CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
CaloMETAnalyzer Class Reference

#include <CaloMETAnalyzer.h>

Inheritance diagram for CaloMETAnalyzer:
CaloMETAnalyzerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &, const edm::TriggerResults &)
 Get the analysis. More...
 
void beginJob (DQMStore *dbe)
 Inizialize parameters for histo binning. More...
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 Initialize run-based parameters. More...
 
void bookMESet (std::string)
 
void bookMonitorElement (std::string, bool)
 
void bookMonitorElementTriggered (std::string, bool)
 
 CaloMETAnalyzer (const edm::ParameterSet &, edm::ConsumesCollector &&)
 Constructor. More...
 
void computeEmHaMET (edm::Handle< edm::View< reco::Candidate > >)
 
void endJob ()
 Finish up a job. More...
 
void endRun (const edm::Run &iRun, const edm::EventSetup &iSetup, DQMStore *dbe)
 Finish up a run. More...
 
void fillMESet (const edm::Event &, std::string, const reco::CaloMET &, const reco::CaloMET &)
 
void fillMESubSet (const edm::Event &, std::string, const reco::CaloMET &, const reco::CaloMET &)
 
void fillMonitorElement (const edm::Event &, std::string, std::string, const reco::CaloMET &, const reco::CaloMET &, bool)
 
void fillMonitorElementTriggered (const edm::Event &, std::string, std::string, const reco::CaloMET &, const reco::CaloMET &, bool)
 
void makeRatePlot (std::string, double)
 
bool selectHighPtJetEvent (const edm::Event &)
 
bool selectLowPtJetEvent (const edm::Event &)
 
bool selectWElectronEvent (const edm::Event &)
 
bool selectWMuonEvent (const edm::Event &)
 
void validateMET (const reco::CaloMET &, edm::Handle< edm::View< reco::Candidate > >)
 
virtual ~CaloMETAnalyzer ()
 Destructor. More...
 
- Public Member Functions inherited from CaloMETAnalyzerBase
void analyze (const edm::Event &, const edm::EventSetup &, const edm::TriggerResults &, const reco::CaloMET &caloMET)
 Get the analysis of the muon properties. More...
 
 CaloMETAnalyzerBase ()
 Constructor. More...
 
virtual ~CaloMETAnalyzerBase ()
 Destructor. More...
 

Public Attributes

int evtCounter
 

Private Attributes

bool _allhist
 
bool _allSelection
 
bool _cleanupSelection
 
DQMStore_dbe
 
bool _doHLTPhysicsOn
 
bool _doPVCheck
 
GenericTriggerEventFlag_EleEventFlag
 
double _EmCaloEz
 
double _EmMET
 
double _EmMetPhi
 
double _EmMEx
 
double _EmMEy
 
double _EmSumEt
 
double _etThreshold
 
std::vector< std::string > _FolderNames
 
double _HaCaloEz
 
double _HaMET
 
double _HaMetPhi
 
double _HaMEx
 
double _HaMEy
 
double _HaSumEt
 
GenericTriggerEventFlag_HighMETEventFlag
 
double _highMETThreshold
 
GenericTriggerEventFlag_HighPtJetEventFlag
 
double _highPtJetThreshold
 
std::string _hlt_PhysDec
 
GenericTriggerEventFlag_LowPtJetEventFlag
 
double _lowPtJetThreshold
 
GenericTriggerEventFlag_MinBiasEventFlag
 
GenericTriggerEventFlag_MuonEventFlag
 
int _numPV
 
int _nvtx_min
 
int _nvtxtrks_min
 
int _print
 
std::string _source
 
std::vector< unsigned > _techTrigsAND
 
std::vector< unsigned > _techTrigsNOT
 
std::vector< unsigned > _techTrigsOR
 
bool _tightBHFiltering
 
int _tightJetIDFiltering
 
int _trig_Ele
 
int _trig_HighMET
 
int _trig_HighPtJet
 
int _trig_JetMB
 
int _trig_LowPtJet
 
int _trig_MinBias
 
int _trig_Muon
 
int _trig_PhysDec
 
int _verbose
 
double _vtxchi2_max
 
int _vtxndof_min
 
double _vtxz_max
 
edm::InputTag BeamHaloSummaryTag
 
edm::Handle< reco::BeamSpotbeamSpot_h
 
math::XYZPoint bspot
 
edm::Handle< edm::ValueMap
< reco::MuonMETCorrectionData > > 
corMetGlobalMuons_ValueMap_Handle
 
JetMETDQMDCSFilterDCSFilter
 
std::vector< std::string > elecExpr_
 
edm::InputTag gtTag
 
edm::InputTag HBHENoiseFilterResultTag
 
edm::InputTag HcalNoiseRBXCollectionTag
 
MonitorElementhCaloEmEtFraction
 
MonitorElementhCaloEmEtFraction020
 
MonitorElementhCaloEmEtInEB
 
MonitorElementhCaloEmEtInEE
 
MonitorElementhCaloEmEtInHF
 
MonitorElementhCaloEmMET
 
MonitorElementhCaloEmMETPhi
 
MonitorElementhCaloEmMEx
 
MonitorElementhCaloEmMEy
 
MonitorElementhCaloEtFractionHadronic
 
MonitorElementhCaloHadEtInHB
 
MonitorElementhCaloHadEtInHE
 
MonitorElementhCaloHadEtInHF
 
MonitorElementhCaloHadEtInHO
 
MonitorElementhCaloHaMET
 
MonitorElementhCaloHaMETPhi
 
MonitorElementhCaloHaMEx
 
MonitorElementhCaloHaMEy
 
MonitorElementhCaloMaxEtInEmTowers
 
MonitorElementhCaloMaxEtInHadTowers
 
MonitorElementhCaloMET
 
MonitorElementhCaloMET1
 
MonitorElementhCaloMET_logx
 
MonitorElementhCaloMET_profile
 
MonitorElementhCaloMETNoHF
 
MonitorElementhCaloMETNoHF_profile
 
MonitorElementhCaloMETPhi
 
MonitorElementhCaloMETPhi020
 
MonitorElementhCaloMETRate
 
MonitorElementhCaloMETSig
 
MonitorElementhCaloMEx
 
MonitorElementhCaloMEx_profile
 
MonitorElementhCaloMExCorrection
 
MonitorElementhCaloMExLS
 
MonitorElementhCaloMEy
 
MonitorElementhCaloMEy_profile
 
MonitorElementhCaloMEyCorrection
 
MonitorElementhCaloMEyLS
 
MonitorElementhCalomuChi2
 
MonitorElementhCalomuD0
 
MonitorElementhCalomuEta
 
MonitorElementhCalomuNhits
 
MonitorElementhCaloMuonCorrectionFlag
 
MonitorElementhCalomuPt
 
MonitorElementhCaloSumET
 
MonitorElementhCaloSumET_logx
 
MonitorElementhCaloSumET_profile
 
std::vector< std::string > highMETExpr_
 
std::vector< std::string > highPtJetExpr_
 
std::vector< std::string > HLTPathsJetMBByName_
 
MonitorElementhmetME
 
MonitorElementhTriggerName_Ele
 
MonitorElementhTriggerName_HighMET
 
MonitorElementhTriggerName_HighPtJet
 
MonitorElementhTriggerName_LowPtJet
 
MonitorElementhTriggerName_MinBias
 
MonitorElementhTriggerName_Muon
 
edm::InputTag inputBeamSpotLabel
 
edm::InputTag inputMuonLabel
 
reco::helper::JetIDHelperjetID
 
std::vector< std::string > lowPtJetExpr_
 
std::string metname
 
std::vector< std::string > minbiasExpr_
 
edm::Handle< reco::MuonCollectionmuon_h
 
std::vector< std::string > muonExpr_
 
edm::ParameterSet parameters
 
edm::InputTag theCaloMETCollectionLabel
 
edm::InputTag theCaloTowersLabel
 
edm::ParameterSet theCleaningParameters
 
edm::InputTag theJetCollectionLabel
 
edm::InputTag vertexTag
 

Detailed Description

DQM monitoring source for CaloMET

Author
F. Chlebana - Fermilab K. Hatakeyama - Rockefeller University

Definition at line 52 of file CaloMETAnalyzer.h.

Constructor & Destructor Documentation

CaloMETAnalyzer::CaloMETAnalyzer ( const edm::ParameterSet pSet,
edm::ConsumesCollector &&  iC 
)

Constructor.

Definition at line 31 of file CaloMETAnalyzer.cc.

References edm::ParameterSet::getParameter(), and Parameters::parameters.

31  {
32 
33  parameters = pSet;
34 
35  edm::ParameterSet highptjetparms = parameters.getParameter<edm::ParameterSet>("highPtJetTrigger");
36  edm::ParameterSet lowptjetparms = parameters.getParameter<edm::ParameterSet>("lowPtJetTrigger" );
37  edm::ParameterSet minbiasparms = parameters.getParameter<edm::ParameterSet>("minBiasTrigger" );
38  edm::ParameterSet highmetparms = parameters.getParameter<edm::ParameterSet>("highMETTrigger" );
39  // edm::ParameterSet lowmetparms = parameters.getParameter<edm::ParameterSet>("lowMETTrigger" );
41  edm::ParameterSet muonparms = parameters.getParameter<edm::ParameterSet>("muonTrigger" );
42 
43  //genericTriggerEventFlag_( new GenericTriggerEventFlag( conf_, iC ) );
44  _HighPtJetEventFlag = new GenericTriggerEventFlag( highptjetparms, iC );
45  _LowPtJetEventFlag = new GenericTriggerEventFlag( lowptjetparms, iC );
46  _MinBiasEventFlag = new GenericTriggerEventFlag( minbiasparms, iC );
47  _HighMETEventFlag = new GenericTriggerEventFlag( highmetparms, iC );
48  // _LowMETEventFlag = new GenericTriggerEventFlag( lowmetparms, iC );
49  _EleEventFlag = new GenericTriggerEventFlag( eleparms, iC );
50  _MuonEventFlag = new GenericTriggerEventFlag( muonparms, iC );
51 
52  highPtJetExpr_ = highptjetparms.getParameter<std::vector<std::string> >("hltPaths");
53  lowPtJetExpr_ = lowptjetparms .getParameter<std::vector<std::string> >("hltPaths");
54  highMETExpr_ = highmetparms .getParameter<std::vector<std::string> >("hltPaths");
55  // lowMETExpr_ = lowmetparms .getParameter<std::vector<std::string> >("hltPaths");
56  muonExpr_ = muonparms .getParameter<std::vector<std::string> >("hltPaths");
57  elecExpr_ = eleparms .getParameter<std::vector<std::string> >("hltPaths");
58  minbiasExpr_ = minbiasparms .getParameter<std::vector<std::string> >("hltPaths");
59 
60 }
T getParameter(std::string const &) const
GenericTriggerEventFlag * _LowPtJetEventFlag
GenericTriggerEventFlag * _HighMETEventFlag
std::vector< std::string > minbiasExpr_
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
edm::ParameterSet parameters
GenericTriggerEventFlag * _MinBiasEventFlag
std::vector< std::string > highPtJetExpr_
GenericTriggerEventFlag * _EleEventFlag
GenericTriggerEventFlag * _HighPtJetEventFlag
GenericTriggerEventFlag * _MuonEventFlag
std::vector< std::string > elecExpr_
std::vector< std::string > muonExpr_
std::vector< std::string > lowPtJetExpr_
std::vector< std::string > highMETExpr_
CaloMETAnalyzer::~CaloMETAnalyzer ( )
virtual

Destructor.

Definition at line 63 of file CaloMETAnalyzer.cc.

63  {
64 
65  delete _HighPtJetEventFlag;
66  delete _LowPtJetEventFlag;
67  delete _MinBiasEventFlag;
68  delete _HighMETEventFlag;
69  // delete _LowMETEventFlag;
70  delete _EleEventFlag;
71  delete _MuonEventFlag;
72 
73 }
GenericTriggerEventFlag * _LowPtJetEventFlag
GenericTriggerEventFlag * _HighMETEventFlag
GenericTriggerEventFlag * _MinBiasEventFlag
GenericTriggerEventFlag * _EleEventFlag
GenericTriggerEventFlag * _HighPtJetEventFlag
GenericTriggerEventFlag * _MuonEventFlag

Member Function Documentation

void CaloMETAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const edm::TriggerResults triggerResults 
)

Get the analysis.

Definition at line 506 of file CaloMETAnalyzer.cc.

References edm::HLTGlobalStatus::accept(), FamosSequences_cff::caloJets, gather_cfg::cout, reco::BeamHaloSummary::CSCLooseHaloId(), reco::BeamHaloSummary::CSCTightHaloId(), cmsPerfPublish::DirName, reco::BeamHaloSummary::EcalLooseHaloId(), reco::BeamHaloSummary::EcalTightHaloId(), edm::EventID::event(), edm::Event::getByLabel(), reco::BeamHaloSummary::GlobalLooseHaloId(), reco::BeamHaloSummary::GlobalTightHaloId(), reco::BeamHaloSummary::HcalLooseHaloId(), reco::BeamHaloSummary::HcalTightHaloId(), i, edm::EventBase::id(), edm::HandleBase::isValid(), bTagSequences_cff::jetID, LogDebug, LogTrace, metname, edm::Handle< T >::product(), edm::HLTGlobalStatus::size(), edm::TriggerNames::size(), AlCaHLTBitMon_QueryRunRegistry::string, edm::TriggerNames::triggerIndex(), edm::TriggerNames::triggerName(), edm::Event::triggerNames(), findQualityFiles::v, and GoodVertex_cfg::vertexCollection.

