ATLAS Offline Software
NPVBeamspotCorrection.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
32 
34  : m_g_nvtx_nreco_bs66mm(nullptr), m_g_nvtx_nreco_bs47mm(nullptr), m_invGraph(nullptr), m_NPVmin(0), m_NPVmax(0)
35 {
37 }
38 
40 {
43  if (m_invGraph) delete m_invGraph;
44 }
45 
47 
48  printf(" \n\nInitializing the NPV Beamspot correction tool\n");
49 
52 
53  if (m_invGraph==nullptr) {
54  m_invGraph = new TGraph();
55  for (int i=0;i<m_g_nvtx_nreco_bs66mm->GetN();++i)
56  m_invGraph->SetPoint(i,m_g_nvtx_nreco_bs66mm->GetY()[i],m_g_nvtx_nreco_bs66mm->GetX()[i]);
57  }
58  m_NPVmin = m_g_nvtx_nreco_bs66mm->GetY()[0];
60 }
61 
63 {
64  if (nRecoVtx<m_NPVmin) error(Form("Nonsense input to GetNVertexBsCorrection: NPV=%.2f",nRecoVtx));
65  // if outside range, linear extrapolation from last valid value
66  if (nRecoVtx>=m_NPVmax) return m_g_nvtx_nreco_bs47mm->Eval(m_invGraph->Eval(m_NPVmax))/m_NPVmax*nRecoVtx;
67 
68  return m_g_nvtx_nreco_bs47mm->Eval(m_invGraph->Eval(nRecoVtx));
69 }
70 
72  TGraph *graph = new TGraph(41);
73  graph->SetName("g_shadowedAverage_bs47mm");
74  graph->SetPoint(0, 0, 0);
75  graph->SetPoint(1, 1, 1);
76  graph->SetPoint(2, 2, 1.97111);
77  graph->SetPoint(3, 3, 2.91499);
78  graph->SetPoint(4, 4, 3.83313);
79  graph->SetPoint(5, 5, 4.72692);
80  graph->SetPoint(6, 6, 5.59763);
81  graph->SetPoint(7, 7, 6.44645);
82  graph->SetPoint(8, 8, 7.27445);
83  graph->SetPoint(9, 9, 8.08265);
84  graph->SetPoint(10, 10, 8.87199);
85  graph->SetPoint(11, 11, 9.64332);
86  graph->SetPoint(12, 12, 10.3975);
87  graph->SetPoint(13, 13, 11.1352);
88  graph->SetPoint(14, 14, 11.8572);
89  graph->SetPoint(15, 15, 12.5641);
90  graph->SetPoint(16, 16, 13.2567);
91  graph->SetPoint(17, 17, 13.9353);
92  graph->SetPoint(18, 18, 14.6007);
93  graph->SetPoint(19, 19, 15.2532);
94  graph->SetPoint(20, 20, 15.8935);
95  graph->SetPoint(21, 21, 16.5219);
96  graph->SetPoint(22, 22, 17.1389);
97  graph->SetPoint(23, 23, 17.7449);
98  graph->SetPoint(24, 24, 18.3404);
99  graph->SetPoint(25, 25, 18.9255);
100  graph->SetPoint(26, 26, 19.5008);
101  graph->SetPoint(27, 27, 20.0665);
102  graph->SetPoint(28, 28, 20.623);
103  graph->SetPoint(29, 29, 21.1705);
104  graph->SetPoint(30, 30, 21.7094);
105  graph->SetPoint(31, 31, 22.2399);
106  graph->SetPoint(32, 32, 22.7622);
107  graph->SetPoint(33, 33, 23.2767);
108  graph->SetPoint(34, 34, 23.7835);
109  graph->SetPoint(35, 35, 24.2829);
110  graph->SetPoint(36, 36, 24.7751);
111  graph->SetPoint(37, 37, 25.2604);
112  graph->SetPoint(38, 38, 25.7388);
113  graph->SetPoint(39, 39, 26.2106);
114  graph->SetPoint(40, 40, 26.6759);
115  return graph;
116 }
117 
119  TGraph *graph = new TGraph(41);
120  graph->SetName("g_shadowedAverage_bs66mm");
121  graph->SetPoint(0, 0, 0);
122  graph->SetPoint(1, 1, 1);
123  graph->SetPoint(2, 2, 1.97943);
124  graph->SetPoint(3, 3, 2.93912);
125  graph->SetPoint(4, 4, 3.87986);
126  graph->SetPoint(5, 5, 4.8024);
127  graph->SetPoint(6, 6, 5.70743);
128  graph->SetPoint(7, 7, 6.59561);
129  graph->SetPoint(8, 8, 7.46756);
130  graph->SetPoint(9, 9, 8.32386);
131  graph->SetPoint(10, 10, 9.16509);
132  graph->SetPoint(11, 11, 9.99175);
133  graph->SetPoint(12, 12, 10.8044);
134  graph->SetPoint(13, 13, 11.6034);
135  graph->SetPoint(14, 14, 12.3893);
136  graph->SetPoint(15, 15, 13.1624);
137  graph->SetPoint(16, 16, 13.9233);
138  graph->SetPoint(17, 17, 14.6723);
139  graph->SetPoint(18, 18, 15.4097);
140  graph->SetPoint(19, 19, 16.136);
141  graph->SetPoint(20, 20, 16.8514);
142  graph->SetPoint(21, 21, 17.5562);
143  graph->SetPoint(22, 22, 18.2509);
144  graph->SetPoint(23, 23, 18.9356);
145  graph->SetPoint(24, 24, 19.6106);
146  graph->SetPoint(25, 25, 20.2763);
147  graph->SetPoint(26, 26, 20.9329);
148  graph->SetPoint(27, 27, 21.5806);
149  graph->SetPoint(28, 28, 22.2197);
150  graph->SetPoint(29, 29, 22.8504);
151  graph->SetPoint(30, 30, 23.4729);
152  graph->SetPoint(31, 31, 24.0874);
153  graph->SetPoint(32, 32, 24.6941);
154  graph->SetPoint(33, 33, 25.2933);
155  graph->SetPoint(34, 34, 25.8851);
156  graph->SetPoint(35, 35, 26.4697);
157  graph->SetPoint(36, 36, 27.0473);
158  graph->SetPoint(37, 37, 27.6179);
159  graph->SetPoint(38, 38, 28.1819);
160  graph->SetPoint(39, 39, 28.7394);
161  graph->SetPoint(40, 40, 29.2904);
162  return graph;
163 }
NPVBeamspotCorrection::NPVBeamspotCorrection
NPVBeamspotCorrection()
Return approximate correction on the number of reconstructed vertices due to different beamspot longi...
Definition: NPVBeamspotCorrection.cxx:33
NPVBeamspotCorrection::m_NPVmin
double m_NPVmin
Definition: NPVBeamspotCorrection.h:46
NPVBeamspotCorrection::m_invGraph
TGraph * m_invGraph
Definition: NPVBeamspotCorrection.h:44
NPVBeamspotCorrection.h
NPVBeamspotCorrection::NVtx_NReconstructible_bs47mm
TGraph * NVtx_NReconstructible_bs47mm()
Definition: NPVBeamspotCorrection.cxx:71
NPVBeamspotCorrection::initNPVBeamspotCorrection
void initNPVBeamspotCorrection()
Definition: NPVBeamspotCorrection.cxx:46
lumiFormat.i
int i
Definition: lumiFormat.py:85
NPVBeamspotCorrection::error
void error(TString msg)
Definition: NPVBeamspotCorrection.h:33
NPVBeamspotCorrection::m_g_nvtx_nreco_bs66mm
TGraph * m_g_nvtx_nreco_bs66mm
Definition: NPVBeamspotCorrection.h:40
NPVBeamspotCorrection::NVtx_NReconstructible_bs66mm
TGraph * NVtx_NReconstructible_bs66mm()
Definition: NPVBeamspotCorrection.cxx:118
NPVBeamspotCorrection::GetNVertexBsCorrection
double GetNVertexBsCorrection(double nRecoVtx)
Definition: NPVBeamspotCorrection.cxx:62
NPVBeamspotCorrection::m_NPVmax
double m_NPVmax
Definition: NPVBeamspotCorrection.h:46
NPVBeamspotCorrection::~NPVBeamspotCorrection
virtual ~NPVBeamspotCorrection()
Definition: NPVBeamspotCorrection.cxx:39
NPVBeamspotCorrection::m_g_nvtx_nreco_bs47mm
TGraph * m_g_nvtx_nreco_bs47mm
Definition: NPVBeamspotCorrection.h:42