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
HTMHTAnalyzer Class Reference

#include <HTMHTAnalyzer.h>

Inheritance diagram for HTMHTAnalyzer:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &, const edm::TriggerResults &)
 Get the analysis. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 HTMHTAnalyzer (const edm::ParameterSet &)
 Constructor. More...
 
virtual ~HTMHTAnalyzer ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Public Attributes

int evtCounter
 

Private Attributes

double _ptThreshold
 
std::string _source
 
int _trig_JetMB
 
int _verbose
 
MonitorElementhHT
 
std::vector< std::string > HLTPathsJetMBByName_
 
MonitorElementhMHT
 
MonitorElementhMHTPhi
 
MonitorElementhMHx
 
MonitorElementhMHy
 
MonitorElementhNevents
 
MonitorElementhNJets
 
MonitorElementjetME
 
std::string metname
 
edm::ParameterSet parameters
 
edm::InputTag theJetCollectionForHTMHTLabel
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

DQM monitoring source for HTMHT

Author
K. Hatakeyama, Rockefeller University

Definition at line 31 of file HTMHTAnalyzer.h.

Constructor & Destructor Documentation

HTMHTAnalyzer::HTMHTAnalyzer ( const edm::ParameterSet pSet)

Constructor.

Definition at line 29 of file HTMHTAnalyzer.cc.

References HLT_25ns10e33_v2_cff::parameters.

29  {
30 
31  parameters = pSet;
32  _ptThreshold = 30.;
33 
34 }
edm::ParameterSet parameters
Definition: HTMHTAnalyzer.h:50
double _ptThreshold
Definition: HTMHTAnalyzer.h:66
HTMHTAnalyzer::~HTMHTAnalyzer ( )
virtual

Destructor.

Definition at line 37 of file HTMHTAnalyzer.cc.

37 { }

Member Function Documentation

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

Get the analysis.

Definition at line 75 of file HTMHTAnalyzer.cc.

References edm::HLTGlobalStatus::accept(), gather_cfg::cout, edm::Event::getByLabel(), i, edm::HandleBase::isValid(), LogTrace, metname, njet, edm::HLTGlobalStatus::size(), edm::TriggerNames::triggerIndex(), and edm::Event::triggerNames().

76  {
77 
78  LogTrace(metname)<<"[HTMHTAnalyzer] Analyze HT & MHT";
79 
80  jetME->Fill(4);
81 
82  // ==========================================================
83  // Trigger information
84  //
85  if(&triggerResults) {
86 
88 
89  //
90  //
91  // Check how many HLT triggers are in triggerResults
92  int ntrigs = triggerResults.size();
93  if (_verbose) std::cout << "ntrigs=" << ntrigs << std::endl;
94 
95  //
96  //
97  // If index=ntrigs, this HLT trigger doesn't exist in the HLT table for this data.
98  const edm::TriggerNames & triggerNames = iEvent.triggerNames(triggerResults);
99 
100  //
101  //
102  // count number of requested Jet or MB HLT paths which have fired
103  for (unsigned int i=0; i!=HLTPathsJetMBByName_.size(); i++) {
104  unsigned int triggerIndex = triggerNames.triggerIndex(HLTPathsJetMBByName_[i]);
105  if (triggerIndex<triggerResults.size()) {
106  if (triggerResults.accept(triggerIndex)) {
107  _trig_JetMB++;
108  }
109  }
110  }
111  // for empty input vectors (n==0), take all HLT triggers!
112  if (HLTPathsJetMBByName_.size()==0) _trig_JetMB=triggerResults.size()-1;
113 
114  if (_trig_JetMB==0) return;
115 
116  } else {
117 
118  edm::LogInfo("CaloMetAnalyzer") << "TriggerResults::HLT not found, "
119  "automatically select events";
120  //return;
121 
122  }
123 
124  // ==========================================================
125 
126  // **** Get the Calo Jet container
128 
129  // **** Get the SISCone Jet container
130  iEvent.getByLabel(theJetCollectionForHTMHTLabel, jetcoll);
131 
132  if(!jetcoll.isValid()) return;
133 
134  // ==========================================================
135  // Reconstructed HT & MHT Information
136 
137  int njet=0;
138  double MHx=0.;
139  double MHy=0.;
140  double MHT=0.;
141  double MHTPhi=0.;
142  double HT=0.;
143 
144  for (reco::CaloJetCollection::const_iterator calojet = jetcoll->begin(); calojet!=jetcoll->end(); ++calojet){
145  if (calojet->pt()>_ptThreshold){
146  njet++;
147  MHx += -1.*calojet->px();
148  MHy += -1.*calojet->py();
149  HT += calojet->pt();
150  }
151  }
152 
153  TVector2 *tv2 = new TVector2(MHx,MHy);
154  MHT =tv2->Mod();
155  MHTPhi=tv2->Phi();
156 
157  //std::cout << "HTMHT " << MHT << std::endl;
158 
159  hNevents->Fill(1.);
160  hNJets->Fill(njet);
161  if (njet>0){
162  hMHx->Fill(MHx);
163  hMHy->Fill(MHy);
164  hMHT->Fill(MHT);
165  hMHTPhi->Fill(MHTPhi);
166  hHT->Fill(HT);
167  }
168 
169 }
MonitorElement * hHT
Definition: HTMHTAnalyzer.h:80
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
MonitorElement * hMHT
Definition: HTMHTAnalyzer.h:77
std::string metname
Definition: HTMHTAnalyzer.h:54
bool accept() const
Has at least one path accepted the event?
MonitorElement * hMHTPhi
Definition: HTMHTAnalyzer.h:78
int njet
Definition: HydjetWrapper.h:95
void Fill(long long x)
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
double _ptThreshold
Definition: HTMHTAnalyzer.h:66
unsigned int size() const
Get number of paths stored.
MonitorElement * hNevents
Definition: HTMHTAnalyzer.h:71
std::vector< std::string > HLTPathsJetMBByName_
Definition: HTMHTAnalyzer.h:61
bool isValid() const
Definition: HandleBase.h:75
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
#define LogTrace(id)
MonitorElement * jetME
Definition: HTMHTAnalyzer.h:69
MonitorElement * hMHy
Definition: HTMHTAnalyzer.h:76
MonitorElement * hNJets
Definition: HTMHTAnalyzer.h:73
tuple cout
Definition: gather_cfg.py:145
MonitorElement * hMHx
Definition: HTMHTAnalyzer.h:75
Definition: HT.h:20
edm::InputTag theJetCollectionForHTMHTLabel
Definition: HTMHTAnalyzer.h:58
void HTMHTAnalyzer::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 41 of file HTMHTAnalyzer.cc.

