CMS 3D CMS Logo

PixelLumiDQM.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 // Package: PixelLumiDQM
4 // Class: PixelLumiDQM
5 
22 // Original author: Amita Raval
23 
24 #ifndef __PixelLumi_PixelLumiDQM_PixelLumiDQM_h__
25 #define __PixelLumi_PixelLumiDQM_PixelLumiDQM_h__
26 
27 #include <vector>
28 #include <map>
29 #include <string>
30 #include <fstream>
31 
35 
37 
38 class PixelLumiDQM : public DQMEDAnalyzer {
39 public:
40  explicit PixelLumiDQM(const edm::ParameterSet&);
41  ~PixelLumiDQM() override;
42  static constexpr double FREQ_ORBIT = 11245.5;
43  static constexpr double SECONDS_PER_LS = double(0x40000)/double(FREQ_ORBIT);
44 
45  // Using all pixel clusters:
46  static constexpr double XSEC_PIXEL_CLUSTER = 10.08e-24; //in cm^2
47  static constexpr double XSEC_PIXEL_CLUSTER_UNC = 0.17e-24;
48 
49  // Excluding the inner barrel layer.
50  static constexpr double rXSEC_PIXEL_CLUSTER = 9.4e-24; //in cm^2
51  static constexpr double rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24;
52  static constexpr double CM2_TO_NANOBARN = 1.0/1.e-33;
53  static const unsigned int lastBunchCrossing = 3564;
54 
55  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
56 
57 private:
58  void analyze(const edm::Event&, const edm::EventSetup&) override;
59  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const&) override;
60  void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
61  void endRun(edm::Run const&, edm::EventSetup const&) override;
63  edm::EventSetup const&) override;
65  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  }
95  void Reset()
96  {
97  for(unsigned int i = 0 ; i< numB.size(); i++){
98  numB[i]=0;
99  dnumB[i]=0.0;
100  }
101  for(unsigned int i = 0 ; i< numFM.size(); i++){
102  numFM[i] = 0;
103  numFP[i] = 0;
104  dnumFM[i] = 0.0;
105  dnumFP[i] = 0.0;
106  }
107  }
108  std::vector<UInt_t> numB;
109  std::vector<UInt_t> numFM;
110  std::vector<UInt_t> numFP;
111  std::vector<double> dnumB;
112  std::vector<double> dnumFM;
113  std::vector<double> dnumFP;
114  private:
115  };
116 
118 
119  UInt_t fRunNo;
120  UInt_t fEvtNo;
121  UInt_t fLSNo;
122  UInt_t fBXNo;
123  UInt_t fTimestamp;
124  UInt_t fNumVtx;
125  UInt_t fNumVtxGood;
127  Double_t fVtxX;
128  Double_t fVtxY;
129  Double_t fVtxZ;
130  Double_t fChi2;
131  Double_t fNdof;
132  std::map<int, PixelClusterCount> fNumPixelClusters;
133 
138 
139  std::map<std::string, MonitorElement*> fHistContainerThisRun;
140 
141  // This is a list of modules to be ignored, either because they were
142  // dead or are dead in part of the data-taking period.
143  std::vector<uint32_t> fDeadModules;
144 
145  // The minimum number of pixels that should live in a cluster in
146  // order for the cluster to be counted as a real cluster
147  // (as opposed to, e.g., a noise pixel).
149 
150  // The minimum pixel cluster charge for a cluster to be counted.
152 
153  // Use the module label to distinguish the three different streams.
154 
167 
168  std::vector<bool> bunchTriggerMask;
171  unsigned int fFillNumber;
173 
174  std::ofstream logFile_;
175 };
176 
177 #endif
UInt_t fNumVtx
Definition: PixelLumiDQM.h:124
bool fIncludePixelQualCheckHistos
Definition: PixelLumiDQM.h:136
static double SECONDS_PER_LS
Definition: PixelLumiDQM.h:43
unsigned int filledAndUnmaskedBunches
Definition: PixelLumiDQM.h:169
MonitorElement * fIntActiveCrossingsFromDB
Definition: PixelLumiDQM.h:155
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
static const unsigned int lastBunchCrossing
Definition: PixelLumiDQM.h:53
void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< uint32_t > fDeadModules
Definition: PixelLumiDQM.h:143
std::vector< double > dnumFP
Definition: PixelLumiDQM.h:113
Double_t fVtxZ
Definition: PixelLumiDQM.h:129
static size_t kOffsetDisks
Definition: PixelLumiDQM.h:79
int fResetIntervalInLumiSections
Definition: PixelLumiDQM.h:137
MonitorElement * fHistRecordedByBxCumulative
Definition: PixelLumiDQM.h:166
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
unsigned int fFillNumber
Definition: PixelLumiDQM.h:171
bool useInnerBarrelLayer
Definition: PixelLumiDQM.h:170
#define constexpr
std::vector< UInt_t > numB
Definition: PixelLumiDQM.h:108
MonitorElement * fHistClusByLS
Definition: PixelLumiDQM.h:163
std::vector< UInt_t > numFP
Definition: PixelLumiDQM.h:110
~PixelLumiDQM() override
Definition: PixelLumiDQM.cc:94
bool fIncludeVertexInfo
Definition: PixelLumiDQM.h:134
std::vector< double > dnumFM
Definition: PixelLumiDQM.h:112
MonitorElement * fHistnFMClusVsLS[2]
Definition: PixelLumiDQM.h:158
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fPixelClusterLabel
Definition: PixelLumiDQM.h:117
unsigned int calculateBunchMask(MonitorElement *, std::vector< bool > &)
static double rXSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:50
MonitorElement * fHistClusterCountByBxLastLumi
Definition: PixelLumiDQM.h:161
MonitorElement * fHistTotalRecordedLumiByLS
Definition: PixelLumiDQM.h:164
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
static double FREQ_ORBIT
Definition: PixelLumiDQM.h:42
std::vector< UInt_t > numFM
Definition: PixelLumiDQM.h:109
Double_t fNdof
Definition: PixelLumiDQM.h:131
static double XSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:47
MonitorElement * fHistClusterCountByBxCumulative
Definition: PixelLumiDQM.h:162
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * fHistnBClusVsLS[3]
Definition: PixelLumiDQM.h:156
Double_t fVtxY
Definition: PixelLumiDQM.h:128
UInt_t fNumVtxGood
Definition: PixelLumiDQM.h:125
std::vector< double > dnumB
Definition: PixelLumiDQM.h:111
double fMinClusterCharge
Definition: PixelLumiDQM.h:151
std::vector< bool > bunchTriggerMask
Definition: PixelLumiDQM.h:168
static double CM2_TO_NANOBARN
Definition: PixelLumiDQM.h:52
bool fIncludePixelClusterInfo
Definition: PixelLumiDQM.h:135
static double XSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:46
MonitorElement * fHistBunchCrossings
Definition: PixelLumiDQM.h:159
std::map< std::string, MonitorElement * > fHistContainerThisRun
Definition: PixelLumiDQM.h:139
MonitorElement * fHistBunchCrossingsLastLumi
Definition: PixelLumiDQM.h:160
UInt_t fNumTrkPerVtx
Definition: PixelLumiDQM.h:126
UInt_t fTimestamp
Definition: PixelLumiDQM.h:123
std::string fLogFileName_
Definition: PixelLumiDQM.h:172
PixelLumiDQM(const edm::ParameterSet &)
Definition: PixelLumiDQM.cc:48
static double rXSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:51
void analyze(const edm::Event &, const edm::EventSetup &) override
static size_t kNumLayers
Definition: PixelLumiDQM.h:76
std::map< int, PixelClusterCount > fNumPixelClusters
Definition: PixelLumiDQM.h:132
MonitorElement * fHistRecordedByBxLastLumi
Definition: PixelLumiDQM.h:165
int fMinPixelsPerCluster
Definition: PixelLumiDQM.h:148
static size_t kOffsetLayers
Definition: PixelLumiDQM.h:78
static size_t kNumDisks
Definition: PixelLumiDQM.h:77
Double_t fVtxX
Definition: PixelLumiDQM.h:127
MonitorElement * fHistnFPClusVsLS[2]
Definition: PixelLumiDQM.h:157
Definition: Run.h:44
Double_t fChi2
Definition: PixelLumiDQM.h:130
std::ofstream logFile_
Definition: PixelLumiDQM.h:174