FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndTripleAnaTask Class Reference

#include <PndTripleAnaTask.h>

Inheritance diagram for PndTripleAnaTask:

Public Member Functions

 PndTripleAnaTask (double pbarmom, TString outname, int mode, TString pidalg)
 
 ~PndTripleAnaTask ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *opt)
 
virtual void Finish ()
 

Private Member Functions

void SetVerbose (int verb=1)
 
void JpsiAnalysis ()
 
void DsDs2317Analysis ()
 
void ThreePiAnalysis ()
 
virtual void SetParContainers ()
 
 ClassDef (PndTripleAnaTask, 1)
 

Private Attributes

int fEvtCount
 
int fMode
 
int fVerbose
 
TLorentzVector fIni
 
PndAnalysisfAnalysis
 
TDatabasePDG * fPdg
 
TFile * fFile
 
TString fOutName
 
TString fPidAlg
 
PndEventShapefEventShape
 
PndRhoTupleQAfQA
 
RhoTuplentp1
 
RhoTuplentp2
 
RhoTuplentp3
 
RhoTuplentp4
 
RhoTuplenmc
 
RhoMassParticleSelectormSel1
 
RhoMassParticleSelectormSel2
 
RhoMassParticleSelectormSel3
 
RhoMassParticleSelectormSel4
 
RhoEnergyParticleSelectorgamSel
 
TClonesArray * fOnlineFilterInfo
 

Detailed Description

Definition at line 25 of file PndTripleAnaTask.h.

Constructor & Destructor Documentation

PndTripleAnaTask::PndTripleAnaTask ( double  pbarmom,
TString  outname,
int  mode,
TString  pidalg 
)

Definition at line 64 of file PndTripleAnaTask.cxx.

References fIni, mp, and sqrt().

