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
PixelLumiDQM::fHistTotalRecordedLumiByLS
MonitorElement * fHistTotalRecordedLumiByLS
Definition: PixelLumiDQM.h:163
PixelLumiDQM::fHistRecordedByBxCumulative
MonitorElement * fHistRecordedByBxCumulative
Definition: PixelLumiDQM.h:165
PixelLumiDQM
Definition: PixelLumiDQM.h:41
PixelLumiDQM::fNumTrkPerVtx
UInt_t fNumTrkPerVtx
Definition: PixelLumiDQM.h:125
mps_fire.i
i
Definition: mps_fire.py:428
PixelLumiDQM::lastBunchCrossing
static const unsigned int lastBunchCrossing
Definition: PixelLumiDQM.h:56
PixelLumiDQM::kOffsetDisks
static constexpr size_t kOffsetDisks
Definition: PixelLumiDQM.h:78
PixelLumiDQM::calculateBunchMask
unsigned int calculateBunchMask(MonitorElement *, std::vector< bool > &)
Definition: PixelLumiDQM.cc:551
PixelLumiDQM::logFile_
std::ofstream logFile_
Definition: PixelLumiDQM.h:173
PixelLumiDQM::fIncludePixelClusterInfo
bool fIncludePixelClusterInfo
Definition: PixelLumiDQM.h:134
PixelLumiDQM::fFillNumber
unsigned int fFillNumber
Definition: PixelLumiDQM.h:170
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
PixelLumiDQM::PixelClusterCount
Definition: PixelLumiDQM.h:80
edm::Run
Definition: Run.h:45
PixelLumiDQM::PixelClusterCount::dnumFP
std::vector< double > dnumFP
Definition: PixelLumiDQM.h:110
edm::EDGetTokenT
Definition: EDGetToken.h:33
PixelLumiDQM::PixelClusterCount::Reset
void Reset()
Definition: PixelLumiDQM.h:93
PixelLumiDQM::fHistContainerThisRun
std::map< std::string, MonitorElement * > fHistContainerThisRun
Definition: PixelLumiDQM.h:138
SiPixelCluster.h
PixelLumiDQM::fIncludeVertexInfo
bool fIncludeVertexInfo
Definition: PixelLumiDQM.h:133
PixelLumiDQM::fHistClusByLS
MonitorElement * fHistClusByLS
Definition: PixelLumiDQM.h:162
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
PixelLumiDQM::PixelClusterCount::PixelClusterCount
PixelClusterCount()
Definition: PixelLumiDQM.h:84
PixelLumiDQM::fNumVtx
UInt_t fNumVtx
Definition: PixelLumiDQM.h:123
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
PixelLumiDQM::fVtxX
Double_t fVtxX
Definition: PixelLumiDQM.h:126
PixelLumiDQM::fBXNo
UInt_t fBXNo
Definition: PixelLumiDQM.h:121
PixelLumiDQM::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: PixelLumiDQM.cc:249
DQMOneEDAnalyzer.h
PixelLumiDQM::kOffsetLayers
static constexpr size_t kOffsetLayers
Definition: PixelLumiDQM.h:77
PixelLumiDQM::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PixelLumiDQM.cc:83
PixelLumiDQM::fHistClusterCountByBxCumulative
MonitorElement * fHistClusterCountByBxCumulative
Definition: PixelLumiDQM.h:161
PixelLumiDQM::fDeadModules
std::vector< uint32_t > fDeadModules
Definition: PixelLumiDQM.h:142
PixelLumiDQM::fIntActiveCrossingsFromDB
MonitorElement * fIntActiveCrossingsFromDB
Definition: PixelLumiDQM.h:154
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:16
PixelLumiDQM::PixelClusterCount::numB
std::vector< UInt_t > numB
Definition: PixelLumiDQM.h:105
PixelLumiDQM::SECONDS_PER_LS
static constexpr double SECONDS_PER_LS
Definition: PixelLumiDQM.h:46
PixelLumiDQM::fEvtNo
UInt_t fEvtNo
Definition: PixelLumiDQM.h:119
PixelLumiDQM::CM2_TO_NANOBARN
static constexpr double CM2_TO_NANOBARN
Definition: PixelLumiDQM.h:55
PixelLumiDQM::XSEC_PIXEL_CLUSTER_UNC
static constexpr double XSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:50
PixelLumiDQM::PixelClusterCount::numFM
std::vector< UInt_t > numFM
Definition: PixelLumiDQM.h:106
PixelLumiDQM::fRunNo
UInt_t fRunNo
Definition: PixelLumiDQM.h:118
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
PixelLumiDQM::rXSEC_PIXEL_CLUSTER_UNC
static constexpr double rXSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:54
PixelLumiDQM::filledAndUnmaskedBunches
unsigned int filledAndUnmaskedBunches
Definition: PixelLumiDQM.h:168
edm::ParameterSet
Definition: ParameterSet.h:47
PixelLumiDQM::fHistBunchCrossingsLastLumi
MonitorElement * fHistBunchCrossingsLastLumi
Definition: PixelLumiDQM.h:159
PixelLumiDQM::PixelLumiDQM
PixelLumiDQM(const edm::ParameterSet &)
Definition: PixelLumiDQM.cc:47
PixelLumiDQM::fHistnFMClusVsLS
MonitorElement * fHistnFMClusVsLS[2]
Definition: PixelLumiDQM.h:157
PixelLumiDQM::fHistRecordedByBxLastLumi
MonitorElement * fHistRecordedByBxLastLumi
Definition: PixelLumiDQM.h:164
PixelLumiDQM::fMinClusterCharge
double fMinClusterCharge
Definition: PixelLumiDQM.h:150
PixelLumiDQM::FREQ_ORBIT
static constexpr double FREQ_ORBIT
Definition: PixelLumiDQM.h:45
PixelLumiDQM::tkGeomToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
Definition: PixelLumiDQM.h:116
PixelLumiDQM::fVtxZ
Double_t fVtxZ
Definition: PixelLumiDQM.h:128
edm::EventSetup
Definition: EventSetup.h:58
PixelLumiDQM::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: PixelLumiDQM.cc:374
PixelLumiDQM::PixelClusterCount::numFP
std::vector< UInt_t > numFP
Definition: PixelLumiDQM.h:107
PixelLumiDQM::fPixelClusterLabel
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fPixelClusterLabel
Definition: PixelLumiDQM.h:115
PixelLumiDQM::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: PixelLumiDQM.cc:89
PixelLumiDQM::kNumDisks
static constexpr size_t kNumDisks
Definition: PixelLumiDQM.h:76
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
PixelLumiDQM::bunchTriggerMask
std::vector< bool > bunchTriggerMask
Definition: PixelLumiDQM.h:167
PixelLumiDQM::fHistnBClusVsLS
MonitorElement * fHistnBClusVsLS[3]
Definition: PixelLumiDQM.h:155
PixelLumiDQM::fTimestamp
UInt_t fTimestamp
Definition: PixelLumiDQM.h:122
PixelLumiDQM::rXSEC_PIXEL_CLUSTER
static constexpr double rXSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:53
PixelLumiDQM::fHistnFPClusVsLS
MonitorElement * fHistnFPClusVsLS[2]
Definition: PixelLumiDQM.h:156
ConfigurationDescriptions
PixelLumiDQM::fHistClusterCountByBxLastLumi
MonitorElement * fHistClusterCountByBxLastLumi
Definition: PixelLumiDQM.h:160
PixelLumiDQM::useInnerBarrelLayer
bool useInnerBarrelLayer
Definition: PixelLumiDQM.h:169
Frameworkfwd.h
PixelLumiDQM::fVtxY
Double_t fVtxY
Definition: PixelLumiDQM.h:127
PixelLumiDQM::PixelClusterCount::dnumB
std::vector< double > dnumB
Definition: PixelLumiDQM.h:108
PixelLumiDQM::endLuminosityBlock
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: PixelLumiDQM.cc:392
dqm::implementation::IBooker
Definition: DQMStore.h:43
PixelLumiDQM::XSEC_PIXEL_CLUSTER
static constexpr double XSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:49
PixelLumiDQM::PixelClusterCount::dnumFM
std::vector< double > dnumFM
Definition: PixelLumiDQM.h:109
PixelLumiDQM::fIncludePixelQualCheckHistos
bool fIncludePixelQualCheckHistos
Definition: PixelLumiDQM.h:135
PixelLumiDQM::fHistBunchCrossings
MonitorElement * fHistBunchCrossings
Definition: PixelLumiDQM.h:158
edm::Event
Definition: Event.h:73
PixelLumiDQM::fMinPixelsPerCluster
int fMinPixelsPerCluster
Definition: PixelLumiDQM.h:147
PixelLumiDQM::~PixelLumiDQM
~PixelLumiDQM() override
Definition: PixelLumiDQM.cc:81
PixelLumiDQM::fNumPixelClusters
std::map< int, PixelClusterCount > fNumPixelClusters
Definition: PixelLumiDQM.h:131
PixelLumiDQM::fLSNo
UInt_t fLSNo
Definition: PixelLumiDQM.h:120
PixelLumiDQM::kNumLayers
static constexpr size_t kNumLayers
Definition: PixelLumiDQM.h:75
PixelLumiDQM::fNumVtxGood
UInt_t fNumVtxGood
Definition: PixelLumiDQM.h:124
PixelLumiDQM::fLogFileName_
std::string fLogFileName_
Definition: PixelLumiDQM.h:171
PixelLumiDQM::fChi2
Double_t fChi2
Definition: PixelLumiDQM.h:129
PixelLumiDQM::fNdof
Double_t fNdof
Definition: PixelLumiDQM.h:130
PixelLumiDQM::fResetIntervalInLumiSections
int fResetIntervalInLumiSections
Definition: PixelLumiDQM.h:136
TrackerGeometry
Definition: TrackerGeometry.h:14