From 48b9f0f95f90a0b52e90bb232f13ae41a614dc01 Mon Sep 17 00:00:00 2001 From: amassiro Date: Sat, 3 Aug 2019 20:14:47 +0200 Subject: [PATCH] update to deal with new procedure and new files --- .../EcalLaserCorrection/plugins/SealModule.cc | 2 ++ CondFormats/EcalObjects/src/classes.h | 8 +++++++ CondFormats/EcalObjects/src/classes_def.xml | 16 +++++++++++++ .../interface/EcalSignalGenerator.h | 24 +++++++++++++------ 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/CalibCalorimetry/EcalLaserCorrection/plugins/SealModule.cc b/CalibCalorimetry/EcalLaserCorrection/plugins/SealModule.cc index 22cdbf69c0efc..45ebd771bcb85 100644 --- a/CalibCalorimetry/EcalLaserCorrection/plugins/SealModule.cc +++ b/CalibCalorimetry/EcalLaserCorrection/plugins/SealModule.cc @@ -1,6 +1,8 @@ #include "FWCore/PluginManager/interface/ModuleDef.h" #include "CalibCalorimetry/EcalLaserCorrection/plugins/EcalLaserCorrectionService.h" +#include "CalibCalorimetry/EcalLaserCorrection/plugins/EcalLaserCorrectionServiceMC.h" DEFINE_FWK_EVENTSETUP_MODULE(EcalLaserCorrectionService); +DEFINE_FWK_EVENTSETUP_MODULE(EcalLaserCorrectionServiceMC); diff --git a/CondFormats/EcalObjects/src/classes.h b/CondFormats/EcalObjects/src/classes.h index 1c9f748dcb380..c0eeac54025f8 100644 --- a/CondFormats/EcalObjects/src/classes.h +++ b/CondFormats/EcalObjects/src/classes.h @@ -34,6 +34,7 @@ #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" #include "CondFormats/EcalObjects/interface/EcalTimeDependentCorrections.h" #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" +#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosMC.h" #include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h" #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h" @@ -124,6 +125,13 @@ namespace CondFormats_EcalObjects { EcalContainer laser_ec_eeDetId_pair; EcalContainer laser_ec_ebDetId_pair; EcalCondObjectContainer laser_map_dm; + + EcalLaserAPDPNRatiosMC laser_mc_map; + std::vector laser_mc_pair_map; + std::vector laser_mc_time_map; + EcalContainer laser_mc_ec_eeDetId_pair; + EcalContainer laser_mc_ec_ebDetId_pair; + EcalCondObjectContainer laser_mc_map_dm; EcalTimeDependentCorrections correction_map; std::vector value_map; diff --git a/CondFormats/EcalObjects/src/classes_def.xml b/CondFormats/EcalObjects/src/classes_def.xml index 67d8101caa54e..a7c5b6fb6474f 100644 --- a/CondFormats/EcalObjects/src/classes_def.xml +++ b/CondFormats/EcalObjects/src/classes_def.xml @@ -151,6 +151,22 @@ + + + + + + + + + + + + + + + + diff --git a/SimCalorimetry/EcalSimAlgos/interface/EcalSignalGenerator.h b/SimCalorimetry/EcalSimAlgos/interface/EcalSignalGenerator.h index 300c2ef3fee5a..ba6efc0eebc47 100644 --- a/SimCalorimetry/EcalSimAlgos/interface/EcalSignalGenerator.h +++ b/SimCalorimetry/EcalSimAlgos/interface/EcalSignalGenerator.h @@ -38,6 +38,8 @@ // needed for LC'/LC correction for time dependent MC #include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbService.h" #include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbRecord.h" +#include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbServiceMC.h" +#include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbRecordMC.h" @@ -122,8 +124,14 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { m_lasercals = laser.product(); // std::cout << " ---> EcalSignalGenerator() : initializeEvent() :: eventTimeValue = " << eventTimeValue << std::endl; - edm::ESHandle laser_prime; - eventSetup->get().get(laser_prime); + // + // the "prime" is exactly the same as the usual laser service, BUT + // it has only 1 IOV, so that effectively you are dividing IOV_n / IOV_0 + // NB: in the creation of the tag make sure the "prime" (MC) tag is prepared properly! + // NB again: if many IOVs also in "MC" tag, then fancy things could be perfomed ... left for the future + // + edm::ESHandle laser_prime; + eventSetup->get().get(laser_prime); // const edm::TimeValue_t eventTimeValue = event.time().value(); m_lasercals_prime = laser_prime.product(); @@ -132,6 +140,7 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { // http://www.cplusplus.com/reference/unordered_map/unordered_map/clear/ // http://www.cplusplus.com/reference/unordered_map/unordered_map/swap/ m_valueLCCache_LC.clear(); + m_valueLCCache_LC_prime.clear(); //--- also the "prime" ... yes //---- @@ -198,8 +207,8 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { m_lasercals = laser.product(); // std::cout << " ---> EcalSignalGenerator() : initializeEvent() :: eventTimeValue = " << eventTimeValue << std::endl; - edm::ESHandle laser_prime; - eventSetup->get().get(laser_prime); + edm::ESHandle laser_prime; + eventSetup->get().get(laser_prime); // const edm::TimeValue_t eventTimeValue = event.time().value(); m_lasercals_prime = laser_prime.product(); @@ -208,6 +217,7 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { // http://www.cplusplus.com/reference/unordered_map/unordered_map/clear/ // http://www.cplusplus.com/reference/unordered_map/unordered_map/swap/ m_valueLCCache_LC.clear(); + m_valueLCCache_LC_prime.clear(); //--- also the "prime" ... yes //---- @@ -308,12 +318,12 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { //---- LC at the beginning of the time (first IOV of the GT == first time) + //---- Using the different "tag", the one with "MC": exactly the same function as findLaserConstant_LC but with a different object double findLaserConstant_LC_prime(const DetId& detId) const { // return 1.0; - int temp_iTime = 0; //---- Correct to set the time to 0 --> the "LC'" is the first IOV of the tag MC to be used - const edm::Timestamp& evtTimeStamp = edm::Timestamp(temp_iTime); + const edm::Timestamp& evtTimeStamp = edm::Timestamp(m_iTime); return (m_lasercals_prime->getLaserCorrection(detId, evtTimeStamp)); } @@ -377,7 +387,7 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { CalibCache m_valueLCCache_LC; CalibCache m_valueLCCache_LC_prime; const EcalLaserDbService* m_lasercals; - const EcalLaserDbService* m_lasercals_prime; + const EcalLaserDbServiceMC* m_lasercals_prime; double theDefaultGains[NGAINS];