]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/qaRec/AliTRDpidChecker.h
fix PID reference figures style (AlexW)
[u/mrichter/AliRoot.git] / TRD / qaRec / AliTRDpidChecker.h
index 698f4bbb0890faf274dad95ce416a3428a4ed1d5..54981641ec5c5dde868dc08349c225b0372383bd 100644 (file)
-#ifndef AliTRDpidChecker_cxx\r
-#define AliTRDpidChecker_cxx\r
-\r
-// Task to check PID performance of the TRD\r
-\r
-class AliTRDReconstructor;\r
-\r
-\r
-#include "AliAnalysisTask.h"\r
-\r
-class TObjArray;\r
-class TList;\r
-class TClonesArray;\r
-class TTreeSRedirector;\r
-\r
-class AliTRDpidChecker : public AliAnalysisTask {\r
- public:\r
-  AliTRDpidChecker(const char *name = "AliTRDpidChecker");\r
-  virtual ~AliTRDpidChecker();\r
-  \r
-  void   ConnectInputData(Option_t *);\r
-  void   CreateOutputObjects();\r
-  void   Exec(Option_t *option);\r
-  void   Terminate(Option_t *);\r
-/*   Int_t  GetDebugLevel() const {return fDebugLevel;}  */\r
-/*   void   SetDebugLevel(Int_t debug){fDebugLevel = debug;} */\r
\r
- private:\r
-  AliTRDpidChecker(const AliTRDpidChecker&); // not implemented\r
-  AliTRDpidChecker& operator=(const AliTRDpidChecker&); // not implemented\r
-\r
-  Double_t GetPionEfficiency(Int_t Index1, Int_t Index2);  // calculates the pion efficiency\r
-  Double_t GetError(Int_t Index1, Int_t Index2);           // calculates the error\r
-  \r
-  TObjArray        *fObjectContainer;       // Container\r
-  TObjArray        *fTracks;                // Array of tracks\r
-\r
-  AliTRDReconstructor *fReconstructor;     // reconstructor needed for recalculation the PID\r
-/*   Int_t            fDebugLevel;         // Debug level */\r
-/*   TTreeSRedirector *fDebugStream;       // Debug stream */\r
-\r
-  ClassDef(AliTRDpidChecker, 1); // example of analysis\r
-};\r
-\r
-#endif\r
+#ifndef ALITRDPIDCHECKER_H
+#define ALITRDPIDCHECKER_H
+
+//////////////////////////////////////////////////////
+//
+// Task to check PID performance of the TRD
+//
+// Author : Alex Wilk <wilka@uni-muenster.de>
+//          Alex Bercuci <A.Bercuci@gsi.de>
+//          Markus Fasel <M.Fasel@gsi.de>
+//
+///////////////////////////////////////////////////////
+
+#ifndef ROOT_TAxis
+#include "TAxis.h"
+#endif
+
+#ifndef ALITRDRECOTASK_H
+#include "AliTRDrecoTask.h"
+#endif
+
+class AliTRDReconstructor;
+class AliTRDpidUtil;
+class AliTRDpidChecker : public AliTRDrecoTask 
+{
+  // Plots registered for this task
+  enum{
+     kEfficiency     =  0     // pi Efficiency plot
+    ,kdEdx           =  1     // dE/dx spectra
+    ,kdEdxSlice      =  2     // dE/dx spectra
+    ,kPH             =  3     // pulse height spectra
+    ,kNClus          =  4     //  number of clusters per track
+    ,kMomentum       =  5     // momentum distribution
+    ,kMomentumBin    =  6     // momentum distribution
+    ,kThresh         =  7     // threshold in efficiency
+  };
+public:
+  AliTRDpidChecker();
+  virtual ~AliTRDpidChecker();
+  
+  virtual void    CreateOutputObjects();
+  virtual Bool_t  GetRefFigure(Int_t ifig);
+  virtual Bool_t  PostProcess();
+  virtual void    Terminate(Option_t *);
+
+  TH1 *PlotLQ(const AliTRDtrackV1 *track = 0x0);
+  TH1 *PlotNN(const AliTRDtrackV1 *track = 0x0);
+  TH1 *PlotESD(const AliTRDtrackV1 *track = 0x0);
+  TH1 *PlotdEdx(const AliTRDtrackV1 *track = 0x0);
+  TH1 *PlotdEdxSlice(const AliTRDtrackV1 *track = 0x0);
+  TH1 *PlotPH(const AliTRDtrackV1 *track = 0x0);
+  TH1 *PlotNClus(const AliTRDtrackV1 *track = 0x0);
+  TH1 *PlotMom(const AliTRDtrackV1 *track = 0x0);
+  TH1 *PlotMomBin(const AliTRDtrackV1 *track = 0x0);
+
+  TObjArray *GetGraphs() { return fGraph; };
+  virtual TObjArray *Histos();
+  void EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray *results, Float_t electron_efficiency);
+  inline void SetMomentumBinning(Int_t nBins, Double_t *bins);
+  inline Int_t FindBin(Int_t species, Double_t momentum);
+  inline Bool_t IsInRange(Double_t momentum);
+
+private:
+  AliTRDpidChecker(const AliTRDpidChecker&);               // not implemented
+  AliTRDpidChecker& operator=(const AliTRDpidChecker&);    // not implemented
+
+  Int_t  CalcPDG(AliTRDtrackV1* track = 0x0);
+  Bool_t CheckTrackQuality(const AliTRDtrackV1* track = 0x0);
+  
+  AliTRDReconstructor *fReconstructor;     //! reconstructor needed for recalculation the PID
+  AliTRDpidUtil       *fUtil;              //! utility class for PID calculations
+  TObjArray           *fGraph;             //! array of graphs filled in PostProcess
+  TObjArray           *fEfficiency;        //! array of histograms with efficiency
+  TAxis               *fMomentumAxis;      //! helper mementum binning
+  ClassDef(AliTRDpidChecker, 1); // TRD PID checker
+};
+
+//________________________________________________________________________
+inline void AliTRDpidChecker::SetMomentumBinning(Int_t nBins, Double_t *bins){
+  //
+  // Set the Momentum Bins
+  //
+  if(fMomentumAxis) delete fMomentumAxis;
+  fMomentumAxis = new TAxis(nBins, bins);
+}
+
+//________________________________________________________________________
+inline Int_t AliTRDpidChecker::FindBin(Int_t species, Double_t momentum){
+  //
+  // Find the Bin in the 2D Histogram
+  //
+  return species * fMomentumAxis->GetNbins() + (fMomentumAxis->FindBin(momentum) -1);
+}
+
+//________________________________________________________________________
+inline Bool_t AliTRDpidChecker::IsInRange(Double_t momentum){
+  //
+  // Check Whether momentum is in the defined Range
+  //
+  return (momentum >= fMomentumAxis->GetXmin() && momentum <= fMomentumAxis->GetXmax());
+}
+
+#endif