8 #include "TLorentzVector.h"
22 edm::LogInfo(
"DQMExample_Step1") <<
"Constructor DQMExample_Step1::DQMExample_Step1 " << std::endl;
48 edm::LogInfo(
"DQMExample_Step1") <<
"Destructor DQMExample_Step1::~DQMExample_Step1 " << std::endl;
56 edm::LogInfo(
"DQMExample_Step1") <<
"DQMExample_Step1::beginRun" << std::endl;
63 edm::LogInfo(
"DQMExample_Step1") <<
"DQMExample_Step1::bookHistograms" << std::endl;
73 edm::LogInfo(
"DQMExample_Step1") <<
"DQMExample_Step1::analyze" << std::endl;
81 edm::LogError(
"DQMClientExample") <<
"invalid collection: vertex"
86 int vertex_number = vertexHandle->size();
87 reco::VertexCollection::const_iterator
v = vertexHandle->begin();
90 if (vertex_number != 0)
91 PVPoint =
math::XYZPoint(v->position().x(), v->position().y(), v->position().z());
100 if (!pfMETCollection.
isValid()) {
101 edm::LogError(
"DQMClientExample") <<
"invalid collection: MET"
110 if (!electronCollection.
isValid()) {
111 edm::LogError(
"DQMClientExample") <<
"invalid collection: electrons"
117 int posEle = 0, negEle = 0;
120 for (reco::GsfElectronCollection::const_iterator recoElectron = electronCollection->begin();
121 recoElectron != electronCollection->end();
124 if (
MediumEle(e, eSetup, *recoElectron)) {
126 ele1 = &(*recoElectron);
128 else if (!ele2 && recoElectron->
pt() >
ptThrL2_)
129 ele2 = &(*recoElectron);
132 if (recoElectron->charge() == 1)
134 else if (recoElectron->charge() == -1)
139 nEle = posEle + negEle;
146 if (!caloJetCollection.
isValid()) {
147 edm::LogError(
"DQMClientExample") <<
"invalid collection: jets"
156 for (reco::CaloJetCollection::const_iterator i_calojet = caloJetCollection->begin();
157 i_calojet != caloJetCollection->end();
161 if (
Distance(*i_calojet, *ele1) < 0.3)
165 if (
Distance(*i_calojet, *ele2) < 0.3)
174 jet1 = &(*i_calojet);
177 jet2 = &(*i_calojet);
189 edm::LogError(
"DQMClientExample") <<
"invalid collection: TriggerResults"
194 bool hasFired =
false;
196 unsigned int numTriggers = trigNames.
size();
198 for (
unsigned int hltIndex = 0; hltIndex < numTriggers; ++hltIndex) {
199 if (trigNames.
triggerName(hltIndex) ==
triggerPath_ && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex))
207 edm::LogError(
"DQMClientExample") <<
"invalid collection: TriggerEvent"
217 if (!(filterIndex >= triggerEvent->sizeFilters())) {
219 std::vector<reco::Particle> triggeredEle;
221 for (
size_t j = 0;
j < keys.size(); ++
j) {
226 triggeredEle.push_back(foundObject.
particle());
230 if (!triggeredEle.empty())
231 ele1_HLT = &(triggeredEle.at(0));
268 if (ele1 && ele1_HLT &&
deltaR(*ele1_HLT, *ele1) < 0.3 && hasFired ==
true) {
293 h_vertex_number = ibooker_.
book1D(
"Vertex_number",
"Number of event vertices in collection", 40, -0.5, 39.5);
295 h_pfMet = ibooker_.
book1D(
"pfMet",
"Pf Missing E_{T}; GeV", 20, 0.0, 100);
318 ibooker_.
book1D(
"EleEta_leading_HLT_matched",
"Eta of leading electron @HLT", 50, -5., 5.);
320 ibooker_.
book1D(
"ElePhi_leading_HLT_matched",
"Phi of leading electron @HLT", 50, -3.5, 3.5);
322 h_ePt_diff = ibooker_.
book1D(
"ElePt_diff_matched",
"pT(RECO) - pT(HLT) for mathed candidates", 100, -10, 10.);
342 if (deltaPhi > 3.1415926) {
343 deltaPhi = 2 * 3.1415926 -
deltaPhi;
359 bool isMediumEle =
false;
361 float pt = electron.
pt();
362 float eta = electron.
eta();
364 int isEB = electron.
isEB();
385 if ((pt > 12.) && (fabs(eta) < 2.5) &&
386 (((isEB == 1) && (fabs(DetaIn) < 0.004)) || ((isEB == 0) && (fabs(DetaIn) < 0.007))) &&
387 (((isEB == 1) && (fabs(DphiIn) < 0.060)) || ((isEB == 0) && (fabs(DphiIn) < 0.030))) &&
388 (((isEB == 1) && (sigmaIetaIeta < 0.010)) || ((isEB == 0) && (sigmaIetaIeta < 0.030))) &&
389 (((isEB == 1) && (HOverE < 0.120)) || ((isEB == 0) && (HOverE < 0.100))) &&
390 (((isEB == 1) && (fabs(ooemoop) < 0.050)) || ((isEB == 0) && (fabs(ooemoop) < 0.050))) &&
391 (((isEB == 1) && (fabs(dxy) < 0.020)) || ((isEB == 0) && (fabs(dxy) < 0.020))) &&
392 (((isEB == 1) && (fabs(dz) < 0.100)) || ((isEB == 0) && (fabs(dz) < 0.100))) &&
393 (((isEB == 1) && (!isConverted)) || ((isEB == 0) && (!isConverted))) && (mishits == 0) &&
394 (nAmbiguousGsfTracks == 0))
~DQMExample_Step1() override
double calcDeltaPhi(double phi1, double phi2)
MonitorElement * h_ePhi_leading_matched
T getUntrackedParameter(std::string const &, T const &) const
double pt() const
transverse momentum
MonitorElement * h_jMultiplicity
bool MediumEle(const edm::Event &iEvent, const edm::EventSetup &iESetup, const reco::GsfElectron &electron)
edm::EDGetTokenT< reco::GsfElectronCollection > theElectronCollection_
Jets made from CaloTowers.
double pt() const final
transverse momentum
float eSuperClusterOverP() const
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
reco::Particle particle(reco::Particle::Charge q=0, const reco::Particle::Point &vertex=reco::Particle::Point(0, 0, 0), int status=0, bool integerCharge=true) const
MonitorElement * h_ePhi_leading_HLT_matched
MonitorElement * h_ePhi_leading
MonitorElement * h_eEta_leading_HLT
MonitorElement * h_jPhi_leading
edm::EDGetTokenT< reco::ConversionCollection > theConversionCollection_
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
Log< level::Error, false > LogError
double Distance(const reco::Candidate &c1, const reco::Candidate &c2)
int pdgId() const
PDG identifier.
DQMExample_Step1(const edm::ParameterSet &ps)
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
MonitorElement * h_eEta_leading
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< reco::BeamSpot > theBSCollection_
MonitorElement * h_ePt_leading_HLT
Single trigger physics object (e.g., an isolated muon)
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
float deltaEtaSuperClusterTrackAtVtx() const
MonitorElement * h_ePt_diff
MonitorElement * h_ePt_leading_HLT_matched
float sigmaIetaIeta() const
float hadronicOverEm() const
double phi() const
momentum azimuthal angle
MonitorElement * h_jEta_leading
void bookHistos(DQMStore::IBooker &)
float deltaPhiSuperClusterTrackAtVtx() const
Abs< T >::type abs(const T &t)
MonitorElement * h_eEta_leading_HLT_matched
MonitorElement * h_vertex_number
MonitorElement * h_ePt_leading
MonitorElement * h_eMultiplicity
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Log< level::Info, false > LogInfo
static const char *const trigNames[]
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
MonitorElement * h_jPt_leading
std::string const & triggerName(unsigned int index) const
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< size_type > Keys
MonitorElement * h_ePt_leading_matched
T getParameter(std::string const &) const
GsfTrackRefVector::size_type ambiguousGsfTracksSize() const
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
edm::InputTag triggerFilter_
MonitorElement * h_ePhi_leading_HLT
double DistancePhi(const reco::Candidate &c1, const reco::Candidate &c2)
const Point & position() const
position
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * h_eMultiplicity_HLT
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
double phi() const final
momentum azimuthal angle
double eta() const
momentum pseudorapidity
MonitorElement * h_eEta_leading_matched
edm::EDGetTokenT< reco::VertexCollection > thePVCollection_
edm::EDGetTokenT< reco::CaloJetCollection > theCaloJetCollection_
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
double eta() const final
momentum pseudorapidity
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override