pflib v3.13.3-1-gf856638
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
HcalBackplane.h
1#ifndef pflib_hcal_inc_
2#define pflib_hcal_inc_
3
4#include <memory>
5
6#include "pflib/Bias.h"
7#include "pflib/GPIO.h"
8#include "pflib/HcalTarget.h"
9#include "pflib/TRIG.h"
10
11namespace pflib {
12
16class HcalBackplane : public HcalTarget {
17 public:
19 virtual ~HcalBackplane() = default;
20
22
35 void init(lpGBT& daq_lpgbt, lpGBT& trig_lpgbt, int hgcroc_boards,
36 bool use_bias_cache);
37
39 virtual int nrocs() override { return nhgcroc_; }
40
42 virtual int necons() override { return necon_; }
43
45 virtual bool have_roc(int iroc) const override;
46
48 virtual bool have_econ(int iecon) const override;
49
51 virtual std::vector<int> roc_ids() const override;
52
54 virtual std::vector<int> econ_ids() const override;
55
57 virtual ROC& roc(int which) override;
58
60 virtual ECON& econ(int which) override;
61
63 Bias& bias(int which) override;
64
66 virtual GPIO& gpio() { return *gpio_; }
67
69 virtual Elinks& elinks() = 0;
70
72 virtual DAQ& daq() = 0;
73
75 virtual TRIG* trig(int itrig) { return (itrig == 0) ? (trig_.get()) : (0); }
76
79 override;
83
89
90 protected:
93
95 int necon_;
96
99
105 struct HGCROCBoard {
106 ROC roc;
107 Bias bias;
109 HGCROCBoard(std::shared_ptr<I2C> roc_i2c, uint8_t roc_addr,
110 const std::string& roc_typename, std::shared_ptr<I2C> bias_i2c,
111 std::shared_ptr<I2C> board_i2c, bool bias_use_cache);
112 };
113
116
119
122};
123
124} // namespace pflib
125
126#endif // pflib_hcal_inc_
The HGC ROC has 4 MAX5825 chips doing the DAC for the bias voltages.
Definition Bias.h:115
Interface with DAQ via a WishboneInterface.
Definition DAQ.h:19
Definition ECON.h:19
Representation of GPIO controller.
Definition GPIO.h:12
representing an HcalBackplane
Definition HcalBackplane.h:16
virtual TRIG * trig(int itrig)
get the trig object, if valid
Definition HcalBackplane.h:75
Bias & bias(int which) override
Get an I2C interface for the given HGCROC board's bias bus
Definition HcalBackplane.cxx:196
virtual DAQ & daq()=0
get the DAQ object
virtual int nrocs() override
number of boards
Definition HcalBackplane.h:39
const std::vector< std::pair< int, std::vector< int > > > & getHardwareRocErxMappingTRG() override
Get the ROC to eRx mapping for the TRG path.
Definition HcalBackplane.cxx:144
virtual bool have_roc(int iroc) const override
do we have a roc with this id?
Definition HcalBackplane.cxx:115
static const std::vector< std::pair< int, int > > ROC_ERX_MAPPING_DAQ
the ROC to eRx mapping along the DAQ path for this hardware
Definition HcalBackplane.h:85
virtual Elinks & elinks()=0
get the Elinks object
virtual ECON & econ(int which) override
get a ECON interface for the given econ board
Definition HcalBackplane.cxx:183
virtual std::vector< int > econ_ids() const override
get a list of the econ IDs we have set up
Definition HcalBackplane.cxx:159
virtual ROC & roc(int which) override
Get a ROC interface for the given HGCROC board.
Definition HcalBackplane.cxx:170
void init(lpGBT &daq_lpgbt, lpGBT &trig_lpgbt, int hgcroc_boards, bool use_bias_cache)
Common initialization for slow control given lpGBT objects and a mask for which HGCROC boards are con...
Definition HcalBackplane.cxx:30
int necon_
Number of ECON boards in this system.
Definition HcalBackplane.h:95
virtual int necons() override
number of econds
Definition HcalBackplane.h:42
std::unique_ptr< GPIO > gpio_
The GPIO interface.
Definition HcalBackplane.h:98
std::array< std::unique_ptr< HGCROCBoard >, 4 > rocs_
the backplane can hold up to 4 HGCROC boards
Definition HcalBackplane.h:115
int nhgcroc_
Number of HGCROC boards in this system.
Definition HcalBackplane.h:92
std::array< std::unique_ptr< ECON >, 3 > econs_
the ECONs on the ECON Mezzanine on this backplane
Definition HcalBackplane.h:118
virtual std::vector< int > roc_ids() const override
get a list of the IDs we have set up
Definition HcalBackplane.cxx:148
virtual ~HcalBackplane()=default
virtual destructor since we'll be holding this as a Target
const std::vector< std::pair< int, int > > & getHardwareRocErxMappingDAQ() override
Get the ROC to eRx mapping for the DAQ path.
Definition HcalBackplane.cxx:133
virtual GPIO & gpio()
Get the GPIO object for debugging purposes.
Definition HcalBackplane.h:66
virtual bool have_econ(int iecon) const override
do we have an econ with this id?
Definition HcalBackplane.cxx:122
std::unique_ptr< pflib::TRIG > trig_
pointer to the TRIG object if available
Definition HcalBackplane.h:121
static const std::vector< std::pair< int, std::vector< int > > > ROC_ERX_MAPPING_TRG
the ROC to eRx mapping along the TRG path for this hardware
Definition HcalBackplane.h:88
An HcalTarget is a Target with access to the biasing chips.
Definition HcalTarget.h:14
Definition ROC.h:19
Trigger path management interface.
Definition TRIG.h:20
Class which provides an interface with an lpGBT ASIC as mounted on an LDMX mezzanine.
Definition lpGBT.h:54
T get(T... args)
This version of the fast control code interfaces with the CMS Fast control library which can be contr...
Definition Backend.cxx:3
an HGCROC board contains one ROC, one Bias board and some other utilities that are accessible via the...
Definition HcalBackplane.h:105
HGCROCBoard(std::shared_ptr< I2C > roc_i2c, uint8_t roc_addr, const std::string &roc_typename, std::shared_ptr< I2C > bias_i2c, std::shared_ptr< I2C > board_i2c, bool bias_use_cache)
constructor to forward constructor arguments to members
Definition HcalBackplane.cxx:21