16 'ECLClustersToTracksNamedBremsstrahlung',
17 'EventLevelClusteringInfo',
18 'EventLevelTrackingInfo',
19 'EventLevelTriggerTimeInfo',
24 'SoftwareTriggerResult',
36 additionalBranches=[],
40 Add the mDST output module to a path.
41 This function defines the mDST data format.
44 path (basf2.Path): Path to add module to
45 mc (bool): Save Monte Carlo quantities? (MCParticles and corresponding relations)
46 filename (str): Output file name.
47 additionalBranches (list): Additional objects/arrays of event durability to save
48 dataDescription (dict or None): Additional key->value pairs to be added as data description
49 fields to the output FileMetaData
51 branches = list(MDST_OBJECTS)
52 persistentBranches = [
'FileMetaData']
54 branches += [
'MCParticles']
55 persistentBranches += [
'BackgroundInfo']
56 branches += additionalBranches
58 if dataDescription
is None:
62 dataDescription.setdefault(
"dataLevel",
"mdst")
63 return path.add_module(
"RootOutput", outputFileName=filename, branchNames=branches,
64 branchNamesPersistent=persistentBranches, additionalDataDescription=dataDescription)
67def add_mdst_dump(path, print_untested=False, print_mutable=True):
69 Add a PrintObjectsModule to a path for printing the mDST content.
72 path (basf2.Path): Path to add module to
73 print_untested (bool): If True print the names of all methods which are not
74 explicitly printed to make sure we don't miss addition of new members
75 print_mutable (bool): If False do not print mutable content that may differ
76 during the execution of two basf2 jobs, e.g. EventMetaData::getTime
80 from ROOT
import Belle2
81 from ROOT.Belle2
import Const
85 it = Const.PIDDetectors.c_set.begin()
87 pid_detectors.append(Const.PIDDetectorSet(it.getDetector()))
89 if it == Const.PIDDetectors.c_set.end():
91 charged_stables = [Const.ChargedStable(Const.chargedStableSet.at(index))
for index
in range(Const.chargedStableSet.size())]
96 DataStorePrinter(
"EventMetaData", [
97 "getErrorFlag",
"getEvent",
"getRun",
"getSubrun",
"getExperiment",
98 "getProduction",
"getParentLfn",
"getGeneratedWeight",
"isEndOfRun"] +
99 ([
"getTime"]
if print_mutable
else []),
102 DataStorePrinter(
"Track", [
103 "getNumberOfFittedHypotheses",
"getQualityIndicator",
"isFlippedAndRefitted",
104 "getTrackTime",
"wasRefined"
106 "getTrackFitResult": charged_stables,
107 "getTrackFitResultWithClosestMass": charged_stables,
108 "getRelationsWith": [
"ECLClusters",
"KLMClusters",
"MCParticles",
"PIDLikelihoods"],
110 DataStorePrinter(
"V0", [
111 "getTracks",
"getTrackFitResults",
"getV0Hypothesis",
112 "getFittedVertexX",
"getFittedVertexY",
"getFittedVertexZ"
114 "getRelationsWith": [
"MCParticles"],
116 DataStorePrinter(
"Kinks", [
117 "getMotherTrackIndex",
"getDaughterTrackIndex",
"getTrackFitResultIndexMotherStart",
118 "getTrackFitResultIndexMotherEnd",
"getTrackFitResultIndexDaughter",
119 "getFittedVertexX",
"getFittedVertexY",
"getFittedVertexZ",
"getFilterFlag"
121 DataStorePrinter(
"TrackFitResult", [
122 "getPosition",
"getMomentum",
"get4Momentum",
"getEnergy",
"getTransverseMomentum",
123 "getCovariance6",
"getParticleType",
"getChargeSign",
"getPValue",
"getD0",
"getPhi0",
124 "getPhi",
"getOmega",
"getZ0",
"getTanLambda",
"getCotTheta",
125 "getTau",
"getCov",
"getCovariance5",
"getHitPatternCDC",
"getHitPatternVXD",
"getNDF",
"getChi2",
127 DataStorePrinter(
"EventLevelTrackingInfo", [
128 "getNCDCHitsNotAssigned",
"getNCDCHitsNotAssignedPostCleaning",
129 "getNCDCSegments",
"getSVDFirstSampleTime",
"hasAnErrorFlag",
130 "hasUnspecifiedTrackFindingFailure",
"hasVXDTF2AbortionFlag",
131 "hasSVDCKFAbortionFlag",
"hasPXDCKFAbortionFlag",
"hasSVDSpacePointCreatorAbortionFlag"], {
132 "hasCDCLayer": range(56)
134 DataStorePrinter(
"PIDLikelihood", [
"getMostLikely",
"isAvailable",
"areAllAvailable"],
137 "isAvailable": pid_detectors,
138 "areAllAvailable": pid_detectors,
139 "getLogL": charged_stables,
140 "getProbability": charged_stables,
141 "getLogarithmicProbability": charged_stables,
142 }
if print_mutable
else {}
144 DataStorePrinter(
"ECLCluster", [
145 "isTrack",
"isNeutral",
"getStatus",
"getConnectedRegionId",
146 "getClusterId",
"getUniqueClusterId",
"getMinTrkDistance",
"getDeltaL",
147 "getAbsZernike40",
"getAbsZernike51",
"getZernikeMVA",
"getE1oE9",
148 "getE9oE21",
"getNumberOfHadronDigits",
"getR",
"getHypotheses",
149 "getSecondMoment",
"getLAT",
"getNumberOfCrystals",
"getTime",
150 "getDeltaTime99",
"hasFailedFitTime",
"hasFailedTimeResolution",
"getPhi",
"getTheta",
151 "getEnergyRaw",
"getEnergyHighestCrystal",
"getUncertaintyEnergy",
152 "getUncertaintyTheta",
"getUncertaintyPhi",
"getClusterPosition",
153 "getCovarianceMatrix3x3",
"getDetectorRegion",
154 "isTriggerCluster",
"hasTriggerClusterMatching",
"hasPulseShapeDiscrimination",
155 "getPulseShapeDiscriminationMVA",
"getMaxECellId",
"getMinTrkDistanceID"
157 "getEnergy": [16, 32],
158 "hasHypothesis": [16, 32],
159 "getRelationsWith": [
"KlIds",
"MCParticles"],
161 DataStorePrinter(
"EventLevelClusteringInfo", [
162 "getNECLCalDigitsOutOfTimeFWD",
"getNECLCalDigitsOutOfTimeBarrel",
163 "getNECLCalDigitsOutOfTimeBWD",
"getNECLCalDigitsOutOfTime",
164 "getNECLShowersRejectedFWD",
"getNECLShowersRejectedBarrel",
165 "getNECLShowersRejectedBWD",
"getNECLShowersRejected",
166 "getNKLMDigitsMultiStripFWD",
"getNKLMDigitsMultiStripBarrel",
167 "getNKLMDigitsMultiStripBWD",
"getNKLMDigitsMultiStrip",
168 "getNECLShowersFWD",
"getNECLShowersBarrel",
169 "getNECLShowersBWD",
"getNECLShowers",
170 "getNECLLocalMaximumsFWD",
"getNECLLocalMaximumsBarrel",
171 "getNECLLocalMaximumsBWD",
"getNECLLocalMaximums",
172 "getNECLTriggerCellsFWD",
"getNECLTriggerCellsBarrel",
173 "getNECLTriggerCellsBWD",
"getNECLTriggerCells"
175 DataStorePrinter(
"KLMCluster", [
176 "getTime",
"getLayers",
"getInnermostLayer",
177 "getClusterPosition",
"getPosition",
"getMomentumMag",
"getEnergy",
178 "getMomentum",
"getError4x4",
"getError7x7",
179 "getAssociatedEclClusterFlag",
"getAssociatedTrackFlag",
180 "getClusterTrackRotationAngle",
"getClusterTrackSeparationAngle",
181 "getClusterTrackSeparation",
182 "getShapeStdDev1",
"getShapeStdDev2",
"getShapeStdDev3"
184 "getRelationsWith": [
"KlIds",
"MCParticles"],
186 DataStorePrinter(
"KlId", [
"isKLM",
"isECL",
"getKlId"]),
187 DataStorePrinter(
"TRGSummary", [
189 "getTimType",
"getTimQuality",
"isPoissonInInjectionVeto"
192 "getTRGSummary": range(10),
193 "getPreScale": [[int(i / 32), i % 32]
for i
in list(range(320))],
194 "getInputBits": range(10),
195 "getFtdlBits": range(10),
196 "getPsnmBits": range(10)
198 DataStorePrinter(
"SoftwareTriggerResult", [
"getResults",
"getNonPrescaledResults"], array=
False),
199 DataStorePrinter(
"MCParticle", [
200 "getPDG",
"getStatus",
"getMass",
"getCharge",
"getEnergy",
"hasValidVertex",
201 "getProductionTime",
"getDecayTime",
"getLifetime",
"getVertex",
202 "getProductionVertex",
"getMomentum",
"get4Vector",
"getDecayVertex",
203 "getIndex",
"getArrayIndex",
204 "getFirstDaughter",
"getLastDaughter",
"getDaughters",
"getNDaughters",
"getMother",
205 "getSecondaryPhysicsProcess",
"getSeenInDetector",
206 "isVirtual",
"isInitial",
"isPrimaryParticle",
"getName"
207 ], {
'getDaughter': [0],
'getParticleFromGeneralizedIndexString': [
'0:0']}),
208 DataStorePrinter(
"EventLevelTriggerTimeInfo", [
209 "isValid",
"hasInjection",
"isHER",
"isRevo2",
210 "getTimeSinceLastInjection",
"getTimeSincePrevTrigger",
"getBunchNumber",
211 "getTimeSinceLastInjectionInMicroSeconds",
"getTimeSincePrevTriggerInMicroSeconds",
212 "getTimeSinceInjectedBunch",
"getTimeSinceInjectedBunchInMicroSeconds",
"getTriggeredBunchNumberGlobal",
213 "hasEventT0SourceFromSVD",
"hasEventT0SourceFromCDC",
"hasEventT0SourceFromECL",
"hasAnyEventT0Sources",
217 path.add_module(PrintObjectsModule(mdst_dataobjects, print_untested))