4 #include "AliTPCParamSR.h"
5 #include "AliTPCDigitsArray.h"
6 #include "AliSimDigits.h"
7 #include "AliTPCBuffer.h"
11 void AliTPCDDL(char* FileName,Int_t eth=0){
13 //Digits stored into a file have an amplitude value greater than "eth"
14 TFile *cf=TFile::Open(FileName);
15 // old geometry (3.07)
16 //AliTPCParamSR *param =(AliTPCParamSR *)cf->Get("75x40_100x60");
17 // if new geometry comment out the line above and uncomment the one below
18 AliTPCParamSR *param =(AliTPCParamSR *)cf->Get("75x40_100x60_150x60");
19 AliTPCDigitsArray *digarr=new AliTPCDigitsArray;
23 //sprintf(cname,"TreeD_75x40_100x60_%d",eventn);
24 // if new geometry comment out the line above and uncomment the one below
26 sprintf(cname,"TreeD_75x40_100x60_150x60_%d",eventn);
27 digarr->ConnectTree(cname);
28 AliTPCBuffer *b=new AliTPCBuffer("AliTPCDDL.dat");
33 // 2: txt files with digits
34 //BE CAREFUL, verbose level 2 MUST be used only for debugging and
35 //it is highly suggested to use this mode only for debugging digits files
36 //reasonably small, because otherwise the size of the txt files can reach
37 //quickly several MB wasting time and disk space.
41 Int_t nrows=Int_t(digarr->GetTree()->GetEntries());
42 cout<<"Number of entries "<<nrows<<endl;
45 for (Int_t n=0; n<nrows; n++) {
46 AliSimDigits *digrow=(AliSimDigits*)digarr->LoadEntry(n);
48 Int_t sec,row; // sector and row number (in the TPC)
49 param->AdjustSectorRow(digrow->GetID(),sec,row);
50 // cout<<sec<<" row "<<row<<endl;
59 //the whole row is written into the output file
60 b->WriteRowBinary(eth,digrow,0,0,0,sec,SubSec,row);
62 //only the pads in the range [37;48] are written into the output file
63 b->WriteRowBinary(eth,digrow,37,48,1,sec,SubSec,row);
65 //only the pads outside the range [37;48] are written into the output file
66 b->WriteRowBinary(eth,digrow,37,48,2,sec,SubSec,row);
70 //outer sector [36;71]
72 if((row!=27)&&(row!=76))
73 b->WriteRowBinary(eth,digrow,0,0,0,sec,SubSec,row);
76 //only the pads outside the range [43;46] are written into the output file
77 b->WriteRowBinary(eth,digrow,43,46,2,sec,SubSec,row);
79 //only the pads in the range [43;46] are written into the output file
80 b->WriteRowBinary(eth,digrow,43,46,1,sec,SubSec,row);
83 //only the pads outside the range [33;88] are written into the output file
84 b->WriteRowBinary(eth,digrow,33,88,2,sec,SubSec,row);
86 //only the pads in the range [33;88] are written into the output file
87 b->WriteRowBinary(eth,digrow,33,88,1,sec,SubSec,row);
93 cout<<"File created !"<<endl;
94 cout<<"Total number of digits: "<<b->GetDigNumber()<<endl;
97 }//end AliTPCDataChallenge