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;
160 std::getline(file, buffer);
161 std::getline(file, buffer);
163 unsigned int index = buffer.find(
'H', 0);
164 while (index < buffer.length()) {
166 if (subdetStr ==
"HB")
168 else if (subdetStr ==
"HE")
170 else if (subdetStr ==
"HF")
175 index = buffer.find(
'H', index);
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) {
237 for (
int ieta = ietaL[
i]; ieta <= ietaU[
i]; ++ieta) {
238 for (
int iphi = iphiL[
i]; iphi <= iphiU[
i]; ++iphi) {
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;
295 if (
abs(ieta) == 28) {
312 double eta_low = 0., eta_high = 0.;
318 double eta1 = etas.first;
319 double eta2 = etas.second;
335 assert(metadata !=
nullptr);
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());
375 if (aieta <= lastHBRing) {
379 }
else if (aieta > lastHBRing and aieta < lastHERing) {
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);
466 else if (qieType ==
QIE11)
477 if (qieType ==
QIE11) {
487 double nonlinearityCorrection = 1.0;
488 double containmentCorrection = 1.0;
493 double containmentCorrection1TS =
pulseCorr_->correction(cell, 1, correctionPhaseNS,
adc2fC(
adc));
496 double correctedCharge = containmentCorrection1TS *
adc2fC(
adc);
497 double containmentCorrection2TSCorrected =
498 pulseCorr_->correction(cell, 2, correctionPhaseNS, correctedCharge);
499 if (qieType ==
QIE11) {
503 containmentCorrection = containmentCorrection1TS;
505 containmentCorrection = containmentCorrection2TSCorrected;
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++) {
612 std::vector<unsigned short> group0LLPbits;
613 group0LLPbits.reserve(df.
samples());
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)
std::vector< uint32_t > FG_HF_thresholds_
float getPedestal() const
static constexpr uint32_t kHcalPhiMask2
const HcalDDDRecConstants * dddConstants() const
double cosh_ieta_28_HE_high_depths_
constexpr int ietaAbs() const
get the absolute value of the cell ieta
uint16_t *__restrict__ id
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
double linearLSB_QIE11Overlap_
const HcalRecoParam * getHcalRecoParam(const HcalGenericDetId &fId) const
static const int QIE11_LUT_MSB1
constexpr edm::DataFrame::id_type id() const
static const int QIE11_LUT_BITMASK
const HcalChannelStatus * getHcalChannelStatus(const HcalGenericDetId &fId) const
bool valid(const DetId &id) const override
const HcalTopology * topo_
static const int QIE11_LUT_MSB0
constexpr const HcalDetId & id() const
tuple correctionPhaseNS
from Configuration.AlCa.GlobalTag import GlobalTag as gtCustomise process.GlobalTag = gtCustomise(pro...
void towerEtaBounds(int ieta, int version, double &eta1, double &eta2) const
where this tower begins and ends in eta
const Item * getValues(DetId fId, bool throwOnFail=true) const
double cosh_ieta_28_HE_low_depths_
void init(const HcalTopology *top, const HcalTimeSlew *delay)
bool overrideDBweightsAndFilterHB_
static const int QIE8_LUT_BITMASK
std::vector< unsigned short > group0FGbits(const QIE11DataFrame &df) const
HcalTopologyMode::TriggerMode triggerMode() const
unsigned short LutElement
void update(const HcalDbService &conditions)
void updateXML(const char *filename)
std::vector< HcalElectronicsId > allElectronicsIdTrigger() const
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_
void lookupMSB(const HBHEDataFrame &df, std::vector< bool > &msb) const
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const override
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
float getRespGain() const
constexpr int iphi() const
get the cell iphi
constexpr int size() const
total number of samples in the digi
std::vector< DetId > getAllChannels() const
constexpr float correctionPhaseNS() const
const HcalTimeSlew * delay_
const HcalL1TriggerObject * getHcalL1TriggerObject(const HcalGenericDetId &fId) const
constexpr double effpedestal(int fCapId) const
get effective pedestal for capid=0..3
Abs< T >::type abs(const T &t)
static const float adc2fC[128]
constexpr int ieta() const
get the cell ieta
const HcalLutMetadata * getHcalLutMetadata() const
constexpr HcalQIESample const & sample(int i) const
access a sample
bool overrideDBweightsAndFilterHE_
float getLUTPedestal(HcalDetId id) const override
static const int QIE8_LUT_MSB
static constexpr uint32_t kHcalEtaMask2
constexpr int adc() const
get the ADC sample
static const int QIE10_LUT_BITMASK
constexpr int size() const
total number of samples in the digi
const HcalQIEType * getHcalQIEType(const HcalGenericDetId &fId) const
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_
constexpr int samples() const
total number of samples in the digi
~HcaluLUTTPGCoder() override
void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const override
constexpr double LUTrespcorrgain(int fCapId) const
get LUT corrected and response corrected gain for capid=0..3
const HcalSiPMCharacteristics * getHcalSiPMCharacteristics() const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
constexpr int samples() const
total number of samples in the digi
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
std::vector< unsigned int > * getLutFast(uint32_t det_id)
static const size_t INPUT_LUT_SIZE
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
constexpr edm::DataFrame::id_type id() const
bool getMSB(const HcalDetId &id, int adc) const
const HcalElectronicsMap * getHcalMapping() const
uint32_t getFGBitInfo() const
get FG bit information
void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const override
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
bool isPlan1(const HcalDetId &id) const
constexpr int depth() const
get the tower depth
void make_cosh_ieta_map(void)
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId, bool throwOnFail=true) const
tuple size
Write out results.
static const int QIE10_LUT_MSB1
static XMLProcessor * getInstance()
uint16_t *__restrict__ uint16_t const *__restrict__ adc
constexpr HcalDetId const & id() const
static constexpr uint32_t kHcalDepthMask2
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.