]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
First round of effc++ changes
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Aug 2006 17:31:23 +0000 (17:31 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Aug 2006 17:31:23 +0000 (17:31 +0000)
47 files changed:
TRD/AliTRDCommonParam.cxx
TRD/AliTRDCommonParam.h
TRD/AliTRDRawStream.cxx
TRD/AliTRDRawStream.h
TRD/AliTRDcalibDB.cxx
TRD/AliTRDcalibDB.h
TRD/AliTRDclusterizerV1.cxx
TRD/AliTRDdataArray.cxx
TRD/AliTRDdataArray.h
TRD/AliTRDdataArrayF.cxx
TRD/AliTRDdataArrayF.h
TRD/AliTRDdataArrayI.cxx
TRD/AliTRDdataArrayI.h
TRD/AliTRDdigit.cxx
TRD/AliTRDdigit.h
TRD/AliTRDdigitsManager.cxx
TRD/AliTRDdigitsManager.h
TRD/AliTRDgeometry.cxx
TRD/AliTRDgeometry.h
TRD/AliTRDpadPlane.cxx
TRD/AliTRDrawData.cxx
TRD/AliTRDrawData.h
TRD/AliTRDsegmentArrayBase.cxx
TRD/AliTRDsegmentID.cxx
TRD/AliTRDtrigger.cxx
TRD/Cal/AliTRDCalChamberStatus.cxx
TRD/Cal/AliTRDCalChamberStatus.h
TRD/Cal/AliTRDCalDet.cxx
TRD/Cal/AliTRDCalDet.h
TRD/Cal/AliTRDCalGlobals.cxx
TRD/Cal/AliTRDCalGlobals.h
TRD/Cal/AliTRDCalMCMStatus.cxx
TRD/Cal/AliTRDCalMCMStatus.h
TRD/Cal/AliTRDCalMonitoring.cxx
TRD/Cal/AliTRDCalMonitoring.h
TRD/Cal/AliTRDCalPIDLQ.cxx
TRD/Cal/AliTRDCalPIDLQ.h
TRD/Cal/AliTRDCalPad.cxx
TRD/Cal/AliTRDCalPad.h
TRD/Cal/AliTRDCalPadStatus.cxx
TRD/Cal/AliTRDCalPadStatus.h
TRD/Cal/AliTRDCalROC.cxx
TRD/Cal/AliTRDCalROC.h
TRD/Cal/AliTRDCalSingleChamberStatus.cxx
TRD/Cal/AliTRDCalSingleChamberStatus.h
TRD/Cal/AliTRDCalSuperModuleStatus.cxx
TRD/Cal/AliTRDCalSuperModuleStatus.h

index 7905b84fb6b2786767ebd92d5703a9494e4fe46d..b0cb8da66e629b98b8ae1cd989df38cdf49d0d35 100644 (file)
@@ -17,9 +17,9 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-// Class containing constant common parameters                           //
+// Class containing constant common parameters                               //
 //                                                                           //
-// Request an instance with AliTRDCommonParam::Instance()                 //
+// Request an instance with AliTRDCommonParam::Instance()                    //
 // Then request the needed values                                            //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
@@ -29,7 +29,6 @@
 #include "AliTRDCommonParam.h"
 #include "AliTRDpadPlane.h"
 
-
 ClassImp(AliTRDCommonParam)
 
 AliTRDCommonParam* AliTRDCommonParam::fgInstance = 0;
@@ -50,8 +49,10 @@ AliTRDCommonParam* AliTRDCommonParam::Instance()
     fgInstance = new AliTRDCommonParam();
   
   return fgInstance;
+
 }
 
+//_____________________________________________________________________________
 void AliTRDCommonParam::Terminate()
 {
   //
@@ -67,29 +68,29 @@ void AliTRDCommonParam::Terminate()
     delete fgInstance;
     fgInstance = 0;
   }
+
 }
 
 //_____________________________________________________________________________
 AliTRDCommonParam::AliTRDCommonParam()
+  :TObject()
+  ,fField(0)
+  ,fExBOn(kFALSE)
+  ,fPadPlaneArray(0)
 {
   //
-  // constructor
+  // Default constructor
   //
   
-  fField              = 0.0;
-
-  fExBOn              = kFALSE;
-  
-  fPadPlaneArray      = 0;
-  
   Init();
+
 }
 
 //_____________________________________________________________________________
 void AliTRDCommonParam::Init()
 {
   //
-  // constructor helper
+  // Initialization
   //
   
   // E x B effects
@@ -113,13 +114,14 @@ void AliTRDCommonParam::Init()
       fPadPlaneArray->AddAt(new AliTRDpadPlane(iplan,icham),ipp);
     }
   }
+
 }
 
 //_____________________________________________________________________________
 AliTRDCommonParam::~AliTRDCommonParam() 
 {
   //
-  // destructor
+  // Destructor
   //
   
   if (fPadPlaneArray) {
@@ -127,19 +129,22 @@ AliTRDCommonParam::~AliTRDCommonParam()
     delete fPadPlaneArray;
     fPadPlaneArray = 0;
   }
+
 }
 
 //_____________________________________________________________________________
-AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p):TObject(p)
+AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p)
+  :TObject(p)
+  ,fField(p.fField)
+  ,fExBOn(p.fExBOn)
+  ,fPadPlaneArray(0)
 {
   //
-  // copy constructor
+  // Copy constructor
   //
 
-  ((AliTRDCommonParam &) p).Copy(*this);
 }
 
-
 //_____________________________________________________________________________
 AliTRDCommonParam &AliTRDCommonParam::operator=(const AliTRDCommonParam &p)
 {
@@ -149,6 +154,7 @@ AliTRDCommonParam &AliTRDCommonParam::operator=(const AliTRDCommonParam &p)
 
   if (this != &p) ((AliTRDCommonParam &) p).Copy(*this);
   return *this;
+
 }
 
 //_____________________________________________________________________________
@@ -159,11 +165,13 @@ void AliTRDCommonParam::Copy(TObject &p) const
   //
   
   AliTRDCommonParam* target = dynamic_cast<AliTRDCommonParam*> (&p);
-  if (!target)
+  if (!target) {
     return;
-  
-  target->fExBOn              = fExBOn;
-  target->fField              = fField;
+  }  
+
+  target->fExBOn = fExBOn;
+  target->fField = fField;
+
 }
 
 //_____________________________________________________________________________
index 43ff2dd99ba38eca7c75f895f60939bbf08ec138..e57abf4a331b3efacb1c1a08d6c1ebe5ce6e51ed 100644 (file)
@@ -5,7 +5,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-// Class containing constant common parameters                           //
+// Class containing constant common parameters                               //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -17,48 +17,49 @@ class AliTRDpadPlane;
 
 class AliTRDCommonParam : public TObject
 {
+
   public:
-    static AliTRDCommonParam* Instance();
-    static void Terminate();
   
     enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
     
     AliTRDCommonParam(const AliTRDCommonParam &p);   
     AliTRDCommonParam &operator=(const AliTRDCommonParam &p); 
-    virtual void Copy(TObject &p) const;
-    
-    void SetField(Float_t field)                        { fField          = field;    };
+    static AliTRDCommonParam *Instance();
+    static void     Terminate();
+    virtual void    Copy(TObject &p) const;
     
-    void     SetExB(Int_t exbOn = 1)                        { fExBOn          = exbOn;    };
+    void            SetField(Float_t field)                        { fField = field; };
+    void            SetExB(Int_t exbOn = 1)                        { fExBOn = exbOn; };
     
-    Float_t  GetField()                               const { return fField; };
-    
-    Bool_t   ExBOn()                                  const { return fExBOn;         };
+    Float_t         GetField()                               const { return fField;  };
+    Bool_t          ExBOn()                                  const { return fExBOn;  };
     
     AliTRDpadPlane *GetPadPlane(Int_t p, Int_t c) const;
-    Int_t    GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const;
-    Int_t    GetColMax(Int_t p) const;
-    Double_t GetRow0(Int_t p, Int_t c, Int_t /*s*/) const;
-    Double_t GetCol0(Int_t p) const;
+    Int_t           GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const;
+    Int_t           GetColMax(Int_t p) const;
+    Double_t        GetRow0(Int_t p, Int_t c, Int_t /*s*/) const;
+    Double_t        GetCol0(Int_t p) const;
   
   protected:
-    static AliTRDCommonParam* fgInstance;     // Instance of this class (singleton implementation)
-    static Bool_t fgTerminated;               // Defines if this class has already been terminated and therefore does not return instances in GetInstance anymore
+
+    static AliTRDCommonParam *fgInstance;     //  Instance of this class (singleton implementation)
+    static Bool_t             fgTerminated;   //  Defines if this class has already been terminated
     
     void Init();
     
-    Float_t              fField;                              //  Magnetic field
-    
-    Int_t                fExBOn;                              //  Switch for the ExB effects
+    Float_t                   fField;         //  Magnetic field
+    Int_t                     fExBOn;         //  Switch for the ExB effects
   
-    TObjArray  *fPadPlaneArray;                               //!  Array of pad plane objects
+    TObjArray                *fPadPlaneArray; //! Array of pad plane objects
   
   private:
-    // this is a singleton, constructor is private!  
+
+    // This is a singleton, constructor is private!  
     AliTRDCommonParam();
     virtual ~AliTRDCommonParam();
   
-    ClassDef(AliTRDCommonParam, 1)
+    ClassDef(AliTRDCommonParam,1)             // The constant parameters common to simulation and reconstruction       
+
 };
 
 #endif
index 31cb1eb9607e37300887f52c83f49bf93e6dae57..ad0bd6fefb093c552bcc57330b038547ec42c98a 100644 (file)
 /* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
-///
-/// This class provides access to TRD digits in raw data.
-///
-/// It loops over all TRD digits in the raw data given by the AliRawReader.
-/// The Next method goes to the next digit. If there are no digits left
-/// it returns kFALSE.
-/// Several getters provide information about the current digit.
-///
+//                                                                           //
+// This class provides access to TRD digits in raw data.                     //
+//                                                                           //
+// It loops over all TRD digits in the raw data given by the AliRawReader.   //
+// The Next method goes to the next digit. If there are no digits left       //
+// it returns kFALSE.                                                        //
+// Several getters provide information about the current digit.              //
+//                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "AliTRDRawStream.h"
+#include "AliLog.h"
 #include "AliRawReader.h"
+
+#include "AliTRDRawStream.h"
 #include "AliTRDcalibDB.h"
 
 ClassImp(AliTRDRawStream)
 
+//_____________________________________________________________________________
+AliTRDRawStream::AliTRDRawStream() 
+  :TObject()
+  ,fRawReader(0)
+  ,fCount(0)
+  ,fDetector(-1)
+  ,fPrevDetector(-1)
+  ,fNPads(-1)
+  ,fRow(-1)
+  ,fPrevRow(-1)
+  ,fColumn(-1)
+  ,fPrevColumn(-1)
+  ,fTime(-1)
+  ,fSignal(-1)
+{
+  //
+  // Default constructor
+  //
 
-AliTRDRawStream::AliTRDRawStream(AliRawReader* rawReader) :
-  fRawReader(rawReader),
-  fCount(0),
-  fDetector(-1),
-  fPrevDetector(-1),
-  fNPads(-1),
-  fRow(-1),
-  fPrevRow(-1),
-  fColumn(-1),
-  fPrevColumn(-1),
-  fTime(-1),
-  fSignal(-1)
+}
+
+//_____________________________________________________________________________
+AliTRDRawStream::AliTRDRawStream(AliRawReader* rawReader) 
+  :TObject()
+  ,fRawReader(rawReader)
+  ,fCount(0)
+  ,fDetector(-1)
+  ,fPrevDetector(-1)
+  ,fNPads(-1)
+  ,fRow(-1)
+  ,fPrevRow(-1)
+  ,fColumn(-1)
+  ,fPrevColumn(-1)
+  ,fTime(-1)
+  ,fSignal(-1)
 {
-// create an object to read TRD raw digits
+  //
+  // Create an object to read TRD raw digits
+  //
 
   fRawReader->Select("TRD");
+
 }
 
+//_____________________________________________________________________________
 AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream) :
   TObject(stream),
   fRawReader(NULL),
@@ -65,31 +93,47 @@ AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream) :
   fTime(-1),
   fSignal(-1)
 {
-  Fatal("AliTRDRawStream", "copy constructor not implemented");
+  //
+  // Copy constructor
+  //
+
+  AliFatal("Copy constructor not implemented");
+
 }
 
+//_____________________________________________________________________________
 AliTRDRawStream& AliTRDRawStream::operator = (const AliTRDRawStream& 
                                              /* stream */)
 {
+  //
+  // Assigment operator
+  //
+
   Fatal("operator =", "assignment operator not implemented");
   return *this;
+
 }
 
+//_____________________________________________________________________________
 AliTRDRawStream::~AliTRDRawStream()
 {
-// clean up
+  //
+  // Destructor
+  //
 
 }
 
-
+//_____________________________________________________________________________
 Bool_t AliTRDRawStream::Next()
 {
-// read the next raw digit
-// returns kFALSE if there is no digit left
+  //
+  // Read the next raw digit
+  // Returns kFALSE if there is no digit left
+  //
 
   fPrevDetector = fDetector;
-  fPrevRow = fRow;
-  fPrevColumn = fColumn;
+  fPrevRow      = fRow;
+  fPrevColumn   = fColumn;
   UChar_t data;
 
   AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
@@ -104,20 +148,20 @@ Bool_t AliTRDRawStream::Next()
       // read the flag
       if (!fRawReader->ReadNextChar(data)) return kFALSE;
       if (data != 0xBB) {
-       Error("Next", "wrong flag: %x", data);
+       AliError(Form("wrong flag: %x", data));
        fCount = -1;
        return kFALSE;
       }
 
       // read the detector number
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read detector number");
+       AliError("Could not read detector number");
        fCount = -1;
        return kFALSE;
       }
       fDetector = data;
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read detector number");
+       AliError("Could not read detector number");
        fCount = -1;
        return kFALSE;
       }
@@ -125,19 +169,19 @@ Bool_t AliTRDRawStream::Next()
 
       // read the number of byts
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read number of bytes");
+       AliError("Could not read number of bytes");
        fCount = -1;
        return kFALSE;
       }
       fCount = data;
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read number of bytes");
+       AliError("Could not read number of bytes");
        fCount = -1;
        return kFALSE;
       }
       fCount += (UInt_t(data) << 8);
       if (!fRawReader->ReadNextChar(data)) {
-        Error("Next", "could not read number of bytes");
+        AliError("Could not read number of bytes");
         fCount = -1;
         return kFALSE;
       }
@@ -145,13 +189,13 @@ Bool_t AliTRDRawStream::Next()
 
       // read the number of active pads
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read number of active pads");
+       AliError("Could not read number of active pads");
        fCount = -1;
        return kFALSE;
       }
       fNPads = data;
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read number of active pads");
+       AliError("Could not read number of active pads");
        fCount = -1;
        return kFALSE;
       }
@@ -164,14 +208,14 @@ Bool_t AliTRDRawStream::Next()
     // read the pad row and column number
     if ((fTime >= timeBins) && (fCount > 2)) {
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read row number");
+       AliError("Could not read row number");
        fCount = -1;
        return kFALSE;
       }
       fCount--;
       fRow = data - 1;
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read column number");
+       AliError("Could not read column number");
        fCount = -1;
        return kFALSE;
       }
@@ -182,7 +226,7 @@ Bool_t AliTRDRawStream::Next()
 
     // read the next data byte
     if (!fRawReader->ReadNextChar(data)) {
-      Error("Next", "could not read data");
+      AliError("Could not read data");
       fCount = -1;
       return kFALSE;
     }
@@ -190,17 +234,18 @@ Bool_t AliTRDRawStream::Next()
 
     if (data == 0) {  // zeros
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read time value");
+       AliError("Could not read time value");
        fCount = -1;
        return kFALSE;
       }
       fCount--;
       fTime += data + 1;
 
-    } else {          // signal
+    } 
+    else {          // signal
       fSignal = (UInt_t(data & 0x7F) << 8);
       if (!fRawReader->ReadNextChar(data)) {
-       Error("Next", "could not read ADC value");
+       AliError("Could not read ADC value");
        fCount = -1;
        return kFALSE;
       }
@@ -212,4 +257,5 @@ Bool_t AliTRDRawStream::Next()
   }
 
   return kFALSE;
+
 }
