Skip to content

Commit

Permalink
Add check that cellID encoder field contains layer id, add silicon wr…
Browse files Browse the repository at this point in the history
…apper for IDEA
  • Loading branch information
armin-ilg committed Sep 23, 2024
1 parent d8451ab commit 9f38283
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 37 deletions.
10 changes: 9 additions & 1 deletion VTXdigi/src/VTXdigitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ StatusCode VTXdigitizer::initialize() {
// set the cellID decoder
m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); // Can be used to access e.g. layer index: m_decoder->get(cellID, "layer"),

if (m_decoder->fieldDescription().find("layer") == std::string::npos){
error()
<< " Readout " << m_readoutName << " does not contain layer id!"
<< endmsg;
return StatusCode::FAILURE;
}

// retrieve the volume manager
m_volman = m_geoSvc->getDetector()->volumeManager();

Expand Down Expand Up @@ -138,7 +145,8 @@ StatusCode VTXdigitizer::execute(const EventContext&) const {

// Smear the hit in the local sensor coordinates
double digiHitLocalPosition[3];
int iLayer = m_decoder->get(cellID, "layer");
int iLayer = m_decoder->get(cellID, "layer");
debug() << "readout: " << m_readoutName << ", layer id: " << iLayer << endmsg;
if (m_readoutName == "VertexBarrelCollection" ||
m_readoutName == "SiWrBCollection") { // In barrel, the sensor box is along y-z
digiHitLocalPosition[0] = simHitLocalPositionVector.x();
Expand Down
74 changes: 38 additions & 36 deletions VTXdigi/test/runVTXdigitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@

################## Vertex sensor resolutions
# IDEA
innerVertexResolution_x = 0.003 # [mm], assume 5 µm resolution for ARCADIA sensor
innerVertexResolution_y = 0.003 # [mm], assume 5 µm resolution for ARCADIA sensor
innerVertexResolution_x = 0.003 # [mm], assume 3 µm resolution for ARCADIA sensor
innerVertexResolution_y = 0.003 # [mm], assume 3 µm resolution for ARCADIA sensor
innerVertexResolution_t = 1000 # [ns]
outerVertexResolution_x = 0.050/math.sqrt(12) # [mm], assume ATLASPix3 sensor with 50 µm pitch
outerVertexResolution_y = 0.150/math.sqrt(12) # [mm], assume ATLASPix3 sensor with 150 µm pitch
outerVertexResolution_t = 1000 # [ns]

# CLD
vertexBarrelResolution_x = 0.003 # [mm], assume 5 µm resolution
vertexBarrelResolution_y = 0.003 # [mm], assume 5 µm resolution
vertexBarrelResolution_x = 0.003 # [mm], assume 3 µm resolution
vertexBarrelResolution_y = 0.003 # [mm], assume 3 µm resolution
vertexBarrelResolution_t = 1000 # [ns]
vertexEndcapResolution_x = 0.003 # [mm], assume 5 µm resolution
vertexEndcapResolution_y = 0.003 # [mm], assume 5 µm resolution
vertexEndcapResolution_x = 0.003 # [mm], assume 3 µm resolution
vertexEndcapResolution_y = 0.003 # [mm], assume 3 µm resolution
vertexEndcapResolution_t = 1000 # [ns]


# IDEA silicon wrapper
siWrapperResolution_x = 0.050/math.sqrt(12) # [mm]
siWrapperResolution_y = 1.0/math.sqrt(12) # [mm]
siWrapperResolution_t = 0.040 # [ns], assume 40 ps timing resolution for a single layer -> Should lead to <30 ps resolution when >1 hit
Expand Down Expand Up @@ -127,11 +127,11 @@
SimG4SaveTrackerHitsD = SimG4SaveTrackerHits("SimG4SaveTrackerHitsD", readoutName="VertexEndcapCollection")
SimG4SaveTrackerHitsD.SimTrackHits.Path = "VTXD_simTrackerHits"

# SimG4SaveTrackerHitsSiWrB = SimG4SaveTrackerHits("SimG4SaveTrackerHitsSiWrB", readoutName="SiWrBCollection")
# SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path = "SiWrB_simTrackerHits"
SimG4SaveTrackerHitsSiWrB = SimG4SaveTrackerHits("SimG4SaveTrackerHitsSiWrB", readoutName="SiWrBCollection")
SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path = "SiWrB_simTrackerHits"

# SimG4SaveTrackerHitsSiWrD = SimG4SaveTrackerHits("SimG4SaveTrackerHitsSiWrD", readoutName="SiWrDCollection")
# SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path = "SiWrD_simTrackerHits"
SimG4SaveTrackerHitsSiWrD = SimG4SaveTrackerHits("SimG4SaveTrackerHitsSiWrD", readoutName="SiWrDCollection")
SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path = "SiWrD_simTrackerHits"

from Configurables import SimG4Alg

Expand All @@ -146,7 +146,7 @@
# IDEA
geantsim = SimG4Alg("SimG4Alg",
outputs= [SimG4SaveTrackerHitsB, SimG4SaveTrackerHitsD,
#SimG4SaveTrackerHitsSiWrB, SimG4SaveTrackerHitsSiWrD,
SimG4SaveTrackerHitsSiWrB, SimG4SaveTrackerHitsSiWrD,
#saveHistTool
],
eventProvider=particle_converter,
Expand Down Expand Up @@ -210,29 +210,31 @@
OutputLevel = INFO
)

#siwrb_digitizer = VTXdigitizer("SiWrBdigitizer",
# inputSimHits = SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path,
# outputDigiHits = SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path.replace("sim", "digi"),
# detectorName = "SiliconWrapper",
# readoutName = "SiWrBCollection",
# xResolutions = siWrapperResolution_x, # mm, r direction
# yResolutions = siWrapperResolution_y, # mm, phi direction
# tResolutions = siWrapperResolution_t, # ns
# forceHitsOntoSurface = False,
# OutputLevel = INFO
#)
#
#siwrd_digitizer = VTXdigitizer("SiWrDdigitizer",
# inputSimHits = SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path,
# outputDigiHits = SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path.replace("sim", "digi"),
# detectorName = "SiliconWrapper",
# readoutName = "SiWrDCollection",
# xResolutions = siWrapperResolution_x, # mm, r direction
# yResolutions = siWrapperResolution_y, # mm, phi direction
# tResolutions = siWrapperResolution_t, # ns
# forceHitsOntoSurface = False,
# OutputLevel = INFO
#)
idea_siwrb_digitizer = VTXdigitizer("SiWrBdigitizer",
inputSimHits = SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path,
outputDigiHits = SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path.replace("sim", "digi"),
outputSimDigiAssociation = SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path.replace("simTrackerHits", "simDigiAssociation"),
detectorName = "SiWrB",
readoutName = "SiWrBCollection",
xResolution = [siWrapperResolution_x, siWrapperResolution_x], # mm, r-phi direction
yResolution = [siWrapperResolution_y, siWrapperResolution_y], # mm, z direction
tResolution = [siWrapperResolution_t, siWrapperResolution_t], # ns
forceHitsOntoSurface = False,
OutputLevel = INFO
)

idea_siwrd_digitizer = VTXdigitizer("SiWrDdigitizer",
inputSimHits = SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path,
outputDigiHits = SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path.replace("sim", "digi"),
outputSimDigiAssociation = SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path.replace("simTrackerHits", "simDigiAssociation"),
detectorName = "SiWrD",
readoutName = "SiWrDCollection",
xResolution = [siWrapperResolution_x, siWrapperResolution_x], # mm, r direction
yResolution = [siWrapperResolution_y, siWrapperResolution_y], # mm, phi direction
tResolution = [siWrapperResolution_t, siWrapperResolution_t], # ns
forceHitsOntoSurface = False,
OutputLevel = INFO
)

# run the genfit tracking
# from Configurables import GenFitter
Expand Down Expand Up @@ -281,7 +283,7 @@
hepmc_converter,
geantsim,
idea_vtxb_digitizer, idea_vtxd_digitizer,
#siwrb_digitizer, siwrd_digitizer,
idea_siwrb_digitizer, idea_siwrd_digitizer,
out
],
EvtSel = 'NONE',
Expand Down

0 comments on commit 9f38283

Please sign in to comment.