ATLAS Offline Software
Loading...
Searching...
No Matches
CscCalibMonToolBase.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#include "TProfile.h"
7#include "TH1F.h"
8#include "TH1I.h"
9#include "TH2F.h"
10#include <sstream>
11#include <utility>
12
13#include "CscCalibMonToolBase.h"
14
15CscCalibMonToolBase::CscCalibMonToolBase(const std::string & type, const std::string & name, const IInterface* parent) :
16 ManagedMonitorToolBase(type, name, parent),
17 m_maxHashId(0),
18 m_maxChamId(0),
19 m_numBad(0),
21 m_detailedHashIds(nullptr),
23 m_hashName("hash_overview"),
24 m_hashTitle(""),
25 m_allChan1dName("all_chan_1d"),
26 m_allChan1dTitle("(View of All Channels)"),
27 m_allChan2dName("all_chan_2d"),
28 m_allChan2dTitle("(View of All Channels)"),
29 m_chamProfName("profile_all_sectors"),
30 m_chamProfTitle(""),
31 m_layHistName("overview"),
32 m_layHistTitle(""),
33 m_chamSummHistName("spectrum"),
35 m_chamHistName("overview"),
36 m_chamHistTitle(""),
37 m_laySummHistName("spectrum"),
39 m_histCol(kAzure +1),
40 m_histColAlert(kRed),
41 m_monGroupVec(nullptr),
42 m_statDbColl(nullptr)
43{
44
45 declareProperty("MakeAllChanHashOverviewHists",m_makeHashHists=true); //Histograms showing a parameter for allchannels
46 declareProperty("MakeAllChan1dHists",m_makeAllChan1dHists=true); //Histograms showing a parameter for allchannels
47 declareProperty("MakeAllChan2dHists",m_makeAllChan2dHists=true); //Histograms showing a parameter for allchannels
48 declareProperty("MakeLayerOverviewHists",m_makeLayHists = true);
49 declareProperty("MakeLayerValueViewHists", m_makeLaySummHists = true);
50 declareProperty("MakeChamberProfiles", m_makeChamProfs = true);
51 declareProperty("MakeChamberValueViewHists", m_makeChamSummHists =true);
52 declareProperty("MakeChamberOverviewHists", m_makeChamHists =true);
53 declareProperty("MaxDetailedChannels",m_maxDetailedChannels = -1); //-1 = all that show problems
54 declareProperty("CscCalibResultKey", m_calibResultKey = ""); //TDS key, defaulted in derived class
55 declareProperty("GetDebugForAllChannels", m_doAllDetailed = false);
56 declareProperty("DoBadDetailed", m_doBadDetailed = false, "Store histograms for channels marked as bad");
57 declareProperty("DoStatDb", m_doStatDb = true);
58}
59
60/*-----------------------------------------------------*/
62{
63 // init message stream - Part 1: Get the messaging service, print where you are
64 ATH_MSG_INFO( "CscCalibMonToolBase : in initialize()" );
65
66 ATH_CHECK( m_idHelperSvc.retrieve() );
67 ATH_CHECK( m_readKey.initialize() );
68
69 //m_generic_path_csccalibmonitoring = "Muon/MuonCalibrationMonitoring/CSC";
71
72
73 //Find valid hashes
74 ATH_MSG_DEBUG( "Expected chamber layer " << m_expectedChamberLayer );
75 ATH_MSG_DEBUG( "Constructing list of expected chamber layers" );
76
77 //Loop through ids to find out what hash range we're working on, and to
78 //initialize histograms.
79 IdContext chanContext = m_idHelperSvc->cscIdHelper().channel_context();
80 const std::vector<Identifier> & ids = m_idHelperSvc->cscIdHelper().idVector();
81 m_maxHashId = 0;
82 m_maxChamId = 0;
83 for(const auto & thisChamberId:ids)
84 {
85 IdentifierHash chamberHash;
86 m_idHelperSvc->cscIdHelper().get_module_hash(thisChamberId,chamberHash);
87 if(chamberHash > m_maxChamId)
88 m_maxChamId = chamberHash;
89
90 std::vector<Identifier> stripVect;
91 m_idHelperSvc->cscIdHelper().idChannels(thisChamberId,stripVect);
92 for(const auto & thisStrip:stripVect)
93 {
94 IdentifierHash stripHash;
95 m_idHelperSvc->cscIdHelper().get_channel_hash(thisStrip,stripHash);
96 bool measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(thisStrip);
97 //Find maximum hash
98 if((unsigned int)stripHash > m_maxHashId)
99 m_maxHashId = (int)stripHash;
100
102 == (unsigned int)m_idHelperSvc->cscIdHelper().chamberLayer(thisStrip)
103 )
104 {
105 ATH_MSG_VERBOSE( "hash " << (int)stripHash << " is expected" );
106 m_expectedHashIdsAll.insert(stripHash);
107 if(!measuresPhi){
108 ATH_MSG_VERBOSE( "hash " << (int)stripHash << " is prec and expected" );
109 m_expectedHashIdsPrec.insert(stripHash);
110 }
111 }
112 else
113 ATH_MSG_VERBOSE( "hash " << (int)stripHash << " is NOT expected (Not a bug, just populating list)." );
114 }//End strip loop
115 }//End chamber loop
116
117 //m_detailedHashIds determines which hashes we're going to look at detailed histograms for.
118 m_detailedHashIds = new bool[m_maxHashId+1];
119 for(unsigned int chanItr =0; chanItr <= m_maxHashId; chanItr++)
120 m_detailedHashIds[chanItr] = false;
121
122 //This needs to be initialized before we book any hist Collecitons
123 ATH_MSG_INFO( "Initializing ManagedMonitorToolBase" );
124 ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code;
125
126
127 return StatusCode::SUCCESS;
128}//end initialize()
129
131{
132 delete [] m_detailedHashIds;
133 delete m_statDbColl;
134
135 return ManagedMonitorToolBase::finalize();
136}//end finalize()
137
138
140 const std::string & dataTypeName, const std::string & dataTypeTitle, const std::string & categoryName, const std::string & categoryTitle,
141 const std::string & axisLabel, int numBins, float lowBound, float highBound, const std::string & parDir,
142 uint16_t toSkip)
143{
144 //toSkip bitmask:
145 //00000000 do all
146 //00000001 skip all channels hash view
147 //00000010 skip chamberAverage
148 //00000100 skip layer overview
149 //00001000 skip sector summary
150 //00010000 skip layer summary
151 //00100000 skip AllChannels 1d view
152 //00100000 skip AllChannels 2d view
153 //01000000 skip csc spectra
154 //10000000 skip sector overview
155
156 //Make sure last character isn't a "/"
157 std::string endDir = "";
158 if(parDir != "")
159 endDir = "/" + parDir;
160
161 //Some universal directories
162 std::string allChambersDirectory = "/GeneralCscHists";
163
164 //Set directory structure used by CscCalibMonToolBase
165 /*
166 m_hashPath = m_generic_path_csccalibmonitoring + allChambersDirectory + "/AllChanHash" + endDir;
167 m_allChan2dPath = m_generic_path_csccalibmonitoring + allChambersDirectory + "/AllChan2d" + endDir;
168 m_chamProfPath = m_generic_path_csccalibmonitoring + allChambersDirectory + "/SectorProfiles" + endDir;
169 m_layHistPath = m_generic_path_csccalibmonitoring + "/EXPERT/" + parDir + "Layers";
170 m_chamSummHistPath = m_generic_path_csccalibmonitoring + "/EXPERT/" + parDir + "ChamberValueSpectrum";
171 m_laySummHistPath = m_generic_path_csccalibmonitoring + "/EXPERT/" + parDir + "LayerValueSpectrum";
172 */
173 bool allGood = true;
174
175
176 std::string nameStart = dataTypeName;
177 if(categoryName != "" )
178 nameStart += "_" + categoryName;
179
180 std::string titleStart = categoryTitle + " " + dataTypeTitle;
181 std::string yaxis= "", xaxis = "";
182
183 ATH_MSG_DEBUG( "In bookHistCollection for " << nameStart << " series." );
184
185 if(!((toSkip>>6) &0x1)){
186 histCollection->cscSpec.resize(2,nullptr);
187 for(int measuresPhi =0; measuresPhi <=1; measuresPhi++) {
188 std::string name = "h_" + nameStart+ "_" + (measuresPhi ? "phi" : "eta") + "_spectrum" ;
189 std::string title = titleStart +" " + (measuresPhi ? "Phi Strips" : "Eta Strips") + " spectrum";
190 TH1F * specHist = new TH1F(name.c_str(), title.c_str(), numBins, lowBound, highBound);
191 specHist->GetYaxis()->SetTitle("Counts");
192 specHist->GetXaxis()->SetTitle(axisLabel.c_str());
193 std::string specPath = getFullPath( getGeoPath(), "OverviewSpectra", parDir);
194 MonGroup monGroup( this, specPath, run, ATTRIB_MANAGED);
195 StatusCode sc = monGroup.regHist(specHist);
196
197 specHist->SetFillColor(m_histCol);
198
199 if(!sc.isSuccess())
200 {
201 ATH_MSG_ERROR( "failed to register " << name );
202 allGood = false;
203 }
204 else
205 histCollection->cscSpec[measuresPhi] = specHist;
206 }
207
208
209 }
210
211 if(m_makeHashHists && !(toSkip & 0x1))
212 {
213 std::string name = "h_" + nameStart + "_" + m_hashName;
214 std::string title = categoryTitle + " " + dataTypeTitle + " " + m_hashTitle;
215 yaxis = axisLabel;
216 xaxis = "Channel Hash ID";
217 TH1F * hashHist = new TH1F(name.c_str(), title.c_str(), m_maxHashId+1,0,m_maxHashId+1);
218 hashHist->GetXaxis()->SetTitle(xaxis.c_str());
219 hashHist->GetYaxis()->SetTitle(yaxis.c_str());
220 hashHist->SetFillColor(m_histCol);
221
222 std::string hashPath = getFullPath( getGeoPath(), "FullViewHash", parDir);
223 MonGroup monGroup( this, hashPath, run, ATTRIB_MANAGED);
224 ATH_MSG_DEBUG( "Registering " << name );
225 if (!monGroup.regHist(hashHist).isSuccess())
226 {
227 ATH_MSG_ERROR( "failed to register " << name );
228 allGood = false;
229 }
230 else
231 histCollection->hashHist = hashHist;
232
233 }
234 //All channels 1d view
235 if(m_makeAllChan1dHists && !((toSkip>>6) & 0x1))
236 {
237
238 std::string name = "h_" + nameStart + "_" + m_allChan1dName;
239 std::string title = categoryTitle + " " + dataTypeTitle + " " + m_allChan1dTitle;
240 yaxis = axisLabel;
241 xaxis = "Chamber";
242 int nxbins = 26146;// 4 layers, 192 channels each, with 32 chambers + 2 "extra" chambers"
243 float nxmin = -16; // -1 (for EC)
244 float nxmax = 16; // 1 (for EA)
245
246 TH1F * allChan1dHistX = new TH1F((name+"X").c_str(), (title+ " - Precision strips").c_str(),
247 nxbins,nxmin,nxmax);
248 allChan1dHistX->GetXaxis()->SetTitle(xaxis.c_str());
249 allChan1dHistX->GetYaxis()->SetTitle(yaxis.c_str());
250
251 std::string allChan1dPath = getFullPath( getGeoPath(), "FullView1d", parDir);
252 MonGroup monGroup( this, allChan1dPath, run, ATTRIB_MANAGED );
253 ATH_MSG_DEBUG( "Registering " << name );
254 if (!monGroup.regHist(allChan1dHistX).isSuccess())
255 {
256 ATH_MSG_ERROR( "failed to register " << name );
257 allGood = false;
258 }
259 else
260 histCollection->allChan1dHistX = allChan1dHistX;
261
262 nxbins = 6562;
263
264 TH1F * allChan1dHistY = new TH1F((name+"Y").c_str(), (title + " - Transverse strips").c_str(),
265 nxbins,nxmin,nxmax);
266 allChan1dHistY->GetXaxis()->SetTitle(xaxis.c_str());
267 allChan1dHistY->GetYaxis()->SetTitle(yaxis.c_str());
268
269 ATH_MSG_DEBUG( "Registering " << name );
270 if (!monGroup.regHist(allChan1dHistY).isSuccess())
271 {
272 ATH_MSG_ERROR( "failed to register " << name );
273 allGood = false;
274 }
275 else
276 histCollection->allChan1dHistY = allChan1dHistY;
277
278
279 }
280
281 //All channels 2d view
282 if(m_makeAllChan2dHists && !((toSkip>>6) & 0x1))
283 {
284
285 std::string name = "h_" + nameStart + "_" + m_allChan2dName;
286 std::string title = categoryTitle + " " + dataTypeTitle + " " + m_allChan2dTitle;
287 //yaxis = "sector + 0.2 * (layer - 1) + 0.1";
288 yaxis = "Sector/Layer";
289 xaxis = "Strip Number (Negative for Transverse Strips)";
290
291 int nxbins ;
292 float nxmin;
293 float nxmax;
294 int nybins ;
295 float nymin;
296 float nymax;
297 if(histCollection->ignoreY){
298 nxbins = 193; // 192 bins for precision + 1 extra
299 nxmin = 0.; // -1 -> -48 (for transverse)
300 nxmax = 193.; // 1 -> 192 (for precision)
301 nybins = 175; // 32 chambers (16 per side x 5 layers per chamber) + 5 extra
302 nymin = -17.; //
303 nymax = 18.; //
304 }
305 else{
306 nxbins = 242; // 192 bins for precision, 48 for transverse strips + 2 extra
307 nxmin = -49.; // -1 -> -48 (for transverse)
308 nxmax = 193.; // 1 -> 192 (for precision)
309 nybins = 175; // 32 chambers (16 per side x 5 layers per chamber) + 5 extra
310 nymin = -17.; //
311 nymax = 18.; //
312 }
313
314 TH2F * allChan2dHist = new TH2F(name.c_str(), title.c_str(),
315 nxbins,nxmin,nxmax,nybins,nymin,nymax);
316 allChan2dHist->GetXaxis()->SetTitle(xaxis.c_str());
317 allChan2dHist->GetYaxis()->SetTitle(yaxis.c_str());
318
319 std::string allChan2dPath = getFullPath( getGeoPath(), "FullView2d", parDir);
320 MonGroup monGroup( this, allChan2dPath, run, ATTRIB_MANAGED);
321 ATH_MSG_DEBUG( "Registering " << name );
322 if (!monGroup.regHist(allChan2dHist).isSuccess())
323 {
324 ATH_MSG_ERROR( "failed to register " << name );
325 allGood = false;
326 }
327 else
328 histCollection->allChan2dHist = allChan2dHist;
329
330 }
331
332 if(m_makeChamProfs && !((toSkip >> 1) & 0x1) )
333 {
334 std::string name = "h_" + nameStart + "_" + m_chamProfName;
335 std::string title = titleStart + " " + m_chamProfTitle;
336 yaxis = "Average " + axisLabel;
337 xaxis = "Sector * eta";
338 int numSectors = 16;
339 TProfile * chamProf= new TProfile(name.c_str(), title.c_str(),
340 numSectors + 1, -16, 17); //hard coding these because its annoying otherwise
341 chamProf->GetXaxis()->SetTitle(xaxis.c_str());
342 chamProf->GetYaxis()->SetTitle(yaxis.c_str());
343
344 ATH_MSG_DEBUG( "Registering " << name );
345 std::string path = getFullPath( getGeoPath(), "Profiles", parDir);
346 MonGroup monGroup( this, path, run, ATTRIB_MANAGED);
347 if (!monGroup.regHist(chamProf).isSuccess())
348 {
349 ATH_MSG_ERROR( "failed to register " << name );
350 allGood = false;
351 }
352 else
353 histCollection->chamProf = chamProf;
354 }
355 if(m_makeLayHists && !((toSkip >> 2) & 0x1) )
356 {
357 std::string namePrefix = nameStart + "_" + m_layHistName;
358 std::string titlePrefix = titleStart + " " + m_layHistTitle;
359 yaxis = axisLabel;
360 xaxis = "Channel";
361
362 ATH_MSG_DEBUG( "Registering set with prefix" << namePrefix );
363 histCollection->layHistVect = new std::vector<TH1F*>();
364 if (!bookLayHists("LayerView", parDir, *histCollection->layHistVect,namePrefix, titlePrefix, "Channel", xaxis
365 ,true, histCollection->ignoreY).isSuccess())
366 {
367 ATH_MSG_ERROR( "failed to register " << namePrefix << " (layer histograms) " );
368 allGood = false;
369 }
370 }
371
372 if(m_makeChamSummHists && !((toSkip >> 3) & 0x1) )
373 {
374 std::string namePrefix = nameStart + "_" + m_chamSummHistName;
375 std::string titlePrefix = titleStart + " " + m_chamSummHistTitle;
376 yaxis = "";
377 xaxis = axisLabel;
378
379 ATH_MSG_DEBUG( "Registering set with prefix" << namePrefix );
380 histCollection->chamSummVect = new std::vector<TH1F*>();
381 if (!bookChamHists("SecSpectrum", parDir,*histCollection->chamSummVect,namePrefix, titlePrefix, xaxis,yaxis,
382 false,histCollection->ignoreY,numBins,lowBound,highBound).isSuccess())
383 {
384 ATH_MSG_ERROR( "failed to register " << namePrefix
385 << " (chamber summary histograms) " );
386 allGood = false;
387 }
388 }
389
390 if(m_makeChamHists && !((toSkip >> 7) & 0x1) )
391 {
392 std::string namePrefix = nameStart + "_" + m_chamHistName;
393 std::string titlePrefix = titleStart + " " + m_chamHistTitle;
394 yaxis = "";
395 xaxis = axisLabel;
396
397 ATH_MSG_DEBUG( "Registering set with prefix" << namePrefix );
398 histCollection->chamHistVect = new std::vector<TH1F*>();
399 if (!bookChamHists("SectorView", parDir,*histCollection->chamHistVect,namePrefix, titlePrefix, xaxis,yaxis,
400 true,histCollection->ignoreY).isSuccess())
401 {
402 ATH_MSG_ERROR( "failed to register " << namePrefix
403 << " (chamber summary histograms) " );
404 allGood = false;
405 }
406 }
407
408 if(m_makeLaySummHists && !((toSkip >> 4) & 0x1) )
409 {
410 std::string namePrefix = nameStart + "_" + m_laySummHistName;
411 std::string titlePrefix = titleStart + " " + m_laySummHistTitle;
412 yaxis = "";
413 xaxis = axisLabel;
414
415 ATH_MSG_DEBUG( "Registering set with prefix" << namePrefix );
416 histCollection->laySummVect = new std::vector<TH1F*>();
417 if (!bookLayHists("LaySpectrum", parDir, *histCollection->laySummVect,
418 namePrefix, titlePrefix, xaxis,yaxis,
419 false,histCollection->ignoreY,numBins,lowBound,highBound).isSuccess())
420 {
421 ATH_MSG_ERROR( " Failed to register " << namePrefix << " (Layer summary hists) " );
422 allGood = false;
423 }
424 }
425 if(allGood)
426 return StatusCode::SUCCESS;
427 else
428 return StatusCode::FAILURE;
429}//end bookHistCollection
430
431StatusCode
432CscCalibMonToolBase::bookLayHists(const std::string & histTypeDir, const std::string & parDir,/* MonGroup &monGroup,*/
433 std::vector<TH1F*> & histVector, const std::string & namePrefix, const std::string & titlePrefix,
434 const std::string & xaxis, const std::string & yaxis,
435 bool chanView, bool ignoreY, unsigned int numBins,
436 float lowBound, float highBound)
437{
438 //Book a set of histograms, one for each layer.
439 //chanView = true ignores numBins and bounds and makes x-axis based on channel ids
440 //ignore Y = true skips transverse direction strips
441
442 //unsigned int numStrips;
443 int stationSize, stationPhi, stationEta, sector;
444 std::string stationName;
445 std::string orientationName = "prec";
446 std::string orientationTitle = "Precision Direction";
447
448 int numHists = 32 * ( (ignoreY) ? 4 : 8);
449 histVector.resize(numHists,nullptr);
450
451 ATH_MSG_DEBUG( "Allocated space for " << numHists << " histograms" );
452
453 const std::vector<Identifier> & ids = m_idHelperSvc->cscIdHelper().idVector();
454 for(const auto & thisChamberId:ids)
455 {
456 IdentifierHash chamHash;
457 m_idHelperSvc->cscIdHelper().get_module_hash(thisChamberId,chamHash);
458 ATH_MSG_DEBUG( "Booking histograms for chamber with hash " << (int)chamHash );
459
460 stationSize = m_idHelperSvc->cscIdHelper().stationName(thisChamberId);
461 stationName = m_idHelperSvc->cscIdHelper().stationNameString(stationSize);
462 stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(thisChamberId);
463 stationEta = m_idHelperSvc->cscIdHelper().stationEta(thisChamberId);
464 sector = getSector(stationPhi,stationSize);
465 for(unsigned int orientationItr = 0; orientationItr < 2; orientationItr++)
466 {
467 if(orientationItr ==1)
468 {
469 if(ignoreY) //skip non precision strips
470 continue;
471 if(chanView) //Base bin labels on orientation
472 {
473 numBins = 48;
474 highBound = 49;
475 lowBound = 1;
476 }
477 orientationName = "trans";
478 orientationTitle = "Transverse Direction";
479 }
480 else
481 {
482 if(chanView)
483 {
484 numBins = 192;
485 highBound = 193;
486 lowBound = 1;
487 }
488 orientationName = "prec";
489 orientationTitle = "Precision Direction";
490 }
491
492 for(unsigned int layItr = 1; layItr <= 4; layItr++)
493 {
494 ATH_MSG_VERBOSE( "Storing a hist on orientation " << orientationItr
495 << " With highbound/lowbound/nbins "
496 << highBound << "/" << lowBound << "/" << numBins );
497
498 std::stringstream nameStream;
499 nameStream.setf(std::ios::right, std::ios::adjustfield);
500 nameStream << namePrefix;
501 nameStream << "_" << orientationName << "_eta_";
502 nameStream << ((stationEta == 1) ? "1" : "0");
503 nameStream << "_sector_" << std::setw(2) << std::setfill('0') << sector;
504 nameStream << "_layer_" << layItr;
505
506 std::stringstream titleStream;
507 titleStream << titlePrefix << ", " << orientationTitle;
508 titleStream << ", Sector " << sector;
509 titleStream <<", Eta " << stationEta;
510 titleStream << ", Layer " << layItr;
511
512 ATH_MSG_VERBOSE( "Storing " << nameStream.str() << " with title "
513 << titleStream.str() << "On orientation " << orientationItr << " With highbound/lowbound/nbins " << highBound << "/" << lowBound << "/" << numBins );
514
515 TH1F* hist = new TH1F(nameStream.str().c_str(), titleStream.str().c_str(),
516 numBins, lowBound, highBound);
517 hist->GetXaxis()->SetTitle(xaxis.c_str());
518 hist->GetYaxis()->SetTitle(yaxis.c_str());
519 hist->SetFillColor(m_histCol);
520
521 int layIndex = getLayIndex(orientationItr,stationEta,sector,layItr);
522
523 //Lets
524 std::string geoPath = getGeoPath(stationEta, sector, layItr, orientationItr);
525 std::string path = getFullPath(geoPath, histTypeDir, parDir);
526 MonGroup monGroup( this, path ,run, ATTRIB_MANAGED);
527
528
529 if(!monGroup.regHist(hist).isSuccess())
530 {
531 ATH_MSG_FATAL( "Failed to register " << nameStream.str()
532 << " with layIndex" << layIndex );
533 return StatusCode::FAILURE;
534 }
535 else
536 {
537 ATH_MSG_DEBUG( "Succesfully registered histogram with layIndex "
538 << layIndex <<" and name " << hist->GetName() );
539 histVector[layIndex] = hist;
540 }
541 }//end layer loop
542 }//End orientation loop
543 }//End chamber loop
544 return StatusCode::SUCCESS;
545}//end bookLayHists
546
547//NOTE: Chanview mode isn't implemented!
548StatusCode CscCalibMonToolBase::bookChamHists(const std::string & histTypeDir, const std::string & parTypeDir, std::vector<TH1F*>& histVector,
549 const std::string & namePrefix, const std::string & titlePrefix,
550 const std::string & xaxis, const std::string & yaxis, bool chanView,
551 bool ignoreY, unsigned int numBins,
552 float lowBound, float highBound)
553{
554 //When doing channel view (i.e. one value per channel, also refered to as SectorView)
555 //we use pre-defined nbins, lower bound, and upper bound for histograms for obvious reasons
556 static const int chanViewNBinsX = 800;
557 static const double chanViewLowBoundX = .5;
558 static const double chanViewHighBoundX = 800.5;
559
560 static const int chanViewNBinsY = 200;
561 static const double chanViewLowBoundY = .5;
562 static const double chanViewHighBoundY = 200.5;
563
564
565 //Book a set of channel view histograms.
566 //unsigned int numStrips;
567 int stationSize, stationPhi, stationEta, sector;
568 std::string stationName;
569 std::string orientationName = "prec";
570 std::string orientationTitle = "Precision Direction";
571
572 int numHists = (ignoreY) ? 32 : 64; //32 chambers, 2 orientations
573 histVector.resize(numHists,nullptr);
574
575 const std::vector<Identifier> & ids = m_idHelperSvc->cscIdHelper().idVector();
576
577 for(const auto & thisChamberId:ids)
578 {
579 IdentifierHash chamHash;
580 m_idHelperSvc->cscIdHelper().get_module_hash(thisChamberId,chamHash);
581 ATH_MSG_DEBUG( "Booking histograms for chamber with hash " << (int)chamHash );
582
583 stationSize = m_idHelperSvc->cscIdHelper().stationName(thisChamberId); //50
584 stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(thisChamberId);
585 stationEta = m_idHelperSvc->cscIdHelper().stationEta(thisChamberId);
586 sector = getSector(stationPhi,stationSize);
587
588 for(unsigned int orientationItr = 0; orientationItr < 2; orientationItr++)
589 {
590 if(orientationItr ==1)
591 {
592 if(ignoreY)
593 continue; //skip non precision strips.
594 orientationName = "trans";
595 orientationTitle = "Transverse Direction";
596 if(chanView){
597 numBins = chanViewNBinsY;
598 lowBound = chanViewLowBoundY;
599 highBound = chanViewHighBoundY;
600 }
601 }
602 else
603 {
604 orientationName = "prec";
605 orientationTitle = "Precision Direction";
606 if(chanView){
607 numBins = chanViewNBinsX;
608 lowBound = chanViewLowBoundX;
609 highBound = chanViewHighBoundX;
610 }
611 }
612
613 std::stringstream nameStream;
614 nameStream.setf(std::ios::right, std::ios::adjustfield);
615 nameStream << namePrefix << "_" << orientationName << "_eta_"
616 << ((stationEta == 1) ? "1" : "0") << "_sector_"
617 << std::setw(2) << std::setfill('0')
618 << sector ;
619
620 std::stringstream titleStream;
621
622 titleStream << titlePrefix << ", " << orientationTitle
623 << ", Eta " << stationEta
624 << ", Sector " << sector;
625
626 TH1F* hist = new TH1F(nameStream.str().c_str(), titleStream.str().c_str()
627 ,numBins, lowBound, highBound);
628 hist->GetXaxis()->SetTitle(xaxis.c_str());
629 hist->GetYaxis()->SetTitle(yaxis.c_str());
630 hist->SetFillColor(m_histCol);
631
632 int chamIndex = getChamIndex(orientationItr,stationEta,sector);
633
634 ATH_MSG_DEBUG( "Registering histogram with name "
635 << hist->GetName() << " and chamIndex " << chamIndex );
636
637 histVector[chamIndex] = hist;
638
639 std::string path = getFullPath(getGeoPath(stationEta,sector), histTypeDir, parTypeDir);
640
641 MonGroup monGroup( this, path ,run, ATTRIB_MANAGED);
642 if (!monGroup.regHist(hist).isSuccess())
643 {
644 ATH_MSG_WARNING("monGroup.regHist(hist) failed for "<< path );
645 }
646 }//End orientation loop
647 }//End chamber loop
648 ATH_MSG_DEBUG( "Exiting bookChamHists" );
649 return StatusCode::SUCCESS;
650}//end bookChamHists
651
653{
654 ATH_MSG_DEBUG( "CscalibMonTool : in bookHistograms()" );
655 if (newRunFlag())
656 {
657
658 //Plot status words. This could be useful to include in all output files, so we'll put
659 //it in the base class here
660 if(m_doStatDb){
661 //This is a histogram collection both derived classes will probably like
662
664 const CscCondDbData* readCdo{*readHandle};
665
667 std::string statDbName = "stat_cool";
668 std::string statDbTitle = "Status Word Value From COOL";
669 std::string statDbAxisLabel = "Stat Word Value";
670 unsigned int statDbNumBins = 8;
671 float statDbMin = -0.5;
672 float statDbMax = 7.5;
673 std::string statDbSubDir = "StatCool";
674
675 StatusCode sc = bookHistCollection(m_statDbColl, statDbName, statDbTitle, "", "",
676 statDbAxisLabel, statDbNumBins, statDbMin, statDbMax, statDbSubDir);
677 if(!sc.isSuccess()){
678 ATH_MSG_WARNING( " Failed to register db stat hists!" );
679 }
680
681 //Loop through channels retrieving status words
682 for(unsigned int chanItr = 0; chanItr <= m_maxHashId; chanItr++){
683 if(m_expectedHashIdsAll.count(chanItr)) {
684 int statWord;
685 if(!readCdo->readChannelStatus(chanItr, statWord).isSuccess()){
686 ATH_MSG_WARNING( "Failed to retrieve statword for hashId "
687 << chanItr );
688 }
689 m_statDbColl->data[chanItr] = (float)statWord;
690 }
691 }//end chanItr llop
692 if(!copyDataToHists(m_statDbColl).isSuccess())
693 {
694 ATH_MSG_WARNING( "copyDataToHists failed in bookHistograms." );
695 }
696 }
697 }
698 return StatusCode::SUCCESS;
699}//end bookHistograms
700
702{
703
704 ATH_MSG_DEBUG( "CscCalibMonToolBase :: in fillHistograms()" );
705
706 return StatusCode::SUCCESS;
707}//end fillHistograms
708
709/*---------------------------------------------------------------------------------------------------------*/
711{
712
713 ATH_MSG_DEBUG( "CscCalibMonToolBase : in procHistograms()" );
714
715 if(endOfRunFlag())
716 {
717 const CscCalibResultContainer* calibContainer = nullptr;
718 if (!evtStore()->retrieve(calibContainer, m_calibResultKey).isSuccess())
719 {
720 ATH_MSG_ERROR( " Cannot retrieve container with name " << m_calibResultKey );
721 return StatusCode::RECOVERABLE;
722 }
723
724 ATH_MSG_DEBUG( "There are " << calibContainer->size() << " parameters to monitor" );
725
726 for(const CscCalibResultCollection* thisParameter: *calibContainer) {
727 ATH_CHECK( handleParameter(thisParameter) );
728 }
729 ATH_CHECK( postProc() );
730 }
731 return StatusCode::SUCCESS;
732}//end procHistograms
733
734
735/*--retrieve histos: Overloaded in derived classes to collect interesting histograms from calibration alg--------*/
737{
738 ATH_MSG_DEBUG( "CscCalibMonToolBase : in postProc()" );
739
740 //This method should be overloaded in a derived class
741
742 return StatusCode::SUCCESS;
743}// end postProc
744
745/*---------------------------------------------------------*/
746StatusCode CscCalibMonToolBase::checkHists(bool /* fromFinalize */)
747{
748
749 ATH_MSG_DEBUG( "CscCalibMonToolBase : in checkHists()" );
750
751 return StatusCode::SUCCESS;
752}
753
754/*--preProcParameter : should be re-defined in derived class to select what histograms and parameters
755 should go into procParameter*/
757{
758 ATH_MSG_DEBUG( "CscCalibMonToolBase : in preProcParameter" );
759 return StatusCode::SUCCESS;
760}
761
762
763/*--procParameter : processes parameter based upon the "set" structs which will be
764 defined in the user's preProcParameter.
765
766 The "processing" done here is simply to retrieve all the new new parameter values, retrieve their
767 corresponding last values from COOL, and find their difference. The value, the old value, and the
768 difference are all put into arrays. These arrays should be passed by the user in handleParameter to copyDataToHists.
769
770 Also inside procParameter, we fill the badHist if we see any problems. We also report any channels missing from the input values.
771 */
773 ProcSetupInfo *procParameterInput)
774{
775 ATH_MSG_DEBUG( "Entering proc parameter for " << parVals->parName() << ". Max diff " << procParameterInput->maxDiff << "." );
776 if (procParameterInput->doChi2)
777 ATH_MSG_DEBUG( " Will retrieve chi2 with expected max of " << procParameterInput->chi2Max );
778
779 //Start with expected channels, remove whenever one is found, leftover are
780 //missing channels
781 std::set<int> missingChannels = procParameterInput->expectedChannels;
782
784 const CscCondDbData* readCdo{*readHandle};
785
786 //--Cycle through values and fill histograms
787 int numFailures = 0, maxFailures = 10;
788 for(const CscCalibResult* chan: *parVals)
789 {
790 const int hashId = chan->hashId();
791 const float val = chan->value();
792 const float error = chan->error();
793 float oldVal = 0;
794
795 //This channel isn't missing
796 missingChannels.erase(hashId);
797
798 //--Compare measured value with an expected value---------------------
799 if(procParameterInput->dbName != "")
800 {
801 //Get expected value from database
802 if(!(readCdo->readChannelParam(hashId, oldVal, procParameterInput->dbName)).isSuccess())
803 {
804 numFailures++;
805 ATH_MSG_WARNING( "CscCalibMonToolBase : Failed to retrieve parameter"
806 << " for channel " << hashId
807 << " from COOL database. Continuing with COOL value = 0"
808 );
809 if(numFailures==maxFailures)
810 {
811 ATH_MSG_FATAL( "CscCalibMonToolBase : "
812 << maxFailures << " failed retrievals. Quiting. " );
813 return StatusCode::FAILURE;
814 }
815 }
816 }
817 else
818 {
819 //No value in database, compare to provided expected value
820 oldVal = procParameterInput->expectedVal;
821 }
822
823 float diff = val - oldVal;
824
825 bool isBad = false;
826 if( std::abs(diff) > procParameterInput->maxDiff)
827 {
828 ATH_MSG_INFO( "CscCalibMonToolBase : Possible problem! " << parVals->parName()
829 << " measurement of " << val << " varies by " << diff
830 << " from expected value of " << oldVal << " on channel with hash Id "
831 << hashId << ". Specified maximum variance is " << procParameterInput->maxDiff );
832 isBad = true;
833 procParameterInput->badHist->Fill(procParameterInput->badBin); //Too high a difference
834 }
835
836 float chi2_ndf = 0;
837 if(procParameterInput->doChi2)
838 {
839 chi2_ndf = chan->chi2()/chan->ndf();
840 if(chi2_ndf > procParameterInput->chi2Max)
841 {
842 procParameterInput->badHist->Fill(procParameterInput->chi2BadBin);
843 isBad = true;
844 }
845 }
846
847 //If there is a bad channel, specify that we want details about it.
848 if( isBad && ( (int)m_numBad <= m_maxDetailedChannels || m_maxDetailedChannels < 0 ) )
849 {
850 if(!m_detailedHashIds[hashId])
851 {
852 m_numBad++;
853 m_detailedHashIds[hashId] = true; //Look closer at this hash id (used in derived class)
854 }
855 }
856
857 (*procParameterInput->vals)[hashId] = val;
858 if((procParameterInput->errors->size()))
859 (*procParameterInput->errors)[hashId] = error;
860 if(procParameterInput->oldVals)
861 (*procParameterInput->oldVals)[hashId] = oldVal;
862 if(procParameterInput->diffs)
863 (*procParameterInput->diffs)[hashId] = diff;
864 if(procParameterInput->doChi2)
865 (*procParameterInput->chi2s)[hashId] = chi2_ndf;
866 //--Print out values channel-by channel sorted by Hash Id-------------------
867 }//End chanItr loop
868
869 if(missingChannels.size() !=0)
870 {
871 for(const auto & thisChan: missingChannels)
872 {
873 if(procParameterInput->missingChans != nullptr)
874 {
875 //If we haven't already noticed that this channel is missing,
876 //increment missing bad bin in badHist.
877 if(!procParameterInput->missingChans->GetBinContent(thisChan+1))
878 procParameterInput->badHist->Fill(procParameterInput->missingBadBin);
879 //Always fill missingChans histogram
880 procParameterInput->missingChans->Fill(thisChan);
881
882 }
883 }
884 }
885 return StatusCode::SUCCESS;
886}
887
888
889/*--makeLayHists : Takes data vector filled in procParameter and fills layer histograms
890 */
892{
893
894 //Determine what histograms we'll make:
895 bool doSpec = true; //(histCollection->cscSpec != NULL);
896 bool doHash = (histCollection->hashHist != nullptr && m_makeHashHists);
897 bool doAllChan1d = (histCollection->allChan1dHistX != nullptr && histCollection->allChan1dHistY != nullptr && m_makeAllChan1dHists);
898 bool doAllChan2d = (histCollection->allChan2dHist != nullptr && m_makeAllChan2dHists);
899 bool doLayChan = (histCollection->layHistVect != nullptr && m_makeLayHists);
900 bool doLaySummary = (histCollection->laySummVect != nullptr && m_makeLaySummHists);
901 bool doChamAvg = (histCollection->chamProf != nullptr && m_makeChamProfs);
902 bool doChamChan = (histCollection->chamSummVect != nullptr && m_makeChamHists);
903 bool doChamSummary = (histCollection->chamSummVect != nullptr && m_makeChamSummHists);
904 bool doErrors = (histCollection->errors.size() != 0); //Changed to a vector, so this
905 // is best way to check at moment
906
907 ATH_MSG_DEBUG( "Copying data to hist collection, doing: All Channels (hash view):"
908 << (int)doHash
909 << "All Channels (1d view) " << (int)doHash
910 << "All Channels (2d view) " << (int)doHash
911 << " layer overview " << (int)doLayChan
912 << " layer spectrum " << (int)doLaySummary
913 << " sector prof " << (int)doChamAvg
914 << " chamber overview " << (int)doChamChan
915 << " chamber spectrum " << (int)doChamSummary
916 );
917
918 //For shorter lines:
919 std::vector<float> & data = histCollection->data;
920 std::vector<float> & errors = histCollection->errors;
921
922 //Loop through all channels, and copy relevant data from channel to histogram.
923 const std::vector<Identifier> & ids = m_idHelperSvc->cscIdHelper().idVector();
924 for(const auto & thisChamberId:ids)
925 {
926 IdentifierHash chamHash;
927 m_idHelperSvc->cscIdHelper().get_module_hash(thisChamberId,chamHash);
928 ATH_MSG_DEBUG( "Copying data to histograms for chamber with hash" << (int)chamHash );
929
930 unsigned int stationSize = m_idHelperSvc->cscIdHelper().stationName(thisChamberId); //51 = large, 50 = small
931
932 unsigned int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(thisChamberId);
933 int stationEta = m_idHelperSvc->cscIdHelper().stationEta(thisChamberId);
934 unsigned int sector = getSector(stationPhi,stationSize);
935 int sectorIndex = sector * stationEta; //Histogram will go from -16 to +16. Bin 0 ignored.
936
937
938
939 std::vector<Identifier> stripVect;
940 m_idHelperSvc->cscIdHelper().idChannels(thisChamberId,stripVect);
941
942 for(const auto & thisStrip:stripVect)
943 {
944 unsigned int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(thisStrip);
945 if(chamberLayer != 2)
946 continue;
947 int measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(thisStrip);
948 if(histCollection->ignoreY && measuresPhi)
949 continue;
950
951 IdentifierHash stripHash;
952 m_idHelperSvc->cscIdHelper().get_channel_hash(thisStrip,stripHash);
953 unsigned int layer = m_idHelperSvc->cscIdHelper().wireLayer(thisStrip);
954 unsigned int strip = m_idHelperSvc->cscIdHelper().strip(thisStrip);
955 float secLayer = (((float)stationEta*sector) + 0.2 * ((float)layer - 1) + 0.1);
956 float datum = data.at(stripHash);
957
958 ATH_MSG_VERBOSE( "Filling all chan for sector: " << sector
959 << "\tlayer: " << layer << "\tstationEta: " << stationEta
960 << "\tsecLayer: " << secLayer
961 << "\tdata: " << datum );
962
963 if(doSpec) {
964 histCollection->cscSpec[measuresPhi]->Fill(datum);
965 }
966 if(doHash)
967 {
968 //copy data array directly to hash histogram with all channels
969 histCollection->hashHist->Fill(stripHash,datum);
970 }
971
972 if(doAllChan1d)
973 {
974 ATH_MSG_VERBOSE( "Filling 1d chan for sector: " << sector
975 << "\tlayer: " << layer << "\tstationEta: " << stationEta
976 << "\tsecLayer: " << secLayer
977 << "\tdata: " << datum );
978 if(measuresPhi){
979
980 double modifiedStripNum =
981 (stationEta *sector)
982 + (layer-1)*.25
983 + ((strip-1) * .25 /(48))
984 ;
985
986 ATH_MSG_VERBOSE( "Modified strip num: " << modifiedStripNum );
987 //copy data array directly to 1d histogram with all channels
988 histCollection->allChan1dHistY->Fill(
989 modifiedStripNum, datum);
990 } else {
991 double modifiedStripNum =
992 (stationEta *sector)
993 + (layer-1)*.25
994 + ((strip-1) * .25 /(192 ))
995 ;
996
997 //copy data array directly to 1d histogram with all channels
998 histCollection->allChan1dHistX->Fill(
999 modifiedStripNum, datum);
1000 }
1001 }
1002
1003 if(doAllChan2d)
1004 {
1005 ATH_MSG_VERBOSE( "Filling 2d chan for sector: " << sector
1006 << "\tlayer: " << layer << "\tstationEta: " << stationEta
1007 << "\tsecLayer: " << secLayer
1008 << "\tdata: " << datum );
1009
1010 //copy data array directly to 2d histogram with all channels
1011 int modifiedStripNum = static_cast<int>(strip) * (measuresPhi ? -1 : 1);
1012 histCollection->allChan2dHist->Fill(
1013 modifiedStripNum, secLayer, std::abs(datum));
1014 }
1015
1016 int layIndex = getLayIndex(measuresPhi,stationEta,sector,layer);
1017 int chamIndex = getChamIndex(measuresPhi,stationEta,sector);
1018 if(doLayChan)
1019 {
1020 //Copy values from data array for this layer to layer histogram
1021 (*(histCollection->layHistVect))[layIndex]->SetBinContent(strip,datum);
1022 if(doErrors)
1023 (*(histCollection->layHistVect))[layIndex]->SetBinError(strip,errors.at(stripHash));
1024 }
1025 if(doLaySummary)
1026 {
1027 //Histogram values for this layer
1028 (*(histCollection->laySummVect))[layIndex]->Fill(datum);
1029
1030 }
1031 if(doChamAvg)
1032 {
1033 //Keeps track of average value for each chamber.
1034 histCollection->chamProf->Fill(sectorIndex,datum);
1035 }
1036 if(doChamSummary)
1037 {
1038 //histogram values for this chamber
1039 (*(histCollection->chamSummVect))[chamIndex]->Fill(datum);
1040 }
1041 if(doChamChan)
1042 {
1043 int shiftedStrip = strip + (layer-1)*( measuresPhi ? 50 : 200);
1044 //Copy values from data array for this chamber to chamber histogram
1045 (*(histCollection->chamHistVect))[chamIndex]->SetBinContent(shiftedStrip,datum);
1046 if(doErrors)
1047 (*(histCollection->chamHistVect))[chamIndex]->SetBinError(shiftedStrip,errors.at(stripHash));
1048 }
1049 }//end strip loop
1050 }//end chamber loop
1051
1052 //probably should put this in its own function at some point
1053
1054 return StatusCode::SUCCESS;
1055}
1056
1057int CscCalibMonToolBase::getLayIndex(int measuresPhi, int stationEta, int sector, int layer)
1058{
1059 int layIndex = measuresPhi*32*4
1060 + ((stationEta ==1) ? 16*4 : 0)
1061 + (sector-1)*4
1062 + layer -1;
1063 return layIndex;
1064}
1065
1066int CscCalibMonToolBase::getChamIndex(int measuresPhi, int stationEta, int sector)
1067{
1068 int chamIndex = measuresPhi*32
1069 + ((stationEta ==1) ? 16 : 0)
1070 + (sector-1);
1071 return( chamIndex);
1072}
1073
1074int CscCalibMonToolBase::getSector(int stationPhi, int stationSize)
1075{
1076 //stationSize : 50 = CSS, 51 = CSL
1077 //Sector 1 : large with athena's stationPhi = 1 (onlinePhi = 0)
1078 //Sector 2 : small with athenas stationPhi = 1 (onlinePhi = 0)
1079 //Sector 3 : large with athenas stationPhi = 2 (onlinePhi = 1)
1080 //etc...
1081 return(2*stationPhi + 50 - stationSize);
1082 //return(2*stationPhi + stationSize - 51);
1083}
1084
1085
1087{
1088 if(eta ==1)
1089 return "A";
1090 if(eta == -1)
1091 return "C";
1092 return "ERROR";
1093}
1094
1095//Geo path creates a directory structure for a histogram based upon where it is in the CSC geometry.
1096//The user fills the data down as far as they like. For example, just filling in eta and sector will provide
1097//a path for a sector-wide histogram.
1098//This provides a centralized location to change the layout of the root output file.
1099std::string CscCalibMonToolBase::getGeoPath( int eta, int sector, int wireLayer, int measuresPhi, int channel )
1100{
1101 std::stringstream ss;
1102
1103 static const std::string histStr = "/_hists";
1104 static const std::string errorDir = "/ERROR";
1105
1106 ss << std::setfill('0');//so we can have uniform numbers
1107
1108
1109 if( eta == -9999 ) //CSC Wide
1110 {
1111 ss << "/CscOverview";
1112 return ss.str();
1113 }
1114
1115 std::string endCap = getEndCap(eta);
1116 if(endCap == "ERROR")
1117 {
1118 ATH_MSG_ERROR( "Eta " << eta << " is invalid. " );
1119 return errorDir;
1120 }
1121
1122 ss << "/EndCap" << endCap;
1123
1124 if(sector == -9999) //Endcap Histogram
1125 {
1126 ss << histStr;
1127 return ss.str();
1128 }
1129
1130 if(sector <1 || sector > 16)
1131 {
1132 ATH_MSG_ERROR( "Sector " << sector << " is invalid. " );
1133 return errorDir;
1134 }
1135
1136 ss << "/Sector" << std::setw(2) << sector;
1137
1138 if(wireLayer == -9999)//Sector (chamber) wide histrogram
1139 {
1140 ss << histStr;
1141 return ss.str();
1142 }
1143
1144 if(wireLayer < 1 || wireLayer > 4)
1145 {
1146 ATH_MSG_ERROR( "WireLayer " << wireLayer << " is invalid." );
1147 return errorDir;
1148 }
1149
1150 ss << "/Layer" << wireLayer;
1151
1152 if(measuresPhi == -9999)//Layer wide histrogram
1153 {
1154 ss << histStr;
1155 return ss.str();
1156 }
1157
1158 if(measuresPhi < 0 || measuresPhi > 1)
1159 {
1160 ATH_MSG_ERROR( "MeasuresPhi " << measuresPhi << " is invalid." );
1161 return errorDir;
1162 }
1163
1164 ss << (measuresPhi ? "/Phi" : "/Eta");
1165 if(channel == -9999) //LayerDirection wide histogram
1166 {
1167 /* Channel histograms don't work (too much memory used by meta data tree), so layer is now our most detailed channel. No need for histStr.
1168 ss << histStr;*/
1169 return ss.str();
1170 }
1171
1172 if( channel < 1 || (measuresPhi && channel > 48) || (!measuresPhi && channel > 192))
1173 {
1174 ATH_MSG_ERROR( "Channel " << channel << " is invalid for a " << (measuresPhi ? "phi layers" : "eta layer") );
1175 return errorDir;
1176 }
1177
1178
1179 ss << "/Channel" << std::setw( measuresPhi ? 2 : 3 ) << channel;
1180
1181 return ss.str();
1182}//end getGeoPath
1183
1184
1185//Produces a full path for a histogram to be placed.
1186std::string CscCalibMonToolBase::getFullPath(const std::string& geoPath, const std::string& histTypeDir, const std::string& parTypeDir)
1187{
1188 std::stringstream ss;
1189
1191
1192 if(histTypeDir != "")
1193 ss << "/" << histTypeDir;
1194
1195 if(parTypeDir != "")
1196 ss << "/" << parTypeDir;
1197
1198 return ss.str();
1199}
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static dqm_algorithms::Chi2Test chi2_ndf("Chi2_per_NDF")
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t ss
static Double_t sc
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
Definition Jet.cxx:631
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
virtual int getSector(int stationPhi, int stationSize)
Produces a sector number from the phi and size of a station.
std::set< int > m_expectedHashIdsPrec
virtual StatusCode postProc()
Run after handleParameter.
std::string getEndCap(int eta)
Gets the letter endcap (A or C) for a given eta index (1,-1)
std::string getGeoPath(int eta=-9999, int sector=-9999, int wireLayer=-9999, int measuresPhi=-9999, int channel=-9999)
getGeoPath creates a directory structure for a histogram based upon where it is in the CSC geometry.
std::string m_calibResultKey
Calibration result storegate key.
virtual StatusCode handleParameter(const CscCalibResultCollection *parVals)
Should be written by user in derived class.
std::string m_hashName
Naming info.
virtual StatusCode bookLayHists(const std::string &histTypeDir, const std::string &parTypeDir, std::vector< TH1F * > &vector, const std::string &namePrefix, const std::string &titlePrefix, const std::string &xaxis, const std::string &yaxis, bool chanView=true, bool ignoreY=false, unsigned int numBins=100, float lowBound=0, float highbound=100)
Books a vector of histograms where each one corresponds to a layer of the CSC secbers.
SG::ReadCondHandleKey< CscCondDbData > m_readKey
Access to COOL database.
std::set< int > m_expectedHashIdsAll
unsigned int m_expectedChamberLayer
virtual StatusCode procHistograms()
At end of run this processes the calibration results and fills the histograms.
virtual int getLayIndex(int measuresPhi, int stationEta, int sector, int layer)
produces a unique number for every layer in the detector
virtual StatusCode fillHistograms()
Standard function for a ManagedMonitorToolBase.
virtual int getChamIndex(int measuresPhi, int stationEta, int sector)
Produces a unique number for every secber in the detector.
virtual StatusCode bookChamHists(const std::string &histTypeDir, const std::string &parTypeDir, std::vector< TH1F * > &histVector, const std::string &namePrefix, const std::string &titlePrefix, const std::string &xaxis="", const std::string &yaxis="", bool chanView=true, bool ignoreY=false, unsigned int numBins=100, float lowBound=0, float highbound=100)
Books a vector of histograms where each one corresponds to a secber of the CSC secbers.
bool m_onlyExpectPrecisionHashIds
Hash Ids one would expect to be in calibration data.
virtual StatusCode initialize()
initializes services, tools, etc.
CscCalibMonToolBase(const std::string &type, const std::string &name, const IInterface *parent)
constructor
HistCollection * m_statDbColl
DataVector< MonGroup > * m_monGroupVec
Keeps track of MonGroups.
std::string getFullPath(const std::string &geoPath, const std::string &histTypeDir, const std::string &parTypeDir)
Geo path creates a directory structure for a histogram based upon its geoPath, the hist type dir (spe...
virtual StatusCode finalize()
deletes private members
virtual StatusCode bookHistCollection(HistCollection *histCollection, const std::string &dataTypeName, const std::string &dataTypeTitle, const std::string &categoryName, const std::string &categoryTitle, const std::string &axisLabel, int numBins, float lowBound, float highBound, const std::string &parDir="", uint16_t toSkip=0)
Initializes the histograms in a histCollection and books them.
virtual StatusCode checkHists(bool fromFinalise)
Standard function for a ManagedMonitorToolBase.
virtual StatusCode copyDataToHists(HistCollection *histCollection)
Fills the histograms in the histCollection based on the data in the std::vector in the HistCollection...
int m_maxDetailedChannels
To keep track of channels that should have more data printed to root file.
std::string m_generic_path_csccalibmonitoring
Path of histograms.
bool m_makeHashHists
Data output options.
virtual StatusCode bookHistograms()
Standard function for a ManagedMonitorToolBase.
virtual StatusCode procParameter(const CscCalibResultCollection *parVals, ProcSetupInfo *simpleSet)
Processors a parameter type.
const std::string & parName() const
the identify of this collection
StatusCode readChannelParam(IdentifierHash hash, T &val, const std::string &parName) const
StatusCode readChannelStatus(IdentifierHash, int &) const
size_type size() const noexcept
Returns the number of elements in the collection.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition IdContext.h:26
This is a "hash" representation of an Identifier.
A container of information describing a monitoring object.
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition run.py:1
Contains an array with data on a per-channel basis, as well as various histograms that give different...
Contains info to be passed to procParameter.