64  :
65  FairTask("Panda Tripple Analysis Task"),
66  fEvtCount(0), fMode(mode), fVerbose(0), fOutName(outname), fPidAlg(pidalg)
67 {
68  double mp=0.938272;
69  fIni.SetXYZT(0,0,pbarmom, sqrt(pbarmom*pbarmom+mp*mp)+mp);
70 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
TLorentzVector fIni
static const double mp
Definition: mzparameters.h:11
Int_t mode
Definition: autocutx.C:47
PndTripleAnaTask::~PndTripleAnaTask ( )

Definition at line 75 of file PndTripleAnaTask.cxx.

References fFile.

76 {
77  delete fFile;
78 }

Member Function Documentation

PndTripleAnaTask::ClassDef ( PndTripleAnaTask  ,
 
)
private
void PndTripleAnaTask::DsDs2317Analysis ( )
private

Definition at line 335 of file PndTripleAnaTask.cxx.

References RhoKinFitter::Add4MomConstraint(), RhoKinFitter::AddMassConstraint(), RhoCandList::Append(), RhoCandList::Cleanup(), RhoTuple::Column(), RhoCandList::Combine(), RhoCandList::CombineAndAppend(), RhoTuple::DumpData(), fAnalysis, fEventShape, fEvtCount, PndAnalysis::FillList(), fIni, RhoKinFitter::Fit(), RhoFitterBase::Fit(), fPidAlg, fQA, fVerbose, gam, gamSel, RhoFitterBase::GetChi2(), RhoCandList::GetLength(), i, PndAnalysis::McTruthMatch(), mSel1, mSel2, mSel3, mSel4, ntp1, ntp2, ntp3, ntp4, RhoCandidate::P4(), PndRhoTupleQA::qaCand(), PndRhoTupleQA::qaComp(), PndRhoTupleQA::qaEventShapeShort(), PndRhoTupleQA::qaP4(), PndRhoTupleQA::qaPi0(), and RhoCandList::Select().

Referenced by Exec().

336 {
337  // *** some variables
338  int i=0,j=0;
339 
340  // *** RhoCandLists for the analysis
341  RhoCandList kp, km, pip, pim, gam, dsp, dsm, ds, pi0, ds0p, ds0m, ds0, ppb;
342 
343  // *** Select with PID info pidalg and ('All'); type and mass are set
344  fAnalysis->FillList(kp, "KaonAllPlus", fPidAlg);
345  fAnalysis->FillList(km, "KaonAllMinus", fPidAlg);
346  fAnalysis->FillList(pip, "PionAllPlus", fPidAlg);
347  fAnalysis->FillList(pim, "PionAllMinus", fPidAlg);
348  fAnalysis->FillList(gam, "Neutral", fPidAlg);
349 
350  gam.Select(gamSel);
351 
352  if (fVerbose) cout <<"kp:"<<kp.GetLength()<<" km:"<<km.GetLength()<<" pip:"<<pip.GetLength()<<" pim:"<<pim.GetLength()<<" g:"<<gam.GetLength()<<endl;
353 
354  dsp.Combine(kp, km, pip, 431);
355  dsm.Combine(km, kp, pim, -431);
356 
357  dsp.Select(mSel1);
358  dsm.Select(mSel1);
359 
360  ds.Cleanup();
361  ds.Append(dsp);
362  ds.Append(dsm);
363 
364  if (fVerbose) cout <<"Ds+:"<<dsp.GetLength()<<" Ds-:"<<dsm.GetLength()<<" Ds:"<<ds.GetLength()<<endl;
365 
366  int ndsmct = fAnalysis->McTruthMatch(ds); // match the whole list to count #matches (should be only 1)
367 
368  // *** write ntuple for the ds reconstruction
369  for (j=0;j<ds.GetLength();++j)
370  {
371  RhoKinVtxFitter vtxfit(ds[j]);
372  //vtxfit.AddMassConstraint(fPdg->GetParticle("D_s+")->Mass());
373  vtxfit.Fit();
374 
375  double chi2 = vtxfit.GetChi2();
376 
377  RhoCandidate *dsfit=ds[j]->GetFit();
378 
379  // some general info about event (actually written for each candidate!)
380  ntp1->Column("ev", (Float_t) fEvtCount);
381  ntp1->Column("cand", (Float_t) j);
382  ntp1->Column("ncand", (Float_t) ds.GetLength());
383  ntp1->Column("nmct", (Float_t) ndsmct);
384 
385  // store info about initial 4-vector
386  fQA->qaP4("beam", fIni, ntp1);
387 
388  // dump information about composite candidate tree recursively (see analysis/AnalysisTools/PndRhoTupleQA)
389  fQA->qaComp("ds", ds[j], ntp1);
390  fQA->qaCand("fds",dsfit, ntp1);
391  ntp1->Column("fchi2", (Float_t) chi2);
392 
393  // dump info about event shapes
395 
396  // *** store the 4-vector of the truth matched candidate (or a dummy, if not matched to keep ntuple consistent)
397  RhoCandidate *truth = ds[j]->GetMcTruth();
398  TLorentzVector lv;
399  if (truth) lv = truth->P4();
400  fQA->qaP4("trds", lv, ntp1);
401 
402  ntp1->DumpData();
403  }
404 
405  // select ds mass
406  dsp.Select(mSel2);
407  dsm.Select(mSel2);
408 
409  pi0.Combine(gam, gam, 111);
410  pi0.Select(mSel3);
411  int npi0mct = fAnalysis->McTruthMatch(pi0);
412 
413  for (j=0;j<pi0.GetLength();++j)
414  {
415  ntp4->Column("ev", (Float_t) fEvtCount);
416  ntp4->Column("cand", (Float_t) j);
417  ntp4->Column("ncand", (Float_t) pi0.GetLength());
418  ntp4->Column("nmct", (Float_t) npi0mct);
419  fQA->qaPi0("pi0",pi0[j],ntp4);
420  ntp4->DumpData();
421  }
422 
423  ds0p.Combine(dsp, pi0, 10431);
424  ds0m.Combine(dsm, pi0, -10431);
425 
426  ds0m.Select(mSel4);
427  ds0p.Select(mSel4);
428 
429  ds0.Cleanup();
430  ds0.Append(ds0p);
431  ds0.Append(ds0m);
432 
433  if (fVerbose) cout <<"Pi0:"<<pi0.GetLength()<<" Ds0+:"<<ds0p.GetLength()<<" Ds0-:"<<ds0m.GetLength()<<" Ds0:"<<ds0.GetLength()<<endl;
434 
435  int nds0mct = fAnalysis->McTruthMatch(ds0); // match the whole list to count #matches (should be only 1)
436 
437  // *** write ntuple for the ds reconstruction
438  for (j=0;j<ds0.GetLength();++j)
439  {
440  RhoKinFitter kinfit(ds0[j]);
441  kinfit.AddMassConstraint(2.3178);
442  kinfit.Fit();
443 
444  double chi2 = kinfit.GetChi2();
445 
446  RhoCandidate *ds0fit=ds0[j]->GetFit();
447 
448  // some general info about event (actually written for each candidate!)
449  ntp2->Column("ev", (Float_t) fEvtCount);
450  ntp2->Column("cand", (Float_t) j);
451  ntp2->Column("ncand", (Float_t) ds0.GetLength());
452  ntp2->Column("nmct", (Float_t) nds0mct);
453 
454  // store info about initial 4-vector
455  fQA->qaP4("beam", fIni, ntp2);
456 
457  // dump information about composite candidate tree recursively (see analysis/AnalysisTools/PndRhoTupleQA)
458  fQA->qaComp("ds0", ds0[j], ntp2);
459  fQA->qaCand("fds0",ds0fit, ntp2);
460  ntp2->Column("fchi2", (Float_t) chi2);
461 
462  // dump info about event shapes
464 
465  // *** store the 4-vector of the truth matched candidate (or a dummy, if not matched to keep ntuple consistent)
466  RhoCandidate *truth = ds0[j]->GetMcTruth();
467  TLorentzVector lv;
468  if (truth) lv = truth->P4();
469  fQA->qaP4("trds0", lv, ntp2);
470 
471  ntp2->DumpData();
472  }
473 
474  ppb.Combine(dsp, ds0m, 88880);
475  ppb.CombineAndAppend(dsm, ds0p, 88880);
476 
477  if (fVerbose) cout <<"ppb:"<<ppb.GetLength()<<endl<<endl;
478 
479  int nppbmct = fAnalysis->McTruthMatch(ppb); // match the whole list to count #matches (should be only 1)
480 
481  // *** write ntuple for the psi(2S) reconstruction
482  for (j=0;j<ppb.GetLength();++j)
483  {
484  RhoKinFitter kinfit(ppb[j]);
485  kinfit.Add4MomConstraint(fIni);
486  kinfit.Fit();
487 
488  double chi2 = kinfit.GetChi2();
489 
490  RhoCandidate *ppbfit=ppb[j]->GetFit();
491 
492  // some general info about event (actually written for each candidate!)
493  ntp3->Column("ev", (Float_t) fEvtCount);
494  ntp3->Column("cand", (Float_t) j);
495  ntp3->Column("ncand", (Float_t) ppb.GetLength());
496  ntp3->Column("nmct", (Float_t) nppbmct);
497 
498  // store info about initial 4-vector
499  fQA->qaP4("beam", fIni, ntp3);
500 
501  // dump information about composite candidate tree recursively (see analysis/AnalysisTools/PndRhoTupleQA)
502  fQA->qaComp("ppb", ppb[j], ntp3);
503  fQA->qaComp("fppb",ppbfit, ntp3);
504  ntp3->Column("fchi2", (Float_t) chi2);
505 
506  // dump info about event shapes
508 
509  // *** store the 4-vector of the truth matched candidate (or a dummy, if not matched to keep ntuple consistent)
510  RhoCandidate *truth = ppb[j]->GetMcTruth();
511  TLorentzVector lv;
512  if (truth) lv = truth->P4();
513  fQA->qaP4("trpsi", lv, ntp3);
514 
515  ntp3->DumpData();
516  }
517 }
void qaPi0(TString pre, RhoCandidate *c, RhoTuple *n)
void qaCand(TString pre, RhoCandidate *cc, RhoTuple *n, bool skip=false)
void Append(const RhoCandidate *c)
Definition: RhoCandList.h:52
RhoMassParticleSelector * mSel3
void Cleanup()
Definition: RhoCandList.cxx:62
PndRhoTupleQA * fQA
Int_t i
Definition: run_full.C:25
RhoEnergyParticleSelector * gamSel
Int_t GetLength() const
Definition: RhoCandList.h:46
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
TLorentzVector fIni
void qaP4(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false)
void CombineAndAppend(RhoCandList &l1, RhoCandList &l2)
void Combine(RhoCandList &l1, RhoCandList &l2)
void qaComp(TString pre, RhoCandidate *c, RhoTuple *n, bool covs=false, bool pulls=false)
void Select(RhoParticleSelectorBase *pidmgr)
TLorentzVector P4() const
Definition: RhoCandidate.h:195
void Column(const char *label, Bool_t value, Bool_t defval=0, const char *block=0)
Definition: RhoTuple.cxx:56
CandList gam
void DumpData()
Definition: RhoTuple.cxx:391
void qaEventShapeShort(TString pre, PndEventShape *evsh, RhoTuple *n)
RhoMassParticleSelector * mSel4
RhoMassParticleSelector * mSel2
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)
PndAnalysis * fAnalysis
RhoMassParticleSelector * mSel1
PndEventShape * fEventShape
void PndTripleAnaTask::Exec ( Option_t *  opt)
virtual

