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