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 one::DQMEDAnalyzer<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 dqmBeginRun(edm::Run const &, edm::EventSetup const &) override;
63  void endRun(edm::Run const &, edm::EventSetup const &) override;
64  void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
65  void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
66 
67  // This is a kludge method to infer the filled bunches from the cluster count;
68  // notice that this cannot be used with random triggers.
69  // The filling scheme should be acquired from the database once it's there.
70 
71  unsigned int calculateBunchMask(MonitorElement *, std::vector<bool> &);
72  unsigned int calculateBunchMask(std::vector<float> &, unsigned int, std::vector<bool> &);
73  // ---------- Member data ----------
74 
75  // Hard-coded numbers of layers and disks...
76  static constexpr size_t kNumLayers = 5;
77  static constexpr size_t kNumDisks = 12;
78  static constexpr size_t kOffsetLayers = 0;
79  static constexpr size_t kOffsetDisks = 4;
80 
82  // B for barrel, F for forwared, M for minus, P for plus side,
83  // O for outer and I for inner. Numbers used for layers.
84  public:
86  : numB(kNumLayers, 0),
87  numFM(kNumDisks, 0),
88  numFP(kNumDisks, 0),
89  dnumB(kNumLayers, 0.0),
90  dnumFM(kNumDisks, 0.0),
91  dnumFP(kNumDisks, 0.0)
92 
93  {}
94  void Reset() {
95  for (unsigned int i = 0; i < numB.size(); i++) {
96  numB[i] = 0;
97  dnumB[i] = 0.0;
98  }
99  for (unsigned int i = 0; i < numFM.size(); i++) {
100  numFM[i] = 0;
101  numFP[i] = 0;
102  dnumFM[i] = 0.0;
103  dnumFP[i] = 0.0;
104  }
105  }
106  std::vector<UInt_t> numB;
107  std::vector<UInt_t> numFM;
108  std::vector<UInt_t> numFP;
109  std::vector<double> dnumB;
110  std::vector<double> dnumFM;
111  std::vector<double> dnumFP;
112 
113  private:
114  };
115 
117 
118  UInt_t fRunNo;
119  UInt_t fEvtNo;
120  UInt_t fLSNo;
121  UInt_t fBXNo;
122  UInt_t fTimestamp;
123  UInt_t fNumVtx;
124  UInt_t fNumVtxGood;
126  Double_t fVtxX;
127  Double_t fVtxY;
128  Double_t fVtxZ;
129  Double_t fChi2;
130  Double_t fNdof;
131  std::map<int, PixelClusterCount> fNumPixelClusters;
132 
137 
138  std::map<std::string, MonitorElement *> fHistContainerThisRun;
139 
140  // This is a list of modules to be ignored, either because they were
141  // dead or are dead in part of the data-taking period.
142  std::vector<uint32_t> fDeadModules;
143 
144  // The minimum number of pixels that should live in a cluster in
145  // order for the cluster to be counted as a real cluster
146  // (as opposed to, e.g., a noise pixel).
148 
149  // The minimum pixel cluster charge for a cluster to be counted.
151 
152  // Use the module label to distinguish the three different streams.
153 
166 
167  std::vector<bool> bunchTriggerMask;
170  unsigned int fFillNumber;
172 
173  std::ofstream logFile_;
174 };
175 
176 #endif
UInt_t fNumVtx
Definition: PixelLumiDQM.h:123
bool fIncludePixelQualCheckHistos
Definition: PixelLumiDQM.h:135
static double SECONDS_PER_LS
Definition: PixelLumiDQM.h:45
unsigned int filledAndUnmaskedBunches
Definition: PixelLumiDQM.h:168
MonitorElement * fIntActiveCrossingsFromDB
Definition: PixelLumiDQM.h:154
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
static const unsigned int lastBunchCrossing
Definition: PixelLumiDQM.h:55
void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< uint32_t > fDeadModules
Definition: PixelLumiDQM.h:142
std::vector< double > dnumFP
Definition: PixelLumiDQM.h:111
Double_t fVtxZ
Definition: PixelLumiDQM.h:128
static size_t kOffsetDisks
Definition: PixelLumiDQM.h:79
int fResetIntervalInLumiSections
Definition: PixelLumiDQM.h:136
MonitorElement * fHistRecordedByBxCumulative
Definition: PixelLumiDQM.h:165
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
unsigned int fFillNumber
Definition: PixelLumiDQM.h:170
bool useInnerBarrelLayer
Definition: PixelLumiDQM.h:169
std::vector< UInt_t > numB
Definition: PixelLumiDQM.h:106
MonitorElement * fHistClusByLS
Definition: PixelLumiDQM.h:162
std::vector< UInt_t > numFP
Definition: PixelLumiDQM.h:108
~PixelLumiDQM() override
Definition: PixelLumiDQM.cc:81
bool fIncludeVertexInfo
Definition: PixelLumiDQM.h:133
std::vector< double > dnumFM
Definition: PixelLumiDQM.h:110
MonitorElement * fHistnFMClusVsLS[2]
Definition: PixelLumiDQM.h:157
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fPixelClusterLabel
Definition: PixelLumiDQM.h:116
unsigned int calculateBunchMask(MonitorElement *, std::vector< bool > &)
static double rXSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:52
MonitorElement * fHistClusterCountByBxLastLumi
Definition: PixelLumiDQM.h:160
MonitorElement * fHistTotalRecordedLumiByLS
Definition: PixelLumiDQM.h:163
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PixelLumiDQM.cc:83
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
static double FREQ_ORBIT
Definition: PixelLumiDQM.h:44
std::vector< UInt_t > numFM
Definition: PixelLumiDQM.h:107
Double_t fNdof
Definition: PixelLumiDQM.h:130
static double XSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:49
MonitorElement * fHistClusterCountByBxCumulative
Definition: PixelLumiDQM.h:161
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * fHistnBClusVsLS[3]
Definition: PixelLumiDQM.h:155
Double_t fVtxY
Definition: PixelLumiDQM.h:127
UInt_t fNumVtxGood
Definition: PixelLumiDQM.h:124
std::vector< double > dnumB
Definition: PixelLumiDQM.h:109
std::map< std::string, MonitorElement * > fHistContainerThisRun
Definition: PixelLumiDQM.h:138
double fMinClusterCharge
Definition: PixelLumiDQM.h:150
std::vector< bool > bunchTriggerMask
Definition: PixelLumiDQM.h:167
static double CM2_TO_NANOBARN
Definition: PixelLumiDQM.h:54
bool fIncludePixelClusterInfo
Definition: PixelLumiDQM.h:134
static double XSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:48
MonitorElement * fHistBunchCrossings
Definition: PixelLumiDQM.h:158
MonitorElement * fHistBunchCrossingsLastLumi
Definition: PixelLumiDQM.h:159
UInt_t fNumTrkPerVtx
Definition: PixelLumiDQM.h:125
UInt_t fTimestamp
Definition: PixelLumiDQM.h:122
std::string fLogFileName_
Definition: PixelLumiDQM.h:171
PixelLumiDQM(const edm::ParameterSet &)
Definition: PixelLumiDQM.cc:48
static double rXSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:53
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: PixelLumiDQM.cc:89
static size_t kNumLayers
Definition: PixelLumiDQM.h:76
std::map< int, PixelClusterCount > fNumPixelClusters
Definition: PixelLumiDQM.h:131
MonitorElement * fHistRecordedByBxLastLumi
Definition: PixelLumiDQM.h:164
int fMinPixelsPerCluster
Definition: PixelLumiDQM.h:147
static size_t kOffsetLayers
Definition: PixelLumiDQM.h:78
static size_t kNumDisks
Definition: PixelLumiDQM.h:77
Double_t fVtxX
Definition: PixelLumiDQM.h:126
MonitorElement * fHistnFPClusVsLS[2]
Definition: PixelLumiDQM.h:156
#define constexpr
Definition: Run.h:45
Double_t fChi2
Definition: PixelLumiDQM.h:129
std::ofstream logFile_
Definition: PixelLumiDQM.h:173