]>
Commit | Line | Data |
---|---|---|
6184d9a9 | 1 | /*************************************************************************** |
2 | fbellini@cern.ch - last modified on 06/08/2012 | |
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 | ||
18 | AliRsnMiniAnalysisTask * AddAnalysisTaskTPCKStar | |
19 | ( | |
20 | Bool_t isMC, | |
21 | Bool_t isPP, | |
22 | Int_t aodFilterBit = 5, | |
23 | AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutPiCandidate = AliRsnCutSetDaughterParticle::kFastTPCpidNsigma, | |
24 | AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate = AliRsnCutSetDaughterParticle::kFastTPCpidNsigma, | |
25 | Float_t nsigmaPi = 2.0, | |
26 | Float_t nsigmaKa = 2.0, | |
27 | Bool_t enableMonitor = kTRUE, | |
28 | Bool_t IsMcTrueOnly = kFALSE, | |
8790f85b | 29 | Bool_t is2011PbPb = kFALSE, |
6184d9a9 | 30 | Int_t nmix = 0, |
31 | Float_t maxDiffVzMix = 1.0, | |
32 | Float_t maxDiffMultMix = 10.0, | |
33 | Float_t maxDiffAngleMixDeg = 20.0, | |
34 | Int_t aodN = 0, | |
35 | TString outNameSuffix = "" | |
36 | ) | |
37 | { | |
38 | // | |
39 | // -- INITIALIZATION ---------------------------------------------------------------------------- | |
40 | // retrieve analysis manager | |
41 | // | |
42 | ||
43 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
44 | if (!mgr) { | |
45 | ::Error("AddAnalysisTaskTPCKStar", "No analysis manager to connect to."); | |
46 | return NULL; | |
47 | } | |
48 | ||
49 | // create the task and configure | |
50 | TString taskName = Form("TPCKStar%s%s_%i%i", (isPP? "pp" : "PbPb"), (isMC ? "MC" : "Data"), (Int_t)cutPiCandidate,(Int_t)cutKaCandidate ); | |
51 | AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC); | |
52 | if (!isMC && !isPP){ | |
53 | Printf(Form("========== SETTING USE CENTRALITY PATCH AOD049 : %s", (aodN==49)? "yes" : "no")); | |
54 | task->SetUseCentralityPatch(aodN==49); | |
55 | } | |
8790f85b | 56 | |
57 | if(is2011PbPb) | |
58 | task->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral); | |
59 | else | |
60 | task->SelectCollisionCandidates(AliVEvent::kMB); | |
61 | ||
62 | ||
6184d9a9 | 63 | if (isPP) |
64 | task->UseMultiplicity("QUALITY"); | |
65 | else | |
66 | task->UseCentrality("V0M"); | |
67 | // set event mixing options | |
68 | task->UseContinuousMix(); | |
69 | //task->UseBinnedMix(); | |
70 | task->SetNMix(nmix); | |
71 | task->SetMaxDiffVz(maxDiffVzMix); | |
72 | task->SetMaxDiffMult(maxDiffMultMix); | |
73 | if (!isPP) task->SetMaxDiffAngle(maxDiffAngleMixDeg*TMath::DegToRad()); //set angle diff in rad | |
74 | ::Info("AddAnalysisTaskTPCKStar", 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))); | |
75 | ||
76 | mgr->AddTask(task); | |
77 | ||
78 | // | |
79 | // -- EVENT CUTS (same for all configs) --------------------------------------------------------- | |
80 | // | |
81 | // cut on primary vertex: | |
82 | // - 2nd argument --> |Vz| range | |
83 | // - 3rd argument --> minimum required number of contributors | |
84 | // - 4th argument --> tells if TPC stand-alone vertexes must be accepted | |
85 | AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); | |
86 | if (isPP) cutVertex->SetCheckPileUp(kTRUE); // set the check for pileup | |
87 | ||
88 | // define and fill cut set for event cut | |
89 | AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); | |
90 | eventCuts->AddCut(cutVertex); | |
91 | eventCuts->SetCutScheme(cutVertex->GetName()); | |
92 | // set cuts in task | |
93 | task->SetEventCuts(eventCuts); | |
94 | ||
95 | // | |
96 | // -- EVENT-ONLY COMPUTATIONS ------------------------------------------------------------------- | |
97 | // | |
98 | //vertex | |
99 | Int_t vtxID = task->CreateValue(AliRsnMiniValue::kVz, kFALSE); | |
100 | AliRsnMiniOutput *outVtx = task->CreateOutput("eventVtx", "HIST", "EVENT"); | |
101 | outVtx->AddAxis(vtxID, 400, -20.0, 20.0); | |
102 | ||
103 | //multiplicity or centrality | |
104 | Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); | |
105 | AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT"); | |
106 | if (isPP) | |
107 | outMult->AddAxis(multID, 400, 0.0, 400.0); | |
108 | else | |
109 | outMult->AddAxis(multID, 100, 0.0, 100.0); | |
110 | ||
111 | //event plane (only for PbPb) | |
112 | Int_t planeID = task->CreateValue(AliRsnMiniValue::kPlaneAngle, kFALSE); | |
113 | AliRsnMiniOutput *outPlane = task->CreateOutput("eventPlane", "HIST", "EVENT"); | |
114 | if (!isPP) | |
115 | outPlane->AddAxis(planeID, 180, 0.0, TMath::Pi()); | |
116 | ||
117 | // | |
118 | // -- PAIR CUTS (common to all resonances) ------------------------------------------------------ | |
119 | // | |
120 | AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange); | |
121 | cutY->SetRangeD(-0.5, 0.5); | |
122 | ||
123 | AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother); | |
124 | cutsPair->AddCut(cutY); | |
125 | cutsPair->SetCutScheme(cutY->GetName()); | |
126 | ||
127 | // | |
128 | // -- CONFIG ANALYSIS -------------------------------------------------------------------------- | |
129 | gROOT->LoadMacro("$ALICE_ROOT/PWGLF/RESONANCES/macros/mini/ConfigTPCanalysisKStar.C"); | |
130 | if (isMC) { | |
131 | if (((Int_t)cutPiCandidate<4) && ((Int_t)cutKaCandidate<4)) | |
132 | Printf("========================== MC analysis - no PID used for efficiency estimation"); | |
133 | else | |
134 | Printf("========================== MC analysis - PID cuts used"); | |
135 | } else | |
136 | Printf("========================== DATA analysis - PID cuts used"); | |
137 | if (!ConfigTPCanalysisKStar(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, aodN)) return 0x0; | |
138 | ||
139 | // | |
140 | // -- CONTAINERS -------------------------------------------------------------------------------- | |
141 | // | |
142 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
143 | // outputFileName += ":Rsn"; | |
144 | Printf("AddAnalysisTaskTPCKStar - Set OutputFileName : \n %s\n", outputFileName.Data() ); | |
145 | ||
146 | AliAnalysisDataContainer *output = mgr->CreateContainer(Form("RsnOut_%s",outNameSuffix.Data()), | |
147 | TList::Class(), | |
148 | AliAnalysisManager::kOutputContainer, | |
149 | outputFileName); | |
150 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
151 | mgr->ConnectOutput(task, 1, output); | |
152 | ||
153 | return task; | |
154 | } |