CMS 3D CMS Logo

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

#include <SiStripSummaryBuilder.h>

Inheritance diagram for SiStripSummaryBuilder:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 SiStripSummaryBuilder (const edm::ParameterSet &iConfig)
 
 ~SiStripSummaryBuilder () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Private Attributes

edm::FileInPath fp_
 
edm::ParameterSet iConfig_
 
bool printdebug_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 16 of file SiStripSummaryBuilder.h.

Constructor & Destructor Documentation

◆ SiStripSummaryBuilder()

SiStripSummaryBuilder::SiStripSummaryBuilder ( const edm::ParameterSet iConfig)
explicit

Definition at line 5 of file SiStripSummaryBuilder.cc.

7  "file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
8  printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 1)),
9  iConfig_(iConfig) {}

◆ ~SiStripSummaryBuilder()

SiStripSummaryBuilder::~SiStripSummaryBuilder ( )
inlineoverride

Definition at line 20 of file SiStripSummaryBuilder.h.

20 {};

Member Function Documentation

◆ analyze()

void SiStripSummaryBuilder::analyze ( const edm::Event evt,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 11 of file SiStripSummaryBuilder.cc.

11  {
12  unsigned int run = evt.id().run();
13  edm::LogInfo("SiStripSummaryBuilder") << "... creating dummy SiStripSummary Data for Run " << run << "\n "
14  << std::endl;
15 
17  obj->setRunNr(run);
18 
19  //* DISCOVER SET OF HISTOGRAMS & QUANTITIES TO BE UPLOADED*//
20 
21  std::vector<std::string> userDBContent;
22  typedef std::vector<edm::ParameterSet> VParameters;
23  VParameters histoList = iConfig_.getParameter<VParameters>("histoList");
24  VParameters::iterator ithistoList = histoList.begin();
25  VParameters::iterator ithistoListEnd = histoList.end();
26 
27  for (; ithistoList != ithistoListEnd; ++ithistoList) {
28  std::string keyName = ithistoList->getUntrackedParameter<std::string>("keyName");
29  std::vector<std::string> Quantities =
30  ithistoList->getUntrackedParameter<std::vector<std::string> >("quantitiesToExtract");
31  for (size_t i = 0; i < Quantities.size(); ++i) {
32  if (Quantities[i] == "landau") {
33  userDBContent.push_back(keyName + std::string("@") + std::string("landauPeak"));
34  userDBContent.push_back(keyName + std::string("@") + std::string("landauPeakErr"));
35  userDBContent.push_back(keyName + std::string("@") + std::string("landauSFWHM"));
36  userDBContent.push_back(keyName + std::string("@") + std::string("landauChi2NDF"));
37  } else if (Quantities[i] == "gauss") {
38  userDBContent.push_back(keyName + std::string("@") + std::string("gaussMean"));
39  userDBContent.push_back(keyName + std::string("@") + std::string("gaussSigma"));
40  userDBContent.push_back(keyName + std::string("@") + std::string("gaussChi2NDF"));
41  } else if (Quantities[i] == "stat") {
42  userDBContent.push_back(keyName + std::string("@") + std::string("entries"));
43  userDBContent.push_back(keyName + std::string("@") + std::string("mean"));
44  userDBContent.push_back(keyName + std::string("@") + std::string("rms"));
45  } else {
46  edm::LogError("SiStripSummaryBuilder")
47  << "Quantity " << Quantities[i] << " cannot be handled\nAllowed quantities are"
48  << "\n 'stat' that includes: entries, mean, rms"
49  << "\n 'landau' that includes: landauPeak, landauPeakErr, landauSFWHM, landauChi2NDF"
50  << "\n 'gauss' that includes: gaussMean, gaussSigma, gaussChi2NDF" << std::endl;
51  }
52  }
53  }
54  obj->setUserDBContent(userDBContent);
55 
56  std::stringstream ss1;
57  ss1 << "QUANTITIES TO BE INSERTED IN DB :"
58  << " \n";
59  std::vector<std::string> userDBContentA = obj->getUserDBContent();
60  for (size_t i = 0; i < userDBContentA.size(); ++i)
61  ss1 << userDBContentA[i] << std::endl;
62  edm::LogInfo("SiStripSummaryBuilder") << ss1.str();
63 
64  //* Loop over detids and create dummy data for each *//
65 
66  std::stringstream ss2;
67  for (uint32_t detid = 0; detid < 430; detid++) {
69  for (unsigned int i = 0; i < userDBContent.size(); i++)
70  values.push_back((float)CLHEP::RandGauss::shoot(50., 30.));
71 
72  ss2 << "\n\tdetid " << detid;
73  for (size_t j = 0; j < values.size(); ++j)
74  ss2 << "\n\t\t " << userDBContent[j] << " " << values[j];
75 
76  obj->put(detid, values, userDBContent);
77 
78  // See CondFormats/SiStripObjects/SiStripSummary.h for detid definitions
79 
80  if (detid == 4)
81  detid = 10;
82  if (detid == 14)
83  detid = 20;
84  if (detid == 26)
85  detid = 30;
86  if (detid == 32)
87  detid = 40;
88  if (detid == 42)
89  detid = 310;
90  if (detid == 313)
91  detid = 320;
92  if (detid == 323)
93  detid = 410;
94  if (detid == 419)
95  detid = 420;
96  }
97 
98  edm::LogInfo("SiStripSummaryBuilder") << ss2.str();
99 
100  //* Insert summary informations in the DB *//
101 
103 
104  if (mydbservice.isAvailable()) {
105  if (mydbservice->isNewTagRequest("SiStripSummaryRcd")) {
106  mydbservice->createNewIOV<SiStripSummary>(
107  obj, mydbservice->beginOfTime(), mydbservice->endOfTime(), "SiStripSummaryRcd");
108  } else {
109  mydbservice->appendSinceTime<SiStripSummary>(obj, mydbservice->currentTime(), "SiStripSummaryRcd");
110  }
111  } else {
112  edm::LogError("SiStripSummaryBuilder") << "Service is unavailable" << std::endl;
113  }
114 }

References cond::service::PoolDBOutputService::appendSinceTime(), cond::service::PoolDBOutputService::beginOfTime(), cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::currentTime(), cond::service::PoolDBOutputService::endOfTime(), edm::ParameterSet::getParameter(), SiStripBadComponentsDQMServiceTemplate_cfg::histoList, mps_fire::i, iConfig_, edm::EventBase::id(), edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), dqmiolumiharvest::j, getGTfromDQMFile::obj, writedatasetfile::run, edm::EventID::run(), AlCaHLTBitMon_QueryRunRegistry::string, and contentValuesCheck::values.

