ATLAS Offline Software
CombinatorialNSWSeedFinderAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
10 
17 
19 
20 #include <ranges>
21 #include <vector>
22 #include <unordered_set>
23 #include <nlohmann/json.hpp>
24 #include <format>
25 #include <fstream>
26 
27 
28 
29 namespace MuonR4 {
30 
31 constexpr unsigned int minLayers{4};
32 
35  ATH_CHECK(m_etaKey.initialize());
36  ATH_CHECK(m_writeKey.initialize());
37  ATH_CHECK(m_idHelperSvc.retrieve());
38  ATH_CHECK(m_visionTool.retrieve(DisableTool{m_visionTool.empty()}));
40 
41  if (!(m_idHelperSvc->hasMM() || m_idHelperSvc->hasSTGC())) {
42  ATH_MSG_ERROR("MM or STGC not part of initialized detector layout");
43  return StatusCode::FAILURE;
44  }
45 
46  return StatusCode::SUCCESS;
47 }
48 
50  const SpacePoint* testHit,
51  const Amg::Vector3D& dirEstUp,
52  const Amg::Vector3D& dirEstDn) const{
53 
54  const double planeOffSet = testHit->positionInChamber().dot(testHit->planeNormal());
55 
56  const Amg::Vector3D estPlaneArrivalUp = startPos+
57  Amg::intersect<3>(startPos, dirEstUp, testHit->planeNormal(), planeOffSet).value_or(0) * dirEstUp;
58  const Amg::Vector3D estPlaneArrivalDn = startPos +
59  Amg::intersect<3>(startPos, dirEstDn, testHit->planeNormal(), planeOffSet).value_or(0) * dirEstDn;
60 
61  switch (testHit->type()) {
63  const auto* prd = static_cast<const xAOD::MMCluster*>(testHit->primaryMeasurement());
64 
65  const double halfLength = prd->readoutElement()->stripLayer(prd->measurementHash()).design().stripLength(prd->channelNumber()) * 0.5;
67  const Amg::Vector3D leftEdge = testHit->positionInChamber() - halfLength * testHit->directionInChamber();
68  const Amg::Vector3D rightEdge = testHit->positionInChamber() + halfLength * testHit->directionInChamber();
69 
70  const bool below = estPlaneArrivalDn.y() > std::max(leftEdge.y(), rightEdge.y());
71  const bool above = estPlaneArrivalUp.y() < std::min(leftEdge.y(), rightEdge.y());
72  ATH_MSG_DEBUG("Hit " << m_idHelperSvc->toString(testHit->identify())
73  << (below || above ? " is outside the window" : " is inside the window"));
74 
75 
76  if(below) return HitWindow::tooLow;
77  if(above) return HitWindow::tooHigh;
78 
79  return HitWindow::inside;
80  }
81  default:
82  ATH_MSG_DEBUG("STGCs not implemented yet - I will do ");
83  break;
84  }
85  //return randmoly an outside hit for now
86  return HitWindow::tooHigh;
87 };
88 
90  const HitLayVec &combinatoricLayers) const {
91 
92 
93  HitLayVec seedHitsFromLayers{};
94  //try all the hits combinations from the layers for now (--rethink about optimized way)
95  unsigned int iterLay0{0}, iterLay1{0}, iterLay2{0}, iterLay3{0};
96  unsigned int startLay1{0}, startLay2{0}, startLay3{0};
97 
98  for( ; iterLay0 < combinatoricLayers[0].size() ; ++iterLay0){
99 
100  const SpacePoint* hit0 = combinatoricLayers[0][iterLay0];
102  const Amg::Vector3D initSeedDir{(beamSpot - hit0->positionInChamber()).unit()};
103  const Amg::Vector3D dirEstUp = Amg::dirFromAngles(initSeedDir.phi(), initSeedDir.theta() - m_windowTheta);
104  const Amg::Vector3D dirEstDn = Amg::dirFromAngles(initSeedDir.phi(), initSeedDir.theta() + m_windowTheta);
105 
106  ATH_MSG_VERBOSE("Reference hit: "<<m_idHelperSvc->toString(hit0->identify())
107  <<", position: "<<Amg::toString(hit0->positionInChamber())<<" seed dir: "<<Amg::toString(initSeedDir)
108  <<" seed plane"<<Amg::toString(beamSpot + Amg::intersect<3>(beamSpot, initSeedDir, hit0->planeNormal(),
109  hit0->planeNormal().dot(hit0->positionInChamber())).value_or(0.) * initSeedDir ));
111  for( iterLay1 = startLay1; iterLay1 < combinatoricLayers[1].size() ; ++iterLay1){
112  const SpacePoint* hit1 = combinatoricLayers[1][iterLay1];
113  const auto hit1InWindow = findHitInWindow(beamSpot, hit1, dirEstUp, dirEstDn);
114  // hit is above- hits are sorted in y so break the loops (we need 4 hits for the seed = no reason to check the others)
115  if(hit1InWindow == HitWindow::tooHigh) {
116  break;
117  }else if(hit1InWindow == HitWindow::tooLow){
118  startLay1=iterLay1;
119  continue;
120  }
121  for( iterLay2 = startLay2; iterLay2 < combinatoricLayers[2].size() ; ++iterLay2){
122  const SpacePoint* hit2 = combinatoricLayers[2][iterLay2];
123  const auto hit2InWindow = findHitInWindow(beamSpot, hit2, dirEstUp, dirEstDn);
124  if (hit2InWindow == HitWindow::tooHigh){
125  iterLay1 = combinatoricLayers[1].size();
126  break;
127  }else if(hit2InWindow == HitWindow::tooLow){
128  startLay2=iterLay2;
129  continue;
130  }
131  for( iterLay3 = startLay3; iterLay3 < combinatoricLayers[3].size(); ++iterLay3){
132  const SpacePoint* hit3 = combinatoricLayers[3][iterLay3];
133  const auto hit3InWindow = findHitInWindow(beamSpot, hit3, dirEstUp, dirEstDn);
134  if (hit3InWindow == HitWindow::tooHigh){
135  iterLay1 = combinatoricLayers[1].size();
136  iterLay2 = combinatoricLayers[2].size();
137  break;
138  }else if(hit3InWindow == HitWindow::tooLow){
139  startLay3=iterLay3;
140  continue;
141  }
142  seedHitsFromLayers.emplace_back(HitVec{hit0, hit1, hit2, hit3});
143  }
144  }
145  }
146  }
147  return seedHitsFromLayers;
148 }
149 
150 
152  const Amg::Vector3D &direction,
153  const HitLayVec& stripHitsLayers) const {
154 
155  //the hits we need to return to extend the segment seed
156  HitVec combinatoricHits;
157 
158  //the stripHitsLayers are already the unused ones - only use for the extension
159  for (unsigned int i = 0; i < stripHitsLayers.size(); i++) {
160 
161  double offset = stripHitsLayers[i].front()->positionInChamber().dot(stripHitsLayers[i].front()->planeNormal());
162  const Amg::Vector3D extrapPos = startPos + Amg::intersect<3>(startPos, direction, stripHitsLayers[i].front()->planeNormal(), offset).value_or(0) * direction;
163 
164  unsigned int indexOfHit = stripHitsLayers[i].size()+1;
165  unsigned int triedHit{0};
166  double minPull{std::numeric_limits<double>::max()};
167 
168  // loop over the hits on the same layer
169  for (unsigned int j = 0; j < stripHitsLayers[i].size(); j++) {
170  auto hit = stripHitsLayers[i].at(j);
171  double pull = std::sqrt(SegmentFitHelpers::chiSqTermStrip(extrapPos, direction, *hit, msg()));
172  ATH_MSG_VERBOSE("Trying extension with hit " << m_idHelperSvc->toString(hit->identify()));
173 
174  //find the hit with the minimum pull (check at least one hit after we have increasing pulls)
175  if (pull > minPull) {
176 
177  triedHit+=1;
178  continue;
179  }
180 
181  if(triedHit>1){
182  break;
183  }
184 
185  indexOfHit = j;
186  minPull = pull;
187  }
188 
189  // complete the seed with the extended hits
190  if (minPull < m_minPullThreshold) {
191  ATH_MSG_VERBOSE("Extension successfull - hit" << m_idHelperSvc->toString(stripHitsLayers[i].at(indexOfHit)->identify())<<", pos: "
192  <<Amg::toString(stripHitsLayers[i].at(indexOfHit)->positionInChamber())<<", dir: "<<Amg::toString(stripHitsLayers[i].at(indexOfHit)->directionInChamber())<<" found with pull "<<minPull);
193  combinatoricHits.push_back(stripHitsLayers[i].at(indexOfHit));
194  }
195  }
196  return combinatoricHits;
197 }
198 
199 std::unique_ptr<SegmentSeed>
201  const AmgSymMatrix(2)& bMatrix,
202  const HoughMaximum& max,
203  const HitLayVec& extensionLayers) const {
204  // we require at least four hits for the seeding
205  if (hits.size() != minLayers) {
206  ATH_MSG_VERBOSE("Seed Rejection: Wrong number of initial layers for seeding --they should be four");
207  return nullptr;
208  }
209 
210  std::array<double, 4> params = CombinatorialSeedSolver::defineParameters(bMatrix, hits);
211 
212  const auto [segPos, direction] = CombinatorialSeedSolver::seedSolution(hits, params);
213 
214  double tanPhi = houghTanPhi(direction);
215  double tanTheta = houghTanTheta(direction);
216 
217  double interceptX = segPos.x();
218  double interceptY = segPos.y();
219  // check the consistency of the parameters - expected to lay in the strip's
220  // length
221  for (std::size_t i = 0; i < 4; i++) {
222  const xAOD::UncalibratedMeasurement *primaryMeas = hits[i]->primaryMeasurement();
223 
224  if (primaryMeas->type() == xAOD::UncalibMeasType::MMClusterType) {
225  const auto *clust = static_cast<const xAOD::MMCluster *>(primaryMeas);
226 
227  double halfLength = 0.5 * clust->readoutElement()->stripLayer(clust->measurementHash()).design().stripLength(clust->channelNumber());
228 
229  if (std::abs(params[i]) > halfLength) {
230  ATH_MSG_VERBOSE("Seed Rejection: Invalid seed - outside of the strip's length");
231  return nullptr;
232  }
233  }
234  }
235 
236  // extend the seed to the segment -- include hits from the other layers too
237  auto extendedHits = extendHits(segPos, direction, extensionLayers);
238  hits.insert(hits.end(), extendedHits.begin(), extendedHits.end());
239  return std::make_unique<SegmentSeed>(tanTheta, interceptY, tanPhi,
240  interceptX, hits.size(),
241  std::move(hits), max.parentBucket());
242 }
243 
244 std::vector<std::unique_ptr<SegmentSeed>>
246  // first sort the hits per layer from the maximum
247  SpacePointPerLayerSplitter hitLayers{max.getHitsInMax()};
248 
249  HitLayVec stripHitsLayers{hitLayers.stripHits()};
250 
251  std::vector<std::unique_ptr<SegmentSeed>> seeds;
252 
253  unsigned int layerSize = stripHitsLayers.size();
254 
255  if (layerSize < minLayers) {
256  ATH_MSG_VERBOSE("Not enough layers to build a seed");
257  return seeds;
258  }
259 
260  if (m_visionTool.isEnabled()) {
262  const auto truthHits = getMatchingSimHits(max.getHitsInMax());
263  constexpr double legX{0.2};
264  double legY{0.8};
265  for (const SpacePoint* sp : max.getHitsInMax()) {
266  const auto* mmClust = static_cast<const xAOD::MMCluster*>(sp->primaryMeasurement());
267  const xAOD::MuonSimHit* simHit = getTruthMatchedHit(*mmClust);
268  if (!simHit || !MC::isMuon(simHit)) continue;
269  const MuonGMR4::MmReadoutElement* reEle = mmClust->readoutElement();
270  const MuonGMR4::StripDesign& design = reEle->stripLayer(mmClust->measurementHash()).design();
271  const Amg::Transform3D toChamb = reEle->msSector()->globalToLocalTrans(gctx) *
272  reEle->localToGlobalTrans(gctx, simHit->identify());
273  const Amg::Vector3D hitPos = toChamb * xAOD::toEigen(simHit->localPosition());
274  const Amg::Vector3D hitDir = toChamb.linear() * xAOD::toEigen(simHit->localDirection());
275 
276  const double pull = std::sqrt(SegmentFitHelpers::chiSqTermStrip(hitPos,hitDir, *sp, msgStream()));
277  const double pull2 = (mmClust->localPosition<1>().x() - simHit->localPosition().x()) / std::sqrt(mmClust->localCovariance<1>().x());
278  primitives.push_back(MuonValR4::drawLabel(std::format("ml: {:1d}, gap: {:1d}, {:}, pull: {:.2f} / {:.2f}", reEle->multilayer(), mmClust->gasGap(),
279  !design.hasStereoAngle() ? "X" : design.stereoAngle() >0 ? "U": "V",pull, pull2),legX,legY,14));
280  legY-=0.05;
281  }
282  m_visionTool->visualizeBucket(Gaudi::Hive::currentContext(), *max.parentBucket(),
283  "truth", std::move(primitives));
284  }
285 
286  const Amg::Transform3D globToLocal = max.msSector()->globalToLocalTrans(gctx);
287  std::array<const SpacePoint*, 4> seedHits{};
288  for (std::size_t i = 0; i < layerSize - 3; ++i) {
289  seedHits[0] = stripHitsLayers[i].front();
290  for (std::size_t j = i + 1; j < layerSize - 2; ++j) {
291  seedHits[1] = stripHitsLayers[j].front();
292  for (std::size_t k = j + 1; k < layerSize - 1; ++k) {
293  seedHits[2] = stripHitsLayers[k].front();
294  for (std::size_t l = k + 1; l < layerSize; ++l) {
295  seedHits[3] = stripHitsLayers[l].front();
296  AmgSymMatrix(2) bMatrix = CombinatorialSeedSolver::betaMatrix(seedHits);
297  if (std::abs(bMatrix.determinant()) < 1.e-6) {
298 
299  continue;
300  }
301 
302  const HitLayVec layers{stripHitsLayers[i], stripHitsLayers[j], stripHitsLayers[k], stripHitsLayers[l]};
303 
304 
305  // each layer may have more than one hit - take the hit combinations
306  HitLayVec result = findCombinatoricHits(globToLocal.translation(), layers);
307 
308  //the layers not participated in the seed build - gonna be used for the extension
309  HitLayVec extensionLayers;
310  std::copy_if(stripHitsLayers.begin(), stripHitsLayers.end(), std::back_inserter(extensionLayers),
311  [&layers,this](const HitVec& stripLayer){
312  const Identifier gasGapId = m_idHelperSvc->gasGapId(stripLayer.front()->identify());
313  return std::ranges::find_if(layers,[&gasGapId, this](const HitVec& spacePoints){
314  return gasGapId == m_idHelperSvc->gasGapId(spacePoints.front()->identify());
315  }) == layers.end();
316  });
317 
318  // we have made sure to have hits from all the four layers -
319  // start by 4 hits for the seed and try to build the seed for the combinatorics found
320  for (auto &combinatoricHits : result) {
321  auto seed = buildSegmentSeed(combinatoricHits, bMatrix, max, extensionLayers);
322  if (seed) {
323  seeds.push_back(std::move(seed));
324 
325  }
326  }
327 
328  }
329  }
330  }
331  }
332 
333  return seeds;
334 }
335 
336 StatusCode CombinatorialNSWSeedFinderAlg::execute(const EventContext &ctx) const {
337  // read the inputs
338  const EtaHoughMaxContainer *maxima{nullptr};
339  ATH_CHECK(SG::get( maxima, m_etaKey, ctx));
340 
341  const ActsGeometryContext *gctx{nullptr};
342  ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
343 
344  // prepare our output collection
345  SG::WriteHandle writeMaxima{m_writeKey, ctx};
346  ATH_CHECK(writeMaxima.record(std::make_unique<SegmentSeedContainer>()));
347 
348  // we use the information from the previous eta-hough transform
349  // to get the combined hits that belong in the same maxima
350  for (const HoughMaximum *max : *maxima) {
351  std::vector<std::unique_ptr<SegmentSeed>> seeds = findSeedsFromMaximum(*max, *gctx);
352 
353  for(const auto& hitMax : max->getHitsInMax()){
354  ATH_MSG_VERBOSE("Hit "<<m_idHelperSvc->toString(hitMax->identify())<<", "
355  <<Amg::toString(hitMax->positionInChamber())<<", dir: "<<Amg::toString(hitMax->directionInChamber()));
356  }
357 
358  for (auto &seed : seeds) {
359  ATH_MSG_VERBOSE("Seed tanTheta = "<<seed->tanTheta()<<", y0 = "<<seed->interceptY()
360  <<", tanPhi = "<<seed->tanPhi()<<", x0 = "<<seed->interceptX()<<", hits in the seed "<<seed->getHitsInMax().size());
361 
362  for(const auto& hit : seed->getHitsInMax()){
363  ATH_MSG_VERBOSE("Hit "<<m_idHelperSvc->toString(hit->identify())<<", "
364  <<Amg::toString(hit->positionInChamber())<<", dir: "<<Amg::toString(hit->directionInChamber()));
365  }
366  if (m_visionTool.isEnabled()) {
367  m_visionTool->visualizeSeed(ctx, *seed, "#phi-combinatorialSeed");
368  }
369  writeMaxima->push_back(std::move(seed));
370  }
371  }
372 
373 
374  return StatusCode::SUCCESS;
375 }
376 
377 } // namespace MuonR4
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MuonR4::minLayers
constexpr unsigned int minLayers
Definition: CombinatorialNSWSeedFinderAlg.cxx:31
UncalibratedMeasurement.h
MuonSimHitHelpers.h
xAOD::MuonSimHit_v1
Definition: MuonSimHit_v1.h:18
MuonR4::CombinatorialNSWSeedFinderAlg::findHitInWindow
HitWindow findHitInWindow(const Amg::Vector3D &startPos, const SpacePoint *testHit, const Amg::Vector3D &dirEstUp, const Amg::Vector3D &dirEstDn) const
Definition: CombinatorialNSWSeedFinderAlg.cxx:49
MuonGMR4::StripDesign::stereoAngle
double stereoAngle() const
Returns the value of the stereo angle.
MuonGMR4::MmReadoutElement
Definition: MmReadoutElement.h:19
MuonGMR4::StripDesign
Definition: StripDesign.h:30
MuonR4::SpacePoint::type
xAOD::UncalibMeasType type() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:131
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
get_generator_info.result
result
Definition: get_generator_info.py:21
MuonGMR4::MuonReadoutElement::msSector
const SpectrometerSector * msSector() const
Returns the pointer to the envelope volume enclosing all chambers in the sector.
MuonR4::SpacePointPerLayerSplitter
The SpacePointPerLayerSplitter takes a set of spacepoints already sorted by layer Identifier (see Muo...
Definition: SpacePointPerLayerSplitter.h:16
xAOD::MuonSimHit_v1::identify
Identifier identify() const
Returns the global ATLAS identifier of the SimHit.
Definition: xAODMuonSimHit_V1.cxx:42
vtune_athena.format
format
Definition: vtune_athena.py:14
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
MuonR4::CombinatorialNSWSeedFinderAlg::initialize
virtual StatusCode initialize() override
Definition: CombinatorialNSWSeedFinderAlg.cxx:33
MuonR4::CombinatorialNSWSeedFinderAlg::findCombinatoricHits
HitLayVec findCombinatoricHits(const Amg::Vector3D &beamSpot, const HitLayVec &combinatoricLayers) const
Definition: CombinatorialNSWSeedFinderAlg.cxx:89
VisualizationHelpers.h
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
MuonR4::SpacePoint::planeNormal
Amg::Vector3D planeNormal() const
Returns the vector pointing out of the measurement plane.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:128
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
xAOD::MMCluster_v1::readoutElement
const MuonGMR4::MmReadoutElement * readoutElement() const
Retrieve the associated MmReadoutElement.
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
MuonR4::HitWindow::tooLow
@ tooLow
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonR4::CombinatorialNSWSeedFinderAlg::m_visionTool
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
Definition: CombinatorialNSWSeedFinderAlg.h:89
x
#define x
MuonValR4::drawLabel
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
Create a TLatex label,.
Definition: VisualizationHelpers.cxx:32
MuonR4::CombinatorialNSWSeedFinderAlg::extendHits
HitVec extendHits(const Amg::Vector3D &startPos, const Amg::Vector3D &direction, const HitLayVec &stripHitsLayers) const
Definition: CombinatorialNSWSeedFinderAlg.cxx:151
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
MuonR4::SpacePoint::primaryMeasurement
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:107
MuonR4::houghTanPhi
double houghTanPhi(const Amg::Vector3D &v)
: Returns the hough tanPhi [x] / [z]
Definition: SegmentFitterEventData.cxx:18
MuonR4::SegmentFitHelpers::chiSqTermStrip
double chiSqTermStrip(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &measurement, MsgStream &msg)
Calculates the chi2 contribuation to a linear segment line from an uncalibrated strip measurement.
Definition: SegmentFitHelperFunctions.cxx:76
SpacePointPerLayerSplitter.h
MuonR4::CombinatorialNSWSeedFinderAlg::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: CombinatorialNSWSeedFinderAlg.h:55
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonGMR4::MmReadoutElement::multilayer
int multilayer() const
Returns the multi layer of the element [1-2].
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SegmentFitHelperFunctions.h
MuonGMR4::SpectrometerSector::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
Definition: SpectrometerSector.cxx:54
MuonR4::HitWindow
HitWindow
Definition: CombinatorialNSWSeedFinderAlg.h:31
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonR4::CombinatorialNSWSeedFinderAlg::m_writeKey
SG::WriteHandleKey< SegmentSeedContainer > m_writeKey
Definition: CombinatorialNSWSeedFinderAlg.h:52
MuonR4::CombinatorialSeedSolver::seedSolution
requires acceptedContainer< spacePointContainer > &&hasPointerValues< spacePointContainer > std::pair< Amg::Vector3D, Amg::Vector3D > seedSolution(const spacePointContainer &spacePoints, const std::array< double, 4 > &parameters)
solves the equation system to calculate the seed
Definition: CombinatorialSeedSolver.h:127
MmIdHelper.h
AnalysisUtils::copy_if
Out copy_if(In first, const In &last, Out res, const Pred &p)
Definition: IFilterUtils.h:30
python.StandardJetMods.pull
pull
Definition: StandardJetMods.py:298
xAOD::MuonSimHit_v1::localDirection
ConstVectorMap< 3 > localDirection() const
Returns the local direction of the traversing particle.
Definition: xAODMuonSimHit_V1.cxx:66
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonR4::SpacePoint
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:18
MuonGMR4::MmReadoutElement::stripLayer
const StripLayer & stripLayer(const Identifier &measId) const
MuonR4::SpacePoint::directionInChamber
const Amg::Vector3D & directionInChamber() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:122
MuonR4::CombinatorialNSWSeedFinderAlg::m_windowTheta
DoubleProperty m_windowTheta
Definition: CombinatorialNSWSeedFinderAlg.h:83
MuonValR4::IPatternVisualizationTool::PrimitiveVec
std::vector< PrimitivePtr > PrimitiveVec
Definition: IPatternVisualizationTool.h:31
CombinatorialNSWSeedFinderAlg.h
MuonR4::HitWindow::inside
@ inside
MuonR4::HitVec
SpacePointPerLayerSplitter::HitVec HitVec
Definition: SpacePointPerLayerSplitter.cxx:11
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonR4::CombinatorialNSWSeedFinderAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CombinatorialNSWSeedFinderAlg.h:58
MuonR4::CombinatorialNSWSeedFinderAlg::m_etaKey
SG::ReadHandleKey< EtaHoughMaxContainer > m_etaKey
Definition: CombinatorialNSWSeedFinderAlg.h:49
MuonGMR4::StripLayer::design
const StripDesign & design() const
Returns the underlying strip design.
Amg::dirFromAngles
Amg::Vector3D dirFromAngles(const double phi, const double theta)
Constructs a direction vector from the azimuthal & polar angles.
Definition: GeoPrimitivesHelpers.h:299
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
MuonR4::SpacePoint::positionInChamber
const Amg::Vector3D & positionInChamber() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:119
MuonR4::HoughMaximum
Data class to represent an eta maximum in hough space.
Definition: HoughMaximum.h:14
SegmentFitterEventData.h
MuonR4::CombinatorialSeedSolver::defineParameters
requires acceptedContainer< spacePointContainer > &&hasPointerValues< spacePointContainer > std::array< double, 4 > defineParameters(AmgSymMatrix(2) betaMatrix, const spacePointContainer &spacePoints)
calculates the parameters lamda,alpha,gamma,kappa of the system
Definition: CombinatorialSeedSolver.h:97
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:21
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
MuonR4::CombinatorialNSWSeedFinderAlg::buildSegmentSeed
std::unique_ptr< SegmentSeed > buildSegmentSeed(HitVec &hits, const AmgSymMatrix(2)&bMatrix, const HoughMaximum &max, const HitLayVec &extensionLayers) const
Definition: CombinatorialNSWSeedFinderAlg.cxx:200
xAOD::MuonSimHit_v1::localPosition
ConstVectorMap< 3 > localPosition() const
Returns the local postion of the traversing particle.
Definition: xAODMuonSimHit_V1.cxx:60
MuonR4::CombinatorialNSWSeedFinderAlg::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition: CombinatorialNSWSeedFinderAlg.h:61
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
MuonGMR4::MuonReadoutElement::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:81
MuonR4::getTruthMatchedHit
const xAOD::MuonSimHit * getTruthMatchedHit(const xAOD::UncalibratedMeasurement &prdHit)
Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement.
Definition: MuonSimHitHelpers.cxx:16
MMCluster.h
python.BuildSignatureFlags.beamSpot
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:455
MuonGMR4::StripDesign::hasStereoAngle
bool hasStereoAngle() const
Returns whether a stereo angle is defined.
CombinatorialSeedSolver.h
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
MuonR4::HitWindow::tooHigh
@ tooHigh
MuonR4::AmgSymMatrix
const AmgSymMatrix(2) &SpacePoint
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:150
MuonR4::houghTanTheta
double houghTanTheta(const Amg::Vector3D &v)
Returns the hough tanTheta [y] / [z].
Definition: SegmentFitterEventData.cxx:14
MuonR4::CombinatorialNSWSeedFinderAlg::findSeedsFromMaximum
std::vector< std::unique_ptr< SegmentSeed > > findSeedsFromMaximum(const HoughMaximum &max, const ActsGeometryContext &gctx) const
Definition: CombinatorialNSWSeedFinderAlg.cxx:245
MuonR4::getMatchingSimHits
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
Definition: MuonSimHitHelpers.cxx:27
HepMCHelpers.h
MuonR4::SpacePoint::identify
const Identifier & identify() const
: Identifier of the primary measurement
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:140
MuonR4::HitLayVec
SpacePointPerLayerSplitter::HitLayVec HitLayVec
Definition: CombinatorialNSWSeedFinderAlg.h:28
fitman.k
k
Definition: fitman.py:528
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:194
MuonR4::CombinatorialNSWSeedFinderAlg::m_minPullThreshold
DoubleProperty m_minPullThreshold
Definition: CombinatorialNSWSeedFinderAlg.h:86