Modified dNdPt/AlidNdPtAnalysisPbPbAOD.{cxx,h} inlcuding corresponding AddTask
authorpluettig <pluettig@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Aug 2013 13:21:02 +0000 (13:21 +0000)
committerpluettig <pluettig@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Aug 2013 13:21:02 +0000 (13:21 +0000)
 - setting of cuts now correct
 - small cleanups done

PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtAnalysisPbPbAOD.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtAnalysisPbPbAOD.h
PWGLF/SPECTRA/ChargedHadrons/dNdPt/macros/AddTask_dNdPt_PbPbAOD.C

index 40ab2b4..5e8f533 100644 (file)
@@ -352,6 +352,7 @@ void AlidNdPtAnalysisPbPbAOD::UserCreateOutputObjects()
 
 void AlidNdPtAnalysisPbPbAOD::UserExec(Option_t *option)
 {
+  
   // Main Loop
   // called for each event
   hEventStatistics->Fill("all events",1);
@@ -633,6 +634,8 @@ Bool_t AlidNdPtAnalysisPbPbAOD::IsTrackAccepted(AliAODTrack *tr)
   Double_t dNClustersTPC = tr->GetTPCNcls();
   Double_t dCrossedRowsTPC = tr->GetTPCClusterInfo(2,1);
   
+  if(dCrossedRowsTPC < GetCutMinNCrossedRowsTPC()) { return kFALSE; }
+  
   hAccNclsTPC->Fill(dNClustersTPC);
   hAccCrossedRowsTPC->Fill(dCrossedRowsTPC);
   //   Double_t dFindableClustersTPC = tr->GetTPCNclsF();
index f65f3e9..6ce07b8 100644 (file)
@@ -75,7 +75,7 @@ class AlidNdPtAnalysisPbPbAOD : public AliAnalysisTaskSE {
     
     // set track quality cut parameters
     void SetCutRequireTPCRefit(Bool_t *b)                              { bCutRequireTPCRefit = b; } 
-    void SetCutMinNCrossedRowsTPC(Double_t d)                          { dCutMinNumberOfCrossedRows = d; }
+    void SetCutMinNCrossedRowsTPC(Double_t d)                          { dCutMinNumberOfCrossedRows = d; }    
     void SetCutMinRatioCrossedRowsOverFindableClustersTPC(Double_t d)  { dCutMinRatioCrossedRowsOverFindableClustersTPC = d; }
     void SetCutMaxChi2PerClusterTPC(Double_t d)                        { dCutMaxChi2PerClusterTPC = d; }
     void SetCutMaxFractionSharedTPCClusters(Double_t d)                { dCutMaxFractionSharedTPCClusters = d; }
@@ -94,6 +94,9 @@ class AlidNdPtAnalysisPbPbAOD : public AliAnalysisTaskSE {
     void SetCutAcceptKinkDaughters(Bool_t *b)                          { bCutAcceptKinkDaughters = b; } 
     void SetCutMaxChi2TPCConstrainedGlobal(Double_t d)                         { dCutMaxChi2TPCConstrainedGlobal = d; }
     
+    // getter for qualtiy track cuts
+    Double_t GetCutMinNCrossedRowsTPC()                                        { return dCutMinNumberOfCrossedRows; }
+    
     THnSparseF *GetHistZvPtEtaCent() const { return hnZvPtEtaCent; }
     TH1F *GetHistEventStatistics() const { return hEventStatistics; }
     
@@ -117,8 +120,8 @@ class AlidNdPtAnalysisPbPbAOD : public AliAnalysisTaskSE {
     TList      *fOutputList;
     
     // Histograms
-    TH1F       *hPt;
-    TH1F       *hMCPt;
+    TH1F       *hPt; // simple pT histogramm
+    TH1F       *hMCPt; // simple pT truth histogramm
     THnSparseF         *hnZvPtEtaCent; //-> Zv:Pt:Eta:Cent
     THnSparseF         *hnMCRecPrimZvPtEtaCent; //-> MC Zv:Pt:Eta:Cent
     THnSparseF         *hnMCGenZvPtEtaCent; //-> MC Zv:Pt:Eta:Cent
@@ -140,8 +143,7 @@ class AlidNdPtAnalysisPbPbAOD : public AliAnalysisTaskSE {
     
     // global variables
     Bool_t bIsMonteCarlo;
-    
-    
+     
     // event cut variables
     Double_t dCutMaxZVertex;
     
@@ -186,7 +188,7 @@ class AlidNdPtAnalysisPbPbAOD : public AliAnalysisTaskSE {
     AlidNdPtAnalysisPbPbAOD(const AlidNdPtAnalysisPbPbAOD&); // not implemented
     AlidNdPtAnalysisPbPbAOD& operator=(const AlidNdPtAnalysisPbPbAOD&); // not implemented  
     
-    ClassDef(AlidNdPtAnalysisPbPbAOD,0);
+    ClassDef(AlidNdPtAnalysisPbPbAOD,1); // has to be at least 1, otherwise not streamable...
 };
 
 #endif
index 950d938..a1f7afc 100644 (file)
@@ -1,42 +1,46 @@
-AlidNdPtAnalysisPbPbAOD *AddTask_dNdPt_PbPbAOD()
+AlidNdPtAnalysisPbPbAOD *AddTask_dNdPt_PbPbAOD( UInt_t uTriggerMask = AliVEvent::kMB, Double_t dNCrossedRowsTPC = 120)
 {
-// Creates, configures and attaches to the train a cascades check task.
-   // Get the pointer to the existing analysis manager via the static access method.
-   //==============================================================================
-   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-   if (!mgr) {
-      ::Error("AddTask_dNdPt_PbPbAOD", "No analysis manager to connect to.");
-      return NULL;
-   }   
-
-   // Check the analysis type using the event handlers connected to the analysis manager.
-   //==============================================================================
-   if (!mgr->GetInputEventHandler()) {
-      ::Error("AddTask_dNdPt_PbPbAOD", "This task requires an input event handler");
-      return NULL;
-   }   
-   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
-
-   // Create and configure the task
-   AlidNdPtAnalysisPbPbAOD *task = new AlidNdPtAnalysisPbPbAOD("dNdPtPbPbAOD");
-  UInt_t triggerMask = AliVEvent::kMB;
-  triggerMask |= AliVEvent::kCentral;
-  triggerMask |= AliVEvent::kSemiCentral;
+  // Creates, configures and attaches to the train a cascades check task.
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    ::Error("AddTask_dNdPt_PbPbAOD", "No analysis manager to connect to.");
+    return NULL;
+  }   
   
-  task->SelectCollisionCandidates(triggerMask);
-   
-   mgr->AddTask(task);
-
-   AliAnalysisDataContainer *coutput = mgr->CreateContainer("dNdPtPbPbAOD", 
-                                                            TList::Class(),
-                                                            AliAnalysisManager::kOutputContainer,      
-                                                            Form("%s:dNdPtHistos", mgr->GetCommonFileName()));
-//                                                          Form("%s:dNdPtHistos", mgr->GetCommonFileName()) );
-
-
-
-   mgr->ConnectInput( task, 0, mgr->GetCommonInputContainer());
-   mgr->ConnectOutput(task, 1, coutput);
-   
-   return task;
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AddTask_dNdPt_PbPbAOD", "This task requires an input event handler");
+    return NULL;
+  }   
+  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+  
+  // Create and configure the task
+  AlidNdPtAnalysisPbPbAOD *task = new AlidNdPtAnalysisPbPbAOD("dNdPtPbPbAOD");
+//   UInt_t triggerMask = AliVEvent::kMB;
+//   triggerMask |= AliVEvent::kCentral;
+//   triggerMask |= AliVEvent::kSemiCentral;
+  
+  task->SelectCollisionCandidates(uTriggerMask);
+  
+  task->SetCutMinNCrossedRowsTPC(dNCrossedRowsTPC);
+  
+  ::Info("AddTask_dNdPt_PbPbAOD",Form("CrossedRowCut set to %.0f", task->GetCutMinNCrossedRowsTPC()));
+  
+  mgr->AddTask(task);
+  
+  AliAnalysisDataContainer *coutput = mgr->CreateContainer("dNdPtPbPbAOD", 
+                                                          TList::Class(),
+                                                          AliAnalysisManager::kOutputContainer,        
+                                                          Form("%s:dNdPtHistos", mgr->GetCommonFileName()));
+                                                          //                                                        Form("%s:dNdPtHistos", mgr->GetCommonFileName()) );
+                                                          
+                                                          
+                                                          
+                                                          mgr->ConnectInput( task, 0, mgr->GetCommonInputContainer());
+                                                          mgr->ConnectOutput(task, 1, coutput);
+                                                          
+                                                          return task;
 }