]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/macros/train/RsnConfig.C
Added a CORRFW analysis task for selection of single tracks with the same style as...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / macros / train / RsnConfig.C
CommitLineData
4fbb2459 1AliRsnPairManager* RsnConfig
2(
3 AliRsnPair::EPairType pidType, // PID type (NoPID, RealisticPID or PerfectPID)
4 const char *pairMgrName, // name for the pair manager
5 Int_t resonancePDG, // PDG code of resonance (for true pairs)
6 AliPID::EParticleType type1, // PID of one member of decay (+)
7 AliPID::EParticleType type2, // PID of other member of decay (-)
8 Double_t bbCut = 10000.0 // Bethe-Bloch TPC cut value (large --> excluded)
9)
10{
11//
12// Creates an AliRsnPairMgr for a specified resonance, which contains:
13// - signal (inv. mass)
14// - event mixing (inv. mass)
15// - like-sign (inv. mass)
16// - true pairs (inv. mass, resolution)
17//
18// For all pairs, a binning in Pt and Eta is provided, and a cut in multiplicity
19// which defines a multiplicity bin where the analysis is computed.
20//
21// Arguments define how the pair manager must be built, and are explained above
22//
23
24 // === NAME DEFINITIONS =========================================================================
25
eca224a3 26 AliRsnPairManager *pairMgr = new AliRsnPairManager(pairMgrName);
4fbb2459 27
28 // === PAIR DEFINITIONS =========================================================================
29
30 // if particle #1 and #2 are different, two histograms must be built
31 // for each scheme (signal, true, mixed, like-sign) exchanging both particles and signs
32 Int_t i, j, nArray = 1;
33 if (type1 != type2) nArray = 2;
34
35 AliRsnPairDef *defUnlike[2] = {0, 0};
36 AliRsnPairDef *defLikePP[2] = {0, 0};
37 AliRsnPairDef *defLikeMM[2] = {0, 0};
38
39 defUnlike[0] = new AliRsnPairDef(type1, '+', type2, '-', resonancePDG);
40 defLikePP[0] = new AliRsnPairDef(type1, '+', type2, '+', resonancePDG);
41 defLikeMM[0] = new AliRsnPairDef(type1, '-', type2, '-', resonancePDG);
42
43 defUnlike[1] = new AliRsnPairDef(type2, '+', type1, '-', resonancePDG);
44 defLikePP[1] = new AliRsnPairDef(type2, '+', type1, '+', resonancePDG);
45 defLikeMM[1] = new AliRsnPairDef(type2, '-', type1, '-', resonancePDG);
46
47 // === PAIR ANALYSIS ENGINES ====================================================================
48
49 // define null (dummy) objects and initialize only the ones which are needed,
50 // depending again on particle types;
51 // array is organized as follows:
52 // [0] - true pairs
53 // [1] - signal
54 // [2] - like PP
55 // [3] - like MM
56 AliRsnPair *pair[2][4] = {0,0,0,0,0,0,0,0};
57
58 for (i = 0; i < nArray; i++) {
59 pair[i][0] = new AliRsnPair(pidType, defUnlike[i]);
60 pair[i][1] = new AliRsnPair(pidType, defUnlike[i]);
61 pair[i][2] = new AliRsnPair(pidType, defLikePP[i]);
62 pair[i][3] = new AliRsnPair(pidType, defLikeMM[i]);
63 }
64
65 // === CUTS =====================================================================================
66
67 // cuts for tracks:
68 // -- primary track quality
69 AliRsnCutESDPrimary *cutESDPrimary = new AliRsnCutESDPrimary("cutESDPrimary");
70 cutESDPrimary->GetCuts()->SetMaxCovDiagonalElements(2.0, 2.0, 0.5, 0.5, 2.0);
71 cutESDPrimary->GetCuts()->SetRequireSigmaToVertex(kTRUE);
72 cutESDPrimary->GetCuts()->SetMaxNsigmaToVertex(4.0);
73 cutESDPrimary->GetCuts()->SetRequireTPCRefit(kTRUE);
74 cutESDPrimary->GetCuts()->SetAcceptKinkDaughters(kFALSE);
75 cutESDPrimary->GetCuts()->SetMinNClustersTPC(50);
76 cutESDPrimary->GetCuts()->SetMaxChi2PerClusterTPC(3.5);
77 // -- Bethe-Bloch with kaon mass hypothesis
78 AliRsnCutBetheBloch *cutKaonBB = new AliRsnCutBetheBloch("cutKaonBB", bbCut, AliPID::kKaon);
79 cutKaonBB->SetCalibConstant(0, 0.76176e-1);
80 cutKaonBB->SetCalibConstant(1, 10.632);
81 cutKaonBB->SetCalibConstant(2, 0.13279e-4);
82 cutKaonBB->SetCalibConstant(3, 1.8631);
83 cutKaonBB->SetCalibConstant(4, 1.9479);
84
85 // cuts on pairs:
86 // -- true daughters of a phi resonance (only for true pairs histogram)cutSetPairTrue->AddCut(cutTrue);
87 AliRsnCutStd *cutTruePair = new AliRsnCutStd("cutTrue", AliRsnCutStd::kTruePair, resonancePDG);
88
89 // cuts on event:
90 // -- none (specified for whole task)
91
92 // cut set definition for all pairs
93 AliRsnCutSet *cutSetParticle = new AliRsnCutSet("trackCuts");
94 cutSetParticle->AddCut(cutESDPrimary);
95 if (pidType == AliRsnPair::kNoPID && bbCut < 10.0)
96 {
97 Info("RsnConfig", "PID TYPE = NOPID AND BB CUT = %f -- Adding this cut", bbCut);
98 cutSetParticle->AddCut(cutKaonBB);
99 cutSetParticle->SetCutScheme("cutKaonBB&cutESDPrimary");
100 }
101 else {
102 Info("RsnConfig", "PID TYPE = %d AND BB CUT = %f -- Excluding cut", pidType, bbCut);
103 cutSetParticle->SetCutScheme("cutESDPrimary");
104 }
105
106 // cut set definition for true pairs
107 AliRsnCutSet *cutSetPairTrue = new AliRsnCutSet("truePairs");
108 cutSetPairTrue->AddCut(cutTruePair);
109 cutSetPairTrue->SetCutScheme("cutTrue");
110
111 // cut manager for all pairs
112 AliRsnCutMgr *cutMgrAll = new AliRsnCutMgr("std", "All");
113 cutMgrAll->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
114
115 // cut manager for all pairs
116 AliRsnCutMgr *cutMgrTrue = new AliRsnCutMgr("true", "True");
117 cutMgrTrue->SetCutSet(AliRsnCut::kParticle, cutSetParticle);
118 cutMgrTrue->SetCutSet(AliRsnCut::kPair, cutSetPairTrue);
119
120 for (i = 0; i < nArray; i++) {
121 pair[i][0]->SetCutMgr(cutMgrTrue);
122 pair[i][0]->SetOnlyTrue();
123 for (j = 1; j < 4; j++) {
124 pair[i][j]->SetCutMgr(cutMgrAll);
125 }
126 }
127
128 // === FUNCTIONS ================================================================================
129
130 // define all binnings
131 AliRsnFunctionAxis *axisIM = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairInvMass, 1000, 0.0, 2.0);
132 AliRsnFunctionAxis *axisPt = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt, 100, 0.0, 10.0);
133 AliRsnFunctionAxis *axisEta = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta, 10, -1.0, 1.0);
134 AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult, 8, 0.0, 200.0);
135
136 // function #1: pt, mult
137 AliRsnFunction *fcnPt = new AliRsnFunction;
138 fcnPt->AddAxis(axisIM);
139 fcnPt->AddAxis(axisPt);
140 fcnPt->AddAxis(axisMult);
141 // function #2: eta, mult
142 AliRsnFunction *fcnEta = new AliRsnFunction;
143 fcnEta->AddAxis(axisIM);
144 fcnEta->AddAxis(axisEta);
145 fcnEta->AddAxis(axisMult);
146
147 // add functions to pairs
148 for (i = 0; i < nArray; i++) {
149 for (j = 0; j < 4; j++) {
150 pair[i][j]->AddFunction(fcnPt);
151 pair[i][j]->AddFunction(fcnEta);
152 }
153 }
154
155 // === ADD TO PAIR MANAGER ======================================================================
156
157 for (i = 0; i < nArray; i++) {
158 for (j = 0; j < 4; j++) {
159 pairMgr->AddPair(pair[i][j]);
160 }
161 }
162
163 return pairMgr;
164}