CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
BDHadronTrackMonitoringHarvester Class Reference

#include <BDHadronTrackMonitoringHarvester.h>

Inheritance diagram for BDHadronTrackMonitoringHarvester:

Public Member Functions

 BDHadronTrackMonitoringHarvester (const edm::ParameterSet &pSet)
 
 ~BDHadronTrackMonitoringHarvester () override
 

Private Member Functions

void beginJob () override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 

Private Attributes

MonitorElementnTrk_absolute_bjet
 
MonitorElementnTrk_absolute_cjet
 
MonitorElementnTrk_absolute_dusgjet
 
MonitorElementnTrk_relative_bjet
 
MonitorElementnTrk_relative_cjet
 
MonitorElementnTrk_relative_dusgjet
 
MonitorElementnTrk_std_bjet
 
MonitorElementnTrk_std_cjet
 
MonitorElementnTrk_std_dusgjet
 

Detailed Description

Top level steering routine for b tag performance harvesting.

Definition at line 24 of file BDHadronTrackMonitoringHarvester.h.

Constructor & Destructor Documentation

BDHadronTrackMonitoringHarvester::BDHadronTrackMonitoringHarvester ( const edm::ParameterSet pSet)
explicit

Definition at line 9 of file BDHadronTrackMonitoringHarvester.cc.

10 {
11 }
BDHadronTrackMonitoringHarvester::~BDHadronTrackMonitoringHarvester ( )
override

Definition at line 14 of file BDHadronTrackMonitoringHarvester.cc.

15 {
16 }

Member Function Documentation

void BDHadronTrackMonitoringHarvester::beginJob ( void  )
overrideprivate

Definition at line 18 of file BDHadronTrackMonitoringHarvester.cc.

19 {
20 }
void BDHadronTrackMonitoringHarvester::dqmEndJob ( DQMStore::IBooker ibook,
DQMStore::IGetter iget 
)
overrideprivate

Definition at line 22 of file BDHadronTrackMonitoringHarvester.cc.

References DQMStore::IBooker::book1D(), DEFINE_FWK_MODULE, DQMStore::IGetter::get(), MonitorElement::getMean(), MonitorElement::getRMS(), mps_fire::i, SiStripPI::max, nTrk_absolute_bjet, nTrk_absolute_cjet, nTrk_absolute_dusgjet, nTrk_relative_bjet, nTrk_relative_cjet, nTrk_relative_dusgjet, nTrk_std_bjet, nTrk_std_cjet, nTrk_std_dusgjet, DQMStore::IGetter::removeElement(), MonitorElement::setAxisRange(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), RecoBTag::setTDRStyle(), and BDHadronTrackMonitoringAnalyzer::TrkHistCat.

