60 #include "TLorentzVector.h"
73 using namespace trigger;
79 return c1.
pt() > c2.
pt();
89 edm::LogInfo(
"ExoticaDQM") <<
" Starting ExoticaDQM " <<
"\n" ;
91 typedef std::vector<edm::InputTag> vtag;
101 ElectronToken_ = consumes<reco::GsfElectronCollection>(
103 PFElectronTokenEI_ = consumes<reco::PFCandidateCollection>(
106 MuonToken_ = consumes<reco::MuonCollection>(
108 PFMuonTokenEI_ = consumes<reco::PFCandidateCollection>(
111 TauToken_ = consumes<reco::CaloTauCollection>(
115 PhotonToken_ = consumes<reco::PhotonCollection>(
119 CaloJetToken_ = consumes<reco::CaloJetCollection>(
121 PFJetToken_ = consumes<reco::PFJetCollection>(
123 PFJetTokenEI_ = consumes<reco::PFJetCollection>(
127 CaloMETToken_ = consumes<reco::CaloMETCollection>(
129 PFMETToken_ = consumes<reco::PFMETCollection>(
131 PFMETTokenEI_ = consumes<reco::PFMETCollection>(
134 ecalBarrelRecHitToken_ = consumes<EBRecHitCollection>(
136 ecalEndcapRecHitToken_ = consumes<EERecHitCollection>(
141 mj_monojet_ptPFJet_ = ps.
getParameter<
double>(
"mj_monojet_ptPFJet");
142 mj_monojet_ptPFMuon_ = ps.
getParameter<
double>(
"mj_monojet_ptPFMuon");
143 mj_monojet_ptPFElectron_ = ps.
getParameter<
double>(
"mj_monojet_ptPFElectron");
156 edm::LogInfo(
"ExoticaDQM") <<
" Deleting ExoticaDQM " <<
"\n" ;
174 edm::LogInfo (
"ExoticaDQM") <<
"[ExoticaDQM]: Begining of Run";
177 bei_->setCurrentFolder(
"Physics/Exotica");
181 bool isConfigChanged =
false;
185 const std::string hltProcessName = theTriggerResultsCollection.process();
186 isValidHltConfig_ = hltConfigProvider_.init( run, eSetup, hltProcessName, isConfigChanged );
209 mj_monojet_pfchef = bei->
book1D(
"mj_monojet_pfchef",
"PFJetID CHEF", 50, 0.0 , 1.0);
210 mj_monojet_pfnhef = bei->
book1D(
"mj_monojet_pfnhef",
"PFJetID NHEF", 50, 0.0 , 1.0);
211 mj_monojet_pfcemf = bei->
book1D(
"mj_monojet_pfcemf",
"PFJetID CEMF", 50, 0.0 , 1.0);
212 mj_monojet_pfnemf = bei->
book1D(
"mj_monojet_pfnemf",
"PFJetID NEMF", 50, 0.0 , 1.0);
213 mj_monojet_pfJet1_pt = bei->
book1D(
"mj_monojet_pfJet1_pt",
"Pt of PFJet-1 (GeV)", 40, 0.0 , 1000);
214 mj_monojet_pfJet2_pt = bei->
book1D(
"mj_monojet_pfJet2_pt",
"Pt of PFJet-2 (GeV)", 40, 0.0 , 1000);
215 mj_monojet_pfJet1_eta = bei->
book1D(
"mj_monojet_pfJet1_eta",
"#eta(PFJet-1)", 50, -5.0, 5.0);
216 mj_monojet_pfJet2_eta = bei->
book1D(
"mj_monojet_pfJet2_eta",
"#eta(PFJet-2)", 50, -5.0, 5.0);
217 mj_monojet_pfJetMulti = bei->
book1D(
"mj_monojet_pfJetMulti",
"No. of PFJets", 10, 0., 10.);
218 mj_monojet_deltaPhiPFJet1PFJet2 = bei->
book1D(
"mj_monojet_deltaPhiPFJet1PFJet2",
"#Delta#phi(PFJet1, PFJet2)", 40, 0., 4.);
219 mj_monojet_deltaRPFJet1PFJet2 = bei->
book1D(
"mj_monojet_deltaRPFJet1PFJet2",
"#DeltaR(PFJet1, PFJet2)", 50, 0., 10.);
220 mj_monojet_pfmetnomu = bei->
book1D(
"mj_monojet_pfmetnomu",
"PFMET no Mu", 100, 0.0 , 500.0);
221 mj_caloMet_et = bei->
book1D(
"mj_caloMet",
"Calo Missing E_{T}; GeV", 50, 0.0 , 500);
222 mj_caloMet_phi = bei->
book1D(
"mj_caloMet_phi",
"Calo Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
223 mj_pfMet_et = bei->
book1D(
"mj_pfMet",
"Pf Missing E_{T}; GeV", 50, 0.0 , 500);
224 mj_pfMet_phi = bei->
book1D(
"mj_pfMet_phi",
"Pf Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
231 ll_gammajet_sMajMajPhot = bei->
book1D(
"ll_gammajet_sMajMajPhot",
"sMajMajPhot", 50, 0.0 , 5.0);
232 ll_gammajet_sMinMinPhot = bei->
book1D(
"ll_gammajet_sMinMinPhot",
"sMinMinPhot", 50, 0.0 , 5.0);
239 ei_pfjet1_pt = bei->
book1D(
"ei_pfjet1_pt",
"Pt of PFJet-1 (EI) (GeV)", 40, 0.0 , 1000);
240 ei_pfmet_pt = bei->
book1D(
"ei_pfmet_pt",
"Pt of PFMET (EI) (GeV)", 40, 0.0 , 1000);
255 bool ValidCaloElectron = iEvent.
getByToken(ElectronToken_, ElectronCollection_);
256 if(!ValidCaloElectron)
return;
258 bool ValidCaloMuon = iEvent.
getByToken(MuonToken_, MuonCollection_);
259 if(!ValidCaloMuon)
return;
261 bool ValidCaloTau = iEvent.
getByToken(TauToken_, TauCollection_);
262 if(!ValidCaloTau)
return;
264 bool ValidCaloPhoton = iEvent.
getByToken(PhotonToken_, PhotonCollection_);
265 if(!ValidCaloPhoton)
return;
267 bool ValidCaloJet = iEvent.
getByToken(CaloJetToken_, caloJetCollection_);
268 if(!ValidCaloJet)
return;
269 calojets = *caloJetCollection_;
271 bool ValidCaloMET = iEvent.
getByToken(CaloMETToken_, caloMETCollection_);
272 if(!ValidCaloMET)
return;
277 bool ValidPFJet = iEvent.
getByToken(PFJetToken_, pfJetCollection_);
278 if(!ValidPFJet)
return;
279 pfjets = *pfJetCollection_;
281 bool ValidPFMET = iEvent.
getByToken(PFMETToken_, pfMETCollection_);
282 if(!ValidPFMET)
return;
287 for(
int i=0;
i<2;
i++){
309 CaloJetCollection::const_iterator calojet_ = calojets.begin();
310 for(; calojet_ != calojets.end(); ++calojet_){
312 jetID->calculate(iEvent, *calojet_);
314 if(scale*calojet_->pt()>CaloJetPt[0]){
315 CaloJetPt[1] = CaloJetPt[0];
316 CaloJetPx[1] = CaloJetPx[0];
317 CaloJetPy[1] = CaloJetPy[0];
318 CaloJetEta[1] = CaloJetEta[0];
319 CaloJetPhi[1] = CaloJetPhi[0];
320 CaloJetEMF[1] = CaloJetEMF[0];
321 CaloJetfHPD[1] = CaloJetfHPD[0];
322 CaloJetn90[1] = CaloJetn90[0];
324 CaloJetPt[0] = scale*calojet_->pt();
325 CaloJetPx[0] = scale*calojet_->px();
326 CaloJetPy[0] = scale*calojet_->py();
327 CaloJetEta[0] = calojet_->eta();
328 CaloJetPhi[0] = calojet_->phi();
329 CaloJetEMF[0] = calojet_->emEnergyFraction();
330 CaloJetfHPD[0] =
jetID->fHPD();
331 CaloJetn90[0] =
jetID->n90Hits();
333 else if(scale*calojet_->pt()<CaloJetPt[0] && scale*calojet_->pt()>CaloJetPt[1] ){
334 CaloJetPt[1] = scale*calojet_->pt();
335 CaloJetPx[1] = scale*calojet_->px();
336 CaloJetPy[1] = scale*calojet_->py();
337 CaloJetEta[1] = calojet_->eta();
338 CaloJetPhi[1] = calojet_->phi();
339 CaloJetEMF[1] = calojet_->emEnergyFraction();
340 CaloJetfHPD[1] =
jetID->fHPD();
341 CaloJetn90[1] =
jetID->n90Hits();
347 mj_monojet_countPFJet=0;
349 PFJetCollection::const_iterator pfjet_ = pfjets.begin();
350 for(; pfjet_ != pfjets.end(); ++pfjet_){
352 if(scale*pfjet_->pt()>PFJetPt[0]){
353 PFJetPt[1] = PFJetPt[0];
354 PFJetPx[1] = PFJetPx[0];
355 PFJetPy[1] = PFJetPy[0];
356 PFJetEta[1] = PFJetEta[0];
357 PFJetPhi[1] = PFJetPhi[0];
358 PFJetNHEF[1] = PFJetNHEF[0];
359 PFJetCHEF[1] = PFJetCHEF[0];
360 PFJetNEMF[1] = PFJetNEMF[0];
361 PFJetCEMF[1] = PFJetCEMF[0];
363 PFJetPt[0] = scale*pfjet_->pt();
364 PFJetPx[0] = scale*pfjet_->px();
365 PFJetPy[0] = scale*pfjet_->py();
366 PFJetEta[0] = pfjet_->eta();
367 PFJetPhi[0] = pfjet_->phi();
368 PFJetNHEF[0] = pfjet_->neutralHadronEnergyFraction();
369 PFJetCHEF[0] = pfjet_->chargedHadronEnergyFraction();
370 PFJetNEMF[0] = pfjet_->neutralEmEnergyFraction();
371 PFJetCEMF[0] = pfjet_->chargedEmEnergyFraction();
373 else if(scale*pfjet_->pt()<PFJetPt[0] && scale*pfjet_->pt()>PFJetPt[1] ){
374 PFJetPt[1] = scale*pfjet_->pt();
375 PFJetPx[1] = scale*pfjet_->px();
376 PFJetPy[1] = scale*pfjet_->py();
377 PFJetEta[1] = pfjet_->eta();
378 PFJetPhi[1] = pfjet_->phi();
379 PFJetNHEF[1] = pfjet_->neutralHadronEnergyFraction();
380 PFJetCHEF[1] = pfjet_->chargedHadronEnergyFraction();
381 PFJetNEMF[1] = pfjet_->neutralEmEnergyFraction();
382 PFJetCEMF[1] = pfjet_->chargedEmEnergyFraction();
385 if(scale*pfjet_->pt()>mj_monojet_ptPFJet_) mj_monojet_countPFJet++;
392 analyzeMultiJets(iEvent);
395 analyzeLongLived(iEvent);
398 analyzeEventInterpretation(iEvent, iSetup);
418 mj_monojet_pfJet1_pt->Fill(PFJetPt[0]);
419 mj_monojet_pfJet1_eta->Fill(PFJetEta[0]);
420 mj_monojet_pfchef->Fill(PFJetCHEF[0]);
421 mj_monojet_pfnhef->Fill(PFJetNHEF[0]);
422 mj_monojet_pfcemf->Fill(PFJetCEMF[0]);
423 mj_monojet_pfnemf->Fill(PFJetNEMF[0]);
424 mj_monojet_pfJetMulti->Fill(mj_monojet_countPFJet);
427 mj_monojet_pfJet2_pt->Fill(PFJetPt[1]);
428 mj_monojet_pfJet2_eta->Fill(PFJetEta[1]);
429 mj_monojet_deltaPhiPFJet1PFJet2->Fill(
deltaPhi(PFJetPhi[0],PFJetPhi[1]));
430 mj_monojet_deltaRPFJet1PFJet2->Fill(
deltaR(PFJetEta[0],PFJetPhi[0],
431 PFJetEta[1],PFJetPhi[1]));
437 mj_caloMet_et->Fill(met.
et());
438 mj_caloMet_phi->Fill(met.
phi());
442 const PFMET pfmet = pfmetcol->front();
443 mj_pfMet_et->Fill(pfmet.
et());
444 mj_pfMet_phi->Fill(pfmet.
phi());
455 iEvent.
getByToken(ecalBarrelRecHitToken_, ecalhitseb);
456 rhitseb = ecalhitseb.
product();
460 iEvent.
getByToken(ecalEndcapRecHitToken_, ecalhitsee);
461 rhitsee = ecalhitsee.
product();
464 reco::PhotonCollection::const_iterator photon = PhotonCollection_->begin();
465 for(; photon != PhotonCollection_->end(); ++photon){
466 if(photon->energy()<3.)
continue;
467 if(nPhot>=40)
continue;
473 std::pair<DetId, float> maxRH = EcalClusterTools::getMaximum( *theSeed, &(*rechits) );
476 Cluster2ndMoments moments = EcalClusterTools::cluster2ndMoments(*SCseed, *rechits);
478 ll_gammajet_sMajMajPhot->Fill(moments.
sMaj);
479 ll_gammajet_sMinMinPhot->Fill(moments.
sMin);
482 ll_gammajet_sMajMajPhot->Fill(-100.);
483 ll_gammajet_sMinMinPhot->Fill(-100.);
497 bool ValidPFElectronEI = iEvent.
getByToken(PFElectronTokenEI_, pfElectronCollectionEI_);
498 if(!ValidPFElectronEI)
return;
499 pfelectronsEI = *pfElectronCollectionEI_;
502 bool ValidPFMuonEI = iEvent.
getByToken(PFMuonTokenEI_, pfMuonCollectionEI_);
503 if(!ValidPFMuonEI)
return;
504 pfmuonsEI = *pfMuonCollectionEI_;
507 bool ValidPFJetEI = iEvent.
getByToken(PFJetTokenEI_, pfJetCollectionEI_);
508 if(!ValidPFJetEI)
return;
509 pfjetsEI = *pfJetCollectionEI_;
512 bool ValidPFMETEI = iEvent.
getByToken(PFMETTokenEI_, pfMETCollectionEI_);
513 if(!ValidPFMETEI)
return;
519 PFJetCollection::const_iterator pfjet_ = pfjetsEI.begin();
520 for(; pfjet_ != pfjetsEI.end(); ++pfjet_){
522 if(scale*pfjet_->pt()<PFJetEIPt)
continue;
523 PFJetEIPt = scale*pfjet_->pt();
524 PFJetEIPx = scale*pfjet_->px();
525 PFJetEIPy = scale*pfjet_->py();
526 PFJetEIEta = pfjet_->eta();
527 PFJetEIPhi = pfjet_->phi();
528 PFJetEINHEF = pfjet_->neutralHadronEnergyFraction();
529 PFJetEICHEF = pfjet_->chargedHadronEnergyFraction();
530 PFJetEINEMF = pfjet_->neutralEmEnergyFraction();
531 PFJetEICEMF = pfjet_->chargedEmEnergyFraction();
535 ei_pfjet1_pt->Fill(PFJetEIPt);
539 const PFMET pfmetEI = pfmetcolEI->front();
540 ei_pfmet_pt->Fill(pfmetEI.
et());
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual double et() const GCC11_FINAL
transverse energy
virtual void analyzeLongLivedTrigger(edm::Event const &e)
virtual void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
virtual void analyzeMultiJetsTrigger(edm::Event const &e)
tuple met
____________________________________________________________________________||
ExoticaDQM(const edm::ParameterSet &ps)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
virtual void analyzeEventInterpretation(edm::Event const &e, edm::EventSetup const &eSetup)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void cd(void)
go to top directory (ie. root)
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
virtual float pt() const =0
transverse momentum
void bookHistos(DQMStore *bei)
virtual void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
double deltaR(double eta1, double eta2, double phi1, double phi2)
virtual void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
T const * product() const
virtual void analyzeMultiJets(edm::Event const &e)
virtual void analyzeLongLived(edm::Event const &e)
bool operator()(const Candidate &c1, const Candidate &c2) const
virtual void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
std::vector< std::string > vstring
void setCurrentFolder(const std::string &fullpath)