Definition at line 192 of file PndTripleAnaTask.cxx.

References all, RhoTuple::Column(), DsDs2317Analysis(), RhoTuple::DumpData(), fAnalysis, fEventShape, fEvtCount, PndAnalysis::FillList(), fIni, fMode, fOnlineFilterInfo, fQA, PndAnalysis::GetEventInTask(), JpsiAnalysis(), nmc, PndRhoTupleQA::qaMcList(), and ThreePiAnalysis().

193 {
194  // *** necessary to read the next event
196 
197  // *** print event counter
198  if (!(++fEvtCount%100)) cout << "evt "<<fEvtCount<<endl;
199 
200  // *******
201  // ******* PUT ANALYSIS CODE HERE
202  // *******
203 
204  PndOnlineFilterInfo *stInfo = 0;
205  if (fOnlineFilterInfo) stInfo = ( PndOnlineFilterInfo* ) fOnlineFilterInfo->At ( 0 );
206 
207  // prepare event shape object
209  fAnalysis->FillList(all, "All");
210  PndEventShape evtShape(all,fIni,0.01,0.05);
211  fEventShape = &evtShape;
212 
213  // write MC tuple
214  nmc->Column("ev", (Int_t) fEvtCount);
215  fQA->qaMcList(nmc);
216  nmc->DumpData();
217 
218  // execute analysis
219  switch (fMode)
220  {
221  case 0:
222  JpsiAnalysis();
223  break;
224  case 1:
225  DsDs2317Analysis();
226  break;
227  case 2:
228  ThreePiAnalysis();
229  break;
230  }
231 }
PndRhoTupleQA * fQA
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
TLorentzVector fIni
void qaMcList(TString pre, RhoCandList &l, RhoTuple *n, int max=10000)
void GetEventInTask()
void Column(const char *label, Bool_t value, Bool_t defval=0, const char *block=0)
Definition: RhoTuple.cxx:56
TClonesArray * fOnlineFilterInfo
void DumpData()
Definition: RhoTuple.cxx:391
PndAnalysis * fAnalysis
PndEventShape * fEventShape
void PndTripleAnaTask::Finish ( )
virtual

