]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDmcmSim.h
Fix in the TRD time-offset calibration (Hans)
[u/mrichter/AliRoot.git] / TRD / AliTRDmcmSim.h
index 3b59d3dcd0859d4d7ae87ea4cc48db3d9fbeea90..748d148e10c9cf31dcb9b503cf9950d9ee67cbf5 100644 (file)
@@ -23,6 +23,7 @@ class AliTRDtrapConfig;
 class AliTRDarrayADC;
 class AliTRDarrayDictionary;
 class AliTRDdigitsManager;
+class TTreeSRedirector;
 
 class AliTRDmcmSim : public TObject {
  public:
@@ -35,6 +36,9 @@ class AliTRDmcmSim : public TObject {
          void      Reset();
          // clears filter registers and internal data
 
+          void      SetDebugStream(TTreeSRedirector *stream) { fDebugStream = stream; }
+  TTreeSRedirector* GetDebugStream() const { return fDebugStream; }
+
          Bool_t    LoadMCM(AliRunLoader* const runloader, Int_t det, Int_t rob, Int_t mcm);
 
          void      NoiseTest(Int_t nsamples, Int_t mean, Int_t sigma, Int_t inputGain = 1, Int_t inputTail = 2);
@@ -44,11 +48,11 @@ class AliTRDmcmSim : public TObject {
          Int_t     GetDataFiltered(Int_t iadc, Int_t timebin) const { return (fADCF[iadc][timebin] >> 2); }
          // Get filtered ADC data
 
-          void      SetData(Int_t iadc, Int_t *adc);           // Set ADC data with array
+          void      SetData(Int_t iadc, const Int_t* const adc);           // Set ADC data with array
           void      SetData(Int_t iadc, Int_t it, Int_t adc); // Set ADC data
          void      SetData(AliTRDarrayADC * const adcArray,
                            AliTRDdigitsManager * const digitsManager = 0x0);         // Set ADC data from adcArray
-         void      SetDataByPad(AliTRDarrayADC *const adcArray,
+         void      SetDataByPad(const AliTRDarrayADC *const adcArray,
                                 AliTRDdigitsManager * const digitsManager = 0x0);    // Set ADC data from adcArray
           void      SetDataPedestal(Int_t iadc);              // Fill ADC data with pedestal values
 
@@ -63,6 +67,9 @@ class AliTRDmcmSim : public TObject {
   // different baseline but it will not change the baseline
   // of the output.
 
+  static  void      SetStoreClusters(Bool_t storeClusters) { fgStoreClusters = storeClusters; }
+  static  Bool_t    GetStoreClusters() { return fgStoreClusters; }
+
           Int_t     GetDetector() const  { return fDetector;  };     // Returns Chamber ID (0-539)
           Int_t     GetRobPos() const { return fRobPos; };           // Returns ROB position (0-7)
           Int_t     GetMcmPos() const { return fMcmPos; };           // Returns MCM position (0-17) (16,17 are mergers)
@@ -72,7 +79,7 @@ class AliTRDmcmSim : public TObject {
 
          void      WriteData(AliTRDarrayADC *digits);
          Bool_t    StoreTracklets();                          // Stores tracklets via runloader
-         TString   GetTrklBranchName() { return fTrklBranchName; }
+         TString   GetTrklBranchName() const { return fTrklBranchName; }
          void      SetTrklBranchName(TString name) { fTrklBranchName = name; }
 
          Int_t     ProduceRawStream( UInt_t *buf, Int_t bufsize, UInt_t iEv = 0 ) const; // Produce raw data stream - Real data format
@@ -126,10 +133,30 @@ class AliTRDmcmSim : public TObject {
          // I/O
          void PrintFitRegXml(ostream& os) const;
          void PrintTrackletsXml(ostream& os) const;
+         void PrintAdcDatTxt(ostream& os) const;
          void PrintAdcDatHuman(ostream& os) const;
          void PrintAdcDatXml(ostream& os) const;
          void PrintAdcDatDatx(ostream& os, Bool_t broadcast=kFALSE, Int_t timeBinOffset = -1) const;
 
+  static  Bool_t ReadPackedConfig(AliTRDtrapConfig *cfg, Int_t hc, UInt_t *data, Int_t size);
+
+  // DMEM addresses
+  static const Int_t fgkDmemAddrLUTcor0       = 0xC02A;
+  static const Int_t fgkDmemAddrLUTcor1       = 0xC028;
+  static const Int_t fgkDmemAddrLUTnbins      = 0xC029;
+
+  static const Int_t fgkDmemAddrLUTStart      = 0xC100; // LUT start address
+  static const Int_t fgkDmemAddrLUTEnd        = 0xC3FF; // maximum possible end address for the LUT table
+  static const Int_t fgkDmemAddrLUTLength     = 0xC02B; // address where real size of the LUT table is stored
+
+  static const Int_t fgkDmemAddrTrackletStart = 0xC0E0; // Storage area for tracklets, start address
+  static const Int_t fgkDmemAddrTrackletEnd   = 0xC0E3; // Storage area for tracklets, end address
+
+  static const Int_t fgkDmemAddrDeflCorr      = 0xc022; // DMEM address of deflection correction
+  static const Int_t fgkDmemAddrNdrift        = 0xc025; // DMEM address of Ndrift
+  static const Int_t fgkDmemAddrDeflCutStart  = 0xc030; // DMEM start address of deflection cut
+  static const Int_t fgkDmemAddrDeflCutEnd    = 0xc055; // DMEM end address of deflection cut
+
  protected:
          Bool_t    CheckInitialized() const;           // Check whether the class is initialized
 
@@ -137,7 +164,6 @@ class AliTRDmcmSim : public TObject {
 
  static const Int_t fgkFormatIndex;                     // index for format settings in stream
 
- static const Int_t fgkNADC;                            // Number of ADC
  static const Int_t fgkMaxTracklets = 4;                // maximum number of tracklet-words submitted per MCM (one per CPU)
  static const Int_t fgkAddDigits = 2;                   // additional digits used for internal representation of ADC data
                                                        // all internal data as after data control block (i.e. 12 bit), s. TRAP manual
@@ -146,7 +172,6 @@ class AliTRDmcmSim : public TObject {
 
  static const UShort_t fgkFPshifts[4];                  // shifts for pedestal filter
 
-
          Bool_t    fInitialized;                       // memory is allocated if initialized
          Int_t     fDetector;                          // Chamber ID
          Int_t     fRobPos;                            // ROB Position on chamber
@@ -220,6 +245,8 @@ class AliTRDmcmSim : public TObject {
          UInt_t AddUintClipping(UInt_t a, UInt_t b, UInt_t nbits) const;
          // Add a and b (unsigned) with clipping to the maximum value representable by nbits
 
+  TTreeSRedirector *fDebugStream;
+
  private:
          AliTRDmcmSim(const AliTRDmcmSim &m);             // not implemented
          AliTRDmcmSim &operator=(const AliTRDmcmSim &m);  // not implemented
@@ -228,7 +255,9 @@ class AliTRDmcmSim : public TObject {
 
   static Int_t fgAddBaseline;             // add baseline to the ADC values
 
-  ClassDef(AliTRDmcmSim,6)
+  static Bool_t fgStoreClusters;          // whether to store all clusters in the tracklets
+
+  ClassDef(AliTRDmcmSim,7)
 };
 
 std::ostream& operator<<(std::ostream& os, const AliTRDmcmSim& mcm);