|
ATLAS Offline Software
|
#include <TruthTrackBuilder.h>
|
| TruthTrackBuilder (const std::string &t, const std::string &n, const IInterface *p) |
| Constructor. More...
|
|
StatusCode | initialize () |
|
StatusCode | finalize () |
|
Track * | createTrack (const PRD_TruthTrajectory &prdTraj, SegmentCollection *segs=0) const |
| return a map of GenParticles to PRDs for further processing More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
ToolHandle< ITrackFitter > | m_trackFitter {this, "TrackFitter", ""} |
| fits the PRDs More...
|
|
ToolHandle< IExtrapolator > | m_extrapolator {this, "ExtrapolationTool", ""} |
| extrapolator More...
|
|
ToolHandle< IRIO_OnTrackCreator > | m_rotcreator {this, "RotCreatorTool", ""} |
|
ToolHandle< IRIO_OnTrackCreator > | m_rotcreatorbroad {this, "BroadRotCreatorTool", ""} |
|
const AtlasDetectorID * | m_DetID |
|
ServiceHandle< IPartPropSvc > | m_particlePropSvc |
| Pointer to the particle properties svc */
More...
|
|
const HepPDT::ParticleDataTable * | m_particleDataTable |
| ParticleDataTable needed to get connection pdg_code <-> charge */. More...
|
|
Gaudi::Property< size_t > | m_minNdof {this, "MinDegreesOfFreedom", 6} |
| checks min degrees of freedom if bigger -1 More...
|
|
Gaudi::Property< bool > | m_onlyPrimaries {this, "OnlyPrimaries", false} |
| restrict track creation to primaries More...
|
|
Gaudi::Property< unsigned int > | m_minSiHits {this, "MinSiHits", 7} |
| min number of Si hits for refit More...
|
|
Gaudi::Property< unsigned int > | m_minSiHitsForward {this, "MinSiHitsForward", 7} |
| min number of Si hits for refit in forward region (ITk specific) More...
|
|
Gaudi::Property< float > | m_forwardBoundary {this, "ForwardBoundary", 2.5} |
| Boundary eta value defining the forward region. More...
|
|
Gaudi::Property< int > | m_matEffects |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 41 of file TruthTrackBuilder.h.
◆ StoreGateSvc_t
◆ TruthTrackBuilder()
Trk::TruthTrackBuilder::TruthTrackBuilder |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
Constructor.
Definition at line 29 of file TruthTrackBuilder.cxx.
35 declareInterface<Trk::ITruthTrackBuilder>(
this);
◆ createTrack()
return a map of GenParticles to PRDs for further processing
< get the charge via the particle table ...
<
- Todo:
- : if we need a dedicated electron fitter is has to go in here !
< Refit a second time to add TRT hits
Implements Trk::ITruthTrackBuilder.
Definition at line 96 of file TruthTrackBuilder.cxx.
98 const EventContext& ctx = Gaudi::Hive::currentContext();
99 if( segs !=
nullptr ){
100 ATH_MSG_WARNING(
"Requested to fill segment collection but mode not implemented");
102 ATH_MSG_VERBOSE(
"The PRD Truth trajectory contains " << prdTraj.prds.size() <<
" PRDs.");
105 auto genPart = prdTraj.genParticle;
107 ATH_MSG_WARNING(
"No GenParticle associated to this PRD_TruthTrajectory. Ignoring track creation.");
110 ATH_MSG_VERBOSE(
"Got PRD Truth trajectory with " << prdTraj.nDoF <<
" degrees of freedom.");
116 genPart->production_vertex()->position().y(),
117 genPart->production_vertex()->position().z()) :
Amg::
Vector3D(0.,0.,0.);
119 genPart->momentum().y(),
120 genPart->momentum().z());
123 int pdgCode = genPart->pdg_id();
129 charge *= (pdgCode > 0.) ? 1. : -1.;
132 const std::vector<const Trk::PrepRawData*> &
clusters = prdTraj.prds;
137 auto per = std::unique_ptr<Trk::TrackParameters>(
145 ATH_MSG_DEBUG(
"Perigee creation for genParticle start position failed. "
146 "Skipping track creation.");
150 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
154 auto traj = std::make_unique<Trk::TrackStates>();
155 traj->push_back(pertsos);
159 std::unique_ptr<const Trk::TrackParameters> prevpar(startParams.uniqueClone());
165 if (surf==prevpar->associatedSurface())
continue;
169 auto thispar = std::unique_ptr<const Trk::TrackParameters>(
184 std::bitset<
Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
192 traj->push_back(tsos);
193 prevpar=std::move(thispar);
204 "Track does not fulfill requirements for refitting. Skipping it.");
220 if (refittedtrack && (
int)
clusters.size()-
i>=9){
223 std::vector<std::unique_ptr<MeasurementBase>> meassetOwn;
227 std::unique_ptr<const Trk::TrackParameters> prevpar(refittedtrack->
trackParameters()->back()->uniqueClone());
235 meassetOwn.emplace_back(rot);
236 measset.push_back(meassetOwn.back().get());
238 prevpar=std::move(thispar);
241 refittedtrack2=(
m_trackFitter->fit(Gaudi::Hive::currentContext(),*refittedtrack,measset,
false,materialInteractions)).
release();
243 if (!refittedtrack2){
244 auto traj2 = std::make_unique<Trk::TrackStates>();
246 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern2;
249 for (
auto & j : meassetOwn) {
260 }
else if(!refittedtrack){
261 ATH_MSG_VERBOSE(
"Track fit of truth trajectory NOT successful, NO track created. ");
265 if (refittedtrack2)
delete refittedtrack;
266 if (!refittedtrack2 && refittedtrack) refittedtrack2=refittedtrack;
269 ATH_MSG_DEBUG(
"Track fit of truth trajectory successful, track created. ");
275 return refittedtrack2;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode Trk::TruthTrackBuilder::finalize |
( |
| ) |
|
◆ initialize()
StatusCode Trk::TruthTrackBuilder::initialize |
( |
| ) |
|
Definition at line 40 of file TruthTrackBuilder.cxx.
45 return StatusCode::FAILURE;
50 return StatusCode::FAILURE;
56 return StatusCode::FAILURE;
62 return StatusCode::FAILURE;
69 return StatusCode::FAILURE;
76 ATH_MSG_ERROR(
"Could not get ParticleDataTable! Cannot associate pdg code with charge. Aborting. " );
77 return StatusCode::FAILURE;
83 return StatusCode::FAILURE;
85 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& Trk::ITruthTrackBuilder::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 39 of file ITruthTrackBuilder.h.
39 {
return IID_ITruthTrackBuilder; }
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_DetID
◆ m_detStore
◆ m_evtStore
◆ m_extrapolator
ToolHandle<IExtrapolator> Trk::TruthTrackBuilder::m_extrapolator {this, "ExtrapolationTool", ""} |
|
private |
◆ m_forwardBoundary
Gaudi::Property<float> Trk::TruthTrackBuilder::m_forwardBoundary {this, "ForwardBoundary", 2.5} |
|
private |
◆ m_matEffects
Gaudi::Property<int> Trk::TruthTrackBuilder::m_matEffects |
|
private |
Initial value:{this, "MatEffects", 3,
"Type of material interaction in extrapolation (Default Pion)"}
Definition at line 70 of file TruthTrackBuilder.h.
◆ m_minNdof
Gaudi::Property<size_t> Trk::TruthTrackBuilder::m_minNdof {this, "MinDegreesOfFreedom", 6} |
|
private |
◆ m_minSiHits
Gaudi::Property<unsigned int> Trk::TruthTrackBuilder::m_minSiHits {this, "MinSiHits", 7} |
|
private |
◆ m_minSiHitsForward
Gaudi::Property<unsigned int> Trk::TruthTrackBuilder::m_minSiHitsForward {this, "MinSiHitsForward", 7} |
|
private |
◆ m_onlyPrimaries
Gaudi::Property<bool> Trk::TruthTrackBuilder::m_onlyPrimaries {this, "OnlyPrimaries", false} |
|
private |
◆ m_particleDataTable
const HepPDT::ParticleDataTable* Trk::TruthTrackBuilder::m_particleDataTable |
|
private |
ParticleDataTable needed to get connection pdg_code <-> charge */.
Definition at line 62 of file TruthTrackBuilder.h.
◆ m_particlePropSvc
ServiceHandle<IPartPropSvc> Trk::TruthTrackBuilder::m_particlePropSvc |
|
private |
◆ m_rotcreator
ToolHandle< IRIO_OnTrackCreator > Trk::TruthTrackBuilder::m_rotcreator {this, "RotCreatorTool", ""} |
|
private |
◆ m_rotcreatorbroad
ToolHandle< IRIO_OnTrackCreator > Trk::TruthTrackBuilder::m_rotcreatorbroad {this, "BroadRotCreatorTool", ""} |
|
private |
◆ m_trackFitter
ToolHandle<ITrackFitter> Trk::TruthTrackBuilder::m_trackFitter {this, "TrackFitter", ""} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
bool is_pixel(Identifier id) const
Gaudi::Property< unsigned int > m_minSiHits
min number of Si hits for refit
Contains information about the 'fitter' of this track.
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
@ Pseudotracking
Pseudo-tracking flag.
Gaudi::Property< float > m_forwardBoundary
Boundary eta value defining the forward region.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Identifier identify(const UncalibratedMeasurement *meas)
Returns the associated identifier.
@ loc2
generic first and second local coordinate
bool is_trt(Identifier id) const
#define ATH_MSG_VERBOSE(x)
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Gaudi::Property< bool > m_onlyPrimaries
restrict track creation to primaries
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
ToolHandle< IExtrapolator > m_extrapolator
extrapolator
ServiceHandle< IPartPropSvc > m_particlePropSvc
Pointer to the particle properties svc */
Gaudi::Property< unsigned int > m_minSiHitsForward
min number of Si hits for refit in forward region (ITk specific)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
virtual void renounce()=0
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
Ensure that the ATLAS eigen extensions are properly loaded.
Definition of ATLAS Math & Geometry primitives (Amg)
represents the track state (measurement, material, fit parameters and quality) at a surface.
Gaudi::Property< size_t > m_minNdof
checks min degrees of freedom if bigger -1
std::unique_ptr< FitQuality > uniqueClone() const
NVI uniqueClone.
double charge(const T &p)
const HepPDT::ParticleDataTable * m_particleDataTable
ParticleDataTable needed to get connection pdg_code <-> charge */.
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
virtual methods to be overwritten by the inherited surfaces
Eigen::Matrix< double, 3, 1 > Vector3D
const AtlasDetectorID * m_DetID
ToolHandle< IRIO_OnTrackCreator > m_rotcreator
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
void setPatternRecognitionInfo(const TrackPatternRecoInfo &patternReco)
Method setting the pattern recognition algorithm.
ToolHandle< ITrackFitter > m_trackFitter
fits the PRDs
Gaudi::Property< int > m_matEffects
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ToolHandle< IRIO_OnTrackCreator > m_rotcreatorbroad