Including the acceptance parameteriazation to be used while analyzing MC (generator...
authorpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Oct 2011 20:43:54 +0000 (20:43 +0000)
committerpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Oct 2011 20:43:54 +0000 (20:43 +0000)
PWG2/EBYE/AliAnalysisTaskBF.cxx
PWG2/EBYE/AliAnalysisTaskBF.h

index 3703b61..4ea9bb3 100755 (executable)
@@ -6,6 +6,8 @@
 #include "TH1F.h"\r
 #include "TH2F.h"\r
 #include "TArrayF.h"\r
+#include "TF1.h"\r
+#include "TRandom.h"\r
 \r
 #include "AliAnalysisTaskSE.h"\r
 #include "AliAnalysisManager.h"\r
@@ -78,7 +80,8 @@ AliAnalysisTaskBF::AliAnalysisTaskBF(const char *name)
   fDCAxyCut(-1),\r
   fDCAzCut(-1),\r
   fTPCchi2Cut(-1),\r
-  fNClustersTPCCut(-1){\r
+  fNClustersTPCCut(-1),\r
+  fAcceptanceParameterization(0) {\r
   // Constructor\r
 \r
   // Define input and output slots here\r
@@ -706,6 +709,12 @@ void AliAnalysisTaskBF::UserExec(Option_t *) {
            if( track->Eta() < fEtaMin || track->Eta() > fEtaMax)  \r
              continue;\r
            \r
+           if(fAcceptanceParameterization) {\r
+             Double_t gRandomNumber = gRandom->Rndm();\r
+             if(gRandomNumber > fAcceptanceParameterization->Eval(track->Pt())) \r
+               continue;\r
+           }\r
+             \r
            array->Add(track);\r
            \r
            // fill charge vector\r
index 171bbc4..51bb876 100755 (executable)
@@ -7,6 +7,7 @@
 class TList;\r
 class TH1F;\r
 class TH2F;\r
+class TF1;\r
 \r
 class AliBalance;\r
 class AliESDtrackCuts;\r
@@ -84,7 +85,11 @@ class AliAnalysisTaskBF : public AliAnalysisTaskSE {
     fNumberOfAcceptedTracksMin = min;\r
     fNumberOfAcceptedTracksMax = max;}\r
   \r
-    void UseOfflineTrigger() {fUseOfflineTrigger = kTRUE;}\r
+  void UseOfflineTrigger() {fUseOfflineTrigger = kTRUE;}\r
+  \r
+  //Acceptance filter\r
+  void SetAcceptanceParameterization(TF1 *parameterization) {\r
+    fAcceptanceParameterization = parameterization;}\r
 \r
  private:\r
   AliBalance *fBalance; //BF object\r
@@ -143,6 +148,8 @@ class AliAnalysisTaskBF : public AliAnalysisTaskSE {
   Double_t fTPCchi2Cut;//only used for AODs\r
   Int_t fNClustersTPCCut;//only used for AODs\r
 \r
+  TF1 *fAcceptanceParameterization;//acceptance filter used for MC\r
+\r
   AliAnalysisTaskBF(const AliAnalysisTaskBF&); // not implemented\r
   AliAnalysisTaskBF& operator=(const AliAnalysisTaskBF&); // not implemented\r
   \r