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

#include <RhoGoodTrackSelector.h>

Inheritance diagram for RhoGoodTrackSelector:
RhoParticleSelectorBase PndGoodTrackSelector

Public Member Functions

 RhoGoodTrackSelector (const char *name="RhoGoodTrackSelector")
 
virtual ~RhoGoodTrackSelector ()
 
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)
 
virtual Bool_t Accept (RhoCandidate *)=0
 
virtual Bool_t Accept (PndPidCandidate *)=0
 
void SetCriterion (criterion crit)
 
void Select (RhoCandList &l)
 
void Select (RhoCandList &in, RhoCandList &out)
 

Protected Member Functions

virtual void SetCriterion (const char *)
 
virtual Bool_t Accept (RhoCandidate &b)
 
virtual Bool_t Accept (PndPidCandidate &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...
 

Private Attributes

Double_t fPMin
 
Double_t fPMax
 
Double_t fPtMin
 
Double_t fPtMax
 
Double_t fChisqProbMin
 
Double_t fChisqMax
 
Double_t fDocaMax
 
Double_t fZMin
 
Double_t fZMax
 
Bool_t fCutFit
 
Bool_t fCutVtx
 
Bool_t fCutMom
 
Bool_t fCutPt
 

Detailed Description

Definition at line 18 of file RhoGoodTrackSelector.h.

Constructor & Destructor Documentation

RhoGoodTrackSelector::RhoGoodTrackSelector ( const char *  name = "RhoGoodTrackSelector")

Definition at line 30 of file RhoGoodTrackSelector.cxx.

30  :
31  RhoParticleSelectorBase ( name,"pi-" ),
32  fCutFit(kFALSE),
33  fCutVtx(kFALSE),
34  fCutMom(kFALSE),
35  fCutPt(kFALSE)
36 
37 {
38 }
RhoParticleSelectorBase(const char *name="VAbsPidSelector", const char *type=0)
TString name
RhoGoodTrackSelector::~RhoGoodTrackSelector ( )
virtual

Definition at line 40 of file RhoGoodTrackSelector.cxx.

41 {
42 }

Member Function Documentation

virtual Bool_t RhoParticleSelectorBase::Accept ( RhoCandidate )
pure virtualinherited
virtual Bool_t RhoParticleSelectorBase::Accept ( PndPidCandidate )
pure virtualinherited
Bool_t RhoGoodTrackSelector::Accept ( RhoCandidate b)
protectedvirtual

Definition at line 44 of file RhoGoodTrackSelector.cxx.

References RhoCandidate::GetRecoCandidate().

Referenced by PndGoodTrackSelector::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)
Bool_t RhoGoodTrackSelector::Accept ( PndPidCandidate b)
protectedvirtual

Reimplemented in PndGoodTrackSelector.

Definition at line 56 of file RhoGoodTrackSelector.cxx.

References fChisqMax, fChisqProbMin, fCutFit, fCutMom, fCutPt, fCutVtx, fDocaMax, fPMax, fPMin, fPtMax, fPtMin, fZMax, fZMin, PndPidCandidate::GetCharge(), PndPidCandidate::GetChiSquared(), PndPidCandidate::GetDegreesOfFreedom(), PndPidCandidate::GetMomentum(), PndPidCandidate::GetPosition(), p, and v.

57 {
58  // The GoodTrackSelector does a selection based on the
59  // quality of a reconstructed charged track
60  if ( &cand == 0 ) { return kFALSE; }
61  if ( cand.GetCharge() == 0 ) { return kFALSE; }
62 // // Cut on number of hits and distance from inner to outer layer
63 // if (fCutHits) {
64 // Int_t nhits = cand.GetNHits(); // Get the number of hits
65 // if ( nhits <= nHitsMin ) return kFALSE;
66 // if ( nhits > nHitsMax ) return kFALSE;
67 // }
68  // Cut on momenta
69  TVector3 p = cand.GetMomentum();
70  if (fCutMom){
71  if ( p.Mag() < fPMin ) { return kFALSE; }
72  if ( p.Mag() > fPMax ) { return kFALSE; }
73  }
74 
75  if (fCutPt){
76  if ( p.Perp() < fPtMin ) { return kFALSE; }
77  if ( p.Perp() > fPtMax ) { return kFALSE; }
78  }
79 
80 
81  // Cut on quality of fit
82  if (fCutFit){
83  Float_t chiq = cand.GetChiSquared();
84  if ( chiq > fChisqMax ) { return kFALSE; }
85  Float_t ndf = cand.GetDegreesOfFreedom();
86  if ( TMath::Prob(chiq,ndf) < fChisqProbMin ) { return kFALSE; }
87  }
88 
89  // Cut on primary vertex
90  if (fCutVtx) {
91  TVector3 v = cand.GetPosition(); // Get the starting point (spot corrected)
92  if ( v.Perp() > fDocaMax ) { return kFALSE; }
93  if ( v.Z() > fZMax ) { return kFALSE; }
94  if ( v.Z() < fZMin ) { return kFALSE; }
95  }
96 
97  return kTRUE;
98 }
Double_t p
Definition: anasim.C:58
__m128 v
Definition: P4_F32vec4.h:4
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
virtual

