CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 SiStripPedestalsBuilder (const edm::ParameterSet &iConfig)
 
 ~SiStripPedestalsBuilder ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::FileInPath fp_
 
uint32_t printdebug_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 ( )
inline

Definition at line 23 of file SiStripPedestalsBuilder.h.

23 {};

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 11 of file SiStripPedestalsBuilder.cc.

References cond::service::PoolDBOutputService::appendSinceTime(), cond::service::PoolDBOutputService::beginOfTime(), prof2calltree::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(), matplotRender::reader, edm::EventID::run(), DTTTrigCorrFirst::run, and SiStripPedestals::setData().

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:165

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().