index 2d43235118924a1cd47d8f513c8d99b9ea8df734..5c64a5e3fbc1bbd1a5c91c98f8761dbe69504d0d 100644 (file)
@@ -6,9 +6,9 @@
 /* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
-///
-/// This class provides access to TRD digits in raw data.
-///
+//                                                                           //
+// This class provides access to TRD digits in raw data.                     //
+//                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 #include <TObject.h>
@@ -17,46 +17,51 @@ class AliRawReader;
 class AliTRDparameter;
 
 class AliTRDRawStream: public TObject {
+
   public :
+
+    AliTRDRawStream();
     AliTRDRawStream(AliRawReader* rawReader);
     virtual ~AliTRDRawStream();
 
     virtual Bool_t   Next();
 
-    Int_t            GetDetector() const {return fDetector;};
-    Int_t            GetPrevDetector() const {return fPrevDetector;};
-    Bool_t           IsNewDetector() const {return fDetector != fPrevDetector;};
-    Int_t            GetNPads() const {return fNPads;};
-    Int_t            GetRow() const {return fRow;};
-    Int_t            GetPrevRow() const {return fPrevRow;};
-    Bool_t           IsNewRow() const {return (fRow != fPrevRow) || IsNewDetector();};
-    Int_t            GetColumn() const {return fColumn;};
-    Int_t            GetPrevColumn() const {return fPrevColumn;};
-    Bool_t           IsNewColumn() const {return (fColumn != fPrevColumn) || IsNewRow();};
-    Int_t            GetTime() const {return fTime-1;};
-    Int_t            GetSignal() const {return fSignal;};
+    Int_t            GetDetector() const     { return fDetector;     };
+    Int_t            GetPrevDetector() const { return fPrevDetector; };
+    Bool_t           IsNewDetector() const   { return fDetector != fPrevDetector; };
+    Int_t            GetNPads() const        { return fNPads;        };
+    Int_t            GetRow() const          { return fRow;          };
+    Int_t            GetPrevRow() const      { return fPrevRow;      };
+    Bool_t           IsNewRow() const        { return (fRow != fPrevRow) || IsNewDetector();  };
+    Int_t            GetColumn() const       { return fColumn;       };
+    Int_t            GetPrevColumn() const   { return fPrevColumn;   };
+    Bool_t           IsNewColumn() const     { return (fColumn != fPrevColumn) || IsNewRow(); };
+    Int_t            GetTime() const         { return fTime-1;       };
+    Int_t            GetSignal() const       { return fSignal;       };
 
     enum {kDDLOffset = 0x400};    // offset for DDL numbers
 
   private :
-    AliTRDRawStream(const AliTRDRawStream& stream);
-    AliTRDRawStream& operator = (const AliTRDRawStream& stream);
 
-    AliRawReader*    fRawReader;    // object for reading the raw data
+    AliTRDRawStream(const AliTRDRawStream &stream);
+    AliTRDRawStream &operator=(const AliTRDRawStream &stream);
+
+    AliRawReader*    fRawReader;    // Object for reading the raw data
+
+    Int_t            fCount;        // Counter of bytes to be read for current detector
 
-    Int_t            fCount;        // counter of bytes to be read for current detector
+    Int_t            fDetector;     // Index of current detector
+    Int_t            fPrevDetector; // Index of previous detector
+    Int_t            fNPads;        // Number of active pads
+    Int_t            fRow;          // Index of current pad row
+    Int_t            fPrevRow;      // Index of previous pad row
+    Int_t            fColumn;       // Index of current pad column
+    Int_t            fPrevColumn;   // Index of previous pad column
+    Int_t            fTime;         // Index of current time bin
+    Int_t            fSignal;       // Signal in ADC counts
 
-    Int_t            fDetector;     // index of current detector
-    Int_t            fPrevDetector; // index of previous detector
-    Int_t            fNPads;        // number of active pads
-    Int_t            fRow;          // index of current pad row
-    Int_t            fPrevRow;      // index of previous pad row
-    Int_t            fColumn;       // index of current pad column
-    Int_t            fPrevColumn;   // index of previous pad column
-    Int_t            fTime;         // index of current time bin
-    Int_t            fSignal;       // signal in ADC counts
+    ClassDef(AliTRDRawStream, 1)    // Class for reading TRD raw digits
 
-    ClassDef(AliTRDRawStream, 1)    // class for reading TRD raw digits
 };
 
 #endif
index 41aa7ae79fb2745653d8f10a1222a0a636dd36b2..6f7df324b7a05c4387ad6f638a765408d23987e2 100644 (file)
 //                                                                           //
 // Class providing the calibration parameters by accessing the CDB           //
 //                                                                           //
-// Request an instance with AliTRDcalibDB::Instance()                 //
+// Request an instance with AliTRDcalibDB::Instance()                        //
 // If a new event is processed set the event number with SetRun              //
 // Then request the calibration data                                         // 
 //                                                                           //
+// Author:                                                                   //
+//   Jan Fiete Grosse-Oetringhaus (Jan.Fiete.Grosse-Oetringhaus@cern.ch)     //
+//                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 #include <TRandom.h>
 
-#include <AliCDBManager.h>
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
+#include "AliCDBEntry.h"
+#include "AliLog.h"
 
 #include "AliTRDcalibDB.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDCommonParam.h"
 
 #include "Cal/AliTRDCalROC.h"
-
 #include "Cal/AliTRDCalPad.h"
 #include "Cal/AliTRDCalDet.h"
 #include "Cal/AliTRDCalGlobals.h"
 #include "Cal/AliTRDCalPIDLQ.h"
 #include "Cal/AliTRDCalMonitoring.h"
-
 #include "Cal/AliTRDCalSuperModuleStatus.h"
 #include "Cal/AliTRDCalChamberStatus.h"
 #include "Cal/AliTRDCalMCMStatus.h"
@@ -50,8 +54,8 @@
 
 ClassImp(AliTRDcalibDB)
 
-AliTRDcalibDB* AliTRDcalibDB::fgInstance = 0;
-Bool_t AliTRDcalibDB::fgTerminated = kFALSE;
+AliTRDcalibDB *AliTRDcalibDB::fgInstance   = 0;
+Bool_t         AliTRDcalibDB::fgTerminated = kFALSE;
 
 //_ singleton implementation __________________________________________________
 AliTRDcalibDB* AliTRDcalibDB::Instance()
@@ -70,6 +74,7 @@ AliTRDcalibDB* AliTRDcalibDB::Instance()
   return fgInstance;
 }
 
+//_____________________________________________________________________________
 void AliTRDcalibDB::Terminate()
 {
   //
@@ -85,34 +90,79 @@ void AliTRDcalibDB::Terminate()
     delete fgInstance;
     fgInstance = 0;
   }
+
 }
 
 //_____________________________________________________________________________
 AliTRDcalibDB::AliTRDcalibDB()
+  :TObject()
+  ,fRun(-1)
 {
   //
-  // constructor
+  // Default constructor
   //
-  
-  // TODO Default runnumber is set to 0, this should be changed later to an invalid value (e.g. -1) to prevent
+  // TODO Default runnumber is set to 0, this should be changed later
+  //      to an invalid value (e.g. -1) to prevent
   // TODO invalid calibration data to be used.
-  fRun = -1;
+  //
+
+  fPadResponse.fPRFbin = 0;
+  fPadResponse.fPRFlo  = 0.0;
+  fPadResponse.fPRFhi  = 0.0;
+  fPadResponse.fPRFwid = 0.0;
+  fPadResponse.fPRFpad = 0;
+  fPadResponse.fPRFsmp = 0;
+
+  for (Int_t i=0; i<kCDBCacheSize; ++i)
+  {
+    fCDBCache[i]   = 0;
+    fCDBEntries[i] = 0;
+  }
   
-  fPadResponse.fPRFbin             = 0;
-  fPadResponse.fPRFlo              = 0.0;
-  fPadResponse.fPRFhi              = 0.0;
-  fPadResponse.fPRFwid             = 0.0;
-  fPadResponse.fPRFpad             = 0;
-  fPadResponse.fPRFsmp             = 0;
+  // Create the sampled PRF
+  SamplePRF();
+
+}
+
+//_____________________________________________________________________________
+AliTRDcalibDB::AliTRDcalibDB(const AliTRDcalibDB &c)
+  :TObject(c)
+  ,fRun(0)
+{
+  //
+  // Copy constructor (not that it make any sense for a singleton...)
+  //
+
+  fPadResponse.fPRFbin = 0;
+  fPadResponse.fPRFlo  = 0.0;
+  fPadResponse.fPRFhi  = 0.0;
+  fPadResponse.fPRFwid = 0.0;
+  fPadResponse.fPRFpad = 0;
+  fPadResponse.fPRFsmp = 0;
 
   for (Int_t i=0; i<kCDBCacheSize; ++i)
   {
-    fCDBCache[i] = 0;
+    fCDBCache[i]   = 0;
     fCDBEntries[i] = 0;
   }
   
   // Create the sampled PRF
   SamplePRF();
+
+}
+
+//_____________________________________________________________________________
+AliTRDcalibDB &AliTRDcalibDB::operator=(const AliTRDcalibDB &c) 
+{
+  //
+  // Assignment operator (same as above ...)
+  //
+
+  if (this != &c) {
+    AliFatal("No assignment operator defined");
+  }
+  return *this;
+
 }
 
 //_____________________________________________________________________________
@@ -128,51 +178,88 @@ AliTRDcalibDB::~AliTRDcalibDB()
   }
 
   Invalidate();
+
 }
 
 //_caching functions____________________________________________________________
 const TObject* AliTRDcalibDB::GetCachedCDBObject(Int_t id)
 {
-    //
-    // Retrieves a cdb object with the given id. The objects are cached as long as the run number is not changed.
-    //
-    // Put together the available objects here by using the lines
-    //   a) For usual calibration objects:
-    //      ase kID<Name> : return CacheCDBEntry(kID<Name>, "TRD/Calib/<Path>"); break;
-    //      See function CacheCDBEntry for details.
-    //   and
-    //   b) For calibration data which depends on two objects: One containing a value per detector and one the local fluctuations per pad:
-    //      case kID<Name> : return CacheMergeCDBEntry(kID<Name>, "TRD/Calib/<padPath>", "TRD/Calib/<chamberPath>"); break;
-    //      See function CacheMergeCDBEntry for details.
-    //
+  //
+  // Retrieves a cdb object with the given id. The objects are cached as
+  // long as the run number is not changed.
+  //
+  // Put together the available objects here by using the lines
+  //   a) For usual calibration objects:
+  //      case kID<Name> : 
+  //        return CacheCDBEntry(kID<Name>,"TRD/Calib/<Path>"); 
+  //        break;
+  //      See function CacheCDBEntry for details.
+  //   and
+  //   b) For calibration data which depends on two objects: One containing 
+  //      a value per detector and one the local fluctuations per pad:
+  //      case kID<Name> :
+  //        return CacheMergeCDBEntry(kID<Name>,"TRD/Calib/<padPath>","TRD/Calib/<chamberPath>"); 
+  //        break;
+  //      See function CacheMergeCDBEntry for details.
+  //
     
-    switch (id)
-    {
-      // parameters defined per pad and chamber
-      case kIDVdriftPad : return CacheCDBEntry(kIDVdriftPad, "TRD/Calib/LocalVdrift"); break;
-      case kIDVdriftChamber : return CacheCDBEntry(kIDVdriftChamber, "TRD/Calib/ChamberVdrift"); break;
-
-      case kIDT0Pad : return CacheCDBEntry(kIDT0Pad, "TRD/Calib/LocalT0"); break;
-      case kIDT0Chamber : return CacheCDBEntry(kIDT0Chamber, "TRD/Calib/ChamberT0"); break;
-
-      case kIDGainFactorPad : return CacheCDBEntry(kIDGainFactorPad, "TRD/Calib/LocalGainFactor"); break;
-      case kIDGainFactorChamber : return CacheCDBEntry(kIDGainFactorChamber, "TRD/Calib/ChamberGainFactor"); break;
-
-      // parameters defined per pad
-      case kIDPRFWidth : return CacheCDBEntry(kIDPRFWidth, "TRD/Calib/PRFWidth"); break;
-
-      // status values
-      case kIDSuperModuleStatus : return CacheCDBEntry(kIDSuperModuleStatus, "TRD/Calib/SuperModuleStatus"); break;
-      case kIDChamberStatus : return CacheCDBEntry(kIDChamberStatus, "TRD/Calib/ChamberStatus"); break;
-      case kIDMCMStatus : return CacheCDBEntry(kIDMCMStatus, "TRD/Calib/MCMStatus"); break;
-      case kIDPadStatus : return CacheCDBEntry(kIDPadStatus, "TRD/Calib/PadStatus"); break;
-
-      // global parameters
-      case kIDMonitoringData : return CacheCDBEntry(kIDMonitoringData, "TRD/Calib/MonitoringData"); break;
-      case kIDGlobals : return CacheCDBEntry(kIDGlobals, "TRD/Calib/Globals"); break;
-      case kIDPIDLQ : return CacheCDBEntry(kIDPIDLQ, "TRD/Calib/PIDLQ"); break;
-    }
-    return 0;
+  switch (id)
+  {
+
+    // Parameters defined per pad and chamber
+    case kIDVdriftPad : 
+      return CacheCDBEntry(kIDVdriftPad, "TRD/Calib/LocalVdrift"); 
+      break;
+    case kIDVdriftChamber : 
+      return CacheCDBEntry(kIDVdriftChamber, "TRD/Calib/ChamberVdrift"); 
+      break;
+    case kIDT0Pad : 
+      return CacheCDBEntry(kIDT0Pad, "TRD/Calib/LocalT0"); 
+      break;
+    case kIDT0Chamber : 
+      return CacheCDBEntry(kIDT0Chamber, "TRD/Calib/ChamberT0"); 
+      break;
+    case kIDGainFactorPad : 
+      return CacheCDBEntry(kIDGainFactorPad, "TRD/Calib/LocalGainFactor"); 
+      break;
+    case kIDGainFactorChamber : 
+      return CacheCDBEntry(kIDGainFactorChamber, "TRD/Calib/ChamberGainFactor"); 
+      break;
+
+    // Parameters defined per pad
+    case kIDPRFWidth : 
+      return CacheCDBEntry(kIDPRFWidth, "TRD/Calib/PRFWidth"); 
+      break;
+
+    // Status values
+    case kIDSuperModuleStatus : 
+      return CacheCDBEntry(kIDSuperModuleStatus, "TRD/Calib/SuperModuleStatus"); 
+      break;
+    case kIDChamberStatus : 
+      return CacheCDBEntry(kIDChamberStatus, "TRD/Calib/ChamberStatus"); 
+      break;
+    case kIDMCMStatus : 
+      return CacheCDBEntry(kIDMCMStatus, "TRD/Calib/MCMStatus"); 
+      break;
+    case kIDPadStatus : 
+      return CacheCDBEntry(kIDPadStatus, "TRD/Calib/PadStatus"); 
+      break;
+
+    // Global parameters
+    case kIDMonitoringData : 
+      return CacheCDBEntry(kIDMonitoringData, "TRD/Calib/MonitoringData"); 
+      break;
+    case kIDGlobals : 
+      return CacheCDBEntry(kIDGlobals, "TRD/Calib/Globals"); 
+      break;
+    case kIDPIDLQ : 
+      return CacheCDBEntry(kIDPIDLQ, "TRD/Calib/PIDLQ"); 
+      break;
+
+  }
+
+  return 0;
+
 }
 
 //_____________________________________________________________________________
@@ -183,14 +270,15 @@ AliCDBEntry* AliTRDcalibDB::GetCDBEntry(const char* cdbPath)
   //
     
   AliCDBEntry* entry = AliCDBManager::Instance()->Get(cdbPath, fRun);
-  if (!entry)
-  { 
-    std::cerr << "AliTRDcalibDB: Failed to get entry: " << cdbPath << std::endl; 
+  if (!entry) { 
+    AliError(Form("Failed to get entry: %s",cdbPath));
     return 0; 
   }
   
-  std::cout << "AliTRDcalibDB: Retrieved object: " << cdbPath << std::endl;
+  AliInfo(Form("AliTRDcalibDB: Retrieved object: %s",cdbPath));
+
   return entry;
+
 }
 
 //_____________________________________________________________________________
@@ -200,13 +288,13 @@ const TObject* AliTRDcalibDB::CacheCDBEntry(Int_t id, const char* cdbPath)
   // Caches the entry <id> with cdb path <cdbPath>
   //
   
-  if (!fCDBCache[id])
-  {
+  if (!fCDBCache[id]) {
     fCDBEntries[id] = GetCDBEntry(cdbPath);
     if (fCDBEntries[id])
       fCDBCache[id] = fCDBEntries[id]->GetObject();
   }
   return fCDBCache[id];
+
 }
 
 //_____________________________________________________________________________
@@ -222,6 +310,7 @@ void AliTRDcalibDB::SetRun(Long64_t run)
 
   fRun = run;
   Invalidate();
+
 }
 
 //_____________________________________________________________________________
@@ -231,21 +320,19 @@ void AliTRDcalibDB::Invalidate()
   // Invalidates cache (when run number is changed).
   //
   
-  for (Int_t i=0; i<kCDBCacheSize; ++i)
-  {
-    if (fCDBEntries[i])
-    {
-      if (AliCDBManager::Instance()->GetCacheFlag() == kFALSE)
-      {
-        if (fCDBEntries[i]->IsOwner() == kFALSE && fCDBCache[i])
+  for (Int_t i=0; i<kCDBCacheSize; ++i) {
+    if (fCDBEntries[i]) {
+      if (AliCDBManager::Instance()->GetCacheFlag() == kFALSE) {
+        if (fCDBEntries[i]->IsOwner() == kFALSE && fCDBCache[i]) {
           delete fCDBCache[i];
-
+       }
         delete fCDBEntries[i];
       }
       fCDBEntries[i] = 0;
-      fCDBCache[i] = 0;
+      fCDBCache[i]   = 0;
     }
   }
+
 }
 
 //_____________________________________________________________________________
@@ -268,6 +355,7 @@ Float_t AliTRDcalibDB::GetVdrift(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return calChamber->GetValue(det) * roc->GetValue(col, row);
+
 }
 
 //_____________________________________________________________________________
@@ -282,6 +370,7 @@ Float_t AliTRDcalibDB::GetVdriftAverage(Int_t det)
     return -1;
 
   return calDet->GetValue(det);
+
 }
 
 //_____________________________________________________________________________
@@ -304,6 +393,7 @@ Float_t AliTRDcalibDB::GetT0(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return calChamber->GetValue(det) * roc->GetValue(col, row);
+
 }
 
 //_____________________________________________________________________________
@@ -318,6 +408,7 @@ Float_t AliTRDcalibDB::GetT0Average(Int_t det)
     return -1;
 
   return calDet->GetValue(det);
+
 }
 
 //_____________________________________________________________________________
@@ -340,6 +431,7 @@ Float_t AliTRDcalibDB::GetGainFactor(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return calChamber->GetValue(det) * roc->GetValue(col, row);
+
 }
 
 //_____________________________________________________________________________
@@ -354,6 +446,7 @@ Float_t AliTRDcalibDB::GetGainFactorAverage(Int_t det)
     return -1;
 
   return calDet->GetValue(det);
+
 }
 
 //_____________________________________________________________________________
@@ -372,6 +465,7 @@ Float_t AliTRDcalibDB::GetPRFWidth(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return roc->GetValue(col, row);
+
 }
 
 //_____________________________________________________________________________
@@ -386,6 +480,7 @@ Float_t AliTRDcalibDB::GetSamplingFrequency()
     return -1;  
   
   return calGlobal->GetSamplingFrequency();
+
 }
   
 //_____________________________________________________________________________
@@ -400,6 +495,7 @@ Int_t AliTRDcalibDB::GetNumberOfTimeBins()
     return -1;
 
   return calGlobal->GetNumberOfTimeBins();
+
 }
 
 //_____________________________________________________________________________
@@ -418,6 +514,7 @@ Char_t AliTRDcalibDB::GetPadStatus(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return roc->GetStatus(col, row);
+
 }
 
 //_____________________________________________________________________________
@@ -438,6 +535,7 @@ Char_t AliTRDcalibDB::GetMCMStatus(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return roc->GetStatus(mcm, row);
+
 }
 
 //_____________________________________________________________________________
@@ -452,6 +550,7 @@ Char_t AliTRDcalibDB::GetChamberStatus(Int_t det)
     return -1;
 
   return cal->GetStatus(det);
+
 }
 
 //_____________________________________________________________________________
@@ -466,6 +565,7 @@ Char_t AliTRDcalibDB::GetSuperModuleStatus(Int_t sm)
     return -1;
 
   return cal->GetStatus(sm);
+
 }
 
 //_____________________________________________________________________________
@@ -480,6 +580,7 @@ Bool_t AliTRDcalibDB::IsPadMasked(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return cal->IsMasked(det, col, row);
+
 }
 
 //_____________________________________________________________________________
@@ -494,6 +595,7 @@ Bool_t AliTRDcalibDB::IsPadBridgedLeft(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return cal->IsBridgedLeft(det, col, row);
+
 }
 
 //_____________________________________________________________________________
@@ -508,6 +610,7 @@ Bool_t AliTRDcalibDB::IsPadBridgedRight(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return cal->IsBridgedRight(det, col, row);
+
 }
 
 //_____________________________________________________________________________
@@ -522,6 +625,7 @@ Bool_t AliTRDcalibDB::IsMCMMasked(Int_t det, Int_t col, Int_t row)
     return -1;
 
   return cal->IsMasked(det, col, row);
+
 }
 
 //_____________________________________________________________________________
@@ -536,6 +640,7 @@ Bool_t AliTRDcalibDB::IsChamberInstalled(Int_t det)
     return -1;
 
   return cal->IsInstalled(det);
+
 }
 
 //_____________________________________________________________________________
@@ -550,6 +655,7 @@ Bool_t AliTRDcalibDB::IsChamberMasked(Int_t det)
     return -1;
 
   return cal->IsMasked(det);
+
 }
 
 //_____________________________________________________________________________
@@ -564,6 +670,7 @@ Bool_t AliTRDcalibDB::IsSuperModuleInstalled(Int_t det)
     return -1;
 
   return cal->IsInstalled(det);
+
 }
 
 //_____________________________________________________________________________
@@ -578,6 +685,7 @@ Bool_t AliTRDcalibDB::IsSuperModuleMasked(Int_t det)
     return -1;
 
   return cal->IsMasked(det);
+
 }
 
 //_____________________________________________________________________________
@@ -588,6 +696,7 @@ const AliTRDCalPIDLQ* AliTRDcalibDB::GetPIDLQObject()
   //
 
   return dynamic_cast<const AliTRDCalPIDLQ*> (GetCachedCDBObject(kIDPIDLQ));
+
 }
 
 //_____________________________________________________________________________
@@ -598,6 +707,7 @@ const AliTRDCalMonitoring* AliTRDcalibDB::GetMonitoringObject()
   //
 
   return dynamic_cast<const AliTRDCalMonitoring*> (GetCachedCDBObject(kIDMonitoringData));
+
 }
 
 //_____________________________________________________________________________
@@ -644,7 +754,7 @@ Float_t AliTRDcalibDB::GetOmegaTau(Float_t vdrift)
 void AliTRDcalibDB::SamplePRF()
 {
   //
-  // Samples the pad response function
+  // Samples the pad response function (should maybe go somewhere else ...)
   //
 
   const Int_t kPRFbin = 61;
@@ -798,7 +908,7 @@ void AliTRDcalibDB::SamplePRF()
 
 //_____________________________________________________________________________
 Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist
-    , Int_t plane, Double_t *pad) const
+                                , Int_t plane, Double_t *pad) const
 {
   //
   // Applies the pad response
index 4a242b00e2c3136a55e455d404d22a0783d91c81..705afb4c9860c0f197ee74e3c114058e346480cf 100644 (file)
 
 /* $Id$ */
 
-#include <iostream>
 #include "TObject.h"
 
-#include "AliLog.h"
-#include "AliTRDgeometry.h"
-
-#include <AliCDBStorage.h>
-#include <AliCDBEntry.h>
+class AliCDBEntry;
 
 class AliTRDCalPIDLQ;
 class AliTRDCalMonitoring;
 
