ATLAS Offline Software
TrigL2Vertex.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 #include <cstring>
8 
10  m_pTrigTrack(pT),
11  m_nTrackType(1),
12  m_mass(mass)
13 {
14  double Ck[5][5];
15  int i{0},j{0};
16 
17  const TrigInDetTrackFitPar* p=pT->param();
18 
19  double a=-2.0*exp(-p->eta())/(1.0+exp(-2.0*p->eta()));
20  m_u[0]=p->a0();
21  m_u[1]=p->z0();
22  m_q[0]=p->phi0();
23  m_q[1]=2.0*atan(exp(-p->eta()));
24  m_q[2]=p->pT()/1000.0;
25 
26 
27  Ck[0][0]=(*p->cov())[0];Ck[0][1]=Ck[1][0]=(*p->cov())[2];
28  Ck[0][2]=Ck[2][0]=(*p->cov())[1];Ck[0][3]=Ck[3][0]=(*p->cov())[3];
29  Ck[0][4]=Ck[4][0]=(*p->cov())[4];Ck[1][1]=(*p->cov())[9];
30  Ck[1][2]=Ck[2][1]=(*p->cov())[6];Ck[1][3]=Ck[3][1]=(*p->cov())[10];
31  Ck[1][4]=Ck[4][1]=(*p->cov())[11];Ck[2][2]=(*p->cov())[5];
32  Ck[2][3]=Ck[3][2]=(*p->cov())[7];Ck[2][4]=Ck[4][2]=(*p->cov())[8];
33  Ck[3][3]=(*p->cov())[12];Ck[3][4]=Ck[4][3]=(*p->cov())[13];
34  Ck[4][4]=(*p->cov())[14];
35  for(i=0;i<5;i++)
36  {
37  Ck[3][i]=a*Ck[3][i];Ck[i][3]=Ck[3][i];
38  }
39  Ck[3][3]*=a;
40  for(i=0;i<5;i++)
41  {
42  Ck[4][i]=Ck[4][i]/1000.0;Ck[i][4]=Ck[4][i];
43  }
44  Ck[4][4]/=1000.0;
45 
46 
47  for(i=0;i<2;i++) for(j=0;j<2;j++) m_Vuu[i][j]=Ck[i][j];
48  for(i=0;i<2;i++) for(j=0;j<3;j++) m_Vuq[i][j]=Ck[i][j+2];
49  for(i=0;i<3;i++) for(j=0;j<3;j++) m_Vqq[i][j]=Ck[i+2][j+2];
50 
51  /*
52  m_Vuu[0][0]=(*p->cov())[0];
53  m_Vuu[0][1]=m_Vuu[1][0]=(*p->cov())[2];
54  m_Vuu[1][1]=(*p->cov())[9];
55 
56  m_Vuq[0][0]=(*p->cov())[1];m_Vuq[0][1]=(*p->cov())[3]*a;
57  m_Vuq[0][2]=(*p->cov())[4]*1e-3;m_Vuq[1][0]=(*p->cov())[6];m_Vuq[1][1]=(*p->cov())[10]*a;
58  m_Vuq[1][2]=(*p->cov())[11]*1e-3;
59 
60  m_Vqq[0][0]=(*p->cov())[5];m_Vqq[0][1]=m_Vqq[1][0]=(*p->cov())[7]*a;
61  m_Vqq[0][2]=m_Vqq[2][0]=(*p->cov())[8]*1e-3;
62  m_Vqq[1][1]=(*p->cov())[12]*a*a;m_Vqq[1][2]=m_Vqq[2][1]=(*p->cov())[13]*a*1e-3;
63  m_Vqq[2][2]=(*p->cov())[14]*1e-6;
64  */
65  m_Perigee[0]=m_u[0];m_Perigee[1]=m_u[1];m_Perigee[2]=m_q[0];m_Perigee[3]=m_q[1];m_Perigee[4]=m_q[2];
66 }
67 
69  m_pTrkTrack(pT),
70  m_nTrackType(2),
71  m_mass(mass)
72 {
73  double Ck[5][5];
74 
75  const Trk::Perigee* pP= pT->perigeeParameters();
76 
77  m_u[0]=pP->parameters()[Trk::d0];
78  m_u[1]=pP->parameters()[Trk::z0];
79  m_q[0]=pP->parameters()[Trk::phi0];
80  m_q[1]=pP->parameters()[Trk::theta];
81 
82  double ptC=1000.0*pP->parameters()[Trk::qOverP];
83 
84  m_q[2]=sin(pP->parameters()[Trk::theta])/ptC;
85 
86  if( pP->covariance() ){
87  // has covariance matrix
88  const AmgSymMatrix(5)* TC = pP->covariance();
89 
90  Ck[0][0]=(*TC)(Trk::d0,Trk::d0);
91  Ck[0][1]=Ck[1][0]=(*TC)(Trk::d0,Trk::z0);
92  Ck[0][2]=Ck[2][0]=(*TC)(Trk::d0,Trk::phi0);
93  Ck[0][3]=Ck[3][0]=(*TC)(Trk::d0,Trk::theta);
94  Ck[0][4]=Ck[4][0]=(*TC)(Trk::d0,Trk::qOverP);
95  Ck[1][1]=(*TC)(Trk::z0,Trk::z0);
96  Ck[1][2]=Ck[2][1]=(*TC)(Trk::z0,Trk::phi0);
97  Ck[1][3]=Ck[3][1]=(*TC)(Trk::z0,Trk::theta);
98  Ck[1][4]=Ck[4][1]=(*TC)(Trk::z0,Trk::qOverP);
99  Ck[2][2]=(*TC)(Trk::phi0,Trk::phi0);
100  Ck[2][3]=Ck[3][2]=(*TC)(Trk::phi0,Trk::theta);
101  Ck[2][4]=Ck[4][2]=(*TC)(Trk::phi0,Trk::qOverP);
102  Ck[3][3]=(*TC)(Trk::theta,Trk::theta);
103  Ck[3][4]=Ck[4][3]=(*TC)(Trk::theta,Trk::qOverP);
104  Ck[4][4]=(*TC)(Trk::qOverP,Trk::qOverP);
105 
106  const double a = cos(pP->parameters()[Trk::theta])/ptC;
107  const double b = -sin(pP->parameters()[Trk::theta])/(pP->parameters()[Trk::qOverP]*ptC);
108 
109  Ck[3][3]=Ck[3][3]+2.0*a*Ck[3][4]+a*a*Ck[4][4];
110  Ck[3][4]=Ck[4][3]=b*Ck[3][4]+a*b*Ck[4][4];
111  Ck[4][4]=b*b*Ck[4][4];
112  Ck[0][3]=Ck[3][0]=Ck[0][3]+a*Ck[0][4];Ck[0][4]*=b;Ck[4][0]=Ck[0][4];
113  Ck[1][3]=Ck[3][1]=Ck[1][3]+a*Ck[1][4];Ck[1][4]*=b;Ck[4][1]=Ck[1][4];
114  Ck[2][3]=Ck[3][2]=Ck[2][3]+a*Ck[2][4];Ck[2][4]*=b;Ck[4][2]=Ck[2][4];
115  for(int i=0;i<2;i++) for(int j=0;j<2;j++) m_Vuu[i][j]=Ck[i][j];
116  for(int i=0;i<3;i++) for(int j=0;j<3;j++) m_Vqq[i][j]=Ck[i+2][j+2];
117  for(int i=0;i<2;i++) for(int j=0;j<3;j++) m_Vuq[i][j]=Ck[i][j+2];
118 
119  m_Perigee[0]=m_u[0];m_Perigee[1]=m_u[1];m_Perigee[2]=m_q[0];m_Perigee[3]=m_q[1];m_Perigee[4]=m_q[2];
120  }
121  else{
122  m_active=false;
123  // no covariance
124  }
125 
126 }
127 
129 {
130 
131 }
132 
134 {
135  m_mass=m;
136 }
137 
139 {
140  m_active=false;
141 }
142 
144 {
145  m_active=true;
146 }
147 
149 {
150  return m_active;
151 }
152 
154 {
155  return m_nTrackType;
156 }
157 
158 
160 {
161  return m_pTrigTrack;
162 }
163 
165 {
166  return m_pTrkTrack;
167 }
168 
170 {
171  m_index=i;
172 }
173 
175 {
176  return m_index;
177 }
178 
179 const double* TrigVertexFitInputTrack::Perigee() const
180 {
181  return &m_Perigee[0];
182 }
183 
185 {
186  return m_PerigeeCovariance[i][j];
187 }
188 
190 {
191  const int i = 3+m_index*3;
192  for(int j=0;j<3;j++)
193  pV->getParametersVector()[i+j]=m_q[j];
194 }
195 
197 {
198  const double C=0.02997;
199  const double B=20.84;
200  const double alpha=C*B/1000.0;
201 
202  double Sk[2][2],detr,chi2;
203  double AC[2][3],BV[2][3];
204  int i{0},j{0},k{0};
205 
206  const int shift=m_index*3;
207 
208  k=3+shift;
209  for(i=0;i<3;i++)
210  for(j=0;j<3;j++)
211  pV->m_Gk[i+k][j+k]=m_Vqq[i][j];
212 
213  initializeVertex(pV);
214  const double xv=pV->getParametersVector()[0];
215  const double yv=pV->getParametersVector()[1];
216  const double zv=pV->getParametersVector()[2];
217  const double phi0=pV->getParametersVector()[3+shift];
218  const double theta0=pV->getParametersVector()[4+shift];
219  const double P0=pV->getParametersVector()[5+shift];
220 
221  const double cosPhi0=cos(phi0);
222  const double sinPhi0=sin(phi0);
223  const double sinPsi=-alpha*(xv*cosPhi0+yv*sinPhi0)/P0;
224  if(fabs(sinPsi)>1.0) return -999.9;
225  const double cosPsi=sqrt(1.0-sinPsi*sinPsi);
226  const double psi=asin(sinPsi);
227  const double sint=sin(theta0);
228  const double ctt=cos(theta0)/sint;
229 
230  m_A[0][0]=-sin(phi0+psi)/cosPsi;
231  m_A[0][1]= cos(phi0+psi)/cosPsi;
232  m_A[0][2]=0.0;
233 
234  m_A[1][0]=-ctt*cosPhi0/cosPsi;
235  m_A[1][1]=-ctt*sinPhi0/cosPsi;
236  m_A[1][2]=1.0;
237 
238  m_B[0][0]=-xv*m_A[0][1]+yv*m_A[0][0];
239  m_B[0][1]=0.0;
240  m_B[0][2]=(1.0-1.0/cosPsi)/alpha;
241 
242  m_B[1][0]=-xv*m_A[1][1]+yv*m_A[1][0];
243  m_B[1][1]=-P0*psi/(alpha*sint*sint);
244  m_B[1][2]=ctt*(psi-sinPsi/cosPsi)/alpha;
245 
246  m_h[0]=yv*cosPhi0-xv*sinPhi0+P0*(1-cosPsi)/alpha;
247  m_h[1]=zv+P0*ctt*psi/alpha;
248 
249  m_resid[0]=m_u[0]-m_h[0];
250  m_resid[1]=m_u[1]-m_h[1];
251 
252  for(i=0;i<2;i++) for(j=0;j<2;j++) Sk[i][j]=m_Vuu[i][j];
253  for(i=0;i<2;i++) for(j=0;j<3;j++)
254  {
255  AC[i][j]=0.0;
256  for(k=0;k<3;k++) AC[i][j]+=m_A[i][k]*pV->m_Gk[k][j];
257  }
258  for(i=0;i<2;i++) for(j=0;j<2;j++)
259  {
260  for(k=0;k<3;k++) Sk[i][j]+=AC[i][k]*m_A[j][k];
261  }
262  for(i=0;i<2;i++)
263  for(j=0;j<3;j++)
264  {
265  BV[i][j]=0.0;
266  for(k=0;k<3;k++) BV[i][j]+=m_B[i][k]*m_Vqq[k][j];
267  }
268  for(i=0;i<2;i++)
269  for(j=0;j<2;j++)
270  {
271  for(k=0;k<3;k++) Sk[i][j]+=BV[i][k]*m_B[j][k];
272  }
273  Sk[0][0]-=2.0*(m_Vuq[0][0]*m_B[0][0]+m_Vuq[0][1]*m_B[0][1]+m_Vuq[0][2]*m_B[0][2]);
274  Sk[1][1]-=2.0*(m_Vuq[1][0]*m_B[1][0]+m_Vuq[1][1]*m_B[1][1]+m_Vuq[1][2]*m_B[1][2]);
275  Sk[0][1]-=m_Vuq[1][0]*m_B[0][0]+m_Vuq[1][1]*m_B[0][1]+m_Vuq[1][2]*m_B[0][2]+
276  m_Vuq[0][0]*m_B[1][0]+m_Vuq[0][1]*m_B[1][1]+m_Vuq[0][2]*m_B[1][2];
277  Sk[1][0]=Sk[0][1];
278 
279  detr=1.0/(Sk[0][0]*Sk[1][1]-Sk[0][1]*Sk[1][0]);
280  m_V[0][0]=Sk[1][1]*detr;
281  m_V[1][1]=Sk[0][0]*detr;
282  m_V[0][1]=m_V[1][0]=-Sk[0][1]*detr;
283 
284  chi2=m_V[0][0]*m_resid[0]*m_resid[0]+m_V[1][1]*m_resid[1]*m_resid[1]+
285  2.0*m_V[0][1]*m_resid[1]*m_resid[0];
286 
287  for(i=0;i<2;i++)
288  {
289  for(j=0;j<3;j++) m_D[i][j]=AC[i][j];
290  for(j=3;j<3+shift;j++)
291  {
292  m_D[i][j]=0.0;
293  for(k=0;k<3;k++)
294  m_D[i][j]+=m_A[i][k]*pV->m_Gk[k][j];
295  }
296  for(j=0;j<3;j++) m_D[i][j+3+shift]=BV[i][j]-m_Vuq[i][j];
297  }
298 
299  return chi2;
300 }
301 
302 
304 {
305  int i{0},j{0},k{0};
306  const int nSize=6+3*m_index;
307 
308  double K[2][MAX_SIZE_VERT_COVM];
309 
310  for(i=0;i<2;i++)
311  {
312  for(j=0;j<nSize;j++)
313  {
314  K[i][j]=0.0;
315  for(k=0;k<2;k++) K[i][j]+=m_D[k][j]*m_V[k][i];
316  }
317  }
318  for(i=0;i<nSize;i++)
319  {
320  pV->getParametersVector()[i]+=K[0][i]*m_resid[0]+K[1][i]*m_resid[1];
321  for(j=i;j<nSize;j++)
322  {
323  pV->m_Gk[i][j]-=K[0][i]*m_D[0][j]+K[1][i]*m_D[1][j];
324  pV->m_Gk[j][i]=pV->m_Gk[i][j];
325  }
326  }
327 }
328 
329 MsgStream& TrigVertexFitInputTrack::report( MsgStream& out ) const
330 {
331  out<<"Track "<<m_index<<" : mass="<<m_mass<<endmsg;
332  for(int i=0;i<2;i++)
333  {
334  out<<" u"<<i<<" = "<<m_u[i]<<" "<<m_Vuu[i][0]<<" "<<m_Vuu[i][1]<<endmsg;
335  }
336  for(int i=0;i<3;i++)
337  {
338  out<<" q"<<i<<" = "<<m_q[i]<<" "<<m_Vqq[i][0]<<" "<<m_Vqq[i][1]<<" "<<m_Vqq[i][2]<<endmsg;
339  }
340  return out;
341 }
342 
344  const TrigVertexFitInputTrack* pT1,
345  const TrigVertexFitInputTrack* pT2) : m_value(m)
346 {
347  m_trackList.clear();
348  m_trackList.push_back(pT1);
349  m_trackList.push_back(pT2);
350 }
351 
353  const TrigVertexFitInputTrack* pT1,
354  const TrigVertexFitInputTrack* pT2,
355  const TrigVertexFitInputTrack* pT3) : m_value(m)
356 {
357  m_trackList.clear();
358  m_trackList.push_back(pT1);m_trackList.push_back(pT2);m_trackList.push_back(pT3);
359 }
360 
361 
363 {
364  m_trackList.clear();
365 }
366 
368 {
369  const double C=0.029997;
370  const double B=20.84;
371 
372  double invMass=0.0,alpha=C*B/1000.0;
373  double P[3];double E=0.0;
374 
375  double* Rk = pV->getParametersVector();
376 
377  int offset=0;
378  for(int i=0;i<3;i++) P[i]=0.0;
379 
381  {
382  offset=3+3*(*it)->getIndex();
383  double mass=(*it)->getMass()/1000.0;
384  double pT=fabs(Rk[offset+2]);
385  double p=pT/sin(Rk[offset+1]);
386 
387  double psi=-asin(alpha*(Rk[0]*cos(Rk[offset])+Rk[1]*sin(Rk[offset]))/Rk[offset+2]);
388  double phiV=Rk[offset]+psi;
389  P[0]+=pT*cos(phiV);
390  P[1]+=pT*sin(phiV);
391  P[2]+=pT*cos(Rk[offset+1])/sin(Rk[offset+1]);
392  E+=sqrt(mass*mass+p*p);
393  }
394  invMass=sqrt(E*E-P[0]*P[0]-P[1]*P[1]-P[2]*P[2]);
395 
396  return invMass;
397 }
398 
399 
401 {
402  const double C=0.029997;
403  const double B=20.84;
404 
405  double invMass=0.0,alpha=C*B/1000.0;
406  double P[3];
407  double E=0.0;
408  int i{0},j{0};
409  bool linFailed=false;
410  double* Rk = pV->getParametersVector();
411 
412  int offset=0;
413  for(i=0;i<3;i++) P[i]=0.0;
414 
415  int nSize=3+3*pV->getTracks()->size();
416 
418  {
419  offset=3+3*(*it)->getIndex();
420  double mass=(*it)->getMass()/1000.0;
421  double pT=fabs(Rk[offset+2]);
422  double p=pT/sin(Rk[offset+1]);
423 
424  double psi=-asin(alpha*(Rk[0]*cos(Rk[offset])+Rk[1]*sin(Rk[offset]))/Rk[offset+2]);
425  double phiV=Rk[offset]+psi;
426  P[0]+=pT*cos(phiV);
427  P[1]+=pT*sin(phiV);
428  P[2]+=pT*cos(Rk[offset+1])/sin(Rk[offset+1]);
429  E+=sqrt(mass*mass+p*p);
430  }
431  invMass=sqrt(E*E-P[0]*P[0]-P[1]*P[1]-P[2]*P[2]);
432 
433  m_resid[0]=m_value/1000.0-invMass;
434  m_D[0][0]=0.0;m_D[0][1]=0.0;m_D[0][2]=0.0;
435 
437  {
438  offset=3+3*(*it)->getIndex();
439 
440  double mass=(*it)->getMass()/1000.0;
441  double Ck=(Rk[offset+2]<0.0)?-1.0:1.0;
442  double sinT=sin(Rk[offset+1]);
443  double cosT=cos(Rk[offset+1]);
444  double pT=fabs(Rk[offset+2]);
445  double p=pT/sinT;
446  double e=sqrt(p*p+mass*mass);
447  double sinF=sin(Rk[offset]);
448  double cosF=cos(Rk[offset]);
449 
450  double sinPsi=-alpha*(Rk[0]*cosF+Rk[1]*sinF)/Rk[offset+2];
451  if(fabs(sinPsi)>1.0)
452  {
453  linFailed=true;
454  break;
455  }
456  double psi=asin(sinPsi);
457  double cosPsi=sqrt(1.0-sinPsi*sinPsi);
458  double phiV=Rk[offset]+psi;
459 
460  double aCos=alpha*Ck/cosPsi;
461  double dP=P[1]*cos(phiV)-P[0]*sin(phiV);
462  double eE=E*Rk[offset+2]/(e*sinT);
463 
464  m_D[0][0]+=dP*cosF*aCos;
465  m_D[0][1]+=dP*sinF*aCos;
466  m_D[0][offset]=-dP*Ck*(Rk[offset+2]-Ck*aCos*(Rk[1]*cosF-Rk[0]*sinF));
467  m_D[0][offset+1]=(Rk[offset+2]/(sinT*sinT))*(P[2]*Ck-eE*cosT);
468  m_D[0][offset+2]=eE/sinT-Ck*(P[0]*cos(phiV)+P[1]*sin(phiV)+P[2]*cosT/sinT)+dP*Ck*sinPsi/cosPsi;
469  }
470  for(i=0;i<nSize;i++) m_D[0][i]/=invMass;
471  if(linFailed) return -999.9;
472  /*
473  for(i=0;i<nSize;i++) printf("%E ",m_D[0][i]);
474  printf("\n");
475  printf("----- numerical Jacobian -----\n");
476 
477  double oldPar, newPar, Delta, newMass, der;
478  for(i=0;i<nSize;i++)
479  {
480  oldPar=Rk[i];
481  Delta=0.00001*oldPar;
482  newPar=oldPar+Delta;
483  Rk[i]=newPar;
484  newMass=calculateInvariantMass(pV);
485  der=(newMass-invMass)/Delta;
486  m_D[1][i]=der;
487  Rk[i]=oldPar;
488  }
489  for(i=0;i<nSize;i++) printf("%E ",m_D[1][i]);
490  printf("\n");
491  printf("------------------------------\n");
492  */
493 
494  double covM=1e-12;
495 
496  for(i=0;i<nSize;i++)
497  {
498  for(j=i;j<nSize;j++)
499  {
500  double dCov=pV->m_Gk[i][j]*m_D[0][i]*m_D[0][j];
501  if(i!=j) dCov*=2.0;
502  covM+=dCov;
503  }
504  }
505  m_V[0][0]=1.0/covM;
506  return ((m_resid[0]*m_resid[0])*m_V[0][0]);
507 }
508 
510 {
511  double K[MAX_SIZE_VERT_COVM];
512  int i{0},j{0};
513  const int nSize=3+3*pV->getTracks()->size();
514  double gain{0};
515 
516  for(i=0;i<nSize;i++)
517  {
518  gain=0.0;
519  for(j=0;j<nSize;j++) gain+=pV->m_Gk[i][j]*m_D[0][j];
520  m_D[1][i]=gain;
521  K[i]=gain*m_V[0][0];
522  }
523  for(i=0;i<nSize;i++)
524  {
525  pV->getParametersVector()[i]+=K[i]*m_resid[0];
526  for(j=i;j<nSize;j++)
527  {
528  pV->m_Gk[i][j]-=K[i]*m_D[1][j];
529  pV->m_Gk[j][i]=pV->m_Gk[i][j];
530  }
531  }
532 }
533 
534 MsgStream& TrigVertexFitConstraint::report( MsgStream& out) const
535 {
536  out<<"Mass constraint with "<<m_trackList.size()<<" : mass="<<m_value<<endmsg;
537  return out;
538 }
539 
541 {
542  return m_value;
543 }
544 
546 {
547  m_pvConstraints=new std::list<TrigVertexFitConstraint*>;
548  m_pvTracks=new std::list<TrigVertexFitInputTrack*>;
549  m_pvConstraints->clear();m_pvTracks->clear();
550  m_nStatus=0;
551  m_nTracks=0;
552  m_P=NULL;
553  m_mass=0.0;
554  m_massVar=0.0;
555  m_chiSquared=0.0;
556  m_nDOF=0;
557  m_ready=false;
558 }
559 
561 {
563  tIt!=m_pvTracks->end();++tIt)
564  {
565  delete (*tIt);
566  }
568  tIt!=m_pvConstraints->end();++tIt)
569  {
570  delete (*tIt);
571  }
572  m_pvConstraints->clear();m_pvTracks->clear();
573  delete m_pvTracks;delete m_pvConstraints;
574  if(m_P!=NULL) delete m_P;
575 }
576 
578 {
579  m_nTracks=m_pvTracks->size();
580  return m_nTracks;
581 }
582 
584 {
585  m_nTracks=m_pvTracks->size();
586  m_nDOF=-3;
587  m_chiSquared=0.0;
588  m_ready=true;
589  return true;
590 }
591 
593 {
594  memset(&m_Gk[0][0],0,sizeof(m_Gk));
595  m_nDOF=-3;
596  m_chiSquared=0.0;
597 }
598 
600 {
601  return (m_nStatus>0);
602 }
603 
605 {
606  return (m_nStatus>1);
607 }
608 
610 {
611  return m_P;
612 }
613 
615 {
616  m_P=P;
617 }
618 
620 {
621  return m_chiSquared;
622 }
623 
625 {
626  return m_nDOF;
627 }
628 
630 {
632 }
633 
635 {
636  m_nDOF+=n;
637 }
638 
640 {
641  if(isMassEstimated()) return m_mass;
642  else return 0.0;}
643 
644 
646 {
647  if(isMassEstimated()) return m_massVar;
648  else return 0.0;
649 }
650 
652 {
653  return &m_Rk[0];
654 }
655 
656 std::list<TrigVertexFitInputTrack*>* TrigL2Vertex::getTracks()
657 {
658  return m_pvTracks;
659 }
660 
661 std::list<TrigVertexFitConstraint*>* TrigL2Vertex::getConstraints()
662 {
663  return m_pvConstraints;
664 }
665 
667 {
668  m_nStatus=s;
669 }
670 
672 {
673  m_mass=m;
674 }
675 
677 {
678  m_massVar=v;
679 }
680 
682 {
683  return m_nStatus;
684 }
685 
687 {
688  return m_ready;
689 }
690 
691 MsgStream& TrigL2Vertex::report( MsgStream& msg) const
692 {
693  const int nSize=3+3*m_pvTracks->size();
694 
695  for(int i=0;i<nSize;i++)
696  {
697  msg<<m_Rk[i]<<" ";
698  for(int j=0;j<nSize;j++) msg<<m_Gk[i][j]<<" ";
699  msg<<endmsg;
700  }
701  return msg;
702 }
703 
705 {
706  TrigVertexFitInputTrack* pI=NULL;
708  it!=m_pvTracks->end();++it)
709  {
710  if((*it)->getTrackType()!=1) continue;
711  if(pT==(*it)->getTrigTrack())
712  {
713  pI=(*it);break;
714  }
715  }
716  return pI;
717 }
718 
719 
721 {
722  TrigVertexFitInputTrack* pI=NULL;
724  it!=m_pvTracks->end();++it)
725  {
726  if((*it)->getTrackType()!=2) continue;
727  if(pT==(*it)->getTrkTrack())
728  {
729  pI=(*it);break;
730  }
731  }
732  return pI;
733 }
TrigVertexFitConstraint::calculateInvariantMass
double calculateInvariantMass(TrigL2Vertex *pV)
Definition: TrigL2Vertex.cxx:367
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TrigL2Vertex::m_P
TrigInDetTrackFitPar * m_P
Definition: TrigL2Vertex.h:193
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TrigVertexFitConstraint::TrigVertexFitConstraint
TrigVertexFitConstraint(double, const TrigVertexFitInputTrack *, const TrigVertexFitInputTrack *)
two-track mass constraint
Definition: TrigL2Vertex.cxx:343
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
TrigVertexFitInputTrack::setMass
void setMass(double)
sets a mass of this particle
Definition: TrigL2Vertex.cxx:133
TrigVertexFitInputTrack::m_u
double m_u[2]
Definition: TrigL2Vertex.h:93
TrigVertexFitInputTrack::getTrackType
int getTrackType()
0: L2 track, 1: EF(offline) track
Definition: TrigL2Vertex.cxx:153
TrigVertexFitConstraint::m_value
double m_value
Definition: TrigL2Vertex.h:118
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrigL2Vertex::setStatus
void setStatus(int)
sets vertex status flag
Definition: TrigL2Vertex.cxx:666
TrigVertexFitInputTrack::initializeVertex
void initializeVertex(class TrigL2Vertex *)
resets and fills its part of the covariance and parameter vector
Definition: TrigL2Vertex.cxx:189
TrigL2Vertex::TrigL2Vertex
TrigL2Vertex()
Definition: TrigL2Vertex.cxx:545
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrackParameters.h
P4Helpers::invMass
double invMass(const I4Momentum &pA, const I4Momentum &pB)
invariant mass from two I4momentum references
Definition: P4Helpers.h:252
TrigVertexFitInputTrack::getTrkTrack
const Trk::Track * getTrkTrack()
getter for EF (offline) tracks
Definition: TrigL2Vertex.cxx:164
TrigL2Vertex::m_massVar
double m_massVar
Definition: TrigL2Vertex.h:190
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
TrigVertexFitConstraint::~TrigVertexFitConstraint
~TrigVertexFitConstraint()
Definition: TrigL2Vertex.cxx:362
TrigVertexFittingNode::m_D
double m_D[2][MAX_SIZE_VERT_COVM]
Definition: TrigL2Vertex.h:48
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
TrigVertexFitInputTrack::getIndex
int getIndex() const
to be used by TrigVertexingTool
Definition: TrigL2Vertex.cxx:174
TrigVertexFitConstraint::updateVertex
virtual void updateVertex(class TrigL2Vertex *)
implementation of abstract method from the base class
Definition: TrigL2Vertex.cxx:509
TrigVertexFitInputTrack::m_Perigee
double m_Perigee[5]
Definition: TrigL2Vertex.h:95
TrigVertexFitConstraint::getChi2Distance
virtual double getChi2Distance(class TrigL2Vertex *)
implementation of abstract method from the base class
Definition: TrigL2Vertex.cxx:400
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
DMTest::P
P_v1 P
Definition: P.h:23
TrigInDetTrackFitPar
Definition: TrigInDetTrackFitPar.h:68
TrigVertexFitInputTrack::getTrigTrack
const TrigInDetTrack * getTrigTrack()
getter for L2 tracks
Definition: TrigL2Vertex.cxx:159
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
DMTest::C
C_v1 C
Definition: C.h:26
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
skel.it
it
Definition: skel.GENtoEVGEN.py:396
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
TrigVertexFitInputTrack::m_A
double m_A[2][3]
Definition: TrigL2Vertex.h:97
TrigL2Vertex::addNdof
void addNdof(int)
increments accumulated number-of-degree-of-freedom of the fit
Definition: TrigL2Vertex.cxx:634
TRT_PAI_gasdata::AC
const float AC
Definition: TRT_PAI_gasdata.h:27
TrigVertexFitInputTrack::m_Vuq
double m_Vuq[2][3]
Definition: TrigL2Vertex.h:91
TrigVertexFitInputTrack::m_active
bool m_active
Definition: TrigL2Vertex.h:101
TrigVertexFitInputTrack::m_Vqq
double m_Vqq[3][3]
Definition: TrigL2Vertex.h:90
Trk::z0
@ z0
Definition: ParamDefs.h:64
TrigL2Vertex::reset
void reset()
resets all internal structures
Definition: TrigL2Vertex.cxx:592
TrigVertexFitConstraint::report
virtual MsgStream & report(MsgStream &) const
Definition: TrigL2Vertex.cxx:534
TrigL2Vertex::~TrigL2Vertex
~TrigL2Vertex()
Definition: TrigL2Vertex.cxx:560
TrigVertexFitInputTrack::m_pTrkTrack
const Trk::Track * m_pTrkTrack
Definition: TrigL2Vertex.h:86
TrigVertexFittingNode::m_V
double m_V[2][2]
Definition: TrigL2Vertex.h:47
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TrigL2Vertex::getTracks
std::list< TrigVertexFitInputTrack * > * getTracks()
lists of tracks in the vertex
Definition: TrigL2Vertex.cxx:656
TrigVertexFitInputTrack::m_PerigeeCovariance
double m_PerigeeCovariance[5][5]
Definition: TrigL2Vertex.h:96
TrigL2Vertex::addChi2
void addChi2(double)
increments accumulated of the fit
Definition: TrigL2Vertex.cxx:629
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
TrigL2Vertex::ndof
int ndof()
returns accumulated number-of-degree-of-freedom of the fit
Definition: TrigL2Vertex.cxx:624
TrigVertexFitInputTrack::m_h
double m_h[2]
Definition: TrigL2Vertex.h:99
TrigL2Vertex::m_ready
bool m_ready
Definition: TrigL2Vertex.h:194
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
TrigInDetTrack
Definition: TrigInDetTrack.h:34
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
TrigL2Vertex::m_chiSquared
double m_chiSquared
Definition: TrigL2Vertex.h:189
TrigL2Vertex::prepareForFit
bool prepareForFit()
resets all internal structures + initialization of the covariance
Definition: TrigL2Vertex.cxx:583
TrigVertexFitInputTrack::activate
void activate()
sets isActive to true
Definition: TrigL2Vertex.cxx:143
MAX_SIZE_VERT_COVM
#define MAX_SIZE_VERT_COVM
Definition: TrigL2Vertex.h:14
TrigVertexFitInputTrack::m_mass
double m_mass
Definition: TrigL2Vertex.h:89
TrigL2Vertex::setMass
void setMass(double)
sets calculated mass of the vertex
Definition: TrigL2Vertex.cxx:671
TrigVertexFittingNode::m_resid
double m_resid[2]
Definition: TrigL2Vertex.h:46
TrigL2Vertex.h
TrigVertexFitInputTrack::updateVertex
virtual void updateVertex(class TrigL2Vertex *)
implementation of abstract method from the base class
Definition: TrigL2Vertex.cxx:303
TrigL2Vertex
Definition: TrigL2Vertex.h:146
TrigL2Vertex::setMassVariance
void setMassVariance(double)
sets variance of the calculated mass of the vertex
Definition: TrigL2Vertex.cxx:676
TrigVertexFitInputTrack::TrigVertexFitInputTrack
TrigVertexFitInputTrack(const TrigInDetTrack *, double)
constructor for L2 tracks
Definition: TrigL2Vertex.cxx:9
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TrigVertexFitInputTrack::isActive
bool isActive()
if true this track will be used in the vertex fit otherwise it will be masked
Definition: TrigL2Vertex.cxx:148
TrigVertexFitInputTrack::mask
void mask()
sets isActive to false
Definition: TrigL2Vertex.cxx:138
TrigVertexFitInputTrack::Perigee
const double * Perigee() const
track parameters at the perigee
Definition: TrigL2Vertex.cxx:179
TrigL2Vertex::getMotherTrack
const TrigInDetTrackFitPar * getMotherTrack()
returns mother particle parameters if m_isMassEstimated() is true
Definition: TrigL2Vertex.cxx:609
TrigVertexFitInputTrack::m_pTrigTrack
const TrigInDetTrack * m_pTrigTrack
Definition: TrigL2Vertex.h:85
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigL2Vertex::m_pvTracks
std::list< TrigVertexFitInputTrack * > * m_pvTracks
Definition: TrigL2Vertex.h:187
TrigVertexFitInputTrack::m_q
double m_q[3]
Definition: TrigL2Vertex.h:94
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:66
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigVertexFitInputTrack::m_index
int m_index
Definition: TrigL2Vertex.h:88
TrigL2Vertex::getNumberOfTracks
int getNumberOfTracks()
Definition: TrigL2Vertex.cxx:577
TrigL2Vertex::chi2
double chi2()
returns accumulated of the fit
Definition: TrigL2Vertex.cxx:619
TrigL2Vertex::mass
double mass()
returns calculated mass of the vertex
Definition: TrigL2Vertex.cxx:639
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
TrigL2Vertex::massVariance
double massVariance()
returns variance of the calculated mass of the vertex
Definition: TrigL2Vertex.cxx:645
TrigVertexFitInputTrack::setIndex
void setIndex(int)
to be used by TrigVertexingTool
Definition: TrigL2Vertex.cxx:169
TrigVertexFitInputTrack::~TrigVertexFitInputTrack
~TrigVertexFitInputTrack()
Definition: TrigL2Vertex.cxx:128
TrigL2Vertex::contains
const TrigVertexFitInputTrack * contains(const TrigInDetTrack *)
checks whether L2 track is in the vertex
Definition: TrigL2Vertex.cxx:704
TrigL2Vertex::m_nStatus
int m_nStatus
Definition: TrigL2Vertex.h:191
TrigVertexFitInputTrack::PerigeeCovariance
double PerigeeCovariance(int, int) const
covariance of track parameters at the perigee
Definition: TrigL2Vertex.cxx:184
TrigL2Vertex::setMotherTrack
void setMotherTrack(TrigInDetTrackFitPar *)
sets mother particle parameters after kinematical fitting
Definition: TrigL2Vertex.cxx:614
Trk::d0
@ d0
Definition: ParamDefs.h:63
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigL2Vertex::m_Gk
double m_Gk[MAX_SIZE_VERT_COVM][MAX_SIZE_VERT_COVM]
Definition: TrigL2Vertex.h:182
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
TrigL2Vertex::m_nTracks
int m_nTracks
Definition: TrigL2Vertex.h:185
TrigL2Vertex::m_pvConstraints
std::list< TrigVertexFitConstraint * > * m_pvConstraints
Definition: TrigL2Vertex.h:188
TrigVertexFitInputTrack::m_nTrackType
int m_nTrackType
Definition: TrigL2Vertex.h:87
TrigL2Vertex::m_Rk
double m_Rk[MAX_SIZE_VERT_COVM]
Definition: TrigL2Vertex.h:192
TrigVertexFitInputTrack::m_Vuu
double m_Vuu[2][2]
Definition: TrigL2Vertex.h:92
python.PyAthena.v
v
Definition: PyAthena.py:154
TrigL2Vertex::report
MsgStream & report(MsgStream &) const
Definition: TrigL2Vertex.cxx:691
TrigVertexFitInputTrack
Definition: TrigL2Vertex.h:62
TrigVertexFitInputTrack::m_B
double m_B[2][3]
Definition: TrigL2Vertex.h:98
a
TList * a
Definition: liststreamerinfos.cxx:10
TrigL2Vertex::isReadyForFit
bool isReadyForFit()
vertex status
Definition: TrigL2Vertex.cxx:686
TrigL2Vertex::getParametersVector
double * getParametersVector()
returns vector of vertex fit parameters: vertex position + refitted track momenta at-perigee (sic !...
Definition: TrigL2Vertex.cxx:651
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
TrigL2Vertex::isMassEstimated
bool isMassEstimated()
vertex status
Definition: TrigL2Vertex.cxx:604
TrigVertexFitConstraint::getValue
double getValue()
returns a mass of the constraint
Definition: TrigL2Vertex.cxx:540
TrigVertexFitInputTrack::report
virtual MsgStream & report(MsgStream &) const
Definition: TrigL2Vertex.cxx:329
TrigL2Vertex::m_mass
double m_mass
Definition: TrigL2Vertex.h:189
TrigL2Vertex::getStatus
int getStatus()
returns vertex status flag
Definition: TrigL2Vertex.cxx:681
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TrigL2Vertex::m_nDOF
int m_nDOF
Definition: TrigL2Vertex.h:185
TrigL2Vertex::getConstraints
std::list< TrigVertexFitConstraint * > * getConstraints()
lists of all constraints imposed on the vertex
Definition: TrigL2Vertex.cxx:661
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TrigVertexFitConstraint::m_trackList
std::list< const TrigVertexFitInputTrack * > m_trackList
Definition: TrigL2Vertex.h:117
Trk::phi0
@ phi0
Definition: ParamDefs.h:65
TrigL2Vertex::isVertexFitted
bool isVertexFitted()
vertex status
Definition: TrigL2Vertex.cxx:599
fitman.k
k
Definition: fitman.py:528
TrigVertexFitInputTrack::getChi2Distance
virtual double getChi2Distance(class TrigL2Vertex *)
implementation of abstract method from the base class
Definition: TrigL2Vertex.cxx:196