CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EgHLTOffHelper.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_TRIGGER_EGHLTOFFHELPER
2 #define DQMOFFLINE_TRIGGER_EGHLTOFFHELPER
3 
4 //class: EgHLTOffHelper (Egamma HLT offline helper)
5 //
6 //author: Sam Harper (July 2008)
7 //
8 //
9 //aim: to hide temporary place holder code away from the rest of the system
10 //
11 //implimentation: currently no isolation producers or electron selection cut meets my needs
12 // while I would like to use a central tool, for now I'm cludging my own as
13 // placeholders
14 
15 
23 
32 
38 
43 
46 
52 
54 class HLTConfigProvider;
56 
57 namespace egHLT {
58 
59  class OffHelper {
60 
61  private:
62  OffEgSel eleLooseCuts_; //loose selection cuts (loose has no relation to other 'loose' cuts)
63  OffEgSel eleCuts_; //normal selection cuts
64  OffEgSel phoLooseCuts_; //loose selection cuts (loose has no relation to other 'loose' cuts)
65  OffEgSel phoCuts_; //normal selection cuts
66 
67  std::vector<std::pair<TrigCodes::TrigBitSet,OffEgSel> > trigCuts_;//non sorted vector (for now)
68 
69 
83 
88 
94 
99 
102 
104 
106 
107 
108 
110  std::vector<std::string> hltFiltersUsed_;
111  std::vector<std::pair<std::string,int> > hltFiltersUsedWithNrCandsCut_; //stores the filter name + number of candidates required to pass that filter for it to accept
112  std::vector<std::pair<std::string,std::string> > l1PreAndSeedFilters_; //filter names of a l1 prescaler and the corresponding l1 seed filter
113  std::vector<std::string> l1PreScaledPaths_;//l1 pre-scaled path names
114  std::vector<std::string> l1PreScaledFilters_;//l1 pre scale filters
115 
116  //allow us to recompute e/gamma HLT isolations (note we also have em and hcal but they have to be declared for every event)
117  //which is awkward and I havent thought of a good way around it yet
120 
121  //our hlt isolation parameters...
122  //ecal
132  //tracker
144  //hcal
149  //flags to disable calculations if same as reco (saves time)
154 
155 
156  std::vector<edm::ParameterSet> trigCutParams_; //probably the least bad option
157 
158  private: //disabling copy / assignment
159  OffHelper& operator=(const OffHelper& rhs){return *this;}
160  OffHelper(const OffHelper& rhs){}
161 
162  public:
164  ~OffHelper();
165 
167  void setupTriggers(const HLTConfigProvider& config,const std::vector<std::string>& hltFiltersUsed);
168 
169  //int is the error code, 0 = no error
170  //it should never throw, print to screen or crash, this is the only error reporting it does
171  int makeOffEvt(const edm::Event& edmEvent,const edm::EventSetup& setup,egHLT::OffEvt& offEvent);
172 
173 
174  int getHandles(const edm::Event& event,const edm::EventSetup& setup);
175  int fillOffEleVec(std::vector<OffEle>& offEles);
176  int fillOffPhoVec(std::vector<OffPho>& offPhos);
177  int setTrigInfo(const edm::Event & edmEvent, egHLT::OffEvt& offEvent);
178 
179  void fillIsolData(const reco::GsfElectron& ele,OffEle::IsolData& isolData);
180  void fillClusShapeData(const reco::GsfElectron& ele,OffEle::ClusShapeData& clusShapeData);
181  void fillHLTData(const reco::GsfElectron& ele,OffEle::HLTData& hltData);
182 
183  void fillIsolData(const reco::Photon& pho,OffPho::IsolData& isolData);
184  void fillClusShapeData(const reco::Photon& pho,OffPho::ClusShapeData& clusShapeData);
185  void fillHLTDataPho(const reco::Photon& pho,OffPho::HLTData& hltData);
186 
187  //tempory debugging functions
189  const std::vector<std::pair<TrigCodes::TrigBitSet,OffEgSel> >& trigCuts()const{return trigCuts_;}
190 
191 
192  template<class T> static bool getHandle(const edm::Event& event,const edm::EDGetTokenT<T>& token,edm::Handle<T>& handle);
193 
194  };
195 
196 
197  template<class T> bool OffHelper::getHandle(const edm::Event& event,const edm::EDGetTokenT<T>& token, edm::Handle<T>& handle)
198  {
199 
200  bool success=event.getByToken(token,handle);
201  return success && handle.product();
202 
203 
204  }
205 }
206 
207 #endif
double hltEMIsolEtaSliceEB_
edm::Handle< reco::TrackCollection > isolTrks_
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
int setTrigInfo(const edm::Event &edmEvent, egHLT::OffEvt &offEvent)
int fillOffPhoVec(std::vector< OffPho > &offPhos)
double hltPhoTrkIsolRSpan_
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken
OffEgSel phoLooseCuts_
void fillClusShapeData(const reco::GsfElectron &ele, OffEle::ClusShapeData &clusShapeData)
edm::Handle< reco::PhotonCollection > recoPhos_
std::vector< std::pair< TrigCodes::TrigBitSet, OffEgSel > > trigCuts_
double hltEMIsolOuterCone_
OffEgSel eleLooseCuts_
edm::EDGetTokenT< HBHERecHitCollection > hbheHitsToken
std::vector< std::string > l1PreScaledPaths_
EgammaHLTTrackIsolation * hltPhoTrkIsolAlgo_
#define NULL
Definition: scimark2.h:8
std::vector< std::pair< std::string, std::string > > l1PreAndSeedFilters_
double hltEleTrkIsolOuterCone_
void fillIsolData(const reco::GsfElectron &ele, OffEle::IsolData &isolData)
void fillHLTData(const reco::GsfElectron &ele, OffEle::HLTData &hltData)
edm::EDGetTokenT< reco::TrackCollection > isolTrkToken
double hltEMIsolInnerConeEE_
edm::EDGetTokenT< reco::GsfElectronCollection > electronsToken
const std::vector< std::pair< TrigCodes::TrigBitSet, OffEgSel > > & trigCuts() const
std::vector< edm::ParameterSet > trigCutParams_
double hltEleTrkIsolInnerCone_
edm::Handle< HBHERecHitCollection > hbheHits_
double hltPhoTrkIsolPtMin_
double hltEleTrkIsolZSpan_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
void fillHLTDataPho(const reco::Photon &pho, OffPho::HLTData &hltData)
double hltHadIsolInnerCone_
const trigger::TriggerEvent * trigEvt() const
double hltPhoTrkIsolZSpan_
std::vector< std::pair< std::string, int > > hltFiltersUsedWithNrCandsCut_
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitsEEToken
double hltEleTrkIsolRSpan_
double hltHadIsolOuterCone_
edm::EDGetTokenT< reco::PhotonCollection > photonsToken
tuple handle
Definition: patZpeak.py:22
static bool getHandle(const edm::Event &event, const edm::EDGetTokenT< T > &token, edm::Handle< T > &handle)
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
edm::Handle< HFRecHitCollection > hfHits_
edm::Handle< std::vector< reco::CaloJet > > recoJets_
double hltEleTrkIsolPtMin_
OffHelper & operator=(const OffHelper &rhs)
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 and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::ESHandle< MagneticField > magField_
tuple conf
Definition: dbtoconf.py:185
edm::Handle< trigger::TriggerEvent > trigEvt_
edm::ESHandle< CaloGeometry > caloGeom_
OffHelper(const OffHelper &rhs)
double hltPhoTrkIsolInnerCone_
double hltEMIsolEtaSliceEE_
double hltEMIsolInnerConeEB_
edm::Handle< reco::GsfElectronCollection > recoEles_
edm::EDGetTokenT< edm::TriggerResults > trigResultsToken
edm::EDGetTokenT< HFRecHitCollection > hfHitsToken
edm::Handle< edm::TriggerResults > trigResults_
edm::ESHandle< CaloTopology > caloTopology_
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken
T const * product() const
Definition: Handle.h:81
std::vector< std::string > l1PreScaledFilters_
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitsEBToken
edm::Handle< EcalRecHitCollection > eeRecHits_
int getHandles(const edm::Event &event, const edm::EventSetup &setup)
void setup(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
double hltPhoTrkIsolOuterCone_
edm::Handle< CaloTowerCollection > caloTowers_
edm::Handle< EcalRecHitCollection > ebRecHits_
std::vector< std::string > hltFiltersUsed_
edm::Handle< reco::VertexCollection > recoVertices_
edm::ESHandle< EcalSeverityLevelAlgo > ecalSeverityLevel_
EgammaHLTTrackIsolation * hltEleTrkIsolAlgo_
edm::Handle< reco::BeamSpot > beamSpot_
std::string hltTag_
void setupTriggers(const HLTConfigProvider &config, const std::vector< std::string > &hltFiltersUsed)
int makeOffEvt(const edm::Event &edmEvent, const edm::EventSetup &setup, egHLT::OffEvt &offEvent)
edm::EDGetTokenT< reco::VertexCollection > vertexToken
int fillOffEleVec(std::vector< OffEle > &offEles)