forked from alisw/AliRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAliITSDDLRawData.C
81 lines (71 loc) · 2.16 KB
/
AliITSDDLRawData.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#if !defined(__CINT__)
#include <Riostream.h>
#include "AliITSDDLRawData.h"
#include "AliRunLoader.h"
#include "AliLoader.h"
#include "AliITS.h"
#endif
//DigitsFile is the input file that contains digits
void AliITSDDLRawData(Int_t eventNumber=0){
Int_t spdLDCs=2;
Int_t sddLDCs=4;
Int_t ssdLDCs=2;
Int_t eventn=0;
const char * inFile_new = "galice.root";
AliRunLoader *rl = AliRunLoader::Open(inFile_new,"Event","read");
rl->LoadgAlice();
gAlice=rl->GetAliRun();
Int_t nevents=rl->GetNumberOfEvents();
cout<<"Number of Events:"<<nevents<<endl;
while (eventNumber<=0 || eventNumber>nevents){
cout<<"Insert the event number:";
cin>>eventNumber;
cout<<endl;
}
rl->GetEvent(eventNumber-1);
AliLoader *itsloader=rl->GetLoader("ITSLoader");
itsloader->LoadDigits();
TTree *TD=itsloader->TreeD();
gAlice=rl->GetAliRun();
if(!gAlice){
cout<<"gAlice is null"<<endl;
return;
}
AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
Int_t nmodules;
ITS->InitModules(-1,nmodules);
ITS->GetDetTypeSim()->SetTreeAddressD(TD,"ITS");
AliITSDDLRawData *util=new AliITSDDLRawData();
//Verbose level
// 0: Silent
// 1: cout messages
// 2: txt files with digits
//BE CAREFUL, verbose level 2 MUST be used only for debugging and
//it is highly suggested to use this mode only for debugging digits files
//reasonably small, because otherwise the size of the txt files can reach
//quickly several MB wasting time and disk space.
util->SetVerbose(0);
TStopwatch timer;
//SILICON PIXEL DETECTOR
cout<<"Formatting data for SPD"<<endl;
timer.Start();
util->RawDataSPD(ITS,TD,spdLDCs,eventNumber);
timer.Stop();
timer.Print();
//ONLY FOR DEBUGGING
// util->TestFormat(eventNumber);
//SILICON DRIFT DETECTOR
cout<<"Formatting data for SDD"<<endl;
timer.Start();
util->RawDataSDD(ITS,TD,sddLDCs,eventNumber);
timer.Stop();
timer.Print();
//SILICON STRIP DETECTOR
cout<<"Formatting data for SSD"<<endl;
timer.Start();
util->RawDataSSD(ITS,TD,ssdLDCs,eventNumber);
timer.Stop();
timer.Print();
delete util;
return;
}