ATLAS Offline Software
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 
28 using Muon::CscPrepData;
31 
33 
35 using Muon::MuonSegment;
37 
40 
41 //******************************************************************************
42 
43 Csc4dSegmentMaker::Csc4dSegmentMaker(const std::string& type, const std::string& aname, const IInterface* 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 
74 std::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
105 std::unique_ptr<MuonSegmentCombinationCollection> Csc4dSegmentMaker::find(const std::vector<const Muon::CscPrepDataCollection*>&,
106  const EventContext&) const {
107  return nullptr;
108 }
TrapezoidBounds.h
Csc4dSegmentMaker::initialize
StatusCode initialize() override
Definition: Csc4dSegmentMaker.cxx:56
Muon::MuonSegmentCombination
Definition: MuonSegmentCombination.h:30
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
MuonEDMPrinterTool.h
EventPrimitivesHelpers.h
Csc4dSegmentMaker::m_printer
ToolHandle< Muon::MuonEDMPrinterTool > m_printer
Definition: Csc4dSegmentMaker.h:65
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
MdtDriftCircleOnTrack.h
Csc4dSegmentMaker::find
std::unique_ptr< MuonSegmentCombinationCollection > find(const MuonSegmentCombinationCollection &, const EventContext &ctx) const override
Definition: Csc4dSegmentMaker.cxx:74
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
Csc4dSegmentMaker::m_max_slope_phi
Gaudi::Property< double > m_max_slope_phi
Definition: Csc4dSegmentMaker.h:57
python.Dumpers.aname
string aname
Definition: Dumpers.py:5541
ICscClusterFitter.h
Csc4dSegmentMaker::m_max_seg_per_chamber
Gaudi::Property< double > m_max_seg_per_chamber
Definition: Csc4dSegmentMaker.h:58
Csc4dSegmentMaker.h
Muon::CscPrepData
Class representing clusters from the CSC.
Definition: CscPrepData.h:39
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Csc4dSegmentMaker::Csc4dSegmentMaker
Csc4dSegmentMaker(const std::string &, const std::string &, const IInterface *)
Definition: Csc4dSegmentMaker.cxx:43
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Segment.h
MuonSegmentCombinationCollection.h
CscClusterOnTrack.h
CscReadoutElement.h
Csc4dSegmentMaker::m_segmentTool
ToolHandle< ICscSegmentUtilTool > m_segmentTool
Definition: Csc4dSegmentMaker.h:60
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Muon::CscPrepDataContainer
MuonPrepDataContainerT< CscPrepData > CscPrepDataContainer
Definition: MuonPrepDataContainer.h:98
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DataVector< Muon::MuonSegmentCombination >
Muon::CscPrepDataCollection
MuonPrepDataCollection< CscPrepData > CscPrepDataCollection
Definition: MuonPrepDataCollection.h:109
CscPrepDataContainer.h
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
MuonDetectorManager.h
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Csc4dSegmentMaker::m_max_chisquare
Gaudi::Property< double > m_max_chisquare
Definition: Csc4dSegmentMaker.h:55
ICscSegmentUtilTool.h
Muon::CscClusterOnTrack
Class to represent the calibrated clusters created from CSC strips.
Definition: CscClusterOnTrack.h:47
PlaneSurface.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ICscStripFitter.h
MuonSegment.h
Csc4dSegmentMaker::~Csc4dSegmentMaker
virtual ~Csc4dSegmentMaker()
LocalDirection.h
AthAlgTool
Definition: AthAlgTool.h:26
FitQuality.h
Csc4dSegmentMaker::m_max_slope_r
Gaudi::Property< double > m_max_slope_r
Definition: Csc4dSegmentMaker.h:56
Muon::MuonSegmentCombination::numberOfStations
unsigned int numberOfStations() const
Number of stations with segment.
Definition: MuonSegmentCombination.h:108
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrackRoad.h
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
Muon::MuonClusterOnTrack
Base class for Muon cluster RIO_OnTracks.
Definition: MuonClusterOnTrack.h:34
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.