]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDMuonTrack.h
Instead just bit-flag marking used clusters store ID's of ESDtracks for
[u/mrichter/AliRoot.git] / STEER / AliESDMuonTrack.h
index 00212ffa6c72bf16075f8b29d5a0a9b55175e7ff..a7a457806faafe6f4f4e1fc76ba8c91cde9098b3 100644 (file)
@@ -6,8 +6,8 @@
 
 /* $Id$ */
 
-//  Class to describe the MUON tracks
-//  in the Event Summary Data class
+/// \class AliESDMuonTrack
+/// \brief Class to describe the MUON tracks in the Event Summary Data class
 //  Author: G.Martinez
 
 
@@ -18,6 +18,7 @@
 #include "AliVParticle.h"
 
 class AliESDMuonCluster;
+class AliESDEvent;
 class TClonesArray;
 class TLorentzVector;
 
@@ -27,9 +28,17 @@ public:
   virtual ~AliESDMuonTrack(); // Destructor
   AliESDMuonTrack(const AliESDMuonTrack& esdm);
   AliESDMuonTrack& operator=(const AliESDMuonTrack& esdm);
+  virtual void Copy(TObject &obj) const;
 
   virtual void Clear(Option_t* opt = "");
   
+  void Reset();
+  
+  // Return kTRUE if the track contain tracker data
+  Bool_t ContainTrackerData() const {return (fMuonClusterMap>0) ? kTRUE : kFALSE;}
+  // Return kTRUE if the track contain trigger data
+  Bool_t ContainTriggerData() const {return (LoCircuit()>0) ? kTRUE : kFALSE;}
+  
   // Get and Set methods for data at vertex
   Double_t GetInverseBendingMomentum(void) const {return fInverseBendingMomentum;}
   void     SetInverseBendingMomentum(Double_t InverseBendingMomentum) 
@@ -80,6 +89,10 @@ public:
   void     SetCovariances(const TMatrixD& cov);
   void     GetCovarianceXYZPxPyPz(Double_t cov[21]) const;
   
+  // Get and Set methods for the transverse position r of the track at the end of the absorber
+  Double_t GetRAtAbsorberEnd() const { return fRAtAbsorberEnd; }
+  void     SetRAtAbsorberEnd(Double_t r) { fRAtAbsorberEnd = r; }
+  
   // Get and Set methods for global tracking info
   Double_t GetChi2(void) const {return fChi2;}
   void     SetChi2(Double_t Chi2) {fChi2 = Chi2;}
@@ -88,6 +101,7 @@ public:
   
   // Get and Set methods for trigger matching
   Int_t    GetMatchTrigger() const;
+  Bool_t   MatchTriggerDigits() const;
   Double_t GetChi2MatchTrigger() const {return fChi2MatchTrigger;}
   void     SetChi2MatchTrigger(Double_t Chi2MatchTrigger) {fChi2MatchTrigger = Chi2MatchTrigger;}
   UShort_t GetHitsPatternInTrigCh() const {return fHitsPatternInTrigCh;}
@@ -99,16 +113,18 @@ public:
   Int_t    LoDev(void)    const  { return fLocalTrigger >> 17 & 0x1F; }
   Int_t    LoLpt(void)    const  { return fLocalTrigger >> 22 & 0x03; }
   Int_t    LoHpt(void)    const  { return fLocalTrigger >> 24 & 0x03; }
-  
+  Int_t    GetTriggerWithoutChamber(void) const { return fLocalTrigger >> 26 & 0xF; }
+  Bool_t TriggerFiredWithoutChamber(Int_t ich) const { return GetTriggerWithoutChamber() >> (3 - ich) & 0x1; }
+
   // Get and Set methods for the hit strips pattern in the trigger chambers
-  UShort_t GetTriggerX1Pattern() { return fX1Pattern; }
-  UShort_t GetTriggerY1Pattern() { return fY1Pattern; }
-  UShort_t GetTriggerX2Pattern() { return fX2Pattern; }
-  UShort_t GetTriggerY2Pattern() { return fY2Pattern; }
-  UShort_t GetTriggerX3Pattern() { return fX3Pattern; }
-  UShort_t GetTriggerY3Pattern() { return fY3Pattern; }
-  UShort_t GetTriggerX4Pattern() { return fX4Pattern; }
-  UShort_t GetTriggerY4Pattern() { return fY4Pattern; }
+  UShort_t GetTriggerX1Pattern() const { return fX1Pattern; }
+  UShort_t GetTriggerY1Pattern() const { return fY1Pattern; }
+  UShort_t GetTriggerX2Pattern() const { return fX2Pattern; }
+  UShort_t GetTriggerY2Pattern() const { return fY2Pattern; }
+  UShort_t GetTriggerX3Pattern() const { return fX3Pattern; }
+  UShort_t GetTriggerY3Pattern() const { return fY3Pattern; }
+  UShort_t GetTriggerX4Pattern() const { return fX4Pattern; }
+  UShort_t GetTriggerY4Pattern() const { return fY4Pattern; }
   void     SetTriggerX1Pattern(UShort_t pat) { fX1Pattern = pat; }
   void     SetTriggerY1Pattern(UShort_t pat) { fY1Pattern = pat; }
   void     SetTriggerX2Pattern(UShort_t pat) { fX2Pattern = pat; }
@@ -121,8 +137,12 @@ public:
   // Get and Set methods for muon cluster map
   UInt_t   GetMuonClusterMap() const {return fMuonClusterMap;}
   void     SetMuonClusterMap(UInt_t muonClusterMap) {fMuonClusterMap = muonClusterMap;}
-  void     AddInMuonClusterMap(Int_t chamber);
-  Bool_t   IsInMuonClusterMap(Int_t chamber) const;
+  void     AddInMuonClusterMap(Int_t chamber) {fMuonClusterMap |= BIT(chamber);}
+  Bool_t   IsInMuonClusterMap(Int_t chamber) const {return (Bool_t) ((fMuonClusterMap & BIT(chamber)) != 0);}
+  
+  // Identify the tracks sharing cluster(s) with another (use the last bit of fMuonClusterMap)
+  void     Connected(Bool_t flag = kTRUE) {flag ? SETBIT(fMuonClusterMap,31) : CLRBIT(fMuonClusterMap,31);}
+  Bool_t   IsConnected() const {return TESTBIT(fMuonClusterMap,31);}
   
   // Methods to get, fill and check the array of associated clusters
   Int_t         GetNClusters() const;
@@ -157,15 +177,60 @@ public:
   Bool_t   XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }  
   Double_t Pt() const { return TMath::Sqrt(Px()*Px() + Py()*Py()); }
   Double_t OneOverPt() const { return (Pt() != 0.) ? 1./Pt() : FLT_MAX; }
-  Double_t Phi() const { return TMath::ATan2(Py(), Px()); }
+  Double_t Phi() const { return TMath::Pi()+TMath::ATan2(-Py(), -Px()); }
   Double_t Theta() const { return TMath::ATan2(Pt(), Pz()); }
   Double_t E() const { return TMath::Sqrt(M()*M() + P()*P()); }
   Double_t M() const { return TDatabasePDG::Instance()->GetParticle("mu-")->Mass(); }
   Double_t Eta() const { return -TMath::Log(TMath::Tan(0.5 * Theta()));}
   Double_t Y() const { return (Pz()/E() != 1.) ? TMath::ATanH(Pz()/E()) : FLT_MAX; }
   Short_t  Charge() const { return (Short_t)TMath::Sign(1., GetInverseBendingMomentum()); }
+
+
+  // Dummy
   const Double_t *PID() const { return (Double_t*)0x0; }
+  Int_t    PdgCode() const {return 0;}
   
