]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/macros/mini/AddTaskLambdaStarPbPb.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / macros / mini / AddTaskLambdaStarPbPb.C
CommitLineData
e455cba6 1/***************************************************************************
2
3//
4// General macro to configure the RSN analysis task.
5// It calls all configs desired by the user, by means
6// of the boolean switches defined in the first lines.
7// ---
8// Inputs:
9// 1) flag to know if running on MC or data
10// 2) path where all configs are stored
11// ---
12// Returns:
13// kTRUE --> initialization successful
14// kFALSE --> initialization failed (some config gave errors)
15//
16****************************************************************************/
17
18AliRsnMiniAnalysisTask * AddTaskLambdaStarPbPb
19(
e455cba6 20 Bool_t isMC = kFALSE,
21 Bool_t isPP = kFALSE,
22 Int_t aodFilterBit = 5,
e455cba6 23 AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutPrCandidate = AliRsnCutSetDaughterParticle::kTPCTOFpidKstarPP2010,
e455cba6 24 AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate = AliRsnCutSetDaughterParticle::kTPCTOFpidKstarPP2010,
8b27ea0d 25 Float_t nsigmaPr = 2.0,
26 Float_t nsigmaKa = 2.0,
e455cba6 27 Bool_t enableMonitor = kTRUE,
28 Bool_t IsMcTrueOnly = kFALSE,
ad4155d3 29 UInt_t triggerMask = AliVEvent::kMB,
30 //Bool_t is2011PbPb = kFALSE,
31 Int_t nmix = 0,
e455cba6 32 Float_t maxDiffVzMix = 1.0,
33 Float_t maxDiffMultMix = 10.0,
34 Float_t maxDiffAngleMixDeg = 20.0,
35 Int_t aodN = 0,
36 TString outNameSuffix = ""
ad4155d3 37 )
e455cba6 38{
39 //
40 // -- INITIALIZATION ----------------------------------------------------------------------------
41 // retrieve analysis manager
42 //
ad4155d3 43
e455cba6 44 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
45 if (!mgr) {
ad4155d3 46 ::Error("AddTaskLambdaStarPbPb", "No analysis manager to connect to.");
47 return NULL;
e455cba6 48 }
ad4155d3 49
e455cba6 50 // create the task and configure
ad4155d3 51 TString taskName = Form("TPCLStar%s%s_%i%i_%s", (isPP? "pp" : "PbPb"), (isMC ? "MC" : "Data"), (Int_t)cutPrCandidate,(Int_t)cutKaCandidate,outNameSuffix.Data() );
e455cba6 52 AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC);
53 if (!isMC && !isPP){
ad4155d3 54
e455cba6 55 Printf(Form("========== SETTING USE CENTRALITY PATCH AOD049 : %s", (aodN==49)? "yes" : "no"));
ad4155d3 56 task->SetUseCentralityPatch(aodN==49);
e455cba6 57 }
ad4155d3 58 //if(is2011PbPb)
59 //task->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral);
60 //else
61
62 task->SelectCollisionCandidates(triggerMask);
63
64
e455cba6 65 if (isPP)
66 task->UseMultiplicity("QUALITY");
67 else
68 task->UseCentrality("V0M");
69 // set event mixing options
70 task->UseContinuousMix();
71 //task->UseBinnedMix();
72 task->SetNMix(nmix);
73 task->SetMaxDiffVz(maxDiffVzMix);
74 task->SetMaxDiffMult(maxDiffMultMix);
75 if (!isPP) task->SetMaxDiffAngle(maxDiffAngleMixDeg*TMath::DegToRad()); //set angle diff in rad
76 ::Info("AddTaskLambdaStarPbPb", Form("Event mixing configuration: \n events to mix = %i \n max diff. vtxZ = cm %5.3f \n max diff multi = %5.3f \n max diff EP angle = %5.3f deg", nmix, maxDiffVzMix, maxDiffMultMix, (isPP ? 0.0 : maxDiffAngleMixDeg)));
77
78 mgr->AddTask(task);
79
80 //
81 // -- EVENT CUTS (same for all configs) ---------------------------------------------------------
82 //
83 // cut on primary vertex:
84 // - 2nd argument --> |Vz| range
85 // - 3rd argument --> minimum required number of contributors
86 // - 4th argument --> tells if TPC stand-alone vertexes must be accepted
87 AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
88 if (isPP) cutVertex->SetCheckPileUp(kTRUE); // set the check for pileup
89
90 // define and fill cut set for event cut
91 AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent);
92 eventCuts->AddCut(cutVertex);
93 eventCuts->SetCutScheme(cutVertex->GetName());
94 // set cuts in task
95 task->SetEventCuts(eventCuts);
96
97 //
98 // -- EVENT-ONLY COMPUTATIONS -------------------------------------------------------------------
99 //
100 //vertex
101 Int_t vtxID = task->CreateValue(AliRsnMiniValue::kVz, kFALSE);
102 AliRsnMiniOutput *outVtx = task->CreateOutput("eventVtx", "HIST", "EVENT");
103 outVtx->AddAxis(vtxID, 400, -20.0, 20.0);
104
105 //multiplicity or centrality
106 Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
107 AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT");
108 if (isPP)
109 outMult->AddAxis(multID, 400, 0.0, 400.0);
110 else
111 outMult->AddAxis(multID, 100, 0.0, 100.0);
112
113 //event plane (only for PbPb)
ad4155d3 114 Int_t planeID = task->CreateValue(AliRsnMiniValue::kPlaneAngle, kFALSE);
115 AliRsnMiniOutput *outPlane = task->CreateOutput("eventPlane", "HIST", "EVENT");
116 if (!isPP)
e455cba6 117 outPlane->AddAxis(planeID, 180, 0.0, TMath::Pi());
ad4155d3 118
119
120
e455cba6 121 //
122 // -- PAIR CUTS (common to all resonances) ------------------------------------------------------
123 //
124 AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange);
125 cutY->SetRangeD(-0.5, 0.5);
126
127 AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother);
128 cutsPair->AddCut(cutY);
129 cutsPair->SetCutScheme(cutY->GetName());
130
131 //
132 // -- CONFIG ANALYSIS --------------------------------------------------------------------------
133
ad4155d3 134 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/RESONANCES/macros/mini/ConfigLambdaStarPbPb.C");
cb99ab07 135 if (!ConfigLambdaStarPbPb(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPrCandidate, cutKaCandidate, nsigmaPr, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, aodN)) return 0x0;
ad4155d3 136
137
e455cba6 138 //
139 // -- CONTAINERS --------------------------------------------------------------------------------
140 //
141 TString outputFileName = AliAnalysisManager::GetCommonFileName();
142 // outputFileName += ":Rsn";
143 Printf("AddTaskLambdaStarPbPb - Set OutputFileName : \n %s\n", outputFileName.Data() );
144
145 AliAnalysisDataContainer *output = mgr->CreateContainer(Form("RsnOut_%s",outNameSuffix.Data()),
146 TList::Class(),
147 AliAnalysisManager::kOutputContainer,
148 outputFileName);
149 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
150 mgr->ConnectOutput(task, 1, output);
151
152 return task;
153}