24 m_trkSelTool(
"InDet::InDetTrackSelectionTool/TrackSelectionTool", this )
27 declareInterface<IMuonEFTrackIsolationTool>(
this);
53 msg() << MSG::DEBUG <<
"Running isolation over EF Muon!" <<
endmsg;
72 msg() << MSG::DEBUG <<
"EF muon has combined muon" <<
endmsg;
78 selfpt = muon_idtrk->
pt();
80 msg() << MSG::DEBUG <<
"Found ID track attached to combined muon, " << muon_idtrk <<
",pt = " << selfpt <<
endmsg;
84 msg() << MSG::WARNING <<
"Found EF combined muon without a link to ID track, will use combined pt for self removal" <<
endmsg;
92 msg() << MSG::WARNING <<
"This EF muon has neither a combined or extrapolated muon and removeSelf is requested, do not process further" <<
endmsg;
93 return StatusCode::FAILURE;
95 msg() << MSG::WARNING <<
"This EF muon has neither a combined, extrapolated or MS muon, do not process further" <<
endmsg;
96 return StatusCode::FAILURE;
104 StatusCode isoResult =
checkIsolation(muon, selfpt, muon_idtrk, muidtrk_perigee, idtrks, conesizes, results, dzvals, drvals, selfremoval);
115 msg() << MSG::WARNING <<
"Inconsistency, removeSelf requested, but selfpt = 0" <<
endmsg;
118 msg() << MSG::WARNING <<
"Could not find a muon to update with the isolation, skipping this muon" <<
endmsg;
119 return StatusCode::FAILURE;
123 results.insert(results.end(), conesizes.size(), 0.0);
128 ntrks_tmp[0]=0; ntrks_tmp[1]=0;
132 trkit!=trks->
end(); ++trkit) {
136 msg() << MSG::DEBUG <<
"INFO: Track pT = " << (*trkit)->pt() <<
" eta = " << (*trkit)->eta() <<
endmsg;
139 const auto& trkSelResult =
m_trkSelTool->accept(*trkit);
145 for(
unsigned int i=0; i<trkSelResult.getNCuts (); ++i) {
146 ATH_MSG_DEBUG(
" Cut " << i << trkSelResult.getCutName(i).data() <<
" pass = " << trkSelResult.getCutResult(i));
155 const Trk::Perigee& idtrk_perigee = (*trkit)->perigeeParameters();
156 dz = idtrk_perigee.parameters()[
Trk::z0] - muidtrk_perigee->parameters()[
Trk::z0];
159 msg() << MSG::DEBUG <<
"Track failed dz cut, ignoring it. dz = " << dz <<
endmsg;
166 msg() << MSG::DEBUG <<
"ID track passes dz cut. dz = " << dz <<
endmsg;
170 if(dzvals) dzvals->push_back(dz);
175 dr = (*trkit)->p4().DeltaR( muon_idtrk->
p4() );
177 dr = (*trkit)->p4().DeltaR( muon->p4() );
180 if(drvals) drvals->push_back(dr);
186 msg() << MSG::DEBUG <<
"ID track within annulus, ignoring it, dR = " << dr <<
", annulus = " <<
m_annulusSize <<
endmsg;
192 msg() << MSG::DEBUG <<
"ID track outside annulus, keep it, dR = " << dr <<
", annulus = " <<
m_annulusSize <<
endmsg;
197 double ptvarcone20 = std::min(0.2,10000/selfpt);
198 double ptvarcone30 = std::min(0.3,10000/selfpt);
201 conesizes.push_back(ptvarcone20);
202 conesizes.push_back(ptvarcone30);
206 for(
unsigned int conepos=0; conepos<conesizes.size(); ++conepos) {
207 if(dr < conesizes.at(conepos) ) {
209 msg() << MSG::DEBUG <<
"Adding trk pt = " << (*trkit)->pt() <<
", with dr = " << dr <<
", into cone = " << conesizes.at(conepos) <<
endmsg;
211 results.at(conepos) += (*trkit)->pt();
212 ++ntrks_tmp[conepos];
220 selfremoval->push_back(selfpt);
221 selfremoval->push_back(muon->pt());
224 for(
unsigned int conepos=0; conepos<conesizes.size(); ++conepos) {
225 msg() << MSG::DEBUG <<
"Scalar pT sum of tracks around this muon cone " << conesizes.at(conepos) <<
" = " << results.at(conepos) <<
endmsg;
229 for(
unsigned int conepos=0; conepos<conesizes.size(); ++conepos) {
230 results.at(conepos) -= selfpt;
233 for(
unsigned int conepos=0; conepos<conesizes.size(); ++conepos) {
234 msg() << MSG::DEBUG <<
"Scalar pT sum of tracks around this muon cone " << conesizes.at(conepos) <<
" after self removal = " << results.at(conepos) <<
endmsg;
240 return StatusCode::SUCCESS;
250 return StatusCode::FAILURE;
254 msg() << MSG::DEBUG <<
"Initializing TrigMuonEFTrackIsolationTool[" << name() <<
"]" <<
endmsg;
256 <<
"Properties set as follows: " <<
endmsg;
275 msg() << MSG::ERROR <<
"Bad configuration of annulusSize = " <<
m_annulusSize <<
", fix your config!" <<
endmsg;
276 return StatusCode::FAILURE;
280 return StatusCode::SUCCESS;
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool msgLvl(const MSG::Level lvl) const
DataModel_detail::const_iterator< DataVector > const_iterator
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.
bool isValid() const
Test to see if the link can be dereferenced.
Class providing the definition of the 4-vector interface.
const ElementLink< TrackParticleContainer > & combinedTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
const ElementLink< TrackParticleContainer > & inDetTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
const ElementLink< TrackParticleContainer > & muonSpectrometerTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Muon_v1 Muon
Reference the current persistent version: