1 // AliFemtoSplittingMergingQA.C - macro to create the splitting/merging
2 // test with the pion correlation function.
3 // As a default the anti-splitting and anti-merging cuts are open
4 // and the two correlation functions:
5 // AliFemtoShareQualityCorrFctn and AliFemtoTPCInnerCorrFctn
6 // can be used to study the splitting (former) and merging (latter) effect
7 // If ones needs to produce a "clean" sample with both effects removed,
8 // one needs to change the cut values to the "reasonable" ones, or perform
9 // the full systematic analysis with the above-mentioned functions
11 // Author: Adam Kisiel. Adam.Kisiel@cern.ch
14 // listFileName - a text file containing a list of ESDs (with full paths)
16 void AliFemtoSplittingMergingQA(const char *listFileName)
18 double PionMass = 0.13956995;
19 double chargePi = 1.0;
21 // Load the neccessary libraries
22 gSystem->Load("libTree");
23 gSystem->Load("libGeom");
24 gSystem->Load("libEG");
25 gSystem->Load("libCint");
26 gSystem->Load("libESD");
27 gSystem->Load("libPWG2femtoscopy");
28 gSystem->Load("libPWG2femtoscopyUser");
30 // Set-up the reader for ALICE ESD
31 AliFemtoEventReaderESD* Reader=new AliFemtoEventReaderESD();
32 // Read only constrained momenta - primordial particles
33 Reader->SetConstrained(true);
34 Reader->SetReadTPCInner(true);
35 // Read the file list from the filename supplied by the user
36 Reader->SetInputFile(listFileName);
39 AliFemtoManager* Manager=new AliFemtoManager();
40 // Point to the data source - the reader
41 Manager->SetEventReader(Reader);
44 AliFemtoSimpleAnalysis* an =new AliFemtoSimpleAnalysis();
45 // Number of events to construct the background
46 an->SetNumEventsToMix(3);
49 AliFemtoBasicEventCut* mec = new AliFemtoBasicEventCut();
50 // Accept events with the given multiplicity
51 mec->SetEventMult(0,100000);
52 // and z-vertex distance to the center of the TPC
53 mec->SetVertZPos(-1000,1000);
56 AliFemtoESDTrackCut* dtc = new AliFemtoESDTrackCut();
57 // We want positive pions
58 dtc->SetPidProbPion(0.2,1.001);
59 dtc->SetPidProbMuon(0.0,0.8);
60 dtc->SetPidProbKaon(0.0,0.1);
61 dtc->SetPidProbProton(0.0,0.1);
62 dtc->SetMostProbablePion();
64 // so we set the correct mass
65 dtc->SetMass(PionMass);
68 dtc->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
69 dtc->SetminTPCncls(95);
70 dtc->SetRemoveKinks(kTRUE);
71 dtc->SetLabel(kFALSE);
72 dtc->SetMaxITSChiNdof(3.0);
73 dtc->SetMaxTPCChiNdof(2.0);
74 dtc->SetMaxSigmaToVertex(3.0);
76 AliFemtoCutMonitorParticleYPt *cutPass = new AliFemtoCutMonitorParticleYPt("cutPass", 0.13957);
77 AliFemtoCutMonitorParticleYPt *cutFail = new AliFemtoCutMonitorParticleYPt("cutFail", 0.13957);
78 dtc->AddCutMonitor(cutPass, cutFail);
81 AliFemtoShareQualityTPCEntranceSepPairCut *sqpc = new AliFemtoShareQualityTPCEntranceSepPairCut();
82 // remove split track pairs and pairs that share hits
84 // Set maximim allowed "quality" for the pair
85 // 1.0 - accept all pairs
86 // -0.5 - reject all pairs
87 // a reasonable value should lie between 0.0 and 0.5
88 sqpc->SetShareQualityMax(1.0);
90 // Set maximum allowed shared hits fraction per pair
91 // 1.0 - accept all pairs
92 // 0.0 - reject all pairs
93 // a reasonable value is small but nno-zero (0.05)
94 sqpc->SetShareFractionMax(1.0);
96 // Set minimum allowed separation between nominal TPC entrance points
97 // of the two tracks in the pair
98 // 0.0 - accept all pairs
99 // a reasonable value is 3.0 [cm]
100 sqpc->SetTPCEntranceSepMinimum(0.0);
101 sqpc->SetRemoveSameLabel(kFALSE);
103 // Add the cuts to the analysis
104 an->SetEventCut(mec);
105 an->SetFirstParticleCut(dtc);
106 an->SetSecondParticleCut(dtc);
107 an->SetPairCut(sqpc);
109 // Setup correlation functions
110 // A simple qinv correlation function
111 AliFemtoQinvCorrFctn *cqinv= new AliFemtoQinvCorrFctn("qinvcf",75,0.0,0.4);
113 // A correlation function to monitor the splitting and cluster sharing in TPC
114 AliFemtoShareQualityCorrFctn *csqqinv= new AliFemtoShareQualityCorrFctn("sqqinvcf",75,0.0,0.4);
116 // A correlation function to monitor the distance at the entrance to the TPC
117 AliFemtoTPCInnerCorrFctn *tpcin = new AliFemtoTPCInnerCorrFctn("tpcin",80, 0.0, 0.4);
119 // add the correlation functions to the analysis
120 an->AddCorrFctn(cqinv);
121 an->AddCorrFctn(csqqinv);
122 an->AddCorrFctn(tpcin);
124 // Add the analysis to the manager
125 Manager->AddAnalysis(an);
127 // Run the event loop
130 cout<<" Problem"<<endl;
134 while ((!Status)&&(nEP<nE))
137 cout<<" next event "<<nEP<<endl;
138 Status=Manager->ProcessEvent();
143 sprintf(ofname, "QinvCF.In.root");
145 TFile f1 (ofname,"RECREATE","Data");
146 cqinv->Numerator()->Write();
147 cqinv->Denominator()->Write();
148 csqqinv->WriteHistos();
149 tpcin->WriteHistos();
153 // Save the cut settings in the output file
154 f1.mkdir("Settings");
157 TList *tListSettings = an->ListSettings();
158 tListSettings->Write();
162 TFile f2("Listout.root","RECREATE");
163 TList *tOutList = an->GetOutputList();