CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
SiPixelDynamicInefficiencyDB Class Reference
Inheritance diagram for SiPixelDynamicInefficiencyDB:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
 SiPixelDynamicInefficiencyDB (const edm::ParameterSet &conf)
 
 ~SiPixelDynamicInefficiencyDB () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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)
 

Private Types

typedef std::vector< edm::ParameterSetParameters
 

Private Attributes

edm::ParameterSet conf_
 
std::string recordName_
 
Parameters theChipGeomFactors_
 
Parameters theColGeomFactors_
 
double theInstLumiScaleFactor_
 
Parameters thePixelGeomFactors_
 
Parameters thePUEfficiency_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtkTopoToken_
 

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

Detailed Description

Definition at line 28 of file SiPixelDynamicInefficiencyDB.cc.

Member Typedef Documentation

◆ Parameters

Definition at line 40 of file SiPixelDynamicInefficiencyDB.cc.

Constructor & Destructor Documentation

◆ SiPixelDynamicInefficiencyDB()

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

Definition at line 53 of file SiPixelDynamicInefficiencyDB.cc.

References conf_, edm::ParameterSet::getUntrackedParameter(), recordName_, AlCaHLTBitMon_QueryRunRegistry::string, theChipGeomFactors_, theColGeomFactors_, theInstLumiScaleFactor_, thePixelGeomFactors_, and thePUEfficiency_.

54  : tkTopoToken_(esConsumes()), conf_(conf) {
55  recordName_ = conf_.getUntrackedParameter<std::string>("record", "SiPixelDynamicInefficiencyRcd");
60  theInstLumiScaleFactor_ = conf_.getUntrackedParameter<double>("theInstLumiScaleFactor");
61 }
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tkTopoToken_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< edm::ParameterSet > Parameters

◆ ~SiPixelDynamicInefficiencyDB()

SiPixelDynamicInefficiencyDB::~SiPixelDynamicInefficiencyDB ( )
overridedefault

Member Function Documentation

◆ analyze()

void SiPixelDynamicInefficiencyDB::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 68 of file SiPixelDynamicInefficiencyDB.cc.

References cond::service::PoolDBOutputService::appendOneIOV(), cond::service::PoolDBOutputService::beginOfTime(), cond::service::PoolDBOutputService::createOneIOV(), cond::service::PoolDBOutputService::currentTime(), sistrip::DISK, cppFunctionSkipper::exception, edm::EventSetup::getData(), edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), PVValHelper::ladder, nano_mu_digi_cff::layer, sistrip::LAYER, gpuClustering::pixelStatus::mask, SiStripPI::max, callgraph::module, sistrip::MODULE, SiPixelDynamicInefficiency::putChipGeomFactor(), SiPixelDynamicInefficiency::putColGeomFactor(), SiPixelDynamicInefficiency::putDetIdmask(), SiPixelDynamicInefficiency::putPixelGeomFactor(), SiPixelDynamicInefficiency::putPUFactor(), SiPixelDynamicInefficiency::puttheInstLumiScaleFactor(), TrackerTopology::pxbDetId(), TrackerTopology::pxfDetId(), DetId::rawId(), recordName_, theChipGeomFactors_, theColGeomFactors_, theInstLumiScaleFactor_, thePixelGeomFactors_, thePUEfficiency_, tkTopoToken_, and cms::Exception::what().

68  {
69  SiPixelDynamicInefficiency DynamicInefficiency;
70 
71  //Retrieve tracker topology from geometry
72  const TrackerTopology* const tTopo = &es.getData(tkTopoToken_);
73 
75  uint32_t mask;
76  uint32_t layer, LAYER = 0;
77  uint32_t ladder, LADDER = 0;
78  uint32_t module, MODULE = 0;
79  uint32_t side, SIDE = 0;
80  uint32_t disk, DISK = 0;
81  uint32_t blade, BLADE = 0;
82  uint32_t panel, PANEL = 0;
83 
84  //Put BPix masks
85  mask = tTopo->pxbDetId(max, LADDER, MODULE).rawId();
86  DynamicInefficiency.putDetIdmask(mask);
87  mask = tTopo->pxbDetId(LAYER, max, MODULE).rawId();
88  DynamicInefficiency.putDetIdmask(mask);
89  mask = tTopo->pxbDetId(LAYER, LADDER, max).rawId();
90  DynamicInefficiency.putDetIdmask(mask);
91  //Put FPix masks
92  mask = tTopo->pxfDetId(max, DISK, BLADE, PANEL, MODULE).rawId();
93  DynamicInefficiency.putDetIdmask(mask);
94  mask = tTopo->pxfDetId(SIDE, max, BLADE, PANEL, MODULE).rawId();
95  DynamicInefficiency.putDetIdmask(mask);
96  mask = tTopo->pxfDetId(SIDE, DISK, max, PANEL, MODULE).rawId();
97  DynamicInefficiency.putDetIdmask(mask);
98  mask = tTopo->pxfDetId(SIDE, DISK, BLADE, max, MODULE).rawId();
99  DynamicInefficiency.putDetIdmask(mask);
100  mask = tTopo->pxfDetId(SIDE, DISK, BLADE, PANEL, max).rawId();
101  DynamicInefficiency.putDetIdmask(mask);
102 
103  //Put PixelGeomFactors
104  for (Parameters::iterator it = thePixelGeomFactors_.begin(); it != thePixelGeomFactors_.end(); ++it) {
105  string det = it->getParameter<string>("det");
106  it->exists("layer") ? layer = it->getParameter<unsigned int>("layer") : layer = LAYER;
107  it->exists("ladder") ? ladder = it->getParameter<unsigned int>("ladder") : ladder = LADDER;
108  it->exists("module") ? module = it->getParameter<unsigned int>("module") : module = MODULE;
109  it->exists("side") ? side = it->getParameter<unsigned int>("side") : side = SIDE;
110  it->exists("disk") ? disk = it->getParameter<unsigned int>("disk") : disk = DISK;
111  it->exists("blade") ? blade = it->getParameter<unsigned int>("blade") : blade = BLADE;
112  it->exists("panel") ? panel = it->getParameter<unsigned int>("panel") : panel = PANEL;
113  double factor = it->getParameter<double>("factor");
114  if (det == "bpix") {
115  DetId detID = tTopo->pxbDetId(layer, ladder, module);
116  edm::LogPrint("SiPixelDynamicInefficiencyDB") << "Putting Pixel geom BPix layer " << layer << " ladder " << ladder
117  << " module " << module << " factor " << factor << std::endl;
118  DynamicInefficiency.putPixelGeomFactor(detID.rawId(), factor);
119  } else if (det == "fpix") {
120  DetId detID = tTopo->pxfDetId(side, disk, blade, panel, module);
121  edm::LogPrint("SiPixelDynamicInefficiencyDB")
122  << "Putting Pixel geom FPix side " << side << " disk " << disk << " blade " << blade << " panel " << panel
123  << " module " << module << " factor " << factor << std::endl;
124  DynamicInefficiency.putPixelGeomFactor(detID.rawId(), factor);
125  } else
126  edm::LogError("SiPixelDynamicInefficiencyDB")
127  << "SiPixelDynamicInefficiencyDB input detector part is neither bpix nor fpix" << std::endl;
128  }
129 
130  //Put ColumnGeomFactors
131  for (Parameters::iterator it = theColGeomFactors_.begin(); it != theColGeomFactors_.end(); ++it) {
132  string det = it->getParameter<string>("det");
133  it->exists("layer") ? layer = it->getParameter<unsigned int>("layer") : layer = LAYER;
134  it->exists("ladder") ? ladder = it->getParameter<unsigned int>("ladder") : ladder = LADDER;
135  it->exists("module") ? module = it->getParameter<unsigned int>("module") : module = MODULE;
136  it->exists("side") ? side = it->getParameter<unsigned int>("side") : side = SIDE;
137  it->exists("disk") ? disk = it->getParameter<unsigned int>("disk") : disk = DISK;
138  it->exists("blade") ? blade = it->getParameter<unsigned int>("blade") : blade = BLADE;
139  it->exists("panel") ? panel = it->getParameter<unsigned int>("panel") : panel = PANEL;
140  double factor = it->getParameter<double>("factor");
141  if (det == "bpix") {
142  DetId detID = tTopo->pxbDetId(layer, ladder, module);
143  edm::LogPrint("SiPixelDynamicInefficiencyDB")
144  << "Putting Column geom BPix layer " << layer << " ladder " << ladder << " module " << module << " factor "
145  << factor << std::endl;
146  DynamicInefficiency.putColGeomFactor(detID.rawId(), factor);
147  } else if (det == "fpix") {
148  DetId detID = tTopo->pxfDetId(side, disk, blade, panel, module);
149  edm::LogPrint("SiPixelDynamicInefficiencyDB")
150  << "Putting Column geom FPix side " << side << " disk " << disk << " blade " << blade << " panel " << panel
151  << " module " << module << " factor " << factor << std::endl;
152  DynamicInefficiency.putColGeomFactor(detID.rawId(), factor);
153  } else
154  edm::LogError("SiPixelDynamicInefficiencyDB")
155  << "SiPixelDynamicInefficiencyDB input detector part is neither bpix nor fpix" << std::endl;
156  }
157 
158  //Put ChipGeomFactors
159  for (Parameters::iterator it = theChipGeomFactors_.begin(); it != theChipGeomFactors_.end(); ++it) {
160  string det = it->getParameter<string>("det");
161  it->exists("layer") ? layer = it->getParameter<unsigned int>("layer") : layer = LAYER;
162  it->exists("ladder") ? ladder = it->getParameter<unsigned int>("ladder") : ladder = LADDER;
163  it->exists("module") ? module = it->getParameter<unsigned int>("module") : module = MODULE;
164  it->exists("side") ? side = it->getParameter<unsigned int>("side") : side = SIDE;
165  it->exists("disk") ? disk = it->getParameter<unsigned int>("disk") : disk = DISK;
166  it->exists("blade") ? blade = it->getParameter<unsigned int>("blade") : blade = BLADE;
167  it->exists("panel") ? panel = it->getParameter<unsigned int>("panel") : panel = PANEL;
168  double factor = it->getParameter<double>("factor");
169  if (det == "bpix") {
170  DetId detID = tTopo->pxbDetId(layer, ladder, module);
171  edm::LogPrint("SiPixelDynamicInefficiencyDB") << "Putting Chip geom BPix layer " << layer << " ladder " << ladder
172  << " module " << module << " factor " << factor << std::endl;
173  DynamicInefficiency.putChipGeomFactor(detID.rawId(), factor);
174  } else if (det == "fpix") {
175  DetId detID = tTopo->pxfDetId(side, disk, blade, panel, module);
176  edm::LogPrint("SiPixelDynamicInefficiencyDB")
177  << "Putting Chip geom FPix side " << side << " disk " << disk << " blade " << blade << " panel " << panel
178  << " module " << module << " factor " << factor << std::endl;
179  DynamicInefficiency.putChipGeomFactor(detID.rawId(), factor);
180  } else
181  edm::LogError("SiPixelDynamicInefficiencyDB")
182  << "SiPixelDynamicInefficiencyDB input detector part is neither bpix nor fpix" << std::endl;
183  }
184 
185  //Put PUFactors
186  for (Parameters::iterator it = thePUEfficiency_.begin(); it != thePUEfficiency_.end(); ++it) {
187  string det = it->getParameter<string>("det");
188  it->exists("layer") ? layer = it->getParameter<unsigned int>("layer") : layer = LAYER;
189  it->exists("ladder") ? ladder = it->getParameter<unsigned int>("ladder") : ladder = LADDER;
190  it->exists("module") ? module = it->getParameter<unsigned int>("module") : module = MODULE;
191  it->exists("side") ? side = it->getParameter<unsigned int>("side") : side = SIDE;
192  it->exists("disk") ? disk = it->getParameter<unsigned int>("disk") : disk = DISK;
193  it->exists("blade") ? blade = it->getParameter<unsigned int>("blade") : blade = BLADE;
194  it->exists("panel") ? panel = it->getParameter<unsigned int>("panel") : panel = PANEL;
195  std::vector<double> factor = it->getParameter<std::vector<double> >("factor");
196  if (det == "bpix") {
197  DetId detID = tTopo->pxbDetId(layer, ladder, module);
198  edm::LogPrint("SiPixelDynamicInefficiencyDB")
199  << "Putting PU efficiency BPix layer " << layer << " ladder " << ladder << " module " << module
200  << " factor size " << factor.size() << std::endl;
201  DynamicInefficiency.putPUFactor(detID.rawId(), factor);
202  } else if (det == "fpix") {
203  DetId detID = tTopo->pxfDetId(side, disk, blade, panel, module);
204  edm::LogPrint("SiPixelDynamicInefficiencyDB")
205  << "Putting PU efficiency FPix side " << side << " disk " << disk << " blade " << blade << " panel " << panel
206  << " module " << module << " factor size " << factor.size() << std::endl;
207  DynamicInefficiency.putPUFactor(detID.rawId(), factor);
208  }
209  }
210  //Put theInstLumiScaleFactor
212 
214  if (mydbservice.isAvailable()) {
215  try {
216  if (mydbservice->isNewTagRequest(recordName_)) {
218  DynamicInefficiency, mydbservice->beginOfTime(), recordName_);
219  } else {
221  DynamicInefficiency, mydbservice->currentTime(), recordName_);
222  }
223  } catch (const cond::Exception& er) {
224  edm::LogError("SiPixelDynamicInefficiencyDB") << er.what() << std::endl;
225  } catch (const std::exception& er) {
226  edm::LogError("SiPixelDynamicInefficiencyDB") << "caught std::exception " << er.what() << std::endl;
227  } catch (...) {
228  edm::LogError("SiPixelDynamicInefficiencyDB") << "Funny error" << std::endl;
229  }
230  } else {
231  edm::LogError("SiPixelDynamicInefficiencyDB") << "Service is unavailable" << std::endl;
232  }
233 }
Base exception class for the object to relational access.
Definition: Exception.h:11
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tkTopoToken_
bool putPUFactor(const uint32_t &, std::vector< double > &)
bool putChipGeomFactor(const uint32_t &, double &)
bool putColGeomFactor(const uint32_t &, double &)
Log< level::Error, false > LogError
constexpr uint32_t mask
Definition: gpuClustering.h:26
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
bool isNewTagRequest(const std::string &recordName)
Log< level::Warning, true > LogPrint
DetId pxbDetId(uint32_t layer, uint32_t ladder, uint32_t module) const
DetId pxfDetId(uint32_t side, uint32_t disk, uint32_t blade, uint32_t panel, uint32_t module) const
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool isAvailable() const
Definition: Service.h:40
char const * what() const noexcept override
Definition: Exception.cc:107
bool putPixelGeomFactor(const uint32_t &, double &)

