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 class TrackerGeometry;
41 class PixelLumiDQM : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
42 public:
43  explicit PixelLumiDQM(const edm::ParameterSet &);
44  ~PixelLumiDQM() override;
45  static constexpr double FREQ_ORBIT = 11245.5;
46  static constexpr double SECONDS_PER_LS = double(0x40000) / double(FREQ_ORBIT);
47 
48  // Using all pixel clusters:
49  static constexpr double XSEC_PIXEL_CLUSTER = 10.08e-24; // in cm^2
50  static constexpr double XSEC_PIXEL_CLUSTER_UNC = 0.17e-24;
51 
52  // Excluding the inner barrel layer.
53  static constexpr double rXSEC_PIXEL_CLUSTER = 9.4e-24; // in cm^2
54  static constexpr double rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24;
55  static constexpr double CM2_TO_NANOBARN = 1.0 / 1.e-33;
56  static const unsigned int lastBunchCrossing = 3564;
57 
58  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
59 
60 private:
61  void analyze(const edm::Event &, const edm::EventSetup &) override;
62  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
63  void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
64  void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
65 
66  // This is a kludge method to infer the filled bunches from the cluster count;
67  // notice that this cannot be used with random triggers.
68  // The filling scheme should be acquired from the database once it's there.
69 
70  unsigned int calculateBunchMask(MonitorElement *, std::vector<bool> &);
71  unsigned int calculateBunchMask(std::vector<float> &, unsigned int, std::vector<bool> &);
72  // ---------- Member data ----------
73 
74  // Hard-coded numbers of layers and disks...
75  static constexpr size_t kNumLayers = 5;
76  static constexpr size_t kNumDisks = 12;
77  static constexpr size_t kOffsetLayers = 0;
78  static constexpr size_t kOffsetDisks = 4;
79 
81  // B for barrel, F for forwared, M for minus, P for plus side,
82  // O for outer and I for inner. Numbers used for layers.
83  public:
85  : numB(kNumLayers, 0),
86  numFM(kNumDisks, 0),
87  numFP(kNumDisks, 0),
88  dnumB(kNumLayers, 0.0),
89  dnumFM(kNumDisks, 0.0),
90  dnumFP(kNumDisks, 0.0)
91 
92  {}
93  void Reset() {
94  for (unsigned int i = 0; i < numB.size(); i++) {
95  numB[i] = 0;
96  dnumB[i] = 0.0;
97  }
98  for (unsigned int i = 0; i < numFM.size(); i++) {
99  numFM[i] = 0;
100  numFP[i] = 0;
101  dnumFM[i] = 0.0;
102  dnumFP[i] = 0.0;
103  }
104  }
105  std::vector<UInt_t> numB;
106  std::vector<UInt_t> numFM;
107  std::vector<UInt_t> numFP;
108  std::vector<double> dnumB;
109  std::vector<double> dnumFM;
110  std::vector<double> dnumFP;
111 
112  private:
113  };
114 
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 constexpr double XSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:49
static constexpr double XSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:50
unsigned int filledAndUnmaskedBunches
Definition: PixelLumiDQM.h:168
MonitorElement * fIntActiveCrossingsFromDB
Definition: PixelLumiDQM.h:154
static const unsigned int lastBunchCrossing
Definition: PixelLumiDQM.h:56
std::vector< uint32_t > fDeadModules
Definition: PixelLumiDQM.h:142
std::vector< double > dnumFP
Definition: PixelLumiDQM.h:110
Double_t fVtxZ
Definition: PixelLumiDQM.h:128
static constexpr size_t kOffsetDisks
Definition: PixelLumiDQM.h:78
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
Definition: PixelLumiDQM.h:116
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:105
MonitorElement * fHistClusByLS
Definition: PixelLumiDQM.h:162
std::vector< UInt_t > numFP
Definition: PixelLumiDQM.h:107
~PixelLumiDQM() override
Definition: PixelLumiDQM.cc:81
bool fIncludeVertexInfo
Definition: PixelLumiDQM.h:133
static constexpr size_t kNumDisks
Definition: PixelLumiDQM.h:76
static constexpr double rXSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:54
std::vector< double > dnumFM
Definition: PixelLumiDQM.h:109
MonitorElement * fHistnFMClusVsLS[2]
Definition: PixelLumiDQM.h:157
static constexpr double SECONDS_PER_LS
Definition: PixelLumiDQM.h:46
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fPixelClusterLabel
Definition: PixelLumiDQM.h:115
unsigned int calculateBunchMask(MonitorElement *, std::vector< bool > &)
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
std::vector< UInt_t > numFM
Definition: PixelLumiDQM.h:106
Double_t fNdof
Definition: PixelLumiDQM.h:130
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:108
std::map< std::string, MonitorElement * > fHistContainerThisRun
Definition: PixelLumiDQM.h:138
double fMinClusterCharge
Definition: PixelLumiDQM.h:150
std::vector< bool > bunchTriggerMask
Definition: PixelLumiDQM.h:167
bool fIncludePixelClusterInfo
Definition: PixelLumiDQM.h:134
static constexpr double rXSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:53
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:47
static constexpr size_t kOffsetLayers
Definition: PixelLumiDQM.h:77
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: PixelLumiDQM.cc:89
std::map< int, PixelClusterCount > fNumPixelClusters
Definition: PixelLumiDQM.h:131
MonitorElement * fHistRecordedByBxLastLumi
Definition: PixelLumiDQM.h:164
int fMinPixelsPerCluster
Definition: PixelLumiDQM.h:147
Double_t fVtxX
Definition: PixelLumiDQM.h:126
MonitorElement * fHistnFPClusVsLS[2]
Definition: PixelLumiDQM.h:156
Definition: Run.h:45
static constexpr double FREQ_ORBIT
Definition: PixelLumiDQM.h:45
Double_t fChi2
Definition: PixelLumiDQM.h:129
static constexpr double CM2_TO_NANOBARN
Definition: PixelLumiDQM.h:55
std::ofstream logFile_
Definition: PixelLumiDQM.h:173
static constexpr size_t kNumLayers
Definition: PixelLumiDQM.h:75