-class AliTRDcalibDB : public TObject
-{
-public:
+class AliTRDcalibDB : public TObject {
+
+ public:
+
   enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
   
-  static AliTRDcalibDBInstance();
-  static void Terminate();
+  static AliTRDcalibDB *Instance();
+  static void           Terminate();
 
-  void SetRun(Long64_t run);
+  void     SetRun(Long64_t run);
   Long64_t GetRun() { return fRun; }
 
-  Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
-  Float_t GetVdriftAverage(Int_t det);
+  Float_t  GetVdrift(Int_t det, Int_t col, Int_t row);
+  Float_t  GetVdriftAverage(Int_t det);
 
-  Float_t GetT0(Int_t det, Int_t col, Int_t row);
-  Float_t GetT0Average(Int_t det);
+  Float_t  GetT0(Int_t det, Int_t col, Int_t row);
+  Float_t  GetT0Average(Int_t det);
 
-  Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
-  Float_t GetGainFactorAverage(Int_t det);
+  Float_t  GetGainFactor(Int_t det, Int_t col, Int_t row);
+  Float_t  GetGainFactorAverage(Int_t det);
 
-  Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
+  Float_t  GetPRFWidth(Int_t det, Int_t col, Int_t row);
 
-  Float_t GetSamplingFrequency();
-  Int_t GetNumberOfTimeBins();
+  Float_t  GetSamplingFrequency();
+  Int_t    GetNumberOfTimeBins();
 
-  Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
-  Char_t GetMCMStatus(Int_t det, Int_t col, Int_t row);
-  Char_t GetChamberStatus(Int_t det);
-  Char_t GetSuperModuleStatus(Int_t sm);
+  Char_t   GetPadStatus(Int_t det, Int_t col, Int_t row);
+  Char_t   GetMCMStatus(Int_t det, Int_t col, Int_t row);
+  Char_t   GetChamberStatus(Int_t det);
+  Char_t   GetSuperModuleStatus(Int_t sm);
 
-  Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
-  Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
-  Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
+  Bool_t   IsPadMasked(Int_t det, Int_t col, Int_t row);
+  Bool_t   IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
+  Bool_t   IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
   
-  Bool_t IsMCMMasked(Int_t det, Int_t col, Int_t row);
+  Bool_t   IsMCMMasked(Int_t det, Int_t col, Int_t row);
   
-  Bool_t IsChamberInstalled(Int_t det);
-  Bool_t IsChamberMasked(Int_t det);
+  Bool_t   IsChamberInstalled(Int_t det);
+  Bool_t   IsChamberMasked(Int_t det);
   
-  Bool_t IsSuperModuleInstalled(Int_t det);
-  Bool_t IsSuperModuleMasked(Int_t det);
+  Bool_t   IsSuperModuleInstalled(Int_t det);
+  Bool_t   IsSuperModuleMasked(Int_t det);
 
-  const AliTRDCalMonitoringGetMonitoringObject();
-  const AliTRDCalPIDLQGetPIDLQObject();
+  const AliTRDCalMonitoring *GetMonitoringObject();
+  const AliTRDCalPIDLQ      *GetPIDLQObject();
 
-  //Related functions, these depend on calibration data
+  // Related functions, these depend on calibration data
   static Float_t GetOmegaTau(Float_t vdrift);
-  Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const;
+  Int_t          PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const;
   
-protected:
-  // for caching see also implentation of GetCachedCDBObject in the .cxx file
+ protected:
+
+  // For caching see also implentation of GetCachedCDBObject in the .cxx file
   enum { kCDBCacheSize = 17 };   // Number of cached objects
   enum { kIDVdriftPad = 0, kIDVdriftChamber,
          kIDT0Pad, kIDT0Chamber,
@@ -86,35 +83,38 @@ protected:
 
   const TObject* GetCachedCDBObject(Int_t id);
   
-  void Invalidate();
-  void SamplePRF();
+  void           Invalidate();
+  void           SamplePRF();
   
-  AliCDBEntryGetCDBEntry(const char* cdbPath);
-  const TObjectCacheCDBEntry(Int_t id, const char* cdbPath);
+  AliCDBEntry   *GetCDBEntry(const char* cdbPath);
+  const TObject *CacheCDBEntry(Int_t id, const char* cdbPath);
 
-  static AliTRDcalibDB* fgInstance;     // Instance of this class (singleton implementation)
-  static Bool_t fgTerminated;               // Defines if this class has already been terminated and therefore does not return instances in GetInstance anymore
+  static AliTRDcalibDB *fgInstance;                 //  Instance of this class (singleton implementation)
+  static Bool_t         fgTerminated;               //  Defines if this class has already been terminated
+  AliCDBEntry          *fCDBEntries[kCDBCacheSize]; //  Cache for CDB entries
+  TObject              *fCDBCache[kCDBCacheSize];   //  Cache for calibration objects.
 
-  AliCDBEntry* fCDBEntries[kCDBCacheSize];    // Cache for CDB entries
-  TObject* fCDBCache[kCDBCacheSize];          // Cache for calibration objects.
-
-  Long64_t fRun;
+  Long64_t              fRun;                       //  Run Number
   
   struct 
   {
-    Float_t             *fPRFsmp;                             //! Sampled pad response
-    Int_t                fPRFbin;                             //  Number of bins for the PRF
-    Float_t              fPRFlo;                              //  Lower boundary of the PRF
-    Float_t              fPRFhi;                              //  Higher boundary of the PRF
-    Float_t              fPRFwid;                             //  Bin width of the sampled PRF
-    Int_t                fPRFpad;                             //  Distance to next pad in PRF
+    Float_t             *fPRFsmp;                   //! Sampled pad response
+    Int_t                fPRFbin;                   //  Number of bins for the PRF
+    Float_t              fPRFlo;                    //  Lower boundary of the PRF
+    Float_t              fPRFhi;                    //  Higher boundary of the PRF
+    Float_t              fPRFwid;                   //  Bin width of the sampled PRF
+    Int_t                fPRFpad;                   //  Distance to next pad in PRF
   } fPadResponse;
   
-private:
-  AliTRDcalibDB(); // this is a singleton, constructor is private!  
+ private:
+
+  AliTRDcalibDB();                                  //  This is a singleton, constructor is private!  
+  AliTRDcalibDB(const AliTRDcalibDB &c);   
+  AliTRDcalibDB &operator=(const AliTRDcalibDB &c); 
   virtual ~AliTRDcalibDB();
 
-  ClassDef(AliTRDcalibDB, 2)
+  ClassDef(AliTRDcalibDB, 2)                        //  Provides central access to the CDB
+
 };
 
 #endif
index bbf789501286021a16dcf5c3ff6a4266ea60b264..c2233e8dd007c51f60abfa128c6a516c4a8149fe 100644 (file)
@@ -150,7 +150,6 @@ Bool_t AliTRDclusterizerV1::ReadDigits(AliRawReader* rawReader)
   //
 
   AliTRDrawData raw;
-  raw.SetDebug(1);
 
   fDigitsManager = raw.Raw2Digits(rawReader);
 
index 9f1fedf9710d10dcbe6e6615f7dd54872f32ea43..f64229b9043695eb4ad82b8f82b18a7c25f259a1 100644 (file)
@@ -26,6 +26,9 @@
 
 #include "TClass.h"
 #include "TError.h"
+
+#include "AliLog.h"
+
 #include "AliTRDsegmentID.h"
 #include "AliTRDarrayI.h"
 #include "AliTRDdataArray.h"
@@ -34,48 +37,66 @@ ClassImp(AliTRDdataArray)
 
 //_____________________________________________________________________________
 AliTRDdataArray::AliTRDdataArray()
+   :fNrow(0)
+   ,fNcol(0)
+   ,fNtime(0)
+   ,fNdim1(-1)
+   ,fNdim2(-1)
+   ,fIndex(0)
+   ,fBufType(-1)
+   ,fNelems(-1)
+   ,fCurrentIdx1(0)
+   ,fCurrentIdx2(0)
+   ,fCurrentIndex(0)
 {
   //
   // Default constructor
   //
 
-  fIndex   =  0;
-
-  fNdim1   = -1;
-  fNdim2   = -1;
-  fNelems  = -1; 
-
-  fBufType = -1;
-
-  fNrow    =  0;
-  fNcol    =  0;
-  fNtime   =  0;
-
 }
 
 //_____________________________________________________________________________
 AliTRDdataArray::AliTRDdataArray(Int_t nrow, Int_t ncol, Int_t ntime)
+   :fNrow(0)
+   ,fNcol(0)
+   ,fNtime(0)
+   ,fNdim1(-1)
+   ,fNdim2(-1)
+   ,fIndex(0)
+   ,fBufType(-1)
+   ,fNelems(-1)
+   ,fCurrentIdx1(0)
+   ,fCurrentIdx2(0)
+   ,fCurrentIndex(0)
 {
   //
   // Creates a AliTRDdataArray with the dimensions <nrow>, <ncol>, and <ntime>.
   // The row- and column dimensions are compressible.
   //
 
-  fIndex   = 0;
-
   Allocate(nrow,ncol,ntime);
 
 }
 
 //_____________________________________________________________________________
-AliTRDdataArray::AliTRDdataArray(const AliTRDdataArray &d):AliTRDsegmentID(d)
+AliTRDdataArray::AliTRDdataArray(const AliTRDdataArray &d)
+   :AliTRDsegmentID(d)
+   ,fNrow(d.fNrow)
+   ,fNcol(d.fNcol)
+   ,fNtime(d.fNtime)
+   ,fNdim1(d.fNdim1)
+   ,fNdim2(d.fNdim2)
+   ,fIndex(d.fIndex)
+   ,fBufType(d.fBufType)
+   ,fNelems(d.fNelems)
+   ,fCurrentIdx1(0)
+   ,fCurrentIdx2(0)
+   ,fCurrentIndex(0)
 {
   //
   // AliTRDdataArray copy constructor
   //
 
-  ((AliTRDdataArray &) d).Copy(*this);
-
 }
 
 //_____________________________________________________________________________
@@ -127,7 +148,7 @@ void AliTRDdataArray::Copy(TObject &d) const
 }
 
 //_____________________________________________________________________________
-void AliTRDdataArray::Allocate(Int_t nrow, Int_t ncol,Int_t ntime)
+void AliTRDdataArray::Allocate(Int_t nrow, Int_t ncol, Int_t ntime)
 {
   //
   // Allocates memory for a AliTRDdataArray with the dimensions 
@@ -136,15 +157,15 @@ void AliTRDdataArray::Allocate(Int_t nrow, Int_t ncol,Int_t ntime)
   //
 
   if (nrow  <= 0) {
-    Error("AliTRDdataArray::Allocate","The number of rows has to be positive");
+    AliError("The number of rows has to be positive");
     exit(1);
   }
   if (ncol  <= 0) {
-    Error("AliTRDdataArray::Allocate","The number of columns has to be positive");
+    AliError("The number of columns has to be positive");
     exit(1);
   }
   if (ntime <= 0) {
-    Error("AliTRDdataArray::Allocate","The number of timebins has to be positive");
+    AliError("The number of timebins has to be positive");
     exit(1);
   }
 
@@ -171,32 +192,32 @@ void AliTRDdataArray::Allocate(Int_t nrow, Int_t ncol,Int_t ntime)
 }
 
 //_____________________________________________________________________________
-Bool_t AliTRDdataArray::CheckBounds(const char *where, Int_t idx1, Int_t idx2) 
+Bool_t AliTRDdataArray::CheckBounds(Int_t idx1, Int_t idx2) 
 {
   //
   // Does the boundary checking
   //
 
   if ((idx2 >= fNdim2) || (idx2 < 0)) 
-    return OutOfBoundsError(where,idx1,idx2);
+    return OutOfBoundsError(idx1,idx2);
 
   Int_t index = (*fIndex).At(idx2) + idx1;
   if ((index < 0) || (index > fNelems)) 
-    return OutOfBoundsError(where,idx1,idx2);
+    return OutOfBoundsError(idx1,idx2);
 
   return kTRUE;  
 
 }
 
 //_____________________________________________________________________________
-Bool_t AliTRDdataArray::OutOfBoundsError(const char *where, Int_t idx1, Int_t idx2) 
+Bool_t AliTRDdataArray::OutOfBoundsError(Int_t idx1, Int_t idx2) 
 {
   //
   // Generate an out-of-bounds error. Always returns false.
   //
 
-  TObject::Error(where, "idx1 %d  idx2 %d out of bounds (size: %d x %d, this: 0x%08x)"
-          ,idx1,idx2,fNdim1,fNdim2,this);
+  AliError(Form("idx1 %d  idx2 %d out of bounds (size: %d x %d, this: 0x%08x)"
+              ,idx1,idx2,fNdim1,fNdim2,this));
 
   return kFALSE;
 
@@ -233,16 +254,12 @@ Int_t AliTRDdataArray::GetIdx1(Int_t row, Int_t col) const
   //
 
   if (row >= fNrow) {
-    TObject::Error("GetIdx1"
-                  ,"row %d out of bounds (size: %d, this: 0x%08x)"
-                  ,row,fNrow,this);
+    AliError(Form("row %d out of bounds (size: %d, this: 0x%08x)",row,fNrow,this));
     return -1;
   }  
 
   if (col >= fNcol) {
-    TObject::Error("GetIdx1"
-                  ,"col %d out of bounds (size: %d, this: 0x%08x)"
-                  ,col,fNcol,this);
+    AliError(Form("col %d out of bounds (size: %d, this: 0x%08x)",col,fNcol,this));
     return -1;
   }  
 
@@ -258,9 +275,7 @@ Int_t AliTRDdataArray::GetIndex(Int_t row, Int_t col, Int_t time) const
   // 
 
   if (time > fNtime) {
-    TObject::Error("GetIdx1"
-                  ,"time %d out of bounds (size: %d, this: 0x%08x)"
-                  ,time,fNtime,this);
+    AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)",time,fNtime,this));
     return -1;
   }  
   
index d583364ccc7c86df5e047868d759a0794ad8eefa..f4260aafd877d125f0149627da94e3b9c21ed0a0 100644 (file)
@@ -43,8 +43,8 @@ class AliTRDdataArray : public AliTRDsegmentID {
           Int_t  GetIdx1(Int_t row, Int_t col) const;
   inline  Int_t  GetIdx1Unchecked(Int_t row, Int_t col) const
                                                { return row + col * fNrow; };
-  inline  Bool_t CheckBounds(const char *where, Int_t idx1, Int_t idx2);
-  inline  Bool_t OutOfBoundsError(const char *where, Int_t idx1, Int_t idx2);
+  inline  Bool_t CheckBounds(Int_t idx1, Int_t idx2);
+  inline  Bool_t OutOfBoundsError(Int_t idx1, Int_t idx2);
  
   Int_t          fNrow;            // Number of rows of the detector segement
   Int_t          fNcol;            // Number of columns of the detector segment
index d5f365b27f21a6bd013d3849fb686d213246a078..7e4ed79e7f7c2a891aaec10a4e7ee902304b732f 100644 (file)
@@ -22,6 +22,8 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include "AliLog.h"
+
 #include "AliTRDdataArrayF.h"
 #include "AliTRDarrayI.h"
 #include "AliTRDarrayF.h"
 ClassImp(AliTRDdataArrayF)
 
 //_____________________________________________________________________________
-AliTRDdataArrayF::AliTRDdataArrayF():AliTRDdataArray()
+AliTRDdataArrayF::AliTRDdataArrayF()
+   :AliTRDdataArray()
+   ,fElements(0)
+   ,fThreshold(0)
 {
   //
   // Default constructor
   //
 
-  fElements = 0;
-
 }
 
 //_____________________________________________________________________________
 AliTRDdataArrayF::AliTRDdataArrayF(Int_t nrow, Int_t ncol, Int_t ntime)
-                 :AliTRDdataArray(nrow,ncol,ntime)
+   :AliTRDdataArray(nrow,ncol,ntime)
+   ,fElements(0)
+   ,fThreshold(0)
 {
   //
   // Creates a AliTRDdataArrayF with the dimensions <nrow>, <ncol>, and <ntime>.
   // The row- and column dimensions are compressible.
   //
 
-  fElements = 0;
-
   Allocate(nrow,ncol,ntime);
   
 }
 
 //_____________________________________________________________________________
-AliTRDdataArrayF::AliTRDdataArrayF(const AliTRDdataArrayF &a):AliTRDdataArray(a)
+AliTRDdataArrayF::AliTRDdataArrayF(const AliTRDdataArrayF &a)
+   :AliTRDdataArray(a)
+   ,fElements(a.fElements)
+   ,fThreshold(a.fThreshold)
 {
   //
   // AliTRDdataArrayF copy constructor
   //
 
-  ((AliTRDdataArrayF &) a).Copy(*this);
-
 }
 
 //_____________________________________________________________________________
@@ -193,9 +197,8 @@ Float_t AliTRDdataArrayF::GetData(Int_t row, Int_t col, Int_t time) const
     }
     else {
       if (idx1 >= 0) {
-        TObject::Error("GetData"
-                      ,"time %d out of bounds (size: %d, this: 0x%08x)"
-                      ,time,fNdim2,this);
+        AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+                     ,time,fNdim2,this));
       }
     }
   }
@@ -236,7 +239,7 @@ void AliTRDdataArrayF::Compress(Int_t bufferType)
   //
 
   if (fBufType  < 0) {
-    Error("AliTRDdataArrayF::Compress","Buffer does not exist");
+    AliError("Buffer does not exist");
     return;
   }
   if (fBufType == bufferType) {
@@ -246,7 +249,7 @@ void AliTRDdataArrayF::Compress(Int_t bufferType)
     Expand();
   }
   if (fBufType !=0)  {
-    Error("AliTRDdataArrayF::Compress","Buffer does not exist");
+    AliError("Buffer does not exist");
     return;
   }
 
@@ -265,7 +268,7 @@ void AliTRDdataArrayF::Expand()
   //
 
   if (fBufType  < 0) {
-    Error("AliTRDdataArrayF::Expand","Buffer does not exist");
+    AliError("Buffer does not exist");
     return;
   }
   if (fBufType == 0) {  
@@ -637,9 +640,8 @@ void AliTRDdataArrayF::SetData(Int_t row, Int_t col, Int_t time, Float_t value)
     }
     else {
       if (idx1 >= 0) {
-        TObject::Error("SetData"
-                      ,"time %d out of bounds (size: %d, this: 0x%08x)"
-                      ,time,fNdim2,this);
+        AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+                     ,time,fNdim2,this));
       }
     }
   }
index 2a8e7f25a351090f4f15c991230ac158f3cdb4ff..9a690d9aeae9c47721c3154f77dd50f562b67325 100644 (file)
@@ -57,8 +57,8 @@ class AliTRDdataArrayF : public AliTRDdataArray {
 
  protected:
 
-  void    SetDataFast(Int_t idx1, Int_t idx2, Float_t v);  
-  Float_t GetDataFast(Int_t idx1, Int_t idx2) const;
+          void    SetDataFast(Int_t idx1, Int_t idx2, Float_t v);  
+          Float_t GetDataFast(Int_t idx1, Int_t idx2) const;
 
   Float_t         GetData1(Int_t idx1, Int_t idx2) const; 
   void            Expand1(); 
index d9303617dcfa024404c4169da9bcbdb9e7704f52..dc351936ee07fc5bba70f1d6a15384d4b69abbfc 100644 (file)
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include "AliLog.h"
+
 #include "AliTRDdataArrayI.h"
 #include "AliTRDarrayI.h"
 
 ClassImp(AliTRDdataArrayI)
 
 //_____________________________________________________________________________
-AliTRDdataArrayI::AliTRDdataArrayI():AliTRDdataArray()
+AliTRDdataArrayI::AliTRDdataArrayI()
+   :AliTRDdataArray()
+   ,fElements(0)
+   ,fThreshold(0)
 {
   //
   // Default constructor
   //
 
-  fElements = 0;
-
 }
 
 //_____________________________________________________________________________
 AliTRDdataArrayI::AliTRDdataArrayI(Int_t nrow, Int_t ncol, Int_t ntime)
-                 :AliTRDdataArray(nrow,ncol,ntime)
+   :AliTRDdataArray(nrow,ncol,ntime)
+   ,fElements(0)
+   ,fThreshold(0)
 {
   //
   // Creates a AliTRDdataArrayI with the dimensions <nrow>, <ncol>, and <ntime>.
   // The row- and column dimensions are compressible.
   //
 
-  fElements = 0;
-
   Allocate(nrow,ncol,ntime);
   
 }
 
 //_____________________________________________________________________________
-AliTRDdataArrayI::AliTRDdataArrayI(const AliTRDdataArrayI &a):AliTRDdataArray(a)
+AliTRDdataArrayI::AliTRDdataArrayI(const AliTRDdataArrayI &a)
+   :AliTRDdataArray(a)
+   ,fElements(a.fElements)
+   ,fThreshold(a.fThreshold)
 {
   //
   // AliTRDdataArrayI copy constructor
   //
 
-  ((AliTRDdataArrayI &) a).Copy(*this);
-
 }
 
 //_____________________________________________________________________________
@@ -192,9 +196,8 @@ Int_t AliTRDdataArrayI::GetData(Int_t row, Int_t col, Int_t time) const
     }
     else {
       if (idx1 >= 0) {
-        TObject::Error("GetData"
-                      ,"time %d out of bounds (size: %d, this: 0x%08x)"
-                      ,time,fNdim2,this);
+        AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+                     ,time,fNdim2,this));
       }
     }
   }
@@ -235,7 +238,7 @@ void AliTRDdataArrayI::Compress(Int_t bufferType)
   //
 
   if (fBufType  < 0) {
-    Error("AliTRDdataArrayI::Compress","Buffer does not exist");
+    AliError("Buffer does not exist");
     return;
   }
   if (fBufType == bufferType) {
@@ -245,7 +248,7 @@ void AliTRDdataArrayI::Compress(Int_t bufferType)
     Expand();
   }
   if (fBufType !=0)  {
-    Error("AliTRDdataArrayI::Compress","Buffer does not exist");
+    AliError("Buffer does not exist");
     return;
   }
 
@@ -264,7 +267,7 @@ void AliTRDdataArrayI::Expand()
   //
 
   if (fBufType  < 0) {
-    Error("AliTRDdataArrayI::Expand","Buffer does not exist");
+    AliError("Buffer does not exist");
     return;
   }
   if (fBufType == 0) {  
@@ -632,9 +635,8 @@ void AliTRDdataArrayI::SetData(Int_t row, Int_t col, Int_t time, Int_t value)
     }
     else {
       if (idx1 >= 0) {
-        TObject::Error("SetData"
-                      ,"time %d out of bounds (size: %d, this: 0x%08x)"
-                      ,time,fNdim2,this);
+        AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+                     ,time,fNdim2,this));
       }
     }
   }
