diff --git a/VTXdigi/src/VTXdigitizer.cpp b/VTXdigi/src/VTXdigitizer.cpp index c67ecc2..3a3a323 100644 --- a/VTXdigi/src/VTXdigitizer.cpp +++ b/VTXdigi/src/VTXdigitizer.cpp @@ -131,18 +131,20 @@ StatusCode VTXdigitizer::execute() { double digiHitLocalPosition[3]; if (m_readoutName == "VTXIBCollection" || m_readoutName == "VTXOBCollection" || - m_readoutName == "VertexBarrelCollection") { // In barrel, the sensor box is along y-z + m_readoutName == "VertexBarrelCollection" || + m_readoutName == "SiWrapperBCollection") { // In barrel, the sensor box is along y-z digiHitLocalPosition[0] = simHitLocalPositionVector.x(); digiHitLocalPosition[1] = simHitLocalPositionVector.y() + m_gauss_x.shoot() * dd4hep::mm; digiHitLocalPosition[2] = simHitLocalPositionVector.z() + m_gauss_y.shoot() * dd4hep::mm; } else if (m_readoutName == "VTXDCollection" || - m_readoutName == "VertexEndcapCollection") { // In the disks, the sensor box is already in x-y + m_readoutName == "VertexEndcapCollection" || + m_readoutName == "SiWrapperDCollection") { // In the disks, the sensor box is already in x-y digiHitLocalPosition[0] = simHitLocalPositionVector.x() + m_gauss_x.shoot() * dd4hep::mm; digiHitLocalPosition[1] = simHitLocalPositionVector.y() + m_gauss_y.shoot() * dd4hep::mm; digiHitLocalPosition[2] = simHitLocalPositionVector.z(); } else { error() - << "VTX readout name (m_readoutName) needs to be either VTXIBCollection, VTXOBCollection or VTXDCollection" + << "VTX readout name (m_readoutName) unknown!" << endmsg; return StatusCode::FAILURE; } diff --git a/VTXdigi/test/runVTXdigitizer.py b/VTXdigi/test/runVTXdigitizer.py index 74669b6..c60ebbb 100644 --- a/VTXdigi/test/runVTXdigitizer.py +++ b/VTXdigi/test/runVTXdigitizer.py @@ -20,6 +20,9 @@ outerVertexResolution_x = 0.014 # [mm], assume ATLASPix3 sensor with 50 µm pitch -> 50/sqrt(12) = 14.4 µm resolution outerVertexResolution_y = 0.043 # [mm], assume ATLASPix3 sensor with 150 µm pitch -> 150/sqrt(12) = 43.3 µm resolution +siWrapperResolution_x = 0.050 # [mm] +siWrapperResolution_y = 1.0 # [mm] + from Configurables import GenAlg genAlg = GenAlg() from Configurables import MomentumRangeParticleGun @@ -47,16 +50,13 @@ from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc") # if FCC_DETECTORS is empty, this should use relative path to working directory -# path_to_detector = os.environ.get("FCCDETECTORS", "") -# path_to_detector = os.environ.get("FCCDETECTORS", "") -# print(path_to_detector) -# detectors_to_use=[ -# 'FCCee/IDEA/compact/IDEA_o1_v01/FCCee_IDEA_o1_v01.xml', -# ] +path_to_detector = os.environ.get("K4GEO", "") # Previously used "FCCDETECTORS" +print(path_to_detector) +detectors_to_use=[ + 'FCCee/IDEA/compact/IDEA_o1_v02/IDEA_o1_v02.xml', + ] # prefix all xmls with path_to_detector -# geoservice.detectors = [os.path.join(path_to_detector, _det) for _det in detectors_to_use] -# geoservice.detectors = ["../lcgeo/FCCee/CLD/compact/CLD_o2_v05/CLD_o2_v05.xml"] # CLD -geoservice.detectors = ["../lcgeo/FCCee/IDEA/compact/IDEA_o1_v01/IDEA_o1_v01.xml"] # IDEA +geoservice.detectors = [os.path.join(path_to_detector, _det) for _det in detectors_to_use] geoservice.OutputLevel = INFO # Geant4 service @@ -97,27 +97,33 @@ from Configurables import SimG4SaveTrackerHits ### CLD -# SimG4SaveTrackerHitsB = SimG4SaveTrackerHits("SimG4SaveTrackerHitsB", readoutNames=["VertexBarrelCollection"]) +# SimG4SaveTrackerHitsB = SimG4SaveTrackerHits("SimG4SaveTrackerHitsB", readoutName="VertexBarrelCollection") # SimG4SaveTrackerHitsB.SimTrackHits.Path = "VTXB_simTrackerHits" -# SimG4SaveTrackerHitsE = SimG4SaveTrackerHits("SimG4SaveTrackerHitsE", readoutNames=["VertexEndcapCollection"]) +# SimG4SaveTrackerHitsE = SimG4SaveTrackerHits("SimG4SaveTrackerHitsE", readoutName="VertexEndcapCollection" # SimG4SaveTrackerHitsE.SimTrackHits.Path = "VTXE_simTrackerHits" ### IDEA -SimG4SaveTrackerHitsIB = SimG4SaveTrackerHits("SimG4SaveTrackerHitsIB", readoutNames=["VTXIBCollection"]) +SimG4SaveTrackerHitsIB = SimG4SaveTrackerHits("SimG4SaveTrackerHitsIB", readoutName="VTXIBCollection") SimG4SaveTrackerHitsIB.SimTrackHits.Path = "VTXIB_simTrackerHits" -SimG4SaveTrackerHitsOB = SimG4SaveTrackerHits("SimG4SaveTrackerHitsOB", readoutNames=["VTXOBCollection"]) +SimG4SaveTrackerHitsOB = SimG4SaveTrackerHits("SimG4SaveTrackerHitsOB", readoutName="VTXOBCollection") SimG4SaveTrackerHitsOB.SimTrackHits.Path = "VTXOB_simTrackerHits" -SimG4SaveTrackerHitsD = SimG4SaveTrackerHits("SimG4SaveTrackerHitsD", readoutNames=["VTXDCollection"]) +SimG4SaveTrackerHitsD = SimG4SaveTrackerHits("SimG4SaveTrackerHitsD", readoutName="VTXDCollection") SimG4SaveTrackerHitsD.SimTrackHits.Path = "VTXD_simTrackerHits" +SimG4SaveTrackerHitsSiWrB = SimG4SaveTrackerHits("SimG4SaveTrackerHitsSiWrB", readoutName="SiWrapperBCollection") +SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path = "SiWrB_simTrackerHits" + +SimG4SaveTrackerHitsSiWrD = SimG4SaveTrackerHits("SimG4SaveTrackerHitsSiWrD", readoutName="SiWrapperDCollection") +SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path = "SiWrD_simTrackerHits" from Configurables import SimG4Alg geantsim = SimG4Alg("SimG4Alg", - outputs= [SimG4SaveTrackerHitsIB, SimG4SaveTrackerHitsOB, SimG4SaveTrackerHitsD ## IDEA + outputs= [SimG4SaveTrackerHitsIB, SimG4SaveTrackerHitsOB, SimG4SaveTrackerHitsD, ## IDEA vertex + # SimG4SaveTrackerHitsSiWrB, SimG4SaveTrackerHitsSiWrD ## IDEA wrapper #SimG4SaveTrackerHitsB, SimG4SaveTrackerHitsE ## CLD #saveHistTool ], @@ -179,6 +185,26 @@ OutputLevel = INFO ) +# siwrb_digitizer = VTXdigitizer("SiWrBdigitizer", +# inputSimHits = SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path, +# outputDigiHits = SimG4SaveTrackerHitsSiWrB.SimTrackHits.Path.replace("sim", "digi"), +# readoutName = "SiWrapperBCollection", +# xResolution = siWrapperResolution_x, # mm, r direction +# yResolution = siWrapperResolution_y, # mm, phi direction +# tResolution = 0.030, # ns +# OutputLevel = INFO +# ) + +# siwrd_digitizer = VTXdigitizer("SiWrDdigitizer", +# inputSimHits = SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path, +# outputDigiHits = SimG4SaveTrackerHitsSiWrD.SimTrackHits.Path.replace("sim", "digi"), +# readoutName = "SiWrapperDCollection", +# xResolution = siWrapperResolution_x, # mm, r direction +# yResolution = siWrapperResolution_y, # mm, phi direction +# tResolution = 0.030, # ns +# OutputLevel = INFO +# ) + # run the genfit tracking # from Configurables import GenFitter # genfitter = GenFitter("GenFitter", inputHits = savetrackertool.SimTrackHits.Path.replace("sim", "digi"), outputTracks = "genfit_tracks") @@ -213,11 +239,9 @@ genAlg, hepmc_converter, geantsim, - # vtxb_digitizer, - # vtxe_digitizer, - vtxib_digitizer, - vtxob_digitizer, - vtxd_digitizer, + # vtxb_digitizer,vtxe_digitizer, + vtxib_digitizer, vtxob_digitizer, vtxd_digitizer, + # siwrb_digitizer, siwrd_digitizer, out ], EvtSel = 'NONE',