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