Skip to content

Commit

Permalink
Merge pull request #16389 from suchandradutta/Phase2Digitizer_81X_221016
Browse files Browse the repository at this point in the history
updated Digitizer framework adding (a) option to allow independent El…
  • Loading branch information
cmsbuild committed Nov 11, 2016
2 parents ef1bd26 + 755b94c commit 05f0fff
Show file tree
Hide file tree
Showing 10 changed files with 234 additions and 99 deletions.
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
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
27 changes: 6 additions & 21 deletions SimTracker/SiPhase2Digitizer/test/DigiTest_cfg.py
@@ -1,6 +1,6 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("digiTest")
process = cms.Process('digiTest',eras.Phase2C2)
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(-1)
)
Expand All @@ -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.StandardSequences.MagneticField_38T_cff')
process.load('Configuration.Geometry.GeometryExtended2023D4Reco_cff')
process.load('Configuration.StandardSequences.MagneticField_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 @@ -63,16 +61,3 @@

#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

#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

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

0 comments on commit 05f0fff

Please sign in to comment.