27 float correctionFactor = 1.0;
45 edm::LogError(
"EcalLaserDbService") <<
" DetId is NOT in ECAL" << endl;
46 return correctionFactor;
65 edm::LogError(
"EcalLaserDbService") <<
" DetId is NOT in ECAL Barrel or Endcap" << endl;
66 return correctionFactor;
74 if (itratio != laserRatiosMap.
end()) {
75 apdpnpair = (*itratio);
77 edm::LogError(
"EcalLaserDbService") <<
"error with laserRatiosMap!" << endl;
78 return correctionFactor;
81 if (iLM - 1 < (
int)laserTimeMap.size()) {
82 timestamp = laserTimeMap[iLM - 1];
84 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
85 return correctionFactor;
89 if (itlin != linearValueMap.
end()) {
92 edm::LogError(
"EcalLaserDbService") <<
"error with linearValueMap!" << endl;
93 return correctionFactor;
96 if (iLM - 1 < (
int)linearTimeMap.size()) {
97 linTimes = linearTimeMap[iLM - 1];
99 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
100 return correctionFactor;
104 if (itref != laserRefMap.
end()) {
107 edm::LogError(
"EcalLaserDbService") <<
"error with laserRefMap!" << endl;
108 return correctionFactor;
112 if (italpha != laserAlphaMap.
end()) {
115 edm::LogError(
"EcalLaserDbService") <<
"error with laserAlphaMap!" << endl;
116 return correctionFactor;
123 return isBarrel ?
cond.barrel(xind) :
cond.endcap(xind);
128 return isBarrel ?
cond.barrel(xind) :
cond.endcap(xind);
132 return isBarrel ?
cond.barrel(xind) :
cond.endcap(xind);
135 apdpnpair = getPair(laserRatiosMap);
136 linValues = getLinear(linearValueMap);
137 apdpnref = getCond(laserRefMap);
138 alpha = getCond(laserAlphaMap);
140 if (iLM - 1 < (
int)laserTimeMap.size()) {
141 timestamp = laserTimeMap[iLM - 1];
143 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
144 return correctionFactor;
147 if (iLM - 1 < (
int)linearTimeMap.size()) {
148 linTimes = linearTimeMap[iLM - 1];
150 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
151 return correctionFactor;
167 long long t_i = 0, t_f = 0;
168 float p_i = 0, p_f = 0;
169 long long lt_i = 0, lt_f = 0;
170 float lp_i = 0, lp_f = 0;
177 }
else if (t >= timestamp.
t2.
value() && t <= timestamp.
t3.
value()) {
182 }
else if (t < timestamp.
t1.
value()) {
188 }
else if (t > timestamp.
t3.
value()) {
200 }
else if (t >= linTimes.
t2.
value() && t <= linTimes.
t3.
value()) {
205 }
else if (t < linTimes.
t1.
value()) {
211 }
else if (t > linTimes.
t3.
value()) {
218 if (apdpnref != 0 && (t_i - t_f) != 0 && (lt_i - lt_f) != 0) {
220 float interpolatedLaserResponse = p_i / apdpnref +
float(tt - t_i) * (p_f - p_i) / (apdpnref *
float(t_f - t_i));
221 float interpolatedLinearResponse =
222 lp_i / apdpnref +
float(tt - lt_i) * (lp_f - lp_i) / (apdpnref *
float(lt_f - lt_i));
224 if (interpolatedLinearResponse > 2.
f || interpolatedLinearResponse < 0.1
f)
225 interpolatedLinearResponse = 1.f;
226 if (interpolatedLaserResponse <= 0.) {
230 edm::LogError(
"EcalLaserDbService") <<
"Interpolated Laser correction <0 for detid " << xid.rawId();
233 return correctionFactor;
236 float interpolatedTransparencyResponse = interpolatedLaserResponse / interpolatedLinearResponse;
238 correctionFactor = 1.f / (
std::pow(interpolatedTransparencyResponse, alpha) * interpolatedLinearResponse);
242 edm::LogError(
"EcalLaserDbService") <<
"apdpnref (" << apdpnref <<
") " 243 <<
"or t_i-t_f (" << (t_i - t_f) <<
" is zero!";
244 return correctionFactor;
247 return correctionFactor;
const EcalTimeMap & getTimeMap() const
int hashedIndex() const
get a compact index for arrays
const self & getMap() const
ErrorMapT channelsWithInvalidCorrection_
static int lmr(EBGlobalCoord ieta, EBGlobalCoord iphi)
U second(std::pair< T, U > const &p)
const EcalLinearCorrections * mLinearCorrections_
const EcalLaserAPDPNRatiosMap & getLaserMap() const
const EcalLaserAPDPNRatiosRef * mAPDPNRatiosRef_
const EcalValueMap & getValueMap() const
unsigned long long TimeValue_t
std::vector< Times > EcalTimeMap
const EcalLaserTimeStampMap & getTimeMap() const
std::vector< EcalLaserTimeStamp > EcalLaserTimeStampMap
const EcalLaserAPDPNRatios * mAPDPNRatios_
std::vector< Item >::const_iterator const_iterator
const EcalLaserAlphas * mAlphas_
const_iterator find(uint32_t rawId) const
const_iterator end() const
alpha
zGenParticlesMatch = cms.InputTag(""),
TimeValue_t value() const
static int lmr(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Power< A, B >::type pow(const A &a, const B &b)