CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
UserPi0Cut Struct Reference

#include <Pi0Cut.h>

+ Inheritance diagram for UserPi0Cut:

Public Member Functions

 UserPi0Cut (double MEBP=0.025, double MEEP=0.045, double MA=20., double TL=25., double MinM=0.12, double MaxM=0.15, double c=1e+10)
 
bool operator() (CDPi0 &_this)
 
bool isGoodPhoton (EvtRecTrack *gTrk)
 
- Public Member Functions inherited from DCSelectionFunction< CDPi0 >
 DCSelectionFunction ()
 
virtual ~DCSelectionFunction ()
 
bool operator() (CDPi0 &iArg) const
 

Static Public Member Functions

static void SetForTrack (EvtRecEvent *_recEvt, EvtRecTrackCol *_recTrkCol)
 

Public Attributes

double MinEnergyOfBarrelPhoton
 
double MinEnergyOfEndcapPhoton
 
double MinAngle
 
double TimeLimit
 
double MinMass
 
double MaxMass
 
double Chisq
 

Static Public Attributes

static EvtRecEventrecEvt = 0
 
static EvtRecTrackColrecTrkCol = 0
 

Detailed Description

Definition at line 10 of file Pi0Cut.h.

Constructor & Destructor Documentation

◆ UserPi0Cut()

UserPi0Cut::UserPi0Cut ( double MEBP = 0.025,
double MEEP = 0.045,
double MA = 20.,
double TL = 25.,
double MinM = 0.12,
double MaxM = 0.15,
double c = 1e+10 )
inline

Definition at line 12 of file Pi0Cut.h.

18 MinAngle(MA),
19 TimeLimit(TL),
20 Chisq(c),
21 MinMass(MinM), MaxMass(MaxM)
22 {}
double MinAngle
Definition Pi0Cut.h:26
double MinEnergyOfEndcapPhoton
Definition Pi0Cut.h:25
double MinMass
Definition Pi0Cut.h:28
double MaxMass
Definition Pi0Cut.h:29
double TimeLimit
Definition Pi0Cut.h:27
double MinEnergyOfBarrelPhoton
Definition Pi0Cut.h:24
double Chisq
Definition Pi0Cut.h:30

Member Function Documentation

◆ isGoodPhoton()

bool UserPi0Cut::isGoodPhoton ( EvtRecTrack * gTrk)
inline

Definition at line 43 of file Pi0Cut.h.

44 {
45 if ( !gTrk->isEmcShowerValid() ) return false;
46
47 RecEmcShower *emcTrk = gTrk->emcShower();
48 //check time
49 if(emcTrk->time() > TimeLimit) return false;
50 //check energy
51 int flag =(emcTrk->cellId() & 0x000F0000) >> 16;
52 if ((flag == 1) && emcTrk->energy() < MinEnergyOfBarrelPhoton) return false;
53 if ((flag == 0 || flag == 2) && emcTrk->energy() < MinEnergyOfEndcapPhoton) return false;
54 //check angle
55 Hep3Vector emcpos(emcTrk->x(), emcTrk->y(), emcTrk->z());
56 if (recEvt->totalCharged() > 0)
57 {
58 double dthe = 200.;
59 double dphi = 200.;
60 double dang1 = 200.;
61 for (int j = 0; j < recEvt->totalCharged(); j++) {
62 EvtRecTrackIterator jtTrk = recTrkCol->begin() + j;
63 if ( !(*jtTrk)->isExtTrackValid() ) continue;
64 RecExtTrack* extTrk = (*jtTrk)->extTrack();
65 if ( extTrk->emcVolumeNumber() == -1 ) continue;
66 Hep3Vector extpos = extTrk->emcPosition();
67 double angd1 = extpos.angle(emcpos);
68 double thed = extpos.theta() - emcpos.theta();
69 double phid = extpos.deltaPhi(emcpos);
70 thed = fmod(thed+CLHEP::twopi+CLHEP::twopi+CLHEP::pi, CLHEP::twopi) - CLHEP::pi;
71 phid = fmod(phid+CLHEP::twopi+CLHEP::twopi+CLHEP::pi, CLHEP::twopi) - CLHEP::pi;
72
73 if ( fabs(thed) < fabs(dthe) ) dthe = thed;
74 if ( fabs(phid) < fabs(dphi) ) dphi = phid;
75 if ( angd1 < dang1 ) dang1 = angd1;
76 }
77 if ( dang1 < 200 ) {
78 dthe = dthe * 180 / (CLHEP::pi);
79 dphi = dphi * 180 / (CLHEP::pi);
80 dang1 = dang1 * 180 / (CLHEP::pi);
81 if ( dang1 < MinAngle) return false;
82
83
84 } // End of "dang1 < 200" IF
85
86 } // End of "recEv
87 return true;
88 }
EvtRecTrackCol::iterator EvtRecTrackIterator
int cellId() const
double x() const
double time() const
double z() const
double energy() const
double y() const
const Hep3Vector emcPosition() const
const int emcVolumeNumber() const
int totalCharged() const
Definition EvtRecEvent.h:24
RecEmcShower * emcShower()
Definition EvtRecTrack.h:70
bool isEmcShowerValid()
Definition EvtRecTrack.h:55
static EvtRecEvent * recEvt
Definition Pi0Cut.h:91
static EvtRecTrackCol * recTrkCol
Definition Pi0Cut.h:92

