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 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",
180 "getRelationsWith": [
"KlIds",
"MCParticles"],
182 DataStorePrinter(
"KlId", [
"isKLM",
"isECL",
"getKlId"]),
183 DataStorePrinter(
"TRGSummary", [
185 "getTimType",
"getTimQuality",
"isPoissonInInjectionVeto"
188 "getTRGSummary": range(10),
189 "getPreScale": [[int(i / 32), i % 32]
for i
in list(range(320))],
190 "getInputBits": range(10),
191 "getFtdlBits": range(10),
192 "getPsnmBits": range(10)
194 DataStorePrinter(
"SoftwareTriggerResult", [
"getResults",
"getNonPrescaledResults"], array=
False),
195 DataStorePrinter(
"MCParticle", [
196 "getPDG",
"getStatus",
"getMass",
"getCharge",
"getEnergy",
"hasValidVertex",
197 "getProductionTime",
"getDecayTime",
"getLifetime",
"getVertex",
198 "getProductionVertex",
"getMomentum",
"get4Vector",
"getDecayVertex",
199 "getIndex",
"getArrayIndex",
200 "getFirstDaughter",
"getLastDaughter",
"getDaughters",
"getNDaughters",
"getMother",
201 "getSecondaryPhysicsProcess",
"getSeenInDetector",
202 "isVirtual",
"isInitial",
"isPrimaryParticle",
"getName"
203 ], {
'getDaughter': [0],
'getParticleFromGeneralizedIndexString': [
'0:0']}),
204 DataStorePrinter(
"EventLevelTriggerTimeInfo", [
205 "isValid",
"hasInjection",
"isHER",
"isRevo2",
206 "getTimeSinceLastInjection",
"getTimeSincePrevTrigger",
"getBunchNumber",
207 "getTimeSinceLastInjectionInMicroSeconds",
"getTimeSincePrevTriggerInMicroSeconds",
208 "getTimeSinceInjectedBunch",
"getTimeSinceInjectedBunchInMicroSeconds",
"getTriggeredBunchNumberGlobal"
211 path.add_module(PrintObjectsModule(mdst_dataobjects, print_untested))