CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
SiPixelPhase1EfficiencyExtras Class Reference
Inheritance diagram for SiPixelPhase1EfficiencyExtras:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SiPixelPhase1EfficiencyExtras (const edm::ParameterSet &conf)
 
 ~SiPixelPhase1EfficiencyExtras () override
 
- 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< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
void dqmEndJob (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
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< Bconsumes (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 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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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)
 

Protected Attributes

const std::string effFolderName_
 
const std::string instLumiFolderName_
 
const std::string vtxFolderName_
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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)
 

Detailed Description

Definition at line 34 of file SiPixelPhase1EfficiencyExtras.cc.

Constructor & Destructor Documentation

◆ SiPixelPhase1EfficiencyExtras()

SiPixelPhase1EfficiencyExtras::SiPixelPhase1EfficiencyExtras ( const edm::ParameterSet conf)
explicit

Definition at line 49 of file SiPixelPhase1EfficiencyExtras.cc.

50  : effFolderName_(iConfig.getParameter<std::string>("EffFolderName")),
51  vtxFolderName_(iConfig.getParameter<std::string>("VtxFolderName")),
52  instLumiFolderName_(iConfig.getParameter<std::string>("InstLumiFolderName")) {
53  edm::LogInfo("PixelDQM") << "SiPixelPhase1EfficiencyExtras::SiPixelPhase1EfficiencyExtras: Hello!";
54 }
Log< level::Info, false > LogInfo

◆ ~SiPixelPhase1EfficiencyExtras()

SiPixelPhase1EfficiencyExtras::~SiPixelPhase1EfficiencyExtras ( )
override

Definition at line 56 of file SiPixelPhase1EfficiencyExtras.cc.

