9#include "GaudiKernel/MsgStream.h"
23#define MSGLVL MSG::DEBUG
26#define ATH_MSG( MSG ) \
28 if( log.level() <= MSGLVL ) { \
29 log << MSGLVL << MSG << endmsg; \
40 MsgStream& log )
const {
43 ATH_MSG(
"Converting xAOD::TrackParticleAuxContainer_v1 to current version..." );
56 for(
size_t i = 0; i < oldObj->
size(); ++i ) {
59 oldInt.setStore( oldObj );
62 for(
size_t i = 0; i < newObj->
size(); ++i ) {
65 newInt.setStore( newObj );
69 uint8_t numberOfBLayerHits=0,numberOfBLayerSharedHits=0,numberOfBLayerOutliers=0,numberOfBLayerSplitHits=0,expectBLayerHit=0;
70 std::vector<float> covMatrixVec;
72 for(
size_t i = 0; i < oldInt.
size(); ++i ) {
75 x = oldInt[ i ]->parameterX(
index);
76 y = oldInt[ i ]->parameterY(
index);
77 newInt[ i ]->setRadiusOfFirstHit(std::sqrt(
x*
x +
y*
y));
79 ATH_MSG(
"Can't find first hit!" );
89 if( numberOfBLayerHitsAcc.
isAvailable( *( oldInt[ i ] ) ) ) {
91 numberOfBLayerHits = numberOfBLayerHitsAcc( *( oldInt[ i ] ) );
96 if( numberOfBLayerSharedHitsAcc.
isAvailable( *( oldInt[ i ] ) ) ) {
98 numberOfBLayerSharedHits = numberOfBLayerSharedHitsAcc( *( oldInt[ i ] ) );
103 if( numberOfBLayerOutliersAcc.
isAvailable( *( oldInt[ i ] ) ) ) {
105 numberOfBLayerOutliers = numberOfBLayerOutliersAcc( *( oldInt[ i ] ) );
110 if( numberOfBLayerSplitHitsAcc.
isAvailable( *( oldInt[ i ] ) ) ) {
112 numberOfBLayerSplitHits = numberOfBLayerSplitHitsAcc( *( oldInt[ i ] ) );
117 if( expectBLayerHitAcc.
isAvailable( *( oldInt[ i ] ) ) ) {
118 expectBLayerHit = expectBLayerHitAcc( *( oldInt[ i ] ) );
126 if( definingParametersCovMatrixAcc.
isAvailable( *( oldInt[ i ] ) ) ) {
128 covMatrixVec = definingParametersCovMatrixAcc( *( oldInt[ i ] ) );
129 if (!covMatrixVec.empty()) {
130 xAOD::ParametersCovMatrix_t cov;
131 Amg::expand( covMatrixVec.begin(), covMatrixVec.end(),cov );
132 newInt[ i ]->setDefiningParametersCovMatrix(cov);
142 ATH_MSG(
"Converting xAOD::TrackParticleAuxContainer_v1 to current version "
153 MsgStream& log )
const {
156 <<
"Somebody called xAODTrackParticleAuxContainerCnv_v1::transToPers"
158 throw std::runtime_error(
"Somebody called xAODTrackParticleAuxContainerCnv_v1::"
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
SG::ConstAccessor< T, ALLOC > ConstAccessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual void transToPers(const xAOD::TrackParticleAuxContainer *, xAOD::TrackParticleAuxContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
xAODTrackParticleAuxContainerCnv_v1()
Default constructor.
virtual void persToTrans(const xAOD::TrackParticleAuxContainer_v1 *oldObj, xAOD::TrackParticleAuxContainer *newObj, MsgStream &log) const override
Function converting from the old type to the current one.
virtual bool resize(size_t size) override
Resize the arrays to a given size.
virtual size_t size() const override
Get the size of the container.
Temporary container used until we have I/O for AuxStoreInternal.
Class describing a TrackParticle.
Helper to copy an aux store while applying thinning.
void expand(std::vector< float >::const_iterator it, std::vector< float >::const_iterator, AmgSymMatrix(N) &covMatrix)
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore ©, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
DataVector< xAOD::TrackParticle_v1 > TrackParticleContainer_v1
The container is a simple typedef for now.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
TrackParticleAuxContainer_v5 TrackParticleAuxContainer
Definition of the current TrackParticle auxiliary container.
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfInnermostPixelLayerSplitHits
number of Pixel 0th layer barrel hits split by cluster splitting
@ numberOfInnermostPixelLayerOutliers
number of 0th layer barrel outliers
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.