58 inputLUT_ = std::vector<HcaluLUTTPGCoder::Lut>(nluts);
59 gain_ = std::vector<float>(nluts, 0.);
60 ped_ = std::vector<float>(nluts, 0.);
65 throw cms::Exception(
"PROBLEM: This method should never be invoked!");
103 assert(file.is_open());
105 std::vector<HcalSubdetector> subdet;
109 std::getline(file, buffer);
110 std::getline(file, buffer);
112 unsigned int index = buffer.find(
"H", 0);
113 while (index < buffer.length()){
115 if (subdetStr ==
"HB") subdet.push_back(
HcalBarrel);
116 else if (subdetStr ==
"HE") subdet.push_back(
HcalEndcap);
117 else if (subdetStr ==
"HF") subdet.push_back(
HcalForward);
121 index = buffer.find(
"H", index);
125 size_t nCol = subdet.size();
128 std::vector<int> ietaU;
129 std::vector<int> ietaL;
130 std::vector<int> iphiU;
131 std::vector<int> iphiL;
132 std::vector<int> depU;
133 std::vector<int> depL;
134 std::vector< Lut > lutFromFile(nCol);
137 for (
size_t i=0;
i<nCol; ++
i) {
140 ietaL.push_back(ieta);
143 for (
size_t i=0;
i<nCol; ++
i) {
146 ietaU.push_back(ieta);
149 for (
size_t i=0;
i<nCol; ++
i) {
152 iphiL.push_back(iphi);
155 for (
size_t i=0;
i<nCol; ++
i) {
158 iphiU.push_back(iphi);
161 for (
size_t i=0;
i<nCol; ++
i) {
167 for (
size_t i=0;
i<nCol; ++
i) {
174 for (
size_t i=0; file >> lutValue;
i = (
i+1) % nCol){
175 lutFromFile[
i].push_back(lutValue);
181 for (
size_t i=0;
i<nCol; ++
i){
182 for (
int ieta = ietaL[
i]; ieta <= ietaU[
i]; ++ieta){
183 for (
int iphi = iphiL[
i]; iphi <= iphiU[
i]; ++iphi){
214 for (
int isub=0; isub<3; ++isub) {
219 if (lut==
nullptr)
throw cms::Exception(
"PROBLEM: No inputLUT_ in xml file for ") << detid << std::endl;
236 if (
abs(ieta) == 28) {
252 double eta_low = 0., eta_high = 0.;
258 double eta1 = etas.first;
259 double eta2 = etas.second;
277 assert(metadata !=
nullptr);
298 unsigned int mipMax = 0;
299 unsigned int mipMin = 0;
317 for (
auto capId : {0,1,2,3}){
337 bool isMasked = ( (status &
bitToMask_) > 0 );
340 auto adc2fC = [channelCoder, shape](
unsigned int adc){
342 for (
auto capId : {0,1,2,3}) fC += channelCoder->
charge(*shape,
adc, capId);
354 else if (qieType ==
QIE11)
366 if (isMasked) lut[
adc] = 0;
368 double nonlinearityCorrection = 1.0;
369 double containmentCorrection2TSCorrected = 1.0;
374 double containmentCorrection1TS =
pulseCorr_->correction(cell, 1, correctionPhaseNS,
adc2fC(
adc));
377 double correctedCharge = containmentCorrection1TS*
adc2fC(
adc);
378 containmentCorrection2TSCorrected =
pulseCorr_->correction(cell, 2, correctionPhaseNS, correctedCharge);
382 const double fcByPE = siPMParameter.getFCByPE();
383 const double effectivePixelsFired = correctedCharge/fcByPE;
384 nonlinearityCorrection = corr.getRecoCorrectionFactor(effectivePixelsFired);
401 if (isMasked) lut[
adc] = 0;
414 for (
int i=0;
i<df.
size();
i++){
422 for (
int i=0;
i<df.
size();
i++){
450 return ped_.at(lutId);
455 return gain_.at(lutId);
464 msb.resize(df.
size());
465 for (
int i=0;
i<df.
size(); ++
i)
int adc(sample_type sample)
get the ADC sample (12 bits)
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_
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_
static const int QIE8_LUT_BITMASK
HcalTopologyMode::TriggerMode triggerMode() const
unsigned short LutElement
void update(const HcalDbService &conditions)
static const int kHcalDepthMask2
void updateXML(const char *filename)
static const int QIE10_LUT_MSB
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
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
unsigned int FG_HF_threshold_
HcaluLUTTPGCoder(const HcalTopology *topo, const edm::ESHandle< HcalTimeSlew > &delay)
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
static const int kHcalPhiMask2
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
~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
const edm::ESHandle< HcalTimeSlew > & delay_
bool getMSB(const HcalDetId &id, int adc) const
float getLUTPedestal(HcalDetId id) const override
static const int kHcalEtaMask2
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 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.