40 float correctionFactor = 1.0;
56 edm::LogError(
"EcalLaserDbService") <<
" DetId is NOT in ECAL" << endl;
57 return correctionFactor;
86 edm::LogError(
"EcalLaserDbService") <<
" DetId is NOT in ECAL Barrel or Endcap" << endl;
87 return correctionFactor;
94 if (itratio != laserRatiosMap.
end()) {
95 apdpnpair = (*itratio);
97 edm::LogError(
"EcalLaserDbService") <<
"error with laserRatiosMap!" << endl;
98 return correctionFactor;
101 if (iLM-1< (
int)laserTimeMap.size()) {
102 timestamp = laserTimeMap[iLM-1];
104 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
105 return correctionFactor;
109 if ( itref != laserRefMap.
end() ) {
112 edm::LogError(
"EcalLaserDbService") <<
"error with laserRefMap!" << endl;
113 return correctionFactor;
117 if ( italpha != laserAlphaMap.
end() ) {
120 edm::LogError(
"EcalLaserDbService") <<
"error with laserAlphaMap!" << endl;
121 return correctionFactor;
142 float p_i = 0, p_f = 0;
149 }
else if ( t >= timestamp.
t2.
value() && t <= timestamp.
t3.
value() ) {
154 }
else if ( t < timestamp.
t1.
value() ) {
161 }
else if ( t > timestamp.
t3.
value() ) {
170 if ( apdpnref != 0 && (t_i - t_f) != 0) {
171 float interpolatedLaserResponse = p_i/apdpnref + (t-t_i)*(p_f-p_i)/apdpnref/(t_f-t_i);
172 if ( interpolatedLaserResponse <= 0 ) {
173 edm::LogError(
"EcalLaserDbService") <<
"The interpolated laser correction is <= zero! ("
174 << interpolatedLaserResponse <<
"). Using 1. as correction factor.";
175 return correctionFactor;
177 correctionFactor = 1/
pow(interpolatedLaserResponse,alpha);
182 <<
"apdpnref (" << apdpnref <<
") "
183 <<
"or t_i-t_f (" << (t_i - t_f) <<
" is zero!";
184 return correctionFactor;
187 return correctionFactor;
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 EcalLaserAPDPNRatiosMap & getLaserMap() const
const EcalLaserAPDPNRatiosRef * mAPDPNRatiosRef_
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned long long TimeValue_t
#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_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)