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