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

#include <PndJpsi2PiAna.h>

Inheritance diagram for PndJpsi2PiAna:
PndAnaTask

Public Member Functions

 PndJpsi2PiAna ()
 
 ~PndJpsi2PiAna ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *opt)
 
virtual void Finish ()
 

Protected Member Functions

void InitArrays ()
 
int GetEvent ()
 
bool FillList (RhoCandList &l, std::string listkey="All")
 

Protected Attributes

RhoMassParticleSelectorjpsiMSel
 
TH1F * jpsimass
 
TH1F * jpsimassf
 
TH1F * ppmass
 
TH1F * ppmassf
 
TH1F * mcmass
 

Private Member Functions

 ClassDef (PndJpsi2PiAna, 1)
 

Private Attributes

UInt_t fEvtCount
 

Detailed Description

Definition at line 13 of file PndJpsi2PiAna.h.

Constructor & Destructor Documentation

PndJpsi2PiAna::PndJpsi2PiAna ( )

Default constructor

Definition at line 34 of file PndJpsi2PiAna.cxx.

34  : PndAnaTask()
35 {
36 
37 }
PndJpsi2PiAna::~PndJpsi2PiAna ( )

Destructor

Definition at line 41 of file PndJpsi2PiAna.cxx.

42 {
43 }

Member Function Documentation

PndJpsi2PiAna::ClassDef ( PndJpsi2PiAna  ,
 
)
private
void PndJpsi2PiAna::Exec ( Option_t *  opt)
virtual

Virtual method Exec

Reimplemented from PndAnaTask.

Definition at line 71 of file PndJpsi2PiAna.cxx.

References RhoCandList::Combine(), fEvtCount, PndAnaTask::FillList(), Rho4CFitter::FitConserveMasses(), PndAnaTask::GetEvent(), RhoCandList::GetLength(), i, jpsimass, jpsimassf, RhoCandidate::M(), mcmass, RhoCandidate::P4(), ppmass, and ppmassf.

72 {
73  if (0==(++fEvtCount)%100) cout <<"evt "<<fEvtCount<<endl;
74 
75  int i,j;
76 
77  GetEvent();
78 
79  RhoCandList ep, em, pip, pim, jpsi, pp, mc;
80 
81  FillList(ep,"ElectronVeryLoosePlus");
82  FillList(em,"ElectronVeryLooseMinus");
83  FillList(pip,"PionVeryLoosePlus");
84  FillList(pim,"PionVeryLooseMinus");
85 
86  FillList(mc,"McTruth");
87 
88  TLorentzVector ini(0, 0, 6.231711, 7.240222);
89 
90 /* cout<<" e+:" <<ep.GetLength();
91  cout<<" e-:" <<em.GetLength();
92  cout<<" pi+:" <<pip.GetLength();
93  cout<<" pi-:" <<pim.GetLength();
94  cout <<endl;*/
95 
96  jpsi.Combine(ep,em);
97 
98 /* cout <<jpsi.GetLength();*/
99 
100  for (j=0;j<jpsi.GetLength();++j) jpsimass->Fill(jpsi[j]->M());
101  //jpsi.Select(jpsiMSel);
102 
103  for (j=0;j<mc.GetLength();++j) mcmass->Fill(mc[j]->M());
104 
105  pp.Combine(jpsi,pip,pim);
106 
107  for (j=0;j<pp.GetLength();++j)
108  {
109  ppmass->Fill(pp[j]->M());
110 
111  //do the 4C fit on the pbar p System
112  Rho4CFitter fitter(pp[j],ini);
113 
114  fitter.FitConserveMasses();
115 
116  RhoCandidate *ppfit=pp[j]->GetFit();
117  ppmassf->Fill(ppfit->M());
118 
119  RhoCandidate *epfit=(pp[j]->Daughter(0)->Daughter(0))->GetFit();
120  RhoCandidate *emfit=(pp[j]->Daughter(0)->Daughter(1))->GetFit();
121 
122  TLorentzVector sum=epfit->P4()+emfit->P4();
123 
124  jpsimassf->Fill(sum.Mag());
125 
126  }
127 
128 
129 }
Int_t i
Definition: run_full.C:25
Int_t GetLength() const
Definition: RhoCandList.h:46
int GetEvent()
Definition: PndAnaTask.cxx:81
TH1F * jpsimassf
Definition: PndJpsi2PiAna.h:40
void Combine(RhoCandList &l1, RhoCandList &l2)
TLorentzVector P4() const
Definition: RhoCandidate.h:195
Double_t M() const
UInt_t fEvtCount
Definition: PndJpsi2PiAna.h:46
bool FillList(RhoCandList &l, std::string listkey="All")
Definition: PndAnaTask.cxx:93
bool PndAnaTask::FillList ( RhoCandList l,
std::string  listkey = "All" 
)
protectedinherited

