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)
66def add_mdst_dump(path, print_untested=False, print_mutable=True):
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
74 print_mutable (bool): If False do not print mutable content that may differ
75 during the execution of two basf2 jobs, e.g. EventMetaData::getTime
79 from ROOT
import Belle2
80 from ROOT.Belle2
import Const
84 it = Const.PIDDetectors.c_set.begin()
86 pid_detectors.append(Const.PIDDetectorSet(it.getDetector()))
88 if it == Const.PIDDetectors.c_set.end():
90 charged_stables = [Const.ChargedStable(Const.chargedStableSet.at(index))
for index
in range(Const.chargedStableSet.size())]
95 DataStorePrinter(
"EventMetaData", [
96 "getErrorFlag",
"getEvent",
"getRun",
"getSubrun",
"getExperiment",
97 "getProduction",
"getParentLfn",
"getGeneratedWeight",
"isEndOfRun"] +
98 ([
"getTime"]
if print_mutable
else []),
101 DataStorePrinter(
"Track", [
102 "getNumberOfFittedHypotheses",
"getQualityIndicator",
"isFlippedAndRefitted",
103 "getTrackTime",
"wasRefined"
105 "getTrackFitResult": charged_stables,
106 "getTrackFitResultWithClosestMass": charged_stables,
107 "getRelationsWith": [
"ECLClusters",
"KLMClusters",
"MCParticles",
"PIDLikelihoods"],
109 DataStorePrinter(
"V0", [
110 "getTracks",
"getTrackFitResults",
"getV0Hypothesis",
111 "getFittedVertexX",
"getFittedVertexY",
"getFittedVertexZ"
113 "getRelationsWith": [
"MCParticles"],
115 DataStorePrinter(
"Kinks", [
116 "getMotherTrackIndex",
"getDaughterTrackIndex",
"getTrackFitResultIndexMotherStart",
117 "getTrackFitResultIndexMotherEnd",
"getTrackFitResultIndexDaughter",
118 "getFittedVertexX",
"getFittedVertexY",
"getFittedVertexZ",
"getFilterFlag"
120 DataStorePrinter(
"TrackFitResult", [
121 "getPosition",
"getMomentum",
"get4Momentum",
"getEnergy",
"getTransverseMomentum",
122 "getCovariance6",
"getParticleType",
"getChargeSign",
"getPValue",
"getD0",
"getPhi0",
123 "getPhi",
"getOmega",
"getZ0",
"getTanLambda",
"getCotTheta",
124 "getTau",
"getCov",
"getCovariance5",
"getHitPatternCDC",
"getHitPatternVXD",
"getNDF",
"getChi2",
126 DataStorePrinter(
"EventLevelTrackingInfo", [
127 "getNCDCHitsNotAssigned",
"getNCDCHitsNotAssignedPostCleaning",
128 "getNCDCSegments",
"getSVDFirstSampleTime",
"hasAnErrorFlag",
129 "hasUnspecifiedTrackFindingFailure",
"hasVXDTF2AbortionFlag",
130 "hasSVDCKFAbortionFlag",
"hasPXDCKFAbortionFlag",
"hasSVDSpacePointCreatorAbortionFlag"], {
131 "hasCDCLayer": range(56)
133 DataStorePrinter(
"PIDLikelihood", [
"getMostLikely",
"isAvailable",
"areAllAvailable"],
136 "isAvailable": pid_detectors,
137 "areAllAvailable": pid_detectors,
138 "getLogL": charged_stables,
139 "getProbability": charged_stables,
140 "getLogarithmicProbability": charged_stables,
141 }
if print_mutable
else {}
143 DataStorePrinter(
"ECLCluster", [
144 "isTrack",
"isNeutral",
"getStatus",
"getConnectedRegionId",
145 "getClusterId",
"getUniqueClusterId",
"getMinTrkDistance",
"getDeltaL",
146 "getAbsZernike40",
"getAbsZernike51",
"getZernikeMVA",
"getE1oE9",
147 "getE9oE21",
"getNumberOfHadronDigits",
"getR",
"getHypotheses",
148 "getSecondMoment",
"getLAT",
"getNumberOfCrystals",
"getTime",
149 "getDeltaTime99",
"hasFailedFitTime",
"hasFailedTimeResolution",
"getPhi",
"getTheta",
150 "getEnergyRaw",
"getEnergyHighestCrystal",
"getUncertaintyEnergy",
151 "getUncertaintyTheta",
"getUncertaintyPhi",
"getClusterPosition",
152 "getCovarianceMatrix3x3",
"getDetectorRegion",
153 "isTriggerCluster",
"hasTriggerClusterMatching",
"hasPulseShapeDiscrimination",
154 "getPulseShapeDiscriminationMVA",
"getMaxECellId",
"getMinTrkDistanceID"
156 "getEnergy": [16, 32],
157 "hasHypothesis": [16, 32],
158 "getRelationsWith": [
"KlIds",
"MCParticles"],
160 DataStorePrinter(
"EventLevelClusteringInfo", [
161 "getNECLCalDigitsOutOfTimeFWD",
"getNECLCalDigitsOutOfTimeBarrel",
162 "getNECLCalDigitsOutOfTimeBWD",
"getNECLCalDigitsOutOfTime",
163 "getNECLShowersRejectedFWD",
"getNECLShowersRejectedBarrel",
164 "getNECLShowersRejectedBWD",
"getNECLShowersRejected",
165 "getNKLMDigitsMultiStripFWD",
"getNKLMDigitsMultiStripBarrel",
166 "getNKLMDigitsMultiStripBWD",
"getNKLMDigitsMultiStrip",
167 "getNECLShowersFWD",
"getNECLShowersBarrel",
168 "getNECLShowersBWD",
"getNECLShowers",
169 "getNECLLocalMaximumsFWD",
"getNECLLocalMaximumsBarrel",
170 "getNECLLocalMaximumsBWD",
"getNECLLocalMaximums",
171 "getNECLTriggerCellsFWD",
"getNECLTriggerCellsBarrel",
172 "getNECLTriggerCellsBWD",
"getNECLTriggerCells"
174 DataStorePrinter(
"KLMCluster", [
175 "getTime",
"getLayers",
"getInnermostLayer",
176 "getClusterPosition",
"getPosition",
"getMomentumMag",
"getEnergy",
177 "getMomentum",
"getError4x4",
"getError7x7",
178 "getAssociatedEclClusterFlag",
"getAssociatedTrackFlag",
179 "getClusterTrackRotationAngle",
"getClusterTrackSeparationAngle",
180 "getClusterTrackSeparation",
181 "getShapeStdDev1",
"getShapeStdDev2",
"getShapeStdDev3"
183 "getRelationsWith": [
"KlIds",
"MCParticles"],
185 DataStorePrinter(
"KlId", [
"isKLM",
"isECL",
"getKlId"]),
186 DataStorePrinter(
"TRGSummary", [
188 "getTimType",
"getTimQuality",
"isPoissonInInjectionVeto"
191 "getTRGSummary": range(10),
192 "getPreScale": [[int(i / 32), i % 32]
for i
in list(range(320))],
193 "getInputBits": range(10),
194 "getFtdlBits": range(10),
195 "getPsnmBits": range(10)
197 DataStorePrinter(
"SoftwareTriggerResult", [
"getResults",
"getNonPrescaledResults"], array=
False),
198 DataStorePrinter(
"MCParticle", [
199 "getPDG",
"getStatus",
"getMass",
"getCharge",
"getEnergy",
"hasValidVertex",
200 "getProductionTime",
"getDecayTime",
"getLifetime",
"getVertex",
201 "getProductionVertex",
"getMomentum",
"get4Vector",
"getDecayVertex",
202 "getIndex",
"getArrayIndex",
203 "getFirstDaughter",
"getLastDaughter",
"getDaughters",
"getNDaughters",
"getMother",
204 "getSecondaryPhysicsProcess",
"getSeenInDetector",
205 "isVirtual",
"isInitial",
"isPrimaryParticle",
"getName"
206 ], {
'getDaughter': [0],
'getParticleFromGeneralizedIndexString': [
'0:0']}),
207 DataStorePrinter(
"EventLevelTriggerTimeInfo", [
208 "isValid",
"hasInjection",
"isHER",
"isRevo2",
209 "getTimeSinceLastInjection",
"getTimeSincePrevTrigger",
"getBunchNumber",
210 "getTimeSinceLastInjectionInMicroSeconds",
"getTimeSincePrevTriggerInMicroSeconds",
211 "getTimeSinceInjectedBunch",
"getTimeSinceInjectedBunchInMicroSeconds",
"getTriggeredBunchNumberGlobal",
212 "hasEventT0SourceFromSVD",
"hasEventT0SourceFromCDC",
"hasEventT0SourceFromECL",
"hasAnyEventT0Sources",
216 path.add_module(PrintObjectsModule(mdst_dataobjects, print_untested))