From 0a162a8fd16ce95c8950ff4c52839c1f8853a9d8 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 26 May 2004 15:42:22 +0000 Subject: [PATCH] Coding conventions --- HLT/comp/AliL3ClusterFitter.cxx | 234 ++++++++++++++++---------------- HLT/comp/AliL3ClusterFitter.h | 55 ++++---- 2 files changed, 143 insertions(+), 146 deletions(-) diff --git a/HLT/comp/AliL3ClusterFitter.cxx b/HLT/comp/AliL3ClusterFitter.cxx index e6aba41c847..1c9b3eb543b 100644 --- a/HLT/comp/AliL3ClusterFitter.cxx +++ b/HLT/comp/AliL3ClusterFitter.cxx @@ -5,7 +5,6 @@ #include "AliL3StandardIncludes.h" -#include "AliL3Logging.h" #include "AliL3ClusterFitter.h" #include "AliL3FitUtilities.h" #include "AliL3DigitData.h" @@ -14,7 +13,6 @@ #include "AliL3MemHandler.h" #include "AliL3HoughTrack.h" #include "AliL3SpacePointData.h" -#include "AliL3Compress.h" #if __GNUC__ == 3 using namespace std; @@ -31,10 +29,10 @@ using namespace std; ClassImp(AliL3ClusterFitter) -Int_t AliL3ClusterFitter::fBadFitError=0; -Int_t AliL3ClusterFitter::fFitError=0; -Int_t AliL3ClusterFitter::fResultError=0; -Int_t AliL3ClusterFitter::fFitRangeError=0; +Int_t AliL3ClusterFitter::fgBadFitError=0; +Int_t AliL3ClusterFitter::fgFitError=0; +Int_t AliL3ClusterFitter::fgResultError=0; +Int_t AliL3ClusterFitter::fgFitRangeError=0; AliL3ClusterFitter::AliL3ClusterFitter() { @@ -130,8 +128,8 @@ void AliL3ClusterFitter::Init(Int_t slice,Int_t patch,Int_t *rowrange,AliL3Track Float_t hit[3]; track->GetLineCrossingPoint(j,hit); hit[0] += AliL3Transform::Row2X(track->GetFirstRow()); - Float_t R = sqrt(hit[0]*hit[0] + hit[1]*hit[1]); - hit[2] = R*track->GetTgl(); + Float_t r = sqrt(hit[0]*hit[0] + hit[1]*hit[1]); + hit[2] = r*track->GetTgl(); Int_t se,ro; AliL3Transform::Slice2Sector(slice,j,se,ro); AliL3Transform::Local2Raw(hit,se,ro); @@ -196,20 +194,20 @@ void AliL3ClusterFitter::LoadLocalSegments() { //Calculate the crossing point between track and padrow - Float_t xyz_cross[3]; - if(!track->GetCrossingPoint(j,xyz_cross)) + Float_t xyzCross[3]; + if(!track->GetCrossingPoint(j,xyzCross)) continue; Int_t sector,row; AliL3Transform::Slice2Sector(fSlice,j,sector,row); - AliL3Transform::Local2Raw(xyz_cross,sector,row); + AliL3Transform::Local2Raw(xyzCross,sector,row); - if(xyz_cross[1] < 0 || xyz_cross[1] >= AliL3Transform::GetNPads(j) || - xyz_cross[2] < 0 || xyz_cross[2] >= AliL3Transform::GetNTimeBins()) //track goes out of range + if(xyzCross[1] < 0 || xyzCross[1] >= AliL3Transform::GetNPads(j) || + xyzCross[2] < 0 || xyzCross[2] >= AliL3Transform::GetNTimeBins()) //track goes out of range continue; - track->SetPadHit(j,xyz_cross[1]); - track->SetTimeHit(j,xyz_cross[2]); + track->SetPadHit(j,xyzCross[1]); + track->SetTimeHit(j,xyzCross[2]); Float_t crossingangle = track->GetCrossingAngle(j); track->SetCrossingAngleLUT(j,crossingangle); @@ -294,20 +292,20 @@ void AliL3ClusterFitter::LoadSeeds(Int_t *rowrange,Bool_t offline,Int_t eventnr, //track->Print(); //exit(5); } - Float_t xyz_cross[3] = {track->GetPointX(),track->GetPointY(),track->GetPointZ()}; - xyz_cross[2] += zvertex; + Float_t xyzCross[3] = {track->GetPointX(),track->GetPointY(),track->GetPointZ()}; + xyzCross[2] += zvertex; Int_t sector,row; AliL3Transform::Slice2Sector(slice,j,sector,row); - AliL3Transform::Global2Raw(xyz_cross,sector,row); - //cout<<"Examining slice "<= AliL3Transform::GetNPads(j)) //Track leaves the slice + AliL3Transform::Global2Raw(xyzCross,sector,row); + //cout<<"Examining slice "<= AliL3Transform::GetNPads(j)) //Track leaves the slice { newslice: Int_t tslice=slice; - Float_t lastcross=xyz_cross[1]; - if(xyz_cross[1] > 0) + Float_t lastcross=xyzCross[1]; + if(xyzCross[1] > 0) { if(slice == 17) slice=0; @@ -340,16 +338,16 @@ void AliL3ClusterFitter::LoadSeeds(Int_t *rowrange,Bool_t offline,Int_t eventnr, //track->Print(); //exit(5); } - xyz_cross[0] = track->GetPointX(); - xyz_cross[1] = track->GetPointY(); - xyz_cross[2] = track->GetPointZ(); - xyz_cross[2] += zvertex; + xyzCross[0] = track->GetPointX(); + xyzCross[1] = track->GetPointY(); + xyzCross[2] = track->GetPointZ(); + xyzCross[2] += zvertex; Int_t sector,row; AliL3Transform::Slice2Sector(slice,j,sector,row); - AliL3Transform::Global2Raw(xyz_cross,sector,row); - if(xyz_cross[1] < 0 || xyz_cross[1] >= AliL3Transform::GetNPads(j)) //track is in the borderline + AliL3Transform::Global2Raw(xyzCross,sector,row); + if(xyzCross[1] < 0 || xyzCross[1] >= AliL3Transform::GetNPads(j)) //track is in the borderline { - if(xyz_cross[1] > 0 && lastcross > 0 || xyz_cross[1] < 0 && lastcross < 0) + if(xyzCross[1] > 0 && lastcross > 0 || xyzCross[1] < 0 && lastcross < 0) goto newslice; else { @@ -359,18 +357,18 @@ void AliL3ClusterFitter::LoadSeeds(Int_t *rowrange,Bool_t offline,Int_t eventnr, } } - if(xyz_cross[2] < 0 || xyz_cross[2] >= AliL3Transform::GetNTimeBins())//track goes out of range + if(xyzCross[2] < 0 || xyzCross[2] >= AliL3Transform::GetNTimeBins())//track goes out of range continue; - if(xyz_cross[1] < 0 || xyz_cross[1] >= AliL3Transform::GetNPads(j)) + if(xyzCross[1] < 0 || xyzCross[1] >= AliL3Transform::GetNPads(j)) { - cerr<<"Slice "<Print(); exit(5); } - track->SetPadHit(j,xyz_cross[1]); - track->SetTimeHit(j,xyz_cross[2]); + track->SetPadHit(j,xyzCross[1]); + track->SetTimeHit(j,xyzCross[2]); angle=0; AliL3Transform::Local2GlobalAngle(&angle,slice); Float_t crossingangle = track->GetCrossingAngle(j,slice); @@ -485,10 +483,10 @@ void AliL3ClusterFitter::FindClusters() cout<<"Fitted "<GetPadHit(row))<<" time " <<(Int_t)rint(track->GetTimeHit(row))<<" hitcharge " <GetPadHit(row))+(Int_t)rint(track->GetTimeHit(row))].fCharge<GetNOverlaps(fCurrentPadRow) > max_tracks) + Int_t maxTracks = FIT_MAXPAR/NUM_PARS; + if(track->GetNOverlaps(fCurrentPadRow) > maxTracks) { cerr<<"AliL3ClusterFitter::FitOverlappingClusters : Too many overlapping tracks"<GetOverlaps(fCurrentPadRow); //Check if at least one cluster is not already fitted - Bool_t all_fitted=kTRUE; + Bool_t allFitted=kTRUE; Int_t k=-1; while(k < track->GetNOverlaps(fCurrentPadRow)) @@ -778,11 +776,11 @@ void AliL3ClusterFitter::FitClusters(AliL3ModelTrack *track,Int_t *padrange,Int_ if(!tr) continue; if(!tr->IsSet(fCurrentPadRow) && !tr->IsPresent(fCurrentPadRow))//cluster has not been set and is not present { - all_fitted = kFALSE; + allFitted = kFALSE; break; } } - if(all_fitted) + if(allFitted) { if(fDebug) cout<<"But all the clusters were already fitted on row "<IsSet(fCurrentPadRow)) //Cluster is not fitted before { - a[n_overlaps*NUM_PARS+1] = charge; - a[n_overlaps*NUM_PARS+3] = sqrt(tr->GetParSigmaY2(fCurrentPadRow)) * GetYWidthFactor(); - a[n_overlaps*NUM_PARS+5] = sqrt(tr->GetParSigmaZ2(fCurrentPadRow)) * GetZWidthFactor(); - //a[n_overlaps*NUM_PARS+6] = sqrt(tr->GetParSigmaZ2(fCurrentPadRow)) * GetZWidthFactor(); - lista[n_overlaps*NUM_PARS + 1] = 1; - lista[n_overlaps*NUM_PARS + 2] = 1; - lista[n_overlaps*NUM_PARS + 3] = 0; - lista[n_overlaps*NUM_PARS + 4] = 1; - lista[n_overlaps*NUM_PARS + 5] = 0; - //lista[n_overlaps*NUM_PARS + 6] = 0; - fit_pars += 3; //<------------------- + a[nOverlaps*NUM_PARS+1] = charge; + a[nOverlaps*NUM_PARS+3] = sqrt(tr->GetParSigmaY2(fCurrentPadRow)) * GetYWidthFactor(); + a[nOverlaps*NUM_PARS+5] = sqrt(tr->GetParSigmaZ2(fCurrentPadRow)) * GetZWidthFactor(); + //a[nOverlaps*NUM_PARS+6] = sqrt(tr->GetParSigmaZ2(fCurrentPadRow)) * GetZWidthFactor(); + lista[nOverlaps*NUM_PARS + 1] = 1; + lista[nOverlaps*NUM_PARS + 2] = 1; + lista[nOverlaps*NUM_PARS + 3] = 0; + lista[nOverlaps*NUM_PARS + 4] = 1; + lista[nOverlaps*NUM_PARS + 5] = 0; + //lista[nOverlaps*NUM_PARS + 6] = 0; + fitPars += 3; //<------------------- } else //Cluster was fitted before { @@ -870,55 +868,55 @@ void AliL3ClusterFitter::FitClusters(AliL3ModelTrack *track,Int_t *padrange,Int_ if(fDebug) cout< max_charge) + timeNum++; + if(charge > maxCharge) { - max_charge = charge; - //time_num++; + maxCharge = charge; + //timeNum++; } if(fDebug) cout<<"Filling padrow "<= size) { @@ -933,47 +931,47 @@ void AliL3ClusterFitter::FitClusters(AliL3ModelTrack *track,Int_t *padrange,Int_ y[ndata]=charge; s[ndata]= 1 + sqrt((Double_t)charge); } - if(max_charge) //there was charge on this pad - pad_num++; - if(time_num_max < time_num) - time_num_max = time_num; + if(maxCharge) //there was charge on this pad + padNum++; + if(timeNumMax < timeNum) + timeNumMax = timeNum; } - if(pad_num <= 1 || time_num_max <=1 || n_overlaps > fNmaxOverlaps || ndata <= fit_pars) //too few to do fit + if(padNum <= 1 || timeNumMax <=1 || nOverlaps > fNmaxOverlaps || ndata <= fitPars) //too few to do fit { SetClusterfitFalse(track); if(fDebug) - cout<<"Too few digits or too many overlaps: "<GetNOverlaps(fCurrentPadRow) > 0)//There is a overlap overlapping=kTRUE; k=-1; - n_overlaps=0; + nOverlaps=0; while(k < track->GetNOverlaps(fCurrentPadRow)) { AliL3ModelTrack *tr=0; @@ -995,36 +993,36 @@ void AliL3ClusterFitter::FitClusters(AliL3ModelTrack *track,Int_t *padrange,Int_ else lpatch=2; - //if(chisq_f < fChiSqMax[(Int_t)overlapping])//cluster fit is good enough - if(chisq_f < fChiSqMax[lpatch])//cluster fit is good enough + //if(chisqF < fChiSqMax[(Int_t)overlapping])//cluster fit is good enough + if(chisqF < fChiSqMax[lpatch])//cluster fit is good enough { - tot_charge = (Int_t)(2*AliL3Transform::Pi() * a[n_overlaps*NUM_PARS+1] * a[n_overlaps*NUM_PARS+3] * a[n_overlaps*NUM_PARS+5]); - Float_t fpad = a[n_overlaps*NUM_PARS+2]; - Float_t ftime = a[n_overlaps*NUM_PARS+4]; - if(tot_charge < 0 || fpad < -1 || fpad > AliL3Transform::GetNPads(fCurrentPadRow) || + totCharge = (Int_t)(2*AliL3Transform::Pi() * a[nOverlaps*NUM_PARS+1] * a[nOverlaps*NUM_PARS+3] * a[nOverlaps*NUM_PARS+5]); + Float_t fpad = a[nOverlaps*NUM_PARS+2]; + Float_t ftime = a[nOverlaps*NUM_PARS+4]; + if(totCharge < 0 || fpad < -1 || fpad > AliL3Transform::GetNPads(fCurrentPadRow) || ftime < -1 || ftime > AliL3Transform::GetNTimeBins()) { if(fDebug) cout<<"AliL3ClusterFitter::Fatal result(s) in fit; in slice "<SetCluster(fCurrentPadRow,0,0,0,0,0,0); fFailed++; - fResultError++; + fgResultError++; continue; } - tr->SetCluster(fCurrentPadRow,fpad,ftime,tot_charge,0,0,pad_num); + tr->SetCluster(fCurrentPadRow,fpad,ftime,totCharge,0,0,padNum); /* - tr->SetCluster(fCurrentPadRow,fpad,ftime,tot_charge, - pow(a[n_overlaps*NUM_PARS+3],2), - pow(a[n_overlaps*NUM_PARS+5],2),pad_num); + tr->SetCluster(fCurrentPadRow,fpad,ftime,totCharge, + pow(a[nOverlaps*NUM_PARS+3],2), + pow(a[nOverlaps*NUM_PARS+5],2),padNum); */ if(fDebug) { - cout<<"Setting cluster in slice "<SetCluster(fCurrentPadRow,0,0,0,0,0,0); - fBadFitError++; + fgBadFitError++; fFailed++; } } - n_overlaps++; + nOverlaps++; } delete [] plane; @@ -1196,7 +1194,7 @@ void AliL3ClusterFitter::AddClusters() } } -void AliL3ClusterFitter::WriteTracks(Int_t min_hits) +void AliL3ClusterFitter::WriteTracks(Int_t minHits) { if(!fSeeds) return; @@ -1208,7 +1206,7 @@ void AliL3ClusterFitter::WriteTracks(Int_t min_hits) { AliL3ModelTrack *tr = (AliL3ModelTrack*)fSeeds->GetCheckedTrack(i); if(!tr) continue; - if(tr->GetNHits() < min_hits) + if(tr->GetNHits() < minHits) { fakes->AddLast(tr); fSeeds->Remove(i); diff --git a/HLT/comp/AliL3ClusterFitter.h b/HLT/comp/AliL3ClusterFitter.h index 33f42c8e644..8891c97fd84 100644 --- a/HLT/comp/AliL3ClusterFitter.h +++ b/HLT/comp/AliL3ClusterFitter.h @@ -3,7 +3,6 @@ #ifndef AliL3_ClusterFitter #define AliL3_ClusterFitter -#include "AliL3RootTypes.h" #include "AliL3Modeller.h" #include "AliL3Transform.h" @@ -13,6 +12,29 @@ class AliL3SpacePointData; class AliL3ClusterFitter : public AliL3Modeller { + public: + AliL3ClusterFitter(); + AliL3ClusterFitter(Char_t *path); + virtual ~AliL3ClusterFitter(); + + void Init(Int_t slice,Int_t patch,Int_t *rowrange,AliL3TrackArray *tracks); + void Init(Int_t slice,Int_t patch); + void LoadSeeds(Int_t *rowrange,Bool_t offline=kTRUE,Int_t eventnr=0,Float_t zvertex=0.0); + void LoadLocalSegments(); + void FindClusters(); + void AddClusters(); + void WriteClusters(Bool_t global=kTRUE); + void WriteTracks(Int_t minHits); + void SetNmaxOverlaps(Int_t i) {fNmaxOverlaps=i;} + //void SetChiSqMax(Float_t f,Bool_t overlapping) {fChiSqMax[(Int_t)overlapping] = f;} + void SetChiSqMax(Float_t f,Int_t lpatch) {fChiSqMax[lpatch] = f;} + void SetInnerWidthFactor(Float_t y,Float_t z) {fYInnerWidthFactor=y; fZInnerWidthFactor=z;} + void SetOuterWidthFactor(Float_t y,Float_t z) {fYOuterWidthFactor=y; fZOuterWidthFactor=z;} + + Float_t GetYWidthFactor() {return fCurrentPadRow < AliL3Transform::GetLastRow(1) ? fYInnerWidthFactor : fYOuterWidthFactor;} + Float_t GetZWidthFactor() {return fCurrentPadRow < AliL3Transform::GetLastRow(1) ? fZInnerWidthFactor : fZOuterWidthFactor;} + AliL3TrackArray *GetSeeds() {return fSeeds;} + private: Int_t fNmaxOverlaps; Int_t fRowMin; @@ -24,10 +46,10 @@ class AliL3ClusterFitter : public AliL3Modeller { Float_t fZOuterWidthFactor; Int_t fFitted; Int_t fFailed; - static Int_t fBadFitError; - static Int_t fFitError; - static Int_t fResultError; - static Int_t fFitRangeError; + static Int_t fgBadFitError; + static Int_t fgFitError; + static Int_t fgResultError; + static Int_t fgFitRangeError; Bool_t fSeeding; Int_t fNMaxClusters; Int_t fNClusters; @@ -43,29 +65,6 @@ class AliL3ClusterFitter : public AliL3Modeller { void SetClusterfitFalse(AliL3ModelTrack *track); void CalculateWeightedMean(AliL3ModelTrack *track,Int_t *padrange,Int_t *timerange); - public: - AliL3ClusterFitter(); - AliL3ClusterFitter(Char_t *path); - virtual ~AliL3ClusterFitter(); - - void Init(Int_t slice,Int_t patch,Int_t *rowrange,AliL3TrackArray *tracks); - void Init(Int_t slice,Int_t patch); - void LoadSeeds(Int_t *rowrange,Bool_t offline=kTRUE,Int_t eventnr=0,Float_t zvertex=0.0); - void LoadLocalSegments(); - void FindClusters(); - void AddClusters(); - void WriteClusters(Bool_t global=kTRUE); - void WriteTracks(Int_t min_hits); - void SetNmaxOverlaps(Int_t i) {fNmaxOverlaps=i;} - //void SetChiSqMax(Float_t f,Bool_t overlapping) {fChiSqMax[(Int_t)overlapping] = f;} - void SetChiSqMax(Float_t f,Int_t lpatch) {fChiSqMax[lpatch] = f;} - void SetInnerWidthFactor(Float_t y,Float_t z) {fYInnerWidthFactor=y; fZInnerWidthFactor=z;} - void SetOuterWidthFactor(Float_t y,Float_t z) {fYOuterWidthFactor=y; fZOuterWidthFactor=z;} - - Float_t GetYWidthFactor() {return fCurrentPadRow < AliL3Transform::GetLastRow(1) ? fYInnerWidthFactor : fYOuterWidthFactor;} - Float_t GetZWidthFactor() {return fCurrentPadRow < AliL3Transform::GetLastRow(1) ? fZInnerWidthFactor : fZOuterWidthFactor;} - AliL3TrackArray *GetSeeds() {return fSeeds;} - ClassDef(AliL3ClusterFitter,1) }; -- 2.31.1