CMS 3D CMS Logo

PixelLumiDQM.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 // Package: PixelLumiDQM
4 // Class: PixelLumiDQM
5 
24 // Original author: Amita Raval
25 
26 #ifndef __PixelLumi_PixelLumiDQM_PixelLumiDQM_h__
27 #define __PixelLumi_PixelLumiDQM_PixelLumiDQM_h__
28 
29 #include <fstream>
30 #include <map>
31 #include <string>
32 #include <vector>
33 
37 
39 
40 class PixelLumiDQM : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
41 public:
42  explicit PixelLumiDQM(const edm::ParameterSet &);
43  ~PixelLumiDQM() override;
44  static constexpr double FREQ_ORBIT = 11245.5;
45  static constexpr double SECONDS_PER_LS = double(0x40000) / double(FREQ_ORBIT);
46 
47  // Using all pixel clusters:
48  static constexpr double XSEC_PIXEL_CLUSTER = 10.08e-24; // in cm^2
49  static constexpr double XSEC_PIXEL_CLUSTER_UNC = 0.17e-24;
50 
51  // Excluding the inner barrel layer.
52  static constexpr double rXSEC_PIXEL_CLUSTER = 9.4e-24; // in cm^2
53  static constexpr double rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24;
54  static constexpr double CM2_TO_NANOBARN = 1.0 / 1.e-33;
55  static const unsigned int lastBunchCrossing = 3564;
56 
57  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
58 
59 private:
60  void analyze(const edm::Event &, const edm::EventSetup &) override;
61  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
62  void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
63  void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
64 
65  // This is a kludge method to infer the filled bunches from the cluster count;
66  // notice that this cannot be used with random triggers.
67  // The filling scheme should be acquired from the database once it's there.
68 
69  unsigned int calculateBunchMask(MonitorElement *, std::vector<bool> &);
70  unsigned int calculateBunchMask(std::vector<float> &, unsigned int, std::vector<bool> &);
71  // ---------- Member data ----------
72 
73  // Hard-coded numbers of layers and disks...
74  static constexpr size_t kNumLayers = 5;
75  static constexpr size_t kNumDisks = 12;
76  static constexpr size_t kOffsetLayers = 0;
77  static constexpr size_t kOffsetDisks = 4;
78 
80  // B for barrel, F for forwared, M for minus, P for plus side,
81  // O for outer and I for inner. Numbers used for layers.
82  public:
84  : numB(kNumLayers, 0),
85  numFM(kNumDisks, 0),
86  numFP(kNumDisks, 0),
87  dnumB(kNumLayers, 0.0),
88  dnumFM(kNumDisks, 0.0),
89  dnumFP(kNumDisks, 0.0)
90 
91  {}
92  void Reset() {
93  for (unsigned int i = 0; i < numB.size(); i++) {
94  numB[i] = 0;
95  dnumB[i] = 0.0;
96  }
97  for (unsigned int i = 0; i < numFM.size(); i++) {
98  numFM[i] = 0;
99  numFP[i] = 0;
100  dnumFM[i] = 0.0;
101  dnumFP[i] = 0.0;
102  }
103  }
104  std::vector<UInt_t> numB;
105  std::vector<UInt_t> numFM;
106  std::vector<UInt_t> numFP;
107  std::vector<double> dnumB;
108  std::vector<double> dnumFM;
109  std::vector<double> dnumFP;
110 
111  private:
112  };
113 
115 
116  UInt_t fRunNo;
117  UInt_t fEvtNo;
118  UInt_t fLSNo;
119  UInt_t fBXNo;
120  UInt_t fTimestamp;
121  UInt_t fNumVtx;
122  UInt_t fNumVtxGood;
124  Double_t fVtxX;
125  Double_t fVtxY;
126  Double_t fVtxZ;
127  Double_t fChi2;
128  Double_t fNdof;
129  std::map<int, PixelClusterCount> fNumPixelClusters;
130 
135 
136  std::map<std::string, MonitorElement *> fHistContainerThisRun;
137 
138  // This is a list of modules to be ignored, either because they were
139  // dead or are dead in part of the data-taking period.
140  std::vector<uint32_t> fDeadModules;
141 
142  // The minimum number of pixels that should live in a cluster in
143  // order for the cluster to be counted as a real cluster
144  // (as opposed to, e.g., a noise pixel).
146 
147  // The minimum pixel cluster charge for a cluster to be counted.
149 
150  // Use the module label to distinguish the three different streams.
151 
164 
165  std::vector<bool> bunchTriggerMask;
168  unsigned int fFillNumber;
170 
171  std::ofstream logFile_;
172 };
173 
174 #endif
PixelLumiDQM::fHistTotalRecordedLumiByLS
MonitorElement * fHistTotalRecordedLumiByLS
Definition: PixelLumiDQM.h:161
PixelLumiDQM::fHistRecordedByBxCumulative
MonitorElement * fHistRecordedByBxCumulative
Definition: PixelLumiDQM.h:163
PixelLumiDQM
Definition: PixelLumiDQM.h:40
PixelLumiDQM::fNumTrkPerVtx
UInt_t fNumTrkPerVtx
Definition: PixelLumiDQM.h:123
mps_fire.i
i
Definition: mps_fire.py:428
PixelLumiDQM::lastBunchCrossing
static const unsigned int lastBunchCrossing
Definition: PixelLumiDQM.h:55
PixelLumiDQM::kOffsetDisks
static constexpr size_t kOffsetDisks
Definition: PixelLumiDQM.h:77
PixelLumiDQM::calculateBunchMask
unsigned int calculateBunchMask(MonitorElement *, std::vector< bool > &)
Definition: PixelLumiDQM.cc:557
PixelLumiDQM::logFile_
std::ofstream logFile_
Definition: PixelLumiDQM.h:171
PixelLumiDQM::fIncludePixelClusterInfo
bool fIncludePixelClusterInfo
Definition: PixelLumiDQM.h:132
PixelLumiDQM::fFillNumber
unsigned int fFillNumber
Definition: PixelLumiDQM.h:168
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
PixelLumiDQM::PixelClusterCount
Definition: PixelLumiDQM.h:79
edm::Run
Definition: Run.h:45
PixelLumiDQM::PixelClusterCount::dnumFP
std::vector< double > dnumFP
Definition: PixelLumiDQM.h:109
edm::EDGetTokenT
Definition: EDGetToken.h:33
PixelLumiDQM::PixelClusterCount::Reset
void Reset()
Definition: PixelLumiDQM.h:92
PixelLumiDQM::fHistContainerThisRun
std::map< std::string, MonitorElement * > fHistContainerThisRun
Definition: PixelLumiDQM.h:136
SiPixelCluster.h
PixelLumiDQM::fIncludeVertexInfo
bool fIncludeVertexInfo
Definition: PixelLumiDQM.h:131
PixelLumiDQM::fHistClusByLS
MonitorElement * fHistClusByLS
Definition: PixelLumiDQM.h:160
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
PixelLumiDQM::PixelClusterCount::PixelClusterCount
PixelClusterCount()
Definition: PixelLumiDQM.h:83
PixelLumiDQM::fNumVtx
UInt_t fNumVtx
Definition: PixelLumiDQM.h:121
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
PixelLumiDQM::fVtxX
Double_t fVtxX
Definition: PixelLumiDQM.h:124
PixelLumiDQM::fBXNo
UInt_t fBXNo
Definition: PixelLumiDQM.h:119
PixelLumiDQM::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: PixelLumiDQM.cc:255
DQMOneEDAnalyzer.h
PixelLumiDQM::kOffsetLayers
static constexpr size_t kOffsetLayers
Definition: PixelLumiDQM.h:76
PixelLumiDQM::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PixelLumiDQM.cc:82
PixelLumiDQM::fHistClusterCountByBxCumulative
MonitorElement * fHistClusterCountByBxCumulative
Definition: PixelLumiDQM.h:159
PixelLumiDQM::fDeadModules
std::vector< uint32_t > fDeadModules
Definition: PixelLumiDQM.h:140
PixelLumiDQM::fIntActiveCrossingsFromDB
MonitorElement * fIntActiveCrossingsFromDB
Definition: PixelLumiDQM.h:152
PixelLumiDQM::PixelClusterCount::numB
std::vector< UInt_t > numB
Definition: PixelLumiDQM.h:104
PixelLumiDQM::SECONDS_PER_LS
static constexpr double SECONDS_PER_LS
Definition: PixelLumiDQM.h:45
PixelLumiDQM::fEvtNo
UInt_t fEvtNo
Definition: PixelLumiDQM.h:117
PixelLumiDQM::CM2_TO_NANOBARN
static constexpr double CM2_TO_NANOBARN
Definition: PixelLumiDQM.h:54
PixelLumiDQM::XSEC_PIXEL_CLUSTER_UNC
static constexpr double XSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:49
PixelLumiDQM::PixelClusterCount::numFM
std::vector< UInt_t > numFM
Definition: PixelLumiDQM.h:105
PixelLumiDQM::fRunNo
UInt_t fRunNo
Definition: PixelLumiDQM.h:116
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PixelLumiDQM::rXSEC_PIXEL_CLUSTER_UNC
static constexpr double rXSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:53
PixelLumiDQM::filledAndUnmaskedBunches
unsigned int filledAndUnmaskedBunches
Definition: PixelLumiDQM.h:166
edm::ParameterSet
Definition: ParameterSet.h:47
PixelLumiDQM::fHistBunchCrossingsLastLumi
MonitorElement * fHistBunchCrossingsLastLumi
Definition: PixelLumiDQM.h:157
PixelLumiDQM::PixelLumiDQM
PixelLumiDQM(const edm::ParameterSet &)
Definition: PixelLumiDQM.cc:47
PixelLumiDQM::fHistnFMClusVsLS
MonitorElement * fHistnFMClusVsLS[2]
Definition: PixelLumiDQM.h:155
PixelLumiDQM::fHistRecordedByBxLastLumi
MonitorElement * fHistRecordedByBxLastLumi
Definition: PixelLumiDQM.h:162
PixelLumiDQM::fMinClusterCharge
double fMinClusterCharge
Definition: PixelLumiDQM.h:148
PixelLumiDQM::FREQ_ORBIT
static constexpr double FREQ_ORBIT
Definition: PixelLumiDQM.h:44
PixelLumiDQM::fVtxZ
Double_t fVtxZ
Definition: PixelLumiDQM.h:126
edm::EventSetup
Definition: EventSetup.h:57
PixelLumiDQM::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: PixelLumiDQM.cc:380
PixelLumiDQM::PixelClusterCount::numFP
std::vector< UInt_t > numFP
Definition: PixelLumiDQM.h:106
PixelLumiDQM::fPixelClusterLabel
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fPixelClusterLabel
Definition: PixelLumiDQM.h:114
PixelLumiDQM::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: PixelLumiDQM.cc:88
PixelLumiDQM::kNumDisks
static constexpr size_t kNumDisks
Definition: PixelLumiDQM.h:75
PixelLumiDQM::bunchTriggerMask
std::vector< bool > bunchTriggerMask
Definition: PixelLumiDQM.h:165
PixelLumiDQM::fHistnBClusVsLS
MonitorElement * fHistnBClusVsLS[3]
Definition: PixelLumiDQM.h:153
PixelLumiDQM::fTimestamp
UInt_t fTimestamp
Definition: PixelLumiDQM.h:120
PixelLumiDQM::rXSEC_PIXEL_CLUSTER
static constexpr double rXSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:52
PixelLumiDQM::fHistnFPClusVsLS
MonitorElement * fHistnFPClusVsLS[2]
Definition: PixelLumiDQM.h:154
ConfigurationDescriptions
PixelLumiDQM::fHistClusterCountByBxLastLumi
MonitorElement * fHistClusterCountByBxLastLumi
Definition: PixelLumiDQM.h:158
PixelLumiDQM::useInnerBarrelLayer
bool useInnerBarrelLayer
Definition: PixelLumiDQM.h:167
Frameworkfwd.h
PixelLumiDQM::fVtxY
Double_t fVtxY
Definition: PixelLumiDQM.h:125
PixelLumiDQM::PixelClusterCount::dnumB
std::vector< double > dnumB
Definition: PixelLumiDQM.h:107
PixelLumiDQM::endLuminosityBlock
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: PixelLumiDQM.cc:398
dqm::implementation::IBooker
Definition: DQMStore.h:43
PixelLumiDQM::XSEC_PIXEL_CLUSTER
static constexpr double XSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:48
PixelLumiDQM::PixelClusterCount::dnumFM
std::vector< double > dnumFM
Definition: PixelLumiDQM.h:108
PixelLumiDQM::fIncludePixelQualCheckHistos
bool fIncludePixelQualCheckHistos
Definition: PixelLumiDQM.h:133
PixelLumiDQM::fHistBunchCrossings
MonitorElement * fHistBunchCrossings
Definition: PixelLumiDQM.h:156
edm::Event
Definition: Event.h:73
PixelLumiDQM::fMinPixelsPerCluster
int fMinPixelsPerCluster
Definition: PixelLumiDQM.h:145
PixelLumiDQM::~PixelLumiDQM
~PixelLumiDQM() override
Definition: PixelLumiDQM.cc:80
PixelLumiDQM::fNumPixelClusters
std::map< int, PixelClusterCount > fNumPixelClusters
Definition: PixelLumiDQM.h:129
PixelLumiDQM::fLSNo
UInt_t fLSNo
Definition: PixelLumiDQM.h:118
PixelLumiDQM::kNumLayers
static constexpr size_t kNumLayers
Definition: PixelLumiDQM.h:74
PixelLumiDQM::fNumVtxGood
UInt_t fNumVtxGood
Definition: PixelLumiDQM.h:122
PixelLumiDQM::fLogFileName_
std::string fLogFileName_
Definition: PixelLumiDQM.h:169
PixelLumiDQM::fChi2
Double_t fChi2
Definition: PixelLumiDQM.h:127
PixelLumiDQM::fNdof
Double_t fNdof
Definition: PixelLumiDQM.h:128
PixelLumiDQM::fResetIntervalInLumiSections
int fResetIntervalInLumiSections
Definition: PixelLumiDQM.h:134