23 {
24  // ***********************
25  //
26  // Book all new histograms.
27  //
28  // ***********************
30  ibook.setCurrentFolder("BDHadronTracks/JetContent");
31 
32  // b jets
33  // absolute average number of tracks
34  nTrk_absolute_bjet = ibook.book1D("nTrk_absolute_bjet","absolute average number of tracks in b jets",6,-0.5,5.5);
35  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
37  }
39  nTrk_absolute_bjet->setAxisTitle("average number of tracks",2);
40 
41  // relative (in percent) average number of tracks
42  nTrk_relative_bjet = ibook.book1D("nTrk_relative_bjet","relative average number of tracks in b jets",6,-0.5,5.5);
43  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
45  }
47  nTrk_relative_bjet->setAxisTitle("average fraction of tracks",2);
48 
49  // standard deviation of number of tracks
50  nTrk_std_bjet = ibook.book1D("nTrk_std_bjet","RMS of number of tracks in b jets",6,-0.5,5.5);
51  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
53  }
54  nTrk_std_bjet->setAxisRange(0, 3, 2);
55  nTrk_std_bjet->setAxisTitle("RMS of number of tracks",2);
56 
57 
58 
59 
60  // c jets
61  nTrk_absolute_cjet = ibook.book1D("nTrk_absolute_cjet","absolute average number of tracks in c jets",6,-0.5,5.5);
62  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
64  }
66  nTrk_absolute_cjet->setAxisTitle("average number of tracks",2);
67 
68  nTrk_relative_cjet = ibook.book1D("nTrk_relative_cjet","relative average number of tracks in c jets",6,-0.5,5.5);
69  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
71  }
73  nTrk_relative_cjet->setAxisTitle("average fraction of tracks",2);
74 
75  nTrk_std_cjet = ibook.book1D("nTrk_std_cjet","RMS of number of tracks in c jets",6,-0.5,5.5);
76  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
78  }
79  nTrk_std_cjet->setAxisRange(0, 3, 2);
80  nTrk_std_cjet->setAxisTitle("RMS of number of tracks",2);
81 
82 
83 
84  // udsg jets
85  nTrk_absolute_dusgjet = ibook.book1D("nTrk_absolute_dusgjet","absolute average number of tracks in dusg jets",6,-0.5,5.5);
86  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
88  }
90  nTrk_absolute_dusgjet->setAxisTitle("average number of tracks",2);
91 
92  nTrk_relative_dusgjet = ibook.book1D("nTrk_relative_dusgjet","relative average number of tracks in dusg jets",6,-0.5,5.5);
93  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
95  }
97  nTrk_relative_dusgjet->setAxisTitle("average fraction of tracks",2);
98 
99  nTrk_std_dusgjet = ibook.book1D("nTrk_std_dusgjet","RMS of number of tracks in dusg jets",6,-0.5,5.5);
100  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
102  }
103  nTrk_std_dusgjet->setAxisRange(0, 3, 2);
104  nTrk_std_dusgjet->setAxisTitle("RMS of number of tracks",2);
105 
106 
107  // ***********************
108  //
109  // get all the old histograms
110  //
111  // ***********************
112 
113  // b jets
114  MonitorElement *nTrk_bjet[6];
115  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
116  nTrk_bjet[i] = iget.get("BDHadronTracks/JetContent/nTrk_bjet_"+BDHadronTrackMonitoringAnalyzer::TrkHistCat[i]);
117  }
118  MonitorElement *nTrkAll_bjet = iget.get("BDHadronTracks/JetContent/nTrkAll_bjet");
119 
120  // c jets
121  MonitorElement *nTrk_cjet[6];
122  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
123  nTrk_cjet[i] = iget.get("BDHadronTracks/JetContent/nTrk_cjet_"+BDHadronTrackMonitoringAnalyzer::TrkHistCat[i]);
124  }
125  MonitorElement *nTrkAll_cjet = iget.get("BDHadronTracks/JetContent/nTrkAll_cjet");
126 
127  // dusg jets
128  MonitorElement *nTrk_dusgjet[6];
129  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
130  nTrk_dusgjet[i] = iget.get("BDHadronTracks/JetContent/nTrk_dusgjet_"+BDHadronTrackMonitoringAnalyzer::TrkHistCat[i]);
131  }
132  MonitorElement *nTrkAll_dusgjet = iget.get("BDHadronTracks/JetContent/nTrkAll_dusgjet");
133 
134 
135 
136  // ***********************
137  //
138  // Calculate contents of new histograms
139  //
140  // ***********************
141 
142  // b jets
143  float mean_bjets[6];
144  float std_bjets[6];
145  float meanAll_bjets;
146  meanAll_bjets = std::max(0.01,nTrkAll_bjet->getMean(1));
147  for (unsigned int i = 0; i< BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++){
148  mean_bjets[i] = nTrk_bjet[i]->getMean(1); // mean number of tracks per category
149  std_bjets[i] = nTrk_bjet[i]->getRMS(1);
150  nTrk_absolute_bjet->setBinContent(i+1,mean_bjets[i]);
151  nTrk_relative_bjet->setBinContent(i+1,mean_bjets[i]/meanAll_bjets);
152  nTrk_std_bjet->setBinContent(i+1,std_bjets[i]);
153  }
154 
155  // c jets
156  float mean_cjets[6];
157  float std_cjets[6];
158  float meanAll_cjets;
159  meanAll_cjets = std::max(0.01,nTrkAll_cjet->getMean(1));
160  for (unsigned int i = 0; i< BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++){
161  mean_cjets[i] = nTrk_cjet[i]->getMean(1); // mean number of tracks per category
162  std_cjets[i] = nTrk_cjet[i]->getRMS(1);
163  nTrk_absolute_cjet->setBinContent(i+1,mean_cjets[i]);
164  nTrk_relative_cjet->setBinContent(i+1,mean_cjets[i]/meanAll_cjets);
165  nTrk_std_cjet->setBinContent(i+1,std_cjets[i]);
166  }
167 
168 
169  // dusg jets
170  float mean_dusgjets[6];
171  float std_dusgjets[6];
172  float meanAll_dusgjets;
173  meanAll_dusgjets = std::max(0.01,nTrkAll_dusgjet->getMean(1));
174  for (unsigned int i = 0; i< BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++){
175  mean_dusgjets[i] = nTrk_dusgjet[i]->getMean(1); // mean number of tracks per category
176  std_dusgjets[i] = nTrk_dusgjet[i]->getRMS(1);
177  nTrk_absolute_dusgjet->setBinContent(i+1,mean_dusgjets[i]);
178  nTrk_relative_dusgjet->setBinContent(i+1,mean_dusgjets[i]/meanAll_dusgjets);
179  nTrk_std_dusgjet->setBinContent(i+1,std_dusgjets[i]);
180  }
181 
182 
183  // ***********************
184  //
185  // Remove histograms with nTracks that we do not want to show
186  //
187  // ***********************
188 
189  // b jets
190  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
192  }
193  iget.removeElement("nTrkAll_bjet");
194 
195  // c jets
196  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
198  }
199  iget.removeElement("nTrkAll_cjet");
200 
201  // dusg jets
202  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
204  }
205  iget.removeElement("nTrkAll_dusgjet");
206 
207 
208 
209 }
void setBinContent(int binx, double content)
set content of bin (1-D)
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:307
TStyle * setTDRStyle()
Definition: Tools.cc:346
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)
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
static const std::vector< std::string > TrkHistCat
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void removeElement(Args &&...args)
Definition: DQMStore.h:310