References DQMStore::IBooker::book1D(), LogTrace, metname, HLT_25ns10e33_v2_cff::parameters, MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

43  {
44  evtCounter = 0;
45  metname = "HTMHTAnalyzer";
46 
47  // PFMET information
48  theJetCollectionForHTMHTLabel = parameters.getParameter<edm::InputTag>("JetCollectionForHTMHTLabel");
50 
51  LogTrace(metname)<<"[HTMHTAnalyzer] Parameters initialization";
52  ibooker.setCurrentFolder("JetMET/MET/"+_source);
53 
54  HLTPathsJetMBByName_ = parameters.getParameter<std::vector<std::string > >("HLTPathsJetMB");
55 
56  // misc
57  _verbose = parameters.getParameter<int>("verbose");
58  _ptThreshold = parameters.getParameter<double>("ptThreshold");
59 
60  jetME = ibooker.book1D("metReco", "metReco", 4, 1, 5);
61  jetME->setBinLabel(4,"HTMHT",1);
62 
63  hNevents = ibooker.book1D("METTask_Nevents", "METTask_Nevents", 1,0,1);
64  hNJets = ibooker.book1D("METTask_NJets", "METTask_NJets", 100, 0, 100);
65  hMHx = ibooker.book1D("METTask_MHx", "METTask_MHx", 500,-500,500);
66  hMHy = ibooker.book1D("METTask_MHy", "METTask_MHy", 500,-500,500);
67  hMHT = ibooker.book1D("METTask_MHT", "METTask_MHT", 500,0,1000);
68  hMHTPhi = ibooker.book1D("METTask_MhTPhi", "METTask_MhTPhi", 80,-4,4);
69  hHT = ibooker.book1D("METTask_HT", "METTask_HT", 500,0,2000);
70 
71 }
MonitorElement * hHT
Definition: HTMHTAnalyzer.h:80
T getParameter(std::string const &) const
MonitorElement * hMHT
Definition: HTMHTAnalyzer.h:77
std::string metname
Definition: HTMHTAnalyzer.h:54
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)
MonitorElement * hMHTPhi
Definition: HTMHTAnalyzer.h:78
edm::ParameterSet parameters
Definition: HTMHTAnalyzer.h:50
std::string _source
Definition: HTMHTAnalyzer.h:56
double _ptThreshold
Definition: HTMHTAnalyzer.h:66
MonitorElement * hNevents
Definition: HTMHTAnalyzer.h:71
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::vector< std::string > HLTPathsJetMBByName_
Definition: HTMHTAnalyzer.h:61
#define LogTrace(id)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * jetME
Definition: HTMHTAnalyzer.h:69
MonitorElement * hMHy
Definition: HTMHTAnalyzer.h:76
MonitorElement * hNJets
Definition: HTMHTAnalyzer.h:73
MonitorElement * hMHx
Definition: HTMHTAnalyzer.h:75
edm::InputTag theJetCollectionForHTMHTLabel
Definition: HTMHTAnalyzer.h:58

Member Data Documentation

double HTMHTAnalyzer::_ptThreshold
private

Definition at line 66 of file HTMHTAnalyzer.h.

std::string HTMHTAnalyzer::_source
private

Definition at line 56 of file HTMHTAnalyzer.h.

int HTMHTAnalyzer::_trig_JetMB
private

Definition at line 63 of file HTMHTAnalyzer.h.

int HTMHTAnalyzer::_verbose
private
int HTMHTAnalyzer::evtCounter

Definition at line 45 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hHT
private

Definition at line 80 of file HTMHTAnalyzer.h.

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

Definition at line 61 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hMHT
private

Definition at line 77 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hMHTPhi
private

Definition at line 78 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hMHx
private

Definition at line 75 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hMHy
private

Definition at line 76 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hNevents
private

Definition at line 71 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hNJets
private

Definition at line 73 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::jetME
private

Definition at line 69 of file HTMHTAnalyzer.h.

std::string HTMHTAnalyzer::metname
private

Definition at line 54 of file HTMHTAnalyzer.h.

edm::ParameterSet HTMHTAnalyzer::parameters
private
edm::InputTag HTMHTAnalyzer::theJetCollectionForHTMHTLabel
private

Definition at line 58 of file HTMHTAnalyzer.h.