]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSDDLRawData.C
Removed warnings
[u/mrichter/AliRoot.git] / ITS / AliITSDDLRawData.C
CommitLineData
c9bd9d3d 1#if !defined(__CINT__)
2#include <Riostream.h>
2e9f335b 3#include "AliITSDDLRawData.h"
4#endif
5
6/*
a79660fb 7Before running this macro it is necessary to comment the following line of the method
2e9f335b 8AddDigit in the class AliITSsimulationSDD
9//if( fResponse->Do10to8() ) signal = Convert8to10( signal );
10In this way the amplitude value for signal coming from SDD takes only 8 bits and not 10.
11*/
9f992f70 12//DigitsFile is the input file that contains digits
2e9f335b 13
9f992f70 14void AliITSDDLRawData(char* DigitsFile="galiceD.root"){
15#ifdef __NOCOMPILED__
2e9f335b 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
c9bd9d3d 29 Int_t eventNumber=0;
30 Int_t spdLDCs=2;
31 Int_t sddLDCs=4;
32 Int_t ssdLDCs=2;
2e9f335b 33 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(DigitsFile);
34 if (!file){
c9bd9d3d 35 file = new TFile(DigitsFile);
2e9f335b 36 }//end if
37 file->ls();
2e9f335b 38
9f992f70 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);
2e9f335b 51
9f992f70 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
2e9f335b 63
9f992f70 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();
c9bd9d3d 74 cout<<"Insert the event number:";
75 cin>>eventNumber;
76 cout<<endl;
77
9f992f70 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();
c9bd9d3d 93 util->RawDataSPD(ITS,TD,spdLDCs,eventNumber);
9f992f70 94 timer.Stop();
95 timer.Print();
96 //ONLY FOR DEBUGGING
c9bd9d3d 97 // util->TestFormat(eventNumber);
98
9f992f70 99 //SILICON DRIFT DETECTOR
100 cout<<"Formatting data for SDD"<<endl;
101 timer.Start();
c9bd9d3d 102 util->RawDataSDD(ITS,TD,sddLDCs,eventNumber);
9f992f70 103 timer.Stop();
104 timer.Print();
105
106 //SILICON STRIP DETECTOR
107 cout<<"Formatting data for SSD"<<endl;
108 timer.Start();
c9bd9d3d 109 util->RawDataSSD(ITS,TD,ssdLDCs,eventNumber);
9f992f70 110 timer.Stop();
111 timer.Print();
112
113 delete util;
114 return;
2e9f335b 115}