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

#include <RhoGoodPhotonSelector.h>

Inheritance diagram for RhoGoodPhotonSelector:
RhoParticleSelectorBase

Public Member Functions

 RhoGoodPhotonSelector (const char *name="RhoGoodPhotonSelector", Double_t e=0.1, Int_t nCrys=0, Double_t lat=1.0, Bool_t qc=kFALSE)
 
virtual ~RhoGoodPhotonSelector ()
 
virtual void SetCriterion (const char *crit)
 
virtual Bool_t Accept (RhoCandidate *b)
 
virtual Bool_t Accept (PndPidCandidate *b)
 
virtual void PrintOn (std::ostream &o=std::cout) const
 
void SetCrystals (Int_t min, Int_t max)
 
void SetTheta (Double_t min, Double_t max)
 
void SetShowerEnergy (Double_t min, Double_t max=1.E8)
 
void SetCriterion (criterion crit)
 
void Select (RhoCandList &l)
 
void Select (RhoCandList &in, RhoCandList &out)
 

Protected Member Functions

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

Int_t fNcMin
 
Int_t fNcMax
 
Double_t fThetaMin
 
Double_t fThetaMax
 
Double_t fEmcMin
 
Double_t fEmcMax
 

Detailed Description

Definition at line 19 of file RhoGoodPhotonSelector.h.

Constructor & Destructor Documentation

RhoGoodPhotonSelector::RhoGoodPhotonSelector ( const char *  name = "RhoGoodPhotonSelector",
Double_t  e = 0.1,
Int_t  nCrys = 0,
Double_t  lat = 1.0,
Bool_t  qc = kFALSE 
)

Definition at line 29 of file RhoGoodPhotonSelector.cxx.

References SetCrystals(), SetShowerEnergy(), and SetTheta().

29  :
30  RhoParticleSelectorBase ( name,"gamma" ) // lat qc //[R.K.03/2017] unused variable(s)
31 {
32  SetShowerEnergy ( emc,1.E8 );
33  SetCrystals ( nCrys,100000 );
34  //SetLAT ( 0.0,lat );
35  //SetPhi ( 0, 2.*3.14159265358979323846 );
36  SetTheta ( 0, 2.*3.14159265358979323846 );
37 }
void emc(Int_t nEvents=10, Char_t part[]="e-", Double_t momentum_min=1.0, Double_t momentum_max=1.0, Double_t theta_min=0, Double_t theta_max=180, Double_t phi_min=0, Double_t phi_max=360, Char_t OutputSimFile[]="sim_emc.root", Char_t OutputDatabaseFile[]="simparams.root", Char_t TransportModel[]="TGeant3", UInt_t seed=0, Bool_t savepoints=kFALSE, Bool_t savehits=kFALSE, Bool_t savewaves=kFALSE, Bool_t savedigis=kFALSE, Bool_t saveclusters=kTRUE, Bool_t savebumps=kTRUE)
Definition: emc.C:1
void SetTheta(Double_t min, Double_t max)
RhoParticleSelectorBase(const char *name="VAbsPidSelector", const char *type=0)
void SetShowerEnergy(Double_t min, Double_t max=1.E8)
TString name
void SetCrystals(Int_t min, Int_t max)
virtual RhoGoodPhotonSelector::~RhoGoodPhotonSelector ( )
inlinevirtual

Definition at line 27 of file RhoGoodPhotonSelector.h.

27 {}

Member Function Documentation

Bool_t RhoGoodPhotonSelector::Accept ( RhoCandidate b)
virtual

Implements RhoParticleSelectorBase.

Definition at line 62 of file RhoGoodPhotonSelector.cxx.

References RhoCandidate::GetRecoCandidate(), and RhoParticleSelectorBase::SetTypeAndMass().

