X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=TPC%2FAliTPCAltro.C;h=d14b2c830c2055b804fbd1d01b74aebcd4067128;hb=9eae9ea55045dd794b98f3b39d129da04b2e7450;hp=096817c83213faea02d08f2909c1d599a3e2e8a6;hpb=b62e2a952be3ddb514d149cf973acfe99d37fa88;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCAltro.C b/TPC/AliTPCAltro.C index 096817c8321..d14b2c830c2 100644 --- a/TPC/AliTPCAltro.C +++ b/TPC/AliTPCAltro.C @@ -8,7 +8,7 @@ #include "AliTPCBuffer160.h" #endif -int AliTPCAltro(char* FileName,Int_t eth=0){ +int AliTPCAltro(Int_t eth=0){ //eth is a threshold. //Digits stored into a file have an amplitude value greater than "eth" Int_t offset=1; //this should be equal to the threshold @@ -17,48 +17,59 @@ int AliTPCAltro(char* FileName,Int_t eth=0){ because the range for each word goes from 0 to 1023, now due to zero suppression values lower that the threshold never appear. */ - TFile *cf=TFile::Open(FileName); - // old geometry (3.07) - //AliTPCParamSR *param =(AliTPCParamSR *)cf->Get("75x40_100x60"); - // if new geometry comment out the line above and uncomment the one below - AliTPCParamSR *param =(AliTPCParamSR *)cf->Get("75x40_100x60_150x60"); - AliTPCDigitsArray *digarr=new AliTPCDigitsArray; - digarr->Setup(param); - - char cname[100]; - //old geometry - //sprintf(cname,"TreeD_75x40_100x60_%d",eventn); - // if new geometry comment out the line above and uncomment the one below - Int_t eventn=0; - sprintf(cname,"TreeD_75x40_100x60_150x60_%d",eventn); - digarr->ConnectTree(cname); Int_t PSecNumber=-1; //Previous Sector number Int_t PRowNumber=-1; //Previous Row number Int_t PPadNumber=-1; //Previous Pad number Int_t PTimeBin=-1; //Previous Time-Bin Int_t BunchLength=0; - //AliTPCBuffer160 is used in write mode to generate AltroFormat.dat file AliTPCBuffer160 Buffer("AltroFormat.dat",1); - //number of entries in the tree - Int_t nrows=Int_t(digarr->GetTree()->GetEntries()); - cout<<"Number of entries "<GetNumberOfEvents(); + cout<<"Number of Events:"<>choice; + }while (choice<=0 || choice>nevents); + rl->GetEvent(choice-1); + AliLoader *tpcloader=rl->GetLoader("TPCLoader"); + tpcloader->LoadDigits(); + TTree *digitsTree=tpcloader->TreeD(); + + AliSimDigits digrows, *dummy=&digrows; + digitsTree->GetBranch("Segment")->SetAddress(&dummy); + Stat_t nrows = digitsTree->GetEntries(); + cout<<"Number of entries (rows):"<CdGAFile(); + AliTPCParamSR* param = AliTPC::LoadTPCParam(gFile); + if (!param) + cout<<"No TPC parameter"<Setup(param); + digarr->ConnectTree(digitsTree); //ofstream ftxt("Data.txt"); for (Int_t n=0; nLoadEntry(n); Int_t sec,row; // sector and row number (in the TPC) + AliSimDigits *digrow=(AliSimDigits*)digarr->LoadEntry(n); param->AdjustSectorRow(digrow->GetID(),sec,row); + //cout<<"Sector:"<First(); do{ - Short_t dig=digrow->CurrentDigit(); //adc - Int_t time=digrow->CurrentRow(); //time - Int_t pad =digrow->CurrentColumn(); // pad - if(dig>eth){ + Short_t dig=digrow->CurrentDigit(); //adc + Int_t time=digrow->CurrentRow(); //time + Int_t pad =digrow->CurrentColumn(); // pad + //cout<<"dig:"<eth){ Count++; //ftxt<<"Sec: "<Next()); }//end for + Buffer.FillBuffer(PTimeBin); Buffer.FillBuffer(BunchLength+2); nwords+=2; Buffer.WriteTrailer(nwords,PPadNumber,PRowNumber,PSecNumber); + numPackets++; cout<<"There are "<