Definition at line 100 of file RhoGoodTrackSelector.cxx.

References fChisqMax, fChisqProbMin, fDocaMax, fPMax, fPMin, fPtMax, fPtMin, fZMax, and 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 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.
virtual void RhoGoodTrackSelector::SetCriterion ( const char *  )
inlineprotectedvirtual

Reimplemented from RhoParticleSelectorBase.

Reimplemented in PndGoodTrackSelector.

Definition at line 58 of file RhoGoodTrackSelector.h.

58 {}; // crit //[R.K.03/2017] unused variable(s)
void RhoGoodTrackSelector::SetFitCut ( Double_t  chi = 1e9,
Double_t  chipm = 0.0 
)
inline

Definition at line 44 of file RhoGoodTrackSelector.h.

References fChisqMax, fChisqProbMin, and fCutFit.

44  {
45  fChisqProbMin = chipm;
46  fChisqMax = chi;
47  fCutFit=kTRUE;
48  }
void RhoGoodTrackSelector::SetMomentumCut ( Double_t  pmin,
Double_t  pmax = 1.E8 
)
inline

Definition at line 34 of file RhoGoodTrackSelector.h.

References fCutMom, fPMax, and fPMin.

34  {
35  fPMin = pmin;
36  fPMax = pmax;
37  fCutMom=kTRUE;
38  }
void RhoGoodTrackSelector::SetPrimaryVertexCut ( Double_t  d,
Double_t  zmin,
Double_t  zmax 
)
inline

Definition at line 49 of file RhoGoodTrackSelector.h.

References d, fCutVtx, fDocaMax, fZMax, and fZMin.

49  {
50  fDocaMax = d;
51  fZMin = zmin;
52  fZMax = zmax;
53  fCutVtx=kTRUE;
54  }
TObjArray * d
void RhoGoodTrackSelector::SetPtCut ( Double_t  ptmin,
Double_t  ptmax = 1.E8 
)
inline

Definition at line 39 of file RhoGoodTrackSelector.h.

References fCutPt, fPtMax, and fPtMin.

39  {
40  fPtMin = ptmin;
41  fPtMax = ptmax;
42  fCutPt=kTRUE;
43  }
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

Double_t RhoGoodTrackSelector::fChisqMax
private

Definition at line 66 of file RhoGoodTrackSelector.h.

Referenced by Accept(), PrintOn(), and SetFitCut().

Double_t RhoGoodTrackSelector::fChisqProbMin
private

Definition at line 66 of file RhoGoodTrackSelector.h.

Referenced by Accept(), PrintOn(), and SetFitCut().

criterion RhoParticleSelectorBase::fCriterion
protectedinherited
Bool_t RhoGoodTrackSelector::fCutFit
private

Definition at line 69 of file RhoGoodTrackSelector.h.

Referenced by Accept(), and SetFitCut().

Bool_t RhoGoodTrackSelector::fCutMom
private

Definition at line 71 of file RhoGoodTrackSelector.h.

Referenced by Accept(), and SetMomentumCut().

Bool_t RhoGoodTrackSelector::fCutPt
private

Definition at line 72 of file RhoGoodTrackSelector.h.

Referenced by Accept(), and SetPtCut().

Bool_t RhoGoodTrackSelector::fCutVtx
private

Definition at line 70 of file RhoGoodTrackSelector.h.

Referenced by Accept(), and SetPrimaryVertexCut().

Double_t RhoGoodTrackSelector::fDocaMax
private

Definition at line 67 of file RhoGoodTrackSelector.h.

Referenced by Accept(), PrintOn(), and SetPrimaryVertexCut().

Double_t RhoGoodTrackSelector::fPMax
private

Definition at line 65 of file RhoGoodTrackSelector.h.

Referenced by Accept(), PrintOn(), and SetMomentumCut().

Double_t RhoGoodTrackSelector::fPMin
private

Definition at line 65 of file RhoGoodTrackSelector.h.

Referenced by Accept(), PrintOn(), and SetMomentumCut().

Double_t RhoGoodTrackSelector::fPtMax
private

Definition at line 65 of file RhoGoodTrackSelector.h.

Referenced by Accept(), PrintOn(), and SetPtCut().

Double_t RhoGoodTrackSelector::fPtMin
private

Definition at line 65 of file RhoGoodTrackSelector.h.

Referenced by Accept(), PrintOn(), and SetPtCut().

TParticlePDG* RhoParticleSelectorBase::fTypeMinus
protectedinherited
TParticlePDG* RhoParticleSelectorBase::fTypePlus
protectedinherited
Double_t RhoGoodTrackSelector::fZMax
private

Definition at line 68 of file RhoGoodTrackSelector.h.

Referenced by Accept(), PrintOn(), and SetPrimaryVertexCut().

Double_t RhoGoodTrackSelector::fZMin
private

Definition at line 68 of file RhoGoodTrackSelector.h.

Referenced by Accept(), PrintOn(), and SetPrimaryVertexCut().


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