]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Calibration classes (prototypes)
authorkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Mar 2006 09:24:09 +0000 (09:24 +0000)
committerkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Mar 2006 09:24:09 +0000 (09:24 +0000)
TPC/AliTPCCalDet.cxx [new file with mode: 0644]
TPC/AliTPCCalDet.h [new file with mode: 0644]
TPC/AliTPCCalPad.cxx [new file with mode: 0644]
TPC/AliTPCCalPad.h [new file with mode: 0644]
TPC/AliTPCCalROC.cxx [new file with mode: 0644]
TPC/AliTPCCalROC.h [new file with mode: 0644]

diff --git a/TPC/AliTPCCalDet.cxx b/TPC/AliTPCCalDet.cxx
new file mode 100644 (file)
index 0000000..ebb7729
--- /dev/null
@@ -0,0 +1,102 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  TPC calibration class for parameters which saved per detector            //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTPCCalDet.h"
+
+ClassImp(AliTPCCalDet)
+
+//_____________________________________ ________________________________________
+AliTPCCalDet::AliTPCCalDet():TNamed()
+{
+  //
+  // AliTPCCalDet default constructor
+  //
+
+  for (Int_t idet = 0; idet < kNdet; idet++) {
+    fData[idet] = 0;
+  }
+
+}
+
+//_____________________________________________________________________________
+AliTPCCalDet::AliTPCCalDet(const Text_t *name, const Text_t *title)
+                :TNamed(name,title)
+{
+  //
+  // AliTPCCalDet constructor
+  //
+
+  for (Int_t idet = 0; idet < kNdet; idet++) {
+    fData[idet] = 0;
+  }
+
+}
+
+
+//_____________________________________________________________________________
+AliTPCCalDet::AliTPCCalDet(const AliTPCCalDet &c):TNamed(c)
+{
+  //
+  // AliTPCCalDet copy constructor
+  //
+
+  ((AliTPCCalDet &) c).Copy(*this);
+
+}
+
+///_____________________________________________________________________________
+AliTPCCalDet::~AliTPCCalDet()
+{
+  //
+  // AliTPCCalDet destructor
+  //
+
+}
+
+//_____________________________________________________________________________
+AliTPCCalDet &AliTPCCalDet::operator=(const AliTPCCalDet &c)
+{
+  //
+  // Assignment operator
+  //
+
+  if (this != &c) ((AliTPCCalDet &) c).Copy(*this);
+  return *this;
+
+}
+
+//_____________________________________________________________________________
+void AliTPCCalDet::Copy(TObject &c) const
+{
+  //
+  // Copy function
+  //
+
+  for (Int_t idet = 0; idet < kNdet; idet++) {
+    ((AliTPCCalDet &) c).fData[idet] = fData[idet];
+  }
+
+  TObject::Copy(c);
+
+}
+
diff --git a/TPC/AliTPCCalDet.h b/TPC/AliTPCCalDet.h
new file mode 100644 (file)
index 0000000..123de57
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef ALITPCCALDET_H
+#define ALITPCCALDET_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  TPC calibration class for parameters which are saved per detector        //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "TNamed.h"
+
+class AliTPCCalDet : public TNamed {
+
+ public:
+  enum { kNdet = 72 };
+  AliTPCCalDet();
+  AliTPCCalDet(const Text_t* name, const Text_t* title);
+  AliTPCCalDet(const AliTPCCalDet &c);   
+  virtual ~AliTPCCalDet();
+  AliTPCCalDet &operator=(const AliTPCCalDet &c);
+
+  virtual void     Copy(TObject &c) const;
+  Float_t GetValue(Int_t d) { return fData[d]; };
+  void SetValue(Int_t d, Float_t value) { fData[d] = value; };
+  
+  protected:
+
+  Float_t  fData[kNdet];                          //[kNdet] Data
+
+  ClassDef(AliTPCCalDet,1)                      //  TPC calibration class for parameters which are saved per detector
+
+};
+
+#endif
diff --git a/TPC/AliTPCCalPad.cxx b/TPC/AliTPCCalPad.cxx
new file mode 100644 (file)
index 0000000..c9a0a95
--- /dev/null
@@ -0,0 +1,108 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  TPC calibration class for parameters which saved per pad                 //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTPCCalPad.h"
+#include "AliTPCCalROC.h"
+//#include "AliTPCCalDet.h"
+
+ClassImp(AliTPCCalPad)
+
+//_____________________________________________________________________________
+AliTPCCalPad::AliTPCCalPad():TNamed()
+{
+  //
+  // AliTPCCalPad default constructor
+  //
+
+  for (Int_t isec = 0; isec < kNsec; isec++) {
+    fROC[isec] = 0;
+  }
+
+}
+
+//_____________________________________________________________________________
+AliTPCCalPad::AliTPCCalPad(const Text_t *name, const Text_t *title)
+                :TNamed(name,title)
+{
+  //
+  // AliTPCCalPad constructor
+  //
+  for (Int_t isec = 0; isec < kNsec; isec++) {
+    fROC[isec] = new AliTPCCalROC(isec);
+  }
+}
+
+
+//_____________________________________________________________________________
+AliTPCCalPad::AliTPCCalPad(const AliTPCCalPad &c):TNamed(c)
+{
+  //
+  // AliTPCCalPad copy constructor
+  //
+
+  ((AliTPCCalPad &) c).Copy(*this);
+
+}
+
+///_____________________________________________________________________________
+AliTPCCalPad::~AliTPCCalPad()
+{
+  //
+  // AliTPCCalPad destructor
+  //
+
+  for (Int_t isec = 0; isec < kNsec; isec++) {
+    if (fROC[isec]) {
+      delete fROC[isec];
+      fROC[isec] = 0;
+    }
+  }
+
+}
+
+//_____________________________________________________________________________
+AliTPCCalPad &AliTPCCalPad::operator=(const AliTPCCalPad &c)
+{
+  //
+  // Assignment operator
+  //
+
+  if (this != &c) ((AliTPCCalPad &) c).Copy(*this);
+  return *this;
+
+}
+
+//_____________________________________________________________________________
+void AliTPCCalPad::Copy(TObject &c) const
+{
+  //
+  // Copy function
+  //
+
+  for (Int_t isec = 0; isec < kNsec; isec++) {
+    if (fROC[isec]) {
+      fROC[isec]->Copy(*((AliTPCCalPad &) c).fROC[isec]);
+    }
+  }
+  TObject::Copy(c);
+}
diff --git a/TPC/AliTPCCalPad.h b/TPC/AliTPCCalPad.h
new file mode 100644 (file)
index 0000000..cc0235e
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef ALITPCCALPAD_H
+#define ALITPCCALPAD_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  TPC calibration class for parameters which are saved per pad                 //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "TNamed.h"
+
+class AliTPCCalROC;
+class AliTPCCalDet;
+
+class AliTPCCalPad : public TNamed {
+
+ public:
+  enum { kNsec = 72 };
+
+  AliTPCCalPad();
+  AliTPCCalPad(const Text_t* name, const Text_t* title);
+  AliTPCCalPad(const AliTPCCalPad &c);   
+  virtual ~AliTPCCalPad();
+  AliTPCCalPad &operator=(const AliTPCCalPad &c);
+  virtual void     Copy(TObject &c) const;
+  AliTPCCalROC *GetCalROC(Int_t sector) const { return fROC[sector]; };  
+ protected:
+  AliTPCCalROC *fROC[kNsec];                    //  Array of ROC objects which contain the values per pad
+  ClassDef(AliTPCCalPad,1)                      //  TPC calibration class for parameters which are saved per pad
+
+};
+
+#endif
diff --git a/TPC/AliTPCCalROC.cxx b/TPC/AliTPCCalROC.cxx
new file mode 100644 (file)
index 0000000..f6b8d86
--- /dev/null
@@ -0,0 +1,130 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  Calibration base class for a single ROC                                  //
+//  Contains one float value per pad                                         //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTPCCalROC.h"
+#include "TMath.h"
+
+ClassImp(AliTPCCalROC)
+  Int_t  AliTPCCalROC::fgNSectorsAll =0;
+Int_t  AliTPCCalROC::fgNSectors[2]={0,0};
+Int_t  AliTPCCalROC::fgNRows[2]={0,0};
+Int_t *AliTPCCalROC::fgNPads[2]={0,0};
+Int_t *AliTPCCalROC::fgRowPosIndex[2] ={0,0}; 
+Int_t  AliTPCCalROC::fgNChannels[2]={0,0};
+
+void AliTPCCalROC::Init(){
+  //
+  // initialize static variables
+  //
+  if (AliTPCCalROC::fgNSectorsAll>0) return;
+  fgNSectorsAll =72;
+  fgNSectors[0] =36;
+  fgNSectors[1] =36;
+  //
+  fgNRows[0]= 63;
+  fgNRows[1]= 96;
+  //
+  // number of pads in padrow
+  fgNPads[0] = new Int_t[fgNRows[0]];
+  fgNPads[1] = new Int_t[fgNRows[1]];  
+  //
+  // padrow index in array
+  //
+  fgRowPosIndex[0] = new Int_t[fgNRows[0]];
+  fgRowPosIndex[1] = new Int_t[fgNRows[1]];
+  //
+  // inner sectors
+  //
+  Int_t index =0;
+  for (Int_t irow=0; irow<fgNRows[0];irow++){
+    Int_t npads = (irow==0) ? 68 : 2 *Int_t(Double_t(irow)/3. +33.67);
+    fgNPads[0][irow] = npads;
+    fgRowPosIndex[0][irow] = index;
+    index+=npads;
+  }
+  fgNChannels[0] = index;
+  //
+  index =0;
+  Double_t k1 = 10.*TMath::Tan(10*TMath::DegToRad())/6.;
+  Double_t k2 = 15.*TMath::Tan(10*TMath::DegToRad())/6.;
+  for (Int_t irow=0; irow<fgNRows[1];irow++){    
+    Int_t npads = (irow<64) ? 
+      2*Int_t(k1*Double_t(irow)+37.75):
+      2*Int_t(k2*Double_t(irow-64)+56.66);
+    fgNPads[1][irow] = npads;
+    fgRowPosIndex[1][irow] = index;
+    index+=npads;
+  }
+  fgNChannels[1] = index;
+}
+
+
+//_____________________________________________________________________________
+AliTPCCalROC::AliTPCCalROC():TObject()
+{
+  //
+  // Default constructor
+  //
+  fSector       = -1;
+  fIndex        = 0;
+  fData         = 0;
+}
+
+//_____________________________________________________________________________
+AliTPCCalROC::AliTPCCalROC(Int_t sector):TObject()
+{
+  //
+  // Constructor that initializes a given sector
+  //
+  Init();
+  fSector = sector;
+  fIndex  = (sector<fgNSectors[0]) ? 0:1;      
+  fData = new Float_t[fgNChannels[fIndex]];
+}
+
+//_____________________________________________________________________________
+AliTPCCalROC::AliTPCCalROC(const AliTPCCalROC &c):TObject(c)
+{
+  //
+  // AliTPCCalROC copy constructor
+  //
+  fSector = c.fSector;
+  fIndex  = c.fIndex;
+  Int_t nchannels =  fgNChannels[fIndex];
+  fData   = new Float_t[nchannels];
+  for (Int_t idata = 0; idata< nchannels; idata++) fData[idata] = c.fData[idata];
+}
+
+//_____________________________________________________________________________
+AliTPCCalROC::~AliTPCCalROC()
+{
+  //
+  // AliTPCCalROC destructor
+  //
+
+  if (fData) {
+    delete [] fData;
+    fData = 0;
+  }
+}
+
diff --git a/TPC/AliTPCCalROC.h b/TPC/AliTPCCalROC.h
new file mode 100644 (file)
index 0000000..bc0db01
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef ALITPCCALROC_H
+#define ALITPCCALROC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliTPCCalROC.h,v */
+
+//////////////////////////////////////////////////
+//                                              //
+//  TPC calibration base class for one ROC      //
+//                                              //
+//////////////////////////////////////////////////
+
+#include <TObject.h>
+
+//_____________________________________________________________________________
+class AliTPCCalROC : public TObject {
+
+ public:
+  
+  AliTPCCalROC();
+  AliTPCCalROC(Int_t sector);
+  AliTPCCalROC(const AliTPCCalROC &c);
+  virtual           ~AliTPCCalROC();  
+  Int_t        GetNrows() const                  { return fgNRows[fIndex]; };
+  Int_t        GetNchannels()       const       { return fgNChannels[fIndex];   };
+  Float_t      GetValue(Int_t row, Int_t pad)  { return fData[fgRowPosIndex[fIndex][row]+pad]; };
+  void         SetValue(Int_t row, Int_t pad, Float_t vd)
+                                                {  fData[fgRowPosIndex[fIndex][row]+pad]= vd; };
+  static void Init(); 
+ public:
+  Int_t     fSector;          // sector number
+  Int_t     fIndex;           // 0- if inner 1- outer
+  Float_t  *fData;            //[fNchannels] Data
+  //
+  static Int_t  fgNSectorsAll;     // number of sectors
+  static Int_t  fgNSectors[2];     // number of sectors - inner outer
+  static Int_t  fgNRows[2];        // number of row     - inner outer
+  static Int_t  fgNChannels[2];    // total number of pads   - inner sector - outer sector
+  static Int_t *fgNPads[2];        // number of pads in row  - inner - outer      
+  static Int_t *fgRowPosIndex[2];  // index array            - inner - outer
+  // 
+  ClassDef(AliTPCCalROC,1)    //  TPC ROC calibration class
+
+};
+
+#endif