FairRoot/PandaRoot
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PndGoodTrackSelector Class Referenceabstract

#include <PndGoodTrackSelector.h>

Inheritance diagram for PndGoodTrackSelector:
RhoGoodTrackSelector RhoParticleSelectorBase

Public Member Functions

virtual Bool_t Accept (PndPidCandidate &)
 
void SetCriterion (const char *crit)
 
void SetMvdHits (Int_t min, Int_t max=65535)
 
void SetSttHits (Int_t min, Int_t max=65535)
 
void SetGemHits (Int_t min, Int_t max=65535)
 
void SetFtsHits (Int_t min, Int_t max=65535)
 
void SetShowerEnergy (Double_t min, Double_t max=1.E8)
 
 ClassDef (PndGoodTrackSelector, 1)
 
virtual void PrintOn (std::ostream &o=std::cout) const
 
void SetMomentumCut (Double_t pmin, Double_t pmax=1.E8)
 
void SetPtCut (Double_t ptmin, Double_t ptmax=1.E8)
 
void SetFitCut (Double_t chi=1e9, Double_t chipm=0.0)
 
void SetPrimaryVertexCut (Double_t d, Double_t zmin, Double_t zmax)
 
void SetCriterion (criterion crit)
 
virtual Bool_t Accept (RhoCandidate *)=0
 
virtual Bool_t Accept (PndPidCandidate *)=0
 
void Select (RhoCandList &l)
 
void Select (RhoCandList &in, RhoCandList &out)
 

Public Attributes

Int_t fMvdHitsMin
 
Int_t fMvdHitsMax
 
Int_t fSttHitsMin
 
Int_t fSttHitsMax
 
Int_t fGemHitsMin
 
Int_t fGemHitsMax
 
Int_t fFtsHitsMin
 
Int_t fFtsHitsMax
 
Double_t fEmcMin
 
Double_t fEmcMax
 

Protected Member Functions

virtual Bool_t Accept (RhoCandidate &b)
 
TParticlePDG * CPConjugate (TParticlePDG *aPart)
 
void SetTypeAndMass (RhoCandidate *b)
 

Protected Attributes

TParticlePDG * fTypePlus
 
TParticlePDG * fTypeMinus
 Particle type to accept. More...
 
criterion fCriterion
 Particle type to accept. More...
 

Detailed Description

Definition at line 7 of file PndGoodTrackSelector.h.

Member Function Documentation

Bool_t PndGoodTrackSelector::Accept ( PndPidCandidate frecoc)
virtual

Reimplemented from RhoGoodTrackSelector.

Definition at line 55 of file PndGoodTrackSelector.cxx.

References RhoGoodTrackSelector::Accept(), Bool_t, fEmcMax, fEmcMin, fMvdHitsMax, fMvdHitsMin, fSttHitsMax, fSttHitsMin, PndPidCandidate::GetEmcCalEnergy(), PndPidCandidate::GetMvdHits(), and PndPidCandidate::GetSttHits().

56 {
58  if (rc==kFALSE) { return kFALSE; }
59  PndPidCandidate* recocand = dynamic_cast<PndPidCandidate*> (&frecoc); //make use of full panda functionality
60 
61  if (recocand->GetMvdHits() < fMvdHitsMin) { return kFALSE; }
62  if (recocand->GetMvdHits() > fMvdHitsMax) { return kFALSE; }
63  if (recocand->GetSttHits() < fSttHitsMin) { return kFALSE; }
64  if (recocand->GetSttHits() > fSttHitsMax) { return kFALSE; }
65  //if(recocand->Get() < fGemHitsMin) return kFALSE;
66  //if(recocand->Get() > fGemHitsMax) return kFALSE;
67  //if(recocand->Get() < fFtsHitsMin) return kFALSE;
68  //if(recocand->Get() > fFtsHitsMax) return kFALSE;
69  if (recocand->GetEmcCalEnergy() < fEmcMin) { return kFALSE; }
70  if (recocand->GetEmcCalEnergy() > fEmcMax) { return kFALSE; }
71  return kTRUE;
72 }
Float_t GetEmcCalEnergy() const
virtual Bool_t Accept(RhoCandidate &b)
Int_t GetSttHits() const
Int_t GetMvdHits() const
virtual Bool_t RhoParticleSelectorBase::Accept ( RhoCandidate )
pure virtualinherited
virtual Bool_t RhoParticleSelectorBase::Accept ( PndPidCandidate )
pure virtualinherited
Bool_t RhoGoodTrackSelector::Accept ( RhoCandidate b)
protectedvirtualinherited

