--- /dev/null
+/**************************************************************************
+ * 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$ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Calibration base class for a single ROC //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTRDCalROC.h"
+
+ClassImp(AliTRDCalROC)
+
+//_____________________________________________________________________________
+AliTRDCalROC::AliTRDCalROC():TObject()
+{
+ //
+ // Default constructor
+ //
+
+ fPla = 0;
+ fCha = 0;
+
+ fNrows = 0;
+ fNcols = 0;
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalROC::AliTRDCalROC(Int_t p, Int_t c):TObject()
+{
+ //
+ // Constructor that initializes a given pad plane type
+ //
+
+ fPla = p;
+ fCha = c;
+
+ fNcols = 144;
+
+ //
+ // The pad plane parameter
+ //
+ switch (p) {
+ case 0:
+ if (c == 2) {
+ // L0C0 type
+ fNrows = 12;
+ }
+ else {
+ // L0C1 type
+ fNrows = 16;
+ }
+ break;
+ case 1:
+ if (c == 2) {
+ // L1C0 type
+ fNrows = 12;
+ }
+ else {
+ // L1C1 type
+ fNrows = 16;
+ }
+ break;
+ case 2:
+ if (c == 2) {
+ // L2C0 type
+ fNrows = 12;
+ }
+ else {
+ // L2C1 type
+ fNrows = 16;
+ }
+ break;
+ case 3:
+ if (c == 2) {
+ // L3C0 type
+ fNrows = 12;
+ }
+ else {
+ // L3C1 type
+ fNrows = 16;
+ }
+ break;
+ case 4:
+ if (c == 2) {
+ // L4C0 type
+ fNrows = 12;
+ }
+ else {
+ // L4C1 type
+ fNrows = 16;
+ }
+ break;
+ case 5:
+ if (c == 2) {
+ // L5C0 type
+ fNrows = 12;
+ }
+ else {
+ // L5C1 type
+ fNrows = 16;
+ }
+ break;
+ };
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalROC::AliTRDCalROC(const AliTRDCalROC &c):TObject(c)
+{
+ //
+ // AliTRDCalROC copy constructor
+ //
+
+ ((AliTRDCalROC &) c).Copy(*this);
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalROC::~AliTRDCalROC()
+{
+ //
+ // AliTRDCalROC destructor
+ //
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalROC &AliTRDCalROC::operator=(const AliTRDCalROC &c)
+{
+ //
+ // Assignment operator
+ //
+
+ if (this != &c) ((AliTRDCalROC &) c).Copy(*this);
+ return *this;
+
+}
+
+//_____________________________________________________________________________
+void AliTRDCalROC::Copy(TObject &c) const
+{
+ //
+ // Copy function
+ //
+
+ ((AliTRDCalROC &) c).fPla = fPla;
+ ((AliTRDCalROC &) c).fCha = fCha;
+
+ ((AliTRDCalROC &) c).fNrows = fNrows;
+ ((AliTRDCalROC &) c).fNcols = fNcols;
+
+ TObject::Copy(c);
+
+}
+
--- /dev/null
+#ifndef ALITRDCALROC_H
+#define ALITRDCALROC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id: AliTRDCalROC.h,v */
+
+//////////////////////////////////////////////////
+// //
+// TRD calibration base class for one ROC //
+// //
+//////////////////////////////////////////////////
+
+#include <TObject.h>
+
+//_____________________________________________________________________________
+class AliTRDCalROC : public TObject {
+
+ public:
+
+ 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;
+
+ Int_t GetNrows() const { return fNrows; };
+ Int_t GetNcols() const { return fNcols; };
+
+ protected:
+
+ Int_t fPla; // Plane number
+ Int_t fCha; // Chamber number
+
+ Int_t fNrows; // Number of rows
+ Int_t fNcols; // Number of columns
+
+ ClassDef(AliTRDCalROC,1) // TRD ROC calibration class
+
+};
+
+#endif
--- /dev/null
+/**************************************************************************
+ * 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$ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Calibration base class for a single ROC //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTRDCalROCVdrift.h"
+
+ClassImp(AliTRDCalROCVdrift)
+
+//_____________________________________________________________________________
+AliTRDCalROCVdrift::AliTRDCalROCVdrift():AliTRDCalROC()
+{
+ //
+ // Default constructor
+ //
+
+ fNchannels = 0;
+ fVdrift = 0;
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalROCVdrift::AliTRDCalROCVdrift(Int_t p, Int_t c)
+ :AliTRDCalROC(p,c)
+{
+ //
+ // Constructor that initializes a given pad plane type
+ //
+
+ fNchannels = fNrows * fNcols;
+ fVdrift = new Float_t[fNchannels];
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalROCVdrift::AliTRDCalROCVdrift(const AliTRDCalROCVdrift &c)
+ :AliTRDCalROC(c)
+{
+ //
+ // AliTRDCalROCVdrift copy constructor
+ //
+
+ ((AliTRDCalROCVdrift &) c).Copy(*this);
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalROCVdrift::~AliTRDCalROCVdrift()
+{
+ //
+ // AliTRDCalROCVdrift destructor
+ //
+
+ if (fVdrift) {
+ delete [] fVdrift;
+ fVdrift = 0;
+ }
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalROCVdrift &AliTRDCalROCVdrift::operator=(const AliTRDCalROCVdrift &c)
+{
+ //
+ // Assignment operator
+ //
+
+ if (this != &c) ((AliTRDCalROCVdrift &) c).Copy(*this);
+ return *this;
+
+}
+
+//_____________________________________________________________________________
+void AliTRDCalROCVdrift::Copy(TObject &c) const
+{
+ //
+ // Copy function
+ //
+
+ Int_t iBin = 0;
+
+ ((AliTRDCalROCVdrift &) c).fNchannels = fNchannels;
+
+ if (((AliTRDCalROCVdrift &) c).fVdrift) delete [] ((AliTRDCalROCVdrift &) c).fVdrift;
+ ((AliTRDCalROCVdrift &) c).fVdrift = new Float_t[fNchannels];
+ for (iBin = 0; iBin < fNchannels; iBin++) {
+ ((AliTRDCalROCVdrift &) c).fVdrift[iBin] = fVdrift[iBin];
+ }
+
+ AliTRDCalROC::Copy(c);
+
+}
+
--- /dev/null
+#ifndef ALITRDCALROCVDRIFT_H
+#define ALITRDCALROCVDRIFT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id: AliTRDCalROCVdrift.h,v */
+
+///////////////////////////////////////////////////
+// //
+// TRD calibration class for Vdrift in one ROC //
+// //
+///////////////////////////////////////////////////
+
+#include "AliTRDCalROC.h"
+
+//_____________________________________________________________________________
+class AliTRDCalROCVdrift : public AliTRDCalROC {
+
+ public:
+
+ AliTRDCalROCVdrift();
+ AliTRDCalROCVdrift(Int_t p, Int_t c);
+ AliTRDCalROCVdrift(const AliTRDCalROCVdrift &c);
+ virtual ~AliTRDCalROCVdrift();
+ AliTRDCalROCVdrift &operator=(const AliTRDCalROCVdrift &c);
+ virtual void Copy(TObject &c) const;
+
+ Int_t GetChannel(Int_t c, Int_t r) { return r+c*fNrows; };
+ Int_t GetNchannels() const { return fNchannels; };
+ Float_t GetVdrift(Int_t ich) const { return fVdrift[ich]; };
+ Float_t GetVdrift(Int_t col, Int_t row) { return fVdrift[GetChannel(col,row)]; };
+
+ void SetVdrift(Int_t ich, Float_t vd) { fVdrift[ich] = vd; };
+ void SetVdrift(Int_t col, Int_t row, Float_t vd)
+ { fVdrift[GetChannel(col,row)] = vd; };
+
+ protected:
+
+ Int_t fNchannels; // Number of channels
+ Float_t *fVdrift; //[fNchannels] Drift velocities
+
+ ClassDef(AliTRDCalROCVdrift,1) // TRD ROC calibration class for Vdrift
+
+};
+
+#endif
--- /dev/null
+/**************************************************************************
+ * 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$ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// TRD calibration class for Vdrift //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTRDCalVdrift.h"
+#include "AliTRDCalROCVdrift.h"
+
+ClassImp(AliTRDCalVdrift)
+
+//_____________________________________________________________________________
+AliTRDCalVdrift::AliTRDCalVdrift():TNamed()
+{
+ //
+ // AliTRDCalVdrift default constructor
+ //
+
+ for (Int_t idet = 0; idet < kNdet; idet++) {
+ fROCVdrift[idet] = 0;
+ }
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalVdrift::AliTRDCalVdrift(const Text_t *name, const Text_t *title)
+ :TNamed(name,title)
+{
+ //
+ // AliTRDCalVdrift constructor
+ //
+
+ for (Int_t isec = 0; isec < kNsect; isec++) {
+ for (Int_t ipla = 0; ipla < kNplan; ipla++) {
+ for (Int_t icha = 0; icha < kNcham; icha++) {
+ Int_t idet = GetDet(ipla,icha,isec);
+ fROCVdrift[idet] = new AliTRDCalROCVdrift(ipla,icha);
+ }
+ }
+ }
+
+}
+
+
+//_____________________________________________________________________________
+AliTRDCalVdrift::AliTRDCalVdrift(const AliTRDCalVdrift &c):TNamed(c)
+{
+ //
+ // AliTRDCalVdrift copy constructor
+ //
+
+ ((AliTRDCalVdrift &) c).Copy(*this);
+
+}
+
+///_____________________________________________________________________________
+AliTRDCalVdrift::~AliTRDCalVdrift()
+{
+ //
+ // AliTRDCalVdrift destructor
+ //
+
+ for (Int_t idet = 0; idet < kNdet; idet++) {
+ if (fROCVdrift[idet]) {
+ delete fROCVdrift[idet];
+ fROCVdrift[idet] = 0;
+ }
+ }
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalVdrift &AliTRDCalVdrift::operator=(const AliTRDCalVdrift &c)
+{
+ //
+ // Assignment operator
+ //
+
+ if (this != &c) ((AliTRDCalVdrift &) c).Copy(*this);
+ return *this;
+
+}
+
+//_____________________________________________________________________________
+void AliTRDCalVdrift::Copy(TObject &c) const
+{
+ //
+ // Copy function
+ //
+
+ for (Int_t idet = 0; idet < kNdet; idet++) {
+ if (fROCVdrift[idet]) {
+ fROCVdrift[idet]->Copy(*((AliTRDCalVdrift &) c).fROCVdrift[idet]);
+ }
+ }
+
+ TObject::Copy(c);
+
+}
+
--- /dev/null
+#ifndef ALITRDCALVDRIFT_H
+#define ALITRDCALVDRIFT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// TRD calibration class for Vdrift //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "TNamed.h"
+
+class AliTRDCalROCVdrift;
+
+class AliTRDCalVdrift : public TNamed {
+
+ public:
+
+ enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
+
+ AliTRDCalVdrift();
+ AliTRDCalVdrift(const Text_t* name, const Text_t* title);
+ AliTRDCalVdrift(const AliTRDCalVdrift &c);
+ virtual ~AliTRDCalVdrift();
+ AliTRDCalVdrift &operator=(const AliTRDCalVdrift &c);
+
+ virtual void Copy(TObject &c) const;
+
+ Int_t GetDet(Int_t p, Int_t c, Int_t s) { return p+c*kNplan+s*kNplan*kNcham; };
+
+ AliTRDCalROCVdrift *GetCalROCVdrift(Int_t d) { return fROCVdrift[d]; };
+ AliTRDCalROCVdrift *GetCalROCVdrift(Int_t p, Int_t c, Int_t s)
+ { return fROCVdrift[GetDet(p,c,s)]; };
+
+ protected:
+
+ AliTRDCalROCVdrift *fROCVdrift[kNdet]; // Array of ROC Vdrift objects
+
+ ClassDef(AliTRDCalVdrift,1) // TRD calibration class for Vdrift
+
+};
+
+#endif
--- /dev/null
+
+AliCDBStorage *storLoc;
+AliCDBStorage *storGrid;
+AliCDBEntry *entry = 0;
+AliTRDCalVdrift *calobj = 0;
+AliTRDCalROCVdrift *calobjROC = 0;
+
+void AliTRDDBAccessTRD()
+{
+
+ // Single instance of AliCDBManager.
+ AliCDBManager *man = AliCDBManager::Instance();
+
+ printf("\nTRD :: Activating Local storage...\n");
+ storLoc = man->GetStorage("local://DBLocal");
+
+ // Create the new database object
+ AliTRDCalVdrift *calVdrift = new AliTRDCalVdrift("Vdrift","TRD drift velocities");
+ AliTRDCalROCVdrift *calROCVdrift = calVdrift->GetCalROCVdrift(0,2,0);
+ calROCVdrift->SetVdrift(1,1,1.50);
+ calROCVdrift->SetVdrift(2,2,1.55);
+ calROCVdrift->SetVdrift(3,3,1.60);
+
+ // Id of the object: AliCDBId("name", firstRun, lastRun)
+ AliCDBId id1("TRD/Calib/Vdrift",0,10);
+
+ // MetaData describing the object
+ AliCDBMetaData *md1= new AliCDBMetaData();
+ md1->SetObjectClassName("AliTRDCalVdrift");
+ md1->SetResponsible("Christoph Blume");
+ md1->SetBeamPeriod(1);
+ md1->SetAliRootVersion("05-04-00"); //root version
+ md1->SetComment("This ist a Vdrift test");
+ md1->SetProperty("key1",calVdrift);
+
+ // Store the object into local storage
+ // Filename: DBLocal/TRD/Calib/Vdrift/Run0_10_v0_s0.root
+ printf("\nTRD :: Storing object into local storage...\n");
+ storLoc->Put(calVdrift,id1,md1);
+
+ // Read, update, store again
+ printf("\nTRD :: Retrieve object from local storage...\n");
+ entry = storLoc->Get("TRD/Calib/Vdrift",5);
+
+ calobj = (AliTRDCalVdrift *) entry->GetObject();
+ calobjROC = calobj->GetCalROCVdrift(0,2,0);
+ printf("\nTRD :: Drift velocities (1): %f (1,1), %f (2,2), %f (3.3)\n"
+ ,calobjROC->GetVdrift(1,1)
+ ,calobjROC->GetVdrift(2,2)
+ ,calobjROC->GetVdrift(3,3));
+
+ // Update object
+ calobjROC->SetVdrift(1,1,1.60);
+ calobjROC->SetVdrift(2,2,1.35);
+ calobjROC->SetVdrift(3,3,1.10);
+
+ // Store into local: filename = Run0_10_v0_s1.root
+ printf("\nTRD :: Storing object into local storage...\n");
+ storLoc->Put(entry);
+
+ // Read, update, store again
+ printf("\nTRD :: Retrieve object from local storage...\n");
+ entry = storLoc->Get("TRD/Calib/Vdrift",5);
+
+ calobj = (AliTRDCalVdrift *) entry->GetObject();
+ calobjROC = calobj->GetCalROCVdrift(0,2,0);
+ printf("\nTRD :: Drift velocities (2): %f (1,1), %f (2,2), %f (3.3)\n"
+ ,calobjROC->GetVdrift(1,1)
+ ,calobjROC->GetVdrift(2,2)
+ ,calobjROC->GetVdrift(3,3));
+
+ printf("\nTRD :: Activating GRID storage...\n");
+ storGrid = 0x0;
+ storGrid = man->GetStorage("alien://aliendb4.cern.ch:9000;cblume;DBGrid;ALICE::CERN::se01");
+ if (!storGrid) {
+ printf("\nTRD :: Failure in activating GRID storage...\n");
+ }
+
+ // Store into GRID: filename = DBGrid/TRD/Calib/Vdrift/Run0_10_v1.root
+ if (storGrid) {
+ storGrid->Put(entry);
+ }
+
+ AliCDBManager::Instance()->Destroy();
+ delete entry;
+ delete md1;
+
+}
padSignal[4] = TMath::Abs(digits->GetDataUnchecked(row,col+2,time));
}
clusterPads[1] = GetCOG(padSignal);
- Double_t check = fPar->LUTposition(iplan,clusterSignal[0]
- ,clusterSignal[1]
- ,clusterSignal[2]);
+ //Double_t check = fPar->LUTposition(iplan,clusterSignal[0]
+ // ,clusterSignal[1]
+ // ,clusterSignal[2]);
// Float_t diff = clusterPads[1] - check;
}
#pragma link C++ class AliTRDrawData+;
#pragma link C++ class AliTRDRawStream+;
+#pragma link C++ class AliTRDCalROC+;
+#pragma link C++ class AliTRDCalROCVdrift+;
+#pragma link C++ class AliTRDCalVdrift+;
+
#endif
AliTRDdigitsManager.cxx \
AliTRDrawData.cxx \
AliTRDpadPlane.cxx \
- AliTRDRawStream.cxx
+ AliTRDRawStream.cxx \
+ AliTRDCalROC.cxx \
+ AliTRDCalROCVdrift.cxx \
+ AliTRDCalVdrift.cxx
HDRS= $(SRCS:.cxx=.h)