507  {
508 
509  if (_verbose) std::cout << "CaloMETAnalyzer analyze" << std::endl;
510 
511  std::string DirName = "JetMET/MET/"+_source;
512  if (_print){
513  std::cout << " " << std::endl;
514  std::cout << "Event = " << iEvent.id().event() << std::endl;
515  }
516 
517  LogTrace(metname)<<"[CaloMETAnalyzer] Analyze CaloMET";
518 
519  hmetME->Fill(1);
520 
521  // ==========================================================
522  // Trigger information
523  //
524  _trig_JetMB=0;
525  _trig_HighPtJet=0;
526  _trig_LowPtJet=0;
527  _trig_MinBias=0;
528  _trig_HighMET=0;
529  // _trig_LowMET=0;
530  _trig_Ele=0;
531  _trig_Muon=0;
532  _trig_PhysDec=0;
533  if(&triggerResults) {
534 
536 
537  //
538  //
539  // Check how many HLT triggers are in triggerResults
540  int ntrigs = triggerResults.size();
541  if (_verbose) std::cout << "ntrigs=" << ntrigs << std::endl;
542 
543  //
544  //
545  // If index=ntrigs, this HLT trigger doesn't exist in the HLT table for this data.
546  const edm::TriggerNames & triggerNames = iEvent.triggerNames(triggerResults);
547 
548  //
549  //
550  const unsigned int nTrig(triggerNames.size());
551  for (unsigned int i=0;i<nTrig;++i)
552  {
553  if (triggerNames.triggerName(i).find(highPtJetExpr_[0].substr(0,highPtJetExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
554  _trig_HighPtJet=true;
555  else if (triggerNames.triggerName(i).find(lowPtJetExpr_[0].substr(0,lowPtJetExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
556  _trig_LowPtJet=true;
557  else if (triggerNames.triggerName(i).find(highMETExpr_[0].substr(0,highMETExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
558  _trig_HighMET=true;
559  // else if (triggerNames.triggerName(i).find(lowMETExpr_[0].substr(0,lowMETExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
560  // _trig_LowMET=true;
561  else if (triggerNames.triggerName(i).find(muonExpr_[0].substr(0,muonExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
562  _trig_Muon=true;
563  else if (triggerNames.triggerName(i).find(elecExpr_[0].substr(0,elecExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
564  _trig_Ele=true;
565  else if (triggerNames.triggerName(i).find(minbiasExpr_[0].substr(0,minbiasExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
566  _trig_MinBias=true;
567  }
568 
569  // count number of requested Jet or MB HLT paths which have fired
570  for (unsigned int i=0; i!=HLTPathsJetMBByName_.size(); i++) {
571  unsigned int triggerIndex = triggerNames.triggerIndex(HLTPathsJetMBByName_[i]);
572  if (triggerIndex<triggerResults.size()) {
573  if (triggerResults.accept(triggerIndex)) {
574  _trig_JetMB++;
575  }
576  }
577  }
578  // for empty input vectors (n==0), take all HLT triggers!
579  if (HLTPathsJetMBByName_.size()==0) _trig_JetMB=triggerResults.size()-1;
580 
581  /*
582  if ( _HighPtJetEventFlag->on() && _HighPtJetEventFlag->accept( iEvent, iSetup) )
583  _trig_HighPtJet=1;
584 
585  if ( _LowPtJetEventFlag->on() && _LowPtJetEventFlag->accept( iEvent, iSetup) )
586  _trig_LowPtJet=1;
587 
588  if ( _MinBiasEventFlag->on() && _MinBiasEventFlag->accept( iEvent, iSetup) )
589  _trig_MinBias=1;
590 
591  if ( _HighMETEventFlag->on() && _HighMETEventFlag->accept( iEvent, iSetup) )
592  _trig_HighMET=1;
593 
594  if ( _LowMETEventFlag->on() && _LowMETEventFlag->accept( iEvent, iSetup) )
595  _trig_LowMET=1;
596 
597  if ( _EleEventFlag->on() && _EleEventFlag->accept( iEvent, iSetup) )
598  _trig_Ele=1;
599 
600  if ( _MuonEventFlag->on() && _MuonEventFlag->accept( iEvent, iSetup) )
601  _trig_Muon=1;
602  */
603 
604  if (triggerNames.triggerIndex(_hlt_PhysDec) != triggerNames.size() &&
605  triggerResults.accept(triggerNames.triggerIndex(_hlt_PhysDec))) _trig_PhysDec=1;
606  } else {
607 
608  edm::LogInfo("CaloMetAnalyzer") << "TriggerResults::HLT not found, "
609  "automatically select events";
610  //
611  // TriggerResults object not found. Look at all events.
612  _trig_JetMB=1;
613 
614  }
615 
616  // ==========================================================
617  // CaloMET information
618 
619  // **** Get the MET container
621  iEvent.getByLabel(theCaloMETCollectionLabel, calometcoll);
622 
623  if(!calometcoll.isValid()) {
624  std::cout<<"Unable to find MET results for CaloMET collection "<<theCaloMETCollectionLabel<<std::endl;
625  return;
626  }
627 
628  const reco::CaloMETCollection *calometcol = calometcoll.product();
629  const reco::CaloMET *calomet;
630  calomet = &(calometcol->front());
631 
632  LogTrace(metname)<<"[CaloMETAnalyzer] Call to the CaloMET analyzer";
633 
634  // **** Get the MET no HF container
635  edm::Handle<reco::CaloMETCollection> calometnohfcoll;
636  iEvent.getByLabel("metNoHF", calometnohfcoll);
637 
638  if(!calometnohfcoll.isValid()) {
639  std::cout<<"Unable to find MET results for CaloMETNoHF collection metNoHF"<<std::endl;
640  return;
641  }
642 
643  const reco::CaloMETCollection *calometnohfcol = calometnohfcoll.product();
644  const reco::CaloMET *calometnohf;
645  calometnohf = &(calometnohfcol->front());
646 
647  //LogTrace(metname)<<"[CaloMETAnalyzer] Call to the CaloMET analyzer";
648 
649  //Only for corMetGlobalMuons
650  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
651 
652  iEvent.getByLabel("muonMETValueMapProducer" , "muCorrData", corMetGlobalMuons_ValueMap_Handle);
653  iEvent.getByLabel("muons", muon_h);
655 
656  if(!beamSpot_h.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve beam spot data require by MET Task";
657 
658  bspot = ( beamSpot_h.isValid() ) ? beamSpot_h->position() : math::XYZPoint(0, 0, 0);
659 
660  }
661 
662 
663  // ==========================================================
664  //
666  iEvent.getByLabel(HcalNoiseRBXCollectionTag,HRBXCollection);
667  if (!HRBXCollection.isValid()) {
668  LogDebug("") << "CaloMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
669  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
670  }
671 
672 
673  edm::Handle<bool> HBHENoiseFilterResultHandle;
674  iEvent.getByLabel(HBHENoiseFilterResultTag, HBHENoiseFilterResultHandle);
675  bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
676  if (!HBHENoiseFilterResultHandle.isValid()) {
677  LogDebug("") << "CaloMETAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
678  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
679  }
680 
681 
683  iEvent.getByLabel(theJetCollectionLabel, caloJets);
684  if (!caloJets.isValid()) {
685  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
686  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
687  }
688 
690  iEvent.getByLabel(theCaloTowersLabel, towers);
691  if (!towers.isValid()) {
692  LogDebug("") << "CaloMETAnalyzer: Could not find caltower product" << std::endl;
693  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find caltower product" << std::endl;
694  }
695 
696  // ==========================================================
697  // CaloMET sanity check
698 
699  if (_source=="CaloMET") validateMET(*calomet,towers);
700 
701  // ==========================================================
702 
703  if (_allhist) computeEmHaMET(towers);
704 
705  // ==========================================================
706  // JetID
707 
708  if (_verbose) std::cout << "JetID starts" << std::endl;
709 
710  //
711  // --- Minimal cuts
712  //
713  bool bJetIDMinimal=true;
714  int nj=0;
715  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
716  cal!=caloJets->end(); ++cal){
717  jetID->calculate(iEvent, *cal);
718  if (_print && nj<=1) std::cout << "Jet pT = " << cal->pt() << " (GeV) "
719  << " eta = " << cal->eta() << " "
720  << " phi = " << cal->phi() << " "
721  << " emf = " << cal->emEnergyFraction() << std::endl;
722  nj++;
723  if (cal->pt()>10.){
724  if (fabs(cal->eta())<=2.6 &&
725  cal->emEnergyFraction()<=0.01) bJetIDMinimal=false;
726  }
727  }
728 
729  //
730  // --- Loose cuts
731  //
732  bool bJetIDLoose=true;
733  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
734  cal!=caloJets->end(); ++cal){
735  jetID->calculate(iEvent, *cal);
736  if (_verbose) std::cout << jetID->n90Hits() << " "
737  << jetID->restrictedEMF() << " "
738  << cal->pt() << std::endl;
739  if (cal->pt()>10.){
740  //
741  // for all regions
742  if (jetID->n90Hits()<2) bJetIDLoose=false;
743  if (jetID->fHPD()>=0.98) bJetIDLoose=false;
744  //
745  // for non-forward
746  if (fabs(cal->eta())<2.55){
747  if (cal->emEnergyFraction()<=0.01) bJetIDLoose=false;
748  }
749  // for forward
750  else {
751  if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=false;
752  if (cal->pt()>80.){
753  if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=false;
754  }
755  } // forward vs non-forward
756  } // pt>10 GeV/c
757  } // calor-jets loop
758 
759  //
760  // --- Tight cuts
761  //
762  bool bJetIDTight=true;
763  bJetIDTight=bJetIDLoose;
764  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
765  cal!=caloJets->end(); ++cal){
766  jetID->calculate(iEvent, *cal);
767  if (cal->pt()>25.){
768  //
769  // for all regions
770  if (jetID->fHPD()>=0.95) bJetIDTight=false;
771  //
772  // for 1.0<|eta|<1.75
773  if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
774  if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=false;
775  }
776  //
777  // for 1.75<|eta|<2.55
778  else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
779  if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=false;
780  }
781  //
782  // for 2.55<|eta|<3.25
783  else if (fabs(cal->eta())>=2.55 && fabs(cal->eta())<3.25){
784  if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3) bJetIDTight=false;
785  if (cal->pt()>=50. && cal->pt()< 80. && cal->emEnergyFraction()<=-0.2) bJetIDTight=false;
786  if (cal->pt()>=80. && cal->pt()<340. && cal->emEnergyFraction()<=-0.1) bJetIDTight=false;
787  if (cal->pt()>=340. && cal->emEnergyFraction()<=-0.1
788  && cal->emEnergyFraction()>=0.95) bJetIDTight=false;
789  }
790  //
791  // for 3.25<|eta|
792  else if (fabs(cal->eta())>=3.25){
793  if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3
794  && cal->emEnergyFraction()>=0.90) bJetIDTight=false;
795  if (cal->pt()>=50. && cal->pt()<130. && cal->emEnergyFraction()<=-0.2
796  && cal->emEnergyFraction()>=0.80) bJetIDTight=false;
797  if (cal->pt()>=130. && cal->emEnergyFraction()<=-0.1
798  && cal->emEnergyFraction()>=0.70) bJetIDTight=false;
799  }
800  } // pt>10 GeV/c
801  } // calor-jets loop
802 
803  if (_verbose) std::cout << "JetID ends" << std::endl;
804 
805  // ==========================================================
806  // HCAL Noise filter
807 
808  bool bHcalNoiseFilter = HBHENoiseFilterResult;
809 
810  // ==========================================================
811  // Get BeamHaloSummary
812  edm::Handle<reco::BeamHaloSummary> TheBeamHaloSummary ;
813  iEvent.getByLabel(BeamHaloSummaryTag, TheBeamHaloSummary) ;
814 
815  bool bBeamHaloIDTightPass = true;
816  bool bBeamHaloIDLoosePass = true;
817 
818  if(TheBeamHaloSummary.isValid()) {
819 
820  const reco::BeamHaloSummary TheSummary = (*TheBeamHaloSummary.product() );
821 
822  // std::cout << TheSummary.EcalLooseHaloId() << " "
823  // << TheSummary.HcalLooseHaloId() << " "
824  // << TheSummary.CSCLooseHaloId() << " "
825  // << TheSummary.GlobalLooseHaloId() << std::endl;
826 
827  if( TheSummary.EcalLooseHaloId() || TheSummary.HcalLooseHaloId() ||
828  TheSummary.CSCLooseHaloId() || TheSummary.GlobalLooseHaloId() )
829  bBeamHaloIDLoosePass = false;
830 
831  if( TheSummary.EcalTightHaloId() || TheSummary.HcalTightHaloId() ||
832  TheSummary.CSCTightHaloId() || TheSummary.GlobalTightHaloId() )
833  bBeamHaloIDTightPass = false;
834 
835  }
836 
837  if (_verbose) std::cout << "BeamHaloSummary ends" << std::endl;
838 
839  // ==========================================================
840  //Vertex information
841 
842  _numPV = 0;
843  bool bPrimaryVertex = true;
844  if(_doPVCheck){
845  bPrimaryVertex = false;
846  Handle<reco::VertexCollection> vertexHandle;
847 
848  iEvent.getByLabel(vertexTag, vertexHandle);
849 
850  if (!vertexHandle.isValid()) {
851  LogDebug("") << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
852  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
853  }
854 
855  if ( vertexHandle.isValid() ){
856  reco::VertexCollection vertexCollection = *(vertexHandle.product());
857  int vertex_number = vertexCollection.size();
858  reco::VertexCollection::const_iterator v = vertexCollection.begin();
859  for ( ; v != vertexCollection.end(); ++v) {
860  double vertex_chi2 = v->normalizedChi2();
861  double vertex_ndof = v->ndof();
862  bool fakeVtx = v->isFake();
863  double vertex_Z = v->z();
864 
865  if ( !fakeVtx
866  && vertex_number>=_nvtx_min
867  && vertex_ndof >_vtxndof_min
868  && vertex_chi2 <_vtxchi2_max
869  && fabs(vertex_Z)<_vtxz_max ) {
870  bPrimaryVertex = true;
871  ++_numPV;
872  }
873  }
874  }
875  }
876  // ==========================================================
877 
879  iEvent.getByLabel( gtTag, gtReadoutRecord);
880 
881  if (!gtReadoutRecord.isValid()) {
882  LogDebug("") << "CaloMETAnalyzer: Could not find GT readout record" << std::endl;
883  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find GT readout record product" << std::endl;
884  }
885 
886  bool bTechTriggers = true;
887  bool bTechTriggersAND = true;
888  bool bTechTriggersOR = false;
889  bool bTechTriggersNOT = false;
890 
891  if (gtReadoutRecord.isValid()) {
892  const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
893 
894  if (_techTrigsAND.size() == 0)
895  bTechTriggersAND = true;
896  else
897  for (unsigned ttr = 0; ttr != _techTrigsAND.size(); ttr++) {
898  bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(_techTrigsAND.at(ttr));
899  }
900 
901  if (_techTrigsAND.size() == 0)
902  bTechTriggersOR = true;
903  else
904  for (unsigned ttr = 0; ttr != _techTrigsOR.size(); ttr++) {
905  bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(_techTrigsOR.at(ttr));
906  }
907  if (_techTrigsNOT.size() == 0)
908  bTechTriggersNOT = false;
909  else
910  for (unsigned ttr = 0; ttr != _techTrigsNOT.size(); ttr++) {
911  bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(_techTrigsNOT.at(ttr));
912  }
913  }
914  else
915  {
916  bTechTriggersAND = true;
917  bTechTriggersOR = true;
918  bTechTriggersNOT = false;
919  }
920 
921  if (_techTrigsAND.size()==0)
922  bTechTriggersAND = true;
923  if (_techTrigsOR.size()==0)
924  bTechTriggersOR = true;
925  if (_techTrigsNOT.size()==0)
926  bTechTriggersNOT = false;
927 
928  bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
929 
930  // ==========================================================
931  // Reconstructed MET Information - fill MonitorElements
932 
933  bool bHcalNoise = bHcalNoiseFilter;
934  bool bBeamHaloID = bBeamHaloIDLoosePass;
935  bool bJetID = bJetIDMinimal;
936 
937  bool bPhysicsDeclared = true;
938  if(_doHLTPhysicsOn) bPhysicsDeclared =_trig_PhysDec;
939 
940  if (_tightBHFiltering) bBeamHaloID = bBeamHaloIDTightPass;
941 
942  if (_tightJetIDFiltering==1) bJetID = bJetIDMinimal;
943  else if (_tightJetIDFiltering==2) bJetID = bJetIDLoose;
944  else if (_tightJetIDFiltering==3) bJetID = bJetIDTight;
945  else if (_tightJetIDFiltering==-1) bJetID = true;
946 
947  bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
948  bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
949 
950  //std::string DirName = "JetMET/MET/"+_source;
951 
952  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin();
953  ic != _FolderNames.end(); ic++){
954  if (*ic=="All") fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
955  if (DCSFilter->filter(iEvent, iSetup)) {
956  if (_cleanupSelection){
957  if (*ic=="BasicCleanup" && bBasicCleanup) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
958  if (*ic=="ExtraCleanup" && bExtraCleanup) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
959  }
960  if (_allSelection) {
961  if (*ic=="HcalNoiseFilter" && bHcalNoiseFilter ) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
962  if (*ic=="JetIDMinimal" && bJetIDMinimal) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
963  if (*ic=="JetIDLoose" && bJetIDLoose) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
964  if (*ic=="JetIDTight" && bJetIDTight) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
965  if (*ic=="BeamHaloIDTightPass" && bBeamHaloIDTightPass) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
966  if (*ic=="BeamHaloIDLoosePass" && bBeamHaloIDLoosePass) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
967  if (*ic=="Triggers" && bTechTriggers) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
968  if (*ic=="PV" && bPrimaryVertex) fillMESet(iEvent, DirName+"/"+*ic, *calomet, *calometnohf);
969  }
970  } // DCS
971  }
972 } // CaloMETAnalyzer::analyze
#define LogDebug(id)
const bool EcalTightHaloId() const
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
edm::InputTag vertexTag
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:204
std::vector< unsigned > _techTrigsOR
const bool HcalTightHaloId() const
edm::InputTag BeamHaloSummaryTag
const bool GlobalLooseHaloId() const
std::vector< unsigned > _techTrigsNOT
void fillMESet(const edm::Event &, std::string, const reco::CaloMET &, const reco::CaloMET &)
edm::Handle< reco::BeamSpot > beamSpot_h
bool accept() const
Has at least one path accepted the event?
double fHPD() const
Definition: JetIDHelper.h:34
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::vector< std::string > minbiasExpr_
void computeEmHaMET(edm::Handle< edm::View< reco::Candidate > >)
Strings::size_type size() const
Definition: TriggerNames.cc:39
const bool GlobalTightHaloId() const
math::XYZPoint bspot
double restrictedEMF() const
Definition: JetIDHelper.h:51
tuple vertexCollection
std::string _source
edm::Handle< reco::MuonCollection > muon_h
edm::InputTag theJetCollectionLabel
void Fill(long long x)
const bool HcalLooseHaloId() const
const bool CSCTightHaloId() const
JetMETDQMDCSFilter * DCSFilter
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
unsigned int size() const
Get number of paths stored.
edm::InputTag gtTag
reco::helper::JetIDHelper * jetID
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
std::vector< std::string > _FolderNames
std::string metname
bool isValid() const
Definition: HandleBase.h:76
edm::InputTag HcalNoiseRBXCollectionTag
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
bool filter(const edm::Event &evt, const edm::EventSetup &es)
#define LogTrace(id)
std::vector< std::string > highPtJetExpr_
edm::InputTag theCaloTowersLabel
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T const * product() const
Definition: Handle.h:81
void validateMET(const reco::CaloMET &, edm::Handle< edm::View< reco::Candidate > >)
std::string const & label() const
Definition: InputTag.h:42
const bool CSCLooseHaloId() const
edm::EventID id() const
Definition: EventBase.h:56
std::vector< std::string > elecExpr_
std::vector< unsigned > _techTrigsAND
std::string _hlt_PhysDec
tuple cout
Definition: gather_cfg.py:121
edm::Handle< edm::ValueMap< reco::MuonMETCorrectionData > > corMetGlobalMuons_ValueMap_Handle
std::vector< std::string > HLTPathsJetMBByName_
std::vector< std::string > muonExpr_
std::vector< std::string > lowPtJetExpr_
std::vector< std::string > highMETExpr_
edm::InputTag inputBeamSpotLabel
edm::InputTag HBHENoiseFilterResultTag
const bool EcalLooseHaloId() const
edm::InputTag theCaloMETCollectionLabel
MonitorElement * hmetME
void calculate(const edm::Event &event, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:86
void CaloMETAnalyzer::beginJob ( DQMStore dbe)
virtual

Inizialize parameters for histo binning.

Implements CaloMETAnalyzerBase.

Definition at line 76 of file CaloMETAnalyzer.cc.

References DQMStore::book1D(), cmsPerfPublish::DirName, edm::ParameterSet::getParameter(), bTagSequences_cff::jetID, LogTrace, metname, Parameters::parameters, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

76  {
77 
78  evtCounter = 0;
79  metname = "caloMETAnalyzer";
80 
81  // trigger information
82  HLTPathsJetMBByName_ = parameters.getParameter<std::vector<std::string > >("HLTPathsJetMB");
83 
85 
86  //Trigger parameters
87  gtTag = theCleaningParameters.getParameter<edm::InputTag>("gtLabel");
88  _techTrigsAND = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsAND");
89  _techTrigsOR = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsOR");
90  _techTrigsNOT = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsNOT");
91 
92  _doHLTPhysicsOn = theCleaningParameters.getParameter<bool>("doHLTPhysicsOn");
93  _hlt_PhysDec = theCleaningParameters.getParameter<std::string>("HLT_PhysDec");
94 
95  _tightBHFiltering = theCleaningParameters.getParameter<bool>("tightBHFiltering");
96  _tightJetIDFiltering = theCleaningParameters.getParameter<int>("tightJetIDFiltering");
97 
98  // ==========================================================
99  //DCS information
100  // ==========================================================
102 
103  //Vertex requirements
104  _doPVCheck = theCleaningParameters.getParameter<bool>("doPrimaryVertexCheck");
105  vertexTag = theCleaningParameters.getParameter<edm::InputTag>("vertexLabel");
106 
107  if (_doPVCheck) {
108  _nvtx_min = theCleaningParameters.getParameter<int>("nvtx_min");
109  _nvtxtrks_min = theCleaningParameters.getParameter<int>("nvtxtrks_min");
110  _vtxndof_min = theCleaningParameters.getParameter<int>("vtxndof_min");
111  _vtxchi2_max = theCleaningParameters.getParameter<double>("vtxchi2_max");
112  _vtxz_max = theCleaningParameters.getParameter<double>("vtxz_max");
113  }
114 
115 
116  // CaloMET information
119 
120  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
121  inputBeamSpotLabel = parameters.getParameter<edm::InputTag>("InputBeamSpotLabel");
122  }
123 
124  // Other data collections
127  HcalNoiseRBXCollectionTag = parameters.getParameter<edm::InputTag>("HcalNoiseRBXCollection");
128  BeamHaloSummaryTag = parameters.getParameter<edm::InputTag>("BeamHaloSummaryLabel");
129  HBHENoiseFilterResultTag = parameters.getParameter<edm::InputTag>("HBHENoiseFilterResultLabel");
130 
131  // misc
132  _verbose = parameters.getParameter<int>("verbose");
133  _print = parameters.getParameter<int>("printOut");
134  _etThreshold = parameters.getParameter<double>("etThreshold"); // MET threshold
135  _allhist = parameters.getParameter<bool>("allHist"); // Full set of monitoring histograms
136  _allSelection= parameters.getParameter<bool>("allSelection"); // Plot with all sets of event selection
137  _cleanupSelection= parameters.getParameter<bool>("cleanupSelection"); // Plot with all sets of event selection
138 
139  _highPtJetThreshold = parameters.getParameter<double>("HighPtJetThreshold"); // High Pt Jet threshold
140  _lowPtJetThreshold = parameters.getParameter<double>("LowPtJetThreshold"); // Low Pt Jet threshold
141  _highMETThreshold = parameters.getParameter<double>("HighMETThreshold"); // High MET threshold
142  // _lowMETThreshold = parameters.getParameter<double>("LowMETThreshold"); // Low MET threshold
143 
144  //
146 
147  // DQStore stuff
148  LogTrace(metname)<<"[CaloMETAnalyzer] Parameters initialization";
149  std::string DirName = "JetMET/MET/"+_source;
150  dbe->setCurrentFolder(DirName);
151 
152  hmetME = dbe->book1D("metReco", "metReco", 4, 1, 5);
153  hmetME->setBinLabel(1,"CaloMET",1);
154 
155  _dbe = dbe;
156 
157  _FolderNames.push_back("All");
158  _FolderNames.push_back("BasicCleanup");
159  _FolderNames.push_back("ExtraCleanup");
160  _FolderNames.push_back("HcalNoiseFilter");
161  _FolderNames.push_back("JetIDMinimal");
162  _FolderNames.push_back("JetIDLoose");
163  _FolderNames.push_back("JetIDTight");
164  _FolderNames.push_back("BeamHaloIDTightPass");
165  _FolderNames.push_back("BeamHaloIDLoosePass");
166  _FolderNames.push_back("Triggers");
167  _FolderNames.push_back("PV");
168 
169  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin();
170  ic != _FolderNames.end(); ic++){
171  if (*ic=="All") bookMESet(DirName+"/"+*ic);
172  if (_cleanupSelection){
173  if (*ic=="BasicCleanup") bookMESet(DirName+"/"+*ic);
174  if (*ic=="ExtraCleanup") bookMESet(DirName+"/"+*ic);
175  }
176  if (_allSelection){
177  if (*ic=="HcalNoiseFilter") bookMESet(DirName+"/"+*ic);
178  if (*ic=="JetIDMinimal") bookMESet(DirName+"/"+*ic);
179  if (*ic=="JetIDLoose") bookMESet(DirName+"/"+*ic);
180  if (*ic=="JetIDTight") bookMESet(DirName+"/"+*ic);
181  if (*ic=="BeamHaloIDTightPass") bookMESet(DirName+"/"+*ic);
182  if (*ic=="BeamHaloIDLoosePass") bookMESet(DirName+"/"+*ic);
183  if (*ic=="Triggers") bookMESet(DirName+"/"+*ic);
184  if (*ic=="PV") bookMESet(DirName+"/"+*ic);
185  }
186  }
187 }
T getParameter(std::string const &) const
edm::InputTag vertexTag
std::vector< unsigned > _techTrigsOR
edm::InputTag BeamHaloSummaryTag
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
std::vector< unsigned > _techTrigsNOT
double _highPtJetThreshold
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::string _source
edm::InputTag theJetCollectionLabel
JetMETDQMDCSFilter * DCSFilter
edm::ParameterSet parameters
edm::InputTag gtTag
reco::helper::JetIDHelper * jetID
std::vector< std::string > _FolderNames
std::string metname
edm::ParameterSet theCleaningParameters
edm::InputTag HcalNoiseRBXCollectionTag
#define LogTrace(id)
edm::InputTag theCaloTowersLabel
std::string const & label() const
Definition: InputTag.h:42
std::vector< unsigned > _techTrigsAND
std::string _hlt_PhysDec
void bookMESet(std::string)
std::vector< std::string > HLTPathsJetMBByName_
edm::InputTag inputBeamSpotLabel
edm::InputTag HBHENoiseFilterResultTag
edm::InputTag theCaloMETCollectionLabel
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * hmetME
void CaloMETAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)

Initialize run-based parameters.

Definition at line 391 of file CaloMETAnalyzer.cc.

392 {
393  if ( _HighPtJetEventFlag->on() ) _HighPtJetEventFlag->initRun( iRun, iSetup );
394  if ( _LowPtJetEventFlag ->on() ) _LowPtJetEventFlag ->initRun( iRun, iSetup );
395  if ( _MinBiasEventFlag ->on() ) _MinBiasEventFlag ->initRun( iRun, iSetup );
396  if ( _HighMETEventFlag ->on() ) _HighMETEventFlag ->initRun( iRun, iSetup );
397  // if ( _LowMETEventFlag ->on() ) _LowMETEventFlag ->initRun( iRun, iSetup );
398  if ( _EleEventFlag ->on() ) _EleEventFlag ->initRun( iRun, iSetup );
399  if ( _MuonEventFlag ->on() ) _MuonEventFlag ->initRun( iRun, iSetup );
400 
401  if (_HighPtJetEventFlag->on() && _HighPtJetEventFlag->expressionsFromDB(_HighPtJetEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
403  if (_LowPtJetEventFlag->on() && _LowPtJetEventFlag->expressionsFromDB(_LowPtJetEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
405  if (_HighMETEventFlag->on() && _HighMETEventFlag->expressionsFromDB(_HighMETEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
407  // if (_LowMETEventFlag->on() && _LowMETEventFlag->expressionsFromDB(_LowMETEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
408  // lowMETExpr_ = _LowMETEventFlag->expressionsFromDB(_LowMETEventFlag->hltDBKey(), iSetup);
409  if (_MuonEventFlag->on() && _MuonEventFlag->expressionsFromDB(_MuonEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
411  if (_EleEventFlag->on() && _EleEventFlag->expressionsFromDB(_EleEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
413  if (_MinBiasEventFlag->on() && _MinBiasEventFlag->expressionsFromDB(_MinBiasEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
415 
416 }
GenericTriggerEventFlag * _LowPtJetEventFlag
GenericTriggerEventFlag * _HighMETEventFlag
std::vector< std::string > minbiasExpr_
std::vector< std::string > expressionsFromDB(const std::string &key, const edm::EventSetup &setup)
Reads and returns logical expressions from DB.
GenericTriggerEventFlag * _MinBiasEventFlag
std::vector< std::string > highPtJetExpr_
GenericTriggerEventFlag * _EleEventFlag
GenericTriggerEventFlag * _HighPtJetEventFlag
GenericTriggerEventFlag * _MuonEventFlag
std::vector< std::string > elecExpr_
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
std::vector< std::string > muonExpr_
std::vector< std::string > lowPtJetExpr_
std::vector< std::string > highMETExpr_
void CaloMETAnalyzer::bookMESet ( std::string  DirName)

Definition at line 200 of file CaloMETAnalyzer.cc.

References gather_cfg::cout.

201 {
202  bool bLumiSecPlot=false;
203  if (DirName.find("All")!=std::string::npos) bLumiSecPlot=true;
204 
205  bookMonitorElement(DirName,bLumiSecPlot);
206 
207  if ( _HighPtJetEventFlag->on() ) {
208  bookMonitorElementTriggered(DirName+"/"+"HighPtJet",false);
209  hTriggerName_HighPtJet = _dbe->bookString("triggerName_HighPtJet", highPtJetExpr_[0]);
210  }
211 
212  if ( _LowPtJetEventFlag->on() ) {
213  bookMonitorElementTriggered(DirName+"/"+"LowPtJet",false);
214  hTriggerName_LowPtJet = _dbe->bookString("triggerName_LowPtJet", lowPtJetExpr_[0]);
215  }
216 
217  if ( _MinBiasEventFlag->on() ) {
218  bookMonitorElementTriggered(DirName+"/"+"MinBias",false);
219  hTriggerName_MinBias = _dbe->bookString("triggerName_MinBias", minbiasExpr_[0]);
220  if (_verbose) std::cout << "_MinBiasEventFlag is on, folder created\n";
221  }
222 
223  if ( _HighMETEventFlag->on() ) {
224  bookMonitorElementTriggered(DirName+"/"+"HighMET",false);
225  hTriggerName_HighMET = _dbe->bookString("triggerName_HighMET", highMETExpr_[0]);
226  }
227 
228  // if ( _LowMETEventFlag->on() ) {
229  // bookMonitorElementTriggered(DirName+"/"+"LowMET",false);
230  // hTriggerName_LowMET = _dbe->bookString("triggerName_LowMET", lowMETExpr_[0]);
231  // }
232 
233  if ( _EleEventFlag->on() ) {
234  bookMonitorElementTriggered(DirName+"/"+"Ele",false);
235  hTriggerName_Ele = _dbe->bookString("triggerName_Ele", elecExpr_[0]);
236  if (_verbose) std::cout << "_EleEventFlag is on, folder created\n";
237  }
238 
239  if ( _MuonEventFlag->on() ) {
240  bookMonitorElementTriggered(DirName+"/"+"Muon",false);
241  hTriggerName_Muon = _dbe->bookString("triggerName_Muon", muonExpr_[0]);
242  if (_verbose) std::cout << "_MuonEventFlag is on, folder created\n";
243  }
244 }
GenericTriggerEventFlag * _LowPtJetEventFlag
MonitorElement * hTriggerName_MinBias
MonitorElement * hTriggerName_Muon
GenericTriggerEventFlag * _HighMETEventFlag
MonitorElement * hTriggerName_HighPtJet
std::vector< std::string > minbiasExpr_
void bookMonitorElement(std::string, bool)
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:838
MonitorElement * hTriggerName_LowPtJet
GenericTriggerEventFlag * _MinBiasEventFlag
std::vector< std::string > highPtJetExpr_
MonitorElement * hTriggerName_HighMET
GenericTriggerEventFlag * _EleEventFlag
GenericTriggerEventFlag * _HighPtJetEventFlag
void bookMonitorElementTriggered(std::string, bool)
GenericTriggerEventFlag * _MuonEventFlag
MonitorElement * hTriggerName_Ele
std::vector< std::string > elecExpr_
tuple cout
Definition: gather_cfg.py:121
std::vector< std::string > muonExpr_
std::vector< std::string > lowPtJetExpr_
std::vector< std::string > highMETExpr_
void CaloMETAnalyzer::bookMonitorElement ( std::string  DirName,
bool  bLumiSecPlot = false 
)

Definition at line 247 of file CaloMETAnalyzer.cc.

References gather_cfg::cout.

248 {
249  if (_verbose) std::cout << "bookMonitorElement " << DirName << std::endl;
250 
252 
253  bookMonitorElementTriggered(DirName, bLumiSecPlot);
254 
255 
256  if (_allhist) {
257 
258  hCaloMaxEtInEmTowers = _dbe->book1D("METTask_CaloMaxEtInEmTowers", "METTask_CaloMaxEtInEmTowers" ,100,0,2000);
259  hCaloMaxEtInEmTowers->setAxisTitle("Et(Max) in EM Tower [GeV]",1);
260  hCaloMaxEtInHadTowers = _dbe->book1D("METTask_CaloMaxEtInHadTowers", "METTask_CaloMaxEtInHadTowers" ,100,0,2000);
261  hCaloMaxEtInHadTowers->setAxisTitle("Et(Max) in Had Tower [GeV]",1);
262 
263  hCaloHadEtInHB = _dbe->book1D("METTask_CaloHadEtInHB","METTask_CaloHadEtInHB",100,0,2000);
264  hCaloHadEtInHB->setAxisTitle("Had Et [GeV]",1);
265  hCaloHadEtInHO = _dbe->book1D("METTask_CaloHadEtInHO","METTask_CaloHadEtInHO",25,0,500);
266  hCaloHadEtInHO->setAxisTitle("Had Et [GeV]",1);
267  hCaloHadEtInHE = _dbe->book1D("METTask_CaloHadEtInHE","METTask_CaloHadEtInHE",100,0,2000);
268  hCaloHadEtInHE->setAxisTitle("Had Et [GeV]",1);
269  hCaloHadEtInHF = _dbe->book1D("METTask_CaloHadEtInHF","METTask_CaloHadEtInHF",50,0,1000);
270  hCaloHadEtInHF->setAxisTitle("Had Et [GeV]",1);
271  hCaloEmEtInHF = _dbe->book1D("METTask_CaloEmEtInHF" ,"METTask_CaloEmEtInHF" ,25,0,500);
272  hCaloEmEtInHF->setAxisTitle("EM Et [GeV]",1);
273  hCaloEmEtInEE = _dbe->book1D("METTask_CaloEmEtInEE" ,"METTask_CaloEmEtInEE" ,50,0,1000);
274  hCaloEmEtInEE->setAxisTitle("EM Et [GeV]",1);
275  hCaloEmEtInEB = _dbe->book1D("METTask_CaloEmEtInEB" ,"METTask_CaloEmEtInEB" ,100,0,2000);
276  hCaloEmEtInEB->setAxisTitle("EM Et [GeV]",1);
277 
278  hCaloEmMEx= _dbe->book1D("METTask_CaloEmMEx","METTask_CaloEmMEx",200,-500,500);
279  hCaloEmMEx->setAxisTitle("EM MEx [GeV]",1);
280  hCaloEmMEy= _dbe->book1D("METTask_CaloEmMEy","METTask_CaloEmMEy",200,-500,500);
281  hCaloEmMEy->setAxisTitle("EM MEy [GeV]",1);
282  hCaloEmMET= _dbe->book1D("METTask_CaloEmMET","METTask_CaloEmMET",200,0,1000);
283  hCaloEmMET->setAxisTitle("EM MET [GeV]",1);
284  hCaloEmMETPhi= _dbe->book1D("METTask_CaloEmMETPhi","METTask_CaloEmMETPhi", 60, -3.2, 3.2);
285  hCaloEmMETPhi->setAxisTitle("EM METPhi [rad]",1);
286 
287  hCaloHaMEx= _dbe->book1D("METTask_CaloHaMEx","METTask_CaloHaMEx",200,-500,500);
288  hCaloHaMEx->setAxisTitle("HA MEx [GeV]",1);
289  hCaloHaMEy= _dbe->book1D("METTask_CaloHaMEy","METTask_CaloHaMEy",200,-500,500);
290  hCaloHaMEy->setAxisTitle("HA MEy [GeV]",1);
291  hCaloHaMET= _dbe->book1D("METTask_CaloHaMET","METTask_CaloHaMET",200,0,1000);
292  hCaloHaMET->setAxisTitle("HA MET [GeV]",1);
293  hCaloHaMETPhi= _dbe->book1D("METTask_CaloHaMETPhi","METTask_CaloHaMETPhi", 60, -3.2, 3.2);
294  hCaloHaMETPhi->setAxisTitle("HA METPhi [rad]",1);
295  }
296 }
MonitorElement * hCaloHadEtInHB
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * hCaloEmEtInHF
MonitorElement * hCaloMaxEtInHadTowers
MonitorElement * hCaloHadEtInHF
MonitorElement * hCaloHaMET
MonitorElement * hCaloEmMEx
MonitorElement * hCaloHadEtInHE
MonitorElement * hCaloEmEtInEB
MonitorElement * hCaloHaMEy
void bookMonitorElementTriggered(std::string, bool)
MonitorElement * hCaloEmMET
MonitorElement * hCaloEmMEy
MonitorElement * hCaloHadEtInHO
tuple cout
Definition: gather_cfg.py:121
MonitorElement * hCaloEmEtInEE
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * hCaloEmMETPhi
MonitorElement * hCaloMaxEtInEmTowers
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * hCaloHaMETPhi
MonitorElement * hCaloHaMEx
void CaloMETAnalyzer::bookMonitorElementTriggered ( std::string  DirName,
bool  bLumiSecPlot = false 
)

Definition at line 300 of file CaloMETAnalyzer.cc.

References gather_cfg::cout, nbinsPV, PVlow, and PVup.

301 {
302  if (_verbose) std::cout << "bookMonitorElementTriggered " << DirName << std::endl;
303 
305 
306 
307  hCaloMEx = _dbe->book1D("METTask_CaloMEx", "METTask_CaloMEx", 200, -500, 500);
308  hCaloMEy = _dbe->book1D("METTask_CaloMEy", "METTask_CaloMEy", 200, -500, 500);
309  hCaloMET = _dbe->book1D("METTask_CaloMET", "METTask_CaloMET", 200, 0, 1000);
310  hCaloMET1 = _dbe->book1D("METTask_CaloMET1", "METTask_CaloMET1", 80, 0, 200);
311  hCaloMETNoHF = _dbe->book1D("METTask_CaloMETNoHF", "METTask_CaloMETNoHF", 200, 0, 1000);
312  hCaloSumET = _dbe->book1D("METTask_CaloSumET", "METTask_CaloSumET", 400, 0, 4000);
313  hCaloMETSig = _dbe->book1D("METTask_CaloMETSig", "METTask_CaloMETSig", 51, 0, 51);
314  hCaloMETPhi = _dbe->book1D("METTask_CaloMETPhi", "METTask_CaloMETPhi", 60, -3.2, 3.2);
315  hCaloMETPhi020 = _dbe->book1D("METTask_CaloMETPhi020", "METTask_CaloMETPhi020", 60, -3.2, 3.2);
316  hCaloMET_logx = _dbe->book1D("METTask_CaloMET_logx", "METTask_CaloMET_logx", 40, -1, 7);
317  hCaloSumET_logx = _dbe->book1D("METTask_CaloSumET_logx", "METTask_CaloSumET_logx", 40, -1, 7);
318 
319  hCaloMEx ->setAxisTitle("MEx [GeV]", 1);
320  hCaloMEy ->setAxisTitle("MEy [GeV]", 1);
321  hCaloMET ->setAxisTitle("MET [GeV]", 1);
322  hCaloMET1 ->setAxisTitle("MET [GeV]", 1);
323  hCaloMETNoHF ->setAxisTitle("MET (No HF) [GeV]", 1);
324  hCaloSumET ->setAxisTitle("SumET [GeV]", 1);
325  hCaloMETSig ->setAxisTitle("METSig", 1);
326  hCaloMETPhi ->setAxisTitle("METPhi [rad]", 1);
327  hCaloMETPhi020 ->setAxisTitle("METPhi [rad] (MET>20 GeV)", 1);
328  hCaloMET_logx ->setAxisTitle("log(MET) [GeV]", 1);
329  hCaloSumET_logx->setAxisTitle("log(SumET) [GeV]", 1);
330 
331 
332  // Book NPV profiles
333  //----------------------------------------------------------------------------
334  hCaloMEx_profile = _dbe->bookProfile("METTask_CaloMEx_profile", "MEx [GeV]", nbinsPV, PVlow, PVup, 200, -500, 500);
335  hCaloMEy_profile = _dbe->bookProfile("METTask_CaloMEy_profile", "MEy [GeV]", nbinsPV, PVlow, PVup, 200, -500, 500);
336  hCaloMET_profile = _dbe->bookProfile("METTask_CaloMET_profile", "MET [GeV]", nbinsPV, PVlow, PVup, 200, 0, 1000);
337  hCaloMETNoHF_profile = _dbe->bookProfile("METTask_CaloMETNoHF_profile", "METNoHF [GeV]", nbinsPV, PVlow, PVup, 200, 0, 1000);
338  hCaloSumET_profile = _dbe->bookProfile("METTask_CaloSumET_profile", "SumET [GeV]", nbinsPV, PVlow, PVup, 400, 0, 4000);
339 
340 
341  // Set NPV profiles x-axis title
342  //----------------------------------------------------------------------------
343  hCaloMEx_profile ->setAxisTitle("nvtx", 1);
344  hCaloMEy_profile ->setAxisTitle("nvtx", 1);
345  hCaloMET_profile ->setAxisTitle("nvtx", 1);
347  hCaloSumET_profile ->setAxisTitle("nvtx", 1);
348 
349 
350  if (_allhist){
351  if (bLumiSecPlot){
352  hCaloMExLS = _dbe->book2D("METTask_CaloMEx_LS","METTask_CaloMEx_LS",200,-200,200,50,0.,500.);
353  hCaloMExLS->setAxisTitle("MEx [GeV]",1);
354  hCaloMExLS->setAxisTitle("Lumi Section",2);
355  hCaloMEyLS = _dbe->book2D("METTask_CaloMEy_LS","METTask_CaloMEy_LS",200,-200,200,50,0.,500.);
356  hCaloMEyLS->setAxisTitle("MEy [GeV]",1);
357  hCaloMEyLS->setAxisTitle("Lumi Section",2);
358  }
359 
360  //hCaloMaxEtInEmTowers = _dbe->book1D("METTask_CaloMaxEtInEmTowers", "METTask_CaloMaxEtInEmTowers" ,100,0,2000);
361  //hCaloMaxEtInEmTowers->setAxisTitle("Et(Max) in EM Tower [GeV]",1);
362  //hCaloMaxEtInHadTowers = _dbe->book1D("METTask_CaloMaxEtInHadTowers", "METTask_CaloMaxEtInHadTowers" ,100,0,2000);
363  //hCaloMaxEtInHadTowers->setAxisTitle("Et(Max) in Had Tower [GeV]",1);
364  hCaloEtFractionHadronic = _dbe->book1D("METTask_CaloEtFractionHadronic","METTask_CaloEtFractionHadronic",100,0,1);
365  hCaloEtFractionHadronic->setAxisTitle("Hadronic Et Fraction",1);
366  hCaloEmEtFraction = _dbe->book1D("METTask_CaloEmEtFraction", "METTask_CaloEmEtFraction" ,100,0,1);
367  hCaloEmEtFraction->setAxisTitle("EM Et Fraction",1);
368 
369  //hCaloEmEtFraction002 = _dbe->book1D("METTask_CaloEmEtFraction002", "METTask_CaloEmEtFraction002" ,100,0,1);
370  //hCaloEmEtFraction002->setAxisTitle("EM Et Fraction (MET>2 GeV)",1);
371  //hCaloEmEtFraction010 = _dbe->book1D("METTask_CaloEmEtFraction010", "METTask_CaloEmEtFraction010" ,100,0,1);
372  //hCaloEmEtFraction010->setAxisTitle("EM Et Fraction (MET>10 GeV)",1);
373  hCaloEmEtFraction020 = _dbe->book1D("METTask_CaloEmEtFraction020", "METTask_CaloEmEtFraction020" ,100,0,1);
374  hCaloEmEtFraction020->setAxisTitle("EM Et Fraction (MET>20 GeV)",1);
375  }
376 
377  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
378  hCalomuPt = _dbe->book1D("METTask_CalomuonPt", "METTask_CalomuonPt", 50, 0, 500);
379  hCalomuEta = _dbe->book1D("METTask_CalomuonEta", "METTask_CalomuonEta", 60, -3.0, 3.0);
380  hCalomuNhits = _dbe->book1D("METTask_CalomuonNhits", "METTask_CalomuonNhits", 50, 0, 50);
381  hCalomuChi2 = _dbe->book1D("METTask_CalomuonNormalizedChi2", "METTask_CalomuonNormalizedChi2", 20, 0, 20);
382  hCalomuD0 = _dbe->book1D("METTask_CalomuonD0", "METTask_CalomuonD0", 50, -1, 1);
383  hCaloMExCorrection = _dbe->book1D("METTask_CaloMExCorrection", "METTask_CaloMExCorrection", 100, -500.0,500.0);
384  hCaloMEyCorrection = _dbe->book1D("METTask_CaloMEyCorrection", "METTask_CaloMEyCorrection", 100, -500.0,500.0);
385  hCaloMuonCorrectionFlag = _dbe->book1D("METTask_CaloCorrectionFlag","METTask_CaloCorrectionFlag", 5, -0.5, 4.5);
386  }
387 
388 }
MonitorElement * hCaloMEy_profile
MonitorElement * hCaloMExCorrection
MonitorElement * hCaloMET1
MonitorElement * hCaloMETSig
MonitorElement * hCaloMETNoHF_profile
MonitorElement * hCaloMEyCorrection
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * hCaloMET
MonitorElement * hCalomuNhits
MonitorElement * hCaloMEyLS
const int nbinsPV
const double PVup
MonitorElement * hCaloSumET_logx
MonitorElement * hCalomuEta
MonitorElement * hCaloSumET_profile
MonitorElement * hCaloEmEtFraction020
MonitorElement * hCaloMETPhi020
MonitorElement * hCaloEtFractionHadronic
MonitorElement * hCalomuChi2
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1186
MonitorElement * hCaloMET_logx
const double PVlow
MonitorElement * hCaloMExLS
MonitorElement * hCalomuD0
MonitorElement * hCaloSumET
MonitorElement * hCaloMEy
std::string const & label() const
Definition: InputTag.h:42
MonitorElement * hCaloEmEtFraction
MonitorElement * hCaloMEx
MonitorElement * hCaloMuonCorrectionFlag
tuple cout
Definition: gather_cfg.py:121
MonitorElement * hCaloMET_profile
MonitorElement * hCaloMEx_profile
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
edm::InputTag theCaloMETCollectionLabel
MonitorElement * hCaloMETNoHF
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * hCalomuPt
MonitorElement * hCaloMETPhi
void CaloMETAnalyzer::computeEmHaMET ( edm::Handle< edm::View< reco::Candidate > >  towers)

Definition at line 975 of file CaloMETAnalyzer.cc.

References funct::cos(), CaloTower::emEnergy(), edm::View< T >::end(), CaloTower::et(), CaloTower::hadEnergy(), phi, reco::Candidate::phi(), funct::pow(), funct::sin(), reco::Candidate::theta(), and theta().

976 {
977 
979 
980  double sum_em_et = 0.0;
981  double sum_em_ex = 0.0;
982  double sum_em_ey = 0.0;
983  double sum_em_ez = 0.0;
984 
985  double sum_ha_et = 0.0;
986  double sum_ha_ex = 0.0;
987  double sum_ha_ey = 0.0;
988  double sum_ha_ez = 0.0;
989 
990  for ( ; towerCand != towers->end(); towerCand++)
991  {
992  const reco::Candidate* candidate = &(*towerCand);
993  if (candidate)
994  {
995  const CaloTower* calotower = dynamic_cast<const CaloTower*> (candidate);
996  if (calotower){
997  double Tower_ET = calotower->et();
998  if (Tower_ET>0.3) {
999 
1000  double phi = candidate->phi();
1001  double theta = candidate->theta();
1002  //double e = candidate->energy();
1003  double e_em = calotower->emEnergy();
1004  double e_ha = calotower->hadEnergy();
1005  double et_em = e_em*sin(theta);
1006  double et_ha = e_ha*sin(theta);
1007 
1008  sum_em_ez += e_em*cos(theta);
1009  sum_em_et += et_em;
1010  sum_em_ex += et_em*cos(phi);
1011  sum_em_ey += et_em*sin(phi);
1012 
1013  sum_ha_ez += e_ha*cos(theta);
1014  sum_ha_et += et_ha;
1015  sum_ha_ex += et_ha*cos(phi);
1016  sum_ha_ey += et_ha*sin(phi);
1017 
1018  } // Et>0.5
1019  } // calotower
1020  } // candidate
1021  } // loop
1022 
1023  //
1024  _EmMEx = -sum_em_ex;
1025  _EmMEy = -sum_em_ey;
1027  _EmCaloEz = sum_em_ez;
1028  _EmSumEt = sum_em_et;
1029  _EmMetPhi = atan2( _EmMEy, _EmMEx );
1030  //
1031  _HaMEx = -sum_ha_ex;
1032  _HaMEy = -sum_ha_ey;
1034  _HaCaloEz = sum_ha_ez;
1035  _HaSumEt = sum_ha_et;
1036  _HaMetPhi = atan2( _HaMEy, _HaMEx );
1037 
1038 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
virtual float phi() const =0
momentum azimuthal angle
double emEnergy() const
Definition: CaloTower.h:77
virtual double theta() const =0
momentum polar angle
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double hadEnergy() const
Definition: CaloTower.h:78
const_iterator begin() const
double et(double vtxZ) const
Definition: CaloTower.h:99
const_iterator end() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
Definition: DDAxes.h:10
void CaloMETAnalyzer::endJob ( void  )

Finish up a job.

Definition at line 191 of file CaloMETAnalyzer.cc.

References bTagSequences_cff::jetID.

191  {
192 
193  delete jetID;
194  delete DCSFilter;
195 
196 }
JetMETDQMDCSFilter * DCSFilter
reco::helper::JetIDHelper * jetID
void CaloMETAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup,
DQMStore dbe 
)

Finish up a run.

Definition at line 420 of file CaloMETAnalyzer.cc.

References cmsPerfPublish::DirName, TrackerOfflineValidation_Dqm_cff::dirName, MonitorElement::getRootObject(), MonitorElement::getTH1F(), i, and AlCaHLTBitMon_QueryRunRegistry::string.

421 {
422 
423  //
424  //--- Check the time length of the Run from the lumi section plots
425 
426  std::string dirName = "JetMET/MET/"+_source+"/";
427  _dbe->setCurrentFolder(dirName);
428 
429  TH1F* tlumisec;
430 
431  MonitorElement *meLumiSec = _dbe->get("aaa");
432  meLumiSec = _dbe->get("JetMET/lumisec");
433 
434  int totlsec=0;
435  double totltime=0.;
436  if ( meLumiSec->getRootObject() ) {
437  tlumisec = meLumiSec->getTH1F();
438  for (int i=0; i<500; i++){
439  if (tlumisec->GetBinContent(i+1)) totlsec++;
440  }
441  totltime = double(totlsec*90); // one lumi sec ~ 90 (sec)
442  }
443 
444  if (totltime==0.) totltime=1.;
445 
446  //
447  //--- Make the integrated plots with rate (Hz)
448 
449  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin(); ic != _FolderNames.end(); ic++)
450  {
451 
453  DirName = dirName+*ic;
454 
455  makeRatePlot(DirName,totltime);
456  if ( _HighPtJetEventFlag->on() )
457  makeRatePlot(DirName+"/"+"triggerName_HighJetPt",totltime);
458  if ( _LowPtJetEventFlag->on() )
459  makeRatePlot(DirName+"/"+"triggerName_LowJetPt",totltime);
460  if ( _MinBiasEventFlag->on() )
461  makeRatePlot(DirName+"/"+"triggerName_MinBias",totltime);
462  if ( _HighMETEventFlag->on() )
463  makeRatePlot(DirName+"/"+"triggerName_HighMET",totltime);
464  // if ( _LowMETEventFlag->on() )
465  // makeRatePlot(DirName+"/"+"triggerName_LowMET",totltime);
466  if ( _EleEventFlag->on() )
467  makeRatePlot(DirName+"/"+"triggerName_Ele",totltime);
468  if ( _MuonEventFlag->on() )
469  makeRatePlot(DirName+"/"+"triggerName_Muon",totltime);
470  }
471 }
int i
Definition: DBlmapReader.cc:9
GenericTriggerEventFlag * _LowPtJetEventFlag
GenericTriggerEventFlag * _HighMETEventFlag
std::string _source
void makeRatePlot(std::string, double)
std::vector< std::string > _FolderNames
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
GenericTriggerEventFlag * _MinBiasEventFlag
GenericTriggerEventFlag * _EleEventFlag
TObject * getRootObject(void) const
GenericTriggerEventFlag * _HighPtJetEventFlag
GenericTriggerEventFlag * _MuonEventFlag
TH1F * getTH1F(void) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void CaloMETAnalyzer::fillMESet ( const edm::Event iEvent,
std::string  DirName,
const reco::CaloMET calomet,
const reco::CaloMET calometnohf 
)

Definition at line 1102 of file CaloMETAnalyzer.cc.

1105 {
1106 
1108 
1109  bool bLumiSecPlot=false;
1110  if (DirName.find("All")) bLumiSecPlot=true;
1111 
1112  if (_trig_JetMB)
1113  fillMonitorElement(iEvent,DirName,"",calomet,calometnohf, bLumiSecPlot);
1114  if (_trig_HighPtJet)
1115  fillMonitorElementTriggered(iEvent,DirName,"HighPtJet",calomet,calometnohf,false);
1116  if (_trig_LowPtJet)
1117  fillMonitorElementTriggered(iEvent,DirName,"LowPtJet",calomet,calometnohf,false);
1118  if (_trig_MinBias)
1119  fillMonitorElementTriggered(iEvent,DirName,"MinBias",calomet,calometnohf,false);
1120  if (_trig_HighMET)
1121  fillMonitorElementTriggered(iEvent,DirName,"HighMET",calomet,calometnohf,false);
1122  // if (_trig_LowMET)
1123  // fillMonitorElementTriggered(iEvent,DirName,"LowMET",calomet,calometnohf,false);
1124  if (_trig_Ele)
1125  fillMonitorElementTriggered(iEvent,DirName,"Ele",calomet,calometnohf,false);
1126  if (_trig_Muon) {
1127  fillMonitorElementTriggered(iEvent,DirName,"Muon",calomet,calometnohf,false);
1128  }
1129 }
void fillMonitorElementTriggered(const edm::Event &, std::string, std::string, const reco::CaloMET &, const reco::CaloMET &, bool)
void fillMonitorElement(const edm::Event &, std::string, std::string, const reco::CaloMET &, const reco::CaloMET &, bool)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void CaloMETAnalyzer::fillMESubSet ( const edm::Event ,
std::string  ,
const reco::CaloMET ,
const reco::CaloMET  
)
void CaloMETAnalyzer::fillMonitorElement ( const edm::Event iEvent,
std::string  DirName,
std::string  TriggerTypeName,
const reco::CaloMET calomet,
const reco::CaloMET calometnohf,
bool  bLumiSecPlot 
)

Definition at line 1132 of file CaloMETAnalyzer.cc.

References gather_cfg::cout, reco::CaloMET::emEtInEB(), reco::CaloMET::emEtInEE(), reco::CaloMET::emEtInHF(), reco::CaloMET::hadEtInHB(), reco::CaloMET::hadEtInHE(), reco::CaloMET::hadEtInHF(), reco::CaloMET::hadEtInHO(), reco::CaloMET::maxEtInEmTowers(), reco::CaloMET::maxEtInHadTowers(), and reco::MET::sumEt().

1137 {
1138  fillMonitorElementTriggered(iEvent, DirName, TriggerTypeName, calomet, calometnohf, bLumiSecPlot);
1139 
1140  double caloSumET = calomet.sumEt();
1141 
1142  /*
1143  double caloMETSig = calomet.mEtSig();
1144  //double caloEz = calomet.e_longitudinal();
1145  double caloMET = calomet.pt();
1146  double caloMEx = calomet.px();
1147  double caloMEy = calomet.py();
1148  double caloMETPhi = calomet.phi();
1149 
1150  double caloMETNoHF = calometnohf.pt();
1151  //double caloMETNoHFPhi = calometnohf.phi();
1152 
1153  if (_verbose) std::cout << _source << " " << caloMET << std::endl;
1154 
1155  double caloEtFractionHadronic = calomet.etFractionHadronic();
1156  double caloEmEtFraction = calomet.emEtFraction();
1157  */
1158  double caloMaxEtInEMTowers = calomet.maxEtInEmTowers();
1159  double caloMaxEtInHadTowers = calomet.maxEtInHadTowers();
1160 
1161  double caloHadEtInHB = calomet.hadEtInHB();
1162  double caloHadEtInHO = calomet.hadEtInHO();
1163  double caloHadEtInHE = calomet.hadEtInHE();
1164  double caloHadEtInHF = calomet.hadEtInHF();
1165  double caloEmEtInEB = calomet.emEtInEB();
1166  double caloEmEtInEE = calomet.emEtInEE();
1167  double caloEmEtInHF = calomet.emEtInHF();
1168  //
1169  // int myLuminosityBlock;
1170  // myLuminosityBlock = (evtCounter++)/1000;
1171  // myLuminosityBlock = iEvent.luminosityBlock();
1172  //
1173 
1174  if (TriggerTypeName!="") DirName = DirName +"/"+TriggerTypeName;
1175 
1176  if (_verbose) std::cout << "_etThreshold = " << _etThreshold << std::endl;
1177  if (caloSumET>_etThreshold){
1178  /*
1179  hCaloMEx = _dbe->get(DirName+"/"+"METTask_CaloMEx"); if (hCaloMEx && hCaloMEx->getRootObject() ) hCaloMEx->Fill(caloMEx);
1180  hCaloMEy = _dbe->get(DirName+"/"+"METTask_CaloMEy"); if (hCaloMEy && hCaloMEy->getRootObject() ) hCaloMEy->Fill(caloMEy);
1181  hCaloMET = _dbe->get(DirName+"/"+"METTask_CaloMET"); if (hCaloMET && hCaloMET->getRootObject() ) hCaloMET->Fill(caloMET);
1182  hCaloMET1 = _dbe->get(DirName+"/"+"METTask_CaloMET1"); if (hCaloMET1 && hCaloMET1->getRootObject() ) hCaloMET1->Fill(caloMET);
1183  hCaloMETPhi = _dbe->get(DirName+"/"+"METTask_CaloMETPhi"); if (hCaloMETPhi && hCaloMETPhi->getRootObject() ) hCaloMETPhi->Fill(caloMETPhi);
1184  hCaloSumET = _dbe->get(DirName+"/"+"METTask_CaloSumET"); if (hCaloSumET && hCaloSumET->getRootObject() ) hCaloSumET->Fill(caloSumET);
1185  hCaloMETSig = _dbe->get(DirName+"/"+"METTask_CaloMETSig"); if (hCaloMETSig && hCaloMETSig->getRootObject() ) hCaloMETSig->Fill(caloMETSig);
1186  //hCaloEz = _dbe->get(DirName+"/"+"METTask_CaloEz"); if (hCaloEz && hCaloEz->getRootObject() ) hCaloEz->Fill(caloEz);
1187 
1188  hCaloMETNoHF = _dbe->get(DirName+"/"+"METTask_CaloMETNoHF"); if (hCaloMETNoHF && hCaloMETNoHF->getRootObject() ) hCaloMETNoHF->Fill(caloMETNoHF);
1189 
1190  hCaloMET_logx = _dbe->get(DirName+"/"+"METTask_CaloMET_logx"); if (hCaloMET_logx && hCaloMET_logx->getRootObject() ) hCaloMET_logx->Fill(log10(caloMET));
1191  hCaloSumET_logx = _dbe->get(DirName+"/"+"METTask_CaloSumET_logx"); if (hCaloSumET_logx && hCaloSumET_logx->getRootObject() ) hCaloSumET_logx->Fill(log10(caloSumET));
1192 
1193  // hCaloMETIonFeedbck = _dbe->get(DirName+"/"+"METTask_CaloMETIonFeedbck"); if (hCaloMETIonFeedbck && hCaloMETIonFeedbck->getRootObject() ) hCaloMETIonFeedbck->Fill(caloMET);
1194  // hCaloMETHPDNoise = _dbe->get(DirName+"/"+"METTask_CaloMETHPDNoise"); if (hCaloMETHPDNoise && hCaloMETHPDNoise->getRootObject() ) hCaloMETHPDNoise->Fill(caloMET);
1195 
1196  //hCaloMETPhi002 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi002"); if (caloMET> 2. && hCaloMETPhi002 && hCaloMETPhi002->getRootObject()) { hCaloMETPhi002->Fill(caloMETPhi);}
1197  //hCaloMETPhi010 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi010"); if (caloMET> 10. && hCaloMETPhi010 && hCaloMETPhi010->getRootObject()) { hCaloMETPhi010->Fill(caloMETPhi);}
1198  hCaloMETPhi020 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi020"); if (caloMET> 20. && hCaloMETPhi020 && hCaloMETPhi020->getRootObject()) { hCaloMETPhi020->Fill(caloMETPhi);}
1199  */
1200 
1201  if (_allhist){
1202  /*
1203  if (bLumiSecPlot){
1204  hCaloMExLS = _dbe->get(DirName+"/"+"METTask_CaloMEx_LS"); if (hCaloMExLS && hCaloMExLS->getRootObject()) hCaloMExLS->Fill(caloMEx,myLuminosityBlock);
1205  hCaloMEyLS = _dbe->get(DirName+"/"+"METTask_CaloMEy_LS"); if (hCaloMEyLS && hCaloMEyLS->getRootObject()) hCaloMEyLS->Fill(caloMEy,myLuminosityBlock);
1206  }
1207  hCaloEtFractionHadronic = _dbe->get(DirName+"/"+"METTask_CaloEtFractionHadronic"); if (hCaloEtFractionHadronic && hCaloEtFractionHadronic->getRootObject()) hCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
1208  hCaloEmEtFraction = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction"); if (hCaloEmEtFraction && hCaloEmEtFraction->getRootObject()) hCaloEmEtFraction->Fill(caloEmEtFraction);
1209 
1210  //hCaloEmEtFraction002 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction002"); if (caloMET> 2. && hCaloEmEtFraction002 && hCaloEmEtFraction002->getRootObject()) hCaloEmEtFraction002->Fill(caloEmEtFraction);
1211  //hCaloEmEtFraction010 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction010"); if (caloMET> 10. && hCaloEmEtFraction010 && hCaloEmEtFraction010->getRootObject()) hCaloEmEtFraction010->Fill(caloEmEtFraction);
1212  hCaloEmEtFraction020 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction020"); if (caloMET> 20. && hCaloEmEtFraction020 && hCaloEmEtFraction020->getRootObject()) hCaloEmEtFraction020->Fill(caloEmEtFraction);
1213  */
1214 
1215  hCaloMaxEtInEmTowers = _dbe->get(DirName+"/"+"METTask_CaloMaxEtInEmTowers"); if (hCaloMaxEtInEmTowers && hCaloMaxEtInEmTowers->getRootObject()) hCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
1216  hCaloMaxEtInHadTowers = _dbe->get(DirName+"/"+"METTask_CaloMaxEtInHadTowers"); if (hCaloMaxEtInHadTowers && hCaloMaxEtInHadTowers->getRootObject()) hCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
1217 
1218  hCaloHadEtInHB = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHB"); if (hCaloHadEtInHB && hCaloHadEtInHB->getRootObject()) hCaloHadEtInHB->Fill(caloHadEtInHB);
1219  hCaloHadEtInHO = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHO"); if (hCaloHadEtInHO && hCaloHadEtInHO->getRootObject()) hCaloHadEtInHO->Fill(caloHadEtInHO);
1220  hCaloHadEtInHE = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHE"); if (hCaloHadEtInHE && hCaloHadEtInHE->getRootObject()) hCaloHadEtInHE->Fill(caloHadEtInHE);
1221  hCaloHadEtInHF = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHF"); if (hCaloHadEtInHF && hCaloHadEtInHF->getRootObject()) hCaloHadEtInHF->Fill(caloHadEtInHF);
1222  hCaloEmEtInEB = _dbe->get(DirName+"/"+"METTask_CaloEmEtInEB"); if (hCaloEmEtInEB && hCaloEmEtInEB->getRootObject()) hCaloEmEtInEB->Fill(caloEmEtInEB);
1223  hCaloEmEtInEE = _dbe->get(DirName+"/"+"METTask_CaloEmEtInEE"); if (hCaloEmEtInEE && hCaloEmEtInEE->getRootObject()) hCaloEmEtInEE->Fill(caloEmEtInEE);
1224  hCaloEmEtInHF = _dbe->get(DirName+"/"+"METTask_CaloEmEtInHF"); if (hCaloEmEtInHF && hCaloEmEtInHF->getRootObject()) hCaloEmEtInHF->Fill(caloEmEtInHF);
1225 
1226  hCaloEmMEx = _dbe->get(DirName+"/"+"METTask_CaloEmMEx"); if (hCaloEmMEx && hCaloEmMEx->getRootObject()) hCaloEmMEx->Fill(_EmMEx);
1227  hCaloEmMEy = _dbe->get(DirName+"/"+"METTask_CaloEmMEy"); if (hCaloEmMEy && hCaloEmMEy->getRootObject()) hCaloEmMEy->Fill(_EmMEy);
1228  //hCaloEmEz = _dbe->get(DirName+"/"+"METTask_CaloEmEz"); if (hCaloEmEz && hCaloEmEz->getRootObject()) hCaloEmEz->Fill(_EmCaloEz);
1229  hCaloEmMET = _dbe->get(DirName+"/"+"METTask_CaloEmMET"); if (hCaloEmMET && hCaloEmMET->getRootObject()) hCaloEmMET->Fill(_EmMET);
1230  hCaloEmMETPhi = _dbe->get(DirName+"/"+"METTask_CaloEmMETPhi"); if (hCaloEmMETPhi && hCaloEmMETPhi->getRootObject()) hCaloEmMETPhi->Fill(_EmMetPhi);
1231  //hCaloEmSumET = _dbe->get(DirName+"/"+"METTask_CaloEmSumET"); if (hCaloEmSumET && hCaloEmSumET->getRootObject()) hCaloEmSumET->Fill(_EmSumEt);
1232 
1233  hCaloHaMEx = _dbe->get(DirName+"/"+"METTask_CaloHaMEx"); if (hCaloHaMEx && hCaloHaMEx->getRootObject()) hCaloHaMEx->Fill(_HaMEx);
1234  hCaloHaMEy = _dbe->get(DirName+"/"+"METTask_CaloHaMEy"); if (hCaloHaMEy && hCaloHaMEy->getRootObject()) hCaloHaMEy->Fill(_HaMEy);
1235  //hCaloHaEz = _dbe->get(DirName+"/"+"METTask_CaloHaEz"); if (hCaloHaEz && hCaloHaEz->getRootObject()) hCaloHaEz->Fill(_HaCaloEz);
1236  hCaloHaMET = _dbe->get(DirName+"/"+"METTask_CaloHaMET"); if (hCaloHaMET && hCaloHaMET->getRootObject()) hCaloHaMET->Fill(_HaMET);
1237  hCaloHaMETPhi = _dbe->get(DirName+"/"+"METTask_CaloHaMETPhi"); if (hCaloHaMETPhi && hCaloHaMETPhi->getRootObject()) hCaloHaMETPhi->Fill(_HaMetPhi);
1238  //hCaloHaSumET = _dbe->get(DirName+"/"+"METTask_CaloHaSumET"); if (hCaloHaSumET && hCaloHaSumET->getRootObject()) hCaloHaSumET->Fill(_HaSumEt);
1239 
1240  } // _allhist
1241  /*
1242  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
1243 
1244  for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
1245  const reco::TrackRef siTrack = muonit->innerTrack();
1246  hCalomuPt = _dbe->get(DirName+"/"+"METTask_CalomuPt"); if (hCalomuPt && hCalomuPt->getRootObject()) hCalomuPt->Fill( muonit->p4().pt() );
1247  hCalomuEta = _dbe->get(DirName+"/"+"METTask_CalomuEta"); if (hCalomuEta && hCalomuEta->getRootObject()) hCalomuEta->Fill( muonit->p4().eta() );
1248  hCalomuNhits = _dbe->get(DirName+"/"+"METTask_CalomuNhits"); if (hCalomuNhits && hCalomuNhits->getRootObject()) hCalomuNhits->Fill( siTrack.isNonnull() ? siTrack->numberOfValidHits() : -999 );
1249  hCalomuChi2 = _dbe->get(DirName+"/"+"METTask_CalomuChi2"); if (hCalomuChi2 && hCalomuChi2->getRootObject()) hCalomuChi2->Fill( siTrack.isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
1250  double d0 = siTrack.isNonnull() ? -1 * siTrack->dxy( bspot) : -999;
1251  hCalomuD0 = _dbe->get(DirName+"/"+"METTask_CalomuD0"); if (hCalomuD0 && hCalomuD0->getRootObject()) hCalomuD0->Fill( d0 );
1252  }
1253 
1254  const unsigned int nMuons = muon_h->size();
1255  for( unsigned int mus = 0; mus < nMuons; mus++ ) {
1256  reco::MuonRef muref( muon_h, mus);
1257  reco::MuonMETCorrectionData muCorrData = (*corMetGlobalMuons_ValueMap_Handle)[muref];
1258  hCaloMExCorrection = _dbe->get(DirName+"/"+"METTask_CaloMExCorrection"); if (hCaloMExCorrection && hCaloMExCorrection->getRootObject()) hCaloMExCorrection-> Fill(muCorrData.corrY());
1259  hCaloMEyCorrection = _dbe->get(DirName+"/"+"METTask_CaloMEyCorrection"); if (hCaloMEyCorrection && hCaloMEyCorrection->getRootObject()) hCaloMEyCorrection-> Fill(muCorrData.corrX());
1260  hCaloMuonCorrectionFlag = _dbe->get(DirName+"/"+"METTask_CaloMuonCorrectionFlag"); if (hCaloMuonCorrectionFlag && hCaloMuonCorrectionFlag->getRootObject()) hCaloMuonCorrectionFlag-> Fill(muCorrData.type());
1261  }
1262  }
1263  */
1264  } // et threshold cut
1265 
1266 }
double hadEtInHE() const
Definition: CaloMET.h:51
MonitorElement * hCaloHadEtInHB
double hadEtInHF() const
Definition: CaloMET.h:53
double maxEtInHadTowers() const
Definition: CaloMET.h:40
MonitorElement * hCaloEmEtInHF
MonitorElement * hCaloMaxEtInHadTowers
MonitorElement * hCaloHadEtInHF
double maxEtInEmTowers() const
Definition: CaloMET.h:38
void Fill(long long x)
MonitorElement * hCaloHaMET
double sumEt() const
Definition: MET.h:48
void fillMonitorElementTriggered(const edm::Event &, std::string, std::string, const reco::CaloMET &, const reco::CaloMET &, bool)
MonitorElement * hCaloEmMEx
MonitorElement * hCaloHadEtInHE
double emEtInEB() const
Definition: CaloMET.h:55
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
MonitorElement * hCaloEmEtInEB
MonitorElement * hCaloHaMEy
double hadEtInHO() const
Definition: CaloMET.h:49
TObject * getRootObject(void) const
MonitorElement * hCaloEmMET
MonitorElement * hCaloEmMEy
double emEtInEE() const
Definition: CaloMET.h:57
MonitorElement * hCaloHadEtInHO
double emEtInHF() const
Definition: CaloMET.h:59
tuple cout
Definition: gather_cfg.py:121
MonitorElement * hCaloEmEtInEE
double hadEtInHB() const
Definition: CaloMET.h:47
MonitorElement * hCaloEmMETPhi
MonitorElement * hCaloMaxEtInEmTowers
MonitorElement * hCaloHaMETPhi
MonitorElement * hCaloHaMEx
void CaloMETAnalyzer::fillMonitorElementTriggered ( const edm::Event iEvent,
std::string  DirName,
std::string  TriggerTypeName,
const reco::CaloMET calomet,
const reco::CaloMET calometnohf,
bool  bLumiSecPlot 
)

Definition at line 1269 of file CaloMETAnalyzer.cc.

References reco::MuonMETCorrectionData::corrX(), reco::MuonMETCorrectionData::corrY(), gather_cfg::cout, reco::CaloMET::emEtFraction(), reco::CaloMET::etFractionHadronic(), HcalObjRepresent::Fill(), edm::Ref< C, T, F >::get(), edm::Ref< C, T, F >::isNonnull(), edm::EventBase::luminosityBlock(), reco::MET::mEtSig(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::MET::sumEt(), and reco::MuonMETCorrectionData::type().

1274 {
1275 
1276  if (TriggerTypeName=="HighPtJet") {
1277  if (!selectHighPtJetEvent(iEvent)) return;
1278  }
1279  else if (TriggerTypeName=="LowPtJet") {
1280  if (!selectLowPtJetEvent(iEvent)) return;
1281  }
1282  else if (TriggerTypeName=="HighMET") {
1283  if (calomet.pt()<_highMETThreshold) return;
1284  }
1285  // else if (TriggerTypeName=="LowMET") {
1286  // if (calomet.pt()<_lowMETThreshold) return;
1287  // }
1288  else if (TriggerTypeName=="Ele") {
1289  if (!selectWElectronEvent(iEvent)) return;
1290  }
1291  else if (TriggerTypeName=="Muon") {
1292  if (!selectWMuonEvent(iEvent)) return;
1293  }
1294 
1295  double caloSumET = calomet.sumEt();
1296  double caloMETSig = calomet.mEtSig();
1297  //double caloEz = calomet.e_longitudinal();
1298  double caloMET = calomet.pt();
1299  double caloMEx = calomet.px();
1300  double caloMEy = calomet.py();
1301  double caloMETPhi = calomet.phi();
1302 
1303  double caloMETNoHF = calometnohf.pt();
1304  //double caloMETNoHFPhi = calometnohf.phi();
1305 
1306  if (_verbose) std::cout << _source << " " << caloMET << std::endl;
1307 
1308  double caloEtFractionHadronic = calomet.etFractionHadronic();
1309  double caloEmEtFraction = calomet.emEtFraction();
1310 
1311  //double caloMaxEtInEMTowers = calomet.maxEtInEmTowers();
1312  //double caloMaxEtInHadTowers = calomet.maxEtInHadTowers();
1313 
1314  //double caloHadEtInHB = calomet.hadEtInHB();
1315  //double caloHadEtInHO = calomet.hadEtInHO();
1316  //double caloHadEtInHE = calomet.hadEtInHE();
1317  //double caloHadEtInHF = calomet.hadEtInHF();
1318  //double caloEmEtInEB = calomet.emEtInEB();
1319  //double caloEmEtInEE = calomet.emEtInEE();
1320  //double caloEmEtInHF = calomet.emEtInHF();
1321 
1322  //
1323  int myLuminosityBlock;
1324  // myLuminosityBlock = (evtCounter++)/1000;
1325  myLuminosityBlock = iEvent.luminosityBlock();
1326  //
1327 
1328  if (TriggerTypeName!="") DirName = DirName +"/"+TriggerTypeName;
1329 
1330  if (_verbose) std::cout << "_etThreshold = " << _etThreshold << std::endl;
1331  if (caloSumET>_etThreshold){
1332  hCaloMEx = _dbe->get(DirName+"/"+"METTask_CaloMEx"); if (hCaloMEx && hCaloMEx->getRootObject() ) hCaloMEx->Fill(caloMEx);
1333  hCaloMEy = _dbe->get(DirName+"/"+"METTask_CaloMEy"); if (hCaloMEy && hCaloMEy->getRootObject() ) hCaloMEy->Fill(caloMEy);
1334  hCaloMET = _dbe->get(DirName+"/"+"METTask_CaloMET"); if (hCaloMET && hCaloMET->getRootObject() ) hCaloMET->Fill(caloMET);
1335  hCaloMET1 = _dbe->get(DirName+"/"+"METTask_CaloMET1"); if (hCaloMET1 && hCaloMET1->getRootObject() ) hCaloMET1->Fill(caloMET);
1336  hCaloMETPhi = _dbe->get(DirName+"/"+"METTask_CaloMETPhi"); if (hCaloMETPhi && hCaloMETPhi->getRootObject() ) hCaloMETPhi->Fill(caloMETPhi);
1337  hCaloSumET = _dbe->get(DirName+"/"+"METTask_CaloSumET"); if (hCaloSumET && hCaloSumET->getRootObject() ) hCaloSumET->Fill(caloSumET);
1338  hCaloMETSig = _dbe->get(DirName+"/"+"METTask_CaloMETSig"); if (hCaloMETSig && hCaloMETSig->getRootObject() ) hCaloMETSig->Fill(caloMETSig);
1339  //hCaloEz = _dbe->get(DirName+"/"+"METTask_CaloEz"); if (hCaloEz && hCaloEz->getRootObject() ) hCaloEz->Fill(caloEz);
1340 
1341  hCaloMETNoHF = _dbe->get(DirName+"/"+"METTask_CaloMETNoHF"); if (hCaloMETNoHF && hCaloMETNoHF->getRootObject() ) hCaloMETNoHF->Fill(caloMETNoHF);
1342 
1343  hCaloMET_logx = _dbe->get(DirName+"/"+"METTask_CaloMET_logx"); if (hCaloMET_logx && hCaloMET_logx->getRootObject() ) hCaloMET_logx->Fill(log10(caloMET));
1344  hCaloSumET_logx = _dbe->get(DirName+"/"+"METTask_CaloSumET_logx"); if (hCaloSumET_logx && hCaloSumET_logx->getRootObject() ) hCaloSumET_logx->Fill(log10(caloSumET));
1345 
1346 
1347  // Fill NPV profiles
1348  //--------------------------------------------------------------------------
1349  hCaloMEx_profile = _dbe->get(DirName + "/METTask_CaloMEx_profile");
1350  hCaloMEy_profile = _dbe->get(DirName + "/METTask_CaloMEy_profile");
1351  hCaloMET_profile = _dbe->get(DirName + "/METTask_CaloMET_profile");
1352  hCaloMETNoHF_profile = _dbe->get(DirName + "/METTask_CaloMETNoHF_profile");
1353  hCaloSumET_profile = _dbe->get(DirName + "/METTask_CaloSumET_profile");
1354 
1355  if (hCaloMEx_profile && hCaloMEx_profile ->getRootObject()) hCaloMEx_profile ->Fill(_numPV, caloMEx);
1356  if (hCaloMEy_profile && hCaloMEy_profile ->getRootObject()) hCaloMEy_profile ->Fill(_numPV, caloMEy);
1357  if (hCaloMET_profile && hCaloMET_profile ->getRootObject()) hCaloMET_profile ->Fill(_numPV, caloMET);
1359  if (hCaloSumET_profile && hCaloSumET_profile ->getRootObject()) hCaloSumET_profile ->Fill(_numPV, caloSumET);
1360 
1361 
1362  //hCaloEz = _dbe->get(DirName+"/"+"METTask_CaloEz_profile"); if (hCaloEz && hCaloEz_profile->getRootObject() ) hCaloEz_profile->Fill(caloEz);
1363  // hCaloMETIonFeedbck = _dbe->get(DirName+"/"+"METTask_CaloMETIonFeedbck"); if (hCaloMETIonFeedbck && hCaloMETIonFeedbck->getRootObject() ) hCaloMETIonFeedbck->Fill(caloMET);
1364  // haloMETHPDNoise = _dbe->get(DirName+"/"+"METTask_CaloMETHPDNoise"); if (hCaloMETHPDNoise && hCaloMETHPDNoise->getRootObject() ) hCaloMETHPDNoise->Fill(caloMET);
1365 
1366  //hCaloMETPhi002 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi002"); if (caloMET> 2. && hCaloMETPhi002 && hCaloMETPhi002->getRootObject()) { hCaloMETPhi002->Fill(caloMETPhi);}
1367  //hCaloMETPhi010 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi010"); if (caloMET> 10. && hCaloMETPhi010 && hCaloMETPhi010->getRootObject()) { hCaloMETPhi010->Fill(caloMETPhi);}
1368  hCaloMETPhi020 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi020"); if (caloMET> 20. && hCaloMETPhi020 && hCaloMETPhi020->getRootObject()) { hCaloMETPhi020->Fill(caloMETPhi);}
1369 
1370  if (_allhist){
1371  if (bLumiSecPlot){
1372  hCaloMExLS = _dbe->get(DirName+"/"+"METTask_CaloMEx_LS"); if (hCaloMExLS && hCaloMExLS->getRootObject()) hCaloMExLS->Fill(caloMEx,myLuminosityBlock);
1373  hCaloMEyLS = _dbe->get(DirName+"/"+"METTask_CaloMEy_LS"); if (hCaloMEyLS && hCaloMEyLS->getRootObject()) hCaloMEyLS->Fill(caloMEy,myLuminosityBlock);
1374  }
1375 
1376  hCaloEtFractionHadronic = _dbe->get(DirName+"/"+"METTask_CaloEtFractionHadronic"); if (hCaloEtFractionHadronic && hCaloEtFractionHadronic->getRootObject()) hCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
1377  hCaloEmEtFraction = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction"); if (hCaloEmEtFraction && hCaloEmEtFraction->getRootObject()) hCaloEmEtFraction->Fill(caloEmEtFraction);
1378 
1379  //hCaloEmEtFraction002 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction002"); if (caloMET> 2. && hCaloEmEtFraction002 && hCaloEmEtFraction002->getRootObject()) hCaloEmEtFraction002->Fill(caloEmEtFraction);
1380  //hCaloEmEtFraction010 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction010"); if (caloMET> 10. && hCaloEmEtFraction010 && hCaloEmEtFraction010->getRootObject()) hCaloEmEtFraction010->Fill(caloEmEtFraction);
1381  hCaloEmEtFraction020 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction020"); if (caloMET> 20. && hCaloEmEtFraction020 && hCaloEmEtFraction020->getRootObject()) hCaloEmEtFraction020->Fill(caloEmEtFraction);
1382 
1383  //hCaloMaxEtInEmTowers = _dbe->get(DirName+"/"+"METTask_CaloMaxEtInEmTowers"); if (hCaloMaxEtInEmTowers && hCaloMaxEtInEmTowers->getRootObject()) hCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
1384  //hCaloMaxEtInHadTowers = _dbe->get(DirName+"/"+"METTask_CaloMaxEtInHadTowers"); if (hCaloMaxEtInHadTowers && hCaloMaxEtInHadTowers->getRootObject()) hCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
1385  //
1386  //hCaloHadEtInHB = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHB"); if (hCaloHadEtInHB && hCaloHadEtInHB->getRootObject()) hCaloHadEtInHB->Fill(caloHadEtInHB);
1387  //hCaloHadEtInHO = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHO"); if (hCaloHadEtInHO && hCaloHadEtInHO->getRootObject()) hCaloHadEtInHO->Fill(caloHadEtInHO);
1388  //hCaloHadEtInHE = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHE"); if (hCaloHadEtInHE && hCaloHadEtInHE->getRootObject()) hCaloHadEtInHE->Fill(caloHadEtInHE);
1389  //hCaloHadEtInHF = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHF"); if (hCaloHadEtInHF && hCaloHadEtInHF->getRootObject()) hCaloHadEtInHF->Fill(caloHadEtInHF);
1390  //hCaloEmEtInEB = _dbe->get(DirName+"/"+"METTask_CaloEmEtInEB"); if (hCaloEmEtInEB && hCaloEmEtInEB->getRootObject()) hCaloEmEtInEB->Fill(caloEmEtInEB);
1391  //hCaloEmEtInEE = _dbe->get(DirName+"/"+"METTask_CaloEmEtInEE"); if (hCaloEmEtInEE && hCaloEmEtInEE->getRootObject()) hCaloEmEtInEE->Fill(caloEmEtInEE);
1392  //hCaloEmEtInHF = _dbe->get(DirName+"/"+"METTask_CaloEmEtInHF"); if (hCaloEmEtInHF && hCaloEmEtInHF->getRootObject()) hCaloEmEtInHF->Fill(caloEmEtInHF);
1393  //
1394  //hCaloEmMEx = _dbe->get(DirName+"/"+"METTask_CaloEmMEx"); if (hCaloEmMEx && hCaloEmMEx->getRootObject()) hCaloEmMEx->Fill(_EmMEx);
1395  //hCaloEmMEy = _dbe->get(DirName+"/"+"METTask_CaloEmMEy"); if (hCaloEmMEy && hCaloEmMEy->getRootObject()) hCaloEmMEy->Fill(_EmMEy);
1397  //hCaloEmMET = _dbe->get(DirName+"/"+"METTask_CaloEmMET"); if (hCaloEmMET && hCaloEmMET->getRootObject()) hCaloEmMET->Fill(_EmMET);
1398  //hCaloEmMETPhi = _dbe->get(DirName+"/"+"METTask_CaloEmMETPhi"); if (hCaloEmMETPhi && hCaloEmMETPhi->getRootObject()) hCaloEmMETPhi->Fill(_EmMetPhi);
1400  //
1401  //hCaloHaMEx = _dbe->get(DirName+"/"+"METTask_CaloHaMEx"); if (hCaloHaMEx && hCaloHaMEx->getRootObject()) hCaloHaMEx->Fill(_HaMEx);
1402  //hCaloHaMEy = _dbe->get(DirName+"/"+"METTask_CaloHaMEy"); if (hCaloHaMEy && hCaloHaMEy->getRootObject()) hCaloHaMEy->Fill(_HaMEy);
1404  //hCaloHaMET = _dbe->get(DirName+"/"+"METTask_CaloHaMET"); if (hCaloHaMET && hCaloHaMET->getRootObject()) hCaloHaMET->Fill(_HaMET);
1405  //hCaloHaMETPhi = _dbe->get(DirName+"/"+"METTask_CaloHaMETPhi"); if (hCaloHaMETPhi && hCaloHaMETPhi->getRootObject()) hCaloHaMETPhi->Fill(_HaMetPhi);
1407 
1408  } // _allhist
1409  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
1410 
1411  for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
1412  const reco::TrackRef siTrack = muonit->innerTrack();
1413  hCalomuPt = _dbe->get(DirName+"/"+"METTask_CalomuPt"); if (hCalomuPt && hCalomuPt->getRootObject()) hCalomuPt->Fill( muonit->p4().pt() );
1414  hCalomuEta = _dbe->get(DirName+"/"+"METTask_CalomuEta"); if (hCalomuEta && hCalomuEta->getRootObject()) hCalomuEta->Fill( muonit->p4().eta() );
1415  hCalomuNhits = _dbe->get(DirName+"/"+"METTask_CalomuNhits"); if (hCalomuNhits && hCalomuNhits->getRootObject()) hCalomuNhits->Fill( siTrack.isNonnull() ? siTrack->numberOfValidHits() : -999 );
1416  hCalomuChi2 = _dbe->get(DirName+"/"+"METTask_CalomuChi2"); if (hCalomuChi2 && hCalomuChi2->getRootObject()) hCalomuChi2->Fill( siTrack.isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
1417  double d0 = siTrack.isNonnull() ? -1 * siTrack->dxy( bspot) : -999;
1418  hCalomuD0 = _dbe->get(DirName+"/"+"METTask_CalomuD0"); if (hCalomuD0 && hCalomuD0->getRootObject()) hCalomuD0->Fill( d0 );
1419  }
1420 
1421  const unsigned int nMuons = muon_h->size();
1422  for( unsigned int mus = 0; mus < nMuons; mus++ ) {
1423  reco::MuonRef muref( muon_h, mus);
1424  reco::MuonMETCorrectionData muCorrData = (*corMetGlobalMuons_ValueMap_Handle)[muref];
1425  hCaloMExCorrection = _dbe->get(DirName+"/"+"METTask_CaloMExCorrection"); if (hCaloMExCorrection && hCaloMExCorrection->getRootObject()) hCaloMExCorrection-> Fill(muCorrData.corrY());
1426  hCaloMEyCorrection = _dbe->get(DirName+"/"+"METTask_CaloMEyCorrection"); if (hCaloMEyCorrection && hCaloMEyCorrection->getRootObject()) hCaloMEyCorrection-> Fill(muCorrData.corrX());
1427  hCaloMuonCorrectionFlag = _dbe->get(DirName+"/"+"METTask_CaloMuonCorrectionFlag"); if (hCaloMuonCorrectionFlag && hCaloMuonCorrectionFlag->getRootObject()) hCaloMuonCorrectionFlag-> Fill(muCorrData.type());
1428  }
1429  }
1430  } // et threshold cut
1431 
1432 }
MonitorElement * hCaloMEy_profile
MonitorElement * hCaloMExCorrection
MonitorElement * hCaloMET1
MonitorElement * hCaloMETSig
MonitorElement * hCaloMETNoHF_profile
MonitorElement * hCaloMEyCorrection
bool selectLowPtJetEvent(const edm::Event &)
MonitorElement * hCaloMET
bool selectWElectronEvent(const edm::Event &)
MonitorElement * hCalomuNhits
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
math::XYZPoint bspot
MonitorElement * hCaloMEyLS
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
std::string _source
edm::Handle< reco::MuonCollection > muon_h
void Fill(long long x)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
MonitorElement * hCaloSumET_logx
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
double mEtSig() const
Definition: MET.h:50
MonitorElement * hCalomuEta
double sumEt() const
Definition: MET.h:48
bool selectWMuonEvent(const edm::Event &)
MonitorElement * hCaloSumET_profile
MonitorElement * hCaloEmEtFraction020
MonitorElement * hCaloMETPhi020
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * hCaloEtFractionHadronic
MonitorElement * hCalomuChi2
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
MonitorElement * hCaloMET_logx
MonitorElement * hCaloMExLS
TObject * getRootObject(void) const
bool selectHighPtJetEvent(const edm::Event &)
double etFractionHadronic() const
Definition: CaloMET.h:42
MonitorElement * hCalomuD0
MonitorElement * hCaloSumET
MonitorElement * hCaloMEy
std::string const & label() const
Definition: InputTag.h:42
MonitorElement * hCaloEmEtFraction
MonitorElement * hCaloMEx
MonitorElement * hCaloMuonCorrectionFlag
tuple cout
Definition: gather_cfg.py:121
MonitorElement * hCaloMET_profile
MonitorElement * hCaloMEx_profile
virtual float pt() const GCC11_FINAL
transverse momentum
edm::InputTag theCaloMETCollectionLabel
MonitorElement * hCaloMETNoHF
double emEtFraction() const
Definition: CaloMET.h:45
MonitorElement * hCalomuPt
MonitorElement * hCaloMETPhi
void CaloMETAnalyzer::makeRatePlot ( std::string  DirName,
double  totltime 
)

Definition at line 475 of file CaloMETAnalyzer.cc.

References MonitorElement::getRootObject(), MonitorElement::getTH1F(), and i.

476 {
477 
479  MonitorElement *meCaloMET = _dbe->get(DirName+"/"+"METTask_CaloMET");
480 
481  TH1F* tCaloMET;
482  TH1F* tCaloMETRate;
483 
484  if ( meCaloMET )
485  if ( meCaloMET->getRootObject() ) {
486  tCaloMET = meCaloMET->getTH1F();
487 
488  // Integral plot & convert number of events to rate (hz)
489  tCaloMETRate = (TH1F*) tCaloMET->Clone("METTask_CaloMETRate");
490  for (int i = tCaloMETRate->GetNbinsX()-1; i>=0; i--){
491  tCaloMETRate->SetBinContent(i+1,tCaloMETRate->GetBinContent(i+2)+tCaloMET->GetBinContent(i+1));
492  }
493  for (int i = 0; i<tCaloMETRate->GetNbinsX(); i++){
494  tCaloMETRate->SetBinContent(i+1,tCaloMETRate->GetBinContent(i+1)/double(totltime));
495  }
496 
497  tCaloMETRate->SetName("METTask_CaloMETRate");
498  tCaloMETRate->SetTitle("METTask_CaloMETRate");
499  hCaloMETRate = _dbe->book1D("METTask_CaloMETRate",tCaloMETRate);
500  hCaloMETRate->setAxisTitle("MET Threshold [GeV]",1);
501  }
502 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * hCaloMETRate
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
TObject * getRootObject(void) const
TH1F * getTH1F(void) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
bool CaloMETAnalyzer::selectHighPtJetEvent ( const edm::Event iEvent)

Definition at line 1435 of file CaloMETAnalyzer.cc.

References FamosSequences_cff::caloJets, gather_cfg::cout, edm::Event::getByLabel(), edm::HandleBase::isValid(), and LogDebug.

1435  {
1436 
1437  bool return_value=false;
1438 
1440  iEvent.getByLabel(theJetCollectionLabel, caloJets);
1441  if (!caloJets.isValid()) {
1442  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1443  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1444  }
1445 
1446  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1447  cal!=caloJets->end(); ++cal){
1448  if (cal->pt()>_highPtJetThreshold){
1449  return_value=true;
1450  }
1451  }
1452 
1453  return return_value;
1454 
1455 }
#define LogDebug(id)
double _highPtJetThreshold
edm::InputTag theJetCollectionLabel
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
tuple cout
Definition: gather_cfg.py:121
bool CaloMETAnalyzer::selectLowPtJetEvent ( const edm::Event iEvent)

Definition at line 1458 of file CaloMETAnalyzer.cc.

References FamosSequences_cff::caloJets, gather_cfg::cout, edm::Event::getByLabel(), edm::HandleBase::isValid(), and LogDebug.

1458  {
1459 
1460  bool return_value=false;
1461 
1463  iEvent.getByLabel(theJetCollectionLabel, caloJets);
1464  if (!caloJets.isValid()) {
1465  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1466  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1467  }
1468 
1469  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1470  cal!=caloJets->end(); ++cal){
1471  if (cal->pt()>_lowPtJetThreshold){
1472  return_value=true;
1473  }
1474  }
1475 
1476  return return_value;
1477 
1478 }
#define LogDebug(id)
edm::InputTag theJetCollectionLabel
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
tuple cout
Definition: gather_cfg.py:121
bool CaloMETAnalyzer::selectWElectronEvent ( const edm::Event iEvent)

Definition at line 1481 of file CaloMETAnalyzer.cc.

1481  {
1482 
1483  bool return_value=true;
1484 
1485  /*
1486  W-electron event selection comes here
1487  */
1488 
1489  return return_value;
1490 
1491 }
bool CaloMETAnalyzer::selectWMuonEvent ( const edm::Event iEvent)

Definition at line 1494 of file CaloMETAnalyzer.cc.

1494  {
1495 
1496  bool return_value=true;
1497 
1498  /*
1499  W-muon event selection comes here
1500  */
1501 
1502  return return_value;
1503 
1504 }
void CaloMETAnalyzer::validateMET ( const reco::CaloMET calomet,
edm::Handle< edm::View< reco::Candidate > >  towers 
)

Definition at line 1040 of file CaloMETAnalyzer.cc.

References funct::cos(), gather_cfg::cout, alignCSCRings::e, edm::View< T >::end(), reco::Candidate::energy(), CaloTower::et(), phi, reco::Candidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), funct::sin(), mathSSE::sqrt(), reco::MET::sumEt(), reco::Candidate::theta(), and theta().

1042 {
1043 
1044  edm::View<reco::Candidate>::const_iterator towerCand = towers->begin();
1045 
1046  double sum_et = 0.0;
1047  double sum_ex = 0.0;
1048  double sum_ey = 0.0;
1049  double sum_ez = 0.0;
1050 
1051  for ( ; towerCand != towers->end(); towerCand++)
1052  {
1053  const reco::Candidate* candidate = &(*towerCand);
1054  if (candidate)
1055  {
1056  const CaloTower* calotower = dynamic_cast<const CaloTower*> (candidate);
1057  if (calotower){
1058  double Tower_ET = calotower->et();
1059  if (Tower_ET>0.3) {
1060 
1061  double phi = candidate->phi();
1062  double theta = candidate->theta();
1063  double e = candidate->energy();
1064  double et = e*sin(theta);
1065  sum_ez += e*cos(theta);
1066  sum_et += et;
1067  sum_ex += et*cos(phi);
1068  sum_ey += et*sin(phi);
1069 
1070  } // Et>0.5
1071  } // calotower
1072  } // candidate
1073  } // loop
1074 
1075  double Mex = -sum_ex;
1076  double Mey = -sum_ey;
1077  //double Mez = -sum_ez;
1078  double Met = sqrt( sum_ex*sum_ex + sum_ey*sum_ey );
1079  double Sumet = sum_et;
1080  //double MetPhi = atan2( -sum_ey, -sum_ex ); // since MET is now a candidate,
1081 
1082  if (_verbose){
1083  if (Sumet!=calomet.sumEt() || Mex!=calomet.px() || Mey!=calomet.py() || Met!=calomet.pt() ){
1084  std::cout << _source << std::endl;
1085  std::cout << "SUMET" << Sumet << " METBlock" << calomet.sumEt() << std::endl;
1086  std::cout << "MEX" << Mex << " METBlock" << calomet.px() << std::endl;
1087  std::cout << "MEY" << Mey << " METBlock" << calomet.py() << std::endl;
1088  std::cout << "MET" << Met << " METBlock" << calomet.pt() << std::endl;
1089  }
1090  }
1091 
1092  if (_print){
1093  std::cout << "SUMET = " << calomet.sumEt() << " (GeV) "
1094  << "MEX" << calomet.px() << " (GeV) "
1095  << "MEY" << calomet.py() << " (GeV) "
1096  << "MET" << calomet.pt() << " (GeV) " << std::endl;
1097  }
1098 
1099 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
virtual double energy() const =0
energy
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
virtual float phi() const =0
momentum azimuthal angle
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
std::string _source
double sumEt() const
Definition: MET.h:48
virtual double theta() const =0
momentum polar angle
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
const_iterator begin() const
tuple cout
Definition: gather_cfg.py:121
double et(double vtxZ) const
Definition: CaloTower.h:99
const_iterator end() const
virtual float pt() const GCC11_FINAL
transverse momentum
Definition: DDAxes.h:10

Member Data Documentation

bool CaloMETAnalyzer::_allhist
private

Definition at line 186 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_allSelection
private

Definition at line 187 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_cleanupSelection
private

Definition at line 188 of file CaloMETAnalyzer.h.

DQMStore* CaloMETAnalyzer::_dbe
private

Definition at line 217 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_doHLTPhysicsOn
private

Definition at line 150 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_doPVCheck
private

Definition at line 149 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_EleEventFlag
private

Definition at line 131 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmCaloEz
private

Definition at line 198 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmMET
private

Definition at line 197 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmMetPhi
private

Definition at line 200 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmMEx
private

Definition at line 195 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmMEy
private

Definition at line 196 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmSumEt
private

Definition at line 199 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_etThreshold
private

Definition at line 177 of file CaloMETAnalyzer.h.

std::vector<std::string> CaloMETAnalyzer::_FolderNames
private

Definition at line 191 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaCaloEz
private

Definition at line 205 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaMET
private

Definition at line 204 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaMetPhi
private

Definition at line 207 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaMEx
private

Definition at line 202 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaMEy
private

Definition at line 203 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaSumEt
private

Definition at line 206 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_HighMETEventFlag
private

Definition at line 129 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_highMETThreshold
private

Definition at line 173 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_HighPtJetEventFlag
private

Definition at line 126 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_highPtJetThreshold
private

Definition at line 171 of file CaloMETAnalyzer.h.

std::string CaloMETAnalyzer::_hlt_PhysDec
private

Definition at line 143 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_LowPtJetEventFlag
private

Definition at line 127 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_lowPtJetThreshold
private

Definition at line 172 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_MinBiasEventFlag
private

Definition at line 128 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_MuonEventFlag
private

Definition at line 132 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_numPV
private

Definition at line 193 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_nvtx_min
private

Definition at line 155 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_nvtxtrks_min
private

Definition at line 156 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_print
private

Definition at line 105 of file CaloMETAnalyzer.h.

std::string CaloMETAnalyzer::_source
private

Definition at line 108 of file CaloMETAnalyzer.h.

std::vector<unsigned > CaloMETAnalyzer::_techTrigsAND
private

Definition at line 145 of file CaloMETAnalyzer.h.

std::vector<unsigned > CaloMETAnalyzer::_techTrigsNOT
private

Definition at line 147 of file CaloMETAnalyzer.h.

std::vector<unsigned > CaloMETAnalyzer::_techTrigsOR
private

Definition at line 146 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_tightBHFiltering
private

Definition at line 152 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_tightJetIDFiltering
private

Definition at line 153 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_Ele
private

Definition at line 167 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_HighMET
private

Definition at line 165 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_HighPtJet
private

Definition at line 162 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_JetMB
private

Definition at line 161 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_LowPtJet
private

Definition at line 163 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_MinBias
private

Definition at line 164 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_Muon
private

Definition at line 168 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_PhysDec
private

Definition at line 169 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_verbose
private
double CaloMETAnalyzer::_vtxchi2_max
private

Definition at line 158 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_vtxndof_min
private

Definition at line 157 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_vtxz_max
private

Definition at line 159 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::BeamHaloSummaryTag
private

Definition at line 115 of file CaloMETAnalyzer.h.

edm::Handle< reco::BeamSpot > CaloMETAnalyzer::beamSpot_h
private

Definition at line 214 of file CaloMETAnalyzer.h.

math::XYZPoint CaloMETAnalyzer::bspot
private

Definition at line 210 of file CaloMETAnalyzer.h.

edm::Handle< edm::ValueMap<reco::MuonMETCorrectionData> > CaloMETAnalyzer::corMetGlobalMuons_ValueMap_Handle
private

Definition at line 212 of file CaloMETAnalyzer.h.

JetMETDQMDCSFilter* CaloMETAnalyzer::DCSFilter
private

Definition at line 183 of file CaloMETAnalyzer.h.

std::vector<std::string> CaloMETAnalyzer::elecExpr_
private

Definition at line 139 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::evtCounter

Definition at line 97 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::gtTag
private

Definition at line 118 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::HBHENoiseFilterResultTag
private

Definition at line 116 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::HcalNoiseRBXCollectionTag
private

Definition at line 114 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtFraction
private

Definition at line 272 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtFraction020
private

Definition at line 276 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtInEB
private

Definition at line 284 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtInEE
private

Definition at line 283 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtInHF
private

Definition at line 282 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmMET
private

Definition at line 289 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmMETPhi
private

Definition at line 290 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmMEx
private

Definition at line 286 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmMEy
private

Definition at line 287 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEtFractionHadronic
private

Definition at line 271 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHadEtInHB
private

Definition at line 278 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHadEtInHE
private

Definition at line 280 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHadEtInHF
private

Definition at line 281 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHadEtInHO
private

Definition at line 279 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHaMET
private

Definition at line 296 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHaMETPhi
private

Definition at line 297 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHaMEx
private

Definition at line 293 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHaMEy
private

Definition at line 294 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMaxEtInEmTowers
private

Definition at line 269 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMaxEtInHadTowers
private

Definition at line 270 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMET
private

Definition at line 238 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMET1
private

Definition at line 239 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMET_logx
private

Definition at line 255 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMET_profile
private

Definition at line 250 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETNoHF
private

Definition at line 242 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETNoHF_profile
private

Definition at line 251 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETPhi
private

Definition at line 240 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETPhi020
private

Definition at line 264 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETRate
private

Definition at line 230 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETSig
private

Definition at line 237 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEx
private

Definition at line 234 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEx_profile
private

Definition at line 248 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMExCorrection
private

Definition at line 305 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMExLS
private

Definition at line 266 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEy
private

Definition at line 235 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEy_profile
private

Definition at line 249 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEyCorrection
private

Definition at line 306 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEyLS
private

Definition at line 267 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuChi2
private

Definition at line 303 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuD0
private

Definition at line 304 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuEta
private

Definition at line 301 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuNhits
private

Definition at line 302 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMuonCorrectionFlag
private

Definition at line 307 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuPt
private

Definition at line 300 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloSumET
private

Definition at line 241 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloSumET_logx
private

Definition at line 256 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloSumET_profile
private

Definition at line 252 of file CaloMETAnalyzer.h.

std::vector<std::string> CaloMETAnalyzer::highMETExpr_
private

Definition at line 136 of file CaloMETAnalyzer.h.

std::vector<std::string> CaloMETAnalyzer::highPtJetExpr_
private

Definition at line 134 of file CaloMETAnalyzer.h.

std::vector<std::string > CaloMETAnalyzer::HLTPathsJetMBByName_
private

Definition at line 124 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hmetME
private

Definition at line 232 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_Ele
private

Definition at line 225 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_HighMET
private

Definition at line 223 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_HighPtJet
private

Definition at line 220 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_LowPtJet
private

Definition at line 221 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_MinBias
private

Definition at line 222 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_Muon
private

Definition at line 226 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::inputBeamSpotLabel
private

Definition at line 121 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::inputMuonLabel
private

Definition at line 120 of file CaloMETAnalyzer.h.

reco::helper::JetIDHelper* CaloMETAnalyzer::jetID
private

Definition at line 180 of file CaloMETAnalyzer.h.

std::vector<std::string> CaloMETAnalyzer::lowPtJetExpr_
private

Definition at line 135 of file CaloMETAnalyzer.h.

std::string CaloMETAnalyzer::metname
private

Definition at line 107 of file CaloMETAnalyzer.h.

std::vector<std::string> CaloMETAnalyzer::minbiasExpr_
private

Definition at line 140 of file CaloMETAnalyzer.h.

edm::Handle< reco::MuonCollection > CaloMETAnalyzer::muon_h
private

Definition at line 213 of file CaloMETAnalyzer.h.

std::vector<std::string> CaloMETAnalyzer::muonExpr_
private

Definition at line 138 of file CaloMETAnalyzer.h.

edm::ParameterSet CaloMETAnalyzer::parameters
private
edm::InputTag CaloMETAnalyzer::theCaloMETCollectionLabel
private

Definition at line 110 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::theCaloTowersLabel
private

Definition at line 112 of file CaloMETAnalyzer.h.

edm::ParameterSet CaloMETAnalyzer::theCleaningParameters
private

Definition at line 142 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::theJetCollectionLabel
private

Definition at line 113 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::vertexTag
private

Definition at line 117 of file CaloMETAnalyzer.h.