]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coding rules
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 13 Sep 2009 09:50:14 +0000 (09:50 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 13 Sep 2009 09:50:14 +0000 (09:50 +0000)
TRD/AliTRDalignment.cxx
TRD/AliTRDalignment.h

index e41c6bec3a804580280f9fec681172fe4a70340e..316abbb2bc1ec9f4004c72d885395a09e992c07c 100644 (file)
@@ -67,7 +67,6 @@
 
 #include <iostream>
 #include <fstream>
-//#include <string>
 
 #include "TMath.h"
 #include "TFile.h"
@@ -85,7 +84,6 @@
 #include "AliCDBStorage.h"
 #include "AliCDBMetaData.h"
 #include "AliCDBEntry.h"
-#include "AliCDBId.h"
 #include "AliSurveyObj.h"
 #include "AliSurveyPoint.h"
 
@@ -405,7 +403,7 @@ void AliTRDalignment::SetChResidual()
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::PrintSm(int i, FILE *fp) const 
+void AliTRDalignment::PrintSm(int i, FILE * const fp) const 
 {
   //
   // print the supermodule data
@@ -418,7 +416,7 @@ void AliTRDalignment::PrintSm(int i, FILE *fp) const
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::PrintCh(int i, FILE *fp) const 
+void AliTRDalignment::PrintCh(int i, FILE * const fp) const 
 {
   //
   // print the chamber data
@@ -431,7 +429,7 @@ void AliTRDalignment::PrintCh(int i, FILE *fp) const
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::ReadAscii(char *filename) 
+void AliTRDalignment::ReadAscii(const char * const filename) 
 {
   //
   // read the alignment data from ascii file
@@ -563,7 +561,7 @@ void AliTRDalignment::ReadCurrentGeo()
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::ReadRoot(char *filename) 
+void AliTRDalignment::ReadRoot(const char * const filename) 
 {
   //
   // read the alignment data from root file
@@ -583,7 +581,7 @@ void AliTRDalignment::ReadRoot(char *filename)
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::ReadDB(char *filename) 
+void AliTRDalignment::ReadDB(const char * const filename) 
 {
   //
   // read the alignment data from database file
@@ -606,8 +604,8 @@ void AliTRDalignment::ReadDB(char *filename)
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::ReadDB(char *db, char *path, int run
-                           , int version, int subversion)
+void AliTRDalignment::ReadDB(const char * const db, const char * const path, 
+                            int run, int version, int subversion)
 {
   //
   // read the alignment data from database
@@ -649,7 +647,7 @@ Bool_t AliTRDalignment::DecodeSurveyPointName(TString pna, Int_t &sm, Int_t &iz,
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::ReadSurveyReport(char *filename) 
+void AliTRDalignment::ReadSurveyReport(const char * const filename) 
 {
   //
   // Read survey report and store the numbers in fSurveyX, fSurveyY, fSurveyZ, 
@@ -759,7 +757,7 @@ void AliTRDalignment::ReadSurveyReport(char *filename)
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::ReadSurveyReport(AliSurveyObj *so) 
+void AliTRDalignment::ReadSurveyReport(const AliSurveyObj * const so) 
 {
   //
   // Read survey report and store the numbers in fSurveyX, fSurveyY, fSurveyZ, 
@@ -850,7 +848,7 @@ void AliTRDalignment::ReadSurveyReport(AliSurveyObj *so)
 }
 
 //_____________________________________________________________________________
-double AliTRDalignment::SurveyChi2(int i, double *a) {
+double AliTRDalignment::SurveyChi2(int i, const double * const a) {
 
   //
   // Compare the survey results to the ideal positions of the survey marks
@@ -919,7 +917,7 @@ void trdAlignmentFcn(int &npar, double *g, double &f, double *par, int iflag) {
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::SurveyToAlignment(int i,char *flag) {
+void AliTRDalignment::SurveyToAlignment(int i, const char * const flag) {
 
   //
   // Find the supermodule alignment parameters needed to make the survey 
@@ -967,7 +965,7 @@ void AliTRDalignment::SurveyToAlignment(int i,char *flag) {
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::ReadAny(char *filename) 
+void AliTRDalignment::ReadAny(const char * const filename) 
 {
   //
   // read the alignment data from any kind of file
@@ -984,7 +982,7 @@ void AliTRDalignment::ReadAny(char *filename)
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::WriteAscii(char *filename) const
+void AliTRDalignment::WriteAscii(const char * const filename) const
 {
   //
   // store the alignment data on ascii file
@@ -1004,7 +1002,7 @@ void AliTRDalignment::WriteAscii(char *filename) const
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::WriteRoot(char *filename) 
+void AliTRDalignment::WriteRoot(const char * const filename) 
 {
   //
   // store the alignment data on root file
@@ -1025,7 +1023,7 @@ void AliTRDalignment::WriteRoot(char *filename)
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::WriteDB(char *filename, int run0, int run1) 
+void AliTRDalignment::WriteDB(const char * const filename, int run0, int run1) 
 {
   //
   // dumping on a DB-like file
@@ -1055,7 +1053,7 @@ void AliTRDalignment::WriteDB(char *filename, int run0, int run1)
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::WriteDB(char *db, char *path, int run0, int run1) 
+void AliTRDalignment::WriteDB(char * const db, const char * const path, int run0, int run1) 
 {
   //
   // store the alignment data in database
@@ -1153,7 +1151,7 @@ void AliTRDalignment::PrintChRMS() const
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::ArToNumbers(TClonesArray *ar) 
+void AliTRDalignment::ArToNumbers(TClonesArray * const ar) 
 {
   //
   // for each of the alignment objects in array ar extract the six local 
@@ -1173,7 +1171,7 @@ void AliTRDalignment::ArToNumbers(TClonesArray *ar)
 }
 
 //_____________________________________________________________________________
-void AliTRDalignment::NumbersToAr(TClonesArray *ar) 
+void AliTRDalignment::NumbersToAr(TClonesArray * const ar) 
 {
   //
   // build array of AliAlignObj objects based on fSm and fCh data
index f27fe4d6b63a5bc62af2d1d7a7d98b004b8b0415..f55abdd57095bd1f8eed73736ea6f233e161ecb9 100644 (file)
@@ -32,7 +32,7 @@ class AliTRDalignment : public TObject {
   Bool_t operator==(const AliTRDalignment& source) const;  
   virtual ~AliTRDalignment() {};
 
-  // setting 
+  // setters 
 
   void SetSmZero();                                  // reset to zero supermodule data
   void SetChZero();                                  // reset to zero chamber data
@@ -50,34 +50,39 @@ class AliTRDalignment : public TObject {
   void SetResidual()                                 {SetSmResidual(); SetChResidual();}
   void SetComment(char *s)                           {fComment.SetString(s);} 
 
+  // simple getters (for other getters see below)
+
+  void GetSm(int sm, double * const a)               {for (int i = 0; i < 6; i++) a[i] = fSm[sm][i];}
+  void GetCh(int ch, double * const a)               {for (int i = 0; i < 6; i++) a[i] = fCh[ch][i];}
+  
   // dumping on screen
 
-  void PrintSm(int sm, FILE *fp = stdout) const;     // print data of a supermodule
-  void PrintCh(int ch, FILE *fp = stdout) const;     // print data of a chamber
-  void PrintSm(FILE *fp = stdout) const              {for (int i = 0; i <  18; i++)  PrintSm(i,fp);}
-  void PrintCh(FILE *fp = stdout) const              {for (int i = 0; i < 540; i++)  PrintCh(i,fp);}
-  void Print(FILE *fp = stdout) const                {PrintSm(fp); PrintCh(fp);                    }
+  void PrintSm(int sm, FILE * const fp = stdout) const;   // print data of a supermodule
+  void PrintCh(int ch, FILE * const fp = stdout) const;   // print data of a chamber
+  void PrintSm(FILE * const fp = stdout) const       {for (int i = 0; i <  18; i++)  PrintSm(i,fp);}
+  void PrintCh(FILE * const fp = stdout) const       {for (int i = 0; i < 540; i++)  PrintCh(i,fp);}
+  void Print(FILE * const fp = stdout) const         {PrintSm(fp); PrintCh(fp);                    }
   void Print(Option_t *) const                       {Print();                                     } 
 
   // reading-in from file
 
-  void ReadAscii(char *filename);                    // read from ascii file
-  void ReadCurrentGeo();                             // read from currently loaded geometry
-  void ReadRoot(char *filename);                     // read from root file
-  void ReadDB(char *filename);                       // read from DB file
-  void ReadDB(char *db, char *path, int run, int version=-1, int subversion=-1);
+  void ReadAscii(const char * const filename);           // read from ascii file
+  void ReadCurrentGeo();                                 // read from currently loaded geometry
+  void ReadRoot(const char * const filename);            // read from root file
+  void ReadDB(const char * const filename);              // read from DB file
+  void ReadDB(const char * const db, const char * const path, int run, int version=-1, int subversion=-1);
   Bool_t DecodeSurveyPointName(TString pna, Int_t &sm, Int_t &iz,Int_t &ir, Int_t &iphi);
-  void ReadSurveyReport(char *filename);             // read from survey report
-  void ReadSurveyReport(AliSurveyObj *so);           // read from survey object 
-  void ReadAny(char *filename);                      // read from any kind of file
+  void ReadSurveyReport(const char * const filename);    // read from survey report
+  void ReadSurveyReport(const AliSurveyObj * const so);  // read from survey object 
+  void ReadAny(const char * const  filename);            // read from any kind of file
 
   // writing on file
 
-  void WriteAscii(char *filename) const;             // store data on ascii file
-  void WriteRoot(char *filename);                    // store data on root file
-  void WriteDB(char *filename, int run0, int run1);  // store data on a local DB-like file
-  void WriteDB(char *db, char *pa, int r0, int r1);  // store data on DB file
-  void WriteGeo(char *filename);                     // apply misalignment and store geometry 
+  void WriteAscii(const char * const filename) const;                    // store data on ascii file
+  void WriteRoot(const char * const filename);                           // store data on root file
+  void WriteDB(const char * const filename, int run0, int run1);         // store data on a local DB-like file
+  void WriteDB(char * const db, const char * const pa, int r0, int r1);  // store data on DB file
+  void WriteGeo(char *filename);                                         // apply misalignment and store geometry 
 
   // geometry and symbolic names getters
 
@@ -110,15 +115,15 @@ class AliTRDalignment : public TObject {
   void   PrintChRMS() const;                         // print rms of fCh
   void   PrintRMS() const                            {PrintSmRMS(); PrintChRMS();}
 
-  double SurveyChi2(int i, double *a);               // compare survey with ideal, return chi2
-  double SurveyChi2(double *a)                       {return SurveyChi2(fIbuffer[0],a);}
-  void   SurveyToAlignment(int i, char *flag);       // determine alignment of supermodule i based on survey
-  void   SurveyToAlignment(char *flag)               {for (int i=0; i<18; i++) SurveyToAlignment(i,flag);}
+  double SurveyChi2(int i, const double * const a);  // compare survey with ideal, return chi2
+  double SurveyChi2(const double * const a)          {return SurveyChi2(fIbuffer[0],a);}
+  void   SurveyToAlignment(int i, const char * const flag);  // determine alignment of supermodule i based on survey
+  void   SurveyToAlignment(const char * const flag)  {for (int i=0; i<18; i++) SurveyToAlignment(i,flag);}
 
  protected:
 
-  void   ArToNumbers(TClonesArray *ar);              // read ar and fill fSm and fCh
-  void   NumbersToAr(TClonesArray *ar);              // build ar using fSm and fCh data
+  void   ArToNumbers(TClonesArray * const ar);       // read ar and fill fSm and fCh
+  void   NumbersToAr(TClonesArray * const ar);       // build ar using fSm and fCh data
   int    IsGeoLoaded();                              // check if geometry is loaded
 
  protected: