]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGPP/TRD/info/AliTRDpidInfo.h
Updates in D+ histos and ntuples (Renu, Francesco, Elena)
[u/mrichter/AliRoot.git] / PWGPP / TRD / info / AliTRDpidInfo.h
1 #ifndef ALITRDPIDINFO_H
2 #define ALITRDPIDINFO_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6 ////////////////////////////////////////////////////////////////////////////
7 //                                                                        //
8 //  TRD PID/Track summary info for performance                            //
9 //                                                                        //
10 //  Authors:                                                              //
11 //    Alexandru Bercuci <A.Bercuci@gsi.de>                                //
12 //                                                                        //
13 ////////////////////////////////////////////////////////////////////////////
14
15 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18
19 class AliTRDpidInfo : public TObject
20 {
21 public:
22   class AliTRDpidData {
23   friend class AliTRDpidInfo;       // allow direct access
24   friend class AliTRDpidRefMakerLQ; // allow direct access
25   friend class AliTRDpidRefMakerNN; // allow direct access
26   public:
27     AliTRDpidData();
28     virtual ~AliTRDpidData(){}
29     Int_t   Layer() const    { return (fPLbin&0xf0)>>4;}
30     Int_t   Momentum() const { return fPLbin&0xf;}
31   protected:
32     UChar_t fPLbin;   // momentum / layer bin
33     Float_t fdEdx[8]; // dEdx array
34     ClassDef(AliTRDpidData, 1)  // PID layer representation
35   };
36
37   AliTRDpidInfo();
38   AliTRDpidInfo(Int_t idx);
39   virtual ~AliTRDpidInfo();
40   inline AliTRDpidData const* GetData(Int_t itrklt) const;
41   AliTRDpidData const* GetDataInLayer(Int_t ily) const;
42   Int_t   GetNtracklets() const        { return fNtracklets;}
43   Char_t  GetPID() const               { return fPID;}
44   void    PushBack(Int_t ly, Int_t p, const Float_t *dedx);
45   void    Reset();
46   void    SetPID(Int_t idx)             { fPID = idx;}
47
48 private:
49   Char_t        fPID;         // reference PID
50   Int_t         fNtracklets;  // number of tracklets
51   AliTRDpidData *fData;       //[fNtracklets] PID data array
52
53   AliTRDpidInfo(const AliTRDpidInfo& ref);
54   AliTRDpidInfo& operator=(const AliTRDpidInfo& ref);
55
56   ClassDef(AliTRDpidInfo, 1)  // track PID data representation
57 };
58
59
60 //________________________________________________________________________
61 AliTRDpidInfo::AliTRDpidData const* AliTRDpidInfo::GetData(Int_t itrklt) const
62 {
63 // Retrive itrklt-th tracklet independent of layer
64 // For the layer specific getter see GetDataInLayer().
65
66   if(!fData) return NULL;
67   if(itrklt<0 || itrklt>=fNtracklets) return NULL;
68   return &fData[itrklt];
69 }
70
71 #endif
72