]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - CORRFW/AliCFParticleGenCuts.h
updated EMCal tasks
[u/mrichter/AliRoot.git] / CORRFW / AliCFParticleGenCuts.h
index 5bb9730b4cd012aed786846e986721fe53b9f77f..d19148f1e882eb74b84856eafbe56772a43a7bb2 100644 (file)
@@ -18,6 +18,9 @@
 // This class is designed to handle 
 // particle selection at generated level.
 //
+// added support for MC in AOD tree (2008-11-04)
+// added a bool flag for the alternative (standard MC) vs (AOD MC).
+//
 // author : R. Vernet (renaud.vernet@cern.ch)
 //////////////////////////////////////////////////////////////////////
 
 
 #include "AliCFCutBase.h"
 
-class AliMCEventHandler;
+class AliMCEvent;
 class TObject;
 class AliMCParticle;
 class AliStack;
+class TList;
+class TH1F;
+class TH2F;
+class TBits;
+class TArrayF;
+class TDecayChannel;
+class AliVParticle;
+class AliVEvent;
+class AliAODMCParticle;
+
 
 class AliCFParticleGenCuts : public AliCFCutBase
 {
@@ -41,32 +54,73 @@ class AliCFParticleGenCuts : public AliCFCutBase
   AliCFParticleGenCuts& operator=(const AliCFParticleGenCuts& c) ;
   virtual ~AliCFParticleGenCuts() { };
   virtual Bool_t IsSelected(TObject* obj) ;
-  virtual void   SetEvtInfo(TObject* mcInfo) ;
+  Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+  virtual void   SetMCEventInfo(const TObject* mcEvent) ;
+  void    SetAODMC(Bool_t flag) {fIsAODMC=flag;}
+
+  Bool_t IsPrimaryCharged(AliVParticle *mcPart);
+  Bool_t IsPrimary(AliMCParticle    *mcPart) ;
+  Bool_t IsPrimary(AliAODMCParticle *mcPart) ;
   //static checkers
-  static Bool_t IsPrimaryCharged(AliMCParticle *mcPart,AliStack*stack);
-  static Bool_t IsPrimary(AliMCParticle *mcPart,AliStack*stack);
-  static Bool_t IsCharged(AliMCParticle *mcPart);
-  static Bool_t IsA(AliMCParticle *mcPart, Int_t pdg, Bool_t abs=kFALSE);
+  static Bool_t IsCharged(AliVParticle *mcPart);
+  static Bool_t IsA(AliMCParticle    *mcPart, Int_t pdg, Bool_t abs=kFALSE);
+  static Bool_t IsA(AliAODMCParticle *mcPart, Int_t pdg, Bool_t abs=kFALSE);
 
-  void SetRequireIsCharged   (Bool_t b=kTRUE)       {fRequireIsCharged=b;}
-  void SetRequireIsPrimary   (Bool_t b=kTRUE)       {fRequireIsPrimary=b;}
-  void SetRequireIsSecondary (Bool_t b=kTRUE)       {fRequireIsSecondary=b;}
-  void SetRequirePdgCode     (Int_t pdg)            {fRequirePdgCode=kTRUE; fPdgCode=pdg;}
+  void SetRequireIsCharged   () {fRequireIsCharged  =kTRUE; fRequireIsNeutral  =kFALSE;}
+  void SetRequireIsNeutral   () {fRequireIsNeutral  =kTRUE; fRequireIsCharged  =kFALSE;}
+  void SetRequireIsPrimary   () {fRequireIsPrimary  =kTRUE; fRequireIsSecondary=kFALSE;}
+  void SetRequireIsSecondary () {fRequireIsSecondary=kTRUE; fRequireIsPrimary  =kFALSE;}
+  void SetRequirePdgCode     (Int_t pdg, Bool_t useAbsolute=kFALSE) {
+                              fRequirePdgCode=kTRUE; 
+                             fPdgCode=pdg; 
+                             fRequireAbsolutePdg=useAbsolute;
+  }
   void SetProdVtxRangeX    (Double32_t xmin, Double32_t xmax) {fProdVtxXMin   =xmin; fProdVtxXMax   =xmax;}
   void SetProdVtxRangeY    (Double32_t ymin, Double32_t ymax) {fProdVtxYMin   =ymin; fProdVtxYMax   =ymax;}
   void SetProdVtxRangeZ    (Double32_t zmin, Double32_t zmax) {fProdVtxZMin   =zmin; fProdVtxZMax   =zmax;}
+  void SetProdVtxRange2D   (Bool_t b=kFALSE)                 {fProdVtxRange2D = b;}
   void SetDecayVtxRangeX   (Double32_t xmin, Double32_t xmax) {fDecayVtxXMin  =xmin; fDecayVtxXMax  =xmax;}
   void SetDecayVtxRangeY   (Double32_t ymin, Double32_t ymax) {fDecayVtxYMin  =ymin; fDecayVtxYMax  =ymax;}
   void SetDecayVtxRangeZ   (Double32_t zmin, Double32_t zmax) {fDecayVtxZMin  =zmin; fDecayVtxZMax  =zmax;}
   void SetDecayLengthRange (Double32_t rmin, Double32_t rmax) {fDecayLengthMin=rmin; fDecayLengthMax=rmax;}
   void SetDecayRxyRange    (Double32_t rmin, Double32_t rmax) {fDecayRxyMin   =rmin; fDecayRxyMax   =rmax;}
+  void SetDecayChannel     (TDecayChannel* dc) {fDecayChannel = dc ;}
 
- protected:
-  AliMCEventHandler* fMCInfo ;    // pointer to the MC event information
+  enum { 
+    kCutCharge,       // ischarged cut
+    kCutPrimSec,      // isprimary cut
+    kCutPDGCode,      // PDG code  cut
+    kCutProdVtxXMin,  // production vertex cut
+    kCutProdVtxXMax,  // production vertex cut
+    kCutProdVtxYMin,  // production vertex cut
+    kCutProdVtxYMax,  // production vertex cut
+    kCutProdVtxZMin,  // production vertex cut
+    kCutProdVtxZMax,  // production vertex cut
+    kCutDecVtxXMin,   // decay vertex cut
+    kCutDecVtxXMax,   // decay vertex cut
+    kCutDecVtxYMin,   // decay vertex cut
+    kCutDecVtxYMax,   // decay vertex cut
+    kCutDecVtxZMin,   // decay vertex cut
+    kCutDecVtxZMax,   // decay vertex cut
+    kCutDecLgthMin,   // decay length cut
+    kCutDecLgthMax,   // decay length cut
+    kCutDecRxyMin,    // transverse decay length cut
+    kCutDecRxyMax,    // transverse decay length cut
+    kCutDecayChannel, // decay channel reuired
+    kNCuts,           // number of single selections
+    kNStepQA=2        // number of QA steps (before/after the cuts)
+  };
+
+ private:
+  Bool_t fIsAODMC ;       // flag for standard MC or MC from AOD tree
+  AliVEvent* fMCInfo ;    // pointer to the MC event information
   Bool_t     fRequireIsCharged;   // require charged particle
+  Bool_t     fRequireIsNeutral;   // require neutral particle
   Bool_t     fRequireIsPrimary;   // require primary particle
   Bool_t     fRequireIsSecondary; // require secondary particle
   Bool_t     fRequirePdgCode;     // require check of the PDG code
+  Bool_t     fRequireAbsolutePdg; // use the PDG code absolute value, used also for the decay channel
+  Bool_t     fProdVtxRange2D;     // cut an ellipse in xy plane
   Int_t      fPdgCode ;           // particle PDG code
   Double32_t fProdVtxXMin;        // min X of particle production vertex
   Double32_t fProdVtxYMin;        // min Y of particle production vertex
@@ -84,8 +138,23 @@ class AliCFParticleGenCuts : public AliCFCutBase
   Double32_t fDecayLengthMax;     // max decay length (absolute)
   Double32_t fDecayRxyMin;        // min decay length in transverse plane wrt (0,0,0)
   Double32_t fDecayRxyMax;        // max decay length in transverse plane wrt (0,0,0)
+  TDecayChannel* fDecayChannel;   // decay channel : if fRequireAbsolutePdg, the antiparticle channel will be checked as well
+
+  //QA histos
+  TH1F*    fhCutStatistics;        // Histogram: statistics of what cuts the tracks did not survive
+  TH2F*    fhCutCorrelation;      // Histogram: 2d statistics plot
+  TH1F*    fhQA[kNCuts][kNStepQA]; // QA Histograms
+  TH2F*    fhProdVtxXY[2];        // Histogram: production vertex in tranzverse plane
+  TArrayF* fCutValues;             // array of cut values
+  TBits* fBitmap ;                 // stores single selection decisions
+
+  void SelectionBitMap(AliMCParticle*    obj); // for MC got from Kinematics
+  void SelectionBitMap(AliAODMCParticle* obj); // for MC got from AOD
+  void FillHistograms(TObject* obj, Bool_t afterCuts);
+  void AddQAHistograms(TList *qaList) ;
+  void DefineHistograms();
 
-  ClassDef(AliCFParticleGenCuts,1);
+  ClassDef(AliCFParticleGenCuts,2);
 };
 
 #endif