// MuoIndexTrans.hpp // // Purpose: Translator/Adaptor for the MuoIndex container // Converts to/from MuoIndex and values // needed by geometry, electronics, and GEANT // // Created: June 1998 Michael R. Fortner // Revised: November, 1998 M. Fortner - Add getGlobal methods for geometry // July 1999 - M. Fortner - add getSectionID for channel ID packing // June 2000 - M. Fortner - extend getFrontEnd to include module map // #ifndef MUO_MUOINDEXTRANS #define MUO_MUOINDEXTRANS #include "MuoIndex.hpp" #include namespace Muon { class MuoIndexTrans { private: struct Section { int planes; int etacells; int phicells; int tubes; }; // PDT sections; exceptions replace general cases // PDT #LBO, L=layer, B=barrel, O=octant as defined in MuoSectionIndex static const Section _pdt4; // 0xx static const Section _pdt3; // 1xx, 2xx, 0x5, 0x6 static const Section _pdt3BEF; // 10x, 14x, 205, 206, 245, 246 static const Section _pdt3Bot; // 105, 145, 215, 235, and oct 6 // MDT sections; exceptions replace general cases static const Section _mdtA; static const Section _mdtB; static const Section _mdtC; static const Section _mdtBCBot; // octants 5 & 6, layers 1 & 2 // MSC sections; exceptions replace general cases static const Section _cmscA; static const Section _cmscABot; // w/ PDT 0x5, 0x6 static const Section _cmscC; static const Section _cmscCBot; // w/ PDT 205, 206, 245, 246 static const Section _cmscCBotH; // PDT 215, 216, 235, 236 static const Section _cmscBBot; // w/ PDT 115, 116, 135, 136 static const Section _cmscBEFBot; // w/ PDT 105, 106, 145, 146 static const Section _cmscBSide; // w/ PDT 114, 124, 134, & oct 7 static const Section _cmscBEFSide; // w/ PDT 104, 144, 107, 147 static const Section _fmscA; static const Section _fmscBC; // Section Orientation // WAMUS indices are layer, octant static const int _orientWAMUS[3][8]; // FAMUS indices are octant static const int _orientFAMUS[8]; // Foward Scintillator map static const unsigned char _fmscChannels[96]; // front end structure struct FEModule { int moduleID; int numFE; int FEID[16]; }; // Scintillator SFE map static const FEModule _sfeModule[18]; public: MuoIndexTrans(); ~MuoIndexTrans(); // Accessors for all geometry int getNumPlanes(const MuoSectionIndex& ix) const; int getNumPlanes(const MuoIndex& ix) const; int getNumEtaCells(const MuoSectionIndex& ix) const; int getNumEtaCells(const MuoIndex& ix) const; int getNumPhiCells(const MuoSectionIndex& ix) const; int getNumPhiCells(const MuoIndex& ix) const; int getNumTubes(const MuoSectionIndex& ix) const; int getNumTubes(const MuoIndex& ix) const; // Adaptors for local geometry int getOrientation(const MuoSectionIndex& ix) const; int getLocalWire(const MuoIndex& ix) const; int getLocalPlane(const MuoIndex& ix) const; int getGlobalPlane(const MuoSectionIndex& section, int plane) const; int getGlobalWire(const MuoSectionIndex& section, int wire, int tube=0) const; MuoIndex getMuoIndex(const MuoSectionIndex& sect, int plane, int wire) const; // Adaptors for readout electronics int getModuleID(const MuoIndex& ix) const; int getFrontEnd(const MuoIndex& ix) const; int getFrontEnd(const int modID, const int index) const; int getFECount(const int modID) const; int getChannelID(const MuoIndex& ix) const; MuoIndex getMuoIndex(const int modID, const int chanID) const; private: // Identify the SectionIndex MuoSectionIndex getMuoSectionIndex(const int modID, const int chanID) const; // Map high-order bits from section to channel ID int getSectionID(const MuoIndex& ix) const; // Calculate suboctant for SFE int getSuboctant(const MuoIndex& ix) const; // Calculate pmt number int getPMT(const MuoIndex& ix) const; // Convert from PDT local to global MuoCellIndex getPDTIndex(const MuoSectionIndex& ix, int lpln, int lwir) const; // Map to internal data Section selectSection(const MuoSectionIndex& ix) const; }; } #endif