18 m_ExternalJetCollectionName(
""),
19 m_VectorOfOldLinkNames({}),
20 m_VectorOfNewLinkNames({}),
24 declareInterface<DerivationFramework::IAugmentationTool>(
this);
26 declareProperty(
"MomentPrefix" , m_momentPrefix);
27 declareProperty(
"InputJets" , m_containerName);
29 declareProperty(
"ExternalJetCollectionName", m_ExternalJetCollectionName);
30 declareProperty(
"ListOfOldLinkNames" , m_VectorOfOldLinkNames);
31 declareProperty(
"ListOfNewLinkNames" , m_VectorOfNewLinkNames);
33 declareProperty(
"DeltaRMatch" , m_dRMatch);
34 declareProperty(
"DeltaRCut" , m_dRCut);
46 ATH_MSG_ERROR(
"Vector size between old and new link names does not agree!");
47 return StatusCode::FAILURE;
57 return StatusCode::SUCCESS;
62 return StatusCode::SUCCESS;
73 return StatusCode::FAILURE;
80 return StatusCode::FAILURE;
87 if(
jets->size() != ExternalJetCollection->
size()){
89 return StatusCode::FAILURE;
94 auto jet_external = ExternalJetCollection->
at(
index);
96 if( std::abs(
jet->pt() - jet_external->pt()) > 0.1 ){
97 ATH_MSG_WARNING(
"Potential inconsistency between two jet collections: " <<
jet->pt() <<
" v.s. " << jet_external->pt());
101 ATH_MSG_ERROR(
"Failure when transferring link from external jet to current jet!");
102 return StatusCode::FAILURE;
110 std::vector<const xAOD::Jet*> UnAssignedExternalJets;
111 for(
auto jet_external : *ExternalJetCollection){
112 UnAssignedExternalJets.push_back(jet_external);
122 for(
auto external_iter = UnAssignedExternalJets.begin(); external_iter != UnAssignedExternalJets.end(); external_iter++){
123 auto jet_external = (*external_iter);
125 double dR =
jet->p4().DeltaR(jet_external->p4());
129 associated_jet = jet_external;
130 associated_iter = external_iter;
134 if(associated_jet == 0){
135 ATH_MSG_WARNING(
"Unable to find associated external jet! This jet will be skipped");
140 if(associated_jet != (*associated_iter)){
142 return StatusCode::FAILURE;
146 UnAssignedExternalJets.erase(associated_iter);
151 ATH_MSG_ERROR(
"Failure when transferring link from external jet to current jet!");
152 return StatusCode::FAILURE;
157 return StatusCode::SUCCESS;
167 std::vector<const xAOD::IParticle*> targetObjs;
169 ATH_MSG_WARNING(
"Unable to fetch link " << OldLinkName <<
" under associated external jet");
175 for(
auto obj : targetObjs){
179 targetLinks.push_back(el_obj);
183 *dec_handle(
jet) = targetLinks;