index d1bf8bfea2aad04addb0103fd572a67fdfbc837c..d756d38c0844871f0777ad70529e8baffd199594 100644 (file)
@@ -53,8 +53,8 @@ class AliTRDdataArrayI : public AliTRDdataArray {
 
  protected:
 
-  void   SetDataFast(Int_t idx1, Int_t idx2, Int_t value);
-  Int_t  GetDataFast(Int_t idx1, Int_t idx2) const;
+          void   SetDataFast(Int_t idx1, Int_t idx2, Int_t value);
+          Int_t  GetDataFast(Int_t idx1, Int_t idx2) const;
 
   Int_t          GetData1(Int_t idx1, Int_t idx2) const; 
   void           Expand1(); 
index 4922aa7c8c8af4bd2ae7dea22c7e4a50e7e5c327..49d3e42d77307b86f45eb3527bdcccc2760617a2 100644 (file)
@@ -33,20 +33,24 @@ ClassImp(AliTRDdigit)
   const UInt_t AliTRDdigit::fgkRawDigit = 0x00000001; 
 
 //_____________________________________________________________________________
-AliTRDdigit::AliTRDdigit():AliDigitNew()
+AliTRDdigit::AliTRDdigit()
+  :AliDigitNew()
+  ,fRow(0)
+  ,fCol(0)
+  ,fTime(0)
 {
   //
   // Default constructor
   //
 
-  fRow  = 0;
-  fCol  = 0;
-  fTime = 0;
-
 }
 
 //_____________________________________________________________________________
-AliTRDdigit::AliTRDdigit(Bool_t isRaw, Int_t *digits, Int_t *amp):AliDigitNew()
+AliTRDdigit::AliTRDdigit(Bool_t isRaw, Int_t *digits, Int_t *amp)
+  :AliDigitNew()
+  ,fRow(0)
+  ,fCol(0)
+  ,fTime(0)
 {
   //
   // Create a TRD digit
index 78151a53db271a5404b94ca7103e7ba9ada71f01..0b6fd9b39817eab6c5cf0b9c6936f98e9e64fc6e 100644 (file)
@@ -37,13 +37,13 @@ class AliTRDdigit : public AliDigitNew {
 
  protected:
 
-  static const UInt_t fgkRawDigit; // Marks a raw digit
+  static const UInt_t   fgkRawDigit; // Marks a raw digit
 
-  UShort_t     fRow;               // Pad row number
-  UShort_t     fCol;               // Pad col number
-  UShort_t     fTime;              // Time bucket
+               UShort_t fRow;        // Pad row number
+               UShort_t fCol;        // Pad col number
+               UShort_t fTime;       // Time bucket
 
-  ClassDef(AliTRDdigit,2)          // Digit for the TRD
+  ClassDef(AliTRDdigit,2)            // Digit for the TRD
 
 };
 
index 01be76a4232194586de73d980644028a5ffd981f..3e8fe6b7d423961129f88c012d0aa94960ac466a 100644 (file)
@@ -29,6 +29,7 @@
 #include <TFile.h>
 
 #include "AliRun.h"
+#include "AliLog.h"
 
 #include "AliTRDdigitsManager.h"
 #include "AliTRDsegmentArray.h"
@@ -44,19 +45,18 @@ ClassImp(AliTRDdigitsManager)
   const Int_t AliTRDdigitsManager::fgkNDict = kNDict;
 
 //_____________________________________________________________________________
-AliTRDdigitsManager::AliTRDdigitsManager():TObject()
+AliTRDdigitsManager::AliTRDdigitsManager()
+  :TObject()
+  ,fEvent(0)
+  ,fTree(0)
+  ,fDigits(0)
+  ,fIsRaw(0)
+  ,fSDigits(0)
 {
   //
   // Default constructor
   //
 
-  fIsRaw   = kFALSE;
-  fEvent   = 0;
-  fDebug   = 0;
-  fSDigits = 0;
-
-  fTree    = NULL;
-  fDigits  = NULL;
   for (Int_t iDict = 0; iDict < kNDict; iDict++) {
     fDictionary[iDict] = NULL;
   }
@@ -65,14 +65,17 @@ AliTRDdigitsManager::AliTRDdigitsManager():TObject()
 
 //_____________________________________________________________________________
 AliTRDdigitsManager::AliTRDdigitsManager(const AliTRDdigitsManager &m)
-:TObject(m)
+  :TObject(m)
+  ,fEvent(m.fEvent)
+  ,fTree(0)
+  ,fDigits(0)
+  ,fIsRaw(m.fIsRaw)
+  ,fSDigits(m.fSDigits)
 {
   //
   // AliTRDdigitsManager copy constructor
   //
 
-  ((AliTRDdigitsManager &) m).Copy(*this);
-
 }
 
 //_____________________________________________________________________________
@@ -96,6 +99,18 @@ AliTRDdigitsManager::~AliTRDdigitsManager()
 
 }
 
+//_____________________________________________________________________________
+AliTRDdigitsManager &AliTRDdigitsManager::operator=(const AliTRDdigitsManager &m)
+{
+  //
+  // Assignment operator
+  //
+
+  if (this != &m) ((AliTRDdigitsManager &) m).Copy(*this);
+  return *this;
+
+}
+
 //_____________________________________________________________________________
 void AliTRDdigitsManager::Copy(TObject &m) const
 {
@@ -105,7 +120,6 @@ void AliTRDdigitsManager::Copy(TObject &m) const
 
   ((AliTRDdigitsManager &) m).fIsRaw   = fIsRaw;
   ((AliTRDdigitsManager &) m).fEvent   = fEvent;
-  ((AliTRDdigitsManager &) m).fDebug   = fDebug;
   ((AliTRDdigitsManager &) m).fSDigits = fSDigits;
 
   TObject::Copy(m);
@@ -198,10 +212,7 @@ Bool_t AliTRDdigitsManager::MakeBranch(TTree *tree)
       TBranch* branch = fTree->GetBranch("TRDdigits");
       if (!branch) fTree->Branch("TRDdigits",kDigits->IsA()->GetName(),
                                  &kDigits,buffersize,99);
-      if (fDebug > 0) {
-        printf("<AliTRDdigitsManager::MakeBranch> ");
-        printf("Making branch TRDdigits\n");
-      }
+      AliDebug(1,"Making branch TRDdigits\n");
     }
     else {
       status = kFALSE;
@@ -223,10 +234,7 @@ Bool_t AliTRDdigitsManager::MakeBranch(TTree *tree)
        TBranch* branch = fTree->GetBranch(branchname);
        if (!branch) fTree->Branch(branchname,kDictionary->IsA()->GetName(),
                                   &kDictionary,buffersize,99);
-        if (fDebug > 0) {
-          printf("<AliTRDdigitsManager::MakeBranch> ");
-          printf("Making branch %s\n",branchname);
-       }
+        AliDebug(1,Form("Making branch %s\n",branchname));
       }
       else {
         status = kFALSE;
@@ -257,10 +265,7 @@ Bool_t AliTRDdigitsManager::ReadDigits(TTree *tree)
   }
 
   if (!fDigits) {
-    if (fDebug > 0) {
-      printf("<AliTRDdigitsManager::ReadDigits> ");
-      printf("Create the data arrays.\n");
-    }
+    AliDebug(1,"Create the data arrays.\n");
     CreateArrays();
   }
 
@@ -292,22 +297,19 @@ Bool_t AliTRDdigitsManager::WriteDigits()
 
   // Store the contents of the segment array in the tree
   if (!fDigits->StoreArray("TRDdigits",fTree)) {
-    printf("<AliTRDdigitsManager::WriteDigits> ");
-    printf("Error while storing digits in branch TRDdigits\n");
+    AliError("Error while storing digits in branch TRDdigits\n");
     return kFALSE;
   }
   for (Int_t iDict = 0; iDict < kNDict; iDict++) {
     Char_t branchname[15];
     sprintf(branchname,"TRDdictionary%d",iDict);
     if (!fDictionary[iDict]->StoreArray(branchname,fTree)) {
-      printf("<AliTRDdigitsManager::WriteDigits> ");
-      printf("Error while storing dictionary in branch %s\n",branchname);
+      AliError(Form("Error while storing dictionary in branch %s\n",branchname));
       return kFALSE;
     }
   }
 
   // Write the new tree to the output file
-  //fTree->Write();
   fTree->AutoSave();  // Modification by Jiri
 
   return kTRUE;
@@ -346,9 +348,8 @@ Int_t AliTRDdigitsManager::GetTrack(Int_t track
   //
 
   if ((track < 0) || (track >= kNDict)) {
-    TObject::Error("GetTracks"
-                  ,"track %d out of bounds (size: %d, this: 0x%08x)"
-                  ,track,kNDict,this);
+    AliError(Form("track %d out of bounds (size: %d, this: 0x%08x)"
+                 ,track,kNDict,this));
     return -1;
   }
 
@@ -395,15 +396,3 @@ Int_t AliTRDdigitsManager::GetTrack(Int_t track, AliTRDdigit *Digit) const
   return GetTrack(track,row,col,time,det);
 
 }
-
-//_____________________________________________________________________________
-AliTRDdigitsManager &AliTRDdigitsManager::operator=(const AliTRDdigitsManager &m)
-{
-  //
-  // Assignment operator
-  //
-
-  if (this != &m) ((AliTRDdigitsManager &) m).Copy(*this);
-  return *this;
-
-}
index cf53288b1995e4ad0556431f07b20c86b4864dbe..d47697356673e5bcd673b84caa9eee51ec70341d 100644 (file)
@@ -41,7 +41,6 @@ class AliTRDdigitsManager : public TObject {
 
   virtual void                SetRaw();
   virtual void                SetEvent(Int_t evt)          { fEvent   = evt; };
-  virtual void                SetDebug(Int_t v = 1)        { fDebug   = v;   };
   virtual void                SetSDigits(Int_t v = 1)      { fSDigits = v;   };
 
   virtual Bool_t              IsRaw() const                { return fIsRaw;         };
@@ -72,9 +71,8 @@ class AliTRDdigitsManager : public TObject {
 
   Bool_t              fIsRaw;              //  Flag indicating raw digits
   Bool_t              fSDigits;            //  Switch for the summable digits
-  Int_t               fDebug;              //  Debug flag
 
-  ClassDef(AliTRDdigitsManager,4)          //  Manages the TRD digits
+  ClassDef(AliTRDdigitsManager,5)          //  Manages the TRD digits
 
 };
 
index 965c6e5bf7cc1e79ce1ef74abf73cf23eaa69d35..4e5340274dec35b92fd70a28800be36fef9c4f69 100644 (file)
 ///////////////////////////////////////////////////////////////////////////////
 
 
-#include <TError.h>
 #include <TGeoManager.h>
 #include <TGeoPhysicalNode.h>
 #include <TGeoMatrix.h>
 
-
+#include "AliLog.h"
 #include "AliRunLoader.h"
-#include "AliTRDgeometry.h"
-#include "AliTRDpadPlane.h"
-
 #include "AliAlignObj.h"
 #include "AliAlignObjAngles.h"
 
@@ -39,6 +35,8 @@
 #include "AliTRD.h"
 #include "AliTRDcalibDB.h"
 #include "AliTRDCommonParam.h"
+#include "AliTRDgeometry.h"
+#include "AliTRDpadPlane.h"
 
 ClassImp(AliTRDgeometry)
 
@@ -161,14 +159,32 @@ ClassImp(AliTRDgeometry)
                                                   fgkTime0Base + 5 * (Cheight() + Cspace()) };
 
 //_____________________________________________________________________________
-AliTRDgeometry::AliTRDgeometry():AliGeometry()
+AliTRDgeometry::AliTRDgeometry()
+  :AliGeometry()
+  ,fMatrixArray(0)
+  ,fMatrixCorrectionArray(0)
+  ,fMatrixGeo(0)
+
 {
   //
   // AliTRDgeometry default constructor
   //
 
-  fMatrixArray           = 0;
-  fMatrixCorrectionArray = 0;
+  Init();
+
+}
+
+//_____________________________________________________________________________
+AliTRDgeometry::AliTRDgeometry(const AliTRDgeometry &g)
+  :AliGeometry(g)
+   ,fMatrixArray(g.fMatrixArray)
+   ,fMatrixCorrectionArray(g.fMatrixCorrectionArray)
+   ,fMatrixGeo(g.fMatrixGeo)
+
+{
+  //
+  // AliTRDgeometry copy constructor
+  //
 
   Init();
 
@@ -186,6 +202,18 @@ AliTRDgeometry::~AliTRDgeometry()
 
 }
 
+//_____________________________________________________________________________
+AliTRDgeometry &AliTRDgeometry::operator=(const AliTRDgeometry &g)
+{
+  //
+  // Assignment operator
+  //
+
+  if (this != &g) Init();
+  return *this;
+
+}
+
 //_____________________________________________________________________________
 void AliTRDgeometry::Init()
 {
@@ -714,9 +742,8 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
   gMC->Matrix(matrix[2],  0.0,  0.0, 90.0, 90.0, 90.0,  0.0);
 
   AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam)
-  {
-    AliError("Could not get common params\n");
+  if (!commonParam) {
+    AliError("Could not get common parameters\n");
     return;
   }
     
@@ -1084,12 +1111,16 @@ Bool_t AliTRDgeometry::Local2Global(Int_t iplan, Int_t icham, Int_t isect
   //
 
   AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam)
+  if (!commonParam) {
+    AliError("Could not get common parameters\n");
     return kFALSE;
+  }
 
   AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
-  if (!calibration)
+  if (!calibration) {
+    AliError("Could not get calibration data\n");
     return kFALSE;  
+  }
   
   AliTRDpadPlane *padPlane = commonParam->GetPadPlane(iplan,icham);
 
@@ -1297,7 +1328,7 @@ AliTRDgeometry* AliTRDgeometry::GetGeometry(AliRunLoader* runLoader)
 
   if (!runLoader) runLoader = AliRunLoader::GetRunLoader();
   if (!runLoader) {
-    ::Error("AliTRDgeometry::GetGeometry", "No run loader");
+    //AliError("No run loader");
     return NULL;
   }
 
@@ -1313,7 +1344,10 @@ AliTRDgeometry* AliTRDgeometry::GetGeometry(AliRunLoader* runLoader)
     AliTRD * trd = (AliTRD*)runLoader->GetAliRun()->GetDetector("TRD");
     geom = trd->GetGeometry();
   }
-  if (!geom) ::Error("AliTRDgeometry::GetGeometry", "Geometry not found");
+  if (!geom) {
+    //AliError("Geometry not found");
+    return NULL;
+  }
 
   saveDir->cd();
   return geom;
@@ -1345,7 +1379,7 @@ Bool_t AliTRDgeometry::ReadGeoMatrices()
       Int_t     lid          = GetDetector(iLayerTRD,ichamber,isector);    
 
       //
-      // local geo system z-x-y  to x-y--z 
+      // Local geo system z-x-y  to x-y--z 
       //
       fMatrixGeo->AddAt(new TGeoHMatrix(*m),lid);
       
index ca7920c97e50f4768193132421142f21b037b923..3e40c3d9a128a4e35c361636a5451b3775415973 100644 (file)
@@ -12,7 +12,9 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "AliGeometry.h"
+
 #include "TObjArray.h"
+
 class AliRunLoader;
 class TGeoHMatrix;
 
@@ -23,7 +25,9 @@ class AliTRDgeometry : public AliGeometry {
   enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540, kNdets = 30 };
 
   AliTRDgeometry();
+  AliTRDgeometry(const AliTRDgeometry &g);
   virtual ~AliTRDgeometry();
+  AliTRDgeometry &operator=(const AliTRDgeometry &g);
 
   virtual void     CreateGeometry(Int_t *idtmed);
   virtual Int_t    IsVersion() { return 1; };
@@ -44,9 +48,9 @@ class AliTRDgeometry : public AliGeometry {
           void     CreateServices(Int_t *idtmed);
 
           Bool_t   ReadGeoMatrices();  
-  TGeoHMatrix *    GetGeoMatrix(Int_t det)       { return (TGeoHMatrix *) fMatrixGeo->At(det);             }
-  TGeoHMatrix *    GetMatrix(Int_t det)          { return (TGeoHMatrix *) fMatrixArray->At(det);           }
-  TGeoHMatrix *    GetCorrectionMatrix(Int_t det){ return (TGeoHMatrix *) fMatrixCorrectionArray->At(det); }
+  TGeoHMatrix     *GetGeoMatrix(Int_t det)        { return (TGeoHMatrix *) fMatrixGeo->At(det);             }
+  TGeoHMatrix     *GetMatrix(Int_t det)           { return (TGeoHMatrix *) fMatrixArray->At(det);           }
+  TGeoHMatrix     *GetCorrectionMatrix(Int_t det) { return (TGeoHMatrix *) fMatrixCorrectionArray->At(det); }
 
   static  Int_t    Nsect()   { return fgkNsect; };
   static  Int_t    Nplan()   { return fgkNplan; };
@@ -74,8 +78,6 @@ class AliTRDgeometry : public AliGeometry {
   static  Float_t  RpadW()   { return fgkRpadW;   };
   static  Float_t  CpadW()   { return fgkCpadW;   };
 
-  //void     SetSMstatus(Int_t sm, Char_t status)     { sm += 5; if (sm > 17) sm -= 18;
-  //                                                          fSMstatus[sm] = status; };
           void     SetSMstatus(Int_t sm, Char_t status)     { fSMstatus[sm] = status; };
 
   virtual Bool_t   IsHole(Int_t /*iplan*/, Int_t /*icham*/, Int_t /*isect*/) const { return kFALSE; };
@@ -85,8 +87,6 @@ class AliTRDgeometry : public AliGeometry {
   virtual Int_t    GetChamber(Int_t d) const;
   virtual Int_t    GetSector(Int_t d)  const;
 
-  //Char_t   GetSMstatus(Int_t sm) const              { sm += 5; if (sm > 17) sm -= 18;
-  //                                                          return fSMstatus[sm];  };
           Char_t   GetSMstatus(Int_t sm) const              { return fSMstatus[sm];  };
           Float_t  GetChamberWidth(Int_t p) const           { return fCwidth[p];     };
           Float_t  GetChamberLength(Int_t p, Int_t c) const { return fClength[p][c]; }; 
@@ -102,105 +102,104 @@ class AliTRDgeometry : public AliGeometry {
 
  protected:
  
-  static const Int_t   fgkNsect;                            // Number of sectors in the full detector (18)
-  static const Int_t   fgkNplan;                            // Number of planes of the TRD (6)
-  static const Int_t   fgkNcham;                            // Number of chambers in z-direction (5)
-  static const Int_t   fgkNdet;                             // Total number of detectors (18 * 6 * 5 = 540)
-
-  static const Float_t fgkRmin;                             // Minimal radius of the TRD
-  static const Float_t fgkRmax;                             // Maximal radius of the TRD
-
-  static const Float_t fgkZmax1;                            // Half-length of the TRD at outer radius
-  static const Float_t fgkZmax2;                            // Half-length of the TRD at inner radius
-
-  static const Float_t fgkSheight;                          // Height of the TRD-volume in spaceframe (BTR1-3)
-  static const Float_t fgkSwidth1;                          // Lower width of the TRD-volume in spaceframe (BTR1-3)
-  static const Float_t fgkSwidth2;                          // Upper width of the TRD-volume in spaceframe (BTR1-3)
-  static const Float_t fgkSlenTR1;                          // Length of the TRD-volume in spaceframe (BTR1)
-  static const Float_t fgkSlenTR2;                          // Length of the TRD-volume in spaceframe (BTR2)
-  static const Float_t fgkSlenTR3;                          // Length of the TRD-volume in spaceframe (BTR3)
-
-  static const Float_t fgkSMpltT;                           // Thickness of the super module side plates
-  //static const Float_t fgkSMgapT;                           // Thickness of the gap between side plates and space frame
-
-  static const Float_t fgkCraH;                             // Height of the radiator part of the chambers
-  static const Float_t fgkCdrH;                             // Height of the drift region of the chambers
-  static const Float_t fgkCamH;                             // Height of the amplification region of the chambers
-  static const Float_t fgkCroH;                             // Height of the readout of the chambers
-  static const Float_t fgkCH;                               // Total height of the chambers
-
-  static const Float_t fgkVspace;                           // Vertical spacing of the chambers
-  static const Float_t fgkHspace;                           // Horizontal spacing of the chambers
-  static const Float_t fgkVrocsm;                           // Radial distance of the first ROC to the outer plates of the SM
-  static const Float_t fgkCalT;                             // Thickness of the lower aluminum frame
-  static const Float_t fgkCclsT;                            // Thickness of the lower G10 frame sides
-  static const Float_t fgkCclfT;                            // Thickness of the lower G10 frame front
-  static const Float_t fgkCcuT;                             // Thickness of the upper G10 frame
-  static const Float_t fgkCauT;                             // Thickness of the upper aluminum frame
-
-  static const Float_t fgkCroW;                             // Additional width of the readout chamber frames
-
-  static const Float_t fgkCpadW;                            // Difference of outer chamber width and pad plane width
-  static const Float_t fgkRpadW;                            // Difference of outer chamber width and pad plane width
-
-  static const Float_t fgkRaThick;                          // Thickness of the radiator
-  static const Float_t fgkMyThick;                          // Thickness of the mylar-layer
-  static const Float_t fgkXeThick;                          // Thickness of the gas volume
-  static const Float_t fgkDrThick;                          // Thickness of the drift region
-  static const Float_t fgkAmThick;                          // Thickness of the amplification region
-  static const Float_t fgkCuThick;                          // Thickness of the pad plane
-  static const Float_t fgkSuThick;                          // Thickness of the HEXCEL+G10 support structure
-  static const Float_t fgkFeThick;                          // Thickness of the FEE + signal lines
-  static const Float_t fgkCoThick;                          // Thickness of the PE of the cooling device
-  static const Float_t fgkWaThick;                          // Thickness of the cooling water
-  static const Float_t fgkRpThick;                          // Thickness of the PCB readout boards
-  static const Float_t fgkRcThick;                          // Thickness of the PCB copper layers
-
-  static const Float_t fgkRaZpos;                           // Position of the radiator
-  static const Float_t fgkMyZpos;                           // Position of the mylar-layer
-  static const Float_t fgkDrZpos;                           // Position of the drift region
-  static const Float_t fgkAmZpos;                           // Position of the amplification region
-  static const Float_t fgkCuZpos;                           // Position of the pad plane
-  static const Float_t fgkSuZpos;                           // Position of the HEXCEL+G10 support structure
-  static const Float_t fgkFeZpos;                           // Position of the FEE + signal lines
-  static const Float_t fgkCoZpos;                           // Position of the PE of the cooling device
-  static const Float_t fgkWaZpos;                           // Position of the cooling water
-  static const Float_t fgkRpZpos;                           // Position of the PCB readout boards
-  static const Float_t fgkRcZpos;                           // Position of the PCB copper layers
-
-  Char_t               fSMstatus[kNsect];                   // Super module status byte
-
-  Float_t              fCwidth[kNplan];                     // Outer widths of the chambers
-  Float_t              fClength[kNplan][kNcham];            // Outer lengths of the chambers
-
-  Float_t              fRotA11[kNsect];                     // Matrix elements for the rotation
-  Float_t              fRotA12[kNsect];                     // Matrix elements for the rotation
-  Float_t              fRotA21[kNsect];                     // Matrix elements for the rotation
-  Float_t              fRotA22[kNsect];                     // Matrix elements for the rotation
-
-  Float_t              fRotB11[kNsect];                     // Matrix elements for the backward rotation
-  Float_t              fRotB12[kNsect];                     // Matrix elements for the backward rotation
-  Float_t              fRotB21[kNsect];                     // Matrix elements for the backward rotation
-  Float_t              fRotB22[kNsect];                     // Matrix elements for the backward rotation
-
-  static const Double_t fgkTime0Base;                       // Base value for calculation of Time-position of pad 0
-  static const Float_t  fgkTime0[kNplan];                   // Time-position of pad 0
+  static const Int_t    fgkNsect;                            // Number of sectors in the full detector (18)
+  static const Int_t    fgkNplan;                            // Number of planes of the TRD (6)
+  static const Int_t    fgkNcham;                            // Number of chambers in z-direction (5)
+  static const Int_t    fgkNdet;                             // Total number of detectors (18 * 6 * 5 = 540)
+
+  static const Float_t  fgkRmin;                             // Minimal radius of the TRD
+  static const Float_t  fgkRmax;                             // Maximal radius of the TRD
+
+  static const Float_t  fgkZmax1;                            // Half-length of the TRD at outer radius
+  static const Float_t  fgkZmax2;                            // Half-length of the TRD at inner radius
+
+  static const Float_t  fgkSheight;                          // Height of the TRD-volume in spaceframe (BTR1-3)
+  static const Float_t  fgkSwidth1;                          // Lower width of the TRD-volume in spaceframe (BTR1-3)
+  static const Float_t  fgkSwidth2;                          // Upper width of the TRD-volume in spaceframe (BTR1-3)
+  static const Float_t  fgkSlenTR1;                          // Length of the TRD-volume in spaceframe (BTR1)
+  static const Float_t  fgkSlenTR2;                          // Length of the TRD-volume in spaceframe (BTR2)
+  static const Float_t  fgkSlenTR3;                          // Length of the TRD-volume in spaceframe (BTR3)
+
+  static const Float_t  fgkSMpltT;                           // Thickness of the super module side plates
+
+  static const Float_t  fgkCraH;                             // Height of the radiator part of the chambers
+  static const Float_t  fgkCdrH;                             // Height of the drift region of the chambers
+  static const Float_t  fgkCamH;                             // Height of the amplification region of the chambers
+  static const Float_t  fgkCroH;                             // Height of the readout of the chambers
+  static const Float_t  fgkCH;                               // Total height of the chambers
+
+  static const Float_t  fgkVspace;                           // Vertical spacing of the chambers
+  static const Float_t  fgkHspace;                           // Horizontal spacing of the chambers
+  static const Float_t  fgkVrocsm;                           // Radial distance of the first ROC to the outer plates of the SM
+  static const Float_t  fgkCalT;                             // Thickness of the lower aluminum frame
+  static const Float_t  fgkCclsT;                            // Thickness of the lower G10 frame sides
+  static const Float_t  fgkCclfT;                            // Thickness of the lower G10 frame front
+  static const Float_t  fgkCcuT;                             // Thickness of the upper G10 frame
+  static const Float_t  fgkCauT;                             // Thickness of the upper aluminum frame
+
+  static const Float_t  fgkCroW;                             // Additional width of the readout chamber frames
+
+  static const Float_t  fgkCpadW;                            // Difference of outer chamber width and pad plane width
+  static const Float_t  fgkRpadW;                            // Difference of outer chamber width and pad plane width
+
+  static const Float_t  fgkRaThick;                          // Thickness of the radiator
+  static const Float_t  fgkMyThick;                          // Thickness of the mylar-layer
+  static const Float_t  fgkXeThick;                          // Thickness of the gas volume
+  static const Float_t  fgkDrThick;                          // Thickness of the drift region
+  static const Float_t  fgkAmThick;                          // Thickness of the amplification region
+  static const Float_t  fgkCuThick;                          // Thickness of the pad plane
+  static const Float_t  fgkSuThick;                          // Thickness of the HEXCEL+G10 support structure
+  static const Float_t  fgkFeThick;                          // Thickness of the FEE + signal lines
+  static const Float_t  fgkCoThick;                          // Thickness of the PE of the cooling device
+  static const Float_t  fgkWaThick;                          // Thickness of the cooling water
+  static const Float_t  fgkRpThick;                          // Thickness of the PCB readout boards
+  static const Float_t  fgkRcThick;                          // Thickness of the PCB copper layers
+
+  static const Float_t  fgkRaZpos;                           // Position of the radiator
+  static const Float_t  fgkMyZpos;                           // Position of the mylar-layer
+  static const Float_t  fgkDrZpos;                           // Position of the drift region
+  static const Float_t  fgkAmZpos;                           // Position of the amplification region
+  static const Float_t  fgkCuZpos;                           // Position of the pad plane
+  static const Float_t  fgkSuZpos;                           // Position of the HEXCEL+G10 support structure
+  static const Float_t  fgkFeZpos;                           // Position of the FEE + signal lines
+  static const Float_t  fgkCoZpos;                           // Position of the PE of the cooling device
+  static const Float_t  fgkWaZpos;                           // Position of the cooling water
+  static const Float_t  fgkRpZpos;                           // Position of the PCB readout boards
+  static const Float_t  fgkRcZpos;                           // Position of the PCB copper layers
+
+  Char_t                fSMstatus[kNsect];                   // Super module status byte
+
+  Float_t               fCwidth[kNplan];                     // Outer widths of the chambers
+  Float_t               fClength[kNplan][kNcham];            // Outer lengths of the chambers
+
+  Float_t               fRotA11[kNsect];                     // Matrix elements for the rotation
+  Float_t               fRotA12[kNsect];                     // Matrix elements for the rotation
+  Float_t               fRotA21[kNsect];                     // Matrix elements for the rotation
+  Float_t               fRotA22[kNsect];                     // Matrix elements for the rotation
+
+  Float_t               fRotB11[kNsect];                     // Matrix elements for the backward rotation
+  Float_t               fRotB12[kNsect];                     // Matrix elements for the backward rotation
+  Float_t               fRotB21[kNsect];                     // Matrix elements for the backward rotation
+  Float_t               fRotB22[kNsect];                     // Matrix elements for the backward rotation
+
+  static const Double_t fgkTime0Base;                        // Base value for calculation of Time-position of pad 0
+  static const Float_t  fgkTime0[kNplan];                    // Time-position of pad 0
   
-  Float_t              fChamberUAorig[3*kNdets][3];         // Volumes origin in
-  Float_t              fChamberUDorig[3*kNdets][3];         // the chamber
-  Float_t              fChamberUForig[3*kNdets][3];         // [3] = x, y, z
-  Float_t              fChamberUUorig[3*kNdets][3];         //
+  Float_t               fChamberUAorig[3*kNdets][3];         // Volumes origin in
+  Float_t               fChamberUDorig[3*kNdets][3];         // the chamber
+  Float_t               fChamberUForig[3*kNdets][3];         // [3] = x, y, z
+  Float_t               fChamberUUorig[3*kNdets][3];         //
 
-  Float_t              fChamberUAboxd[3*kNdets][3];         // Volumes box
-  Float_t              fChamberUDboxd[3*kNdets][3];         // dimensions (half)
-  Float_t              fChamberUFboxd[3*kNdets][3];         // [3] = x, y, z
-  Float_t              fChamberUUboxd[3*kNdets][3];         // 
+  Float_t               fChamberUAboxd[3*kNdets][3];         // Volumes box
+  Float_t               fChamberUDboxd[3*kNdets][3];         // dimensions (half)
+  Float_t               fChamberUFboxd[3*kNdets][3];         // [3] = x, y, z
+  Float_t               fChamberUUboxd[3*kNdets][3];         // 
 
-  TObjArray *          fMatrixArray;                        //! array of matrix - Transformation Global to Local
-  TObjArray *          fMatrixCorrectionArray;              //! array of Matrix - Transformation Cluster to  Tracking systerm
-  TObjArray *          fMatrixGeo;                          //! geo matrices
+  TObjArray *           fMatrixArray;                        //! array of matrix - Transformation Global to Local
+  TObjArray *           fMatrixCorrectionArray;              //! array of Matrix - Transformation Cluster to  Tracking systerm
+  TObjArray *           fMatrixGeo;                          //! geo matrices
 
-  ClassDef(AliTRDgeometry,10)                               // TRD geometry class
+  ClassDef(AliTRDgeometry,10)                                // TRD geometry class
 
 };
 
index c59046a30f4f82209d76acdb17070f35a3db99ee..8d9c7e78900beca9c25124f9d9f74bb3dfa27afa 100644 (file)
 ClassImp(AliTRDpadPlane)
 
 //_____________________________________________________________________________
-AliTRDpadPlane::AliTRDpadPlane():TObject()
+AliTRDpadPlane::AliTRDpadPlane()
+  :TObject()
+  ,fGeo(0)
+  ,fPla(0)
+  ,fCha(0)
+  ,fLength(0)
+  ,fWidth(0)
+  ,fLengthRim(0)
+  ,fWidthRim(0)
+  ,fLengthOPad(0)
+  ,fWidthOPad(0)
+  ,fLengthIPad(0)
+  ,fWidthIPad(0)
+  ,fRowSpacing(0)
+  ,fColSpacing(0)
+  ,fNrows(0)
+  ,fNcols(0)
+  ,fTiltingAngle(0)
+  ,fTiltingTan(0)
+  ,fPadRow(0)
+  ,fPadCol(0)
 {
   //
   // Default constructor
   //
 
-  fGeo          = 0;
-
-  fPla          = 0;
-  fCha          = 0;
-
-  fLength       = 0.0;
-  fWidth        = 0.0;
-  fLengthRim    = 0.0;
-  fWidthRim     = 0.0;
-  fLengthOPad   = 0.0;
-  fWidthOPad    = 0.0;
-  fLengthIPad   = 0.0;
-  fWidthIPad    = 0.0;
-
-  fRowSpacing   = 0.0;
-  fColSpacing   = 0.0;
-
-  fNrows        = 0;
-  fNcols        = 0;
-
-  fPadRow       = 0;
-  fPadCol       = 0;
-
-  fTiltingAngle = 0.0;
-  fTiltingTan   = 0.0;
-
 }
 
 //_____________________________________________________________________________
-AliTRDpadPlane::AliTRDpadPlane(Int_t p, Int_t c):TObject(),fPadRow(0),fPadCol(0)
+AliTRDpadPlane::AliTRDpadPlane(Int_t p, Int_t c)
+  :TObject()
+  ,fGeo(0)
+  ,fPla(0)
+  ,fCha(0)
+  ,fLength(0)
+  ,fWidth(0)
+  ,fLengthRim(0)
+  ,fWidthRim(0)
+  ,fLengthOPad(0)
+  ,fWidthOPad(0)
+  ,fLengthIPad(0)
+  ,fWidthIPad(0)
+  ,fRowSpacing(0)
+  ,fColSpacing(0)
+  ,fNrows(0)
+  ,fNcols(0)
+  ,fTiltingAngle(0)
+  ,fTiltingTan(0)
+  ,fPadRow(0)
+  ,fPadCol(0)
 {
   //
   // Constructor that initializes a given pad plane type
@@ -286,13 +300,45 @@ AliTRDpadPlane::AliTRDpadPlane(Int_t p, Int_t c):TObject(),fPadRow(0),fPadCol(0)
 }
 
 //_____________________________________________________________________________
-AliTRDpadPlane::AliTRDpadPlane(const AliTRDpadPlane &p):TObject(p)
+AliTRDpadPlane::AliTRDpadPlane(const AliTRDpadPlane &p)
+  :TObject(p)
+  ,fGeo(0)
+  ,fPla(p.fPla)
+  ,fCha(p.fCha)
+  ,fLength(p.fLength)
+  ,fWidth(p.fWidth)
+  ,fLengthRim(p.fLengthRim)
+  ,fWidthRim(p.fLengthRim)
+  ,fLengthOPad(p.fLengthOPad)
+  ,fWidthOPad(p.fWidthOPad)
+  ,fLengthIPad(p.fLengthIPad)
+  ,fWidthIPad(p.fWidthIPad)
+  ,fRowSpacing(p.fRowSpacing)
+  ,fColSpacing(p.fColSpacing)
+  ,fNrows(p.fNrows)
+  ,fNcols(p.fNcols)
+  ,fTiltingAngle(p.fTiltingAngle)
+  ,fTiltingTan(p.fTiltingTan)
+  ,fPadRow(0)
+  ,fPadCol(0)
 {
   //
   // AliTRDpadPlane copy constructor
   //
 
-  ((AliTRDpadPlane &) p).Copy(*this);
+  Int_t iBin = 0;
+
+  if (((AliTRDpadPlane &) p).fPadRow) delete [] ((AliTRDpadPlane &) p).fPadRow;
+  ((AliTRDpadPlane &) p).fPadRow = new Double_t[fNrows];
+  for (iBin = 0; iBin < fNrows; iBin++) {
+    ((AliTRDpadPlane &) p).fPadRow[iBin] = fPadRow[iBin];
+  }                                                                             
+
+  if (((AliTRDpadPlane &) p).fPadCol) delete [] ((AliTRDpadPlane &) p).fPadCol;
+  ((AliTRDpadPlane &) p).fPadCol = new Double_t[fNrows];
+  for (iBin = 0; iBin < fNrows; iBin++) {
+    ((AliTRDpadPlane &) p).fPadCol[iBin] = fPadCol[iBin];
+  }                                                                             
 
 }
 
@@ -417,7 +463,7 @@ Int_t AliTRDpadPlane::GetPadRowNumber(Double_t z) const
 
 //_____________________________________________________________________________
 Int_t AliTRDpadPlane::GetPadColNumber(Double_t rphi
-                                     , Double_t /*rowOffset*/) const
+                                    , Double_t /*rowOffset*/) const
 {
   //
   // Finds the pad column number for a given global rphi-position
@@ -434,7 +480,6 @@ Int_t AliTRDpadPlane::GetPadColNumber(Double_t rphi
   // into the opposite direction
   // 
 
-
   rphiShift = rphi ;
 
   if ((rphiShift > GetCol0()) || (rphiShift < GetColEnd())) {
index 662bc53b348a40901b2452e5f362efe0975d5d03..2e34ebb1318d7b07de11b1f0cddcecffb0ca5282 100644 (file)
 
 #include <Riostream.h>
 
+#include "AliDAQ.h"
+#include "AliRawDataHeader.h"
+#include "AliRawReader.h"
+#include "AliLog.h"
+
 #include "AliTRDrawData.h"
 #include "AliTRDdigitsManager.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDdataArrayI.h"
 #include "AliTRDRawStream.h"
-#include "AliRawDataHeader.h"
-#include "AliRawReader.h"
 #include "AliTRDCommonParam.h"
 #include "AliTRDcalibDB.h"
-#include "AliDAQ.h"
 
 ClassImp(AliTRDrawData)
 
@@ -43,19 +45,6 @@ AliTRDrawData::AliTRDrawData():TObject()
   // Default constructor
   //
 
-  fDebug         = 0;
-
-}
-
-//_____________________________________________________________________________
-AliTRDrawData::AliTRDrawData(const AliTRDrawData &r):TObject()
-{
-  //
-  // AliTRDrawData copy constructor
-  //
-
-  ((AliTRDrawData &) r).Copy(*this);
-
 }
 
 //_____________________________________________________________________________
@@ -67,29 +56,6 @@ AliTRDrawData::~AliTRDrawData()
 
 }
 
-//_____________________________________________________________________________
-AliTRDrawData &AliTRDrawData::operator=(const AliTRDrawData &r)
-{
-  //
-  // Assignment operator
-  //
-
-  if (this != &r) ((AliTRDrawData &) r).Copy(*this);
-  return *this;
-
-}
-
-//_____________________________________________________________________________
-void AliTRDrawData::Copy(TObject &r) const
-{
-  //
-  // Copy function
-  //
-
-  ((AliTRDrawData &) r).fDebug         = fDebug;
-
-}
-
 //_____________________________________________________________________________
 Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree)
 {
@@ -125,7 +91,6 @@ Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree)
   unsigned char *headerPtr;
 
   AliTRDdigitsManager* digitsManager = new AliTRDdigitsManager();
-  digitsManager->SetDebug(fDebug);
 
   // Read in the digit arrays
   if (!digitsManager->ReadDigits(digitsTree)) {
@@ -137,18 +102,15 @@ Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree)
   AliTRDdataArrayI *digits;
 
   AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam)
-  {
-    printf("<AliTRDrawData::Digits2Raw> ");
-    printf("Could not get common params\n");
+  if (!commonParam) {
+    AliError("Could not get common parameters\n");
     return 0;
   }
   
   AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
   if (!calibration)
   {
-    printf("<AliTRDdigitizer::Digits2Raw> ");
-    printf("Could not get calibration object\n");
+    AliError("Could not get calibration object\n");
     return kFALSE;
   }
     
@@ -260,9 +222,7 @@ Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree)
       nbyte++;
     }
 
-    if (fDebug > 1) {
-      Info("Digits2Raw","det = %d, nbyte = %d (%d)",det,nbyte,bufferMax);
-    }
+    AliDebug(1,Form("det = %d, nbyte = %d (%d)",det,nbyte,bufferMax));
 
     // Write the subevent header
     bytePtr    = (unsigned char *) headerSubevent;
@@ -287,14 +247,9 @@ Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree)
 
   }
 
