]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDfeeParam.h
Fix coverity defect
[u/mrichter/AliRoot.git] / TRD / AliTRDfeeParam.h
index 92c116e8a6cbd50b1ace722f6b433f54e805abd3..8d8430aa736e89218198ce6b041fb2c8090859b5 100644 (file)
@@ -5,16 +5,24 @@
 
 /* $Id$ */
 
-//////////////////////////////////////////////////
-//                                              //
-//  TRD front end electronics parameters class  //
-//  Contains all FEE (MCM, TRAP, PASA) related  //
-//  parameters, constants, and mapping.         //
-//                                              //
-//////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  TRD front end electronics parameters class                            //
+//  Contains all FEE (MCM, TRAP, PASA) related                            //
+//  parameters, constants, and mapping.                                   //
+//                                                                        //
+//  Author:                                                               //
+//    Ken Oyama (oyama@physi.uni-heidelberg.de)                           //
+//                                                                        //
+//  many things now configured by AliTRDtrapConfig reflecting             //
+//  the real memory structure of the TRAP (Jochen)                        //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 #include <TObject.h>
 
+class TRootIoCtor;
+
 class AliTRDCommonParam;
 class AliTRDpadPlane;
 class AliTRDgeometry;
@@ -25,6 +33,7 @@ class AliTRDfeeParam : public TObject
 
  public:
 
+  AliTRDfeeParam(TRootIoCtor *);
   AliTRDfeeParam(const AliTRDfeeParam &p);
   virtual           ~AliTRDfeeParam();
   AliTRDfeeParam    &operator=(const AliTRDfeeParam &p);
@@ -36,67 +45,47 @@ class AliTRDfeeParam : public TObject
   // 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    GetExtendedPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
   virtual Int_t    GetMCMfromPad(Int_t irow, Int_t icol) const;
+  virtual Int_t    GetMCMfromSharedPad(Int_t irow, Int_t icol) const;
   virtual Int_t    GetROBfromPad(Int_t irow, Int_t icol) const;
+  virtual Int_t    GetROBfromSharedPad(Int_t irow, Int_t icol) const;
   virtual Int_t    GetRobSide(Int_t irob) const;
   virtual Int_t    GetColSide(Int_t icol) const;
 
+  // SCSN-related
+  static  UInt_t   AliToExtAli(Int_t rob, Int_t aliid);  // Converts the MCM-ROB combination to the extended MCM ALICE ID (used to address MCMs on the SCSN Bus)
+  static  Int_t    ExtAliToAli( UInt_t dest, UShort_t linkpair, UShort_t rocType, Int_t *list, Int_t listSize);  // translates an extended MCM ALICE ID to a list of MCMs
+  static  Short_t  ChipmaskToMCMlist( UInt_t cmA, UInt_t cmB, UShort_t linkpair, Int_t *mcmList, Int_t listSize );
+  static  Short_t  GetRobAB( UShort_t robsel, UShort_t linkpair );  // Returns the chamber side (A=0, B=0) of a ROB
+
+  // geometry
   static  Float_t  GetSamplingFrequency() { return (Float_t)fgkLHCfrequency / 4000000.0; }
-  static  Int_t    GetNmcmRob()           { return fgkNmcmRob; }
+  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; }
-
-  static  Int_t    GetADCpedestal()       { return fgkADCpedestal; }
-  static  Int_t    GetADCnoise()          { return fgkADCnoise; }
-  static  Int_t    GetADCDAC()            { return fgkADCDAC; }
-
-  static  Bool_t   isPFon()               { return fgkPFon; }
-  static  Bool_t   isGFon()               { return fgkGFon; }
-  static  Bool_t   isTFon()               { return fgkTFon; }
-
-  static  Int_t    GetPFtimeConstant()    {  return fgkPFtimeConstant; }
-  static  Int_t    GetPFeffectPedestal()  {  return fgkPFeffectPedestal; }
-
-  //          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  Int_t    GetTFtype()            { return fgkTFtype; }
-  static  Int_t    GetTFnExp()            { return fgkTFnExp; }
-          Float_t  GetTFr1()              { return fTFr1; }
-          Float_t  GetTFr2()              { return fTFr2; }
-          Float_t  GetTFc1()              { return fTFc1; }
-          Float_t  GetTFc2()              { return fTFc2; }
-
-  static  Float_t  GetTFattPar()          { return ((Float_t)fgkTFattPar1) / ((Float_t)fgkTFattPar2) ; }
-  static  Float_t  GetTFf0()              { return 1 + fgkTFon*(-1+GetTFattPar()); }   // 1 if TC off
-  
-  static  Int_t    GetEBsglIndThr()       { return fgkEBsglIndThr; }
-  static  Int_t    GetEBsumIndThr()       { return fgkEBsumIndThr; }
-  static  Int_t    GetEBindLUT()          { return fgkEBindLUT; }
-  static  Int_t    GetEBignoreNeighbour() { return fgkEBignoreNeighbour; }
-
-  static  Int_t    GetRAWversion()        { return fgkRAWversion; }
-  static  Bool_t   GetRAWstoreRaw()       { return fgkRAWstoreRaw; }
+  static  Int_t    GetNrobC0()            { return fgkNrobC0;       }
+  static  Int_t    GetNrobC1()            { return fgkNrobC1;       }
+  static  Int_t    GetNadcMcm()           { return fgkNadcMcm;      }
+  static  Int_t    GetNcol()              { return fgkNcol;         }
+  static  Int_t    GetNcolMcm()           { return fgkNcolMcm;      }
+  static  Int_t    GetNrowC0()            { return fgkNrowC0;       }
+  static  Int_t    GetNrowC1()            { return fgkNrowC1;       }
+
+  // tracklet simulation
+         Bool_t   GetTracklet()         const { return fgTracklet; } 
+  static  void     SetTracklet(Bool_t trackletSim = kTRUE) { fgTracklet = trackletSim; }
+
+  // Concerning raw data format
+          Int_t    GetRAWversion() const                    { return fRAWversion;        }
+          void     SetRAWversion( Int_t rawver );
 
  protected:
 
