|
ATLAS Offline Software
|
Go to the documentation of this file.
53 const std::string& Bname,
54 const std::string& Prefix) :
72 vIsoValues =
item.vIsoValues;
73 vNTracks =
item.vNTracks;
79 vIsoValues.push_back(isoValue);
80 vNTracks.push_back(nTracks);
81 vMuons.push_back(
muon);
89 return buildName(
"Ntracks");
93 return buildName(
"",
"_muLink");
102 declareInterface<DerivationFramework::IAugmentationTool>(
this);
112 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initializeHook() -- begin");
119 <<
"), IsoTrkImpChi2Max ("
121 <<
") and IsoDoTrkImpChi2Cut ("
135 return StatusCode::SUCCESS;
143 return StatusCode::SUCCESS;
149 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::addBranchesVCLoopHook() -- begin");
152 <<
"Vertex container index " << ivc
158 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::addBranchesVCSetupHook() -- end");
161 return StatusCode::SUCCESS;
167 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::addBranchesSVLoopHook() -- begin");
177 "calculate muon track isolation ...");
181 "save muon track isolation ...");
185 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::addBranchesSVLoopHook() -- end");
188 return StatusCode::SUCCESS;
195 const unsigned int ipv,
196 const unsigned int its,
197 const unsigned int itt)
const {
200 <<
", its: " << its <<
", itt: " << itt);
204 TVector3 candP = cand.
totalP();
214 " muons and " << candMuTracks.size() <<
215 " tracks from B cand; " << tracks.size() <<
216 " tracks to check.");
220 for (
unsigned int ic = 0;
ic < nCones; ++
ic) {
229 for (
id=0;
id < candMuTracks.size(); ++
id) {
233 if ( candMuTracks[
id].Mag() > 0. ) {
239 double nTracksInCone = 0;
240 double ptSumInCone = 0.;
242 double isoValue(-5.);
245 if ( candRefPV != NULL ) {
247 for (TrackBag::const_iterator trkItr = tracks.begin();
248 trkItr != tracks.end(); ++trkItr) {
249 double deltaR = candMuTracks[
id].DeltaR((*trkItr)->p4().Vect());
251 double logChi2 = (doLogChi2 > 0) ?
254 if ( doLogChi2 == 2 ) logChi2 = abs(logChi2);
255 if ( doLogChi2 == 0 || logChi2 < logChi2Max ) {
257 ptSumInCone += (*trkItr)->pt();
262 if ( ptSumInCone + candMuTracks[
id].
Pt() > 0. ) {
263 isoValue = candMuTracks[
id].Pt()
264 / ( ptSumInCone + candMuTracks[
id].Pt() );
272 iso.
fill(isoValue, nTracksInCone,
muon);
277 return StatusCode::SUCCESS;
283 const int ipv)
const {
296 for (
unsigned int its = 0; its < nTrackSels; ++its) {
297 for (
unsigned int ic = 0;
ic < nCones; ++
ic) {
298 for (
unsigned int itt = 0; itt < nTrackTypes; ++itt) {
308 <<
", found ? " <<
found
310 << (
found ? itpv->second : -1));
319 typedef std::vector<MuonLink_t> MuonLinkVector_t;
326 for (
unsigned int its = 0; its < nTrackSels; ++its) {
327 for (
unsigned int ipv = 0; ipv < nPvAssocs; ++ipv) {
328 for (
unsigned int ic = 0;
ic < nCones; ++
ic) {
329 for (
unsigned int itt = 0; itt < nTrackTypes; ++itt) {
332 dv_iso_values(
result.muIsoName());
334 dv_iso_ntracks(
result.nTracksName());
335 dv_iso_values(*vtx) =
result.vIsoValues;
336 dv_iso_ntracks(*vtx) =
result.vNTracks;
337 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::saveIsolation() -- isobn: "
338 <<
result.muIsoName() <<
", ntbn: "
340 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::saveIsolation() -- vertex: ("
343 << vtx->
z() <<
"), N(iso): "
344 <<
result.vIsoValues.size() <<
", N(nTracks): "
345 <<
result.vNTracks.size());
346 MuonLinkVector_t
links;
348 if (
muon != NULL ) {
350 links.push_back(link);
353 <<
" *muon == NULL -- EL not saved!");
358 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::saveIsolation() -- muLinks: "
359 <<
"N_saved = " <<
links.size() );
365 return StatusCode::SUCCESS;
370 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::setResultsPrefix -- begin");
377 for (
unsigned int its = 0; its < nTrackSels; ++its) {
378 for (
unsigned int ipv = 0; ipv < nPvAssocs; ++ipv) {
379 for (
unsigned int ic = 0;
ic < nCones; ++
ic) {
380 for (
unsigned int itt = 0; itt < nTrackTypes; ++itt) {
398 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults : nCones = " << nCones);
399 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults : nTrackSels = "
401 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults : nPvAssocs = "
403 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults : nTrackTypes = "
405 m_results.resize(boost::extents[nCones][nTrackSels][nPvAssocs][nTrackTypes]);
406 for (
unsigned int its = 0; its < nTrackSels; ++its) {
407 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults -- its = " << its);
408 for (
unsigned int ipv = 0; ipv < nPvAssocs; ++ipv) {
409 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults -- ipv = " << ipv);
410 for (
unsigned int ic = 0;
ic < nCones; ++
ic) {
412 for (
unsigned int itt = 0; itt < nTrackTypes; ++itt) {
413 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults -- itt = " << itt);
433 unsigned int itt)
const {
434 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::buildBranchName -- begin");
442 static_cast<int>(
coneSize * 10.),
static_cast<int>(logChi2Max * 10.), doLogChi2,
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
float x() const
Returns the x position.
TVector3 totalP()
: Returns total 3-momentum calculated from the refitted tracks
ElementLink< xAOD::MuonContainer > MuonLink_t
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::vector< const xAOD::Muon * > MuonBag
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Helper class to provide type-safe access to aux data.
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
std::vector< const xAOD::TrackParticle * > TrackBag
float z() const
Returns the z position.
ElementLink implementation for ROOT usage.
: B-physics xAOD helpers.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
float y() const
Returns the y position.
const xAOD::Vertex * pv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the refitted collision vertex of type pv_type.
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size
Helper class to provide type-safe access to aux data.