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
import Belle2
78 from ROOT.Belle2
import Const
82 it = Const.PIDDetectors.c_set.begin()
84 pid_detectors.append(Const.PIDDetectorSet(it.getDetector()))
86 if it == Const.PIDDetectors.c_set.end():
88 charged_stables = [Const.ChargedStable(Const.chargedStableSet.at(index))
for index
in range(Const.chargedStableSet.size())]
93 DataStorePrinter(
"EventMetaData", [
94 "getErrorFlag",
"getEvent",
"getRun",
"getSubrun",
"getExperiment",
95 "getProduction",
"getTime",
"getParentLfn",
"getGeneratedWeight",
99 DataStorePrinter(
"Track", [
100 "getNumberOfFittedHypotheses",
"getQualityIndicator",
"isFlippedAndRefitted",
101 "getTrackTime",
"wasRefined"
103 "getTrackFitResult": charged_stables,
104 "getTrackFitResultWithClosestMass": charged_stables,
105 "getRelationsWith": [
"ECLClusters",
"KLMClusters",
"MCParticles",
"PIDLikelihoods"],
107 DataStorePrinter(
"V0", [
108 "getTracks",
"getTrackFitResults",
"getV0Hypothesis",
109 "getFittedVertexX",
"getFittedVertexY",
"getFittedVertexZ"
111 "getRelationsWith": [
"MCParticles"],
113 DataStorePrinter(
"Kinks", [
114 "getMotherTrackIndex",
"getDaughterTrackIndex",
"getTrackFitResultIndexMotherStart",
115 "getTrackFitResultIndexMotherEnd",
"getTrackFitResultIndexDaughter",
116 "getFittedVertexX",
"getFittedVertexY",
"getFittedVertexZ",
"getFilterFlag"
118 DataStorePrinter(
"TrackFitResult", [
119 "getPosition",
"getMomentum",
"get4Momentum",
"getEnergy",
"getTransverseMomentum",
120 "getCovariance6",
"getParticleType",
"getChargeSign",
"getPValue",
"getD0",
"getPhi0",
121 "getPhi",
"getOmega",
"getZ0",
"getTanLambda",
"getCotTheta",
122 "getTau",
"getCov",
"getCovariance5",
"getHitPatternCDC",
"getHitPatternVXD",
"getNDF",
"getChi2",
124 DataStorePrinter(
"EventLevelTrackingInfo", [
125 "getNCDCHitsNotAssigned",
"getNCDCHitsNotAssignedPostCleaning",
126 "getNCDCSegments",
"getSVDFirstSampleTime",
"hasAnErrorFlag",
127 "hasUnspecifiedTrackFindingFailure",
"hasVXDTF2AbortionFlag",
128 "hasSVDCKFAbortionFlag",
"hasPXDCKFAbortionFlag",
"hasSVDSpacePointCreatorAbortionFlag"], {
129 "hasCDCLayer": range(56)
131 DataStorePrinter(
"PIDLikelihood", [
"getMostLikely",
"isAvailable",
"areAllAvailable"], {
132 "isAvailable": pid_detectors,
133 "areAllAvailable": pid_detectors,
134 "getLogL": charged_stables,
135 "getProbability": charged_stables,
136 "getLogarithmicProbability": charged_stables,
138 DataStorePrinter(
"ECLCluster", [
139 "isTrack",
"isNeutral",
"getStatus",
"getConnectedRegionId",
140 "getClusterId",
"getUniqueClusterId",
"getMinTrkDistance",
"getDeltaL",
141 "getAbsZernike40",
"getAbsZernike51",
"getZernikeMVA",
"getE1oE9",
142 "getE9oE21",
"getNumberOfHadronDigits",
"getR",
"getHypotheses",
143 "getSecondMoment",
"getLAT",
"getNumberOfCrystals",
"getTime",
144 "getDeltaTime99",
"hasFailedFitTime",
"hasFailedTimeResolution",
"getPhi",
"getTheta",
145 "getEnergyRaw",
"getEnergyHighestCrystal",
"getUncertaintyEnergy",
146 "getUncertaintyTheta",
"getUncertaintyPhi",
"getClusterPosition",
147 "getCovarianceMatrix3x3",
"getDetectorRegion",
148 "isTriggerCluster",
"hasTriggerClusterMatching",
"hasPulseShapeDiscrimination",
149 "getPulseShapeDiscriminationMVA",
"getMaxECellId",
"getMinTrkDistanceID"
151 "getEnergy": [16, 32],
152 "hasHypothesis": [16, 32],
153 "getRelationsWith": [
"KlIds",
"MCParticles"],
155 DataStorePrinter(
"EventLevelClusteringInfo", [
156 "getNECLCalDigitsOutOfTimeFWD",
"getNECLCalDigitsOutOfTimeBarrel",
157 "getNECLCalDigitsOutOfTimeBWD",
"getNECLCalDigitsOutOfTime",
158 "getNECLShowersRejectedFWD",
"getNECLShowersRejectedBarrel",
159 "getNECLShowersRejectedBWD",
"getNECLShowersRejected",
160 "getNKLMDigitsMultiStripFWD",
"getNKLMDigitsMultiStripBarrel",
161 "getNKLMDigitsMultiStripBWD",
"getNKLMDigitsMultiStrip",
162 "getNECLShowersFWD",
"getNECLShowersBarrel",
163 "getNECLShowersBWD",
"getNECLShowers",
164 "getNECLLocalMaximumsFWD",
"getNECLLocalMaximumsBarrel",
165 "getNECLLocalMaximumsBWD",
"getNECLLocalMaximums",
166 "getNECLTriggerCellsFWD",
"getNECLTriggerCellsBarrel",
167 "getNECLTriggerCellsBWD",
"getNECLTriggerCells"
169 DataStorePrinter(
"KLMCluster", [
170 "getTime",
"getLayers",
"getInnermostLayer",
171 "getClusterPosition",
"getPosition",
"getMomentumMag",
"getEnergy",
172 "getMomentum",
"getError4x4",
"getError7x7",
173 "getAssociatedEclClusterFlag",
"getAssociatedTrackFlag",
175 "getRelationsWith": [
"KlIds",
"MCParticles"],
177 DataStorePrinter(
"KlId", [
"isKLM",
"isECL",
"getKlId"]),
178 DataStorePrinter(
"TRGSummary", [
180 "getTimType",
"getTimQuality",
"isPoissonInInjectionVeto"
183 "getTRGSummary": range(10),
184 "getPreScale": [[int(i / 32), i % 32]
for i
in list(range(320))],
185 "getInputBits": range(10),
186 "getFtdlBits": range(10),
187 "getPsnmBits": range(10)
189 DataStorePrinter(
"SoftwareTriggerResult", [
"getResults",
"getNonPrescaledResults"], array=
False),
190 DataStorePrinter(
"MCParticle", [
191 "getPDG",
"getStatus",
"getMass",
"getCharge",
"getEnergy",
"hasValidVertex",
192 "getProductionTime",
"getDecayTime",
"getLifetime",
"getVertex",
193 "getProductionVertex",
"getMomentum",
"get4Vector",
"getDecayVertex",
194 "getIndex",
"getArrayIndex",
195 "getFirstDaughter",
"getLastDaughter",
"getDaughters",
"getNDaughters",
"getMother",
196 "getSecondaryPhysicsProcess",
"getSeenInDetector",
197 "isVirtual",
"isInitial",
"isPrimaryParticle",
"getName"
198 ], {
'getDaughter': [0],
'getParticleFromGeneralizedIndexString': [
'0:0']}),
199 DataStorePrinter(
"EventLevelTriggerTimeInfo", [
200 "isValid",
"hasInjection",
"isHER",
"isRevo2",
201 "getTimeSinceLastInjection",
"getTimeSincePrevTrigger",
"getBunchNumber",
202 "getTimeSinceLastInjectionInMicroSeconds",
"getTimeSincePrevTriggerInMicroSeconds",
203 "getTimeSinceInjectedBunch",
"getTimeSinceInjectedBunchInMicroSeconds",
"getTriggeredBunchNumberGlobal"
206 path.add_module(PrintObjectsModule(mdst_dataobjects, print_untested))