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

#include <PndPidListMaker.h>

Public Member Functions

 PndPidListMaker ()
 
 PndPidListMaker (RhoCandList &l)
 
virtual ~PndPidListMaker ()
 
void SetBaseList (RhoCandList &l)
 
bool FillList (RhoCandList &l, std::string listkey="All")
 

Private Member Functions

void Init ()
 
 ClassDef (PndPidListMaker, 1)
 

Private Attributes

RhoCandList fBaseList
 
RhoPlusParticleSelectorplusSel
 
RhoMinusParticleSelectorminusSel
 
RhoSimpleElectronSelectoreSel
 
RhoSimpleMuonSelectormuSel
 
RhoSimplePionSelectorpiSel
 
RhoSimpleKaonSelectorkSel
 
RhoSimpleProtonSelectorpSel
 
std::vector< std::string > fListNames
 

Detailed Description

Definition at line 17 of file PndPidListMaker.h.

Constructor & Destructor Documentation

PndPidListMaker::PndPidListMaker ( )

Definition at line 9 of file PndPidListMaker.cxx.

References Init().

10 {
11  Init();
12 }
PndPidListMaker::PndPidListMaker ( RhoCandList l)

Definition at line 14 of file PndPidListMaker.cxx.

References Init(), and SetBaseList().

15 {
16  SetBaseList(l);
17  Init();
18 }
void SetBaseList(RhoCandList &l)
PndPidListMaker::~PndPidListMaker ( )
virtual

Definition at line 20 of file PndPidListMaker.cxx.

References RhoCandList::Cleanup(), and fBaseList.

21 {
23 }
void Cleanup()
Definition: RhoCandList.cxx:62
RhoCandList fBaseList

Member Function Documentation

PndPidListMaker::ClassDef ( PndPidListMaker  ,
 
)
private
bool PndPidListMaker::FillList ( RhoCandList l,
std::string  listkey = "All" 
)

Definition at line 72 of file PndPidListMaker.cxx.

References all, best, RhoCandList::Cleanup(), eSel, fBaseList, fListNames, i, kSel, loose, minusSel, muSel, n, piSel, plusSel, pSel, RhoCandList::Select(), RhoParticleSelectorBase::SetCriterion(), tight, veryLoose, and veryTight.

Referenced by PndAnaTask::FillList().

73 {
74  //RhoCandidate *tc;
75  l.Cleanup();
76 
77  if (listkey=="Charged") {
78  l=fBaseList;
79  return true;
80  }
81 
82  if (listkey=="Plus") {
84  return true;
85  }
86 
87  if (listkey=="Minus") {
89  return true;
90  }
91 
92  bool listExists=false;
93  int i=0, n=fListNames.size();
94 
95  while (i<n && !listExists) { listExists=(listkey==fListNames[i++]); }
96 
97  if (!listExists) { return false; }
98 
99  --i;
100 
101  //int ptype=i/12; // particle type: 0=electron, ..., 4=proton
102  //int ctype=(i%12)/3; // criterion: 0=veryLoose,..., 3=veryTight
103  //int select_chrg=(i%3); // select charge: 0=all, 1=plus, 2=minus
104 
105  int ptype=i/18; // particle type: 0=electron, ..., 4=proton
106  int ctype=(i%18)/3; // criterion: 0=veryLoose,..., 3=veryTight, 4=Best, 5=all
107  int select_chrg=(i%3); // select charge: 0=all, 1=plus, 2=minus
108 
109  RhoParticleSelectorBase* pidSel=NULL;
110 
111  if (select_chrg==1) {
113  } else if (select_chrg==2) {
115  }
116 
117  switch (ptype) {
118  case 0:
119  pidSel = eSel;
120  break;
121  case 1:
122  pidSel = muSel;
123  break;
124  case 2:
125  pidSel = piSel;
126  break;
127  case 3:
128  pidSel = kSel;
129  break;
130  case 4:
131  pidSel = pSel;
132  break;
133  }
134  if (NULL==pidSel) { return false; }
135 
136  switch (ctype) {
137  case 0:
138  pidSel->SetCriterion(veryLoose);
139  break;
140  case 1:
141  pidSel->SetCriterion(loose);
142  break;
143  case 2:
144  pidSel->SetCriterion(tight);
145  break;
146  case 3:
147  pidSel->SetCriterion(veryTight);
148  break;
149  case 4:
150  pidSel->SetCriterion(best);
151  break; //
152  case 5:
153  pidSel->SetCriterion(all);
154  break; //
155  }
156 
157  if (select_chrg>0) {
158  l.Select(pidSel);
159  } else {
160  l.Select(fBaseList,pidSel);
161  }
162 
163  return true;
164 }
void Cleanup()
Definition: RhoCandList.cxx:62
Int_t i
Definition: run_full.C:25
RhoMinusParticleSelector * minusSel
int n
RhoSimplePionSelector * piSel
RhoPlusParticleSelector * plusSel
void Select(RhoParticleSelectorBase *pidmgr)
RhoCandList fBaseList
virtual void SetCriterion(const char *crit)
RhoSimpleProtonSelector * pSel
RhoSimpleKaonSelector * kSel
RhoSimpleMuonSelector * muSel
std::vector< std::string > fListNames
RhoSimpleElectronSelector * eSel
void PndPidListMaker::Init ( )
private

