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