]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/fastSimul/simul.C
Merge branch 'master', remote branch 'origin' into TPCdev
[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
10 void simul(Int_t npoints){ 
11   //
12   // simulation submit script
13   //
14   printf("Hallo world\n");
15   gRandom->SetSeed(0);
16   gROOT->LoadMacro("$mcPath/AliTPCclusterFast.cxx+");
17  
18   AliTPCclusterFast::fPRF = new TF1("fprf","gausn",-5,5);
19   AliTPCclusterFast::fTRF = new TF1("ftrf","gausn",-5,5);
20   AliTPCclusterFast::fPRF->SetParameters(1,0,0.5);
21   AliTPCclusterFast::fTRF->SetParameters(1,0,0.5);
22   //
23   AliTPCtrackFast::Simul("trackerSimul.root",npoints); 
24 }
25
26
27
28 void Merge(){
29   //
30   //
31   //
32   TString objfile;
33   AliTPCtrackFast track0;
34   track0.MakeHisto();
35   AliTPCtrackFast *track1;
36   ifstream in;
37   Int_t counter=0;
38   in.open("track.txt");
39   while(in.good()) {
40     in >> objfile;
41     if (!objfile.Contains("root")) continue; // protection
42     TFile currentFile(objfile.Data());
43     printf("Open file:Counter\t%d\tMerging file %s\n",counter,objfile.Data());
44     track1=(AliTPCtrackFast)currentFile.Get("track");
45     if (!track1) continue;
46     track0.Add(*track1);
47     counter++;
48   } 
49   TFile f("mergetrack.root","recreate");
50   track0.Write("track");
51   f.Close("");
52 }
53
54
55
56
57 void DrawdEdxResolExample(){
58   //
59   // Example analysis to make an space point resolution study
60   //
61   TChain * chain  = AliXRDPROOFtoolkit::MakeChain("trackerSimul.list", "simulTrack",0,100); 
62   chain->SetCacheSize(10000000000);
63
64   //
65   // 1.) Qmax/Qtot as function of the input ionization density
66   //
67   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);
68   //
69   // 2.) Non linearity due to the tucncation Qtot_{60%}/Qtot 100% 
70   //
71   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);
72   //
73   //
74   //
75
76
77 }