14 fp_(iConfig.getUntrackedParameter<
edm::FileInPath>(
"file",
edm::FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
15 printdebug_(iConfig.getUntrackedParameter<uint32_t>(
"printDebug",1)),
19 stripLengthMode_(
true),
33 std::vector<uint32_t> inputDetIds;
57 unsigned int count = 0;
58 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo > DetInfos =
reader.getAllData();
59 for(std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >::const_iterator it = DetInfos.begin(); it != DetInfos.end(); it++) {
67 uint32_t detId = it->first;
69 unsigned short nApvs = it->second.nApvs;
71 if(stripLengthMode_) {
73 double linearSlope = noiseStripLengthLinearSlope.get(sl);
74 double linearQuote = noiseStripLengthLinearQuote.get(sl);
75 double stripLength = it->second.stripLength;
76 for(
unsigned short j=0; j<nApvs; ++j ) {
80 for(
unsigned short stripId = 0; stripId < 128; ++stripId ) {
82 if( count<printDebug_ )
printLog(detId, stripId+128*j, noise);
83 obj->
setData(noise, theSiStripVector);
89 double meanN = meanNoise.get(sl);
90 double sigmaN = sigmaNoise.get(sl);
91 for(
unsigned short j=0; j<nApvs; ++j ) {
95 for(
unsigned short stripId = 0; stripId < 128; ++stripId ) {
96 noise = ( CLHEP::RandGauss::shoot(meanN, sigmaN) ) * gain;
98 if( count<printDebug_ )
printLog(detId, stripId+128*j, noise);
99 obj->
setData(noise, theSiStripVector);
105 if ( ! obj->
put(it->first,theSiStripVector) ) {
106 edm::LogError(
"SiStripNoisesFakeESSource::produce ")<<
" detid already exists"<<std::endl;
122 edm::LogError(
"SiStripNoiseNormalizedWithApvGainBuilder")<<
"Service is unavailable"<<std::endl;
std::pair< int, int > index
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
static float getApvGain(uint16_t apv, const Range &range)
std::vector< uint16_t > InputVector
SiStripNoiseNormalizedWithApvGainBuilder(const edm::ParameterSet &iConfig)
static index getIndex(const TrackerTopology *tTopo, DetId id)
void getDetIds(std::vector< uint32_t > &DetIds_) const
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
cond::Time_t beginOfTime() const
std::pair< ContainerIterator, ContainerIterator > Range
void printLog(const uint32_t detId, const unsigned short strip, const double &noise) const
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, const InputVector &input)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
cond::Time_t endOfTime() const
inputRange
Get input source.
cond::Time_t currentTime() const
std::string fullPath() const
const Range getRange(const uint32_t detID) const
T const * product() const
void setData(float noise_, InputVector &vped)