RPCReadOutMapping

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
#ifndef RPCReadOutMapping_H
#define RPCReadOutMapping_H
/** \class RPCReadOutMapping
 *
 *  Description:
 *       Class to map read-out channels to physical RPC strips
 */

#include "CondFormats/Serialization/interface/Serializable.h"

#include <map>
#include <vector>
#include <utility>
#include <string>

#include "CondFormats/RPCObjects/interface/DccSpec.h"
#include "CondFormats/RPCObjects/interface/LinkBoardElectronicIndex.h"
#include "CondFormats/RPCObjects/interface/LinkBoardPackedStrip.h"
#include <cstdint>
class LinkBoardSpec;

class RPCReadOutMapping {
public:
  /// first member is DetUnit ID, second strip in DetUnit frame
  typedef std::pair<uint32_t, int> StripInDetUnit;

  RPCReadOutMapping(const std::string& version = "");
  virtual ~RPCReadOutMapping() {}

  /// FED identified by ID
  const DccSpec* dcc(int dccId) const;

  /// Range of FED IDs in map (min and max id)
  std::pair<int, int> dccNumberRange() const;

  /// all FEDs in map
  std::vector<const DccSpec*> dccList() const;

  /// attach FED to map
  void add(const DccSpec& dcc);

  /// version as string
  const std::string& version() const { return theVersion; }

  /// conversion between electronic and detector indexing
  virtual const LinkBoardSpec* location(const LinkBoardElectronicIndex& ele) const;

  /// convert strip location as in raw data (LB and LBchannel) to detUnit frame
  virtual StripInDetUnit detUnitFrame(const LinkBoardSpec& location, const LinkBoardPackedStrip& packedStrip) const;

  /// connection "paths" that lead from one digi to one strip
  std::vector<std::pair<LinkBoardElectronicIndex, LinkBoardPackedStrip> > rawDataFrame(
      const StripInDetUnit& duFrame) const;

  // TEMPORARY
  std::vector<const LinkBoardSpec*> getLBforChamber(const std::string& name) const;
  std::pair<LinkBoardElectronicIndex, int> getRAWSpecForCMSChamberSrip(uint32_t detId,
                                                                       int strip,
                                                                       int dccInputChannel) const;

private:
  typedef std::map<int, DccSpec>::const_iterator IMAP;
  std::map<int, DccSpec> theFeds;
  std::string theVersion;

  COND_SERIALIZABLE;
};

#endif  // RPCReadOutMapping_H