63 {
64  // The RhoGoodPhotonSelector does a selection based on the
65  // quality of a reconstructed charged track
66 
67  if ( b == 0 ) { return kFALSE; }
68  PndPidCandidate* tmppoint = b->GetRecoCandidate();
69  PndPidCandidate* tmp2 = ( PndPidCandidate* ) tmppoint;
70  if ( !Accept ( tmp2 ) ) { return kFALSE; }
71  SetTypeAndMass ( b );
72  return kTRUE;
73 }
PndPidCandidate * GetRecoCandidate() const
Definition: RhoCandidate.h:376
void SetTypeAndMass(RhoCandidate *b)
virtual Bool_t Accept(RhoCandidate *b)
Bool_t RhoGoodPhotonSelector::Accept ( PndPidCandidate b)
virtual

Implements RhoParticleSelectorBase.

Definition at line 75 of file RhoGoodPhotonSelector.cxx.

References emc(), fabs(), fEmcMax, fEmcMin, fNcMax, fNcMin, fThetaMax, fThetaMin, PndPidCandidate::GetCharge(), PndPidCandidate::GetEmcCalEnergy(), PndPidCandidate::GetEmcNumberOfCrystals(), PndPidCandidate::GetMomentum(), nc, and p.

76 {
77  // The RhoGoodPhotonSelector does a selection based on the
78  // quality of a reconstructed charged track
79 
80  if ( cand == 0 ) { return kFALSE; }
81 
82  if ( fabs ( cand->GetCharge() ) >0.001 ) { return kFALSE; }
83 
84  // Check EMC energy deposit
85  Float_t emc = cand->GetEmcCalEnergy();
86  if ( emc < fEmcMin ) { return kFALSE; }
87  if ( emc > fEmcMax ) { return kFALSE; }
88 
89  // Cut on number of crystals
90 
91  Int_t nc = cand->GetEmcNumberOfCrystals();
92  if ( nc < fNcMin ) { return kFALSE; }
93  if ( nc > fNcMax ) { return kFALSE; }
94 
95 
96  // Check LAT
97  // ************* at the moment no lateral shape is provided in PandaROOT
98  /*
99  Float_t lat = cand->GetEmcLateralShape();
100  if (lat <= fLatMin) return kFALSE;
101  if (lat > fLatMax) return kFALSE;
102  */
103 
104 
105  // Check angular acceptance
106 
107  TVector3 p = cand->GetMomentum();
108  if ( p.Theta() < fThetaMin ) { return kFALSE; }
109  if ( p.Theta() > fThetaMax ) { return kFALSE; }
110 
111  // ************* removed phi cut for the time being
112  // ***** K.G. 25. 3. 2010
113 
114  //if (p.Phi() + 3.14159265358979323846 < fPhiMin) return kFALSE;
115  //if (p.Phi() + 3.14159265358979323846 > fPhiMax) return kFALSE;
116 
117  return kTRUE;
118 }
void emc(Int_t nEvents=10, Char_t part[]="e-", Double_t momentum_min=1.0, Double_t momentum_max=1.0, Double_t theta_min=0, Double_t theta_max=180, Double_t phi_min=0, Double_t phi_max=360, Char_t OutputSimFile[]="sim_emc.root", Char_t OutputDatabaseFile[]="simparams.root", Char_t TransportModel[]="TGeant3", UInt_t seed=0, Bool_t savepoints=kFALSE, Bool_t savehits=kFALSE, Bool_t savewaves=kFALSE, Bool_t savedigis=kFALSE, Bool_t saveclusters=kTRUE, Bool_t savebumps=kTRUE)
Definition: emc.C:1
Double_t p
Definition: anasim.C:58
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TH1F * nc
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 RhoGoodPhotonSelector::PrintOn ( std::ostream o = std::cout) const
virtual

Definition at line 120 of file RhoGoodPhotonSelector.cxx.

References fEmcMax, fEmcMin, fNcMax, fNcMin, fThetaMax, and fThetaMin.

Referenced by operator<<().

121 {
122  o << GetName() << endl;
123  if ( fEmcMin > 0 ) { o << "EMC energy = " << fEmcMin << " ... " << fEmcMax << " GeV" << endl; }
124  if ( fNcMin > 0 ) { o << "Number of Crystals = " << fNcMin << " ... " << fNcMax << endl; }
125  //if (latMin > 0) o << "LAT = " << fLatMin << " ... " << fLatMax << endl;
126  if ( fThetaMin > 0 ) { o << "Theta [Rad] = " << fThetaMin << " ... " << fThetaMax << endl; }
127  //if ( fPhiMin > 0 ) o << "Phi [Rad] = " << fPhiMin << " ... " << fPhiMax << endl;
128  o << endl;
129 }
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 RhoGoodPhotonSelector::SetCriterion ( const char *  crit)
virtual

