ATLAS Offline Software
PixelChargeInterpolationValidation.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PixelChargeInterpolationValidation_C
6 #define PixelChargeInterpolationValidation_C
7 
8 #include <string>
9 #include <vector>
10 #include <sstream>
11 #include <fstream>
12 
13 #include <TDirectory.h>
14 #include <TH1.h>
15 #include <TH2.h>
16 #include <TProfile.h>
17 
23 
24 static const int NLAYERS = 4;
25 static const int NCLUSSIZES = 10;
26 
27 namespace PixelCalib{
28 
29 
32  m_eta(0),
33  m_phi(0),
34  m_etaDig(0),
35  m_phiDig(0),
36  m_etaPull(0),
37  m_phiPull(0),
38  m_etaErr(0),
39  m_phiErr(0),
40  m_eta_phi(0),
41  m_phi_eta(0),
42  m_etaDig_phi(0),
43  m_phiDig_eta(0),
44  m_etaPull_phi(0),
45  m_phiPull_eta(0),
46  m_etaErr_phi(0),
47  m_phiErr_eta(0),
48  m_charge_eta(0),
49  m_charge_phi(0),
50  m_name(tag){
51 
52  std::vector<float> *layers = getLayersBins();
53  std::vector<float> clustersizeEta = model.getClusterSizeYBins();
54  clustersizeEta.insert(clustersizeEta.begin(),0.5);
55  clustersizeEta.push_back(100);
56  std::vector<float> clustersizePhi = model.getClusterSizeXBins();
57  clustersizePhi.insert(clustersizePhi.begin(),0.5);
58  clustersizePhi.push_back(100);
59 
60  std::vector<float> phibins_Layer;
61  for(int i = -60; i <= 60; i+=2) phibins_Layer.push_back(i);
62  std::vector<float> etabins_Layer;
63  for(float i = -2.5; i <= 2.5; i+=0.125) etabins_Layer.push_back(i);
64  std::vector<float> ptbins_Layer;
65  int ntot = 9;
66  double start = 0.1;
67  double end = 10E3;
68  ptbins_Layer.reserve(ntot+1);
69 for(int i = 0; i < ntot+1; i++){
70  ptbins_Layer.push_back( start * pow( end/start, double(i)/double(ntot) ) );
71  }
72 
73 
74 
75  std::vector<std::string> binsnames(3);
76  std::vector<std::vector <float> > binsvectors(3);
77 
78  binsnames[LayerIndex] = "Layer";
79  binsnames[AngleIndex] = "#eta_{i}";
80  binsnames[ClustersizeIndex] = "ClusterSize";
81 
82  binsvectors[LayerIndex] = *layers;
83  binsvectors[AngleIndex] = etabins_Layer;
84  binsvectors[ClustersizeIndex] = std::move(clustersizeEta);
85 
86  m_eta = new PixelResidualHistograms(std::string("ResEta"),
87  std::string("Local y residuals - Analog position"),
88  500,100,binsvectors,binsnames);
89 
90  m_etaDig = new PixelResidualHistograms(std::string("ResEtaDig"),
91  std::string("Local y residuals - Center position"),
92  500,100,binsvectors,binsnames);
93 
94  m_etaPull = new PixelResidualHistograms(std::string("PullEta"),
95  std::string("Local y pulls - Analog position"),
96  10.,100,binsvectors,binsnames);
97 
98  m_etaErr = new PixelResidualHistograms(std::string("ErrEta"),
99  std::string("Local y errors - Cluster uncertainty"),
100  1000,250,binsvectors,binsnames);
101 
102  m_phi_eta = new PixelResidualHistograms(std::string("ResPhiEta"),
103  std::string("Local x residuals - Analog position"),
104  150, 100, binsvectors,binsnames);
105 
106  m_phiDig_eta = new PixelResidualHistograms(std::string("ResPhiDigEta"),
107  std::string("Local x residuals - Center position"),
108  150, 100, binsvectors,binsnames);
109 
110  m_phiPull_eta = new PixelResidualHistograms(std::string("PullPhiEta"),
111  std::string("Local x pulls - Analog position"),
112  10.,100,binsvectors,binsnames);
113 
114  m_phiErr_eta = new PixelResidualHistograms(std::string("ErrPhiEta"),
115  std::string("Local x errors - Cluster uncertainty"),
116  100,100,binsvectors,binsnames);
117 
118  m_charge_eta = new PixelResidualHistograms(std::string("ChargeEta"),
119  std::string("Charge"),
120  600000,600,binsvectors,binsnames);
121 
122  binsnames[AngleIndex] = "#phi_{i} [#circ]";
123 
124  binsvectors[AngleIndex] = phibins_Layer;
125  binsvectors[ClustersizeIndex] = std::move(clustersizePhi);
126 
127  m_phi = new PixelResidualHistograms(std::string("ResPhi"),
128  std::string("Local x residuals - Analog position"),
129  150, 100, binsvectors,binsnames);
130 
131  m_phiDig = new PixelResidualHistograms(std::string("ResPhiDig"),
132  std::string("Local x residuals - Center position"),
133  150, 100, binsvectors,binsnames);
134 
135  m_phiPull = new PixelResidualHistograms(std::string("PullPhi"),
136  std::string("Local x pulls - Analog position"),
137  10.,100,binsvectors,binsnames);
138 
139  m_phiErr = new PixelResidualHistograms(std::string("ErrPhi"),
140  std::string("Local x errors - Cluster uncertainty"),
141  100,100,binsvectors,binsnames);
142 
143  m_eta_phi = new PixelResidualHistograms(std::string("ResEtaPhi"),
144  std::string("Local y residuals - Analog position"),
145  500,100,binsvectors,binsnames);
146 
147  m_etaDig_phi = new PixelResidualHistograms(std::string("ResEtaDigPhi"),
148  std::string("Local y residuals - Center position"),
149  500,100,binsvectors,binsnames);
150 
151  m_etaPull_phi = new PixelResidualHistograms(std::string("PullEtaPhi"),
152  std::string("Local y pulls - Analog position"),
153  10.,100,binsvectors,binsnames);
154 
155  m_etaErr_phi = new PixelResidualHistograms(std::string("ErrEtaPhi"),
156  std::string("Local y errors - Cluster uncertainty"),
157  1000,250,binsvectors,binsnames);
158 
159  m_charge_phi = new PixelResidualHistograms(std::string("ChargePhi"),
160  std::string("Charge"),
161  600000,600,binsvectors,binsnames);
162 
163  std::vector<std::string> binsnames_Layer(2);
164  std::vector<std::vector <float> > binsvectors_Layer(2);
165 
166  binsnames_Layer[0] = "p_{T} [GeV]";
167  binsnames_Layer[1] = "#eta_{i}";
168 
169  binsvectors_Layer[0] = std::move(ptbins_Layer);
170  binsvectors_Layer[1] = etabins_Layer;
171 
172  for(int i = 0 ; i < NLAYERS; i++){
173 
174  std::cout << "layers " << NLAYERS << " " << i << std::endl;
175 
176  std::ostringstream name;
177  std::ostringstream title;
178  name << "ResEta_Layer" << i;
179  title << "Local y resolution - Layer " << i ;
180  m_eta_Layer.push_back(
181  new PixelResidualHistograms(name.str(),
182  ( title.str() + " - Analog position").c_str(),
183  500, 100, binsvectors_Layer, binsnames_Layer)
184  );
185  m_etaDig_Layer.push_back(
186  new PixelResidualHistograms( (name.str() + "Dig").c_str(),
187  ( title.str() + " - Center position").c_str(),
188  500, 100, binsvectors_Layer, binsnames_Layer)
189  );
190  m_etaPull_Layer.push_back(
191  new PixelResidualHistograms( (name.str() + "Pull").c_str(),
192  ( title.str() + " - Pulls").c_str(),
193  10., 100, binsvectors_Layer, binsnames_Layer)
194  );
195  }
196 
197 
198  binsnames_Layer[1] = "#phi_{i} [#circ]";
199  binsvectors_Layer[1] = phibins_Layer;
200 
201  for(int i = 0 ; i < NLAYERS; i++){
202  std::ostringstream name;
203  std::ostringstream title;
204  name << "ResPhi_Layer" << i;
205  title << "Local x resolution - Layer " << i ;
206  m_phi_Layer.push_back(
207  new PixelResidualHistograms(name.str(),
208  ( title.str() + " - Analog position").c_str(),
209  150, 100, binsvectors_Layer, binsnames_Layer)
210  );
211  m_phiDig_Layer.push_back(
212  new PixelResidualHistograms( (name.str() + "Dig").c_str(),
213  ( title.str() + " - Center position").c_str(),
214  150, 100, binsvectors_Layer, binsnames_Layer)
215  );
216  m_phiPull_Layer.push_back(
217  new PixelResidualHistograms( (name.str() + "Pull").c_str(),
218  ( title.str() + " - Pulls").c_str(),
219  10., 100, binsvectors_Layer, binsnames_Layer)
220  );
221  }
222 
223  std::vector<std::string> binsnames_Clustersize(1);
224  std::vector<std::vector <float> > binsvectors_Clustersize(1);
225 
226  binsnames_Clustersize[0] = "#eta_{i}";
227  binsvectors_Clustersize[0] = etabins_Layer;
228 
229  for(int i = 0 ; i < NCLUSSIZES; i++){
230  std::ostringstream name;
231  std::ostringstream title;
232  name << "ResEta_Clustersize" << i+1;
233  title << "Local y resolution - Clustersize " << i+1;
234  m_eta_Clustersize.push_back(
235  new PixelResidualHistograms(name.str(),
236  ( title.str() + " - Analog position").c_str(),
237  400, 100, binsvectors_Clustersize, binsnames_Clustersize)
238  );
239  m_etaDig_Clustersize.push_back(
240  new PixelResidualHistograms( (name.str() + "Dig").c_str(),
241  ( title.str() + " - Center position").c_str(),
242  400, 100, binsvectors_Clustersize, binsnames_Clustersize)
243  );
244  m_etaErr_Clustersize.push_back(
245  new PixelResidualHistograms( (name.str() + "Err").c_str(),
246  ( title.str() + " - Cluster uncertainty").c_str(),
247  1000, 250, binsvectors_Clustersize, binsnames_Clustersize)
248  );
249  m_etaPull_Clustersize.push_back(
250  new PixelResidualHistograms( (name.str() + "Pull").c_str(),
251  ( title.str() + " - Pull").c_str(),
252  10., 100., binsvectors_Clustersize, binsnames_Clustersize)
253  );
254  std::ostringstream namecs;
255  std::ostringstream titlecs;
256  namecs << "Eta_Clustersize" << i+1;
257  titlecs << "#eta_{i} distribution - Clustersize " << i+1 ;
258  m_etaClustersize.push_back(
259  new TH1F(namecs.str().c_str(), titlecs.str().c_str(),
260  etabins_Layer.size(), etabins_Layer[0],
261  etabins_Layer[etabins_Layer.size()-1])
262  );
263  }
264 
265 
266  binsnames_Clustersize[0] = "#phi_{i} [#circ]";
267  binsvectors_Clustersize[0] = std::move(phibins_Layer);
268 
269  for(int i = 0 ; i < NCLUSSIZES; i++){
270  std::ostringstream name;
271  std::ostringstream title;
272  name << "ResPhi_Clustersize" << i+1;
273  title << "Local x resolution - Clustersize " << i+1;
274  m_phi_Clustersize.push_back(
275  new PixelResidualHistograms(name.str(),
276  ( title.str() + " - Analog position").c_str(),
277  150, 100, binsvectors_Clustersize, binsnames_Clustersize)
278  );
279  m_phiDig_Clustersize.push_back(
280  new PixelResidualHistograms( (name.str() + "Dig").c_str(),
281  ( title.str() + " - Center position").c_str(),
282  150, 100, binsvectors_Clustersize, binsnames_Clustersize)
283  );
284  m_phiErr_Clustersize.push_back(
285  new PixelResidualHistograms( (name.str() + "Err").c_str(),
286  ( title.str() + " - Cluster uncertainty").c_str(),
287  100, 100, binsvectors_Clustersize, binsnames_Clustersize)
288  );
289  m_phiPull_Clustersize.push_back(
290  new PixelResidualHistograms( (name.str() + "Pull").c_str(),
291  ( title.str() + " - Pull").c_str(),
292  10., 100., binsvectors_Clustersize, binsnames_Clustersize)
293  );
294  std::ostringstream namecs;
295  std::ostringstream titlecs;
296  namecs << "Phi_Clustersize" << i+1;
297  titlecs << "#phi_{i} distribution - Clustersize " << i+1 ;
298  m_phiClustersize.push_back(
299  new TH1F(namecs.str().c_str(), titlecs.str().c_str(),
300  400, -100,100)
301  );
302  }
303 
304  m_eta_phi_correlation = new TH2F("eta_phi_correlation",
305  "#phi_{i} #eta_{i} correlation", 100, -100,100, 100, -2.5, 2.5);
306 
307  m_eta_phi_correlation->GetYaxis()->SetTitle("#eta_{i}");
308  m_eta_phi_correlation->GetXaxis()->SetTitle("#phi_{i}");
309 
310  m_CSeta_CSphi_correlation = new TH2F("CSeta_CSphi_correlation",
311  "#Deltarow #Deltacolumn correlation", 10, 0,10, 10, 0, 10);
312 
313  m_CSeta_CSphi_correlation->GetYaxis()->SetTitle("#eta_{i}");
314  m_CSeta_CSphi_correlation->GetXaxis()->SetTitle("#phi_{i}");
315 
316 
317  double ptbins_Layerpointer[101];
318  int ntot2 = 100;
319  double start2 = 0.1;
320  double end2 = 10E3;
321  for(int i = 0; i < ntot2+1; i++){
322  ptbins_Layerpointer[i] = start2 * pow( end2/start2, double(i)/double(ntot2) );
323  }
324  m_ResEtaDig_vs_p = new TH2F("ResEtaDig_vs_p",
325  "Local y residuals vs p_{T}",
326  100, ptbins_Layerpointer, 100, -1000, 1000);
327  m_ResPhiDig_vs_p = new TH2F("ResPhiDig_vs_p", "Local x residuals vs p_{T}",
328  100, ptbins_Layerpointer, 100, -400, 400);
329 
330 
331  delete layers;
332 
333 }
334 
336 
338 
339  delete m_phi;
340  delete m_eta;
341  delete m_phiDig;
342  delete m_etaDig;
343  delete m_phiPull;
344  delete m_etaPull;
345  delete m_phiErr;
346  delete m_etaErr;
347  delete m_phi_eta;
348  delete m_eta_phi;
349  delete m_phiDig_eta;
350  delete m_etaDig_phi;
351  delete m_phiPull_eta;
352  delete m_etaPull_phi;
353  delete m_phiErr_eta;
354  delete m_etaErr_phi;
355  delete m_charge_eta;
356  delete m_charge_phi;
357 
358  m_phi = 0;
359  m_eta = 0;
360  m_phiDig = 0;
361  m_etaDig = 0;
362  m_phiPull = 0;
363  m_etaPull = 0;
364  m_phiErr = 0;
365  m_etaErr = 0;
366  m_phi_eta = 0;
367  m_eta_phi = 0;
368  m_phiDig_eta = 0;
369  m_etaDig_phi = 0;
370  m_phiPull_eta = 0;
371  m_etaPull_phi = 0;
372  m_phiErr_eta = 0;
373  m_etaErr_phi = 0;
374  m_charge_eta = 0;
375  m_charge_phi = 0;
376 
377  for(int i = 0 ; i < NLAYERS; i++){
378  delete m_eta_Layer[i];
379  delete m_etaDig_Layer[i];
380  delete m_etaPull_Layer[i];
381  delete m_phi_Layer[i];
382  delete m_phiDig_Layer[i];
383  delete m_phiPull_Layer[i];
384 
385  m_eta_Layer[i] = 0;
386  m_etaDig_Layer[i] = 0;
387  m_etaPull_Layer[i] = 0;
388  m_phi_Layer[i] = 0;
389  m_phiDig_Layer[i] = 0;
390  m_phiPull_Layer[i] = 0;
391  }
392 
393  for(int i = 0 ; i < NCLUSSIZES; i++){
394  delete m_eta_Clustersize[i];
395  delete m_etaDig_Clustersize[i];
396  delete m_etaPull_Clustersize[i];
397  delete m_etaErr_Clustersize[i];
398  delete m_phi_Clustersize[i];
399  delete m_phiDig_Clustersize[i];
400  delete m_phiPull_Clustersize[i];
401  delete m_phiErr_Clustersize[i];
402  m_eta_Clustersize[i] = 0;
403  m_etaDig_Clustersize[i] = 0;
405  m_etaErr_Clustersize[i] = 0;
406  m_phi_Clustersize[i] = 0;
407  m_phiDig_Clustersize[i] = 0;
409  m_phiErr_Clustersize[i] = 0;
410  delete m_phiClustersize[i]; m_phiClustersize[i] = 0;
411  delete m_etaClustersize[i]; m_etaClustersize[i] = 0;
412  }
413 
418 
419 
420 }
421 
422 
424 
426 
427 
428  TDirectory *current = gDirectory;
429  if(file !=0) file->cd();
430  TDirectory *globaldir = (TDirectory *)gDirectory->Get("Validation");
431  globaldir->cd();
432  int readhistos = 0;
433  readhistos += m_phi->Read();
434  readhistos += m_eta->Read();
435  readhistos += m_phiDig->Read();
436  readhistos += m_etaDig->Read();
437  readhistos += m_phiPull->Read();
438  readhistos += m_etaPull->Read();
439  readhistos += m_phiErr->Read();
440  readhistos += m_etaErr->Read();
441  readhistos += m_phi_eta->Read();
442  readhistos += m_eta_phi->Read();
443  readhistos += m_phiDig_eta->Read();
444  readhistos += m_etaDig_phi->Read();
445  readhistos += m_phiPull_eta->Read();
446  readhistos += m_etaPull_phi->Read();
447  readhistos += m_phiErr_eta->Read();
448  readhistos += m_etaErr_phi->Read();
449  readhistos += m_charge_eta->Read();
450  readhistos += m_charge_phi->Read();
451  for(int i = 0 ; i < NLAYERS; i++){
452  m_eta_Layer[i]->Read();
453  m_etaDig_Layer[i]->Read();
454  m_etaPull_Layer[i]->Read();
455  m_phi_Layer[i]->Read();
456  m_phiDig_Layer[i]->Read();
457  m_phiPull_Layer[i]->Read();
458  }
459  for(int i = 0 ; i < NCLUSSIZES; i++){
460  m_eta_Clustersize[i]->Read();
461  m_etaDig_Clustersize[i]->Read();
462  m_etaErr_Clustersize[i]->Read();
463  m_etaPull_Clustersize[i]->Read();
464  m_phi_Clustersize[i]->Read();
465  m_phiDig_Clustersize[i]->Read();
466  m_phiErr_Clustersize[i]->Read();
467  m_phiErr_Clustersize[i]->Read();
468  //m_phiClustersize[i]->Read();
469  //m_etaClustersize[i]->Read();
470  }
471  //m_eta_phi_correlation
472  //m_CSeta_CSphi_correlation
473 
474  current->cd();
475  return readhistos;
476 }
477 
479 
481 
482  TDirectory *current = gDirectory;
483  TDirectory *globaldir;
484  if(writedir != 0) writedir->cd();
485  globaldir = gDirectory->mkdir("Validation");
486  globaldir->cd();
487  int writtenhistos = 0;
488  writtenhistos += m_phi->Write(true);
489  writtenhistos += m_eta->Write(true);
490  writtenhistos += m_phiDig->Write(true);
491  writtenhistos += m_etaDig->Write(true);
492  writtenhistos += m_phiPull->Write(true);
493  writtenhistos += m_etaPull->Write(true);
494  writtenhistos += m_phiErr->Write(true);
495  writtenhistos += m_etaErr->Write(true);
496  writtenhistos += m_phi_eta->Write(true);
497  writtenhistos += m_eta_phi->Write(true);
498  writtenhistos += m_phiDig_eta->Write(true);
499  writtenhistos += m_etaDig_phi->Write(true);
500  writtenhistos += m_phiPull_eta->Write(true);
501  writtenhistos += m_etaPull_phi->Write(true);
502  writtenhistos += m_phiErr_eta->Write(true);
503  writtenhistos += m_etaErr_phi->Write(true);
504  writtenhistos += m_charge_eta->Write(true);
505  writtenhistos += m_charge_phi->Write(true);
506 
507  for(int i = 0 ; i < NLAYERS; i++){
508  m_eta_Layer[i]->Write(true);
509  m_etaDig_Layer[i]->Write(true);
510  m_etaPull_Layer[i]->Write(true);
511  m_phi_Layer[i]->Write(true);
512  m_phiDig_Layer[i]->Write(true);
513  m_phiPull_Layer[i]->Write(true);
514  }
515  for(int i = 0 ; i < NCLUSSIZES; i++){
516  m_eta_Clustersize[i]->Write(true);
517  m_etaDig_Clustersize[i]->Write(true);
518  m_etaErr_Clustersize[i]->Write(true);
519  m_etaPull_Clustersize[i]->Write(true);
520  m_phi_Clustersize[i]->Write(true);
521  m_phiDig_Clustersize[i]->Write(true);
522  m_phiErr_Clustersize[i]->Write(true);
523  m_phiPull_Clustersize[i]->Write(true);
524  m_phiClustersize[i]->Write();
525  m_etaClustersize[i]->Write();
526  }
527 
528  m_eta_phi_correlation->Write();
529  m_CSeta_CSphi_correlation->Write();
530  m_ResEtaDig_vs_p->Write();
531  m_ResPhiDig_vs_p->Write();
532 
533  current->cd();
534  return writtenhistos;
535 }
536 
538 
540 
541  // Let's write resolutions into text file (see:
542  // void PixelClusterOnTrackErrorData::Print(std::string file) const
544 
545  TProfile *etaModel = m_eta_Clustersize[0]->GetRMSProfile("#eta_{i}");
546  TProfile *phiModel = m_phi_Clustersize[0]->GetRMSProfile("#phi_{i} [#circ]");
547  //int ncsx = m_phi_Clustersize.size();
548  //int ncsy = m_eta_Clustersize.size(); // number of cluster size (x-direction) bins
549  int ncsx = 4;
550  int ncsy = 4;
551  int neta = etaModel->GetNbinsX(); // number of eta values bins
552  int nalpha = phiModel->GetNbinsX(); // number of incidence angle bins
553  int ntotbins = ncsx + ncsy + neta + nalpha;
554 
555  std::vector<float> values;
556  values.reserve(ntotbins);
557  int globalindex = 0;
558  for (int i=0; i<ncsx && globalindex<ntotbins; i++, globalindex++) {
559  values.push_back(i+0.5);
560  }
561  for (int i=0; i<ncsy && globalindex<ntotbins; i++, globalindex++) {
562  values.push_back(i+0.5);
563  }
564  values.push_back(-2.5);
565  for (int i=1; i<neta && globalindex<ntotbins; i++, globalindex++) {
566  values.push_back(etaModel->GetBinLowEdge(i+1));
567  }
568  values.push_back(-180);
569  for (int i=1; i<nalpha && globalindex<ntotbins; i++, globalindex++) {
570  values.push_back(phiModel->GetBinLowEdge(i+1));
571  }
572  parameters->setParameters(ncsx, ncsy, neta, nalpha,0,std::move(values));
573 
574  int ntotyconstnx = ncsx * nalpha;
575  globalindex = 0;
576  for(int i = 0; i < nalpha && globalindex < ntotyconstnx; i++)
577  for(int j = 0; j < ncsx && globalindex < ntotyconstnx; j++, globalindex++){
578  double value = m_phi_Clustersize[j]->GetRMSProfile("#phi_{i} [#circ]")->GetBinContent(i+1)/1000;
579  if (value == 0) value = (j+1)*50/sqrt(12)/1000;
580  parameters->setPixelBarrelPhiError(globalindex,value);
581  }
582  int ntotyconstny = ncsx * ncsy * neta;
583  globalindex = 0;
584  for(int i = 0; i < neta && globalindex < ntotyconstny; i++)
585  for(int j = 0; j < ncsx && globalindex < ntotyconstny; j++)
586  for(int k = 0; k < ncsy && globalindex < ntotyconstny; k++, globalindex++){
587  double value = m_eta_Clustersize[k]->GetRMSProfile("#eta_{i}")->GetBinContent(i+1)/1000;
588  if (value == 0) value = (k+1)*400/sqrt(12)/1000;
589  parameters->setPixelBarrelEtaError(globalindex,value);
590  }
591  parameters->Print(name);
592 
593  delete parameters;
594 }
595 
597 
599  double Phi, double CSphi, double digResPhi, double ResPhi, double ErrPhi, Double_t PullPhi,
600  double Eta, double CSeta, double digResEta, double ResEta, double ErrEta, Double_t PullEta, double Charge){
601 
602  std::vector< float >parameters(3);
605  parameters[ClustersizeIndex] = CSeta;
606  m_eta->Fill(float(ResEta),parameters);
607  m_etaDig->Fill(float(digResEta),parameters);
608  m_etaPull->Fill(float(PullEta),parameters);
609  m_etaErr->Fill(float(ErrEta), parameters);
610  m_phi_eta->Fill(float(ResPhi),parameters);
611  m_phiDig_eta->Fill(float(digResPhi),parameters);
612  m_phiPull_eta->Fill(float(PullPhi),parameters);
613  m_phiErr_eta->Fill(float(ErrPhi), parameters);
614  m_charge_eta->Fill(float(Charge), parameters);
615 
617  parameters[ClustersizeIndex] = CSphi;
618  m_phi->Fill(float(ResPhi),parameters);
619  m_phiDig->Fill(float(digResPhi),parameters);
620  m_phiPull->Fill(float(PullPhi),parameters);
621  m_phiErr->Fill(float(ErrPhi), parameters);
622  m_eta_phi->Fill(float(ResEta),parameters);
623  m_etaDig_phi->Fill(float(digResEta),parameters);
624  m_etaPull_phi->Fill(float(PullEta),parameters);
625  m_etaErr_phi->Fill(float(ErrEta), parameters);
626  m_charge_phi->Fill(float(Charge), parameters);
627 
628  if( Layer < NLAYERS){
629  std::vector< float >parameters_Layer(2);
630  if(GeVTrkPt < 10E10) parameters_Layer[0] = GeVTrkPt;
631  else parameters_Layer[0] = 1.;
632 
633  parameters_Layer[1] = Eta;
634  m_eta_Layer[Layer]->Fill(float(ResEta),parameters_Layer);
635  m_etaDig_Layer[Layer]->Fill(float(digResEta),parameters_Layer);
636  m_etaPull_Layer[Layer]->Fill(float(PullEta), parameters_Layer);
637 
638  parameters_Layer[1] = Phi;
639  m_phi_Layer[Layer]->Fill(float(ResPhi),parameters_Layer);
640  m_phiDig_Layer[Layer]->Fill(float(digResPhi),parameters_Layer);
641  m_phiPull_Layer[Layer]->Fill(float(PullPhi), parameters_Layer);
642  }
643 
644  std::vector< float >parameters_Clustersize(1);
645 
646  if( int(CSeta)-1 < NCLUSSIZES){
647  parameters_Clustersize[0] = Eta;
648  m_eta_Clustersize[int(CSeta)-1]->Fill(float(ResEta),parameters_Clustersize);
649  m_etaDig_Clustersize[int(CSeta)-1]->Fill(float(digResEta),parameters_Clustersize);
650  m_etaErr_Clustersize[int(CSeta)-1]->Fill(float(ErrEta),parameters_Clustersize);
651  m_etaPull_Clustersize[int(CSeta)-1]->Fill(float(PullEta),parameters_Clustersize);
652  m_etaClustersize[int(CSeta)-1]->Fill(Eta);
653  }
654  if( int(CSphi)-1 < NCLUSSIZES){
655  parameters_Clustersize[0] = Phi;
656  m_phi_Clustersize[int(CSphi)-1]->Fill(float(ResPhi),parameters_Clustersize);
657  m_phiDig_Clustersize[int(CSphi)-1]->Fill(float(digResPhi),parameters_Clustersize);
658  //std::cout << ErrPhi << " " << CSphi << " " << Phi << std::endl;
659  m_phiErr_Clustersize[int(CSphi)-1]->Fill(float(ErrPhi),parameters_Clustersize);
660  m_phiPull_Clustersize[int(CSphi)-1]->Fill(float(PullPhi),parameters_Clustersize);
661  m_phiClustersize[int(CSphi)-1]->Fill(Phi);
662  }
663 
666  m_ResEtaDig_vs_p->Fill(GeVTrkPt,digResEta);
667  m_ResPhiDig_vs_p->Fill(GeVTrkPt,digResPhi);
668  return;
669 
670 }
671 
673 
675 
676  if(ref_file == 0) return;
677 
678  /*
679  PixelResidualHistograms *eta_reference = 0;
680  PixelResidualHistograms *phi_reference = 0;
681  PixelResidualHistograms *eta_referencePerLayer = 0;
682  PixelResidualHistograms *phi_referencePerLayer = 0;
683  PixelResidualHistograms *eta_referencePerAngle = 0;
684  PixelResidualHistograms *phi_referencePerAngle = 0;
685  PixelResidualProfiles* phi_referenceProfileLayer = 0;
686  PixelResidualProfiles* eta_referenceProfileLayer = 0;
687  PixelResidualProfiles* phiPt_referenceProfileLayer = 0;
688  PixelResidualProfiles* etaPt_referenceProfileLayer = 0;
689  PixelResidualHistograms* phi_referencePerPt = 0;
690  PixelResidualHistograms* eta_referencePerPt = 0;
691  PixelResidualHistograms* phi_referencePerCs = 0;
692  PixelResidualHistograms* eta_referencePerCs = 0;
693  std::string ref_name = std::string("Reference ");
694 
695  if(ref_file != 0 ){
696  eta_reference = m_etaVector->Clone();
697  eta_reference->Read(ref_file);
698  phi_reference = m_phiVector->Clone();
699  phi_reference->Read(ref_file);
700  eta_referencePerLayer = m_etaPerLayer->Clone();
701  eta_referencePerLayer->Read(ref_file);
702  phi_referencePerLayer = m_phiPerLayer->Clone();
703  phi_referencePerLayer->Read(ref_file);
704  eta_referencePerAngle = m_etaPerAngle->Clone();
705  eta_referencePerAngle->Read(ref_file);
706  phi_referencePerAngle = m_phiPerAngle->Clone();
707  phi_referencePerAngle->Read(ref_file);
708  phi_referenceProfileLayer = m_phivsAnglePerLayer->Clone();
709  phi_referenceProfileLayer->Read(ref_file);
710  eta_referenceProfileLayer = m_etavsAnglePerLayer->Clone();
711  eta_referenceProfileLayer->Read(ref_file);
712  phiPt_referenceProfileLayer = m_phivsPtPerLayer->Clone();
713  phiPt_referenceProfileLayer->Read(ref_file);
714  etaPt_referenceProfileLayer = m_etavsPtPerLayer->Clone();
715  etaPt_referenceProfileLayer->Read(ref_file);
716  phi_referencePerPt = m_phiPerPt->Clone();
717  phi_referencePerPt->Read(ref_file);
718  eta_referencePerPt = m_etaPerPt->Clone();
719  eta_referencePerPt->Read(ref_file);
720  phi_referencePerCs = m_phiPerCs->Clone();
721  phi_referencePerCs->Read(ref_file);
722  eta_referencePerCs = m_etaPerCs->Clone();
723  eta_referencePerCs->Read(ref_file);
724  }else{
725  eta_reference = m_etaDigVector;
726  phi_reference = m_phiDigVector;
727  eta_referencePerLayer = m_etaDigPerLayer;
728  phi_referencePerLayer = m_phiDigPerLayer;
729  eta_referencePerAngle = m_etaDigPerAngle;
730  phi_referencePerAngle = m_phiDigPerAngle;
731  phi_referenceProfileLayer = m_phiDigvsAnglePerLayer;
732  eta_referenceProfileLayer = m_etaDigvsAnglePerLayer;
733  phiPt_referenceProfileLayer = m_phiDigvsPtPerLayer;
734  etaPt_referenceProfileLayer = m_etaDigvsPtPerLayer;
735  phi_referencePerPt = m_phiDigPerPt;
736  eta_referencePerPt = m_phiDigPerPt;
737  phi_referencePerCs = m_phiDigPerCs;
738  eta_referencePerCs = m_etaDigPerCs;
739  ref_name = std::string("Digital ");
740  }
741 
742  m_etaVector->Analyze(eta_reference, ref_name);
743  m_phiVector->Analyze(phi_reference, ref_name);
744  m_etaPerLayer->Analyze(eta_referencePerLayer, ref_name);
745  m_phiPerLayer->Analyze(phi_referencePerLayer, ref_name);
746  m_etaPerAngle->Analyze(eta_referencePerAngle, ref_name);
747  m_phiPerAngle->Analyze(phi_referencePerAngle, ref_name);
748 
749  //m_phivsAnglePerLayer->Analyze(phi_referenceProfileLayer, ref_name);
750  //m_etavsAnglePerLayer->Analyze(eta_referenceProfileLayer, ref_name);
751 
752  //m_phivsPtPerLayer->Analyze(phiPt_referenceProfileLayer, ref_name,std::string("log"));
753  //m_etavsPtPerLayer->Analyze(etaPt_referenceProfileLayer, ref_name,std::string("log"));
754  m_phiPerPt->Analyze(phi_referencePerPt, ref_name);
755  m_etaPerPt->Analyze(eta_referencePerPt, ref_name);
756 
757  m_phiPerCs->Analyze(phi_referencePerCs, ref_name);
758  m_etaPerCs->Analyze(eta_referencePerCs, ref_name);
759 
760  if(ref_file != 0 ){
761  delete eta_reference;
762  delete phi_reference;
763  delete eta_referencePerLayer;
764  delete phi_referencePerLayer;
765  delete eta_referencePerAngle;
766  delete phi_referencePerAngle;
767  delete phi_referenceProfileLayer;
768  delete eta_referenceProfileLayer;
769  delete phiPt_referenceProfileLayer;
770  delete etaPt_referenceProfileLayer;
771  delete phi_referencePerPt;
772  delete eta_referencePerPt;
773  delete phi_referencePerCs;
774  delete eta_referencePerCs;
775  }
776 
777  phi_reference = 0;
778  eta_reference = 0;
779  phi_referencePerLayer = 0;
780  eta_referencePerLayer = 0;
781  phi_referencePerAngle = 0;
782  eta_referencePerAngle = 0;
783  phi_referenceProfileLayer = 0;
784  eta_referenceProfileLayer = 0;
785  phiPt_referenceProfileLayer = 0;
786  etaPt_referenceProfileLayer = 0;
787  phi_referencePerPt = 0;
788  eta_referencePerPt = 0;
789  phi_referencePerCs = 0;
790  eta_referencePerCs = 0;
791  */
792 
793 }
794 
795 }
796 
797 #endif // #ifdef PixelChargeInterpolationValidation_C
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
PixelCalib::PixelChargeInterpolationValidation::m_phi_eta
PixelResidualHistograms * m_phi_eta
Definition: PixelChargeInterpolationValidation.h:54
PixelCalib::PixelChargeInterpolationValidation::m_etaDig_Layer
std::vector< PixelResidualHistograms * > m_etaDig_Layer
Definition: PixelChargeInterpolationValidation.h:66
PixelCalib::PixelChargeInterpolationValidation::m_phiErr_eta
PixelResidualHistograms * m_phiErr_eta
Definition: PixelChargeInterpolationValidation.h:60
PixelCalib::PixelChargeInterpolationValidation::m_etaPull_Clustersize
std::vector< PixelResidualHistograms * > m_etaPull_Clustersize
Definition: PixelChargeInterpolationValidation.h:78
PixelClusterOnTrackErrorData.h
PixelCalib::PixelChargeInterpolationValidation::~PixelChargeInterpolationValidation
virtual ~PixelChargeInterpolationValidation()
Definition: PixelChargeInterpolationValidation.cxx:337
PixelCalib::PixelChargeInterpolationValidation::Fill
void Fill(int Layer, double GeVTrkPt, double Phi, double CSphi, double MicronDigResPhi, double MicronResPhi, double MicronErrPhi, double PullPhi, double Eta, double CSeta, double MicronDigResEta, double MicronResEta, double MicronErrEta, double PullEta, double Charge)
Definition: PixelChargeInterpolationValidation.cxx:598
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
PixelCalib::PixelChargeInterpolationValidation::m_etaErr_Clustersize
std::vector< PixelResidualHistograms * > m_etaErr_Clustersize
Definition: PixelChargeInterpolationValidation.h:76
PixelCalib::PixelChargeInterpolationValidation::m_ResPhiDig_vs_p
TH2F * m_ResPhiDig_vs_p
Definition: PixelChargeInterpolationValidation.h:86
PixelCalib::PixelChargeInterpolationValidation::m_phiClustersize
std::vector< TH1F * > m_phiClustersize
Definition: PixelChargeInterpolationValidation.h:81
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
PixelCalib::PixelResidualHistograms::Read
int Read()
Definition: PixelResidualHistograms.cxx:113
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
PixelCalib::PixelChargeInterpolationValidation::Read
int Read(TDirectory *file=0)
Definition: PixelChargeInterpolationValidation.cxx:425
PixelCalib::PixelChargeInterpolationValidation::m_eta_phi_correlation
TH2F * m_eta_phi_correlation
Definition: PixelChargeInterpolationValidation.h:83
PixelCalib::PixelChargeInterpolationValidation::LayerIndex
@ LayerIndex
Definition: PixelChargeInterpolationValidation.h:93
athena.value
value
Definition: athena.py:124
PixelCalib::PixelChargeInterpolationValidation::m_etaErr_phi
PixelResidualHistograms * m_etaErr_phi
Definition: PixelChargeInterpolationValidation.h:59
Phi
@ Phi
Definition: RPCdef.h:8
PixelCalib::PixelChargeInterpolationValidation::m_phiPull
PixelResidualHistograms * m_phiPull
Definition: PixelChargeInterpolationValidation.h:50
PixelCalib::PixelChargeInterpolationValidation::m_phiDig_Clustersize
std::vector< PixelResidualHistograms * > m_phiDig_Clustersize
Definition: PixelChargeInterpolationValidation.h:73
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
PixelCalib::PixelChargeInterpolationValidation::PixelChargeInterpolationValidation
PixelChargeInterpolationValidation(const std::string &tag, const PixelChargeInterpolationParameters &model)
Definition: PixelChargeInterpolationValidation.cxx:30
python.RingerConstants.Layer
Layer
Definition: RingerConstants.py:42
PixelCalib::PixelChargeInterpolationValidation::m_eta_phi
PixelResidualHistograms * m_eta_phi
Definition: PixelChargeInterpolationValidation.h:53
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
PixelCalib::PixelChargeInterpolationValidation::m_phiPull_eta
PixelResidualHistograms * m_phiPull_eta
Definition: PixelChargeInterpolationValidation.h:58
PixelCalib::PixelChargeInterpolationValidation::m_charge_phi
PixelResidualHistograms * m_charge_phi
Definition: PixelChargeInterpolationValidation.h:62
PixelCalib::PixelChargeInterpolationValidation::m_phiPull_Layer
std::vector< PixelResidualHistograms * > m_phiPull_Layer
Definition: PixelChargeInterpolationValidation.h:69
OfflineCalibUtils.icc
PixelCalib::PixelChargeInterpolationValidation::m_eta
PixelResidualHistograms * m_eta
Definition: PixelChargeInterpolationValidation.h:45
PixelResidualHistograms.h
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
lumiFormat.i
int i
Definition: lumiFormat.py:85
PixelCalib::PixelChargeInterpolationValidation::Analyze
void Analyze(TDirectory *ref_file=0)
Definition: PixelChargeInterpolationValidation.cxx:674
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
PixelCalib::PixelChargeInterpolationValidation::m_phi
PixelResidualHistograms * m_phi
Definition: PixelChargeInterpolationValidation.h:46
PixelCalib::PixelChargeInterpolationValidation::m_etaErr
PixelResidualHistograms * m_etaErr
Definition: PixelChargeInterpolationValidation.h:51
PixelCalib::PixelChargeInterpolationValidation::m_phiDig_Layer
std::vector< PixelResidualHistograms * > m_phiDig_Layer
Definition: PixelChargeInterpolationValidation.h:67
covarianceTool.title
title
Definition: covarianceTool.py:542
file
TFile * file
Definition: tile_monitor.h:29
PixelCalib
Definition: PixelChargeInterpolationCalibration.h:14
PixelCalib::PixelResidualHistograms::Fill
void Fill(float residual, const std::vector< float > &parameters)
Definition: PixelResidualHistograms.cxx:68
PixelCalib::PixelChargeInterpolationValidation::m_ResEtaDig_vs_p
TH2F * m_ResEtaDig_vs_p
Definition: PixelChargeInterpolationValidation.h:85
PixelCalib::PixelChargeInterpolationValidation::m_eta_Clustersize
std::vector< PixelResidualHistograms * > m_eta_Clustersize
Definition: PixelChargeInterpolationValidation.h:72
PixelChargeInterpolationParameters.h
PixelCalib::PixelClusterOnTrackErrorData
Definition: PixelClusterOnTrackErrorData.h:25
PixelCalib::PixelChargeInterpolationValidation::ClustersizeIndex
@ ClustersizeIndex
Definition: PixelChargeInterpolationValidation.h:95
PixelCalib::PixelChargeInterpolationValidation::m_etaDig_phi
PixelResidualHistograms * m_etaDig_phi
Definition: PixelChargeInterpolationValidation.h:55
PixelCalib::PixelChargeInterpolationValidation::m_eta_Layer
std::vector< PixelResidualHistograms * > m_eta_Layer
Definition: PixelChargeInterpolationValidation.h:64
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PixelCalib::PixelChargeInterpolationValidation::m_phiDig_eta
PixelResidualHistograms * m_phiDig_eta
Definition: PixelChargeInterpolationValidation.h:56
PixelCalib::PixelChargeInterpolationValidation::m_etaClustersize
std::vector< TH1F * > m_etaClustersize
Definition: PixelChargeInterpolationValidation.h:80
PixelCalib::PixelChargeInterpolationValidation::m_etaPull
PixelResidualHistograms * m_etaPull
Definition: PixelChargeInterpolationValidation.h:49
PixelCalib::PixelChargeInterpolationValidation::m_charge_eta
PixelResidualHistograms * m_charge_eta
Definition: PixelChargeInterpolationValidation.h:61
PixelCalib::PixelResidualHistograms::Write
int Write(bool writebins=false)
Definition: PixelResidualHistograms.cxx:85
PixelCalib::PixelChargeInterpolationValidation::m_etaDig
PixelResidualHistograms * m_etaDig
Definition: PixelChargeInterpolationValidation.h:47
PixelCalib::PixelChargeInterpolationValidation::Write
int Write(TDirectory *file=0)
Definition: PixelChargeInterpolationValidation.cxx:480
PixelCalib::PixelChargeInterpolationValidation::m_phi_Clustersize
std::vector< PixelResidualHistograms * > m_phi_Clustersize
Definition: PixelChargeInterpolationValidation.h:71
PixelChargeInterpolationValidation.h
PixelCalib::PixelChargeInterpolationValidation::m_etaDig_Clustersize
std::vector< PixelResidualHistograms * > m_etaDig_Clustersize
Definition: PixelChargeInterpolationValidation.h:74
correlationModel::model
model
Definition: AsgElectronEfficiencyCorrectionTool.cxx:46
PixelCalib::PixelChargeInterpolationValidation::m_phiErr
PixelResidualHistograms * m_phiErr
Definition: PixelChargeInterpolationValidation.h:52
PixelCalib::PixelChargeInterpolationValidation::m_etaPull_Layer
std::vector< PixelResidualHistograms * > m_etaPull_Layer
Definition: PixelChargeInterpolationValidation.h:68
PixelCalib::PixelChargeInterpolationValidation::m_phiPull_Clustersize
std::vector< PixelResidualHistograms * > m_phiPull_Clustersize
Definition: PixelChargeInterpolationValidation.h:77
PixelCalib::PixelChargeInterpolationValidation::WriteErrorsFile
void WriteErrorsFile(const std::string &name)
Definition: PixelChargeInterpolationValidation.cxx:539
PixelCalib::PixelChargeInterpolationValidation::m_phiDig
PixelResidualHistograms * m_phiDig
Definition: PixelChargeInterpolationValidation.h:48
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
PixelCalib::PixelChargeInterpolationValidation::m_phi_Layer
std::vector< PixelResidualHistograms * > m_phi_Layer
Definition: PixelChargeInterpolationValidation.h:65
PixelCalib::PixelChargeInterpolationValidation::AngleIndex
@ AngleIndex
Definition: PixelChargeInterpolationValidation.h:94
PixelCalib::PixelChargeInterpolationValidation::m_phiErr_Clustersize
std::vector< PixelResidualHistograms * > m_phiErr_Clustersize
Definition: PixelChargeInterpolationValidation.h:75
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
PixelCalib::PixelChargeInterpolationParameters
Definition: PixelChargeInterpolationParameters.h:26
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
PixelCalib::PixelChargeInterpolationValidation::m_CSeta_CSphi_correlation
TH2F * m_CSeta_CSphi_correlation
Definition: PixelChargeInterpolationValidation.h:84
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
Eta
@ Eta
Definition: RPCdef.h:8
fitman.k
k
Definition: fitman.py:528
PixelCalib::PixelChargeInterpolationValidation::m_etaPull_phi
PixelResidualHistograms * m_etaPull_phi
Definition: PixelChargeInterpolationValidation.h:57
PixelCalib::PixelResidualHistograms
Definition: PixelResidualHistograms.h:21