FairRoot/PandaRoot
RhoGoodPhotonSelector.cxx
Go to the documentation of this file.
1 // //
3 // RhoGoodPhotonSelector //
4 // //
5 // Selector classes for photon quality selections //
6 // //
7 // Author List: //
8 // Marcel Kunze, RUB, Feb. 99 //
9 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
10 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
11 // //
13 
15 
16 #include "RhoBase/RhoCandidate.h"
17 
19 
20 TBuffer& operator>> ( TBuffer& buf, RhoGoodPhotonSelector *&obj )
21 {
22  obj = ( RhoGoodPhotonSelector* ) buf.ReadObject ( RhoGoodPhotonSelector::Class() );
23  return buf;
24 }
25 
26 #include <iostream>
27 using namespace std;
28 
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 }
38 
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 }
61 
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 }
74 
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 }
119 
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 }
130 
132 {
133  a.PrintOn ( o );
134  return o;
135 }
136 
virtual void PrintOn(std::ostream &o=std::cout) const
Double_t p
Definition: anasim.C:58
Int_t GetCharge() const
TTree * b
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
TH1F * nc
Definition: plot_eta_c.C:38
Float_t GetEmcCalEnergy() const
Int_t GetEmcNumberOfCrystals() const
PndPidCandidate * GetRecoCandidate() const
Definition: RhoCandidate.h:376
std::ostream & operator<<(std::ostream &o, const PndEventInfo &a)
virtual void SetCriterion(const char *crit)
void SetTheta(Double_t min, Double_t max)
Int_t a
Definition: anaLmdDigi.C:126
RhoGoodPhotonSelector(const char *name="RhoGoodPhotonSelector", Double_t e=0.1, Int_t nCrys=0, Double_t lat=1.0, Bool_t qc=kFALSE)
Double_t
void SetShowerEnergy(Double_t min, Double_t max=1.E8)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
void SetTypeAndMass(RhoCandidate *b)
TString name
virtual void SetCriterion(const char *crit)
virtual Bool_t Accept(RhoCandidate *b)
ClassImp(PndAnaContFact)
void SetCrystals(Int_t min, Int_t max)
TVector3 GetMomentum() const