Fixing coding violations from FC
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Mar 2010 13:56:35 +0000 (13:56 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Mar 2010 13:56:35 +0000 (13:56 +0000)
FMD/AliFMDBaseDA.cxx
FMD/AliFMDBaseDA.h

index 82debd4..6a3b64a 100644 (file)
@@ -95,7 +95,8 @@ AliFMDBaseDA::AliFMDBaseDA() :
   fPulseLength(10),
   fRequiredEvents(0),
   fCurrentEvent(0)
- {
+{
+  //Constructor
    fSeenDetectors[0] = fSeenDetectors[1] = fSeenDetectors[2] = kFALSE;
   fDetectorArray.SetOwner();
   fConditionsFile.open("conditions.csv");
@@ -113,6 +114,7 @@ AliFMDBaseDA::AliFMDBaseDA(const AliFMDBaseDA & baseDA) :
   fRequiredEvents(baseDA.fRequiredEvents),
   fCurrentEvent(baseDA.fCurrentEvent)
 {
+  //Copy constructor
   fSeenDetectors[0] = baseDA.fSeenDetectors[0];
   fSeenDetectors[1] = baseDA.fSeenDetectors[1];
   fSeenDetectors[2] = baseDA.fSeenDetectors[2];
@@ -131,6 +133,7 @@ AliFMDBaseDA::~AliFMDBaseDA()
 //_____________________________________________________________________
 void AliFMDBaseDA::Run(AliRawReader* reader) 
 {
+  //Run the FMD DA
   TFile* diagFile = 0;
   if (fSaveHistograms)
     diagFile = TFile::Open(fDiagnosticsFilename.Data(),"RECREATE");
@@ -144,7 +147,7 @@ void AliFMDBaseDA::Run(AliRawReader* reader)
   AliFMDRawReader* fmdReader  = new AliFMDRawReader(reader,0);
   TClonesArray*    digitArray = new TClonesArray("AliFMDDigit",0);
   
-  Bool_t SOD_read = kFALSE;
+  Bool_t sodread = kFALSE;
   
   for(Int_t i=0;i<3;i++) {
     reader->NextEvent(); // Read Start-of-Run / Start-of-Files event
@@ -155,14 +158,14 @@ void AliFMDBaseDA::Run(AliRawReader* reader)
       
       WriteConditionsData(fmdReader);
       Init();
-      SOD_read = kTRUE;
+      sodread = kTRUE;
       break;
     }
   }
   
   InitContainer(diagFile);
   
-  if(!SOD_read) 
+  if(!sodread) 
     AliWarning("No SOD event detected!");
   
   int lastProgress = 0;
@@ -197,8 +200,8 @@ void AliFMDBaseDA::Run(AliRawReader* reader)
   for(UShort_t det=1;det<=3;det++) {
     if (!fSeenDetectors[det-1]) continue;
     std::cout << "FMD" << det << std::endl;
-    UShort_t FirstRing = (det == 1 ? 1 : 0);
-    for (UShort_t ir = FirstRing; ir < 2; ir++) {
+    UShort_t firstRing = (det == 1 ? 1 : 0);
+    for (UShort_t ir = firstRing; ir < 2; ir++) {
       Char_t   ring = (ir == 0 ? 'O' : 'I');
       UShort_t nsec = (ir == 0 ? 40  : 20);
       UShort_t nstr = (ir == 0 ? 256 : 512);
@@ -235,6 +238,7 @@ void AliFMDBaseDA::Run(AliRawReader* reader)
 
 void AliFMDBaseDA::InitContainer(TDirectory* diagFile)
 {
+  //Prepare container for diagnostics
   TObjArray* detArray;
   TObjArray* ringArray;
   TObjArray* sectorArray;
@@ -297,6 +301,7 @@ void AliFMDBaseDA::InitContainer(TDirectory* diagFile)
 //_____________________________________________________________________ 
 void AliFMDBaseDA::WriteConditionsData(AliFMDRawReader* fmdReader) 
 {
+  //Write the conditions data to file
   AliFMDParameters* pars       = AliFMDParameters::Instance();
   fConditionsFile.write(Form("# %s \n",pars->GetConditionsShuttleID()),14);
   
@@ -366,7 +371,7 @@ void AliFMDBaseDA::WriteConditionsData(AliFMDRawReader* fmdReader)
   
 }
 //_____________________________________________________________________ 
-Int_t AliFMDBaseDA::GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board) {
+Int_t AliFMDBaseDA::GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board) const {
 
   UShort_t iring  =  (ring == 'I' ? 1 : 0);
   
index 85e6375..dc9e6ba 100644 (file)
@@ -46,7 +46,7 @@ public:
   void Run(AliRawReader* fmdReader);
   void SetSaveDiagnostics(Bool_t save) {fSaveHistograms = save;}
   void SetRequiredEvents(Int_t nEvents) {fRequiredEvents = nEvents;}
-  Int_t GetRequiredEvents() {return fRequiredEvents ;}
+  Int_t GetRequiredEvents() const {return fRequiredEvents ;}
 protected:
   
   virtual void Init()  {};
@@ -57,17 +57,17 @@ protected:
   virtual void FinishEvent()  {};
   virtual void Terminate(TFile* ) {};
   
-  Int_t GetCurrentEvent() {return fCurrentEvent;}
+  Int_t GetCurrentEvent() const {return fCurrentEvent;}
   
-  static const UInt_t kBaseDDL = 3072;
+  static const UInt_t fgkBaseDDL = 3072;   // base FMD ddl
   //Char_t* fDiagnosticsFilename;
-  TString fDiagnosticsFilename;
-  std::ofstream fOutputFile;
-  std::ofstream fConditionsFile;
-  Bool_t fSaveHistograms;
-  TObjArray fDetectorArray;
+  TString fDiagnosticsFilename;            // name of diagnostics file
+  std::ofstream fOutputFile;               // output file
+  std::ofstream fConditionsFile;           // conditions file
+  Bool_t fSaveHistograms;                  // save hists or not
+  TObjArray fDetectorArray;                // array indiced by detector
 
-  Int_t GetHalfringIndex(UShort_t, Char_t, UShort_t);
+  Int_t GetHalfringIndex(UShort_t, Char_t, UShort_t) const;
   Int_t GetPulseSize(UShort_t det , 
                     Char_t ring, 
                     UShort_t board) {return fPulseSize.At(GetHalfringIndex(det,ring,board));}
@@ -85,17 +85,17 @@ protected:
   
 
   
-  TArrayS fPulseSize;
-  TArrayS fPulseLength;
+  TArrayS fPulseSize;                     // Pulse size for gain calib
+  TArrayS fPulseLength;                   // Pulse length for gain calib
 
-  Bool_t  fSeenDetectors[3];
+  Bool_t  fSeenDetectors[3];              // Detectors seen so far
 private:
  
   void WriteConditionsData(AliFMDRawReader* fmdReader);
   void SetCurrentEvent(Int_t currentEvent) {fCurrentEvent = currentEvent; }
   void InitContainer(TDirectory* dir);
-  Int_t fRequiredEvents;
-  Int_t fCurrentEvent;   
+  Int_t fRequiredEvents;            // number of events required for this calib
+  Int_t fCurrentEvent;              // the current event