-  if (fDebug) {
-    for (Int_t iDDL = 0; iDDL < kNumberOfDDLs; iDDL++) {
-      Info("Digits2Raw","Total size: DDL %d = %d",iDDL,ntotalbyte[iDDL]);
-    }
-  }
-
   // Update the data headers and close the output files
   for (Int_t iDDL = 0; iDDL < kNumberOfDDLs; iDDL++) {
+
     header.fSize = UInt_t(outputFile[iDDL]->tellp()) - bHPosition[iDDL];
     header.SetAttribute(0);  // valid data
     outputFile[iDDL]->seekp(bHPosition[iDDL]);
@@ -302,6 +257,7 @@ Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree)
 
     outputFile[iDDL]->close();
     delete outputFile[iDDL];
+
   }
 
   delete geo;
@@ -311,9 +267,6 @@ Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree)
   delete [] bHPosition;
   delete [] ntotalbyte;
 
-
-
-
   return kTRUE;
 
 }
@@ -333,24 +286,19 @@ AliTRDdigitsManager* AliTRDrawData::Raw2Digits(AliRawReader* rawReader)
   AliTRDgeometry *geo = new AliTRDgeometry();
 
   AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
-  if (!commonParam)
-  {
-    printf("<AliTRDrawData::Raw2Digits> ");
-    printf("Could not get common params\n");
+  if (!commonParam) {
+    AliError("Could not get common parameters\n");
     return 0;
   }
     
   AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
-  if (!calibration)
-  {
-    printf("<AliTRDdigitizer::Raw2Digits> ");
-    printf("Could not get calibration object\n");
+  if (!calibration) {
+    AliError("Could not get calibration object\n");
     return 0;
   }
 
   // Create the digits manager
   AliTRDdigitsManager* digitsManager = new AliTRDdigitsManager();
-  digitsManager->SetDebug(fDebug);
   digitsManager->CreateArrays();
 
   AliTRDRawStream input(rawReader);
@@ -368,11 +316,9 @@ AliTRDdigitsManager* AliTRDrawData::Raw2Digits(AliRawReader* rawReader)
       if (track1) track1->Compress(1,0);
       if (track2) track2->Compress(1,0);
 
-      if (fDebug > 2) {
-       Info("Raw2Digits","Subevent header:");
-       Info("Raw2Digits","\tdet   = %d",det);
-       Info("Raw2Digits","\tnpads = %d",npads);
-      }      
+      AliDebug(2,"Subevent header:");
+      AliDebug(2,Form("\tdet   = %d",det));
+      AliDebug(2,Form("\tnpads = %d",npads));
 
       // Create the data buffer
       Int_t cham      = geo->GetChamber(det);
index 38d36b3d3712050400dc4d70391b3189a6f44413..d23522aa5bdf2dc6d43cace216e19ab399a613eb 100644 (file)
@@ -22,21 +22,14 @@ class AliTRDrawData : public TObject {
  public:
 
   AliTRDrawData();
-  AliTRDrawData(const AliTRDrawData &r);
   virtual ~AliTRDrawData();
-  AliTRDrawData &operator=(const AliTRDrawData &r);
-
-  virtual void                 Copy(TObject &r) const;
 
   virtual Bool_t               Digits2Raw(TTree *digits);
   virtual AliTRDdigitsManager* Raw2Digits(AliRawReader* rawReader);
-  virtual void                 SetDebug(Int_t v = 1) { fDebug = v; };
 
  protected:
 
-  Int_t                fDebug;          //  Debug level
-
-  ClassDef(AliTRDrawData,1)             //  TRD raw data class
+  ClassDef(AliTRDrawData,2)             //  TRD raw data class
 
 };
 #endif
index 1d488668e73735f397afdfe001a6fc21b4ab98c9..ca3095408d3cfd2477ad3abcebcc31451f7ce55a 100644 (file)
@@ -21,7 +21,6 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "AliTRDsegmentArrayBase.h"
 #include <TROOT.h>
 #include <TTree.h>
 #include <TClonesArray.h>
 #include <TError.h>
 #include <TClass.h>
 
+#include "AliLog.h"
+
+#include "AliTRDsegmentArrayBase.h"
 #include "AliTRDarrayI.h"
 #include "AliTRDsegmentID.h"
 
 ClassImp(AliTRDsegmentArrayBase)
   
 //_____________________________________________________________________________
-AliTRDsegmentArrayBase::AliTRDsegmentArrayBase():TNamed()
+AliTRDsegmentArrayBase::AliTRDsegmentArrayBase()
+  :TNamed()
+  ,fSegment(0) 
+  ,fTreeIndex(0)
+  ,fNSegment(0)
+  ,fTree(0)
+  ,fBranch(0)
+  ,fClass(0)
 {
   //
   // AliTRDsegmentArrayBase default constructor
   //
 
-  fNSegment  = 0;
-  fSegment   = 0; 
-  fTreeIndex = 0;
-  fTree      = 0;
-  fClass     = 0;
-  fBranch    = 0;
-
 }
 
 //_____________________________________________________________________________
 AliTRDsegmentArrayBase::AliTRDsegmentArrayBase(const char *classname, Int_t n)
+  :TNamed()
+  ,fSegment(0) 
+  ,fTreeIndex(0)
+  ,fNSegment(0)
+  ,fTree(0)
+  ,fBranch(0)
+  ,fClass(0)
 {
   //
   //  Create an array of objects of <classname>. The class must inherit from
@@ -59,13 +68,6 @@ AliTRDsegmentArrayBase::AliTRDsegmentArrayBase(const char *classname, Int_t n)
   //  the array.
   //
 
-  fNSegment  = 0;
-  fSegment   = 0; 
-  fTreeIndex = 0;
-  fTree      = 0;
-  fClass     = 0;
-  fBranch    = 0;
-
   SetClass(classname);
 
   if (MakeArray(n) == kFALSE) {
@@ -77,13 +79,17 @@ AliTRDsegmentArrayBase::AliTRDsegmentArrayBase(const char *classname, Int_t n)
 
 //_____________________________________________________________________________
 AliTRDsegmentArrayBase::AliTRDsegmentArrayBase(const AliTRDsegmentArrayBase &a)
-:TNamed(a)
+  :TNamed(a)
+  ,fSegment(a.fSegment) 
+  ,fTreeIndex(a.fTreeIndex)
+  ,fNSegment(a.fNSegment)
+  ,fTree(a.fTree)
+  ,fBranch(a.fBranch)
+  ,fClass(a.fClass)
 {
   //
   // AliTRDsegmentArrayBase copy constructor
   //
-  
-  ((AliTRDsegmentArrayBase &) a).Copy(*this);
 
 }
 
@@ -94,13 +100,14 @@ AliTRDsegmentArrayBase::~AliTRDsegmentArrayBase()
   // AliTRDsegmentArrayBase destructor
   //
 
-  if (fNSegment){
+  if (fNSegment) {
     fSegment->Delete();
     delete fSegment;
   }
 
-  //if (fTree)      delete fTree;
-  if (fTreeIndex) delete fTreeIndex;
+  if (fTreeIndex) {
+    delete fTreeIndex;
+  }
 
 }
 
@@ -154,21 +161,22 @@ Bool_t AliTRDsegmentArrayBase::SetClass(const char *classname)
     fSegment   = 0;
   }
 
-  if (!gROOT) ::Fatal("AliTRDsegmentArrayBase::AliTRDsegmentArrayBase"
-                     ,"ROOT system not initialized");
-   
-   fClass = gROOT->GetClass(classname);
-   if (!fClass) {
-     Error("AliTRDsegmentArrayBase","%s is not a valid class name",classname);
-     return kFALSE;
-   }
-   if (!fClass->InheritsFrom(AliTRDsegmentID::Class())) {
-     Error("AliTRDsegmentArrayBase"
-          ,"%s does not inherit from AliTRDsegmentID",classname);
-     return kFALSE;
-   }
+  if (!gROOT) {
+    AliFatal("ROOT system not initialized");
+    exit(1);
+  }   
+
+  fClass = gROOT->GetClass(classname);
+  if (!fClass) {
+    AliError(Form("%s is not a valid class name",classname));
+    return kFALSE;
+  }
+  if (!fClass->InheritsFrom(AliTRDsegmentID::Class())) {
+    AliError(Form("%s does not inherit from AliTRDsegmentID",classname));
+    return kFALSE;
+  }
   
-   return kTRUE;
+  return kTRUE;
 
 }
 
@@ -182,9 +190,13 @@ AliTRDsegmentID *AliTRDsegmentArrayBase::NewSegment()
   if (fClass  == 0) return 0;
 
   AliTRDsegmentID *segment = (AliTRDsegmentID *) fClass->New();
-  if (segment == 0) return 0;
 
-  return segment;
+  if (segment == 0) {
+    return 0;
+  }
+  else {
+    return segment;
+  }
 
 }
 
@@ -200,8 +212,8 @@ Bool_t AliTRDsegmentArrayBase::AddSegment(AliTRDsegmentID *segment)
   if (fClass   == 0) return kFALSE;
 
   if (!(segment->IsA()->InheritsFrom(fClass))) {
-    Error("AliTRDsegmentArrayBase","added class %s is not of proper type",
-         segment->IsA()->GetName());
+    AliError(Form("added class %s is not of proper type"
+                 ,segment->IsA()->GetName()));
     return kFALSE;
   }
 
@@ -250,10 +262,12 @@ Bool_t AliTRDsegmentArrayBase::MakeArray(Int_t n)
   fTreeIndex = new AliTRDarrayI();
   fTreeIndex->Set(n);
   fNSegment  = n;
-  if ((fSegment) && (fTreeIndex)) 
+  if ((fSegment) && (fTreeIndex)) {
     return kTRUE;
-  else 
+  }
+  else { 
     return kFALSE;
+  }
                  
 }
 
