CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EgHLTOffPho.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_TRIGGER_EGHLTOFFPHO
2 #define DQMOFFLINE_TRIGGER_EGHLTOFFPHO
3 
4 //class: EgHLTOffPho
5 //
6 //author: Sam Harper (July 2008)
7 //
8 //
9 //aim: to allow easy access to phoctron ID variables
10 // currently the CMSSW photon classes are a mess with key photon variables not being accessable from Photon
11 // this a stop gap to produce a simple photon class with all variables easily accessable via methods
12 // note as this is meant for HLT Offline DQM, I do not want the overhead of converting to pat
13 //
14 //implimentation: aims to be a wrapper for Photon methods, it is hoped that in time these methods will be directly added to Photon and so
15 // make this class obsolute
16 // unfortunately can not be a pure wrapper as needs to store isol and cluster shape
17 //
18 
19 
22 
25 
26 namespace egHLT {
27  class OffPho {
28 
29  public:
30  //helper struct to store the isolations
31  struct IsolData {
32  int nrTrks;
33  float ptTrks;
34  float em;
35  float had;
36  float hltHad;
37  float hltTrks;
38  float hltEm;
39  };
40 
41  public:
42  //helper struct to store the cluster shapes
43  struct ClusShapeData {
44  float sigmaEtaEta;
47  float e1x5Over5x5;
48  float sigmaPhiPhi;
50  float r9;
51  };
52 
53 
54  private:
55  const reco::Photon* pho_; //pointers to the underlying phoctron (we do not own this)
56 
59 
60  //these are bit-packed words telling me which cuts the photon fail (ie 0x0 is passed all cuts)
61  int cutCode_;
63 
64  //the idea is that these are user definable cuts mean to be idenital to the specified trigger
65  //it is probably clear to the reader that I havent decided on the most efficient way to do this
66  std::vector<std::pair<TrigCodes::TrigBitSet,int> > trigCutsCutCodes_; //unsorted vector (may sort if have performance issues)
67 
68  //and these are the trigger bits stored
69  //note that the trigger bits are defined at the begining of each job
70  //and do not necessaryly map between jobs
72 
73  public:
74 
75  OffPho(const reco::Photon& pho,const ClusShapeData& shapeData,const IsolData& isolData):
76  pho_(&pho),clusShapeData_(shapeData),isolData_(isolData),
78  ~OffPho(){}
79 
80  //modifiers
81  void setCutCode(int code){cutCode_=code;}
82  void setLooseCutCode(int code){looseCutCode_=code;}
83 
84  //slightly inefficient way, think I can afford it and its a lot easier to just make the sorted vector outside the class
85  void setTrigCutsCutCodes(const std::vector<std::pair<TrigCodes::TrigBitSet,int> > trigCutsCutCodes){trigCutsCutCodes_=trigCutsCutCodes;}
87 
88  const reco::Photon* recoPho()const{return pho_;}
89 
90  //kinematic and geometric methods
91  float et()const{return pho_->et();}
92  float pt()const{return pho_->pt();}
93  float energy()const{return pho_->energy();}
94  float eta()const{return pho_->eta();}
95  float phi()const{return pho_->phi();}
96  float etSC()const{return pho_->superCluster()->position().rho()/pho_->superCluster()->position().r()*energy();}
97  float etaSC()const{return pho_->superCluster()->eta();}
98  float detEta()const{return etaSC();}
99  float phiSC()const{return pho_->superCluster()->phi();}
100  float zVtx()const{return pho_->vz();}
101  const math::XYZTLorentzVector& p4()const{return pho_->p4();}
102 
103  bool isGap()const{return pho_->isEBGap() || pho_->isEEGap() || pho_->isEBEEGap();}
104 
105  //abreviations of overly long Photon methods, I'm sorry but if you cant figure out what hOverE() means, you shouldnt be using this class
106  float hOverE()const{return pho_->hadronicOverEm();}
107 
108 
109 
110  float sigmaEtaEta()const;
113  float sigmaPhiPhi()const{return clusShapeData_.sigmaPhiPhi;}
116  float e1x5Over5x5()const{return clusShapeData_.e1x5Over5x5;}
117  float r9()const{return clusShapeData_.r9;}
118 
119  //isolation
120  float isolEm()const{return isolData_.em;}
121  float isolHad()const{return isolData_.had;}
122  int isolNrTrks()const{return isolData_.nrTrks;}
123  float isolPtTrks()const{return isolData_.ptTrks;}
124  float hltIsolHad()const{return isolData_.hltHad;}
125  float hltIsolTrks()const{return isolData_.hltTrks;}
126  float hltIsolEm()const{return isolData_.hltEm;}
127 
128  //selection cuts
129  int cutCode()const{return cutCode_;}
130  int looseCutCode()const{return looseCutCode_;}
131 
132  //trigger codes are just used as a unique identifier of the trigger, it is an error to specify more than a single bit
133  //the idea here is to allow an arbitary number of photon triggers
134  int trigCutsCutCode(const TrigCodes::TrigBitSet& trigger)const;
135 
136  //trigger
138 
139  };
140 }
141 
142 #endif
float hltIsolTrks() const
Definition: EgHLTOffPho.h:125
float e1x5Over5x5() const
Definition: EgHLTOffPho.h:116
float sigmaIPhiIPhi() const
Definition: EgHLTOffPho.h:114
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.h:57
void setTrigCutsCutCodes(const std::vector< std::pair< TrigCodes::TrigBitSet, int > > trigCutsCutCodes)
Definition: EgHLTOffPho.h:85
virtual double et() const
transverse energy
bool isEBGap() const
true if photon is in EB, and inside the boundaries in super crystals/modules
Definition: Photon.h:115
std::vector< std::pair< TrigCodes::TrigBitSet, int > > trigCutsCutCodes_
Definition: EgHLTOffPho.h:66
ClusShapeData clusShapeData_
Definition: EgHLTOffPho.h:57
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
float et() const
Definition: EgHLTOffPho.h:91
float isolHad() const
Definition: EgHLTOffPho.h:121
float isolPtTrks() const
Definition: EgHLTOffPho.h:123
float sigmaEtaEtaUnCorr() const
Definition: EgHLTOffPho.h:111
bool isEBEEGap() const
true if photon is in boundary between EB and EE
Definition: Photon.h:123
int trigCutsCutCode(const TrigCodes::TrigBitSet &trigger) const
Definition: EgHLTOffPho.cc:14
const reco::Photon * pho_
Definition: EgHLTOffPho.h:55
float phiSC() const
Definition: EgHLTOffPho.h:99
OffPho(const reco::Photon &pho, const ClusShapeData &shapeData, const IsolData &isolData)
Definition: EgHLTOffPho.h:75
virtual double eta() const
momentum pseudorapidity
IsolData isolData_
Definition: EgHLTOffPho.h:58
float energy() const
Definition: EgHLTOffPho.h:93
float eta() const
Definition: EgHLTOffPho.h:94
TrigCodes::TrigBitSet trigBits_
Definition: EgHLTOffPho.h:71
int looseCutCode() const
Definition: EgHLTOffPho.h:130
float etaSC() const
Definition: EgHLTOffPho.h:97
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffPho.h:137
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
float detEta() const
Definition: EgHLTOffPho.h:98
const reco::Photon * recoPho() const
Definition: EgHLTOffPho.h:88
virtual double energy() const
energy
float hOverE() const
Definition: EgHLTOffPho.h:106
#define INVALID
Definition: myFilter.cc:40
float sigmaEtaEta() const
Definition: EgHLTOffPho.cc:5
float pt() const
Definition: EgHLTOffPho.h:92
void setTrigBits(TrigCodes::TrigBitSet bits)
Definition: EgHLTOffPho.h:86
float r9() const
Definition: EgHLTOffPho.h:117
void setLooseCutCode(int code)
Definition: EgHLTOffPho.h:82
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:155
float e2x5MaxOver5x5() const
Definition: EgHLTOffPho.h:115
virtual double vz() const
z coordinate of vertex position
float hltIsolHad() const
Definition: EgHLTOffPho.h:124
bool isGap() const
Definition: EgHLTOffPho.h:103
float zVtx() const
Definition: EgHLTOffPho.h:100
bool isEEGap() const
true if photon is in EE, and inside the boundaries in supercrystal/D
Definition: Photon.h:119
void setCutCode(int code)
Definition: EgHLTOffPho.h:81
float etSC() const
Definition: EgHLTOffPho.h:96
virtual double pt() const
transverse momentum
float sigmaIEtaIEta() const
Definition: EgHLTOffPho.h:112
float phi() const
Definition: EgHLTOffPho.h:95
float sigmaPhiPhi() const
Definition: EgHLTOffPho.h:113
int isolNrTrks() const
Definition: EgHLTOffPho.h:122
int cutCode() const
Definition: EgHLTOffPho.h:129
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffPho.h:101
virtual double phi() const
momentum azimuthal angle
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
float hltIsolEm() const
Definition: EgHLTOffPho.h:126
float isolEm() const
Definition: EgHLTOffPho.h:120
std::bitset< maxNrBits_ > TrigBitSet