Generate and assign the variables from the VXD-CDC object.
93{
94 const std::vector<TrackingUtilities::WithWeight<const CKFToSVDState*>>& previousStates = pair->first;
95 CKFToSVDState* state = pair->second;
96
97 const RecoTrack* cdcTrack = previousStates.front()->getSeed();
98 B2ASSERT("Path without seed?", cdcTrack);
99
100 const SpacePoint* spacePoint = state->
getHit();
101 B2ASSERT("Path without hit?", spacePoint);
102
103 std::vector<TrackingUtilities::WithWeight<const CKFToSVDState*>> allStates = previousStates;
104 allStates.emplace_back(state, 0);
105
107
108 var<
named(
"seed_cdc_hits")>() = cdcHits.size();
109 var<
named(
"seed_lowest_cdc_layer")>() = cdcHits.front()->getICLayer();
110
111 genfit::MeasuredStateOnPlane firstMeasurement;
114 } else {
115 B2ASSERT("Previous state was not fitted?", previousStates.back()->mSoPSet());
116 firstMeasurement = previousStates.back()->getMeasuredStateOnPlane();
117 }
118
119 const ROOT::Math::XYZVector position = ROOT::Math::XYZVector(firstMeasurement.getPos());
120 const ROOT::Math::XYZVector momentum = ROOT::Math::XYZVector(firstMeasurement.getMom());
121
122 const CDCTrajectory3D trajectory(position, 0, momentum, cdcTrack->
getChargeSeed());
123
124 const ROOT::Math::XYZVector& hitPosition = spacePoint->
getPosition();
125
126 const double arcLength = trajectory.calcArcLength2D(hitPosition);
127 const ROOT::Math::XYVector& trackPositionAtHit2D = trajectory.getTrajectory2D().getPos2DAtArcLength2D(arcLength);
128 const double trackPositionAtHitZ = trajectory.getTrajectorySZ().mapSToZ(arcLength);
129
130 ROOT::Math::XYZVector trackPositionAtHit(trackPositionAtHit2D.X(), trackPositionAtHit2D.Y(), trackPositionAtHitZ);
131
132 const auto calculateCharge = [](const auto & s) {
133 return s.getCharge();
134 };
135 const auto calculateSeedCharge = [](const auto & s) {
136 return s.getSeedCharge();
137 };
138 const auto calculateSize = [](const auto & s) {
139 return s.getSize();
140 };
141 const auto calculateSNR = [](const auto & s) {
142 return s.getSNR();
143 };
144 const auto calculateChargeSizeRatio = [](const auto & s) {
145 return s.getCharge() / s.getSize();
146 };
147
150
151 B2ASSERT("Must be related to exactly 2 clusters", clusters.size() == 2);
152 const SVDCluster* firstCluster = clusters[0];
153 const SVDCluster* secondCluster = clusters[1];
154
155 var<
named(
"cluster_1_charge")>() = calculateCharge(*firstCluster);
156 var<
named(
"cluster_2_charge")>() = calculateCharge(*secondCluster);
157 var<
named(
"mean_rest_cluster_charge")>() = meanOver(allStates, calculateCharge);
158 var<
named(
"min_rest_cluster_charge")>() = minOver(allStates, calculateCharge);
159 var<
named(
"std_rest_cluster_charge")>() = stdOver(allStates, calculateCharge);
160
161 var<
named(
"cluster_1_seed_charge")>() = calculateSeedCharge(*firstCluster);
162 var<
named(
"cluster_2_seed_charge")>() = calculateSeedCharge(*secondCluster);
163 var<
named(
"mean_rest_cluster_seed_charge")>() = meanOver(allStates, calculateSeedCharge);
164 var<
named(
"min_rest_cluster_seed_charge")>() = minOver(allStates, calculateSeedCharge);
165 var<
named(
"std_rest_cluster_seed_charge")>() = stdOver(allStates, calculateSeedCharge);
166
167 var<
named(
"cluster_1_size")>() = calculateSize(*firstCluster);
168 var<
named(
"cluster_2_size")>() = calculateSize(*secondCluster);
169 var<
named(
"mean_rest_cluster_size")>() = meanOver(allStates, calculateSize);
170 var<
named(
"min_rest_cluster_size")>() = minOver(allStates, calculateSize);
171 var<
named(
"std_rest_cluster_size")>() = stdOver(allStates, calculateSize);
172
173 var<
named(
"cluster_1_snr")>() = calculateSNR(*firstCluster);
174 var<
named(
"cluster_2_snr")>() = calculateSNR(*secondCluster);
175 var<
named(
"mean_rest_cluster_snr")>() = meanOver(allStates, calculateSNR);
176 var<
named(
"min_rest_cluster_snr")>() = minOver(allStates, calculateSNR);
177 var<
named(
"std_rest_cluster_snr")>() = stdOver(allStates, calculateSNR);
178
179 var<
named(
"cluster_1_charge_over_size")>() = calculateChargeSizeRatio(*firstCluster);
180 var<
named(
"cluster_2_charge_over_size")>() = calculateChargeSizeRatio(*secondCluster);
181 var<
named(
"mean_rest_cluster_charge_over_size")>() = meanOver(allStates, calculateChargeSizeRatio);
182 var<
named(
"min_rest_cluster_charge_over_size")>() = minOver(allStates, calculateChargeSizeRatio);
183 var<
named(
"std_rest_cluster_charge_over_size")>() = stdOver(allStates, calculateChargeSizeRatio);
184 }
185
186 std::vector<const SpacePoint*> spacePoints;
187 for (const CKFToSVDState* walkState : allStates) {
188 const SpacePoint* sp = walkState->getHit();
189 if (sp) {
190 spacePoints.push_back(sp);
191 }
192 }
193
194 if (spacePoints.size() >= 3) {
198 } else {
199 var<
named(
"quality_index_triplet")>() = 0;
200 var<
named(
"quality_index_circle")>() = 0;
201 var<
named(
"quality_index_helix")>() = 0;
202 }
203
204 return true;
205}
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlane() const
Get the mSoP if already set during extrapolation (or fitting)
const Hit * getHit() const
Return the SP this state is related to. May be nullptr.
bool mSoPSet() const
Is the mSoP already set? (= state was already extrapolated)
std::vector< Belle2::RecoTrack::UsedCDCHit * > getSortedCDCHitList() const
Return a sorted list of cdc hits. Sorted by the sortingParameter.
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
QualityEstimatorRiemannHelixFit m_qualityHelix
Instance of the Riemann helix-fit class.
QualityEstimatorTripletFit m_qualityTriplet
Instance of the triplet-fit class.
QualityEstimatorCircleFit m_qualityCircle
Instance of the circle-fit class.
Belle2::VXD::SensorInfoBase::SensorType getType() const
Return SensorType (PXD, SVD, ...) on which the SpacePoint lives.
const B2Vector3D & getPosition() const
return the position vector in global coordinates
static constexpr int named(const char *name)