Referenced by operator()().

◆ operator()()

bool UserPi0Cut::operator() ( CDPi0 & _this)
inlinevirtual

Implements DCSelectionFunction< CDPi0 >.

Definition at line 32 of file Pi0Cut.h.

33 {
34 EvtRecTrack* g1 = const_cast<EvtRecTrack*>(_this.navPi0()->hiEnGamma());
35 EvtRecTrack* g2 = const_cast<EvtRecTrack*>(_this.navPi0()->loEnGamma());
36 if(!isGoodPhoton(g1)) return false;
37 if(!isGoodPhoton(g2)) return false;
38 if(_this.navPi0()->chisq() > Chisq) return false;
39 if(_this.navPi0()->unconMass() < MinMass || _this.navPi0()->unconMass() > MaxMass) return false;
40 return true;
41 }
TF1 * g1
virtual const EvtRecPi0 * navPi0() const
Definition CDPi0.cxx:103
double unconMass() const
Definition EvtRecPi0.h:24
double chisq() const
Definition EvtRecPi0.h:25
bool isGoodPhoton(EvtRecTrack *gTrk)
Definition Pi0Cut.h:43

◆ SetForTrack()

static void UserPi0Cut::SetForTrack ( EvtRecEvent * _recEvt,
EvtRecTrackCol * _recTrkCol )
inlinestatic

Definition at line 90 of file Pi0Cut.h.

90{ recEvt =_recEvt; recTrkCol=_recTrkCol;}

Referenced by Pi0RecAlg::execute().

Member Data Documentation

◆ Chisq

double UserPi0Cut::Chisq

Definition at line 30 of file Pi0Cut.h.

Referenced by operator()(), and Pi0RecAlg::Pi0RecAlg().

◆ MaxMass

double UserPi0Cut::MaxMass

Definition at line 29 of file Pi0Cut.h.

Referenced by Pi0RecAlg::execute(), operator()(), and Pi0RecAlg::Pi0RecAlg().

◆ MinAngle

double UserPi0Cut::MinAngle

Definition at line 26 of file Pi0Cut.h.

Referenced by isGoodPhoton(), and Pi0RecAlg::Pi0RecAlg().

◆ MinEnergyOfBarrelPhoton

double UserPi0Cut::MinEnergyOfBarrelPhoton

Definition at line 24 of file Pi0Cut.h.

Referenced by isGoodPhoton(), and Pi0RecAlg::Pi0RecAlg().

◆ MinEnergyOfEndcapPhoton

double UserPi0Cut::MinEnergyOfEndcapPhoton

Definition at line 25 of file Pi0Cut.h.

Referenced by isGoodPhoton(), and Pi0RecAlg::Pi0RecAlg().

◆ MinMass

double UserPi0Cut::MinMass

Definition at line 28 of file Pi0Cut.h.

Referenced by Pi0RecAlg::execute(), operator()(), and Pi0RecAlg::Pi0RecAlg().

◆ recEvt

EvtRecEvent * UserPi0Cut::recEvt = 0
static

Definition at line 91 of file Pi0Cut.h.

Referenced by isGoodPhoton(), Pi0::make_gamma_list(), and SetForTrack().

◆ recTrkCol

EvtRecTrackCol * UserPi0Cut::recTrkCol = 0
static

Definition at line 92 of file Pi0Cut.h.

Referenced by isGoodPhoton(), Pi0::make_gamma_list(), and SetForTrack().

◆ TimeLimit

double UserPi0Cut::TimeLimit

Definition at line 27 of file Pi0Cut.h.

Referenced by isGoodPhoton(), and Pi0RecAlg::Pi0RecAlg().


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