+ protected:
+ Bool_t CheckInitialized() const; // Check whether the class is initialized
+
+ void SetNTimebins(Int_t ntimebins); // allocate data arrays corr. to the no. of timebins
+
+ 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
+ static const Int_t fgkNCPU = 4; // Number of CPUs in the TRAP
+ static const Int_t fgkNHitsMC = 100; // maximum number of hits for which MC information is kept
+
+ 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
+ Int_t fMcmPos; // MCM Position on chamber
+ Int_t fRow; // Pad row number (0-11 or 0-15) of the MCM on chamber
+ Int_t fNTimeBin; // Number of timebins currently allocated
+ Int_t **fADCR; // Array with MCM ADC values (Raw, 12 bit)
+ Int_t **fADCF; // Array with MCM ADC values (Filtered, 12 bit)
+ UInt_t *fMCMT; // tracklet word for one mcm/trap-chip
+ TClonesArray *fTrackletArray; // Array of AliTRDtrackletMCM which contains MC information in addition to the tracklet word
+ Int_t *fZSMap; // Zero suppression map (1 dimensional projection)
+
+ Int_t fFitPtr[fgkNCPU]; // pointer to the tracklet to be calculated by CPU i
+
+ TString fTrklBranchName; // name of the tracklet branch to right to
+
+ // Parameter classes
+ AliTRDfeeParam *fFeeParam; // FEE parameters
+ AliTRDtrapConfig *fTrapConfig; // TRAP config
+
+ AliTRDdigitsManager *fDigitsManager; // pointer to digits manager used for MC label calculation
+ AliTRDarrayDictionary* fDict[3]; // pointers to label dictionaries
+
+
+ // internal filter registers
+ UInt_t* fPedAcc; // Accumulator for pedestal filter
+ UInt_t* fGainCounterA; // Counter for values above FGTA in the gain filter
+ UInt_t* fGainCounterB; // Counter for values above FGTB in the gain filter
+ UShort_t* fTailAmplLong; // Amplitude of the long component in the tail filter
+ UShort_t* fTailAmplShort; // Amplitude of the short component in the tail filter
+
+ // hit detection
+ // individual hits can be stored as MC info
+ struct Hit_t { // Array of detected hits (only available in MC)
+ Hit_t() : fChannel(0), fTimebin(0), fQtot(0), fYpos(0) { fLabel[0] = 0; fLabel[1] = 0; fLabel[2] = 0; }
+ Int_t fChannel; // ADC channel of the hit
+ Int_t fTimebin; // timebin of the hit
+ Int_t fQtot; // total charge of the hit
+ Int_t fYpos; // calculated y-position
+ Int_t fLabel[3]; // up to 3 labels (only in MC)
+ } fHits[fgkNHitsMC];
+ Int_t fNHits; // Number of detected hits
+
+ // tracklet calculation
+ struct FitReg_t { // pointer to the 18 fit registers
+ Int_t fNhits; // number of hits
+ UInt_t fQ0; // charge accumulated in first window
+ UInt_t fQ1; // charge accumulated in second window
+ UInt_t fSumX; // sum x
+ Int_t fSumY; // sum y
+ UInt_t fSumX2; // sum x**2
+ UInt_t fSumY2; // sum y**2
+ Int_t fSumXY; // sum x*y
+ } *fFitReg;
+
+ // Sort functions as in TRAP
+ void Sort2(UShort_t idx1i, UShort_t idx2i, UShort_t val1i, UShort_t val2i,
+ UShort_t * const idx1o, UShort_t * const idx2o, UShort_t * const val1o, UShort_t * const val2o) const;
+ void Sort3(UShort_t idx1i, UShort_t idx2i, UShort_t idx3i,
+ UShort_t val1i, UShort_t val2i, UShort_t val3i,
+ UShort_t * const idx1o, UShort_t * const idx2o, UShort_t * const idx3o,
+ UShort_t * const val1o, UShort_t * const val2o, UShort_t * const val3o);
+ void Sort6To4(UShort_t idx1i, UShort_t idx2i, UShort_t idx3i, UShort_t idx4i, UShort_t idx5i, UShort_t idx6i,
+ UShort_t val1i, UShort_t val2i, UShort_t val3i, UShort_t val4i, UShort_t val5i, UShort_t val6i,
+ UShort_t * const idx1o, UShort_t * const idx2o, UShort_t * const idx3o, UShort_t * const idx4o,
+ UShort_t * const val1o, UShort_t * const val2o, UShort_t * const val3o, UShort_t * const val4o);
+ void Sort6To2Worst(UShort_t idx1i, UShort_t idx2i, UShort_t idx3i, UShort_t idx4i, UShort_t idx5i, UShort_t idx6i,
+ UShort_t val1i, UShort_t val2i, UShort_t val3i, UShort_t val4i, UShort_t val5i, UShort_t val6i,
+ UShort_t * const idx5o, UShort_t * const idx6o);
+
+ 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
+
+ private:
+ AliTRDmcmSim(const AliTRDmcmSim &m); // not implemented
+ AliTRDmcmSim &operator=(const AliTRDmcmSim &m); // not implemented
+
+ static Bool_t fgApplyCut; // apply cut on deflection length
+
+ static Int_t fgAddBaseline; // add baseline to the ADC values
+
+ ClassDef(AliTRDmcmSim,6)