ATLAS Offline Software
Public Member Functions | List of all members
JetSubStructureUtils::PlanarFlow Class Reference

#include <PlanarFlow.h>

Inheritance diagram for JetSubStructureUtils::PlanarFlow:
Collaboration diagram for JetSubStructureUtils::PlanarFlow:

Public Member Functions

virtual double result (const fastjet::PseudoJet &jet) const
 
virtual TOut result (const xAOD::Jet &jet) const
 
virtual double result (const xAOD::Jet &jet) const
 

Detailed Description

Definition at line 11 of file PlanarFlow.h.

Member Function Documentation

◆ result() [1/3]

double PlanarFlow::result ( const fastjet::PseudoJet &  jet) const
virtual

Definition at line 13 of file PlanarFlow.cxx.

14 {
15 
16  double PF=-1.;
17  if(jet.m() == 0.0 ) return PF;
18  if(jet.constituents().empty() ) return PF;
19 
20  vector<fastjet::PseudoJet> constit_pseudojets = jet.constituents();
21 
22  TMatrixDSym MomentumTensor(2);
23  //Planar flow
24  double phi0=jet.phi();
25  double eta0=jet.eta();
26 
27  double nvec[3];
28  nvec[0]=(cos(phi0)/cosh(eta0));
29  nvec[1]=(sin(phi0)/cosh(eta0));
30  nvec[2]=tanh(eta0);
31 
32  //this is the rotation matrix
33  double RotationMatrix[3][3];
34 
35  for(int i=0; i<3; i++) {
36  for(int j=0; j<3; j++) {
37  RotationMatrix[i][j] = 0.;
38  }
39  }
40 
41  const double mag3 = sqrt(nvec[0]*nvec[0] + nvec[1]*nvec[1]+ nvec[2]*nvec[2]);
42  const double mag2 = sqrt(nvec[0]*nvec[0] + nvec[1]*nvec[1]);
43 
44  if(mag3 <= 0) {
45  // Rotation axis is null
46  return PF;
47  }
48 
49  const double inv_mag3 = 1. / mag3;
50 
51  double ctheta0 = nvec[2]*inv_mag3;
52  double stheta0 = mag2*inv_mag3;
53  double cphi0 = (mag2>0.) ? nvec[0]/mag2:0.;
54  double sphi0 = (mag2>0.) ? nvec[1]/mag2:0.;
55 
56  RotationMatrix[0][0] =- ctheta0*cphi0;
57  RotationMatrix[0][1] =- ctheta0*sphi0;
58  RotationMatrix[0][2] = stheta0;
59  RotationMatrix[1][0] = sphi0;
60  RotationMatrix[1][1] =- 1.*cphi0;
61  RotationMatrix[1][2] = 0.;
62  RotationMatrix[2][0] = stheta0*cphi0;
63  RotationMatrix[2][1] = stheta0*sphi0;
64  RotationMatrix[2][2] = ctheta0;
65 
66 
67  for(vector<fastjet::PseudoJet>::iterator cit=constit_pseudojets.begin(); cit != constit_pseudojets.end();
68  ++cit) {
69  const fastjet::PseudoJet & cp = *cit;
70  TLorentzVector p = TLorentzVector(cp.px(),cp.py(),cp.pz(),cp.e());
71  double n=1./(cp.e()*jet.m());
72  double px_rot = RotationMatrix[0][0] * (p.Px())+RotationMatrix[0][1]
73  * (p.Py())+RotationMatrix[0][2]*(p.Pz());
74  double py_rot = RotationMatrix[1][0] * (p.Px())+RotationMatrix[1][1]
75  * (p.Py())+RotationMatrix[1][2]*(p.Pz());
76  double pz_rot = RotationMatrix[2][0] * (p.Px())+RotationMatrix[2][1]
77  * (p.Py())+RotationMatrix[2][2]*(p.Pz());
78 
79  TLorentzVector prot;
80  prot.SetPxPyPzE(px_rot, py_rot, pz_rot, p.E() );
81 
82  MomentumTensor(0,0) += n * prot.Px() * prot.Px();
83  MomentumTensor(0,1) += n * prot.Py() * prot.Px();
84  MomentumTensor(1,0) += n * prot.Px() * prot.Py();
85  MomentumTensor(1,1) += n * prot.Py() * prot.Py();
86  }
87 
88  TMatrixDSymEigen eigen(MomentumTensor);
89  TVectorD Lambda = eigen.GetEigenValues();
90  double num = 4*Lambda[0]*Lambda[1];
91  double den = (Lambda[0]+Lambda[1]) * (Lambda[0]+Lambda[1]);
92  if ( fabs(den) < 1.e-20 ) return PF;
93  PF = num/den;
94  return PF;
95 }

◆ result() [2/3]

virtual TOut JetSubStructureUtils::SubstructureCalculator< TOut >::result
inline

Definition at line 25 of file SubstructureCalculator.h.

25  {
26  // PS 4/18 master developent
27  // std::vector<fastjet::PseudoJet> constit_pseudojets =
28  // jet::JetConstituentFiller::constituentPseudoJets(jet);
29 
30  std::vector<fastjet::PseudoJet> constit_pseudojets;
31  std::transform(jet.getConstituents().begin(),
32  jet.getConstituents().end(),
33  std::back_inserter(constit_pseudojets),
34  [](const auto& c){
35  const xAOD::IParticle* ip = c->rawConstituent();
36  return
37  // fastjet::PseudoJet((c->rawConstituent())->p4());
38  fastjet::PseudoJet(ip->p4());
39  });
40 
41  fastjet::PseudoJet pjet = fastjet::join(constit_pseudojets);
42 
43  return result(pjet);
44  }

◆ result() [3/3]

virtual double JetSubStructureUtils::SubstructureCalculator< double >::result ( const xAOD::Jet jet) const
inlinevirtualinherited

Definition at line 25 of file SubstructureCalculator.h.

25  {
26  // PS 4/18 master developent
27  // std::vector<fastjet::PseudoJet> constit_pseudojets =
28  // jet::JetConstituentFiller::constituentPseudoJets(jet);
29 
30  std::vector<fastjet::PseudoJet> constit_pseudojets;
31  std::transform(jet.getConstituents().begin(),
32  jet.getConstituents().end(),
33  std::back_inserter(constit_pseudojets),
34  [](const auto& c){
35  const xAOD::IParticle* ip = c->rawConstituent();
36  return
37  // fastjet::PseudoJet((c->rawConstituent())->p4());
38  fastjet::PseudoJet(ip->p4());
39  });
40 
41  fastjet::PseudoJet pjet = fastjet::join(constit_pseudojets);
42 
43  return result(pjet);
44  }

The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
JetSubStructureUtils::PlanarFlow::result
virtual double result(const fastjet::PseudoJet &jet) const
Definition: PlanarFlow.cxx:13
JetSubStructureUtils::SubstructureCalculator< double >::result
virtual double result(const xAOD::Jet &jet) const
Definition: SubstructureCalculator.h:25
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
LArNewCalib_PedestalAutoCorr.cp
cp
Definition: LArNewCalib_PedestalAutoCorr.py:175
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
mag2
Scalar mag2() const
mag2 method - forward to squaredNorm()
Definition: AmgMatrixBasePlugin.h:30
FlavorTagDiscriminants::TruthDecoratorHelpers::TruthType::Lambda
@ Lambda
Definition: TruthDecoratorHelpers.h:21
python.compressB64.c
def c
Definition: compressB64.py:93