Commit 8d735267 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (TRT_DriftCircleOnTrackTool-02-00-00)

parent f46d7763
################################################################################
# Package: TRT_DriftCircleOnTrackTool
################################################################################
# Declare the package name:
atlas_subdir( TRT_DriftCircleOnTrackTool )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthenaBaseComps
GaudiKernel
InnerDetector/InDetRecEvent/InDetRIO_OnTrack
Tracking/TrkTools/TrkToolInterfaces
PRIVATE
InnerDetector/InDetDetDescr/InDetReadoutGeometry
InnerDetector/InDetRecTools/TRT_DriftFunctionTool
Tracking/TrkEvent/TrkEventPrimitives )
# Component(s) in the package:
atlas_add_component( TRT_DriftCircleOnTrackTool
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps GaudiKernel InDetRIO_OnTrack TrkToolInterfaces InDetReadoutGeometry TrkEventPrimitives )
# Install files from the package:
atlas_install_headers( TRT_DriftCircleOnTrackTool )
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// Header file for class TRT_DriftCircleOnTrackNoDriftTimeTool
///////////////////////////////////////////////////////////////////
// (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
// Interface for TRT_DriftCircleOnTrack production
///////////////////////////////////////////////////////////////////
// Version 1.0 18/02/2003 I.Gavrilenko
///////////////////////////////////////////////////////////////////
#ifndef TRT_DriftCircleOnTrackNoDriftTimeTool_H
#define TRT_DriftCircleOnTrackNoDriftTimeTool_H
#include "AthenaBaseComps/AthAlgTool.h"
#include "TrkToolInterfaces/IRIO_OnTrackCreator.h"
#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
namespace InDet {
/** @class TRT_DriftCircleOnTrackNoDriftTimeTool
This tool creates TRT_DriftCircleOnTrack objects using a given
track hypothesis. See doxygen to Trk::RIO_OnTrackCreator for details.
*/
class TRT_DriftCircleOnTrackNoDriftTimeTool :
virtual public Trk::IRIO_OnTrackCreator,public AthAlgTool
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
TRT_DriftCircleOnTrackNoDriftTimeTool(const std::string&,const std::string&,const IInterface*);
virtual ~TRT_DriftCircleOnTrackNoDriftTimeTool ();
virtual StatusCode initialize();
virtual StatusCode finalize ();
virtual const InDet::TRT_DriftCircleOnTrack* correct
(const Trk::PrepRawData&,const Trk::TrackParameters&) const;
///////////////////////////////////////////////////////////////////
// Private methods:
///////////////////////////////////////////////////////////////////
private:
///////////////////////////////////////////////////////////////////
// Private data:
///////////////////////////////////////////////////////////////////
};
} // end of namespace InDet
#endif // TRT_DriftCircleOnTrackNoDriftTimeTool_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// Header file for class TRT_DriftCircleOnTrackRecalibrateTool
///////////////////////////////////////////////////////////////////
// (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef TRT_DriftCircleOnTrackRecalibrateTool_H
#define TRT_DriftCircleOnTrackRecalibrateTool_H
#include "GaudiKernel/ToolHandle.h"
#include "AthenaBaseComps/AthAlgTool.h"
#include "TrkToolInterfaces/IRIO_OnTrackCreator.h"
class ITRT_DriftFunctionTool;
namespace Trk {
class IRIO_OnTrackErrorScalingTool;
}
namespace InDet {
/** @class TRT_DriftCircleOnTrackRecalibrateTool
This tool creates TRT_DriftCircleOnTrack objects using a given
track hypothesis. See doxygen to Trk::RIO_OnTrackCreator for details.
*/
class TRT_DriftCircleOnTrackRecalibrateTool :
virtual public Trk::IRIO_OnTrackCreator, public AthAlgTool
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
TRT_DriftCircleOnTrackRecalibrateTool
(const std::string&,const std::string&,const IInterface*);
virtual ~TRT_DriftCircleOnTrackRecalibrateTool ();
virtual StatusCode initialize();
virtual StatusCode finalize ();
virtual const Trk::RIO_OnTrack* correct
(const Trk::PrepRawData&,const Trk::TrackParameters&) const;
///////////////////////////////////////////////////////////////////
// Private methods:
///////////////////////////////////////////////////////////////////
private:
///////////////////////////////////////////////////////////////////
// Private data:
///////////////////////////////////////////////////////////////////
ToolHandle<Trk::IRIO_OnTrackCreator> m_riontrackTube ;
ToolHandle<ITRT_DriftFunctionTool> m_drifttool ;
ToolHandle<Trk::IRIO_OnTrackErrorScalingTool> m_errorScalingTool;
bool m_scaleTrtCov ;
bool m_useToTCorrection; //!< Shall the Time over Threshold correction be used?
double m_scalefactor ; //scale factor for hit uncertainty
};
} // end of namespace InDet
#endif // TRT_DriftCircleOnTrackRecalibrateTool_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// Header file for class TRT_DriftCircleOnTrackTool
///////////////////////////////////////////////////////////////////
// (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
// Interface for TRT_DriftCircleOnTrack production
///////////////////////////////////////////////////////////////////
// Version 1.0 18/02/2003 I.Gavrilenko
///////////////////////////////////////////////////////////////////
#ifndef TRT_DriftCircleOnTrackTool_H
#define TRT_DriftCircleOnTrackTool_H
#include "GaudiKernel/ToolHandle.h"
#include "AthenaBaseComps/AthAlgTool.h"
#include "TrkToolInterfaces/IRIO_OnTrackCreator.h"
#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
namespace Trk {
class IRIO_OnTrackErrorScalingTool;
}
namespace InDet {
/** @class TRT_DriftCircleOnTrackTool
This tool creates TRT_DriftCircleOnTrack objects using a given
track hypothesis. See doxygen to Trk::RIO_OnTrackCreator for details.
*/
class TRT_DriftCircleOnTrackTool :
virtual public Trk::IRIO_OnTrackCreator, public AthAlgTool
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
TRT_DriftCircleOnTrackTool
(const std::string&,const std::string&,const IInterface*);
virtual ~TRT_DriftCircleOnTrackTool ();
virtual StatusCode initialize();
virtual StatusCode finalize ();
virtual const InDet::TRT_DriftCircleOnTrack* correct
(const Trk::PrepRawData&,const Trk::TrackParameters&) const;
///////////////////////////////////////////////////////////////////
// Private methods:
///////////////////////////////////////////////////////////////////
private:
///////////////////////////////////////////////////////////////////
// Private data:
///////////////////////////////////////////////////////////////////
ToolHandle<Trk::IRIO_OnTrackErrorScalingTool> m_errorScalingTool ;
bool m_scaleTrtCov ;
bool m_useErrorCorrection;
};
} // end of namespace InDet
#endif // TRT_DriftCircleOnTrackTool_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// Header file for class TRT_DriftCircleOnTrackUniversalTool
///////////////////////////////////////////////////////////////////
// (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef TRT_DriftCircleOnTrackUniversalTool_H
#define TRT_DriftCircleOnTrackUniversalTool_H
#include "GaudiKernel/ToolHandle.h"
#include "AthenaBaseComps/AthAlgTool.h"
#include "TrkToolInterfaces/IRIO_OnTrackCreator.h"
namespace InDet {
/** @class TRT_DriftCircleOnTrackUniversalTool
This tool creates TRT_DriftCircleOnTrack objects using a given
track hypothesis. See doxygen to Trk::RIO_OnTrackCreator for details.
*/
class TRT_DriftCircleOnTrackUniversalTool :
virtual public Trk::IRIO_OnTrackCreator, public AthAlgTool
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
TRT_DriftCircleOnTrackUniversalTool
(const std::string&,const std::string&,const IInterface*);
virtual ~TRT_DriftCircleOnTrackUniversalTool ();
virtual StatusCode initialize();
virtual StatusCode finalize ();
virtual const Trk::RIO_OnTrack* correct
(const Trk::PrepRawData&,const Trk::TrackParameters&) const;
///////////////////////////////////////////////////////////////////
// Private methods:
///////////////////////////////////////////////////////////////////
private:
///////////////////////////////////////////////////////////////////
// Private data:
///////////////////////////////////////////////////////////////////
ToolHandle<Trk::IRIO_OnTrackCreator> m_riontrackDrift ;
ToolHandle<Trk::IRIO_OnTrackCreator> m_riontrackTube ;
double m_scalefactor; //scale factor for hit uncertainty
};
} // end of namespace InDet
#endif // TRT_DriftCircleOnTrackUniversalTool_H
package TRT_DriftCircleOnTrackTool
manager Igor Gavrilenko <Igor.Gavrilenko@cern.ch>
private
use TRT_DriftFunctionTool TRT_DriftFunctionTool-* InnerDetector/InDetRecTools
use InDetReadoutGeometry InDetReadoutGeometry-* InnerDetector/InDetDetDescr
use TrkEventPrimitives TrkEventPrimitives-* Tracking/TrkEvent
public
use AtlasPolicy AtlasPolicy-*
use GaudiInterface GaudiInterface-* External
use AthenaBaseComps AthenaBaseComps-* Control
use TrkToolInterfaces TrkToolInterfaces-* Tracking/TrkTools
use InDetRIO_OnTrack InDetRIO_OnTrack-* InnerDetector/InDetRecEvent
library TRT_DriftCircleOnTrackTool *.cxx components/*.cxx
apply_pattern component_library
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
@mainpage
@section TrtDriftCircleOnTrackToolDoc Overview
When making the TRT RIO_OnTrack, the tool currently provides
<ul>
<li> a check if the prediction is in the active region, otherwise the
DriftCircleOnTrack making is cancelled,</li>
<li> the z coordinate (obtained directly from the Track Parameters),</li>
<li> the left-right solution by setting TRT::SIDE and assigning a sign to R.
This left-right solution takes the sign information from the
TrackParameters which are represented as Trk::AtaStraightLine
in the case of a DriftCircle. The sign definition is detailed in
Trk::AtaStraightLine.</li>
</ul>
A good drift radius calibration needs to be available already at the
level of pattern recognition, therefore it is done in the
InDet::TRT_DriftFunctionTool and not in the TRT_DriftCircleOnTrackTool.
However, a more sophisticated r-T calibration is planned for this tool
to take into account signal run time and possibly wire sagging
and the r-T relation for individual tubes.
More general information on <nop>RIO_OnTrackCreation and instructions
how to use these tools can be found under Trk::RIO_OnTrackCreator.
@section TrtDriftCircleOnTrackToolDocMgr Package Managers
The TRT_DriftCircleOnTrackTool package is currently maintained by
I. Gavrilenko.
*/
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// Implementation file for class TRT_DriftCircleOnTrackNoDriftTimeTool
///////////////////////////////////////////////////////////////////
// (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
// AlgTool used for TRT_DriftCircleOnTrack object production
///////////////////////////////////////////////////////////////////
// Version 1.0 21/04/2004 I.Gavrilenko
///////////////////////////////////////////////////////////////////
#include "TRT_DriftCircleOnTrackTool/TRT_DriftCircleOnTrackNoDriftTimeTool.h"
#include "TrkEventPrimitives/LocalParameters.h"
///////////////////////////////////////////////////////////////////
// Constructor
///////////////////////////////////////////////////////////////////
InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::TRT_DriftCircleOnTrackNoDriftTimeTool
(const std::string& ty,const std::string& na,const IInterface* pa)
: AthAlgTool(ty,na,pa)
{
declareInterface<IRIO_OnTrackCreator>(this);
}
///////////////////////////////////////////////////////////////////
// Destructor
///////////////////////////////////////////////////////////////////
InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::~TRT_DriftCircleOnTrackNoDriftTimeTool(){}
///////////////////////////////////////////////////////////////////
// Initialisation
///////////////////////////////////////////////////////////////////
StatusCode InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::initialize()
{
StatusCode sc = AlgTool::initialize(); return sc;
}
///////////////////////////////////////////////////////////////////
// Finalize
///////////////////////////////////////////////////////////////////
StatusCode InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::finalize()
{
StatusCode sc = AlgTool::finalize(); return sc;
}
///////////////////////////////////////////////////////////////////
// Trk::TRT_DriftCircleOnTrack production
///////////////////////////////////////////////////////////////////
const InDet::TRT_DriftCircleOnTrack* InDet::TRT_DriftCircleOnTrackNoDriftTimeTool::correct
(const Trk::PrepRawData& rio,const Trk::TrackParameters& TP) const
{
const InDet::TRT_DriftCircle* DC = dynamic_cast<const InDet::TRT_DriftCircle*>(&rio);
if(!DC) return 0;
// Straw identification
//
const InDetDD::TRT_BaseElement* pE = DC->detectorElement(); if(!pE) return 0;
// Identifier iD = DC->identify();
// IdentifierHash iH = trt_id->straw_layer_hash(trt_id->layer_id(iD));
IdentifierHash iH = pE->identifyHash();
// Global direction of the track parameters
//
const Amg::VectorX& P = TP.parameters();
double se = sin(P[3]);
Amg::Vector3D dir(cos(P[2])*se,sin(P[2])*se,cos(P[3]));
double predictedLocZ=P[1];
// only create objects within the active area
//
double sl = pE->strawLength()*.5;
if (predictedLocZ > sl) predictedLocZ = sl;
else if(predictedLocZ <-sl) predictedLocZ =-sl;
// TRT_DriftCircleOnTrack production
//
Trk::DefinedParameter radius(0.,Trk::locX);
Trk::LocalParameters lp(radius);
Amg::MatrixX cov(1,1);
cov(0,0)=1.33333;
return new InDet::TRT_DriftCircleOnTrack
(DC,lp,cov,iH,predictedLocZ,dir,Trk::NODRIFTTIME);
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// Implementation file for class TRT_DriftCircleOnTrackRecalibrateTool
///////////////////////////////////////////////////////////////////
// (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
// AlgTool used for TRT_DriftCircleOnTrack object production
///////////////////////////////////////////////////////////////////
#include "TRT_DriftCircleOnTrackTool/TRT_DriftCircleOnTrackRecalibrateTool.h"
#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
#include "TrkToolInterfaces/IRIO_OnTrackErrorScalingTool.h"
#include "TrkEventPrimitives/LocalParameters.h"
#include "TRT_DriftFunctionTool/ITRT_DriftFunctionTool.h"
#include "InDetReadoutGeometry/TRT_DetectorManager.h"
///////////////////////////////////////////////////////////////////
// Constructor
///////////////////////////////////////////////////////////////////
InDet::TRT_DriftCircleOnTrackRecalibrateTool::TRT_DriftCircleOnTrackRecalibrateTool
(const std::string& ty,const std::string& na,const IInterface* pa)
: AthAlgTool(ty,na,pa),
m_riontrackTube("InDet::TRT_DriftCircleOnTrackNoDriftTimeTool/TRT_DriftCircleOnTrackNoDriftTimeTool"),
m_drifttool("TRT_DriftFunctionTool"),
m_errorScalingTool("Trk::RIO_OnTrackErrorScalingTool/RIO_OnTrackErrorScalingTool"),
m_useToTCorrection(false),
m_scalefactor(2.)
{
declareInterface<IRIO_OnTrackCreator>(this);
declareProperty("RIOonTrackToolTube", m_riontrackTube );
declareProperty("DriftFunctionTool", m_drifttool);
declareProperty("ErrorScalingTool", m_errorScalingTool);
declareProperty("ScaleHitUncertainty", m_scalefactor );
declareProperty("useDriftTimeToTCorrection",m_useToTCorrection);
}
///////////////////////////////////////////////////////////////////
// Destructor
///////////////////////////////////////////////////////////////////
InDet::TRT_DriftCircleOnTrackRecalibrateTool::~TRT_DriftCircleOnTrackRecalibrateTool(){}
///////////////////////////////////////////////////////////////////
// Initialisation
///////////////////////////////////////////////////////////////////
StatusCode InDet::TRT_DriftCircleOnTrackRecalibrateTool::initialize()
{
StatusCode sc = AlgTool::initialize();
if(m_drifttool.retrieve().isFailure()){
msg(MSG::FATAL) << "Failed to retrieve tool " << m_drifttool << endreq;
return StatusCode::FAILURE;
}
if(m_riontrackTube.retrieve().isFailure()){
msg(MSG::FATAL) << "Failed to retrieve tool " << m_riontrackTube << endreq;
return StatusCode::FAILURE;
}
if ( m_errorScalingTool.retrieve().isFailure() ) {
msg(MSG::FATAL) << "Failed to retrieve tool " << m_errorScalingTool << endreq;
return StatusCode::FAILURE;
} else {
msg(MSG::INFO) << "Retrieved tool " << m_errorScalingTool << endreq;
m_scaleTrtCov = m_errorScalingTool->needToScaleTrt();
if (m_scaleTrtCov) msg(MSG::DEBUG) << "Detected need for scaling TRT errors." << endreq;
}
return sc;
}
///////////////////////////////////////////////////////////////////
// Finalize
///////////////////////////////////////////////////////////////////
StatusCode InDet::TRT_DriftCircleOnTrackRecalibrateTool::finalize()
{
StatusCode sc = AlgTool::finalize(); return sc;
}
///////////////////////////////////////////////////////////////////
// Trk::TRT_DriftCircleOnTrack production
///////////////////////////////////////////////////////////////////
const Trk::RIO_OnTrack* InDet::TRT_DriftCircleOnTrackRecalibrateTool::correct
(const Trk::PrepRawData& rio,const Trk::TrackParameters& TP) const
{
const InDet::TRT_DriftCircle* DC = dynamic_cast<const InDet::TRT_DriftCircle*>(&rio);
if(!DC) return 0;
const Trk::RIO_OnTrack *rot=NULL;
//recalculate driftradius using the new calibration constants
bool isOK=false;
double t0=0.;
double rawtime = m_drifttool->rawTime(DC->driftTimeBin());
if (m_useToTCorrection) {
rawtime -= m_drifttool->driftTimeToTCorrection(DC->timeOverThreshold(), DC->identify());
}
double driftradius = m_drifttool->driftRadius(rawtime,DC->identify(),t0,isOK);
double error = m_drifttool->errorOfDriftRadius(rawtime-t0,DC->identify());
double distance=fabs(fabs(TP.parameters()[0])-driftradius);