1 #ifndef ALITRDTRAPCONFIG_H
\r
2 #define ALITRDTRAPCONFIG_H
\r
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
7 // Class holding the configuration of the tracklet processor
12 #include <TObject.h>
\r
13 #include <TString.h>
\r
14 #include <TClonesArray.h>
\r
16 class AliTRDtrapConfig : public TObject
\r
19 static AliTRDtrapConfig* Instance();
\r
21 enum TrapReg_t { kSML0,
\r
454 kLastReg }; // enum of all TRAP registers, to be used for access to them
\r
456 const char* GetRegName(TrapReg_t reg) const { return fRegs[reg].fName.Data(); }
\r
457 UShort_t GetRegAddress(TrapReg_t reg) const { return fRegs[reg].fAddr; }
\r
458 UShort_t GetRegNBits(TrapReg_t reg) const { return fRegs[reg].fNbits; }
\r
459 UInt_t GetRegResetValue(TrapReg_t reg) const { return fRegs[reg].fResetValue; }
\r
461 TrapReg_t GetRegByAddress(Int_t address) const;
\r
463 Int_t GetTrapReg(TrapReg_t reg, Int_t det = -1, Int_t rob = -1, Int_t mcm = -1);
\r
464 Bool_t PrintTrapReg(TrapReg_t reg, Int_t det = -1, Int_t rob = -1, Int_t mcm = -1);
\r
465 Bool_t PrintTrapAddr(Int_t addr, Int_t det = -1, Int_t rob = -1, Int_t mcm = -1);
\r
467 Bool_t SetTrapReg(TrapReg_t reg, Int_t value);
\r
468 Bool_t SetTrapReg(TrapReg_t reg, Int_t value, Int_t det);
\r
469 Bool_t SetTrapReg(TrapReg_t reg, Int_t value, Int_t det, Int_t rob, Int_t mcm);
\r
474 Bool_t LoadConfig();
\r
475 Bool_t LoadConfig(Int_t det, TString filename);
\r
477 Int_t ExtAliToAli( UInt_t dest, UShort_t linkpair, UShort_t rocType);
\r
480 static AliTRDtrapConfig *fgInstance; // pointer to instance (singleton)
\r
482 struct SimpleReg_t {
\r
483 TString fName; // Name of the register
\r
484 UShort_t fAddr; // Address in GIO of TRAP
\r
485 UShort_t fNbits; // Number of bits, from 1 to 32
\r
486 UInt_t fResetValue; // reset value
\r
487 SimpleReg_t(char *nnn = 0, UShort_t a = 0, UShort_t n = 0, UInt_t r = 0) :
\r
488 fName(nnn), fAddr(a), fNbits(n), fResetValue(r) {}
\r
491 struct RegValue_t {
\r
496 } state; // mode of storage (global or per MCM)
\r
499 Int_t *individualValue;
\r
503 SimpleReg_t fRegs[kLastReg]; // array of TRAP registers
\r
504 RegValue_t fRegisterValue[kLastReg]; // array of TRAP register values in use
\r
506 Bool_t AddValues(UInt_t det, UInt_t cmd, UInt_t extali, UInt_t addr, UInt_t data);
\r
507 Short_t GetRobAB( UShort_t robsel, UShort_t linkpair ) const; // Converts the ROB part of the extended ALICE ID to robs
\r
508 Short_t ChipmaskToMCMlist( Int_t cmA, Int_t cmB, UShort_t linkpair ); // Converts the chipmask to a list of MCMs
\r
510 static const UInt_t fgkScsnCmdWrite=10; // Command number for the write command
\r
511 static const Int_t fgkMaxLinkPairs=4; // number of linkpairs used during configuration
\r
512 static const Int_t fgkMaxMcm; // max. no. of MCMs to be treated
\r
513 static const Int_t fgkMcmlistSize=256; // list of MCMs to which a value has to be written
\r
515 Int_t fMcmlist[fgkMcmlistSize]; // stores the list of MCMs after the conversion from extAliID -> AliID
\r
517 AliTRDtrapConfig(); // private constructor due to singleton implementation
\r
520 struct BlockDescr_t {
\r
532 enum DbankProp_t { kDBankEmpty = 0,
\r
543 AliTRDtrapConfig& operator=(const AliTRDtrapConfig &rhs); // not implemented
544 AliTRDtrapConfig(const AliTRDtrapConfig& cfg); // not implemented
546 ClassDef(AliTRDtrapConfig, 2);
\r