/**@file CbmTbDaqMap.cxx **@date 03.12.2009 **@author V. Friese **/ #include "CbmTbDaqMap.h" #include using std::cout; using std::endl; // ----- Default Constructor ---------------------------------------------- CbmTbDaqMap::CbmTbDaqMap() { } // --------------------------------------------------------------------------- // ----- Standard Constructor --------------------------------------------- CbmTbDaqMap::CbmTbDaqMap(Int_t iRun) : fRun(iRun) { } // --------------------------------------------------------------------------- // ----- Destructor ------------------------------------------------------ CbmTbDaqMap::~CbmTbDaqMap() { } // --------------------------------------------------------------------------- // ----- Mapping --------------------------------------------------------- Bool_t CbmTbDaqMap::Map(Int_t iRoc, Int_t iNx, Int_t iId, Int_t& iStation, Int_t& iSector, Int_t& iSide, Int_t& iChannel) { // ---- Setup from 4 September 2009 until end of runtime if ( fRun >= 13 && fRun <= 71 ) { // Only one sector per station iSector = 1; // ROC 0 reads first two 1nx boards if (iRoc==0) { if (iNx==0 && iId<64) { iStation = 1; iSide = 0; iChannel = iId; } else if (iNx==0 && iId>=64) { iStation = 2; iSide = 0; iChannel = iId - 64; } else if (iNx==2 && iId<64) { iStation = 1; iSide = 1; iChannel = iId; } else if (iNx==2 && iId>=64) { iStation = 2; iSide = 1; iChannel = 127 - iId; } else { cout << "-E- CbmTbDaqMap: Run " << fRun << ", no mapping for ROC " << iRoc << ", NX " << iNx << ", channel " << iId << " !" << endl; Fatal("Map", "Cannot find mapping"); } } // ROC 0 // ROC 1 reads Q02 (station 3) // ROC 3 reads Q06 (station 4) else if (iRoc == 1 || iRoc == 3 ) { if ( iRoc == 1 ) iStation = 3; else if ( iRoc == 3 ) iStation = 4; if ( iNx == 0 ) { iSide = 0; iChannel = iId; } else if ( iNx == 1 ) { iSide = 0; iChannel = 256 - iId; } else if ( iNx == 2 ) { iSide = 1; iChannel = 127 + iId; } else if ( iNx == 3 ) { iSide = 1; iChannel = 127 - iId; } else { cout << "-E- CbmTbDaqMap: Run " << fRun << ", no mapping for ROC " << iRoc << ", NX " << iNx << ", channel " << iId << " !" << endl; Fatal("Map", "Cannot find mapping"); } } // ROC 1 and 3 // Unknown ROC else { cout << "-E- CbmTbDaqMap: Run " << fRun << ", unknwon ROC " << iRoc << endl; Fatal("Map", "Cannot find mapping"); } } // --- Tag sep04 ---------------------------------------- // Tag not found else { cout << "-W- CbmTbDaqMap: No setup available for run " << fRun << endl; } return kTRUE; } // --------------------------------------------------------------------------- ClassImp(CbmTbDaqMap)