1db00cb5 |
1 | /// \file RunAltroEmulOnRAW.C |
b7757586 |
2 | |
3 | |
4 | |
5 | // +++++++++++++++++++++++++++++++++++++++++++++++++ |
6 | void RunAltroEmulOnRAW(Int_t mode, const char *uri, |
7 | const char *outputRootFileName ="rawdata.root"){ |
8 | |
9 | // modes |
b027d808 |
10 | |
11 | // 0: MAF off / TCF off - ONLY ZS |
12 | |
b7757586 |
13 | // 1: MAF on / TCF off |
14 | // 2: MAF on / TCF on - params from Rehak (baseline) |
15 | // 3: MAF on / TCF on - params from Rehak (baseline & pulse shortening) |
16 | // 4: MAF on / TCF on - params from Rehak (baseline, used in P2) |
b027d808 |
17 | // 5: MAF on - presample 1, postsample 1 |
18 | // 6: MAF on - presample 1, postsample 3 |
19 | // 7: MAF on - presample 1, postsample 5 |
b7757586 |
20 | |
21 | |
b027d808 |
22 | if (mode<0 || mode>7) { |
b7757586 |
23 | printf(" ERROR: chosen mode not avalailable ...\n"); |
24 | return; |
25 | } |
26 | |
27 | |
28 | TStopwatch timer; |
29 | timer.Start(); |
30 | |
31 | // READ RAW DATA +++++++++++ |
32 | |
33 | AliRawReader *reader=AliRawReader::Create(uri); |
34 | reader->NextEvent(); |
35 | Int_t runNumber=reader->GetRunNumber(); |
36 | reader->RewindEvents(); |
37 | |
38 | // ALTRO EMULATOR +++++++++++ |
39 | |
40 | Int_t baseline = 50; // standard in run 137228 |
41 | |
42 | Int_t *K0= new Int_t[2]; Int_t *K1= new Int_t[2]; Int_t *K2= new Int_t[2]; |
43 | Int_t *L0= new Int_t[2]; Int_t *L1= new Int_t[2]; Int_t *L2= new Int_t[2]; |
44 | |
45 | if ( mode == 2 ) { // "middle aggressive" |
46 | // params from Rehak (baseline) |
47 | K0[0]=64386; K1[0]=65184; K2[0]= 77; |
48 | L0[0]=64675; L1[0]=64950; L2[0]= 0; |
49 | K0[1]=63675; K1[1]=65355; K2[1]= 218; |
50 | L0[1]=63917; L1[1]=65263; L2[1]= 0; |
51 | |
52 | } else if ( mode ==3 ) { // "most aggressive" |
53 | // params from Rehak (baseline & pulse shortening) |
54 | K0[0]=58684; K1[0]=65273; K2[0]= 1361; // IROC |
55 | L0[0]=59754; L1[0]=65187; L2[0]= 0; |
56 | K0[1]=59688; K1[1]=65347; K2[1]= 1349; // OROC |
57 | L0[1]=60704; L1[1]=65273; L2[1]= 0; |
58 | |
59 | } else if ( mode == 4 ) { // a bit "aggressive" |
60 | // params from Rehak (baseline, used in P2); |
61 | K0[0]=62055; K1[0]=65300; K2[0]= 277; // IROC |
62 | L0[0]=62339; L1[0]=65208; L2[0]= 0; |
63 | K0[1]=63151; K1[1]=65435; K2[1]= 266; // OROC |
64 | L0[1]=63387; L1[1]=65371; L2[1]= 0; |
65 | } |
66 | |
67 | |
68 | AliTPCAltroEmulator *a1 = new AliTPCAltroEmulator(); |
69 | |
70 | a1->ConfigBaselineCorrection1(4, baseline, 0, 0); |
b7757586 |
71 | a1->ConfigZerosuppression(3,2,0,0); |
72 | |
b027d808 |
73 | if (mode ==0) { // do nothing, just ZS |
74 | |
75 | a1->ConfigAltro(1,0,0,1,1,0); |
76 | |
77 | } else if (mode==1) { // MAF |
b7757586 |
78 | |
b027d808 |
79 | a1->ConfigBaselineCorrection2(3,3,0,0,0); |
80 | a1->ConfigAltro(1,0,1,1,1,0); |
81 | |
82 | } else if (mode==2 || mode ==3 || mode==4) { // MAF and different TCF |
83 | |
84 | a1->ConfigTailCancellationFilterForRAWfiles(K0,K1,K2,L0,L1,L2); |
85 | a1->ConfigBaselineCorrection2(3,3,0,0,0); |
86 | a1->ConfigAltro(1,1,1,1,1,0); |
87 | |
88 | } else if (mode == 5) { // different MAF |
89 | |
90 | a1->ConfigBaselineCorrection2(3,3,0,1,1); // 1 presample, 1 postsamples |
91 | a1->ConfigAltro(1,0,1,1,1,0); |
92 | |
93 | } else if (mode == 6) { // different MAF |
94 | |
95 | a1->ConfigBaselineCorrection2(3,3,0,1,3); // 1 presample, 3 postsamples |
96 | a1->ConfigAltro(1,0,1,1,1,0); |
97 | |
98 | } else if (mode == 7) { // different MAF |
99 | |
100 | a1->ConfigBaselineCorrection2(3,3,0,1,5); // 1 presample, 5 postsamples |
101 | a1->ConfigAltro(1,0,1,1,1,0); |
102 | |
103 | } |
b7757586 |
104 | |
105 | |
106 | a1->SetOutputRootFileName(outputRootFileName); |
107 | a1->RunEmulationOnRAWdata(reader); |
108 | |
109 | timer.Stop(); timer.Print(); |
110 | } |
111 | |
112 | |