/*************************************************************************** Detector Description ----------------------------------------- Copyright (C) 1998 by ATLAS Collaboration ***************************************************************************/ // $Id: MuonID.h,v 1.11 2001/07/26 12:49:18 goldfarb Exp $ // $Name: $ #ifndef DETECTORDESCRIPTION_MUONID_H # define DETECTORDESCRIPTION_MUONID_H // Includes #include "AtlasDetDescr/AtlasDetectorID.h" #include "Identifier/Range.h" // // class MuonID // // This class provides an interface to generate an identifier or a // range for the Muon Spectrometer. To work with identifiers for the // Muon Spectrometer and its subsystems, this class and the classes // MDT_ID, RPC_ID, and TGC_ID should be used. // // An identifier for a part of the muon spectrometer is an // hierarchical set of numbers of the form: // // /muon/[mdt,rpc,tgc]/station_side/station_layer/station_eta/... // .../station_phi/ // // The details of the ranges allowed for these numbers is given // below. // // The class MuonID provides general services for all subsystems, for // example, // // - generate ids for each subsystem (mdt, rpc, tgc) // - test ids to see if they are of one of these systems // - print out the contents of an id // // For the full interface, see below. // // Value ranges for id elements: // ----------------------------- // // Definition and the range of values for the elements of the // identifier are: // // element range meaning // ------- ----- ------- // station_side [-1, 1] sign(eta) // station_layer [ 0, 3] MDT: Inner,Extra,Middle,Outer; TGC: Increasing Z // station_eta [ 0,10] EndCap is counted as upper eta values // station_phi [ 0,47] MDT: [0,15]; TGC 'F': [0,23]; TGC 'E': [0,47] // // Special cases: // // 1) BEE, EES and EEL - these chambers form an 'extra' layer = 1. // Eta counting starts with EES and EEL and then comes BEE // (after the EES). // // 2) BIR - these are 'extra' chambers in the inner layer which // are at a slightly larger radius than the BIL chambers which // fall within the two phi sectors of the feet. These have // will have the same eta/phi as the corresponding BIL, but // will have a chamber number = 1 (see MDT below). // // 3) BOF, BOG, and BOH - BOF chambers alternate in eta with a // pair of BOG+BOH chambers, starting with BOF. BOG+BOH // chambers form a pair of chambers which cover the same phi // sector as a single BOF. To distinguish BOG from BOH, they // will have different chamber numbers (see below). // // According to which technology, the other fields receive different // meanings and are serviced by specialized classes // // MDT Chambers // ==================== // chamber [0, 1] (1 for special cases: BIR = 1, BOG = 0, BOH = 1) // multilayer [0, 1] // tube_layer [0, 4] // tube [0, 71] // // RPC Doublet Sets // ==================== // doublet_set [0, 1] (Middle: 0=bottom, 1=top) // zdoublet [0, 2] // xdoublet [0, 1] (dead space separation) // xreadout [0, 1] (logical separation - BMS, BMF) // gas_gap [0, 1] (doublets) // strip_layer [0, 1] // strip [0, 99] // // TGC Chambers // ==================== // chamber_eta [0, 4] (Inner: 0, Middle: depends on station type) // gas_gap [0, 2] (doublets or triplets) // is_strip [0, 1] (0=wire, 1=strip) // element [0,133] (strips: 0-31, wires: 0-133) // class MuonID : public AtlasDetectorID { public: MuonID(); // Build id for (sub)systems Identifier muon() const; Identifier mdt() const; Identifier rpc() const; Identifier tgc() const; // Test for technology type bool is_muon(const Identifier& id) const; bool is_mdt (const Identifier& id) const; bool is_rpc (const Identifier& id) const; bool is_tgc (const Identifier& id) const; // Extract station parts int station_side (const Identifier& id); int station_layer(const Identifier& id); int station_eta (const Identifier& id); int station_phi (const Identifier& id); // When extracting parts of identifier: missing id part returns 0 // and sets field_not_found to true. bool field_not_found() const; // Print out contents of an id void print(const Identifier& id) const; protected: // check values down to station level bool values_ok(int station_side, int station_layer, int station_eta, int station_phi) const; void add_station_id(Identifier& id, int station_side, int station_layer, int station_eta, int station_phi) const; enum MUON_INDEX {technology_index = 0, station_side_index = 1, station_layer_index = 2, station_eta_index = 3, station_phi_index = 4 }; }; class MDT_ID : public MuonID { public: MDT_ID(); // MDT Chamber Identifier id(int station_side, int station_layer, int station_eta, int station_phi, int chamber) const; // MDT Tube Identifier tube_id(int station_side, int station_layer, int station_eta, int station_phi, int chamber, int multilayer, int tube_layer, int tube) const; Identifier tube_id(const Identifier& mdt_id, int multilayer, int tube_layer, int tube) const; Range range(const std::string& station_side, const std::string& station_layer, const std::string& station_eta, const std::string& station_phi, const std::string& chamber, const std::string& multilayer, const std::string& tube_layer, const std::string& tube) const; // Extract parts of identifier: missing id part returns 0 and sets // field_not_found to true. bool field_not_found() const; int chamber (const Identifier& id); int multilayer(const Identifier& id); int tube_layer(const Identifier& id); int tube (const Identifier& id); private: // check values down to chamber level bool values_ok(int station_side, int station_layer, int station_eta, int station_phi, int chamber) const; // check values down to tube level bool values_ok(int station_side, int station_layer, int station_eta, int station_phi, int chamber, int multilayer, int tube_layer, int tube) const; enum MDT_INDEX {chamber_index = 5, multilayer_index = 6, tube_layer_index = 7, tube_index = 8 }; }; class RPC_ID : public MuonID { public: RPC_ID(); // RPC Doublet Set Identifier id(int station_side, int station_layer, int station_eta, int station_phi, int doublet_set) const; // RPC Strip Identifier strip_id(int station_side, int station_layer, int station_eta, int station_phi, int doublet_set, int zdoublet, int xdoublet, int xreadout, int gas_gap, int strip_layer, int strip) const; Identifier strip_id(const Identifier& rpc_id, int zdoublet, int xdoublet, int xreadout, int gas_gap, int strip_layer, int strip) const; Range range (const std::string& station_side, const std::string& station_layer, const std::string& station_eta, const std::string& station_phi, const std::string& doublet_set, const std::string& zdoublet, const std::string& xdoublet, const std::string& xreadout, const std::string& gas_gap, const std::string& strip_layer, const std::string& strip) const; // Extract parts of identifier: missing id part returns 0 and sets // field_not_found to true. bool field_not_found() const; int doublet_set(const Identifier& id); int zdoublet (const Identifier& id); int xdoublet (const Identifier& id); int xreadout (const Identifier& id); int gas_gap (const Identifier& id); int strip_layer(const Identifier& id); int strip (const Identifier& id); private: // check values down to doublet set level bool values_ok(int station_side, int station_layer, int station_eta, int station_phi, int doublet_set) const; // check values down to strip level bool values_ok(int station_side, int station_layer, int station_eta, int station_phi, int doublet_set, int zdoublet, int xdoublet, int xreadout, int gas_gap, int strip_layer, int strip) const; enum RPC_INDEX {doublet_set_index = 5, strip_layer_index = 6, strip_index = 7}; }; class TGC_ID : public MuonID { public: TGC_ID(); // TGC Chamber Identifier id(int station_side, int station_layer, int station_eta, int station_phi, int chamber_eta) const; // TGC Wire or Strip Identifier element_id(int station_side, int station_layer, int station_eta, int station_phi, int chamber_eta, int gas_gap, int is_strip, int element) const; Identifier element_id(const Identifier& tgc_id, int gas_gap, int is_strip, int element) const; Range range(const std::string& station_side, const std::string& station_layer, const std::string& station_eta, const std::string& station_phi, const std::string& chamber_eta, const std::string& gas_gap, const std::string& is_strip, const std::string& element) const; // Extract parts of identifier: missing id part returns 0 and sets // field_not_found to true. bool field_not_found() const; int chamber_eta(const Identifier& id); int gas_gap (const Identifier& id); int is_strip (const Identifier& id); int element (const Identifier& id); private: // check values down to chamber level bool values_ok(int station_side, int station_layer, int station_eta, int station_phi, int chamber_eta) const; // check values down to element level bool values_ok(int station_side, int station_layer, int station_eta, int station_phi, int chamber_eta, int gas_gap, int is_strip, int element) const; enum TGC_INDEX {chamber_eta_index = 5, gas_gap_index = 6, is_strip_index = 7, element_index = 8}; }; #endif // DETECTORDESCRIPTION_MUONID_H