]>
Commit | Line | Data |
---|---|---|
2e9f335b | 1 | #if !defined(__CINT__) || defined(__MAKECINT__) |
2 | ||
3 | #include <iostream.h> | |
4 | #include "AliITSDDLRawData.h" | |
5 | #endif | |
6 | ||
7 | /* | |
a79660fb | 8 | Before running this macro it is necessary to comment the following line of the method |
2e9f335b | 9 | AddDigit in the class AliITSsimulationSDD |
10 | //if( fResponse->Do10to8() ) signal = Convert8to10( signal ); | |
11 | In this way the amplitude value for signal coming from SDD takes only 8 bits and not 10. | |
12 | */ | |
9f992f70 | 13 | //DigitsFile is the input file that contains digits |
2e9f335b | 14 | |
9f992f70 | 15 | void AliITSDDLRawData(char* DigitsFile="galiceD.root"){ |
16 | #ifdef __NOCOMPILED__ | |
2e9f335b | 17 | if (gClassTable->GetID("AliRun") < 0) { |
18 | gROOT->LoadMacro("loadlibs.C"); | |
19 | loadlibs(); | |
20 | } | |
21 | else { | |
22 | #endif | |
23 | if(gAlice){ | |
24 | delete gAlice; | |
25 | gAlice=0; | |
26 | } | |
27 | #ifdef __NOCOMPILED__ | |
28 | } | |
29 | #endif | |
2e9f335b | 30 | TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(DigitsFile); |
31 | if (!file){ | |
c391f9d9 | 32 | file = TFile::Open(DigitsFile); |
2e9f335b | 33 | }//end if |
34 | file->ls(); | |
2e9f335b | 35 | |
9f992f70 | 36 | // Get AliRun object from file |
37 | if (!gAlice){ | |
38 | gAlice = (AliRun*)file->Get("gAlice"); | |
39 | if (gAlice)cout<<"AliRun object found on file "<<DigitsFile<<endl; | |
40 | if(!gAlice){ | |
41 | cout<<"Can't access AliRun object on file "<<DigitsFile<<endl; | |
42 | cout<<"Macro execution stopped!!!"<<endl; | |
43 | exit(1); | |
44 | }//end if | |
45 | }//end if | |
46 | gAlice->SetTreeDFileName(DigitsFile); | |
47 | // Long_t nparticles = gAlice->GetEvent(0); | |
2e9f335b | 48 | |
9f992f70 | 49 | //Int_t nparticles = gAlice->GetEvent(0); |
50 | // | |
51 | // ITS | |
52 | AliITS *ITS = (AliITS*)gAlice->GetModule("ITS"); | |
53 | Int_t nmodules; | |
54 | ITS->InitModules(-1,nmodules); | |
55 | cout<<"Number of ITS modules= "<<nmodules<<endl; | |
56 | //cout<<"Filling modules... It takes a while, now. Please be patient"<<endl; | |
57 | //ITS->FillModules(0,0,nmodules," "," "); | |
58 | //cout<<"ITS modules .... DONE!"<<endl; | |
59 | // DIGITS | |
2e9f335b | 60 | |
9f992f70 | 61 | |
62 | TTree* TD = (TTree*)file->Get("TreeD0"); | |
63 | if (TD == 0x0){ | |
64 | ::Error("DDLRawData","Can not find tree with ITS digits"); | |
65 | return; | |
66 | }//end if | |
67 | ITS->SetTreeAddressD(TD); | |
68 | ||
69 | ||
70 | //TTree *TD = gAlice->TreeD(); | |
71 | ||
72 | AliITSDDLRawData *util=new AliITSDDLRawData(); | |
73 | //Verbose level | |
74 | // 0: Silent | |
75 | // 1: cout messages | |
76 | // 2: txt files with digits | |
77 | //BE CAREFUL, verbose level 2 MUST be used only for debugging and | |
78 | //it is highly suggested to use this mode only for debugging digits files | |
79 | //reasonably small, because otherwise the size of the txt files can reach | |
80 | //quickly several MB wasting time and disk space. | |
81 | util->SetVerbose(0); | |
82 | TStopwatch timer; | |
83 | ||
84 | //SILICON PIXEL DETECTOR | |
85 | cout<<"Formatting data for SPD"<<endl; | |
86 | timer.Start(); | |
87 | util->RawDataSPD(ITS,TD); | |
88 | // util->RawDataSPD(ITS,TD,20); | |
89 | timer.Stop(); | |
90 | timer.Print(); | |
91 | //ONLY FOR DEBUGGING | |
92 | util->TestFormat(); | |
c391f9d9 | 93 | |
9f992f70 | 94 | //SILICON DRIFT DETECTOR |
95 | cout<<"Formatting data for SDD"<<endl; | |
96 | timer.Start(); | |
97 | //util->RawDataSDD(ITS,TD,12); | |
98 | util->RawDataSDD(ITS,TD); | |
99 | timer.Stop(); | |
100 | timer.Print(); | |
101 | ||
102 | //SILICON STRIP DETECTOR | |
103 | cout<<"Formatting data for SSD"<<endl; | |
104 | timer.Start(); | |
105 | //util->RawDataSSD(ITS,TD,16); | |
106 | util->RawDataSSD(ITS,TD); | |
107 | timer.Stop(); | |
108 | timer.Print(); | |
109 | ||
110 | delete util; | |
111 | return; | |
2e9f335b | 112 | } |