36 std::vector<const xAOD::TrackParticle*> jet_tracks;
37 const std::string ghostMuonStr{
"GhostMuon"};
40 std::vector<const xAOD::Muon*> muons_in_jet;
43 if (
jet->getAssociatedObjects(
"GhostTrack", jet_tracks) ) {
45 for(
const auto *
const muon : muons) {
47 if(!idtrack)
continue;
52 for(
unsigned jtrk=0; jtrk<jet_tracks.size(); ++jtrk) {
54 if(jet_tracks.at(jtrk)==idtrack) {
55 muons_in_jet.push_back(
muon);
61 jet->setAssociatedObjects( ghostMuonStr, muons_in_jet) ;
68 using namespace msgMET;
74 return StatusCode::FAILURE;
78 if(*iMET==metFinal)
continue;
83 <<
" mpx: " << metFinal->
mpx()
84 <<
" mpy: " << metFinal->
mpy()
87 return StatusCode::SUCCESS;
94 using namespace msgMET;
99 ANA_MSG_ERROR(
"failed to fill MET term \"" << totalName <<
"\"");
100 return StatusCode::FAILURE;
104 for(
const auto met : *metCont) {
115 <<
" mpx: " << metFinal->
mpx()
116 <<
" mpy: " << metFinal->
mpy()
119 return StatusCode::SUCCESS;
126 const std::string& metKey,
128 using namespace msgMET;
131 return StatusCode::FAILURE;
133 if(metCont->
find(metKey)!=metCont->
end()){
134 ANA_MSG_ERROR(
"Attempted to add a duplicate MET term: " << metKey);
135 return StatusCode::FAILURE;
141 met->setName (metKey);
142 met->setSource(metSource);
144 return StatusCode::SUCCESS;
165 using namespace msgMET;
167 const auto& uniqueLinks = accessors::constitObjLinks(
met);
168 std::vector<const xAOD::IParticle*> objs_out{};
169 objs_out.reserve(uniqueLinks.size());
171 for (
const auto& link: uniqueLinks){
172 if (link.isValid()) {
173 objs_out.push_back(*link);
176 objs_out.push_back(
nullptr);
186 using namespace msgMET;
188 const auto& uniqueLinks = accessors::constitObjLinks(
met);
189 const auto& uniqueWeights = accessors::constitObjWeights(
met);
190 std::vector<std::pair<const xAOD::IParticle*,float> > objs_weights_out{};
191 objs_weights_out.reserve(uniqueLinks.size());
193 for (
size_t i=0; i<uniqueLinks.size(); ++i) {
194 auto& link = uniqueLinks[i];
195 float weight = uniqueWeights[i];
196 if (link.isValid()) {
197 objs_weights_out.push_back(std::make_pair(*link,weight));
200 objs_weights_out.push_back(std::make_pair(
nullptr,0));
204 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)