5 from ROOT.Belle2
import Const
10 'ECLClustersToTracksNamedBremsstrahlung',
11 'EventLevelClusteringInfo',
12 'EventLevelTrackingInfo',
16 'SoftwareTriggerResult',
28 additionalBranches=[],
32 Add the mDST output module to a path.
33 This function defines the mDST data format.
36 path (basf2.Path): Path to add module to
37 mc (bool): Save Monte Carlo quantities? (MCParticles and corresponding relations)
38 filename (str): Output file name.
39 additionalBranches (list): Additional objects/arrays of event durability to save
40 dataDescription (dict or None): Additional key->value pairs to be added as data description
41 fields to the output FileMetaData
43 branches = list(MDST_OBJECTS)
44 persistentBranches = [
'FileMetaData']
46 branches += [
'MCParticles']
47 persistentBranches += [
'BackgroundInfo']
48 branches += additionalBranches
50 if dataDescription
is None:
54 dataDescription.setdefault(
"dataLevel",
"mdst")
55 return path.add_module(
"RootOutput", outputFileName=filename, branchNames=branches,
56 branchNamesPersistent=persistentBranches, additionalDataDescription=dataDescription)
59 def add_mdst_dump(path, print_untested=False):
61 Add a PrintObjectsModule to a path for printing the mDST content.
64 path (basf2.Path): Path to add module to
65 print_untested (bool): If True print the names of all methods which are not
66 explicitly printed to make sure we don't miss addition of new members
70 pid_detectors = [Const.PIDDetectorSet(Const.PIDDetectors.c_set[index])
for index
in range(Const.PIDDetectors.c_size)]
71 charged_stables = [Const.ChargedStable(Const.chargedStableSet.at(index))
for index
in range(Const.chargedStableSet.size())]
76 DataStorePrinter(
"EventMetaData", [
77 "getErrorFlag",
"getEvent",
"getRun",
"getSubrun",
"getExperiment",
78 "getProduction",
"getTime",
"getParentLfn",
"getGeneratedWeight",
81 DataStorePrinter(
"Track", [
"getNumberOfFittedHypotheses",
"getQualityIndicator"], {
82 "getTrackFitResult": charged_stables,
83 "getTrackFitResultWithClosestMass": charged_stables,
84 "getRelationsWith": [
"ECLClusters",
"KLMClusters",
"MCParticles",
"PIDLikelihoods"],
86 DataStorePrinter(
"V0", [
"getTracks",
"getTrackFitResults",
"getV0Hypothesis"], {
87 "getRelationsWith": [
"MCParticles"],
89 DataStorePrinter(
"TrackFitResult", [
90 "getPosition",
"getMomentum",
"get4Momentum",
"getEnergy",
"getTransverseMomentum",
91 "getCovariance6",
"getParticleType",
"getChargeSign",
"getPValue",
"getD0",
"getPhi0",
92 "getPhi",
"getOmega",
"getZ0",
"getTanLambda",
"getCotTheta",
93 "getTau",
"getCov",
"getCovariance5",
"getHitPatternCDC",
"getHitPatternVXD",
"getNDF",
"getChi2"
95 DataStorePrinter(
"EventLevelTrackingInfo", [
96 "getNCDCHitsNotAssigned",
"getNCDCHitsNotAssignedPostCleaning",
97 "getNCDCSegments",
"getSVDFirstSampleTime",
"hasAnErrorFlag",
98 "hasUnspecifiedTrackFindingFailure",
"hasVXDTF2AbortionFlag",
99 "hasSVDCKFAbortionFlag",
"hasPXDCKFAbortionFlag"], {
100 "hasCDCLayer": range(56)
102 DataStorePrinter(
"PIDLikelihood", [
"getMostLikely"], {
103 "isAvailable": pid_detectors,
104 "getLogL": charged_stables,
105 "getProbability": charged_stables,
107 DataStorePrinter(
"ECLCluster", [
108 "isTrack",
"isNeutral",
"getStatus",
"getConnectedRegionId",
109 "getClusterId",
"getMinTrkDistance",
"getDeltaL",
110 "getAbsZernike40",
"getAbsZernike51",
"getZernikeMVA",
"getE1oE9",
111 "getE9oE21",
"getClusterHadronIntensity",
"getNumberOfHadronDigits",
112 "getSecondMoment",
"getLAT",
"getNumberOfCrystals",
"getTime",
113 "getDeltaTime99",
"hasFailedFitTime",
"hasFailedTimeResolution",
"getPhi",
"getTheta",
"getR",
"getHypotheses",
114 "getEnergyRaw",
"getEnergyHighestCrystal",
"getUncertaintyEnergy",
115 "getUncertaintyTheta",
"getUncertaintyPhi",
"getClusterPosition",
116 "getCovarianceMatrix3x3",
"getDetectorRegion",
"getUniqueId",
117 "isTriggerCluster",
"hasTriggerClusterMatching",
"hasPulseShapeDiscrimination",
118 "getPulseShapeDiscriminationMVA",
"getMaxECellId",
120 "getEnergy": [16, 32],
121 "hasHypothesis": [16, 32],
122 "getRelationsWith": [
"KlIds",
"MCParticles"],
124 DataStorePrinter(
"EventLevelClusteringInfo", [
125 "getNECLCalDigitsOutOfTimeFWD",
"getNECLCalDigitsOutOfTimeBarrel",
126 "getNECLCalDigitsOutOfTimeBWD",
"getNECLCalDigitsOutOfTime",
127 "getNECLShowersRejectedFWD",
"getNECLShowersRejectedBarrel",
128 "getNECLShowersRejectedBWD",
"getNECLShowersRejected"
130 DataStorePrinter(
"KLMCluster", [
131 "getTime",
"getLayers",
"getInnermostLayer",
132 "getClusterPosition",
"getPosition",
"getMomentumMag",
"getEnergy",
133 "getMomentum",
"getError4x4",
"getError7x7",
134 "getAssociatedEclClusterFlag",
"getAssociatedTrackFlag",
136 "getRelationsWith": [
"KlIds",
"MCParticles"],
138 DataStorePrinter(
"KlId", [
"isKLM",
"isECL",
"getKlId"]),
139 DataStorePrinter(
"TRGSummary", [
140 "getTimType",
"getTimQuality",
"isPoissonInInjectionVeto"
142 "getTRGSummary": range(10),
143 "getPreScale": [[int(i / 32), i % 32]
for i
in list(range(320))],
144 "getInputBits": range(10),
145 "getFtdlBits": range(10),
146 "getPsnmBits": range(10),
148 DataStorePrinter(
"SoftwareTriggerResult", [
"getResults",
"getNonPrescaledResults"], array=
False),
149 DataStorePrinter(
"MCParticle", [
150 "getPDG",
"getStatus",
"getMass",
"getCharge",
"getEnergy",
"hasValidVertex",
151 "getProductionTime",
"getDecayTime",
"getLifetime",
"getVertex",
152 "getProductionVertex",
"getMomentum",
"get4Vector",
"getDecayVertex",
153 "getIndex",
"getArrayIndex",
154 "getFirstDaughter",
"getLastDaughter",
"getDaughters",
"getNDaughters",
"getMother",
155 "getSecondaryPhysicsProcess",
"getSeenInDetector",
156 "isVirtual",
"isInitial",
"isPrimaryParticle",
"getName"
159 path.add_module(PrintObjectsModule(mdst_dataobjects, print_untested))