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
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

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 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>
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)
 
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 6 of file SiStripSummaryBuilder.cc.

8  "file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
9  printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 1)),
10  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 12 of file SiStripSummaryBuilder.cc.

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

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:355
SiStripBadComponentsDQMServiceTemplate_cfg.histoList
histoList
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:78
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:187
SiStripSummaryBuilder::iConfig_
edm::ParameterSet iConfig_
Definition: SiStripSummaryBuilder.h:28
edm::LogInfo
Definition: MessageLogger.h:254
cond::service::PoolDBOutputService::appendSinceTime
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
Definition: PoolDBOutputService.h:135
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
edm::FileInPath
Definition: FileInPath.h:64
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:110
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogError
Definition: MessageLogger.h:183
SiStripSummary::InputVector
std::vector< float > InputVector
Definition: SiStripSummary.h:86
edm::Service< cond::service::PoolDBOutputService >
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:185
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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:100
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:189