]>
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, | |
27d1c841 | 29 | UInt_t triggerMask = AliVEvent::kMB, |
73b349ad | 30 | Int_t PbPb2011CentFlat = 0, |
6184d9a9 | 31 | Int_t nmix = 0, |
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 = "" | |
37 | ) | |
38 | { | |
39 | // | |
40 | // -- INITIALIZATION ---------------------------------------------------------------------------- | |
41 | // retrieve analysis manager | |
42 | // | |
43 | ||
44 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
45 | if (!mgr) { | |
46 | ::Error("AddAnalysisTaskTPCKStar", "No analysis manager to connect to."); | |
47 | return NULL; | |
48 | } | |
49 | ||
50 | // create the task and configure | |
27d1c841 | 51 | TString taskName = Form("TPCKStar%s%s_%i%i_%s", (isPP? "pp" : "PbPb"), (isMC ? "MC" : "Data"), (Int_t)cutPiCandidate,(Int_t)cutKaCandidate, outNameSuffix.Data() ); |
6184d9a9 | 52 | AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC); |
53 | if (!isMC && !isPP){ | |
54 | Printf(Form("========== SETTING USE CENTRALITY PATCH AOD049 : %s", (aodN==49)? "yes" : "no")); | |
55 | task->SetUseCentralityPatch(aodN==49); | |
56 | } | |
da997f6c | 57 | //centrality flatening patch LHC11h |
58 | if(PbPb2011CentFlat) | |
59 | task->SetUseCentralityPatchPbPb2011(PbPb2011CentFlat); | |
27d1c841 | 60 | //task->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral); |
27d1c841 | 61 | task->SelectCollisionCandidates(triggerMask); |
da997f6c | 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 -------------------------------------------------------------------------- | |
27d1c841 | 129 | if(!isMC){ |
9f69b548 | 130 | gROOT->LoadMacro("ConfigTPCanalysisKStar.C"); |
131 | if (!ConfigTPCanalysisKStar(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, aodN)) return 0x0; | |
27d1c841 | 132 | } |
133 | else { | |
9f69b548 | 134 | gROOT->LoadMacro("ConfigTPCanalysisKStarMC.C"); |
135 | if (!ConfigTPCanalysisKStarMC(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, 313, aodN)) return 0x0; //K* | |
136 | if (!ConfigTPCanalysisKStarMC(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, -313, aodN)) return 0x0; //anti-K* | |
27d1c841 | 137 | } |
138 | ||
139 | ||
140 | ||
6184d9a9 | 141 | |
142 | // | |
143 | // -- CONTAINERS -------------------------------------------------------------------------------- | |
144 | // | |
145 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
146 | // outputFileName += ":Rsn"; | |
147 | Printf("AddAnalysisTaskTPCKStar - Set OutputFileName : \n %s\n", outputFileName.Data() ); | |
148 | ||
149 | AliAnalysisDataContainer *output = mgr->CreateContainer(Form("RsnOut_%s",outNameSuffix.Data()), | |
150 | TList::Class(), | |
151 | AliAnalysisManager::kOutputContainer, | |
152 | outputFileName); | |
153 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
154 | mgr->ConnectOutput(task, 1, output); | |
155 | ||
156 | return task; | |
157 | } |