X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSDDLRawData.C;h=57f7ff15ca548ccd33e0830da01e54d31f98f103;hb=311ee5f3738a1911db7325221e218dd28b1ce64d;hp=ede2ebb0398ff909349e05489e8e44fc67d757e1;hpb=2e9f335bada3a86a05438303bb696adc778215c9;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSDDLRawData.C b/ITS/AliITSDDLRawData.C index ede2ebb0398..57f7ff15ca5 100644 --- a/ITS/AliITSDDLRawData.C +++ b/ITS/AliITSDDLRawData.C @@ -1,91 +1,81 @@ -#if !defined(__CINT__) || defined(__MAKECINT__) - -#include +#if !defined(__CINT__) +#include #include "AliITSDDLRawData.h" +#include "AliRunLoader.h" +#include "AliLoader.h" +#include "AliITS.h" #endif -/* -Before running this macro it is necessary comment the following line of the method -AddDigit in the class AliITSsimulationSDD -//if( fResponse->Do10to8() ) signal = Convert8to10( signal ); -In this way the amplitude value for signal coming from SDD takes only 8 bits and not 10. -*/ +//DigitsFile is the input file that contains digits -void AliITSDDLRawData(char* DigitsFile="galice.root"){ - #ifdef __NOCOMPILED__ - if (gClassTable->GetID("AliRun") < 0) { - gROOT->LoadMacro("loadlibs.C"); - loadlibs(); - } - else { -#endif - if(gAlice){ - delete gAlice; - gAlice=0; - } -#ifdef __NOCOMPILED__ - } -#endif - // Connect the Root input file containing Geometry, Kine and Hits - // galice.root file by default - char* filename="galice.root"; - // TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename); - TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(DigitsFile); - if (!file){ - // file = new TFile(filename); - file = new TFile(DigitsFile); - cout<<"NEW FILE CREATED !!!"<ls(); - // Get AliRun object from file - if (!gAlice) { - gAlice = (AliRun*)file->Get("gAlice"); - if (gAlice)cout<<"AliRun object found on file "<LoadgAlice(); + gAlice=rl->GetAliRun(); + Int_t nevents=rl->GetNumberOfEvents(); + cout<<"Number of Events:"<nevents){ + cout<<"Insert the event number:"; + cin>>eventNumber; + cout<SetTreeDFileName("digits.root"); - gAlice->SetTreeDFileName(DigitsFile); - Int_t nparticles = gAlice->GetEvent(0); - // - // ITS - AliITS *ITS = (AliITS*)gAlice->GetModule("ITS"); + rl->GetEvent(eventNumber-1); + AliLoader *itsloader=rl->GetLoader("ITSLoader"); + itsloader->LoadDigits(); + TTree *TD=itsloader->TreeD(); + gAlice=rl->GetAliRun(); + if(!gAlice){ + cout<<"gAlice is null"<GetDetector("ITS"); + Int_t nmodules; ITS->InitModules(-1,nmodules); + ITS->GetDetTypeSim()->SetTreeAddressD(TD,"ITS"); - cout<<"Number of ITS modules= "<FillModules(0,0,nmodules," "," "); - //cout<<"ITS modules .... DONE!"<TreeD(); - - AliITSDDLRawData *util=new AliITSDDLRawData(); - TStopwatch timer; - - //SILICON PIXEL DETECTOR - cout<<"Formatting data for SPD"<RawDataSPD(ITS,TD); - timer.Stop(); - timer.Print(); + 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"<RawDataSPD(ITS,TD,spdLDCs,eventNumber); + timer.Stop(); + timer.Print(); + //ONLY FOR DEBUGGING + // util->TestFormat(eventNumber); - //SILICON DRIFT DETECTOR - cout<<"Formatting data for SDD"<RawDataSDD(ITS,TD); - timer.Stop(); - timer.Print(); - - //SILICON STRIP DETECTOR - cout<<"Formatting data for SSD"<RawDataSSD(ITS,TD); - timer.Stop(); - timer.Print(); - - delete util; - return; + //SILICON DRIFT DETECTOR + cout<<"Formatting data for SDD"<RawDataSDD(ITS,TD,sddLDCs,eventNumber); + timer.Stop(); + timer.Print(); + + //SILICON STRIP DETECTOR + cout<<"Formatting data for SSD"<RawDataSSD(ITS,TD,ssdLDCs,eventNumber); + timer.Stop(); + timer.Print(); + + delete util; + + return; }