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

#include <PndAnaTask.h>

Inheritance diagram for PndAnaTask:
PndJpsi2PiAna

Public Member Functions

 PndAnaTask ()
 
 ~PndAnaTask ()
 
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")
 

Private Member Functions

 ClassDef (PndAnaTask, 0)
 

Private Attributes

TClonesArray * fChargedCands
 
TClonesArray * fNeutralCands
 
TClonesArray * fChargedProbability
 
TClonesArray * fNeutralProbability
 
TClonesArray * fMcCands
 
RhoCandList fLAllCands
 
RhoCandList fLChargedCands
 
RhoCandList fLNeutralCands
 
RhoCandList fLMcCands
 
PndPidListMakerfPidListMaker
 
Bool_t fEventRead
 

Detailed Description

Definition at line 20 of file PndAnaTask.h.

Constructor & Destructor Documentation

PndAnaTask::PndAnaTask ( )

Definition at line 33 of file PndAnaTask.cxx.

33  :
34  fPidListMaker(0),
35  fEventRead(kFALSE)
36 //fCurrentEventInfo(0)
37 {
38 }
Bool_t fEventRead
Definition: PndAnaTask.h:59
PndPidListMaker * fPidListMaker
Definition: PndAnaTask.h:58
PndAnaTask::~PndAnaTask ( )

Definition at line 40 of file PndAnaTask.cxx.

References fPidListMaker.

41 {
42  if(0!=fPidListMaker) { delete fPidListMaker; }
43 }
PndPidListMaker * fPidListMaker
Definition: PndAnaTask.h:58

Member Function Documentation

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

Virtual method Exec

Reimplemented in PndJpsi2PiAna.

Definition at line 50 of file PndAnaTask.cxx.

51 {
52 }
bool PndAnaTask::FillList ( RhoCandList l,
std::string  listkey = "All" 
)
protected

Definition at line 93 of file PndAnaTask.cxx.

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

Referenced by PndJpsi2PiAna::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 PndAnaTask::Finish ( )
virtual

Reimplemented in PndJpsi2PiAna.

Definition at line 54 of file PndAnaTask.cxx.

55 {
56 }
int PndAnaTask::GetEvent ( )
protected

Definition at line 81 of file PndAnaTask.cxx.

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

Referenced by PndJpsi2PiAna::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 PndAnaTask::Init ( )
virtual

Virtual method Init

Reimplemented in PndJpsi2PiAna.

Definition at line 45 of file PndAnaTask.cxx.

46 {
47  return kSUCCESS;
48 }
void PndAnaTask::InitArrays ( )
protected

Definition at line 59 of file PndAnaTask.cxx.

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

Referenced by PndJpsi2PiAna::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

TClonesArray* PndAnaTask::fChargedCands
private

Definition at line 47 of file PndAnaTask.h.

Referenced by FillList(), and InitArrays().

TClonesArray* PndAnaTask::fChargedProbability
private

Definition at line 49 of file PndAnaTask.h.

Referenced by FillList(), and InitArrays().

Bool_t PndAnaTask::fEventRead
private

Definition at line 59 of file PndAnaTask.h.

RhoCandList PndAnaTask::fLAllCands
private

Definition at line 53 of file PndAnaTask.h.

Referenced by FillList(), and GetEvent().

RhoCandList PndAnaTask::fLChargedCands
private

Definition at line 54 of file PndAnaTask.h.

Referenced by FillList(), and GetEvent().

RhoCandList PndAnaTask::fLMcCands
private

Definition at line 56 of file PndAnaTask.h.

Referenced by GetEvent().

RhoCandList PndAnaTask::fLNeutralCands
private

Definition at line 55 of file PndAnaTask.h.

Referenced by FillList(), and GetEvent().

TClonesArray* PndAnaTask::fMcCands
private

Definition at line 51 of file PndAnaTask.h.

Referenced by FillList(), and InitArrays().

TClonesArray* PndAnaTask::fNeutralCands
private

Definition at line 48 of file PndAnaTask.h.

Referenced by FillList(), and InitArrays().

TClonesArray* PndAnaTask::fNeutralProbability
private

Definition at line 50 of file PndAnaTask.h.

Referenced by FillList(), and InitArrays().

PndPidListMaker* PndAnaTask::fPidListMaker
private

Definition at line 58 of file PndAnaTask.h.

Referenced by FillList(), InitArrays(), and ~PndAnaTask().


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