Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/env python
import os
print(os.environ["DD4HEP_LIBRARY_PATH"])
import sys
# sys.exit(0)
from Gaudi.Configuration import *
##############################################################################
# Random Number Svc
##############################################################################
from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_
# rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_() # The default engine in Gaudi
rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_() # The default engine in Geant4
rndmengine.SetSingleton = True
rndmengine.Seeds = [42]
# rndmgensvc = RndmGenSvc("RndmGenSvc")
# rndmgensvc.Engine = rndmengine.name()
##############################################################################
# Event Data Svc
##############################################################################
#from Configurables import CEPCDataSvc
#dsvc = CEPCDataSvc("EventDataSvc")
from Configurables import K4DataSvc
dsvc = K4DataSvc("EventDataSvc")
##############################################################################
# Geometry Svc
##############################################################################
# geometry_option = "CepC_v4-onlyTracker.xml"
geometry_option = "CepC_v4-onlyVXD.xml"
if not os.getenv("DETCEPCV4ROOT"):
print("Can't find the geometry. Please setup envvar DETCEPCV4ROOT." )
sys.exit(-1)
geometry_path = os.path.join(os.getenv("DETCEPCV4ROOT"), "compact", geometry_option)
if not os.path.exists(geometry_path):
print("Can't find the compact geometry file: %s"%geometry_path)
sys.exit(-1)
from Configurables import GeoSvc
geosvc = GeoSvc("GeoSvc")
#geosvc.compact = geometry_path
geosvc.compact = "../Detector/DetEcalMatrix/compact/det.xml"
##############################################################################
# Physics Generator
##############################################################################
from Configurables import GenAlgo
from Configurables import GtGunTool
from Configurables import StdHepRdr
from Configurables import SLCIORdr
from Configurables import HepMCRdr
from Configurables import GenPrinter
gun = GtGunTool("GtGunTool")
gun.Particles = ["gamma"]
#gun.Energies = [0.5, 1] # GeV
#gun.EnergyMin = [0.1] # GeV
gun.EnergyMin = [1] # GeV
gun.EnergyMax = [1] # GeV
gun.ThetaMins = [90] # rad; 45deg
gun.ThetaMaxs = [90] # rad; 45deg
gun.PhiMins = [0] # rad; 0deg
gun.PhiMaxs = [0] # rad; 360deg
stdheprdr = StdHepRdr("StdHepRdr")
#stdheprdr.Input = "/cefs/data/stdhep/CEPC250/2fermions/E250.Pbhabha.e0.p0.whizard195/bhabha.e0.p0.00001.stdhep"
#stdheprdr.Input = "/cefs/data/stdhep/CEPC250/2fermions/E250.Pbhabha.e0.p0.whizard195/bhabha.e0.p0.00001.stdhep"
stdheprdr.Input = "/cefs/data/stdhep/CEPC250/higgs/E250.Pbbh.whizard195/E250.Pbbh_X.e0.p0.whizard195/Pbbh_X.e0.p0.00001.stdhep"
# lciordr = SLCIORdr("SLCIORdr")
# lciordr.Input = "/cefs/data/stdhep/lcio250/signal/Higgs/E250.Pbbh.whizard195/E250.Pbbh_X.e0.p0.whizard195/Pbbh_X.e0.p0.00001.slcio"
# hepmcrdr = HepMCRdr("HepMCRdr")
# hepmcrdr.Input = "example_UsingIterators.txt"
genprinter = GenPrinter("GenPrinter")
genalg = GenAlgo("GenAlgo")
genalg.GenTools = ["GtGunTool"]
#genalg.GenTools = ["StdHepRdr"]
# genalg.GenTools = ["StdHepRdr", "GenPrinter"]
# genalg.GenTools = ["SLCIORdr", "GenPrinter"]
# genalg.GenTools = ["HepMCRdr", "GenPrinter"]
##############################################################################
# Detector Simulation
##############################################################################
from Configurables import DetSimSvc
detsimsvc = DetSimSvc("DetSimSvc")
# from Configurables import ExampleAnaElemTool
# example_anatool = ExampleAnaElemTool("ExampleAnaElemTool")
from Configurables import DetSimAlg
detsimalg = DetSimAlg("DetSimAlg")
# detsimalg.VisMacs = ["vis.mac"]
detsimalg.RunCmds = [
# "/tracking/verbose 1",
]
detsimalg.AnaElems = [
# example_anatool.name()
# "ExampleAnaElemTool"
"Edm4hepWriterAnaElemTool"
]
detsimalg.RootDetElem = "WorldDetElemTool"
from Configurables import AnExampleDetElemTool
example_dettool = AnExampleDetElemTool("AnExampleDetElemTool")
##############################################################################
from Configurables import CaloDigiAlg
example_CaloDigiAlg = CaloDigiAlg("CaloDigiAlg")
example_CaloDigiAlg.Scale = 1
example_CaloDigiAlg.SimCaloHitCollection = "SimCalorimeterCol"
example_CaloDigiAlg.CaloHitCollection = "ECALBarrel"
##############################################################################
from Configurables import GearSvc
gearSvc = GearSvc("GearSvc")
#gearSvc.GearXMLFile = "/junofs/users/wxfang/CEPC/CEPCOFF/doSim/fullDet/GearOutput.xml"
gearSvc.GearXMLFile = "../Detector/DetCEPCv4/compact/FullDetGear.xml"
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
##############################################################################
#from Configurables import PandoraPFAlg
from Configurables import PandoraMatrixAlg
#pandoralg = PandoraPFAlg("PandoraPFAlg")
pandoralg = PandoraMatrixAlg("PandoraMatrixAlg")
## KEEP same with lcioinput name for the ReadXXX ###########
pandoralg.ReadMCParticle = "MCParticle"
pandoralg.ReadECALBarrel = "ECALBarrel"
pandoralg.ReadECALEndcap = "ECALEndcap"
pandoralg.ReadECALOther = "ECALOther"
pandoralg.ReadHCALBarrel = "HCALBarrel"
pandoralg.ReadHCALEndcap = "HCALEndcap"
pandoralg.ReadHCALOther = "HCALOther"
pandoralg.ReadMUON = "MUON"
pandoralg.ReadLCAL = "LCAL"
pandoralg.ReadLHCAL = "LHCAL"
pandoralg.ReadBCAL = "BCAL"
pandoralg.ReadKinkVertices = "KinkVertices"
pandoralg.ReadProngVertices = "ProngVertices"
pandoralg.ReadSplitVertices = "SplitVertices"
pandoralg.ReadV0Vertices = "V0Vertices"
pandoralg.ReadTracks = "MarlinTrkTracks"
pandoralg.WriteClusterCollection = "PandoraClusters"
pandoralg.WriteReconstructedParticleCollection = "PandoraPFOs"
pandoralg.WriteVertexCollection = "PandoraPFANewStartVertices"
pandoralg.AnaOutput = "/cefs/higgs/wxfang/cepc/Pandora/Ana/gamma/Ana_gamma_Matrix_NewTest.root"
pandoralg.PandoraSettingsDefault_xml = "/junofs/users/wxfang/MyGit/MarlinPandora/scripts/PandoraSettingsDefault_wx.xml"
#### Do not chage the collection name, only add or delete ###############
pandoralg.TrackCollections = ["MarlinTrkTracks"]
pandoralg.ECalCaloHitCollections= ["ECALBarrel", "ECALEndcap", "ECALOther"]
pandoralg.HCalCaloHitCollections= ["HCALBarrel", "HCALEndcap", "HCALOther"]
pandoralg.LCalCaloHitCollections= ["LCAL"]
pandoralg.LHCalCaloHitCollections= ["LHCAL"]
pandoralg.MuonCaloHitCollections= ["MUON"]
pandoralg.MCParticleCollections = ["MCParticle"]
pandoralg.RelCaloHitCollections = ["RecoCaloAssociation_ECALBarrel", "RecoCaloAssociation_ECALEndcap", "RecoCaloAssociation_ECALOther", "RecoCaloAssociation_HCALBarrel", "RecoCaloAssociation_HCALEndcap", "RecoCaloAssociation_HCALOther", "RecoCaloAssociation_LCAL", "RecoCaloAssociation_LHCAL", "RecoCaloAssociation_MUON"]
pandoralg.RelTrackCollections = ["MarlinTrkTracksMCTruthLink"]
pandoralg.KinkVertexCollections = ["KinkVertices"]
pandoralg.ProngVertexCollections= ["ProngVertices"]
pandoralg.SplitVertexCollections= ["SplitVertices"]
pandoralg.V0VertexCollections = ["V0Vertices"]
pandoralg.ECalToMipCalibration = 112 #1000MeV/8.918 #CEPC :160.0
pandoralg.HCalToMipCalibration = 34.8
pandoralg.ECalMipThreshold = 0.225# 8.918*0.225=2.00655 #CEPC 0.5
pandoralg.HCalMipThreshold = 0.3
pandoralg.ECalToEMGeVCalibration= 1.# BGO, to be tuned # CEPC: 0.9 for G2CD Digi, 1.007 for NewLDCaloDigi
pandoralg.HCalToEMGeVCalibration= 1.007
pandoralg.ECalToHadGeVCalibrationBarrel= 1.12 #very small effect
pandoralg.ECalToHadGeVCalibrationEndCap= 1.12
pandoralg.HCalToHadGeVCalibration= 1.07
pandoralg.MuonToMipCalibration= 10.0
pandoralg.DigitalMuonHits= 0
pandoralg.MaxHCalHitHadronicEnergy = 1.0
pandoralg.UseOldTrackStateCalculation= 0
pandoralg.AbsorberRadLengthECal= 0.08945 #BG0: 1/11.18 mm , CEPC: 0.2854 = 1/3.504 mm
pandoralg.AbsorberIntLengthECal= 0.00448 #BG0: 1/223.2 mm , CEPC: 0.0101 = 1/99.46 mm
pandoralg.AbsorberRadLengthHCal= 0.0569
pandoralg.AbsorberIntLengthHCal= 0.006
pandoralg.AbsorberRadLengthOther= 0.0569
pandoralg.AbsorberIntLengthOther= 0.006
##############################################################################
# write PODIO file
from Configurables import PodioOutput
write = PodioOutput("write")
write.filename = "test.root"
write.outputCommands = ["keep *"]
# ApplicationMgr
from Configurables import ApplicationMgr
ApplicationMgr(
TopAlg = [genalg, detsimalg, example_CaloDigiAlg, pandoralg],
#TopAlg = [genalg, detsimalg],
#TopAlg = [genalg, detsimalg, write],
#TopAlg = [read, pandoralg],
EvtSel = 'NONE',
EvtMax = 100,
#ExtSvc = [rndmengine, dsvc, geosvc, gearSvc],
ExtSvc = [rndmengine, dsvc, geosvc, gearSvc,detsimsvc],
OutputLevel=INFO
)