Skip to content
Snippets Groups Projects
Commit 6422d38d authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'cleanup_trigpartcreator' into 'master'

InDetTrigParticleCreation: delete Run-2 algorithms

See merge request atlas/athena!40985
parents 850af417 01250a45
No related branches found
No related tags found
No related merge requests found
Showing
with 10 additions and 2344 deletions
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( InDetTrigParticleCreation )
......@@ -7,7 +7,4 @@ atlas_subdir( InDetTrigParticleCreation )
atlas_add_component( InDetTrigParticleCreation
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps AthenaKernel AtlasDetDescr CxxUtils GaudiKernel IdDictDetDescr Identifier InDetIdentifier Particle StoreGateLib TrigInterfacesLib TrigNavigationLib TrigSteeringEvent TrigTimeAlgsLib TrkEventUtils TrkParameters TrkParticleBase TrkToolInterfaces TrkTrack TrkTrackLink TrkTrackSummary VxVertex xAODTracking )
# Install files from the package:
atlas_install_python_modules( python/*.py )
LINK_LIBRARIES AthenaBaseComps GaudiKernel StoreGateLib TrkToolInterfaces TrkTrack TrkTrackSummary xAODTracking )
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
/////////////////////////////////////////////////////////////////////////////
/**
// filename: TrigParticleCreator.h
//
// author: Patricia Conde Muino 13/09/2005
// Patricia.Conde.Muino@cern.ch
//
// Description: Seeded version of the offline ParticleCreator
//
// Modified :
//
// -------------------------------
// ATLAS Collaboration
*/
////////////////////////////////////////////////////////////////////////////
#ifndef INDETTRIGPARTICLECREATION_PARTICLECREATOR_H
#define INDETTRIGPARTICLECREATION_PARTICLECREATOR_H
#include "GaudiKernel/ToolHandle.h"
#include "TrkTrack/TrackCollection.h"
//!< Trigger specific stuff
#include "TrigInterfaces/FexAlgo.h"
// STL
#include <map>
#include <string>
class VxContainer;
class TH1F;
namespace Trk { class RecVertex; }
namespace Trk { class ITrackParticleCreatorTool; }
namespace Trk { class IPRD_AssociationTool; }
namespace Rec { class TrackParticleContainer; }
namespace Rec { class TrackParticle; }
namespace InDet
{
class TrigParticleCreator : public HLT::FexAlgo
{
public:
TrigParticleCreator(const std::string &name, ISvcLocator *pSvcLocator);
virtual ~TrigParticleCreator();
HLT::ErrorCode hltInitialize();
HLT::ErrorCode hltExecute(const HLT::TriggerElement* input, HLT::TriggerElement* output);
HLT::ErrorCode hltFinalize();
private:
void ResetMon();
void FillMonPerTrack(const Rec::TrackParticle *, const double&, const double&);
void FillMonPerRoi(const double&, const double&);
private:
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool;
ToolHandle< Trk::IPRD_AssociationTool > m_assoTool; /** used to work out which (if any) PRDs are shared between tracks*/
Rec::TrackParticleContainer* m_trackPC;
const TrackCollection* m_allTracksFromStoreGate;
const VxContainer* m_primcontainer;
bool m_doSharedHits;
//+++ SA: Monitoring
std::string m_slice_name;
bool m_mon_doSliceSpecific;
int m_mon_counter;
int m_mon_prescale;
float m_mon_ptmin;
//+++ Common Variables
std::vector<float> m_dqm_d0;
std::vector<float> m_dqm_z0;
std::vector<float> m_dqm_phi;
std::vector<float> m_dqm_eta;
std::vector<float> m_dqm_qOverP;
std::vector<int> m_dqm_npix_hits;
std::vector<int> m_dqm_nsct_hits;
std::vector<int> m_dqm_ntrt_hits;
std::vector<float> m_dqm_chi2dof;
std::vector<float> m_dqm_eta_roi;
std::vector<float> m_dqm_phi_roi;
int m_dqm_ntrkpart;
int m_dqm_ntrk;
int m_dqm_nvertex;
//+++ Bjet
float m_dqm_bj_sumpt;
//+++ Muon
float m_dqm_mu_d0;
float m_dqm_mu_z0;
float m_dqm_mu_eta;
float m_dqm_mu_phi;
float m_dqm_mu_qOverP;
float m_dqm_mu_pt;
int m_dqm_mu_npix_hits;
int m_dqm_mu_nsct_hits;
int m_dqm_mu_ntrt_hits;
float m_dqm_mu_chi2dof;
float m_dqm_mu_eta_roi;
float m_dqm_mu_phi_roi;
//+++ Tau
std::vector<float> m_dqm_ta_roidr;
float m_dqm_ta_L_pt; //+++ pT of leading (L) pT track
float m_dqm_ta_frac_pt; //+++ fraction pT_L/pT_NL, NL= next-to-leading
float m_dqm_ta_sum_ch; //+++ Charge sum all tracks
float m_dqm_ta_asy_ch; //+++ Charge asymmetry all tracks
float m_dqm_ta_m; //+++ Inv mass all tracks
};
}
#endif
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
/////////////////////////////////////////////////////////////////////////////
/**
// filename: TrigTrackingxAODCnv.h
//
// author: Jiri Masik
// Jiri.Masik@manchester.ac.uk
//
//
// -------------------------------
// ATLAS Collaboration
*/
////////////////////////////////////////////////////////////////////////////
#ifndef INDETTRIGPARTICLECREATION_TRACKINGXAODCNV_H
#define INDETTRIGPARTICLECREATION_TRACKINGXAODCNV_H
#include "GaudiKernel/ToolHandle.h"
#include "TrkTrack/TrackCollection.h"
#include "TrkToolInterfaces/IPRDtoTrackMapExchangeTool.h"
//!< Trigger specific stuff
#include "TrigInterfaces/FexAlgo.h"
// STL
#include <map>
#include <string>
class TH1F;
class AtlasDetectorID;
class Identifier;
class PixelID;
namespace Trk {
class ITrackParticleCreatorTool;
class IResidualPullCalculator;
}
namespace InDet
{
class TrigTrackingxAODCnv : public HLT::FexAlgo
{
public:
TrigTrackingxAODCnv(const std::string &name, ISvcLocator *pSvcLocator);
virtual ~TrigTrackingxAODCnv();
HLT::ErrorCode hltInitialize();
HLT::ErrorCode hltExecute(const HLT::TriggerElement* input, HLT::TriggerElement* output);
HLT::ErrorCode hltFinalize();
private:
void ResetMon();
void FillMonPerTrack(const xAOD::TrackParticle *, const double&, const double&);
void FillMonPerRoi(const TrigRoiDescriptor* , const double&, const double&);
void fillIBLResidual(const Trk::Track *track);
private:
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool;
ToolHandle< Trk::IResidualPullCalculator > m_residualCalc;
/** Tool to emulate the run2 behaviour.
* The downstream clients will use the latest PRD association map indpendent of the feature that created it.
* If this tool is set, the map will be exchanged via the tool rather than being attached as a feature.
*/
PublicToolHandle<Trk::IPRDtoTrackMapExchangeTool> m_prdToTrackMapExchange
{this, "PRDToTrackMapExchange", "" };
const AtlasDetectorID* m_idHelper;
const PixelID* m_pixelId;
const TrackCollection* m_tracks;
bool m_doIBLresidual;
bool m_doSharedHits; // if enabled will extract PRD-to-track map from output TE, the map has to be filled and stored by the preceding algorith,
//Monitoring
std::string m_slice_name;
bool m_mon_doSliceSpecific;
int m_mon_counter;
int m_mon_prescale;
float m_mon_ptmin;
//Common Variables
std::vector<float> m_dqm_d0;
std::vector<float> m_dqm_d0sig;
std::vector<float> m_dqm_z0;
std::vector<float> m_dqm_phi;
std::vector<float> m_dqm_eta;
std::vector<float> m_dqm_qOverP;
std::vector<int> m_dqm_npix_hits;
std::vector<int> m_dqm_nsct_hits;
std::vector<int> m_dqm_ntrt_hits;
std::vector<float> m_dqm_chi2dof;
std::vector<float> m_dqm_eta_roi;
std::vector<float> m_dqm_phi_roi;
double m_roiPhi, m_roiEta, m_roiZ;
double m_roiPhiWidth, m_roiEtaWidth, m_roiZ_Width;
int m_dqm_ntrkpart;
int m_dqm_ntrk;
int m_dqm_nvertex;
//Bjet
float m_dqm_bj_sumpt;
//Muon
float m_dqm_mu_d0;
float m_dqm_mu_z0;
float m_dqm_mu_eta;
float m_dqm_mu_phi;
float m_dqm_mu_qOverP;
float m_dqm_mu_pt;
int m_dqm_mu_npix_hits;
int m_dqm_mu_nsct_hits;
int m_dqm_mu_ntrt_hits;
float m_dqm_mu_chi2dof;
float m_dqm_mu_eta_roi;
float m_dqm_mu_phi_roi;
//Tau
std::vector<float> m_dqm_ta_roidr;
float m_dqm_ta_L_pt; //+++ pT of leading (L) pT track
float m_dqm_ta_frac_pt; //+++ fraction pT_L/pT_NL, NL= next-to-leading
float m_dqm_ta_sum_ch; //+++ Charge sum all tracks
float m_dqm_ta_asy_ch; //+++ Charge asymmetry all tracks
float m_dqm_ta_m; //+++ Inv mass all tracks
//
std::vector<float> m_dqm_ibl_z; //IBL coordinate along z
std::vector<float> m_dqm_ibl_res_x;
std::vector<float> m_dqm_ibl_res_y;
std::vector<float> m_dqm_ibl_hit_expected_found;
//Timers
TrigTimer* m_timerMemAlloc;
TrigTimer* m_timerFeatureAttach;
TrigTimer* m_timerTrackConversion;
};
}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/////////////////////////////////////////////////////////////////////////////
/**
// filename: TrigiVertexxAODCnv.h
//
// author: Ondrej Penc
// ondrej.penc@cern.ch
//
//
// -------------------------------
// ATLAS Collaboration
*/
////////////////////////////////////////////////////////////////////////////
#ifndef TRIGVERTEXXAODCNV__H
#define TRIGVERTEXXAODCNV__H
#include <string>
#include "TrigInterfaces/FexAlgo.h"
namespace InDet
{
class TrigVertexxAODCnv : public HLT::FexAlgo
{
public:
/// Regular algorithm constructor
TrigVertexxAODCnv( const std::string& name, ISvcLocator* pSvcLocator );
/// Function initialising the algorithm
HLT::ErrorCode hltInitialize();
/// Function executing the algorithm
HLT::ErrorCode hltExecute(const HLT::TriggerElement*, HLT::TriggerElement*);
/// Function finalizing the algorithm
HLT::ErrorCode hltFinalize();
private:
/// The key of the input Container
std::string m_VxContName;
/// The key for the output xAOD::Container
std::string m_xVxContName;
};
}
#endif // TRIGVERTEXXAODCNV__H
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
class InDetTrigParticleCreationMonitorBase(TrigGenericMonitoringToolConfig):
def __init__(self, name="InDetTrigParticleCreationMonitorBase", type="electron"):
super (InDetTrigParticleCreationMonitorBase, self).__init__(name)
d0max=5.
z0max=40.
qoverpmax=4e-3
ntrkmax=100
nvertexmax = 25
if type=="cosmicsN":
d0max=1000.
z0max=1400.
qoverpmax=0.01
ntrkmax=20
nvertexmax=10
ntrkbins = min(ntrkmax,100)
nvertexbins = min(nvertexmax,25)
# Common Histograms
self.Histograms += [ defineHistogram('trk_d0',
type='TH1F',
title="d0",
xbins = 100, xmin=-d0max, xmax=d0max)]
self.Histograms += [ defineHistogram('trk_z0',
type='TH1F',
title="z0",
xbins = 100, xmin=-z0max, xmax=z0max)]
self.Histograms += [ defineHistogram('trk_phi',
type='TH1F',
title="phi",
xbins = 100, xmin=-3.142, xmax=3.142)]
self.Histograms += [ defineHistogram('trk_eta',
type='TH1F',
title="eta",
xbins = 100, xmin=-5., xmax=5)]
self.Histograms += [ defineHistogram('trk_qoverp',
type='TH1F',
title="qoverp",
xbins = 100, xmin=-qoverpmax, xmax=qoverpmax)]
self.Histograms += [ defineHistogram('trk_nPIXHits',
type='TH1F',
title="npix_hits",
xbins = 10, xmin=0., xmax=10.)]
self.Histograms += [ defineHistogram('trk_nSCTHits',
type='TH1F',
title="nsct_hits",
xbins = 20, xmin=0., xmax=20.)]
self.Histograms += [ defineHistogram('trk_nTRTHits',
type='TH1F',
title="ntrt_hits",
xbins = 76, xmin=-1., xmax=75.)]
self.Histograms += [ defineHistogram('trk_chi2dof',
type='TH1F',
title="chi2dof",
xbins = 100, xmin=0., xmax=10.)]
self.Histograms += [ defineHistogram('roi_nTrkPart',
type='TH1F',
title="ntrkpart",
xbins = ntrkbins, xmin=0., xmax=ntrkmax)]
self.Histograms += [ defineHistogram('roi_nTracks',
type='TH1F',
title="ntrk",
xbins = ntrkbins, xmin=0., xmax=ntrkmax)]
self.Histograms += [ defineHistogram('roi_nVertices',
type='TH1F',
title="nvertex",
xbins = nvertexbins, xmin=0., xmax=nvertexmax)]
# Slice Specific Histograms
if (type=="bjet"):
self.Histograms += [ defineHistogram('roi_nTrkPart, bj_sumPt',
type='TH2F',
title="roi_nTrkPart vs bj_sumPt",
xbins=100, xmin=0., xmax=100.,
ybins=100, ymin=0, ymax=5000 ) ]
if (type=="muon"):
self.Histograms += [ defineHistogram('mu_pt',
type='TH1F',
title="mu_pt",
xbins = 100, xmin=0., xmax=2000.)]
self.Histograms += [ defineHistogram('mu_eta',
type='TH1F',
title="mu_eta",
xbins = 100, xmin=-3., xmax=3.)]
self.Histograms += [ defineHistogram('mu_phi',
type='TH1F',
title="mu_phi",
xbins = 100, xmin=-3.1416, xmax=3.1416)]
self.Histograms += [ defineHistogram('mu_d0, mu_phi',
type='TH2F',
title="reco: d0 vs phi",
xbins=100, xmin=-5., xmax=5.,
ybins=100, ymin=-3.1416, ymax=3.1416 ) ]
self.Histograms += [ defineHistogram('mu_eta, mu_phi',
type='TH2F',
title="reco: eta vs phi",
xbins=100, xmin=-3, xmax=3,
ybins=100, ymin=-3.1416, ymax=3.1416 ) ]
self.Histograms += [ defineHistogram('mu_etaRoi, mu_phiRoi',
type='TH2F',
title="roi: eta vs phi",
xbins=100, xmin=-3, xmax=3,
ybins=100, ymin=-3.1416, ymax=3.1416 ) ]
self.Histograms += [ defineHistogram('mu_eta, mu_etaRoi',
type='TH2F',
title="reco vs roi: eta",
xbins=100, xmin=-3, xmax=3,
ybins=100, ymin=-3, ymax=3 ) ]
self.Histograms += [ defineHistogram('mu_phi, mu_phiRoi',
type='TH2F',
title="reco vs roi: phi",
xbins=100, xmin=-3.1416, xmax=3.1416,
ybins=100, ymin=-3.1416, ymax=3.1416 ) ]
if (type=="tau"):
self.Histograms += [ defineHistogram('ta_roiDR',
type='TH1F',
title="ta_roiDR",
xbins = 100, xmin=0., xmax=1.)]
self.Histograms += [ defineHistogram('ta_lPt',
type='TH1F',
title="ta_lPt",
xbins = 100, xmin=0., xmax=1000.)]
self.Histograms += [ defineHistogram('ta_fracPt',
type='TH1F',
title="ta_fracPt",
xbins = 100, xmin=0., xmax=1.0)]
self.Histograms += [ defineHistogram('ta_sumCh',
type='TH1F',
title="ta_sumCh",
xbins = 100, xmin=-50., xmax=50.)]
self.Histograms += [ defineHistogram('ta_asyCh',
type='TH1F',
title="ta_asyCh",
xbins = 24, xmin=-1.2, xmax=1.2)]
self.Histograms += [ defineHistogram('ta_m',
type='TH1F',
title="ta_m",
xbins = 301, xmin=-1., xmax=300.)]
#
#-- online
#
class InDetTrigParticleCreationOnlineMonitor(InDetTrigParticleCreationMonitorBase):
def __init__(self, name="InDetTrigParticleCreationOnlineMonitor", type="electron"):
super (InDetTrigParticleCreationOnlineMonitor, self).__init__(name,type)
self.defineTarget("Online")
#
#-- validation
#
class InDetTrigParticleCreationValidationMonitor(InDetTrigParticleCreationMonitorBase):
def __init__(self, name="InDetTrigParticleCreationValidationMonitor", type="electron"):
super (InDetTrigParticleCreationValidationMonitor, self).__init__(name,type)
self.defineTarget("Validation")
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
class InDetTrigTrackingxAODCnvMonitorBase(TrigGenericMonitoringToolConfig):
def __init__(self, name="InDetTrigTrackingxAODCnvMonitorBase", type="electron"):
super (InDetTrigTrackingxAODCnvMonitorBase, self).__init__(name)
d0max=5.
z0max=250.
qoverpmax=4e-3
ntrkmax=100
nvertexmax = 25
phimax = 3.2
phibin = 64
etamax = 3.
etabin = 60
if type=="cosmicsN":
d0max=1000.
z0max=1400.
qoverpmax=0.01
ntrkmax=20
nvertexmax=10
ntrkbins = min(ntrkmax,100)
nvertexbins = min(nvertexmax,25)
# Common Histograms
self.Histograms += [ defineHistogram('trk_d0',
type='TH1F',
title="d0",
xbins = 100, xmin=-d0max, xmax=d0max)]
self.Histograms += [ defineHistogram('trk_d0sig',
type='TH1F',
title="d0sig",
xbins = 100, xmin=-d0max, xmax=d0max)]
self.Histograms += [ defineHistogram('trk_z0',
type='TH1F',
title="z0",
xbins = 100, xmin=-z0max, xmax=z0max)]
self.Histograms += [ defineHistogram('trk_phi',
type='TH1F',
title="phi",
xbins = phibin, xmin=-phimax, xmax=phimax)]
self.Histograms += [ defineHistogram('trk_eta',
type='TH1F',
title="eta",
xbins = etabin, xmin=-etamax, xmax=etamax)]
self.Histograms += [ defineHistogram('trk_qoverp',
type='TH1F',
title="qoverp",
xbins = 100, xmin=-qoverpmax, xmax=qoverpmax)]
self.Histograms += [ defineHistogram('trk_nPIXHits',
type='TH1F',
title="npix_hits",
xbins = 20, xmin=0., xmax=20.)]
self.Histograms += [ defineHistogram('trk_nSCTHits',
type='TH1F',
title="nsct_hits",
xbins = 20, xmin=0., xmax=20.)]
self.Histograms += [ defineHistogram('trk_nTRTHits',
type='TH1F',
title="ntrt_hits",
xbins = 50, xmin=0., xmax=50.)]
self.Histograms += [ defineHistogram('trk_chi2dof',
type='TH1F',
title="chi2dof",
xbins = 100, xmin=0., xmax=10.)]
self.Histograms += [ defineHistogram('roi_nTrkPart',
type='TH1F',
title="ntrkpart",
xbins = ntrkbins, xmin=0., xmax=ntrkmax)]
self.Histograms += [ defineHistogram('roi_nTracks',
type='TH1F',
title="ntrk",
xbins = ntrkbins, xmin=0., xmax=ntrkmax)]
self.Histograms += [ defineHistogram('roi_nVertices',
type='TH1F',
title="nvertex",
xbins = nvertexbins, xmin=0., xmax=nvertexmax)]
self.Histograms += [ defineHistogram('roi_eta',
type='TH1F',
title="Eta of the input RoI",
xbins = 100, xmin=-5, xmax=5)]
self.Histograms += [ defineHistogram('roi_phi',
type='TH1F',
title="Phi of the input RoI",
xbins = phibin, xmin=-phimax, xmax=phimax)]
self.Histograms += [ defineHistogram('roi_z',
type='TH1F',
title="z of the input RoI",
xbins = 100, xmin=-300, xmax=300)]
self.Histograms += [ defineHistogram('roi_etaWidth',
type='TH1F',
title="Eta width of the input RoI",
xbins = 100, xmin=0, xmax=5)]
self.Histograms += [ defineHistogram('roi_phiWidth',
type='TH1F',
title="Phi width of the input RoI",
xbins = 2*phibin, xmin=0, xmax=6.4)]
self.Histograms += [ defineHistogram('roi_zWidth',
type='TH1F',
title="z width of the input RoI",
xbins = 100, xmin=0, xmax=500)]
self.Histograms += [ defineHistogram('IBLz, IBLresx',
type='TProfile',
title="IBLresx vs z (profile)",
xbins=70, xmin=-350., xmax=350.,
ymin=-0.1, ymax=0.1 ) ]
self.Histograms += [ defineHistogram('IBLz, IBLresy',
type='TProfile',
title="IBLresy vs z (profile)",
xbins=70, xmin=-350., xmax=350.,
ymin=-0.1, ymax=+0.1 ) ]
self.Histograms += [ defineHistogram('trk_z0, IBLHitExpectedAndFound',
type='TProfile',
title="IBLHitExpectedAndFound vs z (profile)",
xbins=50, xmin=-250., xmax=250.,
ymin=-0.1, ymax=+1.1 ) ]
# Slice Specific Histograms
if (type=="bjet"):
self.Histograms += [ defineHistogram('roi_nTrkPart, bj_sumPt',
type='TH2F',
title="roi_nTrkPart vs bj_sumPt",
xbins=100, xmin=0., xmax=100.,
ybins=100, ymin=0, ymax=5000 ) ]
if (type=="muon"):
self.Histograms += [ defineHistogram('mu_pt',
type='TH1F',
title="mu_pt",
xbins = 100, xmin=0., xmax=2000.)]
self.Histograms += [ defineHistogram('mu_eta',
type='TH1F',
title="mu_eta",
xbins = etabin, xmin=-etamax, xmax=etamax)]
self.Histograms += [ defineHistogram('mu_phi',
type='TH1F',
title="mu_phi",
xbins = phibin, xmin=-phimax, xmax=phimax)]
self.Histograms += [ defineHistogram('mu_d0, mu_phi',
type='TH2F',
title="reco: d0 vs phi",
xbins=100, xmin=-10., xmax=10.,
ybins=phibin, ymin=-phimax, ymax=phimax ) ]
self.Histograms += [ defineHistogram('mu_eta, mu_phi',
type='TH2F',
title="reco: eta vs phi",
xbins=etabin, xmin=-etamax, xmax=etamax,
ybins=phibin, ymin=-phimax, ymax=phimax ) ]
self.Histograms += [ defineHistogram('mu_etaRoi, mu_phiRoi',
type='TH2F',
title="roi: eta vs phi",
xbins=etabin, xmin=-etamax, xmax=etamax,
ybins=phibin, ymin=-phimax, ymax=phimax ) ]
self.Histograms += [ defineHistogram('mu_eta, mu_etaRoi',
type='TH2F',
title="reco vs roi: eta",
xbins=etabin/2, xmin=-etamax, xmax=etamax,
ybins=etabin/2, ymin=-etamax, ymax=etamax ) ]
self.Histograms += [ defineHistogram('mu_phi, mu_phiRoi',
type='TH2F',
title="reco vs roi: phi",
xbins=phibin/2, xmin=-phimax, xmax=phimax,
ybins=phibin/2, ymin=-phimax, ymax=phimax ) ]
if (type=="tau"):
self.Histograms += [ defineHistogram('ta_roiDR',
type='TH1F',
title="ta_roiDR",
xbins = 100, xmin=0., xmax=1.)]
self.Histograms += [ defineHistogram('ta_lPt',
type='TH1F',
title="ta_lPt",
xbins = 100, xmin=0., xmax=1000.)]
self.Histograms += [ defineHistogram('ta_fracPt',
type='TH1F',
title="ta_fracPt",
xbins = 100, xmin=0., xmax=1.0)]
self.Histograms += [ defineHistogram('ta_sumCh',
type='TH1F',
title="ta_sumCh",
xbins = 100, xmin=-50., xmax=50.)]
self.Histograms += [ defineHistogram('ta_asyCh',
type='TH1F',
title="ta_asyCh",
xbins = 24, xmin=-1.2, xmax=1.2)]
self.Histograms += [ defineHistogram('ta_m',
type='TH1F',
title="ta_m",
xbins = 301, xmin=-1., xmax=300.)]
#
#-- online
#
class InDetTrigTrackingxAODCnvOnlineMonitor(InDetTrigTrackingxAODCnvMonitorBase):
def __init__(self, name="InDetTrigTrackingxAODCnvOnlineMonitor", type="electron"):
super (InDetTrigTrackingxAODCnvOnlineMonitor, self).__init__(name,type)
self.defineTarget("Online")
#
#-- validation
#
class InDetTrigTrackingxAODCnvValidationMonitor(InDetTrigTrackingxAODCnvMonitorBase):
def __init__(self, name="InDetTrigTrackingxAODCnvValidationMonitor", type="electron"):
super (InDetTrigTrackingxAODCnvValidationMonitor, self).__init__(name,type)
self.defineTarget("Validation")
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# File: InDetTrigParticleCreation/__init__.py
# Author: Iwona.Grabowska@cern.ch
__version__ = '1.0.0'
__author__ = 'Iwona.Grabowska@cern.ch'
__all__ = [ 'InDetTrigParticleCreationMonitoring' ]
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigTrackingxAODCnvMT.h"
#include "TrkToolInterfaces/ITrackParticleCreatorTool.h"
#include "xAODTracking/TrackParticleAuxContainer.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "TrkTrack/Track.h"
#include "TrkParameters/TrackParameters.h"
#include "TrigSteeringEvent/TrigRoiDescriptor.h"
#include "TrkTrackSummary/TrackSummary.h"
#include <cmath>
......@@ -35,9 +32,6 @@ namespace InDet
"Track Collection");
}
TrigTrackingxAODCnvMT::~TrigTrackingxAODCnvMT()
{}
///////////////////////////////////////////////////////////////////
// Initialisation
///////////////////////////////////////////////////////////////////
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/////////////////////////////////////////////////////////////////////////////
/**
// filename: TrigTrackingxAODCnv.h
// filename: TrigTrackingxAODCnvMT.h
//
// author: Jiri Masik
// Jiri.Masik@manchester.ac.uk
......@@ -18,42 +18,26 @@
#ifndef INDETTRIGPARTICLECREATION_TRACKINGXAODCNVMT_H
#define INDETTRIGPARTICLECREATION_TRACKINGXAODCNVMT_H
#include "GaudiKernel/ToolHandle.h"
// Base class
#include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "GaudiKernel/ToolHandle.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "TrkToolInterfaces/ITrackParticleCreatorTool.h"
#include "TrkTrack/TrackCollection.h"
#include "xAODTracking/TrackParticleContainer.h"
// STL
#include <string>
class TH1F;
class AtlasDetectorID;
class PixelID;
class TrigRoiDescriptorCollection;
namespace Trk {
class ITrackParticleCreatorTool;
class IResidualPullCalculator;
}
namespace InDet
{
class TrigTrackingxAODCnvMT : public AthReentrantAlgorithm
{
public:
TrigTrackingxAODCnvMT(const std::string &name, ISvcLocator *pSvcLocator);
virtual ~TrigTrackingxAODCnvMT();
StatusCode initialize();
StatusCode execute(const EventContext& ctx) const;
virtual StatusCode initialize() override;
virtual StatusCode execute(const EventContext& ctx) const override;
private:
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// Gaudi/Athena include(s):
#include "AthenaKernel/errorcheck.h"
#include "GaudiKernel/ITHistSvc.h"
// EDM include(s):
#include "xAODTracking/VertexContainer.h"
#include "xAODTracking/VertexAuxContainer.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "VxVertex/VxContainer.h"
#include "VxVertex/VxTrackAtVertex.h"
#include "TrkTrackLink/ITrackLink.h"
#include "TrkParticleBase/LinkToTrackParticleBase.h"
#include "TrkTrack/LinkToTrack.h"
#include "TrkTrack/Track.h"
#include "TrkTrack/TrackCollection.h"
// Local include(s):
#include "InDetTrigParticleCreation/TrigVertexxAODCnv.h"
namespace InDet {
TrigVertexxAODCnv::TrigVertexxAODCnv( const std::string& name,
ISvcLocator* pSvcLocator )
: HLT::FexAlgo( name, pSvcLocator )
{
declareProperty( "InputVxContainerKey", m_VxContName = "PrimVx" );
declareProperty( "OutputVxContainerKey", m_xVxContName = "xPrimVx" );
}
HLT::ErrorCode TrigVertexxAODCnv::hltInitialize()
{
ATH_MSG_INFO( "Initializing - Package version: " << PACKAGE_VERSION );
ATH_MSG_INFO( "Input Vertex Container = " << m_VxContName );
ATH_MSG_INFO( "Output Vertex Container = " << m_xVxContName );
return HLT::OK;
}
HLT::ErrorCode TrigVertexxAODCnv::hltExecute(const HLT::TriggerElement*, HLT::TriggerElement* outputTE)
{
int outputLevel = msgLvl();
// Retrieve the AOD vertices:
const VxContainer *vxc;
if(HLT::OK != getFeature(outputTE, vxc, m_VxContName))
{
msg() << MSG::ERROR << "Internal error in the navigation structure during retrieval of the VxContainer with key: " << m_VxContName << ". Do nothing." << endmsg;
return HLT::NAV_ERROR;
}
if(!vxc)
{
msg() << MSG::ERROR << "No VxContainer with key: " << m_VxContName << " found. Do nothing." << endmsg;
return HLT::NAV_ERROR;
}
const xAOD::TrackParticleContainer *xtpc;
if(HLT::OK != getFeature(outputTE, xtpc)){
msg() << MSG::ERROR << "No xAOD::TrackParticleContainer - cannot create links" << endmsg;
return HLT::NAV_ERROR;
}
// Create the xAOD container and its auxiliary store:
xAOD::VertexContainer* xaod = new xAOD::VertexContainer();
xAOD::VertexAuxContainer aux;
xaod->setStore( &aux );
// Create the xAOD objects:
auto itr = vxc->begin();
auto end = vxc->end();
const Trk::VxCandidate* vtx;
Trk::VxCandidate dummyVxCandidate(Trk::RecVertex(Amg::Vector3D::Zero(), AmgSymMatrix(3)::Zero()), std::vector<Trk::VxTrackAtVertex*>());
dummyVxCandidate.setVertexType(Trk::NoVtx);
for( ; itr != end; ++itr )
{
if((*itr)->vertexType() == 0)
{
vtx = &dummyVxCandidate;
}
else
{
vtx = *itr;
}
// Create the xAOD object:
xAOD::Vertex* vertex = new xAOD::Vertex();
xaod->push_back( vertex );
// Get & set the Position
vertex->setPosition(vtx->recVertex().position());
// Get & set the Covariance Position
vertex->setCovariancePosition(vtx->recVertex().covariancePosition());
// Get & set the Fit quality
vertex->setFitQuality((float)(vtx->recVertex().fitQuality().chiSquared()), (float)(vtx->recVertex().fitQuality().doubleNumberDoF ()));
//Type of the vertex
vertex->setVertexType((xAOD::VxType::VertexType)(vtx->vertexType()));
//Set Links
unsigned int VTAVsize = vtx->vxTrackAtVertex()->size();
for (unsigned int i = 0 ; i < VTAVsize ; ++i)
{
Trk::VxTrackAtVertex* VTAV = (*(vtx->vxTrackAtVertex()))[i];
Trk::ITrackLink* trklink = VTAV->trackOrParticleLink();
Trk::LinkToTrack* linkToTrackPB = dynamic_cast<Trk::LinkToTrack*>(trklink);
if (!linkToTrackPB)
{
ATH_MSG_DEBUG ("Cast of element link failed, skip this track !!!!!");
}
else
{
ElementLink<xAOD::TrackParticleContainer> newLink(*xtpc, linkToTrackPB->index());
//Now set the newlink to the new xAOD vertex
vertex->addTrackAtVertex(newLink, VTAV->vtxCompatibility());
}
}
}
// Save xAOD vertices:
if ( HLT::OK != attachFeature(outputTE, xaod, m_xVxContName) )
{
msg() << MSG::ERROR << "Could not attach feature to the TE" << endmsg;
return HLT::NAV_ERROR;
}
else
{
if(outputLevel <= MSG::DEBUG)
msg() << MSG::DEBUG << "Stored xAOD::Vertex container" << endmsg;
}
return HLT::OK;
}
HLT::ErrorCode TrigVertexxAODCnv::hltFinalize()
{
msg() << MSG::DEBUG << "finalize() success" << endmsg;
return HLT::OK;
}
} // namespace InDet
#include "InDetTrigParticleCreation/TrigParticleCreator.h"
#include "InDetTrigParticleCreation/TrigTrackingxAODCnv.h"
#include "../TrigTrackingxAODCnvMT.h"
#include "InDetTrigParticleCreation/TrigVertexxAODCnv.h"
#include "TrkTrack/Track.h"
DECLARE_COMPONENT( InDet::TrigParticleCreator )
DECLARE_COMPONENT( InDet::TrigTrackingxAODCnv )
DECLARE_COMPONENT( InDet::TrigTrackingxAODCnvMT )
DECLARE_COMPONENT( InDet::TrigVertexxAODCnv )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment