12 #include "CLHEP/Random/RandGauss.h"
20 theDefaultParameters_(3.0,
45 testHEPlan1_(
false) {}
69 if (hid.
iphi() == 39 && hid.
zside() == 1 &&
93 if ((hid.
ieta() > -5) && (hid.
ieta() < 5))
99 if (hid.
depth() % 2 == 1)
101 else if (hid.
depth() % 2 == 0)
115 value0 += sipmpar.getDarkCurrent() * 25. / (1. - sipmchar->getCrossTalk(sipmpar.getType()));
117 float value[4] = {value0, value0, value0, value0};
119 for (
int i = 0;
i < 4;
i++) {
123 value[
i] = value0 + (
float)CLHEP::RandGauss::shoot(0.0,
width.getWidth(
i) / 100.);
143 width2 += sipmpar.getDarkCurrent() * 25. /
std::pow(1 - sipmchar->getCrossTalk(sipmpar.getType()), 3) *
148 for (
int i = 0;
i < 4;
i++) {
149 for (
int j = 0;
j < 4;
j++) {
160 float value[4] = {value0, value0, value0, value0};
162 for (
int i = 0;
i < 4;
i++) {
189 for (
unsigned capid = 0; capid < 4; capid++) {
207 for (
int i = 0;
i < 64;
i++) {
208 lowEdges[
i] = -1.5 +
i;
210 result.setMinCharges(lowEdges);
223 float phase = -25.0f;
224 float Xphase = (
phase + 32.0f) * 4.0
f;
232 int pulseShapeID = hparam.
mcShape();
238 Xphase = (
phase + 32.0f) * 4.0
f;
249 Xphase = (
phase + 32.0f) * 4.0
f;
260 Xphase = (
phase + 32.0f) * 4.0
f;
266 if (cell.
ieta() == 1 && cell.
iphi() == 1)
275 Xphase = (
phase + 32.0f) * 4.0
f;
287 Xphase = (
phase + 32.0f) * 4.0
f;
295 for (
int k = 0;
k < 5;
k++) {
296 rshift[
k + 1] = rshift[
k] + r1bit[
k];
299 int packingScheme = 1;
300 unsigned int param = pulseShapeID |
syncPhase << rshift[1] | (
binOfMaximum << rshift[2]) | (Iphase << rshift[3]) |
312 int containmentCorrectionFlag = 0;
314 int containmentCorrectionPreSample = 0;
317 float Xphase = (
phase + 32.0) * 4.0;
335 int LeakCorrectionID = 0;
339 int timeCorrectionID = 0;
345 int specialCaseID = 0;
347 int noiseFlaggingID = 0;
349 int pileupCleaningID = 0;
351 int packingScheme = 1;
357 containmentCorrectionFlag = 1;
358 containmentCorrectionPreSample = 0;
360 float Xphase = (
phase + 32.0) * 4.0;
368 LeakCorrectionID = 0;
370 timeCorrectionID = 0;
375 pileupCleaningID = 0;
380 containmentCorrectionFlag = 1;
381 containmentCorrectionPreSample = 0;
383 float Xphase = (
phase + 32.0) * 4.0;
391 LeakCorrectionID = 0;
393 timeCorrectionID = 0;
398 pileupCleaningID = 0;
402 containmentCorrectionFlag = 0;
403 containmentCorrectionPreSample = 0;
405 float Xphase = (
phase + 32.0) * 4.0;
413 LeakCorrectionID = 0;
415 timeCorrectionID = 0;
420 pileupCleaningID = 0;
427 for (
int k = 0;
k < 6;
k++) {
429 p1shift[
j] = p1shift[
k] + p1bit[
k];
433 param1 = containmentCorrectionFlag | (containmentCorrectionPreSample << p1shift[1]) | (Iphase << p1shift[2]) |
438 for (
int k = 0;
k < 9;
k++) {
440 q2shift[
j] = q2shift[
k] + q2bit[
k];
446 (specialCaseID << q2shift[6]) | (noiseFlaggingID << q2shift[7]) | (pileupCleaningID << q2shift[8]) |
447 (packingScheme << q2shift[9]);
480 #define EMAP_NHBHECR 9
486 #define EMAP_NHSETS 4
487 #define EMAP_NTOPBOT 2
488 #define EMAP_NHTRSHO 4
489 #define EMAP_NHSETSHO 3
505 return std::make_unique<HcalDcsMap>(dcs_map_helper);
509 static const int kUTCAMask = 0x4000000;
510 static const int kLinearIndexMax = 0x7FFFF;
511 static const int kTriggerBitMask = 0x02000000;
513 uint32_t counterTrig = 0;
515 for (
const auto& fId :
cells) {
528 assert(counterTrig < kLinearIndexMax);
529 uint32_t raw = counterTrig;
530 raw |= kUTCAMask | kTriggerBitMask;
535 return std::make_unique<HcalElectronicsMap>(emapHelper);
539 const std::vector<HcalGenericDetId>&
cells)
const {
541 std::stringstream mystream;
543 for (
const auto& fId :
cells) {
544 if (fId.isHcalDetId()) {
547 int ieta =
id.ietaAbs();
548 int iside =
id.zside();
549 int iphi =
id.iphi();
553 char sidesign = (iside == -1) ?
'M' :
'P';
556 irm = (
iphi + 1) % 4 + 1;
558 if (
ieta >= 21 && (irm == 1 || irm == 3))
559 iwedge = (
iphi + 1 + irm + 1) / 4;
561 iwedge = (
iphi + irm + 1) / 4;
564 sprintf(tempbuff,
"%s%c%2.2i%c", det.c_str(), sidesign, iwedge,
'\0');
565 mystream << tempbuff;
566 rbx = mystream.str();
572 if ((iside == 1 &&
ieta == 40) || (iside == -1 &&
ieta == 41)) {
573 irm = ((
iphi + 1) / 2) % 36 + 1;
574 hfphi = ((
iphi + 1) / 6) % 12 + 1;
576 irm = (
iphi + 1) / 2;
577 hfphi = (
iphi - 1) / 6 + 1;
579 irm = (irm - 1) % 3 + 1;
580 sprintf(tempbuff,
"%s%c%2.2i%c", det.c_str(), sidesign, hfphi,
'\0');
581 mystream << tempbuff;
582 rbx = mystream.str();
587 int ring(0), sector(0);
594 for (
int i = -2;
i <
iphi;
i += 6)
598 irm = ((
iphi + 1) / 2) % 6 + 1;
599 if (
ring != 0 && sector % 2 != 0)
602 sprintf(tempbuff,
"%s%i%2.2d", det.c_str(),
ring, sector);
604 sprintf(tempbuff,
"%s%i%c%2.2d", det.c_str(),
ring, sidesign, sector);
605 mystream << tempbuff;
606 rbx = mystream.str();
612 return std::make_unique<HcalFrontEndMap>(emapHelper);
617 auto eta_depth_pair = std::make_pair(
ieta,
depth);
622 std::vector<int> segmentation;
628 return nLayersInDepth;
636 if (hid.
zside() == 1 && (hid.
iphi() == 63 || hid.
iphi() == 64 || hid.
iphi() == 65 || hid.
iphi() == 66))
656 if (nLayersInDepth > 4) {
669 if (nLayersInDepth > 4) {
697 ps.getParameter<
int>(
"pixels"),
698 ps.getParameter<
double>(
"nonlin1"),
699 ps.getParameter<
double>(
"nonlin2"),
700 ps.getParameter<
double>(
"nonlin3"),
701 ps.getParameter<
double>(
"crosstalk"),
705 return std::make_unique<HcalSiPMCharacteristics>(sipmHelper);
712 uint32_t bitInfo = ((44 << 16) | 30);
720 tppar.
loadObject(0, 0, 0xFFFFFFFFFFFFFFFF, 0, 0, 0);