Definition at line 93 of file PndAnaTask.cxx.

References RhoCandList::Add(), RhoCandList::Cleanup(), PndAnaTask::fChargedCands, PndAnaTask::fChargedProbability, PndPidListMaker::FillList(), PndAnaTask::fLAllCands, PndAnaTask::fLChargedCands, PndAnaTask::fLNeutralCands, PndAnaTask::fMcCands, PndAnaTask::fNeutralCands, PndAnaTask::fNeutralProbability, PndAnaTask::fPidListMaker, PndPidProbability::GetElectronPidProb(), GetEntriesFast(), PndPidProbability::GetKaonPidProb(), RhoCandList::GetLength(), PndPidProbability::GetMuonPidProb(), PndPidProbability::GetPionPidProb(), PndPidProbability::GetProtonPidProb(), PndPidListMaker::SetBaseList(), RhoCandidate::SetPidInfo(), and uid().

Referenced by Exec().

94 {
95  // Reads the specified List for the current event
96 
97  l.Cleanup();
98  UInt_t uid=1;
99 
100  // when the first list is requested read in the event
101  /*
102  if (!fEventRead)
103  {
104  fRootManager->ReadEvent(fEvtCount-1);
105  fEventRead=true;
106  }
107  */
108 
109  if (listkey=="McTruth") {
110  if (fMcCands) {
111  //cout <<"PndAnaTask::FillList: "<<fMcCands->GetEntriesFast()<<" mc cands"<<endl;
112  for (int i1=0; i1<fMcCands->GetEntriesFast(); i1++) {
113  RhoCandidate* tc = (RhoCandidate*)fMcCands->At(i1);
114  l.Add(tc);
115  }
116  return true;
117  } else { return false; }
118  }
119 
120  // fill all, neutral and charged from the PndPidCandidate Array
121 // if (fMicroCands && allCands.GetLength()==0)
122 // {
123 // for (int i1=0; i1<fMicroCands->GetEntriesFast(); i1++)
124 // {
125 // VAbsMicroCandidate *mic = (VAbsMicroCandidate *)fMicroCands->At(i1);
126 // RhoCandidate tc(*mic,i1+1);
127 //
128 // allCands.Add(tc);
129 //
130 // if (fabs(tc.Charge())>0.01)
131 // chargedCands.Add(tc);
132 // else
133 // neutralCands.Add(tc);
134 // }
135 // }
136  //else
137  if (fLAllCands.GetLength() == 0) { // do only when we didn't read something yet.
138  // removed now compatibility to RhoCandidate readin ... instead read PndPidCandidates
140  for (int i1=0; i1<fNeutralCands->GetEntriesFast(); i1++) {
142  RhoCandidate tc(*mic,uid++);
143 
144  // TODO: Do we want to set something here? It is neutrals anyway.
145  if(0!=fNeutralProbability && i1<fNeutralProbability->GetEntriesFast()) {
147  // numbering see PndPidListMaker
148  tc.SetPidInfo(0,neuProb->GetElectronPidProb());
149  tc.SetPidInfo(1,neuProb->GetMuonPidProb());
150  tc.SetPidInfo(2,neuProb->GetPionPidProb());
151  tc.SetPidInfo(3,neuProb->GetKaonPidProb());
152  tc.SetPidInfo(4,neuProb->GetProtonPidProb());
153  }
154  fLNeutralCands.Add(&tc);
155  fLAllCands.Add(&tc);
156  }
157 
158  if (fChargedCands && fLChargedCands.GetLength()==0) {
159  for (int i1=0; i1<fChargedCands->GetEntriesFast(); i1++) {
161  RhoCandidate tc(*mic,uid++);
162 
163  if(0!=fChargedProbability && i1<fChargedProbability->GetEntriesFast()) {
165  // numbering see PndPidListMaker
166  tc.SetPidInfo(0,chProb->GetElectronPidProb());
167  tc.SetPidInfo(1,chProb->GetMuonPidProb());
168  tc.SetPidInfo(2,chProb->GetPionPidProb());
169  tc.SetPidInfo(3,chProb->GetKaonPidProb());
170  tc.SetPidInfo(4,chProb->GetProtonPidProb());
171  }
172  fLChargedCands.Add(&tc);
173  fLAllCands.Add(&tc);
174  }
175  }
176  }
177 
178 
179  // set the base list for the PID list maker
181 
182  if (listkey=="All" ) {
183  l=fLAllCands;
184  return true;
185  }
186 
187  if (listkey=="Neutral") {
188  l=fLNeutralCands;
189  return true;
190  }
191 
192  if (listkey=="Charged") {
193  l=fLChargedCands;
194  return true;
195  }
196 
197  return fPidListMaker->FillList(l,listkey);
198 }
TClonesArray * fMcCands
Definition: PndAnaTask.h:51
void Add(const RhoCandidate *c)
Definition: RhoCandList.h:49
Double_t GetProtonPidProb(PndPidProbability *flux=NULL) const
void Cleanup()
Definition: RhoCandList.cxx:62
Double_t GetKaonPidProb(PndPidProbability *flux=NULL) const
Int_t GetLength() const
Definition: RhoCandList.h:46
TClonesArray * fChargedProbability
Definition: PndAnaTask.h:49
cout<< "POINTs for new FwEndCap == "<< tsim-> GetEntriesFast()
RhoCandList fLChargedCands
Definition: PndAnaTask.h:54
TClonesArray * fNeutralProbability
Definition: PndAnaTask.h:50
RhoCandList fLNeutralCands
Definition: PndAnaTask.h:55
int uid(int lev, int lrun, int lmode)
Definition: autocutx.C:122
void SetBaseList(RhoCandList &l)
Double_t GetMuonPidProb(PndPidProbability *flux=NULL) const
TClonesArray * fNeutralCands
Definition: PndAnaTask.h:48
PndPidListMaker * fPidListMaker
Definition: PndAnaTask.h:58
TClonesArray * fChargedCands
Definition: PndAnaTask.h:47
bool FillList(RhoCandList &l, std::string listkey="All")
RhoCandList fLAllCands
Definition: PndAnaTask.h:53
Double_t GetElectronPidProb(PndPidProbability *flux=NULL) const
Double_t GetPionPidProb(PndPidProbability *flux=NULL) const
void PndJpsi2PiAna::Finish ( )
virtual

