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

updated Digitizer framework adding (a) option to allow independent El… #16389

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -14,6 +14,7 @@

//#include "PixelIndices.h"
#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
#include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"

Expand Down Expand Up @@ -89,7 +90,7 @@ Phase2TrackerDigitizerAlgorithm::Phase2TrackerDigitizerAlgorithm(const edm::Para
// Be careful, this parameter is also used in SiPixelDet.cc to
// calculate the noise in adc counts from noise in electrons.
// Both defaults should be the same.
theElectronPerADC(conf_common.getParameter<double>("ElectronPerAdc")),
theElectronPerADC(conf_specific.getParameter<double>("ElectronPerAdc")),

// ADC saturation value, 255(8bit adc.
theAdcFullScale(conf_specific.getParameter<int>("AdcFullScale")),
Expand All @@ -110,6 +111,10 @@ Phase2TrackerDigitizerAlgorithm::Phase2TrackerDigitizerAlgorithm(const edm::Para
// Add threshold gaussian smearing:
theThresholdSmearing_Endcap(conf_specific.getParameter<double>("ThresholdSmearing_Endcap")),
theThresholdSmearing_Barrel(conf_specific.getParameter<double>("ThresholdSmearing_Barrel")),

// Add HIP Threshold in electron units.
theHIPThresholdInE_Endcap(conf_specific.getParameter<double>("HIPThresholdInElectrons_Endcap")),
theHIPThresholdInE_Barrel(conf_specific.getParameter<double>("HIPThresholdInElectrons_Barrel")),

// theTofCut 12.5, cut in particle TOD +/- 12.5ns
theTofLowerCut(conf_specific.getParameter<double>("TofLowerCut")),
Expand Down Expand Up @@ -699,7 +704,7 @@ void Phase2TrackerDigitizerAlgorithm::pixel_inefficiency(const SubdetEfficiencie

// setup the chip indices conversion
unsigned int Subid=DetId(detID).subdetId();
if (Subid == PixelSubdetector::PixelBarrel) { // barrel layers
if (Subid == PixelSubdetector::PixelBarrel || Subid == StripSubdetector::TOB) { // barrel layers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suchandradutta - what does "TOB" mean in this context (for my future reference)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidlange6 - here TOB means the phase2 barrel layers as defined in the package description of Geometry/TrackerNumberingBuilder in the section of

"Phase 2 Upgrade Detector DetId schema Tilted Geometry with new pixel detector for TDR (from Version V4021)"

https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/Geometry/TrackerNumberingBuilder/README.md

unsigned int layerIndex = tTopo->pxbLayer(detID);
if (layerIndex-1 < eff.barrel_efficiencies.size()) subdetEfficiency = eff.barrel_efficiencies[layerIndex-1];
} else { // forward disks
Expand Down Expand Up @@ -754,7 +759,7 @@ LocalVector Phase2TrackerDigitizerAlgorithm::DriftDirection(const Phase2TrackerG
alpha2_Barrel = 0.0;
}

if (Sub_detid == PixelSubdetector::PixelBarrel) { // barrel layers
if (Sub_detid == PixelSubdetector::PixelBarrel || Sub_detid == StripSubdetector::TOB) { // barrel layers
dir_x = -( tanLorentzAnglePerTesla_Barrel * Bfield.y() + alpha2_Barrel* Bfield.z()* Bfield.x() );
dir_y = +( tanLorentzAnglePerTesla_Barrel * Bfield.x() - alpha2_Barrel* Bfield.z()* Bfield.y() );
dir_z = -(1 + alpha2_Barrel* Bfield.z()*Bfield.z() );
Expand Down Expand Up @@ -910,14 +915,16 @@ void Phase2TrackerDigitizerAlgorithm::digitize(const Phase2TrackerGeomDetUnit* p
unsigned int Sub_detid = DetId(detID).subdetId();

float theThresholdInE = 0.;

float theHIPThresholdInE = 0.;
// Define Threshold
if (Sub_detid == PixelSubdetector::PixelBarrel) { // Barrel modules
if (Sub_detid == PixelSubdetector::PixelBarrel || Sub_detid == StripSubdetector::TOB) { // Barrel modules
if (addThresholdSmearing) theThresholdInE = smearedThreshold_Barrel_->fire(); // gaussian smearing
else theThresholdInE = theThresholdInE_Barrel; // no smearing
theHIPThresholdInE = theHIPThresholdInE_Barrel;
} else { // Forward disks modules
if (addThresholdSmearing) theThresholdInE = smearedThreshold_Endcap_->fire(); // gaussian smearing
else theThresholdInE = theThresholdInE_Endcap; // no smearing
theHIPThresholdInE = theHIPThresholdInE_Endcap;
}


Expand Down Expand Up @@ -949,7 +956,7 @@ void Phase2TrackerDigitizerAlgorithm::digitize(const Phase2TrackerGeomDetUnit* p

DigitizerUtility::DigiSimInfo info;
info.sig_tot = adc;
info.ot_bit = ( int(signalInElectrons / theElectronPerADC) > theAdcFullScale ? true : false);
info.ot_bit = ( signalInElectrons > theHIPThresholdInE ? true : false);
if (makeDigiSimLinks_ && sig_data.hitInfo() != 0) {
info.hit_counter = sig_data.hitIndex();
info.tof_bin = sig_data.tofBin();
Expand Down
Expand Up @@ -129,6 +129,9 @@ class Phase2TrackerDigitizerAlgorithm {
const double theThresholdSmearing_Endcap;
const double theThresholdSmearing_Barrel;

const double theHIPThresholdInE_Endcap;
const double theHIPThresholdInE_Barrel;

const float theTofLowerCut; // Cut on the particle TOF
const float theTofUpperCut; // Cut on the particle TOF
const float tanLorentzAnglePerTesla_Endcap; //FPix Lorentz angle tangent per Tesla
Expand Down
Expand Up @@ -12,6 +12,16 @@
xmin = cms.double(-0.5),
xmax = cms.double(200.5)
),
DigiOccupancySH = cms.PSet(
Nbins = cms.int32(51),
xmin = cms.double(-0.001),
xmax = cms.double(0.05)
),
DigiOccupancyPH = cms.PSet(
Nbins = cms.int32(51),
xmin = cms.double(-0.0001),
xmax = cms.double(0.005)
),
PositionOfDigisH = cms.PSet(
Nxbins = cms.int32(260),
xmin = cms.double(0.5),
Expand Down Expand Up @@ -47,18 +57,18 @@
),
XYPositionMapH = cms.PSet(
Nxbins = cms.int32(1200),
xmin = cms.double(-1200.),
xmax = cms.double(1200.),
xmin = cms.double(-120.),
xmax = cms.double(120.),
Nybins = cms.int32(1200),
ymin = cms.double(-1200.),
ymax = cms.double(1200.)
),
ymin = cms.double(-120.),
ymax = cms.double(120.)
),
RZPositionMapH = cms.PSet(
Nxbins = cms.int32(3000),
xmin = cms.double(-3000.),
xmax = cms.double(3000.),
Nybins = cms.int32(600),
xmin = cms.double(-300.),
xmax = cms.double(300.),
Nybins = cms.int32(3000),
ymin = cms.double(0.),
ymax = cms.double(1200.)
ymax = cms.double(120.)
)
)
Expand Up @@ -40,20 +40,25 @@
xmin = cms.double(-3.2),
xmax = cms.double(3.2)
),
SimHitElossH = cms.PSet(
Nbins = cms.int32(100),
xmin = cms.double(0.0),
xmax = cms.double(100000.0)
),
XYPositionMapH = cms.PSet(
Nxbins = cms.int32(1200),
xmin = cms.double(-1200.),
xmax = cms.double(1200.),
xmin = cms.double(-120.),
xmax = cms.double(120.),
Nybins = cms.int32(1200),
ymin = cms.double(-1200.),
ymax = cms.double(1200.)
ymin = cms.double(-120.),
ymax = cms.double(120.)
),
RZPositionMapH = cms.PSet(
Nxbins = cms.int32(3000),
xmin = cms.double(-3000.),
xmax = cms.double(3000.),
Nybins = cms.int32(600),
xmin = cms.double(-300.),
xmax = cms.double(300.),
Nybins = cms.int32(1200),
ymin = cms.double(0.),
ymax = cms.double(1200.)
ymax = cms.double(120.)
)
)
40 changes: 25 additions & 15 deletions SimTracker/SiPhase2Digitizer/python/phase2TrackerDigitizer_cfi.py
Expand Up @@ -13,19 +13,21 @@
isOTreadoutAnalog = cms.bool(False),#set this to true if you want analog readout for OT
# Common for Algos
AlgorithmCommon = cms.PSet(
DeltaProductionCut = cms.double(0.03),
ElectronPerAdc = cms.double(135.0) #D.B.:used for misscalibration
DeltaProductionCut = cms.double(0.03)
),
# Specific parameters
#Pixel Digitizer Algorithm
PixelDigitizerAlgorithm = cms.PSet(
makeDigiSimLinks = cms.untracked.bool(True),
ElectronPerAdc = cms.double(135.0),
ReadoutNoiseInElec = cms.double(350.0),
ThresholdInElectrons_Barrel = cms.double(2000.0),
ThresholdInElectrons_Endcap = cms.double(2000.0),
ThresholdInElectrons_Barrel = cms.double(1000.0),
ThresholdInElectrons_Endcap = cms.double(1000.0),
AddThresholdSmearing = cms.bool(True),
ThresholdSmearing_Barrel = cms.double(245.0),
ThresholdSmearing_Endcap = cms.double(210.0),
ThresholdSmearing_Barrel = cms.double(100.0),
ThresholdSmearing_Endcap = cms.double(100.0),
HIPThresholdInElectrons_Barrel = cms.double(1.0e10), # very high value to avoid Over threshold bit
HIPThresholdInElectrons_Endcap = cms.double(1.0e10), # very high value to avoid Over threshold bit
NoiseInElectrons = cms.double(175.0),
DigitalReadout = cms.bool(False), # Flag to decide analog or digital readout
AdcFullScale = cms.int32(255),
Expand Down Expand Up @@ -55,13 +57,15 @@
#Pixel in PS Module
PSPDigitizerAlgorithm = cms.PSet(
makeDigiSimLinks = cms.untracked.bool(True),
#D.B.:the noise should be a function of strip capacitance, roughly: ReadoutNoiseInElec=500+(64*Cdet[pF]) ~= 500+(64*1.5[cm])
ElectronPerAdc = cms.double(135.0),
ReadoutNoiseInElec = cms.double(1000.0),#D.B.:Fill readout noise, including all readout chain, relevant for smearing
ThresholdInElectrons_Barrel = cms.double(5800.), #D.B.: this should correspond to a threshold of 530mV
ThresholdInElectrons_Endcap = cms.double(5800.),
ThresholdInElectrons_Barrel = cms.double(6300.), #(0.4 MIP = 0.4 * 16000 e)
ThresholdInElectrons_Endcap = cms.double(6300.), #(0.4 MIP = 0.4 * 16000 e)
AddThresholdSmearing = cms.bool(True),
ThresholdSmearing_Barrel = cms.double(580.0),#D.B.: changed (~5mV peakToPeak --> 1.76mV rms) (was 210.0)
ThresholdSmearing_Endcap = cms.double(580.0),#D.B.: changed (~5mV peakToPeak --> 1.76mV rms) (was 245.0)
ThresholdSmearing_Barrel = cms.double(630.0),
ThresholdSmearing_Endcap = cms.double(630.0),
HIPThresholdInElectrons_Barrel = cms.double(1.0e10), # very high value to avoid Over threshold bit
HIPThresholdInElectrons_Endcap = cms.double(1.0e10), # very high value to avoid Over threshold bit
NoiseInElectrons = cms.double(300), # 30% of the readout noise (should be changed in future)
DigitalReadout = cms.bool(True), # Flag to decide analog or digital readout
AdcFullScale = cms.int32(255),
Expand Down Expand Up @@ -91,13 +95,16 @@
#Strip in PS module
PSSDigitizerAlgorithm = cms.PSet(
makeDigiSimLinks = cms.untracked.bool(True),
ElectronPerAdc = cms.double(135.0),
#D.B.:the noise should be a function of strip capacitance, roughly: ReadoutNoiseInElec=500+(64*Cdet[pF]) ~= 500+(64*1.5[cm])
ReadoutNoiseInElec = cms.double(1000.0),#D.B.:Fill readout noise, including all readout chain, relevant for smearing
ThresholdInElectrons_Barrel = cms.double(5800.), #D.B.: this should correspond to a threshold of 530mV
ThresholdInElectrons_Endcap = cms.double(5800.),
ThresholdInElectrons_Barrel = cms.double(6300.), #(0.4 MIP = 0.4 * 16000 e)
ThresholdInElectrons_Endcap = cms.double(6300.), #(0.4 MIP = 0.4 * 16000 e)
AddThresholdSmearing = cms.bool(True),
ThresholdSmearing_Barrel = cms.double(580.0),#D.B.: changed (~5mV peakToPeak --> 1.76mV rms) (was 210.0)
ThresholdSmearing_Endcap = cms.double(580.0),#D.B.: changed (~5mV peakToPeak --> 1.76mV rms) (was 245.0)
ThresholdSmearing_Barrel = cms.double(630.0),
ThresholdSmearing_Endcap = cms.double(630.0),
HIPThresholdInElectrons_Barrel = cms.double(21000.), # 1.4 MIP considered as HIP
HIPThresholdInElectrons_Endcap = cms.double(21000.), # 1.4 MIP considered as HIP
NoiseInElectrons = cms.double(300), # 30% of the readout noise (should be changed in future)
DigitalReadout = cms.bool(True), # Flag to decide analog or digital readout
AdcFullScale = cms.int32(255),
Expand Down Expand Up @@ -127,13 +134,16 @@
#Two Strip Module
SSDigitizerAlgorithm = cms.PSet(
makeDigiSimLinks = cms.untracked.bool(True),
ElectronPerAdc = cms.double(135.0),
#D.B.:the noise should be a function of strip capacitance, roughly: ReadoutNoiseInElec=500+(64*Cdet[pF]) ~= 500+(64*1.5[cm])
ReadoutNoiseInElec = cms.double(1000.0),#D.B.:Fill readout noise, including all readout chain, relevant for smearing
ThresholdInElectrons_Barrel = cms.double(5800.), #D.B.: this should correspond to a threshold of 530mV
ThresholdInElectrons_Endcap = cms.double(5800.),
AddThresholdSmearing = cms.bool(True),
ThresholdSmearing_Barrel = cms.double(580.0),#D.B.: changed (~5mV peakToPeak --> 1.76mV rms) (was 210.0)
ThresholdSmearing_Endcap = cms.double(580.0),#D.B.: changed (~5mV peakToPeak --> 1.76mV rms) (was 245.0)
HIPThresholdInElectrons_Barrel = cms.double(1.0e10), # very high value to avoid Over threshold bit
HIPThresholdInElectrons_Endcap = cms.double(1.0e10), # very high value to avoid Over threshold bit
NoiseInElectrons = cms.double(300), # 30% of the readout noise (should be changed in future)
DigitalReadout = cms.bool(True), # Flag to decide analog or digital readout
AdcFullScale = cms.int32(255),
Expand Down
33 changes: 18 additions & 15 deletions SimTracker/SiPhase2Digitizer/test/DigiTest_cfg.py
Expand Up @@ -14,22 +14,20 @@
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.EventContent.EventContent_cff')
#process.load('Configuration.Geometry.GeometryExtended2023tiltedReco_cff')
process.load('Configuration.Geometry.GeometryExtended2023D3Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2023D4Reco_cff')
process.load('Configuration.StandardSequences.MagneticField_38T_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.load('Configuration.StandardSequences.EndOfProcess_cff')

# Other statements
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '')

process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
# list of files

process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'file:step2_DIGI.root'
)
'file:step2_DIGI.root'
)
)
# Production Info
process.configurationMetadata = cms.untracked.PSet(
Expand Down Expand Up @@ -64,15 +62,20 @@
#process.digi_step = cms.Sequence(process.siPixelRawData*process.siPixelDigis)
process.p = cms.Path(process.digiana_seq * process.dqm_comm )

# customisation of the process.

# Automatic addition of the customisation function from SLHCUpgradeSimulations.Configuration.combinedCustoms
#from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2023tilted
# customisation of the process.

#call to customisation function cust_2023tilted imported from SLHCUpgradeSimulations.Configuration.combinedCustoms
#process = cust_2023tilted(process)
# Automatic addition of the customisation function from SLHCUpgradeSimulations.Configuration.combinedCustoms
from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2023LReco
from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2023tilted4021
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function doesn't exist at this moment- is it coming or is it now removed thanks to the eras migration (which is where this needs to go at some point)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added era option


#call to customisation function cust_2023tilted4021 imported from SLHCUpgradeSimulations.Configuration.combinedCustoms
process = cust_2023tilted4021(process)

# Automatic addition of the customisation function from HLTrigger.Configuration.customizeHLTforMC
from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforFullSim

#call to customisation function customizeHLTforFullSim imported from HLTrigger.Configuration.customizeHLTforMC
process = customizeHLTforFullSim(process)

# End of customisation functions

#call to customisation function cust_2023LReco imported from SLHCUpgradeSimulations.Configuration.combinedCustoms
process = cust_2023LReco(process)
# Customisation from command line