]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSDDLRawData.C
Radius of PHOS equal to 460 (Y.Schutz)
[u/mrichter/AliRoot.git] / ITS / AliITSDDLRawData.C
1 #if !defined(__CINT__)
2 #include <Riostream.h>
3 #include "AliITSDDLRawData.h"
4 #include "AliRunLoader.h"
5 #include "AliLoader.h"
6 #include "AliITS.h"
7 #endif
8
9 /*
10 Before running this macro it is necessary to comment the following line of the method
11 AddDigit in the class AliITSsimulationSDD
12 //if( fResponse->Do10to8() ) signal = Convert8to10( signal ); 
13 In this way the amplitude value for signal coming from SDD takes only 8 bits and not 10.
14 */
15 //DigitsFile is the input file that contains digits
16
17 void AliITSDDLRawData(Int_t eventNumber=0){
18
19   Int_t spdLDCs=2;
20   Int_t sddLDCs=4;
21   Int_t ssdLDCs=2;
22   Int_t eventn=0;
23   const char * inFile_new = "galice.root";
24   AliRunLoader *rl = AliRunLoader::Open(inFile_new,"Event","read");
25   rl->LoadgAlice();
26   Int_t nevents=rl->GetNumberOfEvents();
27   cout<<"Number of Events:"<<nevents<<endl;
28   while (eventNumber<=0 || eventNumber>nevents){
29     cout<<"Insert the event number:";
30     cin>>eventNumber;
31     cout<<endl;
32   }
33   rl->GetEvent(eventNumber-1);
34   AliLoader *itsloader=rl->GetLoader("ITSLoader");
35   itsloader->LoadDigits();
36   TTree *TD=itsloader->TreeD();
37   gAlice=rl->GetAliRun(); 
38   if(!gAlice){
39     cout<<"gAlice is null"<<endl;
40     return;
41   } 
42   AliITS *ITS  = (AliITS*)gAlice->GetDetector("ITS");
43
44   Int_t nmodules;
45   ITS->InitModules(-1,nmodules);
46   ITS->SetTreeAddressD(TD);
47
48     AliITSDDLRawData *util=new AliITSDDLRawData();
49     //Verbose level
50     // 0: Silent
51     // 1: cout messages
52     // 2: txt files with digits 
53     //BE CAREFUL, verbose level 2 MUST be used only for debugging and
54     //it is highly suggested to use this mode only for debugging digits files
55     //reasonably small, because otherwise the size of the txt files can reach
56     //quickly several MB wasting time and disk space.
57     util->SetVerbose(0);
58     TStopwatch timer;
59     
60     //SILICON PIXEL DETECTOR
61     cout<<"Formatting data for SPD"<<endl;
62     timer.Start();
63     util->RawDataSPD(ITS,TD,spdLDCs,eventNumber);
64     timer.Stop();
65     timer.Print();
66     //ONLY FOR DEBUGGING 
67     //    util->TestFormat(eventNumber);
68     
69     //SILICON DRIFT DETECTOR
70     cout<<"Formatting data for SDD"<<endl;
71     timer.Start();
72     util->RawDataSDD(ITS,TD,sddLDCs,eventNumber);
73     timer.Stop();
74     timer.Print();
75     
76     //SILICON STRIP DETECTOR
77     cout<<"Formatting data for SSD"<<endl;
78     timer.Start();
79     util->RawDataSSD(ITS,TD,ssdLDCs,eventNumber);
80     timer.Stop();
81     timer.Print();
82     
83     delete util;
84
85     return;
86 }