]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/macros/test/ConfigTaskRsnTest.C
Changes from Constantin:
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / macros / test / ConfigTaskRsnTest.C
CommitLineData
2dab9030 1//
2// This function configures the entire task for all resonances the user is interested in.
3// This is done by creating all configuration objects which are defined in the package.
4//
5// Generally speaking, one has to define the following objects for each resonance:
6//
7// 1 - an AliRsnPairDef to define the resonance decay channel to be studied
8// 2 - an AliRsnPair{Ntuple|Functions} where the output is stored
9// 3 - one or more AliRsnCut objects to define track selections
10// which will have then to be organized into AliRsnCutSet objects
11// 4 - an AliRsnCutManager to include all cuts to be applied (see point 3)
12// 5 - definitions to build the TNtuple or histograms which are returned
13//
14// The return value is used to know if the configuration was successful
15//
16Bool_t RsnConfigTask(AliRsnAnalysisSE* &task, const char *dataLabel)
17{
18 // for safety, return if no task is passed
19 if (!task)
20 {
21 Error("ConfigTaskRsn", "Task not found");
22 return kFALSE;
23 }
24
25 // interpret the useful information from second argument
26 TString strDataLabel(dataLabel);
0d73200d 27 Bool_t isESD = strDataLabel.Contains("ESD");
28 Bool_t isAOD = strDataLabel.Contains("AOD");
29 Bool_t isSim = strDataLabel.Contains("sim");
30 Bool_t isData = strDataLabel.Contains("data");
31 Bool_t isPass1 = strDataLabel.Contains("pass1");
32 Bool_t isPass2 = strDataLabel.Contains("pass2");
2dab9030 33
34 //
35 // -- Set cuts for events (applied to all analyses) -----------------------------------------------
36 //
37
38 // primary vertex range
0d73200d 39 AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
2dab9030 40 AliRsnCutSet *cutSetEvent = new AliRsnCutSet("eventCuts", AliRsnCut::kEvent);
41 cutSetEvent->AddCut(cutVertex);
42 cutSetEvent->SetCutScheme("cutVertex");
43 task->SetEventCuts(cutSetEvent);
44
45 //
46 // -- Setup pairs ---------------------------------------------------------------------------------
47 //
48
49 // decay channels
0d73200d 50 AliRsnPairDef *pairDefpm = new AliRsnPairDef(AliPID::kKaon, '+', AliPID::kKaon, '-', 333, 1.019455);
2dab9030 51
52 // computation objects
0d73200d 53 AliRsnPairFunctions *pairPMhist = new AliRsnPairFunctions("pairPMHist", pairDefpm);
0d73200d 54 AliRsnPairNtuple *pairPMntp = new AliRsnPairNtuple ("pairPMNtp" , pairDefpm);
2dab9030 55
56 //
57 // -- Setup cuts ----------------------------------------------------------------------------------
58 //
59
60 // -- track cut --
61 // --> global cuts for 2010 analysis
62 AliRsnCutESD2010 *cuts2010 = new AliRsnCutESD2010("cuts2010");
63 // ----> set the flag for sim/data management
64 cuts2010->SetMC(isSim);
65 // ----> require to check PID
51919bc4 66 cuts2010->SetCheckITS(kFALSE);
67 cuts2010->SetCheckTPC(kFALSE);
68 cuts2010->SetCheckTOF(kFALSE);
2dab9030 69 // ----> set TPC ranges and calibration
70 cuts2010->SetTPCrange(5.0, 3.0);
71 cuts2010->SetTPCpLimit(0.35);
72 cuts2010->SetITSband(4.0);
0d73200d 73 if (isSim) cuts2010->SetTPCpar(2.15898 / 50.0, 1.75295E1, 3.40030E-9, 1.96178, 3.91720);
74 else cuts2010->SetTPCpar(1.41543 / 50.0, 2.63394E1, 5.0411E-11, 2.12543, 4.88663);
2dab9030 75 // ----> set standard quality cuts for TPC global tracks
0d73200d 76 //cuts2010->GetCutsTPC()->SetRequireTPCStandAlone(kTRUE); // require to have the projection at inner TPC wall
2dab9030 77 cuts2010->GetCutsTPC()->SetMinNClustersTPC(70);
78 cuts2010->GetCutsTPC()->SetMaxChi2PerClusterTPC(4);
79 cuts2010->GetCutsTPC()->SetAcceptKinkDaughters(kFALSE);
80 cuts2010->GetCutsTPC()->SetRequireTPCRefit(kTRUE);
81 cuts2010->GetCutsTPC()->SetRequireITSRefit(kTRUE);
82 cuts2010->GetCutsTPC()->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
83 cuts2010->GetCutsTPC()->SetMaxDCAToVertexXYPtDep("0.0350+0.0420/pt^0.9"); // DCA pt dependent: 7*(0.0050+0.0060/pt0.9)
84 cuts2010->GetCutsTPC()->SetMaxDCAToVertexZ(1e6); // disabled
85 cuts2010->GetCutsTPC()->SetDCAToVertex2D(kFALSE); // each DCA is checked separately
86 cuts2010->GetCutsTPC()->SetRequireSigmaToVertex(kFALSE);
87 // ----> set standard quality cuts for ITS standalone tracks
0d73200d 88 cuts2010->GetCutsITS()->SetRequireITSStandAlone(kTRUE, kTRUE);
2dab9030 89 cuts2010->GetCutsITS()->SetRequireITSRefit(kTRUE);
90 cuts2010->GetCutsITS()->SetMinNClustersITS(4);
91 cuts2010->GetCutsITS()->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
92 cuts2010->GetCutsITS()->SetMaxChi2PerClusterITS(1.);
93 cuts2010->GetCutsITS()->SetMaxDCAToVertexXYPtDep("0.0595+0.0182/pt^1.55"); // DCA pt dependent
94 cuts2010->GetCutsITS()->SetMaxDCAToVertexZ(1e6); // disabled
95 cuts2010->GetCutsITS()->SetDCAToVertex2D(kFALSE); // each DCA is checked separately
2dab9030 96 // ----> set the configuration for TOF PID checks
97 if (isData && (isPass1 || isPass2))
98 {
99 cuts2010->SetTOFcalibrateESD(kTRUE);
100 //if (isPass2) cuts2010->SetTOFcalibrateESD(kFALSE); // potrebbe anche essere kFALSE
101 cuts2010->SetTOFcorrectTExp(kTRUE);
102 cuts2010->SetTOFuseT0(kTRUE);
103 cuts2010->SetTOFtuneMC(kFALSE);
104 cuts2010->SetTOFresolution(100.0);
105 }
106 else if (isSim)
107 {
108 cuts2010->SetTOFcalibrateESD(kFALSE);
109 cuts2010->SetTOFcorrectTExp(kTRUE);
110 cuts2010->SetTOFuseT0(kTRUE);
111 cuts2010->SetTOFtuneMC(kTRUE);
112 cuts2010->SetTOFresolution(100.0);
113 }
114 cuts2010->Initialize();
115
51919bc4 116 // -- tracks --> PID
117 AliRsnCutPID *cutPID = new AliRsnCutPID("cutPID", AliPID::kKaon, 0.0, kTRUE);
2dab9030 118
2dab9030 119 // cut sets
120 AliRsnCutSet *cutSetDaughterCommon = new AliRsnCutSet("commonDaughterCuts", AliRsnCut::kDaughter);
2dab9030 121
122 // --> add related cuts
123 cutSetDaughterCommon->AddCut(cuts2010);
2dab9030 124 cutSetDaughterCommon->AddCut(cutPID);
51919bc4 125
2dab9030 126 // --> define schemes
51919bc4 127 cutSetDaughterCommon->SetCutScheme("cuts2010&cutPID");
2dab9030 128
129 // cut managers
130 // define a proper name for each mult bin, to avoid omonyme output histos
131 pairPMhist->GetCutManager()->SetCommonDaughterCuts(cutSetDaughterCommon);
2dab9030 132 pairPMntp ->GetCutManager()->SetCommonDaughterCuts(cutSetDaughterCommon);
2dab9030 133
134 // function axes
51919bc4 135 AliRsnValue *axisIM = new AliRsnValue("IM", AliRsnValue::kPairInvMass, 50, 0.9, 1.4);
136 AliRsnValue *axisPt = new AliRsnValue("PT", AliRsnValue::kPairPt, 50, 0.0, 20.0);
2dab9030 137
51919bc4 138 // functions for TH1-like output
2dab9030 139 AliRsnFunction *fcnPt = new AliRsnFunction;
2dab9030 140 // --> add axes
2dab9030 141 fcnPt ->AddAxis(axisIM);
142 fcnPt ->AddAxis(axisPt);
2dab9030 143
51919bc4 144 // add functions to TH1-like output
2dab9030 145 pairPMhist->AddFunction(fcnPt);
2dab9030 146
51919bc4 147 // add values to TNtuple-like output
148 pairPMntp->AddValue(axisIM);
149 pairPMntp->AddValue(axisPt);
150
151 // add everything to analysis manager
2dab9030 152 task->GetAnalysisManager()->Add(pairPMhist);
51919bc4 153 //task->GetAnalysisManager()->Add(pairPMntp);
2dab9030 154
155 return kTRUE;
156}