ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
TrigVertexFitConstraint Class Reference

#include <TrigL2Vertex.h>

Inheritance diagram for TrigVertexFitConstraint:
Collaboration diagram for TrigVertexFitConstraint:

Public Member Functions

 TrigVertexFitConstraint (double, const TrigVertexFitInputTrack *, const TrigVertexFitInputTrack *)
 two-track mass constraint More...
 
 TrigVertexFitConstraint (double, const TrigVertexFitInputTrack *, const TrigVertexFitInputTrack *, const TrigVertexFitInputTrack *)
 three-track mass constraint More...
 
 ~TrigVertexFitConstraint ()
 
virtual double getChi2Distance (class TrigL2Vertex *)
 implementation of abstract method from the base class More...
 
virtual void updateVertex (class TrigL2Vertex *)
 implementation of abstract method from the base class More...
 
virtual MsgStream & report (MsgStream &) const
 
double getValue ()
 returns a mass of the constraint More...
 

Protected Attributes

double m_resid [2]
 
double m_V [2][2]
 
double m_D [2][MAX_SIZE_VERT_COVM]
 

Private Member Functions

double calculateInvariantMass (TrigL2Vertex *pV)
 

Private Attributes

std::list< const TrigVertexFitInputTrack * > m_trackList
 
double m_value
 

Detailed Description

Definition at line 104 of file TrigL2Vertex.h.

Constructor & Destructor Documentation

◆ TrigVertexFitConstraint() [1/2]

TrigVertexFitConstraint::TrigVertexFitConstraint ( double  m,
const TrigVertexFitInputTrack pT1,
const TrigVertexFitInputTrack pT2 
)

two-track mass constraint

Definition at line 342 of file TrigL2Vertex.cxx.

344  : m_value(m)
345 {
346  m_trackList.clear();
347  m_trackList.push_back(pT1);
348  m_trackList.push_back(pT2);
349 }

◆ TrigVertexFitConstraint() [2/2]

TrigVertexFitConstraint::TrigVertexFitConstraint ( double  m,
const TrigVertexFitInputTrack pT1,
const TrigVertexFitInputTrack pT2,
const TrigVertexFitInputTrack pT3 
)

three-track mass constraint

Definition at line 351 of file TrigL2Vertex.cxx.

354  : m_value(m)
355 {
356  m_trackList.clear();
357  m_trackList.push_back(pT1);m_trackList.push_back(pT2);m_trackList.push_back(pT3);
358 }

◆ ~TrigVertexFitConstraint()

TrigVertexFitConstraint::~TrigVertexFitConstraint ( )

Definition at line 361 of file TrigL2Vertex.cxx.

362 {
363  m_trackList.clear();
364 }

Member Function Documentation

◆ calculateInvariantMass()

double TrigVertexFitConstraint::calculateInvariantMass ( TrigL2Vertex pV)
private

Definition at line 366 of file TrigL2Vertex.cxx.

367 {
368  const double C=0.029997;
369  const double B=20.84;
370 
371  double invMass=0.0,alpha=C*B/1000.0;
372  double P[3];double E=0.0;
373 
374  double* Rk = pV->getParametersVector();
375 
376  int offset=0;
377  for(int i=0;i<3;i++) P[i]=0.0;
378 
380  {
381  offset=3+3*(*it)->getIndex();
382  double mass=(*it)->getMass()/1000.0;
383  double pT=fabs(Rk[offset+2]);
384  double p=pT/sin(Rk[offset+1]);
385 
386  double psi=-asin(alpha*(Rk[0]*cos(Rk[offset])+Rk[1]*sin(Rk[offset]))/Rk[offset+2]);
387  double phiV=Rk[offset]+psi;
388  P[0]+=pT*cos(phiV);
389  P[1]+=pT*sin(phiV);
390  P[2]+=pT*cos(Rk[offset+1])/sin(Rk[offset+1]);
391  E+=sqrt(mass*mass+p*p);
392  }
393  invMass=sqrt(E*E-P[0]*P[0]-P[1]*P[1]-P[2]*P[2]);
394 
395  return invMass;
396 }

◆ getChi2Distance()

double TrigVertexFitConstraint::getChi2Distance ( class TrigL2Vertex pV)
virtual

