Skip to content
Snippets Groups Projects
Commit 6663b17d authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'trig-ftf-itk-det-road-tool' into 'main'

RoadPredictor tool for Trigger Phase II ITk tracking, EFTRACK-142

See merge request atlas/athena!68032
parents 0233ef82 47a2ab6b
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#ifndef __ITRIGINDETROADPREDICTORTOOL_H__
#define __ITRIGINDETROADPREDICTORTOOL_H__
#include <vector>
#include "GaudiKernel/IAlgTool.h"
namespace Trk {
class SpacePoint;
}
namespace InDetDD {
class SiDetectorElement;
}
static const InterfaceID IID_ITrigInDetRoadPredictorTool("ITrigInDetRoadPredictorTool", 1 , 0);
class ITrigInDetRoadPredictorTool: virtual public IAlgTool
{
public:
static const InterfaceID& interfaceID() {
return IID_ITrigInDetRoadPredictorTool;
}
virtual int getRoad(const std::vector<const Trk::SpacePoint *> &,
std::vector<const InDetDD::SiDetectorElement *> &,
const EventContext &) const = 0;
};
#endif
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#include <cmath>
#include <iostream>
#include <memory>
#include "GaudiKernel/SystemOfUnits.h"
#include "TrkParameters/TrackParameters.h"
#include "TrkPrepRawData/PrepRawData.h"
#include "TrkSpacePoint/SpacePoint.h"
#include "TrigInDetRoadPredictorTool.h"
#include "AthenaBaseComps/AthMsgStreamMacros.h"
#include "AthenaBaseComps/AthCheckMacros.h"
#include "TrkSurfaces/Surface.h"
#include "InDetPrepRawData/PixelCluster.h"
TrigInDetRoadPredictorTool::TrigInDetRoadPredictorTool(const std::string& t,
const std::string& n,
const IInterface* p ): AthAlgTool(t,n,p)
{
declareInterface< ITrigInDetRoadPredictorTool >( this );
}
StatusCode TrigInDetRoadPredictorTool::initialize() {
ATH_CHECK( m_fieldCondObjInputKey.initialize());
return StatusCode::SUCCESS;
}
int TrigInDetRoadPredictorTool::getRoad(const std::vector<const Trk::SpacePoint*>& seed, std::vector<const InDetDD::SiDetectorElement*>& road, const EventContext& ctx) const {
//1. get magnetic field
MagField::AtlasFieldCache fieldCache;
SG::ReadCondHandle<AtlasFieldCacheCondObj> fieldCondObj{m_fieldCondObjInputKey, ctx};
if (!fieldCondObj.isValid()) {
ATH_MSG_ERROR("Failed to retrieve AtlasFieldCacheCondObj with key " << m_fieldCondObjInputKey.key());
return -1;
}
fieldCondObj->getInitializedCache (fieldCache);
road.clear();
unsigned int seedSize = seed.size();
if(seedSize < 3) return -2;
//2. adding spacepoints' DEs
for(unsigned int spIdx=0;spIdx<seedSize;spIdx++) {
const Trk::PrepRawData* prd = seed.at(spIdx)->clusterList().first;
const InDet::PixelCluster* pPixelHit = dynamic_cast<const InDet::PixelCluster*>(prd);
road.push_back(pPixelHit->detectorElement());
}
return 0;
}
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGINDETTRACKFITTER_TRIGINDETROADPREDICTORTOOL_H
#define TRIGINDETTRACKFITTER_TRIGINDETROADPREDICTORTOOL_H
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/ServiceHandle.h"
#include "TrigInDetToolInterfaces/ITrigInDetRoadPredictorTool.h"
// MagField cache
#include "MagFieldConditions/AtlasFieldCacheCondObj.h"
#include "MagFieldElements/AtlasFieldCache.h"
namespace Trk {
class SpacePoint;
}
class TrigInDetRoadPredictorTool: public AthAlgTool, virtual public ITrigInDetRoadPredictorTool
{
public:
TrigInDetRoadPredictorTool( const std::string&, const std::string&, const IInterface* );
virtual StatusCode initialize() override;
virtual int getRoad(const std::vector<const Trk::SpacePoint*>&, std::vector<const InDetDD::SiDetectorElement*>&, const EventContext&) const;
private:
Gaudi::Property<int> m_nClustersMin {this, "nClustersMin", 7, "Minimum number of clusters on track"};
SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCondObjInputKey{
this, "AtlasFieldCacheCondObj", "fieldCondObj",
"Name of the Magnetic Field conditions object key"};
};
#endif
#include "../TrigInDetTrackFitter.h"
#include "../TrigDkfTrackMakerTool.h"
#include "../TrigInDetTrackFollowingTool.h"
#include "../TrigInDetRoadPredictorTool.h"
DECLARE_COMPONENT( TrigInDetTrackFitter )
DECLARE_COMPONENT( TrigDkfTrackMakerTool )
DECLARE_COMPONENT( TrigInDetTrackFollowingTool )
DECLARE_COMPONENT( TrigInDetRoadPredictorTool )
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