Member Data Documentation

◆ fp_

edm::FileInPath SiStripSummaryBuilder::fp_
private

Definition at line 25 of file SiStripSummaryBuilder.h.

◆ iConfig_

edm::ParameterSet SiStripSummaryBuilder::iConfig_
private

Definition at line 28 of file SiStripSummaryBuilder.h.

Referenced by analyze().

◆ printdebug_

bool SiStripSummaryBuilder::printdebug_
private

Definition at line 26 of file SiStripSummaryBuilder.h.

mps_fire.i
i
Definition: mps_fire.py:428
SiStripBadComponentsDQMServiceTemplate_cfg.histoList
histoList
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:78
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
SiStripSummaryBuilder::iConfig_
edm::ParameterSet iConfig_
Definition: SiStripSummaryBuilder.h:28
cond::service::PoolDBOutputService::appendSinceTime
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
Definition: PoolDBOutputService.h:141
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
edm::FileInPath
Definition: FileInPath.h:61
SiStripSummaryBuilder::printdebug_
bool printdebug_
Definition: SiStripSummaryBuilder.h:26
SiStripSummaryBuilder::fp_
edm::FileInPath fp_
Definition: SiStripSummaryBuilder.h:25
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:116
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
SiStripSummary
Definition: SiStripSummary.h:66
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
SiStripSummary::InputVector
std::vector< float > InputVector
Definition: SiStripSummary.h:86
edm::Service< cond::service::PoolDBOutputService >
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:213
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::EventBase::id
edm::EventID id() const
Definition: EventBase.h:59
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:128
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:217