ATLAS Offline Software
L1CaloPprPhos4ShapeCollection.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 
10 #include <sstream>
11 #include <unistd.h>
12 
13 
14 // ROOT includes
15 #include "TTree.h"
16 #include "TFile.h"
17 #include "TProfile.h"
18 #include "TH1.h"
19 #include "TH1F.h"
20 #include "TH2F.h"
21 #include "TCanvas.h"
22 #include "TStyle.h"
23 #include "TSystem.h"
24 #include "TPaveText.h"
25 
26 #include "LWHists/TH2F_LW.h"
27 
28 
30  AthMessaging("L1CaloPprPhos4ShapeCollection"),
31  m_minSignalHeight(30),
32  m_timingRegime("Calib1"),
33  m_histTool(0)
34 {
35  // turn off directory ownership in ROOT
36  TH1::AddDirectory(0);
37 
38  m_isTileRun = false;
39  m_isLArRun = false;
40 
42  m_signalShapes->clear();
44 
45  m_outputFileDirName = ".";
46  m_outputFileName = "shapeMakerData";
47  m_outputFileNamePostfix = "root";
48 
49  m_dbFileName_rawMax = "rawMax";
50  m_dbFileName_rawFit = "rawFit";
51  m_dbFileName_processedMax = "processedMax";
52  m_dbFileName_processedFit = "processedFit";
53  m_outDBFileNamePostfix = "txt";
54 
55  m_outRawCanvasName = "rawShapes";
57  m_outProcessedCanvasName = "processedShapes";
59 
60  m_outputSummaryPlotsFileName = "summary";
63 
64  m_coolIdName = "coolId";
65  m_coolId = 0;
66 
67  m_isEnabledName = "isEnabled";
68  m_isEnabled = false;
69 
70  m_isValidName = "isValid";
71  m_isValid = false;
72 
73  m_rawSignalShapeName = "rawSignalShape";
74  m_rawSignalShape = 0;
75  m_rawMaxPeakBinName = "rawMaxPeakBin";
76  m_rawMaxPeakBin = 0;
77  m_rawMaxPeakValueName = "rawMaxPeakValue";
78  m_rawMaxPeakValue = 0.0;
79  m_rawMaxFullDelayDataName = "rawMaxFullDelayData";
81  m_rawFitPeakBinName = "rawFitPeakBin";
82  m_rawFitPeakBin = 0;
83  m_rawFitPeakValueName = "rawFitPeakValue";
84  m_rawFitPeakValue = 0.0;
85  m_rawFitFullDelayDataName = "rawFitFullDelayData";
87  m_rawFitPerformedName = "rawFitPerformed";
88  m_rawFitPerformed = false;
89 
90  m_rawFitName = "rawFit";
91  m_rawFit = 0;
92 
93  m_pedestalMeanName = "pedestalMean";
94  m_pedestalMean = 0.0;
95  m_pedestalSigmaName = "pedestalSigma";
96  m_pedestalSigma = 0.0;
97 
98  m_processedSignalShapeName = "processedSignalShape";
100  m_processedMaxPeakBinName = "processedMaxPeakBin";
102  m_processedMaxPeakValueName = "processedMaxPeakValue";
104  m_processedMaxFullDelayDataName = "processedMaxFullDelayData";
106  m_processedFitPeakBinName = "processedFitPeakBin";
108  m_processedFitPeakValueName = "processedFitPeakValue";
110  m_processedFitFullDelayDataName = "processedFitFullDelayData";
112  m_processedFitPerformedName = "processedFitPerformed";
113  m_processedFitPerformed = false;
114 
115  m_processedFitName = "processedFit";
116  m_processedFit = 0;
117 
118  m_isProcessedName = "isProcessed";
119  m_isProcessed = false;
120 
121  m_risingSlopeMeanName = "risingSlopeMean";
122  m_risingSlopeMean = 0.0;
123  m_risingSlopeSigmaName = "risingSlopeSigma";
124  m_risingSlopeSigma = 0.0;
125 
126  m_currentFullDelayDataName = "currentFullDelayData";
128 
129  m_errorCodeName = "errorCode";
130  m_errorCode = 0;
131 
132  m_runNumberName = "runNumber";
133  m_runNumber = 0;
134  m_runNumberStr = "";
135 }
136 
138 {
139  for (auto& P : *m_signalShapes) delete P.second;
140  delete m_signalShapes;
141 }
142 
144 
145  if ( coolId.id() == m_signalShapesItr->first) {
146  return m_signalShapesItr->second;
147  }
148 
149  m_signalShapesItr = m_signalShapes->find(coolId.id());
150 
151  if ( m_signalShapesItr == m_signalShapes->end()) {
152  ATH_MSG_WARNING("[GetSignalShape] Did not find requested COOL ID, 0x" << std::hex << coolId.id() << std::dec << ", in signalShapes.");
153  return (L1CaloPprPhos4Shape*)0;
154  }
155 
156  return m_signalShapesItr->second;
157 }
158 
160 
161  // first check that the current iterator isn't the right one already
162  if (m_signalShapesItr != m_signalShapes->end()) {
163  if ( coolId.id() == m_signalShapesItr->first) {
164  return m_signalShapesItr;
165  }
166  }
167 
168  m_signalShapesItr = m_signalShapes->find(coolId.id());
169 
170  // check that the iterator was found
171  // if it was not then I create a new one
172  // for this COOL ID
173  if (m_signalShapesItr == m_signalShapes->end()) {
174 
175  // make sure cool ID exists first
176  if (!CoolIdExists(coolId)) {
177  ATH_MSG_WARNING("[GetMapIterator] channel 0x" << CoolIdToString(coolId) << " does not exist and will not be created.");
178  return m_signalShapes->end();
179  }
180 
181  L1CaloPprPhos4Shape* temp = new L1CaloPprPhos4Shape(coolId);
183 
184  (*m_signalShapes)[coolId.id()] = temp;
185  m_signalShapesItr = m_signalShapes->find(coolId.id());
186 
187  if (m_signalShapesItr == m_signalShapes->end()) {
188  ATH_MSG_WARNING("[GetMapIterator] Something strange going on. Did not find newly created signal shape for cool ID: 0x" << CoolIdToString(coolId));
189  return m_signalShapes->end();
190  }
191  }
192 
193  return m_signalShapesItr;
194 
195 }
196 
197 StatusCode L1CaloPprPhos4ShapeCollection::Fill(const L1CaloCoolChannelId& coolId, const unsigned int ns_step, const unsigned int adc) {
198  ShapesMap_itr itr = GetMapIterator(coolId);
199  if (itr == m_signalShapes->end()) {
200  ATH_MSG_WARNING("[Fill] no iterator returned for 0x" << CoolIdToString(coolId));
201  return StatusCode::FAILURE;
202  }
203  return itr->second->Fill(ns_step, adc);
204 }
205 
206 
207 StatusCode L1CaloPprPhos4ShapeCollection::Fill(const L1CaloCoolChannelId& coolId, const unsigned int timeSlice, const unsigned int rodHeaderStep, const int adc) {
208  ShapesMap_itr itr = GetMapIterator(coolId);
209  if (itr == m_signalShapes->end()) {
210  ATH_MSG_WARNING("[Fill] no iterator returned for 0x" << CoolIdToString(coolId));
211  return StatusCode::FAILURE;
212  }
213  return itr->second->Fill(timeSlice, rodHeaderStep, adc);
214 }
215 
216 
217 StatusCode L1CaloPprPhos4ShapeCollection::Fill(const L1CaloCoolChannelId& coolId, const unsigned int rodHeaderStep, const std::vector<int>& adc) {
218  ShapesMap_itr itr = GetMapIterator(coolId);
219  if (itr == m_signalShapes->end()) {
220  ATH_MSG_WARNING("[Fill] no iterator returned for 0x" << CoolIdToString(coolId));
221  return StatusCode::FAILURE;
222  }
223  return itr->second->Fill(rodHeaderStep, adc);
224 }
225 
226 StatusCode L1CaloPprPhos4ShapeCollection::Finalize ATLAS_NOT_REENTRANT(void) {
227 
228  // want to store the profiles and histograms for each cool id into
229  // a TTree, which will be output to a file.
230 
231  ATH_MSG_INFO("[Finalize] In Finalize()");
232 
233  // open the output file
234  std::string filename;
235  if (m_runNumberStr.empty()) {
236  filename = (m_outputFileDirName + '/' + m_outputFileName + '.' + m_outputFileNamePostfix);
237  }
238  else {
239  filename = (m_outputFileDirName + '/' + m_outputFileName + '_' + m_runNumberStr + '.' + m_outputFileNamePostfix);
240  }
241 
242  ATH_MSG_INFO("[Finalize] Opening output file: " << filename);
243  TFile* outputFile = new TFile(filename.c_str(), "RECREATE");
244  if (!outputFile->IsOpen()) {
245  ATH_MSG_ERROR("[Finalize]: Could not open file for TTree output: " << filename);
246 
247  delete outputFile; outputFile = 0;
248  return StatusCode::FAILURE;
249  }
250 
251 
252  ATH_MSG_INFO("[Finalize] Create TTree");
253 
254  TTree* tree = new TTree("phos4signalShapes", "phos4signalShapes");
255 
256  tree->Branch(m_coolIdName.c_str(), &m_coolId, std::string(m_coolIdName + "/i").c_str());
257 
258  tree->Branch(m_isEnabledName.c_str(), &m_isEnabled, std::string(m_isEnabledName + "/O").c_str());
259  tree->Branch(m_isValidName.c_str(), &m_isValid, std::string(m_isValidName + "/O").c_str());
260  tree->Branch(m_isProcessedName.c_str(), &m_isProcessed, std::string(m_isProcessedName + "/O").c_str());
261 
262  tree->Branch(m_rawSignalShapeName.c_str(), &m_rawSignalShape);
263  tree->Branch(m_rawMaxPeakBinName.c_str(), &m_rawMaxPeakBin, std::string(m_rawMaxPeakBinName + "/i").c_str());
264  tree->Branch(m_rawMaxPeakValueName.c_str(), &m_rawMaxPeakValue, std::string(m_rawMaxPeakValueName + "/F").c_str());
265  tree->Branch(m_rawMaxFullDelayDataName.c_str(), &m_rawMaxFullDelayData, std::string(m_rawMaxFullDelayDataName + "/i").c_str());
266  tree->Branch(m_rawFitPeakBinName.c_str(), &m_rawFitPeakBin, std::string(m_rawFitPeakBinName + "/i").c_str());
267  tree->Branch(m_rawFitPeakValueName.c_str(), &m_rawFitPeakValue, std::string(m_rawFitPeakValueName + "/F").c_str());
268  tree->Branch(m_rawFitFullDelayDataName.c_str(), &m_rawFitFullDelayData, std::string(m_rawFitFullDelayDataName + "/i").c_str());
269  tree->Branch(m_rawFitPerformedName.c_str(), &m_rawFitPerformed, std::string(m_rawFitPerformedName + "/O").c_str());
270 
271  tree->Branch(m_rawFitName.c_str(), &m_rawFit);
272 
273  tree->Branch(m_pedestalMeanName.c_str(), &m_pedestalMean, std::string(m_pedestalMeanName + "/F").c_str());
274  tree->Branch(m_pedestalSigmaName.c_str(), &m_pedestalSigma, std::string(m_pedestalSigmaName + "/F").c_str());
275 
276  tree->Branch(m_processedSignalShapeName.c_str(), &m_processedSignalShape);
277  tree->Branch(m_processedMaxPeakBinName.c_str(), &m_processedMaxPeakBin, std::string(m_processedMaxPeakBinName + "/i").c_str());
278  tree->Branch(m_processedMaxPeakValueName.c_str(), &m_processedMaxPeakValue, std::string(m_processedMaxPeakValueName + "/F").c_str());
279  tree->Branch(m_processedMaxFullDelayDataName.c_str(), &m_processedMaxFullDelayData, std::string(m_processedMaxFullDelayDataName + "/i").c_str());
280  tree->Branch(m_processedFitPeakBinName.c_str(), &m_processedFitPeakBin, std::string(m_processedFitPeakBinName + "/i").c_str());
281  tree->Branch(m_processedFitPeakValueName.c_str(), &m_processedFitPeakValue, std::string(m_processedFitPeakValueName + "/F").c_str());
282  tree->Branch(m_processedFitFullDelayDataName.c_str(), &m_processedFitFullDelayData, std::string(m_processedFitFullDelayDataName + "/i").c_str());
283  tree->Branch(m_processedFitPerformedName.c_str(), &m_processedFitPerformed, std::string(m_processedFitPerformedName + "/O").c_str());
284 
285  tree->Branch(m_processedFitName.c_str(), &m_processedFit);
286 
287  tree->Branch(m_risingSlopeMeanName.c_str(), &m_risingSlopeMean, std::string(m_risingSlopeMeanName + "/F").c_str());
288  tree->Branch(m_risingSlopeSigmaName.c_str(), &m_risingSlopeSigma, std::string(m_risingSlopeSigmaName + "/F").c_str());
289 
290  tree->Branch(m_errorCodeName.c_str(), &m_errorCode, std::string(m_errorCodeName + "/i").c_str());
291 
292  tree->Branch(m_currentFullDelayDataName.c_str(), &m_currentFullDelayData, std::string(m_currentFullDelayDataName + "/i").c_str());
293 
294  ATH_MSG_INFO("[Finalize] Looping over shapes for processing.");
295 
296  // open a file to output each of the new FullDelayData values for the database
297  std::string dbFilename_rawMax;
298  std::string dbFilename_rawFit;
299  std::string dbFilename_processedMax;
300  std::string dbFilename_processedFit;
301  if (m_runNumberStr.empty()) {
302  dbFilename_rawMax = (m_outputFileDirName + '/' + m_dbFileName_rawMax + '.' + m_outDBFileNamePostfix);
303  dbFilename_rawFit = (m_outputFileDirName + '/' + m_dbFileName_rawFit + '.' + m_outDBFileNamePostfix);
304  dbFilename_processedMax = (m_outputFileDirName + '/' + m_dbFileName_processedMax + '.' + m_outDBFileNamePostfix);
305  dbFilename_processedFit = (m_outputFileDirName + '/' + m_dbFileName_processedFit + '.' + m_outDBFileNamePostfix);
306  }
307  else {
308  dbFilename_rawMax = (m_outputFileDirName + '/' + m_dbFileName_rawMax + '_' + m_runNumberStr + '.' + m_outDBFileNamePostfix);
309  dbFilename_rawFit = (m_outputFileDirName + '/' + m_dbFileName_rawFit + '_' + m_runNumberStr + '.' + m_outDBFileNamePostfix);
310  dbFilename_processedMax = (m_outputFileDirName + '/' + m_dbFileName_processedMax + '_' + m_runNumberStr + '.' + m_outDBFileNamePostfix);
311  dbFilename_processedFit = (m_outputFileDirName + '/' + m_dbFileName_processedFit + '_' + m_runNumberStr + '.' + m_outDBFileNamePostfix);
312  }
313  std::ofstream dbFile_rawMax(dbFilename_rawMax.c_str());
314  if (!dbFile_rawMax.is_open()) {
315  ATH_MSG_ERROR("[Finalize]: Failed to open file for database output, " << dbFilename_rawMax);
316  }
317  std::ofstream dbFile_rawFit(dbFilename_rawFit.c_str());
318  if (!dbFile_rawFit.is_open()) {
319  ATH_MSG_ERROR("[Finalize]: Failed to open file for database output, " << dbFilename_rawFit);
320  }
321  std::ofstream dbFile_processedMax(dbFilename_processedMax.c_str());
322  if (!dbFile_processedMax.is_open()) {
323  ATH_MSG_ERROR("[Finalize]: Failed to open file for database output, " << dbFilename_processedMax);
324  }
325  std::ofstream dbFile_processedFit(dbFilename_processedFit.c_str());
326  if (!dbFile_processedFit.is_open()) {
327  ATH_MSG_ERROR("[Finalize]: Failed to open file for database output, " << dbFilename_processedFit);
328  }
329 
331  // need a canvas to putput the postscript file containing
332  // the raw and processed histograms
333  // Adding two more canvases to output the channels
334  // with errors which will be saved to a different file
335  // and then concatentated to the top of the full list
336 
337  TCanvas rawCanvas("rawCanvas", "Raw Signal Shapes", 0, 0, 1024, 768);
338  rawCanvas.SetBatch(true);
339  // remove any pading space
340  rawCanvas.SetMargin(0, 0, 0, 0);
341  // divide into two pads (1 for page titles and 1 for plots)
342  rawCanvas.Divide(1, 2, 0, 0);
343  TVirtualPad *rawTitlePad = rawCanvas.cd(1);
344  TVirtualPad *rawPlotPad = rawCanvas.cd(2);
345  // remove any pading space from pads
346  rawTitlePad->SetMargin(0, 0, 0, 0);
347  rawPlotPad->SetMargin(0, 0, 0, 0);
348  // resize the pads so that title is at the top
349  const float titleBottom = 0.97;
350  rawTitlePad->SetPad(0, titleBottom, 1, 1);
351  rawPlotPad->SetPad(0, 0, 1, titleBottom);
352  // divide bottom pad into 64 pads for plots
353  const unsigned short int maxPlotsPerPage = 64;
354  const unsigned short int maxPlotsPerPageX = 8;
355  const unsigned short int maxPlotsPerPageY = 8;
356  rawPlotPad->Divide(maxPlotsPerPageX, maxPlotsPerPageY, 0, 0);
357  // Create text label for top pad
358  TPaveText *rawPageTitle = new TPaveText(0, 0, 1, 1);
359  rawPageTitle->SetFillColor(kWhite);
360  rawPageTitle->SetBorderSize(0);
361 
362  TCanvas rawErrorCanvas("rawErrorCanvas", "Raw Signal Shapes with Errors", 0, 0, 1024, 768);
363  rawErrorCanvas.SetBatch(true);
364  // remove any pading space
365  rawErrorCanvas.SetMargin(0, 0, 0, 0);
366  // divide into two pads (1 for page titles and 1 for plots)
367  rawErrorCanvas.Divide(1, 2, 0, 0);
368  TVirtualPad *rawErrorTitlePad = rawErrorCanvas.cd(1);
369  TVirtualPad *rawErrorPlotPad = rawErrorCanvas.cd(2);
370  // remove any pading space from pads
371  rawErrorTitlePad->SetMargin(0, 0, 0, 0);
372  rawErrorPlotPad->SetMargin(0, 0, 0, 0);
373  // resize the pads so that title is at the top
374  rawErrorTitlePad->SetPad(0, titleBottom, 1, 1);
375  rawErrorPlotPad->SetPad(0, 0, 1, titleBottom);
376  // divide bottom pad into 64 pads for plots
377  const unsigned short int maxErrorPlotsPerPage = 16;
378  const unsigned short int maxErrorPlotsPerPageX = 4;
379  const unsigned short int maxErrorPlotsPerPageY = 4;
380  rawErrorPlotPad->Divide(maxErrorPlotsPerPageX, maxErrorPlotsPerPageY, 0, 0);
381  // Create text label for top pad
382  TPaveText *rawErrorPageTitle = new TPaveText(0, 0, 1, 1);
383  rawErrorPageTitle->SetFillColor(kWhite);
384  rawErrorPageTitle->SetBorderSize(0);
385 
386  // Counter for the number of plots in the error canvas
387  // this is used to figure out how many plots are being
388  // included and when to go to the next page
389  unsigned short int nErrorPlots = 0;
390  unsigned short int nErrorPlotPages = 0;
391 
392  TCanvas processedCanvas("processedCanvas", "Processed Signal Shapes", 0, 0, 1024, 768);
393  // remove any pading space
394  processedCanvas.SetMargin(0, 0, 0, 0);
395  // divide into two pads (1 for page titles and 1 for plots)
396  processedCanvas.Divide(1, 2, 0, 0);
397  TVirtualPad *processedTitlePad = processedCanvas.cd(1);
398  TVirtualPad *processedPlotPad = processedCanvas.cd(2);
399  // remove any pading space from pads
400  processedTitlePad->SetMargin(0, 0, 0, 0);
401  processedPlotPad->SetMargin(0, 0, 0, 0);
402  // resize the pads so that title is at the top
403  processedTitlePad->SetPad(0, titleBottom, 1, 1);
404  processedPlotPad->SetPad(0, 0, 1, titleBottom);
405  // divide bottom pad into 64 pads for plots
406  processedPlotPad->Divide(maxPlotsPerPageX, maxPlotsPerPageY, 0, 0);
407  // Create text label for top pad
408  TPaveText *processedPageTitle = new TPaveText(0, 0, 1, 1);
409  processedPageTitle->SetFillColor(kWhite);
410  processedPageTitle->SetBorderSize(0);
411 
412  TCanvas processedErrorCanvas("processedErrorCanvas", "Processed Signal Shapes with Errors", 0, 0, 1024, 768);
413  // remove any pading space
414  processedErrorCanvas.SetMargin(0, 0, 0, 0);
415  // divide into two pads (1 for page titles and 1 for plots)
416  processedErrorCanvas.Divide(1, 2, 0, 0);
417  TVirtualPad *processedErrorTitlePad = processedErrorCanvas.cd(1);
418  TVirtualPad *processedErrorPlotPad = processedErrorCanvas.cd(2);
419  // remove any pading space from pads
420  processedErrorTitlePad->SetMargin(0, 0, 0, 0);
421  processedErrorPlotPad->SetMargin(0, 0, 0, 0);
422  // resize the pads so that title is at the top
423  processedErrorTitlePad->SetPad(0, titleBottom, 1, 1);
424  processedErrorPlotPad->SetPad(0, 0, 1, titleBottom);
425  // divide bottom pad into 64 pads for plots
426  processedErrorPlotPad->Divide(maxErrorPlotsPerPageX, maxErrorPlotsPerPageY, 0, 0);
427  // Create text label for top pad
428  TPaveText *processedErrorPageTitle = new TPaveText(0, 0, 1, 1);
429  processedErrorPageTitle->SetFillColor(kWhite);
430  processedErrorPageTitle->SetBorderSize(0);
431 
432  // also want files to store the canvases in
433  std::string filenameRawShapes, filenameRawErrorShapes;
434  std::string filenameProcessedShapes, filenameProcessedErrorShapes;
435  if (m_runNumberStr.empty()) {
436  filenameRawShapes = (m_outputFileDirName + '/' + m_outRawCanvasName + '.' + m_outRawCanvasNamePostfix);
437  filenameRawErrorShapes = (m_outputFileDirName + '/' + m_outRawCanvasName + "Error." + m_outRawCanvasNamePostfix);
438  filenameProcessedShapes = (m_outputFileDirName + '/' + m_outProcessedCanvasName + '.' + m_outProcessedCanvasNamePostfix);
439  filenameProcessedErrorShapes = (m_outputFileDirName + '/' + m_outProcessedCanvasName + "Error." + m_outProcessedCanvasNamePostfix);
440  }
441  else {
442  filenameRawShapes = (m_outputFileDirName + '/' + m_outRawCanvasName + '_' + m_runNumberStr + '.' + m_outRawCanvasNamePostfix);
443  filenameRawErrorShapes = (m_outputFileDirName + '/' + m_outRawCanvasName + "Error_" + m_runNumberStr + '.' + m_outRawCanvasNamePostfix);
444  filenameProcessedShapes = (m_outputFileDirName + '/' + m_outProcessedCanvasName + '_' + m_runNumberStr + '.' + m_outProcessedCanvasNamePostfix);
445  filenameProcessedErrorShapes = (m_outputFileDirName + '/' + m_outProcessedCanvasName + "Error_" + m_runNumberStr + '.' + m_outProcessedCanvasNamePostfix);
446  }
447 
449  // setup summary plots for this run
451 
452  // 1D difference between currentFullDelayData and derived
453  TH1I *h1f_diff_fullDelayData_rawMax = new TH1I("h1f_diff_fullDelayData_rawMax", "FullDelayData: RawMax - database;#Delta FullDelayData (ns)", 100, -50, 50);
454  TH1I *h1f_diff_fullDelayData_rawFit = new TH1I("h1f_diff_fullDelayData_rawFit", "FullDelayData: RawFit - database;#Delta FullDelayData (ns)", 100, -50, 50);
455  TH1I *h1f_diff_fullDelayData_processedMax = new TH1I("h1f_diff_fullDelayData_processedMax", "FullDelayData: ProcessedMax - database;#Delta FullDelayData (ns)", 100, -50, 50);
456  TH1I *h1f_diff_fullDelayData_processedFit = new TH1I("h1f_diff_fullDelayData_processedFit", "FullDelayData: ProcessedFit - database;#Delta FullDelayData (ns)", 100, -50, 50);
457 
458  // 2D difference between currentFullDelayData and derived
459  // EM
460  TH2F_LW *h2f_diff_fullDelayData_rawMax_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_diff_fullDelayData_rawMax_em", "EM FullDelayData: RawMax - database");
461  TH2F_LW *h2f_diff_fullDelayData_rawFit_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_diff_fullDelayData_rawFit_em", "EM FullDelayData: RawFit - database");
462  TH2F_LW *h2f_diff_fullDelayData_processedMax_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_diff_fullDelayData_processedMax_em", "EM FullDelayData: ProcessedMax - database");
463  TH2F_LW *h2f_diff_fullDelayData_processedFit_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_diff_fullDelayData_processedFit_em", "EM FullDelayData: ProcessedFit - database");
464  // HAD
465  TH2F_LW *h2f_diff_fullDelayData_rawMax_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_diff_fullDelayData_rawMax_had", "HAD FullDelayData: RawMax - database");
466  TH2F_LW *h2f_diff_fullDelayData_rawFit_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_diff_fullDelayData_rawFit_had", "HAD FullDelayData: RawFit - database");
467  TH2F_LW *h2f_diff_fullDelayData_processedMax_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_diff_fullDelayData_processedMax_had", "HAD FullDelayData: ProcessedMax - database");
468  TH2F_LW *h2f_diff_fullDelayData_processedFit_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_diff_fullDelayData_processedFit_had", "HAD FullDelayData: ProcessedFit - database");
469 
470  // 2D Error Plots (just a place holder to help presentation in the summary plots
471  // EM
472  TH2F_LW *h2f_errorCode_dummy_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_errorCode_dummy_em", "EM Error Code Dummy");
473  // HAD
474  TH2F_LW *h2f_errorCode_dummy_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_errorCode_dummy_had", "HAD Error Code Dummy");
475 
476  // 2D ErrorCode
477  TH2F_LW *h2f_errorCode_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_errorCode_em", "EM Error Code");
478  TH2F_LW *h2f_errorCode_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_errorCode_had", "HAD Error Code");
479 
480  // 2D derived FullDelayData
481  // EM
482  TH2F_LW *h2f_fullDelayData_rawMax_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_fullDelayData_rawMax_em", "EM FullDelayData: RawMax");
483  TH2F_LW *h2f_fullDelayData_rawFit_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_fullDelayData_rawFit_em", "EM FullDelayData: RawFit");
484  TH2F_LW *h2f_fullDelayData_processedMax_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_fullDelayData_processedMax_em", "EM FullDelayData: ProcessedMax");
485  TH2F_LW *h2f_fullDelayData_processedFit_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_fullDelayData_processedFit_em", "EM FullDelayData: ProcessedFit");
486  // HAD
487  TH2F_LW *h2f_fullDelayData_rawMax_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_fullDelayData_rawMax_had", "HAD FullDelayData: RawMax");
488  TH2F_LW *h2f_fullDelayData_rawFit_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_fullDelayData_rawFit_had", "HAD FullDelayData: RawFit");
489  TH2F_LW *h2f_fullDelayData_processedMax_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_fullDelayData_processedMax_had", "HAD FullDelayData: ProcessedMax");
490  TH2F_LW *h2f_fullDelayData_processedFit_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_fullDelayData_processedFit_had", "HAD FullDelayData: ProcessedFit");
491 
492  // 2D current Delays
493  TH2F_LW *h2f_fullDelayData_em = (*m_histTool)->bookPPMEmEtaVsPhi("h2f_fullDelayData_em", "EM FullDelayData from database");
494  TH2F_LW *h2f_fullDelayData_had = (*m_histTool)->bookPPMHadEtaVsPhi("h2f_fullDelayData_had", "HAD FullDelayData from database");
495 
496 
497  // get iterators to loop over cool ids
498  ShapesMap_itr itr = this->begin();
499  ShapesMap_itr itrEnd = this->end();
500 
501  StatusCode overallSc;
502  for (; itr != itrEnd; ++itr) {
503 
504  L1CaloPprPhos4Shape* shape = itr->second;
505 
506  // call the finalize function for this cool id
507  // so the raw signal is processed.
508  StatusCode sc = shape->Finalize();
509  if (sc.isFailure()) {
510  overallSc = StatusCode::FAILURE;
511  }
512 
513  // now fill the TTree items
514  m_coolId = shape->GetCoolId();
515 
516  m_isEnabled = shape->IsEnabled();
517  m_isValid = shape->IsValidChannel();
518  m_isProcessed = shape->IsProcessed();
519 
520  m_rawSignalShape = shape->GetRawSignalShape();
521  m_rawMaxPeakBin = shape->GetRawMaxPeakBin();
522  m_rawMaxPeakValue = shape->GetRawMaxPeakValue();
523  m_rawMaxFullDelayData = shape->GetRawMaxFullDelayData();
524  m_rawFitPeakBin = shape->GetRawFitPeakBin();
525  m_rawFitPeakValue = shape->GetRawFitPeakValue();
526  m_rawFitFullDelayData = shape->GetRawFitFullDelayData();
527  m_rawFitPerformed = shape->GetRawFitPerformed();
528 
529  m_rawFit = shape->GetRawFit();
530 
531  m_pedestalMean = shape->GetPedestalMean();
532  m_pedestalSigma = shape->GetPedestalSigma();
533 
534  m_processedSignalShape = shape->GetProcessedSignalShape();
535  m_processedMaxPeakBin = shape->GetProcessedMaxPeakBin();
536  m_processedMaxPeakValue = shape->GetProcessedMaxPeakValue();
537  m_processedMaxFullDelayData = shape->GetProcessedMaxFullDelayData();
538  m_processedFitPeakBin = shape->GetProcessedFitPeakBin();
539  m_processedFitPeakValue = shape->GetProcessedFitPeakValue();
540  m_processedFitFullDelayData = shape->GetProcessedFitFullDelayData();
541  m_processedFitPerformed = shape->GetProcessedFitPerformed();
542 
543  m_processedFit = shape->GetProcessedFit();
544 
545  m_risingSlopeMean = shape->GetRisingSlopeMean();
546  m_risingSlopeSigma = shape->GetRisingSlopeSigma();
547 
548  m_errorCode = shape->GetErrorCode();
549 
550  m_currentFullDelayData = shape->GetCurrentFullDelayData();
551 
552  tree->Fill();
553 
554  // output to database text file
555  if (dbFile_rawMax.is_open()) {
556  dbFile_rawMax << m_timingRegime << ".PprPhos4ScanResults,0x";
557  dbFile_rawMax.width(8);
558  dbFile_rawMax.fill('0');
559  dbFile_rawMax << std::hex << itr->first << std::dec << ",";
560  dbFile_rawMax << "ModuleId:unsigned:0,";
561  dbFile_rawMax << "ErrorCode:unsigned:" << shape->GetErrorCode() << ",";
562  dbFile_rawMax << "Histograms:string:Not yet set,";
563  dbFile_rawMax << "FullDelayData:unsigned:" << shape->GetRawMaxFullDelayData() << std::endl;
564  }
565  if (dbFile_rawFit.is_open()) {
566  dbFile_rawFit << m_timingRegime << ".PprPhos4ScanResults,0x";
567  dbFile_rawFit.width(8);
568  dbFile_rawFit.fill('0');
569  dbFile_rawFit << std::hex << itr->first << std::dec << ",";
570  dbFile_rawFit << "ModuleId:unsigned:0,";
571  dbFile_rawFit << "ErrorCode:unsigned:" << shape->GetErrorCode() << ",";
572  dbFile_rawFit << "Histograms:string:Not yet set,";
573  dbFile_rawFit << "FullDelayData:unsigned:" << shape->GetRawFitFullDelayData() << std::endl;
574  }
575  if (dbFile_processedMax.is_open()) {
576  dbFile_processedMax << m_timingRegime << ".PprPhos4ScanResults,0x";
577  dbFile_processedMax.width(8);
578  dbFile_processedMax.fill('0');
579  dbFile_processedMax << std::hex << itr->first << std::dec << ",";
580  dbFile_processedMax << "ModuleId:unsigned:0,";
581  dbFile_processedMax << "ErrorCode:unsigned:" << shape->GetErrorCode() << ",";
582  dbFile_processedMax << "Histograms:string:Not yet set,";
583  dbFile_processedMax << "FullDelayData:unsigned:" << shape->GetProcessedMaxFullDelayData() << std::endl;
584  }
585  if (dbFile_processedFit.is_open()) {
586  dbFile_processedFit << m_timingRegime << ".PprPhos4ScanResults,0x";
587  dbFile_processedFit.width(8);
588  dbFile_processedFit.fill('0');
589  dbFile_processedFit << std::hex << itr->first << std::dec << ",";
590  dbFile_processedFit << "ModuleId:unsigned:0,";
591  dbFile_processedFit << "ErrorCode:unsigned:" << shape->GetErrorCode() << ",";
592  dbFile_processedFit << "Histograms:string:Not yet set,";
593  dbFile_processedFit << "FullDelayData:unsigned:" << shape->GetProcessedFitFullDelayData() << std::endl;
594  }
595 
598  // put plots in canvas
599 
600  const unsigned int digiChanNum = ((m_coolId >> 8) & 0xf) * 4 + (m_coolId & 0xf);
601  // customize how the pads are presented
602  TVirtualPad* rawPad = rawPlotPad->GetPad(digiChanNum + 1);
603  rawPad->SetRightMargin(0.);
604  rawPad->SetTopMargin(0.);
605  rawPad->SetBottomMargin(0.);
606  rawPad->SetLeftMargin(0.);
607  if (!(digiChanNum % 8))
608  rawPad->SetLeftMargin(0.1);
609  if (digiChanNum >= 56)
610  rawPad->SetBottomMargin(0.1);
611 
612  m_rawSignalShape->SetMinimum(0);
613  m_rawSignalShape->SetMaximum(1030);
614 
615  TVirtualPad* procPad = processedPlotPad->GetPad(digiChanNum + 1);
616  procPad->SetRightMargin(0.);
617  procPad->SetLeftMargin(0.);
618  procPad->SetBottomMargin(0.);
619  procPad->SetTopMargin(0.);
620  if (!(digiChanNum % 8))
621  procPad->SetLeftMargin(0.1);
622  if (digiChanNum >= 56)
623  procPad->SetBottomMargin(0.1);
624 
625  m_processedSignalShape->SetMinimum(-30);
626  m_processedSignalShape->SetMaximum(1000);
627 
628  rawPad->SetFillColor(kWhite);
629  procPad->SetFillColor(kWhite);
630  // color disabled (but used) channels cyan
631  if (!shape->IsEnabled() && shape->IsValidChannel()) {
632  rawPad->SetFillColor(kCyan);
633  procPad->SetFillColor(kCyan);
634  }
635  // color enabled but unused channels green
636  else if (!shape->IsValidChannel()) {
637  rawPad->SetFillColor(kGreen);
638  procPad->SetFillColor(kGreen);
639  }
640  // color channels with error codes red
641  else if (shape->GetErrorCode() != 0) {
642  rawPad->SetFillColor(kRed);
643  procPad->SetFillColor(kRed);
644 
645  // if there is no signal, zoom in on the pedestal
646  ChanCalibErrorCode raw_errorCode = shape->GetErrorCode();
647  if (raw_errorCode.phos4ScanNoSignal()) {
648  m_rawSignalShape->SetMaximum(100);
649  m_rawSignalShape->SetMinimum(0);
650  m_processedSignalShape->SetMaximum(70);
651  m_processedSignalShape->SetMinimum(-30);
652  }
653  }
654 
655  rawPlotPad->cd(digiChanNum + 1);
656  m_rawSignalShape->GetXaxis()->SetLabelSize(0.07);
657  m_rawSignalShape->GetXaxis()->SetLabelOffset(0.01);
658  m_rawSignalShape->Draw();
659  processedPlotPad->cd(digiChanNum + 1);
660  m_processedSignalShape->GetXaxis()->SetLabelSize(0.07);
661  m_processedSignalShape->GetXaxis()->SetLabelOffset(0.01);
662  m_processedSignalShape->Draw();
663 
664  // save canses to file
665  if (digiChanNum == maxPlotsPerPage - 1) {
666  ATH_MSG_INFO("[Finalize] Saving Channel Shapes to file. ");
667  // set title for the page
668  std::string rawTitle = GetPadTitle(m_coolId) + " (raw)";
669  std::string processedTitle = GetPadTitle(m_coolId) + " (processed)";
670 
671  // draw title on page
672  rawTitlePad->cd();
673  rawPageTitle->Clear();
674  rawPageTitle->AddText(rawTitle.c_str());
675  rawPageTitle->Draw();
676 
677  // update canvas
678  rawCanvas.Update();
679 
680  // draw title on page
681  processedTitlePad->cd();
682  processedPageTitle->Clear();
683  processedPageTitle->AddText(processedTitle.c_str());
684  processedPageTitle->Draw();
685 
686  processedCanvas.Update();
687 
688  // if this is the first module in the first crate we open the files.
689  if ( ((m_coolId >> 24) & 0xf) == 0 && ((m_coolId >> 16) & 0xf) == 0) {
690  rawCanvas.SaveAs( std::string(filenameRawShapes + "(").c_str() );
691  processedCanvas.SaveAs( std::string(filenameProcessedShapes + "(").c_str() );
692 
693  rawPlotPad->Clear();
694  rawPlotPad->SetMargin(0, 0, 0, 0);
695  rawPlotPad->Divide(8, 8, 0, 0);
696  processedPlotPad->Clear();
697  processedPlotPad->SetMargin(0, 0, 0, 0);
698  processedPlotPad->Divide(8, 8, 0, 0);
699 
700  }
701  // if this is the last module in the last crate the we close the files.
702  else if (((m_coolId >> 24) & 0xf) == 7 && ((m_coolId >> 16) & 0xf) == 15) {
703  rawCanvas.SaveAs( std::string(filenameRawShapes + ")").c_str() );
704  processedCanvas.SaveAs( std::string(filenameProcessedShapes + ")").c_str() );
705  }
706  // all others just add
707  else {
708  rawCanvas.SaveAs( filenameRawShapes.c_str() );
709  processedCanvas.SaveAs( filenameProcessedShapes.c_str() );
710 
711  rawPlotPad->Clear();
712  rawPlotPad->SetMargin(0, 0, 0, 0);
713  rawPlotPad->Divide(8, 8, 0, 0);
714  processedPlotPad->Clear();
715  processedPlotPad->SetMargin(0, 0, 0, 0);
716  processedPlotPad->Divide(8, 8, 0, 0);
717 
718  }
719 
720  }// end if(digiChanNum)
721 
722  // fill the error plot canvases
723 
724  // add shapes with errors to the error summary canvases
725  if (m_errorCode != 0) {
726 
727  ChanCalibErrorCode tempErrorCode(m_errorCode);
728 
729  // don't plot saturated signals
730  if (!tempErrorCode.phos4ScanSignalSaturated()) {
731 
732  // if it's a Tile run and this is a Tile Channel
733  if (m_isTileRun && !m_isLArRun && IsTileChannel(shape)) {
734 
735  const unsigned short int padIndex = nErrorPlots + 1;
736 
737  TVirtualPad *rawErrorPad = rawErrorPlotPad->cd(padIndex);
738  TVirtualPad *procErrorPad = processedErrorPlotPad->cd(padIndex);
739  rawErrorPad->SetFillColor(kWhite);
740  procErrorPad->SetFillColor(kWhite);
741  // color disabled (but used) channels cyan
742  if (!shape->IsEnabled() && shape->IsValidChannel()) {
743  rawErrorPad->SetFillColor(kCyan);
744  procErrorPad->SetFillColor(kCyan);
745  }
746  // color enabled but unused channels green
747  else if (!shape->IsValidChannel()) {
748  rawErrorPad->SetFillColor(kGreen);
749  procErrorPad->SetFillColor(kGreen);
750  }
751  // color channels with error codes red
752  else {
753  rawErrorPad->SetFillColor(kRed);
754  procErrorPad->SetFillColor(kRed);
755  }
756 
757  rawErrorPad->cd();
758  m_rawSignalShape->Draw();
759 
760  procErrorPad->cd();
761  m_processedSignalShape->Draw();
762 
763  nErrorPlots++;
764  }
765  // if it's a LAr run and this is a LAr Channel
766  else if ( m_isLArRun && !m_isTileRun && IsLArChannel(shape)) {
767 
768  const unsigned short int padIndex = nErrorPlots + 1;
769 
770  TVirtualPad *rawErrorPad = rawErrorPlotPad->cd(padIndex);
771  TVirtualPad *procErrorPad = processedErrorPlotPad->cd(padIndex);
772  rawErrorPad->SetFillColor(kWhite);
773  procErrorPad->SetFillColor(kWhite);
774  // color disabled (but used) channels cyan
775  if (!shape->IsEnabled() && shape->IsValidChannel()) {
776  rawErrorPad->SetFillColor(kCyan);
777  procErrorPad->SetFillColor(kCyan);
778  }
779  // color enabled but unused channels green
780  else if (!shape->IsValidChannel()) {
781  rawErrorPad->SetFillColor(kGreen);
782  procErrorPad->SetFillColor(kGreen);
783  }
784  // color channels with error codes red
785  else {
786  rawErrorPad->SetFillColor(kRed);
787  procErrorPad->SetFillColor(kRed);
788  }
789 
790  rawErrorPad->cd();
791  m_rawSignalShape->Draw();
792 
793  procErrorPad->cd();
794  m_processedSignalShape->Draw();
795 
796  nErrorPlots++;
797  }
798  }
799  }// end if(errorCode)
800 
801  // Save the output file if the number of plots has reached
802  // the maximum
803  if (nErrorPlots == maxErrorPlotsPerPage) {
804 
805  ATH_MSG_INFO("[Finalize] Saving Error Shapes to file. ");
806 
807  // set title for the page
808  std::string rawTitle = "Failed Channels (raw)";
809  std::string processedTitle = "Failed Channels (processed)";
810 
811  // draw title on page
812  rawErrorTitlePad->cd();
813  rawErrorPageTitle->Clear();
814  rawErrorPageTitle->AddText(rawTitle.c_str());
815  rawErrorPageTitle->Draw();
816 
817  // update canvas
818  rawErrorCanvas.Update();
819 
820  // draw title on page
821  processedErrorTitlePad->cd();
822  processedErrorPageTitle->Clear();
823  processedErrorPageTitle->AddText(processedTitle.c_str());
824  processedErrorPageTitle->Draw();
825 
826  processedErrorCanvas.Update();
827 
828  // if this is the first page open a new file
829  if ( nErrorPlotPages == 0 ) {
830  rawErrorCanvas.SaveAs( std::string(filenameRawErrorShapes + "(").c_str() );
831  processedErrorCanvas.SaveAs( std::string(filenameProcessedErrorShapes + "(").c_str() );
832 
833  rawErrorPlotPad->Clear();
834  rawErrorPlotPad->SetMargin(0, 0, 0, 0);
835  rawErrorPlotPad->Divide(maxErrorPlotsPerPageX, maxErrorPlotsPerPageX, 0, 0);
836  processedErrorPlotPad->Clear();
837  processedErrorPlotPad->SetMargin(0, 0, 0, 0);
838  processedErrorPlotPad->Divide(maxErrorPlotsPerPageX, maxErrorPlotsPerPageX, 0, 0);
839 
840  }
841  // all others just add
842  else {
843  rawErrorCanvas.SaveAs( filenameRawErrorShapes.c_str() );
844  processedErrorCanvas.SaveAs( filenameProcessedErrorShapes.c_str() );
845 
846  rawErrorPlotPad->Clear();
847  rawErrorPlotPad->SetMargin(0, 0, 0, 0);
848  rawErrorPlotPad->Divide(maxErrorPlotsPerPageX, maxErrorPlotsPerPageX, 0, 0);
849  processedErrorPlotPad->Clear();
850  processedErrorPlotPad->SetMargin(0, 0, 0, 0);
851  processedErrorPlotPad->Divide(maxErrorPlotsPerPageX, maxErrorPlotsPerPageX, 0, 0);
852  }
853  // Note: These files will be closed after the LOOP over the iterators ends
854  nErrorPlots = 0;
855  nErrorPlotPages++;
856  }// end if(nErrorPlots)
857 
858 
860  // Fill Summary Plots
862 
863  // 1D plots
864  const int diffRawMax = (int)m_rawMaxFullDelayData - (int)m_currentFullDelayData;
865  const int diffRawFit = (int)m_rawFitFullDelayData - (int)m_currentFullDelayData;
866  const int diffProcessedMax = (int)m_processedMaxFullDelayData - (int)m_currentFullDelayData;
867  const int diffProcessedFit = (int)m_processedFitFullDelayData - (int)m_currentFullDelayData;
868  // only fill if there was no error
869  if (m_errorCode == 0) {
870  h1f_diff_fullDelayData_rawMax->Fill(diffRawMax);
871  h1f_diff_fullDelayData_rawFit->Fill(diffRawFit);
872  h1f_diff_fullDelayData_processedMax->Fill(diffProcessedMax);
873  h1f_diff_fullDelayData_processedFit->Fill(diffProcessedFit);
874  }
875 
876  float eta = shape->GetEta();
877  float phi = shape->GetPhi();
878 
879  // 2D plots
880  if (shape->GetLayer() == L1CaloPprPhos4Shape::EM) {
881 
882  // error code
883  int error = 0;
884  if (m_errorCode == 0x12) // no signal
885  error = 1;
886  else if (m_errorCode == 0x402) // saturated signal
887  error = 2;
888  else if (m_errorCode == 0x22) // bad signal shape
889  error = 3;
890  if (error > 0)
891  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_errorCode_em, eta, phi, error);
892 
893  // skip filling if there is an error
894  if (error == 0) {
895  // diff delay
896  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_diff_fullDelayData_rawMax_em, eta, phi, diffRawMax);
897  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_diff_fullDelayData_rawFit_em, eta, phi, diffRawFit);
898  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_diff_fullDelayData_processedMax_em, eta, phi, diffProcessedMax);
899  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_diff_fullDelayData_processedFit_em, eta, phi, diffProcessedFit);
900 
901  // derived delays
902  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_fullDelayData_rawMax_em, eta, phi, m_rawMaxFullDelayData);
903  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_fullDelayData_rawFit_em, eta, phi, m_rawFitFullDelayData);
904  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_fullDelayData_processedMax_em, eta, phi, m_processedMaxFullDelayData);
905  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_fullDelayData_processedFit_em, eta, phi, m_processedFitFullDelayData);
906 
907  // current delay
908  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_fullDelayData_em, eta, phi, m_currentFullDelayData);
909  }// end if(error)
910  // for the diff plots, I want the bins with errors to appear white
911  // to do this I falsely fill them with large negative values
912  else {
913  int artificialDelay = -999;
914  // diff delay
915  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_diff_fullDelayData_rawMax_em, eta, phi, artificialDelay);
916  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_diff_fullDelayData_rawFit_em, eta, phi, artificialDelay);
917  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_diff_fullDelayData_processedMax_em, eta, phi, artificialDelay);
918  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_diff_fullDelayData_processedFit_em, eta, phi, artificialDelay);
919 
920  // error plot
921  int artificialError = 10;
922  (*m_histTool)->fillPPMEmEtaVsPhi(h2f_errorCode_dummy_em, eta, phi, artificialError);
923  }
924  }
925  else if (shape->GetLayer() == L1CaloPprPhos4Shape::HAD) {
926 
927  // error code
928  int error = 0;
929  if (m_errorCode == 0x12) // no signal
930  error = 1;
931  else if (m_errorCode == 0x402) // saturated signal
932  error = 2;
933  else if (m_errorCode == 0x22) // bad signal shape
934  error = 3;
935  if (error > 0)
936  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_errorCode_had, eta, phi, error);
937 
938  // skip filling if there is an error
939  if (error == 0) {
940  // diff delays
941  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_diff_fullDelayData_rawMax_had, eta, phi, diffRawMax);
942  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_diff_fullDelayData_rawFit_had, eta, phi, diffRawFit);
943  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_diff_fullDelayData_processedMax_had, eta, phi, diffProcessedMax);
944  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_diff_fullDelayData_processedFit_had, eta, phi, diffProcessedFit);
945 
946  // derived delays
947  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_fullDelayData_rawMax_had, eta, phi, m_rawMaxFullDelayData);
948  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_fullDelayData_rawFit_had, eta, phi, m_rawFitFullDelayData);
949  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_fullDelayData_processedMax_had, eta, phi, m_processedMaxFullDelayData);
950  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_fullDelayData_processedFit_had, eta, phi, m_processedFitFullDelayData);
951 
952  // current delay
953  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_fullDelayData_had, eta, phi, m_currentFullDelayData);
954  }// end if(error)
955  // for the diff plots, I want the bins with errors to appear white
956  // to do this I falsely fill them with large negative values
957  else {
958  int artificialDelay = -999;
959 
960  // diff delays
961  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_diff_fullDelayData_rawMax_had, eta, phi, artificialDelay);
962  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_diff_fullDelayData_rawFit_had, eta, phi, artificialDelay);
963  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_diff_fullDelayData_processedMax_had, eta, phi, artificialDelay);
964  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_diff_fullDelayData_processedFit_had, eta, phi, artificialDelay);
965 
966  // error plot
967  int artificialError = 10;
968  (*m_histTool)->fillPPMHadEtaVsPhi(h2f_errorCode_dummy_had, eta, phi, artificialError);
969  }
970  }
971 
972  }// end for(itr)
973 
974 
975  // Close error plots
976  // if there are earlier pages, end the file
977  if (nErrorPlotPages > 0) {
978 
979  ATH_MSG_INFO("[Finalize] Saving Last Error Shapes to file. ");
980 
981  // set title for the page
982  std::string rawTitle = "Failed Channels (raw)";
983  std::string processedTitle = "Failed Channels (processed)";
984 
985  // draw title on page
986  rawErrorTitlePad->cd();
987  rawErrorPageTitle->Clear();
988  rawErrorPageTitle->AddText(rawTitle.c_str());
989  rawErrorPageTitle->Draw();
990 
991  // update canvas
992  rawErrorCanvas.Update();
993 
994  // draw title on page
995  processedErrorTitlePad->cd();
996  processedErrorPageTitle->Clear();
997  processedErrorPageTitle->AddText(processedTitle.c_str());
998  processedErrorPageTitle->Draw();
999 
1000  processedErrorCanvas.Update();
1001 
1002  rawErrorCanvas.SaveAs( std::string(filenameRawErrorShapes + ")").c_str() );
1003  processedErrorCanvas.SaveAs( std::string(filenameProcessedErrorShapes + ")").c_str() );
1004 
1005 
1006  // append Error histograms to the top of the signal shape files
1007  MergeErrorAndShapes(filenameRawErrorShapes, filenameRawShapes);
1008  MergeErrorAndShapes(filenameProcessedErrorShapes, filenameProcessedShapes);
1009 
1010  }
1011  // if there is only one page just save it
1012  else if (nErrorPlots != 0 ) {
1013 
1014  ATH_MSG_INFO("[Finalize] Saving Single Page of Error Shapes to file. ");
1015 
1016  // set title for the page
1017  std::string rawTitle = "Failed Channels (raw)";
1018  std::string processedTitle = "Failed Channels (processed)";
1019 
1020  // draw title on page
1021  rawErrorTitlePad->cd();
1022  rawErrorPageTitle->Clear();
1023  rawErrorPageTitle->AddText(rawTitle.c_str());
1024  rawErrorPageTitle->Draw();
1025 
1026  // update canvas
1027  rawErrorCanvas.Update();
1028 
1029  // draw title on page
1030  processedErrorTitlePad->cd();
1031  processedErrorPageTitle->Clear();
1032  processedErrorPageTitle->AddText(processedTitle.c_str());
1033  processedErrorPageTitle->Draw();
1034 
1035  processedErrorCanvas.Update();
1036 
1037  rawErrorCanvas.SaveAs( filenameRawErrorShapes.c_str() );
1038  processedErrorCanvas.SaveAs( filenameProcessedErrorShapes.c_str() );
1039 
1040  // append Error histograms to the top of the signal shape files
1041  MergeErrorAndShapes(filenameRawErrorShapes, filenameRawShapes);
1042  MergeErrorAndShapes(filenameProcessedErrorShapes, filenameProcessedShapes);
1043  }
1044 
1045  //gZip the postscript files
1046  gzipFile(filenameRawShapes);
1047  gzipFile(filenameProcessedShapes);
1048 
1049  // close text file
1050  if (dbFile_rawMax.is_open()) dbFile_rawMax.close();
1051  if (dbFile_rawFit.is_open()) dbFile_rawFit.close();
1052  if (dbFile_processedMax.is_open()) dbFile_processedMax.close();
1053  if (dbFile_processedFit.is_open()) dbFile_processedFit.close();
1054 
1055  ATH_MSG_INFO("[Finalize] Writing TTree.");
1056 
1057  tree->Write();
1058 
1059  // Also want to store the Run Number
1060  TTree* runTree = new TTree("runInfo", "runInfo");
1061 
1062  runTree->Branch(m_runNumberName.c_str(), &m_runNumber, std::string(m_runNumberName + "/i").c_str());
1063 
1064  // m_runNumber was set during the run so we can go ahead and fill it.
1065  runTree->Fill();
1066 
1067  runTree->Write();
1068 
1069  outputFile->Close();
1070 
1071 // delete rawPageTitle;
1072 // rawPageTitle = 0;
1073 //
1074 // delete processedPageTitle;
1075 // processedPageTitle = 0;
1076 
1078  // Save and Draw summary plots
1080  ATH_MSG_INFO("Recording Summary Plots.");
1081 
1082  std::string summaryRootFile, summaryPsFile;
1083  if (m_runNumberStr.empty()) {
1084  summaryRootFile = (m_outputFileDirName + '/' + m_outputSummaryPlotsFileName + '.' + m_outputSummaryPlotsPostfix);
1085  summaryPsFile = (m_outputFileDirName + '/' + m_outputSummaryPlotsFileName + '.' + m_outputSummaryCanvasPostfix);
1086  }
1087  else {
1088  summaryRootFile = (m_outputFileDirName + '/' + m_outputSummaryPlotsFileName + '_' + m_runNumberStr + '.' + m_outputSummaryPlotsPostfix);
1089  summaryPsFile = (m_outputFileDirName + '/' + m_outputSummaryPlotsFileName + '_' + m_runNumberStr + '.' + m_outputSummaryCanvasPostfix);
1090  }
1091 
1092  // Open ROOT file
1093  TFile *summaryFile = new TFile(summaryRootFile.c_str(), "RECREATE");
1094  summaryFile->cd();
1095 
1096  // turn off plot titles for summary plots
1097  gStyle->SetOptTitle(0);
1098 
1099  // Create canvas for postscript file
1100  TCanvas *summaryCanvas = new TCanvas("summaryCanvas", "Summary Plots", 0, 0, 800, 600);
1101  summaryCanvas->SetBatch(true);
1102  summaryCanvas->cd(1)->SetMargin(0, 0, 0, 0);
1103  // divide into Title pad and content pad
1104  summaryCanvas->Divide(1, 2, 0, 0);
1105  TVirtualPad *titlePad = summaryCanvas->cd(1);
1106  titlePad->SetPad(0, titleBottom, 1, 1);
1107  TVirtualPad *contentPad = summaryCanvas->cd(2);
1108  contentPad->SetPad(0, 0, 1, titleBottom);
1109 
1110  TPaveText *titlePave = new TPaveText(0, 0, 1, 1);
1111  titlePave->SetFillColor(kWhite);
1112  titlePave->SetBorderSize(kWhite);
1113  titlePad->cd();
1114  titlePave->Draw();
1115 
1116  // error code
1117 
1118  contentPad->Clear();
1119  contentPad->Divide(1, 2, 0, 0);
1120  contentPad->cd(1)->SetMargin(0.1, 0., 0. , 0.);
1121  contentPad->cd(2)->SetMargin(0.1, 0., 0.1, 0.);
1122 
1123  contentPad->cd(1);
1124  SaveEtaPhiHisto(h2f_errorCode_em, 1, 4, 3)->Draw("col");
1125  contentPad->cd(2);
1126  SaveEtaPhiHisto(h2f_errorCode_had, 1, 4, 3)->Draw("col");
1127 
1128  titlePave->Clear();
1129  titlePave->AddText("ErrorCode: EM(top) HAD(bottom) Color Code: no signal(blue), sat signal(green), bad signal(red) ");
1130 
1131  summaryCanvas->Update();
1132  summaryCanvas->SaveAs( std::string(summaryPsFile + "(").c_str() );
1133 
1134  // current delays
1135 
1136  // EM
1137  contentPad->Clear();
1138  contentPad->Divide(2, 2, 0, 0);
1139  contentPad->cd(1)->SetMargin(0.1, 0. , 0. , 0. );
1140  contentPad->cd(2)->SetMargin(0. , 0.1, 0. , 0. );
1141  contentPad->cd(3)->SetMargin(0.1, 0. , 0.1, 0. );
1142  contentPad->cd(4)->SetMargin(0. , 0.1, 0.1, 0. );
1143 
1144  contentPad->cd(1);
1145  SaveEtaPhiHisto(h2f_fullDelayData_rawMax_em, 0, 300, 60)->Draw("col");
1146  contentPad->cd(2);
1147  SaveEtaPhiHisto(h2f_fullDelayData_rawFit_em, 0, 300, 60)->Draw("colz");
1148  contentPad->cd(3);
1149  SaveEtaPhiHisto(h2f_fullDelayData_processedMax_em, 0, 300, 60)->Draw("col");
1150  contentPad->cd(4);
1151  SaveEtaPhiHisto(h2f_fullDelayData_processedFit_em, 0, 300, 60)->Draw("colz");
1152 
1153  titlePave->Clear();
1154  titlePave->AddText("EM Derived FullDelayData: RawMax(top-left) RawFit(top-right) ProcessedMax(bottom-left) ProcessedFit(bottom-right)");
1155 
1156  summaryCanvas->Update();
1157  summaryCanvas->SaveAs( summaryPsFile.c_str() );
1158 
1159  // HAD
1160  contentPad->Clear();
1161  contentPad->Divide(2, 2, 0, 0);
1162  contentPad->cd(1)->SetMargin(0.1, 0. , 0. , 0. );
1163  contentPad->cd(2)->SetMargin(0. , 0.1, 0. , 0. );
1164  contentPad->cd(3)->SetMargin(0.1, 0. , 0.1, 0. );
1165  contentPad->cd(4)->SetMargin(0. , 0.1, 0.1, 0. );
1166 
1167  contentPad->cd(1);
1168  SaveEtaPhiHisto(h2f_fullDelayData_rawMax_had, 0, 300, 60)->Draw("col");
1169  contentPad->cd(2);
1170  SaveEtaPhiHisto(h2f_fullDelayData_rawFit_had, 0, 300, 60)->Draw("colz");
1171  contentPad->cd(3);
1172  SaveEtaPhiHisto(h2f_fullDelayData_processedMax_had, 0, 300, 60)->Draw("col");
1173  contentPad->cd(4);
1174  SaveEtaPhiHisto(h2f_fullDelayData_processedFit_had, 0, 300, 60)->Draw("colz");
1175 
1176  titlePave->Clear();
1177  titlePave->AddText("HAD Derived FullDelayData: RawMax(top-left) RawFit(top-right) ProcessedMax(bottom-left) ProcessedFit(bottom-right)");
1178 
1179  summaryCanvas->Update();
1180  summaryCanvas->SaveAs( summaryPsFile.c_str() );
1181 
1182  // current delays EM & HAD
1183  contentPad->Clear();
1184  contentPad->Divide(1, 2, 0, 0);
1185  contentPad->cd(1)->SetMargin(0.1, 0.1, 0. , 0.);
1186  contentPad->cd(2)->SetMargin(0.1, 0.1, 0.1, 0.);
1187 
1188  contentPad->cd(1);
1189  SaveEtaPhiHisto(h2f_fullDelayData_em, 0, 300, 60)->Draw("colz");
1190  contentPad->cd(2);
1191  SaveEtaPhiHisto(h2f_fullDelayData_had, 0, 300, 60)->Draw("colz");
1192 
1193  titlePave->Clear();
1194  titlePave->AddText("FullDelayData From Database: EM(top) HAD(bottom)");
1195 
1196  summaryCanvas->Update();
1197  summaryCanvas->SaveAs( summaryPsFile.c_str() );
1198 
1199  // difference of delays
1200 
1201  // EM
1202  contentPad->Clear();
1203  contentPad->Divide(2, 2, 0, 0);
1204  contentPad->cd(1)->SetMargin(0.1, 0. , 0.01, 0. );
1205  contentPad->cd(2)->SetMargin(0. , 0.1, 0.01, 0. );
1206  contentPad->cd(3)->SetMargin(0.1, 0. , 0.1, 0. );
1207  contentPad->cd(4)->SetMargin(0. , 0.1, 0.1, 0. );
1208 
1209  contentPad->cd(1);
1210  SaveEtaPhiHisto(h2f_errorCode_dummy_em)->Draw("box");
1211  SaveEtaPhiHisto(h2f_diff_fullDelayData_rawMax_em)->Draw("col same");
1212  contentPad->cd(2);
1213  SaveEtaPhiHisto(h2f_errorCode_dummy_em)->Draw("box");
1214  SaveEtaPhiHisto(h2f_diff_fullDelayData_rawFit_em)->Draw("colz same");
1215  contentPad->cd(3);
1216  SaveEtaPhiHisto(h2f_errorCode_dummy_em)->Draw("box");
1217  SaveEtaPhiHisto(h2f_diff_fullDelayData_processedMax_em)->Draw("col same");
1218  contentPad->cd(4);
1219  SaveEtaPhiHisto(h2f_errorCode_dummy_em)->Draw("box");
1220  SaveEtaPhiHisto(h2f_diff_fullDelayData_processedFit_em)->Draw("colz same");
1221 
1222  titlePave->Clear();
1223  titlePave->AddText("EM FullDelayData (derived-database): RawMax(top-left) RawFit(top-right) ProcessedMax(bottom-left) ProcessedFit(bottom-right)");
1224 
1225  summaryCanvas->Update();
1226  summaryCanvas->SaveAs( summaryPsFile.c_str() );
1227 
1228  // HAD
1229  contentPad->Clear();
1230  contentPad->Divide(2, 2, 0, 0);
1231  contentPad->cd(1)->SetMargin(0.1, 0. , 0.01, 0. );
1232  contentPad->cd(2)->SetMargin(0. , 0.1, 0.01, 0. );
1233  contentPad->cd(3)->SetMargin(0.1, 0. , 0.1, 0. );
1234  contentPad->cd(4)->SetMargin(0. , 0.1, 0.1, 0. );
1235 
1236  contentPad->cd(1);
1237  SaveEtaPhiHisto(h2f_errorCode_dummy_had)->Draw("box");
1238  SaveEtaPhiHisto(h2f_diff_fullDelayData_rawMax_had)->Draw("col same");
1239  contentPad->cd(2);
1240  SaveEtaPhiHisto(h2f_errorCode_dummy_had)->Draw("box");
1241  SaveEtaPhiHisto(h2f_diff_fullDelayData_rawFit_had)->Draw("colz same");
1242  contentPad->cd(3);
1243  SaveEtaPhiHisto(h2f_errorCode_dummy_had)->Draw("box");
1244  SaveEtaPhiHisto(h2f_diff_fullDelayData_processedMax_had)->Draw("col same");
1245  contentPad->cd(4);
1246  SaveEtaPhiHisto(h2f_errorCode_dummy_had)->Draw("box");
1247  SaveEtaPhiHisto(h2f_diff_fullDelayData_processedFit_had)->Draw("colz same");
1248 
1249  titlePave->Clear();
1250  titlePave->AddText("HAD FullDelayData (derived-database): RawMax(top-left) RawFit(top-right) ProcessedMax(bottom-left) ProcessedFit(bottom-right)");
1251 
1252  summaryCanvas->Update();
1253  summaryCanvas->SaveAs( summaryPsFile.c_str() );
1254 
1255  // Save and Draw 1D diff delay histograms
1256  contentPad->Clear();
1257  contentPad->Divide(2, 2, 0, 0);
1258  contentPad->cd(1)->SetMargin(0.1, 0. , 0. , 0. );
1259  contentPad->cd(2)->SetMargin(0.1, 0. , 0. , 0. );
1260  contentPad->cd(3)->SetMargin(0.1, 0. , 0.1, 0. );
1261  contentPad->cd(4)->SetMargin(0.1, 0. , 0.1, 0. );
1262 
1263  // write to ROOT file
1264  h1f_diff_fullDelayData_rawMax->Write();
1265  h1f_diff_fullDelayData_rawFit->Write();
1266  h1f_diff_fullDelayData_processedMax->Write();
1267  h1f_diff_fullDelayData_processedFit->Write();
1268 
1269  // draw in canvas
1270  contentPad->cd(1);
1271  contentPad->cd(1)->SetLogy(1);
1272  h1f_diff_fullDelayData_rawMax->Draw();
1273  contentPad->cd(2);
1274  contentPad->cd(2)->SetLogy(1);
1275  h1f_diff_fullDelayData_rawFit->Draw();
1276  contentPad->cd(3);
1277  contentPad->cd(3)->SetLogy(1);
1278  h1f_diff_fullDelayData_processedMax->Draw();
1279  contentPad->cd(4);
1280  contentPad->cd(4)->SetLogy(1);
1281  h1f_diff_fullDelayData_processedFit->Draw();
1282 
1283  titlePave->Clear();
1284  titlePave->AddText("FullDelayData (derived-database): RawMax(top-left) RawFit(top-right) ProcessedMax(bottom-left) ProcessedFit(bottom-right)");
1285 
1286  summaryCanvas->Update();
1287  summaryCanvas->SaveAs( std::string(summaryPsFile + ")").c_str() );
1288 
1289  // close ROOT file
1290  summaryFile->Close();
1291 
1292 
1293  // copy ps to pdf
1294  ps2pdf(summaryPsFile);
1295  sleep(5);
1296  // gzip ps
1297  gzipFile(summaryPsFile);
1298 
1299 
1300 // delete summaryFile;
1301 // summaryFile = 0;
1302 //
1303 // delete h1f_diff_fullDelayData_rawMax;
1304 // h1f_diff_fullDelayData_rawMax = 0;
1305 // delete h1f_diff_fullDelayData_rawFit;
1306 // h1f_diff_fullDelayData_rawFit = 0;
1307 // delete h1f_diff_fullDelayData_processedMax;
1308 // h1f_diff_fullDelayData_processedMax = 0;
1309 // delete h1f_diff_fullDelayData_processedFit;
1310 // h1f_diff_fullDelayData_processedFit = 0;
1311 //
1312  // commented out since LW histo deconstructor is private(!!)
1313 // delete h2f_diff_fullDelayData_rawMax_em;
1314 // h2f_diff_fullDelayData_rawMax_em = 0;
1315 // delete h2f_diff_fullDelayData_rawFit_em;
1316 // h2f_diff_fullDelayData_rawFit_em = 0;
1317 // delete h2f_diff_fullDelayData_processedMax_em;
1318 // h2f_diff_fullDelayData_processedMax_em = 0;
1319 // delete h2f_diff_fullDelayData_processedFit_em;
1320 // h2f_diff_fullDelayData_processedFit_em = 0;
1321 //
1322 // delete h2f_diff_fullDelayData_rawMax_had;
1323 // h2f_diff_fullDelayData_rawMax_had = 0;
1324 // delete h2f_diff_fullDelayData_rawFit_had;
1325 // h2f_diff_fullDelayData_rawFit_had = 0;
1326 // delete h2f_diff_fullDelayData_processedMax_had;
1327 // h2f_diff_fullDelayData_processedMax_had = 0;
1328 // delete h2f_diff_fullDelayData_processedFit_had;
1329 // h2f_diff_fullDelayData_processedFit_had = 0;
1330 
1331 
1332 
1333  return overallSc;
1334 }
1335 
1337 
1338  const float eta = shape->GetEta();
1339  const float feta = fabs(eta);
1341 
1343  if ( feta < 1.5 )
1344  return true;
1345  }
1346 
1347  return false;
1348 
1349 }
1350 
1352 
1353  const float eta = shape->GetEta();
1354  const float feta = fabs(eta);
1356 
1358  if ( feta > 1.5 && feta < 4.9)
1359  return true;
1360  }
1361  else if (layer == L1CaloPprPhos4Shape::EM) {
1362  if ( feta < 4.9)
1363  return true;
1364  }
1365 
1366  return false;
1367 
1368 }
1369 
1370 
1372 {
1373  L1CaloPprPhos4Shape *shape = GetSignalShape(coolId);
1374  if (shape != 0) {
1375  shape->SetEta(eta);
1376  shape->SetPhi(phi);
1377  shape->SetLayer(layer);
1378  return true;
1379  }
1380  return false;
1381 }
1382 
1384  ShapesMap_itr itr = GetMapIterator(coolId);
1385  if (itr == m_signalShapes->end()) {
1386  ATH_MSG_WARNING("[SetCurrentFullDelayData] no iterator returned for 0x" << CoolIdToString(coolId));
1387  return StatusCode::FAILURE;
1388  }
1389 
1390  itr->second->SetCurrentFullDelayData(delay);
1391 
1392  return StatusCode::SUCCESS;
1393 }
1394 
1395 
1397  ShapesMap_itr itr = GetMapIterator(coolId);
1398  if (itr == m_signalShapes->end()) {
1399  ATH_MSG_WARNING("[SetPedValue] no iterator returned for 0x" << CoolIdToString(coolId));
1400  return StatusCode::FAILURE;
1401  }
1402 
1403  itr->second->SetPedValue(value);
1404 
1405  return StatusCode::SUCCESS;
1406 }
1407 
1409  ShapesMap_itr itr = GetMapIterator(coolId);
1410  if (itr == m_signalShapes->end()) {
1411  ATH_MSG_WARNING("[SetL1aFadcSlice] no iterator returned for 0x" << CoolIdToString(coolId));
1412  return StatusCode::FAILURE;
1413  }
1414 
1415  itr->second->SetL1aFadcSlice(slice);
1416 
1417  return StatusCode::SUCCESS;
1418 }
1419 
1421  ShapesMap_itr itr = GetMapIterator(coolId);
1422  if (itr == m_signalShapes->end()) {
1423  ATH_MSG_WARNING("[SetValidChannel] no iterator returned for 0x" << CoolIdToString(coolId));
1424  return StatusCode::FAILURE;
1425  }
1426 
1427  itr->second->SetValidChannel(validity);
1428 
1429  return StatusCode::SUCCESS;
1430 }
1431 
1433  ShapesMap_itr itr = GetMapIterator(coolId);
1434  if (itr == m_signalShapes->end()) {
1435  ATH_MSG_WARNING("[SetChannelEnabled] no iterator returned for 0x" << CoolIdToString(coolId));
1436  return StatusCode::FAILURE;
1437  }
1438 
1439  itr->second->SetEnabled(enabled);
1440 
1441  return StatusCode::SUCCESS;
1442 }
1443 
1444 
1446 {
1447  // must be a PPM
1448  if (coolId.moduleType() != L1CaloModuleType::Ppm) {
1449  ATH_MSG_WARNING("[CoolIdExists] channel 0x" << CoolIdToString(coolId) << " has L1CaloModuleType is " << coolId.moduleType().toString() << ", but expecting PPM.");
1450  return false;
1451  }
1452  // crate must be 0-7
1453  else if (!(coolId.crate() <= 7)) {
1454  ATH_MSG_WARNING("[CoolIdExists] channel 0x" << CoolIdToString(coolId) << " has crate is " << coolId.crate() << ", but should be 0 - 7.");
1455  return false;
1456  }
1457  // module must be 0-15
1458  else if (!(coolId.module() <= 15)) {
1459  ATH_MSG_WARNING("[CoolIdExists] channel 0x" << CoolIdToString(coolId) << " has module is " << coolId.module() << ", but should be 0 - 15.");
1460  return false;
1461  }
1462  // subModule must be 0-15
1463  else if (!(coolId.subModule() <= 15)) {
1464  ATH_MSG_WARNING("[CoolIdExists] channel 0x" << CoolIdToString(coolId) << " has subModule is " << coolId.subModule() << ", but should be 0 - 15.");
1465  return false;
1466  }
1467  // channel must be 0-3
1468  else if (!(coolId.channel() <= 3)) {
1469  ATH_MSG_WARNING("[CoolIdExists] channel 0x" << CoolIdToString(coolId) << " has channel is " << coolId.channel() << ", but should be 0 - 3.");
1470  return false;
1471  }
1472 
1473  return true;
1474 }
1475 
1476 TH2F* L1CaloPprPhos4ShapeCollection::SaveEtaPhiHisto(TH2F_LW *histo, const float min, const float max, const unsigned int contourBins) const {
1477 
1478  TH2F *temp = histo->getROOTHist();
1479  temp->SetMinimum(min);
1480  temp->SetMaximum(max);
1481  temp->SetContour(contourBins);
1482  temp->SetFillColor(kGray);
1483  temp->SetLineColor(kGray);
1484  temp->Write();
1485  return temp;
1486 }
1487 
1488 std::string L1CaloPprPhos4ShapeCollection::GetPadTitle(const unsigned int coolId) const {
1489 
1490  std::stringstream temp;
1491 
1492  L1CaloCoolChannelId id(coolId);
1493 
1494  temp << "Crate " << id.crate() << " Ppm " << id.module();
1495 
1496  return temp.str();
1497 
1498 }
1499 
1500 
1502 {
1503  if (!gSystem->AccessPathName(filename.c_str())) {
1504  std::string command = "gzip -f " + filename;
1505  ATH_MSG_INFO("Running System command: " << command);
1506  gSystem->Exec(command.c_str());
1507 
1508  }
1509 }
1510 
1512 {
1513  if (!gSystem->AccessPathName(filename.c_str())) {
1514  unsigned int index = filename.find("ps");
1515  std::string temp = filename;
1516  temp.replace(index, 2, "pdf");
1517  std::string command = "ps2pdf " + filename;
1518  command += " ";
1519  command += temp;
1520  ATH_MSG_INFO("Running System command: " << command);
1521  gSystem->Exec(command.c_str());
1522  }
1523 }
1524 
1525 void L1CaloPprPhos4ShapeCollection::psmerge(std::string& file1, std::string& file2, std::string& outputfile) const
1526 {
1527  if (!gSystem->AccessPathName(file1.c_str())
1528  && !gSystem->AccessPathName(file2.c_str())
1529  )
1530  {
1531  std::string command = "psmerge " + file1 + ' ' + file2 + " > " + outputfile;
1532  ATH_MSG_INFO("Running System command: " << command);
1533  gSystem->Exec(command.c_str());
1534  }
1535 }
1536 
1537 void L1CaloPprPhos4ShapeCollection::mv(std::string& file1, std::string& file2) const
1538 {
1539  if (!gSystem->AccessPathName(file1.c_str()) )
1540  {
1541  std::string command = "mv " + file1 + ' ' + file2;
1542  ATH_MSG_INFO("Running System command: " << command);
1543  gSystem->Exec(command.c_str());
1544  }
1545 }
1546 
1547 void L1CaloPprPhos4ShapeCollection::rm(std::string& file) const
1548 {
1549  if (!gSystem->AccessPathName(file.c_str()) )
1550  {
1551  std::string command = "rm " + file;
1552  ATH_MSG_INFO("Running System command: " << command);
1553  gSystem->Exec(command.c_str());
1554  }
1555 }
1556 
1557 void L1CaloPprPhos4ShapeCollection::MergeErrorAndShapes(std::string& error, std::string& shapes) const
1558 {
1559 
1560  // merge the error and shapes files to one file
1561  std::string tempFilename = "temp.ps";
1562  psmerge(error, shapes, tempFilename);
1563 
1564  // can remove the error file
1565  rm(error);
1566 
1567  // can remove the shapes file
1568  rm(shapes);
1569 
1570  // move the temp filename to the shapes filename
1571  mv(tempFilename, shapes);
1572 
1573 }
1574 
1576 {
1577  char temp[200];
1578  sprintf(temp, "%08x", coolId.id());
1579  std::string tempStr = temp;
1580  return tempStr;
1581 }
1582 
L1CaloPprPhos4ShapeCollection::m_outputSummaryCanvasPostfix
std::string m_outputSummaryCanvasPostfix
Definition: L1CaloPprPhos4ShapeCollection.h:199
L1CaloPprPhos4Shape::SetMinimumSignalHeight
void SetMinimumSignalHeight(const unsigned int min)
Definition: L1CaloPprPhos4Shape.h:98
L1CaloPprPhos4ShapeCollection::m_rawMaxPeakValueName
std::string m_rawMaxPeakValueName
Definition: L1CaloPprPhos4ShapeCollection.h:216
L1CaloCoolChannelId.h
L1CaloPprPhos4Shape::GetRawFit
TF1 * GetRawFit(void)
Definition: L1CaloPprPhos4Shape.h:125
L1CaloPprPhos4ShapeCollection::SetPedValue
StatusCode SetPedValue(const L1CaloCoolChannelId &coolId, unsigned int value)
Definition: L1CaloPprPhos4ShapeCollection.cxx:1396
L1CaloPprPhos4Shape::GetProcessedMaxPeakBin
unsigned int GetProcessedMaxPeakBin(void)
Definition: L1CaloPprPhos4Shape.h:128
L1CaloPprPhos4ShapeCollection::m_processedMaxPeakBinName
std::string m_processedMaxPeakBinName
Definition: L1CaloPprPhos4ShapeCollection.h:239
ChanCalibErrorCode::phos4ScanSignalSaturated
bool phos4ScanSignalSaturated() const
Definition: ChanCalibErrorCode.h:156
L1CaloPprPhos4Shape::GetProcessedFitPeakBin
unsigned int GetProcessedFitPeakBin(void)
Definition: L1CaloPprPhos4Shape.h:131
TH2F_LW.h
L1CaloPprPhos4ShapeCollection::SetChannelEtaPhiLayer
bool SetChannelEtaPhiLayer(const L1CaloCoolChannelId &coolId, const float eta, const float phi, const L1CaloPprPhos4Shape::CaloLayer layer)
Definition: L1CaloPprPhos4ShapeCollection.cxx:1371
L1CaloPprPhos4ShapeCollection::m_rawMaxPeakValue
float m_rawMaxPeakValue
Definition: L1CaloPprPhos4ShapeCollection.h:217
L1CaloPprPhos4Shape::GetRawFitPeakValue
float GetRawFitPeakValue(void)
Definition: L1CaloPprPhos4Shape.h:121
L1CaloPprPhos4ShapeCollection::IsTileChannel
bool IsTileChannel(L1CaloPprPhos4Shape const *const shape) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1336
ChanCalibErrorCode::phos4ScanNoSignal
bool phos4ScanNoSignal() const
Definition: ChanCalibErrorCode.h:138
L1CaloPprPhos4Shape::IsValidChannel
bool IsValidChannel(void)
Definition: L1CaloPprPhos4Shape.h:159
max
#define max(a, b)
Definition: cfImp.cxx:41
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
L1CaloPprPhos4Shape::GetProcessedFitFullDelayData
unsigned int GetProcessedFitFullDelayData(void)
Definition: L1CaloPprPhos4Shape.h:133
L1CaloPprPhos4ShapeCollection::m_rawFitPerformedName
std::string m_rawFitPerformedName
Definition: L1CaloPprPhos4ShapeCollection.h:226
L1CaloPprPhos4ShapeCollection::m_rawFitPeakValueName
std::string m_rawFitPeakValueName
Definition: L1CaloPprPhos4ShapeCollection.h:222
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TH1I
Definition: rootspy.cxx:332
TH2F
Definition: rootspy.cxx:420
L1CaloPprPhos4ShapeCollection::L1CaloPprPhos4ShapeCollection
L1CaloPprPhos4ShapeCollection()
Definition: L1CaloPprPhos4ShapeCollection.cxx:29
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
index
Definition: index.py:1
L1CaloPprPhos4ShapeCollection::m_signalShapesItr
ShapesMap_itr m_signalShapesItr
Definition: L1CaloPprPhos4ShapeCollection.h:164
L1CaloPprPhos4ShapeCollection::m_rawFitFullDelayData
unsigned int m_rawFitFullDelayData
Definition: L1CaloPprPhos4ShapeCollection.h:225
L1CaloPprPhos4ShapeCollection::m_processedSignalShape
TH1F * m_processedSignalShape
Definition: L1CaloPprPhos4ShapeCollection.h:238
tree
TChain * tree
Definition: tile_monitor.h:30
L1CaloPprPhos4Shape::GetPhi
float GetPhi(void) const
Definition: L1CaloPprPhos4Shape.h:105
L1CaloPprPhos4ShapeCollection::m_processedFit
TF1 * m_processedFit
Definition: L1CaloPprPhos4ShapeCollection.h:255
L1CaloPprPhos4Shape::IsProcessed
bool IsProcessed(void)
Definition: L1CaloPprPhos4Shape.h:165
L1CaloPprPhos4Shape::GetLayer
CaloLayer GetLayer(void) const
Definition: L1CaloPprPhos4Shape.h:108
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
L1CaloPprPhos4ShapeCollection::m_processedFitPerformedName
std::string m_processedFitPerformedName
Definition: L1CaloPprPhos4ShapeCollection.h:251
L1CaloPprPhos4ShapeCollection::m_processedMaxPeakValue
float m_processedMaxPeakValue
Definition: L1CaloPprPhos4ShapeCollection.h:242
L1CaloPprPhos4ShapeCollection::m_dbFileName_rawMax
std::string m_dbFileName_rawMax
Definition: L1CaloPprPhos4ShapeCollection.h:186
L1CaloPprPhos4ShapeCollection::m_isValidName
std::string m_isValidName
Definition: L1CaloPprPhos4ShapeCollection.h:209
L1CaloPprPhos4ShapeCollection::m_outputSummaryPlotsPostfix
std::string m_outputSummaryPlotsPostfix
Definition: L1CaloPprPhos4ShapeCollection.h:198
athena.value
value
Definition: athena.py:122
L1CaloPprPhos4ShapeCollection::CoolIdExists
bool CoolIdExists(const L1CaloCoolChannelId &coolId) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1445
L1CaloCoolChannelId::crate
unsigned int crate() const
Definition: L1CaloCoolChannelId.h:25
ChanCalibErrorCode
ChanCalibErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanE...
Definition: ChanCalibErrorCode.h:20
L1CaloPprPhos4Shape::GetCoolId
unsigned int GetCoolId(void)
Definition: L1CaloPprPhos4Shape.h:140
L1CaloPprPhos4ShapeCollection::SetChannelEnabled
StatusCode SetChannelEnabled(const L1CaloCoolChannelId &coolId, bool enabled)
Definition: L1CaloPprPhos4ShapeCollection.cxx:1432
L1CaloPprPhos4ShapeCollection::m_outputSummaryPlotsFileName
std::string m_outputSummaryPlotsFileName
Definition: L1CaloPprPhos4ShapeCollection.h:197
L1CaloPprPhos4ShapeCollection::ps2pdf
void ps2pdf(std::string &filename) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1511
L1CaloPprPhos4ShapeCollection::m_processedSignalShapeName
std::string m_processedSignalShapeName
Definition: L1CaloPprPhos4ShapeCollection.h:237
L1CaloPprPhos4Shape::CaloLayer
CaloLayer
Definition: L1CaloPprPhos4Shape.h:92
L1CaloPprPhos4Shape::GetProcessedFit
TF1 * GetProcessedFit(void)
Definition: L1CaloPprPhos4Shape.h:136
L1CaloPprPhos4Shape::SetPhi
void SetPhi(const float phi)
Definition: L1CaloPprPhos4Shape.h:104
L1CaloPprPhos4ShapeCollection::m_errorCode
unsigned int m_errorCode
Definition: L1CaloPprPhos4ShapeCollection.h:269
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
L1CaloPprPhos4ShapeCollection::m_processedFitPeakValueName
std::string m_processedFitPeakValueName
Definition: L1CaloPprPhos4ShapeCollection.h:247
L1CaloPprPhos4ShapeCollection::m_processedMaxPeakBin
unsigned int m_processedMaxPeakBin
Definition: L1CaloPprPhos4ShapeCollection.h:240
L1CaloPprPhos4ShapeCollection::m_processedMaxFullDelayData
unsigned int m_processedMaxFullDelayData
Definition: L1CaloPprPhos4ShapeCollection.h:244
L1CaloCoolChannelId::moduleType
L1CaloModuleType moduleType() const
Return module type of this channel ID.
Definition: L1CaloCoolChannelId.cxx:120
L1CaloPprPhos4ShapeCollection::IsLArChannel
bool IsLArChannel(L1CaloPprPhos4Shape const *const shape) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1351
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
outputfile
ofstream outputfile
Definition: CellClusterLinkTool.h:25
L1CaloPprPhos4ShapeCollection::m_processedFitPerformed
bool m_processedFitPerformed
Definition: L1CaloPprPhos4ShapeCollection.h:252
L1CaloPprPhos4Shape::SetEta
void SetEta(const float eta)
Definition: L1CaloPprPhos4Shape.h:101
L1CaloPprPhos4Shape::HAD
@ HAD
Definition: L1CaloPprPhos4Shape.h:95
L1CaloPprPhos4ShapeCollection::GetMapIterator
ShapesMap_itr GetMapIterator(const L1CaloCoolChannelId &coolId)
Definition: L1CaloPprPhos4ShapeCollection.cxx:159
L1CaloPprPhos4ShapeCollection::m_outProcessedCanvasName
std::string m_outProcessedCanvasName
Definition: L1CaloPprPhos4ShapeCollection.h:194
L1CaloPprPhos4ShapeCollection::m_rawFitName
std::string m_rawFitName
Definition: L1CaloPprPhos4ShapeCollection.h:229
L1CaloPprPhos4ShapeCollection::m_processedFitPeakBinName
std::string m_processedFitPeakBinName
Definition: L1CaloPprPhos4ShapeCollection.h:245
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
L1CaloPprPhos4ShapeCollection::GetSignalShape
L1CaloPprPhos4Shape * GetSignalShape(const L1CaloCoolChannelId &coolId)
Definition: L1CaloPprPhos4ShapeCollection.cxx:143
L1CaloPprPhos4ShapeCollection::m_rawFitFullDelayDataName
std::string m_rawFitFullDelayDataName
Definition: L1CaloPprPhos4ShapeCollection.h:224
L1CaloPprPhos4ShapeCollection::SetL1aFadcSlice
StatusCode SetL1aFadcSlice(const L1CaloCoolChannelId &coolId, unsigned int slice)
Definition: L1CaloPprPhos4ShapeCollection.cxx:1408
L1CaloPprPhos4ShapeCollection::psmerge
void psmerge(std::string &file1, std::string &file2, std::string &outputfile) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1525
L1CaloPprPhos4Shape::GetRawSignalShape
TProfile * GetRawSignalShape(void)
Definition: L1CaloPprPhos4Shape.h:116
L1CaloPprPhos4ShapeCollection::m_rawMaxPeakBinName
std::string m_rawMaxPeakBinName
Definition: L1CaloPprPhos4ShapeCollection.h:214
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
L1CaloCoolChannelId::channel
unsigned int channel() const
Definition: L1CaloCoolChannelId.h:30
L1CaloPprPhos4Shape::GetProcessedFitPerformed
bool GetProcessedFitPerformed(void)
Definition: L1CaloPprPhos4Shape.h:134
L1CaloPprPhos4Shape
Definition: L1CaloPprPhos4Shape.h:86
lumiFormat.summaryFile
summaryFile
Definition: lumiFormat.py:122
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
L1CaloPprPhos4ShapeCollection::m_rawFitPeakValue
float m_rawFitPeakValue
Definition: L1CaloPprPhos4ShapeCollection.h:223
L1CaloPprPhos4ShapeCollection::SetValidChannel
StatusCode SetValidChannel(const L1CaloCoolChannelId &coolId, bool validity)
Definition: L1CaloPprPhos4ShapeCollection.cxx:1420
L1CaloPprPhos4Shape::GetRawFitPeakBin
unsigned int GetRawFitPeakBin(void)
Definition: L1CaloPprPhos4Shape.h:120
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
L1CaloPprPhos4Shape::GetProcessedSignalShape
TH1F * GetProcessedSignalShape(void)
Definition: L1CaloPprPhos4Shape.h:127
L1CaloPprPhos4ShapeCollection::m_rawFitPerformed
bool m_rawFitPerformed
Definition: L1CaloPprPhos4ShapeCollection.h:227
L1CaloPprPhos4ShapeCollection::m_rawFit
TF1 * m_rawFit
Definition: L1CaloPprPhos4ShapeCollection.h:230
L1CaloPprPhos4ShapeCollection::m_rawSignalShape
TProfile * m_rawSignalShape
Definition: L1CaloPprPhos4ShapeCollection.h:213
L1CaloPprPhos4ShapeCollection::m_processedMaxFullDelayDataName
std::string m_processedMaxFullDelayDataName
Definition: L1CaloPprPhos4ShapeCollection.h:243
file
TFile * file
Definition: tile_monitor.h:29
L1CaloPprPhos4ShapeCollection::m_rawFitPeakBin
unsigned int m_rawFitPeakBin
Definition: L1CaloPprPhos4ShapeCollection.h:221
L1CaloCoolChannelId::id
unsigned int id() const
Definition: L1CaloCoolChannelId.h:32
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
L1CaloPprPhos4ShapeCollection::ShapesMap_t
std::map< unsigned int, L1CaloPprPhos4Shape * > ShapesMap_t
Definition: L1CaloPprPhos4ShapeCollection.h:104
L1CaloPprPhos4ShapeCollection::m_pedestalSigma
float m_pedestalSigma
Definition: L1CaloPprPhos4ShapeCollection.h:235
delay
double delay(std::size_t d)
Definition: JetTrigTimerTest.cxx:14
L1CaloPprPhos4ShapeCollection::m_isValid
bool m_isValid
Definition: L1CaloPprPhos4ShapeCollection.h:210
L1CaloPprPhos4ShapeCollection::m_dbFileName_processedFit
std::string m_dbFileName_processedFit
Definition: L1CaloPprPhos4ShapeCollection.h:189
L1CaloPprPhos4ShapeCollection::m_pedestalMean
float m_pedestalMean
Definition: L1CaloPprPhos4ShapeCollection.h:233
L1CaloPprPhos4ShapeCollection::m_rawMaxFullDelayDataName
std::string m_rawMaxFullDelayDataName
Definition: L1CaloPprPhos4ShapeCollection.h:218
L1CaloPprPhos4ShapeCollection::~L1CaloPprPhos4ShapeCollection
~L1CaloPprPhos4ShapeCollection()
Definition: L1CaloPprPhos4ShapeCollection.cxx:137
L1CaloPprPhos4ShapeCollection.h
L1CaloPprPhos4ShapeCollection::m_rawMaxPeakBin
unsigned int m_rawMaxPeakBin
Definition: L1CaloPprPhos4ShapeCollection.h:215
L1CaloPprPhos4Shape::GetRawFitFullDelayData
unsigned int GetRawFitFullDelayData(void)
Definition: L1CaloPprPhos4Shape.h:122
L1CaloPprPhos4Shape::GetRawMaxPeakBin
unsigned int GetRawMaxPeakBin(void)
Definition: L1CaloPprPhos4Shape.h:117
L1CaloPprPhos4ShapeCollection::m_signalShapes
ShapesMap_t * m_signalShapes
Definition: L1CaloPprPhos4ShapeCollection.h:163
L1CaloPprPhos4ShapeCollection::m_outRawCanvasName
std::string m_outRawCanvasName
Definition: L1CaloPprPhos4ShapeCollection.h:192
min
#define min(a, b)
Definition: cfImp.cxx:40
L1CaloPprPhos4ShapeCollection::m_isProcessed
bool m_isProcessed
Definition: L1CaloPprPhos4ShapeCollection.h:258
ATLAS_NOT_REENTRANT
StatusCode L1CaloPprPhos4ShapeCollection::Finalize ATLAS_NOT_REENTRANT(void)
Definition: L1CaloPprPhos4ShapeCollection.cxx:226
L1CaloPprPhos4ShapeCollection::m_isProcessedName
std::string m_isProcessedName
Definition: L1CaloPprPhos4ShapeCollection.h:257
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
L1CaloPprPhos4ShapeCollection::m_pedestalMeanName
std::string m_pedestalMeanName
Definition: L1CaloPprPhos4ShapeCollection.h:232
L1CaloPprPhos4ShapeCollection::m_processedFitPeakBin
unsigned int m_processedFitPeakBin
Definition: L1CaloPprPhos4ShapeCollection.h:246
L1CaloPprPhos4Shape::GetProcessedFitPeakValue
float GetProcessedFitPeakValue(void)
Definition: L1CaloPprPhos4Shape.h:132
L1CaloPprPhos4ShapeCollection::m_outRawCanvasNamePostfix
std::string m_outRawCanvasNamePostfix
Definition: L1CaloPprPhos4ShapeCollection.h:193
L1CaloPprPhos4ShapeCollection::m_rawSignalShapeName
std::string m_rawSignalShapeName
Definition: L1CaloPprPhos4ShapeCollection.h:212
L1CaloPprPhos4Shape::GetProcessedMaxFullDelayData
unsigned int GetProcessedMaxFullDelayData(void)
Definition: L1CaloPprPhos4Shape.h:130
L1CaloPprPhos4Shape::EM
@ EM
Definition: L1CaloPprPhos4Shape.h:94
L1CaloPprPhos4ShapeCollection::SaveEtaPhiHisto
TH2F * SaveEtaPhiHisto(TH2F_LW *histo, const float min=-3., const float max=3., const unsigned int contourBins=12) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1476
L1CaloPprPhos4Shape::GetPedestalMean
float GetPedestalMean(void)
Definition: L1CaloPprPhos4Shape.h:153
L1CaloPprPhos4ShapeCollection::SetCurrentFullDelayData
StatusCode SetCurrentFullDelayData(const L1CaloCoolChannelId &coolId, unsigned int delay)
Definition: L1CaloPprPhos4ShapeCollection.cxx:1383
L1CaloPprPhos4ShapeCollection::m_outputFileName
std::string m_outputFileName
Definition: L1CaloPprPhos4ShapeCollection.h:184
L1CaloPprPhos4ShapeCollection::m_processedFitPeakValue
float m_processedFitPeakValue
Definition: L1CaloPprPhos4ShapeCollection.h:248
L1CaloPprPhos4ShapeCollection::m_outputFileNamePostfix
std::string m_outputFileNamePostfix
Definition: L1CaloPprPhos4ShapeCollection.h:185
L1CaloPprPhos4ShapeCollection::m_pedestalSigmaName
std::string m_pedestalSigmaName
Definition: L1CaloPprPhos4ShapeCollection.h:234
L1CaloCoolChannelId
Definition: L1CaloCoolChannelId.h:10
L1CaloPprPhos4ShapeCollection::m_processedFitFullDelayDataName
std::string m_processedFitFullDelayDataName
Definition: L1CaloPprPhos4ShapeCollection.h:249
L1CaloPprPhos4ShapeCollection::m_risingSlopeSigma
float m_risingSlopeSigma
Definition: L1CaloPprPhos4ShapeCollection.h:263
L1CaloPprPhos4ShapeCollection::rm
void rm(std::string &file) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1547
L1CaloPprPhos4ShapeCollection::m_errorCodeName
std::string m_errorCodeName
Definition: L1CaloPprPhos4ShapeCollection.h:268
L1CaloModuleType::Ppm
@ Ppm
Definition: L1CaloModuleType.h:17
L1CaloPprPhos4Shape::Finalize
StatusCode Finalize(void)
In finalize I want the profile to be processed and extract some useful characteristics like the peak ...
Definition: L1CaloPprPhos4Shape.cxx:135
L1CaloPprPhos4ShapeCollection::m_dbFileName_processedMax
std::string m_dbFileName_processedMax
Definition: L1CaloPprPhos4ShapeCollection.h:188
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
L1CaloPprPhos4ShapeCollection::m_dbFileName_rawFit
std::string m_dbFileName_rawFit
Definition: L1CaloPprPhos4ShapeCollection.h:187
L1CaloPprPhos4Shape::GetRawFitPerformed
bool GetRawFitPerformed(void)
Definition: L1CaloPprPhos4Shape.h:123
L1CaloPprPhos4ShapeCollection::MergeErrorAndShapes
void MergeErrorAndShapes(std::string &error, std::string &shapes) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1557
L1CaloPprPhos4Shape::GetRisingSlopeMean
float GetRisingSlopeMean(void)
Definition: L1CaloPprPhos4Shape.h:148
L1CaloModuleType::toString
const std::string toString() const
Compare with type value.
Definition: L1CaloModuleType.cxx:82
L1CaloPprPhos4ShapeCollection::m_coolIdName
std::string m_coolIdName
Definition: L1CaloPprPhos4ShapeCollection.h:203
L1CaloPprPhos4ShapeCollection::m_risingSlopeMean
float m_risingSlopeMean
Definition: L1CaloPprPhos4ShapeCollection.h:261
L1CaloPprPhos4Shape::GetProcessedMaxPeakValue
float GetProcessedMaxPeakValue(void)
Definition: L1CaloPprPhos4Shape.h:129
L1CaloPprPhos4ShapeCollection::Fill
StatusCode Fill(const L1CaloCoolChannelId &coolId, const unsigned int ns_step, const unsigned int adc)
Definition: L1CaloPprPhos4ShapeCollection.cxx:197
L1CaloPprPhos4ShapeCollection::m_isEnabled
bool m_isEnabled
Definition: L1CaloPprPhos4ShapeCollection.h:207
L1CaloPprPhos4ShapeCollection::m_runNumber
unsigned int m_runNumber
Definition: L1CaloPprPhos4ShapeCollection.h:272
L1CaloPprPhos4ShapeCollection::m_runNumberName
std::string m_runNumberName
Definition: L1CaloPprPhos4ShapeCollection.h:271
L1CaloPprPhos4ShapeCollection::m_outProcessedCanvasNamePostfix
std::string m_outProcessedCanvasNamePostfix
Definition: L1CaloPprPhos4ShapeCollection.h:195
L1CaloPprPhos4Shape::GetRisingSlopeSigma
float GetRisingSlopeSigma(void)
Definition: L1CaloPprPhos4Shape.h:149
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
L1CaloPprPhos4ShapeCollection::m_processedFitFullDelayData
unsigned int m_processedFitFullDelayData
Definition: L1CaloPprPhos4ShapeCollection.h:250
L1CaloPprPhos4ShapeCollection::m_outputFileDirName
std::string m_outputFileDirName
Definition: L1CaloPprPhos4ShapeCollection.h:183
L1CaloPprPhos4ShapeCollection::m_isTileRun
bool m_isTileRun
Definition: L1CaloPprPhos4ShapeCollection.h:155
L1CaloPprPhos4ShapeCollection::m_minSignalHeight
unsigned int m_minSignalHeight
Definition: L1CaloPprPhos4ShapeCollection.h:158
L1CaloPprPhos4ShapeCollection::m_processedFitName
std::string m_processedFitName
Definition: L1CaloPprPhos4ShapeCollection.h:254
L1CaloPprPhos4Shape::GetRawMaxPeakValue
float GetRawMaxPeakValue(void)
Definition: L1CaloPprPhos4Shape.h:118
L1CaloPprPhos4ShapeCollection::m_runNumberStr
std::string m_runNumberStr
Definition: L1CaloPprPhos4ShapeCollection.h:273
L1CaloPprPhos4ShapeCollection::gzipFile
void gzipFile(std::string &filename) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1501
L1CaloPprPhos4Shape::SetLayer
void SetLayer(const CaloLayer layer)
Definition: L1CaloPprPhos4Shape.h:107
TH2F_LW
Definition: TH2F_LW.h:23
L1CaloPprPhos4Shape::GetEta
float GetEta(void) const
Definition: L1CaloPprPhos4Shape.h:102
L1CaloPprPhos4ShapeCollection::CoolIdToString
std::string CoolIdToString(const L1CaloCoolChannelId &coolId) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1575
L1CaloPprPhos4ShapeCollection::m_rawFitPeakBinName
std::string m_rawFitPeakBinName
Definition: L1CaloPprPhos4ShapeCollection.h:220
L1CaloPprPhos4Shape::GetCurrentFullDelayData
unsigned int GetCurrentFullDelayData(void)
Definition: L1CaloPprPhos4Shape.h:157
L1CaloPprPhos4ShapeCollection::ShapesMap_itr
ShapesMap_t::iterator ShapesMap_itr
Definition: L1CaloPprPhos4ShapeCollection.h:105
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415
L1CaloPprPhos4ShapeCollection::m_isLArRun
bool m_isLArRun
Definition: L1CaloPprPhos4ShapeCollection.h:156
error
Definition: IImpactPoint3dEstimator.h:70
L1CaloPprPhos4Shape::IsEnabled
bool IsEnabled(void)
Definition: L1CaloPprPhos4Shape.h:162
ChanCalibErrorCode.h
L1CaloPprPhos4Shape::GetPedestalSigma
float GetPedestalSigma(void)
Definition: L1CaloPprPhos4Shape.h:154
L1CaloPprPhos4ShapeCollection::mv
void mv(std::string &file1, std::string &file2) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1537
get_generator_info.command
string command
Definition: get_generator_info.py:38
L1CaloPprPhos4ShapeCollection::m_currentFullDelayData
unsigned int m_currentFullDelayData
Definition: L1CaloPprPhos4ShapeCollection.h:266
L1CaloPprPhos4Shape::GetRawMaxFullDelayData
unsigned int GetRawMaxFullDelayData(void)
Definition: L1CaloPprPhos4Shape.h:119
L1CaloPprPhos4ShapeCollection::m_processedMaxPeakValueName
std::string m_processedMaxPeakValueName
Definition: L1CaloPprPhos4ShapeCollection.h:241
L1CaloPprPhos4ShapeCollection::m_currentFullDelayDataName
std::string m_currentFullDelayDataName
Definition: L1CaloPprPhos4ShapeCollection.h:265
L1CaloPprPhos4ShapeCollection::m_risingSlopeSigmaName
std::string m_risingSlopeSigmaName
Definition: L1CaloPprPhos4ShapeCollection.h:262
L1CaloCoolChannelId::subModule
unsigned int subModule() const
Definition: L1CaloCoolChannelId.h:29
L1CaloPprPhos4ShapeCollection::m_rawMaxFullDelayData
unsigned int m_rawMaxFullDelayData
Definition: L1CaloPprPhos4ShapeCollection.h:219
L1CaloPprPhos4ShapeCollection::m_outDBFileNamePostfix
std::string m_outDBFileNamePostfix
Definition: L1CaloPprPhos4ShapeCollection.h:190
L1CaloPprPhos4ShapeCollection::m_isEnabledName
std::string m_isEnabledName
Definition: L1CaloPprPhos4ShapeCollection.h:206
L1CaloPprPhos4ShapeCollection::m_coolId
unsigned int m_coolId
Definition: L1CaloPprPhos4ShapeCollection.h:204
L1CaloCoolChannelId::module
unsigned int module(bool logical=true) const
L1CaloPprPhos4ShapeCollection::m_risingSlopeMeanName
std::string m_risingSlopeMeanName
Definition: L1CaloPprPhos4ShapeCollection.h:260
L1CaloPprPhos4ShapeCollection::GetPadTitle
std::string GetPadTitle(const unsigned int coolId) const
Definition: L1CaloPprPhos4ShapeCollection.cxx:1488
L1CaloPprPhos4Shape::GetErrorCode
unsigned int GetErrorCode(void)
Definition: L1CaloPprPhos4Shape.h:151