BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Muc/MucRecEvent/include/MucRecEvent/MucRec3DRoad.h
Go to the documentation of this file.
1//$id$
2//
3//$log$
4
5/*
6 * 2003/12/25 Zhengyun You Peking University
7 *
8 * 2005/02/27 Zhengyun You Peking University
9 * transplanted to Gaudi framework
10 */
11
12#ifndef MUC_REC_3DROAD_H
13#define MUC_REC_3DROAD_H
14
15#include "GaudiKernel/ContainedObject.h"
16#include "GaudiKernel/ObjectVector.h"
17#include "GaudiKernel/SmartRef.h"
18
19#include "MucRecEvent/MucRec2DRoad.h"
20
21/**
22 * Describes a road found in the muon chamber.
23 *
24 * A 3Droad is a set of hits in muon chamber strips that we expect to
25 * be associated with a single particle traversing the muon chamber.
26 * (Roads are found by the MucRecRoadFinder class.)
27 * Methods include adding hits, calculating and retrieving the
28 * trajectory indicated by the hits, projecting along the trajectory
29 * to an arbitrary gap, etc.
30 *
31 * @author Zhengyun You \URL{mailto:youzy@hep.pku.cn}
32 *
33 */
34
35class MucRec3DRoad : virtual public ContainedObject {
36public:
37 /// Constructor.
39
40 /// Assignment constructor.
42
43 /// Copy constructor.
44 MucRec3DRoad( const MucRec3DRoad& source );
45 /// Destructor.
47
48 /// set the index for this road
49 void SetIndex( const int& index );
50
51 /// set the group index for this road
52 void SetGroup( const int& Group );
53
54 /// set the fit parameters : slope and intercept for XZ and YZ.
55 void SetSimpleFitParams( const float& m_SlopeZX, const float& m_InterceptZX,
56 const float& m_SlopeZY, const float& m_InterceptZY );
57 /// refit the 3D road without the assigned gap
58 int RefitNoCurrentGap( const int& gap, float& slopeZX, float& interceptZX, float& slopeZY,
59 float& interceptZY );
60
61 vector<Identifier> ProjectToStrip( const int& part, const int& gap, const HepPoint3D& gPoint,
62 const Hep3Vector& gDirection );
63
64 vector<Identifier> ProjectToStrip( const int& part, const int& gap, const HepPoint3D& gPoint,
65 const Hep3Vector& gDirection, vector<int>& padID,
66 vector<float>& intersect_x, vector<float>& intersect_y,
67 vector<float>& intersect_z );
68
69 /// Where does the trajectory of this road intersect a specific gap?
70 void ProjectWithSigma( const int& gap, float& x, float& y, float& z, float& sigmaX,
71 float& sigmaY, float& sigmaZ );
72
73 /// Where does the trajectory of this road intersect a specific gap when refit without
74 /// current gap!!!
75 void ProjectNoCurrentGap( const int& gap, float& x, float& y, float& z, float& sigmaX,
76 float& sigmaY, float& sigmaZ, float& quad_x1, float& quad_y1,
77 float& quad_z1, float& quad_x2, float& quad_y2, float& quad_z2 );
78
79 /// Where does the trajectory of this road intersect two surfaces of a specific gap?
80 void Project( const int& gap, float& x1, float& y1, float& z1, float& x2, float& y2,
81 float& z2 );
82
83 /// project with assigned pos and dir
84 void Project( const int& gap, const float zx, const float x0, const float zy, const float y0,
85 float& x1, float& y1, float& z1 );
86
87 /// Where does the trajectory of this road intersect the reference plane?
88 // void ProjectToReference(float &x, float &y, float &z);
89
90 /// Where does the trajectory of this road intersect a z=const plane?
91 // void ProjectToZ(float &x, float &y, float &zplane);
92
93 /// Transform the Phi, ZR cord. to ZX, ZY cord.
94 void TransformPhiRToXY( const float& vk, const float& vr, const float& k0, const float& r0,
95 float& vx, float& vy, float& x0, float& y0 ) const;
96
97 /// Get sign of vx in TransformPhiRToXY
98 float GetVxSign( const float vk ) const;
99
100 /// A unique identifier for this road in the current event.
101 int GetIndex() const;
102
103 /// In which part was this road found?
104 int GetPart() const;
105
106 /// In which segment was this road found?
107 int GetSeg() const;
108
109 /// unique index of group this road belongs to
110 int GetGroup() const;
111
112 /// Which gap is the last one with hits attached to this road?
113 int GetLastGap() const;
114
115 /// How many gaps provide hits attached to this road?
116 int GetNGapsWithHits() const;
117
118 /// How many hits in all does this road contain?
119 int GetTotalHits() const;
120
121 /// How many hits per gap does this road contain?
122 int GetHitsPerGap( const int& gap ) const;
123
124 /// How many hits were attached in the gap with the most attached hits?
125 int GetMaxHitsPerGap() const;
126
127 /// Does this road contain any hits in the given segment?
128 bool HasHitInGap( const int& gap ) const;
129
130 /// How many hits do two roads share?
131 int GetNSharedHits( const MucRec3DRoad* road ) const;
132
133 // Are the two X and Y clusters in each gap in the same panel?
134 // bool ClusterPanelsMatch() const;
135
136 /// Difference between the last gap in the two 1-D roads.
137 int GetLastGapDelta() const;
138
139 /// Difference between the number of hits in the two 1-D roads.
140 int GetTotalHitsDelta() const;
141
142 /// How many degrees of freedom in the trajectory fit?
144
145 /// Chi-square parameter (per degree of freedom) of the trajectory fit.
146 float GetReducedChiSquare() const;
147
148 /// Get Z-X dimension slope.
149 float GetSlopeZX() const;
150
151 /// Get Z-X dimension intercept.
152 float GetInterceptZX() const;
153
154 /// Get Z-Y dimension slope.
155 float GetSlopeZY() const;
156
157 /// Get Z-Y dimension intercept.
158 float GetInterceptZY() const;
159
160 /// Get a pointer to the first hit attached in a particular gap.
161 MucRecHit* GetHit( const int& gap ) const;
162
163 /// Is the intersection of a pair of H and V clusters inside a panel?
164 // bool IsIntersectionOK(const TMuiCluster *hcluster,
165 // const TMuiCluster *vcluster) const;
166
167 /// get a pointer to the 2D road in the 3D road.
168 MucRec2DRoad* Get2DRoad( const int& orient = 0 ) const;
169
170 /// Get indices of all hits in the road.
171 vector<Identifier> GetHitsID() const;
172
173 /// Print Hits Infomation.
175
176private:
177 Hep3Vector m_VertexPos; // Event vertex position.
178 Hep3Vector m_VertexSigma; // Uncertainty of event vertex position.
179
180 MucRec2DRoad* m_Road0; // object describing the 2-D road orient 0
181 MucRec2DRoad* m_Road1; // object describing the 2-D road orient 1
182
183 int m_Index; // uniquely identifies this road in the event
184 int m_Part; // the part in which this road was found
185 int m_Seg; // the segment in which this road was found
186 int m_LastGap; // Last gap with attached hits.
187 float m_Chi2; // Chi-square parameter of trajectory fit.
188 int m_DOF; // Number of degrees of freedom of fit.
189
190 float m_SlopeZX; // X = m_InterceptZX + m_SlopeZX * Z.
191 float m_InterceptZX; // X = m_InterceptZX + m_SlopeZX * Z.
192 float m_SlopeZY; // Y = m_InterceptZY + m_SlopeZY * Z.
193 float m_InterceptZY; // Y = m_InterceptZY + m_SlopeZY * Z.
194
195 // == true if X and Y clusters are in the same panels in all gaps.
196 // bool m_ClusterPanelsMatch;
197 int m_Group; // Which group does this road belong to?
198};
199
200typedef ObjectVector<MucRec3DRoad> MucRec3DRoadContainer;
201
202#endif /* MUC_REC_3DROAD_H */
HepGeom::Point3D< double > HepPoint3D
int RefitNoCurrentGap(const int &gap, float &slopeZX, float &interceptZX, float &slopeZY, float &interceptZY)
refit the 3D road without the assigned gap
float GetSlopeZX() const
Get Z-X dimension slope.
float GetSlopeZY() const
Get Z-Y dimension slope.
void TransformPhiRToXY(const float &vk, const float &vr, const float &k0, const float &r0, float &vx, float &vy, float &x0, float &y0) const
Where does the trajectory of this road intersect the reference plane?
bool HasHitInGap(const int &gap) const
Does this road contain any hits in the given segment?
int GetLastGapDelta() const
Difference between the last gap in the two 1-D roads.
void SetIndex(const int &index)
set the index for this road
int GetHitsPerGap(const int &gap) const
How many hits per gap does this road contain?
MucRec3DRoad(const MucRec3DRoad &source)
Copy constructor.
void ProjectNoCurrentGap(const int &gap, float &x, float &y, float &z, float &sigmaX, float &sigmaY, float &sigmaZ, float &quad_x1, float &quad_y1, float &quad_z1, float &quad_x2, float &quad_y2, float &quad_z2)
float GetVxSign(const float vk) const
Get sign of vx in TransformPhiRToXY.
MucRecHit * GetHit(const int &gap) const
Get a pointer to the first hit attached in a particular gap.
int GetPart() const
In which part was this road found?
vector< Identifier > ProjectToStrip(const int &part, const int &gap, const HepPoint3D &gPoint, const Hep3Vector &gDirection)
int GetLastGap() const
Which gap is the last one with hits attached to this road?
MucRec3DRoad & operator=(const MucRec3DRoad &orig)
Assignment constructor.
int GetTotalHitsDelta() const
Difference between the number of hits in the two 1-D roads.
void PrintHitsInfo()
Print Hits Infomation.
vector< Identifier > ProjectToStrip(const int &part, const int &gap, const HepPoint3D &gPoint, const Hep3Vector &gDirection, vector< int > &padID, vector< float > &intersect_x, vector< float > &intersect_y, vector< float > &intersect_z)
void SetGroup(const int &Group)
set the group index for this road
int GetTotalHits() const
How many hits in all does this road contain?
float GetInterceptZY() const
Get Z-Y dimension intercept.
MucRec3DRoad(MucRec2DRoad *road0, MucRec2DRoad *road1)
Constructor.
int GetGroup() const
unique index of group this road belongs to
void SetSimpleFitParams(const float &m_SlopeZX, const float &m_InterceptZX, const float &m_SlopeZY, const float &m_InterceptZY)
set the fit parameters : slope and intercept for XZ and YZ.
void Project(const int &gap, const float zx, const float x0, const float zy, const float y0, float &x1, float &y1, float &z1)
project with assigned pos and dir
int GetNSharedHits(const MucRec3DRoad *road) const
How many hits do two roads share?
int GetSeg() const
In which segment was this road found?
int GetDegreesOfFreedom() const
How many degrees of freedom in the trajectory fit?
~MucRec3DRoad()
Destructor.
MucRec2DRoad * Get2DRoad(const int &orient=0) const
Is the intersection of a pair of H and V clusters inside a panel?
void Project(const int &gap, float &x1, float &y1, float &z1, float &x2, float &y2, float &z2)
Where does the trajectory of this road intersect two surfaces of a specific gap?
vector< Identifier > GetHitsID() const
Get indices of all hits in the road.
void ProjectWithSigma(const int &gap, float &x, float &y, float &z, float &sigmaX, float &sigmaY, float &sigmaZ)
Where does the trajectory of this road intersect a specific gap?
float GetInterceptZX() const
Get Z-X dimension intercept.
int GetNGapsWithHits() const
How many gaps provide hits attached to this road?
int GetIndex() const
A unique identifier for this road in the current event.
float GetReducedChiSquare() const
Chi-square parameter (per degree of freedom) of the trajectory fit.
int GetMaxHitsPerGap() const
How many hits were attached in the gap with the most attached hits?