Remove old add task macro
authorrbailhac <Raphaelle.Bailhache@cern.ch>
Mon, 13 Jan 2014 12:18:38 +0000 (13:18 +0100)
committerrbailhac <Raphaelle.Bailhache@cern.ch>
Mon, 13 Jan 2014 12:18:38 +0000 (13:18 +0100)
PWGHF/hfe/macros/AddTaskFlowTPCTOFQCSP.C [deleted file]

diff --git a/PWGHF/hfe/macros/AddTaskFlowTPCTOFQCSP.C b/PWGHF/hfe/macros/AddTaskFlowTPCTOFQCSP.C
deleted file mode 100644 (file)
index 383d7e4..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-///////////////////////////////////////////////////////////////////\r
-//                                                               //            \r
-// AddTaskFlowTPCTOFQCSP macro                                     //\r
-// Author: Andrea Dubla, Utrecht University, 2012                //\r
-//                                                               //\r
-///////////////////////////////////////////////////////////////////\r
-class AliAnalysisDataContainer;\r
-class AliFlowTrackCuts;\r
-class AliFlowTrackSimpleCuts;\r
-class AliFlowEventCuts;\r
-class AliFlowEventSimpleCuts;\r
-class AliAnalysisDataContainer;\r
-class AliHFEextraCuts;\r
-\r
-AliAnalysisTaskFlowTPCTOFQCSP* AddTaskFlowTPCTOFQCSP(\r
-                                              TString uniqueID = "",\r
-                                              Float_t centrMin ,\r
-                                              Float_t centrMax ,\r
-                                              Double_t InvmassCut,\r
-                                              Int_t Trigger,\r
-                                              Double_t pTCut,\r
-                                              Double_t minTPCnsigma,\r
-                                              Double_t maxTPCnsigma,\r
-                                              Double_t minTOFnSigma,\r
-                                              Double_t maxTOFnSigma,\r
-                                              Int_t minTPCCluster,\r
-                                              Int_t TPCS,\r
-                                              Int_t Vz,\r
-                                              AliHFEextraCuts::ITSPixel_t pixel,\r
-                                              Bool_t PhotonicElectronDCA = kTRUE,\r
-                                              Bool_t PhiCut = kFALSE,\r
-                                              Bool_t QaPidSparse = kFALSE,\r
-                                              const char *Cent = "V0M",\r
-                                              Bool_t QC = kTRUE, // use qc2 and qc4\r
-                                              Bool_t SP_TPC = kTRUE, //use tpc sp method\r
-                                              Bool_t VZERO_SP = kFALSE, // use vzero sp method\r
-                                              Int_t harmonic = 2,\r
-                                              Bool_t shrinkSP = kTRUE,\r
-                                              Bool_t debug = kFALSE,\r
-                                              Int_t RPFilterBit = 1,\r
-                                              Bool_t op_ang = kFALSE,\r
-                                              Double_t op_angle_cut = 3.\r
-                                              )\r
-\r
-{\r
-\r
-\r
-\r
-    if(debug) cout << " === Adding Task ElectFlow === " << endl;    \r
-    TString fileName = AliAnalysisManager::GetCommonFileName();\r
-    fileName += ":ElectroID_";\r
-    fileName += uniqueID;\r
-    if(debug) cout << "    --> Reconstruction data container: " << fileName << endl;\r
-    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
-    if (!mgr) {\r
-        if(debug) cout << " Fatal error: no analysis manager found! " << endl;\r
-        return 0x0;\r
-    }\r
-    if (!mgr->GetInputEventHandler()) {\r
-        if(debug) cout << " Fatal error: no imput event handler found!" << endl;\r
-        return 0x0;\r
-    }\r
-\r
-//create a task\r
-  AliAnalysisTaskFlowTPCTOFQCSP *taskHFE = ConfigHFEStandardCuts(minTPCCluster, pixel);    //kTRUE if MC\r
-    \r
-  if(debug) cout << " === AliAnalysisTaskFlowTPCTOFQCSP === " << taskHFE << endl;\r
-  if(!taskHFE) {\r
-        if(debug) cout << " --> Unexpected error occurred: NO TASK WAS CREATED! (could be a library problem!) " << endl;\r
-        return 0x0;\r
-    }\r
-    \r
-// Set centrality percentiles and method V0M, FMD, TRK, TKL, CL0, CL1, V0MvsFMD, TKLvsV0M, ZEMvsZDC\r
-  taskHFE->SetCentralityParameters(centrMin, centrMax, Cent);\r
-  taskHFE->SetInvariantMassCut(InvmassCut);\r
-  taskHFE->SetpTCuttrack(pTCut);\r
-  taskHFE->SetTrigger(Trigger);\r
-  taskHFE->SetTPCS(TPCS);\r
-  taskHFE->SetVz(Vz);\r
-  taskHFE->SetIDCuts(minTPCnsigma, maxTPCnsigma, minTOFnSigma, maxTOFnSigma);\r
-  taskHFE->SetQAPIDSparse(QaPidSparse);\r
-  taskHFE->SetPhiCut(PhiCut);\r
-  taskHFE->SelectPhotonicElectronMethod(PhotonicElectronDCA);\r
-  taskHFE->SetOpeningAngleflag(op_ang);\r
-  taskHFE->SetOpeningAngleCut(op_angle_cut);\r
-    \r
-    \r
-//set RP cuts for flow package analysis\r
-  cutsRP = new AliFlowTrackCuts(Form("RFPcuts%s",uniqueID));\r
-    if(!cutsRP) {\r
-        if(debug) cout << " Fatal error: no RP cuts found, could be a library problem! " << endl;\r
-        return 0x0;\r
-    }\r
-\r
-    if(!VZERO_SP) {\r
-        AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kGlobal;\r
-        cutsRP->SetParamType(rptype);\r
-        cutsRP->SetAODfilterBit(RPFilterBit);\r
-        cutsRP->SetPtRange(0.2, 5.0);\r
-        cutsRP->SetEtaRange(-0.8, 0.8);\r
-        cutsRP->SetMinNClustersTPC(70);\r
-        cutsRP->SetMinChi2PerClusterTPC(0.1);\r
-        cutsRP->SetMaxChi2PerClusterTPC(4.0);\r
-        cutsRP->SetRequireTPCRefit(kTRUE);\r
-        cutsRP->SetMaxDCAToVertexXY(0.3);\r
-        cutsRP->SetMaxDCAToVertexZ(0.3);\r
-        cutsRP->SetAcceptKinkDaughters(kFALSE);\r
-        cutsRP->SetMinimalTPCdedx(10.);\r
-        if(debug) cout << "    --> kGlobal RP's " << cutsRP << endl;\r
-    }\r
-    if(VZERO_SP) { // use vzero sub analysis\r
-        cutsRP = cutsRP->GetStandardVZEROOnlyTrackCuts(); // select vzero tracks\r
-        SP_TPC = kFALSE; // disable other methods\r
-        QC = kFALSE;\r
-        if(debug) cout << "    --> VZERO RP's " << cutsRP << endl;\r
-    }\r
-\r
-    AliFlowTrackSimpleCuts *POIfilterLeft = new AliFlowTrackSimpleCuts();\r
-    AliFlowTrackSimpleCuts *POIfilterRight = new AliFlowTrackSimpleCuts();\r
-    if(SP_TPC){\r
-        POIfilterLeft->SetEtaMin(-0.8);\r
-        POIfilterLeft->SetEtaMax(0.0);\r
-        POIfilterLeft->SetMassMin(263731); POIfilterLeft->SetMassMax(263733);\r
-\r
-        POIfilterRight->SetEtaMin(0.0);\r
-        POIfilterRight->SetEtaMax(0.8);\r
-        POIfilterRight->SetMassMin(263731); POIfilterRight->SetMassMax(263733);\r
-    }\r
-\r
-    \r
-    AliFlowTrackSimpleCuts *POIfilterVZERO = new AliFlowTrackSimpleCuts();\r
-    if(VZERO_SP || QC){\r
-        POIfilterVZERO->SetEtaMin(-0.8);\r
-        POIfilterVZERO->SetEtaMax(0.8);\r
-        POIfilterVZERO->SetMassMin(263731); POIfilterVZERO->SetMassMax(263733);\r
\r
-    }\r
\r
-    \r
-    taskHFE->SetRPCuts(cutsRP);\r
\r
\r
- AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(Form("ccontainer0_%s",uniqueID.Data()),TList::Class(),AliAnalysisManager::kOutputContainer,fileName);\r
-  \r
- mgr->ConnectInput(taskHFE,0,mgr->GetCommonInputContainer());\r
- mgr->ConnectOutput(taskHFE,1,coutput3);\r
-    \r
\r
-    if(debug) cout << " === RECEIVED REQUEST FOR FLOW ANALYSIS === " << endl;\r
-    AliAnalysisDataContainer *flowEvent = mgr->CreateContainer(Form("FlowContainer_%s",uniqueID.Data()), AliFlowEventSimple::Class(), AliAnalysisManager::kExchangeContainer);\r
-    mgr->ConnectOutput(taskHFE, 2, flowEvent);\r
-    if(debug) cout << "    --> Created IO containers " << flowEvent << endl;   \r
-    \r
-    \r
-  mgr->AddTask(taskHFE);\r
-    \r
-    if (QC) {  // add qc tasks\r
-        TPCTOFnew::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
-        TPCTOFnew::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
-        TPCTOFnew::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
-        TPCTOFnew::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
-        TPCTOFnew::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
-\r
-    \r
-return taskHFE;\r
-\r
-}\r
-\r
-//_____________________________________________________________________________\r
-//_____________________________________________________________________________\r
-                    \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("hfeCuts","HFE Standard Cuts");  //TODO....change the cuts values to PbPb\r
-    //  hfecuts->CreateStandardCuts();\r
-    hfecuts->SetMinNClustersTPC(minTPCCulster);\r
-    hfecuts->SetMinNClustersITS(3);\r
-    hfecuts->SetMinNTrackletsTRD(0);\r
-    hfecuts->SetMinRatioTPCclusters(0.6);\r
-    \r
-    //   hfecuts->SetEtaRange(-0.9,0.9);\r
-    //   hfecuts->SetTPCmodes(AliHFEextraCuts::kFound, AliHFEextraCuts::kFoundOverFindable);\r
-    hfecuts->SetRequireITSPixel();\r
-    hfecuts->SetCutITSpixel(pixel);//kAny\r
-    hfecuts->SetMaxChi2perClusterITS(-1);\r
-    hfecuts->SetMaxChi2perClusterTPC(3.5);\r
-    hfecuts->SetCheckITSLayerStatus(kFALSE); // shud be put back\r
-    //  hfecuts->UnsetVertexRequirement();\r
-    hfecuts->SetVertexRange(10.);\r
-    hfecuts->SetRequireSigmaToVertex();\r
-    //hfecuts->SetSigmaToVertex(10);\r
-    hfecuts->SetTOFPIDStep(kFALSE);\r
-    //  hfecuts->SetQAOn();\r
-    hfecuts->SetPtRange(0, 30);\r
-    \r
-    AliAnalysisTaskFlowTPCTOFQCSP *task = new AliAnalysisTaskFlowTPCTOFQCSP("HFE_Flow_TPCTOF");\r
-    printf("*************************************************************");\r
-    printf("task -------------------------------------------- %p\n ", task);\r
-    printf("*************************************************************\n");\r
-\r
-    \r
-    task->SetHFECuts(hfecuts);\r
-    \r
-    //   task->SetInvariantMassCut(0.05);\r
-    //  task->SetRejectKinkMother(kTRUE);\r
-    //  task->SetRemovePileUp(kTRUE);\r
-    \r
-    // Define PID\r
- //   AliHFEpid *pid = task->GetPID();\r
- //   if(useMC) pid->SetHasMCData(kTRUE);\r
- //   pid->AddDetector("TPC", 0);\r
-   // pid->AddDetector("EMCAL", 1);\r
-    \r
- //   printf("*************************************\n");\r
- //   printf("Configuring standard Task:\n");\r
-    //  task->PrintStatus();\r
-  //  pid->PrintStatus();\r
-  //  printf("*************************************\n");\r
-    return task;\r
-    \r
-    \r
-}\r
-\r
-//_____________________________________________________________________________\r
-\r
-namespace TPCTOFnew{\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