54 #include <gsl/gsl_sf_erf.h> 56 #include "CLHEP/Random/RandGaussQ.h" 57 #include "CLHEP/Random/RandFlat.h" 58 #include "CLHEP/Random/RandGeneral.h" 116 if (use_ineff_from_db_) {
117 theSiPixelGainCalibrationService_->setESObjects(es);
119 if (use_deadmodule_DB_) {
122 if (use_LorentzAngle_DB_) {
133 quality_map = PixelFEDChannelCollectionMapHandle.product();
136 std::vector<std::string> allScenarios;
140 std::back_inserter(allScenarios),
143 std::vector<std::string> allScenariosInProb;
145 for (
auto it = m_probabilities.begin(); it != m_probabilities.end(); ++it) {
147 for (
const auto&
entry : it->second) {
149 auto probability =
entry.second;
150 if (probability != 0) {
151 if (
std::find(allScenariosInProb.begin(), allScenariosInProb.end(),
scenario) == allScenariosInProb.end()) {
152 allScenariosInProb.push_back(
scenario);
159 std::copy_if(allScenariosInProb.begin(),
160 allScenariosInProb.end(),
161 std::back_inserter(notFound),
163 return (
std::find(allScenarios.begin(), allScenarios.end(),
arg) == allScenarios.end());
166 if (!notFound.empty()) {
167 for (
const auto&
entry : notFound) {
169 <<
"The requested scenario: " <<
entry <<
" is not found in the map!!" << std::endl;
171 throw cms::Exception(
"SiPixelDigitizerAlgorithm") <<
"Found: " << notFound.size()
172 <<
" missing scenario(s) in SiPixelStatusScenariosRcd while " 173 "present in SiPixelStatusScenarioProbabilityRcd \n";
181 dbobject_den = SiPixel2DTemp_den.
product();
185 dbobject_num = SiPixel2DTemp_num.
product();
187 int numOfTemplates = dbobject_den->
numOfTempl() + dbobject_num->numOfTempl();
188 templateStores_.reserve(numOfTemplates);
202 conf.getParameter<
std::
string>(
"SiPixelQualityLabel")),
204 makeDigiSimLinks_(conf.getUntrackedParameter<
bool>(
"makeDigiSimLinks",
true)),
205 use_ineff_from_db_(conf.getParameter<
bool>(
"useDB")),
206 use_module_killing_(conf.getParameter<
bool>(
"killModules")),
207 use_deadmodule_DB_(conf.getParameter<
bool>(
"DeadModules_DB")),
208 use_LorentzAngle_DB_(conf.getParameter<
bool>(
"LorentzAngle_DB")),
211 : conf.getParameter<
Parameters>(
"DeadModules")),
213 templ2D(templateStores_),
216 IDnum(conf.exists(
"TemplateIDnumerator") ? conf.getParameter<
int>(
"TemplateIDnumerator") : 0),
217 IDden(conf.exists(
"TemplateIDdenominator") ? conf.getParameter<
int>(
"TemplateIDdenominator") : 0),
221 GeVperElectron(3.61E-09),
224 alpha2Order(conf.getParameter<
bool>(
"Alpha2Order")),
230 NumberOfBarrelLayers(conf.exists(
"NumPixelBarrel") ? conf.getParameter<
int>(
"NumPixelBarrel") : 3),
238 theElectronPerADC(conf.getParameter<double>(
"ElectronPerAdc")),
242 theAdcFullScale(conf.getParameter<
int>(
"AdcFullScale")),
246 theNoiseInElectrons(conf.getParameter<double>(
"NoiseInElectrons")),
250 theReadoutNoise(conf.getParameter<double>(
"ReadoutNoiseInElec")),
255 theThresholdInE_FPix(conf.getParameter<double>(
"ThresholdInElectrons_FPix")),
256 theThresholdInE_BPix(conf.getParameter<double>(
"ThresholdInElectrons_BPix")),
257 theThresholdInE_BPix_L1(conf.exists(
"ThresholdInElectrons_BPix_L1")
258 ? conf.getParameter<double>(
"ThresholdInElectrons_BPix_L1")
259 : theThresholdInE_BPix),
260 theThresholdInE_BPix_L2(conf.exists(
"ThresholdInElectrons_BPix_L2")
261 ? conf.getParameter<double>(
"ThresholdInElectrons_BPix_L2")
262 : theThresholdInE_BPix),
265 theThresholdSmearing_FPix(conf.getParameter<double>(
"ThresholdSmearing_FPix")),
266 theThresholdSmearing_BPix(conf.getParameter<double>(
"ThresholdSmearing_BPix")),
267 theThresholdSmearing_BPix_L1(conf.exists(
"ThresholdSmearing_BPix_L1")
268 ? conf.getParameter<double>(
"ThresholdSmearing_BPix_L1")
269 : theThresholdSmearing_BPix),
270 theThresholdSmearing_BPix_L2(conf.exists(
"ThresholdSmearing_BPix_L2")
271 ? conf.getParameter<double>(
"ThresholdSmearing_BPix_L2")
272 : theThresholdSmearing_BPix),
275 electronsPerVCAL(conf.getParameter<double>(
"ElectronsPerVcal")),
276 electronsPerVCAL_Offset(conf.getParameter<double>(
"ElectronsPerVcal_Offset")),
277 electronsPerVCAL_L1(conf.exists(
"ElectronsPerVcal_L1") ? conf.getParameter<double>(
"ElectronsPerVcal_L1")
279 electronsPerVCAL_L1_Offset(conf.exists(
"ElectronsPerVcal_L1_Offset")
280 ? conf.getParameter<double>(
"ElectronsPerVcal_L1_Offset")
281 : electronsPerVCAL_Offset),
285 theTofLowerCut(conf.getParameter<double>(
"TofLowerCut")),
286 theTofUpperCut(conf.getParameter<double>(
"TofUpperCut")),
289 tanLorentzAnglePerTesla_FPix(use_LorentzAngle_DB_ ? 0.0
290 : conf.getParameter<double>(
"TanLorentzAnglePerTesla_FPix")),
291 tanLorentzAnglePerTesla_BPix(use_LorentzAngle_DB_ ? 0.0
292 : conf.getParameter<double>(
"TanLorentzAnglePerTesla_BPix")),
295 FPix_p0(conf.getParameter<double>(
"FPix_SignalResponse_p0")),
296 FPix_p1(conf.getParameter<double>(
"FPix_SignalResponse_p1")),
297 FPix_p2(conf.getParameter<double>(
"FPix_SignalResponse_p2")),
298 FPix_p3(conf.getParameter<double>(
"FPix_SignalResponse_p3")),
300 BPix_p0(conf.getParameter<double>(
"BPix_SignalResponse_p0")),
301 BPix_p1(conf.getParameter<double>(
"BPix_SignalResponse_p1")),
302 BPix_p2(conf.getParameter<double>(
"BPix_SignalResponse_p2")),
303 BPix_p3(conf.getParameter<double>(
"BPix_SignalResponse_p3")),
306 addNoise(conf.getParameter<
bool>(
"AddNoise")),
310 addChargeVCALSmearing(conf.getParameter<
bool>(
"ChargeVCALSmearing")),
313 addNoisyPixels(conf.getParameter<
bool>(
"AddNoisyPixels")),
316 fluctuateCharge(conf.getUntrackedParameter<
bool>(
"FluctuateCharge",
true)),
323 addThresholdSmearing(conf.getParameter<
bool>(
"AddThresholdSmearing")),
326 doMissCalibrate(conf.getParameter<
bool>(
"MissCalibrate")),
327 theGainSmearing(conf.getParameter<double>(
"GainSmearing")),
328 theOffsetSmearing(conf.getParameter<double>(
"OffsetSmearing")),
331 AddPixelAging(conf.getParameter<
bool>(
"DoPixelAging")),
339 tMax(conf.getParameter<double>(
"deltaProductionCut")),
348 LogInfo(
"PixelDigitizer ") <<
"SiPixelDigitizerAlgorithm constructed" 349 <<
"Configuration parameters:" 350 <<
"Threshold/Gain = " 364 std::map<int, SiPixelDigitizerAlgorithm::CalParameters, std::less<int> >
calmap;
366 LogDebug(
"PixelDigitizer ") <<
" miss-calibrate the pixel amplitude ";
368 const bool ReadCalParameters =
false;
369 if (ReadCalParameters) {
371 std::ifstream in_file;
372 char filename[80] =
"phCalibrationFit_C0.dat";
376 cout <<
" File not found " << endl;
379 cout <<
" file opened : " << filename << endl;
382 for (
int i = 0;
i < 3;
i++) {
383 in_file.getline(line, 500,
'\n');
384 cout << line << endl;
387 cout <<
" test map" << endl;
393 for (
int i = 0;
i < (52 * 80);
i++) {
394 in_file >> par0 >> par1 >> par2 >> par3 >> name >> colid >> rowid;
396 cerr <<
"Cannot read data file" << endl;
399 if (in_file.eof() != 0) {
400 cerr << in_file.eof() <<
" " << in_file.gcount() <<
" " << in_file.fail() <<
" " << in_file.good()
401 <<
" end of file " << endl;
416 calmap.insert(std::pair<int, CalParameters>(chan, onePix));
420 if (rowid != p.first)
421 cout <<
" wrong channel row " << rowid <<
" " << p.first << endl;
422 if (colid != p.second)
423 cout <<
" wrong channel col " << colid <<
" " << p.second << endl;
427 cout <<
" map size " << calmap.size() <<
" max " << calmap.max_size() <<
" " << calmap.empty() << endl;
450 LogDebug(
"PixelDigitizer") <<
"SiPixelDigitizerAlgorithm deleted";
462 if (AddPixelInefficiency) {
463 FromConfig = conf.
exists(
"thePixelColEfficiency_BPix1") && conf.
exists(
"thePixelColEfficiency_BPix2") &&
464 conf.
exists(
"thePixelColEfficiency_BPix3") && conf.
exists(
"thePixelColEfficiency_FPix1") &&
465 conf.
exists(
"thePixelColEfficiency_FPix2") && conf.
exists(
"thePixelEfficiency_BPix1") &&
466 conf.
exists(
"thePixelEfficiency_BPix2") && conf.
exists(
"thePixelEfficiency_BPix3") &&
467 conf.
exists(
"thePixelEfficiency_FPix1") && conf.
exists(
"thePixelEfficiency_FPix2") &&
468 conf.
exists(
"thePixelChipEfficiency_BPix1") && conf.
exists(
"thePixelChipEfficiency_BPix2") &&
469 conf.
exists(
"thePixelChipEfficiency_BPix3") && conf.
exists(
"thePixelChipEfficiency_FPix1") &&
470 conf.
exists(
"thePixelChipEfficiency_FPix2");
471 if (NumberOfBarrelLayers == 3)
472 FromConfig = FromConfig && conf.
exists(
"theLadderEfficiency_BPix1") && conf.
exists(
"theLadderEfficiency_BPix2") &&
473 conf.
exists(
"theLadderEfficiency_BPix3") && conf.
exists(
"theModuleEfficiency_BPix1") &&
474 conf.
exists(
"theModuleEfficiency_BPix2") && conf.
exists(
"theModuleEfficiency_BPix3") &&
475 conf.
exists(
"thePUEfficiency_BPix1") && conf.
exists(
"thePUEfficiency_BPix2") &&
476 conf.
exists(
"thePUEfficiency_BPix3") && conf.
exists(
"theInnerEfficiency_FPix1") &&
477 conf.
exists(
"theInnerEfficiency_FPix2") && conf.
exists(
"theOuterEfficiency_FPix1") &&
478 conf.
exists(
"theOuterEfficiency_FPix2") && conf.
exists(
"thePUEfficiency_FPix_Inner") &&
479 conf.
exists(
"thePUEfficiency_FPix_Outer") && conf.
exists(
"theInstLumiScaleFactor");
480 if (NumberOfBarrelLayers >= 4)
481 FromConfig = FromConfig && conf.
exists(
"thePixelColEfficiency_BPix4") &&
482 conf.
exists(
"thePixelEfficiency_BPix4") && conf.
exists(
"thePixelChipEfficiency_BPix4");
483 if (NumberOfEndcapDisks >= 3)
484 FromConfig = FromConfig && conf.
exists(
"thePixelColEfficiency_FPix4") &&
485 conf.
exists(
"thePixelEfficiency_FPix3") && conf.
exists(
"thePixelChipEfficiency_FPix3");
487 LogInfo(
"PixelDigitizer ") <<
"The PixelDigitizer inefficiency configuration is read from the config file.\n";
488 theInstLumiScaleFactor = conf.
getParameter<
double>(
"theInstLumiScaleFactor");
490 thePixelColEfficiency[i++] = conf.
getParameter<
double>(
"thePixelColEfficiency_BPix1");
491 thePixelColEfficiency[i++] = conf.
getParameter<
double>(
"thePixelColEfficiency_BPix2");
492 thePixelColEfficiency[i++] = conf.
getParameter<
double>(
"thePixelColEfficiency_BPix3");
493 if (NumberOfBarrelLayers >= 4) {
494 thePixelColEfficiency[i++] = conf.
getParameter<
double>(
"thePixelColEfficiency_BPix4");
498 thePixelEfficiency[i++] = conf.
getParameter<
double>(
"thePixelEfficiency_BPix1");
499 thePixelEfficiency[i++] = conf.
getParameter<
double>(
"thePixelEfficiency_BPix2");
500 thePixelEfficiency[i++] = conf.
getParameter<
double>(
"thePixelEfficiency_BPix3");
501 if (NumberOfBarrelLayers >= 4) {
502 thePixelEfficiency[i++] = conf.
getParameter<
double>(
"thePixelEfficiency_BPix4");
506 thePixelChipEfficiency[i++] = conf.
getParameter<
double>(
"thePixelChipEfficiency_BPix1");
507 thePixelChipEfficiency[i++] = conf.
getParameter<
double>(
"thePixelChipEfficiency_BPix2");
508 thePixelChipEfficiency[i++] = conf.
getParameter<
double>(
"thePixelChipEfficiency_BPix3");
509 if (NumberOfBarrelLayers >= 4) {
510 thePixelChipEfficiency[i++] = conf.
getParameter<
double>(
"thePixelChipEfficiency_BPix4");
513 if (NumberOfBarrelLayers == 3) {
515 theLadderEfficiency_BPix[i++] = conf.
getParameter<std::vector<double> >(
"theLadderEfficiency_BPix1");
516 theLadderEfficiency_BPix[i++] = conf.
getParameter<std::vector<double> >(
"theLadderEfficiency_BPix2");
517 theLadderEfficiency_BPix[i++] = conf.
getParameter<std::vector<double> >(
"theLadderEfficiency_BPix3");
518 if (((theLadderEfficiency_BPix[0].
size() != 20) || (theLadderEfficiency_BPix[1].
size() != 32) ||
519 (theLadderEfficiency_BPix[2].
size() != 44)) &&
520 (NumberOfBarrelLayers == 3))
521 throw cms::Exception(
"Configuration") <<
"Wrong ladder number in efficiency config!";
524 theModuleEfficiency_BPix[i++] = conf.
getParameter<std::vector<double> >(
"theModuleEfficiency_BPix1");
525 theModuleEfficiency_BPix[i++] = conf.
getParameter<std::vector<double> >(
"theModuleEfficiency_BPix2");
526 theModuleEfficiency_BPix[i++] = conf.
getParameter<std::vector<double> >(
"theModuleEfficiency_BPix3");
527 if (((theModuleEfficiency_BPix[0].
size() != 4) || (theModuleEfficiency_BPix[1].
size() != 4) ||
528 (theModuleEfficiency_BPix[2].
size() != 4)) &&
529 (NumberOfBarrelLayers == 3))
530 throw cms::Exception(
"Configuration") <<
"Wrong module number in efficiency config!";
532 thePUEfficiency.push_back(conf.
getParameter<std::vector<double> >(
"thePUEfficiency_BPix1"));
533 thePUEfficiency.push_back(conf.
getParameter<std::vector<double> >(
"thePUEfficiency_BPix2"));
534 thePUEfficiency.push_back(conf.
getParameter<std::vector<double> >(
"thePUEfficiency_BPix3"));
535 if (((thePUEfficiency[0].
empty()) || (thePUEfficiency[1].
empty()) || (thePUEfficiency[2].
empty())) &&
536 (NumberOfBarrelLayers == 3))
538 <<
"At least one PU efficiency (BPix) number is needed in efficiency config!";
541 if (NumberOfBarrelLayers >= 5) {
542 if (NumberOfTotLayers > 20) {
543 throw cms::Exception(
"Configuration") <<
"SiPixelDigitizer was given more layers than it can handle";
547 thePixelColEfficiency[
j - 1] = 0.999;
548 thePixelEfficiency[
j - 1] = 0.999;
549 thePixelChipEfficiency[
j - 1] = 0.999;
554 thePixelColEfficiency[i++] = conf.
getParameter<
double>(
"thePixelColEfficiency_FPix1");
555 thePixelColEfficiency[i++] = conf.
getParameter<
double>(
"thePixelColEfficiency_FPix2");
556 if (NumberOfEndcapDisks >= 3) {
557 thePixelColEfficiency[i++] = conf.
getParameter<
double>(
"thePixelColEfficiency_FPix3");
560 thePixelEfficiency[i++] = conf.
getParameter<
double>(
"thePixelEfficiency_FPix1");
561 thePixelEfficiency[i++] = conf.
getParameter<
double>(
"thePixelEfficiency_FPix2");
562 if (NumberOfEndcapDisks >= 3) {
563 thePixelEfficiency[i++] = conf.
getParameter<
double>(
"thePixelEfficiency_FPix3");
566 thePixelChipEfficiency[i++] = conf.
getParameter<
double>(
"thePixelChipEfficiency_FPix1");
567 thePixelChipEfficiency[i++] = conf.
getParameter<
double>(
"thePixelChipEfficiency_FPix2");
568 if (NumberOfEndcapDisks >= 3) {
569 thePixelChipEfficiency[i++] = conf.
getParameter<
double>(
"thePixelChipEfficiency_FPix3");
572 if (NumberOfEndcapDisks >= 4) {
573 if (NumberOfTotLayers > 20) {
574 throw cms::Exception(
"Configuration") <<
"SiPixelDigitizer was given more layers than it can handle";
578 thePixelColEfficiency[
j - 1] = 0.999;
579 thePixelEfficiency[
j - 1] = 0.999;
580 thePixelChipEfficiency[
j - 1] = 0.999;
584 if (NumberOfBarrelLayers == 3) {
586 theInnerEfficiency_FPix[i++] = conf.
getParameter<
double>(
"theInnerEfficiency_FPix1");
587 theInnerEfficiency_FPix[i++] = conf.
getParameter<
double>(
"theInnerEfficiency_FPix2");
589 theOuterEfficiency_FPix[i++] = conf.
getParameter<
double>(
"theOuterEfficiency_FPix1");
590 theOuterEfficiency_FPix[i++] = conf.
getParameter<
double>(
"theOuterEfficiency_FPix2");
591 thePUEfficiency.push_back(conf.
getParameter<std::vector<double> >(
"thePUEfficiency_FPix_Inner"));
592 thePUEfficiency.push_back(conf.
getParameter<std::vector<double> >(
"thePUEfficiency_FPix_Outer"));
593 if (((thePUEfficiency[3].
empty()) || (thePUEfficiency[4].
empty())) && (NumberOfEndcapDisks == 2))
595 <<
"At least one (FPix) PU efficiency number is needed in efficiency config!";
596 pu_scale.resize(thePUEfficiency.size());
599 LogInfo(
"PixelDigitizer ") <<
"The PixelDigitizer inefficiency configuration is read from the database.\n";
608 if (bunchspace == 50)
620 const std::map<uint32_t, double>& PixelGeomFactorsDBIn = SiPixelDynamicInefficiency->
getPixelGeomFactors();
621 const std::map<uint32_t, double>& ColGeomFactorsDB = SiPixelDynamicInefficiency->
getColGeomFactors();
622 const std::map<uint32_t, double>& ChipGeomFactorsDB = SiPixelDynamicInefficiency->
getChipGeomFactors();
623 const std::map<uint32_t, std::vector<double> >& PUFactors = SiPixelDynamicInefficiency->
getPUFactors();
624 std::vector<uint32_t> DetIdmasks = SiPixelDynamicInefficiency->
getDetIdmasks();
627 for (
const auto& it_module : geom->
detUnits()) {
628 if (dynamic_cast<PixelGeomDetUnit const*>(it_module) ==
nullptr)
630 const DetId detid = it_module->geographicalId();
631 uint32_t rawid = detid.
rawId();
632 PixelGeomFactors[rawid] = 1;
633 ColGeomFactors[rawid] = 1;
634 ChipGeomFactors[rawid] = 1;
635 PixelGeomFactorsROCStdPixels[rawid] = std::vector<double>(16, 1);
636 PixelGeomFactorsROCBigPixels[rawid] = std::vector<double>(16, 1);
640 std::map<uint32_t, double> PixelGeomFactorsDB;
643 for (
auto db_factor : PixelGeomFactorsDBIn) {
646 unsigned int rocMask = rocIdMaskBits <<
shift;
647 unsigned int rocId = (((db_factor.first) & rocMask) >>
shift);
650 unsigned int rawid = db_factor.first & (~rocMask);
655 double factor = db_factor.second;
656 double badFraction = 1 -
factor;
657 double bigPixelFraction =
static_cast<double>(nBigPixelsInROC) / nPixelsInROC;
658 double stdPixelFraction = 1. - bigPixelFraction;
660 double badFractionBig =
std::min(bigPixelFraction, badFraction);
661 double badFractionStd =
std::max(0., badFraction - badFractionBig);
662 double badFractionBigReNormalized = badFractionBig / bigPixelFraction;
663 double badFractionStdReNormalized = badFractionStd / stdPixelFraction;
664 PixelGeomFactorsROCStdPixels[rawid][rocId] *= (1. - badFractionStdReNormalized);
665 PixelGeomFactorsROCBigPixels[rawid][rocId] *= (1. - badFractionBigReNormalized);
667 PixelGeomFactorsDB[db_factor.first] = db_factor.second;
672 PixelGeomFactorsDB = PixelGeomFactorsDBIn;
676 for (
const auto& it_module : geom->
detUnits()) {
677 if (dynamic_cast<PixelGeomDetUnit const*>(it_module) ==
nullptr)
679 const DetId detid = it_module->geographicalId();
680 uint32_t rawid = detid.
rawId();
681 for (
auto db_factor : PixelGeomFactorsDB)
683 PixelGeomFactors[rawid] *= db_factor.second;
684 for (
auto db_factor : ColGeomFactorsDB)
686 ColGeomFactors[rawid] *= db_factor.second;
687 for (
auto db_factor : ChipGeomFactorsDB)
689 ChipGeomFactors[rawid] *= db_factor.second;
695 for (
auto factor : PUFactors) {
697 for (
const auto& it_module : geom->
detUnits()) {
698 if (dynamic_cast<PixelGeomDetUnit const*>(it_module) ==
nullptr)
700 const DetId detid = it_module->geographicalId();
701 if (!
matches(detid, db_id, DetIdmasks))
703 if (iPU.count(detid.
rawId())) {
705 <<
"Multiple db_ids match to same module in SiPixelDynamicInefficiency DB Object";
710 thePUEfficiency.push_back(
factor.second);
713 pu_scale.resize(thePUEfficiency.size());
718 const std::vector<uint32_t>& DetIdmasks) {
721 for (
size_t i = 0;
i < DetIdmasks.size(); ++
i) {
743 thePixelPseudoRadDamage[i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_BPix1");
744 thePixelPseudoRadDamage[i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_BPix2");
745 thePixelPseudoRadDamage[i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_BPix3");
746 thePixelPseudoRadDamage[i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_BPix4");
749 if (NumberOfBarrelLayers >= 5) {
750 if (NumberOfTotLayers > 20) {
751 throw cms::Exception(
"Configuration") <<
"SiPixelDigitizer was given more layers than it can handle";
755 thePixelPseudoRadDamage[
j - 1] = 0.;
760 thePixelPseudoRadDamage[i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_FPix1");
761 thePixelPseudoRadDamage[i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_FPix2");
762 thePixelPseudoRadDamage[i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_FPix3");
765 if (NumberOfEndcapDisks >= 4) {
766 if (NumberOfTotLayers > 20) {
767 throw cms::Exception(
"Configuration") <<
"SiPixelDigitizer was given more layers than it can handle";
771 thePixelPseudoRadDamage[
j - 1] = 0.;
781 std::vector<PSimHit>::const_iterator inputEnd,
782 const size_t inputBeginGlobalIndex,
783 const unsigned int tofBin,
787 CLHEP::HepRandomEngine* engine) {
792 size_t simHitGlobalIndex = inputBeginGlobalIndex;
793 for (std::vector<PSimHit>::const_iterator ssbegin = inputBegin; ssbegin != inputEnd; ++ssbegin, ++simHitGlobalIndex) {
795 if ((*ssbegin).detUnitId() != detId) {
800 LogDebug(
"Pixel Digitizer") << (*ssbegin).particleType() <<
" " << (*ssbegin).pabs() <<
" " 801 << (*ssbegin).energyLoss() <<
" " << (*ssbegin).tof() <<
" " << (*ssbegin).trackId()
802 <<
" " << (*ssbegin).processType() <<
" " << (*ssbegin).detUnitId()
803 << (*ssbegin).entryPoint() <<
" " << (*ssbegin).exitPoint();
806 std::vector<EnergyDepositUnit> ionization_points;
807 std::vector<SignalPoint> collection_points;
842 std::vector<int>::const_iterator
pu;
843 std::vector<int>::const_iterator pu0 = bunchCrossing.end();
845 for (pu = bunchCrossing.begin(); pu != bunchCrossing.end(); ++
pu) {
852 if (pu0 != bunchCrossing.end()) {
855 double instlumi_pow = 1.;
859 instlumi_pow *= instlumi;
873 for (
unsigned int i = 0;
i < ps.size();
i++)
874 if (ps[
i].getBunchCrossing() == 0)
880 double instlumi_pow = 1.;
884 instlumi_pow *= instlumi;
899 const std::vector<PileupSummaryInfo>& ps, CLHEP::HepRandomEngine* engine) {
900 std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ =
nullptr;
903 std::vector<int> bunchCrossing;
904 std::vector<float> TrueInteractionList;
906 for (
unsigned int i = 0;
i < ps.size();
i++) {
907 bunchCrossing.push_back(ps[
i].getBunchCrossing());
908 TrueInteractionList.push_back(ps[
i].getTrueNumInteractions());
912 std::vector<int>::const_iterator
pu;
913 std::vector<int>::const_iterator pu0 = bunchCrossing.end();
915 for (pu = bunchCrossing.begin(); pu != bunchCrossing.end(); ++
pu) {
923 if (pu0 != bunchCrossing.end()) {
924 unsigned int PUBin = TrueInteractionList.at(
p);
926 std::vector<double> probabilities;
927 probabilities.reserve(theProbabilitiesPerScenario.size());
928 for (
auto it = theProbabilitiesPerScenario.begin(); it != theProbabilitiesPerScenario.end(); it++) {
929 probabilities.push_back(it->second);
932 CLHEP::RandGeneral randGeneral(*engine, &(probabilities.front()), probabilities.size());
933 double x = randGeneral.shoot();
934 unsigned int index = x * probabilities.size() - 1;
937 PixelFEDChannelCollection_ = std::make_unique<PixelFEDChannelCollection>(
quality_map->at(scenario));
939 std::make_unique<PixelFEDChannelCollection>(
quality_map->at(scenario));
942 return PixelFEDChannelCollection_;
946 CLHEP::HepRandomEngine* engine) {
949 std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ =
nullptr;
956 std::vector<int>::const_iterator
pu;
957 std::vector<int>::const_iterator pu0 = bunchCrossing.end();
959 for (pu = bunchCrossing.begin(); pu != bunchCrossing.end(); ++
pu) {
967 if (pu0 != bunchCrossing.end()) {
968 unsigned int PUBin = TrueInteractionList.at(
p);
970 std::vector<double> probabilities;
971 probabilities.reserve(theProbabilitiesPerScenario.size());
972 for (
auto it = theProbabilitiesPerScenario.begin(); it != theProbabilitiesPerScenario.end(); it++) {
973 probabilities.push_back(it->second);
976 CLHEP::RandGeneral randGeneral(*engine, &(probabilities.front()), probabilities.size());
977 double x = randGeneral.shoot();
978 unsigned int index = x * probabilities.size() - 1;
981 PixelFEDChannelCollection_ = std::make_unique<PixelFEDChannelCollection>(
quality_map->at(scenario));
983 std::make_unique<PixelFEDChannelCollection>(
quality_map->at(scenario));
986 return PixelFEDChannelCollection_;
991 for (
const auto& det : signalMap) {
992 auto& theSignal =
_signal[det.first];
993 for (
const auto&
chan : det.second) {
994 theSignal[
chan.first].set(
chan.second *
1002 std::vector<PixelDigi>& digis,
1003 std::vector<PixelDigiSimLink>& simlinks,
1005 CLHEP::HepRandomEngine* engine) {
1017 float thePixelThresholdInE = 0.;
1021 int lay = tTopo->
layer(detID);
1026 thePixelThresholdInE = CLHEP::RandGaussQ::shoot(
1028 }
else if (lay == 2) {
1029 thePixelThresholdInE = CLHEP::RandGaussQ::shoot(
1032 thePixelThresholdInE =
1041 }
else if (lay == 2) {
1050 thePixelThresholdInE =
1056 throw cms::Exception(
"NotAPixelGeomDetUnit") <<
"Not a pixel geomdet unit" << detID;
1062 int numColumns = topol->
ncolumns();
1063 int numRows = topol->
nrows();
1066 LogDebug(
"PixelDigitizer") <<
" PixelDigitizer " << numColumns <<
" " << numRows <<
" " << moduleThickness;
1088 make_digis(thePixelThresholdInE, detID, pixdet, digis, simlinks, tTopo);
1091 LogDebug(
"PixelDigitizer") <<
"[SiPixelDigitizerAlgorithm] converted " << digis.size() <<
" PixelDigis in DetUnit" 1100 std::vector<EnergyDepositUnit>& ionization_points,
1101 CLHEP::HepRandomEngine* engine)
const {
1104 const float SegmentLength = 0.0010;
1111 float length = direction.
mag();
1113 int NumberOfSegments =
int(length / SegmentLength);
1114 if (NumberOfSegments < 1)
1115 NumberOfSegments = 1;
1118 LogDebug(
"Pixel Digitizer") <<
" enter primary_ionzation " << NumberOfSegments
1125 float* elossVector =
new float[NumberOfSegments];
1132 float momentum = hit.
pabs();
1134 fluctuateEloss(pid, momentum, eLoss, length, NumberOfSegments, elossVector, engine);
1137 ionization_points.resize(NumberOfSegments);
1140 for (
int i = 0;
i != NumberOfSegments;
i++) {
1150 ionization_points[
i] = edu;
1153 LogDebug(
"Pixel Digitizer") <<
i <<
" " << ionization_points[
i].x() <<
" " << ionization_points[
i].y() <<
" " 1154 << ionization_points[
i].z() <<
" " << ionization_points[
i].energy();
1159 delete[] elossVector;
1166 float particleMomentum,
1170 float elossVector[],
1171 CLHEP::HepRandomEngine* engine)
const {
1177 double particleMass = 139.6;
1181 particleMass = 0.511;
1183 particleMass = 105.7;
1184 else if (pid == 321)
1185 particleMass = 493.7;
1186 else if (pid == 2212)
1187 particleMass = 938.3;
1190 float segmentLength = length / NumberOfSegs;
1195 double segmentEloss = (1000. * eloss) / NumberOfSegs;
1196 for (
int i = 0;
i < NumberOfSegs;
i++) {
1202 double deltaCutoff =
tMax;
1203 de =
fluctuate->SampleFluctuations(
double(particleMomentum * 1000.),
1206 double(segmentLength * 10.),
1210 elossVector[
i] = de;
1216 float ratio = eloss / sum;
1218 for (
int ii = 0;
ii < NumberOfSegs;
ii++)
1219 elossVector[
ii] = ratio * elossVector[
ii];
1221 float averageEloss = eloss / NumberOfSegs;
1222 for (
int ii = 0;
ii < NumberOfSegs;
ii++)
1223 elossVector[
ii] = averageEloss;
1235 const std::vector<EnergyDepositUnit>& ionization_points,
1236 std::vector<SignalPoint>& collection_points)
const {
1238 LogDebug(
"Pixel Digitizer") <<
" enter drift ";
1241 collection_points.resize(ionization_points.size());
1244 if (driftDir.
z() == 0.) {
1245 LogWarning(
"Magnetic field") <<
" pxlx: drift in z is zero ";
1253 float TanLorenzAngleX, TanLorenzAngleY, dir_z, CosLorenzAngleX, CosLorenzAngleY;
1255 TanLorenzAngleX = driftDir.
x();
1256 TanLorenzAngleY = driftDir.
y();
1257 dir_z = driftDir.
z();
1258 CosLorenzAngleX = 1. /
sqrt(1. + TanLorenzAngleX * TanLorenzAngleX);
1259 CosLorenzAngleY = 1. /
sqrt(1. + TanLorenzAngleY * TanLorenzAngleY);
1262 TanLorenzAngleX = driftDir.
x();
1263 TanLorenzAngleY = 0.;
1264 dir_z = driftDir.
z();
1265 CosLorenzAngleX = 1. /
sqrt(1. + TanLorenzAngleX * TanLorenzAngleX);
1266 CosLorenzAngleY = 1.;
1271 LogDebug(
"Pixel Digitizer") <<
" Lorentz Tan " << TanLorenzAngleX <<
" " << TanLorenzAngleY <<
" " << CosLorenzAngleX
1272 <<
" " << CosLorenzAngleY <<
" " << moduleThickness * TanLorenzAngleX <<
" " << driftDir;
1277 float DriftDistance;
1281 for (
unsigned int i = 0;
i != ionization_points.size();
i++) {
1282 float SegX, SegY, SegZ;
1283 SegX = ionization_points[
i].
x();
1284 SegY = ionization_points[
i].y();
1285 SegZ = ionization_points[
i].z();
1290 DriftDistance = moduleThickness / 2. - (dir_z * SegZ);
1300 if (DriftDistance < 0.) {
1302 }
else if (DriftDistance > moduleThickness)
1303 DriftDistance = moduleThickness;
1306 float XDriftDueToMagField = DriftDistance * TanLorenzAngleX;
1307 float YDriftDueToMagField = DriftDistance * TanLorenzAngleY;
1310 float CloudCenterX = SegX + XDriftDueToMagField;
1311 float CloudCenterY = SegY + YDriftDueToMagField;
1314 DriftLength =
sqrt(DriftDistance * DriftDistance + XDriftDueToMagField * XDriftDueToMagField +
1315 YDriftDueToMagField * YDriftDueToMagField);
1321 Sigma_x = Sigma / CosLorenzAngleX;
1322 Sigma_y = Sigma / CosLorenzAngleY;
1325 float energyOnCollector = ionization_points[
i].energy();
1330 energyOnCollector *=
exp(-1 * kValue * DriftDistance / moduleThickness);
1334 LogDebug(
"Pixel Digitizer") <<
" Dift DistanceZ= " << DriftDistance <<
" module thickness= " << moduleThickness
1335 <<
" Start Energy= " << ionization_points[
i].energy()
1336 <<
" Energy after loss= " << energyOnCollector;
1338 SignalPoint sp(CloudCenterX, CloudCenterY, Sigma_x, Sigma_y, hit.
tof(), energyOnCollector);
1341 collection_points[
i] = (sp);
1350 std::vector<PSimHit>::const_iterator inputEnd,
1352 const size_t hitIndex,
1353 const unsigned int tofBin,
1355 const std::vector<SignalPoint>& collection_points) {
1364 LogDebug(
"Pixel Digitizer") <<
" enter induce_signal, " << topol->
pitch().first <<
" " << topol->
pitch().second;
1368 typedef std::map<int, float, std::less<int> > hit_map_type;
1369 hit_map_type hit_signal;
1372 std::map<int, float, std::less<int> >
x,
y;
1377 for (std::vector<SignalPoint>::const_iterator
i = collection_points.begin();
i != collection_points.end(); ++
i) {
1378 float CloudCenterX =
i->position().x();
1379 float CloudCenterY =
i->position().y();
1382 float Charge =
i->amplitude();
1391 LogDebug(
"Pixel Digitizer") <<
" cloud " <<
i->position().x() <<
" " <<
i->position().y() <<
" " <<
i->sigma_x()
1392 <<
" " <<
i->sigma_y() <<
" " <<
i->amplitude();
1415 int IPixRightUpX =
int(floor(mp.
x()));
1416 int IPixRightUpY =
int(floor(mp.
y()));
1419 LogDebug(
"Pixel Digitizer") <<
" right-up " << PointRightUp <<
" " << mp.
x() <<
" " << mp.
y() <<
" " << IPixRightUpX
1420 <<
" " << IPixRightUpY;
1425 int IPixLeftDownX =
int(floor(mp.
x()));
1426 int IPixLeftDownY =
int(floor(mp.
y()));
1429 LogDebug(
"Pixel Digitizer") <<
" left-down " << PointLeftDown <<
" " << mp.
x() <<
" " << mp.
y() <<
" " 1430 << IPixLeftDownX <<
" " << IPixLeftDownY;
1434 int numColumns = topol->
ncolumns();
1435 int numRows = topol->
nrows();
1437 IPixRightUpX = numRows > IPixRightUpX ? IPixRightUpX : numRows - 1;
1438 IPixRightUpY = numColumns > IPixRightUpY ? IPixRightUpY : numColumns - 1;
1439 IPixLeftDownX = 0 < IPixLeftDownX ? IPixLeftDownX : 0;
1440 IPixLeftDownY = 0 < IPixLeftDownY ? IPixLeftDownY : 0;
1447 for (ix = IPixLeftDownX; ix <= IPixRightUpX; ix++) {
1448 float xUB, xLB, UpperBound, LowerBound;
1453 if (ix == 0 || SigmaX == 0.)
1458 LowerBound = 1 -
calcQ((xLB - CloudCenterX) / SigmaX);
1461 if (ix == numRows - 1 || SigmaX == 0.)
1466 UpperBound = 1. -
calcQ((xUB - CloudCenterX) / SigmaX);
1469 float TotalIntegrationRange = UpperBound - LowerBound;
1470 x[ix] = TotalIntegrationRange;
1477 for (iy = IPixLeftDownY; iy <= IPixRightUpY; iy++) {
1478 float yUB, yLB, UpperBound, LowerBound;
1480 if (iy == 0 || SigmaY == 0.)
1485 LowerBound = 1. -
calcQ((yLB - CloudCenterY) / SigmaY);
1488 if (iy == numColumns - 1 || SigmaY == 0.)
1493 UpperBound = 1. -
calcQ((yUB - CloudCenterY) / SigmaY);
1496 float TotalIntegrationRange = UpperBound - LowerBound;
1497 y[iy] = TotalIntegrationRange;
1504 for (ix = IPixLeftDownX; ix <= IPixRightUpX; ix++) {
1505 for (iy = IPixLeftDownY; iy <= IPixRightUpY; iy++) {
1507 float ChargeFraction = Charge * x[ix] * y[iy];
1509 if (ChargeFraction > 0.) {
1512 hit_signal[
chan] += ChargeFraction;
1519 LogDebug(
"Pixel Digitizer") <<
" pixel " << ix <<
" " << iy <<
" - " 1520 <<
" " << chan <<
" " << ChargeFraction <<
" " << mp.
x() <<
" " << mp.
y() <<
" " 1521 << lp.
x() <<
" " << lp.
y() <<
" " 1532 bool reweighted =
false;
1543 for (hit_map_type::const_iterator im = hit_signal.begin(); im != hit_signal.end(); ++im) {
1544 int chan = (*im).first;
1546 :
Amplitude((*im).second, (*im).second));
1550 LogDebug(
"Pixel Digitizer") <<
" pixel " << ip.first <<
" " << ip.second <<
" " << theSignal[
chan];
1563 std::vector<PixelDigi>& digis,
1564 std::vector<PixelDigiSimLink>& simlinks,
1567 LogDebug(
"Pixel Digitizer") <<
" make digis " 1573 <<
" List pixels passing threshold ";
1578 signalMaps::const_iterator it =
_signal.find(detID);
1587 std::map<TrackEventId, float> simi;
1590 float signalInElectrons = (*i).second;
1597 if (signalInElectrons >= thePixelThresholdInE &&
1598 signalInElectrons > 0.) {
1600 int chan = (*i).first;
1607 int col = ip.second;
1608 adc =
int(
missCalibrate(detID, tTopo, pixdet, col, row, signalInElectrons));
1614 LogDebug(
"Pixel Digitizer") << (*i).first <<
" " << (*i).second <<
" " << signalInElectrons <<
" " << adc
1615 << ip.first <<
" " << ip.second;
1619 digis.emplace_back(ip.first, ip.second, adc);
1623 unsigned int il = 0;
1624 for (
const auto&
info : (*i).second.hitInfos()) {
1627 simi[std::make_pair(
info.trackId(),
info.eventId().rawId())] += (*i).second.individualampl()[il];
1632 for (
const auto&
info : (*i).second.hitInfos()) {
1634 auto found = simi.find(std::make_pair(
info.trackId(),
info.eventId().rawId()));
1635 if (
found == simi.end())
1638 float sum_samechannel =
found->second;
1639 float fraction = sum_samechannel / (*i).second;
1657 float thePixelThreshold,
1658 CLHEP::HepRandomEngine* engine) {
1667 float theSmearedChargeRMS = 0.0;
1671 if ((*i).second < 3000) {
1672 theSmearedChargeRMS = 543.6 - (*i).second * 0.093;
1673 }
else if ((*i).second < 6000) {
1674 theSmearedChargeRMS = 307.6 - (*i).second * 0.01;
1676 theSmearedChargeRMS = -432.4 + (*i).second * 0.123;
1680 float noise_ChargeVCALSmearing = theSmearedChargeRMS * CLHEP::RandGaussQ::shoot(engine, 0., 1.);
1684 if (((*i).second +
Amplitude(noise + noise_ChargeVCALSmearing, -1.)) < 0.) {
1687 (*i).second +=
Amplitude(noise + noise_ChargeVCALSmearing, -1.);
1696 if (((*i).second +
Amplitude(noise, -1.)) < 0.) {
1708 int numColumns = topol->
ncolumns();
1709 int numRows = topol->
nrows();
1713 int numberOfPixels = (numRows * numColumns);
1714 std::map<int, float, std::less<int> > otherPixels;
1715 std::map<int, float, std::less<int> >::iterator mapI;
1726 << otherPixels.size();
1730 for (mapI = otherPixels.begin(); mapI != otherPixels.end(); mapI++) {
1731 int iy = ((*mapI).first) / numRows;
1732 int ix = ((*mapI).first) - (iy * numRows);
1735 if (iy < 0 || iy > (numColumns - 1))
1736 LogWarning(
"Pixel Geometry") <<
" error in iy " << iy;
1737 if (ix < 0 || ix > (numRows - 1))
1738 LogWarning(
"Pixel Geometry") <<
" error in ix " << ix;
1743 LogDebug(
"Pixel Digitizer") <<
" Storing noise = " << (*mapI).first <<
" " << (*mapI).second <<
" " << ix <<
" " 1744 << iy <<
" " <<
chan;
1747 if (theSignal[chan] == 0) {
1762 CLHEP::HepRandomEngine* engine) {
1766 int numColumns = topol->
ncolumns();
1767 int numRows = topol->
nrows();
1771 double pixelEfficiency = 1.0;
1772 double columnEfficiency = 1.0;
1773 double chipEfficiency = 1.0;
1774 std::vector<double> pixelEfficiencyROCStdPixels(16, 1);
1775 std::vector<double> pixelEfficiencyROCBigPixels(16, 1);
1777 auto pIndexConverter =
PixelIndices(numColumns, numRows);
1779 std::vector<int> badRocsFromFEDChannels(16, 0);
1785 for (
const auto& ch : *it) {
1786 for (
unsigned int i_roc = ch.roc_first; i_roc <= ch.roc_last; ++i_roc) {
1787 for (
const auto p : path) {
1789 if (myroc->
idInDetUnit() ==
static_cast<unsigned int>(i_roc)) {
1792 int chipIndex(0), colROC(0), rowROC(0);
1793 pIndexConverter.transformToROC(global.
col, global.
row, chipIndex, colROC, rowROC);
1794 badRocsFromFEDChannels.at(chipIndex) = 1;
1806 int layerIndex = tTopo->
layer(detID);
1813 if (numColumns > 416)
1814 LogWarning(
"Pixel Geometry") <<
" wrong columns in barrel " << numColumns;
1816 LogWarning(
"Pixel Geometry") <<
" wrong rows in barrel " << numRows;
1821 module = 5 - module;
1832 unsigned int diskIndex =
1834 unsigned int panelIndex = tTopo->
pxfPanel(detID);
1835 unsigned int moduleIndex = tTopo->
pxfModule(detID);
1846 if (numColumns > 260 || numRows > 160) {
1847 if (numColumns > 260)
1848 LogWarning(
"Pixel Geometry") <<
" wrong columns in endcaps " << numColumns;
1850 LogWarning(
"Pixel Geometry") <<
" wrong rows in endcaps " << numRows;
1853 if ((panelIndex == 1 && (moduleIndex == 1 || moduleIndex == 2)) ||
1854 (panelIndex == 2 && moduleIndex == 1)) {
1863 pixelEfficiency = 0.999;
1864 columnEfficiency = 0.999;
1865 chipEfficiency = 0.999;
1880 LogDebug(
"Pixel Digitizer") <<
" enter pixel_inefficiency " << pixelEfficiency <<
" " << columnEfficiency <<
" " 1890 std::map<int, int, std::less<int> > chips,
columns, pixelStd, pixelBig;
1891 std::map<int, int, std::less<int> >::iterator iter;
1896 int chan =
i->first;
1899 int col = ip.second;
1901 pIndexConverter.transformToROC(col, row, chipIndex, colROC, rowROC);
1902 int dColInChip = pIndexConverter.DColumn(colROC);
1904 int dColInDet = pIndexConverter.DColumnInModule(dColInChip, chipIndex);
1907 columns[dColInDet]++;
1910 pixelBig[chipIndex]++;
1912 pixelStd[chipIndex]++;
1917 for (iter = chips.begin(); iter != chips.end(); iter++) {
1919 float rand = CLHEP::RandFlat::shoot(engine);
1920 if (rand > chipEfficiency)
1921 chips[iter->first] = 0;
1925 for (iter = columns.begin(); iter != columns.end(); iter++) {
1927 float rand = CLHEP::RandFlat::shoot(engine);
1928 if (rand > columnEfficiency)
1929 columns[iter->first] = 0;
1934 for (iter = pixelStd.begin(); iter != pixelStd.end(); iter++) {
1935 float rand = CLHEP::RandFlat::shoot(engine);
1936 if (rand > pixelEfficiencyROCStdPixels[iter->first])
1937 pixelStd[iter->first] = 0;
1940 for (iter = pixelBig.begin(); iter != pixelBig.end(); iter++) {
1941 float rand = CLHEP::RandFlat::shoot(engine);
1942 if (rand > pixelEfficiencyROCBigPixels[iter->first])
1943 pixelBig[iter->first] = 0;
1953 int col = ip.second;
1955 pIndexConverter.transformToROC(col, row, chipIndex, colROC, rowROC);
1956 int dColInChip = pIndexConverter.DColumn(colROC);
1958 int dColInDet = pIndexConverter.DColumnInModule(dColInChip, chipIndex);
1961 float rand = CLHEP::RandFlat::shoot(engine);
1962 if (chips[chipIndex] == 0 || columns[dColInDet] == 0 || rand > pixelEfficiency ||
1963 (pixelStd.count(chipIndex) && pixelStd[chipIndex] == 0) ||
1964 (pixelBig.count(chipIndex) && pixelBig[chipIndex] == 0)) {
1969 if ((pixelStd.count(chipIndex) && pixelStd[chipIndex] == 0) ||
1970 (pixelBig.count(chipIndex) && pixelBig[chipIndex] == 0) || (badRocsFromFEDChannels.at(chipIndex) == 1)) {
1992 float pseudoRadDamage = 0.0f;
1997 int layerIndex = tTopo->
layer(detID);
2007 unsigned int diskIndex =
2017 pseudoRadDamage = 0.f;
2023 return pseudoRadDamage;
2025 LogDebug(
"Pixel Digitizer") <<
" enter pixel_aging " << pseudoRadDamage;
2043 const float signalInElectrons)
const {
2070 throw cms::Exception(
"NotAPixelGeomDetUnit") <<
"Not a pixel geomdet unit" << detID;
2086 newAmp = p3 + p2 * tanh(p0 * signal - p1);
2130 const DetId& detId)
const {
2165 dir_z = -(1 + alpha2_BPix * Bfield.z() * Bfield.z());
2170 dir_z = -(1 + alpha2_FPix * Bfield.z() * Bfield.z());
2173 throw cms::Exception(
"NotAPixelGeomDetUnit") <<
"Not a pixel geomdet unit" << detID;
2180 alpha2 = lorentzAngle * lorentzAngle;
2182 dir_x = -(lorentzAngle * Bfield.y() + alpha2 * Bfield.z() * Bfield.x());
2183 dir_y = +(lorentzAngle * Bfield.x() - alpha2 * Bfield.z() * Bfield.y());
2184 dir_z = -(1 + alpha2 * Bfield.z() * Bfield.z());
2191 LogDebug(
"Pixel Digitizer") <<
" The drift direction in local coordinate is " << theDriftDirection;
2194 return theDriftDirection;
2207 int col = ip.second;
2222 Parameters::const_iterator itDeadModules =
DeadModules.begin();
2225 for (; itDeadModules !=
DeadModules.end(); ++itDeadModules) {
2226 int Dead_detID = itDeadModules->getParameter<
int>(
"Dead_detID");
2227 if (detid == Dead_detID) {
2240 if (Module ==
"whole") {
2249 if (Module ==
"tbmA" && ip.first >= 80 && ip.first <= 159) {
2253 if (Module ==
"tbmB" && ip.first <= 79) {
2268 for (
size_t id = 0;
id < disabledModules.size();
id++) {
2269 if (detID == disabledModules[
id].DetID) {
2271 badmodule = disabledModules[
id];
2290 std::vector<GlobalPixel> badrocpositions(0);
2291 for (
unsigned int j = 0;
j < 16;
j++) {
2294 typedef std::vector<CablingPathToDetUnit>::const_iterator
IT;
2295 for (IT it = path.begin(); it != path.end(); ++it) {
2300 badrocpositions.push_back(global);
2310 for (std::vector<GlobalPixel>::const_iterator it = badrocpositions.begin(); it != badrocpositions.end(); ++it) {
2311 if (it->row >= 80 && ip.first >= 80) {
2312 if ((
std::abs(ip.second - it->col) < 26)) {
2314 }
else if (it->row == 120 && ip.second - it->col == 26) {
2316 }
else if (it->row == 119 && it->col - ip.second == 26) {
2319 }
else if (it->row < 80 && ip.first < 80) {
2320 if ((
std::abs(ip.second - it->col) < 26)) {
2322 }
else if (it->row == 40 && ip.second - it->col == 26) {
2324 }
else if (it->row == 39 && it->col - ip.second == 26) {
2334 std::map<
int,
float, std::less<int> >& hit_signal,
2335 const size_t hitIndex,
2336 const unsigned int tofBin,
2340 unsigned short int processType) {
2341 int irow_min = topol->
nrows();
2346 float chargeBefore = 0;
2347 float chargeAfter = 0;
2351 for (
std::map<
int,
float, std::less<int> >::const_iterator im = hit_signal.begin(); im != hit_signal.end(); ++im) {
2352 int chan = (*im).first;
2357 :
Amplitude((*im).second, (*im).second));
2358 chargeBefore += (*im).second;
2360 if (pixelWithCharge.first < irow_min)
2361 irow_min = pixelWithCharge.first;
2362 if (pixelWithCharge.first > irow_max)
2363 irow_max = pixelWithCharge.first;
2364 if (pixelWithCharge.second < icol_min)
2365 icol_min = pixelWithCharge.second;
2366 if (pixelWithCharge.second > icol_max)
2367 icol_max = pixelWithCharge.second;
2372 float trajectoryScaleToPosition = hitEntryPoint.
z() / direction.
z();
2374 if ((hitEntryPoint.
z() > 0 && direction.
z() < 0) || (hitEntryPoint.
z() < 0 && direction.
z() > 0)) {
2375 trajectoryScaleToPosition *= -1;
2378 LocalPoint hitPosition = hitEntryPoint + trajectoryScaleToPosition * direction;
2381 std::pair<int, int> hitPixel =
2382 std::pair<int, int>(
int(floor(hitPositionPixel.
x())),
int(floor(hitPositionPixel.
y())));
2389 std::pair<int, int> entryPixel =
2390 std::pair<int, int>(
int(floor(hitEntryPointPixel.
x())),
int(floor(hitEntryPointPixel.
y())));
2391 std::pair<int, int> exitPixel =
2392 std::pair<int, int>(
int(floor(hitExitPointPixel.
x())),
int(floor(hitExitPointPixel.
y())));
2394 int hitcol_min, hitcol_max, hitrow_min, hitrow_max;
2395 if (entryPixel.first > exitPixel.first) {
2396 hitrow_min = exitPixel.first;
2397 hitrow_max = entryPixel.first;
2399 hitrow_min = entryPixel.first;
2400 hitrow_max = exitPixel.first;
2403 if (entryPixel.second > exitPixel.second) {
2404 hitcol_min = exitPixel.second;
2405 hitcol_max = entryPixel.second;
2407 hitcol_min = entryPixel.second;
2408 hitcol_max = exitPixel.second;
2414 LogDebug(
"Pixel Digitizer") <<
"\n" 2424 <<
"Pixel Pos - X: " << hitPositionPixel.
x() <<
" Y: " << hitPositionPixel.
y() <<
"\n" 2425 <<
"Cart.Cor. - X: " << CMSSWhitPosition.
x() <<
" Y: " << CMSSWhitPosition.
y() <<
"\n" 2426 <<
"Z=0 Pos - X: " << hitPosition.
x() <<
" Y: " << hitPosition.
y() <<
"\n" 2428 <<
"Origin of the template:" 2430 <<
"Pixel Pos - X: " << originPixel.x() <<
" Y: " << originPixel.y() <<
"\n" 2431 <<
"Cart.Cor. - X: " << origin.
x() <<
" Y: " << origin.
y() <<
"\n" 2440 <<
"Entry - X Pixel: " << hitEntryPointPixel.
x() <<
" Y Pixel: " << hitEntryPointPixel.
y()
2442 <<
"Exit - X Pixel: " << hitExitPointPixel.
x() <<
" Y Pixel: " << hitExitPointPixel.
y()
2445 <<
"row min: " << irow_min <<
" col min: " << icol_min <<
"\n";
2448 if (!(irow_min <= hitrow_max && irow_max >= hitrow_min && icol_min <= hitcol_max && icol_max >= hitcol_min)) {
2453 float cmToMicrons = 10000.f;
2455 track[0] = (hitPosition.
x() - origin.
x()) * cmToMicrons;
2456 track[1] = (hitPosition.
y() - origin.
y()) * cmToMicrons;
2458 track[3] = direction.x();
2459 track[4] = direction.y();
2460 track[5] = direction.z();
2464 for (
int row = 0; row <
TXSIZE; ++row) {
2466 pixrewgt[row][
col] = 0;
2470 for (
int row = 0; row <
TXSIZE; ++row) {
2478 for (
int row = 0; row <
TXSIZE; ++row) {
2481 pixrewgt[row][
col] =
2488 std::cout <<
"Cluster before reweighting: " << std::endl;
2508 LogDebug(
"PixelDigitizer ") <<
"Cluster Charge Reweighting did not work properly.";
2514 std::cout <<
"Cluster after reweighting: " << std::endl;
2518 for (
int row = 0; row <
TXSIZE; ++row) {
2521 charge = pixrewgt[row][
col];
2522 if ((hitPixel.first + row -
THX) >= 0 && (hitPixel.first + row -
THX) < topol->
nrows() &&
2523 (hitPixel.second +
col -
THY) >= 0 && (hitPixel.second +
col -
THY) < topol->
ncolumns() && charge > 0) {
2531 if (chargeBefore != 0. && chargeAfter == 0.) {
2537 std::cout <<
"Charges (before->after): " << chargeBefore <<
" -> " << chargeAfter << std::endl;
2538 std::cout <<
"Charge loss: " << (1 - chargeAfter / chargeBefore) * 100 <<
" %" << std::endl << std::endl;
2555 int i,
j,
k,
l, kclose;
2557 float xsize,
ysize, q50i, q100i, q50r, q10r, q100r, xhit2D, yhit2D, qclust, dist2, dmin2;
2560 int goodWeightsUsed, nearbyWeightsUsed, noWeightsUsed;
2561 float cotalpha, cotbeta;
2579 LogDebug(
"Pixel Digitizer") <<
"Reweighting angle is not good!" << std::endl;
2596 for (i = 0; i <
BYM2; ++
i) {
2597 for (j = 0; j <
BXM2; ++
j) {
2599 xy_rewgt[
j][
i] = 0.f;
2610 LogDebug(
"Pixel Digitizer") <<
"No matching template found" << std::endl;
2616 std::cout <<
"Template unirrad: " << std::endl;
2626 if (cluster.num_dimensions() != 2) {
2627 LogWarning(
"Pixel Digitizer") <<
"Cluster is not 2-dimensional. Return." << std::endl;
2630 nclusx = (
int)cluster.shape()[0];
2631 nclusy = (
int)cluster.shape()[1];
2633 LogWarning(
"Pixel Digitizer") <<
"Sizes in x do not match: nclusx=" << nclusx <<
" xdoubleSize=" <<
xdouble.size()
2634 <<
" TXSIZE=" <<
TXSIZE <<
". Return." << std::endl;
2638 LogWarning(
"Pixel Digitizer") <<
"Sizes in y do not match. Return." << std::endl;
2645 for (i = 0; i <
TYSIZE; ++
i) {
2646 for (j = 0; j <
TXSIZE; ++
j) {
2647 xy_clust[
j][
i] = 0.f;
2648 denx_clust[
j][
i] = 0;
2649 deny_clust[
j][
i] = 0;
2650 if (cluster[j][i] > q100i) {
2651 qclust += cluster[
j][
i];
2663 std::cout <<
"Template irrad: " << std::endl;
2675 std::vector<int> ytclust;
2676 std::vector<int> xtclust;
2677 std::vector<int> ycclust;
2678 std::vector<int> xcclust;
2680 for (i = 0; i <
TYSIZE; ++
i) {
2681 for (j = 0; j <
TXSIZE; ++
j) {
2682 if (xy_in[j + 1][i + 1] > q100i) {
2684 ytclust.push_back(i);
2685 xtclust.push_back(j);
2686 xy_clust[
j][
i] = xy_rewgt[j + 1][i + 1] / xy_in[j + 1][i + 1];
2687 denx_clust[
j][
i] =
j;
2688 deny_clust[
j][
i] =
i;
2695 for (i = 0; i <
TYSIZE; ++
i) {
2696 for (j = 0; j <
TXSIZE; ++
j) {
2697 if (xy_rewgt[j + 1][i + 1] > q10r && xy_clust[j][i] == 0.
f && ntpix > 0) {
2701 for (k = 0; k < ntpix; ++
k) {
2702 dist2 = (i - ytclust[
k]) * (i - ytclust[k]) + 0.44444f * (j - xtclust[
k]) * (j - xtclust[k]);
2703 if (dist2 < dmin2) {
2708 xy_clust[
j][
i] = xy_rewgt[j + 1][i + 1] / xy_in[xtclust[kclose] + 1][ytclust[kclose] + 1];
2709 denx_clust[
j][
i] = xtclust[kclose];
2710 deny_clust[
j][
i] = ytclust[kclose];
2721 goodWeightsUsed = 0;
2722 nearbyWeightsUsed = 0;
2725 for (i = 0; i <
TYSIZE; ++
i) {
2726 for (j = 0; j <
TXSIZE; ++
j) {
2727 if (xy_clust[j][i] > 0.
f) {
2728 cluster[
j][
i] = xy_clust[
j][
i] * clust[denx_clust[
j][
i]][deny_clust[
j][
i]];
2729 if (cluster[j][i] > q100r) {
2730 qclust += cluster[
j][
i];
2732 if (cluster[j][i] > 0) {
2736 if (clust[j][i] > 0.
f) {
2738 ycclust.push_back(i);
2739 xcclust.push_back(j);
2748 for (l = 0; l < ncpix; ++
l) {
2753 for (k = 0; k < ntpix; ++
k) {
2754 dist2 = (i - ytclust[
k]) * (i - ytclust[k]) + 0.44444f * (j - xtclust[
k]) * (j - xtclust[k]);
2755 if (dist2 < dmin2) {
2761 nearbyWeightsUsed++;
2762 cluster[
j][
i] *= xy_clust[xtclust[kclose]][ytclust[kclose]];
2763 if (cluster[j][i] > q100r) {
2764 qclust += cluster[
j][
i];
2768 cluster[
j][
i] = 0.f;
2778 for (
int row = 0; row <
TXSIZE; ++row) {
2789 for (
int row = 0; row <
BXM2; ++row) {
2800 for (
int row = 0; row <
TXSIZE; ++row) {
void init(const edm::EventSetup &es)
const SiPixel2DTemplateDBObject * dbobject_den
static std::pair< int, int > channelToPixelROC(const int chan)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
const float theThresholdInE_BPix_L2
virtual int nrows() const =0
const GeomDetType & type() const override
double theOuterEfficiency_FPix[20]
void pixel_inefficiency_db(uint32_t detID)
signal_map_type::const_iterator signal_map_const_iterator
Local3DVector LocalVector
float tof() const
deprecated name for timeOfFlight()
const bool use_deadmodule_DB_
float xsize()
pixel x-size (microns)
edm::ESHandle< SiPixelFedCablingMap > map_
void init_DynIneffDB(const edm::EventSetup &, const unsigned int &)
const float electronsPerVCAL
const double theThresholdSmearing_FPix
virtual int rowsperroc() const =0
Point3DBase< Scalar, LocalTag > LocalPoint
const std::map< unsigned int, double > & getPixelGeomFactors() const
std::map< unsigned int, probabilityVec > probabilityMap
std::map< int, CalParameters, std::less< int > > initCal() const
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
bool xytemp(float xhit, float yhit, bool ydouble[21+2], bool xdouble[13+2], float template2d[13+2][21+2], bool dervatives, float dpdx2d[2][13+2][21+2], float &QTemplate)
static std::pair< int, int > channelToPixel(int ch)
std::vector< float > track
LocalVector DriftDirection(const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const DetId &detId) const
void induce_signal(std::vector< PSimHit >::const_iterator inputBegin, std::vector< PSimHit >::const_iterator inputEnd, const PSimHit &hit, const size_t hitIndex, const unsigned int tofBin, const PixelGeomDetUnit *pixdet, const std::vector< SignalPoint > &collection_points)
SiPixelDigitizerAlgorithm(const edm::ParameterSet &conf)
CaloTopology const * topology(0)
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
const std::vector< float > & getMix_TrueInteractions() const
probabilityVec getProbabilities(const unsigned int puBin) const
const float tanLorentzAnglePerTesla_FPix
PixelEfficiencies pixelEfficiencies_
const std::unique_ptr< SiG4UniversalFluctuation > fluctuate
const int theAdcFullScale
PixelEfficiencies(const edm::ParameterSet &conf, bool AddPixelInefficiency, int NumberOfBarrelLayers, int NumberOfEndcapDisks)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
edm::ESHandle< SiPixelQualityProbabilities > scenarioProbabilityHandle
const std::vector< int > & getMix_bunchCrossing() const
const double theThresholdSmearing_BPix_L1
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool killBadFEDChannels() const
const float theThresholdInE_FPix
std::unique_ptr< PixelFEDChannelCollection > PixelFEDChannelCollection_
const double theThresholdSmearing_BPix
const Bounds & bounds() const
std::vector< std::vector< double > > thePUEfficiency
unsigned int pxbModule(const DetId &id) const
const float electronsPerVCAL_Offset
const bool addThresholdSmearing
void module_killing_conf(uint32_t detID)
const std::map< unsigned int, std::vector< double > > & getPUFactors() const
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
const bool fluctuateCharge
std::map< uint32_t, size_t > iPU
virtual bool isItBigPixelInX(int ixbin) const =0
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
float thePixelPseudoRadDamage[20]
edm::ESHandle< TrackerGeometry > geom_
~SiPixelDigitizerAlgorithm()
double calcQ(float x) const
const Plane & surface() const
The nominal surface of the GeomDet.
const float GeVperElectron
float s50()
1/2 of the pixel threshold signal in adc units
const double theThresholdSmearing_BPix_L2
identify pixel inside single ROC
const bool use_ineff_from_db_
const SiPixel2DTemplateDBObject * dbobject_num
void make_digis(float thePixelThresholdInE, uint32_t detID, const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo) const
static int pixelToChannel(int row, int col)
global coordinates (row and column in DetUnit, as in PixelDigi)
virtual std::pair< float, float > pitch() const =0
bool isThere(GeomDetEnumerators::SubDetector subdet) const
const bool use_LorentzAngle_DB_
const std::vector< uint32_t > getDetIdmasks() const
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Container::value_type value_type
const PixelFEDChannelCollectionMap * quality_map
virtual int colsperroc() const =0
double theInstLumiScaleFactor
const Parameters DeadModules
boost::multi_array< float, 2 > array_2d
const std::map< unsigned int, double > & getColGeomFactors() const
Local3DPoint localPosition() const
float pixel_aging(const PixelAging &aging, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo) const
std::map< uint32_t, std::vector< double > > PixelGeomFactorsROCBigPixels
double thePixelChipEfficiency[20]
const float theTofUpperCut
SiPixelTemplate2D templ2D
const bool use_module_killing_
std::vector< double > pu_scale
void printCluster(array_2d &cluster)
void module_killing_DB(uint32_t detID)
static int pixelToChannelROC(const int rowROC, const int colROC)
const bool PrintTemplates
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual bool isItBigPixelInY(int iybin) const =0
void digitize(const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
Abs< T >::type abs(const T &t)
const float theThresholdInE_BPix
double theInnerEfficiency_FPix[20]
DetId geographicalId() const
The label of this GeomDet.
const int NumberOfEndcapDisks
virtual int channel(const LocalPoint &p) const =0
std::vector< double > theModuleEfficiency_BPix[20]
const std::vector< disabledModuleType > getBadComponentList() const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< LinkConnSpec >::const_iterator IT
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
bool isTrackerPixel() const
signal_map_type::iterator signal_map_iterator
std::unique_ptr< PixelFEDChannelCollection > chooseScenario(PileupMixingContent *puInfo, CLHEP::HepRandomEngine *)
const float theThresholdInE_BPix_L1
edm::ESHandle< SiPixelLorentzAngle > SiPixelLorentzAngle_
const float electronsPerVCAL_L1_Offset
unsigned int pxfModule(const DetId &id) const
void setSimAccumulator(const std::map< uint32_t, std::map< int, int > > &signalMap)
const bool UseReweighting
const std::map< int, CalParameters, std::less< int > > calmap
void fluctuateEloss(int particleId, float momentum, float eloss, float length, int NumberOfSegments, float elossVector[], CLHEP::HepRandomEngine *) const
const bool doMissCalibrate
unsigned int pxbLayer(const DetId &id) const
const bool AddPixelInefficiency
const bool addChargeVCALSmearing
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const std::unique_ptr< GaussianTailNoiseGenerator > theNoiser
const float theNoiseInElectrons
std::map< int, Amplitude, std::less< int > > signal_map_type
const float electronsPerVCAL_L1
edm::ESHandle< SiPixelQuality > SiPixelBadModule_
short getTemplateID(const uint32_t &detid) const
std::map< uint32_t, std::vector< double > > PixelGeomFactorsROCStdPixels
virtual float thickness() const =0
void primary_ionization(const PSimHit &hit, std::vector< EnergyDepositUnit > &ionization_points, CLHEP::HepRandomEngine *) const
void init_from_db(const edm::ESHandle< TrackerGeometry > &, const edm::ESHandle< SiPixelDynamicInefficiency > &)
double thePixelColEfficiency[20]
void calculateInstlumiFactor(PileupMixingContent *puInfo)
std::vector< bool > ydouble
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
void accumulateSimHits(const std::vector< PSimHit >::const_iterator inputBegin, const std::vector< PSimHit >::const_iterator inputEnd, const size_t inputBeginGlobalIndex, const unsigned int tofBin, const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
row and collumn in ROC representation
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore2D > &pixelTemp, std::string dir="")
const std::map< unsigned int, double > & getChipGeomFactors() const
const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const final
static const GlobalPoint notFound(0, 0, 0)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
const float tanLorentzAnglePerTesla_BPix
edm::ESHandle< SiPixelDynamicInefficiency > SiPixelDynamicInefficiency_
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
unsigned short processType() const
float ysize()
pixel y-size (microns)
unsigned int layer(const DetId &id) const
std::vector< bool > xdouble
std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const final
float missCalibrate(uint32_t detID, const TrackerTopology *tTopo, const PixelGeomDetUnit *pixdet, int col, int row, float amp) const
bool matches(const DetId &, const DetId &, const std::vector< uint32_t > &)
std::vector< edm::ParameterSet > Parameters
const bool KillBadFEDChannels
std::vector< double > theLadderEfficiency_BPix[20]
double gettheInstLumiScaleFactor() const
float energyLoss() const
The energy deposit in the PSimHit, in ???.
virtual int ncolumns() const =0
const float theReadoutNoise
const TrackerGeomDet * idToDet(DetId) const override
static unsigned int const shift
float getLorentzAngle(const uint32_t &) const
std::map< uint32_t, double > ColGeomFactors
const RotationType & rotation() const
double thePixelEfficiency[20]
PixelAging(const edm::ParameterSet &conf, bool AddPixelAging, int NumberOfBarrelLayers, int NumberOfEndcapDisks)
const float theTofLowerCut
void drift(const PSimHit &hit, const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const TrackerTopology *tTopo, const std::vector< EnergyDepositUnit > &ionization_points, std::vector< SignalPoint > &collection_points) const
std::map< uint32_t, double > PixelGeomFactors
std::map< uint32_t, double > ChipGeomFactors
virtual SubDetector subDetector() const
Which subdetector.
const bool addNoisyPixels
const PixelAging pixelAging_
const PositionType & position() const
int PixelTempRewgt2D(int id_gen, int id_rewgt, array_2d &cluster)
T const * product() const
const float theElectronPerADC
Local3DPoint entryPoint() const
Entry point in the local Det frame.
unsigned int pxfPanel(const DetId &id) const
const bool makeDigiSimLinks_
bool hitSignalReweight(const PSimHit &hit, std::map< int, float, std::less< int > > &hit_signal, const size_t hitIndex, const unsigned int tofBin, const PixelTopology *topol, uint32_t detID, signal_map_type &theSignal, unsigned short int processType)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
unsigned int detUnitId() const
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
const int NumberOfBarrelLayers
GlobalPixel toGlobal(const LocalPixel &loc) const
void add_noise(const PixelGeomDetUnit *pixdet, float thePixelThreshold, CLHEP::HepRandomEngine *)
void pixel_inefficiency(const PixelEfficiencies &eff, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
constexpr Detector det() const
get the detector field from this detid