56 inputLUT_ = std::vector<HcaluLUTTPGCoder::Lut>(nluts);
57 gain_ = std::vector<float>(nluts, 0.);
58 ped_ = std::vector<float>(nluts, 0.);
62 throw cms::Exception(
"PROBLEM: This method should never be invoked!");
100 assert(file.is_open());
102 std::vector<HcalSubdetector> subdet;
106 std::getline(file, buffer);
107 std::getline(file, buffer);
109 unsigned int index = buffer.find(
"H", 0);
110 while (index < buffer.length()){
112 if (subdetStr ==
"HB") subdet.push_back(
HcalBarrel);
113 else if (subdetStr ==
"HE") subdet.push_back(
HcalEndcap);
114 else if (subdetStr ==
"HF") subdet.push_back(
HcalForward);
118 index = buffer.find(
"H", index);
122 size_t nCol = subdet.size();
125 std::vector<int> ietaU;
126 std::vector<int> ietaL;
127 std::vector<int> iphiU;
128 std::vector<int> iphiL;
129 std::vector<int> depU;
130 std::vector<int> depL;
131 std::vector< Lut > lutFromFile(nCol);
134 for (
size_t i=0;
i<nCol; ++
i) {
137 ietaL.push_back(ieta);
140 for (
size_t i=0;
i<nCol; ++
i) {
143 ietaU.push_back(ieta);
146 for (
size_t i=0;
i<nCol; ++
i) {
149 iphiL.push_back(iphi);
152 for (
size_t i=0;
i<nCol; ++
i) {
155 iphiU.push_back(iphi);
158 for (
size_t i=0;
i<nCol; ++
i) {
164 for (
size_t i=0;
i<nCol; ++
i) {
171 for (
size_t i=0; file >> lutValue;
i = (
i+1) % nCol){
172 lutFromFile[
i].push_back(lutValue);
178 for (
size_t i=0;
i<nCol; ++
i){
179 for (
int ieta = ietaL[
i]; ieta <= ietaU[
i]; ++ieta){
180 for (
int iphi = iphiL[
i]; iphi <= iphiU[
i]; ++iphi){
211 for (
int isub=0; isub<3; ++isub) {
216 if (lut==
nullptr)
throw cms::Exception(
"PROBLEM: No inputLUT_ in xml file for ") << detid << std::endl;
231 assert(metadata !=
nullptr);
235 std::map<int, float> cosh_ieta;
237 double eta_low = 0., eta_high = 0.;
239 cosh_ieta[
i] = fabs(cosh((eta_low + eta_high)/2.));
243 double eta1 = etas.first;
244 double eta2 = etas.second;
245 cosh_ieta[
i] = cosh((eta1 + eta2)/2.);
262 unsigned int mipMax = 0;
263 unsigned int mipMin = 0;
281 for (
auto capId : {0,1,2,3}){
282 ped += calibrations.
pedestal(capId);
301 bool isMasked = ( (status &
bitToMask_) > 0 );
304 auto adc2fC = [channelCoder, shape](
unsigned int adc){
306 for (
auto capId : {0,1,2,3}) fC += channelCoder->
charge(*shape,
adc, capId);
318 else if (qieType ==
QIE11)
329 if (isMasked) lut[
adc] = 0;
331 double nonlinearityCorrection = 1.0;
335 const double fcByPE = siPMParameter.getFCByPE();
336 const double effectivePixelsFired =
adc2fC(
adc)/fcByPE;
337 nonlinearityCorrection = corr.getRecoCorrectionFactor(effectivePixelsFired);
353 if (isMasked) lut[
adc] = 0;
366 for (
int i=0;
i<df.
size();
i++){
374 for (
int i=0;
i<df.
size();
i++){
402 return ped_.at(lutId);
407 return gain_.at(lutId);
416 msb.resize(df.
size());
417 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
HcalSubdetector subdet() const
get the subdetector
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId) const
bool valid(const DetId &id) const override
double linearLSB_QIE11Overlap_
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 adc() const
get the ADC sample
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
double pedestal(int fCapId) const
get pedestal for capid=0..3
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
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
std::vector< DetId > getAllChannels() 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
int ieta() const
get the cell ieta
edm::DataFrame::id_type id() const
const HcalLutMetadata * getHcalLutMetadata() const
unsigned int FG_HF_threshold_
static const int QIE8_LUT_MSB
static const int QIE10_LUT_BITMASK
int ietaAbs() const
get the absolute value of the cell ieta
const HcalQIEType * getHcalQIEType(const HcalGenericDetId &fId) const
int iphi() const
get the cell iphi
static const int kHcalPhiMask2
double LUTrespcorrgain(int fCapId) const
get LUT corrected and response corrected gain for capid=0..3
std::vector< float > ped_
std::vector< float > gain_
int size() const
total number of samples in the digi
const HcalQIESample & sample(int i) const
access a sample
~HcaluLUTTPGCoder() override
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
HcaluLUTTPGCoder(const HcalTopology *topo)
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
const HcalDetId & id() const
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
int samples() const
total number of samples in the digi
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.