CMS 3D CMS Logo

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 
22 
31 
37 
42 
45 
51 
53 class HLTConfigProvider;
55 
56 namespace egHLT {
57 
58  class OffHelper {
59  private:
60  OffEgSel eleLooseCuts_; //loose selection cuts (loose has no relation to other 'loose' cuts)
61  OffEgSel eleCuts_; //normal selection cuts
62  OffEgSel phoLooseCuts_; //loose selection cuts (loose has no relation to other 'loose' cuts)
63  OffEgSel phoCuts_; //normal selection cuts
64 
65  std::vector<std::pair<TrigCodes::TrigBitSet, OffEgSel> > trigCuts_; //non sorted vector (for now)
66 
80 
85 
91 
96 
99 
101 
103 
105  std::vector<std::string> hltFiltersUsed_;
106  std::vector<std::pair<std::string, int> >
107  hltFiltersUsedWithNrCandsCut_; //stores the filter name + number of candidates required to pass that filter for it to accept
108  std::vector<std::pair<std::string, std::string> >
109  l1PreAndSeedFilters_; //filter names of a l1 prescaler and the corresponding l1 seed filter
110  std::vector<std::string> l1PreScaledPaths_; //l1 pre-scaled path names
111  std::vector<std::string> l1PreScaledFilters_; //l1 pre scale filters
112 
113  //allow us to recompute e/gamma HLT isolations (note we also have em and hcal but they have to be declared for every event)
114  //which is awkward and I havent thought of a good way around it yet
117 
118  //our hlt isolation parameters...
119  //ecal
129  //tracker
141  //hcal
146  //flags to disable calculations if same as reco (saves time)
151 
152  std::vector<edm::ParameterSet> trigCutParams_; //probably the least bad option
153 
154  private: //disabling copy / assignment
155  OffHelper& operator=(const OffHelper&) = delete;
156  OffHelper(const OffHelper&) = delete;
157 
158  public:
160  : eleLooseCuts_(),
161  eleCuts_(),
162  phoLooseCuts_(),
163  phoCuts_(),
164  hltEleTrkIsolAlgo_(nullptr),
165  hltPhoTrkIsolAlgo_(nullptr) {}
166  ~OffHelper();
167 
168  void setup(const edm::ParameterSet& conf, edm::ConsumesCollector&& iC);
170  const std::vector<std::string>& hltFiltersUsed,
171  const TrigCodes& trigCodes);
172 
173  //int is the error code, 0 = no error
174  //it should never throw, print to screen or crash, this is the only error reporting it does
175  int makeOffEvt(const edm::Event& edmEvent,
176  const edm::EventSetup& setup,
177  egHLT::OffEvt& offEvent,
178  const TrigCodes& trigCodes);
179 
180  int getHandles(const edm::Event& event, const edm::EventSetup& setup);
181  int fillOffEleVec(std::vector<OffEle>& offEles);
182  int fillOffPhoVec(std::vector<OffPho>& offPhos);
183  int setTrigInfo(const edm::Event& edmEvent, egHLT::OffEvt& offEvent, const TrigCodes& trigCodes);
184 
185  void fillIsolData(const reco::GsfElectron& ele, OffEle::IsolData& isolData);
186  void fillClusShapeData(const reco::GsfElectron& ele, OffEle::ClusShapeData& clusShapeData);
187  void fillHLTData(const reco::GsfElectron& ele, OffEle::HLTData& hltData);
188 
189  void fillIsolData(const reco::Photon& pho, OffPho::IsolData& isolData);
190  void fillClusShapeData(const reco::Photon& pho, OffPho::ClusShapeData& clusShapeData);
191  void fillHLTDataPho(const reco::Photon& pho, OffPho::HLTData& hltData);
192 
193  //tempory debugging functions
194  const trigger::TriggerEvent* trigEvt() const { return trigEvt_.product(); }
195  const std::vector<std::pair<TrigCodes::TrigBitSet, OffEgSel> >& trigCuts() const { return trigCuts_; }
196 
197  template <class T>
199  };
200 
201  template <class T>
203  bool success = event.getByToken(token, handle);
204  return success && handle.product();
205  }
206 } // namespace egHLT
207 
208 #endif
egHLT::OffHelper::recoJets_
edm::Handle< std::vector< reco::CaloJet > > recoJets_
Definition: EgHLTOffHelper.h:95
EcalSeverityLevelAlgo
Definition: EcalSeverityLevelAlgo.h:33
Handle.h
CaloJet.h
egHLT::OffHelper::trigResultsToken
edm::EDGetTokenT< edm::TriggerResults > trigResultsToken
Definition: EgHLTOffHelper.h:78
egHLT::OffHelper::hltEleTrkIsolZSpan_
double hltEleTrkIsolZSpan_
Definition: EgHLTOffHelper.h:139
egHLT::OffPho::IsolData
Definition: EgHLTOffPho.h:29
egHLT::OffHelper::ecalRecHitsEBToken
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitsEBToken
Definition: EgHLTOffHelper.h:67
CaloTower.h
egHLT::OffHelper::hltEleTrkIsolPtMin_
double hltEleTrkIsolPtMin_
Definition: EgHLTOffHelper.h:136
egHLT::OffHelper::trigCuts_
std::vector< std::pair< TrigCodes::TrigBitSet, OffEgSel > > trigCuts_
Definition: EgHLTOffHelper.h:65
edm::Handle::product
T const * product() const
Definition: Handle.h:70
egHLT::OffHelper::hltHadIsolEtMin_
double hltHadIsolEtMin_
Definition: EgHLTOffHelper.h:144
egHLT::OffHelper::eeRecHits_
edm::Handle< EcalRecHitCollection > eeRecHits_
Definition: EgHLTOffHelper.h:87
egHLT::OffHelper::caloTowers_
edm::Handle< CaloTowerCollection > caloTowers_
Definition: EgHLTOffHelper.h:98
ESHandle.h
TriggerResults.h
egHLT::OffHelper::magField_
edm::ESHandle< MagneticField > magField_
Definition: EgHLTOffHelper.h:83
patZpeak.handle
handle
Definition: patZpeak.py:23
egHLT::OffHelper::triggerSummaryToken
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
Definition: EgHLTOffHelper.h:73
edm::EDGetTokenT
Definition: EDGetToken.h:33
egHLT::OffHelper::setup
void setup(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
Definition: EgHLTOffHelper.cc:34
EgammaHLTTrackIsolation
Definition: EgammaHLTTrackIsolation.h:42
egHLT::OffHelper::hltEMIsolEtaSliceEE_
double hltEMIsolEtaSliceEE_
Definition: EgHLTOffHelper.h:126
egHLT::OffHelper::phoLooseCuts_
OffEgSel phoLooseCuts_
Definition: EgHLTOffHelper.h:62
EgHLTOffPho.h
egHLT::OffEvt
Definition: EgHLTOffEvt.h:29
egHLT::TrigCodes
Definition: EgHLTTrigCodes.h:20
egHLT::OffHelper::hltTag_
std::string hltTag_
Definition: EgHLTOffHelper.h:104
egHLT::OffPho::ClusShapeData
Definition: EgHLTOffPho.h:41
PhotonFwd.h
egHLT::OffHelper::setupTriggers
void setupTriggers(const HLTConfigProvider &config, const std::vector< std::string > &hltFiltersUsed, const TrigCodes &trigCodes)
Definition: EgHLTOffHelper.cc:100
egHLT::OffHelper::hltPhoTrkIsolAlgo_
EgammaHLTTrackIsolation * hltPhoTrkIsolAlgo_
Definition: EgHLTOffHelper.h:116
egHLT::OffHelper::caloGeom_
edm::ESHandle< CaloGeometry > caloGeom_
Definition: EgHLTOffHelper.h:81
egHLT::OffHelper::hltEMIsolInnerConeEE_
double hltEMIsolInnerConeEE_
Definition: EgHLTOffHelper.h:125
egHLT::OffHelper::caloJetsToken
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken
Definition: EgHLTOffHelper.h:69
edm::Handle
Definition: AssociativeIterator.h:50
egHLT::OffHelper::trigCutParams_
std::vector< edm::ParameterSet > trigCutParams_
Definition: EgHLTOffHelper.h:152
EcalRecHitCollections.h
egHLT::OffHelper::hltPhoTrkIsolInnerCone_
double hltPhoTrkIsolInnerCone_
Definition: EgHLTOffHelper.h:132
egHLT::OffHelper::hltPhoTrkIsolZSpan_
double hltPhoTrkIsolZSpan_
Definition: EgHLTOffHelper.h:133
egHLT::OffHelper::caloTopology_
edm::ESHandle< CaloTopology > caloTopology_
Definition: EgHLTOffHelper.h:82
egHLT::OffHelper::l1PreScaledFilters_
std::vector< std::string > l1PreScaledFilters_
Definition: EgHLTOffHelper.h:111
egHLT::OffHelper::recoVertices_
edm::Handle< reco::VertexCollection > recoVertices_
Definition: EgHLTOffHelper.h:102
config
Definition: config.py:1
Photon.h
egHLT::OffHelper::recoEles_
edm::Handle< reco::GsfElectronCollection > recoEles_
Definition: EgHLTOffHelper.h:94
egHLT::OffHelper::vertexToken
edm::EDGetTokenT< reco::VertexCollection > vertexToken
Definition: EgHLTOffHelper.h:79
egHLT::OffHelper::hltPhoTrkIsolCountTrks_
bool hltPhoTrkIsolCountTrks_
Definition: EgHLTOffHelper.h:135
egHLT::OffHelper::getHandles
int getHandles(const edm::Event &event, const edm::EventSetup &setup)
Definition: EgHLTOffHelper.cc:170
egHLT::OffHelper::beamSpotToken
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
Definition: EgHLTOffHelper.h:76
BeamSpot.h
egHLT::OffHelper::hltFiltersUsed_
std::vector< std::string > hltFiltersUsed_
Definition: EgHLTOffHelper.h:105
egHLT::OffHelper::OffHelper
OffHelper()
Definition: EgHLTOffHelper.h:159
egHLT::OffHelper::~OffHelper
~OffHelper()
Definition: EgHLTOffHelper.cc:27
EgHLTOffEgSel.h
egHLT::OffHelper::hltPhoTrkIsolOuterCone_
double hltPhoTrkIsolOuterCone_
Definition: EgHLTOffHelper.h:131
egHLT::OffHelper::trigCuts
const std::vector< std::pair< TrigCodes::TrigBitSet, OffEgSel > > & trigCuts() const
Definition: EgHLTOffHelper.h:195
IdealMagneticFieldRecord.h
edm::ESHandle< CaloGeometry >
summarizeEdmComparisonLogfiles.success
success
Definition: summarizeEdmComparisonLogfiles.py:115
egHLT::OffHelper::hltHadIsolInnerCone_
double hltHadIsolInnerCone_
Definition: EgHLTOffHelper.h:143
CaloTowerDefs.h
reco::GsfElectron
Definition: GsfElectron.h:34
GsfElectron.h
egHLT::OffHelper::calHLTEleTrkIsol_
bool calHLTEleTrkIsol_
Definition: EgHLTOffHelper.h:149
EgHLTOffEle.h
egHLT::OffHelper::hltEMIsolEtMinEB_
double hltEMIsolEtMinEB_
Definition: EgHLTOffHelper.h:123
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
egHLT::OffHelper::eleCuts_
OffEgSel eleCuts_
Definition: EgHLTOffHelper.h:61
egHLT::OffHelper::isolTrks_
edm::Handle< reco::TrackCollection > isolTrks_
Definition: EgHLTOffHelper.h:90
egHLT::OffHelper::hltEleTrkIsolOuterCone_
double hltEleTrkIsolOuterCone_
Definition: EgHLTOffHelper.h:137
egHLT::OffHelper::recoPhos_
edm::Handle< reco::PhotonCollection > recoPhos_
Definition: EgHLTOffHelper.h:93
egHLT::OffHelper::beamSpot_
edm::Handle< reco::BeamSpot > beamSpot_
Definition: EgHLTOffHelper.h:97
egHLT::OffHelper
Definition: EgHLTOffHelper.h:58
egHLT::OffHelper::hltEMIsolEMinEB_
double hltEMIsolEMinEB_
Definition: EgHLTOffHelper.h:124
GsfElectronFwd.h
edm::ParameterSet
Definition: ParameterSet.h:47
egHLT::OffHelper::hltEMIsolEMinEE_
double hltEMIsolEMinEE_
Definition: EgHLTOffHelper.h:128
Event.h
egHLT::OffHelper::isolTrkToken
edm::EDGetTokenT< reco::TrackCollection > isolTrkToken
Definition: EgHLTOffHelper.h:70
egHLT::OffHelper::eleLooseCuts_
OffEgSel eleLooseCuts_
Definition: EgHLTOffHelper.h:60
egHLT::OffHelper::hltHadIsolDepth_
int hltHadIsolDepth_
Definition: EgHLTOffHelper.h:145
egHLT::OffHelper::hbheHitsToken
edm::EDGetTokenT< HBHERecHitCollection > hbheHitsToken
Definition: EgHLTOffHelper.h:71
egHLT::OffHelper::fillClusShapeData
void fillClusShapeData(const reco::GsfElectron &ele, OffEle::ClusShapeData &clusShapeData)
Definition: EgHLTOffHelper.cc:310
egHLT::OffHelper::trigResults_
edm::Handle< edm::TriggerResults > trigResults_
Definition: EgHLTOffHelper.h:100
CaloTopologyRecord.h
egHLT::OffHelper::hbheHits_
edm::Handle< HBHERecHitCollection > hbheHits_
Definition: EgHLTOffHelper.h:89
egHLT::OffHelper::phoCuts_
OffEgSel phoCuts_
Definition: EgHLTOffHelper.h:63
egHLT::OffEgSel
Definition: EgHLTOffEgSel.h:24
egHLT::OffHelper::calHLTHcalIsol_
bool calHLTHcalIsol_
Definition: EgHLTOffHelper.h:147
egHLT::OffHelper::calHLTPhoTrkIsol_
bool calHLTPhoTrkIsol_
Definition: EgHLTOffHelper.h:150
egHLT::OffHelper::ecalSeverityLevel_
edm::ESHandle< EcalSeverityLevelAlgo > ecalSeverityLevel_
Definition: EgHLTOffHelper.h:84
egHLT::OffHelper::ebRecHits_
edm::Handle< EcalRecHitCollection > ebRecHits_
Definition: EgHLTOffHelper.h:86
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:58
egHLT::OffHelper::fillHLTDataPho
void fillHLTDataPho(const reco::Photon &pho, OffPho::HLTData &hltData)
Definition: EgHLTOffHelper.cc:392
trigger::TriggerEvent
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
egHLT::OffPho::HLTData
Definition: EgHLTOffPho.h:53
egHLT::OffHelper::hltEMIsolEtMinEE_
double hltEMIsolEtMinEE_
Definition: EgHLTOffHelper.h:127
egHLT::OffHelper::hfHits_
edm::Handle< HFRecHitCollection > hfHits_
Definition: EgHLTOffHelper.h:88
egHLT::OffHelper::fillOffPhoVec
int fillOffPhoVec(std::vector< OffPho > &offPhos)
Definition: EgHLTOffHelper.cc:403
egHLT::OffHelper::setTrigInfo
int setTrigInfo(const edm::Event &edmEvent, egHLT::OffEvt &offEvent, const TrigCodes &trigCodes)
Definition: EgHLTOffHelper.cc:512
InputTag.h
egHLT::OffEle::IsolData
Definition: EgHLTOffEle.h:32
CaloTopology.h
ValueMap.h
VertexFwd.h
egHLT::OffHelper::trigEvt
const trigger::TriggerEvent * trigEvt() const
Definition: EgHLTOffHelper.h:194
reco::Photon
Definition: Photon.h:21
egHLT::OffHelper::fillHLTData
void fillHLTData(const reco::GsfElectron &ele, OffEle::HLTData &hltData)
Definition: EgHLTOffHelper.cc:354
HLTConfigProvider
Definition: HLTConfigProvider.h:29
egHLT::OffHelper::hltHadIsolOuterCone_
double hltHadIsolOuterCone_
Definition: EgHLTOffHelper.h:142
egHLT::OffHelper::hltEMIsolEtaSliceEB_
double hltEMIsolEtaSliceEB_
Definition: EgHLTOffHelper.h:122
egHLT::OffHelper::hltPhoTrkIsolRSpan_
double hltPhoTrkIsolRSpan_
Definition: EgHLTOffHelper.h:134
CaloGeometry.h
egHLT::OffHelper::trigEvt_
edm::Handle< trigger::TriggerEvent > trigEvt_
Definition: EgHLTOffHelper.h:92
egHLT::OffHelper::l1PreAndSeedFilters_
std::vector< std::pair< std::string, std::string > > l1PreAndSeedFilters_
Definition: EgHLTOffHelper.h:109
HcalRecHitCollections.h
egHLT::OffHelper::fillIsolData
void fillIsolData(const reco::GsfElectron &ele, OffEle::IsolData &isolData)
Definition: EgHLTOffHelper.cc:260
egHLT::OffHelper::hltEleTrkIsolAlgo_
EgammaHLTTrackIsolation * hltEleTrkIsolAlgo_
Definition: EgHLTOffHelper.h:115
EgHLTTrigCodes.h
egHLT::OffHelper::operator=
OffHelper & operator=(const OffHelper &)=delete
ConsumesCollector.h
egHLT::OffHelper::hltPhoTrkIsolPtMin_
double hltPhoTrkIsolPtMin_
Definition: EgHLTOffHelper.h:130
ParameterSet.h
egHLT::OffHelper::hfHitsToken
edm::EDGetTokenT< HFRecHitCollection > hfHitsToken
Definition: EgHLTOffHelper.h:72
egHLT::OffHelper::l1PreScaledPaths_
std::vector< std::string > l1PreScaledPaths_
Definition: EgHLTOffHelper.h:110
egHLT::OffHelper::hltEleTrkIsolInnerCone_
double hltEleTrkIsolInnerCone_
Definition: EgHLTOffHelper.h:138
egHLT::OffHelper::caloTowersToken
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken
Definition: EgHLTOffHelper.h:77
egHLT::OffHelper::hltEMIsolOuterCone_
double hltEMIsolOuterCone_
Definition: EgHLTOffHelper.h:120
EgHLTOffEvt.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
egHLT::OffHelper::ecalRecHitsEEToken
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitsEEToken
Definition: EgHLTOffHelper.h:68
egHLT
Definition: EgHLTBinData.h:10
egHLT::OffHelper::hltFiltersUsedWithNrCandsCut_
std::vector< std::pair< std::string, int > > hltFiltersUsedWithNrCandsCut_
Definition: EgHLTOffHelper.h:107
egHLT::OffEle::ClusShapeData
Definition: EgHLTOffEle.h:47
egHLT::OffHelper::photonsToken
edm::EDGetTokenT< reco::PhotonCollection > photonsToken
Definition: EgHLTOffHelper.h:75
egHLT::OffEle::HLTData
Definition: EgHLTOffEle.h:59
egHLT::OffHelper::calHLTEmIsol_
bool calHLTEmIsol_
Definition: EgHLTOffHelper.h:148
egHLT::OffHelper::getHandle
static bool getHandle(const edm::Event &event, const edm::EDGetTokenT< T > &token, edm::Handle< T > &handle)
Definition: EgHLTOffHelper.h:202
egHLT::OffHelper::electronsToken
edm::EDGetTokenT< reco::GsfElectronCollection > electronsToken
Definition: EgHLTOffHelper.h:74
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
egHLT::OffHelper::makeOffEvt
int makeOffEvt(const edm::Event &edmEvent, const edm::EventSetup &setup, egHLT::OffEvt &offEvent, const TrigCodes &trigCodes)
Definition: EgHLTOffHelper.cc:151
egHLT::OffHelper::hltEleTrkIsolRSpan_
double hltEleTrkIsolRSpan_
Definition: EgHLTOffHelper.h:140
egHLT::OffHelper::hltEMIsolInnerConeEB_
double hltEMIsolInnerConeEB_
Definition: EgHLTOffHelper.h:121
egHLT::OffHelper::fillOffEleVec
int fillOffEleVec(std::vector< OffEle > &offEles)
Definition: EgHLTOffHelper.cc:218
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316