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