+  /// Set the corresponding MC track number
+  void  SetLabel(Int_t label) {fLabel = label;}
+  /// Return the corresponding MC track number
+  Int_t GetLabel() const {return fLabel;}
+
+  /// Additional methods to decode hit pattern
+  /// The hit pattern is a UShort_t with:
+  /// <pre>
+  ///   0    |   1 0 0 0 1  |  1 1  |   1  1  0  1  |   1  1  0  1   
+  ///        |              |       |               | 
+  /// unused |  RPC (0-17)  |  flag |  Bend plane   | Non-bend plane
+  ///        |      or      |       | Match chamber | Match chamber
+  ///        | further info |       |  11 12 13 14  |  11 12 13 14
+  ///        |    (20-24)   |       |               |
+  /// </pre>
+  enum EAliTriggerChPatternFlag {
+    kNoEff,    ///< Track is not good for chamber efficiency evaluation
+    kChEff,    ///< Track crosses different RPCs
+    kSlatEff,  ///< Track crosses the same RPC in all planes
+    kBoardEff  ///< Track crosses the same board in all planes
+  };
+  enum EAliTriggerChPatternInfo {
+    kCrossDifferentSlats  = 20, ///< The RPC cannot be univoquely determined
+    kTrackMatchesManyPads = 21, ///< Track not good for effciency calculation since it matches many pads
+    kTrackMatchesFewPads  = 22, ///< Track not good for effciency calculation since it matches pads in less than 3/4 chambers
+    kTrackOutsideGeometry = 23, ///< Problems in pattern determination since track extrapolation is outside trigger chambers
+    kTrackerTrackPattern  = 24  ///< The pattern was calculated from a tracker track not matching trigger track
+  };
+  /// Set hits pattern
+  static void SetFiredChamber(UShort_t& pattern, Int_t cathode, Int_t chamber);
+  /// Add efficiency flag and crossed RPC or info on rejected track
+  static void AddEffInfo(UShort_t& pattern, Int_t slatOrInfo, EAliTriggerChPatternFlag effType = kNoEff);
+  /// Chamber was hit
+  static Bool_t IsChamberHit(UShort_t pattern, Int_t cathode, Int_t chamber);
+  /// Get Efficiency flag
+  static Int_t GetEffFlag(UShort_t pattern);
+  /// Getting crossed slat or info
+  static Int_t GetSlatOrInfo(UShort_t pattern);
+
+  AliESDEvent* GetESDEvent() const {return fESDEvent;}
+  void         SetESDEvent(AliESDEvent* evt) {fESDEvent = evt;}  
   
 protected:
   // parameters at vertex
@@ -199,6 +264,8 @@ protected:
   /// [10]=<X,InvP_yz> [11]=<ThetaX,InvP_yz> [12]=<Y,InvP_yz> [13]=<ThetaY,InvP_yz> [14]=<InvP_yz,InvP_yz>  </pre>
   Double32_t fCovariances[15]; ///< \brief reduced covariance matrix of parameters AT FIRST CHAMBER
   
+  Double32_t fRAtAbsorberEnd; ///< transverse position r of the track at the end of the absorber
+  
   // global tracking info
   Double32_t fChi2;                ///< chi2 in the MUON track fit
   Double32_t fChi2MatchTrigger;    ///< chi2 of trigger/track matching
@@ -214,13 +281,17 @@ protected:
   UShort_t fX4Pattern;             ///< x-strips pattern in st7/ch2
   UShort_t fY4Pattern;             ///< y-strips pattern in st7/ch2
   
-  UInt_t     fMuonClusterMap;      ///< Map of clusters in tracking chambers
-  UShort_t   fHitsPatternInTrigCh; ///< Word containing info on the hits left in trigger chambers
-  UChar_t    fNHit;                ///< number of hit in the track
+  UInt_t   fMuonClusterMap;        ///< Map of clusters in tracking chambers
+  UShort_t fHitsPatternInTrigCh;   ///< Word containing info on the hits left in trigger chambers
+  UChar_t  fNHit;                  ///< number of hit in the track
   
   mutable TClonesArray* fClusters; ///< Array of clusters attached to the track
   
-  ClassDef(AliESDMuonTrack,10) // MUON ESD track class 
+  Int_t fLabel;                    ///< point to the corresponding MC track
+
+  AliESDEvent*   fESDEvent; //!Pointer back to event to which the track belongs
+  
+  ClassDef(AliESDMuonTrack,13) // MUON ESD track class 
 };
 
 #endif