Definition at line 591 of file PndTripleAnaTask.cxx.

References fFile.

592 {
593 
594  // *******
595  // ******* STORE YOUR HISTOS AND TUPLES
596  // *******
597 
598  fFile->Write();
599  fFile->Close();
600 
601 }
InitStatus PndTripleAnaTask::Init ( )
virtual

Definition at line 83 of file PndTripleAnaTask.cxx.

References fAnalysis, fFile, fIni, fMode, fOnlineFilterInfo, fOutName, fPdg, fQA, gamSel, RhoTuple::GetInternalTree(), mSel1, mSel2, mSel3, mSel4, nmc, ntp1, ntp2, ntp3, and ntp4.

84 {
85  // *** initialize PndAnalysis object
86  fAnalysis = new PndAnalysis();
87 
88  // *******
89  // ******* PREPARE/CREATE THE STUFF YOU NEED
90  // *******
91 
92  fPdg = TDatabasePDG::Instance();
93 
94  // *** RhoTuple QA helper
95  // *** QA tool for simple dumping of analysis results in RhoRuple
96  // *** WIKI: https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootAnalysisJuly13#PndRhoTupleQA
97  fQA = new PndRhoTupleQA(fAnalysis,fIni.Pz());
98 
99  // *** Connect to the Online Filter Info
100  fOnlineFilterInfo = ( TClonesArray* ) FairRootManager::Instance()->GetObject ( "OnlineFilterInfo" );
101 
102  // ***
103  // *** Prepare RhoTuple output
104  // ***
105 
106  TDirectory *dir = gDirectory;
107  fFile=new TFile(fOutName,"RECREATE");
108  fFile->cd();
109 
110  // tuple to store mc truth
111  nmc = new RhoTuple("nmc", "mctruth info");
112 
113  double m0_jpsi = fPdg->GetParticle("J/psi")->Mass(); // Get nominal PDG mass of the J/psi
114  double m0_ds = fPdg->GetParticle("D_s+")->Mass(); // Get nominal PDG mass of the Ds
115  double m0_pi0 = fPdg->GetParticle("pi0")->Mass(); // Get nominal PDG mass of the pi0
116 
117  gamSel = new RhoEnergyParticleSelector("gamsel" ,10.+0.1,20.);
118 
119  switch (fMode)
120  {
121  // ***
122  // *** ppb -> J/psi pi+ pi-
123  // ***
124  case 0:
125  // *** Mass selector for the jpsi cands
126  mSel1 = new RhoMassParticleSelector("jpsi" ,m0_jpsi,0.3);
127  mSel2 = new RhoMassParticleSelector("jpsipre",m0_jpsi,1.0);
128 
129  // *** create some ntuples
130  ntp1 = new RhoTuple("ntp1", "jpsi analysis");
131  ntp2 = new RhoTuple("ntp2", "psi(2S) analysis");
132 
133  break;
134 
135  // ***
136  // *** ppb -> Ds+ Ds(2317)- [Ds pi0]
137  // ***
138  case 1:
139  // *** Mass selector for the Ds cands
140  mSel1 = new RhoMassParticleSelector("ds" ,m0_ds,0.2);
141  mSel2 = new RhoMassParticleSelector("dspre",m0_ds,1.0);
142  mSel4 = new RhoMassParticleSelector("ds0", 2.3178,0.3);
143 
144  mSel3 = new RhoMassParticleSelector("pi0",m0_pi0,0.05);
145 
146  // *** create some ntuples
147  ntp1 = new RhoTuple("ntp1", "ds analysis");
148  ntp2 = new RhoTuple("ntp2", "ds2317 analysis");
149  ntp3 = new RhoTuple("ntp3", "ppb analysis");
150  ntp4 = new RhoTuple("ntp4", "pi0 analysis");
151 
152  break;
153 
154  // ***
155  // *** ppb -> pi0 pi0 pi0 (with some resonances)
156  // ***
157  case 2:
158  // *** Mass selector for the pi0 cands
159  mSel1 = new RhoMassParticleSelector("pi0",m0_pi0,0.05);
160 
161  // *** create some ntuples
162  ntp1 = new RhoTuple("ntp1", "pi0 analysis");
163  ntp2 = new RhoTuple("ntp2", "2part analysis");
164  break;
165  }
166 
167  // assign RhoTuples to outfile
168  if (ntp1) ntp1->GetInternalTree()->SetDirectory(gDirectory);
169  if (ntp2) ntp2->GetInternalTree()->SetDirectory(gDirectory);
170  if (ntp3) ntp3->GetInternalTree()->SetDirectory(gDirectory);
171  if (ntp4) ntp4->GetInternalTree()->SetDirectory(gDirectory);
172  if (nmc) nmc->GetInternalTree()->SetDirectory(gDirectory);
173 
174  // *** restore original gDirectory
175  dir->cd();
176 
177  return kSUCCESS;
178 }
RhoMassParticleSelector * mSel3
PndRhoTupleQA * fQA
TDatabasePDG * fPdg
RhoEnergyParticleSelector * gamSel
TLorentzVector fIni
TClonesArray * fOnlineFilterInfo
RhoMassParticleSelector * mSel4
RhoMassParticleSelector * mSel2
TTree * GetInternalTree()
Definition: RhoTuple.h:207
PndAnalysis * fAnalysis
RhoMassParticleSelector * mSel1
void PndTripleAnaTask::JpsiAnalysis ( )
private