Definition at line 44 of file RhoGoodTrackSelector.cxx.

References RhoCandidate::GetRecoCandidate().

Referenced by Accept().

45 {
46  // The GoodTrackSelector does a selection based on the
47  // quality of a reconstructed charged track
48 
49  if ( &b == 0 ) { return kFALSE; }
50  if ( !Accept ( *(b.GetRecoCandidate()) ) ) { return kFALSE; }
51  //SetTypeAndMass ( b );
52 
53  return kTRUE;
54 }
PndPidCandidate * GetRecoCandidate() const
Definition: RhoCandidate.h:376
virtual Bool_t Accept(RhoCandidate &b)
PndGoodTrackSelector::ClassDef ( PndGoodTrackSelector  ,
 
)
TParticlePDG * RhoParticleSelectorBase::CPConjugate ( TParticlePDG *  aPart)
protectedinherited

Definition at line 129 of file RhoParticleSelectorBase.cxx.

References name, and TString.

Referenced by RhoParticleSelectorBase::RhoParticleSelectorBase(), and PndAnaPidSelector::SetSelection().

130 {
131  // TDatabasePDG *pdt = TDatabasePDG::Instance();
132  TDatabasePDG* pdt = TDatabasePDG::Instance();
133  Int_t theCode = thePart->PdgCode();
134  TString name = thePart->GetName();
135 
136  // Is it a charged particle ?
137  if ( name.Index ( "-" ) >0 || name.Index ( "+" ) >0 || abs ( theCode ) ==2212 ) { theCode = -theCode; }
138 
139  return pdt->GetParticle ( theCode );
140 }
TString name
void RhoGoodTrackSelector::PrintOn ( std::ostream o = std::cout) const
virtualinherited

Definition at line 100 of file RhoGoodTrackSelector.cxx.

References RhoGoodTrackSelector::fChisqMax, RhoGoodTrackSelector::fChisqProbMin, RhoGoodTrackSelector::fDocaMax, RhoGoodTrackSelector::fPMax, RhoGoodTrackSelector::fPMin, RhoGoodTrackSelector::fPtMax, RhoGoodTrackSelector::fPtMin, RhoGoodTrackSelector::fZMax, and RhoGoodTrackSelector::fZMin.

Referenced by operator<<().

101 {
102  o << GetName() << endl;
103 // if ( fNHitsMin > 0 ) { o << "Number of Hits = " << fNHitsMin << " ... " << fNHitsMax << endl; }
104  if ( fPMin > 0 ) { o << "Momentum range = " << fPMin << " ... " << fPMax << " GeV" << endl; }
105  if ( fPtMin > 0 ) { o << "Momentum range (Pt) = " << fPtMin << " ... " << fPtMax << " GeV" << endl; }
106  if ( fChisqProbMin > 0 ) { o << "Fit probability/chi2 = " << fChisqProbMin << '/' << fChisqMax << endl; }
107  if ( fZMin>-1.E8 || fZMax < 1.E8 ) { o << "z position = " << fZMin << " ... " << fZMax << endl; }
108  if ( fDocaMax < 1.E8 ) { o << "doca = " << fDocaMax << endl; }
109  o << endl;
110 }
void RhoParticleSelectorBase::Select ( RhoCandList l)
inherited

Definition at line 94 of file RhoParticleSelectorBase.cxx.

References RhoCandList::Select().

95 {
96  l.Select(this);
97  // RhoCandList tmp ( l );
98  // Select ( tmp,l );
99 }
void Select(RhoParticleSelectorBase *pidmgr)
void RhoParticleSelectorBase::Select ( RhoCandList in,
RhoCandList out 
)
inherited

