From 0e75e410fbf79a73b10754f32c9e6740c1e779a7 Mon Sep 17 00:00:00 2001 From: marian Date: Thu, 26 Oct 2006 12:24:33 +0000 Subject: [PATCH] Codding convention correction (Marian) --- TPC/AliTPCmapper.cxx | 85 ++++++++++++++++++++------- TPC/AliTPCmapper.h | 135 ++++++++++++++++++++++--------------------- 2 files changed, 132 insertions(+), 88 deletions(-) diff --git a/TPC/AliTPCmapper.cxx b/TPC/AliTPCmapper.cxx index 2312ce87271..e56c9446cfc 100644 --- a/TPC/AliTPCmapper.cxx +++ b/TPC/AliTPCmapper.cxx @@ -81,7 +81,7 @@ void AliTPCmapper::Init() //______________________________________________________________ Int_t AliTPCmapper::ReadMapping() { - FILE *f_in; + FILE *fin; char line[255]; int pad = -1, row = -1; @@ -89,22 +89,22 @@ Int_t AliTPCmapper::ReadMapping() int padsec = 0; - f_in = fopen(fMapfileName,"r"); - if (!f_in){ + fin = fopen(fMapfileName,"r"); + if (!fin){ fprintf(stderr, "cannot open file '%s'!\n",fMapfileName); return 1; } - fgets(line,256,f_in); + fgets(line,256,fin); while (sscanf(line,"%d %d %d %d %d %d %d %d", &padsec, &row, &pad, &rcu, &bra, &fec, &alt, &chn )!=8){ - fgets(line, 256, f_in); + fgets(line, 256, fin); fprintf(stderr,"%s",line); } - while (!feof(f_in)){ + while (!feof(fin)){ sscanf(line,"%d %d %d %d %d %d %d %d", &padsec, &row, &pad, &rcu, &bra, &fec, &alt, &chn @@ -124,10 +124,10 @@ Int_t AliTPCmapper::ReadMapping() - fgets(line, 256, f_in); + fgets(line, 256, fin); } - fclose(f_in); + fclose(fin); return 0; } @@ -143,7 +143,10 @@ void AliTPCmapper::PrintRBFACinfo(Int_t row, Int_t pad) } //______________________________________________________________ -Int_t AliTPCmapper::GetPadsInRowS(Int_t row){ +Int_t AliTPCmapper::GetPadsInRowS(Int_t row) const{ + // + //GetPadsInRowS + // if ( row == 0 ) return 68; @@ -161,7 +164,10 @@ Int_t AliTPCmapper::GetPadsInRowS(Int_t row){ } //______________________________________________________________ -Double_t AliTPCmapper::GetPadXlocalS(Int_t row, Int_t pad){ +Double_t AliTPCmapper::GetPadXlocalS(Int_t row, Int_t pad) const { + // + //GetPadXlocalS + // if ( row < 63 ) //IROC return (852.25 + 7.5 * (Double_t)row)*1.e-1; //divide by 10 to get cm @@ -176,14 +182,20 @@ Double_t AliTPCmapper::GetPadXlocalS(Int_t row, Int_t pad){ } //______________________________________________________________ -Double_t AliTPCmapper::GetPadXlocalS(Int_t padsector){ +Double_t AliTPCmapper::GetPadXlocalS(Int_t padsector) const{ + // + //GetPadXlocalS + // Int_t row=GetRowFromPadSector(padsector); Int_t pad=GetPadFromPadSector(padsector); return GetPadXlocalS(row,pad); } //______________________________________________________________ -Double_t AliTPCmapper::GetPadYlocalS(Int_t row, Int_t pad){ +Double_t AliTPCmapper::GetPadYlocalS(Int_t row, Int_t pad) const{ + // + //:GetPadYlocalS + // Int_t padsInRow = GetPadsInRowS(row); if ( row < 63 ) //IROC @@ -194,44 +206,63 @@ Double_t AliTPCmapper::GetPadYlocalS(Int_t row, Int_t pad){ } //______________________________________________________________ -Double_t AliTPCmapper::GetPadYlocalS(Int_t padsector){ +Double_t AliTPCmapper::GetPadYlocalS(Int_t padsector) const{ + // + //:GetPadYlocalS + // Int_t row = GetRowFromPadSector(padsector); Int_t pad = GetPadFromPadSector(padsector); return GetPadYlocalS(row,pad); } //______________________________________________________________ -Double_t AliTPCmapper::GetPadXglobalS(Int_t row, Int_t pad,Int_t sector){ +Double_t AliTPCmapper::GetPadXglobalS(Int_t row, Int_t pad,Int_t sector) const{ + // + // GetPadXglobalS + // Double_t angle = (Double_t)(( sector * 20. ) +10. ) * TMath::DegToRad(); return GetPadXlocalS(row,pad)*TMath::Cos(angle) - GetPadYlocalS(row,pad)*TMath::Sin(angle); } //______________________________________________________________ -Double_t AliTPCmapper::GetPadYglobalS(Int_t row, Int_t pad,Int_t sector){ +Double_t AliTPCmapper::GetPadYglobalS(Int_t row, Int_t pad,Int_t sector) const{ + // + // GetPadYglobalS + // Double_t angle = (Double_t)(( sector * 20. ) + 10. ) * TMath::DegToRad(); return GetPadXlocalS(row,pad)*TMath::Sin(angle) + GetPadYlocalS(row,pad)*TMath::Cos(angle); } //______________________________________________________________ -Double_t AliTPCmapper::GetPadWidthS(Int_t row) +Double_t AliTPCmapper::GetPadWidthS(Int_t row) const { + // + // :GetPadWidthS + // if (row < 63 ) return .4; return .6; } //______________________________________________________________ -Double_t AliTPCmapper::GetPadLengthS(Int_t row) +Double_t AliTPCmapper::GetPadLengthS(Int_t row) const { + // + // GetPadLengthS + // + if ( row < 63 ) return .75; if ( row < 127 ) return 1.; return 1.5; } //______________________________________________________________ -Int_t AliTPCmapper::GetAltroAddrwPatch(const Int_t row,const Int_t pad) +Int_t AliTPCmapper::GetAltroAddrwPatch(const Int_t row,const Int_t pad) const { + // + // :GetAltroAddrwPatch + // return GetChannelS(row,pad)+ (GetAltroS (row,pad) <<4)+ (GetFECs (row,pad) <<7)+ @@ -240,14 +271,20 @@ Int_t AliTPCmapper::GetAltroAddrwPatch(const Int_t row,const Int_t pad) } //______________________________________________________________ -Int_t AliTPCmapper::GetAltroAddrwPatch(const Int_t padsector) +Int_t AliTPCmapper::GetAltroAddrwPatch(const Int_t padsector) const { + // + // GetAltroAddrwPatch + // return GetAltroAddrwPatch(GetRowFromPadSector(padsector),GetPadFromPadSector(padsector)); } //______________________________________________________________ -Int_t AliTPCmapper::GetRow(Int_t altroaddr) +Int_t AliTPCmapper::GetRow(Int_t altroaddr) const { + // + // GetRow + // Int_t rcu = (altroaddr>>12)&0x07; Int_t bra = (altroaddr>>11)&0x01; Int_t fec = (altroaddr>>7)&0x0F; @@ -257,8 +294,11 @@ Int_t AliTPCmapper::GetRow(Int_t altroaddr) } //______________________________________________________________ -Int_t AliTPCmapper::GetPad(Int_t altroaddr) +Int_t AliTPCmapper::GetPad(Int_t altroaddr) const { + // + // GetPad + // Int_t rcu = (altroaddr>>12)&0x07; Int_t bra = (altroaddr>>11)&0x01; Int_t fec = (altroaddr>>7)&0x0F; @@ -270,6 +310,9 @@ Int_t AliTPCmapper::GetPad(Int_t altroaddr) //______________________________________________________________ void AliTPCmapper::PrintAddressArray(Int_t row, Int_t pad) { + // + // PrintAddressArray + // Bool_t a[kNaddrSize]; Int_t addr = GetAltroAddrwPatch(row,pad); diff --git a/TPC/AliTPCmapper.h b/TPC/AliTPCmapper.h index 1f5bfff446c..948e020f9ae 100644 --- a/TPC/AliTPCmapper.h +++ b/TPC/AliTPCmapper.h @@ -3,38 +3,9 @@ /* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -#include +#include -class AliTPCmapper{ - -private: - enum { - kNrcu = 6, - kNbranch = 2, - kNfecMax = 13, - kNaltro = 8, - kNchannel = 16, - kNpadrow = 159, - kNpadMax = 140, - kNaddrSize = 20, - kNpadSector = 15488 - }; - - Int_t fAddressToRow[kNrcu][kNbranch][kNfecMax][kNaltro][kNchannel]; - Int_t fAddressToPad[kNrcu][kNbranch][kNfecMax][kNaltro][kNchannel]; - - Int_t fRowPadToRCU[kNpadrow][kNpadMax]; - Int_t fRowPadToBranch[kNpadrow][kNpadMax]; - Int_t fRowPadToFEC[kNpadrow][kNpadMax]; - Int_t fRowPadToAltro[kNpadrow][kNpadMax]; - Int_t fRowPadToChannel[kNpadrow][kNpadMax]; - - Int_t fPadsecToRow[kNpadSector]; - Int_t fPadsecToPad[kNpadSector]; - - Int_t fRowPadToPadsec[kNpadrow][kNpadMax]; - - Char_t fMapfileName[255]; +class AliTPCmapper : public TObject{ public: @@ -47,55 +18,55 @@ public: Int_t ReadMapping(); - Int_t GetRow(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel){ + Int_t GetRow(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel) const{ return fAddressToRow[rcu][branch][fec][altro][channel];} - Int_t GetPad(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel){ + Int_t GetPad(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel) const { return fAddressToPad[rcu][branch][fec][altro][channel];} - Int_t GetPadSector(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel){ + Int_t GetPadSector(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel) const { return fRowPadToPadsec[fAddressToPad[rcu][branch][fec][altro][channel]] [fAddressToPad[rcu][branch][fec][altro][channel]];} - Int_t GetRow(Int_t altroaddr); + Int_t GetRow(Int_t altroaddr) const; - Int_t GetPad(Int_t altroaddr); + Int_t GetPad(Int_t altroaddr) const; - Int_t GetPadFromPadSector(Int_t padsector){ + Int_t GetPadFromPadSector(Int_t padsector) const{ return fPadsecToPad[padsector];} - Int_t GetRowFromPadSector(Int_t padsector){ + Int_t GetRowFromPadSector(Int_t padsector) const { return fPadsecToRow[padsector];} - Int_t GetPadSector(Int_t row,Int_t pad){ + Int_t GetPadSector(Int_t row,Int_t pad) const{ return fRowPadToPadsec[row][pad];} - Int_t GetPadsInRowS(Int_t row); + Int_t GetPadsInRowS(Int_t row) const; - Double_t GetPadXlocalS (Int_t row, Int_t pad); - Double_t GetPadXlocalS (Int_t padsector); - Double_t GetPadYlocalS (Int_t row, Int_t pad); - Double_t GetPadYlocalS (Int_t padsector); - Double_t GetPadXglobalS(Int_t row, Int_t pad, Int_t sector); - Double_t GetPadYglobalS(Int_t row, Int_t pad, Int_t sector); - Double_t GetPadWidthS (Int_t row); - Double_t GetPadLengthS (Int_t row); + Double_t GetPadXlocalS (Int_t row, Int_t pad) const; + Double_t GetPadXlocalS (Int_t padsector) const; + Double_t GetPadYlocalS (Int_t row, Int_t pad) const; + Double_t GetPadYlocalS (Int_t padsector) const; + Double_t GetPadXglobalS(Int_t row, Int_t pad, Int_t sector) const; + Double_t GetPadYglobalS(Int_t row, Int_t pad, Int_t sector) const; + Double_t GetPadWidthS (Int_t row) const; + Double_t GetPadLengthS (Int_t row) const; - Int_t GetRCUs(Int_t row, Int_t pad){ + Int_t GetRCUs(Int_t row, Int_t pad) const{ return fRowPadToRCU[row][pad];} - Int_t GetBranchS(Int_t row, Int_t pad){ + Int_t GetBranchS(Int_t row, Int_t pad) const { return fRowPadToBranch[row][pad];} - Int_t GetFECs(Int_t row, Int_t pad){ + Int_t GetFECs(Int_t row, Int_t pad) const { return fRowPadToFEC[row][pad];} - Int_t GetAltroS(Int_t row, Int_t pad){ + Int_t GetAltroS(Int_t row, Int_t pad) const{ return fRowPadToAltro[row][pad];} - Int_t GetChannelS(Int_t row, Int_t pad){ + Int_t GetChannelS(Int_t row, Int_t pad) const { return fRowPadToChannel[row][pad];} void PrintRBFACinfo(Int_t row, Int_t pad); @@ -103,36 +74,66 @@ public: void PrintAddressArray(Int_t row, Int_t pad); - Int_t GetAltroAddrwPatch(const Int_t row, const Int_t pad); + Int_t GetAltroAddrwPatch(const Int_t row, const Int_t pad) const; - Int_t GetAltroAddrwPatch(const Int_t padsector); + Int_t GetAltroAddrwPatch(const Int_t padsector) const; //for aliroot compatibility (sector == roc) - Int_t GetPadsInRowS(Int_t row, Int_t sector){ + Int_t GetPadsInRowS(Int_t row, Int_t sector) const { return GetPadsInRowS(row+(sector/36)*63);} - Double_t GetPadXlocal (Int_t row, Int_t pad, Int_t sector){ + Double_t GetPadXlocal (Int_t row, Int_t pad, Int_t sector) const { return GetPadXlocalS(row+(sector/36)*63,pad);} - Double_t GetPadYlocal (Int_t row, Int_t pad, Int_t sector){ + Double_t GetPadYlocal (Int_t row, Int_t pad, Int_t sector) const { return GetPadYlocalS(row+(sector/36)*63,pad);} - Double_t GetPadXglobal (Int_t row, Int_t pad, Int_t sector){ + Double_t GetPadXglobal (Int_t row, Int_t pad, Int_t sector) const { return GetPadXlocalS(row+(sector/36)*63,pad);} - Double_t GetPadYglobal (Int_t row, Int_t pad, Int_t sector){ + Double_t GetPadYglobal (Int_t row, Int_t pad, Int_t sector) const{ return GetPadYlocalS(row+(sector/36)*63,pad);} - Int_t GetRCU(Int_t row, Int_t pad, Int_t sector){ + Int_t GetRCU(Int_t row, Int_t pad, Int_t sector) const { return GetRCUs(row+(sector/36)*63,pad);} - Int_t GetBranch(Int_t row, Int_t pad, Int_t sector){ + Int_t GetBranch(Int_t row, Int_t pad, Int_t sector) const { return GetBranchS(row+(sector/36)*63,pad);} - Int_t GetFEC(Int_t row, Int_t pad, Int_t sector){ + Int_t GetFEC(Int_t row, Int_t pad, Int_t sector) const { return GetFECs(row+(sector/36)*63,pad);} - Int_t GetAltro(Int_t row, Int_t pad, Int_t sector){ + Int_t GetAltro(Int_t row, Int_t pad, Int_t sector) const { return GetAltroS(row+(sector/36)*63,pad);} - Int_t GetChannel(Int_t row, Int_t pad, Int_t sector){ + Int_t GetChannel(Int_t row, Int_t pad, Int_t sector) const { return GetChannelS(row+(sector/36)*63,pad);} - Double_t GetPadWidth (Int_t row, Int_t sector){ + Double_t GetPadWidth (Int_t row, Int_t sector) const { return GetPadWidthS(row+(sector/36)*63);} - Double_t GetPadLength (Int_t row, Int_t sector){ + Double_t GetPadLength (Int_t row, Int_t sector) const{ return GetPadLengthS(row+(sector/36)*63);} +private: + enum { + kNrcu = 6, + kNbranch = 2, + kNfecMax = 13, + kNaltro = 8, + kNchannel = 16, + kNpadrow = 159, + kNpadMax = 140, + kNaddrSize = 20, + kNpadSector = 15488 + }; + + Int_t fAddressToRow[kNrcu][kNbranch][kNfecMax][kNaltro][kNchannel]; //fAddressToRow + Int_t fAddressToPad[kNrcu][kNbranch][kNfecMax][kNaltro][kNchannel]; //fAddressToPad + + Int_t fRowPadToRCU[kNpadrow][kNpadMax]; //fRowPadToRCU + Int_t fRowPadToBranch[kNpadrow][kNpadMax]; //fRowPadToBranch + Int_t fRowPadToFEC[kNpadrow][kNpadMax]; //fRowPadToFEC + Int_t fRowPadToAltro[kNpadrow][kNpadMax]; // fRowPadToAltro + Int_t fRowPadToChannel[kNpadrow][kNpadMax]; //RowPadToChannel + + Int_t fPadsecToRow[kNpadSector]; //PadsecToRow + Int_t fPadsecToPad[kNpadSector]; //PadsecToPad + + Int_t fRowPadToPadsec[kNpadrow][kNpadMax]; //RowPadToPadsec + + Char_t fMapfileName[255]; //MapfileName + + ClassDef(AliTPCmapper,0) }; -- 2.39.3