Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-05-27 01:56:01

0001 // Authors: Izaak Neutelings (May 2024)
0002 // Sources: https://docs.google.com/spreadsheets/d/13G7sOjssqw4B5AtOcQV3g0W01oZUOMM6Hm_DduxBEPU
0003 #ifndef CondFormats_HGCalObjects_HGCalConfiguraton_h
0004 #define CondFormats_HGCalObjects_HGCalConfiguraton_h
0005 #include "CondFormats/Serialization/interface/Serializable.h"
0006 #include "CondFormats/HGCalObjects/interface/HGCalMappingModuleIndexer.h"
0007 #include <map>
0008 #include <vector>
0009 
0010 // @short configuration for ECON eRX (one half of HGROC)
0011 struct HGCalROCConfig {
0012   uint32_t charMode;  // characterization mode; determines data fields in ROC dataframe
0013   COND_SERIALIZABLE;
0014 };
0015 
0016 // @short configuration for ECON-D module
0017 struct HGCalECONDConfig {
0018   //std::string typecode;
0019   uint32_t headerMarker;  // begin of event marker/identifier for ECON-D
0020   std::vector<HGCalROCConfig> rocs;
0021   COND_SERIALIZABLE;
0022 };
0023 
0024 // @short configuration for FED
0025 struct HGCalFedConfig {
0026   bool mismatchPassthroughMode;  // ignore ECON-D packet mismatches
0027   uint32_t cbHeaderMarker;       // begin of event marker/identifier for capture block
0028   uint32_t slinkHeaderMarker;    // begin of event marker/identifier for S-link
0029   std::vector<HGCalECONDConfig> econds;
0030   COND_SERIALIZABLE;
0031 };
0032 
0033 /**
0034  *  @short Main HGCal configuration with a tree structure of vectors of
0035  *         HGCalFedConfig/HGCalECONDConfig/HGCalROCConfig structs as follows:
0036  *         config.feds[dense_fed_idx].econds[dense_econd_idx].rocs[dense_eRx_idx]
0037  **/
0038 class HGCalConfiguration {
0039 public:
0040   std::vector<HGCalFedConfig> feds;
0041 
0042 private:
0043   COND_SERIALIZABLE;
0044 };
0045 
0046 inline std::ostream& operator<<(std::ostream& os, const HGCalConfiguration& config) {
0047   uint32_t nfed = config.feds.size();
0048   uint32_t ntotmod = 0;
0049   uint32_t ntotroc = 0;
0050   for (auto const& fed : config.feds) {
0051     ntotmod += fed.econds.size();  // number of ECON-D modules for this FED
0052     for (auto const& mod : fed.econds) {
0053       ntotroc += mod.rocs.size();  // number of eRx half-ROCs for this ECON-D module
0054     }
0055   }
0056   os << "HGCalConfiguration(nfed=" << nfed << ",ntotmod=" << ntotmod << ",ntotroc=" << ntotroc << ")";
0057   return os;
0058 }
0059 
0060 #endif