-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECAL for Time dependent MC. Premix option C. Handle for APD/PN tag for time dependence #28214
Changes from 13 commits
0b3c752
9091ebc
a871be0
c031b54
a7ea04f
80b042e
e0f9f5e
56ee7eb
978ae06
1835a55
5a1eca5
22c10ca
3f00eb4
47062b0
658f29d
c8ab979
b68e88b
7d89f4d
609c424
2a9f99c
3b063f5
8600d68
6027981
f1c74bc
c420815
e4810f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// 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 "FWCore/Framework/interface/EventSetupRecordImplementation.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::EventSetupRecordImplementation<EcalLaserDbRecordMC> {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete commented-out code |
||
|
||
class EcalLaserDbRecordMC | ||
: public edm::eventsetup::DependentRecordImplementation<EcalLaserDbRecordMC, | ||
boost::mpl::vector<EcalLaserAlphasRcd, | ||
EcalLaserAPDPNRatiosRefRcd, | ||
EcalLaserAPDPNRatiosMCRcd, | ||
EcalLinearCorrectionsRcd> > {}; | ||
|
||
#endif /* ECALLASERCORRECTION_ECALLASERDBRECORDMC_H */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
// | ||
// 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_; | ||
|
||
// std::vector<std::string> mDumpRequest; | ||
// std::ostream* mDumpStream; | ||
}; | ||
|
||
EcalLaserCorrectionServiceMC::EcalLaserCorrectionServiceMC(const edm::ParameterSet& fConfig) | ||
: ESProducer() | ||
// mDumpRequest (), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete commented-out code |
||
// mDumpStream(0) | ||
{ | ||
//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 | ||
|
||
// mDumpRequest = fConfig.getUntrackedParameter <std::vector <std::string> > ("dump", std::vector<std::string>()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete commented-out code |
||
// if (!mDumpRequest.empty()) { | ||
// std::string otputFile = fConfig.getUntrackedParameter <std::string> ("file", ""); | ||
// mDumpStream = otputFile.empty () ? &std::cout : new std::ofstream (otputFile.c_str()); | ||
// } | ||
} | ||
|
||
EcalLaserCorrectionServiceMC::~EcalLaserCorrectionServiceMC() { | ||
// do anything here that needs to be done at desctruction time | ||
// (e.g. close files, deallocate resources etc.) | ||
// if (mDumpStream != &std::cout) delete mDumpStream; | ||
} | ||
|
||
// | ||
// 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); |
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); |
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 |
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); |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -644,8 +644,8 @@ def identitySim(wf): | |||||
'CMSSW_10_6_0-106X_upgrade2018_realistic_v4-v1', # 18 - GENSIM input for 2018 fullSim premix workflows | ||||||
'CMSSW_10_6_0-106X_upgrade2018_realistic_v4_FastSim-v1', # 19 - fastSim MinBias for mixing UP18 | ||||||
'CMSSW_10_6_0-PU25ns_106X_upgrade2018_realistic_v4_FastSim-v1',# 20 - fastSim premix library UP18 | ||||||
'CMSSW_10_6_0-106X_mc2017_realistic_v3-v1', # 21 - GEN-SIM inputs for LHE-GEN-SIM 2017 workflows | ||||||
'CMSSW_10_6_0-106X_upgrade2018_realistic_v4-v1', # 22 - GEN-SIM inputs for LHE-GEN-SIM 2018 workflows | ||||||
'CMSSW_10_6_0-106X_mc2017_realistic_v3-v1', # 21 - GEN-SIM inputs for LHE-GEN-SIM 2017 workflows | ||||||
'CMSSW_10_6_0-106X_upgrade2018_realistic_v4-v1', # 22 - GEN-SIM inputs for LHE-GEN-SIM 2018 workflows | ||||||
] | ||||||
|
||||||
# note: INPUT commands to be added once GEN-SIM w/ 13TeV+PostLS1Geo will be available | ||||||
|
@@ -1745,8 +1745,10 @@ def lhegensim2018ml(fragment,howMuch): | |||||
|
||||||
steps['DIGIPRMXUP15_PU50']=merge([digiPremixUp2015Defaults50ns]) | ||||||
steps['DIGIPRMXUP17_PU25']=merge([digiPremixUp2017Defaults25ns]) | ||||||
steps['DIGIPRMXUP17_PU25_RD']=merge([digiPremixUp2017Defaults25ns, { '--customise_commands':"\"process.EcalLaserCorrectionServiceMC = cms.ESProducer('EcalLaserCorrectionServiceMC') \\n process.GlobalTag.toGet = cms.VPSet( cms.PSet( record = cms.string('EcalLaserAPDPNRatiosMCRcd'), tag = cms.string('EcalLaserAPDPNRatios_UL_2017_mc'), connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') ) ) \\n process.ecal_sim_parameter_map.timeDependent=cms.bool(True)\"" } ]) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you also need to specify a run number from the 2017 era to be used in the simulation? Otherwise how do you get the laser corrections from the appropriate IOV? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently this is a test, and it is using only 1 IOV. As shown in the slides linked, in order to have the time dependent I did, for my private production, the following:
in the digipremixing, and
in the sim step. Would you like me to prepare the workflow as this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you also need to include a time-dependent
and in the DIGIPRMX step:
I can't comment on the plans for central production but I think that the relval workflow should test the use of multi-IOV tags in MC. As far as I can tell, it does not. Or have I misunderstood? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ok, I will prepare the worflow to use more IOVs, meaning I will prepare the python configuration, but the c++ code here in this PR is independent from it. Question to relval experts: where is the number of events per workflow defined? Is it handled with some configuration? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @amassiro : sorry I have missed your question. The number of events per workflow is set here (
For "numberEventsInLuminosityBlock", you can add this parameter similarly to this line
Chayanit for PdmV |
||||||
steps['DIGIPRMXLOCALUP17_PU25']=merge([digiPremixLocalPileupUp2017Defaults25ns]) | ||||||
steps['DIGIPRMXUP18_PU25']=merge([digiPremixUp2018Defaults25ns]) | ||||||
steps['DIGIPRMXUP18_PU25_RD']=merge([digiPremixUp2018Defaults25ns, { '--customise_commands':"\"process.EcalLaserCorrectionServiceMC = cms.ESProducer('EcalLaserCorrectionServiceMC') \\n process.GlobalTag.toGet = cms.VPSet( cms.PSet( record = cms.string('EcalLaserAPDPNRatiosMCRcd'), tag = cms.string('EcalLaserAPDPNRatios_UL_2018_mc_3sigma_v2'), connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS') ) ) \\n process.ecal_sim_parameter_map.timeDependent=cms.bool(True)\"" } ]) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same question as in L1748 applies here. |
||||||
steps['DIGIPRMXLOCALUP18_PU25']=merge([digiPremixLocalPileupUp2018Defaults25ns]) | ||||||
|
||||||
premixProd25ns = {'-s' : 'DIGI,DATAMIX,L1,DIGI2RAW,HLT:@relval2016', | ||||||
|
@@ -1882,7 +1884,7 @@ def lhegensim2018ml(fragment,howMuch): | |||||
'--datatier':'AOD,DQMIO', | ||||||
'--eventcontent':'AOD,DQM', | ||||||
'--era':'Run2_2018_pp_on_AA', | ||||||
'--customise':'Configuration/DataProcessing/RecoTLR.customisePostEra_Run2_2018_pp_on_AA', | ||||||
'--customise':'Configuration/DataProcessing/RecoTLR.customisePostEra_Run2_2018_pp_on_AA', | ||||||
'-n':'10' | ||||||
},steps['RECOHID15']]) | ||||||
|
||||||
|
@@ -3077,7 +3079,7 @@ def gen2018HiMix(fragment,howMuch): | |||||
baseDataSetReleaseBetter={} | ||||||
for gen in upgradeFragments: | ||||||
for ds in defaultDataSets: | ||||||
key=gen[:-4]+'_'+ds | ||||||
key=gen[:-4]+'_'+ds | ||||||
version='1' | ||||||
if key in versionOverrides: | ||||||
version = versionOverrides[key] | ||||||
|
@@ -3088,15 +3090,15 @@ def gen2018HiMix(fragment,howMuch): | |||||
key='MinBias_14TeV_pythia8_TuneCUETP8M1'+'_'+ds | ||||||
name=baseDataSetReleaseBetter[key] | ||||||
if '2017' in ds: | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'AVE_35_BX_25ns','--pileup_input':'das:/RelValMinBias_13/%s/GEN-SIM'%(name,)} | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'AVE_35_BX_25ns','--pileup_input':'das:/RelValMinBias_13/%s/GEN-SIM'%(name,)} | ||||||
elif '2018' in ds: | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'AVE_50_BX_25ns','--pileup_input':'das:/RelValMinBias_13/%s/GEN-SIM'%(name,)} | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'AVE_50_BX_25ns','--pileup_input':'das:/RelValMinBias_13/%s/GEN-SIM'%(name,)} | ||||||
elif '2021' in ds: | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'Run3_Flat55To75_PoissonOOTPU','--pileup_input':'das:/RelValMinBias_14TeV/%s/GEN-SIM'%(name,)} | ||||||
elif 'postLS2' in ds: | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'AVE_50_BX_25ns','--pileup_input':'das:/RelValMinBias_13/%s/GEN-SIM'%(name,)} | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'AVE_50_BX_25ns','--pileup_input':'das:/RelValMinBias_13/%s/GEN-SIM'%(name,)} | ||||||
elif '2026' in ds: | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'AVE_200_BX_25ns','--pileup_input':'das:/RelValMinBias_14TeV/%s/GEN-SIM'%(name,)} | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'AVE_200_BX_25ns','--pileup_input':'das:/RelValMinBias_14TeV/%s/GEN-SIM'%(name,)} | ||||||
else: | ||||||
PUDataSets[ds]={'-n':10,'--pileup':'AVE_35_BX_25ns','--pileup_input':'das:/RelValMinBias_14TeV/%s/GEN-SIM'%(name,)} | ||||||
|
||||||
|
@@ -3249,7 +3251,7 @@ def gen2018HiMix(fragment,howMuch): | |||||
'--datatier':'NANOAODSIM', | ||||||
'-n':'10', | ||||||
'--eventcontent':'NANOEDMAODSIM', | ||||||
'--filein':'file:step3_inMINIAODSIM.root', | ||||||
'--filein':'file:step3_inMINIAODSIM.root', | ||||||
'--geometry' : geom | ||||||
} | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete commented-out code