Definition at line 25 of file PndPidListMaker.cxx.

References eSel, fListNames, i, kSel, minusSel, muSel, piSel, plusSel, and pSel.

Referenced by PndPidListMaker().

26 {
27  // init the selectors;
30 
31  // **** pid selectors for generic list creation
32  //
38 
39  // initialize Known Names
40  std::vector<std::string> pNames;
41  std::vector<std::string> critNames;
42 
43  pNames.push_back("Electron");
44  pNames.push_back("Muon");
45  pNames.push_back("Pion");
46  pNames.push_back("Kaon");
47  pNames.push_back("Proton");
48 
49  critNames.push_back("VeryLoose");
50  critNames.push_back("Loose");
51  critNames.push_back("Tight");
52  critNames.push_back("VeryTight");
53  critNames.push_back("Best"); //
54  critNames.push_back("All"); //
55 
56  fListNames.clear();
57 
58  for (unsigned int i=0; i<pNames.size(); i++) {
59  for (unsigned int j=0; j<critNames.size(); j++) {
60  fListNames.push_back(pNames[i]+critNames[j]);
61  fListNames.push_back(pNames[i]+critNames[j]+"Plus");
62  fListNames.push_back(pNames[i]+critNames[j]+"Minus");
63  }
64  }
65 }
Int_t i
Definition: run_full.C:25
RhoMinusParticleSelector * minusSel
RhoSimplePionSelector * piSel
RhoPlusParticleSelector * plusSel
RhoSimpleProtonSelector * pSel
RhoSimpleKaonSelector * kSel
RhoSimpleMuonSelector * muSel
std::vector< std::string > fListNames
RhoSimpleElectronSelector * eSel
void PndPidListMaker::SetBaseList ( RhoCandList l)

Definition at line 67 of file PndPidListMaker.cxx.

References fBaseList.

Referenced by PndAnaTask::FillList(), and PndPidListMaker().

68 {
69  fBaseList=l;
70 }
RhoCandList fBaseList

Member Data Documentation

RhoSimpleElectronSelector* PndPidListMaker::eSel
private

Definition at line 39 of file PndPidListMaker.h.

Referenced by FillList(), and Init().

RhoCandList PndPidListMaker::fBaseList
private

Definition at line 32 of file PndPidListMaker.h.

Referenced by FillList(), SetBaseList(), and ~PndPidListMaker().

std::vector<std::string> PndPidListMaker::fListNames
private

Definition at line 45 of file PndPidListMaker.h.

Referenced by FillList(), and Init().

RhoSimpleKaonSelector* PndPidListMaker::kSel
private

Definition at line 42 of file PndPidListMaker.h.

Referenced by FillList(), and Init().

RhoMinusParticleSelector* PndPidListMaker::minusSel
private

Definition at line 37 of file PndPidListMaker.h.

Referenced by FillList(), and Init().

RhoSimpleMuonSelector* PndPidListMaker::muSel
private

Definition at line 40 of file PndPidListMaker.h.

Referenced by FillList(), and Init().

RhoSimplePionSelector* PndPidListMaker::piSel
private

Definition at line 41 of file PndPidListMaker.h.

Referenced by FillList(), and Init().

RhoPlusParticleSelector* PndPidListMaker::plusSel
private

Definition at line 36 of file PndPidListMaker.h.

Referenced by FillList(), and Init().

RhoSimpleProtonSelector* PndPidListMaker::pSel
private

Definition at line 43 of file PndPidListMaker.h.

Referenced by FillList(), and Init().


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