Definition at line 233 of file PndTripleAnaTask.cxx.

References RhoKinFitter::Add4MomConstraint(), RhoTuple::Column(), RhoCandList::Combine(), RhoTuple::DumpData(), fAnalysis, fEventShape, fEvtCount, PndAnalysis::FillList(), fIni, RhoKinFitter::Fit(), RhoFitterBase::Fit(), fPidAlg, fQA, RhoFitterBase::GetChi2(), RhoCandList::GetLength(), i, PndAnalysis::McTruthMatch(), mSel1, mSel2, muminus, muplus, ntp1, ntp2, RhoCandidate::P4(), piminus, piplus, PndRhoTupleQA::qaCand(), PndRhoTupleQA::qaComp(), PndRhoTupleQA::qaEventShapeShort(), PndRhoTupleQA::qaP4(), and RhoCandList::Select().

Referenced by Exec().

234 {
235  // *** some variables
236  int i=0,j=0;
237 
238  // *** RhoCandLists for the analysis
239  RhoCandList muplus, muminus, piplus, piminus, jpsi, ppb;
240 
241  // *** Select with PID info pidalg and ('All'); type and mass are set
242  fAnalysis->FillList(muplus, "MuonAllPlus", fPidAlg);
243  fAnalysis->FillList(muminus, "MuonAllMinus", fPidAlg);
244  fAnalysis->FillList(piplus, "PionAllPlus", fPidAlg);
245  fAnalysis->FillList(piminus, "PionAllMinus", fPidAlg);
246 
247  // *** combinatorics for J/psi -> mu+ mu-
248  jpsi.Combine(muplus, muminus, 443);
249  jpsi.Select(mSel2);
250  int njmct = fAnalysis->McTruthMatch(jpsi); // match the whole list to count #matches (should be only 1)
251 
252  // *** write ntuple for the jpsi reconstruction
253  for (j=0;j<jpsi.GetLength();++j)
254  {
255  RhoKinVtxFitter vtxfit(jpsi[j]);
256  //vtxfit.AddMassConstraint(fPdg->GetParticle("J/psi")->Mass());
257  vtxfit.Fit();
258 
259  double chi2 = vtxfit.GetChi2();
260 
261  RhoCandidate *jfit=jpsi[j]->GetFit();
262 
263  // some general info about event (actually written for each candidate!)
264  ntp1->Column("ev", (Float_t) fEvtCount);
265  ntp1->Column("cand", (Float_t) j);
266  ntp1->Column("ncand", (Float_t) jpsi.GetLength());
267  ntp1->Column("nmct", (Float_t) njmct);
268 
269  // store info about initial 4-vector
270  fQA->qaP4("beam", fIni, ntp1);
271 
272  // dump information about composite candidate tree recursively (see analysis/AnalysisTools/PndRhoTupleQA)
273  fQA->qaComp("j", jpsi[j], ntp1);
274  fQA->qaCand("fj",jfit, ntp1);
275  ntp1->Column("fchi2", (Float_t) chi2);
276 
277  // dump info about event shapes
279 
280  // *** store the 4-vector of the truth matched candidate (or a dummy, if not matched to keep ntuple consistent)
281  RhoCandidate *truth = jpsi[j]->GetMcTruth();
282  TLorentzVector lv;
283  if (truth) lv = truth->P4();
284  fQA->qaP4("trj", lv, ntp1);
285 
286  ntp1->DumpData();
287  }
288 
289 
290  // *** some rough mass selection on J/psi
291  jpsi.Select(mSel1);
292 
293  // *** combinatorics for psi(2S) -> J/psi pi+ pi-
294  ppb.Combine(jpsi, piplus, piminus, 88880);
295  int nppbmct = fAnalysis->McTruthMatch(ppb); // match the whole list to count #matches (should be only 1)
296 
297  // *** write ntuple for the psi(2S) reconstruction
298  for (j=0;j<ppb.GetLength();++j)
299  {
300  RhoKinFitter kinfit(ppb[j]);
301  kinfit.Add4MomConstraint(fIni);
302  kinfit.Fit();
303 
304  double chi2 = kinfit.GetChi2();
305 
306  RhoCandidate *ppbfit=ppb[j]->GetFit();
307 
308  // some general info about event (actually written for each candidate!)
309  ntp2->Column("ev", (Float_t) fEvtCount);
310  ntp2->Column("cand", (Float_t) j);
311  ntp2->Column("ncand", (Float_t) ppb.GetLength());
312  ntp2->Column("nmct", (Float_t) nppbmct);
313 
314  // store info about initial 4-vector
315  fQA->qaP4("beam", fIni, ntp2);
316 
317  // dump information about composite candidate tree recursively (see analysis/AnalysisTools/PndRhoTupleQA)
318  fQA->qaComp("ppb", ppb[j], ntp2);
319  fQA->qaComp("fppb",ppbfit, ntp2);
320  ntp2->Column("fchi2", (Float_t) chi2);
321 
322  // dump info about event shapes
324 
325  // *** store the 4-vector of the truth matched candidate (or a dummy, if not matched to keep ntuple consistent)
326  RhoCandidate *truth = ppb[j]->GetMcTruth();
327  TLorentzVector lv;
328  if (truth) lv = truth->P4();
329  fQA->qaP4("trpsi", lv, ntp2);
330 
331  ntp2->DumpData();
332  }
333 }
void qaCand(TString pre, RhoCandidate *cc, RhoTuple *n, bool skip=false)
PndRhoTupleQA * fQA
Int_t i
Definition: run_full.C:25
Int_t GetLength() const
Definition: RhoCandList.h:46
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
CandList piplus
TLorentzVector fIni
void qaP4(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false)
CandList muplus
void Combine(RhoCandList &l1, RhoCandList &l2)
void qaComp(TString pre, RhoCandidate *c, RhoTuple *n, bool covs=false, bool pulls=false)
void Select(RhoParticleSelectorBase *pidmgr)
TLorentzVector P4() const
Definition: RhoCandidate.h:195
void Column(const char *label, Bool_t value, Bool_t defval=0, const char *block=0)
Definition: RhoTuple.cxx:56
void DumpData()
Definition: RhoTuple.cxx:391
void qaEventShapeShort(TString pre, PndEventShape *evsh, RhoTuple *n)
CandList piminus
RhoMassParticleSelector * mSel2
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)
CandList muminus
PndAnalysis * fAnalysis
RhoMassParticleSelector * mSel1
PndEventShape * fEventShape
void PndTripleAnaTask::SetParContainers ( )
privatevirtual

