Commit 073c1015 authored by Niels Van Eldik's avatar Niels Van Eldik Committed by Graeme Stewart
Browse files

new PRDs (InDetTrackSplitterTool-01-00-00)

parent cb0533a0
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef IINDETINDETTRACKSPLITTERTOOL_H
#define IINDETINDETTRACKSPLITTERTOOL_H
// Include files
#include "GaudiKernel/IAlgTool.h"
#include "TrkTrack/Track.h"
#include "TrkTrack/TrackCollection.h"
//class Identifier;
namespace InDet{
static const InterfaceID IID_InDetTrackSplitterTool("InDet::InDetTrackSplitterTool", 1, 0);
class IInDetTrackSplitterTool : virtual public IAlgTool {
public:
/** Destructor */
virtual ~IInDetTrackSplitterTool(){};
/// Retrieve interface ID
static InterfaceID const& interfaceID() {return IID_InDetTrackSplitterTool;};
/** Takes a trackCollection, splits them according to upper and lower parts and fills
two track collections, one with upper tracks and one with lower tracks
which are accessed via getUpperTracks and getLowerTracks
Using this method requires track to pass trackIsCandidate
(for the moment this is just a d0 cut requiring the track went through TRT cavity*/
virtual void splitTracks(TrackCollection const* inputTracks) = 0;
/** Takes a combined ID track and either
1) if removeSilicon = true
Strips off the Si hits.
Then refits the remaining TRT hits using the original
z0 and eta0 as constratins on the fit.
2) if removeSilicon = false
Strips off the TRT hits.
Then refits the remaining Si hits using the original
pT and phi as constratins on the fit
*/
virtual Trk::Track* stripTrack(Trk::Track const& input, bool removeSilicon = true, bool applyConstraint = true) =0;
/** Splits a single input track into upper and lower parts (based on global y)
returns a pair of track the first being the upper*/
virtual std::pair<Trk::Track*, Trk::Track*> splitInUpperLowerTrack(Trk::Track const& input, bool siliconHitsOnly = false) = 0;
/** Splits a single input track into odd and even parts (Not yet implemented)
*/
virtual std::pair<Trk::Track*, Trk::Track*> splitInOddEvenHitsTrack(Trk::Track const& input) = 0;
/** Return the names of the track collections stored in storeGate
*/
virtual std::string const UpperTracksKey() const = 0;
virtual std::string const LowerTracksKey() const = 0;
};
}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef INDETINDETTRACKSPLITTERTOOL_H
#define INDETINDETTRACKSPLITTERTOOL_H
/**
InDetTrackSplitterTool.h
AUTHORS: John Alison
*/
#include "InDetTrackSplitterTool/IInDetTrackSplitterTool.h"
#include "GaudiKernel/IAlgTool.h"
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "TrkTrack/Track.h"
#include "TrkTrack/TrackCollection.h"
class TRT_ID;
class SCT_ID;
class IInDetTrackSplitterTool;
namespace Trk {
class ITrackFitter ;
class ITrackSelectorTool;
class RIO_OnTrack;
class MeasurementBase;
class MeasurementBaseComparisonFunction;
class PseudoMeasurementOnTrack;
class StraightLineSurface;
}
namespace InDet{
/** @class InDetTrackSplitterTool
This tool is used for splitting tracks in different segments and returning fitted tracks that
have the corrisponding hits associated with them.
Currently it is for seen to split tracks in:
- Upper and Lower tracks (for cosmics)
- Tracks using alternating hits. (odd and even)
- Strip a combined (Si+TRT) track of its Si hits
refit remianing TRT-Only hits with theta and z0
constraint from input track.
- Strip a combined (Si+TRT) track of its TRT hits
refit remianing Si-Only hits with qOverP
constraint from input track.
Usages:
1) If you have a single track and want to split in to upper and lower do:
m_trackSplitterTool->splitInUpperLowerTrack(inputtrack);
->splitInOddEvenHitsTrack(inputtrack);
this call return a std::pair containing the split tracks
3) If you have a single track and want to strip ether Si or TRT hits do:
m_trackSplitterTool->stripTrack(inputtrack,true); //For removing the Si Hits
m_trackSplitterTool->stripTrack(inputtrack,false);//For removing the TRT Hits
2) If you have a track collection and want to create track collections with upper and lower tracks do
m_trackSplitterTool->splitTracks(inputTracks);
then retrieve the collection from storeGate with the names m_outputUpperTracksName, m_outputLowerTracksName
@author John Alison*/
class InDetTrackSplitterTool : public AthAlgTool, virtual public IInDetTrackSplitterTool
{
public:
/** default constructor */
InDetTrackSplitterTool(std::string const&, std::string const&,IInterface const *);
/** default destructor */
virtual ~InDetTrackSplitterTool();
/** standard Athena-Algorithm methods */
virtual StatusCode initialize();
virtual StatusCode finalize();
/** Takes a trackCollection, splits them according to upper and lower parts and fills
two track collections, one with upper tracks and one with lower tracks
which are accessed via getUpperTracks and getLowerTracks
Using this method requires track to pass trackIsCandidate
(for the moment this is just a d0 cut requiring the track went through TRT cavity*/
virtual void splitTracks(TrackCollection const* inputTracks);
/** Splits a single input track into upper and lower parts (based on global y)
returns a pair of track the first being the upper*/
virtual std::pair<Trk::Track*, Trk::Track*> splitInUpperLowerTrack(Trk::Track const& input, bool siliconHitsOnly = false);
/** Takes a combined ID track and either
1) if removeSilicon = true
Strips off the Si hits.
Then refits the remaining TRT hits using the original
z0 and eta0 as constratins on the fit.
2) if removeSilicon = false
Strips off the TRT hits.
Then refits the remaining Si hits using the original
pT and phi as constratins on the fit
*/
virtual Trk::Track* stripTrack(Trk::Track const& input, bool removeSilicon = true, bool applyConstraint = true);
/** Splits a single input track into odd and even parts (with logic to aviod splitting SCT space points)
*/
virtual std::pair<Trk::Track*, Trk::Track*> splitInOddEvenHitsTrack(Trk::Track const& input);
/** Return the names of the track collections stored in storeGate
*/
std::string const inline UpperTracksKey() const {return m_outputUpperTracksName;}
std::string const inline LowerTracksKey() const {return m_outputLowerTracksName;}
private:
/** Track selection applied in the splitTracks method
(for the moment this is just a d0 cut requiring the track went through TRT cavity
*/
bool trackIsCandidate(Trk::Track const& inputTrack) const;
/** Return a vector of the SCT hits on track
*/
std::vector<Trk::MeasurementBase const*> getSCTHits(Trk::Track const& input);
/** Logic to check if there is another SCT hit associated with the input hit, which forms a space point
*/
std::vector<Trk::MeasurementBase const*>::iterator findSCTHitsFromSameSpacePoint(Trk::MeasurementBase const* m_sctHit, std::vector<Trk::MeasurementBase const*>& m_listOfSCTHits);
/** Logic to check if the track is constrained given the number of various types of hits
*/
bool isConstrained(unsigned int nPixelHits, unsigned int nSCTHits, unsigned int nTRTHits, unsigned int nPseudomeasurements) const;
/** Strip the Si hits, fit the remaining with a theta, z0 constraint.
*/
Trk::Track* stripSiFromTrack(Trk::Track const& input);
/** Make the theta and z0 constraint
*/
Trk::PseudoMeasurementOnTrack const* makeThetaZ0Constraint(Trk::Perigee const* originialPerigee);
/** Strip the TRT hits, fit the remaining with a qOverP constraint
*/
Trk::Track* stripTRTFromTrack(Trk::Track const& input, bool applyConstraint = true);
/** Make the qOverP constraint
*/
Trk::PseudoMeasurementOnTrack const* makePConstraint(Trk::Perigee const* originialPerigee
,Trk::StraightLineSurface const* trtSurf);
/** Output track collection names recorded in storgate
*/
std::string m_outputUpperTracksName;
std::string m_outputLowerTracksName;
/** Do we use the material on the input track
*/
bool m_keepmaterial;
/** Upper(Lower) Track Collections */
TrackCollection* upperTracks;
TrackCollection* lowerTracks;
/** Helper Functions */
ToolHandle<Trk::ITrackFitter> m_trkfitter;
TRT_ID const* m_trtid ;
SCT_ID const* m_sctid ;
};
}
#endif
#################################################
package InDetTrackSplitterTool
author John Alison
# General
public
use TrkTrack TrkTrack-* Tracking/TrkEvent
use GaudiInterface GaudiInterface-* External
use AtlasPolicy AtlasPolicy-*
use AthenaBaseComps AthenaBaseComps-* Control
private
use EventPrimitives EventPrimitives-* Event
use GeoPrimitives GeoPrimitives-* DetectorDescription
use InDetIdentifier InDetIdentifier-* InnerDetector/InDetDetDescr
use InDetRIO_OnTrack InDetRIO_OnTrack-* InnerDetector/InDetRecEvent
use TrkFitterInterfaces TrkFitterInterfaces-* Tracking/TrkFitter
#use TrkFitterUtils TrkFitterUtils-* Tracking/TrkFitter
use TrkEventPrimitives TrkEventPrimitives-* Tracking/TrkEvent
#use TrkParameters TrkParameters-* Tracking/TrkEvent
use TrkPseudoMeasurementOnTrack TrkPseudoMeasurementOnTrack-* Tracking/TrkEvent
use TrkMeasurementBase TrkMeasurementBase-* Tracking/TrkEvent
use TrkCompetingRIOsOnTrack TrkCompetingRIOsOnTrack-* Tracking/TrkEvent
use TrkSurfaces TrkSurfaces-* Tracking/TrkDetDescr
public
library InDetTrackSplitterTool *.cxx -s=components *.cxx
apply_pattern component_library
#library InDetTrackSplitterTool *.cxx components/*.cxx
#apply_pattern component_library files=*.cxx
#apply_pattern dual_use_library files=*.cxx
#apply_pattern declare_joboptions files="MyJobOptions.py"
#################################################
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
@mainpage InDetTrackSplitterTool Package
@author John Alison <johnda@hep.upenn.edu>, Manuel Kayl <Manuel.Kayl@cern.ch>
This tool is used for splitting tracks in different segments and returning fitted tracks that
have the corrisponding hits associated with them.
Currently it is for seen to split tracks in:
Upper and Lower track segment for cosmics
(However there are lingering problems fitting TRT only tracks)
Tracks using alternating hits. (odd and even)
Usages:
1) If you have a single track and want to split in to upper and lower do
m_trackSplitterTool->splitInUpperLowerTrack(inputtrack);
->splitInOddEvenHitsTrack(inputtrack);
2) If you have a track collection and want to create track collections with upper and lower tracks do
m_trackSplitterTool->splitTracks(inputTracks);
then retrieve the collection from storeGate with the names m_outputUpperTracksName, m_outputLowerTracksName
*/
#include "InDetTrackSplitterTool/InDetTrackSplitterTool.h"
#include "GaudiKernel/DeclareFactoryEntries.h"
DECLARE_NAMESPACE_TOOL_FACTORY( InDet, InDetTrackSplitterTool )
DECLARE_FACTORY_ENTRIES(InDetTrackSplitterTool)
{
DECLARE_NAMESPACE_TOOL( InDet, InDetTrackSplitterTool );
}
#include "GaudiKernel/LoadFactoryEntries.h"
LOAD_FACTORY_ENTRIES( InDetTrackSplitterTool )
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment