FEDRA emulsion software from the OPERA Collaboration
EdbSegment.h
Go to the documentation of this file.
1 #ifndef ROOT_EdbSegment
2 #define ROOT_EdbSegment
3 
5 // //
6 // EdbSegment //
7 // //
8 // segment of the track //
9 // //
11 
12 #include "TArrayI.h"
13 #include "TObjArray.h"
14 #include "EdbCluster.h"
15 
16 class EdbAffine2D;
17 
18 //______________________________________________________________________________
19 class EdbSeg3D : public TObject {
20 
21 private:
22 
23  Float_t eX0; // |_coordinates of the segment's initial point
24  Float_t eY0; // | in the SAME FOR ALL SEGMENTS stage coordinate system
25  Float_t eZ0; // |
26  Float_t eTx; // tanX: deltaX/deltaZ
27  Float_t eTy; // tanY: deltaY/deltaZ
28 
29  Float_t eDz; // length of the segment along Z with sign
30 
31 public:
32  EdbSeg3D() { }
33  EdbSeg3D( float x, float y, float z, float tx, float ty, float dz=0 ):
34  eX0(x), eY0(y), eZ0(z), eTx(tx), eTy(ty), eDz(dz) {}
35  virtual ~EdbSeg3D() { }
36 
37  virtual Float_t GetX0() const { return eX0; }
38  virtual Float_t GetY0() const { return eY0; }
39  virtual Float_t GetZ0() const { return eZ0; }
40  virtual Float_t GetTx() const { return eTx; }
41  virtual Float_t GetTy() const { return eTy; }
42  virtual Float_t GetDz() const { return eDz; }
43 
44  virtual void SetX0( float x ) { eX0 = x; }
45  virtual void SetY0( float y ) { eY0 = y; }
46  virtual void SetZ0( float z ) { eZ0 = z; }
47  virtual void SetTx( float tx ) { eTx = tx; }
48  virtual void SetTy( float ty ) { eTy = ty; }
49  virtual void SetDz( float dz ) { eDz = dz; }
50 
51  virtual void Set(float x, float y, float z, float tx, float ty, float dz=0);
52 
53  virtual void Transform( const EdbAffine2D *aff );
54 
55  // virtual void Print( Option_t *opt=0) const;
56 
57  ClassDef(EdbSeg3D,2) // base class with geometrical data for segments
58 };
59 
60 //______________________________________________________________________________
61 class EdbSegment : public EdbSeg3D {
62 
63 private:
64 
65  Int_t eSide; // side of the segment location (0-up, 1-down)
66  Int_t ePuls; // puls height (number of grains)
67  Int_t eID; // segment identifier
68  Float_t eSigmaX; // dispersion parameter of grains around track line
69  Float_t eSigmaY; // dispersion parameter of grains around track line
70 
71  TObjArray *eElements;
72 
73 public:
74  EdbSegment();
75  EdbSegment( float x, float y, float z, float tx, float ty, float dz=0,
76  int side=0, int puls=0, int id=0 );
77  virtual ~EdbSegment();
78 
79  void Set(float x, float y, float z, float tx, float ty,
80  float dz=0, int side=0, int puls=0, int id=0);
81 
82  void Copy( EdbSegment &s);
83  void SetSigma(float sx, float sy) { eSigmaX=sx; eSigmaY=sy; }
84  float GetSigmaX() const { return eSigmaX; }
85  float GetSigmaY() const { return eSigmaY; }
86 
87  Int_t GetSide() const { return eSide; }
88  Int_t GetPuls() const { return ePuls%1000; }
89  Int_t GetVolume() const { return ePuls/1000; }
90  Int_t GetID() const { return eID; }
91 
92  void SetSide(int side) { eSide = side; }
93  void SetPuls(int puls) { ePuls = puls; }
94  void SetID(int id) { eID = id; }
95  void SetIDE(int id) {
96  eID = id;
97  if(eElements)
98  for(int i=0; i<eElements->GetLast()+1; i++)
99  ((EdbCluster*)eElements->At(i))->SetSegment(eID);
100  }
101  void SetIDE() { SetIDE(GetID()); }
102  void UnSetIDE() {
103  if(eElements) {
104  for(int i=0; i<eElements->GetLast()+1; i++)
105  if( ((EdbCluster*)eElements->UncheckedAt(i))->GetSegment() == eID )
106  ((EdbCluster*)eElements->UncheckedAt(i))->SetSegment(-1);
107  eElements->Clear();
108  }
109  }
110 
111 
112  Int_t GetNelements() const { if(eElements) return eElements->GetLast()+1;
113  else return 0; }
114 
115  TObjArray *GetElements() const { return eElements; }
116 
117  void AddElement( TObject *element );
118 
119  void Print( Option_t *opt=0) const;
120 
121  ClassDef(EdbSegment,3) // segment of the track
122 };
123 
124 //______________________________________________________________________________
125 class EdbTrack : public EdbSeg3D {
126 
127  private:
128 
129  Int_t eID; // Track identifier
130 
131  TObjArray *eElements;
132 
133  public:
134  EdbTrack();
135  EdbTrack( float x, float y, float z, float tx, float ty, float dz=0, int id=0 );
136  virtual ~EdbTrack();
137 
138  void Set(float x, float y, float z, float tx, float ty,
139  float dz, int id=0);
140 
141  Int_t GetID() const { return eID; }
142 
143  Int_t GetNelements() const { if(eElements) return eElements->GetLast()+1;
144  else return 0; }
145  TObjArray *GetElements() const { return eElements; }
146 
147  void AddElement( TObject *element );
148 
149  void Print( Option_t *opt=0) const;
150 
151  ClassDef(EdbTrack,3) // Track linked from segments
152 };
153 
154 #endif /* ROOT_EdbSegment */
brick dz
Definition: RecDispMC.C:107
Definition: EdbAffine.h:17
Definition: EdbCluster.h:19
Definition: EdbSegment.h:19
virtual Float_t GetDz() const
Definition: EdbSegment.h:42
Float_t eX0
Definition: EdbSegment.h:23
virtual void SetX0(float x)
Definition: EdbSegment.h:44
EdbSeg3D(float x, float y, float z, float tx, float ty, float dz=0)
Definition: EdbSegment.h:33
virtual void Set(float x, float y, float z, float tx, float ty, float dz=0)
virtual ~EdbSeg3D()
Definition: EdbSegment.h:35
Float_t eTx
Definition: EdbSegment.h:26
virtual Float_t GetX0() const
Definition: EdbSegment.h:37
virtual void SetDz(float dz)
Definition: EdbSegment.h:49
virtual void Transform(const EdbAffine2D *aff)
Definition: EdbSegment.cxx:58
Float_t eDz
Definition: EdbSegment.h:29
virtual Float_t GetTx() const
Definition: EdbSegment.h:40
virtual void SetTy(float ty)
Definition: EdbSegment.h:48
Float_t eZ0
Definition: EdbSegment.h:25
virtual Float_t GetZ0() const
Definition: EdbSegment.h:39
virtual void SetTx(float tx)
Definition: EdbSegment.h:47
EdbSeg3D()
Definition: EdbSegment.h:32
virtual Float_t GetY0() const
Definition: EdbSegment.h:38
virtual Float_t GetTy() const
Definition: EdbSegment.h:41
Float_t eTy
Definition: EdbSegment.h:27
virtual void SetZ0(float z)
Definition: EdbSegment.h:46
virtual void SetY0(float y)
Definition: EdbSegment.h:45
Float_t eY0
Definition: EdbSegment.h:24
Definition: EdbSegment.h:61
Int_t GetVolume() const
Definition: EdbSegment.h:89
Int_t GetPuls() const
Definition: EdbSegment.h:88
void AddElement(TObject *element)
Definition: EdbSegment.cxx:149
Int_t GetNelements() const
Definition: EdbSegment.h:112
void Set(float x, float y, float z, float tx, float ty, float dz=0, int side=0, int puls=0, int id=0)
Definition: EdbSegment.cxx:92
void SetSigma(float sx, float sy)
Definition: EdbSegment.h:83
void SetIDE()
Definition: EdbSegment.h:101
Int_t ePuls
Definition: EdbSegment.h:66
TObjArray * GetElements() const
Definition: EdbSegment.h:115
void SetSide(int side)
Definition: EdbSegment.h:92
EdbSegment()
array of clusters (transient!)
Definition: EdbSegment.cxx:71
void Copy(EdbSegment &s)
Definition: EdbSegment.cxx:128
float GetSigmaX() const
Definition: EdbSegment.h:84
Int_t eSide
Definition: EdbSegment.h:65
Float_t eSigmaX
Definition: EdbSegment.h:68
Int_t eID
Definition: EdbSegment.h:67
Int_t GetID() const
Definition: EdbSegment.h:90
virtual ~EdbSegment()
Definition: EdbSegment.cxx:86
TObjArray * eElements
Definition: EdbSegment.h:71
void Print(Option_t *opt=0) const
Definition: EdbSegment.cxx:139
void SetPuls(int puls)
Definition: EdbSegment.h:93
void SetID(int id)
Definition: EdbSegment.h:94
void UnSetIDE()
Definition: EdbSegment.h:102
void SetIDE(int id)
Definition: EdbSegment.h:95
Float_t eSigmaY
Definition: EdbSegment.h:69
Int_t GetSide() const
Definition: EdbSegment.h:87
float GetSigmaY() const
Definition: EdbSegment.h:85
Definition: EdbSegment.h:125
Int_t GetID() const
Definition: EdbSegment.h:141
void Set(float x, float y, float z, float tx, float ty, float dz, int id=0)
Definition: EdbSegment.cxx:177
TObjArray * GetElements() const
Definition: EdbSegment.h:145
TObjArray * eElements
Definition: EdbSegment.h:131
EdbTrack()
array of segments (transient!)
Definition: EdbSegment.cxx:157
Int_t GetNelements() const
Definition: EdbSegment.h:143
void AddElement(TObject *element)
Definition: EdbSegment.cxx:216
void Print(Option_t *opt=0) const
Definition: EdbSegment.cxx:207
virtual ~EdbTrack()
Definition: EdbSegment.cxx:171
Int_t eID
Definition: EdbSegment.h:129
const char * opt
Definition: mc2raw.cxx:42
UInt_t id
Definition: tlg2pattern.C:118
EdbSegP * s
Definition: tlg2pattern.C:32