]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDmcmSim.h
Protection against index out of range
[u/mrichter/AliRoot.git] / TRD / AliTRDmcmSim.h
index 0f4690d418d569acc82b1ba2bbcba3b7afe73ba5..e198d86bc2a417d79f00adba11ce6dc663cc9497 100644 (file)
 #include <TObject.h>
 
 class AliTRDfeeParam;
+class AliTRDSimParam;
+class AliTRDcalibDB;
 class AliTRDgeometry;
 
 class AliTRDmcmSim : public TObject {
 
  public:
 
-  AliTRDmcmSim();
-  virtual         ~AliTRDmcmSim();
+                    AliTRDmcmSim();
+                    AliTRDmcmSim(const AliTRDmcmSim &m);
+  virtual          ~AliTRDmcmSim();
+  AliTRDmcmSim      &operator=(const AliTRDmcmSim &m);
 
-  //PH  virtual void      Copy(TObject &m) const;
+  virtual void      Copy(TObject &m) const;
 
-          void      Init( Int_t cha_id, Int_t rob_pos, Int_t mcm_pos ); // Initialize MCM by the position parameters
+          void      Init( Int_t cha, Int_t rob, Int_t mcm );   // Initialize MCM by the position parameters
           void      SetData(Int_t iadc, Int_t *adc);           // Set ADC data with array 
-          void      SetData(Int_t iadc, Int_t it, Int_t adc ); // Set ADC data one by one
+          void      SetData(Int_t iadc, Int_t it, Int_t adc ); // Set ADC data
           void      SetDataPedestal(Int_t iadc );              // Fill ADC data with pedestal values
 
-          Int_t     GetChaId()  { return fChaId;  };    // Returns Chamber ID (0-539)
-          Int_t     GetRobPos() { return fRobPos; };    // Returns ROB position (0-7)
-          Int_t     GetMcmPos() { return fMcmPos; };    // Returns MCM position (0-17) (16,17 are mergers)
-          Int_t     GetRow()    { return fRow; };       // Returns Row number on chamber where it is sitting
-         Int_t     GetCol( Int_t iadc );               // Get corresponding column (0-143) from adc ID (= 0-20) 
-                    // for the ADC/Col mapping, see: http://wiki.kip.uni-heidelberg.de/ti/TRD/index.php/Image:ROB_MCM_numbering.pdf
+          Int_t     GetChaId() const  { return fChaId;  };     // 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)
+          Int_t     GetRow() const    { return fRow;    };     // Returns Row number on chamber where the MCM is sitting
+         Int_t     GetCol( Int_t iadc );                      // Get corresponding column (0-143) from for ADC channel iadc = [0:20]
+         // for the ADC/Col mapping, see: http://wiki.kip.uni-heidelberg.de/ti/TRD/index.php/Image:ROB_MCM_numbering.pdf
 
-         Int_t     ProduceRawStream( UInt_t *buf, Int_t bufsize );    // Produce raw data stream from this MCM
-         void      Filter();                           //  Apply digital filters
-         void      ZSMapping();                        //  Do ZS mapping
+         Int_t     ProduceRawStream( UInt_t *buf, Int_t bufsize ); // Produce raw data stream from this MCM
+         void      Filter();                                  // Apply digital filters for existing data
+         void      ZSMapping();                               // Do ZS mapping for existing data
+         void      DumpData( char *f, char *target );         // Dump data stored (only for debugging)
 
  protected:
 
-          Bool_t    fInitialized;                       // Status
-
-         AliTRDfeeParam *fFeeParam;
-         AliTRDgeometry *fGeo;
-
+          Bool_t    fInitialized;                       // Status whether the class is initialized or not
          Int_t     fChaId;                             // Chamber ID
          Int_t     fSector;                            // Sector number of the supermodule
          Int_t     fStack;                             // Chamber stack ID
          Int_t     fLayer;                             // Chamber layer ID
-          Int_t     fRobPos;                            // ROB Position
-          Int_t     fMcmPos;                            // MCM Position
+          Int_t     fRobPos;                            // ROB Position on chamber
+          Int_t     fMcmPos;                            // MCM Position on chamber
          Int_t     fNADC;                              // Number of ADC (usually 21)
-         Int_t     fNTimeBin;                          // Number of Timebin (valiable)
-          Int_t     fRow;                               // Pad row number (0-11 or 0-15)
-          Int_t     fColOfADCbeg;                       // Column corresponds to ADC channel 0
-          Int_t     fColOfADCend;                       // Column corresponds to ADC channel [fNADC-1] (usually 20)
+         Int_t     fNTimeBin;                          // Number of Timebins (variable)
+          Int_t     fRow;                               // Pad row number (0-11 or 0-15) of the MCM on chamber
           Int_t   **fADCR;                              // Array with MCM ADC values (Raw)
           Int_t   **fADCF;                              // Array with MCM ADC values (Filtered)
-          Int_t   **fZSM;                               // Zero Suppression Map
-          Int_t    *fZSM1Dim;                           // Zero Suppression (1 dimensional projection)
+          Int_t   **fZSM;                               // Zero suppression map
+          Int_t    *fZSM1Dim;                           // Zero suppression map (1 dimensional projection)
+
+         // Parameter classes
+         AliTRDfeeParam *fFeeParam;                    // FEE parameters
+         AliTRDSimParam *fSimParam;                    // Simulation parameters
+         AliTRDcalibDB  *fCal;                         // Calibration interface
+         AliTRDgeometry *fGeo;                         // Geometry
 
+         Bool_t    CheckInitialized();                 // Check whether the class is initialized
          void      FilterPedestal();                   // Apply pedestal filter
          void      FilterGain();                       // Apply gain filter
          void      FilterTail();                       // Apply tail filter
 
+         // Here are the several sub functions used only in FilterTail
          void      FilterSimDeConvExpA(Int_t *source, Double_t *target, Int_t n, Int_t nexp);
          void      FilterSimDeConvExpD(Int_t *source, Int_t *target, Int_t n, Int_t nexp);
          void      FilterSimDeConvExpMI(Int_t *source, Double_t *target, Int_t n);