]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/TRD/AliTRDcheckESD.h
remove temporary data structure for PID exchange container
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDcheckESD.h
1 #ifndef ALITRDCHECKESD_H
2 #define ALITRDCHECKESD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id: AliTRDcheckESD.h 27496 2008-07-22 08:35:45Z cblume $ */
7
8 /////////////////////////////////////////////////////
9 //
10 // Check basic detector results at ESD level
11 //
12 // Author
13 //   Alex Bercuci <A.Bercuci@gsi.de>
14 //
15 //////////////////////////////////////////////////////
16
17 #ifndef ALIANALYSISTASK_H
18 #include "AliAnalysisTaskSE.h"
19 #endif
20
21 class AliESDEvent;
22 class AliMCEvent;
23 class TH1;
24 class TH2;
25 class TObjArray;
26 class TGraph;
27 class TGraphErrors;
28 class AliTRDcheckESD : public AliAnalysisTaskSE {
29 public:
30   enum ETRDcheckESDstatus {
31      kMC        = BIT(0)  // use MC info
32     ,kCollision = BIT(1)  // 
33   };
34   enum ETRDcheckESDhistos {
35     kNCl = 0                // number of clusters per track
36    ,kTRDstat                // TRD tracks status
37    ,kTRDmom                 // TRD track momentum
38    ,kPtRes                  // Pt resolution @ vertex for TRD
39    ,kTPCVertex              // event vertex from TPC
40    ,kEventVertex            // event vertex
41    ,kNTracksAll             // ntracks - all
42    ,kNTracksAcc             // ntracks - inside acc. and DCA cut
43    ,kNTracksTPC             // additional cut on number of TPC clusters
44    ,kDCAxy                  // transverse DCA 
45    ,kDCAz                   // z - DCA
46    ,kPt1                    // Pt distribution, eta and ptmin cuts
47    ,kPt2                    // Pt distribution, cuts from kPt1 and DCA cuts
48    ,kPt3pos                 // Pt distribution, cuts from kPt2 and cut on TPC clusters for positives (>100)
49    ,kPt3neg                 // Pt distribution, cuts from kPt2 and cut on TPC clusters for negatives (>100)
50    ,kPt4pos                 // Pt distribution, cuts from kPt3pos and at least one TRD tracklet
51    ,kPt4neg                 // Pt distribution, cuts from kPt3neg and at least one TRD tracklet
52    ,kTheta                  // distribution of theta for tracks passing the cuts from kPt4pos and kPt4neg
53    ,kPhi                    // distribution of phi for tracks passing the cuts from kPt4pos and kPt4neg
54    ,kNTPCCl                 // number of TPC clusters, cuts from kPt2
55    ,kNTPCCl2                // number of TPC clusters, cuts from kPt2 + pt>1 GeV/c
56    ,kTPCDedx                // TPC dE/dx, cuts from kPt3pos or kPt3neg
57    ,kEtaPhi                 // (eta,phi) distrib. for tracks after the cuts from kPt3pos or kPt3neg
58    ,kEtaNclsTPC             // (TPC_Ncls,eta) distrib. for tracks after the cuts from kPt3pos or kPt3neg
59    ,kPhiNclsTPC             // (TPC_Ncls,phi) distrib. for tracks after the cuts from kPt3pos or kPt3neg
60    ,kNTrackletsTRD          // (TRD tracklets per track, P) distribution, after cuts from kPt4pos or kPt4neg
61    ,kNClsTrackTRD           // (TRD clusters per track, P) distribution, after cuts from kPt4pos or kPt4neg
62    ,kPHSlice                // (slicePH,sliceNo) distribution, after cuts from kPt4pos or kPt4neg
63    ,kQtotP                  // (total Q from slices, momentum) distribution, after cuts from kPt4pos or kPt4neg
64    ,kPropagXYvsP            // (X,Y,momentum) distribution after AliESDtrack::PropagateTo(r=300.)
65    ,kPropagRZvsP            // (R,Z,momentum) distribution after AliESDtrack::PropagateTo(r=300.)
66    ,kTPCRefTracksPos        // (eta,detector phi,P) distribution of reference TPC positive tracks (fulfill cuts from kPt3pos)
67    ,kTPCRefTracksNeg        // (eta,detector phi,P) distribution of reference TPC negative tracks (fulfill cuts from kPt3neg)
68    ,kTRDRefTracksPos        // (eta,detector phi,P) distribution of reference TRD positive tracks (fulfill cuts from kPt4pos)
69    ,kTRDRefTracksNeg        // (eta,detector phi,P) distribution of reference TRD negative tracks (fulfill cuts from kPt4neg)
70    ,kTRDEtaPhiAvNtrkl       // (eta, detector phi) profile of average number of tracklets
71    ,kTRDEtaDeltaPhiAvNtrkl  // (eta, delta-phi) profile of average number of tracklets
72                             // delta-phi is the angle made by the track with the normal to the chamber entrance plane
73    ,kNhistos = 37 // number of histograms
74    ,kNrefs   = 37 // number of reference plots
75   };
76   enum ETRDcheckESDbits {
77     kTPCout = 1 // track left TPC
78    ,kTRDin      // track reach TRD fiducial volume
79    ,kTRDout     // track reconstructed in TRD
80    ,kTRDpid     // PID calculated in TRD
81    ,kTRDref     // track refitted in TRD
82   };
83   AliTRDcheckESD();
84   AliTRDcheckESD(char* name);
85   virtual ~AliTRDcheckESD();
86   
87   void          UserCreateOutputObjects();
88   Bool_t        GetRefFigure(Int_t ifig);
89   Int_t         GetNRefFigures() const  { return fNRefFigures; } 
90   void          UserExec(Option_t *);
91
92   Bool_t        HasMC() const { return TESTBIT(fStatus, kMC);}
93   Bool_t        IsCollision() const {return TESTBIT(fStatus, kCollision);}
94   void          SetCollision(Bool_t set=kTRUE) {set ? SETBIT(fStatus, kCollision) : CLRBIT(fStatus, kCollision);}
95   TObjArray*    Histos();
96   Bool_t        Load(const Char_t *fn="AnalysisResults.root", const Char_t *dir="TRD_Performance", const Char_t *name=NULL);
97   void          SetMC(Bool_t mc = kTRUE) { mc ? SETBIT(fStatus, kMC) : CLRBIT(fStatus, kMC);}
98   Bool_t        PutTrendValue(const Char_t *name, Double_t val);
99   void          Terminate(Option_t *);
100
101 private:
102   static const Float_t fgkxTPC; // end radial position of TPC
103   static const Float_t fgkxTOF; // start radial position of TOF
104   static const UChar_t fgkNgraph[kNrefs]; // number of graphs/ref plot
105
106   AliTRDcheckESD(const AliTRDcheckESD&);
107   AliTRDcheckESD& operator=(const AliTRDcheckESD&);
108   Int_t         Pdg2Idx(Int_t pdg);
109   void          Process(TH1 **h, TGraphErrors *g);
110   void          Process2D(TH2 * const h, TGraphErrors **g);
111   void          PrintStatus(ULong_t s);
112
113   Int_t            fStatus;            // bit mask for controlling the task
114   Int_t            fNRefFigures;       // number of current ref plots
115   AliESDEvent      *fESD;              //! ESD event
116   AliMCEvent       *fMC;               //! MC event
117   TObjArray        *fHistos;           //! QA histos
118   TObjArray        *fResults;          // QA graphs
119   static FILE      *fgFile;            //! trend file streamer
120   // Vertex selection
121   static const Float_t fgkEvVertexZ;// cm
122   static const Int_t   fgkEvVertexN;// cm
123   // Track selection
124   static const Float_t fgkTrkDCAxy; // cm
125   static const Float_t fgkTrkDCAz;  // cm
126   static const Int_t   fgkNclTPC;   // N clusters TPC
127   static const Float_t fgkPt;       // min. pt
128   static const Float_t fgkEta;      // eta range
129   
130   static const Float_t fgkQs;      // scale for the total charge
131
132   ClassDef(AliTRDcheckESD, 5)          // user oriented TRD analysis based on ESD-MC data
133 };
134 #endif