]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add new FEE parameter class by Ken
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Jun 2007 16:46:51 +0000 (16:46 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Jun 2007 16:46:51 +0000 (16:46 +0000)
TRD/AliTRDfeeParam.cxx [new file with mode: 0644]
TRD/AliTRDfeeParam.h [new file with mode: 0644]
TRD/TRDbaseLinkDef.h
TRD/libTRDbase.pkg

diff --git a/TRD/AliTRDfeeParam.cxx b/TRD/AliTRDfeeParam.cxx
new file mode 100644 (file)
index 0000000..2da453c
--- /dev/null
@@ -0,0 +1,240 @@
+
+/**************************************************************************
+ * 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 front end electronics parameters class  //
+//  Contains all FEE (MCM, TRAP, PASA) related  //
+//  parameters, constants, and mapping.         //
+//                                              //
+//////////////////////////////////////////////////
+
+#include <TMath.h>
+
+#include "AliTRDfeeParam.h"
+#include "AliTRDgeometry.h"
+#include "AliTRDCommonParam.h"
+
+ClassImp(AliTRDfeeParam)
+
+AliTRDfeeParam *AliTRDfeeParam::fgInstance   = 0;
+Bool_t          AliTRDfeeParam::fgTerminated = kFALSE;
+
+//_____________________________________________________________________________
+AliTRDfeeParam* AliTRDfeeParam::Instance()
+{
+  // Instance constructor
+  
+  if (fgTerminated != kFALSE) {
+    return 0;
+  }
+
+  if (fgInstance == 0) {
+    fgInstance = new AliTRDfeeParam();
+  }  
+
+  return fgInstance;
+}
+
+//_____________________________________________________________________________
+void AliTRDfeeParam::Terminate()
+{
+  //
+  // Terminate the class and release memory
+  //
+  
+  fgTerminated = kTRUE;
+
+  if (fgInstance != 0) {
+    delete fgInstance;
+    fgInstance = 0;
+  }
+}
+
+//_____________________________________________________________________________
+AliTRDfeeParam::AliTRDfeeParam()
+  :TObject()
+  //  ,fGeo(0)
+  ,fCP(0)
+  ,fTFaR1(0)
+  ,fTFaR2(0)
+  ,fTFaC1(0)
+  ,fTFaC2(0)
+{
+  //
+  // Default constructor
+  //
+  
+  // PASA V.4
+  if      (fgkTFaNExp == 1) {
+    fTFaR1 = 1.1563;
+    fTFaR2 = 0.1299;
+    fTFaC1 = 0.0657;
+    fTFaC2 = 0.0000;
+  }
+  else if (fgkTFaNExp == 2) {
+    fTFaR1 = 1.1563;
+    fTFaR2 = 0.1299;
+    fTFaC1 = 0.1141;
+    fTFaC2 = 0.6241;
+  }
+
+  //  fGeo = AliTRDgeometry::Instance();
+  fCP  = AliTRDCommonParam::Instance();
+
+}
+
+//_____________________________________________________________________________
+AliTRDfeeParam::AliTRDfeeParam(const AliTRDfeeParam &p)
+  :TObject(p)
+  //  ,fGeo(p.fGeo)
+  ,fCP(p.fCP)
+  ,fTFaR1(p.fTFaR1)
+  ,fTFaR2(p.fTFaR2)
+  ,fTFaC1(p.fTFaC1)
+  ,fTFaC2(p.fTFaC2)
+{
+  //
+  // AliTRDfeeParam copy constructor
+  //
+}
+
+//_____________________________________________________________________________
+AliTRDfeeParam::~AliTRDfeeParam()
+{
+  //
+  // AliTRDfeeParam destructor
+  //
+}
+
+//_____________________________________________________________________________
+AliTRDfeeParam &AliTRDfeeParam::operator=(const AliTRDfeeParam &p)
+{
+  //
+  // Assignment operator
+  //
+
+  if (this != &p) {
+    ((AliTRDfeeParam &) p).Copy(*this);
+  }
+  return *this;
+}
+
+//_____________________________________________________________________________
+void AliTRDfeeParam::Copy(TObject &p) const
+{
+  //
+  // Copy function
+  //
+
+  //  ((AliTRDfeeParam &) p).fGeo     = fGeo;
+  ((AliTRDfeeParam &) p).fCP      = fCP;
+  ((AliTRDfeeParam &) p).fTFaR1   = fTFaR1;
+  ((AliTRDfeeParam &) p).fTFaR2   = fTFaR2;
+  ((AliTRDfeeParam &) p).fTFaC1   = fTFaC1;
+  ((AliTRDfeeParam &) p).fTFaC2   = fTFaC2;
+  
+  TObject::Copy(p);
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDfeeParam::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
+{
+  //
+  // return on which pad row this mcm sits
+  //
+  
+  return fgkNmcmRobInRow*(irob/2) + imcm/fgkNmcmRobInCol;
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDfeeParam::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
+{
+  //
+  // return which pad is connected to this adc channel.
+  // Return -1 if no appropriate pad is found.
+
+  // Caution: ADC ordering in the online data is opposite to the pad column ordering.
+  // And it is not one-by-one correspondence. Precise drawing can be found in:
+  // http://wiki.kip.uni-heidelberg.de/ti/TRD/index.php/Image:ROB_MCM_numbering.pdf
+
+  if (iadc < 0 || iadc > 19 ) return -1;
+  Int_t mcmcol = imcm%fgkNmcmRobInCol + GetRobSide(irob)*fgkNmcmRobInCol;  // MCM column number on ROC [0..7]
+  Int_t padcol = mcmcol*fgkNcolMcm + fgkNcolMcm + 1 - iadc;
+  if( padcol < 0 || padcol >= fgkNcol ) return -1;
+  return padcol;
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDfeeParam::GetMCMfromPad(Int_t irow, Int_t icol) const
+{
+  //
+  // Return on which MCM this pad is directry connected.
+  // Return -1 for error.
+  //
+
+  if ( irow < 0 || icol < 0 || irow > fgkNrowC1 || icol > fgkNcol ) return -1;
+
+  return (icol%(fgkNcol/2))/fgkNcolMcm + fgkNmcmRobInCol*(irow%fgkNmcmRobInRow);
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDfeeParam::GetROBfromPad(Int_t irow, Int_t icol) const
+{
+  //
+  // return on which rob this pad is
+  //
+
+  return (irow/fgkNmcmRobInRow)*2 + GetColSide(icol);
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDfeeParam::GetRobSide(Int_t irob) const
+{
+  //
+  // return on which side this rob sits (A side = 0, B side = 1)
+  //
+
+  if ( irob < 0 || irob >= fgkNrobC1 ) return -1;
+  return irob%2;
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDfeeParam::GetColSide(Int_t icol) const
+{
+  //
+  // return on which side this column sits (A side = 0, B side = 1)
+  //
+
+  if ( icol < 0 || icol >= fgkNcol ) return -1;
+  return icol/(fgkNcol/2);
+}
+
+//
+//void AliTRDfeeParam::GetFilterParam( Float_t &r1, Float_t &r2, Float_t &c1, Float_t &c2, Float_t &ped ) const
+//{
+  //
+  // Return current filter parameter
+  //
+
+  //  r1            = fR1;
+  //r2            = fR2;
+  //c1            = fC1;
+  //c2            = fC2;
+  //ped           = fPedestal;
+//};
diff --git a/TRD/AliTRDfeeParam.h b/TRD/AliTRDfeeParam.h
new file mode 100644 (file)
index 0000000..96b632b
--- /dev/null
@@ -0,0 +1,151 @@
+#ifndef ALITRDFEEPARAM_H
+#define ALITRDFEEPARAM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//////////////////////////////////////////////////
+//                                              //
+//  TRD front end electronics parameters class  //
+//  Contains all FEE (MCM, TRAP, PASA) related  //
+//  parameters, constants, and mapping.         //
+//                                              //
+//////////////////////////////////////////////////
+
+#include <TObject.h>
+
+class AliTRDCommonParam;
+class AliTRDpadPlane;
+class AliTRDgeometry;
+
+//_____________________________________________________________________________
+class AliTRDfeeParam : public TObject
+{
+
+ public:
+
+  AliTRDfeeParam(const AliTRDfeeParam &p);
+  virtual           ~AliTRDfeeParam();
+  AliTRDfeeParam    &operator=(const AliTRDfeeParam &p);
+  virtual void       Copy(TObject &p) const;
+
+  static AliTRDfeeParam *Instance();  // Singleton
+  static void            Terminate();
+
+  // Translation from MCM to Pad and vice versa
+  virtual Int_t    GetPadRowFromMCM(Int_t irob, Int_t imcm) const;
+  virtual Int_t    GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
+  virtual Int_t    GetMCMfromPad(Int_t irow, Int_t icol) const;
+  virtual Int_t    GetROBfromPad(Int_t irow, Int_t icol) const;
+  virtual Int_t    GetRobSide(Int_t irob) const;
+  virtual Int_t    GetColSide(Int_t icol) const;
+
+  static  Float_t  GetSamplingFrequency() { return (Float_t)fgkLHCfrequency / 4000000.0; }
+  static  Int_t    GetNmcmRob()           { return fgkNmcmRob; }
+  static  Int_t    GetNmcmRobInRow()      { return fgkNmcmRobInRow; }
+  static  Int_t    GetNmcmRobInCol()      { return fgkNmcmRobInCol; }
+  static  Int_t    GetNrobC0()            { return fgkNrobC0; }
+  static  Int_t    GetNrobC1()            { return fgkNrobC1; }
+  static  Int_t    GetNadcMcm()           { return fgkNadcMcm; }
+  static  Int_t    GetNtimebin()          { return fgkNtimebin; }
+  static  Int_t    GetNcol()              { return fgkNcol; }
+  static  Int_t    GetNcolMcm()           { return fgkNcolMcm; }
+  static  Int_t    GetNrowC0()            { return fgkNrowC0; }
+  static  Int_t    GetNrowC1()            { return fgkNrowC1; }
+
+  //          Float_t  GetClusThr()           { return fClusThr; };
+  //        Float_t  GetPadThr() const { return fPadThr; };
+  //        Int_t    GetTailCancelation() const { return fTCOn; };
+  //        Int_t    GetNexponential() const { return fTCnexp; };
+  //virtual void     GetFilterParam(Float_t &r1, Float_t &r2, Float_t &c1, Float_t &c2, Float_t &ped) const;
+  //        Int_t    GetFilterType() const { return fFilterType; };
+
+  static  Float_t  GetTFattenuationParam() { return ((Float_t)fgkTFattenuationParameter1) / ((Float_t)fgkTFattenuationParameter2) ; }
+  static  Float_t  GetTFf0()               { return 1 + fgkTFon*(-1+GetTFattenuationParam()); }   // 1 if TC off
+
+ protected:
+
+  static AliTRDfeeParam *fgInstance;
+  static Bool_t          fgTerminated;       //  Defines if this class has already been terminated                                                        
+
+  //  AliTRDgeometry    *fGeo;     // TRD geometry class
+  AliTRDCommonParam *fCP;      // TRD common parameters class
+
+  // Remark: ISO C++ allows initialization of static const values only for integer.
+
+  // Basic Geometrical numbers
+  static const Int_t    fgkLHCfrequency      = 40079000 ; // [Hz] LHC clock (should be moved to STEER?)
+  static const Int_t    fgkNmcmRob           = 16;        // Number of MCMs per ROB         (old fgkMCMmax)
+  static const Int_t    fgkNmcmRobInRow      = 4;         // Number of MCMs per ROB in row dir. (old fgkMCMrow)
+  static const Int_t    fgkNmcmRobInCol      = 4;         // Number of MCMs per ROB in col dir. (old fgkMCMrow)
+  static const Int_t    fgkNrobC0            = 6;         // Number of ROBs per C0 chamber  (old fgkROBmaxC0)
+  static const Int_t    fgkNrobC1            = 8;         // Number of ROBs per C1 chamber  (old fgkROBmaxC1)
+  static const Int_t    fgkNadcMcm           = 21;        // Number of ADC channels per MCM (old fgkADCmax)
+  static const Int_t    fgkNtimebin          = 30;        // Number of Time bins            (old fgkTBmax)
+  static const Int_t    fgkNcol              = 144;       // Number of pads per padplane row(old fgkColmax)
+  static const Int_t    fgkNcolMcm           = 18;        // Number of pads per MCM         (old fgkPadmax)
+  static const Int_t    fgkNrowC0            = 12;        // Number of Rows per C0 chamber  (old fgkRowmaxC0)
+  static const Int_t    fgkNrowC1            = 16;        // Number of Rows per C1 chamber  (old fgkRowmaxC1)
+
+  // ADC intrinsic parameters
+  static const Int_t    fgkADCpedestal       = 100000;    // ADC baseline * 100 (old name fPedestal)
+  static const Int_t    fgkADCnoise          = 10;        // ADC noise    * 100 (not contained in the digitizer) [in ADC] 
+  static const Int_t    fgkADCDAC            = 0;         // 5 bit ADC gain parameter
+
+  // TRAP filter global setup
+  static const Bool_t   fgkPFon              = kTRUE;     // Pedestal Filter enable/disable flag.
+  static const Bool_t   fgkGFon              = kFALSE;    // Gain correction Filter enable/disable flag
+  static const Bool_t   fgkTFon              = kTRUE;     // Tail cancelation Filter enable/disable flag (old name fTCOn)
+
+  // PF setup
+  static const Int_t    fgkPFtimeConstant    =  0;        // 0 for fastest, 3 for slowest (no effect, probably)
+  static const Int_t    fgkPFeffectPedestal  = 10;        // [in ADC units] the desired baseline (Additive)
+
+  // GF setup
+  static const Int_t    fgkGFnoise           =  0;        // Noise level increased by gain filter x 100 [in ADC] (to be measured)
+
+  // TF setup
+  static const Int_t    fgkTFtype                 = 2;    // TC type (0=analog, 1=digital, 2=TRAPsim) (old name fFilterType)
+  static const Int_t    fgkTFlongDecayWeight      = 270;  // 0 to 1024 corresponds to 0 to 0.5
+  static const Int_t    fgkTFlongDecayParameter   = 348;  // 0 to 511 corresponds to 0.75 to 1
+  static const Int_t    fgkTFshortDecayParameter  = 449;  // 0 to 511 correponds to 0.25 to 0.5
+  static const Int_t    fgkTFattenuationParameter1= 45;   // attenuationParameter = fgkTFattenuationParameter1/fgkTFattenuationParameter2
+  static const Int_t    fgkTFattenuationParameter2= 14;   //                      = -alphaL/ln(lambdaL)-(1-alphaL)/ln(lambdaS)
+
+  // OLD TF setup (calculated from above)  (valid only for fgkTFtype = 0 or 1)
+  static const Int_t    fgkTFaNExp                 = 1;    // Number of exponential
+               Float_t  fTFaR1;                        // Time constant [microseconds] long (old name fR1)
+               Float_t  fTFaR2;                        // Time constant [microseconds] short(old name fR2)
+               Float_t  fTFaC1;                        // Weight long  (old name fC1)
+               Float_t  fTFaC2;                        // Weight short (old name fC2)
+
+  // Zero suppression parameters
+  static const Int_t    fgkEBsingleIndicatorThreshold = 3;    // used in EBIS, in ADC units above the pedestal
+  static const Int_t    fgkEBsumIndicatorThreshold    = 4;    // used in EBIT, in ADC units above the pedestal
+  static const Int_t    fgkEBindicatorLookupTable     = 0xF0; // see the TRAP user manual, used in EBIL
+  static const Int_t    fgkEBmarkIgnoreNeighbour      = 1;    // used in EBIN
+
+  // Charge accumulators
+  static const Int_t    fgkPREPqAcc0Start             =  0;   // Preprocessor Charge Accumulator 0 Start
+  static const Int_t    fgkPREPqAcc0End               = 10;   // Preprocessor Charge Accumulator 0 End
+  static const Int_t    fgkPREPqAcc1Start             = 11;   // Preprocessor Charge Accumulator 1 Start
+  static const Int_t    fgkPREPqAcc1End               = 20;   // Preprocessor Charge Accumulator 1 End
+  static const Int_t    fgkMinClusterCharge           = 20;   // Hit detection [in ADC units]
+
+  // OLD TRAP processing parameters calculated from above
+  //static const Float_t  fClusThr;                     // Cluster threshold
+  //static const Float_t  fPadThr;                      // Pad threshold
+
+  // For raw production
+  static const Int_t    fgkRAWversion            = 1;         // Raw data production version
+  static const Bool_t   fgkRAWstoreRaw           = kTRUE;     // Store unfiltered data for raw data stream
+
+ private:
+
+  AliTRDfeeParam();
+
+  ClassDef(AliTRDfeeParam,1)  //
+};
+
+#endif
index 66c4a4a037216ca4c3cce1a762b10cbeaa82969f..d31396e703040c6a77a0729d0947e5334afa53ec 100644 (file)
@@ -29,6 +29,8 @@
 #pragma link C++ class  AliTRDRawStream+;
 
 #pragma link C++ class  AliTRDCommonParam+;
+#pragma link C++ class  AliTRDfeeParam+;
+
 #pragma link C++ class  AliTRDcalibDB+;
 #pragma link C++ class  AliTRDCalROC+;
 #pragma link C++ class  AliTRDCalPad+;
index 182c0c7c9f99ea973a853bdc8e0e2e449b8f0452..f087586bd86d0533ed6517571f4c67ba617d7a17 100644 (file)
@@ -13,6 +13,7 @@ SRCS= AliTRDarrayI.cxx \
       AliTRDpadPlane.cxx \
       AliTRDRawStream.cxx \
       AliTRDCommonParam.cxx \
+      AliTRDfeeParam.cxx \
       AliTRDcalibDB.cxx \
       Cal/AliTRDCalROC.cxx \
       Cal/AliTRDCalPad.cxx \