Improved QAchecker and plots for DQM
[u/mrichter/AliRoot.git] / TOF / AliTOFCalPadZ.cxx
index f997707..a6557bf 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*$Log$
+/*
+$Log$
+Revision 1.6  2006/04/20 22:30:49  hristov
+Coding conventions (Annalisa)
+
+Revision 1.5  2006/04/16 22:29:05  hristov
+Coding conventions (Annalisa)
+
+Revision 1.4  2006/04/05 08:35:38  hristov
+Coding conventions (S.Arcelli, C.Zampolli)
+
+Revision 1.3  2006/03/28 14:57:30  arcelli
+updates to handle new V5 geometry & some re-arrangements
+
+Revision 1.2  2006/02/13 17:22:26  arcelli
+just Fixing Log info
+
+Revision 1.1  2006/02/13 16:10:48  arcelli
+Add classes for TOF Calibration (C.Zampolli)
+
 author: Chiara Zampolli, zampolli@bo.infn.it
- */  
+*/  
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -23,47 +42,84 @@ author: Chiara Zampolli, zampolli@bo.infn.it
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "TObject.h"
-#include "TROOT.h"
 #include "TBrowser.h"
-#include "TClass.h"
-#include "AliTOFGeometryV4.h"
-#include "AliTOFChannel.h"
+
+#include "AliLog.h"
+
 #include "AliTOFCalPadZ.h"
+#include "AliTOFChannel.h"
+#include "AliTOFGeometryV5.h"
 
 ClassImp(AliTOFCalPadZ)
 
 //________________________________________________________________
 
-AliTOFCalPadZ::AliTOFCalPadZ(){
-  fCh = 0;
-  fNSector = AliTOFGeometryV4::NSectors();
-  fNPlate = AliTOFGeometryV4::NPlates();
-  fNStripA = AliTOFGeometryV4::NStripA();
-  fNStripB = AliTOFGeometryV4::NStripB();
-  fNStripC = 20;
-  //  fNStripC = AliTOFGeometryV4::NStripC();
-  fNpadZ = AliTOFGeometryV4::NpadZ();
-  fNpadX = AliTOFGeometryV4::NpadX();
-
+  AliTOFCalPadZ::AliTOFCalPadZ():
+  fNpadX(0),
+  fGeom(0x0),
+  fCh(0)
+{
+  //fCh = 0;
+  //fNpadX=0;
 }
 //________________________________________________________________
 
 AliTOFCalPadZ::AliTOFCalPadZ(AliTOFChannel *ch):
+  fNpadX(0),
+  fGeom(0x0),
   fCh(ch)
 {  
-  fNSector = AliTOFGeometryV4::NSectors();
-  fNPlate = AliTOFGeometryV4::NPlates();
-  fNStripA = AliTOFGeometryV4::NStripA();
-  fNStripB = AliTOFGeometryV4::NStripB();
-  //  fNStripC = AliTOFGeometryV4::NStripC();
-  fNStripC = 20;
-  fNpadZ = AliTOFGeometryV4::NpadZ();
-  fNpadX = AliTOFGeometryV4::NpadX();
+  //fNpadX = 0;
+}
+//________________________________________________________________
 
+AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom):
+  fNpadX(0),
+  fGeom(geom),
+  fCh(0)
+{
+  //ctor with TOF geometry
+  //fCh = 0;
+  //fGeom = geom;
+  fNpadX = fGeom->NpadX();
 }
 //________________________________________________________________
 
+AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom,AliTOFChannel *ch):
+  fNpadX(0),
+  fGeom(geom),
+  fCh(ch)
+{  
+  //ctor with TOF geometry and cal channel
+  fGeom = geom;
+  fNpadX = fGeom->NpadX();
+}
+
+//________________________________________________________________
+AliTOFCalPadZ::AliTOFCalPadZ(const AliTOFCalPadZ &source):
+  TObject(),
+  fNpadX(0),
+  fGeom(0x0),
+  fCh(0)
+{
+  // copy constructor
+
+  this->fGeom=source.fGeom;
+
+}
+
+//_____________________________________________________________________________
+AliTOFCalPadZ& AliTOFCalPadZ::operator=(const AliTOFCalPadZ &source)
+{
+  // assignment operator
+
+  this->fGeom=source.fGeom;
+  return *this;
+
+}
+
+//________________________________________________________________
+
 AliTOFCalPadZ::~AliTOFCalPadZ()
   {
     delete[] fCh;
@@ -72,6 +128,13 @@ AliTOFCalPadZ::~AliTOFCalPadZ()
 
 void AliTOFCalPadZ::Browse(TBrowser *b)
 {
+  //Add cal object to browsable list
+  if(fGeom==0x0){
+    AliInfo("V5 TOF Geometry is taken as the default");
+    AliTOFGeometry *geom = new AliTOFGeometryV5();
+    fNpadX = geom->NpadX();
+    delete geom;
+  }
   char name[10];
   for(Int_t i=0; i<fNpadX; ++i) {
     snprintf(name,sizeof(name),"PadX %2.2d",i);