eformat::helper::SourceIdentifier Class Reference

#include <SourceIdentifier.h>

List of all members.

Public Member Functions

 SourceIdentifier (eformat::SubDetector subdet, uint16_t id)
 SourceIdentifier (uint32_t sid)
eformat::SubDetector subdetector_id (void) const
uint16_t module_id (void) const
uint32_t code (void) const
std::string human (void) const
std::string human_detector (void) const

Private Attributes

eformat::SubDetector m_sd
 The subdetector component.
uint16_t m_id
 The module identifier.


Detailed Description

Defines converters between source identifiers and its components.

Definition at line 94 of file SourceIdentifier.h.


Constructor & Destructor Documentation

eformat::helper::SourceIdentifier::SourceIdentifier ( eformat::SubDetector  subdet,
uint16_t  id 
)

Constructor. Takes the components to form a source identifier.

Parameters:
subdet The subdetector for this source
id The module identifier

Definition at line 19 of file SourceIdentifier.cxx.

00020   : m_sd(subdet),
00021     m_id(id)
00022 {
00023 }

eformat::helper::SourceIdentifier::SourceIdentifier ( uint32_t  sid  ) 

Constructor. Takes the source identifier to understand the components from.

Parameters:
sid The source identifier, fully built.
Warning:
This source identifier has to conform to the current version of the library or unpredictable results might occur.

Definition at line 25 of file SourceIdentifier.cxx.

00026   : m_sd(static_cast<eformat::SubDetector>((sid >> 16) & 0xff)),
00027     m_id(static_cast<uint16_t>(0xffff & sid))
00028 {
00029 }


Member Function Documentation

uint32_t eformat::helper::SourceIdentifier::code ( void   )  const

Gets the full 32-bit number made by assembling the 3 numbers above.

Definition at line 31 of file SourceIdentifier.cxx.

References m_id, and m_sd.

00032 {
00033   uint32_t retval = (0xff) & m_sd;
00034   retval <<= 16;
00035   retval |= m_id;
00036   return retval;
00037 }

std::string eformat::helper::SourceIdentifier::human ( void   )  const

Returns a string that represents the source identifier in a human readable format

Definition at line 39 of file SourceIdentifier.cxx.

References human_detector(), and module_id().

00040 {
00041   std::ostringstream oss;
00042   oss << human_detector() << ", Identifier = " << (unsigned int)module_id();
00043   return oss.str();
00044 }

std::string eformat::helper::SourceIdentifier::human_detector ( void   )  const

Returns a string that represents the subdetector identifier in a human readable format

Definition at line 46 of file SourceIdentifier.cxx.

References eformat::FULL_SD_EVENT, eformat::LAR_EM_BARREL_A_SIDE, eformat::LAR_EM_BARREL_C_SIDE, eformat::LAR_EM_ENDCAP_A_SIDE, eformat::LAR_EM_ENDCAP_C_SIDE, eformat::LAR_FCAL_A_SIDE, eformat::LAR_FCAL_C_SIDE, eformat::LAR_HAD_ENDCAP_A_SIDE, eformat::LAR_HAD_ENDCAP_C_SIDE, eformat::MUON_ANCILLARY_CRATE, eformat::MUON_CSC_ENDCAP_A_SIDE, eformat::MUON_CSC_ENDCAP_C_SIDE, eformat::MUON_MDT_BARREL_A_SIDE, eformat::MUON_MDT_BARREL_C_SIDE, eformat::MUON_MDT_ENDCAP_A_SIDE, eformat::MUON_MDT_ENDCAP_C_SIDE, eformat::MUON_RPC_BARREL_A_SIDE, eformat::MUON_RPC_BARREL_C_SIDE, eformat::MUON_TGC_ENDCAP_A_SIDE, eformat::MUON_TGC_ENDCAP_C_SIDE, eformat::OTHER, eformat::PIXEL_B_LAYER, eformat::PIXEL_BARREL, eformat::PIXEL_FORWARD_A_SIDE, eformat::PIXEL_FORWARD_C_SIDE, s, eformat::SCT_BARREL_A_SIDE, eformat::SCT_BARREL_C_SIDE, eformat::SCT_ENDCAP_A_SIDE, eformat::SCT_ENDCAP_C_SIDE, deljobs::string, subdetector_id(), eformat::TDAQ_BEAM_CRATE, eformat::TDAQ_CALO_CLUSTER_PROC_DAQ, eformat::TDAQ_CALO_CLUSTER_PROC_ROI, eformat::TDAQ_CALO_JET_PROC_DAQ, eformat::TDAQ_CALO_JET_PROC_ROI, eformat::TDAQ_CALO_PREPROC, eformat::TDAQ_CTP, eformat::TDAQ_EVENT_FILTER, eformat::TDAQ_L2SV, eformat::TDAQ_LVL2, eformat::TDAQ_MUON_CTP_INTERFACE, eformat::TDAQ_SFI, eformat::TDAQ_SFO, eformat::TILECAL_BARREL_A_SIDE, eformat::TILECAL_BARREL_C_SIDE, eformat::TILECAL_EXT_A_SIDE, eformat::TILECAL_EXT_C_SIDE, eformat::TILECAL_LASER_CRATE, eformat::TRT_ANCILLARY_CRATE, eformat::TRT_BARREL_A_SIDE, eformat::TRT_BARREL_C_SIDE, eformat::TRT_ENDCAP_A_SIDE, and eformat::TRT_ENDCAP_C_SIDE.

