Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:42

0001 
0002 #ifndef DataFormats_SiStripCommon_ConstantsForHardwareSystems_H
0003 #define DataFormats_SiStripCommon_ConstantsForHardwareSystems_H
0004 
0005 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
0006 #include "DataFormats/SiStripCommon/interface/Constants.h"
0007 
0008 /**
0009    @file ConstantsForHardwareSystems.h
0010    @brief Constants and enumerated types for FED/FEC systems
0011 */
0012 
0013 namespace sistrip {
0014 
0015   // -------------------- FED misc --------------------
0016 
0017   static const uint16_t FED_ADC_RANGE = 0x400;  // 1024
0018 
0019   // -------------------- FED ids --------------------
0020 
0021   static const uint16_t FED_ID_MIN = static_cast<uint16_t>(FEDNumbering::MINSiStripFEDID);
0022   static const uint16_t FED_ID_MAX = static_cast<uint16_t>(FEDNumbering::MAXSiStripFEDID);
0023   static const uint16_t CMS_FED_ID_MAX = static_cast<uint16_t>(FEDNumbering::MAXFEDID);
0024   static const uint16_t NUMBER_OF_FEDS = static_cast<uint16_t>(FED_ID_MAX - FED_ID_MIN + 1);
0025 
0026   // -------------------- FEDs to channels --------------------
0027 
0028   static const uint16_t FEDCH_PER_FEUNIT = 12;
0029   static const uint16_t FEUNITS_PER_FED = 8;
0030   static const uint16_t FEDCH_PER_FED = FEDCH_PER_FEUNIT * FEUNITS_PER_FED;  // 96
0031 
0032   // -------------------- Front-end devices --------------------
0033 
0034   static const uint16_t APVS_PER_FEDCH = 2;
0035   static const uint16_t APVS_PER_FEUNIT = APVS_PER_FEDCH * FEDCH_PER_FEUNIT;  // 24
0036   static const uint16_t APVS_PER_FED = APVS_PER_FEUNIT * FEUNITS_PER_FED;     // 194
0037 
0038   static const uint16_t APVS_PER_CHAN = 2;
0039   static const uint16_t CHANS_PER_LLD = 3;
0040 
0041   // -------------------- Detector strips --------------------
0042 
0043   static const uint16_t STRIPS_PER_APV = 128;
0044   static const uint16_t STRIPS_PER_FEDCH = STRIPS_PER_APV * APVS_PER_FEDCH;
0045   static const uint16_t STRIPS_PER_FEUNIT = STRIPS_PER_FEDCH * FEDCH_PER_FEUNIT;  // 3072
0046   static const uint16_t STRIPS_PER_FED = STRIPS_PER_FEUNIT * FEUNITS_PER_FED;     // 24576
0047 
0048   // -------------------- FED buffers --------------------
0049 
0050   static const uint16_t DAQ_HDR_SIZE = 8;
0051   static const uint16_t TRK_HDR_SIZE = 8;
0052   static const uint16_t FE_HDR_SIZE = 16;
0053   static const uint16_t APV_ERROR_HDR_SIZE = 24;
0054   static const uint16_t FULL_DEBUG_HDR_SIZE = 8 * FE_HDR_SIZE;
0055 
0056   // -------------------- Control system --------------------
0057 
0058   //static const uint16_t FEC_CRATE_OFFSET =  1; //@@ temporary
0059   //static const uint16_t FEC_RING_OFFSET  =  1; //@@ temporary
0060 
0061   static const uint16_t FEC_RING_MIN = 1;
0062   static const uint16_t FEC_RING_MAX = 8;
0063 
0064   static const uint16_t CCU_ADDR_MIN = 1;
0065   static const uint16_t CCU_ADDR_MAX = 127;
0066 
0067   static const uint16_t CCU_CHAN_MIN = 16;
0068   static const uint16_t CCU_CHAN_MAX = 31;
0069 
0070   static const uint16_t LLD_CHAN_MIN = 1;
0071   static const uint16_t LLD_CHAN_MAX = 3;
0072 
0073   static const uint16_t APV_I2C_MIN = 32;
0074   static const uint16_t APV_I2C_MAX = 37;
0075 
0076   // -------------------- VME crates --------------------
0077 
0078   static const uint16_t SLOTS_PER_CRATE = 20;
0079 
0080   static const uint16_t CRATE_SLOT_MIN = 2;  // slot 1 is reserved for VME controller
0081   static const uint16_t CRATE_SLOT_MAX = 21;
0082 
0083   static const uint16_t MAX_FEDS_PER_CRATE = 16;
0084   static const uint16_t MAX_FECS_PER_CRATE = 20;
0085 
0086   static const uint16_t FED_CRATE_MIN = 1;
0087   static const uint16_t FED_CRATE_MAX = 60;
0088 
0089   static const uint16_t FEC_CRATE_MIN = 1;
0090   static const uint16_t FEC_CRATE_MAX = 4;
0091 
0092   // -------------------- String constants --------------------
0093 
0094   static const char unknownApvReadoutMode_[] = "UnknownApvReadoutMode";
0095   static const char undefinedApvReadoutMode_[] = "UndefinedApvReadoutMode";
0096 
0097   static const char apvPeakMode_[] = "ApvPeakMode";
0098   static const char apvDeconMode_[] = "ApvDeconMode";
0099   static const char apvMultiMode_[] = "ApvMultiMode";
0100 
0101   static const char unknownFedReadoutMode_[] = "UnknownFedReadoutMode";
0102   static const char undefinedFedReadoutMode_[] = "UndefinedFedReadoutMode";
0103 
0104   static const char fedScopeMode_[] = "FedScopeMode";
0105   static const char fedVirginRaw_[] = "FedVirginRaw";
0106   static const char fedProcRaw_[] = "FedProcessedRaw";
0107   static const char fedZeroSuppr_[] = "FedZeroSuppressed";
0108   static const char fedZeroSupprCMO_[] = "FedZeroSuppressedCMOverride";
0109   static const char fedZeroSupprLite_[] = "FedZeroSupprressedLite";
0110   static const char fedZeroSupprLiteCMO_[] = "FedZeroSuppressedLiteCMOverride";
0111   static const char fedZeroSupprLite8TT_[] = "FedZeroSuppressedLite8TT";
0112   static const char fedZeroSupprLite8TTCMO_[] = "FedZeroSuppressedLite8TTCMOverride";
0113   static const char fedZeroSupprLite8TB_[] = "FedZeroSuppressedLite8TB";
0114   static const char fedZeroSupprLite8TBCMO_[] = "FedZeroSuppressedLite8TBCMOverride";
0115   static const char fedZeroSupprLite8BB_[] = "FedZeroSuppressedLite8BB";
0116   static const char fedZeroSupprLite8BBCMO_[] = "FedZeroSuppressedLite8BBCMOverride";
0117   static const char fedPreMixRaw_[] = "FedPreMixRaw";
0118 
0119   // -------------------- Enumerators --------------------
0120 
0121   enum ApvReadoutMode {
0122     UNKNOWN_APV_READOUT_MODE = sistrip::unknown_,
0123     UNDEFINED_APV_READOUT_MODE = sistrip::invalid_,
0124     APV_PEAK_MODE = 1,
0125     APV_DECON_MODE = 2,
0126     APV_MULTI_MODE = 3
0127   };
0128 
0129   enum FedReadoutMode {
0130     UNKNOWN_FED_READOUT_MODE = sistrip::unknown_,
0131     UNDEFINED_FED_READOUT_MODE = sistrip::invalid_,
0132     FED_SCOPE_MODE = 1,
0133     FED_VIRGIN_RAW = 2,
0134     FED_PROC_RAW = 6,
0135     FED_ZERO_SUPPR = 10,
0136     FED_ZERO_SUPPR_LITE = 3,
0137     FED_ZERO_SUPPR_LITE_CMO = 4,
0138     FED_ZERO_SUPPR_LITE8_TT = 12,
0139     FED_ZERO_SUPPR_LITE8_TT_CMO = 8,
0140     FED_ZERO_SUPPR_LITE8_TB = 5,
0141     FED_ZERO_SUPPR_LITE8_TB_CMO = 7,
0142     FED_ZERO_SUPPR_LITE8_BB = 9,
0143     FED_ZERO_SUPPR_LITE8_BB_CMO = 11,
0144     FED_PREMIX_RAW = 15
0145   };
0146 
0147   enum FedReadoutPath {
0148     UNKNOWN_FED_READOUT_PATH = sistrip::unknown_,
0149     UNDEFINED_FED_READOUT_PATH = sistrip::invalid_,
0150     VME_READOUT = 1,
0151     SLINK_READOUT = 2
0152   };
0153 
0154   enum FedBufferFormat {
0155     UNKNOWN_FED_BUFFER_FORMAT = sistrip::unknown_,
0156     UNDEFINED_FED_BUFFER_FORMAT = sistrip::invalid_,
0157     FULL_DEBUG_FORMAT = 1,
0158     APV_ERROR_FORMAT = 2
0159   };
0160 
0161   enum FedSuperMode {
0162     UNKNOWN_FED_SUPER_MODE = sistrip::unknown_,
0163     UNDEFINED_FED_SUPER_MODE = sistrip::invalid_,
0164     REAL = 0,
0165     FAKE = 1
0166   };
0167 
0168 }  // namespace sistrip
0169 
0170 #endif  // DataFormats_SiStripCommon_ConstantsForHardwareSystems_H