Skip to content

Commit

Permalink
update to deal with new procedure and new files
Browse files Browse the repository at this point in the history
  • Loading branch information
amassiro committed Aug 3, 2019
1 parent 5c5b24e commit 48b9f0f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CalibCalorimetry/EcalLaserCorrection/plugins/SealModule.cc
Original file line number Diff line number Diff line change
@@ -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);
8 changes: 8 additions & 0 deletions CondFormats/EcalObjects/src/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -124,6 +125,13 @@ namespace CondFormats_EcalObjects {
EcalContainer<EEDetId,EcalLaserAPDPNRatios::EcalLaserAPDPNpair> laser_ec_eeDetId_pair;
EcalContainer<EBDetId,EcalLaserAPDPNRatios::EcalLaserAPDPNpair> laser_ec_ebDetId_pair;
EcalCondObjectContainer<EcalLaserAPDPNRatios::EcalLaserAPDPNpair> laser_map_dm;

EcalLaserAPDPNRatiosMC laser_mc_map;
std::vector<EcalLaserAPDPNRatiosMC::EcalLaserAPDPNpair> laser_mc_pair_map;
std::vector<EcalLaserAPDPNRatiosMC::EcalLaserTimeStamp> laser_mc_time_map;
EcalContainer<EEDetId,EcalLaserAPDPNRatiosMC::EcalLaserAPDPNpair> laser_mc_ec_eeDetId_pair;
EcalContainer<EBDetId,EcalLaserAPDPNRatiosMC::EcalLaserAPDPNpair> laser_mc_ec_ebDetId_pair;
EcalCondObjectContainer<EcalLaserAPDPNRatiosMC::EcalLaserAPDPNpair> laser_mc_map_dm;

EcalTimeDependentCorrections correction_map;
std::vector<EcalTimeDependentCorrections::Values> value_map;
Expand Down
16 changes: 16 additions & 0 deletions CondFormats/EcalObjects/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,22 @@
<field name = "ee_" mapping = "blob"/>
</class>

<!-- base class -->
<class name="EcalLaserAPDPNRatiosMC::EcalLaserAPDPNpair"/>
<class name="EcalLaserAPDPNRatiosMC::EcalLaserTimeStamp"/>
<class name="EcalLaserAPDPNRatiosMC">
<field name="laser_map" mapping="blob" />
</class>
<!-- templates for EcalCondObjectContainer having the class as template parameter -->
<class name="std::vector<EcalLaserAPDPNRatiosMC::EcalLaserAPDPNpair>"/>
<class name="std::vector<EcalLaserAPDPNRatiosMC::EcalLaserTimeStamp>"/>
<class name="EcalContainer<EEDetId,EcalLaserAPDPNRatiosMC::EcalLaserAPDPNpair>"/>
<class name="EcalContainer<EBDetId,EcalLaserAPDPNRatiosMC::EcalLaserAPDPNpair>"/>
<class name="EcalCondObjectContainer<EcalLaserAPDPNRatiosMC::EcalLaserAPDPNpair>">
<field name = "eb_" mapping = "blob"/>
<field name = "ee_" mapping = "blob"/>
</class>

<!-- base class -->
<class name="EcalTimeDependentCorrections::Values"/>
<class name="EcalTimeDependentCorrections::Times"/>
Expand Down
24 changes: 17 additions & 7 deletions SimCalorimetry/EcalSimAlgos/interface/EcalSignalGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"



Expand Down Expand Up @@ -122,8 +124,14 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator {
m_lasercals = laser.product();
// std::cout << " ---> EcalSignalGenerator() : initializeEvent() :: eventTimeValue = " << eventTimeValue << std::endl;

edm::ESHandle<EcalLaserDbService> laser_prime;
eventSetup->get<EcalLaserDbRecord>().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<EcalLaserDbServiceMC> laser_prime;
eventSetup->get<EcalLaserDbRecordMC>().get(laser_prime);
// const edm::TimeValue_t eventTimeValue = event.time().value();
m_lasercals_prime = laser_prime.product();

Expand All @@ -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
//----


Expand Down Expand Up @@ -198,8 +207,8 @@ class EcalSignalGenerator : public EcalBaseSignalGenerator {
m_lasercals = laser.product();
// std::cout << " ---> EcalSignalGenerator() : initializeEvent() :: eventTimeValue = " << eventTimeValue << std::endl;

edm::ESHandle<EcalLaserDbService> laser_prime;
eventSetup->get<EcalLaserDbRecord>().get(laser_prime);
edm::ESHandle<EcalLaserDbServiceMC> laser_prime;
eventSetup->get<EcalLaserDbRecordMC>().get(laser_prime);
// const edm::TimeValue_t eventTimeValue = event.time().value();
m_lasercals_prime = laser_prime.product();

Expand All @@ -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
//----


Expand Down Expand Up @@ -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));

}
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 48b9f0f

Please sign in to comment.