31 vector<vector<ElementLink<IParticleContainer> > >* matchedparts =
32 new vector<vector<ElementLink<IParticleContainer> > >(jets.size());
35 part_itr != parts.end(); ++part_itr) {
40 double deltaAngleMatch = 999.;
42 for (
unsigned int iJet = 0; iJet < jets.size(); iJet++) {
43 const Jet&
jet = *jets[iJet];
47 ATH_MSG_WARNING(
"PARTICLE to JET center-of-mass Associator: PARENT jet not available.");
51 if ( ! assoParentJet.
isValid()){
52 ATH_MSG_WARNING(
"PARTICLE to JET center-of-mass Associator: Unable to get parent link Null ptr is returned.");
55 const Jet* parentJet = *(assoParentJet);
56 double jetMass = parentJet->
m();
57 if (jetMass < 1000. ) jetMass = 1000.;
59 TLorentzVector tlv_parentj(0, 0, 0, 0);
60 tlv_parentj.SetPtEtaPhiM(parentJet->
pt(), parentJet->
eta(), parentJet->
phi(), jetMass);
61 TVector3 t3_boost = -1. * tlv_parentj.BoostVector();
63 TLorentzVector tlv_subj(0, 0, 0, 0);
64 tlv_subj.SetPtEtaPhiM(
jet.pt(),
jet.eta(),
jet.phi(),
jet.m());
66 TLorentzVector tlv_part(0, 0, 0, 0);
67 tlv_part.SetPtEtaPhiM(part.pt(), part.eta(), part.phi(), part.m());
69 double dR = tlv_part.DeltaR(tlv_parentj);
73 tlv_part.Boost( t3_boost );
74 tlv_subj.Boost( t3_boost );
75 double angleSubTrk = tlv_subj.Angle(tlv_part.Vect());
76 if ( angleSubTrk < deltaAngleMatch){
77 deltaAngleMatch = angleSubTrk;
83 if (matchjetidx >= 0 && deltaAngleMatch < partAngleMax) {
85 EL.toContainedElement(parts, *part_itr);
86 (*matchedparts)[matchjetidx].push_back(
EL);
JetParticleAssociation(const std::string &name)
JetParticleCenterOfMassAssociation(const std::string &name)
virtual const std::vector< std::vector< ElementLink< xAOD::IParticleContainer > > > * match(const xAOD::JetContainer &, const xAOD::IParticleContainer &) const override
double getAngleSize(const double &par_R) const
virtual double eta() const
pseudo rapidity
virtual double phi() const
phi in [-pi,pi[
virtual double pt() const
transverse momentum
Class providing the definition of the 4-vector interface.