 |
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GaudiKernel/TypeNameString.h"
13 #include "GaudiKernel/SystemOfUnits.h"
25 #include "Identifier/Identifier.h"
38 , m_trackListInput(
"ExtendedTracks")
39 , m_trackListOutput(
"SiTracksWithTRTMomConstr")
40 , m_trackSummaryTool(
"Trk::ITrackSummaryTool/ITrackSummaryTool")
41 , m_trackFitter(
"Trk::KalmanFitter/TrkKalmanFitter")
42 , m_useThetaCorrection(false)
44 , m_applyTrkSel(false)
51 , m_selNHitTRTMinCrack(15)
52 , m_selEtaCrackMin(0.7)
53 , m_selEtaCrackMax(1.)
54 , m_selChiSqPerDOFMin(100)
55 , m_nTracksProcessed(0)
57 , m_nTracksAccepted(0)
96 "Track selection will be applied:"
109 return StatusCode::SUCCESS;
114 return StatusCode::SUCCESS;
121 auto outputtracks = std::make_unique<ConstDataVector<TrackCollection> >(
SG::VIEW_ELEMENTS ) ;
122 for (
const auto it : *inputtracks){
125 ATH_MSG_DEBUG(
"kinematic requirements not passed, skip track") ;
132 outputtracks->push_back(
track ) ;
134 ATH_MSG_DEBUG(
"addTRTMomentumConstraint(.) returned 0 pointer, skip track") ;
146 return StatusCode::SUCCESS;
179 float chisqpdof =
track.fitQuality()->chiSquared() /
track.fitQuality()->numberDoF() ;
181 std::unique_ptr<const Trk::TrackSummary>
summary
193 if( isInTransitionRegion ) {
207 <<
"\n\t passed : " << rc
208 <<
"\n\t Pt = " <<
pt
209 <<
"\n\t phi = " << mesp->parameters()[
Trk::phi]
210 <<
"\n\t eta = " <<
eta
225 tsos->measurementOnTrack() &&
226 tsos->trackParameters() ) {
233 if(rc==
nullptr ||
r>rmax) {
240 ATH_MSG_VERBOSE (
"Returning surface with adress: " << rc <<
" at radius " << rmax);
246 double rmin=9999999. ;
250 tsos->measurementOnTrack() &&
251 tsos->trackParameters() ) {
258 if(rc==
nullptr ||
r<rmin) {
265 ATH_MSG_VERBOSE (
"Returning surface with adress: " << rc <<
" at radius " << rmin );
272 std::array<Trk::DefinedParameter, 2> defPar = {
z0,
theta};
273 if( !mp->covariance() )
return nullptr;
294 if( !mpSi->covariance() || !mpTRT->covariance() )
return nullptr;
300 std::array<Trk::DefinedParameter, 3> parFromTRT_vec = {z0TRT, thetaTRT,
331 sortedMS.push_back( pm ) ;
332 for(
int i=0, i_max=
ms.size() ;
i!=i_max ; ++
i ) {
333 sortedMS.push_back(
ms[
i] ) ;
342 for (
const auto it:*(
track->measurementsOnTrack())){
347 setSi.push_back (
it ) ;
350 setTRT.push_back (
it ) ;
354 ATH_MSG_DEBUG(
"TRTMomConstr() : Found " << setSi.size() <<
" Si measurm's!" ) ;
355 ATH_MSG_DEBUG(
"TRTMomConstr() : Found " << setTRT.size() <<
" TRT measurm's!") ;
357 ATH_MSG_DEBUG(
"TRTMomConstr() : fewer TRT measurements than required: "
375 ATH_MSG_ERROR(
"TRTMomConstr() : PseudoMeasurementOnTrack creation failed! " );
382 for(
int i=0, i_max=setTRTPM.size() ;
i!=i_max ; ++
i ) {
390 Gaudi::Hive::currentContext(), setTRTPM, *perTrk,
true,
Trk::pion
395 ATH_MSG_DEBUG(
"TRTMomConstr() : Fit of TRT part of the track failed! ");
408 ATH_MSG_ERROR(
"TRTMomConstr() : PseudoMeasurementOnTrack creation failed! " );
411 ATH_MSG_DEBUG(
"TRTMomConstr() : pmFromTRT " << *pmFromTRT ) ;
417 ->fit(Gaudi::Hive::currentContext(), setSiPM, *perTrk,
true,
Trk::pion
422 ATH_MSG_DEBUG(
"TRTMomConstr() : Si+TRT-p_T Track fit failed !" ) ;
426 ATH_MSG_DEBUG(
"TRTMomConstr() : Si+PM(TRT) track parameteres @ perigee: " << *perSi ) ;
433 return alg.dump( outst ) ;
437 outst <<
"\n|-------------------------------------------------------------------";
438 outst <<
"-----------------------------|\n" ;
439 outst <<
"| processed : "
442 outst <<
"| accepted by track presel. : "
445 outst <<
"| accepted by track presel. + PM : "
448 outst <<
"| ------------------------------------------------------------------";
449 outst <<
"---------------------------- |\n" ;
450 outst <<
"| reject by # PIX hits : "
453 outst <<
"| reject by # SCT hits : "
456 outst <<
"| reject by # TRT hits : "
459 outst <<
"| ------------------------------------------------------------------";
460 outst <<
"---------------------------- |\n" ;
461 outst <<
"| reject by exist. PM(TRT) : "
465 outst <<
"|-------------------------------------------------------------------";
466 outst <<
"-----------------------------|\n" ;
def retrieve(aClass, aKey=None)
int m_selNHitPIXMin
minimal number of PIX hits cut value for the TrackSelection
bool is_pixel(Identifier id) const
@ numberOfPixelHits
number of pixel layers on track with absence of hits
StatusCode finalize()
finalize method of this algorithm.
double m_selPtMin
minimal pT cut value for the TrackSelection
const Trk::PseudoMeasurementOnTrack * createPMfromTRT(const Trk::Perigee *mpSi, const Trk::Perigee *mpTRT)
creates a PseudoMeasurement with (z0, theta, q/p) from TRT track perigee parameters
MsgStream & dump(MsgStream &outst) const
ToolHandle< Trk::ITrackSummaryTool > m_trackSummaryTool
The summary tool to make the track selection.
Trk::Track * addTRTMomentumConstraint(const Trk::Track *track)
Strips of all TRT hits from the track and replaces them with a TRT momentum constraint from a the TRT...
double m_selEtaCrackMax
maximum |eta| to define the transition region
double m_selEtaCrackMin
minimum |eta| to define the transition region
const TRT_ID * m_trtid
Identifier helper class for the TRT.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
bool is_sct(Identifier id) const
Scalar eta() const
pseudorapidity method
DataVector adapter that acts like it holds const pointers.
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
std::string m_trackListInput
Name of the TrackCollection (input)
Scalar theta() const
theta method
const AtlasDetectorID * m_idHelper
Detector ID helper.
size_t m_nTracksPresel
Counter for number of tracks passing the preselection.
double m_selEtaMax
maximal eta cut value for the TrackSelection
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
bool is_trt(Identifier id) const
#define ATH_MSG_VERBOSE(x)
#define AmgSymMatrix(dim)
bool m_useThetaCorrection
correct theta after TRT+PM(z0,theta) refit, small diff.
std::pair< double, ParamDefs > DefinedParameter
bool m_applyTrkSel
apply a selection on tracks or not
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
const Trk::MeasurementSet addPM(Trk::MeasurementSet &ms, const Trk::PseudoMeasurementOnTrack *pm)
adds a PseudoMeasurement to a MeasurementSet
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
size_t m_nTracksProcessed
Counter for number of tracks processed.
Class to handle pseudo-measurements in fitters and on track objects.
virtual const S & associatedSurface() const override final
Access to the Surface method.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
virtual const Amg::Vector3D & globalPosition() const override
returns global position (gathered through Surface constraint)
::StatusCode StatusCode
StatusCode definition for legacy code.
@ numberOfSCTHits
number of SCT holes
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
AddTRTMomConstr(const std::string &name, ISvcLocator *pSvcLocator)
The AddTRTMomConstr is an implementation to add the so-called TRT momentum constraint on a track.
double m_thetaCorr
theta can be different after TRT+PM fit by < o(10e-4).
size_t m_nRejectPM
Counter for number of tracks failing the addition of a pseudo-measurement (PM)
size_t m_nRejectTRT
Counter for number of tracks failing the min number of TRT hits req.
double m_selEtaMin
minimal eta cut value for the TrackSelection
bool accept(const Trk::Track &track)
Verifies if the given track passes the track selection criteria specified via the jobOptions.
StatusCode initialize()
initialize method of this algorithm.
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
const Perigee * perigeeParameters() const
return Perigee.
@ numberOfTRTHits
number of TRT outliers
size_t m_nTracksAccepted
Counter for number of tracks passing the preselection and with PM.
const Trk::TrackStateOnSurface * findouterscthit(const Trk::Track *track)
Returns the outermost SCT TSOS on the given Track.
represents the track state (measurement, material, fit parameters and quality) at a surface.
size_t m_nRejectSCT
Counter for number of tracks failing the min number of SCT hits req.
const Trk::TrackStateOnSurface * findinnertrthit(const Trk::Track *track)
Returns the innermost TRT TSOS on the given Track.
Eigen::Matrix< double, 3, 1 > Vector3D
double m_selChiSqPerDOFMin
maximal Chisquare per degree of freedom cut value for the TrackSelection
MsgStream & operator<<(MsgStream &outst, const AddTRTMomConstr &alg)
std::string m_trackListOutput
Name of the TrackCollection (Output)
int m_selNHitTRTMin
minimal number of TRT hits cut value for the TrackSelection
#define ATH_MSG_WARNING(x)
Identifier identify() const
return the identifier -extends MeasurementBase
int m_selNHitSCTMin
minimal number of SCT hits cut value for the TrackSelection
ToolHandle< Trk::ITrackFitter > m_trackFitter
The TrackFitter to refit the tracks (segment, momentum constraint)
@ PseudoMeasurementOnTrack
size_t m_nRejectPIX
Counter for number of tracks failing the min number of PIX hits req.
virtual const Amg::Vector3D & globalPosition() const override final
return the global position of this RIO_OnTrack
const Trk::PseudoMeasurementOnTrack * createPMfromSi(const Trk::Perigee *mp)
creates a PseudoMeasurement with (z0, theta) from extended track perigee parameters
StatusCode execute()
execute method of this algorithm that is called for each event
int m_selNHitTRTMinCrack
minimal number of TRT hits cut value in trans.