17 _iniunmeasParticles(0),
26 _breco = bReco->
clone( bReco->GetName() + (TString)
"SMEAR" );
28 _lepton = lepton->
clone( lepton->GetName() + (TString)
"SMEAR" );
29 _iniX = X->
clone( X->GetName() + (TString)
"INI" );
30 _X = X->
clone( X->GetName() + (TString)
"SMEAR" );
32 _neutrino = neutrino->
clone( neutrino->GetName() + (TString)
"SMEAR" );
64 std::vector<TAbsFitParticle*> ParVec(0);
84 _Y4S.SetXYZ(0., 0., 0.);
90 Double_t EY4S = TMath::Sqrt(
_Y4S.Mag2() + 10.58*10.58 );
123 <<
"----------------------------------" << std::endl;
124 std::cout <<
"--- PRINTING INITIAL PARTICLES ---" << std::endl;
125 std::cout <<
"----------------------------------" << std::endl ;
135 <<
"-------------------------------------------------" << std::endl;
136 std::cout <<
"INITIAL CONSTRAINTS " << std::endl ;
137 std::cout <<
"-------------------------------------------------" << std::endl;
140 <<
" px: " << pXCons.getCurrentValue()
141 <<
" py: " << pYCons.getCurrentValue()
142 <<
" pz: " << pZCons.getCurrentValue()
143 <<
" E: " << ECons.getCurrentValue() << std::endl << std::endl;
158 for (
int i = 0;
i < nbExperiments;
i++) {
164 <<
"-------------------------------------------------------" << std::endl ;
165 std::cout <<
"--- PRINTING SMEARED PARTICLES BEFORE FIT FOR experiment # " <<
i+1 << std::endl;
166 std::cout <<
"-------------------------------------------------------" << std::endl;
176 <<
"-------------------------------------------------" << std::endl;
177 std::cout <<
"INITIAL (SMEARED) CONSTRAINTS FOR experiment # "<<
i+1 << std::endl ;
178 std::cout <<
"-------------------------------------------------" << std::endl;
180 <<
" px: " << pXCons.getCurrentValue()
181 <<
" py: " << pYCons.getCurrentValue()
182 <<
" pz: " << pZCons.getCurrentValue()
183 <<
" E: " << ECons.getCurrentValue() << std::endl << std::endl;
190 <<
"-------------------------------------------------" << std::endl;
191 std::cout <<
" CONSTRAINTS AFTER FIT FOR experiment # "<<
i+1 << std::endl ;
192 std::cout <<
"-------------------------------------------------" << std::endl;
195 <<
" px: " << pXCons.getCurrentValue()
196 <<
" py: " << pYCons.getCurrentValue()
197 <<
" pz: " << pZCons.getCurrentValue()
198 <<
" E: " << ECons.getCurrentValue() << std::endl << std::endl;
203 <<
"--------------------------------------------------------" << std::endl ;
204 std::cout <<
"--- PRINTING PARTICLES AFTER FIT FOR experiment # "<<
i+1 << std::endl;
205 std::cout <<
"--------------------------------------------------------" << std::endl;
225 std::cout <<
" ------ "<< (Double_t)
i/nbExperiments*100. <<
" % PROCESSED ------";
241 TMatrixD parIni( *(iniParticle->
getParIni()) );
243 for (
int m = 0;
m < iniParticle->
getNPar();
m++) {
244 parIni(
m, 0) += gRandom->Gaus(0., TMath::Sqrt( (*covM)(
m,
m) ) );
246 TLorentzVector* ini4Vec = iniParticle->
calc4Vec( &parIni );
256 TVector3 nuP3 =
_Y4S;
260 TLorentzVector ini4VecNeutrino ;
261 ini4VecNeutrino.SetXYZM( nuP3.X(), nuP3.Y(), nuP3.Z(), 0. );
276 TMatrixD parpull( *parfit );
277 parpull -= (*partrue);
279 for (
int i = 0;
i < parpull.GetNrows();
i++) {
281 ((TH1D*)
_histsDiff1[histindex])->Fill( parpull(
i, 0) );
282 parpull(
i, 0) /= TMath::Sqrt( (*covMatrixFit)(
i,
i) );
283 ((TH1D*)
_histsPull1[histindex])->Fill( parpull(
i, 0) );
284 ((TH1D*)
_histsError1[histindex])->Fill( TMath::Sqrt( (*covMatrixFit)(
i,
i) ) );
303 for (
int i = 0;
i < pull->GetNrows();
i++) {
304 ( (TH1D*)
_histsPull2[histindex])->Fill( (*pull)(
i, 0) );
305 ( (TH1D*)
_histsError2[histindex])->Fill( TMath::Sqrt( (*VDeltaY)(
i,
i) ) );
306 ( (TH1D*)
_histsDiff2[histindex])->Fill( pardiff(
i, 0) );
321 for (
int i = 0;
i < partrue->GetNrows();
i++) {
360 _histStatus =
new TH1D(
"hStatus",
"Status of the Fit", 16, -1, 15);
361 _histNIter =
new TH1D(
"hNIter",
"Number of iterations", 100, 0, 100);
362 _histPChi2 =
new TH1D(
"hPChi2",
"Chi2 probability", 100, 0., 1.);
363 _histChi2 =
new TH1D(
"hChi2",
"Chi2 ", 200, 0., 20.);
364 _histMBrecoTrue =
new TH1D(
"histMBrecoTrue",
"histMBrecoTrue", 2000, 4., 6.);
365 _histMBrecoSmear =
new TH1D(
"histMBrecoSmear",
"histMBrecoSmear", 2000, 4., 6.);
366 _histMBrecoFit =
new TH1D(
"histMBrecoFit",
"histMBrecoFit", 2000, 4., 6.);
367 _histMXTrue =
new TH1D(
"histMXTrue",
"histMXTrue", 600, 0., 6.);
368 _histMXSmear =
new TH1D(
"histMXSmear",
"histMXSmear", 600, 0., 6.);
369 _histMXFit =
new TH1D(
"histMXFit",
"histMXFit", 600, 0., 6.);
370 _histMXlnuTrue =
new TH1D(
"histMXlnuTrue",
"histMXlnuTrue", 3000, 4., 7.);
371 _histMXlnuSmear =
new TH1D(
"histMXlnuSmear",
"histMXlnuSmear", 500, 3., 8.);
372 _histMXlnuFit =
new TH1D(
"histMXlnuFit",
"histMXlnuFit", 3000, 4., 7.);
384 TObjArray histarrays;
396 TString histnames[] = {
"hParTrue",
"hParSmear",
"hParFit",
"hPull1",
"hError1",
"hDiff1",
"hPull2",
"hError2",
"hDiff2" };
398 TArrayD arrmin( histarrays.GetEntries() );
399 TArrayD arrmax( histarrays.GetEntries() );
400 arrmin[0] = 0.; arrmax[0] = 2.;
401 arrmin[1] = 0.; arrmax[1] = 2.;
402 arrmin[2] = 0.; arrmax[2] = 2.;
404 arrmin[3] = -3.; arrmax[3] = 3.;
405 arrmin[4] = 0.; arrmax[4] = .2;
406 arrmin[5] = -.5; arrmax[5] = .5;
407 arrmin[6] = -3.; arrmax[6] = 3.;
408 arrmin[7] = 0.; arrmax[7] = 0.2;
409 arrmin[8] = -.5; arrmax[8] = .5;
416 for (
int i = 0;
i < particle->
getNPar();
i++) {
417 for (
int h = 0;
h < histarrays.GetEntries();
h++ ) {
418 TString
name = histnames[
h] + (TString) particle->GetName();
422 arrmin[
h] = (*parfit)(
i,0)*0.5;
423 arrmax[
h] = (*parfit)(
i,0)*1.5;
425 TH1D* newhisto =
new TH1D( name, name, 100, arrmin[
h], arrmax[h]) ;
426 ((TObjArray*) histarrays[h])->Add( newhisto );
TAbsFitParticle * _iniLepton
void setMaxF(Double_t maxF)
Bool_t _withMassConstraint
void addParticles1(TAbsFitParticle *p1, TAbsFitParticle *p2=0, TAbsFitParticle *p3=0, TAbsFitParticle *p4=0, TAbsFitParticle *p5=0, TAbsFitParticle *p6=0, TAbsFitParticle *p7=0, TAbsFitParticle *p8=0, TAbsFitParticle *p9=0, TAbsFitParticle *p10=0)
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 addParticles2(TAbsFitParticle *p1, TAbsFitParticle *p2=0, TAbsFitParticle *p3=0, TAbsFitParticle *p4=0, TAbsFitParticle *p5=0, TAbsFitParticle *p6=0, TAbsFitParticle *p7=0, TAbsFitParticle *p8=0, TAbsFitParticle *p9=0, TAbsFitParticle *p10=0)
void addMeasParticle(TAbsFitParticle *particle)
Bool_t _doCheckConstraintsTruth
TAbsFitParticle * _neutrino
virtual TAbsFitParticle * clone(TString newname="") const =0
void setVerbosity(Int_t verbosity=1)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
TAbsFitParticle * _iniBreco
const TMatrixD * getParIni()
const TLorentzVector * getCurr4Vec()
TAbsFitParticle * _lepton
virtual const TMatrixD * getCovMatrix() const
void setMaxNbIter(Int_t maxNbIter)
void addParticle1(TAbsFitParticle *particle)
virtual Double_t getCurrentValue()
std::vector< TAbsFitParticle * > _iniunmeasParticles
Bool_t doToyExperiments(Int_t nbExperiments=1000)
Bool_t _printSmearedPartBefore