CMS 3D CMS Logo

RPCLinkSynchroStat.h
Go to the documentation of this file.
1 #ifndef DQM_RPCMonitorClient_RPCLinkSynchroStat_H
2 #define DQM_RPCMonitorClient_RPCLinkSynchroStat_H
3 
4 #include <map>
5 #include <cmath>
6 #include <vector>
9 
10 class RPCReadOutMapping;
11 
13 public:
15 
16  virtual ~RPCLinkSynchroStat() {}
17 
18  void init(const RPCReadOutMapping *theCabling, bool addChamberInfo);
19 
20  void add(const RPCRawSynchro::ProdItem &counts, std::vector<LinkBoardElectronicIndex> &problems);
21 
22  void add(const std::string &lbName, const unsigned int *hits);
23 
25 
26 protected:
27  class LinkBoard {
28  public:
30  const std::string &name() const { return theName; }
31  typedef std::pair<std::string, std::string> ChamberAndPartition;
32  int add(const ChamberAndPartition &part);
33  int add(const LinkBoardElectronicIndex &ele);
34  const std::vector<LinkBoardElectronicIndex> &paths() const { return theElePaths; }
35  const std::vector<ChamberAndPartition> &chamberAndPartitions() const { return theChamberAndPartitions; }
36  bool operator<(const LinkBoard &o) const { return theName < o.theName; }
37  bool operator==(const LinkBoard &o) const { return (theName == o.theName); }
38 
39  private:
41  std::vector<ChamberAndPartition> theChamberAndPartitions;
42  std::vector<LinkBoardElectronicIndex> theElePaths;
43  };
44 
45  class SynchroCounts {
46  public:
47  SynchroCounts() : theCounts(std::vector<unsigned int>(8, 0)) {}
48  SynchroCounts(const unsigned int *hits) : theCounts(std::vector<unsigned int>(hits, hits + 8)) {}
49 
50  void increment(unsigned int bxDiff);
51  void set(unsigned int bxDiff);
52  unsigned int firstHit() const;
53 
54  double rms() const;
55  double mean() const;
56  unsigned int sum() const { return mom0(); }
57 
58  std::string print() const;
59  const std::vector<unsigned int> &counts() const { return theCounts; }
60  bool operator==(const SynchroCounts &) const;
62 
63  private:
64  unsigned int mom0() const;
65  double mom1() const;
66  std::vector<unsigned int> theCounts;
67  };
68 
69  typedef std::pair<LinkBoard, SynchroCounts> BoardAndCounts;
70  struct LessLinkName {
71  bool operator()(const BoardAndCounts &o1, const BoardAndCounts &o2);
72  };
73  struct LessCountSum {
74  bool operator()(const BoardAndCounts &o1, const BoardAndCounts &o2);
75  };
76  struct ShortLinkInfo {
77  unsigned int idx;
78  std::vector<unsigned int> hit_paths;
80  };
81 
83 
84  static const unsigned int MAXDCCINDEX = 2;
85  static const unsigned int DCCINDEXSHIFT = 790;
86  static const unsigned int MAXRBCINDEX = 35;
87  static const unsigned int MAXLINKINDEX = 17;
88  static const unsigned int MAXLBINDEX = 2;
90  std::vector<BoardAndCounts> theLinkStatMap;
91 
93 };
94 #endif
RPCLinkSynchroStat::MAXLINKINDEX
static const unsigned int MAXLINKINDEX
Definition: RPCLinkSynchroStat.h:87
RPCLinkSynchroStat::LinkBoard::LinkBoard
LinkBoard(const std::string &n)
Definition: RPCLinkSynchroStat.h:29
RPCLinkSynchroStat::LessCountSum::operator()
bool operator()(const BoardAndCounts &o1, const BoardAndCounts &o2)
Definition: RPCLinkSynchroStat.cc:14
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
RPCLinkSynchroStat::LessLinkName::operator()
bool operator()(const BoardAndCounts &o1, const BoardAndCounts &o2)
Definition: RPCLinkSynchroStat.cc:11
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
RPCLinkSynchroStat::LinkBoard::paths
const std::vector< LinkBoardElectronicIndex > & paths() const
Definition: RPCLinkSynchroStat.h:34
RPCLinkSynchroStat::LinkBoard
Definition: RPCLinkSynchroStat.h:27
RPCLinkSynchroStat::dumpDelays
std::string dumpDelays()
Definition: RPCLinkSynchroStat.cc:212
RPCLinkSynchroStat::SynchroCounts::SynchroCounts
SynchroCounts(const unsigned int *hits)
Definition: RPCLinkSynchroStat.h:48
RPCLinkSynchroStat::SynchroCounts::increment
void increment(unsigned int bxDiff)
Definition: RPCLinkSynchroStat.cc:59
RPCLinkSynchroStat::init
void init(const RPCReadOutMapping *theCabling, bool addChamberInfo)
Definition: RPCLinkSynchroStat.cc:131
RPCLinkSynchroStat::SynchroCounts
Definition: RPCLinkSynchroStat.h:45
RPCLinkSynchroStat::ShortLinkInfo::counts
SynchroCounts counts
Definition: RPCLinkSynchroStat.h:79
RPCLinkSynchroStat::LinkBoard::add
int add(const ChamberAndPartition &part)
Definition: RPCLinkSynchroStat.cc:26
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
RPCMonitorLinkSynchro_cfi.useFirstHitOnly
useFirstHitOnly
Definition: RPCMonitorLinkSynchro_cfi.py:6
RPCLinkSynchroStat::SynchroCounts::mom1
double mom1() const
Definition: RPCLinkSynchroStat.cc:77
part
part
Definition: HCALResponse.h:20
RPCLinkSynchroStat::LinkBoard::theElePaths
std::vector< LinkBoardElectronicIndex > theElePaths
Definition: RPCLinkSynchroStat.h:42
RPCLinkSynchroStat::SynchroCounts::firstHit
unsigned int firstHit() const
Definition: RPCLinkSynchroStat.cc:47
RPCLinkSynchroStat::LinkBoard::theName
std::string theName
Definition: RPCLinkSynchroStat.h:40
RPCLinkSynchroStat::LinkBoard::theChamberAndPartitions
std::vector< ChamberAndPartition > theChamberAndPartitions
Definition: RPCLinkSynchroStat.h:41
RPCLinkSynchroStat::LinkBoard::ChamberAndPartition
std::pair< std::string, std::string > ChamberAndPartition
Definition: RPCLinkSynchroStat.h:31
RPCLinkSynchroStat::SynchroCounts::rms
double rms() const
Definition: RPCLinkSynchroStat.cc:89
RPCLinkSynchroStat::DCCINDEXSHIFT
static const unsigned int DCCINDEXSHIFT
Definition: RPCLinkSynchroStat.h:85
RPCLinkSynchroStat::SynchroCounts::set
void set(unsigned int bxDiff)
Definition: RPCLinkSynchroStat.cc:54
RPCLinkSynchroHistoMaker
Definition: RPCLinkSynchroHistoMaker.h:13
RPCLinkSynchroStat::MAXDCCINDEX
static const unsigned int MAXDCCINDEX
Definition: RPCLinkSynchroStat.h:84
CastorDigiReco.o1
o1
Definition: CastorDigiReco.py:84
RPCLinkSynchroStat::MAXLBINDEX
static const unsigned int MAXLBINDEX
Definition: RPCLinkSynchroStat.h:88
RPCLinkSynchroStat::SynchroCounts::counts
const std::vector< unsigned int > & counts() const
Definition: RPCLinkSynchroStat.h:59
RPCLinkSynchroStat::LinkBoard::operator<
bool operator<(const LinkBoard &o) const
Definition: RPCLinkSynchroStat.h:36
RPCLinkSynchroStat::SynchroCounts::operator+=
SynchroCounts & operator+=(const SynchroCounts &rhs)
Definition: RPCLinkSynchroStat.cc:64
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCLinkSynchroStat::BoardAndCounts
std::pair< LinkBoard, SynchroCounts > BoardAndCounts
Definition: RPCLinkSynchroStat.h:69
RPCLinkSynchroStat::LinkBoard::name
const std::string & name() const
Definition: RPCLinkSynchroStat.h:30
RPCLinkSynchroStat::SynchroCounts::operator==
bool operator==(const SynchroCounts &) const
Definition: RPCLinkSynchroStat.cc:111
RPCLinkSynchroStat::RPCLinkSynchroStat
RPCLinkSynchroStat(bool useFirstHitOnly)
Definition: RPCLinkSynchroStat.cc:118
RPCLinkSynchroStat::add
void add(const RPCRawSynchro::ProdItem &counts, std::vector< LinkBoardElectronicIndex > &problems)
Definition: RPCLinkSynchroStat.cc:176
RPCLinkSynchroStat::MAXRBCINDEX
static const unsigned int MAXRBCINDEX
Definition: RPCLinkSynchroStat.h:86
RPCRawSynchro::ProdItem
std::vector< std::pair< LinkBoardElectronicIndex, int > > ProdItem
Definition: RPCRawSynchro.h:9
createfilelist.int
int
Definition: createfilelist.py:10
RPCLinkSynchroStat::ShortLinkInfo::hit_paths
std::vector< unsigned int > hit_paths
Definition: RPCLinkSynchroStat.h:78
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
RPCReadOutMapping
Definition: RPCReadOutMapping.h:22
RPCLinkSynchroStat::theLinkStatMap
std::vector< BoardAndCounts > theLinkStatMap
Definition: RPCLinkSynchroStat.h:90
LinkBoardElectronicIndex.h
RPCLinkSynchroStat::SynchroCounts::sum
unsigned int sum() const
Definition: RPCLinkSynchroStat.h:56
RPCLinkSynchroStat::ShortLinkInfo::idx
unsigned int idx
Definition: RPCLinkSynchroStat.h:77
LinkBoardElectronicIndex
Definition: LinkBoardElectronicIndex.h:10
RPCRawSynchro.h
std
Definition: JetResolutionObject.h:76
RPCLinkSynchroStat::SynchroCounts::mean
double mean() const
Definition: RPCLinkSynchroStat.cc:84
RPCLinkSynchroStat::~RPCLinkSynchroStat
virtual ~RPCLinkSynchroStat()
Definition: RPCLinkSynchroStat.h:16
RPCLinkSynchroStat::ShortLinkInfo
Definition: RPCLinkSynchroStat.h:76
dqmiodumpmetadata.counts
counts
Definition: dqmiodumpmetadata.py:25
edmOneToOneComparison.problems
problems
Definition: edmOneToOneComparison.py:170
RPCLinkSynchroStat
Definition: RPCLinkSynchroStat.h:12
RPCLinkSynchroStat::LinkBoard::operator==
bool operator==(const LinkBoard &o) const
Definition: RPCLinkSynchroStat.h:37
RPCLinkSynchroStat::theLinkStatNavi
unsigned int theLinkStatNavi[MAXDCCINDEX+1][MAXRBCINDEX+1][MAXLINKINDEX+1][MAXLBINDEX+1]
Definition: RPCLinkSynchroStat.h:89
RPCLinkSynchroStat::SynchroCounts::mom0
unsigned int mom0() const
Definition: RPCLinkSynchroStat.cc:70
RPCLinkSynchroStat::SynchroCounts::SynchroCounts
SynchroCounts()
Definition: RPCLinkSynchroStat.h:47
RPCLinkSynchroStat::theUseFirstHitOnly
bool theUseFirstHitOnly
Definition: RPCLinkSynchroStat.h:82
RPCLinkSynchroStat::LessCountSum
Definition: RPCLinkSynchroStat.h:73
RPCLinkSynchroStat::SynchroCounts::theCounts
std::vector< unsigned int > theCounts
Definition: RPCLinkSynchroStat.h:66
RPCLinkSynchroStat::LessLinkName
Definition: RPCLinkSynchroStat.h:70
RPCLinkSynchroStat::LinkBoard::chamberAndPartitions
const std::vector< ChamberAndPartition > & chamberAndPartitions() const
Definition: RPCLinkSynchroStat.h:35
RPCLinkSynchroStat::SynchroCounts::print
std::string print() const
Definition: RPCLinkSynchroStat.cc:101