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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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::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 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)
 
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 17 of file SiStripSummaryBuilder.cc.

Constructor & Destructor Documentation

◆ SiStripSummaryBuilder()

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

Definition at line 32 of file SiStripSummaryBuilder.cc.

34  "file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
35  printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 1)),
36  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 38 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.

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

◆ iConfig_

edm::ParameterSet SiStripSummaryBuilder::iConfig_
private

Definition at line 29 of file SiStripSummaryBuilder.cc.

Referenced by analyze().

◆ printdebug_

bool SiStripSummaryBuilder::printdebug_
private

Definition at line 27 of file SiStripSummaryBuilder.cc.