]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDarrayADC.h
Added macros for production using Geant4. 3 different physics lists can be used:...
[u/mrichter/AliRoot.git] / TRD / AliTRDarrayADC.h
index e7c6e7cbf9662d34de6c9f77931da2eb007ba3b5..17c09349db1cc7a3ae065b5e427164cb1bf334ee 100644 (file)
-#ifndef ALITRDARRAYADC_H\r
-#define ALITRDARRAYADC_H\r
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * \r
- * See cxx source for full Copyright notice */ \r
-\r
-/* $Id: AliTRDarrayADC.h 23387 2008-01-17 17:25:16Z cblume $ */\r
-\r
-///////////////////////////////////////////////\r
-//                                           //\r
-// Container class for ADC values            //\r
-//                                           // \r
-///////////////////////////////////////////////\r
-\r
-#include <TObject.h>\r
-\r
-class AliTRDarrayADC: public TObject\r
-{\r
- public:\r
-\r
-  AliTRDarrayADC();\r
-  AliTRDarrayADC(Int_t nrow, Int_t ncol, Int_t ntime);\r
-  AliTRDarrayADC(const AliTRDarrayADC &b);\r
-  ~AliTRDarrayADC();\r
-  AliTRDarrayADC &operator=(const AliTRDarrayADC &b);\r
-\r
-  void    Allocate(Int_t nrow, Int_t ncol, Int_t ntime);\r
-  void    SetNdet(Int_t ndet) {fNdet=ndet;};  \r
-  Int_t   GetNdet()  const {return fNdet;};\r
-  void    SetDataByAdcCol(Int_t nrow, Int_t ncol, Int_t ntime, Short_t value)\r
-                        {fADC[(nrow*fNumberOfChannels+ncol)*fNtime+ntime]=value;};\r
-  Bool_t  HasData() const {return fNtime ? 1 : 0;};\r
-  Short_t GetDataByAdcCol(Int_t nrow, Int_t ncol, Int_t ntime) const\r
-                         {return fADC[(nrow*fNumberOfChannels+ncol)*fNtime+ntime];};\r
-  inline  void GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const;\r
-  Short_t GetDataBits(Int_t nrow, Int_t ncol, Int_t ntime) const;\r
-  UChar_t GetPadStatus(Int_t nrow, Int_t ncol, Int_t ntime) const;\r
-  void    SetPadStatus(Int_t nrow, Int_t ncol, Int_t ntime, UChar_t status);\r
-  Bool_t  IsPadCorrupted(Int_t nrow, Int_t ncol, Int_t ntime);\r
-  void    Compress();\r
-  void    Expand();\r
-  Int_t   GetNtime() const {return fNtime;};\r
-  Int_t   GetNrow() const {return fNrow;};\r
-  Int_t   GetNcol() const {return fNcol;};\r
-  Int_t   GetDim() const {return fNAdim;};\r
-  void    DeleteNegatives();\r
-  void    Reset();\r
-  Short_t GetData(Int_t nrow, Int_t ncol, Int_t ntime) const;\r
-  void    SetData(Int_t nrow, Int_t ncol, Int_t ntime, Short_t value);\r
-  static  void    CreateLut(); \r
-  void    SubtractBaseline(Short_t baseline);\r
-\r
- protected:\r
-\r
-  Int_t fNdet;    //ID number of the chamber\r
-  Int_t fNrow;    //Number of rows\r
-  Int_t fNcol;    //Number of columns(pads)\r
-  Int_t fNumberOfChannels;  //  Number of MCM channels per row\r
-  Int_t fNtime;   //Number of time bins\r
-  Int_t fNAdim;   //Dimension of the ADC array\r
-  Short_t* fADC;  //[fNAdim]   //Pointer to adc values\r
-  static Short_t *fgLutPadNumbering;   //  [fNcol] Look Up Table\r
-\r
-  ClassDef(AliTRDarrayADC,4) //ADC container class\r
-    \r
-};\r
-\r
-inline void AliTRDarrayADC::GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const\r
-{\r
-  Int_t colNum = fgLutPadNumbering[c];\r
-  for(Int_t ic=n, idx = (r*fNumberOfChannels+colNum)*fNtime+t; ic--; idx+=fNtime) vals[ic] = fADC[idx];\r
- }\r
-\r
-#endif \r
-\r
+#ifndef ALITRDARRAYADC_H
+#define ALITRDARRAYADC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * 
+ * See cxx source for full Copyright notice */ 
+
+/* $Id: AliTRDarrayADC.h 23387 2008-01-17 17:25:16Z cblume $ */
+
+///////////////////////////////////////////////
+//                                           //
+// Container class for ADC values            //
+//                                           // 
+///////////////////////////////////////////////
+
+#include <TObject.h>
+
+class AliTRDSignalIndex;
+class AliTRDarrayADC: public TObject
+{
+ public:
+
+  AliTRDarrayADC();
+  AliTRDarrayADC(Int_t nrow, Int_t ncol, Int_t ntime);
+  AliTRDarrayADC(const AliTRDarrayADC &b);
+  ~AliTRDarrayADC();
+  AliTRDarrayADC &operator=(const AliTRDarrayADC &b);
+
+  void    Allocate(Int_t nrow, Int_t ncol, Int_t ntime);
+  void    SetNdet(Int_t ndet) {fNdet=ndet;};  
+  Int_t   GetNdet()  const {return fNdet;};
+  void    SetDataByAdcCol(Int_t nrow, Int_t ncol, Int_t ntime, Short_t value)
+                         {fADC[(nrow*fNumberOfChannels+ncol)*fNtime+ntime]=value;}
+  Bool_t  HasData() const {return fNtime ? 1 : 0;};
+  Short_t GetDataByAdcCol(Int_t nrow, Int_t ncol, Int_t ntime) const
+                         {return fADC[(nrow*fNumberOfChannels+ncol)*fNtime+ntime];};
+  inline  void GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const;
+  Short_t GetDataBits(Int_t nrow, Int_t ncol, Int_t ntime) const;
+  UChar_t GetPadStatus(Int_t nrow, Int_t ncol, Int_t ntime) const;
+  void    SetPadStatus(Int_t nrow, Int_t ncol, Int_t ntime, UChar_t status);
+  Bool_t  IsPadCorrupted(Int_t nrow, Int_t ncol, Int_t ntime);
+  void    Compress();
+  void    Expand();
+  Int_t   GetNtime() const {return fNtime;};
+  Int_t   GetNrow() const {return fNrow;};
+  Int_t   GetNcol() const {return fNcol;};
+  Int_t   GetDim() const {return fNAdim;};
+  void    DeleteNegatives();
+  void    Reset();
+  void    ConditionalReset(AliTRDSignalIndex* idx);
+  inline  Short_t* GetDataAddress(Int_t nrow, Int_t ncol, Int_t ntime = 0) const;
+  inline  Short_t GetData(Int_t nrow, Int_t ncol, Int_t ntime) const;
+  inline  void    SetData(Int_t nrow, Int_t ncol, Int_t ntime, Short_t value);
+  static  void    CreateLut(); 
+
+ protected:
+
+  Int_t fNdet;    //ID number of the chamber
+  Int_t fNrow;    //Number of rows
+  Int_t fNcol;    //Number of columns(pads)
+  Int_t fNumberOfChannels;  //  Number of MCM channels per row
+  Int_t fNtime;   //Number of time bins
+  Int_t fNAdim;   //Dimension of the ADC array
+  Short_t* fADC;  //[fNAdim]   //Pointer to adc values
+  static Short_t *fgLutPadNumbering;   //  [fNcol] Look Up Table
+
+  ClassDef(AliTRDarrayADC,4) //ADC container class
+    
+};
+
+//________________________________________________________________________________
+Short_t* AliTRDarrayADC::GetDataAddress(Int_t nrow, Int_t ncol, Int_t ntime) const
+{
+  //
+  // Get the address of the given pad
+  //
+
+  Int_t corrcolumn = fgLutPadNumbering[ncol];
+
+  return &fADC[(nrow*fNumberOfChannels+corrcolumn)*fNtime+ntime];
+
+}
+//________________________________________________________________________________
+Short_t AliTRDarrayADC::GetData(Int_t nrow, Int_t ncol, Int_t ntime) const
+{
+  //
+  // Get the data using the pad numbering.
+  // To access data using the mcm scheme use instead
+  // the method GetDataByAdcCol
+  //
+
+  Int_t corrcolumn = fgLutPadNumbering[ncol];
+
+  return fADC[(nrow*fNumberOfChannels+corrcolumn)*fNtime+ntime];
+
+}
+//________________________________________________________________________________
+void AliTRDarrayADC::SetData(Int_t nrow, Int_t ncol, Int_t ntime, Short_t value)
+{
+  //
+  // Set the data using the pad numbering.
+  // To write data using the mcm scheme use instead
+  // the method SetDataByAdcCol
+  //
+
+  Int_t colnumb = fgLutPadNumbering[ncol];
+
+  fADC[(nrow*fNumberOfChannels+colnumb)*fNtime+ntime] = value;
+
+}
+
+void AliTRDarrayADC::GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const
+{
+  Int_t colNum = fgLutPadNumbering[c];
+  for(Int_t ic=n, idx = (r*fNumberOfChannels+colNum)*fNtime+t; ic--; idx+=fNtime) vals[ic] = fADC[idx];
+ }
+
+#endif 
+