Definition at line 182 of file PndTripleAnaTask.cxx.

References run.

183 {
184  // *** Get run and runtime database
185  FairRun* run = FairRun::Instance();
186  if ( ! run ) Fatal("SetParContainers", "No analysis run");
187 }
Int_t run
Definition: autocutx.C:47
void PndTripleAnaTask::SetVerbose ( int  verb = 1)
inlineprivate

Definition at line 48 of file PndTripleAnaTask.h.

References fVerbose.

48 {fVerbose=verb;}
void PndTripleAnaTask::ThreePiAnalysis ( )
private

Definition at line 519 of file PndTripleAnaTask.cxx.

References RhoKinFitter::Add4MomConstraint(), RhoTuple::Column(), RhoCandList::Combine(), RhoTuple::DumpData(), fAnalysis, fEventShape, fEvtCount, PndAnalysis::FillList(), fIni, RhoKinFitter::Fit(), fPidAlg, fQA, gam, gamSel, RhoFitterBase::GetChi2(), RhoCandList::GetLength(), i, PndAnalysis::McTruthMatch(), mSel1, ntp1, ntp2, RhoCandidate::P4(), PndRhoTupleQA::qaComp(), PndRhoTupleQA::qaEventShapeShort(), PndRhoTupleQA::qaP4(), PndRhoTupleQA::qaPi0(), and RhoCandList::Select().

