File indexing completed on 2024-05-11 03:33:47
0001 #ifndef PixelToFEDAssociateFromAscii_H
0002 #define PixelToFEDAssociateFromAscii_H
0003
0004
0005
0006
0007
0008
0009 #include <vector>
0010 #include <string>
0011
0012 #include "CalibTracker/SiPixelConnectivity/interface/TRange.h"
0013 #include "CalibTracker/SiPixelConnectivity/interface/PixelToFEDAssociate.h"
0014
0015 class PixelBarrelName;
0016 class PixelEndcapName;
0017 class PixelModuleName;
0018
0019 class PixelToFEDAssociateFromAscii : public PixelToFEDAssociate {
0020 public:
0021 PixelToFEDAssociateFromAscii(const std::string &fileName);
0022
0023
0024 int operator()(const PixelModuleName &) const override;
0025
0026
0027 std::string version() const override;
0028
0029
0030 int operator()(const PixelBarrelName &) const;
0031
0032
0033 int operator()(const PixelEndcapName &) const;
0034
0035 private:
0036
0037 void init(const std::string &fileName);
0038
0039 typedef TRange<int> Range;
0040
0041
0042
0043 struct Bdu {
0044 int b;
0045 Range l, z, f;
0046 bool operator()(const PixelBarrelName &) const;
0047 };
0048
0049
0050
0051 struct Edu {
0052 int e;
0053 Range d, b;
0054 bool operator()(const PixelEndcapName &) const;
0055 };
0056
0057 typedef std::vector<std::pair<int, std::vector<Bdu> > > BarrelConnections;
0058 typedef std::vector<std::pair<int, std::vector<Edu> > > EndcapConnections;
0059 BarrelConnections theBarrel;
0060 EndcapConnections theEndcap;
0061
0062 private:
0063 std::string theVersion;
0064
0065
0066 void send(std::pair<int, std::vector<Bdu> > &, std::pair<int, std::vector<Edu> > &);
0067 Bdu getBdu(std::string) const;
0068 Edu getEdu(std::string) const;
0069 Range readRange(const std::string &) const;
0070
0071 using PixelToFEDAssociate::operator();
0072 };
0073 #endif