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:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 BDHadronTrackMonitoringHarvester (const edm::ParameterSet &pSet)
 
 ~BDHadronTrackMonitoringHarvester ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::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 ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob ()
 
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
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::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

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

Definition at line 14 of file BDHadronTrackMonitoringHarvester.cc.

15 {
16 }

Member Function Documentation

void BDHadronTrackMonitoringHarvester::beginJob ( void  )
privatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 18 of file BDHadronTrackMonitoringHarvester.cc.

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

Implements DQMEDHarvester.

Definition at line 22 of file BDHadronTrackMonitoringHarvester.cc.

References DQMStore::IBooker::book1D(), DEFINE_FWK_MODULE, DQMStore::IGetter::get(), MonitorElement::getMean(), MonitorElement::getRMS(), i, 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(), RecoBTag::setTDRStyle(), and BDHadronTrackMonitoringAnalyzer::TrkHistCat.

23 {
24  // ***********************
25  //
26  // Book all new histograms.
27  //
28  // ***********************
30 
31  // b jets
32  // absolute average number of tracks
33  nTrk_absolute_bjet = ibook.book1D("nTrk_absolute_bjet","absolute average number of tracks in b jets",6,-0.5,5.5);
34  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
36  }
38  nTrk_absolute_bjet->setAxisTitle("average number of tracks",2);
39 
40  // relative (in percent) average number of tracks
41  nTrk_relative_bjet = ibook.book1D("nTrk_relative_bjet","relative average number of tracks in b jets",6,-0.5,5.5);
42  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
44  }
46  nTrk_relative_bjet->setAxisTitle("average fraction of tracks",2);
47 
48  // standard deviation of number of tracks
49  nTrk_std_bjet = ibook.book1D("nTrk_std_bjet","RMS of number of tracks in b jets",6,-0.5,5.5);
50  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
52  }
53  nTrk_std_bjet->setAxisRange(0, 3, 2);
54  nTrk_std_bjet->setAxisTitle("RMS of number of tracks",2);
55 
56 
57 
58 
59  // c jets
60  nTrk_absolute_cjet = ibook.book1D("nTrk_absolute_cjet","absolute average number of tracks in c jets",6,-0.5,5.5);
61  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
63  }
65  nTrk_absolute_cjet->setAxisTitle("average number of tracks",2);
66 
67  nTrk_relative_cjet = ibook.book1D("nTrk_relative_cjet","relative average number of tracks in c jets",6,-0.5,5.5);
68  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
70  }
72  nTrk_relative_cjet->setAxisTitle("average fraction of tracks",2);
73 
74  nTrk_std_cjet = ibook.book1D("nTrk_std_cjet","RMS of number of tracks in c jets",6,-0.5,5.5);
75  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
77  }
78  nTrk_std_cjet->setAxisRange(0, 3, 2);
79  nTrk_std_cjet->setAxisTitle("RMS of number of tracks",2);
80 
81 
82 
83  // udsg jets
84  nTrk_absolute_dusgjet = ibook.book1D("nTrk_absolute_dusgjet","absolute average number of tracks in dusg jets",6,-0.5,5.5);
85  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
87  }
89  nTrk_absolute_dusgjet->setAxisTitle("average number of tracks",2);
90 
91  nTrk_relative_dusgjet = ibook.book1D("nTrk_relative_dusgjet","relative average number of tracks in dusg jets",6,-0.5,5.5);
92  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
94  }
96  nTrk_relative_dusgjet->setAxisTitle("average fraction of tracks",2);
97 
98  nTrk_std_dusgjet = ibook.book1D("nTrk_std_dusgjet","RMS of number of tracks in dusg jets",6,-0.5,5.5);
99  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
101  }
102  nTrk_std_dusgjet->setAxisRange(0, 3, 2);
103  nTrk_std_dusgjet->setAxisTitle("RMS of number of tracks",2);
104 
105 
106  // ***********************
107  //
108  // get all the old histograms
109  //
110  // ***********************
111 
112  // b jets
113  MonitorElement *nTrk_bjet[6];
114  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
115  nTrk_bjet[i] = iget.get("nTrk_bjet_"+BDHadronTrackMonitoringAnalyzer::TrkHistCat[i]);
116  }
117  MonitorElement *nTrkAll_bjet = iget.get("nTrkAll_bjet");
118 
119  // c jets
120  MonitorElement *nTrk_cjet[6];
121  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
122  nTrk_cjet[i] = iget.get("nTrk_cjet_"+BDHadronTrackMonitoringAnalyzer::TrkHistCat[i]);
123  }
124  MonitorElement *nTrkAll_cjet = iget.get("nTrkAll_cjet");
125 
126  // dusg jets
127  MonitorElement *nTrk_dusgjet[6];
128  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
129  nTrk_dusgjet[i] = iget.get("nTrk_dusgjet_"+BDHadronTrackMonitoringAnalyzer::TrkHistCat[i]);
130  }
131  MonitorElement *nTrkAll_dusgjet = iget.get("nTrkAll_dusgjet");
132 
133 
134 
135  // ***********************
136  //
137  // Calculate contents of new histograms
138  //
139  // ***********************
140 
141  // b jets
142  float mean_bjets[6];
143  float std_bjets[6];
144  float meanAll_bjets;
145  meanAll_bjets = nTrkAll_bjet->getMean(1);
146  for (unsigned int i = 0; i< BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++){
147  mean_bjets[i] = nTrk_bjet[i]->getMean(1); // mean number of tracks per category
148  std_bjets[i] = nTrk_bjet[i]->getRMS(1);
149  nTrk_absolute_bjet->setBinContent(i+1,mean_bjets[i]);
150  nTrk_relative_bjet->setBinContent(i+1,mean_bjets[i]/meanAll_bjets);
151  nTrk_std_bjet->setBinContent(i+1,std_bjets[i]);
152  }
153 
154  // c jets
155  float mean_cjets[6];
156  float std_cjets[6];
157  float meanAll_cjets;
158  meanAll_cjets = nTrkAll_cjet->getMean(1);
159  for (unsigned int i = 0; i< BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++){
160  mean_cjets[i] = nTrk_cjet[i]->getMean(1); // mean number of tracks per category
161  std_cjets[i] = nTrk_cjet[i]->getRMS(1);
162  nTrk_absolute_cjet->setBinContent(i+1,mean_cjets[i]);
163  nTrk_relative_cjet->setBinContent(i+1,mean_cjets[i]/meanAll_cjets);
164  nTrk_std_cjet->setBinContent(i+1,std_cjets[i]);
165  }
166 
167 
168  // dusg jets
169  float mean_dusgjets[6];
170  float std_dusgjets[6];
171  float meanAll_dusgjets;
172  meanAll_dusgjets = nTrkAll_dusgjet->getMean(1);
173  for (unsigned int i = 0; i< BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++){
174  mean_dusgjets[i] = nTrk_dusgjet[i]->getMean(1); // mean number of tracks per category
175  std_dusgjets[i] = nTrk_dusgjet[i]->getRMS(1);
176  nTrk_absolute_dusgjet->setBinContent(i+1,mean_dusgjets[i]);
177  nTrk_relative_dusgjet->setBinContent(i+1,mean_dusgjets[i]/meanAll_dusgjets);
178  nTrk_std_dusgjet->setBinContent(i+1,std_dusgjets[i]);
179  }
180 
181 
182  // ***********************
183  //
184  // Remove histograms with nTracks that we do not want to show
185  //
186  // ***********************
187 
188  // b jets
189  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
191  }
192  iget.removeElement("nTrkAll_bjet");
193 
194  // c jets
195  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
197  }
198  iget.removeElement("nTrkAll_cjet");
199 
200  // dusg jets
201  for(unsigned int i = 0; i < BDHadronTrackMonitoringAnalyzer::TrkHistCat.size(); i++) {
203  }
204  iget.removeElement("nTrkAll_dusgjet");
205 
206 
207 
208 }
int i
Definition: DBlmapReader.cc:9
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:305
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:115
static const std::vector< std::string > TrkHistCat
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:202

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().