implementation of abstract method from the base class

Implements TrigVertexFittingNode.

Definition at line 399 of file TrigL2Vertex.cxx.

400 {
401  const double C=0.029997;
402  const double B=20.84;
403 
404  double invMass=0.0,alpha=C*B/1000.0;
405  double P[3];
406  double E=0.0;
407  int i{0},j{0};
408  bool linFailed=false;
409  double* Rk = pV->getParametersVector();
410 
411  int offset=0;
412  for(i=0;i<3;i++) P[i]=0.0;
413 
414  int nSize=3+3*pV->getTracks()->size();
415 
417  {
418  offset=3+3*(*it)->getIndex();
419  double mass=(*it)->getMass()/1000.0;
420  double pT=fabs(Rk[offset+2]);
421  double p=pT/sin(Rk[offset+1]);
422 
423  double psi=-asin(alpha*(Rk[0]*cos(Rk[offset])+Rk[1]*sin(Rk[offset]))/Rk[offset+2]);
424  double phiV=Rk[offset]+psi;
425  P[0]+=pT*cos(phiV);
426  P[1]+=pT*sin(phiV);
427  P[2]+=pT*cos(Rk[offset+1])/sin(Rk[offset+1]);
428  E+=sqrt(mass*mass+p*p);
429  }
430  invMass=sqrt(E*E-P[0]*P[0]-P[1]*P[1]-P[2]*P[2]);
431 
432  m_resid[0]=m_value/1000.0-invMass;
433  m_D[0][0]=0.0;m_D[0][1]=0.0;m_D[0][2]=0.0;
434 
436  {
437  offset=3+3*(*it)->getIndex();
438 
439  double mass=(*it)->getMass()/1000.0;
440  double Ck=(Rk[offset+2]<0.0)?-1.0:1.0;
441  double sinT=sin(Rk[offset+1]);
442  double cosT=cos(Rk[offset+1]);
443  double pT=fabs(Rk[offset+2]);
444  double p=pT/sinT;
445  double e=sqrt(p*p+mass*mass);
446  double sinF=sin(Rk[offset]);
447  double cosF=cos(Rk[offset]);
448 
449  double sinPsi=-alpha*(Rk[0]*cosF+Rk[1]*sinF)/Rk[offset+2];
450  if(fabs(sinPsi)>1.0)
451  {
452  linFailed=true;
453  break;
454  }
455  double psi=asin(sinPsi);
456  double cosPsi=sqrt(1.0-sinPsi*sinPsi);
457  double phiV=Rk[offset]+psi;
458 
459  double aCos=alpha*Ck/cosPsi;
460  double dP=P[1]*cos(phiV)-P[0]*sin(phiV);
461  double eE=E*Rk[offset+2]/(e*sinT);
462 
463  m_D[0][0]+=dP*cosF*aCos;
464  m_D[0][1]+=dP*sinF*aCos;
465  m_D[0][offset]=-dP*Ck*(Rk[offset+2]-Ck*aCos*(Rk[1]*cosF-Rk[0]*sinF));
466  m_D[0][offset+1]=(Rk[offset+2]/(sinT*sinT))*(P[2]*Ck-eE*cosT);
467  m_D[0][offset+2]=eE/sinT-Ck*(P[0]*cos(phiV)+P[1]*sin(phiV)+P[2]*cosT/sinT)+dP*Ck*sinPsi/cosPsi;
468  }
469  for(i=0;i<nSize;i++) m_D[0][i]/=invMass;
470  if(linFailed) return -999.9;
471  /*
472  for(i=0;i<nSize;i++) printf("%E ",m_D[0][i]);
473  printf("\n");
474  printf("----- numerical Jacobian -----\n");
475 
476  double oldPar, newPar, Delta, newMass, der;
477  for(i=0;i<nSize;i++)
478  {
479  oldPar=Rk[i];
480  Delta=0.00001*oldPar;
481  newPar=oldPar+Delta;
482  Rk[i]=newPar;
483  newMass=calculateInvariantMass(pV);
484  der=(newMass-invMass)/Delta;
485  m_D[1][i]=der;
486  Rk[i]=oldPar;
487  }
488  for(i=0;i<nSize;i++) printf("%E ",m_D[1][i]);
489  printf("\n");
490  printf("------------------------------\n");
491  */
492 
493  double covM=1e-12;
494 
495  for(i=0;i<nSize;i++)
496  {
497  for(j=i;j<nSize;j++)
498  {
499  double dCov=pV->m_Gk[i][j]*m_D[0][i]*m_D[0][j];
500  if(i!=j) dCov*=2.0;
501  covM+=dCov;
502  }
503  }
504  m_V[0][0]=1.0/covM;
505  return ((m_resid[0]*m_resid[0])*m_V[0][0]);
506 }

