33 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<
"[DTResolutionAnalysisTest]: Constructor";
48 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
49 <<
"DTResolutionAnalysisTest: analyzed " <<
nevents <<
" events";
53 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<
"[DTResolutionAnalysisTest]: BeginRun";
66 ibooker.
book2D(
"ResidualsGlbSummary",
"# of SLs with good mean and good sigma of residuals", 12, 1, 13, 5, -2, 3);
70 meanDistr[-2] = ibooker.
book1D(
"MeanDistr",
"Mean value of the residuals all (cm)", 100, -0.1, 0.1);
71 meanDistr[-1] = ibooker.
book1D(
"MeanDistr_Phi",
"Mean value of the residuals #phi SL (cm)", 100, -0.1, 0.1);
73 ibooker.
book1D(
"MeanDistr_ThetaWh0",
"Mean values of the residuals #theta SL Wh 0 (cm)", 100, -0.1, 0.1);
75 ibooker.
book1D(
"MeanDistr_ThetaWh1",
"Mean value of the residuals #theta SL Wh +/-1 (cm)", 100, -0.1, 0.1);
77 ibooker.
book1D(
"MeanDistr_ThetaWh2",
"Mean value of the residuals #theta SL Wh +/-2 (cm)", 100, -0.1, 0.1);
79 for (
int wh = -2; wh <= 2; wh++) {
82 for (
int st = 1; st <= 4; st++) {
85 for (
int sl = 1; sl <= 3; sl++) {
86 if (sl == 2 && st == 4)
89 string histoLabel =
"MeanDistr";
90 string histoName = histoLabel +
"_W" + wheel.str() +
"_MB" + station.str() +
"_Phi";
91 string histoType = histoLabel +
"_Phi";
93 histoName = histoLabel +
"_W" + wheel.str() +
"_MB" + station.str() +
"_Theta";
94 histoType = histoLabel +
"_Theta";
99 histoLabel =
"SigmaDistr";
100 histoName = histoLabel +
"_W" + wheel.str() +
"_MB" + station.str() +
"_Phi";
101 histoType = histoLabel +
"_Phi";
103 histoName = histoLabel +
"_W" + wheel.str() +
"_MB" + station.str() +
"_Theta";
104 histoType = histoLabel +
"_Theta";
112 string histoTitle =
"# of SLs with good mean of residuals";
118 sigmaDistr[-2] = ibooker.
book1D(
"SigmaDistr",
"Sigma value of the residuals all (cm)", 50, 0.0, 0.2);
119 sigmaDistr[-1] = ibooker.
book1D(
"SigmaDistr_Phi",
"Sigma value of the residuals #phi SL (cm)", 50, 0.0, 0.2);
121 ibooker.
book1D(
"SigmaDistr_ThetaWh0",
"Sigma value of the residuals #theta SL Wh 0 (cm)", 50, 0.0, 0.2);
123 ibooker.
book1D(
"SigmaDistr_ThetaWh1",
"Sigma value of the residuals #theta SL Wh +/-1 (cm)", 50, 0.0, 0.2);
125 ibooker.
book1D(
"SigmaDistr_ThetaWh2",
"Sigma value of the residuals #theta SL Wh +/-2 (cm)", 50, 0.0, 0.2);
127 histoTitle =
"# of SLs with good sigma of residuals";
133 for (
int wheel = -2; wheel <= 2; wheel++) {
135 for (
int sector = 1; sector <= 12; sector++) {
143 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
144 <<
"[DTResolutionAnalysisTest]: Base folder " <<
topHistoFolder <<
" does not exist. Skipping client operation."
152 LogTrace(
"DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
153 <<
"[DTResolutionAnalysisTest]: End of Run transition, performing the DQM client operation" << endl;
158 for (vector<const DTChamber*>::const_iterator ch_it =
muonGeom->
chambers().begin();
165 for (vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
166 sl_it != (*ch_it)->superLayers().end();
173 float statMean = res_histo->
getMean(1);
174 float statSigma = res_histo->
getRMS(1);
177 TH1F* histo_root = res_histo->
getTH1F();
181 int binSect = slID.
sector();
184 else if (slID.
sector() == 14)
194 if (histo_root->GetEntries() > 20) {
195 TF1* gfit =
new TF1(
"Gaussian",
"gaus", (statMean - (2 * statSigma)), (statMean + (2 * statSigma)));
197 histo_root->Fit(gfit,
"Q0 SERIAL",
"", -0.1, 0.1);
199 LogWarning(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
200 <<
"[DTResolutionAnalysisTask]: Exception when fitting SL : " << slID;
203 if ((binSect == 4 || binSect == 10) && slID.
station() == 4)
211 mean = gfit->GetParameter(1);
212 sigma = gfit->GetParameter(2);
225 string histoType =
"MeanDistr_Phi";
227 histoType =
"MeanDistr_Theta";
230 histoType =
"SigmaDistr_Phi";
232 histoType =
"SigmaDistr_Theta";
236 MeanHistos[make_pair(slID.
wheel(), binSect)]->setBinContent(binSL, mean);
239 if ((slID.
sector() == 13 || slID.
sector() == 14) && binSL == 12)
241 if ((slID.
sector() == 13 || slID.
sector() == 14) && binSL == 13)
260 if ((binSect == 4 || binSect == 10) && slID.
station() == 4)
279 LogVerbatim(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
280 <<
"[DTResolutionAnalysisTask] Fit of " << slID <<
" not performed because # entries < 20 ";
283 if ((binSect == 4 || binSect == 10) && slID.
station() == 4)
292 LogWarning(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
293 <<
"[DTResolutionAnalysisTask] Histo: " <<
getMEName(slID) <<
" not found" << endl;
304 string histoName =
"MeanSummaryRes_W" + wheel.str();
305 string histoTitle =
"# of SLs with wrong mean of residuals (Wheel " + wheel.str() +
")";
322 histoName =
"SigmaSummaryRes_W" + wheel.str();
323 histoTitle =
"# of SLs with wrong sigma of residuals (Wheel " + wheel.str() +
")";
346 string MeanHistoName =
"MeanTest_W" + wheel.str() +
"_Sec" + sector.str();
347 string SigmaHistoName =
"SigmaTest_W" + wheel.str() +
"_Sec" + sector.str();
352 if (sect != 4 && sect != 10) {
355 ibooker.
book1D(MeanHistoName.c_str(),
"Mean (from gaussian fit) of the residuals distribution", 11, 1, 12);
358 ibooker.
book1D(MeanHistoName.c_str(),
"Mean (from gaussian fit) of the residuals distribution", 13, 1, 14);
360 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(1,
"MB1_SL1", 1);
361 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(2,
"MB1_SL2", 1);
362 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(3,
"MB1_SL3", 1);
363 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(4,
"MB2_SL1", 1);
364 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(5,
"MB2_SL2", 1);
365 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(6,
"MB2_SL3", 1);
366 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(7,
"MB3_SL1", 1);
367 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(8,
"MB3_SL2", 1);
368 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(9,
"MB3_SL3", 1);
369 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(10,
"MB4_SL1", 1);
370 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(11,
"MB4_SL3", 1);
372 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S13_SL1", 1);
373 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S13_SL3", 1);
376 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S14_SL1", 1);
377 (
MeanHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S14_SL3", 1);
380 if (sect != 4 && sect != 10) {
382 ibooker.
book1D(SigmaHistoName.c_str(),
"Sigma (from gaussian fit) of the residuals distribution", 11, 1, 12);
385 ibooker.
book1D(SigmaHistoName.c_str(),
"Sigma (from gaussian fit) of the residuals distribution", 13, 1, 14);
387 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(1,
"MB1_SL1", 1);
388 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(2,
"MB1_SL2", 1);
389 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(3,
"MB1_SL3", 1);
390 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(4,
"MB2_SL1", 1);
391 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(5,
"MB2_SL2", 1);
392 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(6,
"MB2_SL3", 1);
393 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(7,
"MB3_SL1", 1);
394 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(8,
"MB3_SL2", 1);
395 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(9,
"MB3_SL3", 1);
396 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(10,
"MB4_SL1", 1);
397 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(11,
"MB4_SL3", 1);
399 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S13_SL1", 1);
400 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S13_SL3", 1);
403 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(12,
"MB4S14_SL1", 1);
404 (
SigmaHistos[make_pair(wh, sect)])->setBinLabel(13,
"MB4S14_SL3", 1);
410 wheel << slID.
wheel();
415 stringstream superLayer;
419 topHistoFolder +
"/Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str() +
"/";
423 "DT/DTCalibValidation/Wheel" + wheel.str() +
"/Station" + station.str() +
"/Sector" + sector.str() +
"/";
425 string histoname = folderName +
"hResDist" +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
426 "_SL" + superLayer.str();
429 histoname = folderName +
"hResDist_STEP3" +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
430 "_SL" + superLayer.str();
439 if (ret == 0 || bin == 11)
474 (*histo).second->Reset();
478 (*histo).second->Reset();
481 for (
int indx = -2; indx != 3; ++indx) {
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
tuple ret
prodAgent to be discontinued
std::map< int, MonitorElement * > meanDistr
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
void bookHistos(DQMStore::IBooker &)
std::map< int, MonitorElement * > wheelMeanHistos
double meanInRange(double mean) const
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
DTResolutionAnalysisTest(const edm::ParameterSet &ps)
Constructor.
virtual void setCurrentFolder(std::string const &fullpath)
virtual TH1F * getTH1F() const
std::string getMEName(const DTSuperLayerId &slID)
Get the ME name.
virtual bool dirExists(std::string const &path) const
~DTResolutionAnalysisTest() override
Destructor.
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
bool getData(T &iHolder) const
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
BeginRun.
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
MonitorElement * globalResSummary
virtual MonitorElement * get(std::string const &fullpath) const
Abs< T >::type abs(const T &t)
int superLayer() const
Return the superlayer number.
std::map< int, MonitorElement * > wheelSigmaHistos
int superlayer() const
Return the superlayer number (deprecated method name)
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
int slFromBin(int bin) const
std::map< int, MonitorElement * > sigmaDistr
int stationFromBin(int bin) const
const DTGeometry * muonGeom
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
double sigmaInRange(double sigma) const
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Log< level::Warning, false > LogWarning
int station() const
Return the station number.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
int wheel() const
Return the wheel number.
std::string topHistoFolder
std::map< int, std::map< int, std::map< std::string, MonitorElement * > > > wheelRingHistos