CMS 3D CMS Logo

SiStripSpyUtilities.h
Go to the documentation of this file.
1 #ifndef DQM_SiStripMonitorHardware_SiStripSpyUtilities_H
2 #define DQM_SiStripMonitorHardware_SiStripSpyUtilities_H
3 
4 // Standard includes.
5 //#include <utility>
6 #include <string>
7 
10 
13 
14 // Other classes
15 class EventSetup;
16 
17 namespace sistrip {
18 
19  namespace SpyUtilities {
20  struct Frame {
21  uint32_t detId;
22  uint16_t digitalLow;
23  uint16_t digitalHigh;
24  uint16_t firstHeaderBit;
25  uint16_t firstTrailerBit;
26  float baseline;
27  std::pair<bool, bool> apvErrorBit;
28  std::pair<uint8_t, uint8_t> apvAddress;
29  };
30 
31  struct FrameQuality {
32  uint16_t minDigiRange;
33  uint16_t maxDigiRange;
34  uint16_t minZeroLight;
35  uint16_t maxZeroLight;
36  uint16_t minTickHeight;
37  uint16_t maxTickHeight;
38  };
39 
40  //fill variables from frame
42  bool aPrintDebug = false);
43 
45  uint16_t& firstHeaderBit,
46  bool printResult = true);
47 
48  //check frame is valid
49  const bool isValid(const Frame& aFrame, const FrameQuality& aQuality, const uint16_t aExpectedPos);
50 
51  //extract range, threshold and apvAddress
52  const uint16_t range(const Frame& aFrame);
53 
54  const uint16_t threshold(const Frame& aFrame);
55 
56  const uint8_t extractAPVaddress(const Frame& aFrame);
57 
58  //find position of the first header and trailer bit
59  const uint16_t findHeaderBits(const edm::DetSetVector<SiStripRawDigi>::detset& channelDigis,
60  const uint16_t threshold);
61 
62  const uint16_t findTrailerBits(const edm::DetSetVector<SiStripRawDigi>::detset& channelDigis,
63  const uint16_t threshold);
64 
65  //find both APV addresses and error bits
66  const std::pair<bool, bool> findAPVErrorBits(const edm::DetSetVector<SiStripRawDigi>::detset& channelDigis,
67  const uint16_t threshold,
68  const uint16_t aFirstBits);
69 
70  const std::pair<uint8_t, uint8_t> findAPVAddresses(const edm::DetSetVector<SiStripRawDigi>::detset& channelDigis,
71  const uint16_t threshold,
72  const uint16_t aFirstBits);
73 
74  std::string print(const Frame& aFrame, std::string aErr);
75 
76  void fedIndex(uint32_t aFedIndex, uint16_t& aFedId, uint16_t& aFedChannel);
77 
78  std::pair<uint16_t, uint32_t> findMajorityValue(std::vector<uint16_t>& values, const uint16_t aFedId = 0);
79 
80  void fillFEDMajorities(const std::map<uint32_t, uint32_t>& channelValues,
81  std::vector<uint32_t>& fedMajoritiesToFill);
82 
83  } // namespace SpyUtilities
84 } // namespace sistrip
85 
86 #endif // DQM_SiStripMonitorHardware_SiStripSpyUtilities_H
edm::DetSetVector< SiStripRawDigi >
sistrip::SpyUtilities::extractFrameInfo
const Frame extractFrameInfo(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, bool aPrintDebug=false)
Definition: SiStripSpyUtilities.cc:11
sistrip::SpyUtilities::fedIndex
void fedIndex(uint32_t aFedIndex, uint16_t &aFedId, uint16_t &aFedChannel)
Definition: SiStripSpyUtilities.cc:300
sistrip::SpyUtilities::Frame::firstTrailerBit
uint16_t firstTrailerBit
Definition: SiStripSpyUtilities.h:25
ESHandle.h
sistrip::SpyUtilities::Frame::digitalLow
uint16_t digitalLow
Definition: SiStripSpyUtilities.h:22
edm::DetSet
Definition: DetSet.h:23
SiStripRawDigi.h
sistrip::SpyUtilities::FrameQuality
Definition: SiStripSpyUtilities.h:31
sistrip::SpyUtilities::findAPVErrorBits
const std::pair< bool, bool > findAPVErrorBits(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold, const uint16_t aFirstBits)
Definition: SiStripSpyUtilities.cc:216
sistrip::SpyUtilities::Frame::detId
uint32_t detId
Definition: SiStripSpyUtilities.h:21
sistrip::SpyUtilities::Frame::apvAddress
std::pair< uint8_t, uint8_t > apvAddress
Definition: SiStripSpyUtilities.h:28
sistrip::SpyUtilities::getMajorityHeader
void getMajorityHeader(const edm::DetSetVector< SiStripRawDigi > *aInputDigis, uint16_t &firstHeaderBit, bool printResult=true)
Definition: SiStripSpyUtilities.cc:97
sistrip::SpyUtilities::extractAPVaddress
const uint8_t extractAPVaddress(const Frame &aFrame)
Definition: SiStripSpyUtilities.cc:87
sistrip::SpyUtilities::findAPVAddresses
const std::pair< uint8_t, uint8_t > findAPVAddresses(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold, const uint16_t aFirstBits)
Definition: SiStripSpyUtilities.cc:250
sistrip::SpyUtilities::fillFEDMajorities
void fillFEDMajorities(const std::map< uint32_t, uint32_t > &channelValues, std::vector< uint32_t > &fedMajoritiesToFill)
Definition: SiStripSpyUtilities.cc:341
sistrip::SpyUtilities::findMajorityValue
std::pair< uint16_t, uint32_t > findMajorityValue(std::vector< uint16_t > &values, const uint16_t aFedId=0)
Definition: SiStripSpyUtilities.cc:311
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
sistrip::SpyUtilities::print
std::string print(const Frame &aFrame, std::string aErr)
Definition: SiStripSpyUtilities.cc:283
sistrip::SpyUtilities::findHeaderBits
const uint16_t findHeaderBits(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold)
Definition: SiStripSpyUtilities.cc:147
sistrip::SpyUtilities::Frame::baseline
float baseline
Definition: SiStripSpyUtilities.h:26
sistrip::SpyUtilities::isValid
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
Definition: SiStripSpyUtilities.cc:124
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DetSetVector.h
sistrip::SpyUtilities::FrameQuality::maxTickHeight
uint16_t maxTickHeight
Definition: SiStripSpyUtilities.h:37
sistrip::SpyUtilities::FrameQuality::minZeroLight
uint16_t minZeroLight
Definition: SiStripSpyUtilities.h:34
sistrip::SpyUtilities::Frame::firstHeaderBit
uint16_t firstHeaderBit
Definition: SiStripSpyUtilities.h:24
sistrip::SpyUtilities::threshold
const uint16_t threshold(const Frame &aFrame)
Definition: SiStripSpyUtilities.cc:83
sistrip::SpyUtilities::FrameQuality::minDigiRange
uint16_t minDigiRange
Definition: SiStripSpyUtilities.h:32
sistrip::SpyUtilities::Frame::digitalHigh
uint16_t digitalHigh
Definition: SiStripSpyUtilities.h:23
sistrip::SpyUtilities::Frame::apvErrorBit
std::pair< bool, bool > apvErrorBit
Definition: SiStripSpyUtilities.h:27
EventSetup.h
sistrip::SpyUtilities::Frame
Definition: SiStripSpyUtilities.h:20
EventSetup
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
cmsCodeRulesChecker.printResult
printResult
Definition: cmsCodeRulesChecker.py:156
sistrip::SpyUtilities::FrameQuality::maxZeroLight
uint16_t maxZeroLight
Definition: SiStripSpyUtilities.h:35
sistrip::SpyUtilities::FrameQuality::maxDigiRange
uint16_t maxDigiRange
Definition: SiStripSpyUtilities.h:33
sistrip::SpyUtilities::FrameQuality::minTickHeight
uint16_t minTickHeight
Definition: SiStripSpyUtilities.h:36
sistrip::SpyUtilities::range
const uint16_t range(const Frame &aFrame)
Definition: SiStripSpyUtilities.cc:76
sistrip::SpyUtilities::findTrailerBits
const uint16_t findTrailerBits(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold)
Definition: SiStripSpyUtilities.cc:178