Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • 1810337/CEPCSW
  • shexin/CEPCSW
  • dudejing/CEPCSW
  • yudian2002/cepcsw-otb-development
  • cepcsw/CEPCSW
  • cepc/CEPCSW
  • shixin/CEPCSW
  • lizhan/CEPCSW
  • 1365447033/CEPCSW
  • shihy/CEPCSW
  • sunwy/CEPCSW
  • guofangyi/cepcsw-release
  • lintao/CEPCSW
  • tanggy/CEPCSW
  • gongjd1119/CEPCSW
  • 221840222/CEPCSW
  • lihn/CEPCSW
  • thinking/CEPCSW
  • myliu/CEPCSW
  • shihy/cepcsw-dose
  • zhaog/CEPCSW
  • 201840277/CEPCSW
  • wangchu/CEPCSW
  • xiaolin.wang/CEPCSW
  • fucd/CEPCSW1
  • tyzhang/CEPCSW
  • yudian2002/cepcsw-ote-development
  • songwz/cepcsw-tdr
  • luhc/CEPCSW
  • tangyb/CEPCSW
  • dhb112358/CEPCSW
  • chenbp/CEPCSW
  • guolei/CEPCSW
  • yudian2002/cepcsw-otk-end-cap-development
  • jiangxj/CEPCSW
  • yudian2002/cepcsw-geo-upgrade
  • fangwx/CEPCSW
  • yudian2002/cepcsw-geo-upgrade-v-2
  • mengwq/CEPCSW
  • zhangxm/CEPCSW
  • chenye/CEPCSW
  • wuchonghao9612/CEPCSW
  • xuchj7/CEPCSW
  • yudian2002/cepcsw-otk-endcap-update-01
  • lizhihao/CEPCSW
  • laipz/CEPCSW
  • zhangkl/CEPCSW
  • lihp29/CEPCSW
  • shuxian/CEPCSW
  • zhangyz/CEPCSW
  • zhangjinxian/CEPCSW_20250110
  • glliu/CEPCSW
  • shuohan/CEPCSW
  • fucd/CEPCSW
  • starr136a/CEPCSW
  • yudian2002/CEPCSW
  • wanjw03/CEPCSW
  • zyjonah/CEPCSW
  • maxt/CEPCSW
