//
// AddTaskPhiFlow macro
// Author: Redmer A. Bertens, Utrecht University, 2012
+// Many thanks to Carlos Perez Lara
+// Commented where necessary
/////////////////////////////////////////////////////////////////////////////////////////////
-AliAnalysisTaskPhiFlow* AddTaskPhiFlow( Float_t centrMin = 30.,
- Float_t centrMax = 40.,
- Float_t vertexZ = 10.,
- Float_t bayesThresholdP = 0.5,
- Float_t minEtaA = -0.8,
- Float_t maxEtaA = 0.,
- Float_t minEtaB = 0.,
- Float_t maxEtaB = 0.8,
- Float_t deltaDip = 0.0,
- Float_t deltaDipMaxPt = 0.0,
- Float_t eventPlanePtCut = 10,
- AliAnalysisTaskPhiFlow::PIDtype pidtype = AliAnalysisTaskPhiFlow::kCombined)
-{
- TString centralityName("");
- centralityName += Form("%.0f", centrMin);
- centralityName += "-";
- centralityName += Form("%.0f", centrMax);
- centralityName += "_";
- centralityName += Form("vZ%.1f", vertexZ);
- centralityName += "_";
- centralityName += Form("bayP%.1f", bayesThresholdP);
- centralityName += "_";
- centralityName += "_EtaA";
- centralityName += Form("%.1f", minEtaA);
- centralityName += "-";
- centralityName += Form("%.1f", maxEtaA);
- centralityName += "_EtaB";
- centralityName += Form("%.1f", minEtaB);
- centralityName += "-";
- centralityName += Form("%.1f", maxEtaB);
- centralityName += "-";
- centralityName += Form("dDip%.f", deltaDip);
- centralityName += "-";
- centralityName += Form("dDipPt%.f", deltaDipMaxPt);
- centralityName += "-";
- centralityName += Form("epPtCut%.f", eventPlanePtCut);
+class AliAnalysisDataContainer;
+class AliFlowTrackCuts;
+class AliFlowTrackSimpleCuts;
+class AliFlowEventCuts;
+class AliFlowEventSimpleCuts;
+class AliAnalysisDataContainer;
+
+AliAnalysisTaskPhiFlow* AddTaskPhiFlow(Bool_t SP = kTRUE,
+ Bool_t SPSUB = kTRUE,
+ Bool_t QC = kTRUE,
+ Bool_t EP = kTRUE,
+ Float_t centrMin = 20.,
+ Float_t centrMax = 30.,
+ Double_t PIDconfig[7],
+ TString suffixName = "",
+ Bool_t bCentralTrigger = kFALSE,
+ Float_t EtaGap = 0.,
+ Float_t POIEtaMin = -0.8,
+ Float_t POIEtaMax = 0.8,
+ Float_t POIPtMin = 0.15,
+ Float_t POIPtMax = 10.,
+ Float_t deltaDip = 0.,
+ Float_t deltaDipMaxPt = 0.,
+ Float_t DCA = 0.3,
+ Int_t harm = 2,
+ Bool_t TPCStandAloneTracks = kFALSE,
+ Bool_t useGlobalRPCuts = kTRUE,
+ Float_t vertexZ = 10.,
+ Bool_t shrinkSP = kTRUE,
+ Bool_t debug = kTRUE)
+{
+ // main function, create and add tasks
+ if(debug) cout << " === Adding Task PhiFlow === " << endl;
+ // set up main output container's name
TString fileName = AliAnalysisManager::GetCommonFileName();
fileName += ":PhiV2FlowEvents";
-
- // get the manager
+ if(debug) cout << " --> Reconstruction data container: " << fileName << endl;
+ // check validity of arguments
+ if((!SPSUB)&&(EtaGap > 0.)) {
+ if(debug) cout << " --> Fatal error: Eta gap is introduced but method SPSUB is not enabled !!! <-- " << endl;
+ return 0x0;
+ }
+ else if ((QC||SP||EP)&&(EtaGap > 0.)) {
+ if(debug) cout << " --> Fatal error: one or more of the flow analyses is not compatible with the Eta Gap !!! <--" << endl;
+ return 0x0;
+ }
+ // get the manager and input event handler
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
- if (!mgr)
- {
- ::Error("AddTaskPhiV2", "No analysis manager to connect to.");
- return NULL;
+ if (!mgr) {
+ if(debug) cout << " Fatal error: no analysis manager found! " << endl;
+ return 0x0;
}
- if (!mgr->GetInputEventHandler())
- {
- ::Error("AddTaskPhiV2", "This task requires an input event handler");
- return NULL;
+ if (!mgr->GetInputEventHandler()) {
+ if(debug) cout << " Fatal error: no imput event handler found!" << endl;
+ return 0x0;
}
-
// create the main task
AliAnalysisTaskPhiFlow *task = new AliAnalysisTaskPhiFlow("TaskPhiFlow");
- task->SelectCollisionCandidates(AliVEvent::kMB);
-
- // set RP cuts for EP method
- AliFlowTrackCuts* cutsRP = new AliFlowTrackCuts("GlobalRP");
- cutsRP->GetStandardTPCStandaloneTrackCuts();
-
- // set POI cuts for EP method
+ if(debug) cout << " === AliAnalysisTaskPhiFlow === " << task << endl;
+ if(!task) {
+ if(debug) cout << " --> Unexpected error occurred: NO TASK WAS CREATED! (could be a library problem!) " << endl;
+ return 0x0;
+ }
+ // set triggers
+ if (bCentralTrigger) task->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral);
+ else task->SelectCollisionCandidates(AliVEvent::kMB);
+ if(debug) cout << " --> Set trigger selection to ";
+ if(debug&&bCentralTrigger) cout << " kMB, kCentral, kSemiCentral " << endl;
+ if(debug&&(!bCentralTrigger)) cout << " kMB " << endl;
+ //set RP cuts for flow package analysis
+ cutsRP = new AliFlowTrackCuts("RFPcuts");
+ if(!cutsRP) {
+ if(debug) cout << " Fatal error: no RP cuts found, could be a library problem! " << endl;
+ return 0x0;
+ }
+ if(useGlobalRPCuts) {
+ AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kGlobal;
+ cutsRP->SetParamType(rptype);
+ cutsRP->SetPtRange(0.2, 5.0);
+ cutsRP->SetEtaRange(-0.8, 0.8);
+ cutsRP->SetMinNClustersTPC(70);
+ cutsRP->SetMinChi2PerClusterTPC(0.1);
+ cutsRP->SetMaxChi2PerClusterTPC(4.0);
+ cutsRP->SetRequireTPCRefit(kTRUE);
+ cutsRP->SetMaxDCAToVertexXY(0.3);
+ cutsRP->SetMaxDCAToVertexZ(0.3);
+ cutsRP->SetAcceptKinkDaughters(kFALSE);
+ cutsRP->SetMinimalTPCdedx(10.);
+ if(debug) cout << " --> kGlobal RP's " << cutsRP << endl;
+ }
+ if(!useGlobalRPCuts) {
+ AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kTPCstandalone;
+ cutsRP->SetParamType(rptype);
+ cutsRP->SetPtRange(0.2,5.);
+ cutsRP->SetEtaRange(-0.8,0.8);
+ cutsRP->SetMinNClustersTPC(70);
+ cutsRP->SetMinChi2PerClusterTPC(0.2);
+ cutsRP->SetMaxChi2PerClusterTPC(4.0);
+ cutsRP->SetMaxDCAToVertexXY(3.0);
+ cutsRP->SetMaxDCAToVertexZ(3.0);
+ cutsRP->SetDCAToVertex2D(kTRUE);
+ cutsRP->SetAcceptKinkDaughters(kFALSE);
+ cutsRP->SetMinimalTPCdedx(10.);
+ if(debug) cout << " --> kTPCStandAlone RP's " << cutsRP << endl;
+ }
+ task->SetRPCuts(cutsRP);
+ // set POI cuts for kaon selection
AliFlowTrackCuts* cutsPOI = new AliFlowTrackCuts("GlobalPOI");
- cutsPOI->GetStandardGlobalTrackCuts2010();
-
- // set and configure kaon track cuts (for the bayesian PID method)
- // select this method by setting PIDtype to kCombined
- AliFlowTrackCuts* cutsKaon = new AliFlowTrackCuts("kaon_cuts");
- AliFlowTrackCuts::PIDsource pid = AliFlowTrackCuts::kTPCbayesian;
- cutsKaon->SetPID(AliPID::kKaon, pid, bayesThresholdP);
- cutsKaon->SetAllowTOFmismatchFlag(kTRUE);
- cutsKaon->SetRequireStrictTOFTPCagreement(kFALSE);
-
- // set some more cuts ...
- task->EventPlanePtCut(kTRUE); // set to true to enforce pt cut on event plane tracks
- task->SetEventPlanePtCut(eventPlanePtCut); // set the upper value for Pt
- task->SetMaxDeltaDipAngleAndPt(deltaDip, deltaDipMaxPt); // set an upper value for d-dip angle and pt of tracks on which this should be applied
+ if(!cutsPOI) {
+ if(debug) cout << " Fatal error: no POI cuts (could be a library problem)!" << endl;
+ return 0x0;
+ }
+ AliFlowTrackCuts* cutsPOI = cutsPOI->GetStandardGlobalTrackCuts2010();
+ cutsPOI->SetPtRange(0.2, 5); //?
+ cutsPOI->SetMaxDCAToVertexXY(DCA);
+ cutsPOI->SetMaxDCAToVertexZ(DCA);
+ if(debug) cout << " --> cutsPOI " << cutsPOI << endl;
+ task->SetPOICuts(cutsPOI);
+ // POI filter cuts, will filter invm mass bands and subevents
+ AliFlowTrackSimpleCuts* POIfilterQC[30];
+ AliFlowTrackSimpleCuts* POIfilterSP[30][2];
+ Double_t flowBands[2][30];
+ for (Int_t mb = 0; mb < 30; mb++) {
+ flowBands[0][mb] = 0.99 + mb * 0.0034;
+ flowBands[1][mb] = 0.99 + (mb + 1) * 0.0034;
+ POIfilterSP[mb][0] = new AliFlowTrackSimpleCuts(Form("FilterPOISP_MB%d_ETANEG", mb));
+ if(!POIfilterSP[mb][0]) {
+ if(debug) cout << " FAILED to initialize POI filters, could be a library problem!" << endl;
+ return 0x0;
+ }
+ POIfilterSP[mb][0]->SetEtaMin(-0.8);
+ POIfilterSP[mb][0]->SetEtaMax(0.);
+ POIfilterSP[mb][0]->SetMassMin(flowBands[0][mb]);
+ POIfilterSP[mb][0]->SetMassMax(flowBands[1][mb]);
+ POIfilterSP[mb][1] = new AliFlowTrackSimpleCuts(Form("FilterPOISP_MB%d_ETAPOS", mb));
+ POIfilterSP[mb][1]->SetEtaMin(0.);
+ POIfilterSP[mb][1]->SetEtaMax(+0.8);
+ POIfilterSP[mb][1]->SetMassMin(flowBands[0][mb]);
+ POIfilterSP[mb][1]->SetMassMax(flowBands[1][mb]);
+ POIfilterQC[mb] = new AliFlowTrackSimpleCuts(Form("FilterPOIQC_MB%d", mb));
+ POIfilterQC[mb]->SetEtaMin(-0.8);
+ POIfilterQC[mb]->SetEtaMax(+0.8);
+ POIfilterQC[mb]->SetMassMin(flowBands[0][mb]);
+ POIfilterQC[mb]->SetMassMax(flowBands[1][mb]);
+ }
+ if(debug) cout << " --> Created poi filters " << endl;
+ task->SetCommonConstants(30, flowBands[0][0], flowBands[1][29]);
+ if(debug) cout << " --> Set common constants " << endl;
+ // set pair and event cuts
+ if((deltaDip>0.005)&&(deltaDipMaxPt>0.005)) task->SetMaxDeltaDipAngleAndPt(deltaDip, deltaDipMaxPt);
+ else cout << " --> Disabled Delta-Dip exclusion. <-- " << endl;
+ task->SetCandidateEtaAndPt(POIEtaMin, POIEtaMax, POIPtMin, POIPtMax);
task->SetCentralityParameters(centrMin, centrMax, "V0M");
task->SetVertexZ(vertexZ);
- task->SetRPCuts(cutsRP);
- task->SetPOICuts(cutsPOI);
-
+ if(debug) cout << " --> Set pair cuts and event cuts" << endl;
// set the kaon cuts, and specify the PID procedure which will be used
- task->SetKaonCuts(cutsKaon);
- task->SetIdentificationType(pidtype);
-
- //set RP cuts for flow package analysis
- cutsFlowRP = new AliFlowTrackCuts("rp_cuts_111");
- AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kGlobal;
- cutsFlowRP->SetParamType(rptype);
- cutsFlowRP->SetPtRange(0.2, 5.0);
- cutsFlowRP->SetEtaRange(-0.8, 0.8);
- cutsFlowRP->SetMinNClustersTPC(70);
- cutsFlowRP->SetMinChi2PerClusterTPC(0.1);
- cutsFlowRP->SetMaxChi2PerClusterTPC(4.0);
- cutsFlowRP->SetRequireTPCRefit(kTRUE);
- cutsFlowRP->SetMaxDCAToVertexXY(0.3);
- cutsFlowRP->SetMaxDCAToVertexZ(0.3);
- cutsFlowRP->SetAcceptKinkDaughters(kFALSE);
- cutsFlowRP->SetMinimalTPCdedx(10.);
-
- Double_t flowBands[2][30];
- for (Int_t i = 0; i < 30; i++)
- {
- flowBands[0][i] = 0.99 + i * 0.0034;
- flowBands[1][i] = 0.99 + (i + 1) * 0.0034;
+ task->SetPIDConfiguration(PIDconfig);
+ if(debug) {
+ cout << " ************ Configured PID routine ************ " << endl;
+ cout << " 0 < " << PIDconfig[1] << " p_t, ITS || TPC with s < " << PIDconfig[0] << endl;
+ if(PIDconfig[2] < 0.) cout << " --> TPC control disabled " << endl;
+ if(PIDconfig[2] > 0.) cout << " --> TPC control enabled " << endl;
+ cout << " " << PIDconfig[1] << " < " << PIDconfig[4] << " p_t, TPC || ITS with s < " << PIDconfig[3] << endl;
+ if(PIDconfig[5] < 0.) cout << " --> ITS control disabled " << endl;
+ if(PIDconfig[5] > 0.) cout << " --> ITS control enabled " << endl;
+ cout << " " << PIDconfig[4] << " < 7 p_t, TPC / TOF Bayesian with p < " << PIDconfig[6] << endl;
+ cout << " ************************************************ " << endl;
}
- task->SetMassRanges(flowBands);
- task->SetEtaRanges(minEtaA, maxEtaA, minEtaB, maxEtaB);
- task->SetFlowRPCuts(cutsFlowRP);
- mgr->AddTask(task);
-
- AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
- AliAnalysisDataContainer *coutput = mgr->CreateContainer(Form("PhiV2_%s", centralityName.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);
-
- AliAnalysisDataContainer *coutputCandidates[30];
-
- for (int r = 0; r != 30; ++r)
- {
- coutputCandidates[r] = mgr->CreateContainer(
- Form("Flow_MassBand_%d", r),
- AliFlowEventSimple::Class(), AliAnalysisManager::kExchangeContainer);
- mgr->ConnectOutput(task, 2 + r, coutputCandidates[r]);
+ if (TPCStandAloneTracks)
+ { // switch to tpc standalone tracks for POI selection
+ if(debug) cout << " --> Switching to TPC standalone analsis " << endl;
+ task->SetRequireStrictKaonCuts();
+ task->SetRequireTPCStandAloneKaons();
}
-
- // Scalar Product
- AliAnalysisTaskScalarProduct *taskSP[30];
- AliAnalysisDataContainer *coutputSP[30];
- for (int r = 0; r != 30; ++r)
- {
- taskSP[r] = new AliAnalysisTaskScalarProduct(Form("SP_MassBand_%d", r), kFALSE);
- taskSP[r]->SetRelDiffMsub(1.0);
- taskSP[r]->SetApplyCorrectionForNUA(kTRUE);
- mgr->AddTask(taskSP[r]);
- coutputSP[r] = mgr->CreateContainer(Form("cobjSP_MassBand_%d", r), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);
- mgr->ConnectInput(taskSP[r], 0, coutputCandidates[r]);
- mgr->ConnectOutput(taskSP[r], 1, coutputSP[r]);
- }
- // Q-Cumulants
- AliAnalysisTaskQCumulants *taskQC[30];
- AliAnalysisDataContainer *coutputQC[30];
- for (int r = 0; r != 30; ++r)
+ // create and configure IO containers
+ AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
+ AliAnalysisDataContainer *coutHist = mgr->CreateContainer(Form("PhiV2_%s", OutputName(centrMin, centrMax,PIDconfig, suffixName, bCentralTrigger, EtaGap, POIEtaMin, POIEtaMax, POIPtMin, POIPtMax, deltaDip, deltaDipMaxPt, DCA, harm, TPCStandAloneTracks, vertexZ, debug, useGlobalRPCuts).Data()), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);
+ if(debug) cout << " --> Created IO containers " << cinput << ", " << coutHist << endl;
+ mgr->AddTask(task);
+ if(debug) cout << " === ADDING MAIN TASK == " << endl;
+ mgr->ConnectInput(task, 0, cinput);
+ mgr->ConnectOutput(task, 1, coutHist);
+ if(debug) cout << " --> Connected IO containers " << endl;
+ if (SP || EP || QC || SPSUB) // if flow analysis should be done after reconstruction
{
- taskQC[r] = new AliAnalysisTaskQCumulants(Form("QC_MassBand_%d", r), kFALSE);
- taskQC[r]->SetCalculateCumulantsVsM(kFALSE);
- taskQC[r]->SetnBinsMult(10000);
- taskQC[r]->SetMinMult(0.);
- taskQC[r]->SetMaxMult(10000.);
- taskQC[r]->SetApplyCorrectionForNUA(kTRUE);
- taskQC[r]->SetFillMultipleControlHistograms(kFALSE);
- mgr->AddTask(taskQC[r]);
- coutputQC[r] = mgr->CreateContainer(Form("cobjQC_MassBand_%d", r), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);
- mgr->ConnectInput(taskQC[r], 0, coutputCandidates[r]);
- mgr->ConnectOutput(taskQC[r], 1, coutputQC[r]);
+ if(debug) cout << " === RECEIVED REQUEST FOR FLOW ANALYSIS === " << endl;
+ AliAnalysisDataContainer *flowEvent = mgr->CreateContainer("FlowContainer", AliFlowEventSimple::Class(), AliAnalysisManager::kExchangeContainer);
+ mgr->ConnectOutput(task, 2, flowEvent);
+ if(debug) cout << " --> Created IO containers " << flowEvent << endl;
+ // set a suffixname as a unique identifier for each wagon
+ if (suffixName == "")
+ {
+ suffixName += Form("%.0f", centrMin);
+ suffixName += Form("%.0f", centrMax);
+ }
+ if(debug) cout << " --> suffixName " << suffixName << endl;
+ for (int mb = 0; mb != 30; ++mb) {
+ if (QC) { // add qc tasks
+ AddQCmethod(Form("QCTPCMB_%d_%s", mb, suffixName.Data()), harm, flowEvent, POIfilterQC[mb], debug);
+ if(debug) cout << " --> Hanging QC task ... " << mb << " succes! "<< endl;
+ }
+ if (SPSUB) { // add sp subevent tasks
+ AddSPmethod(Form("SPTPCMB_%d_%s", mb, suffixName.Data()), -0.8, -.5*EtaGap, .5*EtaGap, +0.8, "Qa", harm, flowEvent, POIfilterSP[mb][1], NULL, false, shrinkSP, debug, true);
+ if(debug) cout << " --> Hanging SP Qa task " << mb << " succes!" << endl;
+ AddSPmethod(Form("SPTPCMB_%d_%s", mb, suffixName.Data()), -0.8, -.5*EtaGap, .5*EtaGap, +0.8, "Qb", harm, flowEvent, POIfilterSP[mb][0], NULL, false, shrinkSP, debug, true);
+ if(debug) cout << " --> Hanging SP Qb task ..." << mb << " succes!"<< endl;
+ }
+ if (SP) { // add sp tasks
+ AddSPmethod(Form("SPTPCMB_%d_%s", mb, suffixName.Data()), -0.8, -0.0, +0.0, +0.8, "QaQb", harm, flowEvent, POIfilterQC[mb], NULL, false, shrinkSP, debug);
+ if(debug) cout << " --> Hanging SP task ... " << mb << " succes!" << endl;
+ }
+ if (EP) { // add ep tasks
+ AddSPmethod(Form("EPTPCMB_%d_%s", mb, suffixName.Data()), -0.8, -0.0, +0.0, +0.8, "QaQb", harm, flowEvent, POIfilterQC[mb], NULL, true, shrinkSP, debug);
+ if(debug) cout << " --> Hanging EP task ... " << mb << " succes!" << endl;
+ }
+ }
}
-
- mgr->ConnectInput(task, 0, cinput);
- mgr->ConnectOutput(task, 1, coutput);
-
- // return the task
+ // print summary to screen
+ cout << endl << endl << " ========= AddTaskPhiFlow launched succesfully - SUMMARY: ========== " << endl;
+ cout << " ************ Configured PID routine ************ " << endl;
+ cout << " 0 < " << PIDconfig[1] << " p_t, ITS || TPC with s < " << PIDconfig[0] << endl;
+ if(PIDconfig[2] < 0.) cout << " --> TPC control disabled " << endl;
+ if(PIDconfig[2] > 0.) cout << " --> TPC control enabled " << endl;
+ cout << " " << PIDconfig[1] << " < " << PIDconfig[4] << " p_t, TPC || ITS with s < " << PIDconfig[3] << endl;
+ if(PIDconfig[5] < 0.) cout << " --> ITS control disabled " << endl;
+ if(PIDconfig[5] > 0.) cout << " --> ITS control enabled " << endl;
+ cout << " " << PIDconfig[4] << " < 7 p_t, TPC / TOF Bayesian with p < " << PIDconfig[6] << endl;
+ cout << " ************************************************ " << endl << endl;
+ cout << " ************* Task statistics ****************** " << endl;
+ if(SP) cout << " --> Launched 30 QaQb SP filters and corresponding 30 SP tasks " << endl;
+ if(EP) cout << " --> Launched 30 QaQb QC filters and corresponding 30 EP tasks " << endl;
+ if(SPSUB) cout << " --> Launched 30+30 Qa&&Qb SP filters and corresponding 30+30 SP tasks " << endl;
+ if(QC) cout << " --> Launched 30 QaQb QC filters and corresponding 30 QC tasks " << endl;
+ cout << " ************************************************** " << endl;
+ cout << " --> Now go for a coffee! <-- " << endl;
return task;
-};
+}
+//_____________________________________________________________________________
+void AddSPmethod(char *name, double minEtaA, double maxEtaA, double minEtaB, double maxEtaB, char *Qvector, int harmonic, AliAnalysisDataContainer *flowEvent, AliFlowTrackSimpleCuts *cutsPOI = NULL, AliFlowTrackSimpleCuts *cutsRFP = NULL, bool bEP, bool shrink = false, bool debug, bool etagap = false)
+{
+ // add sp task and invm filter tasks
+ if(debug) (bEP) ? cout << " ****** Reveived request for EP task ****** " << endl : cout << " ******* Switching to SP task ******* " << endl;
+ TString fileName = AliAnalysisManager::GetCommonFileName();
+ (bEP) ? fileName+=":EP" : fileName+=":SP";
+ if(etagap) {
+ fileName+="_SUBEVENTS";
+ if(debug) cout << " --> Setting up subevent analysis <-- " << endl;
+ }
+ if(debug) cout << " --> fileName " << fileName << endl;
+ TString myFolder = fileName;
+ if(debug) cout << " --> myFolder " << myFolder << endl;
+ TString myNameSP;
+ (bEP) ? myNameSP = Form("%sEPv%d%s", name, harmonic, Qvector): myNameSP = Form("%sSPv%d%s", name, harmonic, Qvector);
+ if(debug) cout << " myNameSP " << myNameSP << endl;
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ AliAnalysisDataContainer *flowEvent2 = mgr->CreateContainer(Form("Filter_%s", myNameSP.Data()), AliFlowEventSimple::Class(), AliAnalysisManager::kExchangeContainer);
+ AliAnalysisTaskFilterFE *tskFilter = new AliAnalysisTaskFilterFE(Form("TaskFilter_%s", myNameSP.Data()), cutsRFP, cutsPOI);
+ tskFilter->SetSubeventEtaRange(minEtaA, maxEtaA, minEtaB, maxEtaB);
+ mgr->AddTask(tskFilter);
+ mgr->ConnectInput(tskFilter, 0, flowEvent);
+ mgr->ConnectOutput(tskFilter, 1, flowEvent2);
+ AliAnalysisDataContainer *outSP = mgr->CreateContainer(myNameSP.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);
+ AliAnalysisTaskScalarProduct *tskSP = new AliAnalysisTaskScalarProduct(Form("TaskScalarProduct_%s", myNameSP.Data()), kFALSE);
+ tskSP->SetApplyCorrectionForNUA(kTRUE);
+ tskSP->SetHarmonic(harmonic);
+ tskSP->SetTotalQvector(Qvector);
+ if (bEP) tskSP->SetBehaveAsEP();
+ if (shrink) tskSP->SetBookOnlyBasicCCH(kTRUE);
+ mgr->AddTask(tskSP);
+ mgr->ConnectInput(tskSP, 0, flowEvent2);
+ mgr->ConnectOutput(tskSP, 1, outSP);
+}
+//_____________________________________________________________________________
+void AddQCmethod(char *name, int harmonic, AliAnalysisDataContainer *flowEvent, AliFlowTrackSimpleCuts *cutsPOI = NULL, Bool_t debug, AliFlowTrackSimpleCuts *cutsRFP = NULL)
+{
+ // add qc task and invm filter tasks
+ if(debug) cout << " ****** Received request for QC v" << harmonic << " task " << name << ", POI " << cutsPOI << ", IO ****** " << flowEvent << endl;
+ TString fileName = AliAnalysisManager::GetCommonFileName();
+ fileName+=":QC";
+ if(debug) cout << " --> Common filename: " << fileName << endl;
+ TString myFolder = Form("v%d", harmonic);
+ if(debug) cout << " --> myFolder: " << myFolder << endl;
+ TString myName = Form("%s", name);
+ if(debug) cout << " --> myName: " << myName << endl;
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ AliAnalysisDataContainer *flowEvent2 = mgr->CreateContainer(Form("Filter_%s", myName.Data()), AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
+ AliAnalysisTaskFilterFE *tskFilter = new AliAnalysisTaskFilterFE(Form("TaskFilter_%s", myName.Data()), cutsRFP, cutsPOI);
+ mgr->AddTask(tskFilter);
+ mgr->ConnectInput(tskFilter, 0, flowEvent);
+ mgr->ConnectOutput(tskFilter, 1, flowEvent2);
+ AliAnalysisDataContainer *outQC = mgr->CreateContainer(myName.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);
+ AliAnalysisTaskQCumulants *tskQC = new AliAnalysisTaskQCumulants(Form("TaskQCumulants_%s", myName.Data()), kFALSE);
+ tskQC->SetApplyCorrectionForNUA(kTRUE);
+ tskQC->SetHarmonic(harmonic);
+ tskQC->SetBookOnlyBasicCCH(kTRUE);
+ mgr->AddTask(tskQC);
+ mgr->ConnectInput(tskQC, 0, flowEvent2);
+ mgr->ConnectOutput(tskQC, 1, outQC);
+}
+//_____________________________________________________________________________
+TString OutputName( Float_t centrMin,
+ Float_t centrMax,
+ Double_t PIDconfig[7],
+ TString suffixName,
+ Bool_t bCentralTrigger,
+ Float_t EtaGap,
+ Float_t POIEtaMin,
+ Float_t POIEtaMax,
+ Float_t POIPtMin,
+ Float_t POIPtMax,
+ Float_t deltaDip,
+ Float_t deltaDipMaxPt,
+ Float_t DCA,
+ Int_t harm,
+ Bool_t TPCStandAloneTracks,
+ Float_t vertexZ,
+ Bool_t debug,
+ Bool_t useGlobalRPCuts)
+{
+ // generate output name
+ TString centralityName = ("");
+ centralityName += Form("%.0f", centrMin);
+ centralityName += Form("%.0f", centrMax);
+ centralityName += "_";
+ centralityName += Form("vZ%.f", vertexZ);
+ centralityName += "_";
+ for(Int_t i = 0; i < 7; i++) centralityName += Form("%.1f_", PIDconfig[i]);
+ centralityName += "_POIEta";
+ centralityName += Form("%.1f", POIEtaMin);
+ centralityName += Form("%.1f", POIEtaMax);
+ centralityName += "_gap";
+ centralityName += Form("%.1f", -0.5*EtaGap);
+ centralityName += Form("%.1f", 0.5*EtaGap);
+ centralityName += "_";
+ centralityName += Form("dDip%.2f", deltaDip);
+ centralityName += "-";
+ centralityName += Form("dDipPt%.2f", deltaDipMaxPt);
+ if (TPCStandAloneTracks) {
+ centralityName += "-";
+ centralityName += "TPCStandAloneTracks";
+ }
+ if (bCentralTrigger) {
+ centralityName += "-";
+ centralityName += "kMBkCkSC";
+ }
+ if (!useGlobalRPCuts) {
+ centralityName += "-";
+ centralityName += "TPCRP";
+ }
+ if(debug) cout << " --> centralityName " << centralityName << endl;
+ return centralityName;
+}
+//_____________________________________________________________________________