]>
Commit | Line | Data |
---|---|---|
8470c96e | 1 | #if !defined( __CINT__) || defined(__MAKECINT__) |
2 | ||
3 | ||
4 | #include <Riostream.h> | |
5 | #include <TSystem.h> | |
6 | #include "AliReconstruction.h" | |
8dd46aaa | 7 | #include "../TRD/AliTRDCalibra.h" |
8 | #include <TStopwatch.h> | |
8470c96e | 9 | |
10 | #endif | |
11 | ||
12 | ||
13 | ||
14 | void AliTRDReconstructandFill() | |
15 | { | |
16 | // | |
17 | // This macro fills 2d histo or vectors during the reconstruction | |
18 | // If it is vectors, it fits them directly after the reconstruction | |
19 | // and writes the result in the file coeftest.root | |
20 | // | |
21 | ||
22 | TStopwatch timer; | |
23 | timer.Start(); | |
24 | ||
25 | ////Set the parameters of AliTRDCalibra*************** | |
26 | AliTRDCalibra *calibra = AliTRDCalibra::Instance(); | |
27 | ||
28 | ////What do you want to use? | |
8dd46aaa | 29 | calibra->SetMITracking(); //Offline tracking |
30 | //calibra->Setmcmtracking(); | |
8470c96e | 31 | |
32 | ||
33 | ////Do you want to try the correction due to the angles of the tracks for mcm tracklets? | |
8dd46aaa | 34 | calibra->SetMcmCorrectAngle(); |
8470c96e | 35 | |
36 | ////What do you want to fill? | |
37 | calibra->SetCH2dOn();//relative gain calibration | |
38 | calibra->SetPH2dOn();//drift velocity and time0 calibration | |
39 | calibra->SetPRF2dOn();//Pad Response Function calibration | |
40 | ||
41 | ||
42 | ////How do you want to store the infos? | |
43 | calibra->SetVector2d();//vector method | |
44 | calibra->SetHisto2d();//2Dhistograms | |
45 | ||
46 | ////Which mode do you want? | |
47 | calibra->SetNz(2,2);//For the PRF z direction | |
48 | calibra->SetNrphi(2,2);//For The PRF rphi direction | |
49 | calibra->SetNz(0,0);//For the gain z direction | |
50 | calibra->SetNrphi(0,0);//For the gain rphi direction | |
51 | calibra->SetNz(1,3);//For the drift velocity and time0 z direction | |
52 | calibra->SetNrphi(1,3);//For the drift velocity and time 0 rphi direction | |
53 | ||
54 | ////How many bins? | |
55 | calibra->SetNumberBinCharge(100); | |
56 | calibra->SetNumberBinPRF(20); | |
57 | ||
58 | ||
59 | ////Do you want to accept more tracks? | |
8dd46aaa | 60 | calibra->SetProcent(1.2);//For the gain if one group has a signal above 1.2 the other group then fill |
8470c96e | 61 | calibra->SetDifference(10);//For the drift velocity if one group has at least 10 time bins then fill |
62 | calibra->SetNumberClusters(18);//For mcm tracklets only fill only with tracklet with at least 18 clusters | |
63 | ||
64 | ////Do you want to take only the middle pad for gain or Vdrift? | |
65 | //calibra->SetTraMaxPad(); | |
66 | ||
67 | //Do you want to apply more strict cut on the clusters for the PRF calibration? | |
68 | calibra->SetThresholdClusterPRF1(2);//The neighbors pads must have a signal smaller than 2 ADC counts | |
69 | calibra->SetThresholdClusterPRF2(10);//The 3 pads in the cluster must have a signal above 10 ADC counts | |
70 | ||
71 | ||
72 | ////What do you want to write? | |
73 | calibra->SetWrite(0);//For the gain | |
74 | calibra->SetWrite(1);//For the average pulse height | |
75 | calibra->SetWrite(2);//For the PRF | |
76 | ||
77 | ||
78 | ////If you want to change the name of the file where it is stored (not very good) | |
79 | //calibra->SetWriteName("test.root"); | |
80 | ||
81 | ||
82 | //Begin the reconstruction | |
83 | AliReconstruction rec; | |
84 | rec.SetGAliceFile("galice.root"); | |
85 | rec.SetLoadAlignFromCDB(kFALSE); | |
86 | rec.SetRunHLTTracking(kFALSE); | |
87 | rec.SetFillESD(""); | |
88 | rec.SetFillTriggerESD(kFALSE); | |
8dd46aaa | 89 | rec.SetRunVertexFinder(kFALSE); |
8470c96e | 90 | rec.Run(); |
91 | timer.Stop(); | |
92 | timer.Print(); | |
8dd46aaa | 93 | calibra->Write2d(); |
8470c96e | 94 | |
95 | ||
96 | TStopwatch timerfit; | |
97 | timerfit.Start(); | |
98 | ////Fit directly after having filling**** | |
99 | ||
100 | ////Do you want to try with less statistics? | |
101 | calibra->SetMinEntries(10);//If there is at least 10 entries in the histo, it will fit | |
102 | ||
103 | ////Do you want to write the result? | |
104 | calibra->SetWriteCoef(0);//gain | |
105 | calibra->SetWriteCoef(1);//time 0 and drift velocity | |
106 | calibra->SetWriteCoef(2);//PRF | |
107 | ||
108 | ////Do you want to change the name of the file (TRD.coefficient.root)? | |
109 | calibra->SetWriteNameCoef("coeftest.root"); | |
110 | ||
111 | ////Do you want to see something? | |
112 | calibra->SetDebug(1); | |
113 | ||
114 | ////Do you want to fit? | |
115 | calibra->FitPHOnline(); | |
116 | calibra->FitCHOnline(); | |
117 | calibra->FitPRFOnline(); | |
8dd46aaa | 118 | |
8470c96e | 119 | |
120 | timerfit.Stop(); | |
121 | timerfit.Print(); | |
122 | ||
123 | } |