21 mLinearCorrections_ (0)
45 float correctionFactor = 1.0;
65 edm::LogError(
"EcalLaserDbService") <<
" DetId is NOT in ECAL" << endl;
66 return correctionFactor;
95 edm::LogError(
"EcalLaserDbService") <<
" DetId is NOT in ECAL Barrel or Endcap" << endl;
96 return correctionFactor;
103 if (itratio != laserRatiosMap.
end()) {
104 apdpnpair = (*itratio);
106 edm::LogError(
"EcalLaserDbService") <<
"error with laserRatiosMap!" << endl;
107 return correctionFactor;
110 if (iLM-1< (
int)laserTimeMap.size()) {
111 timestamp = laserTimeMap[iLM-1];
113 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
114 return correctionFactor;
118 if (itlin != linearValueMap.
end()) {
119 linValues = (*itlin);
121 edm::LogError(
"EcalLaserDbService") <<
"error with linearValueMap!" << endl;
122 return correctionFactor;
125 if (iLM-1< (
int)linearTimeMap.size()) {
126 linTimes = linearTimeMap[iLM-1];
128 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
129 return correctionFactor;
133 if ( itref != laserRefMap.
end() ) {
136 edm::LogError(
"EcalLaserDbService") <<
"error with laserRefMap!" << endl;
137 return correctionFactor;
141 if ( italpha != laserAlphaMap.
end() ) {
144 edm::LogError(
"EcalLaserDbService") <<
"error with laserAlphaMap!" << endl;
145 return correctionFactor;
166 float p_i = 0, p_f = 0;
168 float lp_i = 0, lp_f = 0;
175 }
else if ( t >= timestamp.
t2.
value() && t <= timestamp.
t3.
value() ) {
180 }
else if ( t < timestamp.
t1.
value() ) {
187 }
else if ( t > timestamp.
t3.
value() ) {
201 }
else if ( t >= linTimes.
t2.
value() && t <= linTimes.
t3.
value() ) {
206 }
else if ( t < linTimes.
t1.
value() ) {
213 }
else if ( t > linTimes.
t3.
value() ) {
222 if ( apdpnref != 0 && (t_i - t_f) != 0 && (lt_i - lt_f) != 0) {
223 float interpolatedLaserResponse = p_i/apdpnref + (t-t_i)*(p_f-p_i)/apdpnref/(t_f-t_i);
224 float interpolatedLinearResponse = lp_i/apdpnref + (t-lt_i)*(lp_f-lp_i)/apdpnref/(lt_f-lt_i);
226 if(interpolatedLinearResponse >2 || interpolatedLinearResponse <0.1) interpolatedLinearResponse=1;
227 if ( interpolatedLaserResponse <= 0 ) {
228 edm::LogWarning(
"EcalLaserDbService") <<
"The interpolated laser correction is <= zero! ("
229 << interpolatedLaserResponse <<
"). Using 1. as correction factor.";
230 return correctionFactor;
233 float interpolatedTransparencyResponse = interpolatedLaserResponse / interpolatedLinearResponse;
235 correctionFactor = 1/(
pow(interpolatedTransparencyResponse,alpha) *interpolatedLinearResponse );
241 <<
"apdpnref (" << apdpnref <<
") "
242 <<
"or t_i-t_f (" << (t_i - t_f) <<
" is zero!";
243 return correctionFactor;
246 return correctionFactor;
const EcalTimeMap & getTimeMap() const
const EcalLaserAPDPNRatios * getAPDPNRatios() const
const self & getMap() const
float getLaserCorrection(DetId const &xid, edm::Timestamp const &iTime) const
static int lmr(EBGlobalCoord ieta, EBGlobalCoord iphi)
uint32_t rawId() const
get the raw id
const EcalLinearCorrections * mLinearCorrections_
const EcalLaserAPDPNRatiosMap & getLaserMap() const
const EcalLaserAPDPNRatiosRef * mAPDPNRatiosRef_
const EcalValueMap & getValueMap() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned long long TimeValue_t
std::vector< Times > EcalTimeMap
#define TYPELOOKUP_DATA_REG(_dataclass_)
TimeValue_t value() const
const EcalLaserAlphas * getAlphas() const
const EcalLaserTimeStampMap & getTimeMap() const
std::vector< EcalLaserTimeStamp > EcalLaserTimeStampMap
const EcalLaserAPDPNRatios * mAPDPNRatios_
std::vector< Item >::const_iterator const_iterator
const EcalLaserAlphas * mAlphas_
const EcalLaserAPDPNRatiosRef * getAPDPNRatiosRef() const
const EcalLinearCorrections * getLinearCorrections() const
const_iterator find(uint32_t rawId) const
const_iterator end() const
Detector det() const
get the detector field from this detid
static int lmr(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Power< A, B >::type pow(const A &a, const B &b)