Reimplemented from RhoParticleSelectorBase.

Definition at line 39 of file RhoGoodPhotonSelector.cxx.

References RhoParticleSelectorBase::SetCriterion(), SetCrystals(), SetShowerEnergy(), SetTheta(), and TString.

40 {
41  // Set criteria accroding to
42  // http://babar-hn.slac.stanford.edu:5090/HyperNews/get/AnalTools/273.html
43  TString crit ( c );
44 
45  if ( crit=="veryLoose" || crit=="loose" ) {
46  SetShowerEnergy ( 0.03,1.E8 );
47  SetCrystals ( 0,100000 );
48  //SetLAT ( 0.0,0.8 );
49  //SetPhi ( 0, 2.*3.14159265358979323846 );
50  SetTheta ( 0, 2.*3.14159265358979323846 );
51  } else {
52  SetShowerEnergy ( 0.1,1.E8 );
53  SetCrystals ( 0,100000 );
54  //SetLAT ( 0.0,0.8 );
55  //SetPhi ( 0, 2.*3.14159265358979323846 );
56  SetTheta ( 0, 2.*3.14159265358979323846 );
57  }
58 
60 }
void SetTheta(Double_t min, Double_t max)
void SetShowerEnergy(Double_t min, Double_t max=1.E8)
virtual void SetCriterion(const char *crit)
void SetCrystals(Int_t min, Int_t max)
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 RhoGoodPhotonSelector::SetCrystals ( Int_t  min,
Int_t  max 
)
inline

Definition at line 34 of file RhoGoodPhotonSelector.h.

References fNcMax, fNcMin, max(), and min().

Referenced by RhoGoodPhotonSelector(), and SetCriterion().

34  {
35  fNcMin = min;
36  fNcMax = max;
37  }
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 RhoGoodPhotonSelector::SetShowerEnergy ( Double_t  min,
Double_t  max = 1.E8 
)
inline

Definition at line 50 of file RhoGoodPhotonSelector.h.

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

Referenced by RhoGoodPhotonSelector(), and SetCriterion().

50  {
51  fEmcMin = min;
52  fEmcMax = max;
53  }
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 RhoGoodPhotonSelector::SetTheta ( Double_t  min,
Double_t  max 
)
inline

Definition at line 46 of file RhoGoodPhotonSelector.h.

References fThetaMax, fThetaMin, max(), and min().

Referenced by RhoGoodPhotonSelector(), and SetCriterion().

46  {
47  fThetaMin = min;
48  fThetaMax = max;
49  }
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(), Accept(), RhoEnergyParticleSelector::Accept(), RhoSimpleMuonSelector::Accept(), RhoSimpleKaonSelector::Accept(), RhoSimpleElectronSelector::Accept(), RhoPlusParticleSelector::Accept(), RhoNeutralParticleSelector::Accept(), RhoMomentumParticleSelector::Accept(), RhoMinusParticleSelector::Accept(), RhoMassParticleSelector::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 RhoGoodPhotonSelector::fEmcMax
private

Definition at line 60 of file RhoGoodPhotonSelector.h.

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

Double_t RhoGoodPhotonSelector::fEmcMin
private

Definition at line 60 of file RhoGoodPhotonSelector.h.

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

Int_t RhoGoodPhotonSelector::fNcMax
private

Definition at line 56 of file RhoGoodPhotonSelector.h.

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

Int_t RhoGoodPhotonSelector::fNcMin
private

Definition at line 56 of file RhoGoodPhotonSelector.h.

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

Double_t RhoGoodPhotonSelector::fThetaMax
private

Definition at line 59 of file RhoGoodPhotonSelector.h.

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

Double_t RhoGoodPhotonSelector::fThetaMin
private

Definition at line 59 of file RhoGoodPhotonSelector.h.

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

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

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