55 #include <gsl/gsl_sf_erf.h> 57 #include "CLHEP/Random/RandGaussQ.h" 58 #include "CLHEP/Random/RandFlat.h" 59 #include "CLHEP/Random/RandGeneral.h" 108 if (use_ineff_from_db_) {
109 theSiPixelGainCalibrationService_->setESObjects(es);
111 if (use_deadmodule_DB_) {
112 SiPixelBadModule_ = &es.
getData(SiPixelBadModuleToken_);
114 if (use_LorentzAngle_DB_) {
116 SiPixelLorentzAngle_ = &es.
getData(SiPixelLorentzAngleToken_);
120 geom_ = &es.
getData(geomToken_);
123 scenarioProbability_ = &es.
getData(scenarioProbabilityToken_);
124 quality_map = &es.
getData(PixelFEDChannelCollectionMapToken_);
127 std::vector<std::string> allScenarios;
131 std::back_inserter(allScenarios),
134 std::vector<std::string> allScenariosInProb;
136 for (
auto it = m_probabilities.begin(); it != m_probabilities.end(); ++it) {
138 for (
const auto&
entry : it->second) {
140 auto probability =
entry.second;
141 if (probability != 0) {
142 if (
std::find(allScenariosInProb.begin(), allScenariosInProb.end(),
scenario) == allScenariosInProb.end()) {
143 allScenariosInProb.push_back(
scenario);
150 std::copy_if(allScenariosInProb.begin(),
151 allScenariosInProb.end(),
154 return (
std::find(allScenarios.begin(), allScenarios.end(),
arg) == allScenarios.end());
159 LogError(
"SiPixelFEDChannelContainer")
160 <<
"The requested scenario: " <<
entry <<
" is not found in the map!! \n";
163 <<
" missing scenario(s) in SiPixelStatusScenariosRcd while " 164 "present in SiPixelStatusScenarioProbabilityRcd \n";
168 TheNewSiPixelChargeReweightingAlgorithmClass->init(es);
178 makeDigiSimLinks_(conf.getUntrackedParameter<
bool>(
"makeDigiSimLinks",
true)),
179 use_ineff_from_db_(conf.getParameter<
bool>(
"useDB")),
180 use_module_killing_(conf.getParameter<
bool>(
"killModules")),
181 use_deadmodule_DB_(conf.getParameter<
bool>(
"DeadModules_DB")),
182 use_LorentzAngle_DB_(conf.getParameter<
bool>(
"LorentzAngle_DB")),
185 : conf.getParameter<
Parameters>(
"DeadModules")),
187 TheNewSiPixelChargeReweightingAlgorithmClass(),
191 GeVperElectron(3.61E-09),
194 alpha2Order(conf.getParameter<
bool>(
"Alpha2Order")),
200 NumberOfBarrelLayers(conf.exists(
"NumPixelBarrel") ? conf.getParameter<
int>(
"NumPixelBarrel") : 3),
208 theElectronPerADC(conf.getParameter<double>(
"ElectronPerAdc")),
212 theAdcFullScale(conf.getParameter<
int>(
"AdcFullScale")),
216 theNoiseInElectrons(conf.getParameter<double>(
"NoiseInElectrons")),
220 theReadoutNoise(conf.getParameter<double>(
"ReadoutNoiseInElec")),
225 theThresholdInE_FPix(conf.getParameter<double>(
"ThresholdInElectrons_FPix")),
226 theThresholdInE_BPix(conf.getParameter<double>(
"ThresholdInElectrons_BPix")),
227 theThresholdInE_BPix_L1(conf.exists(
"ThresholdInElectrons_BPix_L1")
228 ? conf.getParameter<double>(
"ThresholdInElectrons_BPix_L1")
229 : theThresholdInE_BPix),
230 theThresholdInE_BPix_L2(conf.exists(
"ThresholdInElectrons_BPix_L2")
231 ? conf.getParameter<double>(
"ThresholdInElectrons_BPix_L2")
232 : theThresholdInE_BPix),
235 theThresholdSmearing_FPix(conf.getParameter<double>(
"ThresholdSmearing_FPix")),
236 theThresholdSmearing_BPix(conf.getParameter<double>(
"ThresholdSmearing_BPix")),
237 theThresholdSmearing_BPix_L1(conf.exists(
"ThresholdSmearing_BPix_L1")
238 ? conf.getParameter<double>(
"ThresholdSmearing_BPix_L1")
239 : theThresholdSmearing_BPix),
240 theThresholdSmearing_BPix_L2(conf.exists(
"ThresholdSmearing_BPix_L2")
241 ? conf.getParameter<double>(
"ThresholdSmearing_BPix_L2")
242 : theThresholdSmearing_BPix),
245 electronsPerVCAL(conf.getParameter<double>(
"ElectronsPerVcal")),
246 electronsPerVCAL_Offset(conf.getParameter<double>(
"ElectronsPerVcal_Offset")),
247 electronsPerVCAL_L1(conf.exists(
"ElectronsPerVcal_L1") ? conf.getParameter<double>(
"ElectronsPerVcal_L1")
249 electronsPerVCAL_L1_Offset(conf.exists(
"ElectronsPerVcal_L1_Offset")
250 ? conf.getParameter<double>(
"ElectronsPerVcal_L1_Offset")
251 : electronsPerVCAL_Offset),
255 theTofLowerCut(conf.getParameter<double>(
"TofLowerCut")),
256 theTofUpperCut(conf.getParameter<double>(
"TofUpperCut")),
259 tanLorentzAnglePerTesla_FPix(use_LorentzAngle_DB_ ? 0.0
260 : conf.getParameter<double>(
"TanLorentzAnglePerTesla_FPix")),
261 tanLorentzAnglePerTesla_BPix(use_LorentzAngle_DB_ ? 0.0
262 : conf.getParameter<double>(
"TanLorentzAnglePerTesla_BPix")),
265 FPix_p0(conf.getParameter<double>(
"FPix_SignalResponse_p0")),
266 FPix_p1(conf.getParameter<double>(
"FPix_SignalResponse_p1")),
267 FPix_p2(conf.getParameter<double>(
"FPix_SignalResponse_p2")),
268 FPix_p3(conf.getParameter<double>(
"FPix_SignalResponse_p3")),
270 BPix_p0(conf.getParameter<double>(
"BPix_SignalResponse_p0")),
271 BPix_p1(conf.getParameter<double>(
"BPix_SignalResponse_p1")),
272 BPix_p2(conf.getParameter<double>(
"BPix_SignalResponse_p2")),
273 BPix_p3(conf.getParameter<double>(
"BPix_SignalResponse_p3")),
276 addNoise(conf.getParameter<
bool>(
"AddNoise")),
280 addChargeVCALSmearing(conf.getParameter<
bool>(
"ChargeVCALSmearing")),
283 addNoisyPixels(conf.getParameter<
bool>(
"AddNoisyPixels")),
286 fluctuateCharge(conf.getUntrackedParameter<
bool>(
"FluctuateCharge",
true)),
293 addThresholdSmearing(conf.getParameter<
bool>(
"AddThresholdSmearing")),
296 doMissCalibrate(conf.getParameter<
bool>(
"MissCalibrate")),
297 theGainSmearing(conf.getParameter<double>(
"GainSmearing")),
298 theOffsetSmearing(conf.getParameter<double>(
"OffsetSmearing")),
301 AddPixelAging(conf.getParameter<
bool>(
"DoPixelAging")),
307 tMax(conf.getParameter<double>(
"deltaProductionCut")),
338 LogInfo(
"PixelDigitizer ") <<
"SiPixelDigitizerAlgorithm constructed" 339 <<
"Configuration parameters:" 340 <<
"Threshold/Gain = " 352 std::map<int, SiPixelDigitizerAlgorithm::CalParameters, std::less<int> >
calmap;
354 LogDebug(
"PixelDigitizer ") <<
" miss-calibrate the pixel amplitude \n";
356 const bool ReadCalParameters =
false;
357 if (ReadCalParameters) {
360 char filename[80] =
"phCalibrationFit_C0.dat";
364 LogInfo(
"PixelDigitizer ") <<
" File not found \n ";
370 for (
int i = 0;
i < 3;
i++) {
375 LogInfo(
"PixelDigitizer ") <<
" test map" 382 for (
int i = 0;
i < (52 * 80);
i++) {
385 LogError(
"PixelDigitizer") <<
"Cannot read data file for calmap" 391 <<
" " <<
in_file.good() <<
" end of file " 397 << colid <<
" " << rowid <<
"\n";
407 calmap.insert(std::pair<int, CalParameters>(
chan, onePix));
411 if (rowid !=
p.first)
412 LogInfo(
"PixelDigitizer ") <<
" wrong channel row " << rowid <<
" " <<
p.first <<
"\n";
413 if (colid !=
p.second)
414 LogInfo(
"PixelDigitizer ") <<
" wrong channel col " << colid <<
" " <<
p.second <<
"\n";
418 LogInfo(
"PixelDigitizer ") <<
" map size " <<
calmap.size() <<
" max " <<
calmap.max_size() <<
" " 419 <<
calmap.empty() <<
"\n";
442 LogDebug(
"PixelDigitizer") <<
"SiPixelDigitizerAlgorithm deleted";
448 int NumberOfBarrelLayers,
456 conf.
exists(
"thePixelColEfficiency_BPix3") && conf.
exists(
"thePixelColEfficiency_FPix1") &&
457 conf.
exists(
"thePixelColEfficiency_FPix2") && conf.
exists(
"thePixelEfficiency_BPix1") &&
458 conf.
exists(
"thePixelEfficiency_BPix2") && conf.
exists(
"thePixelEfficiency_BPix3") &&
459 conf.
exists(
"thePixelEfficiency_FPix1") && conf.
exists(
"thePixelEfficiency_FPix2") &&
460 conf.
exists(
"thePixelChipEfficiency_BPix1") && conf.
exists(
"thePixelChipEfficiency_BPix2") &&
461 conf.
exists(
"thePixelChipEfficiency_BPix3") && conf.
exists(
"thePixelChipEfficiency_FPix1") &&
462 conf.
exists(
"thePixelChipEfficiency_FPix2");
465 conf.
exists(
"theLadderEfficiency_BPix3") && conf.
exists(
"theModuleEfficiency_BPix1") &&
466 conf.
exists(
"theModuleEfficiency_BPix2") && conf.
exists(
"theModuleEfficiency_BPix3") &&
467 conf.
exists(
"thePUEfficiency_BPix1") && conf.
exists(
"thePUEfficiency_BPix2") &&
468 conf.
exists(
"thePUEfficiency_BPix3") && conf.
exists(
"theInnerEfficiency_FPix1") &&
469 conf.
exists(
"theInnerEfficiency_FPix2") && conf.
exists(
"theOuterEfficiency_FPix1") &&
470 conf.
exists(
"theOuterEfficiency_FPix2") && conf.
exists(
"thePUEfficiency_FPix_Inner") &&
471 conf.
exists(
"thePUEfficiency_FPix_Outer") && conf.
exists(
"theInstLumiScaleFactor");
474 conf.
exists(
"thePixelEfficiency_BPix4") && conf.
exists(
"thePixelChipEfficiency_BPix4");
477 conf.
exists(
"thePixelEfficiency_FPix3") && conf.
exists(
"thePixelChipEfficiency_FPix3");
479 LogInfo(
"PixelDigitizer ") <<
"The PixelDigitizer inefficiency configuration is read from the config file.\n";
513 throw cms::Exception(
"Configuration") <<
"Wrong ladder number in efficiency config!";
522 throw cms::Exception(
"Configuration") <<
"Wrong module number in efficiency config!";
530 <<
"At least one PU efficiency (BPix) number is needed in efficiency config!";
534 if (NumberOfTotLayers > 20) {
535 throw cms::Exception(
"Configuration") <<
"SiPixelDigitizer was given more layers than it can handle";
565 if (NumberOfTotLayers > 20) {
566 throw cms::Exception(
"Configuration") <<
"SiPixelDigitizer was given more layers than it can handle";
587 <<
"At least one (FPix) PU efficiency number is needed in efficiency config!";
591 LogInfo(
"PixelDigitizer ") <<
"The PixelDigitizer inefficiency configuration is read from the database.\n";
617 for (
const auto& it_module :
geom->detUnits()) {
618 if (dynamic_cast<PixelGeomDetUnit const*>(it_module) ==
nullptr)
620 const DetId detid = it_module->geographicalId();
621 uint32_t rawid = detid.
rawId();
622 PixelGeomFactors[rawid] = 1;
623 ColGeomFactors[rawid] = 1;
624 ChipGeomFactors[rawid] = 1;
625 PixelGeomFactorsROCStdPixels[rawid] = std::vector<double>(16, 1);
626 PixelGeomFactorsROCBigPixels[rawid] = std::vector<double>(16, 1);
630 std::map<uint32_t, double> PixelGeomFactorsDB;
632 LogDebug(
"PixelDigitizer ") <<
" Check PixelEfficiencies -- PixelGeomFactorsDBIn " 635 for (
auto db_factor : PixelGeomFactorsDBIn) {
636 LogDebug(
"PixelDigitizer ") <<
" db_factor " << db_factor.first <<
" " << db_factor.second <<
"\n";
640 unsigned int rocMask = rocIdMaskBits <<
shift;
641 unsigned int rocId = (((db_factor.first) & rocMask) >>
shift);
644 unsigned int rawid = db_factor.first & (~rocMask);
649 double factor = db_factor.second;
650 double badFraction = 1 -
factor;
651 double bigPixelFraction =
static_cast<double>(nBigPixelsInROC) / nPixelsInROC;
652 double stdPixelFraction = 1. - bigPixelFraction;
654 double badFractionBig =
std::min(bigPixelFraction, badFraction);
655 double badFractionStd =
std::max(0., badFraction - badFractionBig);
656 double badFractionBigReNormalized = badFractionBig / bigPixelFraction;
657 double badFractionStdReNormalized = badFractionStd / stdPixelFraction;
658 PixelGeomFactorsROCStdPixels[rawid][rocId] *= (1. - badFractionStdReNormalized);
659 PixelGeomFactorsROCBigPixels[rawid][rocId] *= (1. - badFractionBigReNormalized);
661 PixelGeomFactorsDB[db_factor.first] = db_factor.second;
666 PixelGeomFactorsDB = PixelGeomFactorsDBIn;
670 <<
" Check PixelEfficiencies -- Loop on all modules and store module level geometrical scale factors " 673 for (
const auto& it_module :
geom->detUnits()) {
674 if (dynamic_cast<PixelGeomDetUnit const*>(it_module) ==
nullptr)
676 const DetId detid = it_module->geographicalId();
677 uint32_t rawid = detid.
rawId();
678 for (
auto db_factor : PixelGeomFactorsDB) {
679 LogDebug(
"PixelDigitizer ") <<
" db_factor PixelGeomFactorsDB " << db_factor.first <<
" " 680 << db_factor.second <<
"\n";
682 PixelGeomFactors[rawid] *= db_factor.second;
684 for (
auto db_factor : ColGeomFactorsDB) {
685 LogDebug(
"PixelDigitizer ") <<
" db_factor ColGeomFactorsDB " << db_factor.first <<
" " << db_factor.second
688 ColGeomFactors[rawid] *= db_factor.second;
690 for (
auto db_factor : ChipGeomFactorsDB) {
691 LogDebug(
"PixelDigitizer ") <<
" db_factor ChipGeomFactorsDB " << db_factor.first <<
" " 692 << db_factor.second <<
"\n";
694 ChipGeomFactors[rawid] *= db_factor.second;
701 LogDebug(
"PixelDigitizer ") <<
" Check PixelEfficiencies -- PUFactors " 703 for (
const auto&
factor : PUFactors) {
705 LogDebug(
"PixelDigitizer ") <<
" factor " <<
factor.first <<
" " <<
factor.second.size() <<
"\n";
706 for (
size_t i = 0,
n =
factor.second.size();
i <
n;
i++) {
707 LogDebug(
"PixelDigitizer ") <<
" print factor.second for " <<
i <<
" " <<
factor.second[
i] <<
"\n";
711 for (
const auto& it_module :
geom->detUnits()) {
712 if (dynamic_cast<PixelGeomDetUnit const*>(it_module) ==
nullptr)
714 const DetId detid = it_module->geographicalId();
715 if (!
matches(detid, db_id, DetIdmasks))
717 if (iPU.count(detid.
rawId())) {
719 <<
"Multiple db_ids match to same module in SiPixelDynamicInefficiency DB Object";
724 thePUEfficiency.push_back(
factor.second);
727 pu_scale.resize(thePUEfficiency.size());
732 const std::vector<uint32_t>& DetIdmasks) {
735 for (
size_t i = 0;
i < DetIdmasks.size(); ++
i) {
757 thePixelPseudoRadDamage[
i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_BPix1");
758 thePixelPseudoRadDamage[
i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_BPix2");
759 thePixelPseudoRadDamage[
i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_BPix3");
760 thePixelPseudoRadDamage[
i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_BPix4");
764 if (NumberOfTotLayers > 20) {
765 throw cms::Exception(
"Configuration") <<
"SiPixelDigitizer was given more layers than it can handle";
769 thePixelPseudoRadDamage[
j - 1] = 0.;
774 thePixelPseudoRadDamage[
i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_FPix1");
775 thePixelPseudoRadDamage[
i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_FPix2");
776 thePixelPseudoRadDamage[
i++] = conf.
getParameter<
double>(
"thePixelPseudoRadDamage_FPix3");
780 if (NumberOfTotLayers > 20) {
781 throw cms::Exception(
"Configuration") <<
"SiPixelDigitizer was given more layers than it can handle";
785 thePixelPseudoRadDamage[
j - 1] = 0.;
795 std::vector<PSimHit>::const_iterator inputEnd,
796 const size_t inputBeginGlobalIndex,
797 const unsigned int tofBin,
801 CLHEP::HepRandomEngine* engine) {
806 size_t simHitGlobalIndex = inputBeginGlobalIndex;
807 for (std::vector<PSimHit>::const_iterator ssbegin = inputBegin; ssbegin != inputEnd; ++ssbegin, ++simHitGlobalIndex) {
809 if ((*ssbegin).detUnitId() != detId) {
814 LogDebug(
"Pixel Digitizer") << (*ssbegin).particleType() <<
" " << (*ssbegin).pabs() <<
" " 815 << (*ssbegin).energyLoss() <<
" " << (*ssbegin).tof() <<
" " << (*ssbegin).trackId()
816 <<
" " << (*ssbegin).processType() <<
" " << (*ssbegin).detUnitId()
817 << (*ssbegin).entryPoint() <<
" " << (*ssbegin).exitPoint();
820 std::vector<EnergyDepositUnit> ionization_points;
821 std::vector<SignalPoint> collection_points;
839 inputBeginGlobalIndex,
857 std::vector<int>::const_iterator
pu;
858 std::vector<int>::const_iterator pu0 = bunchCrossing.end();
860 for (
pu = bunchCrossing.begin();
pu != bunchCrossing.end(); ++
pu) {
867 if (pu0 != bunchCrossing.end()) {
870 double instlumi_pow = 1.;
874 instlumi_pow *= instlumi;
888 for (
unsigned int i = 0;
i < ps.size();
i++)
889 if (ps[
i].getBunchCrossing() == 0)
895 double instlumi_pow = 1.;
899 instlumi_pow *= instlumi;
914 const std::vector<PileupSummaryInfo>& ps, CLHEP::HepRandomEngine* engine) {
915 std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ =
nullptr;
918 std::vector<int> bunchCrossing;
919 std::vector<float> TrueInteractionList;
921 for (
unsigned int i = 0;
i < ps.size();
i++) {
922 bunchCrossing.push_back(ps[
i].getBunchCrossing());
923 TrueInteractionList.push_back(ps[
i].getTrueNumInteractions());
927 std::vector<int>::const_iterator
pu;
928 std::vector<int>::const_iterator pu0 = bunchCrossing.end();
930 for (
pu = bunchCrossing.begin();
pu != bunchCrossing.end(); ++
pu) {
938 if (pu0 != bunchCrossing.end()) {
939 unsigned int PUBin = TrueInteractionList.at(
p);
941 std::vector<double> probabilities;
942 probabilities.reserve(theProbabilitiesPerScenario.size());
943 for (
auto it = theProbabilitiesPerScenario.begin(); it != theProbabilitiesPerScenario.end(); it++) {
944 probabilities.push_back(it->second);
947 CLHEP::RandGeneral randGeneral(*engine, &(probabilities.front()), probabilities.size());
948 double x = randGeneral.shoot();
949 unsigned int index =
x * probabilities.size() - 1;
952 PixelFEDChannelCollection_ = std::make_unique<PixelFEDChannelCollection>(
quality_map->at(
scenario));
957 return PixelFEDChannelCollection_;
961 CLHEP::HepRandomEngine* engine) {
964 std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ =
nullptr;
971 std::vector<int>::const_iterator
pu;
972 std::vector<int>::const_iterator pu0 = bunchCrossing.end();
974 for (
pu = bunchCrossing.begin();
pu != bunchCrossing.end(); ++
pu) {
982 if (pu0 != bunchCrossing.end()) {
983 unsigned int PUBin = TrueInteractionList.at(
p);
985 std::vector<double> probabilities;
986 probabilities.reserve(theProbabilitiesPerScenario.size());
987 for (
auto it = theProbabilitiesPerScenario.begin(); it != theProbabilitiesPerScenario.end(); it++) {
988 probabilities.push_back(it->second);
991 CLHEP::RandGeneral randGeneral(*engine, &(probabilities.front()), probabilities.size());
992 double x = randGeneral.shoot();
993 unsigned int index =
x * probabilities.size() - 1;
996 PixelFEDChannelCollection_ = std::make_unique<PixelFEDChannelCollection>(
quality_map->at(
scenario));
1001 return PixelFEDChannelCollection_;
1006 for (
const auto& det : signalMap) {
1007 auto& theSignal =
_signal[det.first];
1008 for (
const auto&
chan : det.second) {
1009 theSignal[
chan.first].set(
chan.second *
1017 std::vector<PixelDigi>& digis,
1018 std::vector<PixelDigiSimLink>& simlinks,
1020 CLHEP::HepRandomEngine* engine) {
1032 float thePixelThresholdInE = 0.;
1036 int lay = tTopo->
layer(detID);
1041 thePixelThresholdInE = CLHEP::RandGaussQ::shoot(
1043 }
else if (lay == 2) {
1044 thePixelThresholdInE = CLHEP::RandGaussQ::shoot(
1047 thePixelThresholdInE =
1056 }
else if (lay == 2) {
1065 thePixelThresholdInE =
1071 throw cms::Exception(
"NotAPixelGeomDetUnit") <<
"Not a pixel geomdet unit" << detID;
1077 int numColumns = topol->
ncolumns();
1078 int numRows = topol->
nrows();
1081 LogDebug(
"PixelDigitizer") <<
" PixelDigitizer " << numColumns <<
" " << numRows <<
" " << moduleThickness;
1103 make_digis(thePixelThresholdInE, detID, pixdet, digis, simlinks, tTopo);
1106 LogDebug(
"PixelDigitizer") <<
"[SiPixelDigitizerAlgorithm] converted " << digis.size() <<
" PixelDigis in DetUnit" 1115 std::vector<EnergyDepositUnit>& ionization_points,
1116 CLHEP::HepRandomEngine* engine)
const {
1119 const float SegmentLength = 0.0010;
1126 float length = direction.
mag();
1128 int NumberOfSegments =
int(length / SegmentLength);
1129 if (NumberOfSegments < 1)
1130 NumberOfSegments = 1;
1133 LogDebug(
"Pixel Digitizer") <<
" enter primary_ionzation " << NumberOfSegments
1134 <<
" shift = " << (
hit.exitPoint().
x() -
hit.entryPoint().
x()) <<
" " 1135 << (
hit.exitPoint().
y() -
hit.entryPoint().
y()) <<
" " 1136 << (
hit.exitPoint().
z() -
hit.entryPoint().
z()) <<
" " <<
hit.particleType() <<
" " 1140 float* elossVector =
new float[NumberOfSegments];
1144 int pid =
hit.particleType();
1147 float momentum =
hit.pabs();
1152 ionization_points.resize(NumberOfSegments);
1155 for (
int i = 0;
i != NumberOfSegments;
i++) {
1165 ionization_points[
i] = edu;
1168 LogDebug(
"Pixel Digitizer") <<
i <<
" " << ionization_points[
i].x() <<
" " << ionization_points[
i].y() <<
" " 1169 << ionization_points[
i].z() <<
" " << ionization_points[
i].energy();
1174 delete[] elossVector;
1181 float particleMomentum,
1185 float elossVector[],
1186 CLHEP::HepRandomEngine* engine)
const {
1192 double particleMass = 139.6;
1196 particleMass = 0.511;
1198 particleMass = 105.7;
1199 else if (pid == 321)
1200 particleMass = 493.7;
1201 else if (pid == 2212)
1202 particleMass = 938.3;
1205 float segmentLength = length / NumberOfSegs;
1210 double segmentEloss = (1000. * eloss) / NumberOfSegs;
1211 for (
int i = 0;
i < NumberOfSegs;
i++) {
1217 double deltaCutoff =
tMax;
1218 de =
fluctuate->SampleFluctuations(
double(particleMomentum * 1000.),
1221 double(segmentLength * 10.),
1225 elossVector[
i] = de;
1231 float ratio = eloss / sum;
1233 for (
int ii = 0;
ii < NumberOfSegs;
ii++)
1234 elossVector[
ii] =
ratio * elossVector[
ii];
1236 float averageEloss = eloss / NumberOfSegs;
1237 for (
int ii = 0;
ii < NumberOfSegs;
ii++)
1238 elossVector[
ii] = averageEloss;
1250 const std::vector<EnergyDepositUnit>& ionization_points,
1251 std::vector<SignalPoint>& collection_points)
const {
1253 LogDebug(
"Pixel Digitizer") <<
" enter drift ";
1256 collection_points.resize(ionization_points.size());
1259 if (driftDir.
z() == 0.) {
1260 LogWarning(
"Magnetic field") <<
" pxlx: drift in z is zero ";
1268 float TanLorenzAngleX, TanLorenzAngleY, dir_z, CosLorenzAngleX, CosLorenzAngleY;
1270 TanLorenzAngleX = driftDir.
x();
1271 TanLorenzAngleY = driftDir.
y();
1272 dir_z = driftDir.
z();
1273 CosLorenzAngleX = 1. /
sqrt(1. + TanLorenzAngleX * TanLorenzAngleX);
1274 CosLorenzAngleY = 1. /
sqrt(1. + TanLorenzAngleY * TanLorenzAngleY);
1277 TanLorenzAngleX = driftDir.
x();
1278 TanLorenzAngleY = 0.;
1279 dir_z = driftDir.
z();
1280 CosLorenzAngleX = 1. /
sqrt(1. + TanLorenzAngleX * TanLorenzAngleX);
1281 CosLorenzAngleY = 1.;
1286 LogDebug(
"Pixel Digitizer") <<
" Lorentz Tan " << TanLorenzAngleX <<
" " << TanLorenzAngleY <<
" " << CosLorenzAngleX
1287 <<
" " << CosLorenzAngleY <<
" " << moduleThickness * TanLorenzAngleX <<
" " << driftDir;
1292 float DriftDistance;
1296 for (
unsigned int i = 0;
i != ionization_points.size();
i++) {
1297 float SegX, SegY, SegZ;
1298 SegX = ionization_points[
i].
x();
1299 SegY = ionization_points[
i].y();
1300 SegZ = ionization_points[
i].z();
1305 DriftDistance = moduleThickness / 2. - (dir_z * SegZ);
1307 if (DriftDistance <= 0.)
1308 LogDebug(
"PixelDigitizer ") <<
" <=0 " << DriftDistance <<
" " <<
i <<
" " << SegZ <<
" " << dir_z <<
" " << SegX
1309 <<
" " << SegY <<
" " << (moduleThickness / 2) <<
" " << ionization_points[
i].
energy()
1310 <<
" " <<
hit.particleType() <<
" " <<
hit.pabs() <<
" " <<
hit.energyLoss() <<
" " 1311 <<
hit.entryPoint() <<
" " <<
hit.exitPoint() <<
"\n";
1313 if (DriftDistance < 0.) {
1315 }
else if (DriftDistance > moduleThickness)
1316 DriftDistance = moduleThickness;
1319 float XDriftDueToMagField = DriftDistance * TanLorenzAngleX;
1320 float YDriftDueToMagField = DriftDistance * TanLorenzAngleY;
1323 float CloudCenterX = SegX + XDriftDueToMagField;
1324 float CloudCenterY = SegY + YDriftDueToMagField;
1327 DriftLength =
sqrt(DriftDistance * DriftDistance + XDriftDueToMagField * XDriftDueToMagField +
1328 YDriftDueToMagField * YDriftDueToMagField);
1334 Sigma_x = Sigma / CosLorenzAngleX;
1335 Sigma_y = Sigma / CosLorenzAngleY;
1338 float energyOnCollector = ionization_points[
i].energy();
1343 energyOnCollector *=
exp(-1 * kValue * DriftDistance / moduleThickness);
1347 LogDebug(
"Pixel Digitizer") <<
" Dift DistanceZ= " << DriftDistance <<
" module thickness= " << moduleThickness
1348 <<
" Start Energy= " << ionization_points[
i].energy()
1349 <<
" Energy after loss= " << energyOnCollector;
1351 SignalPoint sp(CloudCenterX, CloudCenterY, Sigma_x, Sigma_y,
hit.tof(), energyOnCollector);
1354 collection_points[
i] = (sp);
1363 std::vector<PSimHit>::const_iterator inputEnd,
1365 const size_t hitIndex,
1366 const size_t FirstHitIndex,
1367 const unsigned int tofBin,
1369 const std::vector<SignalPoint>& collection_points) {
1378 LogDebug(
"Pixel Digitizer") <<
" enter induce_signal, " << topol->
pitch().first <<
" " << topol->
pitch().second;
1382 typedef std::map<int, float, std::less<int> > hit_map_type;
1383 hit_map_type hit_signal;
1386 std::map<int, float, std::less<int> >
x,
y;
1391 for (std::vector<SignalPoint>::const_iterator
i = collection_points.begin();
i != collection_points.end(); ++
i) {
1392 float CloudCenterX =
i->position().x();
1393 float CloudCenterY =
i->position().y();
1396 float Charge =
i->amplitude();
1400 <<
i->position().y() <<
" " <<
i->sigma_x() <<
" " <<
i->sigma_y() <<
" " 1401 <<
i->amplitude() <<
"\n";
1405 LogDebug(
"Pixel Digitizer") <<
" cloud " <<
i->position().x() <<
" " <<
i->position().y() <<
" " <<
i->sigma_x()
1406 <<
" " <<
i->sigma_y() <<
" " <<
i->amplitude();
1429 int IPixRightUpX =
int(floor(mp.
x()));
1430 int IPixRightUpY =
int(floor(mp.
y()));
1433 LogDebug(
"Pixel Digitizer") <<
" right-up " << PointRightUp <<
" " << mp.
x() <<
" " << mp.
y() <<
" " << IPixRightUpX
1434 <<
" " << IPixRightUpY;
1439 int IPixLeftDownX =
int(floor(mp.
x()));
1440 int IPixLeftDownY =
int(floor(mp.
y()));
1443 emd::LogDebug(
"Pixel Digitizer") <<
" left-down " << PointLeftDown <<
" " << mp.
x() <<
" " << mp.
y() <<
" " 1444 << IPixLeftDownX <<
" " << IPixLeftDownY;
1448 int numColumns = topol->
ncolumns();
1449 int numRows = topol->
nrows();
1451 IPixRightUpX = numRows > IPixRightUpX ? IPixRightUpX : numRows - 1;
1452 IPixRightUpY = numColumns > IPixRightUpY ? IPixRightUpY : numColumns - 1;
1453 IPixLeftDownX = 0 < IPixLeftDownX ? IPixLeftDownX : 0;
1454 IPixLeftDownY = 0 < IPixLeftDownY ? IPixLeftDownY : 0;
1461 for (ix = IPixLeftDownX; ix <= IPixRightUpX; ix++) {
1462 float xUB, xLB, UpperBound, LowerBound;
1467 if (ix == 0 ||
SigmaX == 0.)
1472 LowerBound = 1 -
calcQ((xLB - CloudCenterX) /
SigmaX);
1475 if (ix == numRows - 1 ||
SigmaX == 0.)
1480 UpperBound = 1. -
calcQ((xUB - CloudCenterX) /
SigmaX);
1483 float TotalIntegrationRange = UpperBound - LowerBound;
1484 x[ix] = TotalIntegrationRange;
1486 LogDebug(
"Pixel Digitizer") << TotalIntegrationRange <<
" " << ix <<
"\n";
1491 for (iy = IPixLeftDownY; iy <= IPixRightUpY; iy++) {
1492 float yUB, yLB, UpperBound, LowerBound;
1494 if (iy == 0 ||
SigmaY == 0.)
1499 LowerBound = 1. -
calcQ((yLB - CloudCenterY) /
SigmaY);
1502 if (iy == numColumns - 1 ||
SigmaY == 0.)
1507 UpperBound = 1. -
calcQ((yUB - CloudCenterY) /
SigmaY);
1510 float TotalIntegrationRange = UpperBound - LowerBound;
1511 y[iy] = TotalIntegrationRange;
1513 LogDebug(
"Pixel Digitizer") << TotalIntegrationRange <<
" " << iy <<
"\n";
1518 for (ix = IPixLeftDownX; ix <= IPixRightUpX; ix++) {
1519 for (iy = IPixLeftDownY; iy <= IPixRightUpY; iy++) {
1521 float ChargeFraction =
Charge *
x[ix] *
y[iy];
1523 if (ChargeFraction > 0.) {
1526 hit_signal[
chan] += ChargeFraction;
1533 LogDebug(
"Pixel Digitizer") <<
" pixel " << ix <<
" " << iy <<
" - " 1534 <<
" " <<
chan <<
" " << ChargeFraction <<
" " << mp.
x() <<
" " << mp.
y() <<
" " 1535 << lp.
x() <<
" " << lp.
y() <<
" " 1546 bool reweighted =
false;
1549 if (
hit.processType() == 0) {
1554 std::vector<PSimHit>::const_iterator crSimHit = inputBegin;
1557 if ((*inputBegin).trackId() !=
hit.trackId()) {
1560 size_t localIndex = FirstHitIndex;
1561 for (std::vector<PSimHit>::const_iterator ssbegin = inputBegin; localIndex < hitIndex;
1562 ++ssbegin, ++localIndex) {
1563 if ((*ssbegin).detUnitId() != detId) {
1566 if ((*ssbegin).trackId() ==
hit.trackId() && (*ssbegin).processType() == 0) {
1575 (*crSimHit), hit_signal, hitIndex, tofBin, topol, detID, theSignal,
hit.processType(),
makeDigiSimLinks_);
1579 for (hit_map_type::const_iterator im = hit_signal.begin(); im != hit_signal.end(); ++im) {
1580 int chan = (*im).first;
1582 :
Amplitude((*im).second, (*im).second));
1586 LogDebug(
"Pixel Digitizer") <<
" pixel " << ip.first <<
" " << ip.second <<
" " << theSignal[
chan];
1599 std::vector<PixelDigi>& digis,
1600 std::vector<PixelDigiSimLink>& simlinks,
1603 LogDebug(
"Pixel Digitizer") <<
" make digis " 1609 <<
" List pixels passing threshold ";
1614 signalMaps::const_iterator it =
_signal.find(detID);
1623 std::map<TrackEventId, float> simi;
1626 float signalInElectrons = (*i).second;
1633 if (signalInElectrons >= thePixelThresholdInE &&
1634 signalInElectrons > 0.) {
1636 int chan = (*i).first;
1643 int col = ip.second;
1650 LogDebug(
"Pixel Digitizer") << (*i).first <<
" " << (*i).second <<
" " << signalInElectrons <<
" " <<
adc 1651 << ip.first <<
" " << ip.second;
1655 digis.emplace_back(ip.first, ip.second,
adc);
1659 unsigned int il = 0;
1660 for (
const auto&
info : (*i).second.hitInfos()) {
1663 simi[std::make_pair(
info.trackId(),
info.eventId().rawId())] += (*i).second.individualampl()[il];
1668 for (
const auto&
info : (*i).second.hitInfos()) {
1670 auto found = simi.find(std::make_pair(
info.trackId(),
info.eventId().rawId()));
1671 if (
found == simi.end())
1674 float sum_samechannel =
found->second;
1675 float fraction = sum_samechannel / (*i).second;
1693 float thePixelThreshold,
1694 CLHEP::HepRandomEngine* engine) {
1703 float theSmearedChargeRMS = 0.0;
1707 if ((*i).second < 3000) {
1708 theSmearedChargeRMS = 543.6 - (*i).second * 0.093;
1709 }
else if ((*i).second < 6000) {
1710 theSmearedChargeRMS = 307.6 - (*i).second * 0.01;
1712 theSmearedChargeRMS = -432.4 + (*i).second * 0.123;
1716 float noise_ChargeVCALSmearing = theSmearedChargeRMS * CLHEP::RandGaussQ::shoot(engine, 0., 1.);
1720 if (((*i).second +
Amplitude(
noise + noise_ChargeVCALSmearing, -1.)) < 0.) {
1744 int numColumns = topol->
ncolumns();
1745 int numRows = topol->
nrows();
1749 int numberOfPixels = (numRows * numColumns);
1750 std::map<int, float, std::less<int> > otherPixels;
1751 std::map<int, float, std::less<int> >::iterator mapI;
1762 << otherPixels.size();
1766 for (mapI = otherPixels.begin(); mapI != otherPixels.end(); mapI++) {
1767 int iy = ((*mapI).first) / numRows;
1768 int ix = ((*mapI).first) - (iy * numRows);
1771 if (iy < 0 || iy > (numColumns - 1))
1772 LogWarning(
"Pixel Geometry") <<
" error in iy " << iy;
1773 if (ix < 0 || ix > (numRows - 1))
1774 LogWarning(
"Pixel Geometry") <<
" error in ix " << ix;
1779 LogDebug(
"Pixel Digitizer") <<
" Storing noise = " << (*mapI).first <<
" " << (*mapI).second <<
" " << ix <<
" " 1780 << iy <<
" " <<
chan;
1783 if (theSignal[
chan] == 0) {
1798 CLHEP::HepRandomEngine* engine) {
1802 int numColumns = topol->
ncolumns();
1803 int numRows = topol->
nrows();
1807 double pixelEfficiency = 1.0;
1808 double columnEfficiency = 1.0;
1809 double chipEfficiency = 1.0;
1810 std::vector<double> pixelEfficiencyROCStdPixels(16, 1);
1811 std::vector<double> pixelEfficiencyROCBigPixels(16, 1);
1813 auto pIndexConverter =
PixelIndices(numColumns, numRows);
1815 std::vector<int> badRocsFromFEDChannels(16, 0);
1821 for (
const auto& ch : *it) {
1822 for (
unsigned int i_roc = ch.roc_first; i_roc <= ch.roc_last; ++i_roc) {
1823 for (
const auto p :
path) {
1825 if (myroc->
idInDetUnit() ==
static_cast<unsigned int>(i_roc)) {
1828 int chipIndex(0), colROC(0), rowROC(0);
1829 pIndexConverter.transformToROC(global.
col, global.
row, chipIndex, colROC, rowROC);
1830 badRocsFromFEDChannels.at(chipIndex) = 1;
1842 int layerIndex = tTopo->
layer(detID);
1846 LogDebug(
"Pixel Digitizer") <<
"Using BPix columnEfficiency = " << columnEfficiency
1847 <<
" for layer = " << layerIndex <<
"\n";
1850 if (numColumns > 416)
1851 LogWarning(
"Pixel Geometry") <<
" wrong columns in barrel " << numColumns;
1853 LogWarning(
"Pixel Geometry") <<
" wrong rows in barrel " << numRows;
1869 unsigned int diskIndex =
1871 unsigned int panelIndex = tTopo->
pxfPanel(detID);
1872 unsigned int moduleIndex = tTopo->
pxfModule(detID);
1878 LogDebug(
"Pixel Digitizer") <<
"Using FPix columnEfficiency = " << columnEfficiency
1879 <<
" for Disk = " << tTopo->
pxfDisk(detID) <<
"\n";
1884 if (numColumns > 260 || numRows > 160) {
1885 if (numColumns > 260)
1886 LogWarning(
"Pixel Geometry") <<
" wrong columns in endcaps " << numColumns;
1888 LogWarning(
"Pixel Geometry") <<
" wrong rows in endcaps " << numRows;
1891 if ((panelIndex == 1 && (moduleIndex == 1 || moduleIndex == 2)) ||
1892 (panelIndex == 2 && moduleIndex == 1)) {
1901 pixelEfficiency = 0.999;
1902 columnEfficiency = 0.999;
1903 chipEfficiency = 0.999;
1918 LogDebug(
"Pixel Digitizer") <<
" enter pixel_inefficiency " << pixelEfficiency <<
" " << columnEfficiency <<
" " 1928 std::map<int, int, std::less<int> > chips,
columns, pixelStd, pixelBig;
1929 std::map<int, int, std::less<int> >::iterator iter;
1934 int chan =
i->first;
1937 int col = ip.second;
1939 pIndexConverter.transformToROC(
col, row, chipIndex, colROC, rowROC);
1940 int dColInChip = pIndexConverter.DColumn(colROC);
1942 int dColInDet = pIndexConverter.DColumnInModule(dColInChip, chipIndex);
1948 pixelBig[chipIndex]++;
1950 pixelStd[chipIndex]++;
1955 for (iter = chips.begin(); iter != chips.end(); iter++) {
1957 float rand = CLHEP::RandFlat::shoot(engine);
1958 if (rand > chipEfficiency)
1959 chips[iter->first] = 0;
1965 float rand = CLHEP::RandFlat::shoot(engine);
1966 if (rand > columnEfficiency)
1972 for (iter = pixelStd.begin(); iter != pixelStd.end(); iter++) {
1973 float rand = CLHEP::RandFlat::shoot(engine);
1974 if (rand > pixelEfficiencyROCStdPixels[iter->first])
1975 pixelStd[iter->first] = 0;
1978 for (iter = pixelBig.begin(); iter != pixelBig.end(); iter++) {
1979 float rand = CLHEP::RandFlat::shoot(engine);
1980 if (rand > pixelEfficiencyROCBigPixels[iter->first])
1981 pixelBig[iter->first] = 0;
1991 int col = ip.second;
1993 pIndexConverter.transformToROC(
col, row, chipIndex, colROC, rowROC);
1994 int dColInChip = pIndexConverter.DColumn(colROC);
1996 int dColInDet = pIndexConverter.DColumnInModule(dColInChip, chipIndex);
1999 float rand = CLHEP::RandFlat::shoot(engine);
2000 if (chips[chipIndex] == 0 ||
columns[dColInDet] == 0 || rand > pixelEfficiency ||
2001 (pixelStd.count(chipIndex) && pixelStd[chipIndex] == 0) ||
2002 (pixelBig.count(chipIndex) && pixelBig[chipIndex] == 0)) {
2007 if ((pixelStd.count(chipIndex) && pixelStd[chipIndex] == 0) ||
2008 (pixelBig.count(chipIndex) && pixelBig[chipIndex] == 0) || (badRocsFromFEDChannels.at(chipIndex) == 1)) {
2030 float pseudoRadDamage = 0.0f;
2035 int layerIndex = tTopo->
layer(detID);
2037 pseudoRadDamage =
aging.thePixelPseudoRadDamage[layerIndex - 1];
2039 LogDebug(
"Pixel Digitizer") <<
"pixel_aging: " 2041 LogDebug(
"Pixel Digitizer") <<
"Subid " << pixdet->
subDetector() <<
" layerIndex " << layerIndex <<
" ladder " 2047 unsigned int diskIndex =
2050 pseudoRadDamage =
aging.thePixelPseudoRadDamage[diskIndex - 1];
2052 LogDebug(
"Pixel Digitizer") <<
"pixel_aging: " 2054 LogDebug(
"Pixel Digitizer") <<
"Subid " << pixdet->
subDetector() <<
" diskIndex " << diskIndex <<
"\n";
2058 pseudoRadDamage = 0.f;
2061 LogDebug(
"Pixel Digitizer") <<
" pseudoRadDamage " << pseudoRadDamage <<
"\n";
2062 LogDebug(
"Pixel Digitizer") <<
" end pixel_aging " 2065 return pseudoRadDamage;
2067 LogDebug(
"Pixel Digitizer") <<
" enter pixel_aging " << pseudoRadDamage;
2085 const float signalInElectrons)
const {
2112 throw cms::Exception(
"NotAPixelGeomDetUnit") <<
"Not a pixel geomdet unit" << detID;
2128 newAmp =
p3 +
p2 * tanh(p0 * signal -
p1);
2156 LogDebug(
"Pixel Digitizer") <<
" misscalibrate " <<
col <<
" " << row
2159 << signalInElectrons <<
" " << signal <<
" " << newAmp <<
" " 2174 const DetId& detId)
const {
2217 throw cms::Exception(
"NotAPixelGeomDetUnit") <<
"Not a pixel geomdet unit" << detID;
2224 alpha2 = lorentzAngle * lorentzAngle;
2234 LogDebug(
"Pixel Digitizer") <<
" The drift direction in local coordinate is " << theDriftDirection;
2237 return theDriftDirection;
2250 int col = ip.second;
2253 LogDebug(
"Pixel Digitizer") <<
"now in isdead check, row " << detID <<
" " <<
col <<
"," << row <<
"\n";
2265 Parameters::const_iterator itDeadModules =
DeadModules.begin();
2268 for (; itDeadModules !=
DeadModules.end(); ++itDeadModules) {
2269 int Dead_detID = itDeadModules->getParameter<
int>(
"Dead_detID");
2270 if (detid == Dead_detID) {
2292 if (
Module ==
"tbmA" && ip.first >= 80 && ip.first <= 159) {
2296 if (
Module ==
"tbmB" && ip.first <= 79) {
2311 for (
size_t id = 0;
id < disabledModules.size();
id++) {
2312 if (detID == disabledModules[
id].DetID) {
2314 badmodule = disabledModules[
id];
2324 LogDebug(
"Pixel Digitizer") <<
"Hit in: " << detID <<
" errorType " << badmodule.
errorType <<
" BadRocs=" << std::hex
2335 std::vector<GlobalPixel> badrocpositions(0);
2336 for (
unsigned int j = 0;
j < 16;
j++) {
2339 typedef std::vector<CablingPathToDetUnit>::const_iterator
IT;
2340 for (
IT it =
path.begin(); it !=
path.end(); ++it) {
2345 badrocpositions.push_back(global);
2355 for (std::vector<GlobalPixel>::const_iterator it = badrocpositions.begin(); it != badrocpositions.end(); ++it) {
2356 if (it->row >= 80 && ip.first >= 80) {
2357 if ((
std::abs(ip.second - it->col) < 26)) {
2359 }
else if (it->row == 120 && ip.second - it->col == 26) {
2361 }
else if (it->row == 119 && it->col - ip.second == 26) {
2364 }
else if (it->row < 80 && ip.first < 80) {
2365 if ((
std::abs(ip.second - it->col) < 26)) {
2367 }
else if (it->row == 40 && ip.second - it->col == 26) {
2369 }
else if (it->row == 39 && it->col - ip.second == 26) {
void init(const edm::EventSetup &es)
static std::pair< int, int > channelToPixelROC(const int chan)
const float theThresholdInE_BPix_L2
double theOuterEfficiency_FPix[20]
T getParameter(std::string const &) const
void pixel_inefficiency_db(uint32_t detID)
unsigned int pxbLayer(const DetId &id) const
signal_map_type::const_iterator signal_map_const_iterator
Local3DVector LocalVector
const bool use_deadmodule_DB_
const float electronsPerVCAL
const double theThresholdSmearing_FPix
Point3DBase< Scalar, LocalTag > LocalPoint
std::map< unsigned int, probabilityVec > probabilityMap
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
static std::pair< int, int > channelToPixel(int ch)
const std::map< unsigned int, double > & getPixelGeomFactors() const
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
virtual int ncolumns() const =0
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)
unsigned int pxfModule(const DetId &id) const
const GeomDetType & type() const override
virtual int rowsperroc() const =0
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const double theThresholdSmearing_BPix_L1
const std::map< unsigned int, double > & getColGeomFactors() const
virtual int nrows() const =0
edm::ESGetToken< SiPixelQualityProbabilities, SiPixelStatusScenarioProbabilityRcd > scenarioProbabilityToken_
const float theThresholdInE_FPix
std::unique_ptr< PixelFEDChannelCollection > PixelFEDChannelCollection_
const double theThresholdSmearing_BPix
std::vector< std::vector< double > > thePUEfficiency
std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const final
const std::vector< int > & getMix_bunchCrossing() const
const float electronsPerVCAL_Offset
const bool addThresholdSmearing
float pixel_aging(const PixelAging &aging, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo) const
void module_killing_conf(uint32_t detID)
const bool fluctuateCharge
unsigned int pxbLadder(const DetId &id) const
Log< level::Error, false > LogError
std::map< uint32_t, size_t > iPU
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
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
~SiPixelDigitizerAlgorithm()
constexpr Detector det() const
get the detector field from this detid
const float GeVperElectron
const double theThresholdSmearing_BPix_L2
identify pixel inside single ROC
const SiPixelDynamicInefficiency * SiPixelDynamicInefficiency_
unsigned int layer(const DetId &id) const
std::unique_ptr< SiPixelChargeReweightingAlgorithm > TheNewSiPixelChargeReweightingAlgorithmClass
bool isTrackerPixel() const
const bool use_ineff_from_db_
constexpr std::array< uint8_t, layerIndexSize > layer
static int pixelToChannel(int row, int col)
global coordinates (row and column in DetUnit, as in PixelDigi)
virtual float thickness() const =0
void induce_signal(std::vector< PSimHit >::const_iterator inputBegin, std::vector< PSimHit >::const_iterator inputEnd, const PSimHit &hit, const size_t hitIndex, const size_t FirstHitIndex, const unsigned int tofBin, const PixelGeomDetUnit *pixdet, const std::vector< SignalPoint > &collection_points)
const bool use_LorentzAngle_DB_
const std::map< unsigned int, std::vector< double > > & getPUFactors() const
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
void make_digis(float thePixelThresholdInE, uint32_t detID, const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo) const
Container::value_type value_type
LocalVector DriftDirection(const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const DetId &detId) const
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > SiPixelBadModuleToken_
const std::vector< disabledModuleType > getBadComponentList() const
SiPixelDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
const PixelFEDChannelCollectionMap * quality_map
const std::vector< uint32_t > getDetIdmasks() const
double theInstLumiScaleFactor
const Parameters DeadModules
std::map< uint32_t, std::vector< double > > PixelGeomFactorsROCBigPixels
virtual bool isItBigPixelInX(int ixbin) const =0
double thePixelChipEfficiency[20]
virtual int colsperroc() const =0
const float theTofUpperCut
void primary_ionization(const PSimHit &hit, std::vector< EnergyDepositUnit > &ionization_points, CLHEP::HepRandomEngine *) const
const bool use_module_killing_
GlobalPixel toGlobal(const LocalPixel &loc) const
std::vector< double > pu_scale
void module_killing_DB(uint32_t detID)
probabilityVec getProbabilities(const unsigned int puBin) const
static int pixelToChannelROC(const int rowROC, const int colROC)
virtual bool isItBigPixelInY(int iybin) const =0
const std::map< unsigned int, double > & getChipGeomFactors() const
unsigned int pxfDisk(const DetId &id) const
void digitize(const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const final
Abs< T >::type abs(const T &t)
double calcQ(float x) const
const float theThresholdInE_BPix
double theInnerEfficiency_FPix[20]
const SiPixelLorentzAngle * SiPixelLorentzAngle_
virtual int channel(const LocalPoint &p) const =0
const int NumberOfEndcapDisks
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
std::vector< double > theModuleEfficiency_BPix[20]
bool getData(T &iHolder) const
float missCalibrate(uint32_t detID, const TrackerTopology *tTopo, const PixelGeomDetUnit *pixdet, int col, int row, float amp) const
std::vector< LinkConnSpec >::const_iterator IT
void init_from_db(const TrackerGeometry *, const SiPixelDynamicInefficiency *)
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd > SiPixelLorentzAngleToken_
signal_map_type::iterator signal_map_iterator
void init_DynIneffDB(const edm::EventSetup &)
DetId geographicalId() const
The label of this GeomDet.
std::unique_ptr< PixelFEDChannelCollection > chooseScenario(PileupMixingContent *puInfo, CLHEP::HepRandomEngine *)
const float theThresholdInE_BPix_L1
const float electronsPerVCAL_L1_Offset
void setSimAccumulator(const std::map< uint32_t, std::map< int, int > > &signalMap)
const bool UseReweighting
edm::ESGetToken< PixelFEDChannelCollectionMap, SiPixelFEDChannelContainerESProducerRcd > PixelFEDChannelCollectionMapToken_
const std::map< int, CalParameters, std::less< int > > calmap
const bool doMissCalibrate
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const bool AddPixelInefficiency
unsigned int pxfPanel(const DetId &id) const
const bool addChargeVCALSmearing
Log< level::Info, false > LogInfo
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 SiPixelQuality * SiPixelBadModule_
const SiPixelFedCablingMap * map_
const Plane & surface() const
The nominal surface of the GeomDet.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const float electronsPerVCAL_L1
const PositionType & position() const
std::map< uint32_t, std::vector< double > > PixelGeomFactorsROCStdPixels
double thePixelColEfficiency[20]
const std::vector< float > & getMix_TrueInteractions() const
constexpr uint32_t rawId() const
get the raw id
void calculateInstlumiFactor(PileupMixingContent *puInfo)
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
virtual SubDetector subDetector() const
Which subdetector.
static const GlobalPoint notFound(0, 0, 0)
const float tanLorentzAnglePerTesla_BPix
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
const SiPixelQualityProbabilities * scenarioProbability_
void fluctuateEloss(int particleId, float momentum, float eloss, float length, int NumberOfSegments, float elossVector[], CLHEP::HepRandomEngine *) 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]
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
const float theReadoutNoise
const TrackerGeometry * geom_
short getBadRocs(const uint32_t &detid) const
static unsigned int const shift
edm::ESGetToken< SiPixelDynamicInefficiency, SiPixelDynamicInefficiencyRcd > SiPixelDynamicInefficiencyToken_
std::map< uint32_t, double > ColGeomFactors
const RotationType & rotation() const
std::map< int, CalParameters, std::less< int > > initCal() const
double thePixelEfficiency[20]
virtual std::pair< float, float > pitch() const =0
PixelAging(const edm::ParameterSet &conf, bool AddPixelAging, int NumberOfBarrelLayers, int NumberOfEndcapDisks)
const float theTofLowerCut
unsigned int pxbModule(const DetId &id) const
Log< level::Warning, false > LogWarning
bool killBadFEDChannels() const
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
std::map< uint32_t, double > PixelGeomFactors
std::map< uint32_t, double > ChipGeomFactors
const bool addNoisyPixels
const PixelAging pixelAging_
float getLorentzAngle(const uint32_t &) const
const float theElectronPerADC
const bool makeDigiSimLinks_
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
*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
const int NumberOfBarrelLayers
double gettheInstLumiScaleFactor() const
uint16_t *__restrict__ uint16_t const *__restrict__ adc
void add_noise(const PixelGeomDetUnit *pixdet, float thePixelThreshold, CLHEP::HepRandomEngine *)
void pixel_inefficiency(const PixelEfficiencies &eff, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
const Bounds & bounds() const