123 uint32_t nchannels = 0;
128 <<
"... creating dummy SiPixelGainCalibration Data for Run " <<
run <<
"\n " << std::endl;
141 edm::LogInfo(
"SiPixelCondObjOfflineBuilder") <<
" There are " << pDD->dets().size() <<
" detectors" << std::endl;
143 for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) {
144 if (dynamic_cast<PixelGeomDetUnit const*>((*it)) !=
nullptr) {
145 uint32_t detid = ((*it)->geographicalId()).
rawId();
155 int nrows = topol.
nrows();
164 if (
detId.subdetId() == 2) {
173 std::vector<char> theSiPixelGainCalibration;
177 float totalGain = 0.0;
178 for (
int j = 0;
j < nrows;
j++) {
181 bool isNoisy =
false;
182 float ped = 0.0,
gain = 0.0;
186 int chipIndex = 0, colROC = 0, rowROC = 0;
188 pIndexConverter.transformToROC(
i,
j, chipIndex, colROC, rowROC);
191 std::map<int, CalParameters, std::less<int> >::const_iterator it =
calmap_.find(chanROC);
192 CalParameters theCalParameters = (*it).second;
193 ped = theCalParameters.p0;
194 gain = theCalParameters.p1;
198 double val = CLHEP::RandFlat::shoot();
205 double val = CLHEP::RandFlat::shoot();
212 if (rmsPedWork > 0) {
213 ped = CLHEP::RandGauss::shoot(meanPedWork, rmsPedWork);
214 while (ped < minped || ped > maxped)
215 ped = CLHEP::RandGauss::shoot(meanPedWork, rmsPedWork);
218 if (rmsGainWork > 0) {
219 gain = CLHEP::RandGauss::shoot(meanGainWork, rmsGainWork);
220 while (gain < mingain || gain > maxgain)
221 gain = CLHEP::RandGauss::shoot(meanGainWork, rmsGainWork);
241 else if (
gain < mingain)
246 else if (ped < minped)
252 if (!isDead && !isNoisy) {
260 if ((
j + 1) % 80 == 0)
262 float averageGain = totalGain /
static_cast<float>(80);
278 <<
"[SiPixelCondObjOfflineBuilder::analyze] detid already exists" << std::endl;
281 edm::LogPrint(
"SiPixelCondObjOfflineBuilder") <<
" ---> PIXEL Modules " << nmodules << std::endl;
282 edm::LogPrint(
"SiPixelCondObjOfflineBuilder") <<
" ---> PIXEL Channels " << nchannels << std::endl;
301 edm::LogError(
"SiPixelCondOfflineBuilder") <<
" db service unavailable";
304 edm::LogInfo(
"SiPixelCondOfflineBuilder") <<
" DB service OK";
319 edm::LogError(
"SiPixelCondObjOfflineBuilder") <<
"caught std::exception " << er.what() << std::endl;
321 edm::LogError(
"SiPixelCondObjOfflineBuilder") <<
"Funny error" << std::endl;
const int numberOfModules_
Base exception class for the object to relational access.
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const double deadFraction_
virtual int ncolumns() const =0
cond::Time_t beginOfTime() const
const double secondRocRowGainOffset_
virtual int nrows() const =0
Log< level::Error, false > LogError
std::pair< ContainerIterator, ContainerIterator > Range
const double secondRocRowPedOffset_
std::unique_ptr< SiPixelGainCalibrationOffline > SiPixelGainCalibration_
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
const double meanGainFPix_
bool isNewTagRequest(const std::string &recordName)
cond::Time_t currentTime() const
const std::string recordName_
std::map< int, CalParameters, std::less< int > > calmap_
static int pixelToChannelROC(const int rowROC, const int colROC)
const double rmsGainFPix_
Log< level::Warning, true > LogPrint
const double meanPedFPix_
Log< level::Info, false > LogInfo
const bool generateColumns_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pddToken_
const double noisyFraction_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
char const * what() const noexcept override