diff --git a/SimCalorimetry/EcalSimAlgos/interface/EcalSignalGenerator.h b/SimCalorimetry/EcalSimAlgos/interface/EcalSignalGenerator.h index ba6efc0eebc47..275d3c34bf082 100644 --- a/SimCalorimetry/EcalSimAlgos/interface/EcalSignalGenerator.h +++ b/SimCalorimetry/EcalSimAlgos/interface/EcalSignalGenerator.h @@ -79,17 +79,12 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { m_peToABarrel = peToABarrel; m_peToAEndcap = peToAEndcap; - -// std::cout << " ---> EcalSignalGenerator() : EcalBaseSignalGenerator() " << std::endl; - } ~EcalSignalGenerator() override {} void initializeEvent(const edm::Event* event, const edm::EventSetup* eventSetup) { -// std::cout << " ---> EcalSignalGenerator() : initializeEvent() " << std::endl; - theEvent = event; eventSetup->get().get(grHandle); // find the gains // Ecal Intercalibration Constants @@ -109,6 +104,10 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { eventSetup->get().get(laser); // const edm::TimeValue_t eventTimeValue = theEvent->time().value(); + // + // FIXME: is this workaround of using "run" really needed or "time" can be used in MC generation as well? + // check with generation experts + // const edm::TimeValue_t eventTimeValue = theEvent->run(); //---- NB: this is a trick. Since the time dependent MC // will be based on "run" (and lumisection) @@ -122,7 +121,6 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { m_lasercals = laser.product(); -// std::cout << " ---> EcalSignalGenerator() : initializeEvent() :: eventTimeValue = " << eventTimeValue << std::endl; // // the "prime" is exactly the same as the usual laser service, BUT @@ -136,9 +134,9 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { m_lasercals_prime = laser_prime.product(); //clear the laser cache for each event time -// CalibCache().swap(m_valueLCCache_LC); -> strange way to clear a collection ... why was it like this? -// http://www.cplusplus.com/reference/unordered_map/unordered_map/clear/ -// http://www.cplusplus.com/reference/unordered_map/unordered_map/swap/ + // CalibCache().swap(m_valueLCCache_LC); -> strange way to clear a collection ... why was it like this? + // 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 //---- @@ -164,15 +162,11 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { else ESMIPToGeV = esMipToGeV->getESValueHigh(); -// std::cout << " ---> EcalSignalGenerator() : initializeEvent() [end] " << std::endl; - } /// some users use EventPrincipals, not Events. We support both void initializeEvent(const edm::EventPrincipal* eventPrincipal, const edm::EventSetup* eventSetup) { -// std::cout << " ---> EcalSignalGenerator() : initializeEvent() [second version]" << std::endl; - theEventPrincipal = eventPrincipal; eventSetup->get().get(grHandle); // find the gains // Ecal Intercalibration Constants @@ -191,6 +185,10 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { edm::TimeValue_t eventTimeValue; if (theEventPrincipal) { // eventTimeValue = theEventPrincipal->time().value(); + // + // FIXME: is this workaround of using "run" really needed or "time" can be used in MC generation as well? + // check with generation experts + // eventTimeValue = theEventPrincipal->run(); //---- NB: this is a trick. Since the time dependent MC // will be based on "run" (and lumisection) @@ -238,8 +236,6 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { else ESMIPToGeV = esMipToGeV->getESValueHigh(); -// std::cout << " ---> EcalSignalGenerator() : initializeEvent() [end] " << std::endl; - } virtual void fill(edm::ModuleCallingContext const* mcc) { @@ -305,13 +301,8 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { //---- LC that depends with time double findLaserConstant_LC(const DetId& detId) const { -// return 1.0; - // const edm::TimeValue_t m_iTime = event.time().value(); const edm::Timestamp& evtTimeStamp = edm::Timestamp(m_iTime); - -// std::cout << " findLaserConstant_LC::evtTimeStamp = " << evtTimeStamp << std::endl; - return (m_lasercals->getLaserCorrection(detId, evtTimeStamp)); } @@ -321,8 +312,6 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator { //---- 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; - const edm::Timestamp& evtTimeStamp = edm::Timestamp(m_iTime); return (m_lasercals_prime->getLaserCorrection(detId, evtTimeStamp)); diff --git a/SimCalorimetry/EcalSimAlgos/src/EcalSignalGenerator.cc b/SimCalorimetry/EcalSimAlgos/src/EcalSignalGenerator.cc index 230eea8a61b34..8374d4f342780 100644 --- a/SimCalorimetry/EcalSimAlgos/src/EcalSignalGenerator.cc +++ b/SimCalorimetry/EcalSimAlgos/src/EcalSignalGenerator.cc @@ -41,22 +41,17 @@ CaloSamples EcalSignalGenerator::samplesInPE(const DIGI &digi LSB[igain] = Emax / (MAXADC * gainRatios[igain]); } - // std::cout << " intercal, LSBs, egains " << icalconst << " " << LSB[0] << " " << LSB[1] << " " << gainRatios[0] << " " << gainRatios[1] << " " << Emax << std::endl; - CaloSamples result(detId, digi.size()); // correction facotr for premixed sample: ratio of laser corrections float correction_factor_for_premixed_sample_transparency = 1.0; - // correction_factor_for_premixed_sample_transparency double value_LC = 1.; if (detId.subdetId() != 3) { -// std::cout << " detId.subdetId() = " << detId.subdetId() << std::endl; auto cache = m_valueLCCache_LC.find(detId); if (cache != m_valueLCCache_LC.end()) { value_LC = cache->second; } else { value_LC = findLaserConstant_LC(detId); -// value_LC = 1.0; m_valueLCCache_LC.emplace(detId, value_LC); } } @@ -73,7 +68,6 @@ CaloSamples EcalSignalGenerator::samplesInPE(const DIGI &digi } correction_factor_for_premixed_sample_transparency = value_LC_prime / value_LC; -// std::cout << " EB correction_factor_for_premixed_sample_transparency[" << detId() << "] = " << correction_factor_for_premixed_sample_transparency << " = " << value_LC_prime << " / " << value_LC << std::endl; // // LC' / LC (see formula) // @@ -142,13 +136,10 @@ CaloSamples EcalSignalGenerator::samplesInPE(const DIGI &digi LSB[igain] = Emax / (MAXADC * gainRatios[igain]); } - // std::cout << " intercal, LSBs, egains " << icalconst << " " << LSB[0] << " " << LSB[1] << " " << gainRatios[0] << " " << gainRatios[1] << " " << Emax << std::endl; - CaloSamples result(detId, digi.size()); // correction facotr for premixed sample: ratio of laser corrections float correction_factor_for_premixed_sample_transparency = 1.0; - // correction_factor_for_premixed_sample_transparency double value_LC = 1.; if (detId.subdetId() != 3) { auto cache = m_valueLCCache_LC.find(detId); @@ -172,7 +163,6 @@ CaloSamples EcalSignalGenerator::samplesInPE(const DIGI &digi } correction_factor_for_premixed_sample_transparency = value_LC_prime / value_LC; -// std::cout << " EE correction_factor_for_premixed_sample_transparency[" << detId() << "] = " << correction_factor_for_premixed_sample_transparency << " = " << value_LC_prime << " / " << value_LC << std::endl; // // LC' / LC (see formula) //