Reimplemented from PndAnaTask.

Definition at line 133 of file PndJpsi2PiAna.cxx.

References jpsimass, jpsimassf, mcmass, ppmass, and ppmassf.

134 {
135  jpsimass->Write();
136  jpsimassf->Write();
137  ppmass->Write();
138  ppmassf->Write();
139  mcmass->Write();
140 }
TH1F * jpsimassf
Definition: PndJpsi2PiAna.h:40
int PndAnaTask::GetEvent ( )
protectedinherited

Definition at line 81 of file PndAnaTask.cxx.

References RhoCandList::Cleanup(), PndAnaTask::fLAllCands, PndAnaTask::fLChargedCands, PndAnaTask::fLMcCands, PndAnaTask::fLNeutralCands, RhoFactory::Instance(), and RhoFactory::Reset().

Referenced by Exec().

82 {
84 
89 
90  return 0;
91 }
void Cleanup()
Definition: RhoCandList.cxx:62
RhoCandList fLMcCands
Definition: PndAnaTask.h:56
static void Reset()
Definition: RhoFactory.cxx:28
RhoCandList fLChargedCands
Definition: PndAnaTask.h:54
RhoCandList fLNeutralCands
Definition: PndAnaTask.h:55
static RhoFactory * Instance()
Definition: RhoFactory.cxx:34
RhoCandList fLAllCands
Definition: PndAnaTask.h:53
InitStatus PndJpsi2PiAna::Init ( )
virtual

Virtual method Init

Reimplemented from PndAnaTask.

Definition at line 47 of file PndJpsi2PiAna.cxx.