Referenced by Exec().

520 {
521  // *** some variables
522  int i=0,j=0;
523 
524  // *** RhoCandLists for the analysis
525  RhoCandList gam, pi0, pip, pim, comb1, ppb;
526 
527  fAnalysis->FillList(pip, "PionAllPlus", fPidAlg);
528  fAnalysis->FillList(pim, "PionAllMinus", fPidAlg);
529  fAnalysis->FillList(gam, "Neutral", fPidAlg);
530 
531  gam.Select(gamSel);
532 
533  pi0.Combine(gam, gam, 111);
534  pi0.Select(mSel1);
535 
536  int npi0mct = fAnalysis->McTruthMatch(pi0);
537 
538  for (j=0;j<pi0.GetLength();++j)
539  {
540  ntp1->Column("ev", (Float_t) fEvtCount);
541  ntp1->Column("cand", (Float_t) j);
542  ntp1->Column("ncand", (Float_t) pi0.GetLength());
543  ntp1->Column("nmct", (Float_t) npi0mct);
544  fQA->qaPi0("pi0",pi0[j],ntp1);
545  ntp1->DumpData();
546  }
547 
548  ppb.Combine(pip, pim, pi0, 88880);
549 
550  int nppbmct = fAnalysis->McTruthMatch(ppb); // match the whole list to count #matches (should be only 1)
551 
552  // *** write ntuple for the psi(2S) reconstruction
553  for (j=0;j<ppb.GetLength();++j)
554  {
555  RhoKinFitter kinfit(ppb[j]);
556  kinfit.Add4MomConstraint(fIni);
557  kinfit.Fit();
558 
559  double chi2 = kinfit.GetChi2();
560 
561  RhoCandidate *ppbfit=ppb[j]->GetFit();
562 
563  // some general info about event (actually written for each candidate!)
564  ntp2->Column("ev", (Float_t) fEvtCount);
565  ntp2->Column("cand", (Float_t) j);
566  ntp2->Column("ncand", (Float_t) ppb.GetLength());
567  ntp2->Column("nmct", (Float_t) nppbmct);
568 
569  // store info about initial 4-vector
570  fQA->qaP4("beam", fIni, ntp2);
571 
572  // dump information about composite candidate tree recursively (see analysis/AnalysisTools/PndRhoTupleQA)
573  fQA->qaComp("ppb", ppb[j], ntp2);
574  fQA->qaComp("fppb",ppbfit, ntp2);
575  ntp2->Column("fchi2", (Float_t) chi2);
576 
577  // dump info about event shapes
579 
580  // *** store the 4-vector of the truth matched candidate (or a dummy, if not matched to keep ntuple consistent)
581  RhoCandidate *truth = ppb[j]->GetMcTruth();
582  TLorentzVector lv;
583  if (truth) lv = truth->P4();
584  fQA->qaP4("trpsi", lv, ntp2);
585 
586  ntp2->DumpData();
587  }
588 }
void qaPi0(TString pre, RhoCandidate *c, RhoTuple *n)
PndRhoTupleQA * fQA
Int_t i
Definition: run_full.C:25
RhoEnergyParticleSelector * gamSel
Int_t GetLength() const
Definition: RhoCandList.h:46
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
TLorentzVector fIni
void qaP4(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false)
void Combine(RhoCandList &l1, RhoCandList &l2)
void qaComp(TString pre, RhoCandidate *c, RhoTuple *n, bool covs=false, bool pulls=false)
void Select(RhoParticleSelectorBase *pidmgr)
TLorentzVector P4() const
Definition: RhoCandidate.h:195
void Column(const char *label, Bool_t value, Bool_t defval=0, const char *block=0)
Definition: RhoTuple.cxx:56
CandList gam
void DumpData()
Definition: RhoTuple.cxx:391
void qaEventShapeShort(TString pre, PndEventShape *evsh, RhoTuple *n)
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)
PndAnalysis * fAnalysis
RhoMassParticleSelector * mSel1
PndEventShape * fEventShape

