]>
Commit | Line | Data |
---|---|---|
6d798f33 | 1 | /*************************************************************************** |
2 | fbellini@cern.ch - last modified on 06/08/2012 | |
0403dbed | 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 | // | |
6d798f33 | 16 | ****************************************************************************/ |
0403dbed | 17 | |
18 | AliRsnMiniAnalysisTask * AddAnalysisTaskTOFKStar_pA | |
19 | ( | |
20 | Bool_t isMC, | |
6d798f33 | 21 | Bool_t isPP, |
0403dbed | 22 | Int_t aodFilterBit = 5, |
6d798f33 | 23 | AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutPiCandidate = AliRsnCutSetDaughterParticle::kTOFpidKstarPPB2011, |
24 | AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate = AliRsnCutSetDaughterParticle::kTOFpidKstarPPB2011, | |
0403dbed | 25 | Float_t nsigmaPi = 2.0, |
26 | Float_t nsigmaKa = 2.0, | |
6d798f33 | 27 | Bool_t enableMonitor = kTRUE, |
28 | Bool_t IsMcTrueOnly = kFALSE, | |
29 | Int_t nmix = 0, | |
0403dbed | 30 | Float_t maxDiffVzMix = 1.0, |
31 | Float_t maxDiffMultMix = 10.0, | |
6d798f33 | 32 | TString outNameSuffix = "", |
0403dbed | 33 | Int_t signedPdg = 313, |
efef1074 | 34 | TString monitorOpt = "", |
6d798f33 | 35 | Double_t minYlab = 0.465, |
36 | Double_t maxYlab = 0.965, | |
16cfcabf | 37 | Bool_t useMixLS = 0, |
38 | AliRsnMiniValue::EType yaxisvar = AliRsnMiniValue::kPt | |
0403dbed | 39 | ) |
40 | { | |
41 | // | |
42 | // -- INITIALIZATION ---------------------------------------------------------------------------- | |
43 | // retrieve analysis manager | |
44 | // | |
45 | ||
46 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
47 | if (!mgr) { | |
48 | ::Error("AddAnalysisTaskTOFKStar", "No analysis manager to connect to."); | |
49 | return NULL; | |
50 | } | |
51 | ||
52 | // create the task and configure | |
6d798f33 | 53 | TString taskName = Form("TOFKStar%s%s_%i%i", (isPP? "pp" : "PbPb"), (isMC ? "MC" : "Data"), (Int_t)cutPiCandidate,(Int_t)cutKaCandidate ); |
0403dbed | 54 | AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask(taskName.Data(), isMC); |
6d798f33 | 55 | if (isPP) |
0403dbed | 56 | task->UseMultiplicity("QUALITY"); |
57 | else | |
6d798f33 | 58 | task->UseCentrality("V0A"); |
0403dbed | 59 | // set event mixing options |
60 | task->UseContinuousMix(); | |
61 | //task->UseBinnedMix(); | |
62 | task->SetNMix(nmix); | |
63 | task->SetMaxDiffVz(maxDiffVzMix); | |
64 | task->SetMaxDiffMult(maxDiffMultMix); | |
6d798f33 | 65 | ::Info("AddAnalysisTaskTOFKStar", Form("Event mixing configuration: \n events to mix = %i \n max diff. vtxZ = cm %5.3f \n max diff multi = %5.3f", nmix, maxDiffVzMix, maxDiffMultMix)); |
66 | ||
0403dbed | 67 | mgr->AddTask(task); |
68 | ||
69 | // | |
70 | // -- EVENT CUTS (same for all configs) --------------------------------------------------------- | |
71 | // | |
72 | // cut on primary vertex: | |
73 | // - 2nd argument --> |Vz| range | |
74 | // - 3rd argument --> minimum required number of contributors | |
75 | // - 4th argument --> tells if TPC stand-alone vertexes must be accepted | |
76 | AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE); | |
6d798f33 | 77 | //if (isPP) cutVertex->SetCheckPileUp(kTRUE); // set the check for pileup |
0403dbed | 78 | |
79 | // define and fill cut set for event cut | |
80 | AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent); | |
81 | eventCuts->AddCut(cutVertex); | |
82 | eventCuts->SetCutScheme(cutVertex->GetName()); | |
83 | // set cuts in task | |
84 | task->SetEventCuts(eventCuts); | |
85 | ||
86 | // | |
87 | // -- EVENT-ONLY COMPUTATIONS ------------------------------------------------------------------- | |
88 | // | |
89 | //vertex | |
90 | Int_t vtxID = task->CreateValue(AliRsnMiniValue::kVz, kFALSE); | |
91 | AliRsnMiniOutput *outVtx = task->CreateOutput("eventVtx", "HIST", "EVENT"); | |
92 | outVtx->AddAxis(vtxID, 400, -20.0, 20.0); | |
93 | ||
94 | //multiplicity or centrality | |
95 | Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); | |
96 | AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT"); | |
6d798f33 | 97 | if (isPP) |
0403dbed | 98 | outMult->AddAxis(multID, 400, 0.0, 400.0); |
99 | else | |
100 | outMult->AddAxis(multID, 100, 0.0, 100.0); | |
6d798f33 | 101 | |
0403dbed | 102 | TH2F* hvz=new TH2F("hVzVsCent","",100,0.,100., 220,-11.,11.); |
103 | task->SetEventQAHist("vz",hvz);//plugs this histogram into the fHAEventVz data member | |
104 | ||
105 | TH2F* hmc=new TH2F("MultiVsCent","",100,0.,100.,4000,0.,4000.); | |
106 | hmc->GetYaxis()->SetTitle("QUALITY"); | |
107 | task->SetEventQAHist("multicent",hmc);//plugs this histogram into the fHAEventMultiCent data member | |
108 | ||
0403dbed | 109 | // |
110 | // -- PAIR CUTS (common to all resonances) ------------------------------------------------------ | |
111 | // | |
112 | AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange); | |
6d798f33 | 113 | cutY->SetRangeD(minYlab, maxYlab); |
0403dbed | 114 | |
115 | AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother); | |
116 | cutsPair->AddCut(cutY); | |
117 | cutsPair->SetCutScheme(cutY->GetName()); | |
118 | ||
119 | // | |
120 | // -- CONFIG ANALYSIS -------------------------------------------------------------------------- | |
121 | gROOT->LoadMacro("$ALICE_ROOT/PWGLF/RESONANCES/macros/mini/ConfigTOFanalysisKStar.C"); | |
122 | if (isMC) { | |
0403dbed | 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"); | |
16cfcabf | 129 | if (!ConfigTOFanalysisKStar(task, isMC, isPP, "", cutsPair, aodFilterBit, cutPiCandidate, cutKaCandidate, nsigmaPi, nsigmaKa, enableMonitor, isMC&IsMcTrueOnly, useMixLS, signedPdg, monitorOpt.Data(), yaxisvar)) return 0x0; |
0403dbed | 130 | |
131 | // | |
132 | // -- CONTAINERS -------------------------------------------------------------------------------- | |
133 | // | |
134 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
135 | // outputFileName += ":Rsn"; | |
136 | Printf("AddAnalysisTaskTOFKStar - Set OutputFileName : \n %s\n", outputFileName.Data() ); | |
137 | ||
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 | } |