changed function names
authorssakai <ssakai@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Apr 2013 11:55:08 +0000 (11:55 +0000)
committerssakai <ssakai@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Apr 2013 11:55:08 +0000 (11:55 +0000)
PWGHF/hfe/macros/AddTaskFlowTPCTOFQCSP.C

index f49e89c..25ec79f 100644 (file)
@@ -58,7 +58,7 @@ AliAnalysisTaskFlowTPCTOFQCSP* AddTaskFlowTPCTOFQCSP(
     }\r
 \r
 //create a task\r
-  AliAnalysisTaskFlowTPCTOFQCSP *taskHFE = ConfigHFEemcalMod(kFALSE, minTPCCluster, pixel);    //kTRUE if MC\r
+  AliAnalysisTaskFlowTPCTOFQCSP *taskHFE = ConfigHFEStandardCuts(minTPCCluster, pixel);    //kTRUE if MC\r
     \r
   if(debug) cout << " === AliAnalysisTaskFlowTPCTOFQCSP === " << taskHFE << endl;\r
   if(!taskHFE) {\r
@@ -147,19 +147,19 @@ AliAnalysisTaskFlowTPCTOFQCSP* AddTaskFlowTPCTOFQCSP(
   mgr->AddTask(taskHFE);\r
     \r
     if (QC) {  // add qc tasks\r
-        AddQCmethod(Form("QCTPCin_%s",uniqueID.Data()), harmonic, flowEvent,  debug ,uniqueID, -0.8, -0.0, 0.0, 0.8,false,POIfilterVZERO);\r
+        TPCTOF::AddQCmethod(Form("QCTPCin_%s",uniqueID.Data()), harmonic, flowEvent,  debug ,uniqueID, -0.8, -0.0, 0.0, 0.8,false,POIfilterVZERO);\r
         if(debug) cout << "    --> Hanging QC task ...succes! "<< endl;\r
     }   \r
     if (SP_TPC) {  // add sp subevent tasks\r
-        AddSPmethod(Form("SPTPCQa_in_%s", uniqueID.Data()), -0.8, -.0, .0, +0.8, "Qa", harmonic, flowEvent, false, shrinkSP, debug,uniqueID, false, POIfilterRight);\r
+        TPCTOF::AddSPmethod(Form("SPTPCQa_in_%s", uniqueID.Data()), -0.8, -.0, .0, +0.8, "Qa", harmonic, flowEvent, false, shrinkSP, debug,uniqueID, false, POIfilterRight);\r
         if(debug) cout << "    --> Hanging SP Qa task ... succes!" << endl;\r
-        AddSPmethod(Form("SPTPCQb_in_%s", uniqueID.Data()), -0.8, -.0, .0, +0.8, "Qb", harmonic, flowEvent,  false, shrinkSP, debug,uniqueID, false, POIfilterLeft);\r
+        TPCTOF::AddSPmethod(Form("SPTPCQb_in_%s", uniqueID.Data()), -0.8, -.0, .0, +0.8, "Qb", harmonic, flowEvent,  false, shrinkSP, debug,uniqueID, false, POIfilterLeft);\r
         if(debug) cout << "    --> Hanging SP Qb task ... succes!"<< endl;\r
     }\r
     if (VZERO_SP) {  // add sp subevent tasks\r
-        AddSPmethod(Form("SPVZEROQa_in_%s", uniqueID.Data()), -0.8, -.0, .0, +0.8, "Qa", harmonic, flowEvent, false, shrinkSP, debug,uniqueID, true, POIfilterVZERO);\r
+        TPCTOF::AddSPmethod(Form("SPVZEROQa_in_%s", uniqueID.Data()), -0.8, -.0, .0, +0.8, "Qa", harmonic, flowEvent, false, shrinkSP, debug,uniqueID, true, POIfilterVZERO);\r
         if(debug) cout << "    --> Hanging SP Qa task ... succes!" << endl;\r
-        AddSPmethod(Form("SPVZEROQb_in_%s", uniqueID.Data()), -0.8, -.0, .0, +0.8, "Qb", harmonic, flowEvent,  false, shrinkSP, debug,uniqueID, true, POIfilterVZERO);\r
+        TPCTOF::AddSPmethod(Form("SPVZEROQb_in_%s", uniqueID.Data()), -0.8, -.0, .0, +0.8, "Qb", harmonic, flowEvent,  false, shrinkSP, debug,uniqueID, true, POIfilterVZERO);\r
         if(debug) cout << "    --> Hanging SP Qb task ... succes!"<< endl;\r
     }\r
 \r
@@ -170,87 +170,16 @@ return taskHFE;
 }\r
 \r
 //_____________________________________________________________________________\r
-\r
-\r
-//_____________________________________________________________________________\r
-void AddSPmethod(char *name, double minEtaA, double maxEtaA, double minEtaB, double maxEtaB, char *Qvector, int harmonic, AliAnalysisDataContainer *flowEvent, bool bEP, bool shrink = false, bool debug, TString uniqueID,Bool_t VZERO_SP = kFALSE,  AliFlowTrackSimpleCuts* POIfilter)\r
-        {\r
-            // add sp task and invm filter tasks\r
-            if(debug) (bEP) ? cout << " ****** Reveived request for EP task ****** " << endl : cout << " ******* Switching to SP task ******* " << endl;\r
-            TString fileName = AliAnalysisManager::GetCommonFileName();\r
-            (bEP) ? fileName+=":EP" : fileName+=":SP";\r
-  //          if(etagap) {\r
-    //            fileName+="_SUBEVENTS";\r
-      //          if(debug) cout << "    --> Setting up subevent analysis <-- " << endl;\r
-        //    }\r
-            if(debug) cout << "    --> fileName " << fileName << endl;\r
-            TString myFolder = fileName;\r
-            if(debug) cout << "    --> myFolder " << myFolder << endl;\r
-            TString myNameSP;\r
-            (bEP) ? myNameSP = Form("%sEPv%d%s", name, harmonic, Qvector): myNameSP = Form("%sSPv%d%s", name, harmonic, Qvector);\r
-            if(debug) cout << " myNameSP " << myNameSP << endl;\r
-            AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
-            AliAnalysisDataContainer *flowEventOut = mgr->CreateContainer(Form("Filter_%s",myNameSP.Data()),AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);\r
-            AliAnalysisTaskFilterFE *tskFilter = new AliAnalysisTaskFilterFE(Form("TaskFilter_%s", myNameSP.Data()), NULL, POIfilter);\r
-            tskFilter->SetSubeventEtaRange(minEtaA, maxEtaA, minEtaB, maxEtaB);\r
-            if(VZERO_SP) tskFilter->SetSubeventEtaRange(-10, 0, 0, 10);\r
-            mgr->AddTask(tskFilter);\r
-            mgr->ConnectInput(tskFilter, 0, flowEvent);\r
-            mgr->ConnectOutput(tskFilter, 1, flowEventOut);\r
-            AliAnalysisDataContainer *outSP = mgr->CreateContainer(myNameSP.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);\r
-            AliAnalysisTaskScalarProduct *tskSP = new AliAnalysisTaskScalarProduct(Form("TaskScalarProduct_%s", myNameSP.Data()), kFALSE);\r
-            tskSP->SetApplyCorrectionForNUA(kTRUE);\r
-            tskSP->SetHarmonic(harmonic);\r
-            tskSP->SetTotalQvector(Qvector);\r
-            if (bEP) tskSP->SetBehaveAsEP();\r
-            if (shrink) tskSP->SetBookOnlyBasicCCH(kTRUE);\r
-            mgr->AddTask(tskSP);\r
-            mgr->ConnectInput(tskSP, 0, flowEventOut);\r
-            mgr->ConnectOutput(tskSP, 1, outSP);\r
-        }\r
-//_____________________________________________________________________________\r
-void AddQCmethod(char *name, int harmonic, AliAnalysisDataContainer *flowEvent, Bool_t debug, TString uniqueID,double minEtaA, double maxEtaA, double minEtaB, double maxEtaB,Bool_t VZERO_SP = kFALSE,  AliFlowTrackSimpleCuts* POIfilter)\r
-        {\r
-            // add qc task and invm filter tasks\r
-            if(debug) cout << " ****** Received request for QC v" << harmonic << " task " << name << ", IO ****** " << flowEvent << endl;\r
-            TString fileName = AliAnalysisManager::GetCommonFileName();\r
-            fileName+=":QC";\r
-            if(debug) cout << "    --> Common filename: " << fileName << endl;\r
-            TString myFolder = Form("v%d", harmonic);\r
-            if(debug) cout << "    --> myFolder: " << myFolder << endl;\r
-            TString myName = Form("%s", name);\r
-            if(debug) cout << "    --> myName: " << myName << endl;\r
-            AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
-            AliAnalysisDataContainer *flowEventOut = mgr->CreateContainer(Form("Filter_%s", myName.Data()), AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);\r
-            AliAnalysisTaskFilterFE *tskFilter = new AliAnalysisTaskFilterFE(Form("TaskFilter_%s", myName.Data()), NULL, POIfilter);\r
-            tskFilter->SetSubeventEtaRange(minEtaA, maxEtaA, minEtaB, maxEtaB);\r
-        //    if(VZERO_SP) tskFilter->SetSubeventEtaRange(-10, 0, 0, 10);\r
-            mgr->AddTask(tskFilter);\r
-            mgr->ConnectInput(tskFilter, 0, flowEvent);\r
-            mgr->ConnectOutput(tskFilter, 1, flowEventOut);\r
-            \r
-            AliAnalysisDataContainer *outQC = mgr->CreateContainer(myName.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);\r
-            AliAnalysisTaskQCumulants *tskQC = new AliAnalysisTaskQCumulants(Form("TaskQCumulants_%s", myName.Data()), kFALSE);\r
-            tskQC->SetApplyCorrectionForNUA(kTRUE);\r
-            tskQC->SetHarmonic(harmonic);\r
-            tskQC->SetBookOnlyBasicCCH(kTRUE);\r
-            mgr->AddTask(tskQC);\r
-            mgr->ConnectInput(tskQC, 0, flowEventOut);\r
-            mgr->ConnectOutput(tskQC, 1, outQC);\r
-        }\r
-//_____________________________________________________________________________\r
-\r
-\r
 //_____________________________________________________________________________\r
                     \r
-AliAnalysisTaskFlowTPCTOFQCSP* ConfigHFEemcalMod(Bool_t useMC,Int_t minTPCCulster,AliHFEextraCuts::ITSPixel_t pixel){\r
+AliAnalysisTaskFlowTPCTOFQCSP* ConfigHFEStandardCuts(Int_t minTPCCulster,AliHFEextraCuts::ITSPixel_t pixel){\r
     //\r
     // HFE standard task configuration\r
     //\r
     \r
     Bool_t kAnalyseTaggedTracks = kTRUE;\r
     \r
-    AliHFEcuts *hfecuts = new AliHFEcuts("hfeCutsEMCAL","HFE Standard Cuts");  //TODO....change the cuts values to PbPb\r
+    AliHFEcuts *hfecuts = new AliHFEcuts("hfeCuts","HFE Standard Cuts");  //TODO....change the cuts values to PbPb\r
     //  hfecuts->CreateStandardCuts();\r
     hfecuts->SetMinNClustersTPC(minTPCCulster);\r
     hfecuts->SetMinNClustersITS(3);\r
@@ -302,5 +231,75 @@ AliAnalysisTaskFlowTPCTOFQCSP* ConfigHFEemcalMod(Bool_t useMC,Int_t minTPCCulste
 \r
 //_____________________________________________________________________________\r
 \r
+namespace TPCTOF{\r
+    //_____________________________________________________________________________\r
+    void AddSPmethod(char *name, double minEtaA, double maxEtaA, double minEtaB, double maxEtaB, char *Qvector, int harmonic, AliAnalysisDataContainer *flowEvent, bool bEP, bool shrink = false, bool debug, TString uniqueID,Bool_t VZERO_SP = kFALSE,  AliFlowTrackSimpleCuts* POIfilter)\r
+    {\r
+        // add sp task and invm filter tasks\r
+        if(debug) (bEP) ? cout << " ****** Reveived request for EP task ****** " << endl : cout << " ******* Switching to SP task ******* " << endl;\r
+        TString fileName = AliAnalysisManager::GetCommonFileName();\r
+        (bEP) ? fileName+=":EP_tpctof" : fileName+=":SP_tpctof";\r
+        //          if(etagap) {\r
+        //            fileName+="_SUBEVENTS";\r
+        //          if(debug) cout << "    --> Setting up subevent analysis <-- " << endl;\r
+        //    }\r
+        if(debug) cout << "    --> fileName " << fileName << endl;\r
+        TString myFolder = fileName;\r
+        if(debug) cout << "    --> myFolder " << myFolder << endl;\r
+        TString myNameSP;\r
+        (bEP) ? myNameSP = Form("%sEPv%d%s", name, harmonic, Qvector): myNameSP = Form("%sSPv%d%s", name, harmonic, Qvector);\r
+        if(debug) cout << " myNameSP " << myNameSP << endl;\r
+        AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
+        AliAnalysisDataContainer *flowEventOut = mgr->CreateContainer(Form("Filter_%s",myNameSP.Data()),AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);\r
+        AliAnalysisTaskFilterFE *tskFilter = new AliAnalysisTaskFilterFE(Form("TaskFilter_%s", myNameSP.Data()), NULL, POIfilter);\r
+        tskFilter->SetSubeventEtaRange(minEtaA, maxEtaA, minEtaB, maxEtaB);\r
+        if(VZERO_SP) tskFilter->SetSubeventEtaRange(-10, 0, 0, 10);\r
+        mgr->AddTask(tskFilter);\r
+        mgr->ConnectInput(tskFilter, 0, flowEvent);\r
+        mgr->ConnectOutput(tskFilter, 1, flowEventOut);\r
+        AliAnalysisDataContainer *outSP = mgr->CreateContainer(myNameSP.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);\r
+        AliAnalysisTaskScalarProduct *tskSP = new AliAnalysisTaskScalarProduct(Form("TaskScalarProduct_%s", myNameSP.Data()), kFALSE);\r
+        tskSP->SetApplyCorrectionForNUA(kTRUE);\r
+        tskSP->SetHarmonic(harmonic);\r
+        tskSP->SetTotalQvector(Qvector);\r
+        if (bEP) tskSP->SetBehaveAsEP();\r
+        if (shrink) tskSP->SetBookOnlyBasicCCH(kTRUE);\r
+        mgr->AddTask(tskSP);\r
+        mgr->ConnectInput(tskSP, 0, flowEventOut);\r
+        mgr->ConnectOutput(tskSP, 1, outSP);\r
+    }\r
+    //_____________________________________________________________________________\r
+    void AddQCmethod(char *name, int harmonic, AliAnalysisDataContainer *flowEvent, Bool_t debug, TString uniqueID,double minEtaA, double maxEtaA, double minEtaB, double maxEtaB,Bool_t VZERO_SP = kFALSE,  AliFlowTrackSimpleCuts* POIfilter)\r
+    {\r
+        // add qc task and invm filter tasks\r
+        if(debug) cout << " ****** Received request for QC v" << harmonic << " task " << name << ", IO ****** " << flowEvent << endl;\r
+        TString fileName = AliAnalysisManager::GetCommonFileName();\r
+        fileName+=":QC_tpctof";\r
+        if(debug) cout << "    --> Common filename: " << fileName << endl;\r
+        TString myFolder = Form("v%d", harmonic);\r
+        if(debug) cout << "    --> myFolder: " << myFolder << endl;\r
+        TString myName = Form("%s", name);\r
+        if(debug) cout << "    --> myName: " << myName << endl;\r
+        AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
+        AliAnalysisDataContainer *flowEventOut = mgr->CreateContainer(Form("Filter_%s", myName.Data()), AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);\r
+        AliAnalysisTaskFilterFE *tskFilter = new AliAnalysisTaskFilterFE(Form("TaskFilter_%s", myName.Data()), NULL, POIfilter);\r
+        tskFilter->SetSubeventEtaRange(minEtaA, maxEtaA, minEtaB, maxEtaB);\r
+        //    if(VZERO_SP) tskFilter->SetSubeventEtaRange(-10, 0, 0, 10);\r
+        mgr->AddTask(tskFilter);\r
+        mgr->ConnectInput(tskFilter, 0, flowEvent);\r
+        mgr->ConnectOutput(tskFilter, 1, flowEventOut);\r
+        \r
+        AliAnalysisDataContainer *outQC = mgr->CreateContainer(myName.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);\r
+        AliAnalysisTaskQCumulants *tskQC = new AliAnalysisTaskQCumulants(Form("TaskQCumulants_%s", myName.Data()), kFALSE);\r
+        tskQC->SetApplyCorrectionForNUA(kTRUE);\r
+        tskQC->SetHarmonic(harmonic);\r
+        tskQC->SetBookOnlyBasicCCH(kTRUE);\r
+        mgr->AddTask(tskQC);\r
+        mgr->ConnectInput(tskQC, 0, flowEventOut);\r
+        mgr->ConnectOutput(tskQC, 1, outQC);\r
+    }\r
+    //_____________________________________________________________________________\r
+}\r
+\r
 \r
 \r