2 // General macro to configure the RSN analysis task.
3 // It calls all configs desired by the user, by means
4 // of the boolean switches defined in the first lines.
7 // 1) flag to know if running on MC or data
8 // 2) path where all configs are stored
11 // kTRUE --> initialization successful
12 // kFALSE --> initialization failed (some config gave errors)
18 AliRsnMiniAnalysisTask * AddTaskLStarPPb
27 // -- INITIALIZATION ----------------------------------------------------------------------------
30 //-------------------------------------------
32 //-------------------------------------------
33 UInt_t triggerMask = AliVEvent::kINT7;
34 Bool_t rmFirstEvtChunk = kTRUE; //needed for pA 2013
35 Bool_t rejectPileUp = kTRUE; //best if used, for pA 2013
36 Int_t MinPlpContribSPD = 5; //default value if used
37 Bool_t useMVPileUpSelection = kFALSE; //
38 Int_t MinPlpContribMV = 5; //default value if used
39 Bool_t useVtxCut2013pA = kTRUE; //default use recommended 2013 pA vtx selection
40 Double_t vtxZcut = 10.0; //cm, default cut on vtx z
44 // retrieve analysis manager
45 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
47 // create the task and connect with physics selection
48 AliRsnMiniAnalysisTask *task = new AliRsnMiniAnalysisTask("RSN", isMC);
50 //task->UseESDTriggerMask(triggerMask); //ESD
51 task->SelectCollisionCandidates(triggerMask); //AOD
55 task->UseMultiplicity("QUALITY");
57 task->UseCentrality("V0M");
60 task->UseContinuousMix();
61 //task->UseBinnedMix();
63 task->SetMaxDiffVz(1.0);
64 task->SetMaxDiffMult(10.0);
65 //task->SetMaxDiffAngle(20);
66 // if (!isPP) task->SetMaxDiffAngle(20.0*TMath::DegToRad()); //set angle diff in rad
71 // -- EVENT CUTS (same for all configs) ---------------------------------------------------------
74 // cut on primary vertex:
75 // - 2nd argument --> |Vz| range
76 // - 3rd argument --> minimum required number of contributors
77 // - 4th argument --> tells if TPC stand-alone vertexes must be accepted
78 AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", vtxZcut, 0, kFALSE);
80 // set the check for pileup
81 //if (isPP) cutVertex->SetCheckPileUp(kTRUE);
83 //set check for pileup in 2013 #############
85 AliRsnCutEventUtils *cutEventUtils = new AliRsnCutEventUtils("cutEventUtils", rmFirstEvtChunk, rejectPileUp);
86 cutEventUtils->SetUseVertexSelection2013pA(useVtxCut2013pA);
87 ::Info("AddTaskLStarPPb", Form(":::::::::::::::::: Vertex cut as pA 2013: %s", (useVtxCut2013pA?"ON":"OFF")));
88 if (useMVPileUpSelection){
89 cutEventUtils->SetUseMVPlpSelection(useMVPileUpSelection);
90 cutEventUtils->SetMinPlpContribMV(MinPlpContribMV);
91 cutEventUtils->SetMinPlpContribSPD(MinPlpContribSPD);
92 ::Info("AddTaskLStarPPb", Form("Multiple-vtx Pile-up rejection settings: MinPlpContribMV = %i, MinPlpContribSPD = %i", MinPlpContribMV, MinPlpContribSPD));
94 cutEventUtils->SetMinPlpContribSPD(MinPlpContribSPD);
95 ::Info("AddTaskLStarPPb", Form("SPD Pile-up rejection settings: MinPlpContribSPD = %i", MinPlpContribSPD));
97 ::Info("AddTaskLStarPPb", Form(":::::::::::::::::: Pile-up rejection mode: %s", (rejectPileUp?"ON":"OFF")));
98 ::Info("AddTaskLStarPPb", Form("::::::::::::: Remove first event in chunk: %s", (rmFirstEvtChunk?"ON":"OFF")));
103 // define and fill cut set
104 AliRsnCutSet *eventCuts = new AliRsnCutSet("eventCuts", AliRsnTarget::kEvent);
105 eventCuts->AddCut(cutEventUtils);
106 eventCuts->AddCut(cutVertex);
107 eventCuts->SetCutScheme(Form("%s&%s", cutEventUtils->GetName(), cutVertex->GetName()));
108 //eventCuts->SetCutScheme(cutVertex->GetName());
111 task->SetEventCuts(eventCuts);
114 // -- EVENT-ONLY COMPUTATIONS -------------------------------------------------------------------
117 // second argument tells if the value must be taken from MC
118 // (when this can be done)
119 // after creating the value, the task returns its ID
122 Int_t vertexID = task->CreateValue(AliRsnMiniValue::kVz, kFALSE);
123 AliRsnMiniOutput *outVertex = task->CreateOutput("eventVertex", "HIST", "EVENT");
124 outVertex->AddAxis(vertexID, 400, -20.0, 20.0);
127 // initialize value computation for multiplicity/centrality
128 Int_t multID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
129 AliRsnMiniOutput *outMult = task->CreateOutput("eventMult", "HIST", "EVENT");
130 // set axes, by passing value ID and defining the binning
132 outMult->AddAxis(multID, 300, 0.0, 300.0);
134 outMult->AddAxis(multID, 100, 0.0, 100.0);
136 // TH2F* hvz=new TH2F("hVzVsCent","", 100, 0., 100., 240, -12.0, 12.0);
137 // task->SetEventQAHist("vz",hvz);//plugs this histogram into the fHAEventVz data member
139 // TH2F* hmc=new TH2F("MultiVsCent","", 400, 0., 400., 400, 0., 400.);
140 // hmc->GetYaxis()->SetTitle("QUALITY");
141 // task->SetEventQAHist("multicent",hmc);//plugs this histogram into the fHAEventMultiCent data member
145 // -- PAIR CUTS (common to all resonances) ------------------------------------------------------
148 AliRsnCutMiniPair *cutY = new AliRsnCutMiniPair("cutRapidity", AliRsnCutMiniPair::kRapidityRange);
149 //cutY->SetRangeD(-0.5, 0.5);
150 cutY->SetRangeD(-0.465, 0.035);// 0 < y_cm < 0.5; y_cm = y_lab + 0.465
152 AliRsnCutSet *cutsPair = new AliRsnCutSet("pairCuts", AliRsnTarget::kMother);
153 cutsPair->AddCut(cutY);
154 cutsPair->SetCutScheme(cutY->GetName());
157 // -- CONFIGS -----------------------------------------------------------------------------------
162 gROOT->LoadMacro(Form("%s/ConfigLStarPPb.C", path));
163 ConfigLStarPPb(task, isMC, isPP, "LStar", cutsPair);
167 // -- CONTAINERS --------------------------------------------------------------------------------
170 const char *file = AliAnalysisManager::GetCommonFileName();
171 AliAnalysisDataContainer *output = mgr->CreateContainer("RsnOut", TList::Class(), AliAnalysisManager::kOutputContainer, file);
172 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
173 mgr->ConnectOutput(task, 1, output);