38 LogVerbatim (
"DTDQM|DTMonitorClient|DTRunConditionVarClient")
39 <<
"DTRunConditionVarClient: Constructor called";
65 LogVerbatim (
"DTDQM|DTMonitorClient|DTRunConditionVarClient")
66 <<
"DTRunConditionVarClient: Destructor called";
71 LogTrace (
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<
"[DTRunConditionVarClient]: BeginRun";
87 LogVerbatim (
"DTDQM|DTMonitorClient|DTRunConditionVarClient")
88 <<
"DTRunConditionVarClient: end job";
92 glbVDriftSummary = ibooker.
book2D(
"VDriftGlbSummary",
"# of MBs with good mean and good sigma of vDrift",12,1,13,5,-2,3);
93 glbT0Summary = ibooker.
book2D(
"T0GlbSummary",
"# of MBs with good mean and good sigma of t0",12,1,13,5,-2,3);
97 summaryHistos[
"MeanVDriftGlbSummary"] = ibooker.
book2D(
"MeanVDriftGlbSummary",
"mean VDrift average per sector",12,1.,13.,5,-2.,3.);
98 allwheelHistos[
"allMeanVDrift"] = ibooker.
book1D(
"VDriftMeanAllWheels",
"mean VDrift for all chambers",60,0.0048,0.006);
102 summaryHistos[
"SigmaVDriftGlbSummary"] = ibooker.
book2D(
"SigmaVDriftGlbSummary",
"# of Chambers with good sigma VDrift",12,1.,13.,5,-2.,3.);
103 allwheelHistos[
"allSigmaVDrift"] = ibooker.
book1D(
"VDriftSigmaAllWheels",
"sigma VDrift for all chambers",30,0.,0.0006);
107 summaryHistos[
"MeanT0GlbSummary"] = ibooker.
book2D(
"MeanT0GlbSummary",
"mean T0 average per sector",12,1.,13.,5,-2.,3.);
108 allwheelHistos[
"allMeanT0"] = ibooker.
book1D(
"T0MeanAllWheels",
"mean T0 for all chambers",100,-25.,25.);
112 summaryHistos[
"SigmaT0GlbSummary"] = ibooker.
book2D(
"SigmaT0GlbSummary",
"# of Chambers with good sigma T0",12,1.,13.,5,-2.,3.);
113 allwheelHistos[
"allSigmaT0"] = ibooker.
book1D(
"T0SigmaAllWheels",
"sigma T0 for alla chambers",50,0,25);
115 for(
int wh=-2; wh<=2; wh++) {
116 bookWheelHistos(ibooker,
"MeanVDrift",
"02-MeanVDrift",wh,60,0.0048,0.006,
true);
117 bookWheelHistos(ibooker,
"SigmaVDrift",
"02-SigmaVDrift",wh,30,0.,0.0006);
118 bookWheelHistos(ibooker,
"MeanT0",
"03-MeanT0",wh,100,-25.,25.);
119 bookWheelHistos(ibooker,
"SigmaT0",
"03-SigmaT0",wh,50,0,25);
124 for(
int sec=1; sec<=14; sec++) {
127 if( (sec == 13 || sec == 14) &&
stat != 4 )
continue;
133 if (!VDriftME || !T0ME) {
134 edm::LogWarning(
"DTRunConditionVarClient") <<
"ME not available" << std::endl;
140 float vDriftMean = VDriftME->
getMean();
141 float t0Mean = T0ME->
getMean();
144 float vDriftSigma = VDriftME->
getRMS();
145 float t0Sigma = T0ME->
getRMS();
149 allwheelHistos[
"allMeanVDrift"] ->
Fill(vDriftMean);
150 allwheelHistos[
"allSigmaVDrift"] ->
Fill(vDriftSigma);
152 (wheelHistos[
wheel])[
"MeanVDrift"] ->
Fill(vDriftMean);
153 (wheelHistos[
wheel])[
"SigmaVDrift"] ->
Fill(vDriftSigma);
160 allwheelHistos[
"allMeanT0"] ->
Fill(t0Mean);
161 allwheelHistos[
"allSigmaT0"] ->
Fill(t0Sigma);
163 (wheelHistos[
wheel])[
"MeanT0"] ->
Fill(t0Mean);
164 (wheelHistos[
wheel])[
"SigmaT0"] ->
Fill(t0Sigma);
170 float vDriftDev(0.), errvDriftDev(0.);
171 percDevVDrift(indexCh, vDriftMean, vDriftSigma, vDriftDev, errvDriftDev);
174 if( sec == 13 || sec == 14 ) sec_ = ( sec == 13 ) ? 4 : 10;
176 float fillvDriftDev =
max(
min(vDriftDev,maxRangeVDrift),minRangeVDrift);
177 float fillT0Mean =
max(
min(t0Mean,maxRangeT0),minRangeT0);
179 float vDriftDevQ = varQuality(fabs(vDriftDev),maxGoodVDriftDev,minBadVDriftDev);
180 float t0MeanQ = varQuality(fabs(t0Mean),maxGoodT0,minBadT0);
182 float vDriftSigmQ = varQuality(vDriftSigma,maxGoodVDriftSigma,minBadVDriftSigma);
183 float t0SigmQ = varQuality(t0Sigma,maxGoodT0Sigma,minBadT0Sigma);
185 if( sec == 13 || sec == 14 ) {
187 float binVDriftDev = (wheelHistos[
wheel])[
"MeanVDriftSummary"]->getBinContent(sec_,
stat);
188 binVDriftDev = (fabs(binVDriftDev) > fabs(fillvDriftDev)) ? binVDriftDev : fillvDriftDev;
189 (wheelHistos[
wheel])[
"MeanVDriftSummary"] -> setBinContent(sec_,
stat,binVDriftDev);
191 float binT0MeanVal = (wheelHistos[
wheel])[
"MeanT0Summary"] -> getBinContent(sec_,
stat);
192 binT0MeanVal = (fabs(binT0MeanVal) > fabs(fillT0Mean)) ? binT0MeanVal : fillT0Mean;
193 (wheelHistos[
wheel])[
"MeanT0Summary"] -> setBinContent(sec_,
stat,binT0MeanVal);
195 float binVDriftSigmVal = (wheelHistos[
wheel])[
"SigmaVDriftSummary"] -> getBinContent(sec_,
stat);
196 binVDriftSigmVal = (binVDriftSigmVal > 0. && binVDriftSigmVal < vDriftSigmQ) ? binVDriftSigmVal : vDriftSigmQ;
197 (wheelHistos[
wheel])[
"SigmaVDriftSummary"] -> setBinContent(sec_,
stat,binVDriftSigmVal);
199 float binT0SigmVal = (wheelHistos[
wheel])[
"SigmaT0Summary"] -> getBinContent(sec_,
stat);
200 binT0SigmVal = (binT0SigmVal > 0. && binT0SigmVal < t0SigmQ) ? binT0SigmVal : t0SigmQ;
201 (wheelHistos[
wheel])[
"SigmaT0Summary"] -> setBinContent(sec_,
stat,binT0SigmVal);
205 (wheelHistos[
wheel])[
"MeanVDriftSummary"] -> setBinContent(sec_,
stat,fillvDriftDev);
206 (wheelHistos[
wheel])[
"MeanT0Summary"] -> setBinContent(sec_,
stat,fillT0Mean);
207 (wheelHistos[
wheel])[
"SigmaVDriftSummary"] -> setBinContent(sec_,
stat,vDriftSigmQ);
208 (wheelHistos[
wheel])[
"SigmaT0Summary"] -> setBinContent(sec_,
stat,t0SigmQ);
213 if(( sec_ == 4 || sec_ == 10) &&
stat == 4) weight = 1/8.;
215 if( vDriftDevQ > 0.85 && vDriftSigmQ > 0.85 ) {
216 glbVDriftSummary ->
Fill(sec_,
wheel,weight);
217 summaryHistos[
"MeanVDriftGlbSummary"] ->
Fill(sec_,
wheel,weight);
218 summaryHistos[
"SigmaVDriftGlbSummary"] ->
Fill(sec_,
wheel,weight);
221 if( vDriftDevQ > 0.85 && vDriftSigmQ < 0.85 ) {
222 summaryHistos[
"MeanVDriftGlbSummary"] ->
Fill(sec_,
wheel,weight);
224 if( vDriftDevQ < 0.85 && vDriftSigmQ > 0.85 ) {
225 summaryHistos[
"SigmaVDriftGlbSummary"] ->
Fill(sec_,
wheel,weight);
229 if( t0MeanQ > 0.85 && t0SigmQ > 0.85 ) {
231 summaryHistos[
"MeanT0GlbSummary"] ->
Fill(sec_,
wheel,weight);
232 summaryHistos[
"SigmaT0GlbSummary"] ->
Fill(sec_,
wheel,weight);
234 if( t0MeanQ > 0.85 && t0SigmQ < 0.85 ) {
235 summaryHistos[
"MeanT0GlbSummary"] ->
Fill(sec_,
wheel,weight);
238 if( t0MeanQ < 0.85 && t0SigmQ > 0.85 ) {
239 summaryHistos[
"SigmaT0GlbSummary"] ->
Fill(sec_,
wheel,weight);
254 if( var <= maxGood ) {qual = 1.;}
255 else if( var > maxGood && var < minBad ) {qual = 0.9;}
256 else if( var >= minBad ) {qual = 0.1;}
266 float vDriftPhi1(0.), vDriftPhi2(0.);
267 float ResPhi1(0.), ResPhi2(0.);
271 if(status1 != 0 || status2 != 0) {
273 throw cms::Exception(
"DTRunConditionVarClient") <<
"Could not find vDrift entry in DB for" 277 float vDriftMed = (vDriftPhi1 + vDriftPhi2) / 2.;
279 devVD = (meanVD - vDriftMed) / vDriftMed;
280 devVD = devVD < 1. ? devVD : 1.;
282 errdevVD = sigmaVD/vDriftMed;
288 int wh,
int nbins,
float min,
float max,
bool isVDCorr )
290 stringstream
wheel; wheel << wh;
292 string folder =
"DT/02-Segments/" + subfolder;
296 string histoName = histoType +
"_W" + wheel.str();
299 (wheelHistos[wh])[histoType] = ibooker.
book1D(histoName, histoLabel, nbins, min, max);
302 histoLabel =
"Summary of corrections to VDrift DB values";
303 histoName =
"CorrTo" + histoType +
"Summary_W" + wheel.str();
305 histoLabel = histoType +
"Summary";
306 histoName = histoType +
"Summary_W" + wheel.str();
317 (wheelHistos[wh])[histoType +
"Summary"] = me;
324 int wh = dtCh.
wheel();
327 stringstream
wheel; wheel << wh;
328 stringstream
station; station << st;
329 stringstream sector; sector <<
sc;
331 string folder =
"DT/02-Segments/Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str();
332 string histoTag =
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
333 string MEpath = folder +
"/" + histoType + histoTag;
337 LogTrace (
"DTDQM|DTMonitorModule|DTRunConditionVar")
338 <<
"[DTRunConditionVar]: getting ME from " << folder << endl;
T getUntrackedParameter(std::string const &, T const &) const
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
DQM Client Diagnostic.
MonitorElement * getChamberHistos(DQMStore::IGetter &, const DTChamberId &, std::string)
MonitorElement * get(const std::string &path)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
float varQuality(float var, float maxGood, float minBad)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void percDevVDrift(DTChamberId indexCh, float meanVD, float sigmaVD, float &devVD, float &errdevVD)
MonitorElement * book1D(Args &&...args)
EventID const & min(EventID const &lh, EventID const &rh)
DTRunConditionVarClient(const edm::ParameterSet &ps)
Constructor.
void bookWheelHistos(DQMStore::IBooker &, std::string histoType, std::string subfolder, int wh, int nbins, float min, float max, bool isVDCorr=false)
book the report summary
double getEntries() const
get # of entries
void setCurrentFolder(const std::string &fullpath)
~DTRunConditionVarClient() override
Destructor.
MonitorElement * book2D(Args &&...args)
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
void setCurrentFolder(const std::string &fullpath)
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
int station() const
Return the station number.
int wheel() const
Return the wheel number.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
EventID const & max(EventID const &lh, EventID const &rh)