Member Data Documentation

MonitorElement* BDHadronTrackMonitoringHarvester::nTrk_absolute_bjet
private

Definition at line 36 of file BDHadronTrackMonitoringHarvester.h.

Referenced by dqmEndJob().

MonitorElement* BDHadronTrackMonitoringHarvester::nTrk_absolute_cjet
private

Definition at line 39 of file BDHadronTrackMonitoringHarvester.h.

Referenced by dqmEndJob().

MonitorElement* BDHadronTrackMonitoringHarvester::nTrk_absolute_dusgjet
private

Definition at line 43 of file BDHadronTrackMonitoringHarvester.h.

Referenced by dqmEndJob().

MonitorElement * BDHadronTrackMonitoringHarvester::nTrk_relative_bjet
private

Definition at line 36 of file BDHadronTrackMonitoringHarvester.h.

Referenced by dqmEndJob().

MonitorElement * BDHadronTrackMonitoringHarvester::nTrk_relative_cjet
private

Definition at line 39 of file BDHadronTrackMonitoringHarvester.h.

Referenced by dqmEndJob().

MonitorElement * BDHadronTrackMonitoringHarvester::nTrk_relative_dusgjet
private

Definition at line 43 of file BDHadronTrackMonitoringHarvester.h.

Referenced by dqmEndJob().

MonitorElement * BDHadronTrackMonitoringHarvester::nTrk_std_bjet
private

Definition at line 36 of file BDHadronTrackMonitoringHarvester.h.

Referenced by dqmEndJob().

MonitorElement * BDHadronTrackMonitoringHarvester::nTrk_std_cjet
private

Definition at line 39 of file BDHadronTrackMonitoringHarvester.h.

Referenced by dqmEndJob().

MonitorElement * BDHadronTrackMonitoringHarvester::nTrk_std_dusgjet
private

Definition at line 43 of file BDHadronTrackMonitoringHarvester.h.

Referenced by dqmEndJob().