Commit 2346b543 authored by Niels Van Eldik's avatar Niels Van Eldik Committed by Graeme Stewart
Browse files

remove constructors taking pointers (TrkRIO_OnTrack-09-00-01)

parent 961fe65a
<?xml version="1.0"?>
<kdevelop>
<general>
<author>Edward Moyse</author>
<email>Edward.Moyse@cern.ch</email>
<version>$VERSION$</version>
<projectmanagement>KDevCustomProject</projectmanagement>
<primarylanguage>C++</primarylanguage>
<ignoreparts>
</ignoreparts>
</general>
<kdevcustomproject>
<run>
<mainprogram>TrkRIO_OnTrack</mainprogram>
</run>
</kdevcustomproject>
<kdevdebugger>
<general>
<dbgshell></dbgshell>
</general>
</kdevdebugger>
<kdevdoctreeview>
<ignoretocs>
<toc>ada</toc>
<toc>ada_bugs_gcc</toc>
<toc>bash</toc>
<toc>bash_bugs</toc>
<toc>clanlib</toc>
<toc>fortran_bugs_gcc</toc>
<toc>gnome1</toc>
<toc>gnustep</toc>
<toc>gtk</toc>
<toc>gtk_bugs</toc>
<toc>haskell</toc>
<toc>haskell_bugs_ghc</toc>
<toc>java_bugs_gcc</toc>
<toc>java_bugs_sun</toc>
<toc>kde2book</toc>
<toc>opengl</toc>
<toc>pascal_bugs_fp</toc>
<toc>php</toc>
<toc>php_bugs</toc>
<toc>perl</toc>
<toc>perl_bugs</toc>
<toc>python</toc>
<toc>python_bugs</toc>
<toc>qt-kdev3</toc>
<toc>ruby</toc>
<toc>ruby_bugs</toc>
<toc>sdl</toc>
<toc>sw</toc>
<toc>w3c-dom-level2-html</toc>
<toc>w3c-svg</toc>
<toc>w3c-uaag10</toc>
<toc>wxwidgets_bugs</toc>
</ignoretocs>
<ignoreqt_xml>
<toc>Guide to the Qt Translation Tools</toc>
<toc>Qt Assistant Manual</toc>
<toc>Qt Designer Manual</toc>
<toc>Qt Reference Documentation</toc>
<toc>qmake User Guide</toc>
</ignoreqt_xml>
<ignoredoxygen>
<toc>KDE Libraries (Doxygen)</toc>
</ignoredoxygen>
</kdevdoctreeview>
<kdevfilecreate>
<filetypes/>
<useglobaltypes>
<type ext="ui" />
<type ext="cpp" />
<type ext="h" />
</useglobaltypes>
</kdevfilecreate>
</kdevelop>
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// RIO_OnTrack.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef TRKRIO_ONTRACK_RIO_ONTRACK_H
#define TRKRIO_ONTRACK_RIO_ONTRACK_H
// Amg
#include "EventPrimitives/EventPrimitives.h"
#include "GeoPrimitives/GeoPrimitives.h"
// Trk
#include "TrkMeasurementBase/MeasurementBase.h"
#include "TrkEventPrimitives/LocalParameters.h"
// Identifier
#include "Identifier/Identifier.h"
#include "Identifier/IdentifierHash.h"
#include <ostream>
class MsgStream;
namespace Trk {
class PrepRawData;
class TrkDetElementBase;
class ITrkEventCnvTool;
/** @class RIO_OnTrack
Class to handle RIO On Tracks ROT) for InDet and Muons,
it inherits from the common MeasurementBase.
The Track holds a vector of TrackStateOnSurface
that carry the MeasurmentBase class pointers.
Need a multimap{RIO, ROT} to go from RIO to ROT
and a map{ROT, Track} to go from ROT to Track
@author Veronique.Boisvert@cern.ch
@author Edward.Moyse@cern.ch
@author Andreas.Salzburger@cern.ch
*/
class RIO_OnTrack : public MeasurementBase {
friend class ITrkEventCnvTool;
public:
/** Default Constructor for POOL */
RIO_OnTrack();
/** Copy Constructor */
RIO_OnTrack(const RIO_OnTrack& rot);
/** Assignment operator */
RIO_OnTrack& operator=(const RIO_OnTrack& rot);
/** Constructor with parameters and without externalPrediction: LocalParameters,
LocalAmg::MatrixX, id&
This class owns the LocalParameters and the error matrix */
RIO_OnTrack( const LocalParameters& locpars,
const Amg::MatrixX& loccov,
const Identifier& id);
/** Destructor */
virtual ~RIO_OnTrack();
/** Pseudo-constructor, needed to avoid excessive RTTI*/
virtual RIO_OnTrack* clone() const = 0;
/** returns the surface for the local to global transformation
- interface from MeasurementBase */
virtual const Surface& associatedSurface() const = 0;
/**Interface method to get the global Position
- interface from MeasurementBase */
virtual const Amg::Vector3D& globalPosition() const = 0;
/**returns the some information about this RIO_OnTrack. */
virtual MsgStream& dump( MsgStream& out ) const;
/**returns the some information about this RIO_OnTrack. */
virtual std::ostream& dump( std::ostream& out ) const;
/** returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
Can be null (in case where the Trk::PrepRawData is not persistified).
Use Detector Element if possible (this is always there).
- extends MeasurementBase */
virtual const Trk::PrepRawData* prepRawData() const = 0;
/** returns the DE hashID
- extends MeasurementBase */
virtual IdentifierHash idDE() const = 0;
/** returns the detector element, assoicated with the PRD of this class
- extends MeasurementBase */
virtual const TrkDetElementBase* detectorElement() const = 0;
/** return the identifier
-extends MeasurementBase */
virtual Identifier identify() const;
/**return number of parameters currently created*/
static unsigned int numberOfInstantiations() ;
protected:
/** ONLY for use in custom convertor
Allows the custom convertor to reset values when persistying/reading back RoTs*/
virtual void setValues(
const Trk::TrkDetElementBase* detEl,
const Trk::PrepRawData* prd)=0;
/**Identifier of the RIO_OnTrack (comes from the associated Trk::PrepRawData)*/
Identifier m_identifier;
/** number of objects of this type in memory */
static unsigned int s_numberOfInstantiations;
};
inline Identifier RIO_OnTrack::identify() const
{ return m_identifier; }
}
#endif // TRKRIO_ONTRACK_RIO_ONTRACK_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// RIO_OnTrackMap.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef TRKRIO_ONTRACK_RIO_ONTRACKMAPS_H
#define TRKRIO_ONTRACK_RIO_ONTRACKMAPS_H
#include "CLIDSvc/CLASS_DEF.h"
#include <map>
namespace Trk{
class PrepRawData;
class RIO_OnTrack;
typedef std::multimap<Trk::PrepRawData*, RIO_OnTrack*> RIOtoROT_Multimap;
}
CLASS_DEF( Trk::RIOtoROT_Multimap , 160822029 , 1 )
#endif // TRKRIO_ONTRACK_RIO_ONTRACKMAPS_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRKRIOONTRACKDICT_H
#define TRKRIOONTRACKDICT_H
#include "TrkRIO_OnTrack/RIO_OnTrack.h"
#include "TrkRIO_OnTrack/RIO_OnTrackMap.h"
#endif
<lcgdict>
<class name="Trk::RIO_OnTrack" >
<field name="m_identifier" transient="false" />
<field name="s_numberOfInstantiations" transient="true" />
</class>
</lcgdict>
package TrkRIO_OnTrack
author Edward Moyse < Edward.Moyse@cern.ch >
use AtlasPolicy AtlasPolicy-*
use CLIDSvc CLIDSvc-* Control
use EventPrimitives EventPrimitives-* Event
use GeoPrimitives GeoPrimitives-* DetectorDescription
use Identifier Identifier-* DetectorDescription
use TrkEventPrimitives TrkEventPrimitives-* Tracking/TrkEvent
use TrkMeasurementBase TrkMeasurementBase-* Tracking/TrkEvent
apply_pattern installed_library
library TrkRIO_OnTrack *.cxx
private
use TrkPrepRawData TrkPrepRawData-* Tracking/TrkEvent
use GaudiInterface GaudiInterface-* External
use AtlasReflex AtlasReflex-* External
# Pattern to build the dict lib. User should create a single header
# file: <package>Dict.h which includes all other .h files. See MissingETDict
# A selection file must be created by hand. This file lists the
# classes to be added to the dictionary, and which fields are
# transient. It should be put in ../<package> dir and is conventionally called
# selection.xml.
# apply_pattern lcgdict dict=TrkRIO_OnTrack selectionfile=selection.xml headerfiles="../TrkRIO_OnTrack/TrkRIO_OnTrackDict.h"
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
@mainpage The RIO_OnTrack class
@section introductionTrkRIO_OnTrack Introduction
Other conceptual names for this class is HitOnTrack or ClusterOnTrack. It contains the modified location of the RIOs according to a track. There are no container of RIO_OnTrack objects since the Track is essentially the container. The RIO_OnTrack contains the RIO from which it comes from. For most use cases there will be a single RIO associated with a RIO_OnTrack, while several RIO_OnTrack for each RIO (since there can be different tracks that make use of the same RIOs). However some users (like xKalman) might join clusters together so for this case a vector of RIOs is provided.
For the navigation, a multimap is recorded between RIO and RIO_OnTrack. In the TrkTrack package there is a map between RIO_OnTrack and Track. In summary the navigation is as followed:
- from Track to RIO_OnTrack: Track class
- from RIO_OnTrack to RIO: RIO_OnTrack class
- from RIO to RIO_OnTrack: multimap
- from RIO_OnTrack to Track: map
- from RIO to Track: use the multimap then the map
- from Track to RIO: Track class to get to RIO_OnTrack, then RIO_OnTrack class to get to RIO
All of these items are under active discussion.
Please let me know of any errors, or if anything is unclear.
@author Veronique.Boisvert@cern.ch
@author Edward.Moyse@cern.ch
@author Andreas.Salzburger@cern.ch
@section used_packagesTrkRIO_OnTrack Used Packages
@htmlinclude used_packages.html
@section requirements Requirements
@include requirements
@namespace Trk
A namespace to enclose the Tracking classes.
*/
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// RIO_OnTrack.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
//Trk
#include "TrkRIO_OnTrack/RIO_OnTrack.h"
#include "TrkEventPrimitives/LocalParameters.h"
#include "TrkPrepRawData/PrepRawData.h"
// Gaudi & AthenaCommon
#include "Identifier/Identifier.h"
#include "GaudiKernel/MsgStream.h"
#include <string>
#include <typeinfo>
unsigned int Trk::RIO_OnTrack::s_numberOfInstantiations=0;
// Constructor with parameters:
Trk::RIO_OnTrack::RIO_OnTrack( const Trk::LocalParameters& locpars,
const Amg::MatrixX& loccov,
const Identifier& id)
: MeasurementBase(locpars,loccov),
m_identifier(id)
{
#ifndef NDEBUG
s_numberOfInstantiations++; // new RIO_OnTrack, so increment total count
#endif
}
// Destructor:
Trk::RIO_OnTrack::~RIO_OnTrack()
{
#ifndef NDEBUG
s_numberOfInstantiations--; // delete RIO_OnTrack, so decrement total count
#endif
}
// default constructor:
Trk::RIO_OnTrack::RIO_OnTrack() :
m_identifier()
{
#ifndef NDEBUG
s_numberOfInstantiations++; // new RIO_OnTrack, so increment total count
#endif
}
// copy constructor:
Trk::RIO_OnTrack::RIO_OnTrack( const Trk::RIO_OnTrack& rot) :
Trk::MeasurementBase(rot),
m_identifier( rot.m_identifier )
{
#ifndef NDEBUG
s_numberOfInstantiations++; // new RIO_OnTrack, so increment total count
#endif
}
// assignment operator:
Trk::RIO_OnTrack& Trk::RIO_OnTrack::operator=(const RIO_OnTrack& rot)
{
if ( &rot != this) {
Trk::MeasurementBase::operator=(rot);
m_identifier = rot.m_identifier;
}
return *this;
}
MsgStream& Trk::RIO_OnTrack::dump( MsgStream& sl ) const
{
sl << "Trk::RIO_OnTrack { "<< endreq;
sl << "\t identifier = "<< identify() << endreq;
sl << "\t position = ("
<< localParameters()
<< endreq;
sl << "\t has Error Matrix: "<< endreq;
sl<< localCovariance() <<"}"<< endreq;
if (prepRawData()!=0) {
sl<<"PrepRawData: "<< (*prepRawData()) << endreq;
}else{
sl<<"PrepRawData: NULL"<<endreq;
}
return sl;
}
std::ostream& Trk::RIO_OnTrack::dump( std::ostream& sl ) const
{
sl << "Trk::RIO_OnTrack { "<<std::endl;
sl << "\t identifier = "<< identify() << std::endl;
sl << "\t position = ("
<< localParameters()
<< std::endl;
sl << "\t has Error Matrix: " << std::endl;
sl << localCovariance() <<" }" << std::endl;
if (prepRawData()!=0) {
sl <<"PrepRawData: "<< (*prepRawData()) << std::endl;
}else{
sl<<"PrepRawData: NULL" << std::endl;
}
return sl;
}
unsigned int Trk::RIO_OnTrack::numberOfInstantiations()
{
return s_numberOfInstantiations;
}
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