CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
TrackFoldedOccupancyClient Class Reference

#include <TrackFoldedOccupancyClient.h>

Inheritance diagram for TrackFoldedOccupancyClient:
DQMEDHarvester edm::one::EDProducer< T > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TrackFoldedOccupancyClient (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~TrackFoldedOccupancyClient () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< T >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 beginJob (void) override
 BeginJob. More...
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 BeginRun. More...
 
void dqmEndJob (DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_) override
 EndJob. More...
 
- 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Member Functions

void bookMEs (DQMStore::IBooker &ibooker_)
 book MEs More...
 

Private Attributes

std::string algoName_
 
edm::ParameterSet conf_
 
std::string histTag_
 
std::string quality_
 
std::string state_
 
MonitorElementTkEtaPhi_Ratio_byFoldingmap = nullptr
 
MonitorElementTkEtaPhi_Ratio_byFoldingmap_op = nullptr
 
MonitorElementTkEtaPhi_RelativeDifference_byFoldingmap = nullptr
 
MonitorElementTkEtaPhi_RelativeDifference_byFoldingmap_op = nullptr
 
std::string TopFolder_
 

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
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 21 of file TrackFoldedOccupancyClient.h.

Constructor & Destructor Documentation

TrackFoldedOccupancyClient::TrackFoldedOccupancyClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 6 of file TrackFoldedOccupancyClient.cc.

References algoName_, conf_, edm::ParameterSet::getParameter(), histTag_, iConfig, quality_, state_, AlCaHLTBitMon_QueryRunRegistry::string, and TopFolder_.

8 {
9  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient::Deleting TrackFoldedOccupancyClient ";
10  TopFolder_ = iConfig.getParameter<std::string>("FolderName");
11  quality_ = iConfig.getParameter<std::string>("TrackQuality");
12  algoName_ = iConfig.getParameter<std::string>("AlgoName");
13  state_ = iConfig.getParameter<std::string>("MeasurementState");
14  histTag_ = (state_ == "default") ? algoName_ : state_ + "_" + algoName_;
15  conf_ = iConfig;
16 }
Log< level::Info, false > LogInfo
TrackFoldedOccupancyClient::~TrackFoldedOccupancyClient ( )
override

Destructor.

Definition at line 19 of file TrackFoldedOccupancyClient.cc.

21 {
22  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient::Deleting TrackFoldedOccupancyClient ";
23 }
Log< level::Info, false > LogInfo

Member Function Documentation

void TrackFoldedOccupancyClient::beginJob ( void  )
overrideprotectedvirtual

BeginJob.

Reimplemented from edm::one::EDProducerBase.

Definition at line 26 of file TrackFoldedOccupancyClient.cc.

28 {
29  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient::beginJob done";
30 }
Log< level::Info, false > LogInfo
void TrackFoldedOccupancyClient::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotected

BeginRun.

Definition at line 33 of file TrackFoldedOccupancyClient.cc.

35 {
36  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient:: Begining of Run";
37 }
Log< level::Info, false > LogInfo
void TrackFoldedOccupancyClient::bookMEs ( DQMStore::IBooker ibooker_)
private

book MEs

Definition at line 40 of file TrackFoldedOccupancyClient.cc.

References dqm::implementation::IBooker::book2D(), conf_, HLT_FULL_cff::EtaMax, Gflash::EtaMin, edm::ParameterSet::getParameter(), histTag_, quality_, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TkEtaPhi_Ratio_byFoldingmap, TkEtaPhi_Ratio_byFoldingmap_op, TkEtaPhi_RelativeDifference_byFoldingmap, TkEtaPhi_RelativeDifference_byFoldingmap_op, and TopFolder_.

Referenced by dqmEndJob().

42 {
43  ibooker.setCurrentFolder(TopFolder_ + "/" + quality_ + "/GeneralProperties/");
44  int Phi2DBin = conf_.getParameter<int>("Phi2DBin");
45  int Eta2DBin = conf_.getParameter<int>("Eta2DBin");
46  double EtaMin = conf_.getParameter<double>("EtaMin");
47  double EtaMax = conf_.getParameter<double>("EtaMax");
48  double PhiMin = conf_.getParameter<double>("PhiMin");
49  double PhiMax = conf_.getParameter<double>("PhiMax");
50 
51  // use the AlgoName and Quality Name
52  std::string histname = "TkEtaPhi_RelativeDifference_byFoldingmap_" + histTag_;
54  ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
57 
58  histname = "TkEtaPhi_RelativeDifference_byFoldingmap_op_" + histTag_;
60  ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
63 
64  histname = "TkEtaPhi_Ratio_byFoldingmap_" + histTag_;
65  TkEtaPhi_Ratio_byFoldingmap = ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
66  TkEtaPhi_Ratio_byFoldingmap->setAxisTitle("Track #eta", 1);
67  TkEtaPhi_Ratio_byFoldingmap->setAxisTitle("Track #phi", 2);
68 
69  histname = "TkEtaPhi_Ratio_byFoldingmap_op_" + histTag_;
71  ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
74 }
MonitorElement * TkEtaPhi_RelativeDifference_byFoldingmap
const double EtaMin[kNumberCalorimeter]
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * TkEtaPhi_RelativeDifference_byFoldingmap_op
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void TrackFoldedOccupancyClient::dqmEndJob ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
overrideprotectedvirtual

EndJob.

Implements DQMEDHarvester.

Definition at line 77 of file TrackFoldedOccupancyClient.cc.

References bookMEs(), dqm::impl::MonitorElement::divide(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), histTag_, cuy::ii, findQualityFiles::jj, quality_, dqm::impl::MonitorElement::setBinContent(), AlCaHLTBitMon_QueryRunRegistry::string, TkEtaPhi_Ratio_byFoldingmap, TkEtaPhi_Ratio_byFoldingmap_op, TkEtaPhi_RelativeDifference_byFoldingmap, TkEtaPhi_RelativeDifference_byFoldingmap_op, and TopFolder_.

79 {
80  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient::endLuminosityBlock";
81 
82  bookMEs(ibooker);
83  std::string inFolder = TopFolder_ + "/" + quality_ + "/GeneralProperties/";
84 
85  std::string hname;
86  hname = "TrackEtaPhi_";
87  MonitorElement* TrackEtaPhi = igetter.get(inFolder + hname + histTag_);
88 
89  hname = "TrackEtaPhiInverted_";
90  MonitorElement* TrackEtaPhiInverted = igetter.get(inFolder + hname + histTag_);
91 
92  hname = "TrackEtaPhiInvertedoutofphase_";
93  MonitorElement* TrackEtaPhiInvertedoutofphase = igetter.get(inFolder + hname + histTag_);
94 
95  if (TrackEtaPhi == nullptr || TrackEtaPhiInverted == nullptr || TrackEtaPhiInvertedoutofphase == nullptr) {
96  edm::LogWarning("TrackFoldedOccupancyClient") << "MEs needed for this module not found. Skipping.";
97  return;
98  }
99 
100  TkEtaPhi_Ratio_byFoldingmap->divide(TrackEtaPhi, TrackEtaPhiInverted, 1., 1., "");
101  TkEtaPhi_Ratio_byFoldingmap_op->divide(TrackEtaPhi, TrackEtaPhiInvertedoutofphase, 1., 1., "");
102 
103  int nx = TrackEtaPhi->getNbinsX();
104  int ny = TrackEtaPhi->getNbinsY();
105 
106  for (int ii = 1; ii <= nx; ii++) {
107  for (int jj = 1; jj <= ny; jj++) {
108  double Sum1 = TrackEtaPhi->getBinContent(ii, jj) + TrackEtaPhiInverted->getBinContent(ii, jj);
109  double Sum2 = TrackEtaPhi->getBinContent(ii, jj) + TrackEtaPhiInvertedoutofphase->getBinContent(ii, jj);
110 
111  double Sub1 = TrackEtaPhi->getBinContent(ii, jj) - TrackEtaPhiInverted->getBinContent(ii, jj);
112  double Sub2 = TrackEtaPhi->getBinContent(ii, jj) - TrackEtaPhiInvertedoutofphase->getBinContent(ii, jj);
113 
114  if (Sum1 == 0 || Sum2 == 0) {
117  } else {
118  double ratio1 = Sub1 / Sum1;
119  double ratio2 = Sub2 / Sum2;
122  }
123  }
124  }
125 }
virtual int getNbinsY() const
get # of bins in Y-axis
int ii
Definition: cuy.py:589
MonitorElement * TkEtaPhi_RelativeDifference_byFoldingmap
void bookMEs(DQMStore::IBooker &ibooker_)
book MEs
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getBinContent(int binx) const
get content of bin (1-D)
Log< level::Info, false > LogInfo
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * TkEtaPhi_RelativeDifference_byFoldingmap_op
Log< level::Warning, false > LogWarning
virtual void divide(const MonitorElement *, const MonitorElement *, double, double, const char *)
Replace entries with results of dividing num by denom.

Member Data Documentation

std::string TrackFoldedOccupancyClient::algoName_
private

Definition at line 44 of file TrackFoldedOccupancyClient.h.

Referenced by TrackFoldedOccupancyClient().

edm::ParameterSet TrackFoldedOccupancyClient::conf_
private

Definition at line 43 of file TrackFoldedOccupancyClient.h.

Referenced by bookMEs(), and TrackFoldedOccupancyClient().

std::string TrackFoldedOccupancyClient::histTag_
private

Definition at line 47 of file TrackFoldedOccupancyClient.h.

Referenced by bookMEs(), dqmEndJob(), and TrackFoldedOccupancyClient().

std::string TrackFoldedOccupancyClient::quality_
private

Definition at line 45 of file TrackFoldedOccupancyClient.h.

Referenced by bookMEs(), dqmEndJob(), and TrackFoldedOccupancyClient().

std::string TrackFoldedOccupancyClient::state_
private

Definition at line 46 of file TrackFoldedOccupancyClient.h.

Referenced by TrackFoldedOccupancyClient().

MonitorElement* TrackFoldedOccupancyClient::TkEtaPhi_Ratio_byFoldingmap = nullptr
private

Definition at line 52 of file TrackFoldedOccupancyClient.h.

Referenced by bookMEs(), and dqmEndJob().

MonitorElement* TrackFoldedOccupancyClient::TkEtaPhi_Ratio_byFoldingmap_op = nullptr
private

Definition at line 53 of file TrackFoldedOccupancyClient.h.

Referenced by bookMEs(), and dqmEndJob().

MonitorElement* TrackFoldedOccupancyClient::TkEtaPhi_RelativeDifference_byFoldingmap = nullptr
private

Definition at line 50 of file TrackFoldedOccupancyClient.h.

Referenced by bookMEs(), and dqmEndJob().

MonitorElement* TrackFoldedOccupancyClient::TkEtaPhi_RelativeDifference_byFoldingmap_op = nullptr
private

Definition at line 51 of file TrackFoldedOccupancyClient.h.

Referenced by bookMEs(), and dqmEndJob().

std::string TrackFoldedOccupancyClient::TopFolder_
private

Definition at line 48 of file TrackFoldedOccupancyClient.h.

Referenced by bookMEs(), dqmEndJob(), and TrackFoldedOccupancyClient().