Referenced by human().

00047 {
00048   using namespace eformat;
00049   std::string s;
00050   switch (subdetector_id()) {
00051   case FULL_SD_EVENT:
00052     s += "FULL_SD_EVENT";
00053     break;
00054   case PIXEL_BARREL:
00055     s += "PIXEL_BARREL";
00056     break;
00057   case PIXEL_FORWARD_A_SIDE:
00058     s += "PIXEL_FORWARD_A_SIDE";
00059     break;
00060   case PIXEL_FORWARD_C_SIDE:
00061     s += "PIXEL_FORWARD_C_SIDE";
00062     break;
00063   case PIXEL_B_LAYER:
00064     s += "PIXEL_B_LAYER";
00065     break;
00066   case SCT_BARREL_A_SIDE:
00067     s += "SCT_BARREL_A_SIDE";
00068     break;
00069   case SCT_BARREL_C_SIDE:
00070     s += "SCT_BARREL_C_SIDE";
00071     break;
00072   case SCT_ENDCAP_A_SIDE:
00073     s += "SCT_ENDCAP_A_SIDE";
00074     break;
00075   case SCT_ENDCAP_C_SIDE:
00076     s += "SCT_ENDCAP_C_SIDE";
00077     break;
00078   case TRT_ANCILLARY_CRATE:
00079     s += "TRT_ANCILLARY_CRATE";
00080     break;
00081   case TRT_BARREL_A_SIDE:
00082     s += "TRT_BARREL_A_SIDE";
00083     break;
00084   case TRT_BARREL_C_SIDE:
00085     s += "TRT_BARREL_C_SIDE";
00086     break;
00087   case TRT_ENDCAP_A_SIDE:
00088     s += "TRT_ENDCAP_A_SIDE";
00089     break;
00090   case TRT_ENDCAP_C_SIDE:
00091     s += "TRT_ENDCAP_C_SIDE";
00092     break;
00093   case LAR_EM_BARREL_A_SIDE:
00094     s += "LAR_EM_BARREL_A_SIDE";
00095     break;
00096   case LAR_EM_BARREL_C_SIDE:
00097     s += "LAR_EM_BARREL_C_SIDE";
00098     break;
00099   case LAR_EM_ENDCAP_A_SIDE:
00100     s += "LAR_EM_ENDCAP_A_SIDE";
00101     break;
00102   case LAR_EM_ENDCAP_C_SIDE:
00103     s += "LAR_EM_ENDCAP_C_SIDE";
00104     break;
00105   case LAR_HAD_ENDCAP_A_SIDE:
00106     s += "LAR_HAD_ENDCAP_A_SIDE";
00107     break;
00108   case LAR_HAD_ENDCAP_C_SIDE:
00109     s += "LAR_HAD_ENDCAP_C_SIDE";
00110     break;
00111   case LAR_FCAL_A_SIDE:
00112     s += "LAR_FCAL_A_SIDE";
00113     break;
00114   case LAR_FCAL_C_SIDE:
00115     s += "LAR_FCAL_C_SIDE";
00116     break;
00117   case TILECAL_LASER_CRATE:
00118     s += "TILECAL_LASER_CRATE";
00119     break;
00120   case TILECAL_BARREL_A_SIDE:
00121     s += "TILECAL_BARREL_A_SIDE";
00122     break;
00123   case TILECAL_BARREL_C_SIDE:
00124     s += "TILECAL_BARREL_C_SIDE";
00125     break;
00126   case TILECAL_EXT_A_SIDE:
00127     s += "TILECAL_EXT_A_SIDE";
00128     break;
00129   case TILECAL_EXT_C_SIDE:
00130     s += "TILECAL_EXT_C_SIDE";
00131     break;
00132   case MUON_ANCILLARY_CRATE:
00133     s += "MUON_ANCILLARY_CRATE";
00134     break;
00135   case MUON_MDT_BARREL_A_SIDE:
00136     s += "MUON_MDT_BARREL_A_SIDE";
00137     break;
00138   case MUON_MDT_BARREL_C_SIDE:
00139     s += "MUON_MDT_BARREL_C_SIDE";
00140     break;
00141   case MUON_MDT_ENDCAP_A_SIDE:
00142     s += "MUON_MDT_ENDCAP_A_SIDE";
00143     break;
00144   case MUON_MDT_ENDCAP_C_SIDE:
00145     s += "MUON_MDT_ENDCAP_C_SIDE";
00146     break;
00147   case MUON_RPC_BARREL_A_SIDE:
00148     s += "MUON_RPC_BARREL_A_SIDE";
00149     break;
00150   case MUON_RPC_BARREL_C_SIDE:
00151     s += "MUON_RPC_BARREL_C_SIDE";
00152     break;
00153   case MUON_TGC_ENDCAP_A_SIDE:
00154     s += "MUON_TGC_ENDCAP_A_SIDE";
00155     break;
00156   case MUON_TGC_ENDCAP_C_SIDE:
00157     s += "MUON_TGC_ENDCAP_C_SIDE";
00158     break;
00159   case MUON_CSC_ENDCAP_A_SIDE:
00160     s += "MUON_CSC_ENDCAP_A_SIDE";
00161     break;
00162   case MUON_CSC_ENDCAP_C_SIDE:
00163     s += "MUON_CSC_ENDCAP_C_SIDE";
00164     break;
00165   case TDAQ_BEAM_CRATE:
00166     s += "TDAQ_BEAM_CRATE";
00167     break;
00168   case TDAQ_CALO_PREPROC:
00169     s += "TDAQ_CALO_PREPROC";
00170     break;
00171   case TDAQ_CALO_CLUSTER_PROC_DAQ:
00172     s += "TDAQ_CALO_CLUSTER_PROC_DAQ";
00173     break;
00174   case TDAQ_CALO_CLUSTER_PROC_ROI:
00175     s += "TDAQ_CALO_CLUSTER_PROC_ROI";
00176     break;
00177   case TDAQ_CALO_JET_PROC_DAQ:
00178     s += "TDAQ_CALO_JET_PROC_DAQ";
00179     break;
00180   case TDAQ_CALO_JET_PROC_ROI:
00181     s += "TDAQ_CALO_JET_PROC_ROI";
00182     break;
00183   case TDAQ_MUON_CTP_INTERFACE:
00184     s += "TDAQ_MUON_CTP_INTERFACE";
00185     break;
00186   case TDAQ_CTP:
00187     s += "TDAQ_CTP";
00188     break;
00189   case TDAQ_L2SV:
00190     s += "TDAQ_L2SV";
00191     break;
00192   case TDAQ_SFI:
00193     s += "TDAQ_SFI";
00194     break;
00195   case TDAQ_SFO:
00196     s += "TDAQ_SFO";
00197     break;
00198   case TDAQ_LVL2:
00199     s += "TDAQ_LVL2";
00200     break;
00201   case TDAQ_EVENT_FILTER:
00202     s += "TDAQ_EVENT_FILTER";
00203     break;
00204   case OTHER:
00205     s += "OTHER";
00206     break;
00207   default:
00208     break;
00209   }
00210   return s;
00211 }

uint16_t eformat::helper::SourceIdentifier::module_id ( void   )  const [inline]

Extracts the Module identifier from the source identifier.

Definition at line 123 of file SourceIdentifier.h.

References m_id.

Referenced by human().

00123 { return m_id; }

eformat::SubDetector eformat::helper::SourceIdentifier::subdetector_id ( void   )  const [inline]

Extracts the SubDetector component of the identifier.

Definition at line 118 of file SourceIdentifier.h.

References m_sd.

Referenced by human_detector().

00118 { return m_sd; }


Member Data Documentation

uint16_t eformat::helper::SourceIdentifier::m_id [private]

The module identifier.

Definition at line 146 of file SourceIdentifier.h.

Referenced by code(), and module_id().

eformat::SubDetector eformat::helper::SourceIdentifier::m_sd [private]

The subdetector component.

Definition at line 145 of file SourceIdentifier.h.

Referenced by code(), and subdetector_id().


Generated on Tue Nov 29 23:36:30 2016 for BOSS_7.0.2 by  doxygen 1.4.7