From 076275918beba30c4af4adf5ea24412b6514f1ce Mon Sep 17 00:00:00 2001 From: kowal2 Date: Fri, 24 Mar 2006 09:24:09 +0000 Subject: [PATCH] Calibration classes (prototypes) --- TPC/AliTPCCalDet.cxx | 102 +++++++++++++++++++++++++++++++++ TPC/AliTPCCalDet.h | 38 +++++++++++++ TPC/AliTPCCalPad.cxx | 108 +++++++++++++++++++++++++++++++++++ TPC/AliTPCCalPad.h | 38 +++++++++++++ TPC/AliTPCCalROC.cxx | 130 +++++++++++++++++++++++++++++++++++++++++++ TPC/AliTPCCalROC.h | 47 ++++++++++++++++ 6 files changed, 463 insertions(+) create mode 100644 TPC/AliTPCCalDet.cxx create mode 100644 TPC/AliTPCCalDet.h create mode 100644 TPC/AliTPCCalPad.cxx create mode 100644 TPC/AliTPCCalPad.h create mode 100644 TPC/AliTPCCalROC.cxx create mode 100644 TPC/AliTPCCalROC.h diff --git a/TPC/AliTPCCalDet.cxx b/TPC/AliTPCCalDet.cxx new file mode 100644 index 00000000000..ebb772966a2 --- /dev/null +++ b/TPC/AliTPCCalDet.cxx @@ -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 index 00000000000..123de578d29 --- /dev/null +++ b/TPC/AliTPCCalDet.h @@ -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 index 00000000000..c9a0a95f62b --- /dev/null +++ b/TPC/AliTPCCalPad.cxx @@ -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 index 00000000000..cc0235e0270 --- /dev/null +++ b/TPC/AliTPCCalPad.h @@ -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 index 00000000000..f6b8d869a30 --- /dev/null +++ b/TPC/AliTPCCalROC.cxx @@ -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 + +//_____________________________________________________________________________ +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 -- 2.43.0