CMS 3D CMS Logo

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

#include <L1TDTTPGClient.h>

Inheritance diagram for L1TDTTPGClient:
DQMEDHarvester edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1TDTTPGClient (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~L1TDTTPGClient () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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 & itemsToGetFrom (BranchType iType) 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Private Member Functions

TH1F * get1DHisto (std::string meName, DQMStore::IGetter &igetter)
 
TProfile * get1DProfile (std::string meName, DQMStore::IGetter &igetter)
 
TH2F * get2DHisto (std::string meName, DQMStore::IGetter &igetter)
 
TProfile2D * get2DProfile (std::string meName, DQMStore::IGetter &igetter)
 
void initialize ()
 
void makeRatioHisto (DQMStore::IGetter &igetter, MonitorElement *ratioME, std::string &nName, std::string &dName)
 
void setMapPhLabel (MonitorElement *me)
 
void setMapThLabel (MonitorElement *me)
 

Private Attributes

int counterEvt_
 counter More...
 
int counterLS_
 
MonitorElementdttpgphmap2ndf
 
MonitorElementdttpgphmapbxf [3]
 
MonitorElementdttpgphmapcorrf
 prescale on number of events More...
 
MonitorElementdttpgthmapbxf [3]
 
MonitorElementdttpgthmaphf
 
std::string input_dir_
 
std::string monitorName_
 
std::string output_dir_
 
edm::ParameterSet parameters_
 
int prescaleEvt_
 units of lumi sections More...
 
int prescaleLS_
 counter More...
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 21 of file L1TDTTPGClient.h.

Constructor & Destructor Documentation

L1TDTTPGClient::L1TDTTPGClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 22 of file L1TDTTPGClient.cc.

References initialize().

22  {
23  parameters_ = ps;
24  initialize();
25 }
edm::ParameterSet parameters_
L1TDTTPGClient::~L1TDTTPGClient ( )
override

Destructor.

Definition at line 27 of file L1TDTTPGClient.cc.

27 { LogInfo("TriggerDQM") << "[TriggerDQM]: ending... "; }

Member Function Documentation

void L1TDTTPGClient::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 53 of file L1TDTTPGClient.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), and dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

53  {
54  ibooker.setCurrentFolder(output_dir_);
55 
56  // booking
57 
58  dttpgphmapcorrf = ibooker.book2D(
59  "DT_TPG_phi_map_corr_frac", "Fraction of correlated best triggers per station", 20, 1, 21, 12, 0, 12);
61  ibooker.book2D("DT_TPG_phi_map_2nd_frac", "Fraction of second tracks per station", 20, 1, 21, 12, 0, 12);
62  dttpgphmapbxf[0] =
63  ibooker.book2D("DT_TPG_phi_map_bx-1_frac", "Fraction of triggers per station (BX=-1)", 20, 1, 21, 12, 0, 12);
64  dttpgphmapbxf[1] =
65  ibooker.book2D("DT_TPG_phi_map_bx0_frac", "Fraction of triggers per station (BX=0)", 20, 1, 21, 12, 0, 12);
66  dttpgphmapbxf[2] =
67  ibooker.book2D("DT_TPG_phi_map_bx+1_frac", "Fraction of triggers per station (BX=1)", 20, 1, 21, 12, 0, 12);
73 
74  dttpgthmaphf = ibooker.book2D(
75  "DT_TPG_theta_map_corr_frac", "Fraction of H quality best triggers per station", 15, 1, 16, 12, 0, 12);
76  dttpgthmapbxf[0] =
77  ibooker.book2D("DT_TPG_theta_map_bx-1_frac", "Fraction of triggers per station (BX=-1)", 15, 1, 16, 12, 0, 12);
78  dttpgthmapbxf[1] =
79  ibooker.book2D("DT_TPG_theta_map_bx0_frac", "Fraction of triggers per station (BX=0)", 15, 1, 16, 12, 0, 12);
80  dttpgthmapbxf[2] =
81  ibooker.book2D("DT_TPG_theta_map_bx+1_frac", "Fraction of triggers per station (BX=1)", 15, 1, 16, 12, 0, 12);
86 
87  // cout << "L1TDTTPGClient::analyze" << endl;
88  counterEvt_++;
89  if (prescaleEvt_ < 1)
90  return;
91  if (prescaleEvt_ > 0 && counterEvt_ % prescaleEvt_ != 0)
92  return;
93 
94  string nName = "DT_TPG_phi_best_map_corr";
95  string dName = "DT_TPG_phi_best_map";
96  makeRatioHisto(igetter, dttpgphmapcorrf, nName, dName);
97  dName = "DT_TPG_phi_map";
98  nName = "DT_TPG_phi_map_2nd";
99  makeRatioHisto(igetter, dttpgphmap2ndf, nName, dName);
100  nName = "DT_TPG_phi_map_bx-1";
101  makeRatioHisto(igetter, dttpgphmapbxf[0], nName, dName);
102  nName = "DT_TPG_phi_map_bx0";
103  makeRatioHisto(igetter, dttpgphmapbxf[1], nName, dName);
104  nName = "DT_TPG_phi_map_bx+1";
105  makeRatioHisto(igetter, dttpgphmapbxf[2], nName, dName);
106 
107  nName = "DT_TPG_theta_best_map_h";
108  dName = "DT_TPG_theta_best_map";
109  makeRatioHisto(igetter, dttpgthmaphf, nName, dName);
110  dName = "DT_TPG_theta_map";
111  nName = "DT_TPG_theta_map_bx-1";
112  makeRatioHisto(igetter, dttpgthmapbxf[0], nName, dName);
113  nName = "DT_TPG_theta_map_bx0";
114  makeRatioHisto(igetter, dttpgthmapbxf[1], nName, dName);
115  nName = "DT_TPG_theta_map_bx+1";
116  makeRatioHisto(igetter, dttpgthmapbxf[2], nName, dName);
117 }
int prescaleEvt_
units of lumi sections
void setMapThLabel(MonitorElement *me)
MonitorElement * dttpgphmapcorrf
prescale on number of events
MonitorElement * dttpgphmapbxf[3]
MonitorElement * dttpgthmapbxf[3]
std::string output_dir_
void makeRatioHisto(DQMStore::IGetter &igetter, MonitorElement *ratioME, std::string &nName, std::string &dName)
MonitorElement * dttpgthmaphf
void setMapPhLabel(MonitorElement *me)
MonitorElement * dttpgphmap2ndf
int counterEvt_
counter
TH1F * L1TDTTPGClient::get1DHisto ( std::string  meName,
DQMStore::IGetter igetter 
)
private