56  {
57  edm::LogInfo("PixelDQM") << "SiPixelPhase1EfficiencyExtras::~SiPixelPhase1EfficiencyExtras: Destructor";
58 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ beginRun()

void SiPixelPhase1EfficiencyExtras::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 60 of file SiPixelPhase1EfficiencyExtras.cc.

60 {}

◆ dqmEndJob()

void SiPixelPhase1EfficiencyExtras::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 65 of file SiPixelPhase1EfficiencyExtras.cc.

References dqm::implementation::IBooker::book2D(), effFolderName_, dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getEntries(), dqm::impl::MonitorElement::getNbinsX(), dqm::legacy::MonitorElement::getTH2F(), dqm::legacy::MonitorElement::getTProfile(), instLumiFolderName_, createfilelist::int, SiStripPI::max, dqm::impl::MonitorElement::setBinContent(), dqm::implementation::NavigatorBase::setCurrentFolder(), and vtxFolderName_.

65  {
67 
68  //Get the existing histos
69  MonitorElement* vtx_v_lumi = iGetter.get(vtxFolderName_ + "/NumberOfGoodPVtxVsLS_GenTk");
70 
71  MonitorElement* scalLumi_v_lumi = iGetter.get(instLumiFolderName_ + "/lumiVsLS");
72 
73  MonitorElement* eff_v_lumi_forward =
74  iGetter.get(effFolderName_ + "/hitefficiency_per_Lumisection_per_PXDisk_PXForward");
75 
76  MonitorElement* eff_v_lumi_barrel =
77  iGetter.get(effFolderName_ + "/hitefficiency_per_Lumisection_per_PXLayer_PXBarrel");
78 
79  //set up some booleans that will tell us which graphs to create
80  bool createNvtx = true;
81  bool createInstLumi = true;
82 
83  //check which of the MEs exist and respond appropriately
84  if (!eff_v_lumi_forward) {
85  edm::LogWarning("SiPixelPhase1EfficiencyExtras")
86  << "no hitefficiency_per_Lumisection_per_PXDisk_PXForward ME is available in " << effFolderName_;
87  return;
88  }
89  if (!eff_v_lumi_barrel) {
90  edm::LogWarning("SiPixelPhase1EfficiencyExtras")
91  << "no hitefficiency_per_Lumisection_per_PXLayer_PXBarrel ME is available in " << effFolderName_;
92  return;
93  }
94  if (!vtx_v_lumi) {
95  edm::LogWarning("SiPixelPhase1EfficiencyExtras")
96  << "no NumberOfGoodPVtxVsLS_GenTK ME is available in " << vtxFolderName_;
97  createNvtx = false;
98  }
99  if (!scalLumi_v_lumi) {
100  edm::LogWarning("SiPixelPhase1EfficiencyExtras") << "no lumiVsLS ME is available in " << instLumiFolderName_;
101  createInstLumi = false;
102  }
103 
104  //If the existing MEs are empty, set the boolean to skip booking
105  if (vtx_v_lumi && vtx_v_lumi->getEntries() == 0)
106  createNvtx = false;
107  if (scalLumi_v_lumi && scalLumi_v_lumi->getEntries() == 0)
108  createInstLumi = false;
109 
110  // if the max mean lumi is not higher than zero, do not create profiles with respect to lumi
111  if (createInstLumi and scalLumi_v_lumi->getTProfile()->GetMaximum() <= 0.)
112  createInstLumi = false;
113 
114  double eff = 0.0;
115 
116  //Will pass if nvtx ME exists and is not empty
117  if (createNvtx) {
118  //Book new histos
119  MonitorElement* eff_v_vtx_barrel =
120  iBooker.book2D("hitefficiency_per_meanNvtx_per_PXLayer_PXBarrel",
121  "hitefficiency_per_meanNvtx_per_PXLayer_PXBarrel; meanNvtx; PXLayer",
122  500,
123  0,
124  100,
125  3,
126  .5,
127  3.5);
128 
129  MonitorElement* eff_v_vtx_forward =
130  iBooker.book2D("hitefficiency_per_meanNvtx_per_PXDisk_PXForward",
131  "hitefficiency_per_meanNvtx_per_PXDisk_PXForward; meanNvtx; PXDisk",
132  500,
133  0,
134  100,
135  7,
136  -3.5,
137  3.5);
138 
139  //initialize variables
140  int numLumiNvtx = int(vtx_v_lumi->getNbinsX());
141  double nvtx = 0.0;
142  int binNumVtx = 0;
143 
144  //For loop to loop through lumisections
145  for (int iLumi = 1; iLumi < numLumiNvtx - 1; iLumi++) {
146  //get the meanNvtx for each lumi
147  nvtx = vtx_v_lumi->getBinContent(iLumi);
148 
149  //Filter out useless iterations
150  if (nvtx != 0) {
151  //Grab the bin number for the nvtx
152  binNumVtx = eff_v_vtx_barrel->getTH2F()->FindBin(nvtx);
153 
154  //loop through the layers
155  for (int iLayer = 1; iLayer < 8; iLayer++) {
156  //get the eff at the lumisection and layer
157  eff = eff_v_lumi_forward->getBinContent(iLumi - 1, iLayer);
158 
159  //set the efficiency in the new histo
160  eff_v_vtx_forward->setBinContent(binNumVtx, iLayer, eff);
161  }
162 
163  //loop through the layers
164  for (int iLayer = 1; iLayer < 5; iLayer++) {
165  //get the efficiency for each lumi at each layer
166  eff = eff_v_lumi_barrel->getBinContent(iLumi - 1, iLayer);
167 
168  //set the efficiency
169  eff_v_vtx_barrel->setBinContent(binNumVtx, iLayer, eff);
170  }
171  }
172  }
173  }
174  // Will pass if InstLumi ME exists, is not empty, and max mean lumi is larger than zero
175  if (createInstLumi) {
176  //Get the max value of inst lumi for plot (ensuring yMax2 is larger than zero)
177  int yMax2 = std::max(1., scalLumi_v_lumi->getTProfile()->GetMaximum());
178  yMax2 *= 1.1;
179 
180  //Book new histos
181  MonitorElement* eff_v_scalLumi_barrel =
182  iBooker.book2D("hitefficiency_per_scalLumi_per_PXLayer_PXBarrel",
183  "hitefficiency_per_scalLumi_per_PXLayer_PXBarrel; scal inst lumi E30; PXLayer",
184  500,
185  0,
186  yMax2,
187  3,
188  .5,
189  3.5);
190 
191  MonitorElement* eff_v_scalLumi_forward =
192  iBooker.book2D("hitefficiency_per_scalLumi_per_PXDisk_PXForward",
193  "hitefficiency_per_scalLumi_per_PXDisk_PXForward; scal inst lumi E30; PXDisk",
194  500,
195  0,
196  yMax2,
197  7,
198  -3.5,
199  3.5);
200 
201  //initialize variables
202  int numLumiScal = int(scalLumi_v_lumi->getNbinsX());
203  double scalLumi = 0.0;
204  int binNumScal = 0;
205 
206  //For loop to loop through lumisections
207  for (int iLumi = 1; iLumi < numLumiScal - 1; iLumi++) {
208  //get the inst lumi for each lumi
209  scalLumi = scalLumi_v_lumi->getBinContent(iLumi);
210 
211  //Filter out useless iterations
212  if (scalLumi > 0) {
213  //Grab the bin number for the inst lumi
214  binNumScal = eff_v_scalLumi_barrel->getTH2F()->FindBin(scalLumi);
215 
216  //loop through the layers
217  for (int iLayer = 1; iLayer < 8; iLayer++) {
218  //get the eff at the lumisection and layer
219  eff = eff_v_lumi_forward->getBinContent(iLumi - 1, iLayer);
220 
221  //set the efficiency in the new histo
222  eff_v_scalLumi_forward->setBinContent(binNumScal, iLayer, eff);
223  }
224 
225  //loop through the layers
226  for (int iLayer = 1; iLayer < 5; iLayer++) {
227  //get the eff at the lumisection and layer
228  eff = eff_v_lumi_barrel->getBinContent(iLumi - 1, iLayer);
229 
230  //set the efficiency in the new histo
231  eff_v_scalLumi_barrel->setBinContent(binNumScal, iLayer, eff);
232  }
233  }
234  }
235  } else
236  return;
237 }
virtual TProfile * getTProfile() const
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
virtual TH2F * getTH2F() const
virtual double getEntries() const
get # of entries
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual int getNbinsX() const
get # of bins in X-axis
Log< level::Warning, false > LogWarning
virtual double getBinContent(int binx) const
get content of bin (1-D)

Member Data Documentation

◆ effFolderName_

const std::string SiPixelPhase1EfficiencyExtras::effFolderName_
protected

Definition at line 44 of file SiPixelPhase1EfficiencyExtras.cc.

Referenced by dqmEndJob().

◆ instLumiFolderName_

const std::string SiPixelPhase1EfficiencyExtras::instLumiFolderName_
protected

Definition at line 46 of file SiPixelPhase1EfficiencyExtras.cc.

Referenced by dqmEndJob().

◆ vtxFolderName_

const std::string SiPixelPhase1EfficiencyExtras::vtxFolderName_
protected

Definition at line 45 of file SiPixelPhase1EfficiencyExtras.cc.

Referenced by dqmEndJob().