Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:11

0001 /** \class QieShape
0002     
0003     basic linearization function for HCAL QIE
0004    $Author: ratnikov
0005 */
0006 
0007 #include <iostream>
0008 
0009 #include "CalibFormats/CastorObjects/interface/QieShape.h"
0010 
0011 namespace reco {
0012   namespace castor {
0013 
0014     QieShape::QieShape(const double fAdcShape[32], const double fAdcBin[32]) {
0015       for (int i = 0; i < 32; i++) {  // initial settings
0016         mLinearization[i] = fAdcShape[i];
0017         mBinSize[i] = fAdcBin[i];
0018         //    std::cout << "QieShape::QieShape-> #/adc/bin: " << i << '/' << fAdcShape [i] << '/' << fAdcBin [i] << std::endl;
0019       }
0020       double factor = 1;
0021       for (int range = 1; range < 4; range++) {
0022         factor = factor * 5;
0023         int offset = 32 * range;
0024         mLinearization[offset] = mLinearization[offset - 2];  // initial overlap
0025         for (int bin = 1; bin < 32; bin++) {
0026           mLinearization[offset + bin] =
0027               mLinearization[offset + bin - 1] +
0028               factor * (mLinearization[bin] - mLinearization[bin - 1]);  // scale initial curve
0029           mBinSize[offset + bin] = factor * mBinSize[bin];
0030         }
0031       }
0032     }
0033 
0034   }  // namespace castor
0035 }  // namespace reco