21 mLinearCorrections_ (0)
46 float correctionFactor = 1.0;
66 edm::LogError(
"EcalLaserDbService") <<
" DetId is NOT in ECAL" << endl;
67 return correctionFactor;
87 edm::LogError(
"EcalLaserDbService") <<
" DetId is NOT in ECAL Barrel or Endcap" << endl;
88 return correctionFactor;
97 if (itratio != laserRatiosMap.
end()) {
98 apdpnpair = (*itratio);
100 edm::LogError(
"EcalLaserDbService") <<
"error with laserRatiosMap!" << endl;
101 return correctionFactor;
104 if (iLM-1< (
int)laserTimeMap.size()) {
105 timestamp = laserTimeMap[iLM-1];
107 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
108 return correctionFactor;
112 if (itlin != linearValueMap.
end()) {
113 linValues = (*itlin);
115 edm::LogError(
"EcalLaserDbService") <<
"error with linearValueMap!" << endl;
116 return correctionFactor;
119 if (iLM-1< (
int)linearTimeMap.size()) {
120 linTimes = linearTimeMap[iLM-1];
122 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
123 return correctionFactor;
127 if ( itref != laserRefMap.
end() ) {
130 edm::LogError(
"EcalLaserDbService") <<
"error with laserRefMap!" << endl;
131 return correctionFactor;
135 if ( italpha != laserAlphaMap.
end() ) {
138 edm::LogError(
"EcalLaserDbService") <<
"error with laserAlphaMap!" << endl;
139 return correctionFactor;
146 return isBarrel ? cond.barrel(xind) : cond.endcap(xind);
150 return isBarrel ? cond.barrel(xind) : cond.endcap(xind);
154 return isBarrel ? cond.barrel(xind) : cond.endcap(xind);
158 apdpnpair = getPair(laserRatiosMap);
159 linValues = getLinear(linearValueMap);
160 apdpnref =
getCond(laserRefMap);
161 alpha =
getCond(laserAlphaMap);
163 if (iLM-1< (
int)laserTimeMap.size()) {
164 timestamp = laserTimeMap[iLM-1];
166 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
167 return correctionFactor;
170 if (iLM-1< (
int)linearTimeMap.size()) {
171 linTimes = linearTimeMap[iLM-1];
173 edm::LogError(
"EcalLaserDbService") <<
"error with laserTimeMap!" << endl;
174 return correctionFactor;
193 long long t_i = 0, t_f = 0;
194 float p_i = 0, p_f = 0;
195 long long lt_i = 0, lt_f = 0;
196 float lp_i = 0, lp_f = 0;
203 }
else if ( t >= timestamp.
t2.
value() && t <= timestamp.
t3.
value() ) {
208 }
else if ( t < timestamp.
t1.
value() ) {
214 }
else if ( t > timestamp.
t3.
value() ) {
227 }
else if ( t >= linTimes.
t2.
value() && t <= linTimes.
t3.
value() ) {
232 }
else if ( t < linTimes.
t1.
value() ) {
238 }
else if ( t > linTimes.
t3.
value() ) {
246 if ( apdpnref != 0 && (t_i - t_f) != 0 && (lt_i - lt_f) != 0) {
248 float interpolatedLaserResponse = p_i/apdpnref + float(tt-t_i)*(p_f-p_i)/(apdpnref*
float(t_f-t_i));
249 float interpolatedLinearResponse = lp_i/apdpnref + float(tt-lt_i)*(lp_f-lp_i)/(apdpnref*
float(lt_f-lt_i));
251 if(interpolatedLinearResponse >2.
f || interpolatedLinearResponse <0.1
f)
252 interpolatedLinearResponse=1.f;
253 if ( interpolatedLaserResponse <= 0. ) {
259 <<
"Interpolated Laser correction <0 for detid "<<xid.
rawId();
263 return correctionFactor;
267 float interpolatedTransparencyResponse = interpolatedLaserResponse / interpolatedLinearResponse;
269 correctionFactor = 1.f/(
std::pow(interpolatedTransparencyResponse,alpha) *interpolatedLinearResponse );
275 <<
"apdpnref (" << apdpnref <<
") "
276 <<
"or t_i-t_f (" << (t_i - t_f) <<
" is zero!";
277 return correctionFactor;
280 return correctionFactor;
const EcalTimeMap & getTimeMap() const
int hashedIndex() const
get a compact index for arrays
const EcalLaserAPDPNRatios * getAPDPNRatios() const
const self & getMap() const
ErrorMapT channelsWithInvalidCorrection_
bool isBarrel(GeomDetEnumerators::SubDetector m)
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
U second(std::pair< T, U > const &p)
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_)
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
TimeValue_t value() const
static int lmr(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Power< A, B >::type pow(const A &a, const B &b)