ATLAS Offline Software
Loading...
Searching...
No Matches
Csc4dSegmentMaker.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "Csc4dSegmentMaker.h"
6
7#include <sstream>
8
23#include "TrkRoad/TrackRoad.h"
24#include "TrkSegment/Segment.h"
27
31
33
37
40
41//******************************************************************************
42
43Csc4dSegmentMaker::Csc4dSegmentMaker(const std::string& type, const std::string& aname, const IInterface* parent) :
44 AthAlgTool(type, aname, parent) {
45 declareInterface<ICscSegmentFinder>(this);
46}
47
48//******************************************************************************
49
50// Destructor.
51
53
54//******************************************************************************
55
57 ATH_MSG_DEBUG("Initializing");
58
59 // Show keys.
60 ATH_MSG_DEBUG(" Max chi-square: " << m_max_chisquare);
61 ATH_MSG_DEBUG(" Max r slope: " << m_max_slope_r);
62 ATH_MSG_DEBUG(" Max phi slope: " << m_max_slope_phi);
63 ATH_MSG_DEBUG(" Max segments/chamber: " << m_max_seg_per_chamber);
64 ATH_MSG_DEBUG(" SegmentTool: " << m_segmentTool.typeAndName());
65
66 ATH_CHECK(m_segmentTool.retrieve());
67 ATH_CHECK(m_printer.retrieve());
68
69 return StatusCode::SUCCESS;
70}
71
72//******************************************************************************
73
74std::unique_ptr<MuonSegmentCombinationCollection> Csc4dSegmentMaker::find(const MuonSegmentCombinationCollection& segcols,
75 const EventContext& ctx) const {
76 // Set dump flag.
77
78 std::unique_ptr<MuonSegmentCombinationCollection> pcols = std::make_unique<MuonSegmentCombinationCollection>();
79 if (segcols.empty()) { return nullptr; }
80
81 for (MuonSegmentCombinationCollection::const_iterator icom = segcols.begin(); icom != segcols.end(); ++icom) {
82 const MuonSegmentCombination& insegs = **icom;
83
84 int nsta = insegs.numberOfStations();
85 if (nsta != 2) { // This can be happened if segment is not made at all in case of two hit layers !!
86 // NOW, 2d segment is not made....
87 // ATH_MSG_FATAL ( " Combination has " << nsta << " stations where 2 are expected" );
88 return pcols;
89 }
90
91 ATH_MSG_DEBUG("Csc4dSegmentMaker called get4dMuonSegmentCombination");
92
93 MuonSegmentCombination* pcol = m_segmentTool->get4dMuonSegmentCombination(&insegs, ctx);
94 if (pcol) {
95 pcols->push_back(pcol);
96 ATH_MSG_DEBUG("Found 4d CSC segment " << std::endl << m_printer->print(*pcol));
97 }
98 }
99
100 ATH_MSG_DEBUG(" Created " << pcols->size() << " 4D segments.");
101 return pcols;
102}
103
104// dummy ICscSegmentFinder interface
105std::unique_ptr<MuonSegmentCombinationCollection> Csc4dSegmentMaker::find(const std::vector<const Muon::CscPrepDataCollection*>&,
106 const EventContext&) const {
107 return nullptr;
108}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
DataVector< Muon::MuonSegmentCombination > MuonSegmentCombinationCollection
This typedef represents a collection of MuonSegmentCombination objects.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Property< double > m_max_slope_phi
Csc4dSegmentMaker(const std::string &, const std::string &, const IInterface *)
Gaudi::Property< double > m_max_chisquare
std::unique_ptr< MuonSegmentCombinationCollection > find(const MuonSegmentCombinationCollection &, const EventContext &ctx) const override
Gaudi::Property< double > m_max_slope_r
StatusCode initialize() override
virtual ~Csc4dSegmentMaker()
Gaudi::Property< double > m_max_seg_per_chamber
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
ToolHandle< ICscSegmentUtilTool > m_segmentTool
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
bool empty() const noexcept
Returns true if the collection is empty.
Class to represent the calibrated clusters created from CSC strips.
Class representing clusters from the CSC.
Definition CscPrepData.h:39
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Base class for Muon cluster RIO_OnTracks.
Class to hold a set of MuonSegments belonging together.
unsigned int numberOfStations() const
Number of stations with segment.
This is the common class for 3D segments used in the muon spectrometer.
MuonPrepDataCollection< CscPrepData > CscPrepDataCollection
MuonPrepDataContainerT< CscPrepData > CscPrepDataContainer