58 return StatusCode::SUCCESS;
69 return StatusCode::SUCCESS;
76 return StatusCode::FAILURE;
84 return StatusCode::FAILURE;
87 std::set<const xAOD::IParticle*> newConst;
89 for (
const auto *
const clust : *constits.
tcCont) newConst.insert(clust);
93 for(
const auto *
const jet : *jetCont) {
94 std::vector<const IParticle*> selectedTracks;
97 bool newConstVec =
m_skipconst || mismatchedPFlow || mismatchedState;
98 if (
m_pflow && !mismatchedPFlow) {
100 for (
size_t consti = 0; consti <
jet->numConstituents(); consti++) {
105 selectedTracks.push_back(pfo);
111 for (
size_t consti = 0; consti <
jet->numConstituents(); consti++) {
116 selectedTracks.push_back(pfo);
121 std::vector<const IParticle*> jettracks;
124 selectedTracks.reserve(jettracks.size());
125 for(
const auto& trk : jettracks) {
128 selectedTracks.push_back(trk);
129 ATH_MSG_VERBOSE(
"Accept track " << trk <<
" px, py = " << trk->p4().Px() <<
", " << trk->p4().Py());
133 std::vector<const IParticle*> consts;
134 std::map<const IParticle*,MissingETBase::Types::constvec_t> momenta;
137 if (mismatchedPFlow)
getPFOs(
jet,consts,constits,momenta);
138 else if (mismatchedState)
getClus(
jet,consts);
139 else if (newConstVec)
getOther(
jet,consts,&newConst);
148 return StatusCode::SUCCESS;
152 std::vector<const xAOD::IParticle*> &consts,
154 std::map<const xAOD::IParticle*,MissingETBase::Types::constvec_t> &momenta) {
156 std::vector<const IParticle*> jettracks;
159 if(constits.
feCont !=
nullptr){
166 if (jettrk==pfotrk) {
167 consts.push_back(pfo);
174 for (
size_t consti = 0; consti <
jet->numConstituents(); consti++){
175 if (pfo->
p4().DeltaR(
jet->rawConstituent(consti)->p4())<0.05) marked =
true;
178 consts.push_back(pfo);
179 TLorentzVector momentum = pfo->
p4();
181 momentum.E(),momentum.Pt());
188 for(
const auto *
const pfo : *constits.
pfoCont) {
189 if (pfo->isCharged()) {
191 for(
const auto& trk : jettracks) {
193 consts.push_back(pfo);
199 for (
size_t consti = 0; consti <
jet->numConstituents(); consti++)
if (pfo->p4().DeltaR(
jet->rawConstituent(consti)->p4())<0.05) marked =
true;
201 consts.push_back(pfo);
202 TLorentzVector momentum = pfo->p4();
204 momentum.E(),momentum.Pt());
212 std::vector<const xAOD::IParticle*> &consts) {
213 std::vector<ElementLink<IParticleContainer> > jetconst =
jet->constituentLinks();
214 for(
const auto& clus : jetconst) consts.push_back(*clus);
218 std::vector<const xAOD::IParticle*> &consts,
219 std::set<const xAOD::IParticle*> *newConst)
const {
220 std::vector<ElementLink<IParticleContainer> > jetconst =
jet->constituentLinks();
223 for(
const auto& clusL : jetconst) {
225 if (newConst->count(clus)) consts.push_back(clus);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Defines enum to access jet attribute and associated particles/objects.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual double pt() const override
const xAOD::IParticle * chargedObject(std::size_t i) const
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
Class providing the definition of the 4-vector interface.
size_t findIndex(const Jet *pJet) const
bool isCharged() const
is a charged PFO
const TrackParticle * track(unsigned int index) const
Retrieve a const pointer to a Rec::TrackParticle.
float charge() const
get charge of PFO
virtual double pt() const
The transverse momentum ( ) of the particle.
xAOD::MissingETAssociation_v1::ConstVec constvec_t
Type for constituent vector.
@ ParticleFlow
The object is a particle-flow object.
@ FlowElement
The object is a track-calo-cluster.
@ CaloCluster
The object is a calorimeter cluster.
bool isInDeltaR(const xAOD::IParticle &p1, const xAOD::IParticle &p2, double dR, bool useRapidity=true)
Check if 2 xAOD::IParticle are in a cone.
Jet_v1 Jet
Definition of the current "jet version".
PFO_v1 PFO
Definition of the current "pfo version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
MissingETContainer_v1 MissingETContainer
MissingETAssociationMap_v1 MissingETAssociationMap
Version control by type defintion.
@ UncalibratedJetConstituent
@ CalibratedJetConstituent
static bool addMiscAssociation(MissingETAssociationMap *pMap)
Add an association to hold objects not associated to any jet.
static bool setJetConstSum(MissingETAssociationMap *metMap, const Jet *jet, const std::vector< const IParticle * > &altConsts, std::map< const IParticle *, MissingETBase::Types::constvec_t > pOverride)
static bool add(MissingETComponentMap *pMap, const MissingET *pMET, MissingETBase::Types::bitmask_t sw=MissingETBase::Status::clearedStatus())
Adding a MissingET object to the map.