From 92a876e269aaf37054806b00361f9a564b264ccf Mon Sep 17 00:00:00 2001 From: vestbo Date: Fri, 22 Mar 2002 11:50:20 +0000 Subject: [PATCH] A bugfix in AliL3Modeller::FindClusters. Changed parameter list in AliL3ModelTrack::GetParSigma**. Added function AliL3Compress::PrintCompRatio. --- HLT/comp/AliL3Compress.cxx | 85 +++++++++++++++++++++++++++++++----- HLT/comp/AliL3Compress.h | 3 +- HLT/comp/AliL3ModelTrack.cxx | 40 +++++++++++++---- HLT/comp/AliL3ModelTrack.h | 7 ++- HLT/comp/AliL3Modeller.cxx | 27 +++++++----- HLT/comp/AliL3Modeller.h | 2 +- 6 files changed, 128 insertions(+), 36 deletions(-) diff --git a/HLT/comp/AliL3Compress.cxx b/HLT/comp/AliL3Compress.cxx index 7e4d1cc5c80..53043b35ea3 100644 --- a/HLT/comp/AliL3Compress.cxx +++ b/HLT/comp/AliL3Compress.cxx @@ -15,7 +15,9 @@ #include "AliL3ModelTrack.h" #include "AliL3Transform.h" #include "AliL3MemHandler.h" +#ifdef use_aliroot #include "AliL3FileHandler.h" +#endif #include "bitio.h" //_____________________________________________________________ @@ -177,6 +179,7 @@ void AliL3Compress::CompressFile() if(output->mask != 0x80) //Write the current byte to file. { + //cerr<<"\nAliL3Compress::CompressFile() : Writing overhead bits!!!"<rack,output->file )!=output->rack) cerr<<"AliL3Compress::ComressFile : Error writing to bitfile"<mask=0x80; @@ -200,13 +203,13 @@ void AliL3Compress::CompressFile() OutputBit(output,0); else OutputBit(output,1); - power = 1<=power) { timeo++; temp=power - 1; } - OutputBits(output,abs(temp),fNumTimeBits); + OutputBits(output,abs(temp),(fNumTimeBits-1)); //Write pad information: temp = (Int_t)cluster.fDPad; @@ -214,13 +217,13 @@ void AliL3Compress::CompressFile() OutputBit(output,0); else OutputBit(output,1); - power = 1<=power) { pado++; temp=power - 1; } - OutputBits(output,abs(temp),fNumPadBits); + OutputBits(output,abs(temp),(fNumPadBits-1)); //Write charge information: temp = (Int_t)cluster.fDCharge; @@ -228,14 +231,14 @@ void AliL3Compress::CompressFile() OutputBit(output,0); else OutputBit(output,1); - power = 1<=power) { chargeo++; temp=power - 1; } - OutputBits(output,abs(temp),fNumChargeBits); - + OutputBits(output,abs(temp),(fNumChargeBits-1)); + //Write shape information: temp = (Int_t)cluster.fDSigmaY2; power = 1<GetNTracks(); i++) { AliL3ModelTrack *track = (AliL3ModelTrack*)fTracks->GetCheckedTrack(i); @@ -515,7 +519,7 @@ void AliL3Compress::CreateDigits(Int_t row,Float_t pad,Float_t time,Int_t charge AliL3Transform *tr = new AliL3Transform(); TRandom *random = new TRandom(); - Int_t entries=10000; + Int_t entries=1000; TH1F *hist1 = new TH1F("hist1","",tr->GetNPads(row),0,tr->GetNPads(row)-1); TH1F *hist2 = new TH1F("hist2","",tr->GetNTimeBins(),0,tr->GetNTimeBins()-1); TH2F *hist3 = new TH2F("hist3","",tr->GetNPads(row),0,tr->GetNPads(row)-1,tr->GetNTimeBins(),0,tr->GetNTimeBins()-1); @@ -542,7 +546,8 @@ void AliL3Compress::CreateDigits(Int_t row,Float_t pad,Float_t time,Int_t charge if(sigmaY2 <= 0 || sigmaZ2 <= 0) { - cerr<<"AliL3Compress::CreateDigits() : Wrong sigmas : "<SetBinaryInput(fname)) + { + cerr<<"AliL3Compress::PrintCompRatio(): Error opening file: "<CompBinary2Memory(ndigits); + mem->CloseBinaryInput(); + + Int_t digit_counter=0; + for(Int_t i=NRows[fPatch][0]; i<=NRows[fPatch][1]; i++) + { + digit_counter += rowPt->fNDigit; + mem->UpdateRowPointer(rowPt); + } + delete mem; + + sprintf(fname,"%s/tracks_c_%d_%d.raw",fPath,fSlice,fPatch); + FILE *file1 = fopen(fname,"r"); + if(!file1) + { + cerr<<"AliL3Compress::PrintCompRatio(): Error opening file: "<GetPadPitchWidth(patch); + fZResidualQ = 0.1/fTransform->GetPadPitchWidth(patch); + fXYWidthQ = 0.01; fZWidthQ = 0.01; } @@ -139,7 +142,6 @@ void AliL3ModelTrack::FillTrack() CalculateHelix(); - AliL3Transform transform; Float_t hit[3]; Int_t sector,row; for(Int_t i=NRows[fPatch][0]; i<=NRows[fPatch][1]; i++) @@ -147,8 +149,8 @@ void AliL3ModelTrack::FillTrack() AliL3ClusterModel *cl = GetClusterModel(i); if(!cl) continue; GetCrossingPoint(i,hit); - transform.Slice2Sector(fSlice,i,sector,row); - transform.Local2Raw(hit,sector,row); + fTransform->Slice2Sector(fSlice,i,sector,row); + fTransform->Local2Raw(hit,sector,row); SetPadHit(i,hit[1]); SetTimeHit(i,hit[2]); } @@ -317,7 +319,7 @@ void AliL3ModelTrack::Print() //----------Code below taken from AliTPCTracker.cxx----------------------- //Functions that give the expected cluster errors based on track parameters. -Double_t AliL3ModelTrack::GetParSigmaY2(Double_t r)//, Double_t tgl, Double_t pt) +Double_t AliL3ModelTrack::GetParSigmaY2(Int_t row)//Double_t r)//, Double_t tgl, Double_t pt) { // @@ -325,6 +327,16 @@ Double_t AliL3ModelTrack::GetParSigmaY2(Double_t r)//, Double_t tgl, Double_t pt // // Sigma rphi + Float_t pad,time; + if(!GetTime(row,time) || !GetPad(row,pad)) + return -1; + + Float_t xyz[3]; + Int_t sector,padrow; + fTransform->Slice2Sector(fSlice,row,sector,padrow); + fTransform->Raw2Local(xyz,sector,padrow,pad,time); + Double_t r = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]); + Double_t tgl = GetTgl(); Double_t pt = GetPt(); @@ -343,13 +355,23 @@ Double_t AliL3ModelTrack::GetParSigmaY2(Double_t r)//, Double_t tgl, Double_t pt return s; } -Double_t AliL3ModelTrack::GetParSigmaZ2(Double_t r)//, Double_t tgl) +Double_t AliL3ModelTrack::GetParSigmaZ2(Int_t row)//Double_t r)//, Double_t tgl) { // // Parametrised error of the cluster reconstruction (drift direction) // // Sigma z + Float_t pad,time; + if(!GetTime(row,time) || !GetPad(row,pad)) + return -1; + + Float_t xyz[3]; + Int_t sector,padrow; + fTransform->Slice2Sector(fSlice,row,sector,padrow); + fTransform->Raw2Local(xyz,sector,padrow,pad,time); + Double_t r = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]); + Double_t tgl = GetTgl(); const Float_t kAz=0.39614e-2; diff --git a/HLT/comp/AliL3ModelTrack.h b/HLT/comp/AliL3ModelTrack.h index 4ee05d822c2..2eba6ef89fb 100644 --- a/HLT/comp/AliL3ModelTrack.h +++ b/HLT/comp/AliL3ModelTrack.h @@ -5,6 +5,8 @@ #include "AliL3Models.h" #include "AliL3Defs.h" +class AliL3Transform; + class AliL3ModelTrack : public AliL3Track { private: @@ -12,6 +14,7 @@ class AliL3ModelTrack : public AliL3Track { Short_t fClusterCharge; //Average cluster charge AliL3ClusterModel *fClusters; //! AliL3TrackModel *fTrackModel; //! + AliL3Transform *fTransform; //! Short_t fNClusters; Int_t *fOverlap; //! Float_t fXYResidualQ; //Quantization steps. @@ -58,8 +61,8 @@ class AliL3ModelTrack : public AliL3Track { Bool_t GetTimeResidual(Int_t row,Float_t &res); Int_t GetNClusters() {return fNClusters;} - Double_t GetParSigmaY2(Double_t r); - Double_t GetParSigmaZ2(Double_t r); + Double_t GetParSigmaY2(Int_t row); + Double_t GetParSigmaZ2(Int_t row); ClassDef(AliL3ModelTrack,1) diff --git a/HLT/comp/AliL3Modeller.cxx b/HLT/comp/AliL3Modeller.cxx index 1a8d0d8c09e..0639c582fbf 100644 --- a/HLT/comp/AliL3Modeller.cxx +++ b/HLT/comp/AliL3Modeller.cxx @@ -37,22 +37,24 @@ AliL3Modeller::~AliL3Modeller() } -void AliL3Modeller::Init(Int_t slice,Int_t patch,Char_t *path) +void AliL3Modeller::Init(Int_t slice,Int_t patch,Char_t *trackdata,Char_t *path) { fSlice = slice; fPatch = patch; - fPadOverlap=4; - fTimeOverlap=4; + fPadOverlap=6; + fTimeOverlap=8; fTrackThreshold=10; sprintf(fPath,"%s",path); fTransform = new AliL3Transform(); fTracks = new AliL3TrackArray("AliL3ModelTrack"); - + + Char_t fname[100]; AliL3MemHandler *file = new AliL3MemHandler(); - if(!file->SetBinaryInput("tracks.raw")) + sprintf(fname,"%s/tracks.raw",trackdata); + if(!file->SetBinaryInput(fname)) { - cerr<<"AliL3Modeller::Init : Error opening trackfile"<Binary2TrackArray(fTracks); @@ -73,7 +75,6 @@ void AliL3Modeller::Init(Int_t slice,Int_t patch,Char_t *path) CheckForOverlaps(); fMemHandler = new AliL3MemHandler(); - Char_t fname[100]; sprintf(fname,"%sdigits_%d_%d.raw",fPath,fSlice,fPatch); if(!fMemHandler->SetBinaryInput(fname)) { @@ -153,7 +154,7 @@ void AliL3Modeller::FindClusters() { if(pad < 0 || pad >= fTransform->GetNPads(i)) { - //cout<<"Pad<0 on row "< 0) { pad--; //In this case, we haven't found anything yet, } //so we will try to expand our search within the natural boundaries. @@ -230,7 +234,7 @@ void AliL3Modeller::FindClusters() else if(padsign==1) { - if(cluster.fCharge==0 && abs(pad-hitpad) <= fPadOverlap/2) + if(cluster.fCharge==0 && abs(pad-hitpad) <= fPadOverlap/2 && pad < fTransform->GetNPads(i)-2) { pad++; //In this case, we haven't found anything yet, continue; //so we will try to expand our search within the natural boundaries. @@ -317,6 +321,7 @@ void AliL3Modeller::WriteRemaining() for(UInt_t j=0; jfNDigit; j++) { if(digPt[j].fCharge==0) continue; + digitcount++; ndigits[(i-NRows[fPatch][0])]++; } diff --git a/HLT/comp/AliL3Modeller.h b/HLT/comp/AliL3Modeller.h index 59f11364132..5de02bf0d79 100644 --- a/HLT/comp/AliL3Modeller.h +++ b/HLT/comp/AliL3Modeller.h @@ -52,7 +52,7 @@ class AliL3Modeller { AliL3Modeller(); virtual ~AliL3Modeller(); - void Init(Int_t slice,Int_t patch,Char_t *path="./"); + void Init(Int_t slice,Int_t patch,Char_t *trackdata,Char_t *path); void FindClusters(); void CheckForOverlaps(); void CalculateCrossingPoints(); -- 2.43.0