Definition at line 101 of file RhoParticleSelectorBase.cxx.

References RhoParticleSelectorBase::Accept(), c, RhoCandList::Cleanup(), RhoCandList::GetLength(), i, n, and RhoCandList::Put().

102 {
103  out.Cleanup();
104  Int_t n = in.GetLength();
105  for ( Int_t i=0; i<n; i++ ) {
106  RhoCandidate* c = in[i];
107 
108  if ( Accept ( c ) ) {
109  //printf("selector \"%s\" accepted i=%i\n",fName.Data(),i);
110  out.Put ( c );
111  } //else printf("selector \"%s\" rejected i=%i\n",fName.Data(),i);
112  }
113 }
void Cleanup()
Definition: RhoCandList.cxx:62
Int_t i
Definition: run_full.C:25
Int_t GetLength() const
Definition: RhoCandList.h:46
int n
virtual Bool_t Accept(RhoCandidate *)=0
void Put(const RhoCandidate *, Int_t i=-1)
Definition: RhoCandList.cxx:77
void PndGoodTrackSelector::SetCriterion ( const char *  crit)
virtual

Reimplemented from RhoGoodTrackSelector.

void RhoParticleSelectorBase::SetCriterion ( criterion  crit)
inherited

Definition at line 89 of file RhoParticleSelectorBase.cxx.

References RhoParticleSelectorBase::fCriterion.

90 {
91  fCriterion = crit;
92 }
criterion fCriterion
Particle type to accept.
void RhoGoodTrackSelector::SetFitCut ( Double_t  chi = 1e9,
Double_t  chipm = 0.0 
)
inlineinherited
void PndGoodTrackSelector::SetFtsHits ( Int_t  min,
Int_t  max = 65535 
)
inline

Definition at line 31 of file PndGoodTrackSelector.h.

References fFtsHitsMax, fFtsHitsMin, max(), and min().

31  {
32  fFtsHitsMin = min;
33  fFtsHitsMax = max;
34  }
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
void PndGoodTrackSelector::SetGemHits ( Int_t  min,
Int_t  max = 65535 
)
inline

Definition at line 26 of file PndGoodTrackSelector.h.

References fGemHitsMax, fGemHitsMin, max(), and min().

26  {
27  fGemHitsMin = min;
28  fGemHitsMax = max;
29  }
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
void RhoGoodTrackSelector::SetMomentumCut ( Double_t  pmin,
Double_t  pmax = 1.E8 
)
inlineinherited

Definition at line 34 of file RhoGoodTrackSelector.h.

References RhoGoodTrackSelector::fCutMom, RhoGoodTrackSelector::fPMax, and RhoGoodTrackSelector::fPMin.

34  {
35  fPMin = pmin;
36  fPMax = pmax;
37  fCutMom=kTRUE;
38  }
void PndGoodTrackSelector::SetMvdHits ( Int_t  min,
Int_t  max = 65535 
)
inline

Definition at line 16 of file PndGoodTrackSelector.h.

References fMvdHitsMax, fMvdHitsMin, max(), and min().

16  {
17  fMvdHitsMin = min;
18  fMvdHitsMax = max;
19  }
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
void RhoGoodTrackSelector::SetPrimaryVertexCut ( Double_t  d,
Double_t  zmin,
Double_t  zmax 
)
inlineinherited
void RhoGoodTrackSelector::SetPtCut ( Double_t  ptmin,
Double_t  ptmax = 1.E8 
)
inlineinherited

Definition at line 39 of file RhoGoodTrackSelector.h.

References RhoGoodTrackSelector::fCutPt, RhoGoodTrackSelector::fPtMax, and RhoGoodTrackSelector::fPtMin.

39  {
40  fPtMin = ptmin;
41  fPtMax = ptmax;
42  fCutPt=kTRUE;
43  }
void PndGoodTrackSelector::SetShowerEnergy ( Double_t  min,
Double_t  max = 1.E8 
)
inline

Definition at line 36 of file PndGoodTrackSelector.h.

References fEmcMax, fEmcMin, max(), and min().