-  static AliTRDfeeParam *fgInstance;
-  static Bool_t          fgTerminated;       //  Defines if this class has already been terminated                                                        
+  static AliTRDfeeParam *fgInstance;         // Singleton instance
+  static Bool_t          fgTerminated;       // Defines if this class has already been terminated
 
-  //  AliTRDgeometry    *fGeo;     // TRD geometry class
-  AliTRDCommonParam *fCP;      // TRD common parameters class
+  AliTRDCommonParam     *fCP;                // TRD common parameters class
 
   // Remark: ISO C++ allows initialization of static const values only for integer.
 
@@ -108,74 +97,24 @@ class AliTRDfeeParam : public TObject
   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       = 0;         // ADC baseline * 100 (old name fPedestal) it is not PFeffectPedestal
-  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            = 1;    // TC type (0=analog, 1=digital, 2=MI) (old name fFilterType)
-
-  // OLD TF setup (calculated from above)  (valid only for fgkTFsimType = 0 or 1)
-  static const Int_t    fgkTFnExp          = 1;    // Number of exponential for simType 0 and 1
-
-  // following need Instance because initialized in constructor
-               Float_t  fTFr1;                        // Time constant [us] long (old name fR1)
-               Float_t  fTFr2;                        // Time constant [us] short(old name fR2)
-               Float_t  fTFc1;                        // Weight long  (old name fC1)
-               Float_t  fTFc2;                        // Weight short (old name fC2)
-
-  // here is for TRAP simulation (not yet used)
-  static const Int_t    fgkTFdecayWeightL     = 270;  // 0 to 1024 corresponds to 0 to 0.5
-  static const Int_t    fgkTFdecayParL        = 348;  // 0 to 511 corresponds to 0.75 to 1
-  static const Int_t    fgkTFdecayParS        = 449;  // 0 to 511 correponds to 0.25 to 0.5
-  static const Int_t    fgkTFattPar1          = 45;   // attenuationParameter = fgkTFattenuationParameter1/fgkTFattenuationParameter2
-  static const Int_t    fgkTFattPar2          = 14;   //                      = -alphaL/ln(lambdaL)-(1-alphaL)/ln(lambdaS)
-
-  // ZS parameters
-  static const Int_t    fgkEBsglIndThr        = 3;    // EBIS in ADC units
-  static const Int_t    fgkEBsumIndThr        = 4;    // EBIT in ADC units
-  static const Int_t    fgkEBindLUT           = 0xF0; // EBIL lookup table
-  static const Int_t    fgkEBignoreNeighbour  = 1;    // EBIN 0:include neighbor
-
-  // 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
+ // Tracklet  processing on/off 
+  static       Bool_t   fgTracklet; // tracklet processing
 
   // For raw production
-  static const Int_t    fgkRAWversion          = 2;     // Raw data production version
-  static const Bool_t   fgkRAWstoreRaw         = kTRUE; // Store unfiltered data for raw data stream
+               Int_t    fRAWversion;                      // Raw data production version
+  static const Int_t    fgkMaxRAWversion      = 3;        // Maximum raw version number supported
 
  private:
 
   AliTRDfeeParam();
 
-  ClassDef(AliTRDfeeParam,1)  //
-};
+  ClassDef(AliTRDfeeParam,4)                              // The TRD front end electronics parameter
 
+};
 #endif
+