59 results
Show changes
Showing
with 1422 additions and 250 deletions
......@@ -72,13 +72,13 @@ EcalDigi.SkipEvt = 0
EcalDigi.Seed = 2079
#Digitalization parameters
EcalDigi.TimeResolution = 0.7 # 0.7 ns
EcalDigi.EcalMIPEnergy = 8.9 # MIP energy 8.9 MeV for 1 cm BGO
EcalDigi.EcalMIPEnergy = 13.35 # MIP energy 13.35 MeV for 1.5 cm BGO
EcalDigi.EcalMIP_Thre = 0.05 # 0.05 mip at each side, 0.1 mip for one bar
EcalDigi.UseRealisticDigi = 1
# scintillation
EcalDigi.UseDigiScint = 1
EcalDigi.EcalCryIntLY = 8200 #intrinsic LY 8200 [p.e./MIP]
EcalDigi.EcalCryMipLY = 200 #Detected effective LY 200 [p.e./MIP]
EcalDigi.EcalCryMipLY = 300 #Detected effective LY 300 [p.e./MIP]
EcalDigi.AttenuationLength = 1e8 # 8000 mm for 5% non-uniformity
# SiPM
EcalDigi.SiPMDigiVerbose = 2 # 0:w/o response, w/o correction; 1:w/ response, w/o correction; 2:w/ response, w/ simple correction; 3:w/ response, w/ full correction
......@@ -86,14 +86,18 @@ EcalDigi.EcalSiPMPDE = 0.25 # NDL-EQR06, PDE 0.25
EcalDigi.EcalSiPMDCR = 0 # NDL-EQR06, dark count rate 2500000 [Hz]
EcalDigi.EcalTimeInterval = 0. # Time interval 0.000002 [s]. DCR*TimeInterval = dark count noise
EcalDigi.EcalSiPMCT = 0. # SiPM crosstalk Probability 12%
EcalDigi.EcalSiPMGainMean = 50 # 50 [ADC/p.e.]
EcalDigi.EcalSiPMGainMean = 5 # 5 [ADC/p.e.]
EcalDigi.EcalSiPMGainSigma = 0.08 # 0.08
#EcalDigi.EcalSiPMNoiseSigma = 0 # 0
# ADC
EcalDigi.ADC = 8192 # 13-bit, 8192
EcalDigi.ADCSwitch = 8000 # 8000
EcalDigi.Pedestal = 50 # Pedestal 50 ADC
EcalDigi.GainRatio_12 = 50 # Gain ratio 50
EcalDigi.GainRatio_23 = 60 # Gain ratio 60
EcalDigi.GainRatio_12 = 30 # Gain ratio 30
EcalDigi.GainRatio_23 = 10 # Gain ratio 10
EcalDigi.EcalASICNoiseSigma = 4
EcalDigi.EcalFEENoiseSigma = 5
EcalDigi.ADCNonLinearity = 0 # ADC non-linearity 0
# temperature control
EcalDigi.UseCryTemp = 0
EcalDigi.UseCryTempCor = 0
......
......@@ -39,12 +39,12 @@ inp = PodioInput("InputReader")
inp.collections = [
"ECALBarrel",
"ECALBarrelParticleAssoCol",
# "ECALEndcaps",
# "ECALEndcapsParticleAssoCol",
"ECALEndcaps",
"ECALEndcapsParticleAssoCol",
"HCALBarrel",
"HCALBarrelParticleAssoCol",
# "HCALEndcaps",
# "HCALEndcapsParticleAssoCol",
"HCALEndcaps",
"HCALEndcapsParticleAssoCol",
"MCParticle",
"CompleteTracks",
"CompleteTracksParticleAssociation",
......@@ -60,7 +60,7 @@ CyberPFAlg.Seed = 1024
CyberPFAlg.BField = 3.
CyberPFAlg.Debug = 0
CyberPFAlg.SkipEvt = 0
CyberPFAlg.WriteAna = 1
CyberPFAlg.WriteAna = 0
CyberPFAlg.AnaFileName = "RecAnaTuple_TDR_o1_v01.root"
CyberPFAlg.UseMCPTrack = 0
CyberPFAlg.UseTruthMatchTrack = 0
......@@ -75,18 +75,12 @@ CyberPFAlg.HcalNeutralCalib = 4.0
CyberPFAlg.MCParticleCollection = "MCParticle"
CyberPFAlg.TrackCollections = ["CompleteTracks"]
CyberPFAlg.MCRecoTrackParticleAssociationCollection = "CompleteTracksParticleAssociation"
#CyberPFAlg.ECalCaloHitCollections = ["ECALBarrel","ECALEndcaps"]
#CyberPFAlg.ECalReadOutNames = ["EcalBarrelCollection","EcalEndcapsCollection"]
#CyberPFAlg.ECalMCPAssociationName = ["ECALBarrelParticleAssoCol", "ECALEndcapsParticleAssoCol"]
#CyberPFAlg.HCalCaloHitCollections = ["HCALBarrel", "HCALEndcaps"]
#CyberPFAlg.HCalReadOutNames = ["HcalBarrelCollection", "HcalEndcapsCollection"]
#CyberPFAlg.HCalMCPAssociationName = ["HCALBarrelParticleAssoCol", "HCALEndcapsParticleAssoCol"]
CyberPFAlg.ECalCaloHitCollections = ["ECALBarrel"]
CyberPFAlg.ECalReadOutNames = ["EcalBarrelCollection"]
CyberPFAlg.ECalMCPAssociationName = ["ECALBarrelParticleAssoCol"]
CyberPFAlg.HCalCaloHitCollections = ["HCALBarrel"]
CyberPFAlg.HCalReadOutNames = ["HcalBarrelCollection"]
CyberPFAlg.HCalMCPAssociationName = ["HCALBarrelParticleAssoCol"]
CyberPFAlg.ECalCaloHitCollections = ["ECALBarrel","ECALEndcaps"]
CyberPFAlg.ECalReadOutNames = ["EcalBarrelCollection","EcalEndcapsCollection"]
CyberPFAlg.ECalMCPAssociationName = ["ECALBarrelParticleAssoCol", "ECALEndcapsParticleAssoCol"]
CyberPFAlg.HCalCaloHitCollections = ["HCALBarrel", "HCALEndcaps"]
CyberPFAlg.HCalReadOutNames = ["HcalBarrelCollection", "HcalEndcapsCollection"]
CyberPFAlg.HCalMCPAssociationName = ["HCALBarrelParticleAssoCol", "HCALEndcapsParticleAssoCol"]
##--- Output collections ---
CyberPFAlg.OutputPFO = "outputPFO";
......@@ -113,8 +107,8 @@ CyberPFAlg.AlgParNames = [ ["InputECALBars","OutputECAL1DClusters","OutputECALHa
["OutputAxisName"], #6
["ReadinAxisName", "OutputClusName", "OutputTowerName"], #9
["ReadinHFClusterName", "ReadinTowerName","OutputClusterName"], #11
["InputHCALHits", "OutputHCALClusters"], #12
["DoECALClustering","DoHCALClustering","InputHCALHits","OutputHCALClusters"], #15
["OutputHCALClusters"], #12
["DoECALClustering","DoHCALClustering","OutputHCALClusters"], #15
["ReadinECALClusterName", "ReadinHCALClusterName", "OutputCombPFO"], #16
["ECALChargedCalib", "HCALChargedCalib", "ECALNeutralCalib", "HCALNeutralCalib"] ]#17
CyberPFAlg.AlgParTypes = [ ["string","string","string"],#1
......@@ -125,8 +119,8 @@ CyberPFAlg.AlgParTypes = [ ["string","string","string"],#1
["string"], #6
["string","string","string"], #9
["string","string","string"], #11
["string", "string"], #12
["bool","bool","string","string"], #15
["string"], #12
["bool","bool","string"], #15
["string","string","string"], #16
["double","double", "double","double"] ]#17
CyberPFAlg.AlgParValues = [ ["BarCol","Cluster1DCol","HalfClusterCol"],#1
......@@ -137,8 +131,8 @@ CyberPFAlg.AlgParValues = [ ["BarCol","Cluster1DCol","HalfClusterCol"],#1
["MergedAxis"], #6
["MergedAxis","ESHalfCluster","ESTower"], #9
["ESHalfCluster","ESTower","EcalCluster"], #11
["HCALBarrel", "SimpleHCALCluster"], #12
["0","1","HCALBarrel","HCALCluster"], #15
["SimpleHCALCluster"], #12
["0","1","HCALCluster"], #15
["EcalCluster", "SimpleHCALCluster", "outputPFO"], #16
["1.26","4.", "1.", "4."] ]#17
......@@ -149,6 +143,7 @@ pid.OutputPFOName = "CyberPFOPID"
from Configurables import GenMatch
genmatch = GenMatch("GenMatch")
genmatch.InputPFOs = "CyberPFOPID"
genmatch.nJets = 2
genmatch.R = 0.6
genmatch.OutputFile = "Jets_TDR_o1_v01.root"
......
......@@ -43,6 +43,7 @@ from Configurables import SLCIORdr
from Configurables import HepMCRdr
from Configurables import GenPrinter
########### Particle Gun ##############
gun = GtGunTool("GtGunTool")
gun.PositionXs = [0]
gun.PositionYs = [0]
......@@ -60,12 +61,24 @@ genprinter = GenPrinter("GenPrinter")
genalg = GenAlgo("GenAlgo")
genalg.GenTools = ["GtGunTool"]
############ Physics generator in stdhep
#stdheprdr = StdHepRdr("StdHepRdr")
#stdheprdr.Input = "/cefs/data/stdhep/CEPC240/higgs/update_from_LiangHao_1M/data/E240.Pnnh_gg.e0.p0.whizard195/nnh_gg.e0.p0.00001.stdhep"
#genalg = GenAlgo("GenAlgo")
#genalg.GenTools = ["StdHepRdr"]
##############################################################################
# Detector Simulation
##############################################################################
from Configurables import DetSimSvc
detsimsvc = DetSimSvc("DetSimSvc")
from Configurables import Edm4hepWriterAnaElemTool
edm4hep_writer = Edm4hepWriterAnaElemTool("Edm4hepWriterAnaElemTool")
edm4hep_writer.TrackerCollections = ["VXD", "ITKBarrel", "ITKEndcap", "TPC", "TPCLowPt", "TPCSpacePoint",
"OTKBarrel", "OTKEndcap", "COIL", "MuonBarrel", "MuonEndcap"]
from Configurables import DetSimAlg
detsimalg = DetSimAlg("DetSimAlg")
detsimalg.RandomSeeds = seed
......@@ -80,10 +93,14 @@ detsimalg.AnaElems = [
]
detsimalg.RootDetElem = "WorldDetElemTool"
from Configurables import Edm4hepWriterAnaElemTool
detsim_anatool = Edm4hepWriterAnaElemTool("Edm4hepWriterAnaElemTool")
detsim_anatool.IsTrk2Primary = False # True: primary; False: ancestor
from Configurables import TimeProjectionChamberSensDetTool
tpc_sensdettool = TimeProjectionChamberSensDetTool("TimeProjectionChamberSensDetTool")
tpc_sensdettool.TypeOption = 1
tpc_sensdettool.DoHeedSim = True
tpc_sensdettool.DoHeedSim = False #True
dedxoption = "TrackHeedSimTool"
tpc_sensdettool.DedxSimTool = dedxoption
......@@ -96,6 +113,15 @@ dedx_simtool.max_step = 1#mm
dedx_simtool.save_mc = True
#dedx_simtool.OutputLevel = DEBUG
from Configurables import CalorimeterSensDetTool
from Configurables import DriftChamberSensDetTool
cal_sensdettool = CalorimeterSensDetTool("CalorimeterSensDetTool")
cal_sensdettool.CalNamesMergeDisable = ["EcalBarrel", "EcalEndcap", "HcalBarrel", "HcalEndcap"]
cal_sensdettool.CalNamesApplyBirks = ["EcalBarrel", "EcalEndcap", "HcalBarrel","HcalEndcap"]
cal_sensdettool.CalNamesBirksConstants = [0.008415, 0.008415, 0.01, 0.01] # BGO and Glass scintillator
from Configurables import MarlinEvtSeeder
evtseeder = MarlinEvtSeeder("EventSeeder")
......
......@@ -50,9 +50,10 @@ podioinput = PodioInput("PodioReader", collections=[
"MCParticle",
"VXDCollection",
"ITKBarrelCollection",
"ITKEndcapCollection",
"TPCCollection",
"OTKBarrelCollection",
"FTDCollection",
"OTKEndcapCollection",
"MuonBarrelCollection",
"MuonEndcapCollection"
])
......@@ -65,17 +66,17 @@ podioinput = PodioInput("PodioReader", collections=[
## Config ##
vxdhitname = "VXDTrackerHits"
sithitname = "ITKBarrelTrackerHits"
ftdhitname = "ITKEndcapTrackerHits"
gashitname = "TPCTrackerHits"
sethitname = "OTKBarrelTrackerHits"
setspname = "OTKBarrelSpacePoints"
ftdhitname = "FTDTrackerHits"
ftdspname = "FTDSpacePoints"
etdhitname = "OTKEndcapTrackerHits"
from Configurables import SmearDigiTool,SiTrackerDigiAlg
## VXD ##
vxdtool = SmearDigiTool("VXD")
vxdtool.ResolutionU = [0.005]
vxdtool.ResolutionV = [0.005]
vxdtool.EnergyThreshold = 0.00001 #GeV
#vxdtool.OutputLevel = DEBUG
digiVXD = SiTrackerDigiAlg("VXDDigi")
......@@ -89,6 +90,7 @@ digiVXD.DigiTool = "SmearDigiTool/VXD"
itkbtool = SmearDigiTool("ITKBarrel")
itkbtool.ResolutionU = [0.008]
itkbtool.ResolutionV = [0.040]
itkbtool.EnergyThreshold = 0.00005 #GeV
#itkbtool.OutputLevel = DEBUG
digiITKB = SiTrackerDigiAlg("ITKBarrelDigi")
......@@ -98,10 +100,25 @@ digiITKB.TrackerHitAssociationCollection = "ITKBarrelTrackerHitAssociation"
digiITKB.DigiTool = "SmearDigiTool/ITKBarrel"
#digiITKB.OutputLevel = DEBUG
## ITKEndcap ##
itketool = SmearDigiTool("ITKEndcap")
itketool.ResolutionU = [0.008]
itketool.ResolutionV = [0.040]
itketool.EnergyThreshold = 0.00005 #GeV
#itketool.OutputLevel = DEBUG
digiITKE = SiTrackerDigiAlg("ITKEndcapDigi")
digiITKE.SimTrackHitCollection = "ITKEndcapCollection"
digiITKE.TrackerHitCollection = ftdhitname
digiITKE.TrackerHitAssociationCollection = "ITKEndcapTrackerHitAssociation"
digiITKE.DigiTool = "SmearDigiTool/ITKEndcap"
#digiITKE.OutputLevel = DEBUG
## OTKBarrel ##
otkbtool = SmearDigiTool("OTKBarrel")
otkbtool.ResolutionU = [0.010]
otkbtool.ResolutionV = [1.000]
otkbtool.EnergyThreshold = 0.00005 #GeV
#otkbtool.OutputLevel = DEBUG
digiOTKB = SiTrackerDigiAlg("OTKBarrelDigi")
......@@ -111,18 +128,19 @@ digiOTKB.TrackerHitAssociationCollection = "OTKBarrelTrackerHitAssociation"
digiOTKB.DigiTool = "SmearDigiTool/OTKBarrel"
#digiOTKB.OutputLevel = DEBUG
## FTD ##
ftdtool = SmearDigiTool("FTD")
ftdtool.ResolutionU = [0.0072]
ftdtool.ResolutionV = [0.086]
#ftdtool.OutputLevel = DEBUG
## OTKEndcap ##
otketool = SmearDigiTool("OTKEndcap")
otketool.ResolutionU = [0.010]
otketool.ResolutionV = [1.000]
otketool.EnergyThreshold = 0.00005 #GeV
#otketool.OutputLevel = DEBUG
digiFTD = SiTrackerDigiAlg("FTDDigi")
digiFTD.SimTrackHitCollection = "FTDCollection"
digiFTD.TrackerHitCollection = ftdhitname
digiFTD.TrackerHitAssociationCollection = "FTDTrackerHitAssociation"
digiFTD.DigiTool = "SmearDigiTool/FTD"
#digiFTD.OutputLevel = DEBUG
digiOTKE = SiTrackerDigiAlg("OTKEndcapDigi")
digiOTKE.SimTrackHitCollection = "OTKEndcapCollection"
digiOTKE.TrackerHitCollection = etdhitname
digiOTKE.TrackerHitAssociationCollection = "OTKEndcapTrackerHitAssociation"
digiOTKE.DigiTool = "SmearDigiTool/OTKEndcap"
#digiOTKE.OutputLevel = DEBUG
## TPC ##
from Configurables import TPCDigiAlg
......@@ -150,9 +168,11 @@ digiMuon.MuonEndcapTrackerHits = "MuonEndcapTrackerHits"
digiMuon.WriteNtuple = 0
digiMuon.OutFileName = "Digi_MUON.root"
digiMuon.SiPMEff = 1
digiMuon.EdepMin = 0.0001
digiMuon.HitEdepMin = 0.000001
digiMuon.HitEdepMax = 0.1
digiMuon.EdepMin = 0.0 # no cut on GeV energy deposition
digiMuon.HitEdepMin = 6.0 # ADC counts
digiMuon.HitEdepMax = -1 # ADC counts, -1 means no upper cut
digiMuon.TimeResolution = 2.0 # Digi hit time resolution, in unit ns
#digiMuon.OutputLevel = DEBUG
#########################################
################
......@@ -195,7 +215,6 @@ tracking.HeaderCol = "EventHeader"
tracking.VTXHitCollection = vxdhitname
tracking.SITHitCollection = sithitname
tracking.FTDPixelHitCollection = ftdhitname
tracking.FTDSpacePointCollection = ftdspname
tracking.SITRawHitCollection = "NotNeedForPixelSIT"
tracking.FTDRawHitCollection = ftdhitname
tracking.UseSIT = True
......@@ -217,7 +236,7 @@ tracking.Chi2WZSeptet = 0.1
from Configurables import ForwardTrackingAlg
forward = ForwardTrackingAlg("ForwardTracking")
forward.FTDPixelHitCollection = ftdhitname
forward.FTDSpacePointCollection = ftdspname
#forward.FTDSpacePointCollection = ftdspname
forward.FTDRawHitCollection = ftdhitname
forward.Chi2ProbCut = 0.0
forward.HitsPerTrackMin = 3
......@@ -232,7 +251,7 @@ forward.CriteriaMax = [30, 1.02, 10, 1.015, 20, 1.3, 1.0, 150, 1.08, 99999999,
from Configurables import TrackSubsetAlg
subset = TrackSubsetAlg("TrackSubset")
subset.TrackInputCollections = ["ForwardTracks", "SiTracks"]
subset.RawTrackerHitCollections = [vxdhitname, sithitname, ftdhitname, ftdspname]
subset.RawTrackerHitCollections = [vxdhitname, sithitname, ftdhitname]
subset.TrackSubsetCollection = "SubsetTracks"
#subset.FitterTool = "KalTestTool/KalTest111"
#subset.OutputLevel = DEBUG
......@@ -249,7 +268,8 @@ full.SITTrackerHits = sithitname
full.TPCTrackerHits = gashitname
full.SETTrackerHits = sethitname
full.FTDPixelTrackerHits = ftdhitname
full.FTDSpacePoints = ftdspname
#full.FTDSpacePoints = ftdspname
full.ETDTrackerHits = etdhitname
full.SITRawHits = "NotNeedForPixelSIT"
full.SETRawHits = "NotNeedForPixelSET"
full.FTDRawHits = ftdhitname
......@@ -259,6 +279,8 @@ full.OutputTracks = "CompleteTracks" # default name
full.FTDHitToTrackDistance = 5.
full.SITHitToTrackDistance = 3.
full.SETHitToTrackDistance = 5.
#according to particle gun
full.ETDHitToTrackDistance = 40.
full.MinChi2ProbForSiliconTracks = 0
full.MaxChi2PerHit = 200
full.ForceSiTPCMerging = True
......@@ -277,7 +299,8 @@ from Configurables import TrackParticleRelationAlg
tpr = TrackParticleRelationAlg("Track2Particle")
tpr.MCParticleCollection = "MCParticle"
tpr.TrackList = ["CompleteTracks"]
tpr.TrackerAssociationList = ["VXDTrackerHitAssociation", "ITKBarrelTrackerHitAssociation", "OTKBarrelTrackerHitAssociation", "FTDTrackerHitAssociation"]
tpr.TrackerAssociationList = ["VXDTrackerHitAssociation", "ITKBarrelTrackerHitAssociation", "ITKEndcapTrackerHitAssociation",
"OTKBarrelTrackerHitAssociation", "OTKEndcapTrackerHitAssociation", "TPCTrackerHitAss"]
#tpr.OutputLevel = DEBUG
......@@ -285,7 +308,8 @@ from Configurables import TrueMuonTagAlg
tmt = TrueMuonTagAlg("TrueMuonTag")
tmt.MCParticleCollection = "MCParticle"
tmt.TrackList = ["CompleteTracks"]
tmt.TrackerAssociationList = ["VXDTrackerHitAssociation", "ITKBarrelTrackerHitAssociation", "OTKBarrelTrackerHitAssociation", "FTDTrackerHitAssociation", "TPCTrackerHitAss"]
tmt.TrackerAssociationList = ["VXDTrackerHitAssociation", "ITKBarrelTrackerHitAssociation", "ITKEndcapTrackerHitAssociation",
"OTKBarrelTrackerHitAssociation", "OTKEndcapTrackerHitAssociation", "TPCTrackerHitAss"]
tmt.MuonTagEfficiency = 0.95 # muon true tag efficiency, default is 1.0 (100%)
tmt.MuonDetTanTheta = 1.2 # muon det barrel/endcap separation tan(theta)
#tmt.OutputLevel = DEBUG
......@@ -299,7 +323,7 @@ out.outputCommands = ["keep *"]
# ApplicationMgr
from Configurables import ApplicationMgr
mgr = ApplicationMgr(
TopAlg = [podioinput, digiVXD, digiITKB, digiOTKB, digiFTD, digiTPC, digiMuon, tracking, forward, subset, clupatra, full, tpr, tpc_dndx, tof, tmt, out],
TopAlg = [podioinput, digiVXD, digiITKB, digiITKE, digiOTKB, digiOTKE, digiTPC, digiMuon, tracking, clupatra, full, tpr, tpc_dndx, tof, tmt, out],
EvtSel = 'NONE',
EvtMax = 50,
ExtSvc = [rndmengine, rndmgensvc, dsvc, evtseeder, geosvc, gearsvc, tracksystemsvc, pidsvc],
......
......@@ -64,6 +64,11 @@ genalg.GenTools = ["GtGunTool"]
from Configurables import DetSimSvc
detsimsvc = DetSimSvc("DetSimSvc")
from Configurables import Edm4hepWriterAnaElemTool
edm4hep_writer = Edm4hepWriterAnaElemTool("Edm4hepWriterAnaElemTool")
edm4hep_writer.TrackerCollections = ["VXD", "SIT", "FTD", "TPC", "TPCLowPt", "TPCSpacePoint",
"SET", "COIL", "MuonBarrel", "MuonEndcap"]
from Configurables import DetSimAlg
detsimalg = DetSimAlg("DetSimAlg")
detsimalg.RandomSeeds = seed
......
......@@ -208,32 +208,32 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
// ### Print Volume ###
// ####################
std::cout << "dim_x1" << " : " << dim_x1*2 << std::endl;
std::cout << "dim_x2" << " : " << dim_x2*2 << std::endl;
std::cout << "dim_x3" << " : " << dim_x3*2 << std::endl;
std::cout << "dim_x4" << " : " << dim_x4*2 << std::endl;
std::cout << "depth_longitudinal_p" << " : " << depth_longitudinal_p << std::endl;
std::cout << "depth_longitudinal_n" << " : " << depth_longitudinal_n << std::endl;
//std::cout << "dim_x1" << " : " << dim_x1*2 << std::endl;
//std::cout << "dim_x2" << " : " << dim_x2*2 << std::endl;
//std::cout << "dim_x3" << " : " << dim_x3*2 << std::endl;
//std::cout << "dim_x4" << " : " << dim_x4*2 << std::endl;
//std::cout << "depth_longitudinal_p" << " : " << depth_longitudinal_p << std::endl;
//std::cout << "depth_longitudinal_n" << " : " << depth_longitudinal_n << std::endl;
std::cout << "radius outer" << " : " << sqrt((radius_inner+depth_longitudinal_n)*(radius_inner+depth_longitudinal_n)+dim_x4*dim_x4) << std::endl;
std::cout << "radius outer" << " : " << sqrt((radius_inner+height_layer1+depth_longitudinal_p)*(radius_inner+height_layer1+depth_longitudinal_p)+dim_x2*dim_x2) << std::endl;
//std::cout << "radius outer" << " : " << sqrt((radius_inner+depth_longitudinal_n)*(radius_inner+depth_longitudinal_n)+dim_x4*dim_x4) << std::endl;
//std::cout << "radius outer" << " : " << sqrt((radius_inner+height_layer1+depth_longitudinal_p)*(radius_inner+height_layer1+depth_longitudinal_p)+dim_x2*dim_x2) << std::endl;
std::cout << "size_crystal" << " : " << size_crystal << std::endl;
std::cout << "size_posi_crystal" << " : " << size_posi_crystal << std::endl;
//std::cout << "size_crystal" << " : " << size_crystal << std::endl;
//std::cout << "size_posi_crystal" << " : " << size_posi_crystal << std::endl;
std::cout << "dead_material_p" << " : " << dead_material_p << std::endl;
std::cout << "dead_material_plus" << " : " << size_posi_crystal*tan(alice_angle) << std::endl;
//std::cout << "dead_material_p" << " : " << dead_material_p << std::endl;
//std::cout << "dead_material_plus" << " : " << size_posi_crystal*tan(alice_angle) << std::endl;
std::cout << "dead_material_n" << " : " << dead_material_n << std::endl;
std::cout << "dead_material_minus" << " : " << size_crystal/tan(copper_angle) << std::endl;
//std::cout << "dead_material_n" << " : " << dead_material_n << std::endl;
//std::cout << "dead_material_minus" << " : " << size_crystal/tan(copper_angle) << std::endl;
std::cout << "area_1" << " : " << dead_material_p*2*size_posi_crystal << std::endl;
std::cout << "area_2" << " : " << (dead_material_p+dead_material_p+size_posi_crystal*tan(alice_angle))*size_posi_crystal << std::endl;
std::cout << "area_3" << " : " << (dead_material_p+dead_material_p+2*size_posi_crystal*tan(alice_angle))*size_posi_crystal << std::endl;
//std::cout << "area_1" << " : " << dead_material_p*2*size_posi_crystal << std::endl;
//std::cout << "area_2" << " : " << (dead_material_p+dead_material_p+size_posi_crystal*tan(alice_angle))*size_posi_crystal << std::endl;
//std::cout << "area_3" << " : " << (dead_material_p+dead_material_p+2*size_posi_crystal*tan(alice_angle))*size_posi_crystal << std::endl;
std::cout << "area_4" << " : " << dead_material_n*2*size_crystal << std::endl;
std::cout << "area_5" << " : " << (dead_material_n+dead_material_n+size_crystal/tan(copper_angle))*size_crystal << std::endl;
std::cout << "area_6" << " : " << (dead_material_n+dead_material_n+2*size_crystal/tan(copper_angle))*size_crystal << std::endl;
//std::cout << "area_4" << " : " << dead_material_n*2*size_crystal << std::endl;
//std::cout << "area_5" << " : " << (dead_material_n+dead_material_n+size_crystal/tan(copper_angle))*size_crystal << std::endl;
//std::cout << "area_6" << " : " << (dead_material_n+dead_material_n+2*size_crystal/tan(copper_angle))*size_crystal << std::endl;
double area_posi = (2*dim_x1+2*dim_x2)*depth_longitudinal_p/2;
double area_nega = (2*dim_x3+2*dim_x4)*depth_longitudinal_n/2;
......@@ -246,12 +246,12 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
double area_5 = (dead_material_n+dead_material_n+size_crystal/tan(copper_angle))*size_crystal;
double area_6 = (dead_material_n+dead_material_n+2*size_crystal/tan(copper_angle))*size_crystal;
std::cout << "area_1_ratio" << " : " << (area_1+area_4)*2*14/(area_posi+area_nega) << std::endl;
std::cout << "area_2_ratio" << " : " << (area_2+area_5)*2*14/(area_posi+area_nega) << std::endl;
std::cout << "area_3_ratio" << " : " << (area_3+area_6)*2*14/(area_posi+area_nega) << std::endl;
//std::cout << "area_1_ratio" << " : " << (area_1+area_4)*2*14/(area_posi+area_nega) << std::endl;
//std::cout << "area_2_ratio" << " : " << (area_2+area_5)*2*14/(area_posi+area_nega) << std::endl;
//std::cout << "area_3_ratio" << " : " << (area_3+area_6)*2*14/(area_posi+area_nega) << std::endl;
std::cout << "pZ" << " : " << pZ << std::endl;
std::cout << "Nbar_phi" << " : " << Nbar_phi << std::endl;
//std::cout << "pZ" << " : " << pZ << std::endl;
//std::cout << "Nbar_phi" << " : " << Nbar_phi << std::endl;
// ####################################
// ### placement of all the volumes ###
......@@ -408,7 +408,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
Tot_Phi = Tot_Phi + Nbar_phi;
Tot_length_Phi_posi = Tot_length_Phi_posi + (length_posi-photoelectronic-crystal_wrapping)*2*(size_posi_crystal*0.5-crystal_wrapping)*2*(length_crystal_z-crystal_wrapping*2*Nbar_phi);
cout<<"length_crystal_phi "<<(dim_x1 - dead_material_l-photoelectronic-crystal_wrapping)*2 <<" "<<size_posi_crystal*tan(alice_angle)*2<<endl;
//cout<<"length_crystal_phi "<<(dim_x1 - dead_material_l-photoelectronic-crystal_wrapping)*2 <<" "<<size_posi_crystal*tan(alice_angle)*2<<endl;
dd4hep::Volume sipm_s0("sipm_s0", dd4hep::Box(photoelectronic/2, photoelectronic_width/2, photoelectronic_width/2), mat_Si);
sipm_s0.setVisAttributes(theDetector, "BlueVis");
......@@ -568,8 +568,8 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
Tot_Z = Tot_Z + 2*Nbar_z+1;
Tot_length_Z_posi = Tot_length_Z_posi + (2*length_posi-(2*Nbar_z+1)*crystal_wrapping*2)*(length_crystal_z/2-photoelectronic-crystal_wrapping)*2*(size_posi_crystal*0.5-crystal_wrapping)*2;
cout<<"layer: "<< ilayer+1 <<" Nbar_z: "<< 2*Nbar_z+1 <<endl;
cout<<"length_crystal_z "<<(length_crystal_z/2-photoelectronic-crystal_wrapping)*2 <<endl;
//cout<<"layer: "<< ilayer+1 <<" Nbar_z: "<< 2*Nbar_z+1 <<endl;
//cout<<"length_crystal_z "<<(length_crystal_z/2-photoelectronic-crystal_wrapping)*2 <<endl;
dd4hep::Volume sipm_s0("sipm_s0", dd4hep::Box(photoelectronic_width/2, photoelectronic/2, photoelectronic_width/2), mat_Si);
sipm_s0.setVisAttributes(theDetector, "BlueVis");
......@@ -723,7 +723,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::PlacedVolume plv = subtrap_positive_vol.placeVolume(block, Position(0, 0, 0.5*size_posi_crystal+ilayer*size_posi_crystal-dim_z_p));
plv.addPhysVolID("dlayer", floor(ilayer/2+1));
cout<<"*****layer: "<<floor(ilayer/2+1)<<endl;
//cout<<"*****layer: "<<floor(ilayer/2+1)<<endl;
sd.setPlacement(plv);
}
......@@ -861,7 +861,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
Tot_Phi = Tot_Phi + Nbar_phi;
Tot_length_Phi_nega = Tot_length_Phi_nega + (length_nega-photoelectronic-crystal_wrapping)*2*(length_crystal_z-Nbar_phi*crystal_wrapping*2)*(size_crystal*0.5-crystal_wrapping)*2;
cout<<"length_crystal_phi "<<(dim_x3 - dead_material_r-photoelectronic-crystal_wrapping)*2 <<" "<<size_crystal/tan(copper_angle)*2<<endl;
//cout<<"length_crystal_phi "<<(dim_x3 - dead_material_r-photoelectronic-crystal_wrapping)*2 <<" "<<size_crystal/tan(copper_angle)*2<<endl;
dd4hep::Volume sipm_s0("sipm_s0", dd4hep::Box(photoelectronic/2, photoelectronic_width/2, photoelectronic_width/2), mat_Si);
sipm_s0.setVisAttributes(theDetector, "BlueVis");
......@@ -1022,8 +1022,8 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
Tot_Z = Tot_Z + 2*Nbar_z+1;
Tot_length_Z_nega = Tot_length_Z_nega + (2*length_nega-(2*Nbar_z+1)*crystal_wrapping*2)*(size_crystal*0.5-crystal_wrapping)*2*(length_crystal_z/2-photoelectronic-crystal_wrapping)*2;
cout<<"layer: "<< ilayer+1 <<" Nbar_z: "<< 2*Nbar_z+1 <<endl;
cout<<"length_crystal_z "<<(length_crystal_z/2-photoelectronic-crystal_wrapping)*2 <<endl;
//cout<<"layer: "<< ilayer+1 <<" Nbar_z: "<< 2*Nbar_z+1 <<endl;
//cout<<"length_crystal_z "<<(length_crystal_z/2-photoelectronic-crystal_wrapping)*2 <<endl;
dd4hep::Volume sipm_s0("sipm_s0", dd4hep::Box(photoelectronic_width/2, photoelectronic/2, photoelectronic_width/2), mat_Si);
sipm_s0.setVisAttributes(theDetector, "BlueVis");
......@@ -1179,13 +1179,13 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::PlacedVolume plv = subtrap_negative_vol.placeVolume(block, Position(0, 0, 0.5*size_crystal+ilayer*size_crystal-dim_z_n));
plv.addPhysVolID("dlayer", floor(ilayer/2+1));
cout<<"*****layer: "<<floor(ilayer/2+1)<<endl;
//cout<<"*****layer: "<<floor(ilayer/2+1)<<endl;
sd.setPlacement(plv);
}
cout<<"Tot_Phi: "<<Tot_Phi<<" Tot_Z: "<<Tot_Z<<endl;
cout<<"Tot_Phi: "<<Tot_Phi*15*16<<" Tot_Z: "<<Tot_Z*15*16<<endl;
//cout<<"Tot_Phi: "<<Tot_Phi<<" Tot_Z: "<<Tot_Z<<endl;
//cout<<"Tot_Phi: "<<Tot_Phi*15*16<<" Tot_Z: "<<Tot_Z*15*16<<endl;
// ###########################
// ### Z modules placement ###
......
......@@ -179,34 +179,34 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
// ### Print Volume ###
// ####################
std::cout << "dim_x1" << " : " << dim_x1*2 << std::endl;
std::cout << "dim_x2" << " : " << dim_x2*2 << std::endl;
std::cout << "dim_x3" << " : " << dim_x3*2 << std::endl;
std::cout << "dim_x4" << " : " << dim_x4*2 << std::endl;
std::cout << "depth_longitudinal_p" << " : " << depth_longitudinal_p << std::endl;
std::cout << "depth_longitudinal_n" << " : " << depth_longitudinal_n << std::endl;
std::cout << "radius outer" << " : " << sqrt((radius_inner+depth_longitudinal_n)*(radius_inner+depth_longitudinal_n)+dim_x4*dim_x4) << std::endl;
std::cout << "radius outer" << " : " << sqrt((radius_inner+height_layer1+depth_longitudinal_p)*(radius_inner+height_layer1+depth_longitudinal_p)+dim_x2*dim_x2) << std::endl;
std::cout << "size_crystal" << " : " << size_crystal << std::endl;
std::cout << "size_posi_crystal" << " : " << size_posi_crystal << std::endl;
std::cout << "pZ" << " : " << pZ << std::endl;
std::cout << "Nbar_phi" << " : " << Nbar_phi << std::endl;
std::cout << "area_1" << " : " << dead_material_p*2*size_posi_crystal << std::endl;
std::cout << "area_2" << " : " << (dead_material_p+dead_material_p+size_posi_crystal*tan(alice_angle))*size_posi_crystal << std::endl;
std::cout << "area_3" << " : " << (dead_material_p+dead_material_p+2*size_posi_crystal*tan(alice_angle))*size_posi_crystal << std::endl;
std::cout << "area_4" << " : " << dead_material_n*2*size_crystal << std::endl;
std::cout << "area_5" << " : " << (dead_material_n+dead_material_n+size_crystal/tan(copper_angle))*size_crystal << std::endl;
std::cout << "area_6" << " : " << (dead_material_n+dead_material_n+2*size_crystal/tan(copper_angle))*size_crystal << std::endl;
std::cout << "total volume" << " : " <<
( dim_x1*2 + (dim_x1+Nlayers*size_crystal*tan(alice_angle))*2 ) * Nlayers*size_crystal /2 * pZ +
( dim_x3*2 + (dim_x3-Nlayers*size_posi_crystal/tan(copper_angle))*2 ) * Nlayers*size_posi_crystal /2 * pZ
<< std::endl;
//std::cout << "dim_x1" << " : " << dim_x1*2 << std::endl;
//std::cout << "dim_x2" << " : " << dim_x2*2 << std::endl;
//std::cout << "dim_x3" << " : " << dim_x3*2 << std::endl;
//std::cout << "dim_x4" << " : " << dim_x4*2 << std::endl;
//std::cout << "depth_longitudinal_p" << " : " << depth_longitudinal_p << std::endl;
//std::cout << "depth_longitudinal_n" << " : " << depth_longitudinal_n << std::endl;
//std::cout << "radius outer" << " : " << sqrt((radius_inner+depth_longitudinal_n)*(radius_inner+depth_longitudinal_n)+dim_x4*dim_x4) << std::endl;
//std::cout << "radius outer" << " : " << sqrt((radius_inner+height_layer1+depth_longitudinal_p)*(radius_inner+height_layer1+depth_longitudinal_p)+dim_x2*dim_x2) << std::endl;
//std::cout << "size_crystal" << " : " << size_crystal << std::endl;
//std::cout << "size_posi_crystal" << " : " << size_posi_crystal << std::endl;
//std::cout << "pZ" << " : " << pZ << std::endl;
//std::cout << "Nbar_phi" << " : " << Nbar_phi << std::endl;
//std::cout << "area_1" << " : " << dead_material_p*2*size_posi_crystal << std::endl;
//std::cout << "area_2" << " : " << (dead_material_p+dead_material_p+size_posi_crystal*tan(alice_angle))*size_posi_crystal << std::endl;
//std::cout << "area_3" << " : " << (dead_material_p+dead_material_p+2*size_posi_crystal*tan(alice_angle))*size_posi_crystal << std::endl;
//std::cout << "area_4" << " : " << dead_material_n*2*size_crystal << std::endl;
//std::cout << "area_5" << " : " << (dead_material_n+dead_material_n+size_crystal/tan(copper_angle))*size_crystal << std::endl;
//std::cout << "area_6" << " : " << (dead_material_n+dead_material_n+2*size_crystal/tan(copper_angle))*size_crystal << std::endl;
//
//std::cout << "total volume" << " : " <<
//( dim_x1*2 + (dim_x1+Nlayers*size_crystal*tan(alice_angle))*2 ) * Nlayers*size_crystal /2 * pZ +
//( dim_x3*2 + (dim_x3-Nlayers*size_posi_crystal/tan(copper_angle))*2 ) * Nlayers*size_posi_crystal /2 * pZ
//<< std::endl;
// ####################################
// ### placement of all the volumes ###
......@@ -239,8 +239,8 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
for(int ilayer=0; ilayer<Nlayers; ilayer=ilayer+1){
length_posi = dim_x1 - dead_material_l + ilayer*size_posi_crystal*tan(alice_angle);
cout<< "layer: "<< ilayer+1 << endl;
cout<< " length_posi: "<< length_posi*2 << endl;
//cout<< "layer: "<< ilayer+1 << endl;
//cout<< " length_posi: "<< length_posi*2 << endl;
//Trapezoid in layer
dd4hep::Volume block("block", dd4hep::Trapezoid( dim_x1+ilayer*size_posi_crystal*tan(alice_angle), dim_x1+(ilayer+1)*size_posi_crystal*tan(alice_angle), pZ/2, pZ/2, size_posi_crystal/2), air);
......@@ -335,7 +335,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
// ###################################
if(ilayer%2==0){
cout<< " Nbar_phi: " << Nbar_phi << endl;
//cout<< " Nbar_phi: " << Nbar_phi << endl;
dd4hep::Volume sipm_s0("sipm_s0", dd4hep::Box(photoelectronic/2, photoelectronic_width/2, photoelectronic_width/2), mat_Si);
sipm_s0.setVisAttributes(theDetector, "BlueVis");
......@@ -556,7 +556,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
Nbar_z = int((length_posi-0.5*width_crystal)/width_crystal);
last_bar = length_posi-0.5*width_crystal - (Nbar_z-1)*width_crystal;
cout<< " Nbar_z: " << 2*Nbar_z+1 << endl;
//cout<< " Nbar_z: " << 2*Nbar_z+1 << endl;
dd4hep::Volume sipm_s0("sipm_s0", dd4hep::Box(photoelectronic_width/2, photoelectronic/2, photoelectronic_width/2), mat_Si);
sipm_s0.setVisAttributes(theDetector, "BlueVis");
......@@ -792,8 +792,8 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
length_nega = dim_x3 - dead_material_r - (ilayer+1)*size_crystal/tan(copper_angle);
cout << "layer: " << ilayer+1 << endl;
cout << " length_nega: " << length_nega*2 << endl;
//cout << "layer: " << ilayer+1 << endl;
//cout << " length_nega: " << length_nega*2 << endl;
//Trapezoid in layer
......@@ -889,7 +889,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
if(ilayer%2==0){
cout<< " Nbar_phi: " << Nbar_phi << endl;
//cout<< " Nbar_phi: " << Nbar_phi << endl;
dd4hep::Volume sipm_s0("sipm_s0", dd4hep::Box(photoelectronic/2, photoelectronic_width/2, photoelectronic_width/2), mat_Si);
sipm_s0.setVisAttributes(theDetector, "BlueVis");
......@@ -1109,7 +1109,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
Nbar_z = int((length_nega-0.5*width_crystal)/width_crystal);
last_bar = length_nega-0.5*width_crystal - (Nbar_z-1)*width_crystal;
cout << " Nbar_z: " << 2*Nbar_z+1 << endl;
//cout << " Nbar_z: " << 2*Nbar_z+1 << endl;
dd4hep::Volume sipm_s0("sipm_s0", dd4hep::Box(photoelectronic_width/2, photoelectronic/2, photoelectronic_width/2), mat_Si);
sipm_s0.setVisAttributes(theDetector, "BlueVis");
......@@ -1332,8 +1332,8 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
sd.setPlacement(plv);
}
cout<<"positive volume "<< positive_volume<<endl;
cout<<"negative volume "<< negative_volume<<endl;
//cout<<"positive volume "<< positive_volume<<endl;
//cout<<"negative volume "<< negative_volume<<endl;
// ###########################
// ### Z modules placement ###
......
......@@ -171,18 +171,18 @@ static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDete
}
std::cout << "module_type: " << module_type << std::endl;
std::cout << "module_number: " << module_number << std::endl;
std::cout << "dim_x: " << dim_x << std::endl;
std::cout << "dim_x1: " << dim_x1 << std::endl;
std::cout << "dim_x2: " << dim_x2 << std::endl;
std::cout << "dim_y: " << dim_y << std::endl;
std::cout << "dim_y1: " << dim_y1 << std::endl;
std::cout << "dim_y2: " << dim_y2 << std::endl;
std::cout << "dim_z: " << dim_z << std::endl;
std::cout << "pos_x: " << pos_x << std::endl;
std::cout << "pos_y: " << pos_y << std::endl;
std::cout << "pos_z: " << pos_z << std::endl;
//std::cout << "module_type: " << module_type << std::endl;
//std::cout << "module_number: " << module_number << std::endl;
//std::cout << "dim_x: " << dim_x << std::endl;
//std::cout << "dim_x1: " << dim_x1 << std::endl;
//std::cout << "dim_x2: " << dim_x2 << std::endl;
//std::cout << "dim_y: " << dim_y << std::endl;
//std::cout << "dim_y1: " << dim_y1 << std::endl;
//std::cout << "dim_y2: " << dim_y2 << std::endl;
//std::cout << "dim_z: " << dim_z << std::endl;
//std::cout << "pos_x: " << pos_x << std::endl;
//std::cout << "pos_y: " << pos_y << std::endl;
//std::cout << "pos_z: " << pos_z << std::endl;
Box EndcapModule(box_half_x,box_half_y,box_half_z);
......@@ -498,8 +498,8 @@ static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDete
}
}
std::cout << "N_bar: " << N_bar << std::endl;
std::cout << "volume_bar: " << volume_bar << std::endl;
//std::cout << "N_bar: " << N_bar << std::endl;
//std::cout << "volume_bar: " << volume_bar << std::endl;
int sector_sum = 0;
if(module_type==1 || module_type==2 || module_type == 21 || module_type == 22) sector_sum = module_number;
......@@ -722,13 +722,13 @@ static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDete
}
endcapID++;
}
cout<<"EndcapModule0: "<<all_module0<<endl;
cout<<"EndcapModule1: "<<all_module1<<endl;
cout<<"EndcapModule2: "<<all_module2<<endl;
cout<<"EndcapModule3: "<<all_module3<<endl;
//cout<<"EndcapModule0: "<<all_module0<<endl;
//cout<<"EndcapModule1: "<<all_module1<<endl;
//cout<<"EndcapModule2: "<<all_module2<<endl;
//cout<<"EndcapModule3: "<<all_module3<<endl;
sdet.addExtension<dd4hep::rec::ECALSystemInfoData>(ecalSystemInfoData);
return sdet;
}
DECLARE_DETELEMENT(LongCrystalBarEndcapCalorimeter_v03, create_detector)
\ No newline at end of file
DECLARE_DETELEMENT(LongCrystalBarEndcapCalorimeter_v03, create_detector)
......@@ -184,18 +184,18 @@ static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDete
}
std::cout << "module_type: " << module_type << std::endl;
std::cout << "module_number: " << module_number << std::endl;
std::cout << "dim_x: " << dim_x << std::endl;
std::cout << "dim_x1: " << dim_x1 << std::endl;
std::cout << "dim_x2: " << dim_x2 << std::endl;
std::cout << "dim_y: " << dim_y << std::endl;
std::cout << "dim_y1: " << dim_y1 << std::endl;
std::cout << "dim_y2: " << dim_y2 << std::endl;
std::cout << "dim_z: " << dim_z << std::endl;
std::cout << "pos_x: " << pos_x << std::endl;
std::cout << "pos_y: " << pos_y << std::endl;
std::cout << "pos_z: " << pos_z << std::endl;
//std::cout << "module_type: " << module_type << std::endl;
//std::cout << "module_number: " << module_number << std::endl;
//std::cout << "dim_x: " << dim_x << std::endl;
//std::cout << "dim_x1: " << dim_x1 << std::endl;
//std::cout << "dim_x2: " << dim_x2 << std::endl;
//std::cout << "dim_y: " << dim_y << std::endl;
//std::cout << "dim_y1: " << dim_y1 << std::endl;
//std::cout << "dim_y2: " << dim_y2 << std::endl;
//std::cout << "dim_z: " << dim_z << std::endl;
//std::cout << "pos_x: " << pos_x << std::endl;
//std::cout << "pos_y: " << pos_y << std::endl;
//std::cout << "pos_z: " << pos_z << std::endl;
Box EndcapModule(box_half_x,box_half_y,box_half_z);
......@@ -619,8 +619,8 @@ static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDete
}
}
std::cout << "N_bar: " << N_bar << std::endl;
std::cout << "volume_bar: " << volume_bar << std::endl;
//std::cout << "N_bar: " << N_bar << std::endl;
//std::cout << "volume_bar: " << volume_bar << std::endl;
int sector_sum = 0;
if(module_type==1 || module_type==2 || module_type == 21 || module_type == 22) sector_sum = module_number;
......@@ -843,13 +843,13 @@ static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDete
}
endcapID++;
}
cout<<"EndcapModule0: "<<all_module0<<endl;
cout<<"EndcapModule1: "<<all_module1<<endl;
cout<<"EndcapModule2: "<<all_module2<<endl;
cout<<"EndcapModule3: "<<all_module3<<endl;
//cout<<"EndcapModule0: "<<all_module0<<endl;
//cout<<"EndcapModule1: "<<all_module1<<endl;
//cout<<"EndcapModule2: "<<all_module2<<endl;
//cout<<"EndcapModule3: "<<all_module3<<endl;
sdet.addExtension<dd4hep::rec::ECALSystemInfoData>(ecalSystemInfoData);
return sdet;
}
DECLARE_DETELEMENT(LongCrystalBarEndcapCalorimeter_v04, create_detector)
\ No newline at end of file
DECLARE_DETELEMENT(LongCrystalBarEndcapCalorimeter_v04, create_detector)
......@@ -111,7 +111,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
int keyVal = segxml.attr<int>( _Unicode(value) ) ;
encoder[ keyStr ] = keyVal ;
std::cout<<"keyStr:"<<keyStr<<"_keyVal:"<<keyVal<<"\n";
//std::cout<<"keyStr:"<<keyStr<<"_keyVal:"<<keyVal<<"\n";
// if we have a multisegmentation that uses the slice as key, we need to know for the
// computation of the layer parameters in LayeredCalorimeterData::Layer below
if( keyStr == "layer"){sensitive_slice_number = keyVal;}
......@@ -239,7 +239,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
slice_vol.setVisAttributes(description,x_slice.visStr());
PlacedVolume slice_phv = envelope.placeVolume(slice_vol,Position(x_slice.position().x(),ky*x_slice.position().y(),kz*x_slice.position().z()));
slice_phv.addPhysVolID("side",kz).addPhysVolID("stave",ky).addPhysVolID("module",l+1).addPhysVolID("layer",layer_num ).addPhysVolID("slice",slice_number);
std::cout<<"l + 1 = "<<l+1<<"\n";
//std::cout<<"l + 1 = "<<l+1<<"\n";
if(ky==1 && kz==1){
dd4hep::PrintLevel printLevel = dd4hep::ERROR;
if (x_det.hasAttr(_Unicode(printLevel))) {
......
......@@ -552,15 +552,17 @@ static Ref_t create_detector(Detector& theDetector,
sectionEnd.rOuter = sectionEnd.rInner + pipeThicknessEnd;
sectionEnd.zPos = zend ;
if(beampipeData->sections.size()!=0){
ConicalSupportData::Section last = beampipeData->sections.back();
if(last.rInner != section.rInner || last.rOuter != section.rOuter){
section.zPos = zstart + 1e-9*dd4hep::mm ;
beampipeData->sections.push_back( section );
if (beampipeData->sections.size()<4) {
if (beampipeData->sections.size()!=0) {
ConicalSupportData::Section last = beampipeData->sections.back();
if (last.rInner != section.rInner || last.rOuter != section.rOuter) {
section.zPos = zstart + 1e-9*dd4hep::mm ;
beampipeData->sections.push_back( section );
}
}
else beampipeData->sections.push_back( section );
beampipeData->sections.push_back( sectionEnd ) ;
}
else beampipeData->sections.push_back( section );
beampipeData->sections.push_back( sectionEnd ) ;
}
}//for all xmlSections
......
#include "DD4hep/DetFactoryHelper.h"
#include "XML/Layering.h"
#include "XML/Utilities.h"
#include "DDRec/DetectorData.h"
#include "DDSegmentation/Segmentation.h"
#include "DD4hep/Shapes.h"
#define MYDEBUG(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << x << std::endl;
#define MYDEBUGVAL(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << #x << ": " << x << std::endl;
using dd4hep::rec::LayeredCalorimeterData;
static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
xml_h e,
[[maybe_unused]] dd4hep::SensitiveDetector sens) {
xml_det_t x_det = e;
std::string det_name = x_det.nameStr();
std::string det_type = x_det.typeStr();
MYDEBUGVAL(det_name);
MYDEBUGVAL(det_type);
xml_dim_t pos(x_det.child(_U(position)));
xml_dim_t dim(x_det.child(_U(dimensions)));
dd4hep::DetElement sdet("det", 1771);
dd4hep::Material det_mat(theDetector.material("Concrete"));
dd4hep::Box box_shape(0.5 * dim.rmax(), 0.5 * dim.rmax(), 0.5 * dim.dz());
dd4hep::Tube hole_shape(0, dim.rmin(), 0.5 * dim.dz());
dd4hep::Transform3D transform_hole(
dd4hep::Rotation3D(),
dd4hep::Position(0, 0, 0)
);
dd4hep::SubtractionSolid solid = dd4hep::SubtractionSolid(box_shape, hole_shape, transform_hole);
dd4hep::Volume det_vol_with_hole(det_name + "_withHole", solid, det_mat);
dd4hep::Transform3D transform(
dd4hep::Rotation3D(),
dd4hep::Position(pos.x(), pos.y(), pos.z())
);
dd4hep::Transform3D transform_01(
dd4hep::Rotation3D(),
dd4hep::Position(pos.x(), pos.y(), -1 * pos.z())
);
dd4hep::PlacedVolume pv;
dd4hep::DetElement both_endcap(det_name, x_det.id());
dd4hep::Volume motherVol = theDetector.pickMotherVolume(both_endcap);
dd4hep::DetElement sdetA = sdet;
dd4hep::Ref_t(sdetA)->SetName((det_name + "_A").c_str());
dd4hep::DetElement sdetB = sdet.clone(det_name + "_B", 1772);
pv = motherVol.placeVolume(det_vol_with_hole, transform);
both_endcap.setPlacement(pv);
both_endcap.add(sdetA);
both_endcap.add(sdetB);
pv = motherVol.placeVolume(det_vol_with_hole, transform_01);
sdetB.setPlacement(pv);
MYDEBUG("create_detector DONE. ");
return both_endcap;
}
DECLARE_DETELEMENT(ConcreteWall_v01, create_detector)
......@@ -144,7 +144,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
Transform3D transform_beampipe(RotationZYX(90*deg,0,0), Translation3D(-kx*x_slice.position().x(),x_slice.position().y() , kz*x_slice.position().z()));
PlacedVolume slice_phv = envelope.placeVolume(slice_vol,transform_beampipe);
slice_phv.addPhysVolID("side",kz).addPhysVolID("module",0).addPhysVolID("layer",0 ).addPhysVolID("slice",layer_num);
std::cout<<"side:"<<kz<<"module:"<<0<<"layer:"<<layer_num<<"slice:"<<layer_num<<"\n";
//std::cout<<"side:"<<kz<<"module:"<<0<<"layer:"<<layer_num<<"slice:"<<layer_num<<"\n";
slice.setPlacement(slice_phv);
slice_number++;
}
......@@ -167,7 +167,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
Transform3D transform_beampipe(RotationZYX(90*deg,0,0), Translation3D(-kx*x_slice.position().x(),x_slice.position().y() , kz*x_slice.position().z()));
PlacedVolume slice_phv = envelope.placeVolume(slice_vol,transform_beampipe);
slice_phv.addPhysVolID("side",kz).addPhysVolID("module",0).addPhysVolID("layer",0 ).addPhysVolID("slice",layer_num);
std::cout<<"side:"<<kz<<"module:"<<0<<"layer:"<<layer_num<<"slice:"<<layer_num<<"\n";
//std::cout<<"side:"<<kz<<"module:"<<0<<"layer:"<<layer_num<<"slice:"<<layer_num<<"\n";
slice.setPlacement(slice_phv);
slice_number++;
}
......
#include <DD4hep/Detector.h>
#include "DD4hep/DetFactoryHelper.h"
#include "XML/Utilities.h"
#include "DDRec/Surface.h"
#include "DetIdentifier/CEPCDetectorData.h"
#include "Math/AxisAngle.h"
#include <map>
using namespace dd4hep;
static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)
{
xml_det_t x_det = e;
Material air = description.air();
int det_id = x_det.id();
std::string name = x_det.nameStr();
bool reflect = x_det.reflect(false);
DetElement tracker(name, det_id);
Volume envelope = createPlacedEnvelope(description, e, tracker);
setDetectorTypeFlag(e, tracker);
if (description.buildType() == BUILD_ENVELOPE)
return tracker;
envelope = envelope.setVisAttributes(description.visAttributes("SeeThrough"));
if (x_det.hasChild(_U(sensitive)))
{
xml_dim_t sd_typ = x_det.child(_U(sensitive));
sens.setType(sd_typ.typeStr());
}
else
{
sens.setType("tracker");
}
std::cout << " ** building ITK_EndCap_v01 ... " << sens.type() << std::endl;
dd4hep::rec::MultiRingsZDiskData* diskData = new dd4hep::rec::MultiRingsZDiskData;
const xml::Component supports = x_det.child("support");
const xml::Component sensor = x_det.child("sensor");
const xml::Component layers_xml = x_det.child("layers");
for (xml_coll_t layer(layers_xml, "layer"); layer; ++layer)
{
dd4hep::rec::MultiRingsZDiskData::LayerLayout disk;
//id="0" z="505*mm" dz="SiliconThickness*2 + SupportThickness" inner_r="81.5*mm" outer_r="242.5*mm" vis="SeeThrough"
const auto layer_id = layer.attr<std::string>("id");
//const auto dz = layer.attr<double>("dz");
const auto inner_r = layer.attr<double>("inner_r");
const auto outer_r = layer.attr<double>("outer_r");
const auto phi0 = layer.attr<double>("phi0");
const auto layer_vis = layer.attr<std::string>("vis");
const auto z = layer.attr<double>("z");
std::string layer_name = "layer" + layer_id;
double SiliconThickness = 0;
double SupportThickness = 0;
for (xml_coll_t sensor_layer(sensor, "slice"); sensor_layer; ++sensor_layer)
{
const auto slice_thickness = sensor_layer.attr<double>("thickness");
SiliconThickness += slice_thickness;
}
for (xml_coll_t support(supports, "slice"); support; ++support)
{
const auto slice_thickness = support.attr<double>("thickness");
SupportThickness += slice_thickness;
}
const auto dz = 2*SiliconThickness + SupportThickness;
Tube layer_tube(inner_r, outer_r, dz / 2.0, 0.0, 2 * M_PI);
Volume layer_vol(layer_name + "P", layer_tube, air);
Volume layerNeg_vol(layer_name + "N", layer_tube, air);
DetElement layer_det(layer_name + "P", det_id);
DetElement layerNeg_det(layer_name + "N", det_id);
layer_vol.setVisAttributes(description.visAttributes(layer_vis));
layerNeg_vol.setVisAttributes(description.visAttributes(layer_vis));
// populate support
double support_z = -SupportThickness / 2.0;
//const xml::Component supports = x_det.child("support");
for (xml_coll_t support(supports, "slice"); support; ++support)
{
const auto support_name = support.attr<std::string>("name");
const auto support_material = support.attr<std::string>("material");
const auto support_thickness = support.attr<double>("thickness");
const auto support_vis = support.attr<std::string>("vis");
std::string support_vol_name = layer_name + "_" + support_name;
Tube support_tube(inner_r, outer_r, support_thickness / 2.0, 0.0, 2 * M_PI);
Volume support_vol(support_vol_name, support_tube, description.material(support_material));
DetElement support_det(support_vol_name, det_id);
DetElement supportNeg_det(support_vol_name + "N", det_id);
support_vol = support_vol.setVisAttributes(description.visAttributes(support_vis));
support_det.setPlacement(layer_vol.placeVolume(support_vol, Position(0, 0, support_z + support_thickness / 2.0)));
supportNeg_det.setPlacement(layerNeg_vol.placeVolume(support_vol, Position(0, 0, - support_z - support_thickness / 2.0)));
support_z += support_thickness;
layer_det.add(support_det);
layerNeg_det.add(supportNeg_det);
rec::Vector3D u(1., 0., 0.);
rec::Vector3D v(0., 1., 0.);
rec::Vector3D n(0., 0., 1.);
rec::VolPlane surf(support_vol, rec::SurfaceType::Helper, support_thickness / 2.0, support_thickness / 2.0, u, v,
n);
rec::volSurfaceList(support_det)->push_back(surf);
rec::volSurfaceList(supportNeg_det)->push_back(surf);
}
// populate sensor
for (xml_coll_t ring(layer, "ring"); ring; ++ring)
{
const auto ring_id = ring.attr<std::string>("id");
const auto ring_inner_r = ring.attr<double>("inner_r");
const auto ring_outer_r = ring.attr<double>("outer_r");
const auto module_dr = ring.attr<double>("module_dr");
const auto module_dphi = ring.attr<double>("module_dphi");
const auto nmodule = ring.attr<double>("nmodule");
const auto vis = ring.attr<std::string>("vis");
std::string ring_vol_name = layer_name + "_ring" + ring_id;
Tube ring_tube(ring_inner_r, ring_outer_r, SiliconThickness / 2.0, 0.0, 2 * M_PI);
Volume ringPosF_vol(ring_vol_name + "PF", ring_tube, air);
Volume ringPosR_vol(ring_vol_name + "PR", ring_tube, air);
Volume ringNegF_vol(ring_vol_name + "NF", ring_tube, air);
Volume ringNegR_vol(ring_vol_name + "NR", ring_tube, air);
DetElement ringPosF_det(ring_vol_name + "PF", det_id);
DetElement ringPosR_det(ring_vol_name + "PR", det_id);
DetElement ringNegF_det(ring_vol_name + "NF", det_id);
DetElement ringNegR_det(ring_vol_name + "NR", det_id);
ringPosF_vol.setVisAttributes(description.visAttributes(vis));
ringPosR_vol.setVisAttributes(description.visAttributes(vis));
ringNegF_vol.setVisAttributes(description.visAttributes(vis));
ringNegR_vol.setVisAttributes(description.visAttributes(vis));
// populate sensor
Box sensor_box(module_dr / 2.0, module_dphi / 2.0, SiliconThickness / 2.0);
std::string sensor_name = ring_vol_name + "_petal";
Volume sensor_vol(sensor_name, sensor_box, air);
DetElement sensor_det(sensor_name, det_id);
sensor_vol = sensor_vol.setVisAttributes(description.visAttributes(vis));
double sensitive_thickness = 0;
double glue_thickness = 0;
double service_thickness = 0;
//const xml::Component sensor = x_det.child("sensor");
double sensor_z = -SiliconThickness / 2.0;
for (xml_coll_t sensor_layer(sensor, "slice"); sensor_layer; ++sensor_layer)
{
const auto sensor_layer_name = sensor_layer.attr<std::string>("name");
const auto sensor_layer_material = sensor_layer.attr<std::string>("material");
const auto sensor_layer_thickness = sensor_layer.attr<double>("thickness");
const auto sensor_layer_vis = sensor_layer.attr<std::string>("vis");
auto is_sensitive = sensor_layer.hasAttr(_U(sensitive));
std::string sensor_layer_vol_name = sensor_name + "_" + sensor_layer_name;
Box sensor_layer_box(module_dr / 2.0, module_dphi / 2.0, sensor_layer_thickness / 2.0);
Volume sensor_layer_vol(sensor_layer_vol_name, sensor_layer_box, description.material(sensor_layer_material));
DetElement sensor_layer_det(sensor_layer_vol_name, det_id);
sensor_layer_vol = sensor_layer_vol.setVisAttributes(description.visAttributes(sensor_layer_vis));
rec::SurfaceType surf_type;
if (is_sensitive)
{
sensor_layer_vol = sensor_layer_vol.setSensitiveDetector(sens);
surf_type = rec::SurfaceType(rec::SurfaceType::Sensitive,rec::SurfaceType::Plane);
sensitive_thickness += sensor_layer_thickness;
}
else
{
surf_type = rec::SurfaceType(rec::SurfaceType::Helper,rec::SurfaceType::Plane);
if (sensitive_thickness==0) glue_thickness += sensor_layer_thickness;
else service_thickness += sensor_layer_thickness;
}
sensor_layer_det.setPlacement(
sensor_vol.placeVolume(sensor_layer_vol, Position(0, 0, sensor_z + sensor_layer_thickness / 2.0)));
sensor_z += sensor_layer_thickness;
sensor_det.add(sensor_layer_det);
rec::Vector3D u(0.,-1., 0.);
rec::Vector3D v(1., 0., 0.);
rec::Vector3D n(0., 0., 1.);
rec::VolPlane surf(sensor_layer_vol, surf_type, sensor_layer_thickness / 2.0,
sensor_layer_thickness / 2.0, u, v,
n);
rec::volSurfaceList(sensor_layer_det)->push_back(surf);
}
PlacedVolume pv;
// place all the sensors into ring
double r_offset = ring_inner_r + module_dr / 2.0;
for (int i = 0; i < nmodule; ++i)
{
double angle = phi0 + i * 2 * M_PI / nmodule;
double rotated_x = r_offset * cos(angle);
double rotated_y = r_offset * sin(angle);
auto transform = Transform3D(RotationZ(angle), Position(rotated_x, rotated_y, 0));
DetElement negative_even_sensor_det = i > 0 ? sensor_det.clone(ring_vol_name + "_petalN" + std::to_string(2 * i)) : sensor_det;
pv = ringNegF_vol.placeVolume(sensor_vol, transform).addPhysVolID("module", 2 * i);
negative_even_sensor_det.setPlacement(pv);
ringNegF_det.add(negative_even_sensor_det);
transform = Transform3D(RotationZYX(-angle, 0, M_PI), Position(rotated_x, rotated_y, 0));
DetElement positive_even_sensor_det = sensor_det.clone(ring_vol_name + "_petalP" + std::to_string(2 * i));
pv = ringPosF_vol.placeVolume(sensor_vol, transform).addPhysVolID("module", 2 * i);
positive_even_sensor_det.setPlacement(pv);
ringPosF_det.add(positive_even_sensor_det);
angle += M_PI / nmodule;
rotated_x = r_offset * cos(angle);
rotated_y = r_offset * sin(angle);
transform = Transform3D(RotationZ(angle), Position(rotated_x, rotated_y, 0));
DetElement positive_odd_sensor_det = sensor_det.clone(ring_vol_name + "_petalP" + std::to_string(2 * i));
pv = ringPosR_vol.placeVolume(sensor_vol, transform).addPhysVolID("module", 2 * i + 1);
positive_odd_sensor_det.setPlacement(pv);
ringPosR_det.add(positive_odd_sensor_det);
transform = Transform3D(RotationZYX(-angle, 0, M_PI), Position(rotated_x, rotated_y, 0));
DetElement negative_odd_sensor_det = sensor_det.clone(ring_vol_name + "_petalN" + std::to_string(2 * i));
pv = ringNegR_vol.placeVolume(sensor_vol, transform).addPhysVolID("module", 2 * i + 1);
negative_odd_sensor_det.setPlacement(pv);
ringNegR_det.add(negative_odd_sensor_det);
}
// place ring into layer
pv = layer_vol.placeVolume(ringPosR_vol, Position(0, 0, +(SupportThickness + SiliconThickness) / 2.0));
pv = pv.addPhysVolID("sensor", std::stoi(ring_id));
ringPosR_det.setPlacement(pv);
layer_det.add(ringPosR_det);
pv = layer_vol.placeVolume(ringPosF_vol, Position(0, 0, -(SupportThickness + SiliconThickness) / 2.0));
pv = pv.addPhysVolID("sensor", std::stoi(ring_id));
ringPosF_det.setPlacement(pv);
layer_det.add(ringPosF_det);
pv = layerNeg_vol.placeVolume(ringNegR_vol, Position(0, 0, -(SupportThickness + SiliconThickness) / 2.0));
pv = pv.addPhysVolID("sensor", std::stoi(ring_id));
ringNegR_det.setPlacement(pv);
layerNeg_det.add(ringNegR_det);
pv = layerNeg_vol.placeVolume(ringNegF_vol, Position(0, 0, +(SupportThickness + SiliconThickness) / 2.0));
pv = pv.addPhysVolID("sensor", std::stoi(ring_id));
ringNegF_det.setPlacement(pv);
layerNeg_det.add(ringNegF_det);
// rotate and reflect ring
// fucd: error while use Rotation3D(1, 0, 0, 0, 1, 0, 0, 0, -1)
// Geant4VolumeManager INFO +++ Bad volume Geant4 Path
/*
std::string reflect_ring_name = ring_vol_name + "_reflect";
auto reflect_ring_det = ring_det.clone(reflect_ring_name, det_id);
reflect_ring_det.setPlacement(layer_vol.placeVolume(
ring_vol, Transform3D(RotationZ(M_PI / nmodule) * Rotation3D(1, 0, 0, 0, 1, 0, 0, 0, -1) ,
Position(0, 0, -(SupportThickness + SiliconThickness) / 2.0)))
.addPhysVolID("sensor", std::stoi(ring_id)).addPhysVolID("face", 1));
layer_det.add(reflect_ring_det);
*/
// fucd: also error
/*
std::pair<DetElement,Volume> reflected_ring = ring_det.reflect(ring_vol_name + "_reflect");
auto pv = layer_vol.placeVolume(reflected_ring.second, Position(0, 0, -(SupportThickness + SiliconThickness) / 2.0))
.addPhysVolID("sensor", std::stoi(ring_id))
.addPhysVolID("face", 1);
reflected_ring.first.setPlacement(pv);
layer_det.add(reflected_ring.first);
*/
dd4hep::rec::MultiRingsZDiskData::Ring ringData;
ringData.petalNumber = 2 * nmodule;
ringData.sensorsPerPetal = 1;
ringData.phi0 = phi0;
ringData.phiOffsetOdd = 2 * M_PI / nmodule;
ringData.distance = ring_inner_r;
ringData.widthInner = module_dphi;
ringData.widthOuter = module_dphi;
ringData.length = module_dr;
ringData.thicknessSensitive = SiliconThickness - glue_thickness - service_thickness;
ringData.thicknessGlue = glue_thickness;
ringData.thicknessService = service_thickness;
disk.rings.push_back(ringData);
}
// put layer into envelope
layer_det.setPlacement(envelope.placeVolume(layer_vol, Position(0, 0, z))
.addPhysVolID("layer", std::stoi(layer_id)).addPhysVolID("side", 1));
tracker.add(layer_det);
// copy layer_vol and put reflect
if (reflect)
{
/*
std::string reflect_layer_name = layer_name + "_reflect";
auto reflect_layer_det = layer_det.clone(reflect_layer_name, det_id);
reflect_layer_det.setPlacement(
envelope.placeVolume(layer_vol, Transform3D(Rotation3D(1, 0, 0, 0, 1, 0, 0, 0, -1), Position(0, 0, -z))).addPhysVolID("side", -1).
addPhysVolID("layer", std::stoi(layer_id)));
tracker.add(reflect_layer_det);
*/
/*
std::pair<DetElement,Volume> reflected_layer = layer_det.reflect(layer_name + "_reflect");
auto pv = envelope.placeVolume(reflected_layer.second, Position(0, 0, -z))
.addPhysVolID("side", -1).addPhysVolID("layer", std::stoi(layer_id));
reflected_layer.first.setPlacement(pv);
tracker.add(reflected_layer.first);
*/
layerNeg_det.setPlacement(envelope.placeVolume(layerNeg_vol, Position(0, 0, -z))
.addPhysVolID("layer", std::stoi(layer_id)).addPhysVolID("side", -1));
tracker.add(layerNeg_det);
}
disk.typeFlags[dd4hep::rec::MultiRingsZDiskData::SensorType::DoubleSided] = 1;
disk.typeFlags[dd4hep::rec::MultiRingsZDiskData::SensorType::Pixel] = 1;
disk.alphaPetal = 0;
disk.zPosition = z;
disk.zOffsetSupport = 0;
disk.rminSupport = inner_r;
disk.rmaxSupport = outer_r;
disk.thicknessSupport = SupportThickness;
diskData->layers.push_back(disk);
}
std::cout << (*diskData) << std::endl;
tracker.addExtension<dd4hep::rec::MultiRingsZDiskData>(diskData);
if (x_det.hasAttr(_U(combineHits)))
{
tracker.setCombineHits(x_det.attr<bool>(_U(combineHits)), sens);
}
return tracker;
}
DECLARE_DETELEMENT(ITK_EndCap_v01, create_detector)
This diff is collapsed.
......@@ -71,7 +71,7 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
dd4hep::PlacedVolume pv;
int layer_id = x_layer.attr<int>(_Unicode(layer_id));
std::cout << "layer_id: " << layer_id << " ......." << endl;
//std::cout << "layer_id: " << layer_id << " ......." << endl;
double sensitive_radius = x_layer.attr<double>(_Unicode(ladder_radius));
int n_ladders = x_layer.attr<int>(_Unicode(n_ladders)) ;
......@@ -81,11 +81,11 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
double ladder_total_thickness = x_layer.attr<double>(_Unicode(ladder_thickness));
double ladder_total_width = x_layer.attr<double>(_Unicode(ladder_width));
double ladder_total_length = x_layer.attr<double>(_Unicode(ladder_length));
std::cout << "ladder_radius: " << ladder_radius/mm <<" mm" << endl;
std::cout << "sensitive_radius: " << sensitive_radius/mm << " mm" << endl;
std::cout << "ladder_thickness: " << ladder_total_thickness/mm << " mm" << endl;
std::cout << "ladder_width: " << ladder_total_width/mm << " mm" << endl;
std::cout << "ladder_length: " << ladder_total_length/mm << " mm" << endl;
//std::cout << "ladder_radius: " << ladder_radius/mm <<" mm" << endl;
//std::cout << "sensitive_radius: " << sensitive_radius/mm << " mm" << endl;
//std::cout << "ladder_thickness: " << ladder_total_thickness/mm << " mm" << endl;
//std::cout << "ladder_width: " << ladder_total_width/mm << " mm" << endl;
//std::cout << "ladder_length: " << ladder_total_length/mm << " mm" << endl;
std::string layerName = dd4hep::_toString( layer_id , "layer_%d" );
dd4hep::Assembly layer_assembly( layerName ) ;
......@@ -94,7 +94,7 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
layerDE.setPlacement( pv ) ;
const double ladder_dphi = ( dd4hep::twopi / n_ladders ) ;
std::cout << "ladder_dphi: " << ladder_dphi << endl;
//std::cout << "ladder_dphi: " << ladder_dphi << endl;
//fetch the ladder parameters
......@@ -115,9 +115,9 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
{
support_mat = theDetector.material(x_ladder_support.materialStr());
}
std::cout << "support_length: " << support_length/mm << " mm" << endl;
std::cout << "support_thickness: " << support_thickness/mm << " mm" << endl;
std::cout << "support_width: " << support_width/mm << " mm" << endl;
//std::cout << "support_length: " << support_length/mm << " mm" << endl;
//std::cout << "support_thickness: " << support_thickness/mm << " mm" << endl;
//std::cout << "support_width: " << support_width/mm << " mm" << endl;
//fetch the flex parameters
......@@ -133,11 +133,11 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
flex_thickness += x_flex_slice_thickness;
if (x_flex_slice_width > flex_width) flex_width = x_flex_slice_width;
if (x_flex_slice_length > flex_length) flex_length = x_flex_slice_length;
std::cout << "x_flex_slice_thickness: " << x_flex_slice_thickness/mm << " mm" << endl;
//std::cout << "x_flex_slice_thickness: " << x_flex_slice_thickness/mm << " mm" << endl;
}
std::cout << "flex_thickness: " << flex_thickness/mm << " mm" << endl;
std::cout << "flex_width: " << flex_width/mm << " mm" << endl;
std::cout << "flex_length: " << flex_length/mm << " mm" << endl;
//std::cout << "flex_thickness: " << flex_thickness/mm << " mm" << endl;
//std::cout << "flex_width: " << flex_width/mm << " mm" << endl;
//std::cout << "flex_length: " << flex_length/mm << " mm" << endl;
//fetch the sensor parameters
......@@ -151,13 +151,13 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
double sensor_total_width = sensor_active_width + sensor_dead_width;
Material sensor_mat = theDetector.material(x_sensor.attr<string>(_Unicode(sensor_mat)));
std::cout << "n_sensors_per_side: " << n_sensors_per_side << endl;
std::cout << "dead_gap: " << dead_gap/mm << " mm" << endl;
std::cout << "sensor_thickness: " << sensor_thickness/mm << " mm" << endl;
std::cout << "sensor_length: " << sensor_length/mm << " mm" << endl;
std::cout << "sensor_active_width: " << sensor_active_width/mm << " mm" << endl;
std::cout << "sensor_dead_width: " << sensor_dead_width/mm << " mm" << endl;
std::cout << "sensor_total_width: " << sensor_total_width/mm << " mm" << endl;
//std::cout << "n_sensors_per_side: " << n_sensors_per_side << endl;
//std::cout << "dead_gap: " << dead_gap/mm << " mm" << endl;
//std::cout << "sensor_thickness: " << sensor_thickness/mm << " mm" << endl;
//std::cout << "sensor_length: " << sensor_length/mm << " mm" << endl;
//std::cout << "sensor_active_width: " << sensor_active_width/mm << " mm" << endl;
//std::cout << "sensor_dead_width: " << sensor_dead_width/mm << " mm" << endl;
//std::cout << "sensor_total_width: " << sensor_total_width/mm << " mm" << endl;
//fetch parameters for the pcb and asic parts
xml_comp_t x_other(x_ladder.child(_Unicode(other)));
......@@ -173,14 +173,14 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
Material pcb_mat = theDetector.material(x_other.attr<string>(_Unicode(pcb_mat)));
Material asic_mat = theDetector.material(x_other.attr<string>(_Unicode(asic_mat)));
std::cout << "pcb_thickness: " << pcb_thickness/mm << " mm" << endl;
std::cout << "pcb_width: " << pcb_width/mm << " mm" << endl;
std::cout << "pcb_length: " << pcb_length/mm << " mm" << endl;
std::cout << "pcb_zgap: " << pcb_zgap/mm << " mm" << endl;
std::cout << "port_pcb_width: " << port_pcb_width/mm << " mm" << endl;
std::cout << "asic_thickness: " << asic_thickness/mm << " mm" << endl; std::cout << "asic_width: " << asic_width/mm << " mm" << endl;
std::cout << "asic_length: " << asic_length/mm << " mm" << endl;
std::cout << "asic_zgap: " << asic_zgap/mm << " mm" << endl;
//std::cout << "pcb_thickness: " << pcb_thickness/mm << " mm" << endl;
//std::cout << "pcb_width: " << pcb_width/mm << " mm" << endl;
//std::cout << "pcb_length: " << pcb_length/mm << " mm" << endl;
//std::cout << "pcb_zgap: " << pcb_zgap/mm << " mm" << endl;
//std::cout << "port_pcb_width: " << port_pcb_width/mm << " mm" << endl;
//std::cout << "asic_thickness: " << asic_thickness/mm << " mm" << endl; std::cout << "asic_width: " << asic_width/mm << " mm" << endl;
//std::cout << "asic_length: " << asic_length/mm << " mm" << endl;
//std::cout << "asic_zgap: " << asic_zgap/mm << " mm" << endl;
//*****************************************************************//
......@@ -224,9 +224,9 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
FlexLayerLogical.setVisAttributes(theDetector.visAttributes(flexVis));
double flex_slice_height = flex_start_height + x_flex_slice_thickness/2.;
pv = FlexEnvelopeLogical.placeVolume(FlexLayerLogical, Position(flex_slice_height, 0., 0.));
std::cout << "flex thickness = " << x_flex_slice_thickness << std::endl;
std::cout << "flex width = " << x_flex_slice_width << std::endl;
std::cout << "flex length = " << x_flex_slice_length << std::endl;
//std::cout << "flex thickness = " << x_flex_slice_thickness << std::endl;
//std::cout << "flex width = " << x_flex_slice_width << std::endl;
//std::cout << "flex length = " << x_flex_slice_length << std::endl;
// std::cout << "flex material: " << x_flex_slice_mat << std::endl;
flex_start_height += x_flex_slice_thickness;
index++;
......@@ -348,7 +348,7 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
pv.addPhysVolID("module", i ) ;
ladderDE.setPlacement(pv);
//std::cout << ladder_enum.str() << " done." << endl;
if(i==0) std::cout << "xy=" << ladder_radius*cos(ladder_phi0) << " " << ladder_radius*sin(ladder_phi0) << std::endl;
//if(i==0) std::cout << "xy=" << ladder_radius*cos(ladder_phi0) << " " << ladder_radius*sin(ladder_phi0) << std::endl;
}
// package the reconstruction data
......@@ -373,12 +373,12 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
zPlanarData->layers.push_back(otkbarrelLayer);
}
std::cout << (*zPlanarData) << endl;
//std::cout << (*zPlanarData) << endl;
otkbarrel.addExtension< ZPlanarData >(zPlanarData);
if ( x_det.hasAttr(_U(combineHits)) ) {
otkbarrel.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
}
std::cout << "otkbarrel done." << endl;
//std::cout << "otkbarrel done." << endl;
return otkbarrel;
}
DECLARE_DETELEMENT(SiTracker_otkbarrel_v01,create_element)
......
......@@ -202,7 +202,7 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
}
else
{
thickness_support += layer_thickness;
if (thickness_sensitive == 0) thickness_support += layer_thickness;
surf_type = rec::SurfaceType(rec::SurfaceType::Helper, rec::SurfaceType::Plane, rec::SurfaceType::ParallelToZ);
}
......@@ -307,7 +307,7 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
double z_position = -ladder_length_inner * (ladder_repeat_inner / 2.0) - (i + 0.5) * ladder_length_outer;
Position pos(0, 0, z_position);
auto cloned_outer_ladder_det = outer_ladder_det.clone("outer_" + ladder_name + std::to_string(-i - 1));
cloned_outer_ladder_det.setPlacement(stave_vol.placeVolume(outer_ladder_vol, pos).addPhysVolID("module", i));
cloned_outer_ladder_det.setPlacement(stave_vol.placeVolume(outer_ladder_vol, pos).addPhysVolID("oladder", -i - 1));
stave_det.add(cloned_outer_ladder_det);
}
......@@ -327,28 +327,26 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
envelope.placeVolume(stave_vol, Transform3D(RotationZ(angle), Position(rotated_x, rotated_y, 0.0))).
addPhysVolID("module", i));
otk_barrel.add(cloned_stave_det);
rec::ZPlanarData::LayerLayout otk_barrel_layer;
otk_barrel_layer.phi0 = angle;
otk_barrel_layer.ladderNumber = ladder_repeat_outer + ladder_repeat_inner;
otk_barrel_layer.thicknessSensitive = thickness_sensitive;
otk_barrel_layer.thicknessSupport = thickness_support;
otk_barrel_layer.distanceSensitive = otk_inner_radius + thickness_support;
otk_barrel_layer.distanceSupport = otk_inner_radius;
otk_barrel_layer.offsetSensitive = stave_y_offset;
otk_barrel_layer.offsetSupport = stave_y_offset;
otk_barrel_layer.widthSensitive = module_width;
otk_barrel_layer.widthSupport = module_width;
otk_barrel_layer.sensorsPerLadder = module_repeat * 4;
double z_half = ladder_length_inner * ladder_repeat_inner / 2.0 + ladder_length_outer * ladder_repeat_outer /
2.0;
otk_barrel_layer.zHalfSensitive = z_half;
otk_barrel_layer.zHalfSupport = z_half;
z_planar_data->layers.push_back(otk_barrel_layer);
}
rec::ZPlanarData::LayerLayout otk_barrel_layer;
otk_barrel_layer.phi0 = 0;
otk_barrel_layer.ladderNumber = stave_repeat;
otk_barrel_layer.thicknessSensitive = thickness_sensitive;
otk_barrel_layer.thicknessSupport = thickness_support;
otk_barrel_layer.distanceSensitive = otk_inner_radius + thickness_support;
otk_barrel_layer.distanceSupport = otk_inner_radius;
otk_barrel_layer.offsetSensitive = stave_y_offset;
otk_barrel_layer.offsetSupport = stave_y_offset;
otk_barrel_layer.widthSensitive = module_width;
otk_barrel_layer.widthSupport = module_width;
otk_barrel_layer.sensorsPerLadder = module_repeat * 4;
double z_half = ladder_length_inner * ladder_repeat_inner / 2.0 + ladder_length_outer * ladder_repeat_outer / 2.0;
otk_barrel_layer.zHalfSensitive = z_half;
otk_barrel_layer.zHalfSupport = z_half;
z_planar_data->layers.push_back(otk_barrel_layer);
// check_det_element(otk_barrel);
std::cout << (*z_planar_data) << std::endl;
otk_barrel.addExtension<rec::ZPlanarData>(z_planar_data);
if (x_det.hasAttr(_U(combineHits)))
{
......
......@@ -96,14 +96,23 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
const double trapezoid_height = ring_outer_radius - ring_inner_radius;
const double trapezoid_inner_length = calculate_polygon_side_length(ring_inner_radius, repeat);
const double trapezoid_outer_length = calculate_polygon_side_length(ring_outer_radius, repeat);
const auto layers_thickness = layers_xml.attr<double>("thickness");
const double layers_base_thickness = layers_thickness;
double layers_base_thickness = 0;
for (xml_coll_t layers(layers_xml, "layer"); layers; ++layers)
{
const xml::Component layer = xml::Handle_t(layers);
const auto layer_thickness = layer.attr<double>("thickness");
layers_base_thickness += layer_thickness;
}
Trapezoid layer_base_shape(trapezoid_inner_length / 2.0, trapezoid_outer_length / 2.0,
layers_base_thickness / 2.0, layers_base_thickness / 2.0, trapezoid_height / 2.0);
Volume layer_base_vol(ring_name, layer_base_shape, air);
layer_base_vol = layer_base_vol.setVisAttributes(theDetector, ring.attr<std::string>("vis"));
double sensitive_thickness = 0;
double support_thickness = 0;
double service_thickness = 0;
double y_offset = -layers_base_thickness / 2.0;
for (xml_coll_t layers(layers_xml, "layer"); layers; ++layers)
{
......@@ -124,10 +133,13 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
{
layer_vol = layer_vol.setSensitiveDetector(sens);
surf_type = rec::SurfaceType(rec::SurfaceType::Sensitive, rec::SurfaceType::Plane);
sensitive_thickness += layer_thickness;
}
else
{
surf_type = rec::SurfaceType(rec::SurfaceType::Helper, rec::SurfaceType::Plane);
if (sensitive_thickness==0) service_thickness += layer_thickness;
else support_thickness += layer_thickness;
}
rec::Vector3D u(1., 0., 0.);
rec::Vector3D v(0., 0., 1.);
......@@ -163,30 +175,37 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
auto cloned_ring_piece_det = ring_piece_det.clone(ring_name + std::to_string(i + 1));
auto cloned_neg_ring_piece_det = ring_piece_det.clone(ring_name + std::to_string(-(i + 1)));
auto pv = envelope.placeVolume(layer_base_vol, transform).addPhysVolID("side", 1).addPhysVolID("module", i)
.addPhysVolID("sensor", ring_num);
.addPhysVolID("layer", ring_num);
auto neg_pv = envelope.placeVolume(layer_base_vol, neg_transform).addPhysVolID("side", -1).
addPhysVolID("module", i).addPhysVolID("sensor", ring_num);
addPhysVolID("module", i).addPhysVolID("layer", ring_num);
cloned_ring_piece_det.setPlacement(pv);
cloned_neg_ring_piece_det.setPlacement(neg_pv);
otk_endcaps.add(cloned_ring_piece_det);
otk_endcaps.add(cloned_neg_ring_piece_det);
}
rec::ZDiskPetalsData::LayerLayout otk_endcap_layer;
otk_endcap_layer.typeFlags[rec::ZDiskPetalsData::SensorType::DoubleSided] = false;
otk_endcap_layer.typeFlags[rec::ZDiskPetalsData::SensorType::Pixel] = true;
otk_endcap_layer.phi0 = angle_step / 2.0;
otk_endcap_layer.distanceSupport = ring_inner_radius;
otk_endcap_layer.distanceSensitive = ring_inner_radius;
otk_endcap_layer.lengthSupport = trapezoid_height;
otk_endcap_layer.lengthSensitive = trapezoid_height;
otk_endcap_layer.thicknessSensitive = sensitive_thickness;
otk_endcap_layer.thicknessSupport = service_thickness; // front regard as support in KF, ignore rear material
otk_endcap_layer.widthInnerSupport = trapezoid_inner_length;
otk_endcap_layer.widthInnerSensitive = trapezoid_inner_length;
otk_endcap_layer.widthOuterSupport = trapezoid_outer_length;
otk_endcap_layer.widthOuterSensitive = trapezoid_outer_length;
otk_endcap_layer.zPosition = zmax - support_thickness - 0.5*sensitive_thickness;
otk_endcap_layer.sensorsPerPetal = 1;
otk_endcap_layer.petalNumber = repeat;
otk_endcap_layer.petalHalfAngle = angle_step / 2.0;
zDiskPetalsData->layers.push_back(otk_endcap_layer);
}
rec::ZDiskPetalsData::LayerLayout otk_endcap_layer;
otk_endcap_layer.typeFlags[rec::ZDiskPetalsData::SensorType::DoubleSided] = false;
otk_endcap_layer.typeFlags[rec::ZDiskPetalsData::SensorType::Pixel] = true;
otk_endcap_layer.phi0 = 0;
otk_endcap_layer.distanceSupport = 406 * mm;
otk_endcap_layer.distanceSensitive = 406 * mm;
otk_endcap_layer.lengthSupport = 1410 * mm;
otk_endcap_layer.lengthSensitive = 1410 * mm;
otk_endcap_layer.thicknessSensitive = 0.3 * mm;
otk_endcap_layer.thicknessSupport = 3.6 * mm;
otk_endcap_layer.zPosition = zmax - 3.6 * mm;
otk_endcap_layer.sensorsPerPetal = 127;
otk_endcap_layer.petalNumber = 16;
zDiskPetalsData->layers.push_back(otk_endcap_layer);
std::cout << (*zDiskPetalsData) << std::endl;
otk_endcaps.addExtension<rec::ZDiskPetalsData>(zDiskPetalsData);
// #ifdef DET_ELEMENT_DEBUG
......@@ -196,6 +215,7 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
{
otk_endcaps.setCombineHits(x_det.attr<bool>(_U(combineHits)), sens);
}
return otk_endcaps;
}
......
......@@ -56,6 +56,14 @@ namespace CEPCConf{
static const int GOOD = 27;
};
struct DetCellID{
static const int system = 0;
static const int side = 1;
static const int layer = 2;
static const int module = 3;
static const int sensor = 4;
};
struct DetEncoderString{
static const int system = 5;
static const int side = -2;
......
......@@ -191,6 +191,136 @@ namespace dd4hep {
return io;
};
/** Simple data structure with key parameters for
* zdisk by multi rings
*
* @author
* @date Feb, 26, 2025
* @version $Id: $
*/
struct MultiRingsZDiskStruct {
/// width of the strips (if applicable )
double widthStrip;
/// length of the strips (if applicable )
double lengthStrip;
/// strip pitch (if applicable )
double pitchStrip;
/// strip stereo angle (if applicable )
double angleStrip;
/// enum for encoding the sensor type in typeFlags
struct SensorType{
enum {
DoubleSided=0,
Pixel
};
};
/** Internal helper struct for defining the layer layout. Layers are defined
* with a sensitive part, flex/cable/service part and a support part.
*/
struct Ring {
Ring() :
petalNumber(0),
sensorsPerPetal(0),
phi0(0),
phiOffsetOdd(0),
distance(0),
widthInner(0),
widthOuter(0),
length(0),
thicknessSensitive(0),
thicknessGlue(0),
thicknessService(0) {
}
int petalNumber;
int sensorsPerPetal;
double phi0;
double phiOffsetOdd;
double distance;
double widthInner;
double widthOuter;
double length;
double thicknessSensitive;
double thicknessGlue;
double thicknessService;
};
struct LayerLayout {
LayerLayout() :
typeFlags(0),
alphaPetal(0),
zPosition(0),
zOffsetSupport(0),
rminSupport(0),
rmaxSupport(0),
thicknessSupport(0) {
}
std::bitset<32> typeFlags;
double alphaPetal;
double zPosition;
double zOffsetSupport;
double rminSupport;
double rmaxSupport;
double thicknessSupport;
std::vector<Ring> rings;
};
std::vector<LayerLayout> layers;
};
typedef StructExtension<MultiRingsZDiskStruct> MultiRingsZDiskData;
static std::ostream& operator<<( std::ostream& io , const MultiRingsZDiskData& d ) {
boost::io::ios_base_all_saver ifs(io);
io << " -- MultiRingsZDiskData: " << std::scientific << std::endl;
io << " widthStrip : " << d.widthStrip << std::endl;
io << " lengthStrip : " << d.lengthStrip << std::endl;
io << " pitchStrip : " << d.pitchStrip << std::endl;
io << " angleStrip : " << d.angleStrip << std::endl;
std::vector<MultiRingsZDiskData::LayerLayout> layers = d.layers;
io << " Layers : alphaPetal zPosition d p zOffsetSup rminSupport rmaxSupport thicknessSupport nRing" << std::endl;
io << " np ns phi0 phiOffsetOdd distance widthInner widthOuter length thicknessSensitive thicknessGlue thicknessService" << std::endl;
for (unsigned i=0,N=layers.size(); i<N; ++i) {
MultiRingsZDiskData::LayerLayout l = layers[i];
std::vector<MultiRingsZDiskData::Ring> rings = l.rings;
io << " " << l.alphaPetal
<< " " << l.zPosition
<< " " << l.typeFlags[ MultiRingsZDiskData::SensorType::DoubleSided ]
<< " " << l.typeFlags[ MultiRingsZDiskData::SensorType::Pixel ]
<< " " << l.zOffsetSupport
<< " " << l.rminSupport
<< " " << l.rmaxSupport
<< " " << l.thicknessSupport
<< " " << rings.size()
<< std::endl;
for (unsigned ir=0,NR=rings.size(); ir<NR; ++ir) {
MultiRingsZDiskData::Ring r = rings[ir];
io << " " << r.petalNumber
<< " " << r.sensorsPerPetal
<< " " << r.phi0
<< " " << r.phiOffsetOdd
<< " " << r.distance
<< " " << r.widthInner
<< " " << r.widthOuter
<< " " << r.length
<< " " << r.thicknessSensitive
<< " " << r.thicknessGlue
<< " " << r.thicknessService
<< std::endl;
}
}
return io;
};
/** Simple data structure with key parameters for
* reconstruction of long crystal bar ECAL
*
......