AliPhysics  1c9c77b (1c9c77b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAODTracklet.C
Go to the documentation of this file.
1 
11 #ifndef ALIAODTRACKLET_C
12 #define ALIAODTRACKLET_C
13 #include <TObject.h>
14 #ifndef __CINT__
15 # include <TMath.h>
16 # include <TString.h>
17 #endif
18 
19 //====================================================================
25 class AliAODTracklet : public TObject
26 {
27 public:
29  enum {
30  kInjection = 0x01,
32  kSecondary = 0x04,
33  kDistinct = 0x08,
34  kSimulated = 0x10,
35  kGenerated = 0x20,
36  kNeutral = 0x40,
37  kSuppressed = 0x80
38  };
39 
41  typedef Float_t Real_t;
51  AliAODTracklet(const AliAODTracklet& other);
55  virtual ~AliAODTracklet() {}
64 
74  void SetTheta(Real_t x) { fTheta = x; }
80  void SetPhi(Real_t x) { fPhi = x; }
86  void SetDTheta(Real_t x) { fDTheta = x; }
92  void SetDPhi(Real_t x) { fDPhi = x; }
98  void SetDelta(Real_t x) { fDelta = x; }
104  void SetFlags(UChar_t x) { fFlags = x; }
120  void SetDistinct() { fFlags |= kDistinct; }
132  void SetNeutral() { fFlags |= kNeutral; }
137  /* @} */
147  Real_t GetTheta() const { return fTheta; }
153  Real_t GetPhi() const { return fPhi; }
159  Real_t GetDTheta() const { return fDTheta; }
165  Real_t GetDPhi() const { return fDPhi; }
171  Real_t GetDelta() const { return fDelta; }
177  UChar_t GetFlags() const { return fFlags; }
178  /* @} */
188  Real_t GetEta() const { return -TMath::Log(TMath::Tan(fTheta/2)); }
196  Bool_t IsMeasured() const { return !IsInjection() && !IsGenerated(); }
201  Bool_t IsInjection() const { return fFlags & kInjection; }
210  Bool_t IsDistinct() const { return fFlags & kDistinct; }
214  Bool_t IsSimulated() const { return fFlags & kSimulated; }
218  Bool_t IsSecondary() const { return fFlags & kSecondary; }
222  Bool_t IsPrimary() const { return (IsSimulated() &&
223  !IsSecondary() &&
224  !IsCombinatorics() &&
225  !IsGenerated()); }
229  Bool_t IsGenerated() const { return fFlags & kGenerated; }
233  Bool_t IsNeutral() const { return fFlags & kNeutral; }
239  Bool_t IsSuppressed() const { return fFlags & kSuppressed; }
240  /* @} */
252  virtual Real_t GetParentPt(Bool_t second=false) const { return 0; }
260  virtual Short_t GetParentPdg(Bool_t second=false) const { return 0; }
261  /* @} */
262  void Print(Option_t* option="") const;
263 protected:
275  UChar_t fFlags;
276 
277  ClassDef(AliAODTracklet,2); // Single tracklet
278 };
279 //____________________________________________________________________
281  : fTheta(999),
282  fPhi(999),
283  fDTheta(999),
284  fDPhi(999),
285  fDelta(-1),
286  fFlags(0)
287 {}
288 //____________________________________________________________________
290  : TObject(other),
291  fTheta(other.fTheta),
292  fPhi(other.fPhi),
293  fDTheta(other.fDTheta),
294  fDPhi(other.fDPhi),
295  fDelta(other.fDelta),
296  fFlags(other.fFlags)
297 {}
298 //____________________________________________________________________
301 {
302  if (&other == this) return *this;
303  fTheta = other.fTheta;
304  fPhi = other.fPhi;
305  fDTheta = other.fDTheta;
306  fDPhi = other.fDPhi;
307  fDelta = other.fDelta;
308  fFlags = other.fFlags;
309  return *this;
310 }
311 //____________________________________________________________________
312 void AliAODTracklet::Print(Option_t* option) const
313 {
314  char flags[8];
315  if (IsMeasured()) flags[0] = 'M'; else flags[0] = '-';
316  if (IsInjection()) flags[1] = 'I'; else flags[1] = '-';
317  if (IsCombinatorics()) flags[2] = 'C'; else flags[2] = '-';
318  if (IsDistinct()) flags[3] = 'D'; else flags[3] = '-';
319  if (IsSecondary()) flags[4] = 'S'; else flags[4] = '-';
320  if (IsPrimary()) flags[5] = 'P'; else flags[5] = '-';
321  if (IsGenerated()) flags[6] = 'G'; else flags[6] = '-';
322  flags[7] = '\0';
323  Printf("Tracklet 0x%02x %s (%6.2f,%6.2f)+/-(%6.2f,%6.2f) [eta=%5.2f]",
324  fFlags,
325  flags,
326  TMath::RadToDeg()*fTheta,
327  TMath::RadToDeg()*fPhi,
328  TMath::RadToDeg()*fDTheta,
329  TMath::RadToDeg()*fDPhi,
330  GetEta());
331 }
332 
333 
334 //====================================================================
341 {
342 public:
352  AliAODMCTracklet(const AliAODMCTracklet& other);
356  virtual ~AliAODMCTracklet() {}
376  virtual Real_t GetParentPt(Bool_t second=false) const
377  {
378  return !second ? fPar1Pt : fPar2Pt;
379  }
387  virtual Short_t GetParentPdg(Bool_t second=false) const
388  {
389  return !second ? fPar1Pdg : fPar2Pdg;
390  }
397  void SetParentPt(Real_t pt, Bool_t second=false)
398  {
399  if (!second) fPar1Pt = pt; else fPar2Pt = pt;
400  }
407  void SetParentPdg(Short_t pdg, Bool_t second=false)
408  {
409  if (!second) fPar1Pdg = pdg; else fPar2Pdg = pdg;
410  }
411  /* @} */
412 protected:
421 
422  ClassDef(AliAODMCTracklet,2); // Single tracklet information (sim)
423 };
424 
425 //____________________________________________________________________
427  : AliAODTracklet(),
428  fPar1Pt(-1),
429  fPar2Pt(-1),
430  fPar1Pdg(0),
431  fPar2Pdg(0)
432 {}
433 //____________________________________________________________________
435  : AliAODTracklet(other),
436  fPar1Pt(other.fPar1Pt),
437  fPar2Pt(other.fPar2Pt),
438  fPar1Pdg(other.fPar1Pdg),
439  fPar2Pdg(other.fPar2Pdg)
440 {
441  SetSimulated();
442 }
443 //____________________________________________________________________
446 {
447  if (&other == this) return *this;
449  fPar1Pt = other.fPar1Pt;
450  fPar2Pt = other.fPar2Pt;
451  fPar1Pdg = other.fPar1Pdg;
452  fPar2Pdg = other.fPar2Pdg;
453  return *this;
454 }
455 
456 #endif
457 //____________________________________________________________________
458 //
459 // EOF
460 //
Int_t pdg
void SetPhi(Real_t x)
Real_t GetEta() const
ClassDef(AliAODTracklet, 2)
Real_t GetTheta() const
void SetFlags(UChar_t x)
void SetCombinatorics()
void SetParentPdg(Short_t pdg, Bool_t second=false)
void SetTheta(Real_t x)
virtual ~AliAODTracklet()
Bool_t IsSecondary() const
void SetDTheta(Real_t x)
Bool_t IsInjection() const
virtual Real_t GetParentPt(Bool_t second=false) const
virtual Real_t GetParentPt(Bool_t second=false) const
Bool_t IsCombinatorics() const
AliAODMCTracklet & operator=(const AliAODMCTracklet &other)
Bool_t IsSimulated() const
Real_t GetDTheta() const
Bool_t IsSuppressed() const
float Float_t
Definition: External.C:68
Real_t GetDPhi() const
Real_t GetPhi() const
virtual Short_t GetParentPdg(Bool_t second=false) const
Bool_t IsMeasured() const
virtual Short_t GetParentPdg(Bool_t second=false) const
AliAODTracklet & operator=(const AliAODTracklet &other)
void SetParentPt(Real_t pt, Bool_t second=false)
short Short_t
Definition: External.C:23
UChar_t GetFlags() const
Bool_t IsNeutral() const
Bool_t IsGenerated() const
void Print(Option_t *option="") const
Bool_t IsDistinct() const
const char Option_t
Definition: External.C:48
Real_t GetDelta() const
bool Bool_t
Definition: External.C:53
void SetDelta(Real_t x)
void SetDPhi(Real_t x)
ClassDef(AliAODMCTracklet, 2)
virtual ~AliAODMCTracklet()
Bool_t IsPrimary() const