101 inputLUT_ = std::vector<HcaluLUTTPGCoder::Lut>(nluts);
102 gain_ = std::vector<float>(nluts, 0.);
103 ped_ = std::vector<float>(nluts, 0.);
108 throw cms::Exception(
"PROBLEM: This method should never be invoked!");
146 assert(file.is_open());
148 std::vector<HcalSubdetector> subdet;
152 std::getline(file, buffer);
153 std::getline(file, buffer);
155 unsigned int index = buffer.find(
"H", 0);
156 while (index < buffer.length()){
158 if (subdetStr ==
"HB") subdet.push_back(
HcalBarrel);
159 else if (subdetStr ==
"HE") subdet.push_back(
HcalEndcap);
160 else if (subdetStr ==
"HF") subdet.push_back(
HcalForward);
164 index = buffer.find(
"H", index);
168 size_t nCol = subdet.size();
171 std::vector<int> ietaU;
172 std::vector<int> ietaL;
173 std::vector<int> iphiU;
174 std::vector<int> iphiL;
175 std::vector<int> depU;
176 std::vector<int> depL;
177 std::vector< Lut > lutFromFile(nCol);
180 for (
size_t i=0;
i<nCol; ++
i) {
183 ietaL.push_back(ieta);
186 for (
size_t i=0;
i<nCol; ++
i) {
189 ietaU.push_back(ieta);
192 for (
size_t i=0;
i<nCol; ++
i) {
195 iphiL.push_back(iphi);
198 for (
size_t i=0;
i<nCol; ++
i) {
201 iphiU.push_back(iphi);
204 for (
size_t i=0;
i<nCol; ++
i) {
210 for (
size_t i=0;
i<nCol; ++
i) {
217 for (
size_t i=0; file >> lutValue;
i = (
i+1) % nCol){
218 lutFromFile[
i].push_back(lutValue);
224 for (
size_t i=0;
i<nCol; ++
i){
225 for (
int ieta = ietaL[
i]; ieta <= ietaU[
i]; ++ieta){
226 for (
int iphi = iphiL[
i]; iphi <= iphiU[
i]; ++iphi){
257 for (
int isub=0; isub<3; ++isub) {
262 if (lut==
nullptr)
throw cms::Exception(
"PROBLEM: No inputLUT_ in xml file for ") << detid << std::endl;
279 if (
abs(ieta) == 28) {
295 double eta_low = 0., eta_high = 0.;
301 double eta1 = etas.first;
302 double eta2 = etas.second;
319 assert(metadata !=
nullptr);
340 unsigned int mipMax = 0;
341 unsigned int mipMin = 0;
359 for (
auto capId : {0,1,2,3}){
379 bool isMasked = ( (status &
bitToMask_) > 0 );
382 auto adc2fC = [channelCoder, shape](
unsigned int adc){
384 for (
auto capId : {0,1,2,3}) fC += channelCoder->
charge(*shape,
adc, capId);
396 else if (qieType ==
QIE11)
408 if (isMasked) lut[
adc] = 0;
410 double nonlinearityCorrection = 1.0;
411 double containmentCorrection2TSCorrected = 1.0;
416 double containmentCorrection1TS =
pulseCorr_->correction(cell, 1, correctionPhaseNS,
adc2fC(
adc));
419 double correctedCharge = containmentCorrection1TS*
adc2fC(
adc);
420 containmentCorrection2TSCorrected =
pulseCorr_->correction(cell, 2, correctionPhaseNS, correctedCharge);
424 const double fcByPE = siPMParameter.getFCByPE();
425 const double effectivePixelsFired = correctedCharge/fcByPE;
426 nonlinearityCorrection = corr.getRecoCorrectionFactor(effectivePixelsFired);
443 if (isMasked) lut[
adc] = 0;
457 for (
int i=0;
i<df.
size();
i++){
465 for (
int i=0;
i<df.
size();
i++){
493 return ped_.at(lutId);
498 return gain_.at(lutId);
507 msb.resize(df.
size());
508 for (
int i=0;
i<df.
size(); ++
i)
std::vector< uint32_t > FG_HF_thresholds_
int samples() const
total number of samples in the digi
float getPedestal() const
void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const override
const HcalDDDRecConstants * dddConstants() const
double cosh_ieta_28_HE_high_depths_
HcalSubdetector subdet() const
get the subdetector
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId) const
bool valid(const DetId &id) const override
double linearLSB_QIE11Overlap_
static uint32_t kHcalEtaMask2
const HcalRecoParam * getHcalRecoParam(const HcalGenericDetId &fId) const
static const int QIE11_LUT_MSB1
static const int QIE11_LUT_BITMASK
const HcalChannelStatus * getHcalChannelStatus(const HcalGenericDetId &fId) const
float getLUTGain(HcalDetId id) const override
int size() const
total number of samples in the digi
const HcalTopology * topo_
edm::DataFrame::id_type id() const
static const int QIE11_LUT_MSB0
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)
static const int QIE8_LUT_BITMASK
HcalTopologyMode::TriggerMode triggerMode() const
unsigned short LutElement
void update(const HcalDbService &conditions)
void updateXML(const char *filename)
static const int QIE10_LUT_MSB0
static const size_t UPGRADE_LUT_SIZE
int depth() const
get the tower depth
void lookupMSB(const HBHEDataFrame &df, std::vector< bool > &msb) const
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
float getRespGain() const
double MaximumFractionalError
HcalDetId const & id() const
std::vector< DetId > getAllChannels() const
constexpr float correctionPhaseNS() const
int maxDepth(HcalSubdetector subdet) const
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
static uint32_t kHcalDepthMask2
const HcalTimeSlew * delay_
const HcalL1TriggerObject * getHcalL1TriggerObject(const HcalGenericDetId &fId) const
constexpr double effpedestal(int fCapId) const
get effective pedestal for capid=0..3
int ieta() const
get the cell ieta
edm::DataFrame::id_type id() const
Abs< T >::type abs(const T &t)
const HcalLutMetadata * getHcalLutMetadata() const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
static const int QIE8_LUT_MSB
constexpr int adc() const
get the ADC sample
static const int QIE10_LUT_BITMASK
int ietaAbs() const
get the absolute value of the cell ieta
const HcalQIEType * getHcalQIEType(const HcalGenericDetId &fId) const
std::vector< double > cosh_ieta_
int iphi() const
get the cell iphi
std::vector< float > ped_
double cosh_ieta(int ieta, int depth, HcalSubdetector subdet)
std::vector< float > gain_
int size() const
total number of samples in the digi
HcalQIESample const & sample(int i) const
access a sample
static uint32_t kHcalPhiMask2
~HcaluLUTTPGCoder() 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
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
bool getMSB(const HcalDetId &id, int adc) const
float getLUTPedestal(HcalDetId id) const override
uint32_t getFGBitInfo() const
get FG bit information
const HcalDetId & id() const
bool isPlan1(const HcalDetId &id) const
void make_cosh_ieta_map(void)
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
int samples() const
total number of samples in the digi
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
static const int QIE10_LUT_MSB1
static XMLProcessor * getInstance()
void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const override
std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const override
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
std::vector< Lut > inputLUT_
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.