35 std::vector<const xAOD::TrackParticle*> jet_tracks;
38 std::vector<const xAOD::Muon*> muons_in_jet;
41 if (
jet->getAssociatedObjects(
"GhostTrack", jet_tracks) ) {
43 for(
const auto *
const muon : muons) {
45 if(!idtrack)
continue;
50 for(
unsigned jtrk=0; jtrk<jet_tracks.size(); ++jtrk) {
52 if(jet_tracks.at(jtrk)==idtrack) {
53 muons_in_jet.push_back(
muon);
59 jet->setAssociatedObjects(
"GhostMuon", muons_in_jet) ;
66 using namespace msgMET;
72 return StatusCode::FAILURE;
76 if(*iMET==metFinal)
continue;
81 <<
" mpx: " << metFinal->
mpx()
82 <<
" mpy: " << metFinal->
mpy()
85 return StatusCode::SUCCESS;
92 using namespace msgMET;
97 ANA_MSG_ERROR(
"failed to fill MET term \"" << totalName <<
"\"");
98 return StatusCode::FAILURE;
102 for(
const auto met : *metCont) {
113 <<
" mpx: " << metFinal->
mpx()
114 <<
" mpy: " << metFinal->
mpy()
117 return StatusCode::SUCCESS;
124 const std::string& metKey,
126 using namespace msgMET;
129 return StatusCode::FAILURE;
131 if(metCont->
find(metKey)!=metCont->
end()){
132 ANA_MSG_ERROR(
"Attempted to add a duplicate MET term: " << metKey);
133 return StatusCode::FAILURE;
139 met->setName (metKey);
140 met->setSource(metSource);
142 return StatusCode::SUCCESS;
163 using namespace msgMET;
165 const auto& uniqueLinks = accessors::constitObjLinks(
met);
166 std::vector<const xAOD::IParticle*> objs_out{};
167 objs_out.reserve(uniqueLinks.size());
169 for (
const auto& link: uniqueLinks){
170 if (link.isValid()) {
171 objs_out.push_back(*link);
174 objs_out.push_back(
nullptr);
184 using namespace msgMET;
186 const auto& uniqueLinks = accessors::constitObjLinks(
met);
187 const auto& uniqueWeights = accessors::constitObjWeights(
met);
188 std::vector<std::pair<const xAOD::IParticle*,float> > objs_weights_out{};
189 objs_weights_out.reserve(uniqueLinks.size());
191 for (
size_t i=0; i<uniqueLinks.size(); ++i) {
192 auto& link = uniqueLinks[i];
193 float weight = uniqueWeights[i];
194 if (link.isValid()) {
195 objs_weights_out.push_back(std::make_pair(*link,weight));
198 objs_weights_out.push_back(std::make_pair(
nullptr,0));
202 return objs_weights_out;
DataModel_detail::const_iterator< DataVector > const_iterator
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const_iterator find(const std::string &name) const
Find non-modifiable MET object by name.
float mpx() const
Returns .
float mpy() const
Returns .
uint64_t bitmask_t
Type for status word bit mask.
template std::vector< const xAOD::Photon * > getMETElements< xAOD::Photon >(const xAOD::MissingET &met)
template std::vector< std::pair< const xAOD::Jet *, float > > getMETElementsWeights< xAOD::Jet >(const xAOD::MissingET &met)
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
template std::vector< const xAOD::Jet * > getMETElements< xAOD::Jet >(const xAOD::MissingET &met)
template std::vector< std::pair< const xAOD::Photon *, float > > getMETElementsWeights< xAOD::Photon >(const xAOD::MissingET &met)
void addGhostMuonsToJets(const xAOD::MuonContainer &muons, xAOD::JetContainer &jets)
std::vector< const T * > getMETElements(const xAOD::MissingET &met)
std::vector< std::pair< const T *, float > > getMETElementsWeights(const xAOD::MissingET &met)
static const MissingETBase::Types::bitmask_t invisSource
template std::vector< std::pair< const xAOD::TauJet *, float > > getMETElementsWeights< xAOD::TauJet >(const xAOD::MissingET &met)
template std::vector< std::pair< const xAOD::Muon *, float > > getMETElementsWeights< xAOD::Muon >(const xAOD::MissingET &met)
template std::vector< const xAOD::Electron * > getMETElements< xAOD::Electron >(const xAOD::MissingET &met)
template std::vector< std::pair< const xAOD::Electron *, float > > getMETElementsWeights< xAOD::Electron >(const xAOD::MissingET &met)
StatusCode fillMET(xAOD::MissingET *&met, xAOD::MissingETContainer *metCont, const std::string &metKey, const MissingETBase::Types::bitmask_t metSource)
template std::vector< const xAOD::Muon * > getMETElements< xAOD::Muon >(const xAOD::MissingET &met)
template std::vector< const xAOD::TauJet * > getMETElements< xAOD::TauJet >(const xAOD::MissingET &met)
double deltaR2(double rapidity1, double phi1, double rapidity2, double phi2)
from bare rapidity,phi
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Jet_v1 Jet
Definition of the current "jet version".
MissingET_v1 MissingET
Version control by type defintion.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
MissingETContainer_v1 MissingETContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
static Types::bitmask_t total(Region reg=Region::FullAcceptance)
Standard full reconstructed MET.
static bool isSoftTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
static bool hasPattern(E bits, F mask)
Generic check for given pattern.
static bool isTotalTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)