-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28214 from amassiro/amassiro_premix_OptionC_2tags…
…_ECAL_11_0_X ECAL for Time dependent MC. Premix option C. Handle for APD/PN tag for time dependence
- Loading branch information
Showing
12 changed files
with
386 additions
and
19 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbRecordMC.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Toyoko Orimoto (Caltech), 10 July 2007 | ||
// | ||
|
||
#ifndef ECALLASERCORRECTION_ECALLASERDBRECORDMC_H | ||
#define ECALLASERCORRECTION_ECALLASERDBRECORDMC_H | ||
|
||
#include "boost/mpl/vector.hpp" | ||
#include "FWCore/Framework/interface/DependentRecordImplementation.h" | ||
|
||
#include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" | ||
#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" | ||
#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosMCRcd.h" | ||
#include "CondFormats/DataRecord/interface/EcalLinearCorrectionsRcd.h" | ||
|
||
class EcalLaserDbRecordMC | ||
: public edm::eventsetup::DependentRecordImplementation<EcalLaserDbRecordMC, | ||
boost::mpl::vector<EcalLaserAlphasRcd, | ||
EcalLaserAPDPNRatiosRefRcd, | ||
EcalLaserAPDPNRatiosMCRcd, | ||
EcalLinearCorrectionsRcd> > {}; | ||
|
||
#endif /* ECALLASERCORRECTION_ECALLASERDBRECORDMC_H */ |
87 changes: 87 additions & 0 deletions
87
CalibCalorimetry/EcalLaserCorrection/plugins/EcalLaserCorrectionServiceMC.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// | ||
// Toyoko Orimoto (Caltech), 10 July 2007 | ||
// Andrea Massironi, 3 Aug 2019 | ||
// | ||
|
||
// system include files | ||
#include <iostream> | ||
#include <fstream> | ||
#include <memory> | ||
|
||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
#include "FWCore/Framework/interface/ESProducer.h" | ||
#include "FWCore/Framework/interface/ESProductHost.h" | ||
#include "FWCore/Utilities/interface/ReusableObjectHolder.h" | ||
#include "FWCore/Framework/interface/ESHandle.h" | ||
|
||
#include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbService.h" | ||
#include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbRecordMC.h" | ||
|
||
#include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" | ||
#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" | ||
#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosMCRcd.h" | ||
#include "CondFormats/DataRecord/interface/EcalLinearCorrectionsRcd.h" | ||
|
||
class EcalLaserCorrectionServiceMC : public edm::ESProducer { | ||
public: | ||
EcalLaserCorrectionServiceMC(const edm::ParameterSet&); | ||
~EcalLaserCorrectionServiceMC() override; | ||
|
||
std::shared_ptr<EcalLaserDbService> produce(const EcalLaserDbRecordMC&); | ||
|
||
private: | ||
using HostType = edm::ESProductHost<EcalLaserDbService, | ||
EcalLaserAlphasRcd, | ||
EcalLaserAPDPNRatiosRefRcd, | ||
EcalLaserAPDPNRatiosMCRcd, | ||
EcalLinearCorrectionsRcd>; | ||
|
||
// ----------member data --------------------------- | ||
edm::ReusableObjectHolder<HostType> holder_; | ||
|
||
edm::ESGetToken<EcalLaserAlphas, EcalLaserAlphasRcd> alphaToken_; | ||
edm::ESGetToken<EcalLaserAPDPNRatiosRef, EcalLaserAPDPNRatiosRefRcd> apdpnRefToken_; | ||
edm::ESGetToken<EcalLaserAPDPNRatios, EcalLaserAPDPNRatiosMCRcd> apdpnToken_; | ||
edm::ESGetToken<EcalLinearCorrections, EcalLinearCorrectionsRcd> linearToken_; | ||
}; | ||
|
||
EcalLaserCorrectionServiceMC::EcalLaserCorrectionServiceMC(const edm::ParameterSet& fConfig) : ESProducer() { | ||
// the following line is needed to tell the framework what | ||
// data is being produced | ||
// setWhatProduced (this, (dependsOn (&EcalLaserCorrectionServiceMC::apdpnCallback))); | ||
|
||
setWhatProduced(this) | ||
.setConsumes(alphaToken_) | ||
.setConsumes(apdpnRefToken_) | ||
.setConsumes(apdpnToken_) | ||
.setConsumes(linearToken_); | ||
|
||
//now do what ever other initialization is needed | ||
} | ||
|
||
EcalLaserCorrectionServiceMC::~EcalLaserCorrectionServiceMC() {} | ||
|
||
// | ||
// member functions | ||
// | ||
|
||
// ------------ method called to produce the data ------------ | ||
std::shared_ptr<EcalLaserDbService> EcalLaserCorrectionServiceMC::produce(const EcalLaserDbRecordMC& record) { | ||
auto host = holder_.makeOrGet([]() { return new HostType; }); | ||
|
||
host->ifRecordChanges<EcalLinearCorrectionsRcd>( | ||
record, [this, h = host.get()](auto const& rec) { h->setLinearCorrectionsData(&rec.get(linearToken_)); }); | ||
|
||
host->ifRecordChanges<EcalLaserAPDPNRatiosMCRcd>( | ||
record, [this, h = host.get()](auto const& rec) { h->setAPDPNData(&rec.get(apdpnToken_)); }); | ||
|
||
host->ifRecordChanges<EcalLaserAPDPNRatiosRefRcd>( | ||
record, [this, h = host.get()](auto const& rec) { h->setAPDPNRefData(&rec.get(apdpnRefToken_)); }); | ||
|
||
host->ifRecordChanges<EcalLaserAlphasRcd>( | ||
record, [this, h = host.get()](auto const& rec) { h->setAlphaData(&rec.get(alphaToken_)); }); | ||
|
||
return host; // automatically converts to std::shared_ptr<EcalLaserDbService> | ||
} | ||
|
||
DEFINE_FWK_EVENTSETUP_MODULE(EcalLaserCorrectionServiceMC); |
5 changes: 5 additions & 0 deletions
5
CalibCalorimetry/EcalLaserCorrection/src/EcalLaserDbRecordMC.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
#include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbRecordMC.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
||
EVENTSETUP_RECORD_REG(EcalLaserDbRecordMC); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosMCRcd.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef DataRecord_EcalLaserAPDPNRatiosMCRcd_h | ||
#define DataRecord_EcalLaserAPDPNRatiosMCRcd_h | ||
// -*- C++ -*- | ||
// | ||
// Package: DataRecord | ||
// Class : EcalLaserAPDPNRatiosMCRcd | ||
// | ||
/**\class EcalLaserAPDPNRatiosMCRcd EcalLaserAPDPNRatiosMCRcd.h CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosMCRcd.h | ||
* | ||
* Description: <one line class summary> | ||
* | ||
* Usage: | ||
* <usage> | ||
* | ||
*/ | ||
// | ||
// Author: | ||
// Created: Fri Jun 1 12:30:43 CEST 2007 | ||
// $Id$ | ||
// | ||
|
||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
|
||
class EcalLaserAPDPNRatiosMCRcd : public edm::eventsetup::EventSetupRecordImplementation<EcalLaserAPDPNRatiosMCRcd> {}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: DataRecord | ||
// Class : EcalLaserAPDPNRatiosMCRcd | ||
// | ||
// Implementation: | ||
// <Notes on implementation> | ||
// | ||
// Author: | ||
// Created: Fri Jun 1 12:30:43 CEST 2019 | ||
// $Id$ | ||
|
||
#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosMCRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
||
EVENTSETUP_RECORD_REG(EcalLaserAPDPNRatiosMCRcd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.