Member Data Documentation

PndAnalysis* PndTripleAnaTask::fAnalysis
private

Definition at line 62 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), Exec(), Init(), JpsiAnalysis(), and ThreePiAnalysis().

PndEventShape* PndTripleAnaTask::fEventShape
private

Definition at line 73 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), Exec(), JpsiAnalysis(), and ThreePiAnalysis().

int PndTripleAnaTask::fEvtCount
private

Definition at line 54 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), Exec(), JpsiAnalysis(), and ThreePiAnalysis().

TFile* PndTripleAnaTask::fFile
private

Definition at line 64 of file PndTripleAnaTask.h.

Referenced by Finish(), Init(), and ~PndTripleAnaTask().

TLorentzVector PndTripleAnaTask::fIni
private
int PndTripleAnaTask::fMode
private

Definition at line 55 of file PndTripleAnaTask.h.

Referenced by Exec(), and Init().

TClonesArray* PndTripleAnaTask::fOnlineFilterInfo
private

Definition at line 89 of file PndTripleAnaTask.h.

Referenced by Exec(), and Init().

TString PndTripleAnaTask::fOutName
private

Definition at line 65 of file PndTripleAnaTask.h.

Referenced by Init().

TDatabasePDG* PndTripleAnaTask::fPdg
private

Definition at line 63 of file PndTripleAnaTask.h.

Referenced by Init().

TString PndTripleAnaTask::fPidAlg
private

Definition at line 66 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), JpsiAnalysis(), and ThreePiAnalysis().

PndRhoTupleQA* PndTripleAnaTask::fQA
private

Definition at line 75 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), Exec(), Init(), JpsiAnalysis(), and ThreePiAnalysis().

int PndTripleAnaTask::fVerbose
private

Definition at line 56 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), and SetVerbose().

RhoEnergyParticleSelector* PndTripleAnaTask::gamSel
private

Definition at line 87 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), Init(), and ThreePiAnalysis().

RhoMassParticleSelector* PndTripleAnaTask::mSel1
private

Definition at line 83 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), Init(), JpsiAnalysis(), and ThreePiAnalysis().

RhoMassParticleSelector* PndTripleAnaTask::mSel2
private

Definition at line 84 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), Init(), and JpsiAnalysis().

RhoMassParticleSelector* PndTripleAnaTask::mSel3
private

Definition at line 85 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), and Init().

RhoMassParticleSelector* PndTripleAnaTask::mSel4
private

Definition at line 86 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), and Init().

RhoTuple* PndTripleAnaTask::nmc
private

Definition at line 81 of file PndTripleAnaTask.h.

Referenced by Exec(), and Init().

RhoTuple* PndTripleAnaTask::ntp1
private

Definition at line 77 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), Init(), JpsiAnalysis(), and ThreePiAnalysis().

RhoTuple* PndTripleAnaTask::ntp2
private

Definition at line 78 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), Init(), JpsiAnalysis(), and ThreePiAnalysis().

RhoTuple* PndTripleAnaTask::ntp3
private

Definition at line 79 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), and Init().

RhoTuple* PndTripleAnaTask::ntp4
private

Definition at line 80 of file PndTripleAnaTask.h.

Referenced by DsDs2317Analysis(), and Init().


The documentation for this class was generated from the following files: