CMS 3D CMS Logo

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