176 bool isEB = electron.
isEB();
178 double r9 = electron.
getR9();
185 std::cout <<
"[ElectronEnergyCalibrator] Using regression energy for calibration" << std::endl;
193 std::cout <<
"[ElectronEnergyCalibrator] Using scale corrections for new regression" << std::endl;
201 std::cout <<
"[ElectronEnergyCalibrator] Using standard ecal energy for calibration" << std::endl;
212 <<
"XXXXXXX requires the RandomNumberGeneratorService\n"
213 "which is not present in the configuration file. You must add the service\n"
214 "in the configuration file or remove the modules that require it.";
279 if ( run_ <= 203002 )
281 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0103;
282 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0090;
283 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0190;
284 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0156;
285 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0269;
286 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0287;
287 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0364;
288 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0321;
291 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0109;
292 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0099;
293 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0182;
294 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0200;
295 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0282;
296 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0309;
297 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0386;
298 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0359;
302 CLHEP::RandFlat flatRandom(rng->
getEngine());
303 double rn = flatRandom.fire();
306 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0109;
307 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0099;
308 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0182;
309 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0200;
310 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0282;
311 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0309;
312 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0386;
313 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0359;
316 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0103;
317 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0090;
318 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0190;
319 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0156;
320 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0269;
321 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0287;
322 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0364;
323 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0321;
327 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0103;
328 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0090;
329 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0190;
330 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0156;
331 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0269;
332 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0287;
333 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0364;
334 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0321;
338 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0109;
339 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0099;
340 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0182;
341 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0200;
342 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0282;
343 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0309;
344 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0386;
345 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0359;
355 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0094;
356 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0092;
357 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0182;
358 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0139;
359 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0220;
360 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0229;
361 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0290;
362 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0234;
370 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.01;
371 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0099;
372 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0217;
373 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0157;
374 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0326;
375 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0330;
376 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0331;
377 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0378;
380 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0096;
381 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0074;
382 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0196;
383 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0141;
384 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0279;
385 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0268;
386 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0301;
387 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0293;
390 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0119;
391 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0107;
392 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0240;
393 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0149;
394 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0330;
395 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0375;
396 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0602;
397 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0607;
398 }
else if (
dataset_ ==
"Summer12_DR53X_HCP2012" ||
dataset_ ==
"Moriond2013" )
400 if ( isEB && fabs(eta) < 1 && r9 < 0.94 ) dsigMC = 0.0099;
401 if ( isEB && fabs(eta) < 1 && r9 >= 0.94 ) dsigMC = 0.0103;
402 if ( isEB && fabs(eta) >= 1 && r9 < 0.94 ) dsigMC = 0.0219;
403 if ( isEB && fabs(eta) >= 1 && r9 >= 0.94 ) dsigMC = 0.0158;
404 if ( !isEB && fabs(eta) < 2 && r9 < 0.94 ) dsigMC = 0.0222;
405 if ( !isEB && fabs(eta) < 2 && r9 >= 0.94 ) dsigMC = 0.0298;
406 if ( !isEB && fabs(eta) >= 2 && r9 < 0.94 ) dsigMC = 0.0318;
407 if ( !isEB && fabs(eta) >= 2 && r9 >= 0.94 ) dsigMC = 0.0302;
414 CLHEP::RandGaussQ gaussDistribution(rng->
getEngine(), 1.,dsigMC);
415 corrMC = gaussDistribution.fire();
422 std::cout <<
"[ElectronEnergyCalibrator] "
423 <<
"======================= SYNCRONIZATION MODE! ======================="
443 std::cout <<
"[ElectronEnergyCalibrator] initial energy "
448 std::cout <<
"[ElectronEnergyCalibrator] initial energy error "
correctionValues corrValArray[100]
double getRegEnergyError()
void setNewEnergyError(double newEnergyError)
void setNewEnergy(double newEnergy)
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
double getSCEnergyError()