CMS 3D CMS Logo

BeamSpotDipServer.h
Go to the documentation of this file.
1 #ifndef DQM_BeamMonitor__BeamSpotDipServer_h
2 #define DQM_BeamMonitor__BeamSpotDipServer_h
3 
8 
10 
13 
16 
19 
20 #include <string>
21 #include <bits/stdc++.h>
22 
23 class DipFactory;
24 class DipData;
25 class DipPublication;
26 
27 class LuminosityBlock;
28 
30 public:
31  explicit BeamSpotDipServer(const edm::ParameterSet&);
32 
33 protected:
34  void bookHistograms(DQMStore::IBooker&, const edm::Run&, const edm::EventSetup&) override;
35  void dqmBeginRun(const edm::Run& r, const edm::EventSetup&) override;
36  void analyze(const edm::Event& e, const edm::EventSetup&) override;
37  void dqmBeginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup&) override;
38  void dqmEndLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup&) override;
39  void dqmEndRun(const edm::Run&, const edm::EventSetup& iSetup) override;
40 
41 private:
44 
45  std::vector<std::string> parse(std::string line, const std::string& delimiter);
47 
48  bool readRcd(const BeamSpotOnlineObjects& bs); // read from database
49  bool readRcd(std::ifstream& file); // read from NFS
50 
51  void problem();
52  void CMS2LHCRF_POS(float x, float y, float z);
53 
54  void trueRcd();
55  void fakeRcd();
56  void publishRcd(std::string qlty, std::string err, bool pubCMS, bool fitTime);
57 
59  std::string getDateTime(long epoch);
60 
61  // constants
62  const char* qualities[3] = {"Uncertain", "Bad", "Good"};
63  const bool publishStatErrors = true;
64  const int rad2urad = 1000000;
65  const int cm2um = 10000;
66  const int cm2mm = 10;
67  const int intLS = 1; // for CMS scaler
68 
69  // variables
70  long lastFitTime = 0;
71  long lastModTime = 0;
72  std::bitset<8> alive;
73  int lsCount = 0;
74  int currentLS = 0;
75 
76  // DIP objects
77  DipFactory* dip;
78  DipData* messageCMS;
79  DipData* messageLHC;
80  DipData* messagePV;
81  DipPublication* publicationCMS;
82  DipPublication* publicationLHC;
83  DipPublication* publicationPV;
84 
85  // initial values of beamspot object
86  int runnum;
89  time_t startTimeStamp = 0;
90  time_t endTimeStamp = 0;
92  std::string quality = "Uncertain";
93  int type = -1;
94  float x = 0;
95  float y = 0;
96  float z = 0;
97  float dxdz = 0;
98  float dydz = 0;
99  float err_x = 0;
100  float err_y = 0;
101  float err_z = 0;
102  float err_dxdz = 0;
103  float err_dydz = 0;
104  float width_x = 0;
105  float width_y = 0;
106  float sigma_z = 0;
107  float err_width_x = 0;
108  float err_width_y = 0;
109  float err_sigma_z = 0;
110 
111  // added for PV information
112  int events = 0;
113  float meanPV = 0;
114  float err_meanPV = 0;
115  float rmsPV = 0;
116  float err_rmsPV = 0;
117  int maxPV = 0;
118  int nPV = 0;
119 
120  //
121  float Size[3];
122  float Centroid[3];
123  float Tilt[2];
124 
125  // tracker status
128 
129  int lastlumi = -1;
130  bool wholeTrackerOn = false;
131 
132  // online beamspot
134 
135  // inputs
136  bool verbose;
137  bool testing;
138 
142 
144 
147 
148  std::vector<int> timeoutLS;
149 };
150 
151 #endif
BeamSpotDipServer::messageLHC
DipData * messageLHC
Definition: BeamSpotDipServer.h:79
BeamSpotDipServer::lumiRange
std::string lumiRange
Definition: BeamSpotDipServer.h:91
BeamSpotDipServer::messageCMS
DipData * messageCMS
Definition: BeamSpotDipServer.h:78
BeamSpotDipServer::Centroid
float Centroid[3]
Definition: BeamSpotDipServer.h:122
BeamSpotDipServer::sourceFile1
std::string sourceFile1
Definition: BeamSpotDipServer.h:146
BeamSpotDipServer::wholeTrackerOn
bool wholeTrackerOn
Definition: BeamSpotDipServer.h:130
BeamSpotDipServer::subjectLHC
std::string subjectLHC
Definition: BeamSpotDipServer.h:140
BeamSpotDipServer::err_dydz
float err_dydz
Definition: BeamSpotDipServer.h:103
ESHandle.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
makeHLTPrescaleTable.delimiter
delimiter
Definition: makeHLTPrescaleTable.py:181
edm::Run
Definition: Run.h:45
BeamSpotDipServer::endTime
std::string endTime
Definition: BeamSpotDipServer.h:88
edm::EDGetTokenT< DCSRecord >
BeamSpotDipServer::dcsRecordInputTag_
edm::InputTag dcsRecordInputTag_
Definition: BeamSpotDipServer.h:126
BeamSpotDipServer::problem
void problem()
Definition: BeamSpotDipServer.cc:323
BeamSpotDipServer::Size
float Size[3]
Definition: BeamSpotDipServer.h:121
BeamSpotDipServer::x
float x
Definition: BeamSpotDipServer.h:94
BeamSpotDipServer::subjectCMS
std::string subjectCMS
Definition: BeamSpotDipServer.h:139
BeamSpotDipServer::maxPV
int maxPV
Definition: BeamSpotDipServer.h:117
DQMStore.h
BeamSpotDipServer
Definition: BeamSpotDipServer.h:29
BeamSpotDipServer::meanPV
float meanPV
Definition: BeamSpotDipServer.h:113
BeamSpotOnlineLegacyObjectsRcd.h
BeamSpotDipServer::alive
std::bitset< 8 > alive
Definition: BeamSpotDipServer.h:72
BeamSpotOnline.h
BeamSpotDipServer::tkStatus
std::string tkStatus()
Definition: BeamSpotDipServer.cc:271
BeamSpotDipServer::width_x
float width_x
Definition: BeamSpotDipServer.h:104
BeamSpotDipServer::readFromNFS
bool readFromNFS
Definition: BeamSpotDipServer.h:143
BeamSpotDipServer::getFileSize
long getFileSize(std::string filename)
Definition: BeamSpotDipServer.cc:239
BeamSpotDipServer::z
float z
Definition: BeamSpotDipServer.h:96
BeamSpotDipServer::dqmEndRun
void dqmEndRun(const edm::Run &, const edm::EventSetup &iSetup) override
Definition: BeamSpotDipServer.cc:223
ESGetToken.h
DQMOneEDAnalyzer.h
BeamSpotDipServer::dydz
float dydz
Definition: BeamSpotDipServer.h:98
BeamSpotDipServer::startTimeStamp
time_t startTimeStamp
Definition: BeamSpotDipServer.h:89
BeamSpotDipServer::BeamSpotDipServer
BeamSpotDipServer(const edm::ParameterSet &)
Definition: BeamSpotDipServer.cc:34
BeamSpotDipServer::verbose
bool verbose
Definition: BeamSpotDipServer.h:136
BeamSpotDipServer::CMS2LHCRF_POS
void CMS2LHCRF_POS(float x, float y, float z)
Definition: BeamSpotDipServer.cc:589
BeamSpotDipServer::currentLS
int currentLS
Definition: BeamSpotDipServer.h:74
cms::cuda::bs
bs
Definition: HistoContainer.h:76
BeamSpotDipServer::endTimeStamp
time_t endTimeStamp
Definition: BeamSpotDipServer.h:90
BeamSpotDipServer::err_meanPV
float err_meanPV
Definition: BeamSpotDipServer.h:114
BeamSpotDipServer::err_z
float err_z
Definition: BeamSpotDipServer.h:101
BeamSpotDipServer::getDateTime
std::string getDateTime()
Definition: BeamSpotDipServer.cc:769
BeamSpotDipServer::lastlumi
int lastlumi
Definition: BeamSpotDipServer.h:129
BeamSpotDipServer::testing
bool testing
Definition: BeamSpotDipServer.h:137
LuminosityBlock
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
BeamSpotDipServer::dqmBeginLuminosityBlock
void dqmBeginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &) override
Definition: BeamSpotDipServer.cc:97
BeamSpotDipServer::timeoutLS
std::vector< int > timeoutLS
Definition: BeamSpotDipServer.h:148
BeamSpotDipServer::parse
std::vector< std::string > parse(std::string line, const std::string &delimiter)
Definition: BeamSpotDipServer.cc:253
BeamSpotDipServer::subjectPV
std::string subjectPV
Definition: BeamSpotDipServer.h:141
BeamSpotDipServer::bsLegacyToken_
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineLegacyObjectsRcd > bsLegacyToken_
Definition: BeamSpotDipServer.h:133
BeamSpotDipServer::messagePV
DipData * messagePV
Definition: BeamSpotDipServer.h:80
BeamSpotDipServer::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &) override
Definition: BeamSpotDipServer.cc:128
BeamSpotDipServer::fakeRcd
void fakeRcd()
Definition: BeamSpotDipServer.cc:686
geometryDiff.file
file
Definition: geometryDiff.py:13
BeamSpotDipServer::err_dxdz
float err_dxdz
Definition: BeamSpotDipServer.h:102
edm::ParameterSet
Definition: ParameterSet.h:47
DQMOneLumiEDAnalyzer
Definition: DQMOneEDAnalyzer.h:90
BeamSpotDipServer::publishRcd
void publishRcd(std::string qlty, std::string err, bool pubCMS, bool fitTime)
Definition: BeamSpotDipServer.cc:708
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
BeamSpotDipServer::sourceFile
std::string sourceFile
Definition: BeamSpotDipServer.h:145
BeamSpotDipServer::publishStatErrors
const bool publishStatErrors
Definition: BeamSpotDipServer.h:63
BeamSpotDipServer::err_width_y
float err_width_y
Definition: BeamSpotDipServer.h:108
BeamSpotDipServer::width_y
float width_y
Definition: BeamSpotDipServer.h:105
BeamSpotDipServer::dqmBeginRun
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &) override
Definition: BeamSpotDipServer.cc:67
edm::EventSetup
Definition: EventSetup.h:58
BeamSpotDipServer::analyze
void analyze(const edm::Event &e, const edm::EventSetup &) override
Definition: BeamSpotDipServer.cc:102
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
BeamSpotDipServer::publicationCMS
DipPublication * publicationCMS
Definition: BeamSpotDipServer.h:81
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineLegacyObjectsRcd >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BeamSpotDipServer::runnum
int runnum
Definition: BeamSpotDipServer.h:86
BeamSpotDipServer::err_rmsPV
float err_rmsPV
Definition: BeamSpotDipServer.h:116
alignCSCRings.r
r
Definition: alignCSCRings.py:93
BeamSpotDipServer::lastModTime
long lastModTime
Definition: BeamSpotDipServer.h:71
BeamSpotDipServer::err_y
float err_y
Definition: BeamSpotDipServer.h:100
BeamSpotDipServer::sigma_z
float sigma_z
Definition: BeamSpotDipServer.h:106
BeamSpotDipServer::dxdz
float dxdz
Definition: BeamSpotDipServer.h:97
BeamSpotDipServer::cm2mm
const int cm2mm
Definition: BeamSpotDipServer.h:66
BeamSpotDipServer::err_x
float err_x
Definition: BeamSpotDipServer.h:99
Frameworkfwd.h
BeamSpotDipServer::bookHistograms
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
Definition: BeamSpotDipServer.cc:62
BeamSpotOnlineObjects
Definition: BeamSpotOnlineObjects.h:25
BeamSpotDipServer::publicationLHC
DipPublication * publicationLHC
Definition: BeamSpotDipServer.h:82
BeamSpotDipServer::Tilt
float Tilt[2]
Definition: BeamSpotDipServer.h:123
BeamSpotDipServer::lastFitTime
long lastFitTime
Definition: BeamSpotDipServer.h:70
BeamSpotDipServer::rmsPV
float rmsPV
Definition: BeamSpotDipServer.h:115
BeamSpotDipServer::quality
std::string quality
Definition: BeamSpotDipServer.h:92
BeamSpotDipServer::trueRcd
void trueRcd()
Definition: BeamSpotDipServer.cc:620
EventSetup.h
BeamSpotDipServer::events
int events
Definition: BeamSpotDipServer.h:112
BeamSpotDipServer::dcsRecordToken_
edm::EDGetTokenT< DCSRecord > dcsRecordToken_
Definition: BeamSpotDipServer.h:127
BeamSpotDipServer::getLastTime
time_t getLastTime(std::string filename)
Definition: BeamSpotDipServer.cc:246
BeamSpotDipServer::nPV
int nPV
Definition: BeamSpotDipServer.h:118
dqm::implementation::IBooker
Definition: DQMStore.h:43
DCSRecord.h
BeamSpotOnlineObjects.h
BeamSpotDipServer::err_sigma_z
float err_sigma_z
Definition: BeamSpotDipServer.h:109
BeamSpotDipServer::y
float y
Definition: BeamSpotDipServer.h:95
ParameterSet.h
BeamSpotDipServer::err_width_x
float err_width_x
Definition: BeamSpotDipServer.h:107
edm::Event
Definition: Event.h:73
BeamSpotDipServer::publicationPV
DipPublication * publicationPV
Definition: BeamSpotDipServer.h:83
mps_splice.line
line
Definition: mps_splice.py:76
BeamSpotDipServer::dip
DipFactory * dip
Definition: BeamSpotDipServer.h:77
edm::InputTag
Definition: InputTag.h:15
BeamSpotDipServer::intLS
const int intLS
Definition: BeamSpotDipServer.h:67
BeamSpotDipServer::readRcd
bool readRcd(const BeamSpotOnlineObjects &bs)
Definition: BeamSpotDipServer.cc:362
BeamSpotDipServer::rad2urad
const int rad2urad
Definition: BeamSpotDipServer.h:64
BeamSpotDipServer::startTime
std::string startTime
Definition: BeamSpotDipServer.h:87
BeamSpotDipServer::cm2um
const int cm2um
Definition: BeamSpotDipServer.h:65
BeamSpotDipServer::qualities
const char * qualities[3]
Definition: BeamSpotDipServer.h:62
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
BeamSpotDipServer::lsCount
int lsCount
Definition: BeamSpotDipServer.h:73