36  {
37  fEmcMin = min;
38  fEmcMax = max;
39  }
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
void PndGoodTrackSelector::SetSttHits ( Int_t  min,
Int_t  max = 65535 
)
inline

Definition at line 21 of file PndGoodTrackSelector.h.

References fSttHitsMax, fSttHitsMin, max(), and min().

21  {
22  fSttHitsMin = min;
23  fSttHitsMax = max;
24  }
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
void RhoParticleSelectorBase::SetTypeAndMass ( RhoCandidate b)
protectedinherited

Definition at line 143 of file RhoParticleSelectorBase.cxx.

References RhoParticleSelectorBase::fTypeMinus, RhoParticleSelectorBase::fTypePlus, RhoCandidate::GetCharge(), RhoCandidate::SetMass(), and RhoCandidate::SetType().

Referenced by PndAnaPidSelector::Accept(), RhoGoodPhotonSelector::Accept(), RhoEnergyParticleSelector::Accept(), RhoMassParticleSelector::Accept(), RhoMinusParticleSelector::Accept(), RhoMomentumParticleSelector::Accept(), RhoNeutralParticleSelector::Accept(), RhoPlusParticleSelector::Accept(), RhoSimpleElectronSelector::Accept(), RhoSimpleKaonSelector::Accept(), RhoSimpleMuonSelector::Accept(), RhoSimpleProtonSelector::Accept(), and RhoSimplePionSelector::Accept().

144 {
145  if ( b == 0 ) { return; }
146  // Set the particle type
147  if ( b->GetCharge() >0.1 ) {
148  if ( fTypePlus == 0 ) { return; }
149  b->SetType ( fTypePlus );
150  b->SetMass ( fTypePlus->Mass() );
151  } else {
152  if ( fTypeMinus == 0 ) { return; }
153  b->SetType ( fTypeMinus );
154  b->SetMass ( fTypeMinus->Mass() );
155  }
156 }
Double_t GetCharge() const
Definition: RhoCandidate.h:183
TParticlePDG * fTypeMinus
Particle type to accept.
void SetType(const TParticlePDG *pdt)
void SetMass(Double_t mass)

Member Data Documentation

criterion RhoParticleSelectorBase::fCriterion
protectedinherited
Double_t PndGoodTrackSelector::fEmcMax

Definition at line 45 of file PndGoodTrackSelector.h.

Referenced by Accept(), and SetShowerEnergy().

Double_t PndGoodTrackSelector::fEmcMin

Definition at line 45 of file PndGoodTrackSelector.h.

Referenced by Accept(), and SetShowerEnergy().

Int_t PndGoodTrackSelector::fFtsHitsMax

Definition at line 44 of file PndGoodTrackSelector.h.

Referenced by SetFtsHits().

Int_t PndGoodTrackSelector::fFtsHitsMin

Definition at line 44 of file PndGoodTrackSelector.h.

Referenced by SetFtsHits().

Int_t PndGoodTrackSelector::fGemHitsMax

Definition at line 43 of file PndGoodTrackSelector.h.

Referenced by SetGemHits().

Int_t PndGoodTrackSelector::fGemHitsMin

Definition at line 43 of file PndGoodTrackSelector.h.

Referenced by SetGemHits().

Int_t PndGoodTrackSelector::fMvdHitsMax

Definition at line 41 of file PndGoodTrackSelector.h.

Referenced by Accept(), and SetMvdHits().

Int_t PndGoodTrackSelector::fMvdHitsMin

Definition at line 41 of file PndGoodTrackSelector.h.

Referenced by Accept(), and SetMvdHits().

Int_t PndGoodTrackSelector::fSttHitsMax

Definition at line 42 of file PndGoodTrackSelector.h.

Referenced by Accept(), and SetSttHits().

Int_t PndGoodTrackSelector::fSttHitsMin

Definition at line 42 of file PndGoodTrackSelector.h.

Referenced by Accept(), and SetSttHits().

TParticlePDG* RhoParticleSelectorBase::fTypeMinus
protectedinherited
TParticlePDG* RhoParticleSelectorBase::fTypePlus
protectedinherited

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