2 // This is an example macro for creation of a pair manager
3 // for a resonance analysis with the PWG2/RESONANCES package.
4 // Its output is an AliRsnPairManager which will be added to the task.
6 // - signal (inv. mass)
7 // - true pairs (inv. mass)
8 // - like-sign (inv. mass)
9 // - true pairs (inv. mass, resolution)
10 // All histogram are done w.r. to Pt or Eta and w.r. to multiplicity.
11 // The binnings are hard-coded. Change them according to your preferences.
14 // -- pairMgrName : a name for the pair manager which must contain
15 // some keywords to choose amond the available cuts
16 // and PID selection available here (this is a personal customization)
17 // -- resonancePDG: PDG code of resonance (for true pairs)
18 // -- type1, type2: particle species for track 1 and 2 in the pair (using AliPID enumeration)
21 // the keyword available here are the following:
22 // -- "NOPID": completely no PID analysis (only primary track cuts are applied)
23 // -- "BB" : all tracks are used, but the TPC Bethe-Bloch cut is applied (cut value = 0.2)
24 // -- "PID" : realistic PID is used
26 AliRsnPairManager* RsnConfig
28 const char *pairMgrName, // name for the pair manager
29 Int_t resonancePDG, // PDG code of resonance (for true pairs)
30 AliPID::EParticleType type1, // PID of one member of decay (+)
31 AliPID::EParticleType type2 // PID of other member of decay (-)
34 // === NAME DEFINITIONS =========================================================================
36 AliRsnPairManager *pairMgr = new AliRsnPairManager(pairMgrName);
38 // examines the given name to define details about track selection and cuts
39 TString str(pairMgrName);
40 AliRsnPair::EPairType pidType;
42 if (str.Contains("NOPID"))
44 pidType = AliRsnPair::kNoPID;
46 Info("RsnConfig", "PID TYPE = No PID -- BB CUT: not used");
48 else if (str.Contains("BB"))
50 pidType = AliRsnPair::kNoPID;
52 Info("RsnConfig", "PID TYPE = No PID -- BB CUT: used");
54 else if (str.Contains("PID"))
56 pidType = AliRsnPair::kRealisticPID;
58 Info("RsnConfig", "PID TYPE = Realistic PID -- BB CUT: not used");
62 Error("RsnConfig", "Unrecognized keywords in the name. Can't continue");
66 // === PAIR DEFINITIONS =========================================================================
68 // if particle #1 and #2 are different, two histograms must be built
69 // for each scheme (signal, true, mixed, like-sign) exchanging both particles and signs
70 Int_t i, j, nArray = 1;
71 if (type1 != type2) nArray = 2;
73 AliRsnPairDef *defUnlike[2] = {0, 0};
74 AliRsnPairDef *defLikePP[2] = {0, 0};
75 AliRsnPairDef *defLikeMM[2] = {0, 0};
77 defUnlike[0] = new AliRsnPairDef(type1, '+', type2, '-', resonancePDG);
78 defLikePP[0] = new AliRsnPairDef(type1, '+', type2, '+', resonancePDG);
79 defLikeMM[0] = new AliRsnPairDef(type1, '-', type2, '-', resonancePDG);
81 defUnlike[1] = new AliRsnPairDef(type2, '+', type1, '-', resonancePDG);
82 defLikePP[1] = new AliRsnPairDef(type2, '+', type1, '+', resonancePDG);
83 defLikeMM[1] = new AliRsnPairDef(type2, '-', type1, '-', resonancePDG);
85 // === PAIR ANALYSIS ENGINES ====================================================================
87 // define null (dummy) objects and initialize only the ones which are needed,
88 // depending again on particle types;
89 // array is organized as follows:
94 AliRsnPair *pair[2][4] = {0,0,0,0,0,0,0,0};
96 for (i = 0; i < nArray; i++) {
97 pair[i][0] = new AliRsnPair(pidType, defUnlike[i]);
98 pair[i][1] = new AliRsnPair(pidType, defUnlike[i]);
99 pair[i][2] = new AliRsnPair(pidType, defLikePP[i]);
100 pair[i][3] = new AliRsnPair(pidType, defLikeMM[i]);
103 // === CUTS =====================================================================================
106 // -- primary track quality
107 AliRsnCutESDPrimary *cutESDPrimary = new AliRsnCutESDPrimary("cutESDPrimary");
108 cutESDPrimary->GetCuts()->SetMaxCovDiagonalElements(2.0, 2.0, 0.5, 0.5, 2.0);
109 cutESDPrimary->GetCuts()->SetRequireSigmaToVertex(kTRUE);
110 cutESDPrimary->GetCuts()->SetMaxNsigmaToVertex(3.0);
111 cutESDPrimary->GetCuts()->SetRequireTPCRefit(kTRUE);
112 cutESDPrimary->GetCuts()->SetAcceptKinkDaughters(kFALSE);
113 cutESDPrimary->GetCuts()->SetMinNClustersTPC(50);
114 cutESDPrimary->GetCuts()->SetMaxChi2PerClusterTPC(3.5);
115 // -- Bethe-Bloch with kaon mass hypothesis
116 Double_t sigmaTPC = 0.065;
117 AliRsnCutBetheBloch *cutKaonBB = new AliRsnCutBetheBloch("cutKaonBB", 3.0 * sigmaTPC, AliPID::kKaon);
118 cutKaonBB->SetCalibConstant(0, 0.76176e-1);
119 cutKaonBB->SetCalibConstant(1, 10.632);
120 cutKaonBB->SetCalibConstant(2, 0.13279e-4);
121 cutKaonBB->SetCalibConstant(3, 1.8631);
122 cutKaonBB->SetCalibConstant(4, 1.9479);
125 // -- true daughters of a phi resonance (only for true pairs histogram)cutSetPairTrue->AddCut(cutTrue);
126 AliRsnCutStd *cutTruePair = new AliRsnCutStd("cutTrue", AliRsnCutStd::kTruePair, resonancePDG);
129 // -- none (specified for whole task)
131 // cut set definition for all pairs
132 AliRsnCutSet *cutSetParticle = new AliRsnCutSet("trackCuts");
133 cutSetParticle->AddCut(cutESDPrimary);
136 cutSetParticle->AddCut(cutKaonBB);
137 cutSetParticle->SetCutScheme("cutKaonBB&cutESDPrimary");
140 cutSetParticle->SetCutScheme("cutESDPrimary");
143 // cut set definition for true pairs
144 AliRsnCutSet *cutSetPairTrue = new AliRsnCutSet("truePairs");
145 cutSetPairTrue->AddCut(cutTruePair);
146 cutSetPairTrue->SetCutScheme("cutTrue");
148 // cut manager for all pairs
149 AliRsnCutMgr *cutMgrAll = new AliRsnCutMgr("std", "All");
150 cutMgrAll->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
152 // cut manager for all pairs
153 AliRsnCutMgr *cutMgrTrue = new AliRsnCutMgr("true", "True");
154 cutMgrTrue->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
155 cutMgrTrue->SetCutSet(AliRsnCut::kPair, cutSetPairTrue);
157 for (i = 0; i < nArray; i++) {
158 pair[i][0]->SetCutMgr(cutMgrTrue);
159 pair[i][0]->SetOnlyTrue();
160 for (j = 1; j < 4; j++) {
161 pair[i][j]->SetCutMgr(cutMgrAll);
165 // === FUNCTIONS ================================================================================
167 // define all binnings
168 AliRsnFunctionAxis *axisIM = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairInvMass, 1000, 0.0, 2.0);
169 AliRsnFunctionAxis *axisPt = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt, 50, 0.0, 10.0);
170 AliRsnFunctionAxis *axisEta = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta, 15, -1.5, 1.5);
171 AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult, 8, 0.0, 200.0);
173 AliRsnFunction *fcn = new AliRsnFunction;
174 fcn->AddAxis(axisIM);
175 fcn->AddAxis(axisPt);
176 fcn->AddAxis(axisEta);
177 fcn->AddAxis(axisMult);
179 // add functions to pairs
180 for (i = 0; i < nArray; i++) {
181 for (j = 0; j < 4; j++) {
182 pair[i][j]->AddFunction(fcn);
186 // === ADD TO PAIR MANAGER ======================================================================
188 for (i = 0; i < nArray; i++) {
189 for (j = 0; j < 4; j++) {
190 pairMgr->AddPair(pair[i][j]);