@@ -264,11 +278,7 @@ void AliTRDsegmentArrayBase::ClearSegment(Int_t index)
   // Remove a segment from the active memory    
   //
 
-  //PH  if ((*fSegment)[index]){
-  //PH    delete (*fSegment)[index]; // because problem with deleting TClonesArray
-  //PH    fSegment->RemoveAt(index);
-  //PH  }
-  if (fSegment->At(index)){
+  if (fSegment->At(index)) {
     delete fSegment->RemoveAt(index);
   }
 
@@ -287,8 +297,9 @@ void AliTRDsegmentArrayBase::MakeTree(char *file)
   fTree   = new TTree("Segment Tree","Tree with segments");
 
   fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000);
-  if (file) 
-      fBranch->SetFile(file);      
+  if (file) {
+    fBranch->SetFile(file);      
+  }
 
   delete psegment;
 
@@ -301,7 +312,7 @@ Bool_t AliTRDsegmentArrayBase::ConnectTree(const char * treeName)
   // Connect a tree from current directory  
   //
 
-  if (fTree){
+  if (fTree) {
     delete fTree;
     fTree   = 0;
     fBranch = 0;
@@ -331,24 +342,26 @@ AliTRDsegmentID *AliTRDsegmentArrayBase::LoadSegment(Int_t index)
   if (fTreeIndex == 0)        return 0;
   if (fBranch    == 0)        return 0;
   if (index > fTreeIndex->fN) return 0;
-  //PH  AliTRDsegmentID *s = (AliTRDsegmentID*) (*fSegment)[index];
+
   AliTRDsegmentID *s = (AliTRDsegmentID*) fSegment->At(index);
   if (s == 0) s = NewSegment();
   s->SetID(index);
   
   if (s != 0) {
     Int_t treeIndex = (*fTreeIndex)[index];
-    if (treeIndex < 1) 
+    if (treeIndex < 1) {
       return 0;
-    else 
-      treeIndex--;   
+    }
+    else { 
+      treeIndex--;
+    }   
     fBranch->SetAddress(&s);
     fTree->GetEvent(treeIndex);
-    //PH    (*fSegment)[index] = (TObject*) s;
     fSegment->AddAt((TObject*) s, index);
   }
-  else 
+  else 
     return 0;
+  }
 
   return s;
 
@@ -369,12 +382,12 @@ AliTRDsegmentID *AliTRDsegmentArrayBase::LoadEntry(Int_t index)
     fBranch->SetAddress(&s);
     fTree->GetEvent(index);
   }
-  else 
+  else {
     return 0;
+  }
 
   Int_t nindex = s->GetID();
   ClearSegment(nindex);
-  //PH  (*fSegment)[nindex] = (TObject *) s;
   fSegment->AddAt((TObject *) s, nindex);
 
   return s;
@@ -448,7 +461,6 @@ const AliTRDsegmentID *AliTRDsegmentArrayBase::At(Int_t i) const
   //
 
   if ((i < 0) || (i >= fNSegment)) return 0; 
-  //PH  return (AliTRDsegmentID *)((*fSegment)[i]);
   return (AliTRDsegmentID *) fSegment->At(i);
 
 }
index 7ea941f37b479db2bf600576682c85751577a9e8..7e97a3b33740546c878ad298225c8f770a933f8d 100644 (file)
 ClassImp(AliTRDsegmentID)
 
 //_____________________________________________________________________________
-AliTRDsegmentID::AliTRDsegmentID():TObject()
+AliTRDsegmentID::AliTRDsegmentID()
+                :fSegmentID(0)
 {
   //
   // AliTRDsegmentID default constructor
   //
 
-  fSegmentID = 0;
-
 }
 
 //_____________________________________________________________________________
-AliTRDsegmentID::AliTRDsegmentID(Int_t index):TObject()
+AliTRDsegmentID::AliTRDsegmentID(Int_t index)
+                :fSegmentID(index)
 {
   //
   // Defines a detector segment
   //
 
-  fSegmentID = index;
-
 }
 
 //_____________________________________________________________________________
index 33777901c057b85c59471facc1242414947ba580..1248da7c81c1893920ea830dccbd390db86870c7 100644 (file)
@@ -286,7 +286,6 @@ Bool_t AliTRDtrigger::ReadDigits(AliRawReader* rawReader)
   //
 
   AliTRDrawData *raw = new AliTRDrawData();
-  raw->SetDebug(1);
 
   fDigitsManager = raw->Raw2Digits(rawReader);
 
index 805306091b808553c00660d8e02fe4921d2d64c0..bf9192116c94a11b225c47a0ea75d016a97e9504 100644 (file)
@@ -26,7 +26,8 @@
 ClassImp(AliTRDCalChamberStatus)
 
 //_____________________________________________________________________________
-AliTRDCalChamberStatus::AliTRDCalChamberStatus():TNamed()
+AliTRDCalChamberStatus::AliTRDCalChamberStatus()
+  :TNamed()
 {
   //
   // AliTRDCalChamberStatus default constructor
@@ -35,11 +36,12 @@ AliTRDCalChamberStatus::AliTRDCalChamberStatus():TNamed()
   for (Int_t idet = 0; idet < kNdet; idet++) {
     fStatus[idet] = 0;
   }
+
 }
 
 //_____________________________________________________________________________
 AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t *title)
-                :TNamed(name,title)
+  :TNamed(name,title)
 {
   //
   // AliTRDCalChamberStatus constructor
@@ -48,5 +50,6 @@ AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t
   for (Int_t idet = 0; idet < kNdet; idet++) {
     fStatus[idet] = 0;
   }
+
 }
 
index 1974bb8211cdcc6c7477c7c82aab1d8c06a7db79..2ac1cdae9d2bf158e3a21b0bf94b01442d36fc52 100644 (file)
@@ -7,30 +7,34 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  TRD calibration class for status of supermodules                         //
+//  TRD calibration class for the status of a readout chamber                //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "TNamed.h"
 
 class AliTRDCalChamberStatus : public TNamed {
-  public:
-    enum { kNdet = 540, kNstacks = 90, kNcham = 5, kNsect = 18 };
-    enum { kInstalled = 1, kMasked = 2 };
+
+ public:
+
+  enum { kNdet = 540, kNstacks = 90, kNcham = 5, kNsect = 18 };
+  enum { kInstalled = 1, kMasked = 2 };
   
-    AliTRDCalChamberStatus();
-    AliTRDCalChamberStatus(const Text_t* name, const Text_t* title);
+  AliTRDCalChamberStatus();
+  AliTRDCalChamberStatus(const Text_t* name, const Text_t* title);
+
+  Char_t GetStatus(Int_t det) const          { return fStatus[det];   };
+  void   SetStatus(Int_t det, Char_t status) { fStatus[det] = status; };
+
+  Bool_t IsInstalled(Int_t sm) const         { return (GetStatus(sm) & kInstalled) ? kTRUE : kFALSE; }
+  Bool_t IsMasked(Int_t sm) const            { return (GetStatus(sm) & kMasked)    ? kTRUE : kFALSE; }
 
-    Char_t GetStatus(Int_t det) const { return fStatus[det]; };
-    void SetStatus(Int_t det, Char_t status) { fStatus[det] = status; };
+ protected:
 
-    Bool_t IsInstalled(Int_t sm) const { return (GetStatus(sm) & kInstalled) ? kTRUE : kFALSE; }
-    Bool_t IsMasked(Int_t sm) const { return (GetStatus(sm) & kMasked) ? kTRUE : kFALSE; }
+  Char_t fStatus[kNdet];                    //  Status byte
 
-  protected:
-    Char_t fStatus[kNdet];                    //  status byte
+  ClassDef(AliTRDCalChamberStatus,1)        //  Defines the status of a single readout chamber
 
-    ClassDef(AliTRDCalChamberStatus,1)
 };
 
 #endif
index 55fcab0f0384af6f35d3d15ed9bd1570c7e01d0e..c78b56b1a595f9cc65fd1dc9d66be325dea29a46 100644 (file)
@@ -52,7 +52,6 @@ AliTRDCalDet::AliTRDCalDet(const Text_t *name, const Text_t *title)
 
 }
 
-
 //_____________________________________________________________________________
 AliTRDCalDet::AliTRDCalDet(const AliTRDCalDet &c):TNamed(c)
 {
index d6cddf7a173b467a269856392d3f5f3e4d8434a0..6164bcb77b5f4c5b18c375524c77990546923b5e 100644 (file)
@@ -23,22 +23,24 @@ class AliTRDCalDet : public TNamed {
   AliTRDCalDet();
   AliTRDCalDet(const Text_t* name, const Text_t* title);
   AliTRDCalDet(const AliTRDCalDet &c);   
-  virtual ~AliTRDCalDet();
+  virtual      ~AliTRDCalDet();
   AliTRDCalDet &operator=(const AliTRDCalDet &c);
 
-  virtual void     Copy(TObject &c) const;
+  virtual void  Copy(TObject &c) const;
 
-  Float_t GetValue(Int_t d) const { return fData[d]; };
-  Float_t GetValue(Int_t p, Int_t c, Int_t s) const { return fData[AliTRDgeometry::GetDetector(p,c,s)]; };
+  Float_t       GetValue(Int_t d) const          { return fData[d];  };
+  Float_t       GetValue(Int_t p, Int_t c, Int_t s) const 
+                                                 { return fData[AliTRDgeometry::GetDetector(p,c,s)];  };
 
-  void SetValue(Int_t d, Float_t value) { fData[d] = value; };
-  void SetValue(Int_t p, Int_t c, Int_t s, Float_t value) { fData[AliTRDgeometry::GetDetector(p,c,s)] = value; };
+  void          SetValue(Int_t d, Float_t value) { fData[d] = value; };
+  void          SetValue(Int_t p, Int_t c, Int_t s, Float_t value) 
+                                                 { fData[AliTRDgeometry::GetDetector(p,c,s)] = value; };
   
 protected:
+ protected:
 
-  Float_t  fData[kNdet];                          //[kNdet] Data
+  Float_t  fData[kNdet];       //[kNdet] Data
 
-  ClassDef(AliTRDCalDet,1)                      //  TRD calibration class for parameters which are saved per detector
+  ClassDef(AliTRDCalDet,1)     //  TRD calibration class for parameters which are saved per detector
 
 };
 
index 64929cdb2ded21d23de477668472b026f0caebbb..01d9d712fe401fb67e43f056c83c62c074131449 100644 (file)
 ClassImp(AliTRDCalGlobals)
 
 //_____________________________________________________________________________
-AliTRDCalGlobals::AliTRDCalGlobals():TNamed()
+AliTRDCalGlobals::AliTRDCalGlobals()
+  :TNamed()
+  ,fSamplingFrequency(0)
+  ,fNumberOfTimeBins(0)
 {
   //
   // AliTRDCalGlobals default constructor
   //
-  
-  
-  Init();
+
 }
 
 //_____________________________________________________________________________
 AliTRDCalGlobals::AliTRDCalGlobals(const Text_t *name, const Text_t *title)
-                :TNamed(name,title)
+  :TNamed(name,title)
+  ,fSamplingFrequency(0)
+  ,fNumberOfTimeBins(0)
 {
   //
   // AliTRDCalGlobals constructor
   //
 
-  Init();
-}
-
-//_____________________________________________________________________________
-void AliTRDCalGlobals::Init()
-{
-  //
-  // default initialization
-  //
-  
-  fSamplingFrequency = 0;
-  fNumberOfTimeBins = 0;
 }
index 2f85035b40cce6e2d6f8c9915a625a3211e350ee..88cd95039846155f1ba4e68bce7fc698acc26fe7 100644 (file)
@@ -7,31 +7,33 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  TRD calibration class for global TRD parameters        //
+//  TRD calibration class for global TRD parameters                          //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "TNamed.h"
 
 class AliTRDCalGlobals : public TNamed {
-  public:
-    AliTRDCalGlobals();
-    AliTRDCalGlobals(const Text_t* name, const Text_t* title);
-    virtual ~AliTRDCalGlobals() {};
+
+ public:
+
+  AliTRDCalGlobals();
+  AliTRDCalGlobals(const Text_t* name, const Text_t* title);
+  virtual ~AliTRDCalGlobals() {};
     
-    void SetSamplingFrequency(Float_t freq)                { fSamplingFrequency = freq; };
-    Float_t GetSamplingFrequency()                   const { return fSamplingFrequency; };
+  void    SetSamplingFrequency(Float_t freq) { fSamplingFrequency = freq; };
+  Float_t GetSamplingFrequency() const       { return fSamplingFrequency; };
     
-    void SetNumberOfTimeBins(Int_t value)     { fNumberOfTimeBins = value; };
-    Int_t GetNumberOfTimeBins()         const { return fNumberOfTimeBins; };
+  void    SetNumberOfTimeBins(Int_t value)   { fNumberOfTimeBins = value; };
+  Int_t   GetNumberOfTimeBins() const        { return fNumberOfTimeBins;  };
   
-  protected:
-    Float_t fSamplingFrequency;                  // Sampling Frequency in MHz
-    Int_t fNumberOfTimeBins;                     // Number of timebins  
-    
-    void Init();
+ protected:
+
+  Float_t fSamplingFrequency;      // Sampling Frequency in MHz
+  Int_t   fNumberOfTimeBins;       // Number of timebins  
     
-    ClassDef(AliTRDCalGlobals,1)                      //  TRD calibration class for global TRD parameters
+  ClassDef(AliTRDCalGlobals,1)     // TRD calibration class for global TRD parameters
+
 };
 
 #endif
index 6ed6063e97fa3c083e3e40c1094bdce7e92e10d7..0690379be0e3cb7d1503cc7f16fb2b0011d40d0d 100644 (file)
@@ -22,6 +22,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "AliTRDCalMCMStatus.h"
+#include "AliTRDgeometry.h"
 #include "AliTRDCalSingleChamberStatus.h"
 
 ClassImp(AliTRDCalMCMStatus)
@@ -58,7 +59,6 @@ AliTRDCalMCMStatus::AliTRDCalMCMStatus(const Text_t *name, const Text_t *title)
 
 }
 
-
 //_____________________________________________________________________________
 AliTRDCalMCMStatus::AliTRDCalMCMStatus(const AliTRDCalMCMStatus &c):TNamed(c)
 {
@@ -112,5 +112,34 @@ void AliTRDCalMCMStatus::Copy(TObject &c) const
   }
 
   TObject::Copy(c);
+
 }
 
