9 #include "TLorentzVector.h"
24 edm::LogInfo(
"DQMExample_Step1") <<
"Constructor DQMExample_Step1::DQMExample_Step1 " << std::endl;
52 edm::LogInfo(
"DQMExample_Step1") <<
"Destructor DQMExample_Step1::~DQMExample_Step1 " << std::endl;
60 edm::LogInfo(
"DQMExample_Step1") <<
"DQMExample_Step1::beginRun" << std::endl;
67 edm::LogInfo(
"DQMExample_Step1") <<
"DQMExample_Step1::bookHistograms" << std::endl;
78 edm::LogInfo(
"DQMExample_Step1") <<
"DQMExample_Step1::beginLuminosityBlock" << std::endl;
87 edm::LogInfo(
"DQMExample_Step1") <<
"DQMExample_Step1::analyze" << std::endl;
97 edm::LogError (
"DQMClientExample") <<
"invalid collection: vertex" <<
"\n";
101 int vertex_number = vertexHandle->size();
102 reco::VertexCollection::const_iterator
v = vertexHandle->begin();
105 if(vertex_number != 0)
106 PVPoint =
math::XYZPoint(v->position().x(), v->position().y(), v->position().z());
115 if ( !pfMETCollection.
isValid() )
117 edm::LogError (
"DQMClientExample") <<
"invalid collection: MET" <<
"\n";
125 if ( !electronCollection.
isValid() )
127 edm::LogError (
"DQMClientExample") <<
"invalid collection: electrons" <<
"\n";
132 int posEle=0, negEle=0;
135 for (reco::GsfElectronCollection::const_iterator recoElectron=electronCollection->begin(); recoElectron!=electronCollection->end(); ++recoElectron)
141 ele1 = &(*recoElectron);
143 else if(!ele2 && recoElectron->
pt() >
ptThrL2_)
144 ele2 = &(*recoElectron);
148 if(recoElectron->charge()==1)
150 else if(recoElectron->charge()==-1)
155 nEle = posEle+negEle;
162 if ( !caloJetCollection.
isValid() )
164 edm::LogError (
"DQMClientExample") <<
"invalid collection: jets" <<
"\n";
172 for (reco::CaloJetCollection::const_iterator i_calojet = caloJetCollection->begin(); i_calojet != caloJetCollection->end(); ++i_calojet)
176 if (
Distance(*i_calojet,*ele1) < 0.3)
continue;
179 if (
Distance(*i_calojet,*ele2) < 0.3)
continue;
181 if (i_calojet->pt() <
ptThrJet_)
continue;
186 jet1 = &(*i_calojet);
189 jet2 = &(*i_calojet);
202 edm::LogError (
"DQMClientExample") <<
"invalid collection: TriggerResults" <<
"\n";
206 bool hasFired =
false;
208 unsigned int numTriggers = trigNames.
size();
210 for(
unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex )
212 if (trigNames.
triggerName(hltIndex)==
triggerPath_ && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex))
223 edm::LogError (
"DQMClientExample") <<
"invalid collection: TriggerEvent" <<
"\n";
233 if( !(filterIndex >= triggerEvent->sizeFilters()) )
236 std::vector<reco::Particle> triggeredEle;
238 for(
size_t j = 0;
j < keys.size(); ++
j )
243 triggeredEle.push_back( foundObject.
particle() );
247 if( triggeredEle.size() >= 1 )
248 ele1_HLT = &(triggeredEle.at(0));
289 if( ele1 && ele1_HLT &&
deltaR(*ele1_HLT,*ele1) < 0.3 && hasFired==
true )
307 edm::LogInfo(
"DQMExample_Step1") <<
"DQMExample_Step1::endLuminosityBlock" << std::endl;
316 edm::LogInfo(
"DQMExample_Step1") <<
"DQMExample_Step1::endRun" << std::endl;
328 h_vertex_number = ibooker_.
book1D(
"Vertex_number",
"Number of event vertices in collection", 40,-0.5, 39.5 );
330 h_pfMet = ibooker_.
book1D(
"pfMet",
"Pf Missing E_{T}; GeV" , 20, 0.0 , 100);
355 h_ePt_diff = ibooker_.
book1D(
"ElePt_diff_matched",
"pT(RECO) - pT(HLT) for mathed candidates",100,-10,10.);
376 if (deltaPhi < 0) deltaPhi = -
deltaPhi;
377 if (deltaPhi > 3.1415926) {
378 deltaPhi = 2 * 3.1415926 -
deltaPhi;
393 bool isMediumEle =
false;
395 float pt = electron.
pt();
396 float eta = electron.
eta();
398 int isEB = electron.
isEB();
405 int mishits = electron.
gsfTrack()->trackerExpectedHitsInner().numberOfHits();
409 float dxy = eleTrack->dxy(
PVPoint_);
419 if( (pt > 12.) && (fabs(eta) < 2.5) &&
420 ( ( (isEB == 1) && (fabs(DetaIn) < 0.004) ) || ( (isEB == 0) && (fabs(DetaIn) < 0.007) ) ) &&
421 ( ( (isEB == 1) && (fabs(DphiIn) < 0.060) ) || ( (isEB == 0) && (fabs(DphiIn) < 0.030) ) ) &&
422 ( ( (isEB == 1) && (sigmaIetaIeta < 0.010) ) || ( (isEB == 0) && (sigmaIetaIeta < 0.030) ) ) &&
423 ( ( (isEB == 1) && (HOverE < 0.120) ) || ( (isEB == 0) && (HOverE < 0.100) ) ) &&
424 ( ( (isEB == 1) && (fabs(ooemoop) < 0.050) ) || ( (isEB == 0) && (fabs(ooemoop) < 0.050) ) ) &&
425 ( ( (isEB == 1) && (fabs(dxy) < 0.020) ) || ( (isEB == 0) && (fabs(dxy) < 0.020) ) ) &&
426 ( ( (isEB == 1) && (fabs(dz) < 0.100) ) || ( (isEB == 0) && (fabs(dz) < 0.100) ) ) &&
427 ( ( (isEB == 1) && (!isConverted) ) || ( (isEB == 0) && (!isConverted) ) ) &&
429 ( nAmbiguousGsfTracks == 0 )
double calcDeltaPhi(double phi1, double phi2)
MonitorElement * h_ePhi_leading_matched
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
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.
float eSuperClusterOverP() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void endLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
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_
Strings::size_type size() const
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
double Distance(const reco::Candidate &c1, const reco::Candidate &c2)
double eta() const
momentum pseudorapidity
DQMExample_Step1(const edm::ParameterSet &ps)
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)
double phi() const
momentum azimuthal angle
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
float deltaEtaSuperClusterTrackAtVtx() const
MonitorElement * h_ePt_diff
MonitorElement * h_ePt_leading_HLT_matched
float sigmaIetaIeta() const
float hadronicOverEm() const
MonitorElement * h_jEta_leading
void bookHistos(DQMStore::IBooker &)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
float deltaPhiSuperClusterTrackAtVtx() const
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
MonitorElement * h_eEta_leading_HLT_matched
MonitorElement * h_vertex_number
MonitorElement * h_ePt_leading
double pt() const
transverse momentum
MonitorElement * h_eMultiplicity
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
double deltaR(double eta1, double eta2, double phi1, double phi2)
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
static const char *const trigNames[]
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
MonitorElement * h_jPt_leading
void setCurrentFolder(const std::string &fullpath)
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
virtual ~DQMExample_Step1()
GsfTrackRefVector::size_type ambiguousGsfTracksSize() const
int pdgId() const
PDG identifier.
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 beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * h_eMultiplicity_HLT
virtual float pt() const GCC11_FINAL
transverse momentum
MonitorElement * h_eEta_leading_matched
edm::EDGetTokenT< reco::VertexCollection > thePVCollection_
edm::EDGetTokenT< reco::CaloJetCollection > theCaloJetCollection_
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector