1 |
< |
/*D |
1 |
> |
/* |
2 |
|
* See header file for a description of this class. |
3 |
|
* |
4 |
|
* $Date$ |
12 |
|
|
13 |
|
|
14 |
|
#include <UserCode/DTDPGAnalysis/src/DTDPGCreateSummary.h> |
15 |
+ |
#include "UserCode/DTDPGAnalysis/src/DTROUtility.h" |
16 |
|
|
17 |
|
// Framework |
18 |
|
#include <FWCore/Utilities/interface/Exception.h> |
43 |
|
#include "TProfile.h" |
44 |
|
#include "TStyle.h" |
45 |
|
#include "TFolder.h" |
46 |
+ |
#include "TText.h" |
47 |
|
#include "boost/filesystem.hpp" |
48 |
|
|
49 |
|
using namespace edm; |
59 |
|
|
60 |
|
// TCanvas c1("c1","",600,780); |
61 |
|
myCanvas = new TCanvas("c1", "",201,81,999,699); |
62 |
+ |
myCanvas->SetFillColor(0); |
63 |
|
|
64 |
|
gStyle->SetPalette(1); |
65 |
+ |
gStyle->SetStatColor(0); |
66 |
|
gStyle->SetStatX(0.99); |
67 |
|
gStyle->SetStatW(0.29); |
68 |
|
gStyle->SetStatY(0.98); |
69 |
|
gStyle->SetStatH(0.30); |
70 |
|
gStyle->SetTitleH(0.1); |
71 |
|
gStyle->SetTitleW(0.97); |
68 |
– |
gStyle->SetTitleH(0.1); |
72 |
|
|
73 |
+ |
|
74 |
+ |
gStyle->SetTitleFillColor(0); |
75 |
|
} |
76 |
|
|
77 |
|
DTDPGCreateSummary::~DTDPGCreateSummary(){ |
81 |
|
} |
82 |
|
|
83 |
|
|
84 |
< |
void DTDPGCreateSummary::beginJob(const edm::EventSetup& context){ |
84 |
> |
void DTDPGCreateSummary::beginJob(){ |
85 |
|
|
86 |
|
edm::LogVerbatim ("DTDPGSummary") << "[DTDPGCreateSummary]: BeginJob"; |
87 |
< |
context.get<MuonGeometryRecord>().get(myMuonGeom); |
87 |
> |
} |
88 |
|
|
84 |
– |
vector<int> emptyVector, wheelVector; |
85 |
– |
wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWhm2", emptyVector); |
86 |
– |
if (! wheelVector.empty()) mySectors[-2]=wheelVector; |
87 |
– |
wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWhm1", emptyVector); |
88 |
– |
if (! wheelVector.empty()) mySectors[-1]=wheelVector; |
89 |
– |
wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWh0", emptyVector); |
90 |
– |
if (! wheelVector.empty()) mySectors[0]=wheelVector; |
91 |
– |
wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWh1", emptyVector); |
92 |
– |
if (! wheelVector.empty()) mySectors[1]=wheelVector; |
93 |
– |
wheelVector = myParameters.getUntrackedParameter<vector<int> >("sectorsWh2", emptyVector); |
94 |
– |
if (! wheelVector.empty()) mySectors[2]=wheelVector; |
89 |
|
|
90 |
+ |
void DTDPGCreateSummary::beginRun(const edm::Run& run,const edm::EventSetup& context){ |
91 |
+ |
|
92 |
+ |
edm::LogVerbatim ("DTDPGSummary") << "[DTDPGCreateSummary]: BeginRun"; |
93 |
+ |
context.get<MuonGeometryRecord>().get(myMuonGeom); |
94 |
|
|
95 |
|
} |
96 |
|
|
105 |
|
|
106 |
|
myFile = new TFile(myParameters.getUntrackedParameter<string>("rootFileName", "DTEfficiencyTest.root").c_str(), "READ"); |
107 |
|
|
110 |
– |
//MainFolder = "DQMData/DT/"; |
111 |
– |
//char cMainFolder[30];sprintf(cMainFolder,"R%09d", runNumber); (for version 200) |
108 |
|
char cMainFolder[30];sprintf(cMainFolder,"DQMData/Run %d", myRunNumber); |
109 |
|
TFolder * mfolder=(TFolder*)myFile->Get(cMainFolder); |
110 |
|
if(!mfolder) { |
113 |
|
|
114 |
|
myMainFolder.append(cMainFolder); |
115 |
|
myMainFolder.append("/DT/Run summary/"); |
116 |
< |
|
116 |
> |
|
117 |
> |
DTROUtility roUtil(myFile,myMainFolder); |
118 |
> |
map<int,std::vector<int> > mySectors = roUtil.getSectorMap(); |
119 |
> |
|
120 |
|
|
121 |
|
edm::LogVerbatim ("DTDPGSummary") << "[DTDPGCreateSummary]: Creating summaries!"; |
122 |
|
|
170 |
|
|
171 |
|
myCanvas->Clear(); |
172 |
|
myCanvas->Divide(2,2); |
173 |
< |
stringstream dduID; dduID << wheelToDDU(wh); |
173 |
> |
stringstream dduID; |
174 |
> |
//if(sec<7)dduID << wheelToDDU(wh); // For 10 DDUs |
175 |
> |
//else dduID << wheelToDDU(wh)+5; // For 10 DDUs |
176 |
> |
dduID << wheelToDDU(wh); // For 5 DDUs |
177 |
|
stringstream ROSID; ROSID << sec; // fix ROS id for ROS Error histogram U.G. 28/8/07 |
178 |
|
|
179 |
|
string histoName = myMainFolder + "00-DataIntegrity/FED" + dduID.str() + "/FED" + dduID.str() + "_TTSValues"; |
189 |
|
histoTSSVal->GetXaxis()->SetBinLabel(6,"error"); |
190 |
|
histoTSSVal->GetXaxis()->SetBinLabel(7,"disc."); |
191 |
|
//histo1->Draw("colz"); // draw with colour palette |
192 |
+ |
histoTSSVal->GetYaxis()->SetLabelSize(0.04); |
193 |
+ |
histoTSSVal->GetXaxis()->SetLabelSize(0.05); |
194 |
|
histoTSSVal->Draw(); |
195 |
|
} |
196 |
|
|
199 |
|
myCanvas->cd(2); |
200 |
|
if(histoROSStatus) { |
201 |
|
histoROSStatus->SetStats( 0 ); |
202 |
< |
histoROSStatus->GetXaxis()->SetBinLabel(1,"ch.enabled"); |
203 |
< |
histoROSStatus->GetXaxis()->SetBinLabel(2,"timeout"); |
204 |
< |
histoROSStatus->GetXaxis()->SetBinLabel(3,"trailer lost"); |
205 |
< |
histoROSStatus->GetXaxis()->SetBinLabel(4,"fiber lost"); |
206 |
< |
histoROSStatus->GetXaxis()->SetBinLabel(5,"prop.err."); |
207 |
< |
histoROSStatus->GetXaxis()->SetBinLabel(6,"patt.err."); |
208 |
< |
histoROSStatus->GetXaxis()->SetBinLabel(7,"sign.lost"); |
209 |
< |
histoROSStatus->GetXaxis()->SetBinLabel(8,"ROS err."); |
210 |
< |
histoROSStatus->GetXaxis()->SetBinLabel(9,"ROS in ev."); |
202 |
> |
|
203 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(1,"#splitline{ch.}{enable}"); |
204 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(2,"#splitline{time}{out}"); |
205 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(3,"#splitline{trailer}{lost}"); |
206 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(4,"#splitline{fiber}{lost}"); |
207 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(5,"#splitline{prop.}{err.}"); |
208 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(6,"#splitline{patt.}{err.}"); |
209 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(7,"#splitline{sign.}{lost}"); |
210 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(8,"#splitline{ROS }{err.}"); |
211 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(9,"#splitline{ROS }{in ev.}"); |
212 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(10,"#splitline{Miss }{ev.}"); |
213 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(11,"#splitline{Ev ID}{Miss}"); |
214 |
> |
histoROSStatus->GetXaxis()->SetBinLabel(12,"#splitline{BX}{Miss}"); |
215 |
> |
histoROSStatus->LabelsOption("h","X"); |
216 |
> |
histoROSStatus->GetYaxis()->SetLabelSize(0.05); |
217 |
> |
histoROSStatus->GetXaxis()->SetLabelSize(0.06); |
218 |
> |
|
219 |
|
histoROSStatus->Draw("colz"); |
220 |
|
} |
221 |
|
|
224 |
|
myCanvas->cd(3); |
225 |
|
if(histoROSSummary) { |
226 |
|
histoROSSummary->SetStats( 0 ); |
227 |
< |
/* |
216 |
< |
histo3->GetXaxis()->SetBinLabel(1,"link timout"); |
217 |
< |
histo3->GetXaxis()->SetBinLabel(2,"ev.miss"); |
218 |
< |
histo3->GetXaxis()->SetBinLabel(3,"FIFO alm.full"); |
219 |
< |
histo3->GetXaxis()->SetBinLabel(4,"FIFO full"); |
220 |
< |
histo3->GetXaxis()->SetBinLabel(5,"timout "); |
221 |
< |
histo3->GetXaxis()->SetBinLabel(6,"max words"); |
222 |
< |
histo3->GetXaxis()->SetBinLabel(7,"L1A FF"); |
223 |
< |
histo3->GetXaxis()->SetBinLabel(8,"from TDC"); |
224 |
< |
histo3->GetXaxis()->SetBinLabel(9,"BX mism."); |
225 |
< |
histo3->GetXaxis()->SetBinLabel(10,"TXC"); |
226 |
< |
histo3->GetXaxis()->SetBinLabel(11,"TDC fatal"); |
227 |
< |
histo3->GetXaxis()->SetBinLabel(12,"TDC FIFO Ov"); |
228 |
< |
histo3->GetXaxis()->SetBinLabel(13,"L1 Buff.Ov"); |
229 |
< |
*/ |
227 |
> |
|
228 |
|
histoROSSummary->GetXaxis()->SetBinLabel(1,"#splitline{Link}{TimeOut}"); |
229 |
|
histoROSSummary->GetXaxis()->SetBinLabel(2,"#splitline{Ev.Id.}{Mis.}"); |
230 |
|
histoROSSummary->GetXaxis()->SetBinLabel(3,"#splitline{FIFO}{#splitline{almost}{full}}"); |
232 |
|
histoROSSummary->GetXaxis()->SetBinLabel(5,"#splitline{Ceros}{Timeout}"); |
233 |
|
histoROSSummary->GetXaxis()->SetBinLabel(6,"#splitline{Max.}{wds}"); |
234 |
|
histoROSSummary->GetXaxis()->SetBinLabel(7,"#splitline{L1A}{FF}"); |
235 |
< |
histoROSSummary->GetXaxis()->SetBinLabel(8,"#splitline{PC}{#splitline{from}{TDC}}"); |
235 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(8,"#splitline{TDC}{#splitline{parity}{err.}}"); |
236 |
> |
|
237 |
|
histoROSSummary->GetXaxis()->SetBinLabel(9,"#splitline{BX ID}{Mis.}"); |
238 |
|
histoROSSummary->GetXaxis()->SetBinLabel(10,"TXP"); |
239 |
< |
histoROSSummary->GetXaxis()->SetBinLabel(11,"#splitline{TDC}{Fatal}"); |
240 |
< |
histoROSSummary->GetXaxis()->SetBinLabel(12,"#splitline{TDC}{#splitline{FIFO}{Ov.}}"); |
241 |
< |
histoROSSummary->GetXaxis()->SetBinLabel(13,"#splitline{L1}{#splitline{Buffer}{Ov.}}"); |
239 |
> |
|
240 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(11,"#splitline{L1A}{#splitline{almost}{full}}"); |
241 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(12,"#splitline{Ch}{blocked}"); |
242 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(13,"#splitline{Ev.}{#splitline{Id.}{Mis.}}"); |
243 |
> |
|
244 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(14,"#splitline{CEROS}{blocked}"); |
245 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(15,"#splitline{TDC}{Fatal}"); |
246 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(16,"#splitline{TDC}{#splitline{FIFO}{Ov.}}"); |
247 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(17,"#splitline{L1}{#splitline{Buffer}{Ov.}}"); |
248 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(18,"#splitline{L1A}{#splitline{FIFO}{Ov.}}"); |
249 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(19,"#splitline{TDC}{#splitline{hit}{err.}}"); |
250 |
> |
histoROSSummary->GetXaxis()->SetBinLabel(20,"#splitline{TDC}{#splitline{hit}{rej.}}"); |
251 |
|
histoROSSummary->LabelsOption("h","X"); |
252 |
< |
|
252 |
> |
|
253 |
|
histoROSSummary->Draw("colz"); |
254 |
|
} |
255 |
|
|
256 |
|
histoName = myMainFolder + "00-DataIntegrity/FED" + dduID.str() + "/ROS" + ROSID.str() + "/FED" + dduID.str() + "_ROS" + ROSID.str() + "_ROSError"; |
257 |
|
TH1F *histoROSError = (TH1F*) myFile -> Get(histoName.c_str()); |
258 |
|
myCanvas->cd(4); |
259 |
+ |
myCanvas->cd(4)->SetBottomMargin(0.15); |
260 |
|
if(histoROSError) { |
261 |
|
histoROSError->SetStats( 0 ); |
262 |
|
histoROSError->GetXaxis()->SetBinLabel(1,"#splitline{Link}{TimeOut}"); |
263 |
|
histoROSError->GetXaxis()->SetBinLabel(2,"#splitline{Ev.Id.}{Mis.}"); |
264 |
|
histoROSError->GetXaxis()->SetBinLabel(3,"#splitline{FIFO}{#splitline{almost}{full}}"); |
265 |
|
histoROSError->GetXaxis()->SetBinLabel(4,"#splitline{FIFO}{full}"); |
266 |
< |
histoROSError->GetXaxis()->SetBinLabel(5," "); |
266 |
> |
histoROSError->GetXaxis()->SetBinLabel(5,"#splitline{CEROS}{timeout}"); |
267 |
|
histoROSError->GetXaxis()->SetBinLabel(6,"#splitline{Max.}{wds}"); |
268 |
< |
histoROSError->GetXaxis()->SetBinLabel(7,"#splitline{L1A}{FF}"); |
269 |
< |
histoROSError->GetXaxis()->SetBinLabel(8,"#splitline{PC}{#splitline{from}{TDC}}"); |
270 |
< |
histoROSError->GetXaxis()->SetBinLabel(9,"#splitline{BX ID}{Mis.}"); |
271 |
< |
histoROSError->GetXaxis()->SetBinLabel(10," "); |
272 |
< |
histoROSError->GetXaxis()->SetBinLabel(11,"#splitline{TDC}{Fatal}"); |
273 |
< |
histoROSError->GetXaxis()->SetBinLabel(12,"#splitline{TDC}{#splitline{FIFO}{Ov.}}"); |
274 |
< |
histoROSError->GetXaxis()->SetBinLabel(13,"#splitline{L1}{#splitline{Buffer}{Ov.}}"); |
268 |
> |
histoROSError->GetXaxis()->SetBinLabel(7,"#splitline{TDC}{#splitline{parity}{err}}"); |
269 |
> |
histoROSError->GetXaxis()->SetBinLabel(8,"#splitline{BX ID}{Mis.}"); |
270 |
> |
histoROSError->GetXaxis()->SetBinLabel(9,"#splitline{Ch}{blocked}"); |
271 |
> |
histoROSError->GetXaxis()->SetBinLabel(10,"#splitline{Ev ID}{Mis.}"); |
272 |
> |
histoROSError->GetXaxis()->SetBinLabel(11,"#splitline{CEROS}{blocked}"); |
273 |
> |
histoROSError->GetXaxis()->SetBinLabel(12,"#splitline{TDC}{Fatal}"); |
274 |
> |
histoROSError->GetXaxis()->SetBinLabel(13,"#splitline{TDC}{#splitline{FIFO}{Ov.}}"); |
275 |
> |
histoROSError->GetXaxis()->SetBinLabel(14,"#splitline{L1}{#splitline{Buffer}{Ov.}}"); |
276 |
> |
histoROSError->GetXaxis()->SetBinLabel(15,"#splitline{TDCL1A}{#splitline{FIFO}{Ov.}}"); |
277 |
> |
histoROSError->GetXaxis()->SetBinLabel(16,"#splitline{TDC}{#splitline{hit}{err.}}"); |
278 |
> |
histoROSError->GetXaxis()->SetBinLabel(17,"#splitline{TDC}{#splitline{hit}{rej.}}"); |
279 |
|
histoROSError->LabelsOption("h","X"); |
280 |
|
histoROSError->Draw("colz"); |
281 |
|
} |
282 |
|
createGifFile("DataIntegrity",wh,sec); |
283 |
|
|
284 |
|
// Event Length |
285 |
+ |
gStyle->SetStatW(0.29); |
286 |
+ |
gStyle->SetOptTitle(0); |
287 |
|
if(sec !=14 && sec !=13){ |
288 |
|
myCanvas->Clear(); |
289 |
|
myCanvas->Divide(2,2); |
316 |
|
|
317 |
|
void DTDPGCreateSummary::createDigiPlots(int wh, int sec) { |
318 |
|
|
319 |
+ |
|
320 |
+ |
gStyle->SetOptTitle(); |
321 |
|
gStyle->SetOptStat(); |
322 |
|
myCanvas->Clear(); |
323 |
|
myCanvas->Divide(3,4); |
343 |
|
vector<const DTLayer*>::const_iterator lEnd = (*slIt)->layers().end(); |
344 |
|
stringstream superLayer; superLayer << sl.superlayer(); |
345 |
|
|
346 |
< |
string histoName = digiFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/TimeBox_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str()+ "_SL" + superLayer.str(); |
346 |
> |
string histoName = digiFolder + "/Sector" + sector.str() + "/Station" + station.str() +"/TimeBox_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str()+ "_SL" + superLayer.str(); |
347 |
|
TH1F *histoTimeBox = (TH1F*) myFile->Get(histoName.c_str()); |
348 |
+ |
|
349 |
|
if(histoTimeBox){ |
350 |
|
int pad = (ch.station() - 1)*3 + sl.superlayer(); |
351 |
|
myCanvas->cd(pad); |
375 |
|
if (ch.sector() == sec && ch.wheel() == wh ) { |
376 |
|
stringstream station; station << ch.station(); |
377 |
|
bool found = false; |
378 |
< |
// From 21x the Occupancy histo is a TH2F per chamber we must to extract |
379 |
< |
// the information from this plot, |
362 |
< |
string histoNameOccupancy = digiFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/OccupancyInTimeHits_perCh_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
378 |
> |
|
379 |
> |
string histoNameOccupancy = digiFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/OccupancyInTimeHits_perCh_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
380 |
|
TH2F *histoOccupancy = (TH2F*) myFile -> Get(histoNameOccupancy.c_str()); |
381 |
|
if(histoOccupancy){ |
382 |
|
found = true; |
400 |
|
layerOccupancy[sl.superlayer()-1][layerId.layer()-1]= new TH1F(histoNameLayer.c_str(),histoTitleLayer.c_str(),100, 0.,100.); |
401 |
|
|
402 |
|
// Fill the 1D Histos |
403 |
< |
int iby=(sl.superlayer()-1)*4+layerId.layer()+1; |
403 |
> |
int iby=(sl.superlayer()-1)*4+layerId.layer(); |
404 |
|
int nbx= histoOccupancy->GetNbinsX() ; |
405 |
|
float totentr=0; |
406 |
|
for(int ibx=1;ibx<nbx;ibx++) { |
438 |
|
} |
439 |
|
} |
440 |
|
|
424 |
– |
// Occupancy Noise -------------------------------------------------------- |
425 |
– |
/* |
426 |
– |
// Loop over all the chambers |
427 |
– |
vector<DTChamber*>::const_iterator ch_digi3_it = myMuonGeom->chambers().begin(); |
428 |
– |
vector<DTChamber*>::const_iterator ch_digi3_end = myMuonGeom->chambers().end(); |
429 |
– |
for (; ch_digi3_it != ch_digi3_end; ++ch_digi3_it) { |
430 |
– |
DTChamberId ch = (*ch_digi3_it)->id(); |
431 |
– |
stringstream wheel; wheel << ch.wheel(); |
432 |
– |
stringstream station; station << ch.station(); |
433 |
– |
stringstream sector; sector << ch.sector(); |
434 |
– |
bool found = false; |
435 |
– |
vector<const DTSuperLayer*>::const_iterator slIt = (*ch_digi3_it)->superLayers().begin(); |
436 |
– |
vector<const DTSuperLayer*>::const_iterator slEnd = (*ch_digi3_it)->superLayers().end(); |
437 |
– |
// Loop over the SLs |
438 |
– |
for(; slIt != slEnd; ++slIt) { |
439 |
– |
DTSuperLayerId sl = (*slIt)->id(); |
440 |
– |
vector<const DTLayer*>::const_iterator lIt = (*slIt)->layers().begin(); |
441 |
– |
vector<const DTLayer*>::const_iterator lEnd = (*slIt)->layers().end(); |
442 |
– |
stringstream superLayer; superLayer << sl.superlayer(); |
443 |
– |
// Loop over the Ls |
444 |
– |
for(; lIt != lEnd; ++lIt) { |
445 |
– |
DTLayerId layerId = (*lIt)->id(); |
446 |
– |
stringstream layer; layer << layerId.layer(); |
447 |
– |
|
448 |
– |
//string digiFolder = myMainFolder + "DTDigiTask/Wheel" + wheel.str(); |
449 |
– |
string digiFolder = myMainFolder + "Digi/Wheel" + wheel.str(); // new folder names from 21x |
450 |
– |
string histo_name = digiFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/Occupancies/OccupancyNoise_perL_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str()+ "_SL" + superLayer.str() + "_L" + layer.str(); |
451 |
– |
TH1F *histo = (TH1F*) myFile -> Get(histo_name.c_str()); |
452 |
– |
if(histo){ |
453 |
– |
found = true; |
454 |
– |
int pad = (sl.superlayer() - 1)*4 + layerId.layer(); |
455 |
– |
myCanvas->cd(pad); |
456 |
– |
histo->Draw(); |
457 |
– |
} |
458 |
– |
} |
459 |
– |
} |
460 |
– |
if(found) { |
461 |
– |
myCanvas->Update(); |
462 |
– |
} |
463 |
– |
} |
464 |
– |
|
465 |
– |
// Digi Per Event --------------------------------------------------------- |
466 |
– |
// Loop over all the chambers |
467 |
– |
vector<DTChamber*>::const_iterator ch_digi4_it = myMuonGeom->chambers().begin(); |
468 |
– |
vector<DTChamber*>::const_iterator ch_digi4_end = myMuonGeom->chambers().end(); |
469 |
– |
for (; ch_digi4_it != ch_digi4_end; ++ch_digi4_it) { |
470 |
– |
DTChamberId ch = (*ch_digi4_it)->id(); |
471 |
– |
stringstream wheel; wheel << ch.wheel(); |
472 |
– |
stringstream station; station << ch.station(); |
473 |
– |
stringstream sector; sector << ch.sector(); |
474 |
– |
bool found = false; |
475 |
– |
vector<const DTSuperLayer*>::const_iterator slIt = (*ch_digi4_it)->superLayers().begin(); |
476 |
– |
vector<const DTSuperLayer*>::const_iterator slEnd = (*ch_digi4_it)->superLayers().end(); |
477 |
– |
// Loop over the SLs |
478 |
– |
for(; slIt != slEnd; ++slIt) { |
479 |
– |
DTSuperLayerId sl = (*slIt)->id(); |
480 |
– |
vector<const DTLayer*>::const_iterator lIt = (*slIt)->layers().begin(); |
481 |
– |
vector<const DTLayer*>::const_iterator lEnd = (*slIt)->layers().end(); |
482 |
– |
stringstream superLayer; superLayer << sl.superlayer(); |
483 |
– |
// Loop over the Ls |
484 |
– |
for(; lIt != lEnd; ++lIt) { |
485 |
– |
DTLayerId layerId = (*lIt)->id(); |
486 |
– |
stringstream layer; layer << layerId.layer(); |
487 |
– |
|
488 |
– |
//string digiFolder = myMainFolder + "DTDigiTask/Wheel" + wheel.str(); |
489 |
– |
string digiFolder = myMainFolder + "Digi/Wheel" + wheel.str(); // new folder names from 21x |
490 |
– |
string histo_name = digiFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/DigiPerEvent/DigiPerEvent_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" + superLayer.str() + "_L" + layer.str(); |
491 |
– |
TProfile *histo = (TProfile*) myFile -> Get(histo_name.c_str()); |
492 |
– |
if(histo){ |
493 |
– |
found = true; |
494 |
– |
int pad = (sl.superlayer() - 1)*4 + layerId.layer(); |
495 |
– |
myCanvas->cd(pad); |
496 |
– |
histo->Draw(); |
497 |
– |
} |
498 |
– |
} |
499 |
– |
} |
500 |
– |
if(found){ |
501 |
– |
myCanvas->Update(); |
502 |
– |
psFile.NewPage(); |
503 |
– |
} |
504 |
– |
} |
505 |
– |
*/ |
506 |
– |
|
441 |
|
} |
442 |
|
|
443 |
|
|
462 |
|
vector<DTChamber*>::const_iterator chTriggerEnd = myMuonGeom->chambers().end(); |
463 |
|
string triggerFolder; |
464 |
|
if ((*hwSrcIt)=="DCC") { |
465 |
< |
triggerFolder = myMainFolder + "03-LocalTrigger/DCC/Wheel" + wheel.str(); |
465 |
> |
triggerFolder = myMainFolder + "03-LocalTrigger-DCC/Wheel" + wheel.str(); |
466 |
|
} |
467 |
|
else { |
468 |
< |
triggerFolder = myMainFolder + "03-LocalTrigger/Wheel" + wheel.str(); |
468 |
> |
triggerFolder = myMainFolder + "04-LocalTrigger-DDU/Wheel" + wheel.str(); |
469 |
|
} |
470 |
|
|
471 |
|
for (; chTriggerIt != chTriggerEnd; ++chTriggerIt) { |
475 |
|
string histoNameBXQual = triggerFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/LocalTriggerPhi/" + (*hwSrcIt) + "_BXvsQual_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str(); |
476 |
|
TH1F *histoBXQual = (TH1F*) myFile -> Get(histoNameBXQual.c_str()); |
477 |
|
if(histoBXQual){ |
544 |
– |
// myCanvas->cd(ch.station()); |
478 |
|
myCanvas->cd( 2*ch.station() - 1 ); |
479 |
|
histoBXQual->GetXaxis()->SetTitle("Quality Flag, Phi trigger"); |
480 |
|
histoBXQual->GetYaxis()->SetTitle("BX id ."); |
483 |
|
histoBXQual->GetYaxis()->SetRangeUser(-9.0,50.1); |
484 |
|
histoBXQual->GetXaxis()->SetTitleSize(0.07); |
485 |
|
histoBXQual->SetStats( 0 ); |
486 |
+ |
histoBXQual->SetFillColor( 0 ); |
487 |
|
histoBXQual->GetXaxis()->SetLabelSize(0.08); |
488 |
|
histoBXQual->GetYaxis()->SetLabelSize(0.08); |
489 |
|
histoBXQual->Draw("colz"); |
498 |
|
histoBXQualTh->GetYaxis()->SetTitleOffset(0.4); |
499 |
|
histoBXQualTh->GetXaxis()->SetTitleSize(0.07); |
500 |
|
histoBXQualTh->SetStats( 0 ); |
501 |
+ |
histoBXQualTh->SetFillColor( 0 ); |
502 |
|
histoBXQualTh->GetXaxis()->SetLabelSize(0.08); |
503 |
|
histoBXQualTh->GetYaxis()->SetLabelSize(0.08); |
504 |
|
histoBXQualTh->Draw("colz"); |
508 |
|
|
509 |
|
createGifFile("TriggQuality"+(*hwSrcIt),wh,sec); |
510 |
|
|
576 |
– |
// Trig efficiency vs position |
577 |
– |
myCanvas->Clear(); |
578 |
– |
myCanvas->Divide(2,2); |
579 |
– |
|
580 |
– |
TH1F *histoEffPosBox[2]; |
581 |
– |
histoEffPosBox[0] = new TH1F("histoEffPos","Phi Trigger efficiency vs position",200,-340.,340.); |
582 |
– |
histoEffPosBox[1] = new TH1F("histoHHHLEffPos","Phi HH/HL Trigger efficiency vs position",200,-340.,340.); |
583 |
– |
string histoTag[4] = {"TrigEffPosPhi","TrigEffPosTheta","TrigEffPosHHHLPhi","TrigEffPosHTheta"}; |
584 |
– |
|
585 |
– |
chTriggerIt = myMuonGeom->chambers().begin(); |
586 |
– |
chTriggerEnd = myMuonGeom->chambers().end(); |
587 |
– |
for (; chTriggerIt != chTriggerEnd; ++chTriggerIt) { |
588 |
– |
DTChamberId ch = (*chTriggerIt)->id(); |
589 |
– |
if (ch.sector() == sec && ch.wheel() == wh ) { |
590 |
– |
stringstream station; station << ch.station(); |
591 |
– |
for (int i=0;i<4;++i){ |
592 |
– |
string histoNameEffPos = triggerFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/Segment/" + (*hwSrcIt) + "_" + histoTag[i] + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str(); |
593 |
– |
TH1F *histoEffPos = (TH1F*) myFile -> Get(histoNameEffPos.c_str()); |
594 |
– |
if(histoEffPos){ |
595 |
– |
myCanvas->cd(i+1); |
596 |
– |
histoEffPos->SetLineColor(ch.station()); |
597 |
– |
if (ch.station()==1){ |
598 |
– |
TH1F* histoEffPosBase = histoEffPos; |
599 |
– |
if (!(i%2)) { |
600 |
– |
histoEffPosBase = histoEffPosBox[i/2]; |
601 |
– |
} |
602 |
– |
else { |
603 |
– |
string labelH = !(i/2) ? "" : "H "; |
604 |
– |
histoEffPosBase->SetTitle(("Theta Trigger " + labelH + "efficiency vs position").c_str()); |
605 |
– |
} |
606 |
– |
histoEffPosBase->GetYaxis()->SetLabelSize(0.06); |
607 |
– |
histoEffPos->GetYaxis()->SetRangeUser(0,1.1); |
608 |
– |
histoEffPosBase->GetXaxis()->SetLabelSize(0.055); |
609 |
– |
histoEffPosBase->GetXaxis()->SetTitle("position [cm]"); |
610 |
– |
histoEffPosBase->GetXaxis()->SetTitleSize(0.055); |
611 |
– |
histoEffPosBase->GetXaxis()->SetTitleOffset(0.85); |
612 |
– |
histoEffPos->SetStats( 0 ); |
613 |
– |
histoEffPosBase->Draw(); |
614 |
– |
} |
615 |
– |
if (ch.station()!=1 || !(i%2)){ |
616 |
– |
histoEffPos->Draw("same"); |
617 |
– |
} |
618 |
– |
} |
619 |
– |
} |
620 |
– |
} |
621 |
– |
} |
622 |
– |
|
623 |
– |
createGifFile("TriggEfficiencyvsPos"+(*hwSrcIt),wh,sec); |
624 |
– |
|
625 |
– |
for (int i=0;i<2;++i) delete histoEffPosBox[i]; |
626 |
– |
|
627 |
– |
// Trig efficiency vs angle |
628 |
– |
myCanvas->Clear(); |
629 |
– |
myCanvas->Divide(2,2); |
630 |
– |
// Loop over all the chambers |
631 |
– |
chTriggerIt = myMuonGeom->chambers().begin(); |
632 |
– |
chTriggerEnd = myMuonGeom->chambers().end(); |
633 |
– |
string histoAngleTag[4] = {"TrigEffAnglePhi","TrigEffAngleTheta","TrigEffAngleHHHLPhi","TrigEffAngleHTheta"}; |
634 |
– |
string histoAngleLabel[4] = {"Phi","Theta","Phi HH/HL","Theta H"}; |
635 |
– |
|
636 |
– |
for (; chTriggerIt != chTriggerEnd; ++chTriggerIt) { |
637 |
– |
DTChamberId ch = (*chTriggerIt)->id(); |
638 |
– |
if (ch.sector() == sec && ch.wheel() == wh ) { |
639 |
– |
stringstream station; station << ch.station(); |
640 |
– |
for (int i=0;i<4;++i){ |
641 |
– |
string histoNameEffAngle = triggerFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/Segment/" + (*hwSrcIt) + "_" + histoAngleTag[i] + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str(); |
642 |
– |
TH1F *histoEffAngle = (TH1F*) myFile -> Get(histoNameEffAngle.c_str()); |
643 |
– |
if(histoEffAngle){ |
644 |
– |
myCanvas->cd(i+1); |
645 |
– |
histoEffAngle->SetLineColor(ch.station()); |
646 |
– |
if (ch.station()==1){ |
647 |
– |
histoEffAngle->GetYaxis()->SetRangeUser(0,1.1); |
648 |
– |
histoEffAngle->GetYaxis()->SetLabelSize(0.06); |
649 |
– |
histoEffAngle->SetStats( 0 ); |
650 |
– |
histoEffAngle->SetTitle((histoAngleLabel[i] + " Trigger efficiency vs angle").c_str()); |
651 |
– |
histoEffAngle->GetXaxis()->SetLabelSize(0.055); |
652 |
– |
histoEffAngle->GetXaxis()->SetTitle("angle [deg]"); |
653 |
– |
histoEffAngle->GetXaxis()->SetTitleSize(0.055); |
654 |
– |
histoEffAngle->GetXaxis()->SetTitleOffset(0.85); |
655 |
– |
histoEffAngle->Draw(); |
656 |
– |
} |
657 |
– |
else |
658 |
– |
histoEffAngle->Draw("same"); |
659 |
– |
} |
660 |
– |
} |
661 |
– |
} |
662 |
– |
} |
663 |
– |
|
664 |
– |
createGifFile("TriggEfficiencyvsAngle"+(*hwSrcIt),wh,sec); |
511 |
|
|
512 |
|
// Trig efficiency 2d plots |
513 |
|
myCanvas->Clear(); |
514 |
< |
myCanvas->Divide(2,4); |
515 |
< |
string histo2DTag[2] = {"TrigEffPosvsAnglePhi","TrackPosvsAngle"}; |
514 |
> |
myCanvas->Divide(3,4); |
515 |
> |
string histo2DTag[3] = {"TrigEffPosvsAnglePhi","TrigEffPosvsAngleHHHLPhi","TrackPosvsAngle"}; |
516 |
> |
|
517 |
|
chTriggerIt = myMuonGeom->chambers().begin(); |
518 |
|
chTriggerEnd = myMuonGeom->chambers().end(); |
519 |
|
for (; chTriggerIt != chTriggerEnd; ++chTriggerIt) { |
522 |
|
if (ch.sector() == sec && ch.wheel() == wh ) { |
523 |
|
stringstream station; station << ch.station(); |
524 |
|
|
525 |
< |
for (int i=0;i<2;++i){ |
525 |
> |
for (int i=0;i<3;++i){ |
526 |
|
string histoName2DEff = triggerFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/Segment/"+ (*hwSrcIt) + "_" + histo2DTag[i] + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str(); |
527 |
|
TH2F *histo2DEff = (TH2F*) myFile -> Get(histoName2DEff.c_str()); |
528 |
|
if(histo2DEff){ |
529 |
< |
myCanvas->cd((ch.station()*2)-1+i); |
530 |
< |
histo2DEff->SetStats( 0 ); |
529 |
> |
myCanvas->cd((ch.station()*3)-2+i); |
530 |
> |
histo2DEff->SetFillColor( 0 ); |
531 |
> |
//histo2DEff->SetStats( 0 ); |
532 |
> |
bool printStats = i==2; |
533 |
> |
histo2DEff->SetStats( printStats ); |
534 |
|
histo2DEff->GetXaxis()->SetTitle("angle [deg]"); |
535 |
|
histo2DEff->GetYaxis()->SetTitle("position [cm] ."); |
536 |
|
histo2DEff->GetYaxis()->SetTitleSize(0.08); |
541 |
|
histo2DEff->GetXaxis()->SetTitleOffset(0.75); |
542 |
|
histo2DEff->SetMinimum(0.); |
543 |
|
histo2DEff->SetMaximum(1.); |
544 |
< |
const char* option = i ? "box" : "colz"; |
544 |
> |
//const char* option = i ? "box" : "colz"; |
545 |
> |
const char* option = i==2 ? "box" : "colz"; |
546 |
|
histo2DEff->Draw(option); |
547 |
|
} |
548 |
|
} |
553 |
|
} |
554 |
|
|
555 |
|
// DCC Only Plots |
556 |
< |
string triggerFolder = myMainFolder + "03-LocalTrigger/DCC/Wheel" + wheel.str(); |
556 |
> |
string triggerFolder = myMainFolder + "03-LocalTrigger-DCC/Wheel" + wheel.str(); |
557 |
|
|
558 |
|
// Trigger LUTs |
559 |
|
myCanvas->Clear(); |
560 |
< |
myCanvas->Divide(2,4); |
561 |
< |
|
560 |
> |
if (sec==4 || sec==10) { |
561 |
> |
myCanvas->Divide(2,5); |
562 |
> |
} else { |
563 |
> |
myCanvas->Divide(2,4); |
564 |
> |
} |
565 |
|
vector<DTChamber*>::const_iterator chTriggerIt = myMuonGeom->chambers().begin(); |
566 |
|
vector<DTChamber*>::const_iterator chTriggerEnd = myMuonGeom->chambers().end(); |
567 |
|
for (; chTriggerIt != chTriggerEnd; ++chTriggerIt) { |
568 |
|
DTChamberId ch = (*chTriggerIt)->id(); |
569 |
< |
if (ch.sector() == sec && ch.wheel() == wh ) { |
569 |
> |
int scsec = ch.sector()>12 ? (ch.sector()==13 ? 4 : 10) : ch.sector(); |
570 |
> |
if ( (scsec == sec && ch.wheel() == wh)) { |
571 |
> |
int istat = ch.sector()>12 ? 5 : ch.station(); |
572 |
|
stringstream station; station << ch.station(); |
573 |
< |
string histoNameLut = triggerFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/Segment/DCC_PhitkvsPhitrig_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str(); |
573 |
> |
stringstream chsector; chsector << ch.sector(); |
574 |
> |
string histoNameLut = triggerFolder + "/Sector" + chsector.str() + "/Station" + station.str() + "/Segment/DCC_PhitkvsPhitrig_W" + wheel.str() + "_Sec" + chsector.str() + "_St" + station.str(); |
575 |
|
TH2F *histoLut = (TH2F*) myFile -> Get(histoNameLut.c_str()); |
576 |
|
if(histoLut){ |
577 |
< |
myCanvas->cd( 2*ch.station() - 1 ); |
577 |
> |
myCanvas->cd( 2*istat - 1 ); |
578 |
> |
histoLut->SetFillColor(0); |
579 |
|
histoLut->GetXaxis()->SetTitle("Trigger local position [cm]"); |
580 |
|
histoLut->GetYaxis()->SetTitle("Segment local position [cm]"); |
581 |
|
histoLut->SetStats( 0 ); |
584 |
|
histoLut->Draw("box"); |
585 |
|
} |
586 |
|
|
587 |
< |
histoNameLut = triggerFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/Segment/DCC_PhibtkvsPhibtrig_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str(); |
587 |
> |
histoNameLut = triggerFolder + "/Sector" + chsector.str() + "/Station" + station.str() + "/Segment/DCC_PhibtkvsPhibtrig_W" + wheel.str() + "_Sec" + chsector.str() + "_St" + station.str(); |
588 |
|
histoLut = (TH2F*) myFile -> Get(histoNameLut.c_str()); |
589 |
< |
if(histoLut){ |
590 |
< |
myCanvas->cd( 2*ch.station() ); |
591 |
< |
histoLut->GetXaxis()->SetTitle("Trigger local direction [°]"); |
592 |
< |
histoLut->GetYaxis()->SetTitle("Segment local direction [°]"); |
589 |
> |
if(histoLut && istat!=3){ |
590 |
> |
myCanvas->cd( 2*istat ); |
591 |
> |
histoLut->SetFillColor(0); |
592 |
> |
histoLut->GetXaxis()->SetTitle("Trigger local direction [deg]"); |
593 |
> |
histoLut->GetYaxis()->SetTitle("Segment local direction [deg]"); |
594 |
|
histoLut->SetStats( 0 ); |
595 |
|
histoLut->GetXaxis()->SetLabelSize(0.08); |
596 |
|
histoLut->GetYaxis()->SetLabelSize(0.08); |
601 |
|
|
602 |
|
createGifFile("TriggLUTsDCC",wh,sec); |
603 |
|
|
604 |
+ |
// Trigger LUTs Residuals |
605 |
+ |
myCanvas->Clear(); |
606 |
+ |
if (sec==4 || sec==10) { |
607 |
+ |
myCanvas->Divide(2,5); |
608 |
+ |
} else { |
609 |
+ |
myCanvas->Divide(2,4); |
610 |
+ |
} |
611 |
+ |
|
612 |
+ |
gStyle->SetOptFit(1); |
613 |
+ |
|
614 |
+ |
chTriggerIt = myMuonGeom->chambers().begin(); |
615 |
+ |
gStyle->SetStatW(0.15); |
616 |
+ |
chTriggerEnd = myMuonGeom->chambers().end(); |
617 |
+ |
for (; chTriggerIt != chTriggerEnd; ++chTriggerIt) { |
618 |
+ |
DTChamberId ch = (*chTriggerIt)->id(); |
619 |
+ |
int scsec = ch.sector()>12 ? (ch.sector()==13 ? 4 : 10) : ch.sector(); |
620 |
+ |
if (scsec == sec && ch.wheel() == wh ) { |
621 |
+ |
int istat = ch.sector()>12 ? 5 : ch.station(); |
622 |
+ |
stringstream station; station << ch.station(); |
623 |
+ |
stringstream chsector; chsector << ch.sector(); |
624 |
+ |
string histoNameLutRes = triggerFolder + "/Sector" + chsector.str() + "/Station" + station.str() + "/Segment/DCC_PhiResidual_W" + wheel.str() + "_Sec" + chsector.str() + "_St" + station.str(); |
625 |
+ |
TH1F *histoLutRes = (TH1F*) myFile -> Get(histoNameLutRes.c_str()); |
626 |
+ |
if(histoLutRes){ |
627 |
+ |
myCanvas->cd( 2*istat - 1 ); |
628 |
+ |
gStyle->SetOptStat(1111); |
629 |
+ |
histoLutRes->SetFillColor(0); |
630 |
+ |
histoLutRes->GetXaxis()->SetTitle("Trigger - Segment local position [cm]"); |
631 |
+ |
histoLutRes->GetXaxis()->SetLabelSize(0.08); |
632 |
+ |
histoLutRes->GetYaxis()->SetLabelSize(0.08); |
633 |
+ |
histoLutRes->Draw(); |
634 |
+ |
} |
635 |
+ |
|
636 |
+ |
histoNameLutRes = triggerFolder + "/Sector" + chsector.str() + "/Station" + station.str() + "/Segment/DCC_PhibResidual_W" + wheel.str() + "_Sec" + chsector.str() + "_St" + station.str(); |
637 |
+ |
histoLutRes = (TH1F*) myFile->Get(histoNameLutRes.c_str()); |
638 |
+ |
if(histoLutRes && istat!=3){ |
639 |
+ |
myCanvas->cd( 2*istat ); |
640 |
+ |
histoLutRes->SetFillColor(0); |
641 |
+ |
histoLutRes->GetXaxis()->SetTitle("Trigger - Segment local direction [deg]"); |
642 |
+ |
histoLutRes->GetXaxis()->SetLabelSize(0.08); |
643 |
+ |
histoLutRes->GetYaxis()->SetLabelSize(0.08); |
644 |
+ |
histoLutRes->Draw(); |
645 |
+ |
} |
646 |
+ |
} |
647 |
+ |
} |
648 |
+ |
|
649 |
+ |
createGifFile("TriggLUTsResidualDCC",wh,sec); |
650 |
+ |
gStyle->SetOptFit(0); |
651 |
+ |
|
652 |
+ |
|
653 |
|
// Quality vs Hits |
654 |
|
myCanvas->Clear(); |
655 |
|
myCanvas->Divide(2,2); |
667 |
|
TH2F *histoHits = (TH2F*) myFile -> Get(histoNameHits.c_str()); |
668 |
|
if(histoHits){ |
669 |
|
myCanvas->cd( ch.station() ); |
670 |
< |
histoHits->GetXaxis()->SetTitle("Phi trigger quality falg"); |
670 |
> |
histoHits->GetXaxis()->SetTitle("Phi trigger quality"); |
671 |
|
histoHits->GetYaxis()->SetTitle("Hits associated to phi segment"); |
672 |
< |
histoHits->SetStats( 0 ); |
672 |
> |
histoHits->SetFillColor( 0 ); |
673 |
> |
histoHits->SetStats(0); |
674 |
|
histoHits->Draw("box"); |
675 |
|
} |
676 |
|
} |
684 |
|
void DTDPGCreateSummary::createRecoPlots(int wh, int sec) { |
685 |
|
|
686 |
|
myCanvas->Clear(); |
687 |
< |
myCanvas->Divide(2,4); |
687 |
> |
myCanvas->Divide(2,2); |
688 |
|
stringstream wheel; wheel << wh; |
689 |
|
stringstream sector; sector << sec; |
690 |
|
string recoFolder = myMainFolder + "02-Segments/Wheel" + wheel.str(); |
698 |
|
stringstream station; station << ch.station(); |
699 |
|
string histoName4DSeg; |
700 |
|
if(ch.station() < 4) |
701 |
< |
histoName4DSeg = recoFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/h4DSegmXvsYInCham_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
701 |
> |
histoName4DSeg = recoFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/h4DSegmXvsYInCham_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
702 |
|
if(ch.station() == 4) |
703 |
< |
histoName4DSeg = recoFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/h4DSegmXInCham_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
704 |
< |
TProfile *histo4DSeg = (TProfile*) myFile -> Get(histoName4DSeg.c_str()); // CB fix here it is not a profile |
705 |
< |
if(histo4DSeg){ |
797 |
< |
int pad = (ch.station() - 1)*2 + 1; |
798 |
< |
myCanvas->cd(pad); |
799 |
< |
histo4DSeg->SetStats( 0 ); |
800 |
< |
histo4DSeg->GetXaxis()->SetLabelSize(0.08); |
801 |
< |
histo4DSeg->GetYaxis()->SetLabelSize(0.08); |
802 |
< |
if(ch.station() < 4) histo4DSeg->Draw("colz"); |
803 |
< |
if(ch.station() == 4) histo4DSeg->Draw(); |
804 |
< |
} |
805 |
< |
histoName4DSeg = recoFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/h4DSegmNHits_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
703 |
> |
histoName4DSeg = recoFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/h4DSegmXInCham_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
704 |
> |
//TProfile *histo4DSeg = (TProfile*) myFile -> Get(histoName4DSeg.c_str()); // CB fix here it is not a profile |
705 |
> |
histoName4DSeg = recoFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/h4DSegmNHits_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
706 |
|
TH1F *histo4DSegNHits = (TH1F*) myFile -> Get(histoName4DSeg.c_str()); |
707 |
|
if(histo4DSegNHits){ |
708 |
< |
int pad = (ch.station() - 1)*2 + 2; |
708 |
> |
int pad = ch.station(); |
709 |
|
myCanvas->cd(pad); |
710 |
|
histo4DSegNHits->GetXaxis()->SetLabelSize(0.08); |
711 |
|
histo4DSegNHits->GetYaxis()->SetLabelSize(0.07); |
712 |
|
histo4DSegNHits->Draw(); |
713 |
+ |
|
714 |
+ |
TText L1; |
715 |
+ |
L1.SetTextSize(0.1); |
716 |
+ |
L1.SetTextColor(4); |
717 |
+ |
char MBstation[10]; |
718 |
+ |
sprintf(MBstation,"MB%d", ch.station()); |
719 |
+ |
L1.DrawText(14.0,0.02,MBstation); |
720 |
+ |
|
721 |
+ |
|
722 |
|
} |
723 |
|
} |
724 |
|
} |
725 |
|
|
726 |
|
createGifFile("RecoSegments",wh,sec); |
727 |
|
|
819 |
– |
/* |
820 |
– |
// reco segment Histos - page2 |
821 |
– |
// Loop over all the chambers |
822 |
– |
vector<DTChamber*>::const_iterator ch_reco2_it = myMuonGeom->chambers().begin(); |
823 |
– |
vector<DTChamber*>::const_iterator ch_reco2_end = myMuonGeom->chambers().end(); |
824 |
– |
for (; ch_reco2_it != ch_reco2_end; ++ch_reco2_it) { |
825 |
– |
DTChamberId ch = (*ch_reco2_it)->id(); |
826 |
– |
stringstream wheel; wheel << ch.wheel(); |
827 |
– |
stringstream station; station << ch.station(); |
828 |
– |
stringstream sector; sector << ch.sector(); |
829 |
– |
|
830 |
– |
string recoFolder = myMainFolder + "DTSegmentAnalysisTask/Wheel" + wheel.str(); |
831 |
– |
string histo_name = recoFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/h4DSegmPhiDirection_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
832 |
– |
TH1F *histo = (TH1F*) myFile -> Get(histo_name.c_str()); |
833 |
– |
if(histo) { |
834 |
– |
int pad = (ch.station() - 1)*2 + 1; |
835 |
– |
myCanvas->cd(pad); |
836 |
– |
histo->Draw(); |
837 |
– |
} |
838 |
– |
histo_name = recoFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/h4DSegmThetaDirection_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str(); |
839 |
– |
TH1F *histo2 = (TH1F*) myFile -> Get(histo_name.c_str()); |
840 |
– |
if(histo2) { |
841 |
– |
int pad = (ch.station() - 1)*2 + 2; |
842 |
– |
myCanvas->cd(pad); |
843 |
– |
histo2->Draw(); |
844 |
– |
} |
845 |
– |
} |
846 |
– |
myCanvas->Update(); |
847 |
– |
psFile.NewPage(); |
848 |
– |
*/ |
728 |
|
} |
729 |
|
|
730 |
|
|
751 |
|
DTSuperLayerId sl = (*slIt)->id(); |
752 |
|
stringstream superLayer; superLayer << sl.superlayer(); |
753 |
|
|
754 |
< |
string histoNameResDist = resoFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/hResDist_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" + superLayer.str(); |
754 |
> |
string histoNameResDist = resoFolder + "/Sector" + sector.str() + "/Station" + station.str() + "/hResDist_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" + superLayer.str(); |
755 |
|
TH1F *histoResDist = (TH1F*) myFile -> Get(histoNameResDist.c_str()); |
756 |
|
if(histoResDist){ |
757 |
|
int pad = (ch.station() - 1)*3 + sl.superlayer(); |
771 |
|
|
772 |
|
createGifFile("HitResiduals",wh,sec); |
773 |
|
|
895 |
– |
/* |
896 |
– |
/- FROM CMSSW_2_1_X THESE HISTOS ARE NOT CREATED ON THE DTResolutionAnalysisTask module |
897 |
– |
/- They are still accessible till the calibration validation |
898 |
– |
/- (For few statistics they are not very usefull anyway) |
899 |
– |
|
900 |
– |
// Residuals as a function of the position Histos ---------------------------- |
901 |
– |
// Loop over all the chambers |
902 |
– |
vector<DTChamber*>::const_iterator ch_reso2_it = myMuonGeom->chambers().begin(); |
903 |
– |
vector<DTChamber*>::const_iterator ch_reso2_end = myMuonGeom->chambers().end(); |
904 |
– |
for (; ch_reso2_it != ch_reso2_end; ++ch_reso2_it) { |
905 |
– |
DTChamberId ch = (*ch_reso2_it)->id(); |
906 |
– |
stringstream wheel; wheel << ch.wheel(); |
907 |
– |
stringstream station; station << ch.station(); |
908 |
– |
stringstream sector; sector << ch.sector(); |
909 |
– |
if (ch.sector() == sec && ch.wheel() == wh ) { |
910 |
– |
vector<const DTSuperLayer*>::const_iterator slIt = (*ch_reso2_it)->superLayers().begin(); |
911 |
– |
vector<const DTSuperLayer*>::const_iterator slEnd = (*ch_reso2_it)->superLayers().end(); |
912 |
– |
// Loop over the SLs |
913 |
– |
for(; slIt != slEnd; ++slIt) { |
914 |
– |
DTSuperLayerId sl = (*slIt)->id(); |
915 |
– |
stringstream superLayer; superLayer << sl.superlayer(); |
916 |
– |
|
917 |
– |
string resoFolder = myMainFolder + "DTResolutionAnalysisTask/Wheel" + wheel.str(); |
918 |
– |
string histo_name = resoFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/hResDistVsDist_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" + superLayer.str(); |
919 |
– |
TProfile *histo = (TProfile*) myFile -> Get(histo_name.c_str()); |
920 |
– |
if(histo){ |
921 |
– |
int pad = (ch.station() - 1)*3 + sl.superlayer(); |
922 |
– |
myCanvas->cd(pad); |
923 |
– |
histo->GetXaxis()->SetTitle(" Hit position in cell (cm) "); |
924 |
– |
histo->SetStats(0); |
925 |
– |
histo->GetXaxis()->SetLabelSize(0.08); |
926 |
– |
histo->GetYaxis()->SetLabelSize(0.08); |
927 |
– |
histo->Draw("colz"); |
928 |
– |
} |
929 |
– |
} // next SL |
930 |
– |
} // endif sector == sec && ch.wheel() == wh |
931 |
– |
} // next chamber |
932 |
– |
myCanvas->Update(); |
933 |
– |
//myCanvas->Print("HitRes_vs_position_in_cell.gif"); |
934 |
– |
sprintf(myGifName,"HitRes_vs_position_in_cell_r%s_W%dS%d.gif",myRunNumber,wh,sec); |
935 |
– |
myCanvas->Print(myGifName); |
936 |
– |
psFile.NewPage(); |
937 |
– |
*/ |
938 |
– |
|
774 |
|
} |
775 |
|
|
776 |
|
|
779 |
|
stringstream wheel; wheel << wh; |
780 |
|
stringstream sector; sector << sec; |
781 |
|
|
782 |
< |
string efficiencyFolder = myMainFolder + "Tests/DTEfficiency/Wheel" + wheel.str(); |
782 |
> |
string efficiencyFolder = myMainFolder + "DTEfficiencyTask/Wheel" + wheel.str() ; |
783 |
|
vector<DTChamber*>::const_iterator chEffIt = myMuonGeom->chambers().begin(); |
784 |
|
vector<DTChamber*>::const_iterator chEffEnd = myMuonGeom->chambers().end(); |
785 |
|
|
804 |
|
DTLayerId layerId = (*lIt)->id(); |
805 |
|
stringstream layer; layer << layerId.layer(); |
806 |
|
|
807 |
< |
string histoName = efficiencyFolder + "/Station" + station.str() + "/Sector" + sector.str() + "/Efficiency_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" + superLayer.str() + "_L" + layer.str(); |
808 |
< |
TH1F *histoEff = (TH1F*) myFile -> Get(histoName.c_str()); |
807 |
> |
string histoName1 = efficiencyFolder + "/Station" + station.str() + "/Sector" + sector.str() |
808 |
> |
+ "/SuperLayer" + superLayer.str() + "/hRecSegmOccupancy_W" + wheel.str() + "_St" + station.str() |
809 |
> |
+ "_Sec" + sector.str() + "_SL" + superLayer.str()+ "_L" + layer.str(); |
810 |
> |
string histoName2 = efficiencyFolder + "/Station" + station.str() + "/Sector" + sector.str() |
811 |
> |
+ "/SuperLayer" + superLayer.str() + "/hEffUnassOccupancy_W" + wheel.str() + "_St" + station.str() |
812 |
> |
+ "_Sec" + sector.str() + "_SL" + superLayer.str()+ "_L" + layer.str(); |
813 |
> |
TH1F *histoAll = (TH1F*) myFile -> Get(histoName1.c_str()); |
814 |
> |
TH1F *histoEff = NULL ; |
815 |
> |
if(myFile -> Get(histoName2.c_str())) |
816 |
> |
histoEff = (TH1F*) myFile -> Get(histoName2.c_str())->Clone("histoEff"); |
817 |
> |
|
818 |
> |
|
819 |
|
if(histoEff){ |
820 |
|
found = true; |
821 |
+ |
|
822 |
+ |
int nb1=histoAll->GetNbinsX(); |
823 |
+ |
int nb2=histoEff->GetNbinsX(); |
824 |
+ |
if(nb1 != nb2){ throw cms::Exception("DTDPGCreateSummaryError") << "[DTDPGCreateSummary]: ERROR : mistmach on number of bins" << endl;} |
825 |
+ |
for(int ibin=1;ibin<nb1;ibin++) |
826 |
+ |
{ |
827 |
+ |
float xpos1=histoEff->GetBinContent(ibin); |
828 |
+ |
float xpos2=histoAll->GetBinContent(ibin); |
829 |
+ |
if(xpos2>0)histoEff->SetBinContent(ibin,xpos1/xpos2); |
830 |
+ |
else histoEff->SetBinContent(ibin,0.); |
831 |
+ |
} |
832 |
+ |
|
833 |
|
int pad = (sl.superlayer() - 1)*4 + layerId.layer(); |
834 |
|
myCanvas->cd(pad); |
835 |
|
histoEff->SetMinimum(0.); |
850 |
|
int nb=histoEff->GetNbinsX(); |
851 |
|
for(int ib=1;ib<nb+1;ib++) |
852 |
|
{ |
996 |
– |
//float xc=histo->GetBinCenter(ib); |
853 |
|
if(histoEff->GetBinContent(ib)<0.02 && histoCheck->GetBinContent(ib)>3) |
854 |
|
histoDead->SetBinContent(ib,1.3); |
855 |
|
else |
856 |
|
histoDead->SetBinContent(ib,0.0); |
857 |
|
|
1002 |
– |
//if(histo->GetBinContent(ib)<0.02) |
1003 |
– |
// cout << "MB" << station.str() << " SL"<< superLayer.str() << " L" << layer.str() |
1004 |
– |
// << "C" << xc << ">>> "<< histo->GetBinContent(ib) << endl; |
1005 |
– |
|
858 |
|
} |
859 |
|
histoDead->SetFillColor(5); |
860 |
|
histoDead->Draw("histsame"); |
861 |
|
histoEff->Draw("same"); |
1010 |
– |
|
862 |
|
} |
863 |
|
} |
864 |
|
} |