00001 // Last commit: $Id: SiStripEnumsAndStrings.cc,v 1.22 2010/02/22 14:10:23 wto Exp $ 00002 00003 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h" 00004 00005 // ----------------------------------------------------------------------------- 00006 // 00007 std::string SiStripEnumsAndStrings::view( const sistrip::View& view ) { 00008 if ( view == sistrip::READOUT_VIEW ) { return sistrip::readoutView_; } 00009 else if ( view == sistrip::CONTROL_VIEW ) { return sistrip::controlView_; } 00010 else if ( view == sistrip::DETECTOR_VIEW ) { return sistrip::detectorView_; } 00011 else if ( view == sistrip::UNDEFINED_VIEW ) { return sistrip::undefinedView_; } 00012 else { return sistrip::unknownView_; } 00013 } 00014 00015 // ----------------------------------------------------------------------------- 00016 // 00017 sistrip::View SiStripEnumsAndStrings::view( const std::string& dir ) { 00018 if ( dir.find( sistrip::readoutView_ ) != std::string::npos ) { return sistrip::READOUT_VIEW; } 00019 else if ( dir.find( sistrip::controlView_ ) != std::string::npos ) { return sistrip::CONTROL_VIEW; } 00020 else if ( dir.find( sistrip::detectorView_ ) != std::string::npos ) { return sistrip::DETECTOR_VIEW; } 00021 else if ( dir.find( sistrip::undefinedView_ ) != std::string::npos ) { return sistrip::UNDEFINED_VIEW; } 00022 else if ( dir.empty() ) { return sistrip::UNDEFINED_VIEW; } 00023 else { return sistrip::UNKNOWN_VIEW; } 00024 } 00025 00026 // ----------------------------------------------------------------------------- 00027 // 00028 std::string SiStripEnumsAndStrings::runType( const sistrip::RunType& run_type ) { 00029 if ( run_type == sistrip::FAST_CABLING ) { return sistrip::fastCablingRun_; } 00030 else if ( run_type == sistrip::FED_CABLING ) { return sistrip::fedCablingRun_; } 00031 else if ( run_type == sistrip::APV_TIMING ) { return sistrip::apvTimingRun_; } 00032 else if ( run_type == sistrip::FED_TIMING ) { return sistrip::fedTimingRun_; } 00033 else if ( run_type == sistrip::OPTO_SCAN ) { return sistrip::optoScanRun_; } 00034 else if ( run_type == sistrip::VPSP_SCAN ) { return sistrip::vpspScanRun_; } 00035 else if ( run_type == sistrip::PEDESTALS ) { return sistrip::pedestalsRun_; } 00036 else if ( run_type == sistrip::PEDS_ONLY ) { return sistrip::pedsOnlyRun_; } 00037 else if ( run_type == sistrip::NOISE ) { return sistrip::noiseRun_; } 00038 else if ( run_type == sistrip::PEDS_FULL_NOISE ) { return sistrip::pedsFullNoiseRun_; } 00039 else if ( run_type == sistrip::APV_LATENCY ){ return sistrip::apvLatencyRun_; } 00040 else if ( run_type == sistrip::FINE_DELAY ){ return sistrip::fineDelayRun_; } 00041 else if ( run_type == sistrip::CALIBRATION ){ return sistrip::calibPeakRun_; } 00042 else if ( run_type == sistrip::CALIBRATION_DECO ){ return sistrip::calibDeconRun_; } 00043 else if ( run_type == sistrip::CALIBRATION_SCAN ){ return sistrip::calibScanPeakRun_; } 00044 else if ( run_type == sistrip::CALIBRATION_SCAN_DECO ){ return sistrip::calibScanDeconRun_; } 00045 else if ( run_type == sistrip::DAQ_SCOPE_MODE ){ return sistrip::daqScopeModeRun_; } 00046 else if ( run_type == sistrip::PHYSICS ){ return sistrip::physicsRun_; } 00047 else if ( run_type == sistrip::UNDEFINED_RUN_TYPE ) { return sistrip::undefinedRunType_; } 00048 else { return sistrip::unknownRunType_; } 00049 } 00050 00051 // ----------------------------------------------------------------------------- 00052 // 00053 sistrip::RunType SiStripEnumsAndStrings::runType( const std::string& run_type ) { 00054 if ( run_type.find( sistrip::fastCablingRun_ ) != std::string::npos ) { return sistrip::FAST_CABLING; } 00055 else if ( run_type.find( sistrip::fedCablingRun_ ) != std::string::npos ) { return sistrip::FED_CABLING; } 00056 else if ( run_type.find( sistrip::apvTimingRun_ ) != std::string::npos ) { return sistrip::APV_TIMING; } 00057 else if ( run_type.find( sistrip::fedTimingRun_ ) != std::string::npos ) { return sistrip::FED_TIMING; } 00058 else if ( run_type.find( sistrip::optoScanRun_ ) != std::string::npos ) { return sistrip::OPTO_SCAN; } 00059 else if ( run_type.find( sistrip::vpspScanRun_ ) != std::string::npos ) { return sistrip::VPSP_SCAN; } 00060 else if ( run_type.find( sistrip::pedestalsRun_ ) != std::string::npos ) { return sistrip::PEDESTALS; } 00061 else if ( run_type.find( sistrip::pedsOnlyRun_ ) != std::string::npos ) { return sistrip::PEDS_ONLY; } 00062 else if ( run_type.find( sistrip::pedsFullNoiseRun_ ) != std::string::npos ) { return sistrip::PEDS_FULL_NOISE; } // needs to be before noise, otherwise name mismatch 00063 else if ( run_type.find( sistrip::noiseRun_ ) != std::string::npos ) { return sistrip::NOISE; } 00064 else if ( run_type.find( sistrip::fineDelayRun_ ) != std::string::npos ) { return sistrip::FINE_DELAY; } 00065 else if ( run_type.find( sistrip::calibPeakRun_ ) != std::string::npos ) { return sistrip::CALIBRATION; } 00066 else if ( run_type.find( sistrip::calibScanPeakRun_ ) != std::string::npos ) { return sistrip::CALIBRATION_SCAN; } 00067 else if ( run_type.find( sistrip::calibDeconRun_ ) != std::string::npos ) { return sistrip::CALIBRATION_DECO; } 00068 else if ( run_type.find( sistrip::calibScanDeconRun_ ) != std::string::npos ) { return sistrip::CALIBRATION_SCAN_DECO; } 00069 else if ( run_type.find( sistrip::apvLatencyRun_ ) != std::string::npos ) { return sistrip::APV_LATENCY; } 00070 else if ( run_type.find( sistrip::daqScopeModeRun_ ) != std::string::npos ) { return sistrip::DAQ_SCOPE_MODE; } 00071 else if ( run_type.find( sistrip::physicsRun_ ) != std::string::npos ) { return sistrip::PHYSICS; } 00072 else if ( run_type.find( sistrip::undefinedRunType_ ) != std::string::npos ) { return sistrip::UNDEFINED_RUN_TYPE; } 00073 else if ( run_type.empty() ) { return sistrip::UNDEFINED_RUN_TYPE; } 00074 else if ( run_type == "FAST_CABLING" ) { return sistrip::FAST_CABLING; } 00075 else if ( run_type == "FED_CABLING" ) { return sistrip::FED_CABLING; } 00076 else if ( run_type == "APV_TIMING" ) { return sistrip::APV_TIMING; } 00077 else if ( run_type == "FED_TIMING" ) { return sistrip::FED_TIMING; } 00078 else if ( run_type == "OPTO_SCAN" ) { return sistrip::OPTO_SCAN; } 00079 else if ( run_type == "VPSP_SCAN" ) { return sistrip::VPSP_SCAN; } 00080 else if ( run_type == "PEDESTALS" ) { return sistrip::PEDESTALS; } 00081 else if ( run_type == "PEDS_FULL_NOISE" ) { return sistrip::PEDS_FULL_NOISE; } 00082 else if ( run_type == "PEDS_ONLY" ) { return sistrip::PEDS_ONLY; } 00083 else if ( run_type == "NOISE" ) { return sistrip::NOISE; } 00084 else if ( run_type == "APV_LATENCY" ) { return sistrip::APV_LATENCY; } 00085 else if ( run_type == "FINE_DELAY" ) { return sistrip::FINE_DELAY; } 00086 else if ( run_type == "CALIBRATION" ) { return sistrip::CALIBRATION; } 00087 else if ( run_type == "CALIBRATION_SCAN" ) { return sistrip::CALIBRATION_SCAN; } 00088 else if ( run_type == "CALIBRATION_DECO" ) { return sistrip::CALIBRATION_DECO; } 00089 else if ( run_type == "CALIBRATION_SCAN_DECO" ) { return sistrip::CALIBRATION_SCAN_DECO; } 00090 else if ( run_type == "DAQ_SCOPE_MODE" ) { return sistrip::DAQ_SCOPE_MODE; } 00091 else if ( run_type == "PHYSICS" ) { return sistrip::PHYSICS; } 00092 else if ( run_type == "UNDEFINED" ) { return sistrip::UNDEFINED_RUN_TYPE; } 00093 else { return sistrip::UNKNOWN_RUN_TYPE; } 00094 } 00095 00096 // ----------------------------------------------------------------------------- 00097 // 00098 sistrip::RunType SiStripEnumsAndStrings::runType( const uint16_t& run_type ) { 00099 if ( run_type == 1 ) { return sistrip::PHYSICS; } 00100 else if ( run_type == 2 ) { return sistrip::PEDESTALS; } 00101 else if ( run_type == 3 ) { return sistrip::CALIBRATION; } 00102 else if ( run_type == 4 ) { return sistrip::OPTO_SCAN; } 00103 else if ( run_type == 5 ) { return sistrip::APV_TIMING; } 00104 else if ( run_type == 6 ) { return sistrip::APV_LATENCY; } 00105 else if ( run_type == 7 ) { return sistrip::FINE_DELAY_PLL; } 00106 else if ( run_type == 8 ) { return sistrip::FINE_DELAY_TTC; } 00107 else if ( run_type == 10 ) { return sistrip::MULTI_MODE; } 00108 else if ( run_type == 11 ) { return sistrip::FED_CABLING; } 00109 else if ( run_type == 12 ) { return sistrip::FED_TIMING; } 00110 else if ( run_type == 13 ) { return sistrip::FED_CABLING; } 00111 else if ( run_type == 14 ) { return sistrip::VPSP_SCAN; } 00112 else if ( run_type == 15 ) { return sistrip::DAQ_SCOPE_MODE; } 00113 else if ( run_type == 16 ) { return sistrip::QUITE_FAST_CABLING; } 00114 else if ( run_type == 17 ) { return sistrip::FINE_DELAY; } //@@ layer 00115 else if ( run_type == 18 ) { return sistrip::PHYSICS_ZS; } 00116 else if ( run_type == 19 ) { return sistrip::CALIBRATION_SCAN; } 00117 else if ( run_type == 20 ) { return sistrip::CALIBRATION_SCAN_DECO; } 00118 else if ( run_type == 21 ) { return sistrip::FAST_CABLING; } 00119 else if ( run_type == 22 ) { return sistrip::PEDS_ONLY; } 00120 else if ( run_type == 23 ) { return sistrip::NOISE; } 00121 else if ( run_type == 24 ) { return sistrip::PEDS_FULL_NOISE; } 00122 else if ( run_type == 33 ) { return sistrip::CALIBRATION_DECO; } 00123 else if ( run_type == sistrip::invalid_ ) { return sistrip::UNDEFINED_RUN_TYPE; } 00124 else { return sistrip::UNKNOWN_RUN_TYPE; } 00125 } 00126 00127 // ----------------------------------------------------------------------------- 00128 // 00129 std::string SiStripEnumsAndStrings::keyType( const sistrip::KeyType& key_type ) { 00130 if ( key_type == sistrip::FED_KEY ) { return sistrip::fedKey_; } 00131 else if ( key_type == sistrip::FEC_KEY ) { return sistrip::fecKey_; } 00132 else if ( key_type == sistrip::DET_KEY ) { return sistrip::detKey_; } 00133 else if ( key_type == sistrip::UNDEFINED_KEY ) { return sistrip::undefinedKey_; } 00134 else { return sistrip::unknownKey_; } 00135 } 00136 00137 // ----------------------------------------------------------------------------- 00138 // 00139 sistrip::KeyType SiStripEnumsAndStrings::keyType( const std::string& key_type ) { 00140 if ( key_type.find ( sistrip::fedKey_) != std::string::npos ) { return sistrip::FED_KEY; } 00141 else if ( key_type.find( sistrip::fecKey_) != std::string::npos ) { return sistrip::FEC_KEY; } 00142 else if ( key_type.find( sistrip::detKey_) != std::string::npos ) { return sistrip::DET_KEY; } 00143 else if ( key_type.find( sistrip::undefinedKey_) != std::string::npos ) { return sistrip::UNDEFINED_KEY; } 00144 else if ( key_type.empty() ) { return sistrip::UNDEFINED_KEY; } 00145 else { return sistrip::UNKNOWN_KEY; } 00146 } 00147 00148 // ----------------------------------------------------------------------------- 00149 // 00150 std::string SiStripEnumsAndStrings::granularity( const sistrip::Granularity& granularity ) { 00151 // System 00152 if ( granularity == sistrip::TRACKER ) { return sistrip::tracker_; } 00153 else if ( granularity == sistrip::PARTITION ) { return sistrip::partition_; } 00154 else if ( granularity == sistrip::TIB ) { return sistrip::tib_; } 00155 else if ( granularity == sistrip::TOB ) { return sistrip::tob_; } 00156 else if ( granularity == sistrip::TEC ) { return sistrip::tec_; } 00157 // Sub-structure 00158 else if ( granularity == sistrip::LAYER ) { return sistrip::layer_; } 00159 else if ( granularity == sistrip::ROD ) { return sistrip::rod_; } 00160 else if ( granularity == sistrip::STRING ) { return sistrip::string_; } 00161 else if ( granularity == sistrip::DISK ) { return sistrip::disk_; } 00162 else if ( granularity == sistrip::PETAL ) { return sistrip::petal_; } 00163 else if ( granularity == sistrip::RING ) { return sistrip::ring_; } 00164 // Module and below 00165 else if ( granularity == sistrip::MODULE ) { return sistrip::module_; } 00166 else if ( granularity == sistrip::LLD_CHAN ) { return sistrip::lldChan_; } 00167 else if ( granularity == sistrip::APV ) { return sistrip::apv_; } 00168 // Readout 00169 else if ( granularity == sistrip::FED_SYSTEM ) { return sistrip::fedSystem_; } 00170 else if ( granularity == sistrip::FE_DRIVER ) { return sistrip::feDriver_; } 00171 else if ( granularity == sistrip::FE_UNIT ) { return sistrip::feUnit_; } 00172 else if ( granularity == sistrip::FE_CHAN ) { return sistrip::feChan_; } 00173 else if ( granularity == sistrip::FED_APV ) { return sistrip::fedApv_; } 00174 else if ( granularity == sistrip::FED_CHANNEL ) { return sistrip::fedChannel_; } 00175 // Control 00176 else if ( granularity == sistrip::FEC_SYSTEM ) { return sistrip::fecSystem_; } 00177 else if ( granularity == sistrip::FEC_CRATE ) { return sistrip::fecCrate_; } 00178 else if ( granularity == sistrip::FEC_SLOT ) { return sistrip::fecSlot_; } 00179 else if ( granularity == sistrip::FEC_RING ) { return sistrip::fecRing_; } 00180 else if ( granularity == sistrip::CCU_ADDR ) { return sistrip::ccuAddr_; } 00181 else if ( granularity == sistrip::CCU_CHAN ) { return sistrip::ccuChan_; } 00182 // Unknown 00183 else if ( granularity == sistrip::UNDEFINED_GRAN ) { return sistrip::undefinedGranularity_; } 00184 else { return sistrip::unknownGranularity_; } 00185 } 00186 00187 // ----------------------------------------------------------------------------- 00188 // 00189 sistrip::Granularity SiStripEnumsAndStrings::granularity( const std::string& granularity ) { 00190 // System 00191 if ( granularity.find( sistrip::tracker_ ) != std::string::npos ) { return sistrip::TRACKER; } 00192 else if ( granularity.find( sistrip::partition_ ) != std::string::npos ) { return sistrip::PARTITION; } 00193 else if ( granularity.find( sistrip::tib_ ) != std::string::npos ) { return sistrip::TIB; } 00194 else if ( granularity.find( sistrip::tob_ ) != std::string::npos ) { return sistrip::TOB; } 00195 else if ( granularity.find( sistrip::tec_ ) != std::string::npos ) { return sistrip::TEC; } 00196 // Readout 00197 else if ( granularity.find( sistrip::fedSystem_ ) != std::string::npos ) { return sistrip::FED_SYSTEM; } 00198 else if ( granularity.find( sistrip::feDriver_ ) != std::string::npos ) { return sistrip::FE_DRIVER; } 00199 else if ( granularity.find( sistrip::feUnit_ ) != std::string::npos ) { return sistrip::FE_UNIT; } 00200 else if ( granularity.find( sistrip::feChan_ ) != std::string::npos ) { return sistrip::FE_CHAN; } 00201 else if ( granularity.find( sistrip::fedApv_ ) != std::string::npos ) { return sistrip::FED_APV; } 00202 else if ( granularity.find( sistrip::fedChannel_ ) != std::string::npos ) { return sistrip::FED_CHANNEL; } 00203 // Control 00204 else if ( granularity.find( sistrip::fecSystem_ ) != std::string::npos ) { return sistrip::FEC_SYSTEM; } 00205 else if ( granularity.find( sistrip::fecCrate_ ) != std::string::npos ) { return sistrip::FEC_CRATE; } 00206 else if ( granularity.find( sistrip::fecSlot_ ) != std::string::npos ) { return sistrip::FEC_SLOT; } 00207 else if ( granularity.find( sistrip::fecRing_ ) != std::string::npos ) { return sistrip::FEC_RING; } 00208 else if ( granularity.find( sistrip::ccuAddr_ ) != std::string::npos ) { return sistrip::CCU_ADDR; } 00209 else if ( granularity.find( sistrip::ccuChan_ ) != std::string::npos ) { return sistrip::CCU_CHAN; } 00210 // Sub-structure 00211 else if ( granularity.find( sistrip::layer_ ) != std::string::npos ) { return sistrip::LAYER; } 00212 else if ( granularity.find( sistrip::rod_ ) != std::string::npos ) { return sistrip::ROD; } 00213 else if ( granularity.find( sistrip::string_ ) != std::string::npos ) { return sistrip::STRING; } 00214 else if ( granularity.find( sistrip::disk_ ) != std::string::npos ) { return sistrip::DISK; } 00215 else if ( granularity.find( sistrip::petal_ ) != std::string::npos ) { return sistrip::PETAL; } 00216 else if ( granularity.find( sistrip::ring_ ) != std::string::npos ) { return sistrip::RING; } 00217 // Module and below 00218 else if ( granularity.find( sistrip::module_ ) != std::string::npos ) { return sistrip::MODULE; } 00219 else if ( granularity.find( sistrip::lldChan_ ) != std::string::npos ) { return sistrip::LLD_CHAN; } 00220 else if ( granularity.find( sistrip::apv_ ) != std::string::npos ) { return sistrip::APV; } //@@ bug if before "FedApv"! 00221 // Unknown 00222 else if ( granularity.find( sistrip::undefinedGranularity_ ) != std::string::npos ) { return sistrip::UNDEFINED_GRAN; } 00223 else if ( granularity.empty() ) { return sistrip::UNDEFINED_GRAN; } 00224 else { return sistrip::UNKNOWN_GRAN; } 00225 } 00226 00227 // ----------------------------------------------------------------------------- 00228 // 00229 std::string SiStripEnumsAndStrings::apvReadoutMode( const sistrip::ApvReadoutMode& mode ) { 00230 if ( mode == sistrip::APV_PEAK_MODE ) { return sistrip::apvPeakMode_; } 00231 else if ( mode == sistrip::APV_DECON_MODE ) { return sistrip::apvDeconMode_; } 00232 else if ( mode == sistrip::APV_MULTI_MODE ) { return sistrip::apvMultiMode_; } 00233 else if ( mode == sistrip::UNDEFINED_APV_READOUT_MODE ) { return sistrip::undefinedApvReadoutMode_; } 00234 else { return sistrip::unknownApvReadoutMode_; } 00235 } 00236 00237 // ----------------------------------------------------------------------------- 00238 // 00239 sistrip::ApvReadoutMode SiStripEnumsAndStrings::apvReadoutMode( const std::string& mode ) { 00240 if ( mode.find( sistrip::apvPeakMode_ ) != std::string::npos ) { return sistrip::APV_PEAK_MODE; } 00241 else if ( mode.find( sistrip::apvDeconMode_ ) != std::string::npos ) { return sistrip::APV_DECON_MODE; } 00242 else if ( mode.find( sistrip::apvMultiMode_ ) != std::string::npos ) { return sistrip::APV_MULTI_MODE; } 00243 else if ( mode.find( sistrip::undefinedApvReadoutMode_ ) != std::string::npos ) { return sistrip::UNDEFINED_APV_READOUT_MODE; } 00244 else if ( mode.empty() ) { return sistrip::UNDEFINED_APV_READOUT_MODE; } 00245 else { return sistrip::UNKNOWN_APV_READOUT_MODE; } 00246 } 00247 00248 // ----------------------------------------------------------------------------- 00249 // 00250 std::string SiStripEnumsAndStrings::fedReadoutMode( const sistrip::FedReadoutMode& mode ) { 00251 if ( mode == sistrip::FED_SCOPE_MODE ) { return sistrip::fedScopeMode_; } 00252 else if ( mode == sistrip::FED_VIRGIN_RAW ) { return sistrip::fedVirginRaw_; } 00253 else if ( mode == sistrip::FED_PROC_RAW ) { return sistrip::fedProcRaw_; } 00254 else if ( mode == sistrip::FED_ZERO_SUPPR ) { return sistrip::fedZeroSuppr_; } 00255 else if ( mode == sistrip::FED_ZERO_SUPPR_LITE ) { return sistrip::fedZeroSupprLite_; } 00256 else if ( mode == sistrip::UNDEFINED_FED_READOUT_MODE ) { return sistrip::undefinedFedReadoutMode_; } 00257 else { return sistrip::unknownFedReadoutMode_; } 00258 } 00259 00260 // ----------------------------------------------------------------------------- 00261 // 00262 sistrip::FedReadoutMode SiStripEnumsAndStrings::fedReadoutMode( const std::string& mode ) { 00263 if ( mode.find( sistrip::fedScopeMode_ ) != std::string::npos ) { return sistrip::FED_SCOPE_MODE; } 00264 else if ( mode.find( sistrip::fedVirginRaw_ ) != std::string::npos ) { return sistrip::FED_VIRGIN_RAW; } 00265 else if ( mode.find( sistrip::fedProcRaw_ ) != std::string::npos ) { return sistrip::FED_PROC_RAW; } 00266 else if ( mode.find( sistrip::fedZeroSuppr_ ) != std::string::npos ) { return sistrip::FED_ZERO_SUPPR; } 00267 else if ( mode.find( sistrip::fedZeroSupprLite_ ) != std::string::npos ) { return sistrip::FED_ZERO_SUPPR_LITE; } 00268 else if ( mode.find( sistrip::undefinedFedReadoutMode_ ) != std::string::npos ) { return sistrip::UNDEFINED_FED_READOUT_MODE; } 00269 else if ( mode.empty() ) { return sistrip::UNDEFINED_FED_READOUT_MODE; } 00270 else { return sistrip::UNKNOWN_FED_READOUT_MODE; } 00271 } 00272 00273 // ----------------------------------------------------------------------------- 00274 // 00275 std::string SiStripEnumsAndStrings::histoType( const sistrip::HistoType& type ) { 00276 if ( type == sistrip::EXPERT_HISTO ) { return sistrip::expertHisto_; } 00277 else if ( type == sistrip::SUMMARY_HISTO ) { return sistrip::summaryHisto_; } 00278 else if ( type == sistrip::UNDEFINED_HISTO_TYPE ) { return sistrip::undefinedHistoType_; } 00279 else { return sistrip::unknownHistoType_; } 00280 } 00281 00282 // ----------------------------------------------------------------------------- 00283 // 00284 sistrip::HistoType SiStripEnumsAndStrings::histoType( const std::string& type ) { 00285 if ( type.find( sistrip::expertHisto_ ) != std::string::npos ) { return sistrip::EXPERT_HISTO; } 00286 else if ( type.find( sistrip::summaryHisto_ ) != std::string::npos ) { return sistrip::SUMMARY_HISTO; } 00287 else if ( type.find( sistrip::undefinedHistoType_ ) != std::string::npos ) { return sistrip::UNDEFINED_HISTO_TYPE; } 00288 else if ( type.empty() ) { return sistrip::UNDEFINED_HISTO_TYPE; } 00289 else { return sistrip::UNKNOWN_HISTO_TYPE; } 00290 } 00291 00292 // ----------------------------------------------------------------------------- 00293 // 00294 std::string SiStripEnumsAndStrings::monitorable( const sistrip::Monitorable& mon ) { 00295 00296 // fed cabling 00297 if ( mon == sistrip::FED_CABLING_FED_ID ) { return sistrip::fedCablingFedId_; } 00298 else if ( mon == sistrip::FED_CABLING_FED_CH ) { return sistrip::fedCablingFedCh_; } 00299 else if ( mon == sistrip::FED_CABLING_ADC_LEVEL ) { return sistrip::fedCablingAdcLevel_; } 00300 00301 // fast fed cabling 00302 else if ( mon == sistrip::FAST_CABLING_DCU_ID ) { return sistrip::fastCablingDcuId_; } 00303 else if ( mon == sistrip::FAST_CABLING_LLD_CH ) { return sistrip::fastCablingLldCh_; } 00304 else if ( mon == sistrip::FAST_CABLING_HIGH_LEVEL ) { return sistrip::fastCablingHighLevel_; } 00305 else if ( mon == sistrip::FAST_CABLING_HIGH_RMS ) { return sistrip::fastCablingHighRms_; } 00306 else if ( mon == sistrip::FAST_CABLING_LOW_LEVEL ) { return sistrip::fastCablingLowLevel_; } 00307 else if ( mon == sistrip::FAST_CABLING_LOW_RMS ) { return sistrip::fastCablingLowRms_; } 00308 else if ( mon == sistrip::FAST_CABLING_MAX ) { return sistrip::fastCablingMax_; } 00309 else if ( mon == sistrip::FAST_CABLING_MIN ) { return sistrip::fastCablingMin_; } 00310 else if ( mon == sistrip::FAST_CABLING_CONNS_PER_FED ) { return sistrip::fastCablingConnsPerFed_; } 00311 00312 // apv timing 00313 else if ( mon == sistrip::APV_TIMING_TIME ) { return sistrip::apvTimingTime_; } 00314 else if ( mon == sistrip::APV_TIMING_MAX_TIME ) { return sistrip::apvTimingMax_; } 00315 else if ( mon == sistrip::APV_TIMING_DELAY ) { return sistrip::apvTimingDelay_; } 00316 else if ( mon == sistrip::APV_TIMING_ERROR ) { return sistrip::apvTimingError_; } 00317 else if ( mon == sistrip::APV_TIMING_BASE ) { return sistrip::apvTimingBase_; } 00318 else if ( mon == sistrip::APV_TIMING_PEAK ) { return sistrip::apvTimingPeak_; } 00319 else if ( mon == sistrip::APV_TIMING_HEIGHT ) { return sistrip::apvTimingHeight_; } 00320 00321 // fed timing 00322 else if ( mon == sistrip::FED_TIMING_TIME ) { return sistrip::fedTimingTime_; } 00323 else if ( mon == sistrip::FED_TIMING_MAX_TIME ) { return sistrip::fedTimingMax_; } 00324 else if ( mon == sistrip::FED_TIMING_DELAY ) { return sistrip::fedTimingDelay_; } 00325 else if ( mon == sistrip::FED_TIMING_ERROR ) { return sistrip::fedTimingError_; } 00326 else if ( mon == sistrip::FED_TIMING_BASE ) { return sistrip::fedTimingBase_; } 00327 else if ( mon == sistrip::FED_TIMING_PEAK ) { return sistrip::fedTimingPeak_; } 00328 else if ( mon == sistrip::FED_TIMING_HEIGHT ) { return sistrip::fedTimingHeight_; } 00329 00330 // opto scan 00331 else if ( mon == sistrip::OPTO_SCAN_LLD_GAIN_SETTING ) { return sistrip::optoScanLldGain_; } 00332 else if ( mon == sistrip::OPTO_SCAN_LLD_BIAS_SETTING ) { return sistrip::optoScanLldBias_; } 00333 else if ( mon == sistrip::OPTO_SCAN_MEASURED_GAIN ) { return sistrip::optoScanMeasGain_; } 00334 else if ( mon == sistrip::OPTO_SCAN_ZERO_LIGHT_LEVEL ) { return sistrip::optoScanZeroLight_; } 00335 else if ( mon == sistrip::OPTO_SCAN_LINK_NOISE ) { return sistrip::optoScanLinkNoise_; } 00336 else if ( mon == sistrip::OPTO_SCAN_BASELINE_LIFT_OFF ) { return sistrip::optoScanBaseLiftOff_; } 00337 else if ( mon == sistrip::OPTO_SCAN_LASER_THRESHOLD ) { return sistrip::optoScanLaserThresh_; } 00338 else if ( mon == sistrip::OPTO_SCAN_TICK_HEIGHT ) { return sistrip::optoScanTickHeight_; } 00339 00340 // vpsp scan 00341 else if ( mon == sistrip::VPSP_SCAN_APV_SETTINGS ) { return sistrip::vpspScanBothApvs_; } 00342 else if ( mon == sistrip::VPSP_SCAN_APV0_SETTING ) { return sistrip::vpspScanApv0_; } 00343 else if ( mon == sistrip::VPSP_SCAN_APV1_SETTING ) { return sistrip::vpspScanApv1_; } 00344 else if ( mon == sistrip::VPSP_SCAN_ADC_LEVEL ) { return sistrip::vpspScanAdcLevel_; } 00345 else if ( mon == sistrip::VPSP_SCAN_DIGITAL_HIGH ) { return sistrip::vpspScanDigitalHigh_; } 00346 else if ( mon == sistrip::VPSP_SCAN_DIGITAL_LOW ) { return sistrip::vpspScanDigitalLow_; } 00347 00348 // pedestals / noise 00349 else if ( mon == sistrip::PEDESTALS_ALL_STRIPS ) { return sistrip::pedestalsAllStrips_; } 00350 else if ( mon == sistrip::PEDESTALS_MEAN ) { return sistrip::pedestalsMean_; } 00351 else if ( mon == sistrip::PEDESTALS_SPREAD ) { return sistrip::pedestalsSpread_; } 00352 else if ( mon == sistrip::PEDESTALS_MAX ) { return sistrip::pedestalsMax_; } 00353 else if ( mon == sistrip::PEDESTALS_MIN ) { return sistrip::pedestalsMin_; } 00354 else if ( mon == sistrip::NOISE_ALL_STRIPS ) { return sistrip::noiseAllStrips_; } 00355 else if ( mon == sistrip::NOISE_MEAN ) { return sistrip::noiseMean_; } 00356 else if ( mon == sistrip::NOISE_SPREAD ) { return sistrip::noiseSpread_; } 00357 else if ( mon == sistrip::NOISE_MAX ) { return sistrip::noiseMax_; } 00358 else if ( mon == sistrip::NOISE_MIN ) { return sistrip::noiseMin_; } 00359 else if ( mon == sistrip::NUM_OF_DEAD ) { return sistrip::numOfDead_; } 00360 else if ( mon == sistrip::NUM_OF_NOISY ) { return sistrip::numOfNoisy_; } 00361 else if ( mon == sistrip::NOISE_GAUS_ALL_STRIPS ) { return sistrip::noiseGausAllStrips_; } 00362 else if ( mon == sistrip::NOISE_KS_ALL_STRIPS ) { return sistrip::noiseKSAllStrips_; } 00363 else if ( mon == sistrip::NOISE_CHI2_ALL_STRIPS ) { return sistrip::noiseChi2AllStrips_; } 00364 else if ( mon == sistrip::NOISE_BIN_84_ALL_STRIPS) { return sistrip::noiseBin84AllStrips_; } 00365 else if ( mon == sistrip::NOISE_RMS_ALL_STRIPS) { return sistrip::noiseRMSAllStrips_; } 00366 else if ( mon == sistrip::NOISE_SIGNIF_ALL_STRIPS ) { return sistrip::noiseSignif_; } 00367 00368 // fine delay 00369 else if ( mon == sistrip::FINE_DELAY_POS) { return sistrip::fineDelayPos_; } 00370 else if ( mon == sistrip::FINE_DELAY_ERROR) { return sistrip::fineDelayErr_; } 00371 00372 // calibration 00373 else if ( mon == sistrip::CALIBRATION_AMPLITUDE) { return sistrip::calibrationAmplitude_; } 00374 else if ( mon == sistrip::CALIBRATION_TAIL) { return sistrip::calibrationTail_; } 00375 else if ( mon == sistrip::CALIBRATION_RISETIME) { return sistrip::calibrationRiseTime_; } 00376 else if ( mon == sistrip::CALIBRATION_TIMECONSTANT) { return sistrip::calibrationTimeConstant_; } 00377 else if ( mon == sistrip::CALIBRATION_SMEARING) { return sistrip::calibrationSmearing_; } 00378 else if ( mon == sistrip::CALIBRATION_CHI2) { return sistrip::calibrationChi2_; } 00379 else if ( mon == sistrip::CALIBRATION_AMPLITUDE_ALLSTRIPS) { return sistrip::calibrationAmplitudeAS_; } 00380 else if ( mon == sistrip::CALIBRATION_TAIL_ALLSTRIPS) { return sistrip::calibrationTailAS_; } 00381 else if ( mon == sistrip::CALIBRATION_RISETIME_ALLSTRIPS) { return sistrip::calibrationRiseTimeAS_; } 00382 else if ( mon == sistrip::CALIBRATION_TIMECONSTANT_ALLSTRIPS) { return sistrip::calibrationTimeConstantAS_; } 00383 else if ( mon == sistrip::CALIBRATION_SMEARING_ALLSTRIPS) { return sistrip::calibrationSmearingAS_; } 00384 else if ( mon == sistrip::CALIBRATION_CHI2_ALLSTRIPS) { return sistrip::calibrationChi2AS_; } 00385 else if ( mon == sistrip::CALIBRATION_AMPLITUDE_MIN) { return sistrip::calibrationAmplitudeMin_; } 00386 else if ( mon == sistrip::CALIBRATION_TAIL_MIN) { return sistrip::calibrationTailMin_; } 00387 else if ( mon == sistrip::CALIBRATION_RISETIME_MIN) { return sistrip::calibrationRiseTimeMin_; } 00388 else if ( mon == sistrip::CALIBRATION_TIMECONSTANT_MIN) { return sistrip::calibrationTimeConstantMin_; } 00389 else if ( mon == sistrip::CALIBRATION_SMEARING_MIN) { return sistrip::calibrationSmearingMin_; } 00390 else if ( mon == sistrip::CALIBRATION_CHI2_MIN) { return sistrip::calibrationChi2Min_; } 00391 else if ( mon == sistrip::CALIBRATION_AMPLITUDE_MAX) { return sistrip::calibrationAmplitudeMax_; } 00392 else if ( mon == sistrip::CALIBRATION_TAIL_MAX) { return sistrip::calibrationTailMax_; } 00393 else if ( mon == sistrip::CALIBRATION_RISETIME_MAX) { return sistrip::calibrationRiseTimeMax_; } 00394 else if ( mon == sistrip::CALIBRATION_TIMECONSTANT_MAX) { return sistrip::calibrationTimeConstantMax_; } 00395 else if ( mon == sistrip::CALIBRATION_SMEARING_MAX) { return sistrip::calibrationSmearingMax_; } 00396 else if ( mon == sistrip::CALIBRATION_CHI2_MAX) { return sistrip::calibrationChi2Max_; } 00397 00398 // scope mode 00399 else if ( mon == sistrip::DAQ_SCOPE_MODE_MEAN_SIGNAL ) { return sistrip::daqScopeModeMeanSignal_; } 00400 00401 // unknown 00402 else if ( mon == sistrip::UNDEFINED_MONITORABLE ) { return sistrip::undefinedMonitorable_; } 00403 else { return sistrip::unknownMonitorable_; } 00404 00405 } 00406 00407 // ----------------------------------------------------------------------------- 00408 // 00409 sistrip::Monitorable SiStripEnumsAndStrings::monitorable( const std::string& mon ) { 00410 00411 // fed cabling 00412 if ( mon.find( sistrip::fedCablingFedId_ ) != std::string::npos ) { return sistrip::FED_CABLING_FED_ID; } 00413 else if ( mon.find( sistrip::fedCablingFedCh_ ) != std::string::npos ) { return sistrip::FED_CABLING_FED_CH; } 00414 else if ( mon.find( sistrip::fedCablingAdcLevel_ ) != std::string::npos ) { return sistrip::FED_CABLING_ADC_LEVEL; } 00415 00416 // fed cabling 00417 else if ( mon.find( sistrip::fastCablingDcuId_ ) != std::string::npos ) { return sistrip::FAST_CABLING_DCU_ID; } 00418 else if ( mon.find( sistrip::fastCablingLldCh_ ) != std::string::npos ) { return sistrip::FAST_CABLING_LLD_CH; } 00419 else if ( mon.find( sistrip::fastCablingHighLevel_ ) != std::string::npos ) { return sistrip::FAST_CABLING_HIGH_LEVEL; } 00420 else if ( mon.find( sistrip::fastCablingHighRms_ ) != std::string::npos ) { return sistrip::FAST_CABLING_HIGH_RMS; } 00421 else if ( mon.find( sistrip::fastCablingLowLevel_ ) != std::string::npos ) { return sistrip::FAST_CABLING_LOW_LEVEL; } 00422 else if ( mon.find( sistrip::fastCablingLowRms_ ) != std::string::npos ) { return sistrip::FAST_CABLING_LOW_RMS; } 00423 else if ( mon.find( sistrip::fastCablingMax_ ) != std::string::npos ) { return sistrip::FAST_CABLING_MAX; } 00424 else if ( mon.find( sistrip::fastCablingMin_ ) != std::string::npos ) { return sistrip::FAST_CABLING_MIN; } 00425 else if ( mon.find( sistrip::fastCablingConnsPerFed_ ) != std::string::npos ) { return sistrip::FAST_CABLING_CONNS_PER_FED; } 00426 00427 // apv timing 00428 else if ( mon.find( sistrip::apvTimingTime_ ) != std::string::npos ) { return sistrip::APV_TIMING_TIME; } 00429 else if ( mon.find( sistrip::apvTimingMax_ ) != std::string::npos ) { return sistrip::APV_TIMING_MAX_TIME; } 00430 else if ( mon.find( sistrip::apvTimingDelay_ ) != std::string::npos ) { return sistrip::APV_TIMING_DELAY; } 00431 else if ( mon.find( sistrip::apvTimingError_ ) != std::string::npos ) { return sistrip::APV_TIMING_ERROR; } 00432 else if ( mon.find( sistrip::apvTimingBase_ ) != std::string::npos ) { return sistrip::APV_TIMING_BASE; } 00433 else if ( mon.find( sistrip::apvTimingPeak_ ) != std::string::npos ) { return sistrip::APV_TIMING_PEAK; } 00434 else if ( mon.find( sistrip::apvTimingHeight_ ) != std::string::npos ) { return sistrip::APV_TIMING_HEIGHT; } 00435 00436 // fed timing 00437 else if ( mon.find( sistrip::fedTimingTime_ ) != std::string::npos ) { return sistrip::FED_TIMING_TIME; } 00438 else if ( mon.find( sistrip::fedTimingMax_ ) != std::string::npos ) { return sistrip::FED_TIMING_MAX_TIME; } 00439 else if ( mon.find( sistrip::fedTimingDelay_ ) != std::string::npos ) { return sistrip::FED_TIMING_DELAY; } 00440 else if ( mon.find( sistrip::fedTimingError_ ) != std::string::npos ) { return sistrip::FED_TIMING_ERROR; } 00441 else if ( mon.find( sistrip::fedTimingBase_ ) != std::string::npos ) { return sistrip::FED_TIMING_BASE; } 00442 else if ( mon.find( sistrip::fedTimingPeak_ ) != std::string::npos ) { return sistrip::FED_TIMING_PEAK; } 00443 else if ( mon.find( sistrip::fedTimingHeight_ ) != std::string::npos ) { return sistrip::FED_TIMING_HEIGHT; } 00444 00445 // opto scan 00446 else if ( mon.find( sistrip::optoScanLldGain_ ) != std::string::npos ) { return sistrip::OPTO_SCAN_LLD_GAIN_SETTING; } 00447 else if ( mon.find( sistrip::optoScanLldBias_ ) != std::string::npos ) { return sistrip::OPTO_SCAN_LLD_BIAS_SETTING; } 00448 else if ( mon.find( sistrip::optoScanMeasGain_ ) != std::string::npos ) { return sistrip::OPTO_SCAN_MEASURED_GAIN; } 00449 else if ( mon.find( sistrip::optoScanZeroLight_ ) != std::string::npos ) { return sistrip::OPTO_SCAN_ZERO_LIGHT_LEVEL; } 00450 else if ( mon.find( sistrip::optoScanLinkNoise_ ) != std::string::npos ) { return sistrip::OPTO_SCAN_LINK_NOISE; } 00451 else if ( mon.find( sistrip::optoScanBaseLiftOff_ ) != std::string::npos ) { return sistrip::OPTO_SCAN_BASELINE_LIFT_OFF; } 00452 else if ( mon.find( sistrip::optoScanLaserThresh_ ) != std::string::npos ) { return sistrip::OPTO_SCAN_LASER_THRESHOLD; } 00453 else if ( mon.find( sistrip::optoScanTickHeight_ ) != std::string::npos ) { return sistrip::OPTO_SCAN_TICK_HEIGHT; } 00454 00455 // vpsp scan 00456 else if ( mon.find( sistrip::vpspScanBothApvs_ ) != std::string::npos ) { return sistrip::VPSP_SCAN_APV_SETTINGS; } 00457 else if ( mon.find( sistrip::vpspScanApv0_ ) != std::string::npos ) { return sistrip::VPSP_SCAN_APV0_SETTING; } 00458 else if ( mon.find( sistrip::vpspScanApv1_ ) != std::string::npos ) { return sistrip::VPSP_SCAN_APV1_SETTING; } 00459 else if ( mon.find( sistrip::vpspScanAdcLevel_ ) != std::string::npos ) { return sistrip::VPSP_SCAN_ADC_LEVEL; } 00460 else if ( mon.find( sistrip::vpspScanDigitalHigh_ ) != std::string::npos ) { return sistrip::VPSP_SCAN_DIGITAL_HIGH; } 00461 else if ( mon.find( sistrip::vpspScanDigitalLow_ ) != std::string::npos ) { return sistrip::VPSP_SCAN_DIGITAL_LOW; } 00462 00463 // pedestals / noise 00464 else if ( mon.find( sistrip::pedestalsAllStrips_ ) != std::string::npos ) { return sistrip::PEDESTALS_ALL_STRIPS; } 00465 else if ( mon.find( sistrip::pedestalsMean_ ) != std::string::npos ) { return sistrip::PEDESTALS_MEAN; } 00466 else if ( mon.find( sistrip::pedestalsSpread_ ) != std::string::npos ) { return sistrip::PEDESTALS_SPREAD; } 00467 else if ( mon.find( sistrip::pedestalsMax_ ) != std::string::npos ) { return sistrip::PEDESTALS_MAX; } 00468 else if ( mon.find( sistrip::pedestalsMin_ ) != std::string::npos ) { return sistrip::PEDESTALS_MIN; } 00469 00470 // noiseKS must come before the more general noiseAllStrips, since it contains that string 00471 else if ( mon.find( sistrip::noiseGausAllStrips_ ) != std::string::npos ) { return sistrip::NOISE_GAUS_ALL_STRIPS; } 00472 else if ( mon.find( sistrip::noiseKSAllStrips_ ) != std::string::npos ) { return sistrip::NOISE_KS_ALL_STRIPS; } 00473 else if ( mon.find( sistrip::noiseChi2AllStrips_ ) != std::string::npos ) { return sistrip::NOISE_CHI2_ALL_STRIPS; } 00474 else if ( mon.find( sistrip::noiseBin84AllStrips_ ) != std::string::npos ) { return sistrip::NOISE_BIN_84_ALL_STRIPS;} 00475 else if ( mon.find( sistrip::noiseRMSAllStrips_ ) != std::string::npos ) { return sistrip::NOISE_RMS_ALL_STRIPS;} 00476 else if ( mon.find( sistrip::noiseSignif_ ) != std::string::npos ) { return sistrip::NOISE_SIGNIF_ALL_STRIPS; } 00477 else if ( mon.find( sistrip::noiseAllStrips_ ) != std::string::npos ) { return sistrip::NOISE_ALL_STRIPS; } 00478 else if ( mon.find( sistrip::noiseMean_ ) != std::string::npos ) { return sistrip::NOISE_MEAN; } 00479 else if ( mon.find( sistrip::noiseSpread_ ) != std::string::npos ) { return sistrip::NOISE_SPREAD; } 00480 else if ( mon.find( sistrip::noiseMax_ ) != std::string::npos ) { return sistrip::NOISE_MAX; } 00481 else if ( mon.find( sistrip::noiseMin_ ) != std::string::npos ) { return sistrip::NOISE_MIN; } 00482 else if ( mon.find( sistrip::numOfDead_ ) != std::string::npos ) { return sistrip::NUM_OF_DEAD; } 00483 else if ( mon.find( sistrip::numOfNoisy_ ) != std::string::npos ) { return sistrip::NUM_OF_NOISY; } 00484 00485 // fine delay 00486 else if ( mon.find( sistrip::fineDelayPos_ ) != std::string::npos ) { return sistrip::FINE_DELAY_POS; } 00487 else if ( mon.find( sistrip::fineDelayErr_ ) != std::string::npos ) { return sistrip::FINE_DELAY_ERROR; } 00488 00489 // calibration 00490 else if ( mon.find( sistrip::calibrationAmplitudeAS_ ) != std::string::npos ) { return sistrip::CALIBRATION_AMPLITUDE_ALLSTRIPS; } 00491 else if ( mon.find( sistrip::calibrationTailAS_ ) != std::string::npos ) { return sistrip::CALIBRATION_TAIL_ALLSTRIPS; } 00492 else if ( mon.find( sistrip::calibrationRiseTimeAS_ ) != std::string::npos ) { return sistrip::CALIBRATION_RISETIME_ALLSTRIPS; } 00493 else if ( mon.find( sistrip::calibrationTimeConstantAS_ ) != std::string::npos ) { return sistrip::CALIBRATION_TIMECONSTANT_ALLSTRIPS; } 00494 else if ( mon.find( sistrip::calibrationSmearingAS_ ) != std::string::npos ) { return sistrip::CALIBRATION_SMEARING_ALLSTRIPS; } 00495 else if ( mon.find( sistrip::calibrationChi2AS_ ) != std::string::npos ) { return sistrip::CALIBRATION_CHI2_ALLSTRIPS; } 00496 else if ( mon.find( sistrip::calibrationAmplitudeMin_ ) != std::string::npos ) { return sistrip::CALIBRATION_AMPLITUDE_MIN; } 00497 else if ( mon.find( sistrip::calibrationTailMin_ ) != std::string::npos ) { return sistrip::CALIBRATION_TAIL_MIN; } 00498 else if ( mon.find( sistrip::calibrationRiseTimeMin_ ) != std::string::npos ) { return sistrip::CALIBRATION_RISETIME_MIN; } 00499 else if ( mon.find( sistrip::calibrationTimeConstantMin_ ) != std::string::npos ) { return sistrip::CALIBRATION_TIMECONSTANT_MIN; } 00500 else if ( mon.find( sistrip::calibrationSmearingMin_ ) != std::string::npos ) { return sistrip::CALIBRATION_SMEARING_MIN; } 00501 else if ( mon.find( sistrip::calibrationChi2Min_ ) != std::string::npos ) { return sistrip::CALIBRATION_CHI2_MIN; } 00502 else if ( mon.find( sistrip::calibrationAmplitudeMax_ ) != std::string::npos ) { return sistrip::CALIBRATION_AMPLITUDE_MAX; } 00503 else if ( mon.find( sistrip::calibrationTailMax_ ) != std::string::npos ) { return sistrip::CALIBRATION_TAIL_MAX; } 00504 else if ( mon.find( sistrip::calibrationRiseTimeMax_ ) != std::string::npos ) { return sistrip::CALIBRATION_RISETIME_MAX; } 00505 else if ( mon.find( sistrip::calibrationTimeConstantMax_ ) != std::string::npos ) { return sistrip::CALIBRATION_TIMECONSTANT_MAX; } 00506 else if ( mon.find( sistrip::calibrationSmearingMax_ ) != std::string::npos ) { return sistrip::CALIBRATION_SMEARING_MAX; } 00507 else if ( mon.find( sistrip::calibrationChi2Max_ ) != std::string::npos ) { return sistrip::CALIBRATION_CHI2_MAX; } 00508 else if ( mon.find( sistrip::calibrationAmplitude_ ) != std::string::npos ) { return sistrip::CALIBRATION_AMPLITUDE; } 00509 else if ( mon.find( sistrip::calibrationTail_ ) != std::string::npos ) { return sistrip::CALIBRATION_TAIL; } 00510 else if ( mon.find( sistrip::calibrationRiseTime_ ) != std::string::npos ) { return sistrip::CALIBRATION_RISETIME; } 00511 else if ( mon.find( sistrip::calibrationTimeConstant_ ) != std::string::npos ) { return sistrip::CALIBRATION_TIMECONSTANT; } 00512 else if ( mon.find( sistrip::calibrationSmearing_ ) != std::string::npos ) { return sistrip::CALIBRATION_SMEARING; } 00513 else if ( mon.find( sistrip::calibrationChi2_ ) != std::string::npos ) { return sistrip::CALIBRATION_CHI2; } 00514 00515 // scope mode 00516 else if ( mon.find( sistrip::daqScopeModeMeanSignal_ ) != std::string::npos ) { return sistrip::DAQ_SCOPE_MODE_MEAN_SIGNAL; } 00517 00518 // unknown 00519 else if ( mon.find( sistrip::undefinedMonitorable_ ) != std::string::npos ) { return sistrip::UNDEFINED_MONITORABLE; } 00520 else if ( mon.empty() ) { return sistrip::UNDEFINED_MONITORABLE; } 00521 else { return sistrip::UNKNOWN_MONITORABLE; } 00522 00523 } 00524 00525 // ----------------------------------------------------------------------------- 00526 // 00527 std::string SiStripEnumsAndStrings::presentation( const sistrip::Presentation& type ) { 00528 if ( type == sistrip::HISTO_1D ) { return sistrip::histo1d_; } 00529 else if ( type == sistrip::HISTO_2D_SUM ) { return sistrip::histo2dSum_; } 00530 else if ( type == sistrip::HISTO_2D_SCATTER ) { return sistrip::histo2dScatter_; } 00531 else if ( type == sistrip::PROFILE_1D ) { return sistrip::profile1D_; } 00532 else if ( type == sistrip::UNDEFINED_PRESENTATION ) { return sistrip::undefinedPresentation_; } 00533 else { return sistrip::unknownPresentation_; } 00534 } 00535 00536 // ----------------------------------------------------------------------------- 00537 // 00538 sistrip::Presentation SiStripEnumsAndStrings::presentation( const std::string& type ) { 00539 if ( type.find( sistrip::histo1d_ ) != std::string::npos ) { return sistrip::HISTO_1D; } 00540 else if ( type.find( sistrip::histo2dSum_ ) != std::string::npos ) { return sistrip::HISTO_2D_SUM; } 00541 else if ( type.find( sistrip::histo2dScatter_ ) != std::string::npos ) { return sistrip::HISTO_2D_SCATTER; } 00542 else if ( type.find( sistrip::profile1D_ ) != std::string::npos ) { return sistrip::PROFILE_1D; } 00543 else if ( type.find( sistrip::undefinedPresentation_ ) != std::string::npos ) { return sistrip::UNDEFINED_PRESENTATION; } 00544 else if ( type.empty() ) { return sistrip::UNDEFINED_PRESENTATION; } 00545 else { return sistrip::UNKNOWN_PRESENTATION; } 00546 } 00547 00548 // ----------------------------------------------------------------------------- 00549 // 00550 std::string SiStripEnumsAndStrings::cablingSource( const sistrip::CablingSource& source ) { 00551 if ( source == sistrip::CABLING_FROM_CONNS ) { return sistrip::cablingFromConns_; } 00552 else if ( source == sistrip::CABLING_FROM_DEVICES ) { return sistrip::cablingFromDevices_; } 00553 else if ( source == sistrip::CABLING_FROM_DETIDS ) { return sistrip::cablingFromDetIds_; } 00554 else if ( source == sistrip::UNDEFINED_CABLING_SOURCE ) { return sistrip::undefinedCablingSource_; } 00555 else { return sistrip::unknownCablingSource_; } 00556 } 00557 00558 // ----------------------------------------------------------------------------- 00559 // 00560 sistrip::CablingSource SiStripEnumsAndStrings::cablingSource( const std::string& source ) { 00561 if ( source.find( sistrip::cablingFromConns_ ) != std::string::npos ) { return sistrip::CABLING_FROM_CONNS; } 00562 else if ( source.find( sistrip::cablingFromDevices_ ) != std::string::npos ) { return sistrip::CABLING_FROM_DEVICES; } 00563 else if ( source.find( sistrip::cablingFromDetIds_ ) != std::string::npos ) { return sistrip::CABLING_FROM_DETIDS; } 00564 else if ( source.find( sistrip::undefinedCablingSource_ ) != std::string::npos ) { return sistrip::UNDEFINED_CABLING_SOURCE; } 00565 else if ( source.empty() ) { return sistrip::UNDEFINED_CABLING_SOURCE; } 00566 else if ( source == "CONNECTIONS" ) { return sistrip::CABLING_FROM_CONNS; } 00567 else if ( source == "DEVICES" ) { return sistrip::CABLING_FROM_DEVICES; } 00568 else if ( source == "DETIDS" ) { return sistrip::CABLING_FROM_DETIDS; } 00569 else if ( source == "UNDEFINED" ) { return sistrip::UNDEFINED_CABLING_SOURCE; } 00570 else { return sistrip::UNKNOWN_CABLING_SOURCE; } 00571 } 00572