60 cosh_ieta_28_HE_low_depths_{},
61 cosh_ieta_28_HE_high_depths_{},
69 linearLSB_QIE11Overlap_{} {}
103 inputLUT_ = std::vector<HcaluLUTTPGCoder::Lut>(nluts);
104 gain_ = std::vector<float>(nluts, 0.);
105 ped_ = std::vector<float>(nluts, 0.);
110 const std::vector<bool>& featureBits,
112 throw cms::Exception(
"PROBLEM: This method should never be invoked!");
156 std::vector<HcalSubdetector> subdet;
166 if (subdetStr ==
"HB")
168 else if (subdetStr ==
"HE")
170 else if (subdetStr ==
"HF")
179 size_t nCol = subdet.size();
182 std::vector<int> ietaU;
183 std::vector<int> ietaL;
184 std::vector<int> iphiU;
185 std::vector<int> iphiL;
186 std::vector<int> depU;
187 std::vector<int> depL;
188 std::vector<Lut> lutFromFile(nCol);
191 for (
size_t i = 0;
i < nCol; ++
i) {
194 ietaL.push_back(
ieta);
197 for (
size_t i = 0;
i < nCol; ++
i) {
200 ietaU.push_back(
ieta);
203 for (
size_t i = 0;
i < nCol; ++
i) {
206 iphiL.push_back(
iphi);
209 for (
size_t i = 0;
i < nCol; ++
i) {
212 iphiU.push_back(
iphi);
215 for (
size_t i = 0;
i < nCol; ++
i) {
221 for (
size_t i = 0;
i < nCol; ++
i) {
228 for (
size_t i = 0;
file >> lutValue;
i = (
i + 1) % nCol) {
229 lutFromFile[
i].push_back(lutValue);
233 for (
size_t i = 0;
i < nCol; ++
i)
236 for (
size_t i = 0;
i < nCol; ++
i) {
268 for (
int isub = 0; isub < 3; ++isub) {
273 std::vector<unsigned int>* lut = _xml->
getLutFast(detid);
275 throw cms::Exception(
"PROBLEM: No inputLUT_ in xml file for ") << detid << std::endl;
277 throw cms::Exception(
"PROBLEM: Wrong inputLUT_ size in xml file for ") << detid << std::endl;
312 double eta_low = 0., eta_high = 0.;
336 float nominalgain_ =
metadata->getNominalGain();
352 bool foundHB =
false;
353 bool foundHE =
false;
354 bool newHBtp =
false;
355 bool newHEtp =
false;
357 for (std::vector<HcalElectronicsId>::const_iterator eId = vIds.begin(); eId != vIds.end(); eId++) {
359 if (foundHB and foundHE)
363 if (hcalTTDetId.null())
366 int aieta =
abs(hcalTTDetId.ieta());
371 auto tpParam =
conditions.getHcalTPChannelParameter(hcalTTDetId,
false);
373 weight = tpParam->getauxi1();
375 if (aieta <= lastHBRing) {
379 }
else if (aieta > lastHBRing and aieta < lastHERing) {
386 for (
const auto&
id :
metadata->getAllChannels()) {
401 unsigned int mipMax = 0;
402 unsigned int mipMin = 0;
403 unsigned int bit12_energy =
405 unsigned int bit13_energy = 0;
406 unsigned int bit14_energy = 999;
407 unsigned int bit15_energy = 999;
429 for (
auto capId : {0, 1, 2, 3}) {
452 auto adc2fC = [channelCoder, shape](
unsigned int adc) {
454 for (
auto capId : {0, 1, 2, 3})
455 fC += channelCoder->
charge(*shape,
adc, capId);
459 int qieType =
conditions.getHcalQIEType(cell)->getValue();
466 else if (qieType ==
QIE11)
477 if (qieType ==
QIE11) {
487 double nonlinearityCorrection = 1.0;
488 double containmentCorrection = 1.0;
496 double correctedCharge = containmentCorrection1TS *
adc2fC(
adc);
497 double containmentCorrection2TSCorrected =
499 if (qieType ==
QIE11) {
503 containmentCorrection = containmentCorrection1TS;
505 containmentCorrection = containmentCorrection2TSCorrected;
510 conditions.getHcalSiPMCharacteristics()->getNonLinearities(siPMParameter.getType()));
511 const double fcByPE = siPMParameter.getFCByPE();
512 const double effectivePixelsFired = correctedCharge / fcByPE;
513 nonlinearityCorrection =
corr.getRecoCorrectionFactor(effectivePixelsFired);
515 containmentCorrection = containmentCorrection2TSCorrected;
521 int((
adc2fC(
adc) - ped) *
gain * rcalib * nonlinearityCorrection * containmentCorrection /
526 int((
adc2fC(
adc) - ped) *
gain * rcalib * nonlinearityCorrection *
527 containmentCorrection / nominalgain_ /
granularity)),
530 unsigned int linearizedADC =
533 if (qieType ==
QIE11) {
534 if ((linearizedADC < bit12_energy and cell.
depth() <= 2)
or (cell.
depth() >= 3))
536 if (linearizedADC >= bit13_energy and cell.
depth() >= 3)
538 if (linearizedADC >= bit14_energy)
540 if (linearizedADC >= bit15_energy)
542 if (
adc >= mipMin and
adc < mipMax)
544 else if (
adc >= mipMax)
575 for (
int i = 0;
i <
df.size();
i++) {
583 for (
int i = 0;
i <
df.size();
i++) {
591 for (
int i = 0;
i <
df.samples();
i++) {
599 for (
int i = 0;
i <
df.samples();
i++) {
612 std::vector<unsigned short> group0LLPbits;
613 group0LLPbits.reserve(
df.samples());
614 for (
int i = 0;
i <
df.samples();
i++) {
615 group0LLPbits.push_back((lut.at(
df[
i].adc()) >> 12) &
618 return group0LLPbits;
623 return ped_.at(lutId);
628 return gain_.at(lutId);
637 msb.resize(
df.size());
638 for (
int i = 0;
i <
df.size(); ++
i)
649 msb.resize(
df.samples());
652 for (
int i = 0;
i <
df.samples(); ++
i) {
661 for (
int i = 0;
i <
df.samples(); ++
i) {
std::vector< uint32_t > FG_HF_thresholds_
std::vector< HcalElectronicsId > allElectronicsIdTrigger() const
static constexpr uint32_t kHcalPhiMask2
double cosh_ieta_28_HE_high_depths_
float getPedestal() const
double linearLSB_QIE11Overlap_
static const int QIE11_LUT_MSB1
constexpr int ietaAbs() const
get the absolute value of the cell ieta
static const int QIE11_LUT_BITMASK
bool valid(const DetId &id) const override
const HcalTopology * topo_
static const int QIE11_LUT_MSB0
void lookupMSB(const HBHEDataFrame &df, std::vector< bool > &msb) const
std::vector< unsigned short > group0FGbits(const QIE11DataFrame &df) const
double cosh_ieta_28_HE_low_depths_
void init(const HcalTopology *top, const HcalTimeSlew *delay)
bool overrideDBweightsAndFilterHB_
static const int QIE8_LUT_BITMASK
bool getMSB(const HcalDetId &id, int adc) const
unsigned short LutElement
void update(const HcalDbService &conditions)
void updateXML(const char *filename)
static const int QIE10_LUT_MSB0
constexpr HcalSubdetector subdet() const
get the subdetector
static const size_t UPGRADE_LUT_SIZE
float getLUTGain(HcalDetId id) const override
std::vector< Lut > inputLUT_
std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const override
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
HcalTopologyMode::TriggerMode triggerMode() const
constexpr int ieta() const
get the cell ieta
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
const HcalTimeSlew * delay_
Abs< T >::type abs(const T &t)
static const float adc2fC[128]
bool overrideDBweightsAndFilterHE_
float getLUTPedestal(HcalDetId id) const override
static const int QIE8_LUT_MSB
uint32_t getValue() const
static constexpr uint32_t kHcalEtaMask2
static const int QIE10_LUT_BITMASK
std::vector< double > cosh_ieta_
std::vector< float > ped_
double cosh_ieta(int ieta, int depth, HcalSubdetector subdet)
constexpr double MaximumFractionalError
std::vector< float > gain_
~HcaluLUTTPGCoder() override
void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const override
std::vector< unsigned int > * getLutFast(uint32_t det_id)
static const size_t INPUT_LUT_SIZE
void towerEtaBounds(int ieta, int version, double &eta1, double &eta2) const
where this tower begins and ends in eta
const HcalDDDRecConstants * dddConstants() const
void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const override
uint32_t getFGBitInfo() const
get FG bit information
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
float getRespGain() const
void make_cosh_ieta_map(void)
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
bool isPlan1(const HcalDetId &id) const
constexpr int iphi() const
get the cell iphi
static const int QIE10_LUT_MSB1
static XMLProcessor * getInstance()
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
uint16_t *__restrict__ uint16_t const *__restrict__ adc
static constexpr uint32_t kHcalDepthMask2
constexpr int depth() const
get the tower depth