38 std::vector<float> z_positions, r_positions;
46 if (!
fitRPC(*cand, m, b, z_positions, r_positions)) {
51 std::vector<const xAOD::MdtDriftCircle*> mdtHits;
55 std::vector<const xAOD::MdtDriftCircle*> biHits;
56 std::vector<const xAOD::MdtDriftCircle*> bmHits;
57 std::vector<const xAOD::MdtDriftCircle*> boHits;
65 const std::string st = idh.stationNameString(idh.stationName(
id));
67 if (st.rfind(
"BI", 0) == 0) {
69 }
else if (st.rfind(
"BM", 0) == 0) {
71 }
else if (st.rfind(
"BO", 0) == 0) {
78 int nStationsWithEnoughHits = 0;
79 if (biHits.size() >= 3) ++nStationsWithEnoughHits;
80 if (bmHits.size() >= 3) ++nStationsWithEnoughHits;
81 if (boHits.size() >= 3) ++nStationsWithEnoughHits;
83 if (nStationsWithEnoughHits < 2) {
84 ATH_MSG_DEBUG(
"Bad candidate: fewer than 2 stations with enough MDT hits");
91 std::vector<L0MDT::Segment> biSegmentsCSF;
92 std::vector<L0MDT::Segment> bmSegmentsCSF;
93 std::vector<L0MDT::Segment> boSegmentsCSF;
95 std::vector<L0MDT::Segment> biSegmentsLEG;
96 std::vector<L0MDT::Segment> bmSegmentsLEG;
97 std::vector<L0MDT::Segment> boSegmentsLEG;
100 if (biHits.size() >= 2) {
104 if (bmHits.size() >= 2) {
108 if (boHits.size() >= 2) {
115 <<
" BI=" << biSegmentsCSF.size()
116 <<
" BM=" << bmSegmentsCSF.size()
117 <<
" BO=" << boSegmentsCSF.size());
121 <<
" BI=" << biSegmentsLEG.size()
122 <<
" BM=" << bmSegmentsLEG.size()
123 <<
" BO=" << boSegmentsLEG.size());
125 const L0MDT::Segment* biSeg = biSegmentsCSF.empty() ? nullptr : &biSegmentsCSF.front();
126 const L0MDT::Segment* bmSeg = bmSegmentsCSF.empty() ? nullptr : &bmSegmentsCSF.front();
127 const L0MDT::Segment* boSeg = boSegmentsCSF.empty() ? nullptr : &boSegmentsCSF.front();
133 <<
"nStations=" << ptResult->nStations
134 <<
" pt=" << ptResult->pt
135 <<
" deltaBeta=" << ptResult->deltaBeta
136 <<
" sagitta=" << ptResult->sagitta
137 <<
" leverArm=" << ptResult->leverArm);
139 ATH_MSG_DEBUG(
"pT estimate not available for this candidate");
144 return StatusCode::SUCCESS;
150 float theta = 2.f * std::atan(std::exp(-cand.
eta()));
151 float tanTheta = std::tan(
theta);
156 for (
int i = 0; i < 4; ++i) {
157 const float z_pos = cand.
zPos(i);
158 z_positions.push_back(z_pos);
159 r_positions.push_back(z_pos * tanTheta);
162 size_t N = z_positions.size();
163 if (N < 1)
return false;
165 float sumZ=0, sumR=0, sumZZ=0, sumZR=0;
166 for (
size_t i=0;i<N;++i) {
167 sumZ += z_positions[i];
168 sumR += r_positions[i];
169 sumZZ += z_positions[i]*z_positions[i];
170 sumZR += z_positions[i]*r_positions[i];
174 float den = N*sumZZ - sumZ*sumZ;
176 m = (N*sumZR - sumZ*sumR) / den;
177 b = (sumR - m*sumZ) / N;
195 const float dEta = 0.01f, dPhi = 0.01f;
204 if (!regSel)
return StatusCode::FAILURE;
206 std::vector<IdentifierHash> hashList;
207 regSel->HashIDList(trigROI, hashList);
213 float windowSize = 5;
231 const Amg::Vector3D gpos = locToGlob* dc->localMeasurementPos() ;
233 if (std::abs(resZ) > windowSize * pitch)
continue;
241 return StatusCode::SUCCESS;
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
StatusCode collectMDTHits(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, float eta, float phi, std::vector< const xAOD::MdtDriftCircle * > &hits, float m, float b) const
Collect MDT hits within a RoI around (eta, phi), keeping only those whose residual from the RPC fit l...