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 &)
 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

Date:
2012/05/20 13:11:45
Revision:
1.35
Author
F. Chlebana - Fermilab K. Hatakeyama - Rockefeller University

Definition at line 53 of file CaloMETAnalyzer.h.

Constructor & Destructor Documentation

CaloMETAnalyzer::CaloMETAnalyzer ( const edm::ParameterSet pSet)

Constructor.

Definition at line 33 of file CaloMETAnalyzer.cc.

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

33  {
34 
35  parameters = pSet;
36 
37  edm::ParameterSet highptjetparms = parameters.getParameter<edm::ParameterSet>("highPtJetTrigger");
38  edm::ParameterSet lowptjetparms = parameters.getParameter<edm::ParameterSet>("lowPtJetTrigger" );
39  edm::ParameterSet minbiasparms = parameters.getParameter<edm::ParameterSet>("minBiasTrigger" );
40  edm::ParameterSet highmetparms = parameters.getParameter<edm::ParameterSet>("highMETTrigger" );
41  // edm::ParameterSet lowmetparms = parameters.getParameter<edm::ParameterSet>("lowMETTrigger" );
43  edm::ParameterSet muonparms = parameters.getParameter<edm::ParameterSet>("muonTrigger" );
44 
45  //genericTriggerEventFlag_( new GenericTriggerEventFlag( conf_ ) );
46  _HighPtJetEventFlag = new GenericTriggerEventFlag( highptjetparms );
47  _LowPtJetEventFlag = new GenericTriggerEventFlag( lowptjetparms );
48  _MinBiasEventFlag = new GenericTriggerEventFlag( minbiasparms );
49  _HighMETEventFlag = new GenericTriggerEventFlag( highmetparms );
50  // _LowMETEventFlag = new GenericTriggerEventFlag( lowmetparms );
51  _EleEventFlag = new GenericTriggerEventFlag( eleparms );
52  _MuonEventFlag = new GenericTriggerEventFlag( muonparms );
53 
54  highPtJetExpr_ = highptjetparms.getParameter<std::vector<std::string> >("hltPaths");
55  lowPtJetExpr_ = lowptjetparms .getParameter<std::vector<std::string> >("hltPaths");
56  highMETExpr_ = highmetparms .getParameter<std::vector<std::string> >("hltPaths");
57  // lowMETExpr_ = lowmetparms .getParameter<std::vector<std::string> >("hltPaths");
58  muonExpr_ = muonparms .getParameter<std::vector<std::string> >("hltPaths");
59  elecExpr_ = eleparms .getParameter<std::vector<std::string> >("hltPaths");
60  minbiasExpr_ = minbiasparms .getParameter<std::vector<std::string> >("hltPaths");
61 
62 }
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 65 of file CaloMETAnalyzer.cc.

65  {
66 
67  delete _HighPtJetEventFlag;
68  delete _LowPtJetEventFlag;
69  delete _MinBiasEventFlag;
70  delete _HighMETEventFlag;
71  // delete _LowMETEventFlag;
72  delete _EleEventFlag;
73  delete _MuonEventFlag;
74 
75 }
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 508 of file CaloMETAnalyzer.cc.

References edm::HLTGlobalStatus::accept(), 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(), LogDebug, LogTrace, metname, edm::Handle< T >::product(), edm::HLTGlobalStatus::size(), edm::TriggerNames::size(), edm::TriggerNames::triggerIndex(), edm::TriggerNames::triggerName(), edm::Event::triggerNames(), v, and GoodVertex_cfg::vertexCollection.

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

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

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

Initialize run-based parameters.

Definition at line 393 of file CaloMETAnalyzer.cc.

