Skip to content
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

Read VertexSmearing from GT in Run-1/2/3 MC #43242

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2566,111 +2566,111 @@ def condition(self, fragment, stepList, key, hasHarvest):
'GT' : 'auto:phase1_2017_design',
'HLTmenu': '@relval2017',
'Era' : 'Run2_2017',
'BeamSpot': 'GaussSigmaZ4cm',
'BeamSpot': 'DBdesign',
'ScenToRun' : ['GenSim','Digi','RecoFakeHLT','HARVESTFakeHLT'],
},
'2018' : {
'Geom' : 'DB:Extended',
'GT' : 'auto:phase1_2018_realistic',
'HLTmenu': '@relval2018',
'Era' : 'Run2_2018',
'BeamSpot': 'Realistic25ns13TeVEarly2018Collision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['GenSim','Digi','RecoFakeHLT','HARVESTFakeHLT','ALCA','Nano'],
},
'2018Design' : {
'Geom' : 'DB:Extended',
'GT' : 'auto:phase1_2018_design',
'HLTmenu': '@relval2018',
'Era' : 'Run2_2018',
'BeamSpot': 'GaussSigmaZ4cm',
'BeamSpot': 'DBdesign',
'ScenToRun' : ['GenSim','Digi','RecoFakeHLT','HARVESTFakeHLT'],
},
'2021' : {
'Geom' : 'DB:Extended',
'GT' : 'auto:phase1_2022_realistic',
'HLTmenu': '@relval2022',
'Era' : 'Run3',
'BeamSpot': 'Realistic25ns13p6TeVEOY2022Collision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['GenSim','Digi','RecoNanoFakeHLT','HARVESTNanoFakeHLT','ALCA'],
},
'2021Design' : {
'Geom' : 'DB:Extended',
'GT' : 'auto:phase1_2022_design',
'HLTmenu': '@relval2022',
'Era' : 'Run3',
'BeamSpot': 'GaussSigmaZ4cm',
'BeamSpot': 'DBdesign',
'ScenToRun' : ['GenSim','Digi','RecoNanoFakeHLT','HARVESTNanoFakeHLT'],
},
'2023' : {
'Geom' : 'DB:Extended',
'GT' : 'auto:phase1_2023_realistic',
'HLTmenu': '@relval2023',
'Era' : 'Run3_2023',
'BeamSpot': 'Realistic25ns13p6TeVEarly2023Collision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['GenSim','Digi','RecoNano','HARVESTNano','ALCA'],
},
'2024' : {
'Geom' : 'DB:Extended',
'GT' : 'auto:phase1_2024_realistic',
'HLTmenu': '@relval2023',
'Era' : 'Run3',
'BeamSpot': 'Realistic25ns13p6TeVEarly2022Collision',
'BeamSpot': 'DBrealistic',
francescobrivio marked this conversation as resolved.
Show resolved Hide resolved
'ScenToRun' : ['GenSim','Digi','RecoNano','HARVESTNano','ALCA'],
},
'2021FS' : {
'Geom' : 'DB:Extended',
'GT' : 'auto:phase1_2022_realistic',
'HLTmenu': '@relval2022',
'Era' : 'Run3_FastSim',
'BeamSpot': 'Realistic25ns13p6TeVEarly2022Collision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['Gen','FastSimRun3','HARVESTFastRun3'],
},
'2021postEE' : {
'Geom' : 'DB:Extended',
'GT' : 'auto:phase1_2022_realistic_postEE',
'HLTmenu': '@relval2022',
'Era' : 'Run3',
'BeamSpot': 'Realistic25ns13p6TeVEarly2022Collision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['GenSim','Digi','RecoNanoFakeHLT','HARVESTNanoFakeHLT','ALCA'],
},
'2023FS' : {
'Geom' : 'DB:Extended',
'GT' : 'auto:phase1_2023_realistic',
'HLTmenu': '@relval2023',
'Era' : 'Run3_2023_FastSim',
'BeamSpot': 'Realistic25ns13p6TeVEarly2023Collision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['Gen','FastSimRun3','HARVESTFastRun3'],
},
'2022HI' : {
'Geom' : 'DB:Extended',
'GT':'auto:phase1_2022_realistic_hi',
'HLTmenu': '@fake2',
'Era':'Run3_pp_on_PbPb',
'BeamSpot': 'Realistic2022PbPbCollision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['GenSim','Digi','RecoNano','HARVESTNano','ALCA'],
},
'2022HIRP' : {
'Geom' : 'DB:Extended',
'GT':'auto:phase1_2022_realistic_hi',
'HLTmenu': '@fake2',
'Era':'Run3_pp_on_PbPb_approxSiStripClusters',
'BeamSpot': 'Realistic2022PbPbCollision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['GenSim','Digi','RecoNano','HARVESTNano','ALCA'],
},
'2023HI' : {
'Geom' : 'DB:Extended',
'GT':'auto:phase1_2023_realistic_hi',
'HLTmenu': '@fake2',
'Era':'Run3_pp_on_PbPb',
'BeamSpot': 'Realistic2022PbPbCollision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['GenSim','Digi','RecoNano','HARVESTNano','ALCA'],
},
'2023HIRP' : {
'Geom' : 'DB:Extended',
'GT':'auto:phase1_2023_realistic_hi',
'HLTmenu': '@fake2',
'Era':'Run3_pp_on_PbPb_approxSiStripClusters',
'BeamSpot': 'Realistic2022PbPbCollision',
'BeamSpot': 'DBrealistic',
'ScenToRun' : ['GenSim','Digi','RecoNano','HARVESTNano','ALCA'],
}
}
Expand Down
2 changes: 2 additions & 0 deletions Configuration/StandardSequences/python/VtxSmeared.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
VtxSmeared = {
'DBdesign': 'IOMC.EventVertexGenerators.VtxSmearedDesign_cfi',
'DBrealistic': 'IOMC.EventVertexGenerators.VtxSmearedRealistic_cfi',
'NoSmear': 'Configuration.StandardSequences.VtxSmearedNoSmear_cff',
'BetafuncEarlyCollision': 'IOMC.EventVertexGenerators.VtxSmearedBetafuncEarlyCollision_cfi',
'BeamProfile': 'IOMC.EventVertexGenerators.VtxSmearedBeamProfile_cfi',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ________________________________________________________________________

#include "IOMC/EventVertexGenerators/interface/BaseEvtVtxGenerator.h"
#include "FWCore/Framework/interface/ESWatcher.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "CondFormats/DataRecord/interface/SimBeamSpotObjectsRcd.h"
#include "CondFormats/BeamSpotObjects/interface/SimBeamSpotObjects.h"
Expand All @@ -37,6 +38,8 @@ class BetafuncEvtVtxGenerator : public BaseEvtVtxGenerator {
BetafuncEvtVtxGenerator& operator=(const BetafuncEvtVtxGenerator& rhs) = delete;
~BetafuncEvtVtxGenerator() override = default;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;

/// return a new event vertex
Expand Down
3 changes: 3 additions & 0 deletions IOMC/EventVertexGenerators/interface/GaussEvtVtxGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "IOMC/EventVertexGenerators/interface/BaseEvtVtxGenerator.h"
#include "FWCore/Framework/interface/ESWatcher.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "CondFormats/DataRecord/interface/SimBeamSpotObjectsRcd.h"
#include "CondFormats/BeamSpotObjects/interface/SimBeamSpotObjects.h"
Expand All @@ -26,6 +27,8 @@ class GaussEvtVtxGenerator : public BaseEvtVtxGenerator {
GaussEvtVtxGenerator& operator=(const GaussEvtVtxGenerator& rhs) = delete;
~GaussEvtVtxGenerator() override = default;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;

/// return a new event vertex
Expand Down
8 changes: 8 additions & 0 deletions IOMC/EventVertexGenerators/python/VtxSmearedDesign_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import FWCore.ParameterSet.Config as cms

# Load GaussEvtVtxGenerator and read parameters from GT (SimBeamSpotObjectRcd)
from IOMC.EventVertexGenerators.GaussEvtVtxGenerator_cfi import GaussEvtVtxGenerator
VtxSmeared = GaussEvtVtxGenerator.clone(
src = "generator:unsmeared",
readDB = True
)
8 changes: 8 additions & 0 deletions IOMC/EventVertexGenerators/python/VtxSmearedRealistic_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import FWCore.ParameterSet.Config as cms

# Load BetafuncEvtVtxGenerator and read parameters from GT (SimBeamSpotObjectRcd)
from IOMC.EventVertexGenerators.BetafuncEvtVtxGenerator_cfi import BetafuncEvtVtxGenerator
VtxSmeared = BetafuncEvtVtxGenerator.clone(
src = "generator:unsmeared",
francescobrivio marked this conversation as resolved.
Show resolved Hide resolved
readDB = True
)
19 changes: 16 additions & 3 deletions IOMC/EventVertexGenerators/src/BetafuncEvtVtxGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ ________________________________________________________________________
#include "CLHEP/Random/RandGaussQ.h"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
//#include "CLHEP/Vector/ThreeVector.h"
francescobrivio marked this conversation as resolved.
Show resolved Hide resolved
#include "HepMC/SimpleVector.h"

#include <iostream>

BetafuncEvtVtxGenerator::BetafuncEvtVtxGenerator(const edm::ParameterSet& p) : BaseEvtVtxGenerator(p), boost_(4, 4) {
readDB_ = p.getParameter<bool>("readDB");
if (!readDB_) {
Expand Down Expand Up @@ -140,3 +137,19 @@ void BetafuncEvtVtxGenerator::sigmaZ(double s) {
}

TMatrixD const* BetafuncEvtVtxGenerator::GetInvLorentzBoost() const { return &boost_; }

void BetafuncEvtVtxGenerator::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<double>("X0", 0.0)->setComment("in cm");
desc.add<double>("Y0", 0.0)->setComment("in cm");
desc.add<double>("Z0", 0.0)->setComment("in cm");
desc.add<double>("SigmaZ", 0.0)->setComment("in cm");
desc.add<double>("BetaStar", 0.0)->setComment("in cm");
desc.add<double>("Emittance", 0.0)->setComment("in cm");
desc.add<double>("Alpha", 0.0)->setComment("in radians");
desc.add<double>("Phi", 0.0)->setComment("in radians");
desc.add<double>("TimeOffset", 0.0)->setComment("in ns");
desc.add<edm::InputTag>("src");
desc.add<bool>("readDB");
francescobrivio marked this conversation as resolved.
Show resolved Hide resolved
descriptions.add("BetafuncEvtVtxGenerator", desc);
}
20 changes: 15 additions & 5 deletions IOMC/EventVertexGenerators/src/GaussEvtVtxGenerator.cc
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@


#include "IOMC/EventVertexGenerators/interface/GaussEvtVtxGenerator.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "CLHEP/Random/RandGaussQ.h"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
//#include "CLHEP/Vector/ThreeVector.h"
#include "HepMC/SimpleVector.h"

GaussEvtVtxGenerator::GaussEvtVtxGenerator(const edm::ParameterSet& p) : BaseEvtVtxGenerator(p) {
Expand Down Expand Up @@ -95,3 +91,17 @@ void GaussEvtVtxGenerator::sigmaZ(double s) {
<< "Illegal resolution in Z (negative)";
}
}

void GaussEvtVtxGenerator::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<double>("MeanX", 0.0)->setComment("in cm");
desc.add<double>("MeanY", 0.0)->setComment("in cm");
desc.add<double>("MeanZ", 0.0)->setComment("in cm");
desc.add<double>("SigmaX", 0.0)->setComment("in cm");
desc.add<double>("SigmaY", 0.0)->setComment("in cm");
desc.add<double>("SigmaZ", 0.0)->setComment("in cm");
desc.add<double>("TimeOffset", 0.0)->setComment("in ns");
desc.add<edm::InputTag>("src");
desc.add<bool>("readDB");
francescobrivio marked this conversation as resolved.
Show resolved Hide resolved
descriptions.add("GaussEvtVtxGenerator", desc);
}