LCOV - code coverage report
Current view: top level - TRD/TRDbase - AliTRDgtuParam.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 28 45 62.2 %
Date: 2016-06-14 17:26:59 Functions: 27 48 56.2 %

          Line data    Source code
       1             : #ifndef ALITRDGTUPARAM_H
       2             : #define ALITRDGTUPARAM_H
       3             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : /* $Id: AliTRDgtuParam.h 27496 2008-07-22 08:35:45Z cblume $ */
       7             : 
       8             : // --------------------------------------------------------
       9             : //
      10             : // Singleton class to hold the parameters steering the GTU
      11             : // tracking
      12             : //
      13             : // --------------------------------------------------------
      14             : 
      15             : #include "TObject.h"
      16             : 
      17             : class AliTRDgeometry;
      18             : 
      19             : class AliTRDgtuParam : public TObject {
      20             :  public:
      21             :   virtual ~AliTRDgtuParam();
      22             : 
      23             :   static AliTRDgtuParam *Instance(); // Singleton
      24             : 
      25        1936 :   static Int_t GetNLinks() { return fgkNLinks; }
      26       21556 :   static Int_t GetNLayers() { return fgkNLinks/2; }
      27       17612 :   static Int_t GetNZChannels() { return fgkNZChannels; }
      28        3282 :   static Int_t GetNRefLayers() { return fgkNRefLayers; }
      29             : 
      30         720 :   static Float_t GetChamberThickness() { return 3.0; }
      31             : 
      32             :   // ----- Bin widths (granularity) -----
      33        1186 :   static Float_t GetBinWidthY() { return fgkBinWidthY; }
      34         720 :   static Float_t GetBinWidthdY() { return fgkBinWidthdY; }
      35             : 
      36             :   // ----- Bit Widths (used for internal representation) -----
      37           0 :   static Int_t GetBitWidthY() { return fgkBitWidthY; }
      38           0 :   static Int_t GetBitWidthdY() { return fgkBitWidthdY; }
      39           0 :   static Int_t GetBitWidthYProj() { return fgkBitWidthYProj; }
      40        1440 :   static Int_t GetBitExcessY() { return fgkBitExcessY; }
      41        1440 :   static Int_t GetBitExcessAlpha() { return fgkBitExcessAlpha; }
      42        1440 :   static Int_t GetBitExcessYProj() { return fgkBitExcessYProj; }
      43             : 
      44             :   Float_t GetInnerPadLength(Int_t stack, Int_t layer) const {
      45        2376 :       return (stack == 2) ? 9. : fgkInnerPadLength[layer];
      46             :   }
      47             :   Float_t GetOuterPadLength(Int_t stack, Int_t layer) const {
      48        1188 :       return (stack == 2) ? 8. : fgkOuterPadLength[layer];
      49             :   }
      50             :   Float_t GetZrow(Int_t stack, Int_t layer, Int_t padrow) const {
      51         720 :     Float_t zRowCorrected = fgkRow0Pos[layer][stack] - GetOuterPadLength(stack, layer) + GetInnerPadLength(stack, layer);
      52         360 :     return zRowCorrected - (0.5 + padrow) * GetInnerPadLength(stack, layer);
      53             :   }
      54             : 
      55         478 :   AliTRDgeometry* GetGeo() const { return fGeo; }
      56           0 :   Float_t GetVertexSize() const { return fVertexSize; }
      57             :   Int_t GetCiAlpha(Int_t layer) const;
      58             :   Int_t GetCiYProj(Int_t layer) const;
      59             :   Int_t GetYt(Int_t stack, Int_t layer, Int_t zrow) const;
      60        2616 :   Int_t GetDeltaY() const { return fgDeltaY; }
      61        1308 :   Int_t GetDeltaAlpha() const { return fgDeltaAlpha; }
      62             :   //conversion rejection stuff
      63          30 :   static Int_t GetInvPtDevCut()  { return (Int_t) (fgInvPtDevCut * fgShiftLengthNorm); }
      64          56 :   static Int_t GetShiftLengthNorm()  { return fgShiftLengthNorm; }
      65          30 :   static Int_t GetCorrectionMode() { return fgCorrectionMode; }
      66          30 :   static Bool_t GetWriteSagittaOutputToTrackWordBC() { return fgWriteSagittaOutputToTrackWordBC; }
      67          30 :   static Int_t GetLayerInvXpos(Int_t layer) { return fgLayerInvXpos[layer]*1e6; }
      68         116 :   static Int_t GetLayerXpos(Int_t layer) { return fgLayerXpos[layer]*10; }
      69             :   Int_t GetZpos(Int_t stack, Int_t layer, Int_t binZ);
      70             :   Int_t GetTanOfTiltingAngle(Int_t layer);
      71             :   Double_t CorrectYforAlignmentOCDB(Int_t det, Double_t trklZpos);
      72             :   void GetYAlignmentDataOCDB(Int_t chamber, Double_t *shiftCorrFactor, Double_t *rotationCorrFactor);
      73             : 
      74             :   Int_t GetZSubchannel(Int_t stack, Int_t layer, Int_t zchannel, Int_t zpos) const;
      75             :   static Int_t GetRefLayer(Int_t refLayerIdx);
      76             : //  Bool_t GetFitParams(TVectorD &rhs, Int_t k); // const
      77             :   Bool_t GetIntersectionPoints(Int_t k, Float_t &x1, Float_t &x2); // const
      78             :   static Int_t GetPt(Int_t layerMask, Int_t a, Float_t b, Float_t x1, Float_t x2, Float_t magField);
      79             : 
      80             :   Bool_t IsInZChannel(Int_t stack, Int_t layer, Int_t zchannel, Int_t zpos) const;
      81             : 
      82           0 :   void SetVertexSize(Float_t vertexsize) { fVertexSize = vertexsize; }
      83             : 
      84           0 :   static void SetDeltaY(Int_t dy) { fgDeltaY = dy; }
      85           0 :   static void SetDeltaAlpha(Int_t da) { fgDeltaAlpha = da; }
      86             : 
      87           0 :   static void SetInvPtDevCut(Float_t dInvPt) {fgInvPtDevCut = dInvPt; }
      88           0 :   static void SetShiftLengthNorm(Int_t shiftLengthNorm) {fgShiftLengthNorm = shiftLengthNorm; }
      89           0 :   static void SetCorrectionMode(Int_t corrMode) {fgCorrectionMode = corrMode; }
      90           0 :   static void SetWriteSagittaOutputToTrackWordBC(Bool_t writeSagittaOutputToTrackWordBC) { fgWriteSagittaOutputToTrackWordBC = writeSagittaOutputToTrackWordBC; }
      91             : 
      92           0 :   static void SetUseGTUconst(Bool_t b) { fgUseGTUconst = b; }
      93          30 :   static Bool_t GetUseGTUconst() { return fgUseGTUconst; }
      94             : 
      95           0 :   static void SetUseGTUmerge(Bool_t b) { fgUseGTUmerge = b; }
      96          78 :   static Bool_t GetUseGTUmerge() { return fgUseGTUmerge; }
      97             : 
      98           0 :   static void SetLimitNoTracklets(Bool_t b) { fgLimitNoTracklets = b; }
      99        1188 :   static Bool_t GetLimitNoTracklets() { return fgLimitNoTracklets; }
     100             : 
     101           0 :   static void SetMaxNoTracklets(Int_t max) { fgMaxNoTracklets = max; }
     102        1188 :   static Int_t GetMaxNoTracklets() { return fgMaxNoTracklets; }
     103             : 
     104             :   // z-channel map
     105             :   Int_t GenerateZChannelMap(); // could have different modes (for beam-beam, cosmics, ...)
     106             :   Bool_t DisplayZChannelMap(Int_t zchannel = -1, Int_t subch = 0) const;
     107             : 
     108             :   // variables for pt-reconstruction (not used at the moment)
     109             :   Bool_t GenerateRecoCoefficients(Int_t trackletMask);
     110             :   Bool_t CalculatePrefactors(Int_t trackletMask);
     111             :   Int_t   GetAki(Int_t k, Int_t i);
     112             :   Float_t GetBki(Int_t k, Int_t i);
     113             :   Float_t GetCki(Int_t k, Int_t i);
     114             :   Int_t   GetPki(Int_t k, Int_t i);
     115             :   Int_t   GetLengthNorm(Int_t k);
     116             :   Int_t   Getc1Inv(Int_t k);
     117             : //  Float_t GetD(Int_t k) const;
     118             : 
     119             :   // B-field
     120           0 :   void SetMagField(Float_t field) { fMagField = field; }
     121           0 :   Float_t GetMagField() const { return fMagField; }
     122             : 
     123             :   static const Int_t fgkNZChannels = 3; // No. of z-channels
     124             :   static const Int_t fgkNLinks = 12;    // No. of links
     125             :   static const Int_t fgkFixLayer = 2;   // which layer is fixed for the generation of the z-channel map
     126             :   static const Int_t fgkNRefLayers = 3;  // no. of reference layers
     127             : 
     128             :   static const Float_t fgkBinWidthY; // bin width for y-position
     129             :   static const Float_t fgkBinWidthdY; // bin width for deflection length
     130             : 
     131             :   static const Int_t fgkBitWidthY; // bit width for y-position
     132             :   static const Int_t fgkBitWidthdY; // bit width for deflection length
     133             :   static const Int_t fgkBitWidthYProj; // bit width for projected y-position
     134             :   static const Int_t fgkBitExcessY; // excess bits for y-position
     135             :   static const Int_t fgkBitExcessAlpha; // excess bits for alpha
     136             :   static const Int_t fgkBitExcessYProj; // excess bits for projected y-position
     137             : 
     138             :   static const Int_t fgkPtInfinity; // infinite pt as obtained when a == 0
     139             : 
     140             :  protected:
     141             :   static       Int_t fgDeltaY;          // accepted deviation in y_proj, default: 9
     142             :   static       Int_t fgDeltaAlpha;      // accepted deviation in alpha, default: 11
     143             : 
     144             :   static       Float_t fgInvPtDevCut;     // max deviation from straight line fit 1/pt to sagitta 1/pt
     145             :   static       Int_t fgShiftLengthNorm;  // shift normalization factor for integer calculation
     146             :   static       Int_t fgCorrectionMode;  // choose between optimizations for sagitta method
     147             :   static       Bool_t fgWriteSagittaOutputToTrackWordBC; // write result of sagitta calculation in gtu simulation to track parameters b and c
     148             :   static       Float_t fgLayerInvXpos[6]; // inverse of x position for tracklets in different layers
     149             :   static       Float_t fgLayerXpos[6]; // x position for tracklets in different layers
     150             : 
     151             :   static       Int_t fgRefLayers[3];    // reference layers for track finding
     152             : 
     153             :   static       Bool_t fgUseGTUconst;    // use constants as in the GTU for the calculations
     154             :                                                // instead of geometry derived quantities
     155             :   static       Bool_t fgUseGTUmerge;    // use merge algorithm exactly as in hardware
     156             :   static       Bool_t fgLimitNoTracklets; // limit the number of tracklets per layer
     157             :   static       Int_t  fgMaxNoTracklets;   // max number of tracklets per layer if limited
     158             :   static const Bool_t fgZChannelMap[5][16][6][16]; // z-channel tables as in GTU
     159             :   static const Float_t fgkRadius[6];    // layer radius as used in the GTU code
     160             :   static const Float_t fgkThickness;    // drift length as used in the GTU code
     161             :   static const Float_t fgkRow0Pos[6][5]; // geometry constant from GTU implementation
     162             :   static const Float_t fgkInnerPadLength[6]; // geometry constant from GTU implementation
     163             :   static const Float_t fgkOuterPadLength[6]; // geometry constant from GTU implementation
     164             :   static const Float_t fgkAcoeff[32][6]; // geometry constant from GTU implementation
     165             :   static const Float_t fgkZposLookupTable[5][6][16]; //chamber z position used for sagitta calculation
     166             :   static const Int_t   fgkMaskID[64]; // geometry constant from GTU implementation
     167             : 
     168             :   Float_t fVertexSize;          // assumed vertex size (z-dir.) for the z-channel map
     169             : 
     170             :   Int_t fZChannelMap[5][16][6][16];               // must be changed
     171             :   Int_t fZSubChannel[5][fgkNZChannels][6][16];    // must be changed
     172             : 
     173             :   Int_t fCurrTrackletMask; // current tracklet mask for which the coefficients have been calculated
     174             :   Float_t fAki[6]; // coefficients used for the fit, calculated for the current tracklet mask
     175             :   Float_t fBki[6]; // coefficients used for the fit, calculated for the current tracklet mask
     176             :   Float_t fCki[6]; // coefficients used for the fit, calculated for the current tracklet mask
     177             :   Int_t   fPki[6]; // prefactor for sagitte calculation, calculated for the current tracklet mask
     178             :   Int_t fLengthNorm; // normalize track sagitta to length of track inside the TRD to obtain 1/pt
     179             :   Int_t fc1Inv; // inverse of the c1 coefficients to calculate 1/pt from fit parameter a
     180             : 
     181             :   Float_t fMagField;            // magnetic field in T
     182             : 
     183             :   AliTRDgeometry *fGeo;         //! pointer to the TRD geometry
     184             : 
     185             :  private:
     186             :   AliTRDgtuParam();                          // instance only via Instance()
     187             :   AliTRDgtuParam(const AliTRDgtuParam &rhs); // not implemented
     188             :   AliTRDgtuParam& operator=(const AliTRDgtuParam &rhs); // not implemented
     189             : 
     190          48 :   ClassDef(AliTRDgtuParam, 1);
     191             : };
     192             : 
     193             : #endif

Generated by: LCOV version 1.11