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();
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  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
59  virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const&) override;
60  virtual void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
61  virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
62  virtual void beginLuminosityBlock(edm::LuminosityBlock const&,
63  edm::EventSetup const&) override;
64  virtual void endLuminosityBlock(edm::LuminosityBlock const&,
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 size_t const kNumLayers = 3;
77  static size_t const kNumDisks = 2;
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  }
93  void Reset()
94  {
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  private:
113  };
114 
116 
117  UInt_t fRunNo;
118  UInt_t fEvtNo;
119  UInt_t fLSNo;
120  UInt_t fBXNo;
121  UInt_t fTimestamp;
122  UInt_t fNumVtx;
123  UInt_t fNumVtxGood;
125  Double_t fVtxX;
126  Double_t fVtxY;
127  Double_t fVtxZ;
128  Double_t fChi2;
129  Double_t fNdof;
130  std::map<int, PixelClusterCount> fNumPixelClusters;
131 
136 
137  std::map<std::string, MonitorElement*> fHistContainerThisRun;
138 
139  // This is a list of modules to be ignored, either because they were
140  // dead or are dead in part of the data-taking period.
141  std::vector<uint32_t> fDeadModules;
142 
143  // The minimum number of pixels that should live in a cluster in
144  // order for the cluster to be counted as a real cluster
145  // (as opposed to, e.g., a noise pixel).
147 
148  // The minimum pixel cluster charge for a cluster to be counted.
150 
151  // Use the module label to distinguish the three different streams.
152 
165 
166  std::vector<bool> bunchTriggerMask;
169  unsigned int fFillNumber;
171 
172  std::ofstream logFile_;
173 };
174 
175 #endif
UInt_t fNumVtx
Definition: PixelLumiDQM.h:122
bool fIncludePixelQualCheckHistos
Definition: PixelLumiDQM.h:134
static double SECONDS_PER_LS
Definition: PixelLumiDQM.h:43
unsigned int filledAndUnmaskedBunches
Definition: PixelLumiDQM.h:167
MonitorElement * fIntActiveCrossingsFromDB
Definition: PixelLumiDQM.h:153
virtual void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
static const unsigned int lastBunchCrossing
Definition: PixelLumiDQM.h:53
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< uint32_t > fDeadModules
Definition: PixelLumiDQM.h:141
std::vector< double > dnumFP
Definition: PixelLumiDQM.h:111
Double_t fVtxZ
Definition: PixelLumiDQM.h:127
int fResetIntervalInLumiSections
Definition: PixelLumiDQM.h:135
MonitorElement * fHistRecordedByBxCumulative
Definition: PixelLumiDQM.h:164
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
unsigned int fFillNumber
Definition: PixelLumiDQM.h:169
bool useInnerBarrelLayer
Definition: PixelLumiDQM.h:168
#define constexpr
std::vector< UInt_t > numB
Definition: PixelLumiDQM.h:106
MonitorElement * fHistClusByLS
Definition: PixelLumiDQM.h:161
std::vector< UInt_t > numFP
Definition: PixelLumiDQM.h:108
bool fIncludeVertexInfo
Definition: PixelLumiDQM.h:132
std::vector< double > dnumFM
Definition: PixelLumiDQM.h:110
MonitorElement * fHistnFMClusVsLS[2]
Definition: PixelLumiDQM.h:156
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fPixelClusterLabel
Definition: PixelLumiDQM.h:115
unsigned int calculateBunchMask(MonitorElement *, std::vector< bool > &)
static double rXSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:50
MonitorElement * fHistClusterCountByBxLastLumi
Definition: PixelLumiDQM.h:159
MonitorElement * fHistTotalRecordedLumiByLS
Definition: PixelLumiDQM.h:162
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual 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:107
Double_t fNdof
Definition: PixelLumiDQM.h:129
static double XSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:47
MonitorElement * fHistClusterCountByBxCumulative
Definition: PixelLumiDQM.h:160
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * fHistnBClusVsLS[3]
Definition: PixelLumiDQM.h:154
Double_t fVtxY
Definition: PixelLumiDQM.h:126
UInt_t fNumVtxGood
Definition: PixelLumiDQM.h:123
std::vector< double > dnumB
Definition: PixelLumiDQM.h:109
double fMinClusterCharge
Definition: PixelLumiDQM.h:149
std::vector< bool > bunchTriggerMask
Definition: PixelLumiDQM.h:166
static double CM2_TO_NANOBARN
Definition: PixelLumiDQM.h:52
bool fIncludePixelClusterInfo
Definition: PixelLumiDQM.h:133
static double XSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:46
MonitorElement * fHistBunchCrossings
Definition: PixelLumiDQM.h:157
std::map< std::string, MonitorElement * > fHistContainerThisRun
Definition: PixelLumiDQM.h:137
MonitorElement * fHistBunchCrossingsLastLumi
Definition: PixelLumiDQM.h:158
UInt_t fNumTrkPerVtx
Definition: PixelLumiDQM.h:124
UInt_t fTimestamp
Definition: PixelLumiDQM.h:121
std::string fLogFileName_
Definition: PixelLumiDQM.h:170
PixelLumiDQM(const edm::ParameterSet &)
Definition: PixelLumiDQM.cc:48
static double rXSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:51
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
std::map< int, PixelClusterCount > fNumPixelClusters
Definition: PixelLumiDQM.h:130
MonitorElement * fHistRecordedByBxLastLumi
Definition: PixelLumiDQM.h:163
int fMinPixelsPerCluster
Definition: PixelLumiDQM.h:146
Double_t fVtxX
Definition: PixelLumiDQM.h:125
static size_t const kNumDisks
Definition: PixelLumiDQM.h:77
MonitorElement * fHistnFPClusVsLS[2]
Definition: PixelLumiDQM.h:155
Definition: Run.h:42
Double_t fChi2
Definition: PixelLumiDQM.h:128
std::ofstream logFile_
Definition: PixelLumiDQM.h:172
static size_t const kNumLayers
Definition: PixelLumiDQM.h:76