◆ getValue()

double TrigVertexFitConstraint::getValue ( )

returns a mass of the constraint

Definition at line 539 of file TrigL2Vertex.cxx.

540 {
541  return m_value;
542 }

◆ report()

MsgStream & TrigVertexFitConstraint::report ( MsgStream &  out) const
virtual

Implements TrigVertexFittingNode.

Definition at line 533 of file TrigL2Vertex.cxx.

534 {
535  out<<"Mass constraint with "<<m_trackList.size()<<" : mass="<<m_value<<endmsg;
536  return out;
537 }

◆ updateVertex()

void TrigVertexFitConstraint::updateVertex ( class TrigL2Vertex pV)
virtual

implementation of abstract method from the base class

Implements TrigVertexFittingNode.

Definition at line 508 of file TrigL2Vertex.cxx.

509 {
510  double K[MAX_SIZE_VERT_COVM];
511  int i{0},j{0};
512  const int nSize=3+3*pV->getTracks()->size();
513  double gain{0};
514 
515  for(i=0;i<nSize;i++)
516  {
517  gain=0.0;
518  for(j=0;j<nSize;j++) gain+=pV->m_Gk[i][j]*m_D[0][j];
519  m_D[1][i]=gain;
520  K[i]=gain*m_V[0][0];
521  }
522  for(i=0;i<nSize;i++)
523  {
524  pV->getParametersVector()[i]+=K[i]*m_resid[0];
525  for(j=i;j<nSize;j++)
526  {
527  pV->m_Gk[i][j]-=K[i]*m_D[1][j];
528  pV->m_Gk[j][i]=pV->m_Gk[i][j];
529  }
530  }
531 }

Member Data Documentation

◆ m_D

double TrigVertexFittingNode::m_D[2][MAX_SIZE_VERT_COVM]
protectedinherited

Definition at line 48 of file TrigL2Vertex.h.

◆ m_resid

double TrigVertexFittingNode::m_resid[2]
protectedinherited

Definition at line 46 of file TrigL2Vertex.h.

◆ m_trackList

std::list<const TrigVertexFitInputTrack*> TrigVertexFitConstraint::m_trackList
private

Definition at line 117 of file TrigL2Vertex.h.

◆ m_V

double TrigVertexFittingNode::m_V[2][2]
protectedinherited

Definition at line 47 of file TrigL2Vertex.h.

◆ m_value

double TrigVertexFitConstraint::m_value
private

Definition at line 118 of file TrigL2Vertex.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
TrigVertexFitConstraint::m_value
double m_value
Definition: TrigL2Vertex.h:118
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
P4Helpers::invMass
double invMass(const I4Momentum &pA, const I4Momentum &pB)
invariant mass from two I4momentum references
Definition: P4Helpers.h:252
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
DMTest::P
P_v1 P
Definition: P.h:23
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
TrigVertexFittingNode::m_V
double m_V[2][2]
Definition: TrigL2Vertex.h:47
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
MAX_SIZE_VERT_COVM
#define MAX_SIZE_VERT_COVM
Definition: TrigL2Vertex.h:14
TrigVertexFittingNode::m_resid
double m_resid[2]
Definition: TrigL2Vertex.h:46
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
TrigL2Vertex::getParametersVector
double * getParametersVector()
returns vector of vertex fit parameters: vertex position + refitted track momenta at-perigee (sic !...
Definition: TrigL2Vertex.cxx:650
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TrigVertexFitConstraint::m_trackList
std::list< const TrigVertexFitInputTrack * > m_trackList
Definition: TrigL2Vertex.h:117