CMS 3D CMS Logo

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

#include <SiStripThresholdBuilder.h>

Inheritance diagram for SiStripThresholdBuilder:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 SiStripThresholdBuilder (const edm::ParameterSet &iConfig)
 
 ~SiStripThresholdBuilder () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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_
 
uint32_t 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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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<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)
 

Detailed Description

Definition at line 16 of file SiStripThresholdBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file SiStripThresholdBuilder.cc.

8  "file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
9  printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 3)) {}
T getUntrackedParameter(std::string const &, T const &) const
SiStripThresholdBuilder::~SiStripThresholdBuilder ( )
inlineoverride

Definition at line 20 of file SiStripThresholdBuilder.h.

References analyze().

20 {};

Member Function Documentation

void SiStripThresholdBuilder::analyze ( const edm::Event evt,
const edm::EventSetup iSetup 
)
override

Definition at line 11 of file SiStripThresholdBuilder.cc.

References cond::service::PoolDBOutputService::appendSinceTime(), cond::service::PoolDBOutputService::beginOfTime(), KineDebug3::count(), cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::currentTime(), cond::service::PoolDBOutputService::endOfTime(), fp_, edm::FileInPath::fullPath(), edm::EventBase::id(), edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), getGTfromDQMFile::obj, printdebug_, SiStripThreshold::put(), DQM::reader, writedatasetfile::run, edm::EventID::run(), edm::second(), SiStripThreshold::setData(), contentValuesCheck::ss, digitizers_cfi::strip, and createJobs::tmp.

Referenced by ~SiStripThresholdBuilder().

11  {
12  unsigned int run = evt.id().run();
13 
14  edm::LogInfo("SiStripThresholdBuilder")
15  << "... creating dummy SiStripThreshold Data for Run " << run << "\n " << std::endl;
16 
18 
20 
21  const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>& DetInfos = reader.getAllData();
22 
23  int count = -1;
24  for (std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator it = DetInfos.begin();
25  it != DetInfos.end();
26  it++) {
27  count++;
28  //Generate Pedestal for det detid
29  SiStripThreshold::Container theSiStripVector;
30  uint16_t strip = 0;
31  while (strip < 128 * it->second.nApvs) {
32  float lTh = (CLHEP::RandFlat::shoot(1.) * 64) / 5;
33  float hTh = (CLHEP::RandFlat::shoot(1.) * 64) / 5;
34  if (hTh < lTh) {
35  float tmp = hTh;
36  hTh = lTh;
37  lTh = tmp;
38  }
39  float cTh = (CLHEP::RandFlat::shoot(1.) * 30.);
40 
41  obj->setData(strip, lTh, hTh, cTh, theSiStripVector);
42  if (count < (int)printdebug_) {
43  std::stringstream ss;
44  theSiStripVector.back().print(ss);
45  edm::LogInfo("SiStripThresholdBuilder")
46  << "detid: " << it->first << " \n"
47  << "firstStrip: " << strip << " \t"
48  << "lTh: " << lTh << " \t"
49  << "hTh: " << hTh << " \t"
50  << "cTh: " << cTh << " \t"
51  << "FirstStrip_and_Hth: " << theSiStripVector.back().FirstStrip_and_Hth << " \n"
52  << ss.str() << std::endl;
53  }
54  obj->setData(strip + 1, lTh, hTh, theSiStripVector);
55  strip = (uint16_t)(CLHEP::RandFlat::shoot(strip + 2, 128 * it->second.nApvs));
56  }
57  if (!obj->put(it->first, theSiStripVector))
58  edm::LogError("SiStripThresholdBuilder")
59  << "[SiStripThresholdBuilder::analyze] detid already exists" << std::endl;
60  }
61 
62  //End now write sistrippedestals data in DB
64 
65  if (mydbservice.isAvailable()) {
66  if (mydbservice->isNewTagRequest("SiStripThresholdRcd")) {
67  mydbservice->createNewIOV<SiStripThreshold>(
68  obj, mydbservice->beginOfTime(), mydbservice->endOfTime(), "SiStripThresholdRcd");
69  } else {
70  mydbservice->appendSinceTime<SiStripThreshold>(obj, mydbservice->currentTime(), "SiStripThresholdRcd");
71  }
72  } else {
73  edm::LogError("SiStripThresholdBuilder") << "Service is unavailable" << std::endl;
74  }
75 }
RunNumber_t run() const
Definition: EventID.h:38
bool put(const uint32_t &detID, const InputVector &vect)
reader
Definition: DQM.py:105
U second(std::pair< T, U > const &p)
std::vector< Data > Container
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:40
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void setData(const uint16_t &strip, const float &lTh, const float &hTh, Container &vthr)
edm::EventID id() const
Definition: EventBase.h:59
std::string fullPath() const
Definition: FileInPath.cc:163
tmp
align.sh
Definition: createJobs.py:716

Member Data Documentation

edm::FileInPath SiStripThresholdBuilder::fp_
private

Definition at line 25 of file SiStripThresholdBuilder.h.

Referenced by analyze().

uint32_t SiStripThresholdBuilder::printdebug_
private

Definition at line 26 of file SiStripThresholdBuilder.h.

Referenced by analyze().