10 #include "TLorentzVector.h"
25 const vector<vector<ElementLink<IParticleContainer> > >*
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++) {
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);
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);