47 gain_ = std::vector<float>(nluts, 0.);
48 ped_ = std::vector<float>(nluts, 0.);
52 throw cms::Exception(
"PROBLEM: This method should never be invoked!");
92 std::vector<HcalSubdetector> subdet;
96 std::getline(file, buffer);
97 std::getline(file, buffer);
99 unsigned int index = buffer.find(
"H", 0);
100 while (index < buffer.length()){
102 if (subdetStr ==
"HB") subdet.push_back(
HcalBarrel);
103 else if (subdetStr ==
"HE") subdet.push_back(
HcalEndcap);
104 else if (subdetStr ==
"HF") subdet.push_back(
HcalForward);
108 index = buffer.find(
"H", index);
112 size_t nCol = subdet.size();
115 std::vector<int> ietaU;
116 std::vector<int> ietaL;
117 std::vector<int> iphiU;
118 std::vector<int> iphiL;
119 std::vector<int> depU;
120 std::vector<int> depL;
121 std::vector< Lut > lutFromFile(nCol);
124 for (
size_t i=0;
i<nCol; ++
i) {
127 ietaL.push_back(ieta);
130 for (
size_t i=0;
i<nCol; ++
i) {
133 ietaU.push_back(ieta);
136 for (
size_t i=0;
i<nCol; ++
i) {
139 iphiL.push_back(iphi);
142 for (
size_t i=0;
i<nCol; ++
i) {
145 iphiU.push_back(iphi);
148 for (
size_t i=0;
i<nCol; ++
i) {
154 for (
size_t i=0;
i<nCol; ++
i) {
161 for (
size_t i=0; file >> lutValue;
i = (
i+1) % nCol){
162 lutFromFile[
i].push_back(lutValue);
168 for (
size_t i=0;
i<nCol; ++
i){
169 for (
int ieta = ietaL[
i]; ieta <= ietaU[
i]; ++ieta){
170 for (
int iphi = iphiL[
i]; iphi <= iphiU[
i]; ++iphi){
201 for (
int isub=0; isub<3; ++isub) {
206 if (lut==0)
throw cms::Exception(
"PROBLEM: No inputLUT_ in xml file for ") << detid << std::endl;
207 if (lut->size()!=128)
throw cms::Exception (
"PROBLEM: Wrong inputLUT_ size in xml file for ") << detid << std::endl;
224 std::map<int, float> cosh_ieta;
227 double eta1 = etas.first;
228 double eta2 = etas.second;
229 cosh_ieta[
i] = cosh((eta1 + eta2)/2.);
233 for (
int isub = 0; isub < 3; ++isub){
254 for (
int capId = 0; capId < 4; ++capId){
255 ped += calibrations.
pedestal(capId);
274 bool isMasked = ( (status &
bitToMask_) > 0 );
287 coder.
adc2fC(frame,samples);
288 float adc2fC = samples[0];
301 coder.
adc2fC(frame,samples);
302 float adc2fC = samples[0];
317 for (
int i=0;
i<df.
size();
i++){
318 ics[
i] = (lut.at(df[
i].
adc()) & 0x3FF);
325 for (
int i=0;
i<df.
size();
i++){
326 ics[
i] = (lut.at(df[
i].
adc()) & 0x3FF);
332 return ((
inputLUT_.at(lutId)).at(sample.
adc()) & 0x3FF);
337 return ped_.at(lutId);
342 return gain_.at(lutId);
351 msb.resize(df.
size());
352 for (
int i=0;
i<df.
size(); ++
i)
359 return (lut.at(adc) & 0x400);
int adc(sample_type sample)
get the ADC sample (12 bits)
float getPedestal() const
HcalSubdetector subdet() const
get the subdetector
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_
double pedestal(int fCapId) const
get pedestal for capid=0..3
const Item * getValues(DetId fId, bool throwOnFail=true) const
unsigned short LutElement
void update(const HcalDbService &conditions)
virtual float getLUTPedestal(HcalDetId id) const
static const int kHcalDepthMask2
void updateXML(const char *filename)
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
Abs< T >::type abs(const T &t)
std::vector< unsigned short > getLinearizationLUTWithMSB(const HcalDetId &id) const
const HcalLutMetadata * getHcalLutMetadata() const
std::vector< LutElement > Lut
void setSample(int i, const HcalQIESample &sam)
virtual float getLUTGain(HcalDetId id) 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
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)
bool getMSB(const HcalDetId &id, int adc) const
static const int kHcalEtaMask2
const HcalDetId & id() const
virtual void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const
const HcalDetId & id() const
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
virtual void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const
tuple size
Write out results.
static XMLProcessor * getInstance()
std::vector< Lut > inputLUT_