Member Data Documentation

◆ conf_

edm::ParameterSet SiPixelDynamicInefficiencyDB::conf_
private

Definition at line 37 of file SiPixelDynamicInefficiencyDB.cc.

Referenced by SiPixelDynamicInefficiencyDB().

◆ recordName_

std::string SiPixelDynamicInefficiencyDB::recordName_
private

Definition at line 38 of file SiPixelDynamicInefficiencyDB.cc.

Referenced by analyze(), and SiPixelDynamicInefficiencyDB().

◆ theChipGeomFactors_

Parameters SiPixelDynamicInefficiencyDB::theChipGeomFactors_
private

Definition at line 43 of file SiPixelDynamicInefficiencyDB.cc.

Referenced by analyze(), and SiPixelDynamicInefficiencyDB().

◆ theColGeomFactors_

Parameters SiPixelDynamicInefficiencyDB::theColGeomFactors_
private

Definition at line 42 of file SiPixelDynamicInefficiencyDB.cc.

Referenced by analyze(), and SiPixelDynamicInefficiencyDB().

◆ theInstLumiScaleFactor_

double SiPixelDynamicInefficiencyDB::theInstLumiScaleFactor_
private

Definition at line 45 of file SiPixelDynamicInefficiencyDB.cc.

Referenced by analyze(), and SiPixelDynamicInefficiencyDB().

◆ thePixelGeomFactors_

Parameters SiPixelDynamicInefficiencyDB::thePixelGeomFactors_
private

Definition at line 41 of file SiPixelDynamicInefficiencyDB.cc.

Referenced by analyze(), and SiPixelDynamicInefficiencyDB().

◆ thePUEfficiency_

Parameters SiPixelDynamicInefficiencyDB::thePUEfficiency_
private

Definition at line 44 of file SiPixelDynamicInefficiencyDB.cc.

Referenced by analyze(), and SiPixelDynamicInefficiencyDB().

◆ tkTopoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiPixelDynamicInefficiencyDB::tkTopoToken_
private

Definition at line 36 of file SiPixelDynamicInefficiencyDB.cc.

Referenced by analyze().