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
 
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)
 
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 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 17 of file SiStripPedestalsBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file SiStripPedestalsBuilder.cc.

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

Definition at line 23 of file SiStripPedestalsBuilder.h.

References analyze().

23 {};

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(), GetRecoTauVFromDQM_MC_cff::obj, printdebug_, SiStripPedestals::put(), matplotRender::reader, edm::EventID::run(), findQualityFiles::run, SiStripPedestals::setData(), and digitizers_cfi::strip.

Referenced by ~SiStripPedestalsBuilder().

11  {
12 
13  unsigned int run=evt.id().run();
14 
15  edm::LogInfo("SiStripPedestalsBuilder") << "... 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(); it != DetInfos.end(); it++){
25  count++;
26  //Generate Pedestal for det detid
27  SiStripPedestals::InputVector theSiStripVector;
28  for(int strip=0; strip<128*it->second.nApvs;++strip){
29 
30  float MeanPed = 100;
31  float RmsPed = 5;
32 
33  float ped = CLHEP::RandGauss::shoot(MeanPed,RmsPed);
34 
35  if ( count<static_cast<int>(printdebug_))
36  edm::LogInfo("SiStripPedestalsBuilder") << "detid " << it->first << " \t"
37  << " strip " << strip << " \t"
38  << ped << " \t"
39  << std::endl;
40  obj->setData(ped,theSiStripVector);
41  }
42 
43  //SiStripPedestals::Range range(theSiStripVector.begin(),theSiStripVector.end());
44  if ( ! obj->put(it->first,theSiStripVector) )
45  edm::LogError("SiStripPedestalsBuilder")<<"[SiStripPedestalsBuilder::analyze] detid already exists"<<std::endl;
46  }
47 
48 
49  //End now write sistrippedestals data in DB
51 
52  if( mydbservice.isAvailable() ){
53  if ( mydbservice->isNewTagRequest("SiStripPedestalsRcd") ){
54  mydbservice->createNewIOV<SiStripPedestals>(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:39
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:46
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:60
void setData(float ped, InputVector &vped)
std::string fullPath() const
Definition: FileInPath.cc:197

Member Data Documentation

edm::FileInPath SiStripPedestalsBuilder::fp_
private

Definition at line 28 of file SiStripPedestalsBuilder.h.

Referenced by analyze().

uint32_t SiStripPedestalsBuilder::printdebug_
private

Definition at line 29 of file SiStripPedestalsBuilder.h.

Referenced by analyze().