1) Suppressed unnecessary output. 2) Added option to request multiple filter bits
authorlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Nov 2013 14:35:46 +0000 (14:35 +0000)
committerlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Nov 2013 14:35:46 +0000 (14:35 +0000)
PWGCF/Correlations/macros/DiHadronPID/AddTaskDiHadronPID.C
PWGCF/Correlations/macros/DiHadronPID/AddTaskDiHadronPIDpp.C

index df5fe78..234fc2e 100644 (file)
@@ -16,8 +16,8 @@ AliAnalysisTaskDiHadronPID* AddTaskDiHadronPID(
        Double_t minTriggerPt = 5.,
        Double_t maxTriggerPt = 10.,
        Bool_t requestAllSingleTrackHistos = kFALSE,
-       Int_t FilterMaskTrigger = 7,
-       Int_t FilterMaskAssociated = 5,
+       UInt_t FilterMaskTrigger = 32,
+       UInt_t FilterMaskAssociated = 32,
        Bool_t isPbPb = kTRUE,
        Bool_t isMC = kFALSE,
        Int_t DebugLevel = 0,
@@ -26,6 +26,7 @@ AliAnalysisTaskDiHadronPID* AddTaskDiHadronPID(
        Bool_t MakeTOFTPCCorrelationsKa = kFALSE,
        Bool_t MakeTOFTPCCorrelationsPr = kFALSE,               
        Double_t TOFIntervalFactorTOFTPC = 1.,
+       Double_t fExtendPtAxis = kFALSE,
        const char* outputFileName = 0,
        const char* containerName = "DiHadronPID",
        const char* folderName = "PWGCF_DiHadronPID")
@@ -58,7 +59,7 @@ AliAnalysisTaskDiHadronPID* AddTaskDiHadronPID(
 
     // Configure and add Event Cuts.
        AliAODEventCutsDiHadronPID* eventcuts = new AliAODEventCutsDiHadronPID("EventCuts");
-       eventcuts->SetTrigger(AliVEvent::kMB);
+       eventcuts->SetTrigger(AliVEvent::kMB + AliVEvent::kCentral);
        eventcuts->SetCentrality(MaxCentrality, MinCentrality);
        eventcuts->SetMaxVertexZ(maxVertexZ);
        eventcuts->SetCentralityEstimator(CentralityEstimator);
@@ -69,7 +70,7 @@ AliAnalysisTaskDiHadronPID* AddTaskDiHadronPID(
        // Configure and add track cuts for trigger.
        AliAODTrackCutsDiHadronPID* triggercuts = new AliAODTrackCutsDiHadronPID("TrackCutsTrigger");
        triggercuts->SetIsMC(isMC);
-       triggercuts->SetFilterMask(1<<FilterMaskTrigger);
+       triggercuts->SetFilterMask(FilterMaskTrigger);
        triggercuts->SetPtRange(minTriggerPt,maxTriggerPt);
        triggercuts->SetMaxEta(maxEta);
        triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllCharged);
@@ -92,7 +93,7 @@ AliAnalysisTaskDiHadronPID* AddTaskDiHadronPID(
        // Configure and add track cuts for associateds.
        AliAODTrackCutsDiHadronPID* associatedscuts = new AliAODTrackCutsDiHadronPID("TrackCutsAssociated");
        associatedscuts->SetIsMC(isMC);
-       associatedscuts->SetFilterMask(1<<FilterMaskAssociated);
+       associatedscuts->SetFilterMask(FilterMaskAssociated);
        associatedscuts->SetPtRange(minAssociatedPt,maxAssociatedPt);
        associatedscuts->SetMaxEta(maxEta);
        ULong_t associatedflags = (UInt_t)(AliAODTrack::kTOFout)|(UInt_t)(AliAODTrack::kTIME);  
index bb39688..14d12ee 100644 (file)
-AliAnalysisTaskDiHadronPID* AddTaskDiHadronPIDpp( // for AOD113 2.76TeV\r
-       Int_t NDEtaBins = 32,\r
-       Int_t NDPhiBins = 32,\r
-       Int_t MinEventsForMixing = 5,\r
-       Int_t PoolTrackDepth = 2000,\r
-       Int_t PoolSize = 1000,\r
-       Bool_t MixEvents = kTRUE,\r
-       Bool_t MixTriggers = kTRUE,\r
-       Double_t MinCentrality = 5.,\r
-       Double_t MaxCentrality = 0.,\r
-       const char* CentralityEstimator = "V0M",\r
-       Double_t maxVertexZ = 10.,\r
-       Double_t maxEta = 0.8,\r
-       Double_t minAssociatedPt = 0.2,\r
-       Double_t maxAssociatedPt = 5.0,\r
-       Double_t minTriggerPt = 5.,\r
-       Double_t maxTriggerPt = 10.,\r
-       Bool_t requestAllSingleTrackHistos = kFALSE,\r
-       Int_t FilterMaskTrigger = 7,\r
-       Int_t FilterMaskAssociated = 5,\r
-       Bool_t isPbPb = kFALSE,\r
-       Bool_t isMC = kFALSE,\r
-       Int_t DebugLevel = 0,\r
-       Bool_t MakeTOFCorrelations = kTRUE,\r
-       Bool_t MakeTOFTPCCorrelationsPi = kFALSE,\r
-       Bool_t MakeTOFTPCCorrelationsKa = kFALSE,\r
-       Bool_t MakeTOFTPCCorrelationsPr = kFALSE,               \r
-       Double_t TOFIntervalFactorTOFTPC = 1.,\r
-       Bool_t ExtendPtAxis = kFALSE,\r
-       const char* outputFileName = 0,\r
-       const char* containerName = "DiHadronPID",\r
-       const char* folderName = "PWGCF_DiHadronPID")\r
-\r
-{\r
-       // Get a pointer to the analysis manager.\r
-    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
-    if (!mgr) {\r
-        cout<<"AddTaskDiHadronPIDpp.C -> No analysis manager found."<<endl;\r
-        return 0x0;\r
-    }  \r
-\r
-    // Create an instance of the task.\r
-    AliAnalysisTaskDiHadronPID* DiHadronPIDTask = new AliAnalysisTaskDiHadronPID(containerName);\r
-\r
-    // Configure the task.\r
-    DiHadronPIDTask->SetNDEtaBins(NDEtaBins);\r
-    DiHadronPIDTask->SetNDPhiBins(NDPhiBins);\r
-    DiHadronPIDTask->SetMinEventsForMixing(MinEventsForMixing);\r
-    DiHadronPIDTask->SetPoolTrackDepth(PoolTrackDepth);\r
-    DiHadronPIDTask->SetPoolSize(PoolSize);\r
-    DiHadronPIDTask->SetMixEvents(MixEvents);\r
-    DiHadronPIDTask->SetMixTriggers(MixTriggers);\r
-    DiHadronPIDTask->SetDebugLevel(DebugLevel);\r
-    DiHadronPIDTask->SetMakeTOFCorrelations(MakeTOFCorrelations);\r
-    DiHadronPIDTask->SetMakeTOFTPCCorrelationsPi(MakeTOFTPCCorrelationsPi);\r
-    DiHadronPIDTask->SetMakeTOFTPCCorrelationsKa(MakeTOFTPCCorrelationsKa);\r
-    DiHadronPIDTask->SetMakeTOFTPCCorrelationsPr(MakeTOFTPCCorrelationsPr);        \r
-    DiHadronPIDTask->SetTOFIntervalFactorTOFTPC(TOFIntervalFactorTOFTPC);\r
-    DiHadronPIDTask->SetExtendPtAxis(ExtendPtAxis);\r
-\r
-    // Configure and add Event Cuts.\r
-       AliAODEventCutsDiHadronPID* eventcuts = new AliAODEventCutsDiHadronPID("EventCuts");\r
-       eventcuts->SetTrigger(AliVEvent::kMB);\r
-       // eventcuts->SetCentrality(MaxCentrality, MinCentrality);\r
-       eventcuts->SetMaxVertexZ(maxVertexZ);\r
-       // eventcuts->SetCentralityEstimator(CentralityEstimator);\r
-       eventcuts->SetIsPbPb(isPbPb);\r
-       eventcuts->SetDemandContributorsOrSPDVertex();\r
-       eventcuts->SetDebugLevel(DebugLevel);\r
-       DiHadronPIDTask->SetEventCuts(eventcuts);\r
-\r
-       // Configure and add track cuts for trigger.\r
-       AliAODTrackCutsDiHadronPID* triggercuts = new AliAODTrackCutsDiHadronPID("TrackCutsTrigger");\r
-       triggercuts->SetIsMC(isMC);\r
-       triggercuts->SetFilterMask(1<<FilterMaskTrigger);\r
-       triggercuts->SetPtRange(minTriggerPt,maxTriggerPt);\r
-       triggercuts->SetMaxEta(maxEta);\r
-       triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllCharged);\r
-       triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPositive);\r
-       triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegative);\r
-       if (requestAllSingleTrackHistos) {\r
-               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllPion);\r
-               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosPion);\r
-               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegPion);                                     \r
-               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllKaon);\r
-               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosKaon);\r
-               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegKaon);             \r
-               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllProton);\r
-               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosProton);\r
-               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegProton);\r
-       }       \r
-       triggercuts->SetDebugLevel(DebugLevel);\r
-       DiHadronPIDTask->SetTrackCutsTrigger(triggercuts);\r
-\r
-       // Configure and add track cuts for associateds.\r
-       AliAODTrackCutsDiHadronPID* associatedscuts = new AliAODTrackCutsDiHadronPID("TrackCutsAssociated");\r
-       associatedscuts->SetIsMC(isMC);\r
-       associatedscuts->SetFilterMask(1<<FilterMaskAssociated);\r
-       associatedscuts->SetPtRange(minAssociatedPt,maxAssociatedPt);\r
-       associatedscuts->SetMaxEta(maxEta);\r
-       // associatedscuts->SetMinimumNumberOfTPCClusters(70); // marek doestn do this\r
-       associatedscuts->SetDemandSPDCluster();\r
-       ULong_t associatedflags = (UInt_t)(AliAODTrack::kTPCrefit)|(UInt_t)(AliAODTrack::kITSrefit)|(UInt_t)(AliAODTrack::kTOFout)|(UInt_t)(AliAODTrack::kTIME);        \r
-       associatedscuts->SetDemandFlags(associatedflags);\r
-       associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllCharged);\r
-       associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPositive);\r
-       associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegative);\r
-       if (requestAllSingleTrackHistos) {\r
-               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllPion);\r
-               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosPion);\r
-               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegPion);                                 \r
-               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllKaon);\r
-               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosKaon);\r
-               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegKaon);         \r
-               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllProton);\r
-               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosProton);\r
-               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegProton);\r
-       }\r
-       associatedscuts->SetDebugLevel(DebugLevel);\r
-       DiHadronPIDTask->SetTrackCutsAssociated(associatedscuts);\r
-\r
-       // Add the task.\r
-       mgr->AddTask(DiHadronPIDTask);\r
-    \r
-       // Data containers.\r
-       AliAnalysisDataContainer* cinput  = mgr->GetCommonInputContainer();\r
-       mgr->ConnectInput(DiHadronPIDTask, 0, cinput); \r
-       \r
-       if (!outputFileName) {outputFileName = AliAnalysisManager::GetCommonFileName();}\r
-       \r
-       AliAnalysisDataContainer* coutput1 = mgr->CreateContainer(containerName, TList::Class(),\r
-                         AliAnalysisManager::kOutputContainer,Form("%s:%s", outputFileName, folderName));\r
-       \r
-       mgr->ConnectOutput(DiHadronPIDTask,1,coutput1);\r
-       \r
-       return DiHadronPIDTask;\r
-\r
-}\r
+AliAnalysisTaskDiHadronPID* AddTaskDiHadronPIDpp( // for AOD113 2.76TeV
+       Int_t NDEtaBins = 32,
+       Int_t NDPhiBins = 32,
+       Int_t MinEventsForMixing = 5,
+       Int_t PoolTrackDepth = 2000,
+       Int_t PoolSize = 1000,
+       Bool_t MixEvents = kTRUE,
+       Bool_t MixTriggers = kTRUE,
+       Double_t MinCentrality = 5.,
+       Double_t MaxCentrality = 0.,
+       const char* CentralityEstimator = "V0M",
+       Double_t maxVertexZ = 10.,
+       Double_t maxEta = 0.8,
+       Double_t minAssociatedPt = 0.2,
+       Double_t maxAssociatedPt = 5.0,
+       Double_t minTriggerPt = 5.,
+       Double_t maxTriggerPt = 10.,
+       Bool_t requestAllSingleTrackHistos = kFALSE,
+       Int_t FilterMaskTrigger = 7,
+       Int_t FilterMaskAssociated = 5,
+       Bool_t isPbPb = kFALSE,
+       Bool_t isMC = kFALSE,
+       Int_t DebugLevel = 0,
+       Bool_t MakeTOFCorrelations = kTRUE,
+       Bool_t MakeTOFTPCCorrelationsPi = kFALSE,
+       Bool_t MakeTOFTPCCorrelationsKa = kFALSE,
+       Bool_t MakeTOFTPCCorrelationsPr = kFALSE,               
+       Double_t TOFIntervalFactorTOFTPC = 1.,
+       Bool_t ExtendPtAxis = kFALSE,
+       const char* outputFileName = 0,
+       const char* containerName = "DiHadronPID",
+       const char* folderName = "PWGCF_DiHadronPID")
+
+{
+       // Get a pointer to the analysis manager.
+    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+    if (!mgr) {
+        cout<<"AddTaskDiHadronPIDpp.C -> No analysis manager found."<<endl;
+        return 0x0;
+    }  
+
+    // Create an instance of the task.
+    AliAnalysisTaskDiHadronPID* DiHadronPIDTask = new AliAnalysisTaskDiHadronPID(containerName);
+
+    // Configure the task.
+    DiHadronPIDTask->SetNDEtaBins(NDEtaBins);
+    DiHadronPIDTask->SetNDPhiBins(NDPhiBins);
+    DiHadronPIDTask->SetMinEventsForMixing(MinEventsForMixing);
+    DiHadronPIDTask->SetPoolTrackDepth(PoolTrackDepth);
+    DiHadronPIDTask->SetPoolSize(PoolSize);
+    DiHadronPIDTask->SetMixEvents(MixEvents);
+    DiHadronPIDTask->SetMixTriggers(MixTriggers);
+    DiHadronPIDTask->SetDebugLevel(DebugLevel);
+    DiHadronPIDTask->SetMakeTOFCorrelations(MakeTOFCorrelations);
+    DiHadronPIDTask->SetMakeTOFTPCCorrelationsPi(MakeTOFTPCCorrelationsPi);
+    DiHadronPIDTask->SetMakeTOFTPCCorrelationsKa(MakeTOFTPCCorrelationsKa);
+    DiHadronPIDTask->SetMakeTOFTPCCorrelationsPr(MakeTOFTPCCorrelationsPr);        
+    DiHadronPIDTask->SetTOFIntervalFactorTOFTPC(TOFIntervalFactorTOFTPC);
+    DiHadronPIDTask->SetExtendPtAxis(ExtendPtAxis);
+
+    // Configure and add Event Cuts.
+       AliAODEventCutsDiHadronPID* eventcuts = new AliAODEventCutsDiHadronPID("EventCuts");
+       eventcuts->SetTrigger(AliVEvent::kMB);
+       // eventcuts->SetCentrality(MaxCentrality, MinCentrality);
+       eventcuts->SetMaxVertexZ(maxVertexZ);
+       // eventcuts->SetCentralityEstimator(CentralityEstimator);
+       eventcuts->SetIsPbPb(isPbPb);
+       eventcuts->SetDemandContributorsOrSPDVertex();
+       eventcuts->SetDebugLevel(DebugLevel);
+       DiHadronPIDTask->SetEventCuts(eventcuts);
+
+       // Configure and add track cuts for trigger.
+       AliAODTrackCutsDiHadronPID* triggercuts = new AliAODTrackCutsDiHadronPID("TrackCutsTrigger");
+       triggercuts->SetIsMC(isMC);
+       triggercuts->SetFilterMask(1<<FilterMaskTrigger);
+       triggercuts->SetPtRange(minTriggerPt,maxTriggerPt);
+       triggercuts->SetMaxEta(maxEta);
+       triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllCharged);
+       triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPositive);
+       triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegative);
+       if (requestAllSingleTrackHistos) {
+               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllPion);
+               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosPion);
+               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegPion);                                     
+               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllKaon);
+               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosKaon);
+               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegKaon);             
+               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllProton);
+               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosProton);
+               triggercuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegProton);
+       }       
+       triggercuts->SetDebugLevel(DebugLevel);
+       DiHadronPIDTask->SetTrackCutsTrigger(triggercuts);
+
+       // Configure and add track cuts for associateds.
+       AliAODTrackCutsDiHadronPID* associatedscuts = new AliAODTrackCutsDiHadronPID("TrackCutsAssociated");
+       associatedscuts->SetIsMC(isMC);
+       associatedscuts->SetFilterMask(1<<FilterMaskAssociated);
+       associatedscuts->SetPtRange(minAssociatedPt,maxAssociatedPt);
+       associatedscuts->SetMaxEta(maxEta);
+       // associatedscuts->SetMinimumNumberOfTPCClusters(70); // marek doestn do this
+       associatedscuts->SetDemandSPDCluster();
+       ULong_t associatedflags = (UInt_t)(AliAODTrack::kTPCrefit)|(UInt_t)(AliAODTrack::kITSrefit)|(UInt_t)(AliAODTrack::kTOFout)|(UInt_t)(AliAODTrack::kTIME);        
+       associatedscuts->SetDemandFlags(associatedflags);
+       associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllCharged);
+       associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPositive);
+       associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegative);
+       if (requestAllSingleTrackHistos) {
+               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllPion);
+               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosPion);
+               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegPion);                                 
+               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllKaon);
+               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosKaon);
+               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegKaon);         
+               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kAllProton);
+               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kPosProton);
+               associatedscuts->RequestQAHistos(AliAODTrackCutsDiHadronPID::kNegProton);
+       }
+       associatedscuts->SetDebugLevel(DebugLevel);
+       DiHadronPIDTask->SetTrackCutsAssociated(associatedscuts);
+
+       // Add the task.
+       mgr->AddTask(DiHadronPIDTask);
+    
+       // Data containers.
+       AliAnalysisDataContainer* cinput  = mgr->GetCommonInputContainer();
+       mgr->ConnectInput(DiHadronPIDTask, 0, cinput); 
+       
+       if (!outputFileName) {outputFileName = AliAnalysisManager::GetCommonFileName();}
+       
+       AliAnalysisDataContainer* coutput1 = mgr->CreateContainer(containerName, TList::Class(),
+                         AliAnalysisManager::kOutputContainer,Form("%s:%s", outputFileName, folderName));
+       
+       mgr->ConnectOutput(DiHadronPIDTask,1,coutput1);
+       
+       return DiHadronPIDTask;
+
+}