CMS 3D CMS Logo

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

#include <SiStripPedestalsBuilder.h>

Inheritance diagram for SiStripPedestalsBuilder:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 SiStripPedestalsBuilder (const edm::ParameterSet &iConfig)
 
 ~SiStripPedestalsBuilder () 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 SiStripPedestalsBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file SiStripPedestalsBuilder.cc.

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

Definition at line 20 of file SiStripPedestalsBuilder.h.

References analyze().

20 {};

Member Function Documentation

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

Definition at line 11 of file SiStripPedestalsBuilder.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_, SiStripPedestals::put(), DQM::reader, writedatasetfile::run, edm::EventID::run(), SiStripPedestals::setData(), and digitizers_cfi::strip.

Referenced by ~SiStripPedestalsBuilder().

11  {
12  unsigned int run = evt.id().run();
13 
14  edm::LogInfo("SiStripPedestalsBuilder")
15  << "... creating dummy SiStripPedestals 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  SiStripPedestals::InputVector theSiStripVector;
30  for (int strip = 0; strip < 128 * it->second.nApvs; ++strip) {
31  float MeanPed = 100;
32  float RmsPed = 5;
33 
34  float ped = CLHEP::RandGauss::shoot(MeanPed, RmsPed);
35 
36  if (count < static_cast<int>(printdebug_))
37  edm::LogInfo("SiStripPedestalsBuilder") << "detid " << it->first << " \t"
38  << " strip " << strip << " \t" << ped << " \t" << std::endl;
39  obj->setData(ped, theSiStripVector);
40  }
41 
42  //SiStripPedestals::Range range(theSiStripVector.begin(),theSiStripVector.end());
43  if (!obj->put(it->first, theSiStripVector))
44  edm::LogError("SiStripPedestalsBuilder")
45  << "[SiStripPedestalsBuilder::analyze] detid already exists" << std::endl;
46  }
47 
48  //End now write sistrippedestals data in DB
50 
51  if (mydbservice.isAvailable()) {
52  if (mydbservice->isNewTagRequest("SiStripPedestalsRcd")) {
53  mydbservice->createNewIOV<SiStripPedestals>(
54  obj, mydbservice->beginOfTime(), mydbservice->endOfTime(), "SiStripPedestalsRcd");
55  } else {
56  //mydbservice->createNewIOV<SiStripPedestals>(obj,mydbservice->currentTime(),"SiStripPedestalsRcd");
57  mydbservice->appendSinceTime<SiStripPedestals>(obj, mydbservice->currentTime(), "SiStripPedestalsRcd");
58  }
59  } else {
60  edm::LogError("SiStripPedestalsBuilder") << "Service is unavailable" << std::endl;
61  }
62 }
RunNumber_t run() const
Definition: EventID.h:38
reader
Definition: DQM.py:105
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
std::vector< uint16_t > InputVector
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)
bool put(const uint32_t &detID, InputVector &input)
edm::EventID id() const
Definition: EventBase.h:59
void setData(float ped, InputVector &vped)
std::string fullPath() const
Definition: FileInPath.cc:163

Member Data Documentation

edm::FileInPath SiStripPedestalsBuilder::fp_
private

Definition at line 25 of file SiStripPedestalsBuilder.h.

Referenced by analyze().

uint32_t SiStripPedestalsBuilder::printdebug_
private

Definition at line 26 of file SiStripPedestalsBuilder.h.

Referenced by analyze().