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:
JetAnalyzerBase

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...
 
 HTMHTAnalyzer (const edm::ParameterSet &)
 Constructor. More...
 
virtual ~HTMHTAnalyzer ()
 Destructor. More...
 
- Public Member Functions inherited from JetAnalyzerBase
void analyze (const edm::Event &, const edm::EventSetup &, reco::CaloJet &caloJet)
 Get the analysis of the muon properties. More...
 
 JetAnalyzerBase ()
 Constructor. More...
 
virtual ~JetAnalyzerBase ()
 Destructor. More...
 

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
 

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 Parameters::parameters.

29  {
30 
31  parameters = pSet;
32  _ptThreshold = 30.;
33 
34 }
edm::ParameterSet parameters
Definition: HTMHTAnalyzer.h:52
double _ptThreshold
Definition: HTMHTAnalyzer.h:68
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 72 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().

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

Inizialize parameters for histo binning.

Implements JetAnalyzerBase.

Definition at line 39 of file HTMHTAnalyzer.cc.

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

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

Member Data Documentation

double HTMHTAnalyzer::_ptThreshold
private

Definition at line 68 of file HTMHTAnalyzer.h.

std::string HTMHTAnalyzer::_source
private

Definition at line 58 of file HTMHTAnalyzer.h.

int HTMHTAnalyzer::_trig_JetMB
private

Definition at line 65 of file HTMHTAnalyzer.h.

int HTMHTAnalyzer::_verbose
private
int HTMHTAnalyzer::evtCounter

Definition at line 47 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hHT
private

Definition at line 82 of file HTMHTAnalyzer.h.

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

Definition at line 63 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hMHT
private

Definition at line 79 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hMHTPhi
private

Definition at line 80 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hMHx
private

Definition at line 77 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hMHy
private

Definition at line 78 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hNevents
private

Definition at line 73 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::hNJets
private

Definition at line 75 of file HTMHTAnalyzer.h.

MonitorElement* HTMHTAnalyzer::jetME
private

Definition at line 71 of file HTMHTAnalyzer.h.

std::string HTMHTAnalyzer::metname
private

Definition at line 56 of file HTMHTAnalyzer.h.

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

Definition at line 60 of file HTMHTAnalyzer.h.