394 {
395  if ( _HighPtJetEventFlag->on() ) _HighPtJetEventFlag->initRun( iRun, iSetup );
396  if ( _LowPtJetEventFlag ->on() ) _LowPtJetEventFlag ->initRun( iRun, iSetup );
397  if ( _MinBiasEventFlag ->on() ) _MinBiasEventFlag ->initRun( iRun, iSetup );
398  if ( _HighMETEventFlag ->on() ) _HighMETEventFlag ->initRun( iRun, iSetup );
399  // if ( _LowMETEventFlag ->on() ) _LowMETEventFlag ->initRun( iRun, iSetup );
400  if ( _EleEventFlag ->on() ) _EleEventFlag ->initRun( iRun, iSetup );
401  if ( _MuonEventFlag ->on() ) _MuonEventFlag ->initRun( iRun, iSetup );
402 
403  if (_HighPtJetEventFlag->on() && _HighPtJetEventFlag->expressionsFromDB(_HighPtJetEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
405  if (_LowPtJetEventFlag->on() && _LowPtJetEventFlag->expressionsFromDB(_LowPtJetEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
407  if (_HighMETEventFlag->on() && _HighMETEventFlag->expressionsFromDB(_HighMETEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
409  // if (_LowMETEventFlag->on() && _LowMETEventFlag->expressionsFromDB(_LowMETEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
410  // lowMETExpr_ = _LowMETEventFlag->expressionsFromDB(_LowMETEventFlag->hltDBKey(), iSetup);
411  if (_MuonEventFlag->on() && _MuonEventFlag->expressionsFromDB(_MuonEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
413  if (_EleEventFlag->on() && _EleEventFlag->expressionsFromDB(_EleEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
415  if (_MinBiasEventFlag->on() && _MinBiasEventFlag->expressionsFromDB(_MinBiasEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
417 
418 }
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 202 of file CaloMETAnalyzer.cc.

References gather_cfg::cout.

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

References gather_cfg::cout.

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

Definition at line 302 of file CaloMETAnalyzer.cc.

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

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

Definition at line 977 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().

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

Finish up a job.

Definition at line 193 of file CaloMETAnalyzer.cc.

193  {
194 
195  delete jetID;
196  delete DCSFilter;
197 
198 }
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 422 of file CaloMETAnalyzer.cc.

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

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

Definition at line 1104 of file CaloMETAnalyzer.cc.

1107 {
1108 
1110 
1111  bool bLumiSecPlot=false;
1112  if (DirName.find("All")) bLumiSecPlot=true;
1113 
1114  if (_trig_JetMB)
1115  fillMonitorElement(iEvent,DirName,"",calomet,calometnohf, bLumiSecPlot);
1116  if (_trig_HighPtJet)
1117  fillMonitorElementTriggered(iEvent,DirName,"HighPtJet",calomet,calometnohf,false);
1118  if (_trig_LowPtJet)
1119  fillMonitorElementTriggered(iEvent,DirName,"LowPtJet",calomet,calometnohf,false);
1120  if (_trig_MinBias)
1121  fillMonitorElementTriggered(iEvent,DirName,"MinBias",calomet,calometnohf,false);
1122  if (_trig_HighMET)
1123  fillMonitorElementTriggered(iEvent,DirName,"HighMET",calomet,calometnohf,false);
1124  // if (_trig_LowMET)
1125  // fillMonitorElementTriggered(iEvent,DirName,"LowMET",calomet,calometnohf,false);
1126  if (_trig_Ele)
1127  fillMonitorElementTriggered(iEvent,DirName,"Ele",calomet,calometnohf,false);
1128  if (_trig_Muon) {
1129  fillMonitorElementTriggered(iEvent,DirName,"Muon",calomet,calometnohf,false);
1130  }
1131 }
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:429
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 1134 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().

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

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

Definition at line 477 of file CaloMETAnalyzer.cc.

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

478 {
479 
481  MonitorElement *meCaloMET = _dbe->get(DirName+"/"+"METTask_CaloMET");
482 
483  TH1F* tCaloMET;
484  TH1F* tCaloMETRate;
485 
486  if ( meCaloMET )
487  if ( meCaloMET->getRootObject() ) {
488  tCaloMET = meCaloMET->getTH1F();
489 
490  // Integral plot & convert number of events to rate (hz)
491  tCaloMETRate = (TH1F*) tCaloMET->Clone("METTask_CaloMETRate");
492  for (int i = tCaloMETRate->GetNbinsX()-1; i>=0; i--){
493  tCaloMETRate->SetBinContent(i+1,tCaloMETRate->GetBinContent(i+2)+tCaloMET->GetBinContent(i+1));
494  }
495  for (int i = 0; i<tCaloMETRate->GetNbinsX(); i++){
496  tCaloMETRate->SetBinContent(i+1,tCaloMETRate->GetBinContent(i+1)/double(totltime));
497  }
498 
499  tCaloMETRate->SetName("METTask_CaloMETRate");
500  tCaloMETRate->SetTitle("METTask_CaloMETRate");
501  hCaloMETRate = _dbe->book1D("METTask_CaloMETRate",tCaloMETRate);
502  hCaloMETRate->setAxisTitle("MET Threshold [GeV]",1);
503  }
504 }
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:717
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
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:429
bool CaloMETAnalyzer::selectHighPtJetEvent ( const edm::Event iEvent)

Definition at line 1437 of file CaloMETAnalyzer.cc.

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

1437  {
1438 
1439  bool return_value=false;
1440 
1442  iEvent.getByLabel(theJetCollectionLabel, caloJets);
1443  if (!caloJets.isValid()) {
1444  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1445  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1446  }
1447 
1448  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1449  cal!=caloJets->end(); ++cal){
1450  if (cal->pt()>_highPtJetThreshold){
1451  return_value=true;
1452  }
1453  }
1454 
1455  return return_value;
1456 
1457 }
#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:356
tuple cout
Definition: gather_cfg.py:121
bool CaloMETAnalyzer::selectLowPtJetEvent ( const edm::Event iEvent)

Definition at line 1460 of file CaloMETAnalyzer.cc.

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

1460  {
1461 
1462  bool return_value=false;
1463 
1465  iEvent.getByLabel(theJetCollectionLabel, caloJets);
1466  if (!caloJets.isValid()) {
1467  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1468  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1469  }
1470 
1471  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1472  cal!=caloJets->end(); ++cal){
1473  if (cal->pt()>_lowPtJetThreshold){
1474  return_value=true;
1475  }
1476  }
1477 
1478  return return_value;
1479 
1480 }
#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:356
tuple cout
Definition: gather_cfg.py:121
bool CaloMETAnalyzer::selectWElectronEvent ( const edm::Event iEvent)

Definition at line 1483 of file CaloMETAnalyzer.cc.

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

Definition at line 1496 of file CaloMETAnalyzer.cc.

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

Definition at line 1042 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().

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

Member Data Documentation

bool CaloMETAnalyzer::_allhist
private

Definition at line 187 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_allSelection
private

Definition at line 188 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_cleanupSelection
private

Definition at line 189 of file CaloMETAnalyzer.h.

DQMStore* CaloMETAnalyzer::_dbe
private

Definition at line 218 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_doHLTPhysicsOn
private

Definition at line 151 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_doPVCheck
private

Definition at line 150 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_EleEventFlag
private

Definition at line 132 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmCaloEz
private

Definition at line 199 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmMET
private

Definition at line 198 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmMetPhi
private

Definition at line 201 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmMEx
private

Definition at line 196 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmMEy
private

Definition at line 197 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_EmSumEt
private

Definition at line 200 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_etThreshold
private

Definition at line 178 of file CaloMETAnalyzer.h.

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

Definition at line 192 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaCaloEz
private

Definition at line 206 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaMET
private

Definition at line 205 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaMetPhi
private

Definition at line 208 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaMEx
private

Definition at line 203 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaMEy
private

Definition at line 204 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_HaSumEt
private

Definition at line 207 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_HighMETEventFlag
private

Definition at line 130 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_highMETThreshold
private

Definition at line 174 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_HighPtJetEventFlag
private

Definition at line 127 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_highPtJetThreshold
private

Definition at line 172 of file CaloMETAnalyzer.h.

std::string CaloMETAnalyzer::_hlt_PhysDec
private

Definition at line 144 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_LowPtJetEventFlag
private

Definition at line 128 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_lowPtJetThreshold
private

Definition at line 173 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_MinBiasEventFlag
private

Definition at line 129 of file CaloMETAnalyzer.h.

GenericTriggerEventFlag* CaloMETAnalyzer::_MuonEventFlag
private

Definition at line 133 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_numPV
private

Definition at line 194 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_nvtx_min
private

Definition at line 156 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_nvtxtrks_min
private

Definition at line 157 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_print
private

Definition at line 106 of file CaloMETAnalyzer.h.

std::string CaloMETAnalyzer::_source
private

Definition at line 109 of file CaloMETAnalyzer.h.

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

Definition at line 146 of file CaloMETAnalyzer.h.

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

Definition at line 148 of file CaloMETAnalyzer.h.

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

Definition at line 147 of file CaloMETAnalyzer.h.

bool CaloMETAnalyzer::_tightBHFiltering
private

Definition at line 153 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_tightJetIDFiltering
private

Definition at line 154 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_Ele
private

Definition at line 168 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_HighMET
private

Definition at line 166 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_HighPtJet
private

Definition at line 163 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_JetMB
private

Definition at line 162 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_LowPtJet
private

Definition at line 164 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_MinBias
private

Definition at line 165 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_Muon
private

Definition at line 169 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_trig_PhysDec
private

Definition at line 170 of file CaloMETAnalyzer.h.

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

Definition at line 159 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::_vtxndof_min
private

Definition at line 158 of file CaloMETAnalyzer.h.

double CaloMETAnalyzer::_vtxz_max
private

Definition at line 160 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::BeamHaloSummaryTag
private

Definition at line 116 of file CaloMETAnalyzer.h.

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

Definition at line 215 of file CaloMETAnalyzer.h.

math::XYZPoint CaloMETAnalyzer::bspot
private

Definition at line 211 of file CaloMETAnalyzer.h.

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

Definition at line 213 of file CaloMETAnalyzer.h.

JetMETDQMDCSFilter* CaloMETAnalyzer::DCSFilter
private

Definition at line 184 of file CaloMETAnalyzer.h.

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

Definition at line 140 of file CaloMETAnalyzer.h.

int CaloMETAnalyzer::evtCounter

Definition at line 98 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::gtTag
private

Definition at line 119 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::HBHENoiseFilterResultTag
private

Definition at line 117 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::HcalNoiseRBXCollectionTag
private

Definition at line 115 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtFraction
private

Definition at line 273 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtFraction020
private

Definition at line 277 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtInEB
private

Definition at line 285 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtInEE
private

Definition at line 284 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmEtInHF
private

Definition at line 283 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmMET
private

Definition at line 290 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmMETPhi
private

Definition at line 291 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmMEx
private

Definition at line 287 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEmMEy
private

Definition at line 288 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloEtFractionHadronic
private

Definition at line 272 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHadEtInHB
private

Definition at line 279 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHadEtInHE
private

Definition at line 281 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHadEtInHF
private

Definition at line 282 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHadEtInHO
private

Definition at line 280 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHaMET
private

Definition at line 297 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHaMETPhi
private

Definition at line 298 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHaMEx
private

Definition at line 294 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloHaMEy
private

Definition at line 295 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMaxEtInEmTowers
private

Definition at line 270 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMaxEtInHadTowers
private

Definition at line 271 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMET
private

Definition at line 239 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMET1
private

Definition at line 240 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMET_logx
private

Definition at line 256 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMET_profile
private

Definition at line 251 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETNoHF
private

Definition at line 243 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETNoHF_profile
private

Definition at line 252 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETPhi
private

Definition at line 241 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETPhi020
private

Definition at line 265 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETRate
private

Definition at line 231 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMETSig
private

Definition at line 238 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEx
private

Definition at line 235 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEx_profile
private

Definition at line 249 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMExCorrection
private

Definition at line 306 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMExLS
private

Definition at line 267 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEy
private

Definition at line 236 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEy_profile
private

Definition at line 250 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEyCorrection
private

Definition at line 307 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMEyLS
private

Definition at line 268 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuChi2
private

Definition at line 304 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuD0
private

Definition at line 305 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuEta
private

Definition at line 302 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuNhits
private

Definition at line 303 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloMuonCorrectionFlag
private

Definition at line 308 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCalomuPt
private

Definition at line 301 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloSumET
private

Definition at line 242 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloSumET_logx
private

Definition at line 257 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hCaloSumET_profile
private

Definition at line 253 of file CaloMETAnalyzer.h.

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

Definition at line 137 of file CaloMETAnalyzer.h.

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

Definition at line 135 of file CaloMETAnalyzer.h.

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

Definition at line 125 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hmetME
private

Definition at line 233 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_Ele
private

Definition at line 226 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_HighMET
private

Definition at line 224 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_HighPtJet
private

Definition at line 221 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_LowPtJet
private

Definition at line 222 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_MinBias
private

Definition at line 223 of file CaloMETAnalyzer.h.

MonitorElement* CaloMETAnalyzer::hTriggerName_Muon
private

Definition at line 227 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::inputBeamSpotLabel
private

Definition at line 122 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::inputMuonLabel
private

Definition at line 121 of file CaloMETAnalyzer.h.

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

Definition at line 181 of file CaloMETAnalyzer.h.

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

Definition at line 136 of file CaloMETAnalyzer.h.

std::string CaloMETAnalyzer::metname
private

Definition at line 108 of file CaloMETAnalyzer.h.

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

Definition at line 141 of file CaloMETAnalyzer.h.

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

Definition at line 214 of file CaloMETAnalyzer.h.

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

Definition at line 139 of file CaloMETAnalyzer.h.

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

Definition at line 111 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::theCaloTowersLabel
private

Definition at line 113 of file CaloMETAnalyzer.h.

edm::ParameterSet CaloMETAnalyzer::theCleaningParameters
private

Definition at line 143 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::theJetCollectionLabel
private

Definition at line 114 of file CaloMETAnalyzer.h.

edm::InputTag CaloMETAnalyzer::vertexTag
private

Definition at line 118 of file CaloMETAnalyzer.h.