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):
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 """
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(
"Kinks", [
113 "getMotherTrackIndex",
"getDaughterTrackIndex",
"getTrackFitResultIndexMotherStart",
114 "getTrackFitResultIndexMotherEnd",
"getTrackFitResultIndexDaughter",
115 "getFittedVertexX",
"getFittedVertexY",
"getFittedVertexZ",
"getFilterFlag"
117 DataStorePrinter(
"TrackFitResult", [
118 "getPosition",
"getMomentum",
"get4Momentum",
"getEnergy",
"getTransverseMomentum",
119 "getCovariance6",
"getParticleType",
"getChargeSign",
"getPValue",
"getD0",
"getPhi0",
120 "getPhi",
"getOmega",
"getZ0",
"getTanLambda",
"getCotTheta",
121 "getTau",
"getCov",
"getCovariance5",
"getHitPatternCDC",
"getHitPatternVXD",
"getNDF",
"getChi2",
123 DataStorePrinter(
"EventLevelTrackingInfo", [
124 "getNCDCHitsNotAssigned",
"getNCDCHitsNotAssignedPostCleaning",
125 "getNCDCSegments",
"getSVDFirstSampleTime",
"hasAnErrorFlag",
126 "hasUnspecifiedTrackFindingFailure",
"hasVXDTF2AbortionFlag",
127 "hasSVDCKFAbortionFlag",
"hasPXDCKFAbortionFlag",
"hasSVDSpacePointCreatorAbortionFlag"], {
128 "hasCDCLayer": range(56)
130 DataStorePrinter(
"PIDLikelihood", [
"getMostLikely",
"isAvailable",
"areAllAvailable"], {
131 "isAvailable": pid_detectors,
132 "areAllAvailable": pid_detectors,
133 "getLogL": charged_stables,
134 "getProbability": charged_stables,
135 "getLogarithmicProbability": charged_stables,
137 DataStorePrinter(
"ECLCluster", [
138 "isTrack",
"isNeutral",
"getStatus",
"getConnectedRegionId",
139 "getClusterId",
"getUniqueClusterId",
"getMinTrkDistance",
"getDeltaL",
140 "getAbsZernike40",
"getAbsZernike51",
"getZernikeMVA",
"getE1oE9",
141 "getE9oE21",
"getNumberOfHadronDigits",
"getR",
"getHypotheses",
142 "getSecondMoment",
"getLAT",
"getNumberOfCrystals",
"getTime",
143 "getDeltaTime99",
"hasFailedFitTime",
"hasFailedTimeResolution",
"getPhi",
"getTheta",
144 "getEnergyRaw",
"getEnergyHighestCrystal",
"getUncertaintyEnergy",
145 "getUncertaintyTheta",
"getUncertaintyPhi",
"getClusterPosition",
146 "getCovarianceMatrix3x3",
"getDetectorRegion",
147 "isTriggerCluster",
"hasTriggerClusterMatching",
"hasPulseShapeDiscrimination",
148 "getPulseShapeDiscriminationMVA",
"getMaxECellId",
"getMinTrkDistanceID"
150 "getEnergy": [16, 32],
151 "hasHypothesis": [16, 32],
152 "getRelationsWith": [
"KlIds",
"MCParticles"],
154 DataStorePrinter(
"EventLevelClusteringInfo", [
155 "getNECLCalDigitsOutOfTimeFWD",
"getNECLCalDigitsOutOfTimeBarrel",
156 "getNECLCalDigitsOutOfTimeBWD",
"getNECLCalDigitsOutOfTime",
157 "getNECLShowersRejectedFWD",
"getNECLShowersRejectedBarrel",
158 "getNECLShowersRejectedBWD",
"getNECLShowersRejected",
159 "getNKLMDigitsMultiStripFWD",
"getNKLMDigitsMultiStripBarrel",
160 "getNKLMDigitsMultiStripBWD",
"getNKLMDigitsMultiStrip",
161 "getNECLShowersFWD",
"getNECLShowersBarrel",
162 "getNECLShowersBWD",
"getNECLShowers",
163 "getNECLLocalMaximumsFWD",
"getNECLLocalMaximumsBarrel",
164 "getNECLLocalMaximumsBWD",
"getNECLLocalMaximums",
165 "getNECLTriggerCellsFWD",
"getNECLTriggerCellsBarrel",
166 "getNECLTriggerCellsBWD",
"getNECLTriggerCells"
168 DataStorePrinter(
"KLMCluster", [
169 "getTime",
"getLayers",
"getInnermostLayer",
170 "getClusterPosition",
"getPosition",
"getMomentumMag",
"getEnergy",
171 "getMomentum",
"getError4x4",
"getError7x7",
172 "getAssociatedEclClusterFlag",
"getAssociatedTrackFlag",
174 "getRelationsWith": [
"KlIds",
"MCParticles"],
176 DataStorePrinter(
"KlId", [
"isKLM",
"isECL",
"getKlId"]),
177 DataStorePrinter(
"TRGSummary", [
179 "getTimType",
"getTimQuality",
"isPoissonInInjectionVeto"
182 "getTRGSummary": range(10),
183 "getPreScale": [[int(i / 32), i % 32]
for i
in list(range(320))],
184 "getInputBits": range(10),
185 "getFtdlBits": range(10),
186 "getPsnmBits": range(10)
188 DataStorePrinter(
"SoftwareTriggerResult", [
"getResults",
"getNonPrescaledResults"], array=
False),
189 DataStorePrinter(
"MCParticle", [
190 "getPDG",
"getStatus",
"getMass",
"getCharge",
"getEnergy",
"hasValidVertex",
191 "getProductionTime",
"getDecayTime",
"getLifetime",
"getVertex",
192 "getProductionVertex",
"getMomentum",
"get4Vector",
"getDecayVertex",
193 "getIndex",
"getArrayIndex",
194 "getFirstDaughter",
"getLastDaughter",
"getDaughters",
"getNDaughters",
"getMother",
195 "getSecondaryPhysicsProcess",
"getSeenInDetector",
196 "isVirtual",
"isInitial",
"isPrimaryParticle",
"getName"
197 ], {
'getDaughter': [0],
'getParticleFromGeneralizedIndexString': [
'0:0']}),
198 DataStorePrinter(
"EventLevelTriggerTimeInfo", [
199 "isValid",
"hasInjection",
"isHER",
"isRevo2",
200 "getTimeSinceLastInjection",
"getTimeSincePrevTrigger",
"getBunchNumber",
201 "getTimeSinceLastInjectionInMicroSeconds",
"getTimeSincePrevTriggerInMicroSeconds",
202 "getTimeSinceInjectedBunch",
"getTimeSinceInjectedBunchInMicroSeconds",
"getTriggeredBunchNumberGlobal"
205 path.add_module(PrintObjectsModule(mdst_dataobjects, print_untested))