7 #include <boost/algorithm/string.hpp>
26 beamSpot_(conf.getParameter<edm::InputTag>(
"beamSpot")) {
32 edm::LogInfo(
"TopElectronHLTOfflineSource") <<
"unable to get DQMStore service?";
114 std::vector<bool> superTriggerAccepts;
115 std::vector<bool> electronTriggerAccepts;
122 if (triggerIndex < hltResults->
size())
124 accept = hltResults->accept(triggerIndex);
127 superTriggerAccepts.push_back(accept);
135 if (triggerIndex < hltResults->
size())
137 accept = hltResults->accept(triggerIndex);
140 electronTriggerAccepts.push_back(accept);
153 if (vertexHandle.
product()->size() != 0)
163 vertexPoint = recoBeamSpotHandle->position();
167 std::vector<const trigger::TriggerObject*> triggerJets;
174 if(objNr<triggerEvent_->sizeObjects()){
181 std::vector<const trigger::TriggerObject*> triggerElectrons;
188 if(objNr<triggerEvent_->sizeObjects()){
189 triggerElectrons.push_back(&
triggerEvent_->getObjects()[objNr]);
196 for(
size_t eleNr=0; eleNr < eles.size(); ++eleNr)
208 if (superTriggerAccepts[
i])
209 fill(
eleMEs_[index], iEvent, eleNr, triggerJets, triggerElectrons, vertexPoint);
214 if (superTriggerAccepts[i] && electronTriggerAccepts[
j])
215 fill(
eleMEs_[index], iEvent, eleNr, triggerJets, triggerElectrons, vertexPoint);
225 for (
size_t i = 0;
i < eleIdNames.size(); ++
i)
237 LogDebug(
"TopElectronHLTOfflineSource") <<
"Booked MonitorElement with name " <<
name;
242 eleSet.
ele_et = dbe->
book1D(
"ele_"+name+
"_et",
"ele_"+name+
"_et", 50, 0., 500.);
243 eleSet.
ele_eta = dbe->
book1D(
"ele_"+name+
"_eta",
"ele_"+name+
"_eta", 50, -2.5, 2.5);
244 eleSet.
ele_phi = dbe->
book1D(
"ele_"+name+
"_phi",
"ele_"+name+
"_phi", 50, -3.1416, 3.1416);
245 eleSet.
ele_isolEm = dbe->
book1D(
"ele_"+name+
"_isolEm",
"ele_"+name+
"_isolEm", 50, -0.05, 3.);
246 eleSet.
ele_isolHad = dbe->
book1D(
"ele_"+name+
"_isolHad",
"ele_"+name+
"_isolHad", 50, -0.05, 5.);
247 eleSet.
ele_minDeltaR = dbe->
book1D(
"ele_"+name+
"_minDeltaR",
"ele_"+name+
"_minDeltaR", 50, 0., 1.);
248 eleSet.
global_n30jets = dbe->
book1D(
"ele_"+name+
"_global_n30jets",
"ele_"+name+
"_global_n30jets", 10, -0.5, 9.5);
249 eleSet.
global_sumEt = dbe->
book1D(
"ele_"+name+
"_global_sumEt",
"ele_"+name+
"_global_sumEt", 50, 0., 1000.);
253 eleSet.
ele_gsftrack_dzPV = dbe->
book1D(
"ele_"+name+
"_gsftrack_dzPV",
"ele_"+name+
"_gsftrack_dzPV", 50, 0., 0.2);
258 eleMENames_.push_back(
"EB");
259 eleMENames_.push_back(
"EE");
261 for (
size_t i=0;
i < eleIdNames_.size() * eleMENames_.size(); ++
i)
273 bool isTriggerMatched =
false;
274 for (
size_t i = 0;
i < triggerElectrons.size(); ++
i)
276 if (
deltaR(*(triggerElectrons[
i]), ele.
p4()) < 0.3)
277 isTriggerMatched =
true;
284 float minDeltaR = 999.;
287 for (
size_t jetNr = 0; jetNr < triggerJets.size(); ++jetNr)
330 eleMEs.
fill(eleMEs.
getMESet(
i,
j+1), ele, minDeltaR, sumEt, triggerJets.
size(), dzPV);
332 eleMEs.
fill(eleMEs.
getMESet(
i,
j+1), ele, minDeltaR, sumEt, triggerJets.
size(), dzPV);
342 LogDebug(
"TopElectronHLTOfflineSource") <<
"filling the histos with " << ele.
et();
T getParameter(std::string const &) const
bool requireTriggerMatch_
T getUntrackedParameter(std::string const &, T const &) const
virtual double et() const GCC11_FINAL
transverse energy
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * global_n30jets
MonitorElement * ele_minDeltaR
const LorentzVector & p4(P4Kind kind) const
void addMESets(const std::string &name)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::vector< EleMEs > eleMEs_
std::vector< std::string > eleIdNames_
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * ele_gsftrack_dzPV
const std::string & name(size_t i)
std::vector< std::string > electronIdNames_
MonitorElement * ele_gsftrack_etaError
MonitorElement * global_sumEt
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
const Point & position() const
position
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
edm::InputTag triggerResultsLabel_
std::vector< EleMESet > eleMESets_
MonitorElement * ele_gsftrack_numberOfValidHits
const std::vector< std::string > & eleIdNames()
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
edm::Handle< reco::GsfElectronCollection > eleHandle_
MonitorElement * ele_gsftrack_phiError
edm::InputTag triggerSummaryLabel_
std::vector< std::string > electronTriggerNames_
math::XYZPoint Point
point in the space
edm::InputTag electronLabel_
HLTConfigProvider hltConfig_
void setVerbose(unsigned level)
virtual void setupHistos(const std::vector< EleMEs >)
void fill(EleMESet &eleMESet, const reco::GsfElectron &ele, float minDeltaR, float sumEt, int n30jets, float dzPV)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
edm::InputTag primaryVertexLabel_
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< std::string > superTriggerNames_
EleMESet & getMESet(size_t namePos, size_t idPos)
edm::InputTag triggerJetFilterLabel_
edm::InputTag triggerElectronFilterLabel_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
void setup(DQMStore *dbe, const std::vector< std::string > &, bool addExtraId, const std::string &name)
T const * product() const
float dr03EcalRecHitSumEt() const
MonitorElement * ele_isolEm
double extraIdCutsSigmaPhi_
void fill(EleMEs &eleMEs, const edm::Event &iEvent, size_t eleIndex, const std::vector< const trigger::TriggerObject * > &triggerJets, const std::vector< const trigger::TriggerObject * > &triggerElectrons, const reco::Vertex::Point &vertexPoint)
const std::string fullName(size_t i)
float dr03HcalTowerSumEt() const
double extraIdCutsSigmaEta_
virtual void endRun(const edm::Run &run, const edm::EventSetup &c)
const std::vector< std::string > & eleMENames()
void setupMESet(EleMESet &eleSet, DQMStore *dbe, const std::string &name)
MonitorElement * ele_isolHad
edm::Handle< trigger::TriggerEvent > triggerEvent_
tuple size
Write out results.
virtual ~TopElectronHLTOfflineSource()
void setCurrentFolder(const std::string &fullpath)
TopElectronHLTOfflineSource(const edm::ParameterSet &conf)
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack