7 #include <boost/algorithm/string.hpp>
26 beamSpot_(consumes<
reco::
BeamSpot>(conf.getParameter<edm::InputTag>(
"beamSpot"))) {
32 edm::LogInfo(
"TopElectronHLTOfflineSource") <<
"unable to get DQMStore service?";
116 std::vector<bool> superTriggerAccepts;
117 std::vector<bool> electronTriggerAccepts;
124 if (triggerIndex < hltResults->
size())
126 accept = hltResults->accept(triggerIndex);
129 superTriggerAccepts.push_back(accept);
137 if (triggerIndex < hltResults->
size())
139 accept = hltResults->accept(triggerIndex);
142 electronTriggerAccepts.push_back(accept);
155 if (vertexHandle.
product()->size() != 0)
165 vertexPoint = recoBeamSpotHandle->position();
169 std::vector<const trigger::TriggerObject*> triggerJets;
176 if(objNr<triggerEvent_->sizeObjects()){
183 std::vector<const trigger::TriggerObject*> triggerElectrons;
190 if(objNr<triggerEvent_->sizeObjects()){
191 triggerElectrons.push_back(&
triggerEvent_->getObjects()[objNr]);
198 for(
size_t eleNr=0; eleNr < eles.size(); ++eleNr)
210 if (superTriggerAccepts[
i])
211 fill(
eleMEs_[index], iEvent, eleNr, triggerJets, triggerElectrons, vertexPoint);
216 if (superTriggerAccepts[i] && electronTriggerAccepts[
j])
217 fill(
eleMEs_[index], iEvent, eleNr, triggerJets, triggerElectrons, vertexPoint);
227 for (
size_t i = 0;
i < eleIdNames.size(); ++
i)
239 LogDebug(
"TopElectronHLTOfflineSource") <<
"Booked MonitorElement with name " <<
name;
244 eleSet.
ele_et = dbe->
book1D(
"ele_"+name+
"_et",
"ele_"+name+
"_et", 50, 0., 500.);
245 eleSet.
ele_eta = dbe->
book1D(
"ele_"+name+
"_eta",
"ele_"+name+
"_eta", 50, -2.5, 2.5);
246 eleSet.
ele_phi = dbe->
book1D(
"ele_"+name+
"_phi",
"ele_"+name+
"_phi", 50, -3.1416, 3.1416);
247 eleSet.
ele_isolEm = dbe->
book1D(
"ele_"+name+
"_isolEm",
"ele_"+name+
"_isolEm", 50, -0.05, 3.);
248 eleSet.
ele_isolHad = dbe->
book1D(
"ele_"+name+
"_isolHad",
"ele_"+name+
"_isolHad", 50, -0.05, 5.);
249 eleSet.
ele_minDeltaR = dbe->
book1D(
"ele_"+name+
"_minDeltaR",
"ele_"+name+
"_minDeltaR", 50, 0., 1.);
250 eleSet.
global_n30jets = dbe->
book1D(
"ele_"+name+
"_global_n30jets",
"ele_"+name+
"_global_n30jets", 10, -0.5, 9.5);
251 eleSet.
global_sumEt = dbe->
book1D(
"ele_"+name+
"_global_sumEt",
"ele_"+name+
"_global_sumEt", 50, 0., 1000.);
255 eleSet.
ele_gsftrack_dzPV = dbe->
book1D(
"ele_"+name+
"_gsftrack_dzPV",
"ele_"+name+
"_gsftrack_dzPV", 50, 0., 0.2);
260 eleMENames_.push_back(
"EB");
261 eleMENames_.push_back(
"EE");
263 for (
size_t i=0;
i < eleIdNames_.size() * eleMENames_.size(); ++
i)
275 bool isTriggerMatched =
false;
276 for (
size_t i = 0;
i < triggerElectrons.size(); ++
i)
278 if (
deltaR(*(triggerElectrons[
i]), ele.
p4()) < 0.3)
279 isTriggerMatched =
true;
286 float minDeltaR = 999.;
289 for (
size_t jetNr = 0; jetNr < triggerJets.size(); ++jetNr)
344 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 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.
virtual double et() const
transverse energy
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< EleMEs > eleMEs_
virtual float phi() const
momentum azimuthal angle
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)
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > eleIdTokenCollection_
const Point & position() const
position
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::vector< EleMESet > eleMESets_
MonitorElement * ele_gsftrack_numberOfValidHits
const std::vector< std::string > & eleIdNames()
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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)
edm::EDGetTokenT< edm::TriggerResults > triggerResultsLabel_
edm::EDGetTokenT< reco::BeamSpot > beamSpot_
edm::Handle< reco::GsfElectronCollection > eleHandle_
MonitorElement * ele_gsftrack_phiError
virtual float eta() const
momentum pseudorapidity
std::vector< std::string > electronTriggerNames_
Abs< T >::type abs(const T &t)
math::XYZPoint Point
point in the space
HLTConfigProvider hltConfig_
void setVerbose(unsigned level)
virtual void setupHistos(const std::vector< EleMEs >)
edm::EDGetTokenT< reco::VertexCollection > primaryVertexLabel_
void fill(EleMESet &eleMESet, const reco::GsfElectron &ele, float minDeltaR, float sumEt, int n30jets, float dzPV)
double deltaR(double eta1, double eta2, double phi1, double phi2)
edm::EDGetTokenT< reco::GsfElectronCollection > electronLabel_
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_
double dzPV(const LorentzVector &vtx, const LorentzVector &p4, const LorentzVector &pv)
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)
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryLabel_
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