16 'ECLClustersToTracksNamedBremsstrahlung',
17 'EventLevelClusteringInfo',
18 'EventLevelTrackingInfo',
19 'EventLevelTriggerTimeInfo',
23 'SoftwareTriggerResult',
35 additionalBranches=[],
39 Add the mDST output module to a path.
40 This function defines the mDST data format.
43 path (basf2.Path): Path to add module to
44 mc (bool): Save Monte Carlo quantities? (MCParticles and corresponding relations)
45 filename (str): Output file name.
46 additionalBranches (list): Additional objects/arrays of event durability to save
47 dataDescription (dict or None): Additional key->value pairs to be added as data description
48 fields to the output FileMetaData
50 branches = list(MDST_OBJECTS)
51 persistentBranches = [
'FileMetaData']
53 branches += [
'MCParticles']
54 persistentBranches += [
'BackgroundInfo']
55 branches += additionalBranches
57 if dataDescription
is None:
61 dataDescription.setdefault(
"dataLevel",
"mdst")
62 return path.add_module(
"RootOutput", outputFileName=filename, branchNames=branches,
63 branchNamesPersistent=persistentBranches, additionalDataDescription=dataDescription)
66 def add_mdst_dump(path, print_untested=False):
68 Add a PrintObjectsModule to a path for printing the mDST content.
71 path (basf2.Path): Path to add module to
72 print_untested (bool): If True print the names of all methods which are not
73 explicitly printed to make sure we don't miss addition of new members
77 from ROOT.Belle2
import Const
81 it = Const.PIDDetectors.c_set.begin()
83 pid_detectors.append(Const.PIDDetectorSet(it.getDetector()))
85 if it == Const.PIDDetectors.c_set.end():
87 charged_stables = [Const.ChargedStable(Const.chargedStableSet.at(index))
for index
in range(Const.chargedStableSet.size())]
92 DataStorePrinter(
"EventMetaData", [
93 "getErrorFlag",
"getEvent",
"getRun",
"getSubrun",
"getExperiment",
94 "getProduction",
"getTime",
"getParentLfn",
"getGeneratedWeight",
98 DataStorePrinter(
"Track", [
99 "getNumberOfFittedHypotheses",
"getQualityIndicator",
"isFlippedAndRefitted",
100 "getTrackTime",
"wasRefined"
102 "getTrackFitResult": charged_stables,
103 "getTrackFitResultWithClosestMass": charged_stables,
104 "getRelationsWith": [
"ECLClusters",
"KLMClusters",
"MCParticles",
"PIDLikelihoods"],
106 DataStorePrinter(
"V0", [
107 "getTracks",
"getTrackFitResults",
"getV0Hypothesis",
108 "getFittedVertexX",
"getFittedVertexY",
"getFittedVertexZ"
110 "getRelationsWith": [
"MCParticles"],
112 DataStorePrinter(
"TrackFitResult", [
113 "getPosition",
"getMomentum",
"get4Momentum",
"getEnergy",
"getTransverseMomentum",
114 "getCovariance6",
"getParticleType",
"getChargeSign",
"getPValue",
"getD0",
"getPhi0",
115 "getPhi",
"getOmega",
"getZ0",
"getTanLambda",
"getCotTheta",
116 "getTau",
"getCov",
"getCovariance5",
"getHitPatternCDC",
"getHitPatternVXD",
"getNDF",
"getChi2",
118 DataStorePrinter(
"EventLevelTrackingInfo", [
119 "getNCDCHitsNotAssigned",
"getNCDCHitsNotAssignedPostCleaning",
120 "getNCDCSegments",
"getSVDFirstSampleTime",
"hasAnErrorFlag",
121 "hasUnspecifiedTrackFindingFailure",
"hasVXDTF2AbortionFlag",
122 "hasSVDCKFAbortionFlag",
"hasPXDCKFAbortionFlag",
"hasSVDSpacePointCreatorAbortionFlag"], {
123 "hasCDCLayer": range(56)
125 DataStorePrinter(
"PIDLikelihood", [
"getMostLikely"], {
126 "isAvailable": pid_detectors,
127 "getLogL": charged_stables,
128 "getProbability": charged_stables,
130 DataStorePrinter(
"ECLCluster", [
131 "isTrack",
"isNeutral",
"getStatus",
"getConnectedRegionId",
132 "getClusterId",
"getMinTrkDistance",
"getDeltaL",
133 "getAbsZernike40",
"getAbsZernike51",
"getZernikeMVA",
"getE1oE9",
134 "getE9oE21",
"getNumberOfHadronDigits",
"getR",
"getHypotheses",
135 "getSecondMoment",
"getLAT",
"getNumberOfCrystals",
"getTime",
136 "getDeltaTime99",
"hasFailedFitTime",
"hasFailedTimeResolution",
"getPhi",
"getTheta",
137 "getEnergyRaw",
"getEnergyHighestCrystal",
"getUncertaintyEnergy",
138 "getUncertaintyTheta",
"getUncertaintyPhi",
"getClusterPosition",
139 "getCovarianceMatrix3x3",
"getDetectorRegion",
140 "isTriggerCluster",
"hasTriggerClusterMatching",
"hasPulseShapeDiscrimination",
141 "getPulseShapeDiscriminationMVA",
"getMaxECellId",
"getMinTrkDistanceID"
143 "getEnergy": [16, 32],
144 "hasHypothesis": [16, 32],
145 "getRelationsWith": [
"KlIds",
"MCParticles"],
147 DataStorePrinter(
"EventLevelClusteringInfo", [
148 "getNECLCalDigitsOutOfTimeFWD",
"getNECLCalDigitsOutOfTimeBarrel",
149 "getNECLCalDigitsOutOfTimeBWD",
"getNECLCalDigitsOutOfTime",
150 "getNECLShowersRejectedFWD",
"getNECLShowersRejectedBarrel",
151 "getNECLShowersRejectedBWD",
"getNECLShowersRejected",
152 "getNKLMDigitsMultiStripFWD",
"getNKLMDigitsMultiStripBarrel",
153 "getNKLMDigitsMultiStripBWD",
"getNKLMDigitsMultiStrip",
154 "getNECLShowersFWD",
"getNECLShowersBarrel",
155 "getNECLShowersBWD",
"getNECLShowers",
156 "getNECLLocalMaximumsFWD",
"getNECLLocalMaximumsBarrel",
157 "getNECLLocalMaximumsBWD",
"getNECLLocalMaximums",
158 "getNECLTriggerCellsFWD",
"getNECLTriggerCellsBarrel",
159 "getNECLTriggerCellsBWD",
"getNECLTriggerCells"
161 DataStorePrinter(
"KLMCluster", [
162 "getTime",
"getLayers",
"getInnermostLayer",
163 "getClusterPosition",
"getPosition",
"getMomentumMag",
"getEnergy",
164 "getMomentum",
"getError4x4",
"getError7x7",
165 "getAssociatedEclClusterFlag",
"getAssociatedTrackFlag",
167 "getRelationsWith": [
"KlIds",
"MCParticles"],
169 DataStorePrinter(
"KlId", [
"isKLM",
"isECL",
"getKlId"]),
170 DataStorePrinter(
"TRGSummary", [
172 "getTimType",
"getTimQuality",
"isPoissonInInjectionVeto"
175 "getTRGSummary": range(10),
176 "getPreScale": [[int(i / 32), i % 32]
for i
in list(range(320))],
177 "getInputBits": range(10),
178 "getFtdlBits": range(10),
179 "getPsnmBits": range(10)
181 DataStorePrinter(
"SoftwareTriggerResult", [
"getResults",
"getNonPrescaledResults"], array=
False),
182 DataStorePrinter(
"MCParticle", [
183 "getPDG",
"getStatus",
"getMass",
"getCharge",
"getEnergy",
"hasValidVertex",
184 "getProductionTime",
"getDecayTime",
"getLifetime",
"getVertex",
185 "getProductionVertex",
"getMomentum",
"get4Vector",
"getDecayVertex",
186 "getIndex",
"getArrayIndex",
187 "getFirstDaughter",
"getLastDaughter",
"getDaughters",
"getNDaughters",
"getMother",
188 "getSecondaryPhysicsProcess",
"getSeenInDetector",
189 "isVirtual",
"isInitial",
"isPrimaryParticle",
"getName"
190 ], {
'getDaughter': [0],
'getParticleFromGeneralizedIndexString': [
'0:0']}),
191 DataStorePrinter(
"EventLevelTriggerTimeInfo", [
192 "isValid",
"hasInjection",
"isHER",
"isRevo2",
193 "getTimeSinceLastInjection",
"getTimeSincePrevTrigger",
"getBunchNumber",
194 "getTimeSinceLastInjectionInMicroSeconds",
"getTimeSincePrevTriggerInMicroSeconds",
195 "getTimeSinceInjectedBunch",
"getTimeSinceInjectedBunchInMicroSeconds",
"getTriggeredBunchNumberGlobal"
198 path.add_module(PrintObjectsModule(mdst_dataobjects, print_untested))