56 gain_ = std::vector<float>(nluts, 0.);
57 ped_ = std::vector<float>(nluts, 0.);
61 throw cms::Exception(
"PROBLEM: This method should never be invoked!");
101 std::vector<HcalSubdetector> subdet;
105 std::getline(file, buffer);
106 std::getline(file, buffer);
108 unsigned int index = buffer.find(
"H", 0);
109 while (index < buffer.length()){
111 if (subdetStr ==
"HB") subdet.push_back(
HcalBarrel);
112 else if (subdetStr ==
"HE") subdet.push_back(
HcalEndcap);
113 else if (subdetStr ==
"HF") subdet.push_back(
HcalForward);
117 index = buffer.find(
"H", index);
121 size_t nCol = subdet.size();
124 std::vector<int> ietaU;
125 std::vector<int> ietaL;
126 std::vector<int> iphiU;
127 std::vector<int> iphiL;
128 std::vector<int> depU;
129 std::vector<int> depL;
130 std::vector< Lut > lutFromFile(nCol);
133 for (
size_t i=0;
i<nCol; ++
i) {
136 ietaL.push_back(ieta);
139 for (
size_t i=0;
i<nCol; ++
i) {
142 ietaU.push_back(ieta);
145 for (
size_t i=0;
i<nCol; ++
i) {
148 iphiL.push_back(iphi);
151 for (
size_t i=0;
i<nCol; ++
i) {
154 iphiU.push_back(iphi);
157 for (
size_t i=0;
i<nCol; ++
i) {
163 for (
size_t i=0;
i<nCol; ++
i) {
170 for (
size_t i=0; file >> lutValue;
i = (
i+1) % nCol){
171 lutFromFile[
i].push_back(lutValue);
177 for (
size_t i=0;
i<nCol; ++
i){
178 for (
int ieta = ietaL[
i]; ieta <= ietaU[
i]; ++ieta){
179 for (
int iphi = iphiL[
i]; iphi <= iphiU[
i]; ++iphi){
210 for (
int isub=0; isub<3; ++isub) {
215 if (lut==0)
throw cms::Exception(
"PROBLEM: No inputLUT_ in xml file for ") << detid << std::endl;
233 std::map<int, float> cosh_ieta;
236 double eta1 = etas.first;
237 double eta2 = etas.second;
238 cosh_ieta[
i] = cosh((eta1 + eta2)/2.);
242 for (
int isub = 0; isub < 3; ++isub){
255 unsigned int mipMax = 0;
256 unsigned int mipMin = 0;
271 for (
int capId = 0; capId < 4; ++capId){
272 ped += calibrations.
pedestal(capId);
290 bool isMasked = ( (status &
bitToMask_) > 0 );
303 coder.
adc2fC(frame,samples);
304 float adc2fC = samples[0];
310 unsigned short data[] = {0, 0, 0};
315 coder.
adc2fC(upgradeFrame, upgradeSamples);
316 float adc2fC = upgradeSamples[0];
322 if (
adc >= mipMin and
adc < mipMax)
324 else if (
adc >= mipMax)
336 coder.
adc2fC(frame,samples);
337 float adc2fC = samples[0];
342 unsigned short data[] = {0, 0, 0, 0};
347 coder.
adc2fC(upgradeFrame, upgradeSamples);
348 float adc2fC = upgradeSamples[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
void setSample(edm::DataFrame::size_type isample, int adc, int tdc, bool soi=false)
set the sample contents
float getPedestal() const
HcalSubdetector subdet() const
get the subdetector
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId) const
static const int QIE11_LUT_MSB1
static const int QIE11_LUT_BITMASK
virtual ~HcaluLUTTPGCoder()
const HcalChannelStatus * getHcalChannelStatus(const HcalGenericDetId &fId) const
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
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 size_t UPGRADE_LUT_SIZE
virtual float getLUTGain(HcalDetId id) const override
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
void setSample(int i, const HcalQIESample &sam)
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
int maxDepth(HcalSubdetector subdet) const
const HcalL1TriggerObject * getHcalL1TriggerObject(const HcalGenericDetId &fId) const
int ieta() const
get the cell ieta
edm::DataFrame::id_type id() const
Abs< T >::type abs(const T &t)
std::vector< unsigned short > getLinearizationLUTWithMSB(const HcalDetId &id) const
const HcalLutMetadata * getHcalLutMetadata() const
std::vector< LutElement > Lut
virtual float getLUTPedestal(HcalDetId id) const override
void setSample(int i, const HcalQIESample &sam)
static const int QIE8_LUT_MSB
std::vector< Lut > upgradeQIE11LUT_
static const int QIE10_LUT_BITMASK
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
virtual void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const override
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
virtual bool valid(const DetId &id) const
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)
char data[epos_bytes_allocation]
bool getMSB(const HcalDetId &id, int adc) const
static const int kHcalEtaMask2
uint32_t getFGBitInfo() const
get FG bit information
std::vector< Lut > upgradeQIE10LUT_
const HcalDetId & id() const
virtual void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const override
const HcalDetId & id() const
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
void setSample(edm::DataFrame::size_type isample, int adc, int le_tdc, int te_tdc, int capid, bool soi=false, bool ok=true)
set the sample contents
int samples() const
total number of samples in the digi
static const std::string subdets[7]
tuple size
Write out results.
static XMLProcessor * getInstance()
std::vector< Lut > inputLUT_