Definition at line 141 of file L1TDTTPGClient.cc.

References dqm::dqmstoreimpl::DQMStore::IGetter::get(), and dqm::legacy::MonitorElement::getTH1F().

141  {
142  MonitorElement *me_ = igetter.get(meName);
143 
144  if (!me_) {
145  LogInfo("TriggerDQM") << "ME NOT FOUND.";
146  return nullptr;
147  }
148 
149  return me_->getTH1F();
150 }
virtual TH1F * getTH1F() const
TProfile * L1TDTTPGClient::get1DProfile ( std::string  meName,
DQMStore::IGetter igetter 
)
private

Definition at line 174 of file L1TDTTPGClient.cc.

References dqm::dqmstoreimpl::DQMStore::IGetter::get(), and dqm::legacy::MonitorElement::getTProfile().

174  {
175  MonitorElement *me_ = igetter.get(meName);
176 
177  if (!me_) {
178  LogInfo("TriggerDQM") << "ME NOT FOUND.";
179  return nullptr;
180  }
181 
182  return me_->getTProfile();
183 }
virtual TProfile * getTProfile() const
TH2F * L1TDTTPGClient::get2DHisto ( std::string  meName,
DQMStore::IGetter igetter 
)
private

Definition at line 152 of file L1TDTTPGClient.cc.

References dqm::dqmstoreimpl::DQMStore::IGetter::get(), and dqm::legacy::MonitorElement::getTH2F().

152  {
153  MonitorElement *me_ = igetter.get(meName);
154 
155  if (!me_) {
156  LogInfo("TriggerDQM") << "ME NOT FOUND.";
157  return nullptr;
158  }
159 
160  return me_->getTH2F();
161 }
virtual TH2F * getTH2F() const
TProfile2D * L1TDTTPGClient::get2DProfile ( std::string  meName,
DQMStore::IGetter igetter 
)
private

Definition at line 163 of file L1TDTTPGClient.cc.

References dqm::dqmstoreimpl::DQMStore::IGetter::get(), and dqm::legacy::MonitorElement::getTProfile2D().

163  {
164  MonitorElement *me_ = igetter.get(meName);
165 
166  if (!me_) {
167  LogInfo("TriggerDQM") << "ME NOT FOUND.";
168  return nullptr;
169  }
170 
171  return me_->getTProfile2D();
172 }
virtual TProfile2D * getTProfile2D() const
void L1TDTTPGClient::initialize ( )
private

Definition at line 30 of file L1TDTTPGClient.cc.