+//_____________________________________________________________________________
+Bool_t AliTRDCalMCMStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
+{
+  //
+  // Checks the MCM status byte
+  //
+
+  AliTRDCalSingleChamberStatus* roc = GetCalROC(d);
+
+  if (!roc) {
+    return kFALSE;
+  }
+  else {
+    return (roc->GetStatus(col, row) & bitMask) ? kTRUE : kFALSE;
+  }
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalSingleChamberStatus* AliTRDCalMCMStatus::GetCalROC(Int_t p, Int_t c, Int_t s) const
+{
+  //
+  // Returns the readout chamber of this MCM
+  //
+  return GetCalROC(AliTRDgeometry::GetDetector(p,c,s)); 
+
+}
index 8c3d026c0ae70659b099403c63387278cff16f1a..b54fc327bfd28ef21af570fbf653d2f446253ab3 100644 (file)
@@ -12,8 +12,8 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "TNamed.h"
-#include "AliTRDgeometry.h"
-#include "AliTRDCalSingleChamberStatus.h"
+
+class AliTRDCalSingleChamberStatus;
 
 class AliTRDCalMCMStatus : public TNamed {
 
@@ -28,14 +28,16 @@ class AliTRDCalMCMStatus : public TNamed {
   virtual ~AliTRDCalMCMStatus();
   AliTRDCalMCMStatus &operator=(const AliTRDCalMCMStatus &c);
 
-  virtual void     Copy(TObject &c) const;
+  virtual void  Copy(TObject &c) const;
+
 
-  AliTRDCalSingleChamberStatus *GetCalROC(Int_t d) const { return fROC[d]; };
-  AliTRDCalSingleChamberStatus *GetCalROC(Int_t p, Int_t c, Int_t s) const
-                                               { return GetCalROC(AliTRDgeometry::GetDetector(p,c,s)); };
+         Bool_t IsMasked(Int_t d, Int_t col, Int_t row) const 
+                                                         { return CheckStatus(d, col, row, kMasked); };
+         Bool_t CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const;
 
-  Bool_t IsMasked(Int_t d, Int_t col, Int_t row) const { return CheckStatus(d, col, row, kMasked); };
-  inline Bool_t CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const;
+         AliTRDCalSingleChamberStatus *GetCalROC(Int_t p, Int_t c, Int_t s) const;
+         AliTRDCalSingleChamberStatus *GetCalROC(Int_t d) const 
+                                                         { return fROC[d]; };
 
  protected:
 
@@ -45,13 +47,4 @@ class AliTRDCalMCMStatus : public TNamed {
 
 };
 
-Bool_t AliTRDCalMCMStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
-{
-  AliTRDCalSingleChamberStatus* roc = GetCalROC(d);
-  if (!roc)
-    return kFALSE;
-    
-  return (roc->GetStatus(col, row) & bitMask) ? kTRUE : kFALSE;
-}
-
 #endif
index e97e3ad4b391a505fb44d45eea99716db8bb6bbd..270a6f6b1cd230ea515d8b1d5bc2a2633b901a1c 100644 (file)
@@ -17,7 +17,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  TRD calibration class for global TRD parameters //
+//  TRD calibration class for monitoring data                                //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 ClassImp(AliTRDCalMonitoring)
 
 //_____________________________________________________________________________
-AliTRDCalMonitoring::AliTRDCalMonitoring():TNamed()
+AliTRDCalMonitoring::AliTRDCalMonitoring()
+  :TNamed()
+  ,fDriftVelocity(0)
+  ,fGasComposition(0)
+  ,fEnvironmentTemperature(0)
 {
   //
   // AliTRDCalMonitoring default constructor
   //
-  
-  
-  Init();
+
 }
 
 //_____________________________________________________________________________
 AliTRDCalMonitoring::AliTRDCalMonitoring(const Text_t *name, const Text_t *title)
-                :TNamed(name,title)
+  :TNamed(name,title)
+  ,fDriftVelocity(0)
+  ,fGasComposition(0)
+  ,fEnvironmentTemperature(0)
 {
   //
   // AliTRDCalMonitoring constructor
   //
 
-  Init();
 }
 
-//_____________________________________________________________________________
-void AliTRDCalMonitoring::Init()
-{
-  //
-  // default initialization
-  //
-  
-}
index 44ef4277a265647ce859884286cda993a406f2ba..924c95c499d2f525630646b4dc73b0d31ef01727 100644 (file)
 #include "TNamed.h"
 
 class AliTRDCalMonitoring : public TNamed {
-  public:
-    AliTRDCalMonitoring();
-    AliTRDCalMonitoring(const Text_t* name, const Text_t* title);
-    virtual ~AliTRDCalMonitoring() {};
 
-    //void SetSamplingFrequency(Float_t freq)                { fSamplingFrequency = freq; };
-    //Float_t GetSamplingFrequency()                   const { return fSamplingFrequency; };
+ public:
 
-  protected:
-    Int_t fADCTresholds[6700];
-    Float_t fDriftVelocity;                      // Drift velocity from the monitor
-    TString fGasComposition;                    // Gas composition
-    Float_t fEnvironmentTemperature;
+  AliTRDCalMonitoring();
+  AliTRDCalMonitoring(const Text_t* name, const Text_t* title);
+  virtual ~AliTRDCalMonitoring() {};
 
-    //Float_t fMCMTemperature[6700];
+ protected:
 
-    Float_t fAnodeCurrentsMin[540];
-    Float_t fAnodeCurrentsMax[540];
-    Float_t fDriftCurrentsMin[540];
-    Float_t fDriftCurrentsMax[540];
-    Float_t fAnodeVoltagesMin[540];
-    Float_t fAnodeVoltagesMax[540];
-    Float_t fDriftVoltagesMin[540];
-    Float_t fDriftVoltagesMax[540];
+  Int_t   fADCTresholds[6700];                 //  Threshold voltage for ADCs
+  Float_t fDriftVelocity;                      //  Drift velocity from the monitor
+  TString fGasComposition;                    //  Gas composition
+  Float_t fEnvironmentTemperature;             //  Environment temperature
 
-    Float_t fLVVoltage[360];
-    Float_t fLVCurrent[360];
+  Float_t fAnodeCurrentsMin[540];              //  Minimum anode current
+  Float_t fAnodeCurrentsMax[540];              //  Maximum anode current
+  Float_t fDriftCurrentsMin[540];              //  Minimum drift current
+  Float_t fDriftCurrentsMax[540];              //  Maximum drift current
+  Float_t fAnodeVoltagesMin[540];              //  Minimum anode voltage
+  Float_t fAnodeVoltagesMax[540];              //  Maximum anode voltage
+  Float_t fDriftVoltagesMin[540];              //  Minimum drift voltage
+  Float_t fDriftVoltagesMax[540];              //  Maximum drift voltage
 
-    void Init();
+  Float_t fLVVoltage[360];                     //  Low voltage
+  Float_t fLVCurrent[360];                     //  Low voltage current
+
+  ClassDef(AliTRDCalMonitoring,1)              //  TRD calibration class for global TRD parameters
 
-    ClassDef(AliTRDCalMonitoring,1)                      //  TRD calibration class for global TRD parameters
 };
 
 #endif
index c82b17f2be670b602908b427fd12c68754e04957..9d2a931c8bea9d1bb7f701f7f1899c904a6ec330 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-//-----------------------------------------------------------------
-// Class for dE/dx and Time Bin of Max. Cluster for Electrons and 
-// pions in TRD. 
-// It is instantiated in class AliTRDpidESD for particle identification
-// in TRD
-// Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de>
-//-----------------------------------------------------------------
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// Container for the distributions of dE/dx and the time bin of the          //
+// max. cluster for electrons and pions                                      //
+//                                                                           //
+// Author:                                                                   //
+//   Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de>                    //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
 
 #include <TH1F.h>
 #include <TFile.h>
 
 #include "AliLog.h"
+#include "AliPID.h"
 
 #include "AliTRDCalPIDLQ.h"
 
@@ -33,15 +37,15 @@ ClassImp(AliTRDCalPIDLQ)
 Char_t* AliTRDCalPIDLQ::fpartName[AliPID::kSPECIES] = {"electron", "muon", "pion", "kaon", "proton"};
     
 //_________________________________________________________________________
-AliTRDCalPIDLQ::AliTRDCalPIDLQ():
-  TNamed(),
-  fNMom(0),
-  fTrackMomentum(0),
-  fMeanChargeRatio(0),
-  fNbins(0),
-  fBinSize(0),
-  fHistdEdx(0),
-  fHistTimeBin(0)
+AliTRDCalPIDLQ::AliTRDCalPIDLQ()
+  :TNamed()
+  ,fNMom(0)
+  ,fTrackMomentum(0)
+  ,fMeanChargeRatio(0)
+  ,fNbins(0)
+  ,fBinSize(0)
+  ,fHistdEdx(0)
+  ,fHistTimeBin(0)
 {
   //
   //  The Default constructor
@@ -50,7 +54,15 @@ AliTRDCalPIDLQ::AliTRDCalPIDLQ():
 }
 
 //_________________________________________________________________________
-AliTRDCalPIDLQ::AliTRDCalPIDLQ(const Text_t *name, const Text_t *title) : TNamed(name, title)
+AliTRDCalPIDLQ::AliTRDCalPIDLQ(const Text_t *name, const Text_t *title) 
+  :TNamed(name,title)
+  ,fNMom(0)
+  ,fTrackMomentum(0)
+  ,fMeanChargeRatio(0)
+  ,fNbins(0)
+  ,fBinSize(0)
+  ,fHistdEdx(0)
+  ,fHistTimeBin(0)
 {
   //
   //  The main constructor
@@ -61,15 +73,33 @@ AliTRDCalPIDLQ::AliTRDCalPIDLQ(const Text_t *name, const Text_t *title) : TNamed
 }
 
 //_____________________________________________________________________________
-AliTRDCalPIDLQ::AliTRDCalPIDLQ(const AliTRDCalPIDLQ &c) : TNamed(c)
+AliTRDCalPIDLQ::AliTRDCalPIDLQ(const AliTRDCalPIDLQ &c) 
+  :TNamed(c)
+  ,fNMom(c.fNMom)
+  ,fTrackMomentum(0)
+  ,fMeanChargeRatio(c.fMeanChargeRatio)
+  ,fNbins(c.fNbins)
+  ,fBinSize(c.fBinSize)
+  ,fHistdEdx(0)
+  ,fHistTimeBin(0)
 {
   //
   // Copy constructor
   //
 
-  Init();
+  AliTRDCalPIDLQ& target = (AliTRDCalPIDLQ &) c;
   
-  ((AliTRDCalPIDLQ &) c).Copy(*this);
+  target.fTrackMomentum = new Double_t[fNMom];
+  for (Int_t i=0; i<fNMom; ++i) {
+    target.fTrackMomentum[i] = fTrackMomentum[i];
+  }
+  if (fHistdEdx) {
+    target.fHistdEdx = (TObjArray*) fHistdEdx->Clone();
+  }  
+
+  if (fHistTimeBin) {
+    target.fHistTimeBin = (TObjArray*) fHistTimeBin->Clone();
+  }
 
 }
 
@@ -91,20 +121,17 @@ void AliTRDCalPIDLQ::CleanUp()
   // Delets all newly created objects
   //
 
-  if (fHistdEdx)
-  {
+  if (fHistdEdx) {
     delete fHistdEdx;
     fHistdEdx = 0;
   }
   
-  if (fHistTimeBin)
-  {
+  if (fHistTimeBin) {
     delete fHistTimeBin;
     fHistTimeBin = 0;
   }
 
-  if (fTrackMomentum)
-  {
+  if (fTrackMomentum) {
     delete[] fTrackMomentum;
     fTrackMomentum = 0;
   }
@@ -134,23 +161,23 @@ void AliTRDCalPIDLQ::Copy(TObject &c) const
   
   target.CleanUp();
   
-  target.fNMom = fNMom;
+  target.fNMom            = fNMom;
+  target.fNbins           = fNbins;
+  target.fBinSize         = fBinSize;
+  target.fMeanChargeRatio = fMeanChargeRatio;
   
   target.fTrackMomentum = new Double_t[fNMom];
-  for (Int_t i=0; i<fNMom; ++i)
+  for (Int_t i=0; i<fNMom; ++i) {
     target.fTrackMomentum[i] = fTrackMomentum[i];
-      
-  target.fMeanChargeRatio = fMeanChargeRatio;
-
-  target.fNbins = fNbins;
-  target.fBinSize = fBinSize;
+  }
 
-  if (fHistdEdx)
+  if (fHistdEdx) {
     target.fHistdEdx = (TObjArray*) fHistdEdx->Clone();
-  
-  if (fHistTimeBin)
+  }
+  if (fHistTimeBin) {
     target.fHistTimeBin = (TObjArray*) fHistTimeBin->Clone();
-    
+  }
+
   TObject::Copy(c);
 
 }
@@ -197,9 +224,7 @@ Bool_t AliTRDCalPIDLQ::ReadData(Char_t *responseFile)
   // Read histogram Root file  
   TFile *histFile = new TFile(responseFile, "READ");
   if (!histFile || !histFile->IsOpen()) {
-    TString error;
-    error.Form("Opening TRD histgram file %s failed", responseFile);
-    AliError(error);    
+    AliError(Form("Opening TRD histgram file %s failed", responseFile));    
     return kFALSE;
   }
   gROOT->cd();
@@ -254,12 +279,13 @@ Double_t  AliTRDCalPIDLQ::GetMean(Int_t k, Int_t ip) const
   // Gets mean of de/dx dist. of e
   //
 
-  printf("Mean for particle = %s and momentum = %.2f is:\n"
-        ,fpartName[k]
-        ,fTrackMomentum[ip]);
-  if (k < 0 || k > AliPID::kSPECIES)
+  AliInfo(Form("Mean for particle = %s and momentum = %.2f is:\n"
+              ,fpartName[k]
+              ,fTrackMomentum[ip]));
+  if (k < 0 || k > AliPID::kSPECIES) {
     return 0;
-  
+  }
+
   return ((TH1F*) fHistdEdx->At(GetHistID(k,ip)))->GetMean();
 
 }
@@ -271,11 +297,12 @@ Double_t  AliTRDCalPIDLQ::GetNormalization(Int_t k, Int_t ip) const
   // Gets Normalization of de/dx dist. of e
   //
 
-  printf("Normalization for particle = %s and momentum = %.2f is:\n"
-        ,fpartName[k]
-        ,fTrackMomentum[ip]);
-  if (k < 0 || k > AliPID::kSPECIES)
+  AliInfo(Form("Normalization for particle = %s and momentum = %.2f is:\n"
+              ,fpartName[k]
+              ,fTrackMomentum[ip]));
+  if (k < 0 || k > AliPID::kSPECIES) {
     return 0;
+  }
   
   return ((TH1F*) fHistdEdx->At(GetHistID(k,ip)))->Integral();
 
@@ -288,11 +315,12 @@ TH1F* AliTRDCalPIDLQ::GetHistogram(Int_t k, Int_t ip) const
   // Returns one selected dEdx histogram
   //
 
-  printf("Histogram for particle = %s and momentum = %.2f is:\n"
-        ,fpartName[k]
-        ,fTrackMomentum[ip]);
-  if (k < 0 || k > AliPID::kSPECIES)
+  AliInfo(Form("Histogram for particle = %s and momentum = %.2f is:\n"
+              ,fpartName[k]
+              ,fTrackMomentum[ip]));
+  if (k < 0 || k > AliPID::kSPECIES) {
     return 0;
+  }
   
   return (TH1F*) fHistdEdx->At(GetHistID(k,ip));
 
@@ -305,9 +333,9 @@ TH1F* AliTRDCalPIDLQ::GetHistogramT(Int_t k, Int_t ip) const
   // Returns one selected time bin max histogram
   //
 
-  printf("Histogram for particle = %s and momentum = %.2f is:\n"
-        ,fpartName[k]
-        ,fTrackMomentum[ip]);
+  AliInfo(Form("Histogram for particle = %s and momentum = %.2f is:\n"
+              ,fpartName[k]
+              ,fTrackMomentum[ip]));
   if (k < 0 || k > AliPID::kSPECIES)
     return 0;
   
@@ -324,12 +352,13 @@ Double_t AliTRDCalPIDLQ::GetProbability(Int_t k, Double_t mom, Double_t dedx1) c
   // from the precalculated de/dx distributions 
   //
   
-  Double_t dedx = dedx1/fMeanChargeRatio;
-  Int_t iEnBin= ((Int_t) (dedx/fBinSize+1));
+  Double_t dedx   = dedx1/fMeanChargeRatio;
+  Int_t    iEnBin = ((Int_t) (dedx/fBinSize+1));
   if(iEnBin > fNbins) iEnBin = fNbins;
 
-  if (k < 0 || k > AliPID::kSPECIES)
+  if (k < 0 || k > AliPID::kSPECIES) {
     return 1;
+  }
   
   TH1F* hist1 = 0;
   TH1F* hist2 = 0;
@@ -337,8 +366,7 @@ Double_t AliTRDCalPIDLQ::GetProbability(Int_t k, Double_t mom, Double_t dedx1) c
   Double_t mom2 = 0;
   
   // Lower limit
-  if (mom<=fTrackMomentum[0]) 
-  {
+  if (mom<=fTrackMomentum[0])  {
     hist1 = (TH1F*) fHistdEdx->At(GetHistID(k,1));
     hist2 = (TH1F*) fHistdEdx->At(GetHistID(k,0));
     mom1 = fTrackMomentum[1];
@@ -346,8 +374,7 @@ Double_t AliTRDCalPIDLQ::GetProbability(Int_t k, Double_t mom, Double_t dedx1) c
   }
     
   // Upper Limit
-  if(mom>=fTrackMomentum[fNMom-1]) 
-  {
+  if(mom>=fTrackMomentum[fNMom-1]) {
     hist2 = (TH1F*) fHistdEdx->At(GetHistID(k,fNMom-1));
     hist1 = (TH1F*) fHistdEdx->At(GetHistID(k,fNMom-2));
     mom2 = fTrackMomentum[fNMom-1];
@@ -355,10 +382,8 @@ Double_t AliTRDCalPIDLQ::GetProbability(Int_t k, Double_t mom, Double_t dedx1) c
   }
     
   // In the range
-  for (Int_t ip=1; ip<fNMom; ip++) 
-  {
-    if ((fTrackMomentum[ip-1]<= mom) && (mom<fTrackMomentum[ip])) 
-    {
+  for (Int_t ip=1; ip<fNMom; ip++) {
+    if ((fTrackMomentum[ip-1]<= mom) && (mom<fTrackMomentum[ip])) {
       hist1 = (TH1F*) fHistdEdx->At(GetHistID(k,ip));
       hist2 = (TH1F*) fHistdEdx->At(GetHistID(k,ip-1));
       mom1 = fTrackMomentum[ip];
@@ -381,28 +406,30 @@ Double_t AliTRDCalPIDLQ::GetProbabilityT(Int_t k, Double_t mom, Int_t timbin) co
   // from the precalculated timbin distributions 
   //
   
-  if (timbin<=0) 
-    return 0.;
-  Int_t iTBin=timbin+1;
+  if (timbin<=0) {
+    return 0.0;
+  }
+
+  Int_t iTBin = timbin+1;
   
-  // everything which is not electron counts as pion for time bin
-  if (k != AliPID::kElectron)
+  // Everything which is not an electron counts as a pion for time bin max
+  if (k != AliPID::kElectron) {
     k = AliPID::kPion;
+  }
 
-  if (mom<=fTrackMomentum[0]) 
+  if (mom<=fTrackMomentum[0]) {
     return ((TH1F*) fHistTimeBin->At(GetHistID(k,0)))->GetBinContent(iTBin);
-  
-  if (mom>=fTrackMomentum[fNMom-1]) 
+  }
+  if (mom>=fTrackMomentum[fNMom-1]) 
     return ((TH1F*) fHistTimeBin->At(GetHistID(k,fNMom-1)))->GetBinContent(iTBin);
-  
-  for (Int_t ip=1; ip<fNMom; ip++)
-  {
-    if ((fTrackMomentum[ip-1]<= mom) && (mom<fTrackMomentum[ip])) 
-    {
+  }
+
+  for (Int_t ip=1; ip<fNMom; ip++) {
+    if ((fTrackMomentum[ip-1]<= mom) && (mom<fTrackMomentum[ip])) {
       Double_t slop = (((TH1F*) fHistTimeBin->At(GetHistID(k,ip)))->GetBinContent(iTBin) 
                      - ((TH1F*) fHistTimeBin->At(GetHistID(k,ip-1)))->GetBinContent(iTBin)) 
                     / (fTrackMomentum[ip] - fTrackMomentum[ip-1]);
-      // Linear Interpolation
+      // Linear interpolation
       return ((TH1F*) fHistTimeBin->At(GetHistID(k,ip-1)))->GetBinContent(iTBin) 
               + slop * (mom - fTrackMomentum[ip-1]);
     }
index 855af7c7b4c67f81130572128b57959fe5235700..a1c92966db78d4299d6d3c86ad5777ce032c24c5 100644 (file)
@@ -2,67 +2,71 @@
 #define ALITRDCALPIDLQ_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
-/*-----------------------------------------------------------------
-   Class for dE/dx and Time Bin of Max. Cluster for Electrons and 
-   pions in TRD. 
-   It is instantiated in class AliTRDpidESD for particle identification
-   in TRD
-   Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de>
-   -----------------------------------------------------------------*/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// Container for the distributions of dE/dx and the time bin of the          //
+// max. cluster for electrons and pions                                      //
+//                                                                           //
+// Author:                                                                   //
+//   Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de>                    //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
 
 #include <TNamed.h>
-#include <AliPID.h>
 
 class TH1F;
 class TObjArray;
 
 class AliTRDCalPIDLQ : public TNamed {
 
 public:
+ public:
 
-    AliTRDCalPIDLQ(); 
-    AliTRDCalPIDLQ(const Text_t *name, const Text_t *title);
-    AliTRDCalPIDLQ(const AliTRDCalPIDLQ& pd);
-    virtual ~AliTRDCalPIDLQ();              
+  AliTRDCalPIDLQ(); 
+  AliTRDCalPIDLQ(const Text_t *name, const Text_t *title);
+  AliTRDCalPIDLQ(const AliTRDCalPIDLQ& pd);
+  virtual          ~AliTRDCalPIDLQ();              
+  AliTRDCalPIDLQ    &operator=(const AliTRDCalPIDLQ &c);
 
-    AliTRDCalPIDLQ &operator=(const AliTRDCalPIDLQ &c);
-    virtual void      Copy(TObject &c) const;
+  virtual void       Copy(TObject &c) const;
 
-            Bool_t    ReadData(Char_t *responseFile);     
-            void      SetMeanChargeRatio(Double_t ratio)    { fMeanChargeRatio = ratio; }  
+          Bool_t     ReadData(Char_t *responseFile);     
+          void       SetMeanChargeRatio(Double_t ratio)     { fMeanChargeRatio = ratio;  }  
 
-            Double_t  GetMeanChargeRatio() const            { return fMeanChargeRatio;  } 
-            Double_t  GetMomentum(Int_t ip) const           { return fTrackMomentum[ip];}
-            Double_t  GetMean(Int_t iType, Int_t ip) const;        
-            Double_t  GetNormalization(Int_t iType, Int_t ip) const;
+          Double_t   GetMeanChargeRatio() const             { return fMeanChargeRatio;   } 
+          Double_t   GetMomentum(Int_t ip) const            { return fTrackMomentum[ip]; }
+          Double_t   GetMean(Int_t iType, Int_t ip) const;        
+          Double_t   GetNormalization(Int_t iType, Int_t ip) const;
 
-            TH1F     *GetHistogram(Int_t iType, Int_t ip) const;
-            TH1F     *GetHistogramT(Int_t iType, Int_t ip) const;
+          TH1F      *GetHistogram(Int_t iType, Int_t ip) const;
+          TH1F      *GetHistogramT(Int_t iType, Int_t ip) const;
 
-            Double_t  GetProbability(Int_t iType, Double_t mom, Double_t dedx) const;
-            Double_t  GetProbabilityT(Int_t iType, Double_t mom, Int_t timbin) const;
-            Int_t     GetNbins() const                      { return fNbins;   }        
-            Double_t  GetBinSize() const                    { return fBinSize; } 
+          Double_t   GetProbability(Int_t iType, Double_t mom, Double_t dedx) const;
+          Double_t   GetProbabilityT(Int_t iType, Double_t mom, Int_t timbin) const;
+          Int_t      GetNbins() const                       { return fNbins;   }        
+          Double_t   GetBinSize() const                     { return fBinSize; } 
 
 protected:
+ protected:
 
-            void  Init();      
-            void  CleanUp();   
-    inline  Int_t GetHistID(Int_t part, Int_t mom) const    { return part*fNMom + mom; }
+          void       Init();      
+          void       CleanUp();   
+  inline  Int_t      GetHistID(Int_t part, Int_t mom) const { return part*fNMom + mom; }
     
-    static Char_t *fpartName[AliPID::kSPECIES]; //! Names of particle species
+  static  Char_t    *fpartName[5];                 //! Names of particle species
     
-    Int_t      fNMom;            // Number of momenta  
-    Double_t  *fTrackMomentum;   //[fNMom] Track momenta for which response functions are available
-    Double_t   fMeanChargeRatio; // Ratio of mean charge from real Det. to prob. dist.
+          Int_t      fNMom;                        //  Number of momenta  
+          Double_t  *fTrackMomentum;               //[fNMom] Track momenta for which response functions are available
+          Double_t   fMeanChargeRatio;             //  Ratio of mean charge from real Det. to prob. dist.
 
-    Int_t      fNbins;           // Number of energy bins
-    Double_t   fBinSize;         // Size of energy bin
+          Int_t      fNbins;                       //  Number of energy bins
+          Double_t   fBinSize;                     //  Size of energy bin
     
-    TObjArray *fHistdEdx;        // Prob. of dEdx for 5 particles and for several momenta
-    TObjArray *fHistTimeBin;     // Prob. of max time bin for 5 particles and for several momenta
+          TObjArray *fHistdEdx;                    //  Prob. of dEdx for 5 particles and for several momenta
+          TObjArray *fHistTimeBin;                 //  Prob. of max time bin for 5 particles and for several momenta
     
-    ClassDef(AliTRDCalPIDLQ, 1)  // The TRD PID response container class
+  ClassDef(AliTRDCalPIDLQ, 1)                      //  The TRD PID response container class
 
 };
 
index 59ce274acb69025c03302ad20a219861d7153205..e1d2ff5e6bab3054056082a57c2af6d113abbcec 100644 (file)
@@ -59,7 +59,6 @@ AliTRDCalPad::AliTRDCalPad(const Text_t *name, const Text_t *title)
 
 }
 
-
 //_____________________________________________________________________________
 AliTRDCalPad::AliTRDCalPad(const AliTRDCalPad &c):TNamed(c)
 {
@@ -113,6 +112,7 @@ void AliTRDCalPad::Copy(TObject &c) const
   }
 
   TObject::Copy(c);
+
 }
 
 //_____________________________________________________________________________
@@ -132,5 +132,6 @@ void AliTRDCalPad::ScaleROCs(AliTRDCalDet* values)
       fROC[idet]->Scale(values->GetValue(idet));
     }
   }
+
 }
 
index 28b68daa4fecd1cff09f1a283ff5199226132343..8c1cc3b5a2305595019d001c9eb6dfa6764ab6e2 100644 (file)
@@ -25,24 +25,24 @@ class AliTRDCalPad : public TNamed {
   AliTRDCalPad();
   AliTRDCalPad(const Text_t* name, const Text_t* title);
   AliTRDCalPad(const AliTRDCalPad &c);   
-  virtual ~AliTRDCalPad();
-  AliTRDCalPad &operator=(const AliTRDCalPad &c);
+  virtual            ~AliTRDCalPad();
+  AliTRDCalPad        &operator=(const AliTRDCalPad &c);
 
-  virtual void     Copy(TObject &c) const;
+  virtual void        Copy(TObject &c) const;
 
-  static inline Int_t               GetDet(Int_t p, Int_t c, Int_t s) { return p+c*kNplan+s*kNplan*kNcham; };
+  static inline Int_t GetDet(Int_t p, Int_t c, Int_t s) { return p+c*kNplan+s*kNplan*kNcham; };
 
-  AliTRDCalROC *GetCalROC(Int_t d) const { return fROC[d]; };
-  AliTRDCalROC *GetCalROC(Int_t p, Int_t c, Int_t s) const
-                                               { return fROC[GetDet(p,c,s)]; };
+  AliTRDCalROC       *GetCalROC(Int_t d) const          { return fROC[d]; };
+  AliTRDCalROC       *GetCalROC(Int_t p, Int_t c, Int_t s) const
+                                                        { return fROC[GetDet(p,c,s)]; };
   
-  void ScaleROCs(AliTRDCalDet* values);
+  void                ScaleROCs(AliTRDCalDet* values);
 
  protected:
 
-  AliTRDCalROC *fROC[kNdet];                    //  Array of ROC objects which contain the values per pad
+  AliTRDCalROC *fROC[kNdet];  //  Array of ROC objects which contain the values per pad
 
-  ClassDef(AliTRDCalPad,1)                      //  TRD calibration class for parameters which are saved per pad
+  ClassDef(AliTRDCalPad,1)    //  TRD calibration class for parameters which are saved per pad
 
 };
 
index ef8896c4e1200e36c225fa464a87c348f3047ad2..bdb255b70271c69eebb8e9907d801c0c1654dcbd 100644 (file)
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  TRD calibration class for MCM status                                     //
+//  TRD calibration class for the single pad status                          //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "AliTRDCalPadStatus.h"
-
+#include "AliTRDgeometry.h"
 #include "AliTRDCalSingleChamberStatus.h"
 
 ClassImp(AliTRDCalPadStatus)
 
 //_____________________________________________________________________________
-AliTRDCalPadStatus::AliTRDCalPadStatus():TNamed()
+AliTRDCalPadStatus::AliTRDCalPadStatus()
+  :TNamed()
 {
   //
   // AliTRDCalPadStatus default constructor
@@ -42,7 +43,7 @@ AliTRDCalPadStatus::AliTRDCalPadStatus():TNamed()
 
 //_____________________________________________________________________________
 AliTRDCalPadStatus::AliTRDCalPadStatus(const Text_t *name, const Text_t *title)
-                :TNamed(name,title)
+  :TNamed(name,title)
 {
   //
   // AliTRDCalPadStatus constructor
@@ -59,9 +60,9 @@ AliTRDCalPadStatus::AliTRDCalPadStatus(const Text_t *name, const Text_t *title)
 
 }
 
-
 //_____________________________________________________________________________
-AliTRDCalPadStatus::AliTRDCalPadStatus(const AliTRDCalPadStatus &c):TNamed(c)
+AliTRDCalPadStatus::AliTRDCalPadStatus(const AliTRDCalPadStatus &c)
+  :TNamed(c)
 {
   //
   // AliTRDCalPadStatus copy constructor
@@ -113,5 +114,33 @@ void AliTRDCalPadStatus::Copy(TObject &c) const
   }
 
   TObject::Copy(c);
+
 }
 
+//_____________________________________________________________________________
+Bool_t AliTRDCalPadStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
+{
+  //
+  // Checks the pad status
+  //
+
+  AliTRDCalSingleChamberStatus *roc = GetCalROC(d);
+  if (!roc) {
+    return kFALSE;
+  }
+  else {
+    return (roc->GetStatus(col, row) & bitMask) ? kTRUE : kFALSE;
+  }
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalSingleChamberStatus* AliTRDCalPadStatus::GetCalROC(Int_t p, Int_t c, Int_t s) const
+{ 
+  //
+  // Returns the readout chamber of this pad
+  //
+
+  return fROC[AliTRDgeometry::GetDetector(p,c,s)];   
+
+}
index c4c4778349756afe2c3df9f050f9319c93f57c6c..5e18320c6192f2d115e2e3a4ed5d8e5c2f1b6c73 100644 (file)
@@ -7,53 +7,46 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  TRD calibration class for MCM status                                     //
+//  TRD calibration class for the single pad status                          //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "TNamed.h"
-#include "AliTRDgeometry.h"
-#include "AliTRDCalSingleChamberStatus.h"
+
+class AliTRDCalSingleChamberStatus;
 
 class AliTRDCalPadStatus : public TNamed {
 
  public:
  
   enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
-  enum { kMasked = 2, kPadBridgedLeft = 4,     kPadBridgedRight = 8    };
+  enum { kMasked = 2, kPadBridgedLeft = 4, kPadBridgedRight = 8    };
 
   AliTRDCalPadStatus();
   AliTRDCalPadStatus(const Text_t* name, const Text_t* title);
   AliTRDCalPadStatus(const AliTRDCalPadStatus &c);   
-  virtual ~AliTRDCalPadStatus();
+  virtual            ~AliTRDCalPadStatus();
   AliTRDCalPadStatus &operator=(const AliTRDCalPadStatus &c);
 
-  virtual void     Copy(TObject &c) const;
+  virtual void        Copy(TObject &c) const;
 
-  AliTRDCalSingleChamberStatus *GetCalROC(Int_t d) const { return fROC[d]; };
-  AliTRDCalSingleChamberStatus *GetCalROC(Int_t p, Int_t c, Int_t s) const
-                                               { return fROC[AliTRDgeometry::GetDetector(p,c,s)]; };
+          Bool_t      IsMasked(Int_t d, Int_t col, Int_t row) const 
+                                               { return CheckStatus(d, col, row, kMasked);          };
+          Bool_t      IsBridgedLeft(Int_t d, Int_t col, Int_t row) const 
+                                               { return CheckStatus(d, col, row, kPadBridgedLeft);  };
+          Bool_t      IsBridgedRight(Int_t d, Int_t col, Int_t row) const 
+                                               { return CheckStatus(d, col, row, kPadBridgedRight); };
+          Bool_t      CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const;
 
-  Bool_t IsMasked(Int_t d, Int_t col, Int_t row) const { return CheckStatus(d, col, row, kMasked); };
-  Bool_t IsBridgedLeft(Int_t d, Int_t col, Int_t row) const { return CheckStatus(d, col, row, kPadBridgedLeft); };
-  Bool_t IsBridgedRight(Int_t d, Int_t col, Int_t row) const { return CheckStatus(d, col, row, kPadBridgedRight); };
-  inline Bool_t CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const;
+  AliTRDCalSingleChamberStatus *GetCalROC(Int_t d) const { return fROC[d]; };
+  AliTRDCalSingleChamberStatus *GetCalROC(Int_t p, Int_t c, Int_t s) const;
 
  protected:
 
   AliTRDCalSingleChamberStatus *fROC[kNdet];          //  Array of ROC objects which contain the values per pad
 
-  ClassDef(AliTRDCalPadStatus,1)                      //  TRD calibration class for MCM status
+  ClassDef(AliTRDCalPadStatus,1)                      //  TRD calibration class for the single pad status
 
 };
-
-Bool_t AliTRDCalPadStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
-{
-  AliTRDCalSingleChamberStatus* roc = GetCalROC(d);
-  if (!roc)
-    return kFALSE;
-
-  return (roc->GetStatus(col, row) & bitMask) ? kTRUE : kFALSE;
-}
           
 #endif
index e6e7cf28324e7c5bdc8142c221540120f1e92e99..6530c59d3291a32ccd26bc364dc9a89c9eff78c2 100644 (file)
 ClassImp(AliTRDCalROC)
 
 //_____________________________________________________________________________
-AliTRDCalROC::AliTRDCalROC():TObject()
+AliTRDCalROC::AliTRDCalROC()
+  :TObject()
+  ,fPla(0)
+  ,fCha(0)
+  ,fNrows(0)
+  ,fNcols(0)
+  ,fNchannels(0)
+  ,fData(0)
 {
   //
   // Default constructor
   //
 
-  fPla          = 0;
-  fCha          = 0;
-
-  fNrows        = 0;
-  fNcols        = 0;
-
-  fNchannels    = 0;
-  fData         = 0;
 }
 
 //_____________________________________________________________________________
-AliTRDCalROC::AliTRDCalROC(Int_t p, Int_t c):TObject()
+AliTRDCalROC::AliTRDCalROC(Int_t p, Int_t c)
+  :TObject()
+  ,fPla(p)
+  ,fCha(c)
+  ,fNrows(0)
+  ,fNcols(144)
+  ,fNchannels(0)
+  ,fData(0)
 {
   //
   // Constructor that initializes a given pad plane type
   //
 
-  fPla = p;
-  fCha = c;
-
-  fNcols      = 144;
-
   //
   // The pad plane parameter
   //
@@ -124,21 +125,37 @@ AliTRDCalROC::AliTRDCalROC(Int_t p, Int_t c):TObject()
   };
 
   fNchannels = fNrows * fNcols;
-  if (fNchannels != 0)
+  if (fNchannels != 0) {
     fData = new UShort_t[fNchannels];
+  }
 
-  for (Int_t i=0; i<fNchannels; ++i)
+  for (Int_t i=0; i<fNchannels; ++i) {
     fData[i] = 0;
+  }
+
 }
 
 //_____________________________________________________________________________
-AliTRDCalROC::AliTRDCalROC(const AliTRDCalROC &c):TObject(c)
+AliTRDCalROC::AliTRDCalROC(const AliTRDCalROC &c)
+  :TObject(c)
+  ,fPla(c.fPla)
+  ,fCha(c.fCha)
+  ,fNrows(c.fNrows)
+  ,fNcols(c.fNcols)
+  ,fNchannels(c.fNchannels)
+  ,fData(0)
 {
   //
   // AliTRDCalROC copy constructor
   //
 
-  ((AliTRDCalROC &) c).Copy(*this);
+  Int_t iBin = 0;
+
+  if (((AliTRDCalROC &) c).fData) delete [] ((AliTRDCalROC &) c).fData;
+  ((AliTRDCalROC &) c).fData = new UShort_t[fNchannels];
+  for (iBin = 0; iBin < fNchannels; iBin++) {
+    ((AliTRDCalROC &) c).fData[iBin] = fData[iBin];
+  }
 
 }
 
@@ -153,6 +170,7 @@ AliTRDCalROC::~AliTRDCalROC()
     delete [] fData;
     fData = 0;
   }
+
 }
 
 //_____________________________________________________________________________
@@ -205,4 +223,5 @@ void AliTRDCalROC::Scale(Float_t value)
   for (Int_t iBin = 0; iBin < fNchannels; iBin++) {
     fData[iBin] = (UShort_t) (value * fData[iBin]);
   }
+
 }
index 68124ad3a2cd6b2811e09bdc598834f0f50acd22..6e8f76532b1116c055ea19756cd336ba3d98d0b5 100644 (file)
@@ -21,34 +21,36 @@ class AliTRDCalROC : public TObject {
   AliTRDCalROC();
   AliTRDCalROC(Int_t p, Int_t c);
   AliTRDCalROC(const AliTRDCalROC &c);
-  virtual           ~AliTRDCalROC();
-  AliTRDCalROC      &operator=(const AliTRDCalROC &c);
-  virtual void       Copy(TObject &c) const;
+  virtual      ~AliTRDCalROC();
+  AliTRDCalROC &operator=(const AliTRDCalROC &c);
+  virtual void  Copy(TObject &c) const;
 
-  Int_t    GetNrows() const                  { return fNrows; };
-  Int_t    GetNcols() const                  { return fNcols; };
+  Int_t         GetNrows() const                { return fNrows; };
+  Int_t         GetNcols() const                { return fNcols; };
 
-  Int_t        GetChannel(Int_t c, Int_t r)     { return r+c*fNrows; };
-  Int_t        GetNchannels()       const       { return fNchannels;   };
+  Int_t         GetChannel(Int_t c, Int_t r)    { return r+c*fNrows; };
+  Int_t         GetNchannels() const            { return fNchannels; };
 
-  Float_t GetValue(Int_t ich) const       { return (Float_t) fData[ich] / 10000; };
-  Float_t GetValue(Int_t col, Int_t row)  { return GetValue(GetChannel(col,row)); };
+  Float_t       GetValue(Int_t ich) const       { return (Float_t) fData[ich] / 10000;  };
+  Float_t       GetValue(Int_t col, Int_t row)  { return GetValue(GetChannel(col,row)); };
 
-  void         SetValue(Int_t ich, Float_t value) { fData[ich] = (UShort_t) (value * 10000); };
-  void         SetValue(Int_t col, Int_t row, Float_t value) { SetValue(GetChannel(col,row), value); };
+  void          SetValue(Int_t ich, Float_t value) 
+                                                { fData[ich] = (UShort_t) (value * 10000); };
+  void          SetValue(Int_t col, Int_t row, Float_t value) 
+                                                { SetValue(GetChannel(col,row), value);    };
 
-  void Scale(Float_t value);
+  void          Scale(Float_t value);
 
  protected:
 
-  Int_t     fPla;             //  Plane number
-  Int_t     fCha;             //  Chamber number
+  Int_t     fPla;              //  Plane number
+  Int_t     fCha;              //  Chamber number
 
-  Int_t     fNrows;           //  Number of rows
-  Int_t     fNcols;           //  Number of columns
+  Int_t     fNrows;            //  Number of rows
+  Int_t     fNcols;            //  Number of columns
 
-  Int_t     fNchannels;             //  Number of channels
-  UShort_t  *fData;                //[fNchannels] Data
+  Int_t     fNchannels;        //  Number of channels
+  UShort_t *fData;             //[fNchannels] Data
 
   ClassDef(AliTRDCalROC, 2)    //  TRD ROC calibration class
 
index d8aed9c84831b929afc6f71bc8b0728df942d8eb..376b5f387353a3dc2e4782ed5730a6c7415875ba 100644 (file)
@@ -18,7 +18,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 //  Calibration base class for a single ROC                                  //
-//  Contains one char value per pad                                         //
+//  Contains one char value per pad                                          //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 ClassImp(AliTRDCalSingleChamberStatus)
 
 //_____________________________________________________________________________
-AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus():TObject()
+AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus()
+  :TObject()
+  ,fPla(0)
+  ,fCha(0)
+  ,fNrows(0)
+  ,fNcols(0)
+  ,fNchannels(0)
+  ,fData(0)
 {
   //
   // Default constructor
   //
 
-  fPla          = 0;
-  fCha          = 0;
-
-  fNrows        = 0;
-  fNcols        = 0;
-
-  fNchannels    = 0;
-  fData         = 0;
 }
 
 //_____________________________________________________________________________
-AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus(Int_t p, Int_t c, Int_t cols):TObject()
+AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus(Int_t p, Int_t c, Int_t cols)
+  :TObject()
+  ,fPla(p)
+  ,fCha(c)
+  ,fNrows(0)
+  ,fNcols(cols)
+  ,fNchannels(0)
+  ,fData(0)
 {
   //
   // Constructor that initializes a given pad plane type
   //
 
-  fPla = p;
-  fCha = c;
-
-  fNcols      = cols;
-
   //
   // The pad plane parameter
   //
@@ -122,21 +123,38 @@ AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus(Int_t p, Int_t c, Int
   };
 
   fNchannels = fNrows * fNcols;
-  if (fNchannels != 0)
+  if (fNchannels != 0) {
     fData = new Char_t[fNchannels];
-
-  for (Int_t i=0; i<fNchannels; ++i)
+  }
+  for (Int_t i=0; i<fNchannels; ++i) {
     fData[i] = 0;
+  }
+
 }
 
 //_____________________________________________________________________________
-AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus(const AliTRDCalSingleChamberStatus &c):TObject(c)
+AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus(const AliTRDCalSingleChamberStatus &c)
+  :TObject(c)
+  ,fPla(c.fPla)
+  ,fCha(c.fCha)
+  ,fNrows(c.fNrows)
+  ,fNcols(c.fNcols)
+  ,fNchannels(c.fNchannels)
+  ,fData(0)
 {
   //
   // AliTRDCalSingleChamberStatus copy constructor
   //
 
-  ((AliTRDCalSingleChamberStatus &) c).Copy(*this);
+  Int_t iBin = 0;
+
+  if (((AliTRDCalSingleChamberStatus &) c).fData) {
+    delete [] ((AliTRDCalSingleChamberStatus &) c).fData;
+  }
+  ((AliTRDCalSingleChamberStatus &) c).fData = new Char_t[fNchannels];
+  for (iBin = 0; iBin < fNchannels; iBin++) {
+    ((AliTRDCalSingleChamberStatus &) c).fData[iBin] = fData[iBin];
+  }
 
 }
 
@@ -151,6 +169,7 @@ AliTRDCalSingleChamberStatus::~AliTRDCalSingleChamberStatus()
     delete [] fData;
     fData = 0;
   }
+
 }
 
 //_____________________________________________________________________________
@@ -172,17 +191,19 @@ void AliTRDCalSingleChamberStatus::Copy(TObject &c) const
   // Copy function
   //
 
-  ((AliTRDCalSingleChamberStatus &) c).fPla          = fPla;
-  ((AliTRDCalSingleChamberStatus &) c).fCha          = fCha;
+  Int_t iBin = 0;
 
-  ((AliTRDCalSingleChamberStatus &) c).fNrows        = fNrows;
-  ((AliTRDCalSingleChamberStatus &) c).fNcols        = fNcols;
+  ((AliTRDCalSingleChamberStatus &) c).fPla       = fPla;
+  ((AliTRDCalSingleChamberStatus &) c).fCha       = fCha;
 
-  Int_t iBin = 0;
+  ((AliTRDCalSingleChamberStatus &) c).fNrows     = fNrows;
+  ((AliTRDCalSingleChamberStatus &) c).fNcols     = fNcols;
 
   ((AliTRDCalSingleChamberStatus &) c).fNchannels = fNchannels;
 
-  if (((AliTRDCalSingleChamberStatus &) c).fData) delete [] ((AliTRDCalSingleChamberStatus &) c).fData;
+  if (((AliTRDCalSingleChamberStatus &) c).fData) {
+    delete [] ((AliTRDCalSingleChamberStatus &) c).fData;
+  }
   ((AliTRDCalSingleChamberStatus &) c).fData = new Char_t[fNchannels];
   for (iBin = 0; iBin < fNchannels; iBin++) {
     ((AliTRDCalSingleChamberStatus &) c).fData[iBin] = fData[iBin];
index cb9993e30b850e73498c804eebfcbeaf075bfb17..ed2ac33d1018fbadd209d24f07a0666d11c97548 100644 (file)
@@ -5,11 +5,11 @@
 
 /* $Id: AliTRDCalSingleChamberStatus.h,v */
 
-//////////////////////////////////////////////////
-//                                              //
-//  TRD calibration base class containing status values for one ROC      //
-//                                              //
-//////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  TRD calibration base class containing status values for one ROC       //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 #include <TObject.h>
 
@@ -21,34 +21,35 @@ class AliTRDCalSingleChamberStatus : public TObject {
   AliTRDCalSingleChamberStatus();
   AliTRDCalSingleChamberStatus(Int_t p, Int_t c, Int_t cols);
   AliTRDCalSingleChamberStatus(const AliTRDCalSingleChamberStatus &c);
-  virtual           ~AliTRDCalSingleChamberStatus();
-  AliTRDCalSingleChamberStatus      &operator=(const AliTRDCalSingleChamberStatus &c);
-  virtual void       Copy(TObject &c) const;
+  virtual                      ~AliTRDCalSingleChamberStatus();
+  AliTRDCalSingleChamberStatus &operator=(const AliTRDCalSingleChamberStatus &c);
 
-  Int_t    GetNrows() const                  { return fNrows; };
-  Int_t    GetNcols() const                  { return fNcols; };
+  virtual void    Copy(TObject &c) const;
 
-  Int_t        GetChannel(Int_t c, Int_t r) const    { return r+c*fNrows; };
-  Int_t        GetNchannels()       const       { return fNchannels;   };
-  Char_t       GetStatus(Int_t ich) const       { return fData[ich]; };
-  Char_t       GetStatus(Int_t col, Int_t row) const { return fData[GetChannel(col,row)]; };
+          Int_t   GetNrows() const                      { return fNrows; };
+          Int_t   GetNcols() const                      { return fNcols; };
 
-  void         SetStatus(Int_t ich, Char_t vd) { fData[ich] = vd;   };
-  void         SetStatus(Int_t col, Int_t row, Char_t vd)
-                                                { fData[GetChannel(col,row)] = vd; };
+          Int_t   GetChannel(Int_t c, Int_t r) const    { return r+c*fNrows;                 };
+          Int_t   GetNchannels() const                  { return fNchannels;                 };
+          Char_t  GetStatus(Int_t ich) const            { return fData[ich];                 };
+          Char_t  GetStatus(Int_t col, Int_t row) const { return fData[GetChannel(col,row)]; };
+
+          void    SetStatus(Int_t ich, Char_t vd)       { fData[ich] = vd;                   };
+          void    SetStatus(Int_t col, Int_t row, Char_t vd)
+                                                        { fData[GetChannel(col,row)] = vd;   };
 
  protected:
 
-  Int_t     fPla;             //  Plane number
-  Int_t     fCha;             //  Chamber number
+          Int_t   fPla;                    //  Plane number
+          Int_t   fCha;                    //  Chamber number
 
-  Int_t     fNrows;           //  Number of rows
-  Int_t     fNcols;           //  Number of columns
+          Int_t   fNrows;                  //  Number of rows
+          Int_t   fNcols;                  //  Number of columns
 
-  Int_t     fNchannels;             //  Number of channels
-  Char_t   *fData;                //[fNchannels] Data
+          Int_t   fNchannels;              //  Number of channels
+          Char_t *fData;                   //[fNchannels] Data
 
-  ClassDef(AliTRDCalSingleChamberStatus,1)    //  TRD ROC calibration class
+  ClassDef(AliTRDCalSingleChamberStatus,1) //  TRD ROC calibration class
 
 };
 
index 3643ce952a63e8080021c8521c8c889a7e45ee4a..0670fae5290284425d2641b2e587b1545f6e1123 100644 (file)
@@ -26,7 +26,8 @@
 ClassImp(AliTRDCalSuperModuleStatus)
 
 //_____________________________________________________________________________
-AliTRDCalSuperModuleStatus::AliTRDCalSuperModuleStatus():TNamed()
+AliTRDCalSuperModuleStatus::AliTRDCalSuperModuleStatus()
+  :TNamed()
 {
   //
   // AliTRDCalSuperModuleStatus default constructor
@@ -35,11 +36,12 @@ AliTRDCalSuperModuleStatus::AliTRDCalSuperModuleStatus():TNamed()
   for (Int_t idet = 0; idet < kNsect; idet++) {
     fStatus[idet] = 0;
   }
+
 }
 
 //_____________________________________________________________________________
 AliTRDCalSuperModuleStatus::AliTRDCalSuperModuleStatus(const Text_t *name, const Text_t *title)
-                :TNamed(name,title)
+  :TNamed(name,title)
 {
   //
   // AliTRDCalSuperModuleStatus constructor
@@ -48,5 +50,6 @@ AliTRDCalSuperModuleStatus::AliTRDCalSuperModuleStatus(const Text_t *name, const
   for (Int_t idet = 0; idet < kNsect; idet++) {
     fStatus[idet] = 0;
   }
+
 }
 
index f397c265ad13da199eb4cd6291e0963362d477c0..85f8409abbde249748d90228d9024b2e347e9919 100644 (file)
 #include "TNamed.h"
 
 class AliTRDCalSuperModuleStatus : public TNamed {
-  public:
-    enum { kNdet = 540, kNstacks = 90, kNcham = 5, kNsect = 18 };
-    enum { kInstalled = 1, kMasked = 2 };
+
+ public:
+
+  enum { kNdet = 540, kNstacks = 90, kNcham = 5, kNsect = 18 };
+  enum { kInstalled = 1, kMasked = 2 };
   
-    AliTRDCalSuperModuleStatus();
-    AliTRDCalSuperModuleStatus(const Text_t* name, const Text_t* title);
+  AliTRDCalSuperModuleStatus();
+  AliTRDCalSuperModuleStatus(const Text_t* name, const Text_t* title);
+
+  Char_t GetStatus(Int_t sm) const          { return fStatus[sm];   };
+  void   SetStatus(Int_t sm, Char_t status) { fStatus[sm] = status; };
+
+  Bool_t IsInstalled(Int_t sm) const        { return (GetStatus(sm) & kInstalled) ? kTRUE : kFALSE; }
+  Bool_t IsMasked(Int_t sm) const           { return (GetStatus(sm) & kMasked)    ? kTRUE : kFALSE; }
 
-    Char_t GetStatus(Int_t sm) const { return fStatus[sm]; };
-    void SetStatus(Int_t sm, Char_t status) { fStatus[sm] = status; };
+ protected:
 
-    Bool_t IsInstalled(Int_t sm) const { return (GetStatus(sm) & kInstalled) ? kTRUE : kFALSE; }
-    Bool_t IsMasked(Int_t sm) const { return (GetStatus(sm) & kMasked) ? kTRUE : kFALSE; }
+  Char_t fStatus[kNsect];                    //  Status byte
 
-  protected:
-    Char_t fStatus[kNsect];                    //  status byte
+  ClassDef(AliTRDCalSuperModuleStatus,1)     //  Defines the status of a single super module
 
-    ClassDef(AliTRDCalSuperModuleStatus,1)
 };
 
 #endif