Newer
Older
import os
from Gaudi.Configuration import *
############## GeomSvc #################
geometry_option = "TDR_o1_v01/TDR_o1_v01.xml"
if not os.getenv("DETCRDROOT"):
print("Can't find the geometry. Please setup envvar DETCRDROOT." )
sys.exit(-1)
geometry_path = os.path.join(os.getenv("DETCRDROOT"), "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 GeomSvc
geomsvc = GeomSvc("GeomSvc")
geomsvc.compact = geometry_path
#######################################
########### k4DataSvc ####################
from Configurables import k4DataSvc
podioevent = k4DataSvc("EventDataSvc", input="CaloDigi_TDR_o1_v01_Pi-_10GeV.root")
##########################################

lihn@ihep.ac.cn
committed
########## CEPCSWData #################
cepcswdatatop ="/cvmfs/cepcsw.ihep.ac.cn/prototype/releases/data/latest"
#######################################
########## CrystalEcalEnergyCorrectionSvc ########
from Configurables import CrystalEcalEnergyCorrectionSvc
crystalecalcorr = CrystalEcalEnergyCorrectionSvc("CrystalEcalEnergyCorrectionSvc")
crystalecalcorr.CorrectionFile = os.path.join(cepcswdatatop, "CEPCSWData/offline-data/Service/CrystalEcalSvc/data/CrackRegionEnergyCorrection.root")
##################################################
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
########## Podio Input ###################
from Configurables import PodioInput
inp = PodioInput("InputReader")
inp.collections = [ "EcalBarrelCollection",
"EcalBarrelContributionCollection",
"ECALBarrel",
"ECALBarrelParticleAssoCol",
"HcalBarrelCollection",
"HcalBarrelContributionCollection",
"HCALBarrel",
"HCALBarrelParticleAssoCol",
"MCParticle",
"CompleteTracks",
"CompleteTracksParticleAssociation"]
##########################################
######### Reconstruction ################
from Configurables import PandoraPlusPFAlg
PandoraPlusPFAlg = PandoraPlusPFAlg("PandoraPlusPFAlg")
##----Global parameters----
PandoraPlusPFAlg.Seed = 1024
PandoraPlusPFAlg.BField = 3.
PandoraPlusPFAlg.Debug = 0
PandoraPlusPFAlg.SkipEvt = 0
PandoraPlusPFAlg.WriteAna = 1
PandoraPlusPFAlg.AnaFileName = "RecAnaTuple_TDR_o1_v01_Pi-_10GeV.root"
PandoraPlusPFAlg.UseTruthTrack = 0
PandoraPlusPFAlg.EcalGlobalCalib = 1.05
PandoraPlusPFAlg.HcalGlobalCalib = 4.5
##----Readin collections----
PandoraPlusPFAlg.MCParticleCollection = "MCParticle"
PandoraPlusPFAlg.TrackCollections = ["CompleteTracks"]
PandoraPlusPFAlg.MCRecoTrackParticleAssociationCollection = "CompleteTracksParticleAssociation"
PandoraPlusPFAlg.ECalCaloHitCollections = ["ECALBarrel"]
PandoraPlusPFAlg.ECalReadOutNames = ["EcalBarrelCollection"]
PandoraPlusPFAlg.ECalMCPAssociationName = ["ECALBarrelParticleAssoCol"]
PandoraPlusPFAlg.HCalCaloHitCollections = ["HCALBarrel"]
PandoraPlusPFAlg.HCalReadOutNames = ["HcalBarrelCollection"]
PandoraPlusPFAlg.HCalMCPAssociationName = ["HCALBarrelParticleAssoCol"]
##--- Output collections ---
PandoraPlusPFAlg.OutputPFO = "outputPFO";
#----Algorithms----
PandoraPlusPFAlg.AlgList = ["GlobalClusteringAlg", #1
"LocalMaxFindingAlg", #2
"TrackMatchingAlg", #3
"HoughClusteringAlg", #4
"ConeClustering2DAlg", #5
"AxisMergingAlg", #6
"EnergySplittingAlg", #9
"EnergyTimeMatchingAlg", #11
"HcalClusteringAlg", #12
"TruthClusteringAlg", #15
"TrackClusterConnectingAlg", #16
"PFOReclusteringAlg" ] #17
PandoraPlusPFAlg.AlgParNames = [ ["InputECALBars","OutputECAL1DClusters","OutputECALHalfClusters"],#1
["OutputLocalMaxName"],#2
["ReadinLocalMaxName","OutputLongiClusName"],#3
["ReadinLocalMaxName","LeftLocalMaxName","OutputLongiClusName"],#4
["ReadinLocalMaxName", "OutputLongiClusName"], #5
["OutputAxisName"], #6
["ReadinAxisName", "OutputClusName", "OutputTowerName"], #9
["ReadinHFClusterName", "ReadinTowerName","OutputClusterName"], #11
["InputHCALHits", "OutputHCALClusters"], #12
["DoECALClustering","DoHCALClustering","InputHCALHits","OutputHCALClusters"], #15
["ReadinECALClusterName", "ReadinHCALClusterName", "OutputCombPFO"], #16
["ECALCalib", "HCALCalib", "MinAngleForNeuMerge"] ]#17
PandoraPlusPFAlg.AlgParTypes = [ ["string","string","string"],#1
["string"],#2
["string","string"],#3
["string","string","string"],#4
["string","string"], #5
["string"], #6
["string","string","string"], #9
["string","string","string"], #11
["string", "string"], #12
["bool","bool","string","string"], #15
["string","string","string"], #16
["double","double","double"] ]#17
PandoraPlusPFAlg.AlgParValues = [ ["BarCol","Cluster1DCol","HalfClusterCol"],#1
["AllLocalMax"],#2
["AllLocalMax","TrackAxis"],#3
["AllLocalMax","LeftLocalMax","HoughAxis"],#4
["LeftLocalMax","ConeAxis"], #5
["MergedAxis"], #6
["MergedAxis","ESHalfCluster","ESTower"], #9
["ESHalfCluster","ESTower","EcalCluster"], #11
["HCALBarrel", "SimpleHCALCluster"], #12
["0","1","HCALBarrel","HCALCluster"], #15
["EcalCluster", "SimpleHCALCluster", "outputPFO"], #16
["1.05","4.5","0.12"] ]#17
##############################################################################
# POD I/O
##############################################################################
from Configurables import PodioOutput
out = PodioOutput("outputalg")
out.filename = "Rec_TDR_o1_v01_Pi-_10GeV.root"
out.outputCommands = ["keep *"]
########################################
from Configurables import ApplicationMgr
ApplicationMgr(
TopAlg=[inp, PandoraPlusPFAlg, out ],
EvtSel="NONE",
EvtMax=10,
ExtSvc=[podioevent, geomsvc],
#OutputLevel=DEBUG
)