16 : _inimeasParticles(0),
17 _iniunmeasParticles(0),
25 _breco = bReco->
clone(bReco->GetName() + (TString)
"SMEAR");
27 _lepton = lepton->
clone(lepton->GetName() + (TString)
"SMEAR");
28 _iniX = X->
clone(X->GetName() + (TString)
"INI");
29 _X = X->
clone(X->GetName() + (TString)
"SMEAR");
31 _neutrino = neutrino->
clone(neutrino->GetName() + (TString)
"SMEAR");
60 std::vector<TAbsFitParticle*> ParVec(0);
80 _Y4S.SetXYZ(0., 0., 0.);
86 Double_t EY4S = TMath::Sqrt(
_Y4S.Mag2() + 10.58 * 10.58);
93 TFitConstraintM MCons(
"MassConstraint",
"Mass-Constraint",
nullptr,
nullptr, 0);
96 TFitConstraintM MPDGCons(
"MPDGCons",
"MPDGCons",
nullptr,
nullptr, 5.279);
118 std::cout << std::endl <<
"----------------------------------" << std::endl;
119 std::cout <<
"--- PRINTING INITIAL PARTICLES ---" << std::endl;
120 std::cout <<
"----------------------------------" << std::endl;
129 std::cout << std::endl <<
"-------------------------------------------------" << std::endl;
130 std::cout <<
"INITIAL CONSTRAINTS " << std::endl;
131 std::cout <<
"-------------------------------------------------" << std::endl;
133 <<
" px: " << pXCons.getCurrentValue() <<
" py: " << pYCons.getCurrentValue()
134 <<
" pz: " << pZCons.getCurrentValue() <<
" E: " << ECons.getCurrentValue() << std::endl
150 for (
int i = 0;
i < nbExperiments;
i++) {
154 std::cout << std::endl <<
"-------------------------------------------------------" << std::endl;
155 std::cout <<
"--- PRINTING SMEARED PARTICLES BEFORE FIT FOR experiment # " <<
i + 1 << std::endl;
156 std::cout <<
"-------------------------------------------------------" << std::endl;
164 std::cout << std::endl <<
"-------------------------------------------------" << std::endl;
165 std::cout <<
"INITIAL (SMEARED) CONSTRAINTS FOR experiment # " <<
i + 1 << std::endl;
166 std::cout <<
"-------------------------------------------------" << std::endl;
168 <<
" py: " << pYCons.getCurrentValue() <<
" pz: " << pZCons.getCurrentValue()
169 <<
" E: " << ECons.getCurrentValue() << std::endl
176 std::cout << std::endl <<
"-------------------------------------------------" << std::endl;
177 std::cout <<
" CONSTRAINTS AFTER FIT FOR experiment # " <<
i + 1 << std::endl;
178 std::cout <<
"-------------------------------------------------" << std::endl;
180 <<
" px: " << pXCons.getCurrentValue() <<
" py: " << pYCons.getCurrentValue()
181 <<
" pz: " << pZCons.getCurrentValue() <<
" E: " << ECons.getCurrentValue() << std::endl
186 std::cout << std::endl <<
"--------------------------------------------------------" << std::endl;
187 std::cout <<
"--- PRINTING PARTICLES AFTER FIT FOR experiment # " <<
i + 1 << std::endl;
188 std::cout <<
"--------------------------------------------------------" << std::endl;
208 std::cout <<
" ------ " << (Double_t)
i / nbExperiments * 100. <<
" % PROCESSED ------";
222 TMatrixD parIni(*(iniParticle->
getParIni()));
224 for (
int m = 0;
m < iniParticle->
getNPar();
m++) {
225 parIni(
m, 0) += gRandom->Gaus(0., TMath::Sqrt((*covM)(
m,
m)));
227 TLorentzVector* ini4Vec = iniParticle->
calc4Vec(&parIni);
237 TVector3 nuP3 =
_Y4S;
241 TLorentzVector ini4VecNeutrino;
242 ini4VecNeutrino.SetXYZM(nuP3.X(), nuP3.Y(), nuP3.Z(), 0.);
254 TMatrixD parpull(*parfit);
255 parpull -= (*partrue);
257 for (
int i = 0;
i < parpull.GetNrows();
i++) {
259 parpull(
i, 0) /= TMath::Sqrt((*covMatrixFit)(
i,
i));
261 ((TH1D*)
_histsError1[histindex])->Fill(TMath::Sqrt((*covMatrixFit)(
i,
i)));
275 for (
int i = 0;
i < pull->GetNrows();
i++) {
277 ((TH1D*)
_histsError2[histindex])->Fill(TMath::Sqrt((*VDeltaY)(
i,
i)));
290 for (
int i = 0;
i < partrue->GetNrows();
i++) {
325 _histStatus =
new TH1D(
"hStatus",
"Status of the Fit", 16, -1, 15);
326 _histNIter =
new TH1D(
"hNIter",
"Number of iterations", 100, 0, 100);
327 _histPChi2 =
new TH1D(
"hPChi2",
"Chi2 probability", 100, 0., 1.);
328 _histChi2 =
new TH1D(
"hChi2",
"Chi2 ", 200, 0., 20.);
329 _histMBrecoTrue =
new TH1D(
"histMBrecoTrue",
"histMBrecoTrue", 2000, 4., 6.);
330 _histMBrecoSmear =
new TH1D(
"histMBrecoSmear",
"histMBrecoSmear", 2000, 4., 6.);
331 _histMBrecoFit =
new TH1D(
"histMBrecoFit",
"histMBrecoFit", 2000, 4., 6.);
332 _histMXTrue =
new TH1D(
"histMXTrue",
"histMXTrue", 600, 0., 6.);
333 _histMXSmear =
new TH1D(
"histMXSmear",
"histMXSmear", 600, 0., 6.);
334 _histMXFit =
new TH1D(
"histMXFit",
"histMXFit", 600, 0., 6.);
335 _histMXlnuTrue =
new TH1D(
"histMXlnuTrue",
"histMXlnuTrue", 3000, 4., 7.);
336 _histMXlnuSmear =
new TH1D(
"histMXlnuSmear",
"histMXlnuSmear", 500, 3., 8.);
337 _histMXlnuFit =
new TH1D(
"histMXlnuFit",
"histMXlnuFit", 3000, 4., 7.);
349 TObjArray histarrays;
360 TString histnames[] = {
361 "hParTrue",
"hParSmear",
"hParFit",
"hPull1",
"hError1",
"hDiff1",
"hPull2",
"hError2",
"hDiff2"};
363 TArrayD arrmin(histarrays.GetEntries());
364 TArrayD arrmax(histarrays.GetEntries());
389 for (
int i = 0;
i < particle->
getNPar();
i++) {
390 for (
int h = 0;
h < histarrays.GetEntries();
h++) {
391 TString
name = histnames[
h] + (TString)particle->GetName();
395 arrmin[
h] = (*parfit)(
i, 0) * 0.5;
396 arrmax[
h] = (*parfit)(
i, 0) * 1.5;
398 TH1D* newhisto =
new TH1D(name, name, 100, arrmin[
h], arrmax[h]);
399 ((TObjArray*)histarrays[h])->Add(newhisto);
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TAbsFitParticle * _iniLepton
void setMaxF(Double_t maxF)
Bool_t _withMassConstraint
Double_t getCurrentValue() override
void setMaxDeltaS(Double_t maxDeltaS)
virtual void setIni4Vec(const TLorentzVector *pini)=0
TSLToyGen(const TAbsFitParticle *bReco, const TAbsFitParticle *lepton, const TAbsFitParticle *X, const TAbsFitParticle *neutrino)
const TLorentzVector * getIni4Vec()
virtual TLorentzVector * calc4Vec(const TMatrixD *params)=0
std::vector< TAbsFitParticle * > _inimeasParticles
std::vector< TAbsFitParticle * > _measParticles
void addConstraint(TAbsFitConstraint *constraint)
TAbsFitParticle * _iniNeutrino
void addUnmeasParticle(TAbsFitParticle *particle)
void addMeasParticle(TAbsFitParticle *particle)
Bool_t _doCheckConstraintsTruth
TAbsFitParticle * _neutrino
void setVerbosity(Int_t verbosity=1)
TAbsFitParticle * _iniBreco
void addParticles2(TAbsFitParticle *p1, TAbsFitParticle *p2=nullptr, TAbsFitParticle *p3=nullptr, TAbsFitParticle *p4=nullptr, TAbsFitParticle *p5=nullptr, TAbsFitParticle *p6=nullptr, TAbsFitParticle *p7=nullptr, TAbsFitParticle *p8=nullptr, TAbsFitParticle *p9=nullptr, TAbsFitParticle *p10=nullptr)
virtual TAbsFitParticle * clone(const TString &newname="") const =0
void addParticles1(TAbsFitParticle *p1, TAbsFitParticle *p2=nullptr, TAbsFitParticle *p3=nullptr, TAbsFitParticle *p4=nullptr, TAbsFitParticle *p5=nullptr, TAbsFitParticle *p6=nullptr, TAbsFitParticle *p7=nullptr, TAbsFitParticle *p8=nullptr, TAbsFitParticle *p9=nullptr, TAbsFitParticle *p10=nullptr)
const TMatrixD * getParIni()
const TLorentzVector * getCurr4Vec()
TAbsFitParticle * _lepton
virtual const TMatrixD * getCovMatrix() const
void setMaxNbIter(Int_t maxNbIter)
void addParticle1(TAbsFitParticle *particle)
std::vector< TAbsFitParticle * > _iniunmeasParticles
Bool_t doToyExperiments(Int_t nbExperiments=1000)
Bool_t _printSmearedPartBefore