]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/fastSimul/simul.C
TPC/fastSimul/AliTPCclusterFast.cxx - iplement dEdx above threshold - several reco...
[u/mrichter/AliRoot.git] / TPC / fastSimul / simul.C
1 /*
2
3   Macro to generate random tracks and clusters.
4   Fast MC - Geant equivalent used
5
6
7 */
8
9 Int_t  kmarkes[5]={20,21,24,25,23};
10 Int_t  kcolors[5]={1,2,4,3,6};
11
12 void simul(Int_t npoints){ 
13   //
14   // simulation submit script
15   //
16   printf("Hallo world\n");
17   gRandom->SetSeed(0);
18   gROOT->LoadMacro("$mcPath/AliTPCclusterFast.cxx+");
19  
20   AliTPCclusterFast::fPRF = new TF1("fprf","gausn",-5,5);
21   AliTPCclusterFast::fTRF = new TF1("ftrf","gausn",-5,5);
22   AliTPCclusterFast::fPRF->SetParameters(1,0,0.5);
23   AliTPCclusterFast::fTRF->SetParameters(1,0,0.5);
24   //
25   AliTPCtrackFast::Simul("trackerSimul.root",npoints); 
26 }
27
28
29
30 void Merge(){
31   //
32   //
33   //
34   TString objfile;
35   AliTPCtrackFast track0;
36   track0.MakeHisto();
37   AliTPCtrackFast *track1;
38   ifstream in;
39   Int_t counter=0;
40   in.open("track.txt");
41   while(in.good()) {
42     in >> objfile;
43     if (!objfile.Contains("root")) continue; // protection
44     TFile currentFile(objfile.Data());
45     printf("Open file:Counter\t%d\tMerging file %s\n",counter,objfile.Data());
46     track1=(AliTPCtrackFast)currentFile.Get("track");
47     if (!track1) continue;
48     track0.Add(*track1);
49     counter++;
50   } 
51   TFile f("mergetrack.root","recreate");
52   track0.Write("track");
53   f.Close("");
54 }
55
56
57
58
59 void DrawdEdxResolExample(){
60   //
61   // Example analysis to make an space point resolution study
62   //
63   TChain * chain  = AliXRDPROOFtoolkit::MakeChain("trackerSimul.list", "simulTrack",0,100); 
64   chain->SetCacheSize(10000000000);
65
66   //
67   // 1.) Qmax/Qtot as function of the input ionization density
68   //
69   chain->Draw("tr.CookdEdxDmax(0,0.6,1,0,1,0)/tr.CookdEdxDtot(0,0.6,1,0,1,0):tr.fMNprim>>hisQtotMax(10,10,50)","","prof",10000);
70   //
71   // 2.) Non linearity due to the truncation Qtot_{60%}/Qtot 100% 
72   //
73   chain->Draw("tr.CookdEdxDtot(0,0.6,1,0,1,0)/tr.CookdEdxDtot(0,0.99,1,0,1,0):tr.fMNprim>>hisQtot60100(10,10,50)","","prof",10000);
74   //
75   // 3.) 
76   //
77   chain->Draw("tr.CookdEdxDtot(0,0.6,1,0,1,0)/tr.fMNprim:tr.fMNprim>>profQtot60(10,10,50)","","prof",10000);
78   chain->Draw("tr.CookdEdxDtot(0,0.99,1,0,1,0)/tr.fMNprim:tr.fMNprim>>profQtot100(10,10,50)","","profsame",10000);
79
80 }
81
82
83