30  {
31  counterLS_ = 0;
32  counterEvt_ = 0;
33 
34  // get back-end interface
35  //dbe_ = Service<DQMStore>().operator->();
36 
37  // base folder for the contents of this job
38  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName", "");
39  // cout << "Monitor name = " << monitorName_ << endl;
40  prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
41  // cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl;
42  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
43  // cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl;
44  output_dir_ = parameters_.getUntrackedParameter<string>("output_dir", "");
45  // cout << "DQM output dir = " << output_dir_ << endl;
46  input_dir_ = parameters_.getUntrackedParameter<string>("input_dir", "");
47  // cout << "DQM input dir = " << input_dir_ << endl;
48 
49  LogInfo("TriggerDQM");
50 }
std::string input_dir_
T getUntrackedParameter(std::string const &, T const &) const
int prescaleEvt_
units of lumi sections
edm::ParameterSet parameters_
int prescaleLS_
counter
std::string output_dir_
std::string monitorName_
int counterEvt_
counter
void L1TDTTPGClient::makeRatioHisto ( DQMStore::IGetter igetter,
MonitorElement ratioME,
std::string &  nName,
std::string &  dName 
)
private

Definition at line 119 of file L1TDTTPGClient.cc.

References HLTTauDQMOffline_cfi::denominator, dqm::impl::MonitorElement::getName(), dqm::legacy::MonitorElement::getTH2F(), HLTTauDQMOffline_cfi::numerator, and particleFlowDisplacedVertex_cfi::ratio.

119  {
120  TH2F *numerator;
121  TH2F *denominator;
122 
123  denominator = this->get2DHisto(input_dir_ + "/" + dName, igetter);
124  numerator = this->get2DHisto(input_dir_ + "/" + nName, igetter);
125 
126  if (numerator && denominator) {
127  TH2F *ratio = ratioME->getTH2F();
128  if (ratio) {
129  ratio->Divide(numerator, denominator);
130  } else {
131  LogInfo("TriggerDQM") << "[TriggerDQM]: ratio histo named \"" << ratioME->getName() << "\" not found!" << endl;
132  }
133  } else {
134  if (!numerator)
135  LogInfo("TriggerDQM") << "[TriggerDQM]: numerator histo \"" << nName << "\" not found!" << endl;
136  if (!denominator)
137  LogInfo("TriggerDQM") << "[TriggerDQM]: denominator histo \"" << dName << "\" not found!" << endl;
138  }
139 }
std::string input_dir_
virtual TH2F * getTH2F() const
const std::string & getName() const
get name of ME
TH2F * get2DHisto(std::string meName, DQMStore::IGetter &igetter)
void L1TDTTPGClient::setMapPhLabel ( MonitorElement me)
private

Definition at line 185 of file L1TDTTPGClient.cc.

References mps_fire::i, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), and makeMuonMisalignmentScenario::wheel.

185  {
186  me->setAxisTitle("DTTF Sector", 2);
187  for (int i = 0; i < 5; i++) {
188  ostringstream wheel;
189  wheel << i - 2;
190  me->setBinLabel(1 + i * 4, "Wheel " + wheel.str(), 1);
191  }
192 }
virtual 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)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void L1TDTTPGClient::setMapThLabel ( MonitorElement me)
private

Definition at line 194 of file L1TDTTPGClient.cc.

References mps_fire::i, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), and makeMuonMisalignmentScenario::wheel.

194  {
195  me->setAxisTitle("DTTF Sector", 2);
196  for (int i = 0; i < 5; i++) {
197  ostringstream wheel;
198  wheel << i - 2;
199  me->setBinLabel(1 + i * 3, "Wheel " + wheel.str(), 1);
200  }
201 }
virtual 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)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

int L1TDTTPGClient::counterEvt_
private

counter

Definition at line 47 of file L1TDTTPGClient.h.

int L1TDTTPGClient::counterLS_
private

Definition at line 46 of file L1TDTTPGClient.h.

MonitorElement* L1TDTTPGClient::dttpgphmap2ndf
private

Definition at line 54 of file L1TDTTPGClient.h.

MonitorElement* L1TDTTPGClient::dttpgphmapbxf[3]
private

Definition at line 55 of file L1TDTTPGClient.h.

MonitorElement* L1TDTTPGClient::dttpgphmapcorrf
private

prescale on number of events

Definition at line 53 of file L1TDTTPGClient.h.

MonitorElement* L1TDTTPGClient::dttpgthmapbxf[3]
private

Definition at line 57 of file L1TDTTPGClient.h.

MonitorElement* L1TDTTPGClient::dttpgthmaphf
private

Definition at line 56 of file L1TDTTPGClient.h.

std::string L1TDTTPGClient::input_dir_
private

Definition at line 44 of file L1TDTTPGClient.h.

std::string L1TDTTPGClient::monitorName_
private

Definition at line 43 of file L1TDTTPGClient.h.

std::string L1TDTTPGClient::output_dir_
private

Definition at line 45 of file L1TDTTPGClient.h.

edm::ParameterSet L1TDTTPGClient::parameters_
private
int L1TDTTPGClient::prescaleEvt_
private

units of lumi sections

Definition at line 49 of file L1TDTTPGClient.h.

int L1TDTTPGClient::prescaleLS_
private

counter

Definition at line 48 of file L1TDTTPGClient.h.