ATLAS Offline Software
CscSegmentMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGL2MUONSA_CSCSEGMENTMAKER_H
6 #define TRIGL2MUONSA_CSCSEGMENTMAKER_H
7 
8 
10 #include "GaudiKernel/ServiceHandle.h"
11 
16 
17 #include "TrackData.h"
18 #include "TgcFitResult.h"
19 #include "MuonRoad.h"
20 #include "CscData.h"
21 #include "CscRegUtils.h"
22 
23 #include <string>
24 #include <vector>
25 
26 namespace TrigL2MuonSA{
27 
28  class CscSegment;
29 
30  class CscSegmentMaker: public AthAlgTool{
31 
32 
33  public:
34 
35 
36  typedef struct{
37  double loc_x;
38  double loc_y;
39  double loc_z;
40  double error;
41  double residual;
42  int measphi;
43  bool enabled;
45  bool isIP;
46  } localCscHit;
47 
48  typedef struct{
49  double a;
50  double b;
51  double zshift;
52  double chi2;
53  int nhit;
55  double residual;
56  std::vector<localCscHit> localHits;
58 
59  public:
60  CscSegmentMaker(const std::string& type, const std::string &name, const IInterface* parent);
61 
62 
63  virtual StatusCode initialize() override;
64 
65 
67  std::vector<TrigL2MuonSA::TrackPattern> &v_trackPatterns,
68  const TrigL2MuonSA::TgcFitResult &tgcFitResult,
69  const TrigL2MuonSA::MuonRoad &muroad) const;
70 
71 
72  ReturnCode make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8], CscSegment &cscsegment, CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager* muDetMgr) const;
73 
74  ReturnCode make_2dsegment(int measphi, const localCscHit &ip_loc,const std::vector<localCscHit> hits_loc[4], local2dSegment &seg2d_eta,local2dSegment &local2d_noip, int &nhite) const;
75 
76  ReturnCode make_2dseg4hit(int measphi, const localCscHit &ip_loc,std::vector<localCscHit> hits_loc[4], std::vector<local2dSegment> &seg2d_4hitCollection, int &nhite) const;
77 
78  ReturnCode make_2dseg3hit(int measphi, const localCscHit &ip_loc, const std::vector<localCscHit> hits_loc[4], std::vector<local2dSegment> &seg2d_4hitCollection, int &nhit) const;
79  ReturnCode fit_clusters(int measphi, const std::vector<localCscHit> &hits_fit, local2dSegment &seg2d) const;
80 
81  ReturnCode make_4dsegment(const local2dSegment &seg2d_eta, const local2dSegment &seg2d_phi,
82  Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir) const;
83 
84  ReturnCode getModuleSP(int mod_hash[2], const TrigL2MuonSA::TgcFitResult &tgcFitResult, int phibin, const TrigL2MuonSA::MuonRoad &muroad, const int exist_clusters[32]) const;
85 
86  ReturnCode display_hits(const std::vector<localCscHit> localHits[4]) const;
87 
88  CscSegment segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscSegment *mu_seg) const;
89 
90  private:
92  ToolHandle<CscRegDict> m_cscregdict {
93  this, "CscRegDict", "TrigL2MuonSA::CscRegDict", ""};
94  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
95  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"};
96 
97  //properties
98  Gaudi::Property< bool > m_use_geometry {
99  this, "UseGeometry", false, ""};
100  Gaudi::Property< double > m_max_chisquare {
101  this, "max_chisquare", 25., ""};
102  Gaudi::Property< double > m_max_residual_eta {
103  this, "max_residual_eta", 100., ""};
104  Gaudi::Property< double > m_max_residual_phi {
105  this, "max_residual_phi", 250., ""};
106  Gaudi::Property< double > m_err_eta {
107  this, "err_eta", 3., ""};
108  Gaudi::Property< double > m_err_phi {
109  this, "err_phi", 6., ""};
110  Gaudi::Property< double > m_err_ip {
111  this, "err_ip", 250., ""};
112 
113 
114  };
115 
116  class CscSegment{
117 
118  public:
119 
120  CscSegment();
121 
122  double x(){ return m_x; }
123  double y(){ return m_y; }
124  double z(){ return m_z; }
125  double px(){ return m_px; }
126  double py(){ return m_py; }
127  double pz(){ return m_pz; }
128  double slopeRZ(){ return m_slopeRZ; }
129  double interceptRZ(){ return m_interceptRZ; }
130  double chiSquare(){ return m_chisquare; }
131  double chiSquarePhi(){ return m_chisquare_phi; }
132 
133  int nHitEta(){ return m_nhit_eta; }
134  void setNHitEta( int nhite){ m_nhit_eta = nhite; }
135  int nHitPhi(){ return m_nhit_phi; }
136  void setNHitPhi( int nhitp){ m_nhit_phi = nhitp; }
137  bool isClean();
138 
139  ReturnCode set(double x, double y, double z, double px, double py, double pz, double chisquare, double chisquare_phi);
140  ReturnCode set(Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir, double chisquare, double chisquare_phi);
141 
142  private:
143  double m_x, m_y, m_z, m_px, m_py, m_pz;
146  double m_chisquare;
148 
149  };
150 
151 
152 }//namespace TrigL2MuonSA
153 
154 
155 #endif /* TRIGL2MUONSA_CSCSEGMENTMAKER_H */
TrigL2MuonSA::CscSegmentMaker::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CscSegmentMaker.h:94
TrigL2MuonSA::CscSegment::interceptRZ
double interceptRZ()
Definition: CscSegmentMaker.h:129
MuonRoad.h
TrigL2MuonSA::CscSegment
Definition: CscSegmentMaker.h:116
TrigL2MuonSA::CscSegmentMaker::make_2dseg4hit
ReturnCode make_2dseg4hit(int measphi, const localCscHit &ip_loc, std::vector< localCscHit > hits_loc[4], std::vector< local2dSegment > &seg2d_4hitCollection, int &nhite) const
Definition: CscSegmentMaker.cxx:327
TrigL2MuonSA::CscSegmentMaker::make_2dseg3hit
ReturnCode make_2dseg3hit(int measphi, const localCscHit &ip_loc, const std::vector< localCscHit > hits_loc[4], std::vector< local2dSegment > &seg2d_4hitCollection, int &nhit) const
Definition: CscSegmentMaker.cxx:394
TrigL2MuonSA::CscSegmentMaker::localCscHit::enabled
bool enabled
Definition: CscSegmentMaker.h:43
TrigL2MuonSA::CscSegmentMaker::localCscHit::error
double error
Definition: CscSegmentMaker.h:40
TrigL2MuonSA::CscSegmentMaker::CscSegmentMaker
CscSegmentMaker(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CscSegmentMaker.cxx:20
TrigL2MuonSA::CscSegmentMaker::make_4dsegment
ReturnCode make_4dsegment(const local2dSegment &seg2d_eta, const local2dSegment &seg2d_phi, Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir) const
Definition: CscSegmentMaker.cxx:534
TrigL2MuonSA::CscSegmentMaker::local2dSegment::a
double a
Definition: CscSegmentMaker.h:49
TrigL2MuonSA::CscSegmentMaker::local2dSegment::nhit
int nhit
Definition: CscSegmentMaker.h:53
TrigL2MuonSA::CscSegmentMaker::localCscHit::isIP
bool isIP
Definition: CscSegmentMaker.h:45
TrigL2MuonSA::CscSegmentMaker::fit_clusters
ReturnCode fit_clusters(int measphi, const std::vector< localCscHit > &hits_fit, local2dSegment &seg2d) const
Definition: CscSegmentMaker.cxx:456
TrigL2MuonSA::CscSegmentMaker::m_err_eta
Gaudi::Property< double > m_err_eta
Definition: CscSegmentMaker.h:106
TrigL2MuonSA::CscSegmentMaker::m_max_chisquare
Gaudi::Property< double > m_max_chisquare
Definition: CscSegmentMaker.h:100
TrigL2MuonSA::TgcFitResult
Definition: TgcFitResult.h:11
TrigL2MuonSA::CscSegment::py
double py()
Definition: CscSegmentMaker.h:126
TrigL2MuonSA::CscSegment::nHitPhi
int nHitPhi()
Definition: CscSegmentMaker.h:135
TrigL2MuonSA::CscSegmentMaker::local2dSegment::residual
double residual
Definition: CscSegmentMaker.h:55
TrigL2MuonSA::CscSegment::m_slopeRZ
double m_slopeRZ
Definition: CscSegmentMaker.h:144
TrigL2MuonSA::CscSegment::y
double y()
Definition: CscSegmentMaker.h:123
TrigL2MuonSA::CscSegmentMaker::local2dSegment
Definition: CscSegmentMaker.h:48
TrigL2MuonSA::CscSegmentMaker::m_muDetMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muDetMgrKey
Definition: CscSegmentMaker.h:95
TrackData.h
CscRegUtils.h
TrigL2MuonSA::CscHits
std::vector< CscHitData > CscHits
Definition: CscData.h:40
TrigL2MuonSA::CscSegmentMaker::FindSuperPointCsc
ReturnCode FindSuperPointCsc(const TrigL2MuonSA::CscHits &cscHits, std::vector< TrigL2MuonSA::TrackPattern > &v_trackPatterns, const TrigL2MuonSA::TgcFitResult &tgcFitResult, const TrigL2MuonSA::MuonRoad &muroad) const
Definition: CscSegmentMaker.cxx:35
TrigL2MuonSA::CscSegment::chiSquare
double chiSquare()
Definition: CscSegmentMaker.h:130
TrigL2MuonSA::CscSegmentMaker::localCscHit
Definition: CscSegmentMaker.h:36
TrigL2MuonSA::UtilTools
Definition: CscRegUtils.h:25
TrigL2MuonSA::CscSegment::m_chisquare
double m_chisquare
Definition: CscSegmentMaker.h:146
TrigL2MuonSA::CscSegmentMaker::m_max_residual_phi
Gaudi::Property< double > m_max_residual_phi
Definition: CscSegmentMaker.h:104
TrigL2MuonSA::CscSegment::m_px
double m_px
Definition: CscSegmentMaker.h:143
TrigL2MuonSA::CscSegment::setNHitPhi
void setNHitPhi(int nhitp)
Definition: CscSegmentMaker.h:136
TrigL2MuonSA::CscSegmentMaker::local2dSegment::zshift
double zshift
Definition: CscSegmentMaker.h:51
TrigL2MuonSA::CscSegmentMaker::localCscHit::residual
double residual
Definition: CscSegmentMaker.h:41
GeoPrimitives.h
TrigL2MuonSA::CscSegment::m_nhit_eta
int m_nhit_eta
Definition: CscSegmentMaker.h:145
TrigL2MuonSA::CscSegmentMaker::getModuleSP
ReturnCode getModuleSP(int mod_hash[2], const TrigL2MuonSA::TgcFitResult &tgcFitResult, int phibin, const TrigL2MuonSA::MuonRoad &muroad, const int exist_clusters[32]) const
Definition: CscSegmentMaker.cxx:581
TrigL2MuonSA::CscSegment::m_interceptRZ
double m_interceptRZ
Definition: CscSegmentMaker.h:144
TrigL2MuonSA::CscSegment::z
double z()
Definition: CscSegmentMaker.h:124
TrigL2MuonSA::MuonRoad
Definition: MuonRoad.h:20
CscData.h
TrigL2MuonSA::CscSegmentMaker::local2dSegment::b
double b
Definition: CscSegmentMaker.h:50
TrigL2MuonSA::CscSegment::m_pz
double m_pz
Definition: CscSegmentMaker.h:143
TrigL2MuonSA::CscSegmentMaker
Definition: CscSegmentMaker.h:30
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigL2MuonSA::CscSegmentMaker::m_use_geometry
Gaudi::Property< bool > m_use_geometry
Definition: CscSegmentMaker.h:98
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigL2MuonSA::CscSegment::m_nhit_phi
int m_nhit_phi
Definition: CscSegmentMaker.h:145
TrigL2MuonSA::CscSegmentMaker::m_max_residual_eta
Gaudi::Property< double > m_max_residual_eta
Definition: CscSegmentMaker.h:102
TrigL2MuonSA::CscSegmentMaker::local2dSegment::stationname
int stationname
Definition: CscSegmentMaker.h:54
TrigL2MuonSA::CscSegment::pz
double pz()
Definition: CscSegmentMaker.h:127
TgcFitResult.h
TrigL2MuonSA::CscSegment::isClean
bool isClean()
Definition: CscSegmentMaker.cxx:726
TrigL2MuonSA::CscSegment::set
ReturnCode set(double x, double y, double z, double px, double py, double pz, double chisquare, double chisquare_phi)
Definition: CscSegmentMaker.cxx:686
TrigL2MuonSA::CscSegmentMaker::m_err_phi
Gaudi::Property< double > m_err_phi
Definition: CscSegmentMaker.h:108
TrigL2MuonSA::CscSegmentMaker::local2dSegment::localHits
std::vector< localCscHit > localHits
Definition: CscSegmentMaker.h:56
TrigL2MuonSA::CscSegmentMaker::localCscHit::loc_x
double loc_x
Definition: CscSegmentMaker.h:37
ReadCondHandleKey.h
TrigL2MuonSA::CscSegment::m_y
double m_y
Definition: CscSegmentMaker.h:143
TrigL2MuonSA::CscSegmentMaker::make_segment
ReturnCode make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8], CscSegment &cscsegment, CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager *muDetMgr) const
Definition: CscSegmentMaker.cxx:144
TrigL2MuonSA::CscSegmentMaker::m_util
UtilTools m_util
Definition: CscSegmentMaker.h:91
TrigL2MuonSA::CscSegment::m_z
double m_z
Definition: CscSegmentMaker.h:143
TrigL2MuonSA::CscSegment::nHitEta
int nHitEta()
Definition: CscSegmentMaker.h:133
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigL2MuonSA::CscSegmentMaker::m_cscregdict
ToolHandle< CscRegDict > m_cscregdict
Definition: CscSegmentMaker.h:92
TrigL2MuonSA::CscSegmentMaker::localCscHit::measphi
int measphi
Definition: CscSegmentMaker.h:42
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TrigL2MuonSA::CscSegment::CscSegment
CscSegment()
Definition: CscSegmentMaker.cxx:670
MuonDetectorManager.h
TrigL2MuonSA::CscSegment::px
double px()
Definition: CscSegmentMaker.h:125
TrigL2MuonSA::CscSegment::setNHitEta
void setNHitEta(int nhite)
Definition: CscSegmentMaker.h:134
TrigL2MuonSA::CscSegment::m_x
double m_x
Definition: CscSegmentMaker.h:143
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager >
TrigL2MuonSA::CscSegmentMaker::initialize
virtual StatusCode initialize() override
Definition: CscSegmentMaker.cxx:27
TrigL2MuonSA::CscSegment::chiSquarePhi
double chiSquarePhi()
Definition: CscSegmentMaker.h:131
TrigL2MuonSA::CscSegmentMaker::display_hits
ReturnCode display_hits(const std::vector< localCscHit > localHits[4]) const
Definition: CscSegmentMaker.cxx:654
TrigL2MuonSA::ReturnCode
Definition: CscRegUtils.h:126
TrigL2MuonSA::CscSegmentMaker::make_2dsegment
ReturnCode make_2dsegment(int measphi, const localCscHit &ip_loc, const std::vector< localCscHit > hits_loc[4], local2dSegment &seg2d_eta, local2dSegment &local2d_noip, int &nhite) const
Definition: CscSegmentMaker.cxx:262
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigL2MuonSA::CscSegmentMaker::segmentAtFirstLayer
CscSegment segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscSegment *mu_seg) const
Definition: CscSegmentMaker.cxx:631
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
TrigL2MuonSA::CscSegment::m_py
double m_py
Definition: CscSegmentMaker.h:143
TrigL2MuonSA::CscSegmentMaker::local2dSegment::chi2
double chi2
Definition: CscSegmentMaker.h:52
TrigL2MuonSA::CscSegmentMaker::localCscHit::stationname
int stationname
Definition: CscSegmentMaker.h:44
TrigL2MuonSA::CscSegmentMaker::localCscHit::loc_y
double loc_y
Definition: CscSegmentMaker.h:38
TrigL2MuonSA::CscSegment::slopeRZ
double slopeRZ()
Definition: CscSegmentMaker.h:128
AthAlgTool
Definition: AthAlgTool.h:26
TrigL2MuonSA::CscSegmentMaker::localCscHit::loc_z
double loc_z
Definition: CscSegmentMaker.h:39
TrigL2MuonSA::CscSegment::x
double x()
Definition: CscSegmentMaker.h:122
IMuonIdHelperSvc.h
TrigL2MuonSA::CscSegmentMaker::m_err_ip
Gaudi::Property< double > m_err_ip
Definition: CscSegmentMaker.h:110
TrigL2MuonSA::CscSegment::m_chisquare_phi
double m_chisquare_phi
Definition: CscSegmentMaker.h:147
TrigL2MuonSA
Definition: AlignmentBarrelLUT.h:13
ServiceHandle< Muon::IMuonIdHelperSvc >