CMS 3D CMS Logo

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 SiStripSummaryBuilder (const edm::ParameterSet &iConfig)
 
 ~SiStripSummaryBuilder () override=default
 
- 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 Attributes

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

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

Constructor & Destructor Documentation

◆ SiStripSummaryBuilder()

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

Definition at line 35 of file SiStripSummaryBuilder.cc.

37  "file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
38  printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 1)),
39  iConfig_(iConfig) {}
T getUntrackedParameter(std::string const &, T const &) const

◆ ~SiStripSummaryBuilder()

SiStripSummaryBuilder::~SiStripSummaryBuilder ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 41 of file SiStripSummaryBuilder.cc.

References cond::service::PoolDBOutputService::appendOneIOV(), cond::service::PoolDBOutputService::beginOfTime(), cond::service::PoolDBOutputService::createOneIOV(), cond::service::PoolDBOutputService::currentTime(), 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.

41  {
42  unsigned int run = evt.id().run();
43  edm::LogInfo("SiStripSummaryBuilder") << "... creating dummy SiStripSummary Data for Run " << run << "\n "
44  << std::endl;
45 
47  obj.setRunNr(run);
48 
49  //* DISCOVER SET OF HISTOGRAMS & QUANTITIES TO BE UPLOADED*//
50 
51  std::vector<std::string> userDBContent;
52  typedef std::vector<edm::ParameterSet> VParameters;
53  VParameters histoList = iConfig_.getParameter<VParameters>("histoList");
54  VParameters::iterator ithistoList = histoList.begin();
55  VParameters::iterator ithistoListEnd = histoList.end();
56 
57  for (; ithistoList != ithistoListEnd; ++ithistoList) {
58  std::string keyName = ithistoList->getUntrackedParameter<std::string>("keyName");
59  std::vector<std::string> Quantities =
60  ithistoList->getUntrackedParameter<std::vector<std::string> >("quantitiesToExtract");
61  for (size_t i = 0; i < Quantities.size(); ++i) {
62  if (Quantities[i] == "landau") {
63  userDBContent.push_back(keyName + std::string("@") + std::string("landauPeak"));
64  userDBContent.push_back(keyName + std::string("@") + std::string("landauPeakErr"));
65  userDBContent.push_back(keyName + std::string("@") + std::string("landauSFWHM"));
66  userDBContent.push_back(keyName + std::string("@") + std::string("landauChi2NDF"));
67  } else if (Quantities[i] == "gauss") {
68  userDBContent.push_back(keyName + std::string("@") + std::string("gaussMean"));
69  userDBContent.push_back(keyName + std::string("@") + std::string("gaussSigma"));
70  userDBContent.push_back(keyName + std::string("@") + std::string("gaussChi2NDF"));
71  } else if (Quantities[i] == "stat") {
72  userDBContent.push_back(keyName + std::string("@") + std::string("entries"));
73  userDBContent.push_back(keyName + std::string("@") + std::string("mean"));
74  userDBContent.push_back(keyName + std::string("@") + std::string("rms"));
75  } else {
76  edm::LogError("SiStripSummaryBuilder")
77  << "Quantity " << Quantities[i] << " cannot be handled\nAllowed quantities are"
78  << "\n 'stat' that includes: entries, mean, rms"
79  << "\n 'landau' that includes: landauPeak, landauPeakErr, landauSFWHM, landauChi2NDF"
80  << "\n 'gauss' that includes: gaussMean, gaussSigma, gaussChi2NDF" << std::endl;
81  }
82  }
83  }
84  obj.setUserDBContent(userDBContent);
85 
86  std::stringstream ss1;
87  ss1 << "QUANTITIES TO BE INSERTED IN DB :"
88  << " \n";
89  std::vector<std::string> userDBContentA = obj.getUserDBContent();
90  for (size_t i = 0; i < userDBContentA.size(); ++i)
91  ss1 << userDBContentA[i] << std::endl;
92  edm::LogInfo("SiStripSummaryBuilder") << ss1.str();
93 
94  //* Loop over detids and create dummy data for each *//
95 
96  std::stringstream ss2;
97  for (uint32_t detid = 0; detid < 430; detid++) {
99  for (unsigned int i = 0; i < userDBContent.size(); i++)
100  values.push_back((float)CLHEP::RandGauss::shoot(50., 30.));
101 
102  ss2 << "\n\tdetid " << detid;
103  for (size_t j = 0; j < values.size(); ++j)
104  ss2 << "\n\t\t " << userDBContent[j] << " " << values[j];
105 
106  obj.put(detid, values, userDBContent);
107 
108  // See CondFormats/SiStripObjects/SiStripSummary.h for detid definitions
109 
110  if (detid == 4)
111  detid = 10;
112  if (detid == 14)
113  detid = 20;
114  if (detid == 26)
115  detid = 30;
116  if (detid == 32)
117  detid = 40;
118  if (detid == 42)
119  detid = 310;
120  if (detid == 313)
121  detid = 320;
122  if (detid == 323)
123  detid = 410;
124  if (detid == 419)
125  detid = 420;
126  }
127 
128  edm::LogInfo("SiStripSummaryBuilder") << ss2.str();
129 
130  //* Insert summary informations in the DB *//
131 
133 
134  if (mydbservice.isAvailable()) {
135  if (mydbservice->isNewTagRequest("SiStripSummaryRcd")) {
136  mydbservice->createOneIOV<SiStripSummary>(obj, mydbservice->beginOfTime(), "SiStripSummaryRcd");
137  } else {
138  mydbservice->appendOneIOV<SiStripSummary>(obj, mydbservice->currentTime(), "SiStripSummaryRcd");
139  }
140  } else {
141  edm::LogError("SiStripSummaryBuilder") << "Service is unavailable" << std::endl;
142  }
143 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
Log< level::Error, false > LogError
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)
edm::EventID id() const
Definition: EventBase.h:63
std::vector< float > InputVector
Log< level::Info, false > LogInfo
RunNumber_t run() const
Definition: EventID.h:38
bool isAvailable() const
Definition: Service.h:40

Member Data Documentation

◆ fp_

edm::FileInPath SiStripSummaryBuilder::fp_
private

Definition at line 29 of file SiStripSummaryBuilder.cc.

◆ iConfig_

edm::ParameterSet SiStripSummaryBuilder::iConfig_
private

Definition at line 32 of file SiStripSummaryBuilder.cc.

Referenced by analyze().

◆ printdebug_

bool SiStripSummaryBuilder::printdebug_
private

Definition at line 30 of file SiStripSummaryBuilder.cc.