13 /**************************************************************************/
15 /**************************************************************************/
17 // Basic structures for Reve. Design criteria:
19 // * provide basic cross-referencing functionality;
21 // * small memory/disk footprint (floats / count on compression in
24 // * simple usage from tree selections;
26 // * placement in TClonesArray (composites are TObject derived);
28 // * minimal member-naming (impossible to make everybody happy).
30 void DisablePODTObjectStreamers();
32 /**************************************************************************/
34 /**************************************************************************/
36 // Minimal Float_t copy of TVector3.
37 // Used to represent points and momenta.
44 Vector() : x(0), y(0), z(0) {}
45 Vector(Float_t _x, Float_t _y, Float_t _z) : x(_x), y(_y), z(_z) {}
48 Float_t* c_vec() { return &x; }
49 void Set(Float_t* v) { x=v[0]; y=v[1]; z=v[2]; }
50 void Set(Double_t* v) { x=v[0]; y=v[1]; z=v[2]; }
51 void Set(Float_t _x, Float_t _y, Float_t _z) { x=_x; y=_y; z=_z; }
52 void Set(Double_t _x, Double_t _y, Double_t _z) { x=_x; y=_y; z=_z; }
53 void Set(const TVector3& v) { x=v.x(); y=v.y(); z=v.z(); }
56 Float_t Theta() const;
57 Float_t CosTheta() const;
60 Float_t Mag() const { return TMath::Sqrt(x*x+y*y+z*z);}
61 Float_t Mag2() const { return x*x+y*y+z*z;}
63 Float_t Perp() const { return TMath::Sqrt(x*x+y*y);}
64 Float_t Perp2() const { return x*x+y*y;}
65 Float_t R() const { return Perp(); }
67 // need operator +,-,Dot
72 inline Float_t Vector::Phi() const
73 { return x == 0.0 && y == 0.0 ? 0.0 : TMath::ATan2(y,x); }
75 inline Float_t Vector::Theta() const
76 { return x == 0.0 && y == 0.0 && z == 0.0 ? 0.0 : TMath::ATan2(Perp(),z); }
78 inline Float_t Vector::CosTheta() const
79 { Float_t ptot = Mag(); return ptot == 0.0 ? 1.0 : z/ptot; }
81 /**************************************************************************/
83 /**************************************************************************/
88 enum Type_e { Reference, Daughter, Decay };
93 PathMark(Type_e t=Reference) : type(t) {}
94 virtual ~PathMark() {}
96 ClassDef(PathMark, 1);
99 /**************************************************************************/
101 /**************************************************************************/
103 class MCTrack : public TParticle // ?? Copy stuff over ??
106 Int_t label; // Label of the track
107 Int_t eva_label; // Label of primary particle
109 Bool_t decayed; // True if decayed during tracking.
110 // ?? Perhaps end-of-tracking point/momentum would be better.
111 Float_t t_decay; // Decay time
112 Vector V_decay; // Decay vertex
113 Vector P_decay; // Decay momentum
115 MCTrack() { decayed = false; }
116 virtual ~MCTrack() {}
118 MCTrack& operator=(const TParticle& p)
119 { *((TParticle*)this) = p; return *this; }
121 void ResetPdgCode() { fPdgCode = 0; }
123 ClassDef(MCTrack, 1);
127 /**************************************************************************/
129 /**************************************************************************/
133 class MCTrackRef : public TObject
144 virtual ~MCTrackRef() {}
146 ClassDef(MCTrackRef, 1)
150 /**************************************************************************/
152 /**************************************************************************/
154 // Representation of a hit.
156 // Members det_id (and subdet_id) serve for cross-referencing into
157 // geometry. Hits should be stored in det_id (+some label ordering) in
158 // order to maximize branch compression.
161 class Hit : public TObject
164 UShort_t det_id; // Custom detector id
165 UShort_t subdet_id; // Custom sub-detector id
166 Int_t label; // Label of particle that produced the hit
170 // ?? Float_t charge. Probably specific.
179 /**************************************************************************/
181 /**************************************************************************/
183 // Base class for reconstructed clusters
185 // ?? Should Hit and cluster have common base? No.
187 class Cluster : public TObject
190 UShort_t det_id; // Custom detector id
191 UShort_t subdet_id; // Custom sub-detector id
192 Int_t label[3]; // Labels of particles that contributed hits
193 // ?? Should include reconstructed track using it? Rather not, separate.
196 // Vector W; // Cluster widths
197 // ?? Coord system? Special variables Wz, Wy?
200 virtual ~Cluster() {}
202 ClassDef(Cluster, 1);
206 /**************************************************************************/
208 /**************************************************************************/
210 class RecTrack : public TObject
213 Int_t label; // Label of the track
214 Int_t status; // Status as exported from reconstruction
216 Vector V; // Start vertex from reconstruction
217 Vector P; // Reconstructed momentum at start vertex
223 virtual ~RecTrack() {}
225 Float_t Pt() { return P.Perp(); }
227 ClassDef(RecTrack, 1);
230 // Another class with specified points/clusters
233 /**************************************************************************/
235 /**************************************************************************/
237 class RecKink : public RecTrack
240 Int_t label_sec; // Label of the secondary track
241 Vector V_end; // End vertex: last point on the primary track
242 Vector V_kink; // Kink vertex: reconstructed position of the kink
243 Vector P_sec; // Momentum of secondary track
245 RecKink() : RecTrack() {}
246 virtual ~RecKink() {}
248 ClassDef(RecKink, 1);
252 /**************************************************************************/
254 /**************************************************************************/
256 class RecV0 : public TObject
261 Vector V_neg; // Vertex of negative track
262 Vector P_neg; // Momentum of negative track
263 Vector V_pos; // Vertex of positive track
264 Vector P_pos; // Momentum of positive track
266 Vector V_ca; // Point of closest approach
267 Vector V0_birth; // Reconstucted birth point of neutral particle
269 // ? Data from simulation.
270 Int_t label; // Neutral mother label read from kinematics
271 Int_t pdg; // PDG code of mother
272 Int_t d_label[2]; // Daughter labels ?? Rec labels present anyway.
280 /**************************************************************************/
281 /**************************************************************************/
283 // Missing primary vertex.
285 // Missing GenInfo, RecInfo.
287 class GenInfo : public TObject
290 Bool_t is_rec; // is reconstructed
297 GenInfo() { is_rec = has_V0 = has_kink = false; }
298 virtual ~GenInfo() {}
300 ClassDef(GenInfo, 1);
303 /**************************************************************************/
304 /**************************************************************************/
306 // This whole construction is highly embarrassing. It requires
307 // shameless copying of experiment data. What is good about this
310 // 1) Filters can be applied at copy time so that only part of the
311 // data is copied over.
313 // 2) Once the data is extracted it can be used without experiment
314 // software. Thus, external service can provide this data and local
315 // client can be really thin.
317 // 3) Some pretty advanced visualization schemes/selections can be
318 // implemented in a general framework by providing data extractors
319 // only. This is also good for PR or VIP displays.
321 // 4) These classes can be extended by particular implementations. The
322 // container classes will use TClonesArray with user-specified element
325 // The common behaviour could be implemented entirely without usage of
326 // a common base classes, by just specifying names of members that
327 // retrieve specific data. This is fine as long as one only uses tree
328 // selections but becomes painful for extraction of data into local
329 // structures (could a) use interpreter but this is an overkill and
330 // would cause serious trouble for multi-threaded environment; b) use
331 // member offsets and data-types from the dictionary).