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", [
"getTracks",
"getTrackFitResults",
"getV0Hypothesis"], {
107 "getRelationsWith": [
"MCParticles"],
109 DataStorePrinter(
"TrackFitResult", [
110 "getPosition",
"getMomentum",
"get4Momentum",
"getEnergy",
"getTransverseMomentum",
111 "getCovariance6",
"getParticleType",
"getChargeSign",
"getPValue",
"getD0",
"getPhi0",
112 "getPhi",
"getOmega",
"getZ0",
"getTanLambda",
"getCotTheta",
113 "getTau",
"getCov",
"getCovariance5",
"getHitPatternCDC",
"getHitPatternVXD",
"getNDF",
"getChi2",
115 DataStorePrinter(
"EventLevelTrackingInfo", [
116 "getNCDCHitsNotAssigned",
"getNCDCHitsNotAssignedPostCleaning",
117 "getNCDCSegments",
"getSVDFirstSampleTime",
"hasAnErrorFlag",
118 "hasUnspecifiedTrackFindingFailure",
"hasVXDTF2AbortionFlag",
119 "hasSVDCKFAbortionFlag",
"hasPXDCKFAbortionFlag",
"hasSVDSpacePointCreatorAbortionFlag"], {
120 "hasCDCLayer": range(56)
122 DataStorePrinter(
"PIDLikelihood", [
"getMostLikely"], {
123 "isAvailable": pid_detectors,
124 "getLogL": charged_stables,
125 "getProbability": charged_stables,
127 DataStorePrinter(
"ECLCluster", [
128 "isTrack",
"isNeutral",
"getStatus",
"getConnectedRegionId",
129 "getClusterId",
"getMinTrkDistance",
"getDeltaL",
130 "getAbsZernike40",
"getAbsZernike51",
"getZernikeMVA",
"getE1oE9",
131 "getE9oE21",
"getNumberOfHadronDigits",
"getR",
"getHypotheses",
132 "getSecondMoment",
"getLAT",
"getNumberOfCrystals",
"getTime",
133 "getDeltaTime99",
"hasFailedFitTime",
"hasFailedTimeResolution",
"getPhi",
"getTheta",
134 "getEnergyRaw",
"getEnergyHighestCrystal",
"getUncertaintyEnergy",
135 "getUncertaintyTheta",
"getUncertaintyPhi",
"getClusterPosition",
136 "getCovarianceMatrix3x3",
"getDetectorRegion",
137 "isTriggerCluster",
"hasTriggerClusterMatching",
"hasPulseShapeDiscrimination",
138 "getPulseShapeDiscriminationMVA",
"getMaxECellId",
"getMinTrkDistanceID"
140 "getEnergy": [16, 32],
141 "hasHypothesis": [16, 32],
142 "getRelationsWith": [
"KlIds",
"MCParticles"],
144 DataStorePrinter(
"EventLevelClusteringInfo", [
145 "getNECLCalDigitsOutOfTimeFWD",
"getNECLCalDigitsOutOfTimeBarrel",
146 "getNECLCalDigitsOutOfTimeBWD",
"getNECLCalDigitsOutOfTime",
147 "getNECLShowersRejectedFWD",
"getNECLShowersRejectedBarrel",
148 "getNECLShowersRejectedBWD",
"getNECLShowersRejected"
150 DataStorePrinter(
"KLMCluster", [
151 "getTime",
"getLayers",
"getInnermostLayer",
152 "getClusterPosition",
"getPosition",
"getMomentumMag",
"getEnergy",
153 "getMomentum",
"getError4x4",
"getError7x7",
154 "getAssociatedEclClusterFlag",
"getAssociatedTrackFlag",
156 "getRelationsWith": [
"KlIds",
"MCParticles"],
158 DataStorePrinter(
"KlId", [
"isKLM",
"isECL",
"getKlId"]),
159 DataStorePrinter(
"TRGSummary", [
161 "getTimType",
"getTimQuality",
"isPoissonInInjectionVeto"
164 "getTRGSummary": range(10),
165 "getPreScale": [[int(i / 32), i % 32]
for i
in list(range(320))],
166 "getInputBits": range(10),
167 "getFtdlBits": range(10),
168 "getPsnmBits": range(10)
170 DataStorePrinter(
"SoftwareTriggerResult", [
"getResults",
"getNonPrescaledResults"], array=
False),
171 DataStorePrinter(
"MCParticle", [
172 "getPDG",
"getStatus",
"getMass",
"getCharge",
"getEnergy",
"hasValidVertex",
173 "getProductionTime",
"getDecayTime",
"getLifetime",
"getVertex",
174 "getProductionVertex",
"getMomentum",
"get4Vector",
"getDecayVertex",
175 "getIndex",
"getArrayIndex",
176 "getFirstDaughter",
"getLastDaughter",
"getDaughters",
"getNDaughters",
"getMother",
177 "getSecondaryPhysicsProcess",
"getSeenInDetector",
178 "isVirtual",
"isInitial",
"isPrimaryParticle",
"getName"
179 ], {
'getDaughter': [0],
'getParticleFromGeneralizedIndexString': [
'0:0']}),
180 DataStorePrinter(
"EventLevelTriggerTimeInfo", [
181 "isValid",
"hasInjection",
"isHER",
"isRevo2",
182 "getTimeSinceLastInjection",
"getTimeSincePrevTrigger",
"getBunchNumber",
183 "getTimeSinceLastInjectionInMicroSeconds",
"getTimeSincePrevTriggerInMicroSeconds",
184 "getTimeSinceInjectedBunch",
"getTimeSinceInjectedBunchInMicroSeconds",
"getTriggeredBunchNumberGlobal"
187 path.add_module(PrintObjectsModule(mdst_dataobjects, print_untested))