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 
51 
53 class HLTConfigProvider;
55 
56 namespace egHLT {
57 
58  class OffHelper {
59 
60  private:
61  OffEgSel eleLooseCuts_; //loose selection cuts (loose has no relation to other 'loose' cuts)
62  OffEgSel eleCuts_; //normal selection cuts
63  OffEgSel phoLooseCuts_; //loose selection cuts (loose has no relation to other 'loose' cuts)
64  OffEgSel phoCuts_; //normal selection cuts
65 
66  std::vector<std::pair<TrigCodes::TrigBitSet,OffEgSel> > trigCuts_;//non sorted vector (for now)
67 
68 
82 
87 
93 
98 
101 
103 
105 
106 
107 
108  std::string hltTag_;
109  std::vector<std::string> hltFiltersUsed_;
110  std::vector<std::pair<std::string,int> > hltFiltersUsedWithNrCandsCut_; //stores the filter name + number of candidates required to pass that filter for it to accept
111  std::vector<std::pair<std::string,std::string> > l1PreAndSeedFilters_; //filter names of a l1 prescaler and the corresponding l1 seed filter
112  std::vector<std::string> l1PreScaledPaths_;//l1 pre-scaled path names
113  std::vector<std::string> l1PreScaledFilters_;//l1 pre scale filters
114 
115  //allow us to recompute e/gamma HLT isolations (note we also have em and hcal but they have to be declared for every event)
116  //which is awkward and I havent thought of a good way around it yet
119 
120  //our hlt isolation parameters...
121  //ecal
131  //tracker
143  //hcal
148  //flags to disable calculations if same as reco (saves time)
153 
154 
155  std::vector<edm::ParameterSet> trigCutParams_; //probably the least bad option
156 
157  private: //disabling copy / assignment
158  OffHelper& operator=(const OffHelper& rhs){return *this;}
159  OffHelper(const OffHelper& rhs){}
160 
161  public:
163  ~OffHelper();
164 
165  void setup(const edm::ParameterSet& conf);
166  void setupTriggers(const HLTConfigProvider& config,const std::vector<std::string>& hltFiltersUsed);
167 
168  //int is the error code, 0 = no error
169  //it should never throw, print to screen or crash, this is the only error reporting it does
170  int makeOffEvt(const edm::Event& edmEvent,const edm::EventSetup& setup,egHLT::OffEvt& offEvent);
171 
172 
173  int getHandles(const edm::Event& event,const edm::EventSetup& setup);
174  int fillOffEleVec(std::vector<OffEle>& offEles);
175  int fillOffPhoVec(std::vector<OffPho>& offPhos);
176  int setTrigInfo(const edm::Event & edmEvent, egHLT::OffEvt& offEvent);
177 
178  void fillIsolData(const reco::GsfElectron& ele,OffEle::IsolData& isolData);
179  void fillClusShapeData(const reco::GsfElectron& ele,OffEle::ClusShapeData& clusShapeData);
180  void fillHLTData(const reco::GsfElectron& ele,OffEle::HLTData& hltData);
181 
182  void fillIsolData(const reco::Photon& pho,OffPho::IsolData& isolData);
183  void fillClusShapeData(const reco::Photon& pho,OffPho::ClusShapeData& clusShapeData);
184  void fillHLTDataPho(const reco::Photon& pho,OffPho::HLTData& hltData);
185 
186  //tempory debugging functions
188  const std::vector<std::pair<TrigCodes::TrigBitSet,OffEgSel> >& trigCuts()const{return trigCuts_;}
189 
190 
191  template<class T> static bool getHandle(const edm::Event& event,const edm::InputTag& tag,edm::Handle<T>& handle);
192 
193  };
194 
195 
197  {
198 
199  bool success=event.getByLabel(tag,handle);
200  return success && handle.product();
201 
202 
203  }
204 }
205 
206 #endif
double hltEMIsolEtaSliceEB_
edm::Handle< reco::TrackCollection > isolTrks_
edm::InputTag ecalRecHitsEBTag_
edm::InputTag vertexTag_
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:27
int setTrigInfo(const edm::Event &edmEvent, egHLT::OffEvt &offEvent)
int fillOffPhoVec(std::vector< OffPho > &offPhos)
double hltPhoTrkIsolRSpan_
OffEgSel phoLooseCuts_
void fillClusShapeData(const reco::GsfElectron &ele, OffEle::ClusShapeData &clusShapeData)
edm::Handle< reco::PhotonCollection > recoPhos_
std::vector< std::pair< TrigCodes::TrigBitSet, OffEgSel > > trigCuts_
edm::InputTag caloJetsTag_
double hltEMIsolOuterCone_
OffEgSel eleLooseCuts_
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)
double hltEMIsolInnerConeEE_
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::InputTag electronsTag_
edm::InputTag hfHitsTag_
void fillHLTDataPho(const reco::Photon &pho, OffPho::HLTData &hltData)
double hltHadIsolInnerCone_
edm::InputTag isolTrkTag_
const trigger::TriggerEvent * trigEvt() const
double hltPhoTrkIsolZSpan_
std::vector< std::pair< std::string, int > > hltFiltersUsedWithNrCandsCut_
double hltEleTrkIsolRSpan_
double hltHadIsolOuterCone_
tuple handle
Definition: patZpeak.py:22
edm::Handle< HFRecHitCollection > hfHits_
edm::Handle< std::vector< reco::CaloJet > > recoJets_
edm::InputTag trigResultsTag_
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::InputTag triggerSummaryLabel_
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::Handle< edm::TriggerResults > trigResults_
edm::ESHandle< CaloTopology > caloTopology_
void setup(const edm::ParameterSet &conf)
edm::InputTag caloTowersTag_
T const * product() const
Definition: Handle.h:74
std::vector< std::string > l1PreScaledFilters_
edm::InputTag photonsTag_
edm::Handle< EcalRecHitCollection > eeRecHits_
int getHandles(const edm::Event &event, const edm::EventSetup &setup)
double hltPhoTrkIsolOuterCone_
edm::Handle< CaloTowerCollection > caloTowers_
edm::Handle< EcalRecHitCollection > ebRecHits_
std::vector< std::string > hltFiltersUsed_
edm::Handle< reco::VertexCollection > recoVertices_
static bool getHandle(const edm::Event &event, const edm::InputTag &tag, edm::Handle< T > &handle)
edm::ESHandle< EcalSeverityLevelAlgo > ecalSeverityLevel_
EgammaHLTTrackIsolation * hltEleTrkIsolAlgo_
edm::InputTag ecalRecHitsEETag_
edm::Handle< reco::BeamSpot > beamSpot_
std::string hltTag_
edm::InputTag hbheHitsTag_
void setupTriggers(const HLTConfigProvider &config, const std::vector< std::string > &hltFiltersUsed)
int makeOffEvt(const edm::Event &edmEvent, const edm::EventSetup &setup, egHLT::OffEvt &offEvent)
int fillOffEleVec(std::vector< OffEle > &offEles)
edm::InputTag beamSpotTag_