CMS 3D CMS Logo

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

#include <SiStripNoisesBuilder.h>

Inheritance diagram for SiStripNoisesBuilder:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

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

Detailed Description

Definition at line 15 of file SiStripNoisesBuilder.h.

Constructor & Destructor Documentation

◆ SiStripNoisesBuilder()

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

Definition at line 6 of file SiStripNoisesBuilder.cc.

8  "file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
9  printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 1)) {}

◆ ~SiStripNoisesBuilder()

SiStripNoisesBuilder::~SiStripNoisesBuilder ( )
inlineoverride

Definition at line 19 of file SiStripNoisesBuilder.h.

19 {};

Member Function Documentation

◆ analyze()

void SiStripNoisesBuilder::analyze ( const edm::Event evt,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 11 of file SiStripNoisesBuilder.cc.

11  {
12  unsigned int run = evt.id().run();
13 
14  edm::LogInfo("SiStripNoisesBuilder") << "... creating dummy SiStripNoises Data for Run " << run << "\n " << std::endl;
15 
17 
19 
20  const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>& DetInfos = reader.getAllData();
21 
22  int count = -1;
23  for (std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator it = DetInfos.begin();
24  it != DetInfos.end();
25  it++) {
26  count++;
27  //Generate Noise for det detid
28  SiStripNoises::InputVector theSiStripVector;
29  for (int strip = 0; strip < 128 * it->second.nApvs; ++strip) {
30  float MeanNoise = 5;
31  float RmsNoise = 1;
32  float noise = CLHEP::RandGauss::shoot(MeanNoise, RmsNoise);
33 
34  //double badStripProb = .5;
35  //bool disable = (CLHEP::RandFlat::shoot(1.) < badStripProb ? true:false);
36 
37  obj->setData(noise, theSiStripVector);
38  if (count < static_cast<int>(printdebug_))
39  edm::LogInfo("SiStripNoisesBuilder")
40  << "detid " << it->first << " \t"
41  << " strip " << strip << " \t" << noise << " \t" << theSiStripVector.back() / 10 << " \t" << std::endl;
42  }
43 
44  if (!obj->put(it->first, theSiStripVector))
45  edm::LogError("SiStripNoisesBuilder") << "[SiStripNoisesBuilder::analyze] detid already exists" << std::endl;
46  }
47 
48  //End now write sistripnoises data in DB
50 
51  if (mydbservice.isAvailable()) {
52  if (mydbservice->isNewTagRequest("SiStripNoisesRcd")) {
53  mydbservice->createNewIOV<SiStripNoises>(
54  obj, mydbservice->beginOfTime(), mydbservice->endOfTime(), "SiStripNoisesRcd");
55  } else {
56  //mydbservice->createNewIOV<SiStripNoises>(obj,mydbservice->currentTime(),"SiStripNoisesRcd");
57  mydbservice->appendSinceTime<SiStripNoises>(obj, mydbservice->currentTime(), "SiStripNoisesRcd");
58  }
59  } else {
60  edm::LogError("SiStripNoisesBuilder") << "Service is unavailable" << std::endl;
61  }
62 }

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(), hgcalDigitizer_cfi::noise, getGTfromDQMFile::obj, printdebug_, DQM::reader, writedatasetfile::run, edm::EventID::run(), and digitizers_cfi::strip.

Member Data Documentation

◆ fp_

edm::FileInPath SiStripNoisesBuilder::fp_
private

Definition at line 24 of file SiStripNoisesBuilder.h.

Referenced by analyze().

◆ printdebug_

uint32_t SiStripNoisesBuilder::printdebug_
private

Definition at line 25 of file SiStripNoisesBuilder.h.

Referenced by analyze().

cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:177
SiStripNoises
Definition: SiStripNoises.h:25
SiStripNoisesBuilder::printdebug_
uint32_t printdebug_
Definition: SiStripNoisesBuilder.h:25
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
edm::LogInfo
Definition: MessageLogger.h:254
cond::service::PoolDBOutputService::appendSinceTime
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
Definition: PoolDBOutputService.h:132
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
edm::FileInPath
Definition: FileInPath.h:64
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:107
DQM.reader
reader
Definition: DQM.py:105
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
SiStripNoisesBuilder::fp_
edm::FileInPath fp_
Definition: SiStripNoisesBuilder.h:24
edm::LogError
Definition: MessageLogger.h:183
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
hgcalDigitizer_cfi.noise
noise
Definition: hgcalDigitizer_cfi.py:150
edm::Service< cond::service::PoolDBOutputService >
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:175
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::EventBase::id
edm::EventID id() const
Definition: EventBase.h:59
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:90
SiStripNoises::InputVector
std::vector< uint16_t > InputVector
Definition: SiStripNoises.h:50
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:179
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163