References fEvtCount, PndAnaTask::InitArrays(), jpsimass, jpsimassf, jpsiMSel, mcmass, ppmass, and ppmassf.

48 {
49  std::cout << "-I- PndJpsi2PiAna: Initialization" << std::endl;
50 
51  InitArrays();
52 
53 
54  jpsimass=new TH1F("mjpsi","jpsi",200,0,3.5);
55  jpsimassf=new TH1F("mjpsif","jpsi fit",200,0,3.5);
56 
57  ppmass=new TH1F("mpp","mpp",200,0,4.5);
58  ppmassf=new TH1F("mppf","mpp",200,0,4.5);
59 
60  mcmass=new TH1F("mmc","mmc",200,0,4.0);
61 
62  jpsiMSel=new RhoMassParticleSelector("jpsi",3.1,0.2);
63 
64  fEvtCount=0;
65 
66  return kSUCCESS;
67 }
RhoMassParticleSelector * jpsiMSel
Definition: PndJpsi2PiAna.h:36
void InitArrays()
Definition: PndAnaTask.cxx:59
TH1F * jpsimassf
Definition: PndJpsi2PiAna.h:40
UInt_t fEvtCount
Definition: PndJpsi2PiAna.h:46
void PndAnaTask::InitArrays ( )
protectedinherited

Definition at line 59 of file PndAnaTask.cxx.

References PndAnaTask::fChargedCands, PndAnaTask::fChargedProbability, PndAnaTask::fMcCands, PndAnaTask::fNeutralCands, PndAnaTask::fNeutralProbability, and PndAnaTask::fPidListMaker.

Referenced by Init().

60 {
61  std::cout << "-I- PndAnaTask: Initialization" << std::endl;
62 
63  FairRootManager* fRootManager = FairRootManager::Instance();
64 
65  if ( 0 == fRootManager ) {
66  std::cout << "-E- PndAnaTask: No FairRootManager found!" << std::endl;
67  return;
68  }
69 
70  //read
71  fChargedCands = (TClonesArray*) fRootManager->GetObject("PidChargedCand");
72  fNeutralCands = (TClonesArray*) fRootManager->GetObject("PidNeutralCand");
73  fChargedProbability = (TClonesArray*) fRootManager->GetObject("PidChargedProbability");
74  fNeutralProbability = (TClonesArray*) fRootManager->GetObject("PidNeutralProbability");
75  fMcCands = (TClonesArray*) fRootManager->GetObject("PndMcTracks");
76 
78 
79 }
TClonesArray * fMcCands
Definition: PndAnaTask.h:51
TClonesArray * fChargedProbability
Definition: PndAnaTask.h:49
TClonesArray * fNeutralProbability
Definition: PndAnaTask.h:50
TClonesArray * fNeutralCands
Definition: PndAnaTask.h:48
PndPidListMaker * fPidListMaker
Definition: PndAnaTask.h:58
TClonesArray * fChargedCands
Definition: PndAnaTask.h:47

Member Data Documentation

UInt_t PndJpsi2PiAna::fEvtCount
private

Definition at line 46 of file PndJpsi2PiAna.h.

Referenced by Exec(), and Init().

TH1F* PndJpsi2PiAna::jpsimass
protected

book all the histograms

Definition at line 39 of file PndJpsi2PiAna.h.

Referenced by Exec(), Finish(), and Init().

TH1F* PndJpsi2PiAna::jpsimassf
protected

Definition at line 40 of file PndJpsi2PiAna.h.

Referenced by Exec(), Finish(), and Init().

RhoMassParticleSelector* PndJpsi2PiAna::jpsiMSel
protected

Definition at line 36 of file PndJpsi2PiAna.h.

Referenced by Init().

TH1F* PndJpsi2PiAna::mcmass
protected

Definition at line 43 of file PndJpsi2PiAna.h.

Referenced by Exec(), Finish(), and Init().

TH1F* PndJpsi2PiAna::ppmass
protected

Definition at line 41 of file PndJpsi2PiAna.h.

Referenced by Exec(), Finish(), and Init().

TH1F* PndJpsi2PiAna::ppmassf
protected

Definition at line 42 of file PndJpsi2PiAna.h.

Referenced by Exec(), Finish(), and Init().


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