CMS 3D CMS Logo

PixelNameTranslation.h
Go to the documentation of this file.
1 #ifndef PixelNameTranslation_h
2 #define PixelNameTranslation_h
3 
12 #include <map>
13 #include <string>
14 #include <vector>
15 #include <list>
16 #include <set>
17 #include <iostream>
18 
25 
26 namespace pos {
27 
28  class PixelDetectorConfig;
29 
42  public:
43  PixelNameTranslation(std::vector<std::vector<std::string> >& tableMat);
45 
46  ~PixelNameTranslation() override {}
47 
48  // Probably these functions should never be used, and instead we should call similar functions in PixelDetectorConfig.
49  std::list<const PixelROCName*> getROCs() const;
50  std::list<const PixelModuleName*> getModules() const;
51  std::set<PixelChannel> getChannels() const; // returns all channels
52  std::set<PixelChannel> getChannels(const PixelDetectorConfig& aDetectorConfig)
53  const; // only returns channels on modules found in the detector config
54 
55  const PixelHdwAddress* getHdwAddress(const PixelROCName& aROC) const;
56 
57  //Should really use a different type of hdw address for a channel
58  const PixelHdwAddress& getHdwAddress(const PixelChannel& aChannel) const;
59  const PixelHdwAddress& firstHdwAddress(const PixelModuleName& aModule) const;
60 
61  const bool checkFor(const PixelROCName& aROC) const;
62 
63  // Added for Debbie (used there only) to allow integrity checks (Dario)
64  bool checkROCExistence(const PixelROCName& aROC) const;
65 
66  const PixelChannel& getChannelForROC(const PixelROCName& aROC) const;
67  std::set<PixelChannel> getChannelsOnModule(const PixelModuleName& aModule) const;
68 
69  friend std::ostream& operator<<(std::ostream& s, const PixelNameTranslation& table);
70 
71  const std::vector<PixelROCName>& getROCsFromFEDChannel(unsigned int fednumber, unsigned int fedchannel) const;
72 
73  PixelROCName ROCNameFromFEDChannelROC(unsigned int fednumber, unsigned int channel, unsigned int roc) const;
74 
75  bool ROCNameFromFEDChannelROCExists(unsigned int fednumber, unsigned int channel, unsigned int roc) const;
76 
77  PixelChannel ChannelFromFEDChannel(unsigned int fednumber, unsigned int fedchannel) const;
78 
79  bool FEDChannelExist(unsigned int fednumber, unsigned int fedchannel) const;
80 
81  const std::vector<PixelROCName>& getROCsFromChannel(const PixelChannel& aChannel) const;
82  std::vector<PixelROCName> getROCsFromModule(const PixelModuleName& aModule) const;
83 
84  void writeASCII(std::string dir = "") const override;
85  void writeXML(pos::PixelConfigKey key, int version, std::string path) const override;
87  int version,
89  std::ofstream* out,
90  std::ofstream* out1 = nullptr,
91  std::ofstream* out2 = nullptr) const override;
92  void writeXML(std::ofstream* out, std::ofstream* out1 = nullptr, std::ofstream* out2 = nullptr) const override;
93  void writeXMLTrailer(std::ofstream* out,
94  std::ofstream* out1 = nullptr,
95  std::ofstream* out2 = nullptr) const override;
96 
97  bool ROCexists(PixelROCName theROC); // Added by Dario
98  const PixelChannel& getChannelFromHdwAddress(const PixelHdwAddress& aHdwAddress) const;
99 
100  std::map<unsigned int, std::set<unsigned int> > getFEDsAndChannels() const;
101 
102  private:
103  std::map<PixelROCName, PixelHdwAddress> translationtable_;
104 
105  std::map<PixelHdwAddress, PixelROCName, PixelHdwAddress> fedlookup_;
106 
107  // This is a bit ugly, since the PixelHdwAddress contains the ROC number, which isn't really relevant to a PixelChannel.
108  std::map<PixelChannel, PixelHdwAddress> channelTranslationTable_;
109  std::map<PixelHdwAddress, PixelChannel> hdwTranslationTable_;
110 
111  std::map<unsigned int, std::map<unsigned int, std::vector<PixelROCName> > > rocsFromFEDidAndChannel_;
112  // FED id FED channel
113 
114  std::vector<PixelROCName> buildROCsFromFEDChannel(unsigned int fednumber, unsigned int fedchannel) const;
115  };
116 } // namespace pos
117 /* @} */
118 #endif
pos::PixelNameTranslation::ChannelFromFEDChannel
PixelChannel ChannelFromFEDChannel(unsigned int fednumber, unsigned int fedchannel) const
Definition: PixelNameTranslation.cc:592
pos::PixelNameTranslation::writeXML
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
Definition: PixelNameTranslation.cc:789
pos::PixelNameTranslation::ROCNameFromFEDChannelROC
PixelROCName ROCNameFromFEDChannelROC(unsigned int fednumber, unsigned int channel, unsigned int roc) const
Definition: PixelNameTranslation.cc:570
pos::PixelNameTranslation::getROCsFromChannel
const std::vector< PixelROCName > & getROCsFromChannel(const PixelChannel &aChannel) const
Definition: PixelNameTranslation.cc:850
pos::PixelNameTranslation::rocsFromFEDidAndChannel_
std::map< unsigned int, std::map< unsigned int, std::vector< PixelROCName > > > rocsFromFEDidAndChannel_
Definition: PixelNameTranslation.h:111
pos::PixelNameTranslation::getROCsFromModule
std::vector< PixelROCName > getROCsFromModule(const PixelModuleName &aModule) const
Definition: PixelNameTranslation.cc:855
pos::PixelNameTranslation::checkFor
const bool checkFor(const PixelROCName &aROC) const
Definition: PixelNameTranslation.cc:469
pos::PixelNameTranslation::PixelNameTranslation
PixelNameTranslation(std::vector< std::vector< std::string > > &tableMat)
Definition: PixelNameTranslation.cc:22
pos::PixelDetectorConfig
This is the documentation about PixelDetectorConfig...
Definition: PixelDetectorConfig.h:39
pos
Definition: PixelAliasList.h:18
pos::PixelModuleName
This class implements..
Definition: PixelModuleName.h:26
PixelROCName.h
This class stores the name and related hardware mappings for a ROC.
pos::PixelNameTranslation::ROCNameFromFEDChannelROCExists
bool ROCNameFromFEDChannelROCExists(unsigned int fednumber, unsigned int channel, unsigned int roc) const
Definition: PixelNameTranslation.cc:562
pos::PixelConfigBase
This file contains the base class for "pixel configuration data" management.
Definition: PixelConfigBase.h:32
pos::PixelNameTranslation::writeXMLHeader
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
Definition: PixelNameTranslation.cc:709
pos::PixelNameTranslation::getChannelFromHdwAddress
const PixelChannel & getChannelFromHdwAddress(const PixelHdwAddress &aHdwAddress) const
Definition: PixelNameTranslation.cc:641
PixelNameTranslation.h
This class provides a translation from the naming documents standard to specify the ROC to the corres...
pos::PixelNameTranslation::getChannelForROC
const PixelChannel & getChannelForROC(const PixelROCName &aROC) const
Definition: PixelNameTranslation.cc:497
pos::PixelNameTranslation::writeASCII
void writeASCII(std::string dir="") const override
Definition: PixelNameTranslation.cc:672
pos::PixelNameTranslation::getHdwAddress
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
Definition: PixelNameTranslation.cc:449
pos::PixelNameTranslation::getFEDsAndChannels
std::map< unsigned int, std::set< unsigned int > > getFEDsAndChannels() const
Definition: PixelNameTranslation.cc:882
PixelHdwAddress.h
Store mfec, mfecchannel etc.
alignCSCRings.s
s
Definition: alignCSCRings.py:92
pos::PixelNameTranslation::getROCsFromFEDChannel
const std::vector< PixelROCName > & getROCsFromFEDChannel(unsigned int fednumber, unsigned int fedchannel) const
Definition: PixelNameTranslation.cc:516
PixelConfigBase.h
This file contains the base class for "pixel configuration data" management.
pos::PixelNameTranslation::translationtable_
std::map< PixelROCName, PixelHdwAddress > translationtable_
Definition: PixelNameTranslation.h:103
PixelModuleName.h
This class implements..
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
PixelChannel.h
This class implements...
pos::PixelNameTranslation::FEDChannelExist
bool FEDChannelExist(unsigned int fednumber, unsigned int fedchannel) const
Definition: PixelNameTranslation.cc:620
pos::PixelNameTranslation::ROCexists
bool ROCexists(PixelROCName theROC)
Definition: PixelNameTranslation.cc:875
pos::PixelNameTranslation::~PixelNameTranslation
~PixelNameTranslation() override
Definition: PixelNameTranslation.h:46
pos::PixelConfigKey
This class implements..
Definition: PixelConfigKey.h:20
pos::PixelNameTranslation::getChannels
std::set< PixelChannel > getChannels() const
Definition: PixelNameTranslation.cc:426
pos::PixelNameTranslation::operator<<
friend std::ostream & operator<<(std::ostream &s, const PixelNameTranslation &table)
Definition: PixelNameTranslation.cc:386
pos::PixelChannel
Definition: PixelChannel.h:21
pos::PixelHdwAddress
Store mfec, mfecchannel etc.
Definition: PixelHdwAddress.h:23
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
pos::PixelNameTranslation::firstHdwAddress
const PixelHdwAddress & firstHdwAddress(const PixelModuleName &aModule) const
Definition: PixelNameTranslation.cc:484
pos::PixelROCName
This class implements..
Definition: PixelROCName.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pos::PixelNameTranslation::writeXMLTrailer
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
Definition: PixelNameTranslation.cc:777
pos::PixelNameTranslation::channelTranslationTable_
std::map< PixelChannel, PixelHdwAddress > channelTranslationTable_
Definition: PixelNameTranslation.h:108
PointingDoubleMultiSkim_cfg.out2
out2
Definition: PointingDoubleMultiSkim_cfg.py:85
pos::PixelNameTranslation::getROCs
std::list< const PixelROCName * > getROCs() const
Definition: PixelNameTranslation.cc:393
PointingDoubleMultiSkim_cfg.out1
out1
Definition: PointingDoubleMultiSkim_cfg.py:57
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
pos::PixelNameTranslation::getChannelsOnModule
std::set< PixelChannel > getChannelsOnModule(const PixelModuleName &aModule) const
Definition: PixelNameTranslation.cc:503
pos::PixelNameTranslation::checkROCExistence
bool checkROCExistence(const PixelROCName &aROC) const
Definition: PixelNameTranslation.cc:462
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
pos::PixelNameTranslation::hdwTranslationTable_
std::map< PixelHdwAddress, PixelChannel > hdwTranslationTable_
Definition: PixelNameTranslation.h:109
pos::PixelNameTranslation
This is the documentation about PixelNameTranslation...
Definition: PixelNameTranslation.h:41
TableParser.table
table
Definition: TableParser.py:111
pos::PixelNameTranslation::buildROCsFromFEDChannel
std::vector< PixelROCName > buildROCsFromFEDChannel(unsigned int fednumber, unsigned int fedchannel) const
Definition: PixelNameTranslation.cc:534
crabWrapper.key
key
Definition: crabWrapper.py:19
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
pos::PixelNameTranslation::getModules
std::list< const PixelModuleName * > getModules() const
Definition: PixelNameTranslation.cc:404
pos::PixelNameTranslation::fedlookup_
std::map< PixelHdwAddress, PixelROCName, PixelHdwAddress > fedlookup_
Definition: PixelNameTranslation.h:105
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23