Commit c4f10f97 authored by Edward Moyse's avatar Edward Moyse Committed by Graeme Stewart
Browse files

'Changes from Anthony' (xAODTracking-00-10-00)

parent ed27be02
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// Local include(s):
#include "xAODTracking/versions/MeasurementStateOnSurfaceAuxContainer_v1.h"
namespace xAOD {
MeasurementStateOnSurfaceAuxContainer_v1::MeasurementStateOnSurfaceAuxContainer_v1()
: AuxContainerBase() {
AUX_VARIABLE( type );
AUX_VARIABLE( detElementId );
AUX_VARIABLE( detType );
AUX_VARIABLE( localX );
AUX_VARIABLE( localY );
AUX_VARIABLE( localTheta );
AUX_VARIABLE( localPhi );
AUX_VARIABLE( unbiasedResidualX );
AUX_VARIABLE( unbiasedResidualY );
AUX_VARIABLE( unbiasedPullX );
AUX_VARIABLE( unbiasedPullY );
AUX_VARIABLE( biasedResidualX );
AUX_VARIABLE( biasedResidualY );
AUX_VARIABLE( biasedPullX );
AUX_VARIABLE( biasedPullY );
AUX_VARIABLE( prepRawDataLink );
}
} // namespace xAOD
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: MeasurementStateOnSurface_v1.cxx 614432 2014-09-01 15:16:31Z htorres $
// EDM include(s):
#include "xAODCore/AuxStoreAccessorMacros.h"
// Local include(s):
#include "xAODTracking/versions/MeasurementStateOnSurface_v1.h"
namespace xAOD {
MeasurementStateOnSurface_v1::MeasurementStateOnSurface_v1()
: SG::AuxElement() {
}
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( MeasurementStateOnSurface_v1, char, type, setType)
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( MeasurementStateOnSurface_v1, uint64_t, detElementId, setDetElementId)
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( MeasurementStateOnSurface_v1, char, detType, setDetType)
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, localX )
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, localY )
void MeasurementStateOnSurface_v1::setLocalPosition(float localX, float localY) {
static Accessor< float > acc1( "localX" );
acc1( *this ) = localX;
static Accessor< float > acc2( "localY" );
acc2( *this ) = localY;
}
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, localTheta )
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, localPhi )
void MeasurementStateOnSurface_v1::setLocalAngles(float localTheta, float localPhi) {
static Accessor< float > acc1( "localTheta" );
acc1( *this ) = localTheta;
static Accessor< float > acc2( "localPhi" );
acc2( *this ) = localPhi;
}
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, unbiasedResidualX )
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, unbiasedResidualY )
void MeasurementStateOnSurface_v1::setUnbiasedResidual(float unbiasedResidualX, float unbiasedResidualY) {
static Accessor< float > acc1( "unbiasedResidualX" );
acc1( *this ) = unbiasedResidualX;
static Accessor< float > acc2( "unbiasedResidualY" );
acc2( *this ) = unbiasedResidualY;
}
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, unbiasedPullX )
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, unbiasedPullY )
void MeasurementStateOnSurface_v1::setUnbiasedPull(float unbiasedPullX, float unbiasedPullY) {
static Accessor< float > acc1( "unbiasedPullX" );
acc1( *this ) = unbiasedPullX;
static Accessor< float > acc2( "unbiasedPullY" );
acc2( *this ) = unbiasedPullY;
}
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, biasedResidualX )
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, biasedResidualY )
void MeasurementStateOnSurface_v1::setBiasedResidual(float biasedResidualX, float biasedResidualY) {
static Accessor< float > acc1( "biasedResidualX" );
acc1( *this ) = biasedResidualX;
static Accessor< float > acc2( "biasedResidualY" );
acc2( *this ) = biasedResidualY;
}
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, biasedPullX )
AUXSTORE_PRIMITIVE_GETTER( MeasurementStateOnSurface_v1, float, biasedPullY )
void MeasurementStateOnSurface_v1::setBiasedPull(float biasedPullX, float biasedPullY) {
static Accessor< float > acc1( "biasedPullX" );
acc1( *this ) = biasedPullX;
static Accessor< float > acc2( "biasedPullY" );
acc2( *this ) = biasedPullY;
}
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( MeasurementStateOnSurface_v1, ElementLink<xAOD::PrepRawDataContainer>, prepRawDataLink, setPrepRawDataLink)
// AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( MeasurementStateOnSurface_v1, ElementLink<xAOD::TrackParticle>, trackParticleLink, setTrackParticleLink)
} // namespace xAOD
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: NeutralParticleAuxContainer_v1.cxx 573493 2013-12-03 13:05:51Z emoyse $
// Local include(s):
#include "xAODTracking/versions/NeutralParticleAuxContainer_v1.h"
namespace xAOD {
NeutralParticleAuxContainer_v1::NeutralParticleAuxContainer_v1()
: AuxContainerBase() {
AUX_VARIABLE( d0 );
AUX_VARIABLE( z0 );
AUX_VARIABLE( phi );
AUX_VARIABLE( theta );
AUX_VARIABLE( oneOverP );
AUX_VARIABLE( definingParametersCovMatrix );
AUX_VARIABLE( vx );
AUX_VARIABLE( vy );
AUX_VARIABLE( vz );
}
void NeutralParticleAuxContainer_v1::dump() const {
std::cout<<" Dumping NeutralParticleAuxContainer_v1"<<std::endl;
std::cout<<"d0:";
std::copy(d0.begin(), d0.end(),
std::ostream_iterator<float>(std::cout, ", "));
std::cout<<"z0:";
std::copy(z0.begin(), z0.end(),
std::ostream_iterator<float>(std::cout, ", "));
std::cout<<"phi0:";
std::copy(phi.begin(), phi.end(),
std::ostream_iterator<float>(std::cout, ", "));
std::cout<<"theta0:";
std::copy(theta.begin(), theta.end(),
std::ostream_iterator<float>(std::cout, ", "));
std::cout<<"oneOverP:";
std::copy(oneOverP.begin(), oneOverP.end(),
std::ostream_iterator<float>(std::cout, ", "));
std::cout<<"definingParametersCovMatrix: ["<<&definingParametersCovMatrix<<"]";
for (unsigned int i=0; i<definingParametersCovMatrix.size();++i){
std::copy(definingParametersCovMatrix[i].begin(), definingParametersCovMatrix[i].end(),
std::ostream_iterator<float>(std::cout, ", "));
std::cout<<std::endl;
}
}
} // namespace xAOD
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: NeutralParticle_v1.cxx 573493 2013-12-03 13:05:51Z emoyse $
// Misc includes
#include <bitset>
#include <vector>
// EDM include(s):
#include "xAODCore/AuxStoreAccessorMacros.h"
// Local include(s):
#include "xAODTracking/versions/NeutralParticle_v1.h"
// #include "xAODTracking/VertexContainer.h" FIXME - need to get ELs working to vertices for neutrals - currently causes compilation failure EJWM
namespace xAOD {
NeutralParticle_v1::NeutralParticle_v1()
: IParticle(), m_p4(), m_p4Cached( false ), m_perigeeCached(false) {
#if ( ! defined(XAOD_STANDALONE) ) && ( ! defined(XAOD_MANACORE) )
m_perigeeParameters=0;
#endif // not XAOD_STANDALONE and not XAOD_MANACORE
}
NeutralParticle_v1::NeutralParticle_v1(const NeutralParticle_v1& tp )
: IParticle( tp ) {
makePrivateStore( tp );
#if ( ! defined(XAOD_STANDALONE) ) && ( ! defined(XAOD_MANACORE) )
m_perigeeParameters = tp.m_perigeeParameters;
#endif // not XAOD_STANDALONE and not XAOD_MANACORE
}
NeutralParticle_v1& NeutralParticle_v1::operator=(const NeutralParticle_v1& tp ){
if(this == &tp) return *this;
if(!hasStore() ) makePrivateStore();
this->IParticle::operator=( tp );
#if ( ! defined(XAOD_STANDALONE) ) && ( ! defined(XAOD_MANACORE) )
m_perigeeParameters = tp.m_perigeeParameters;
#endif // not XAOD_STANDALONE and not XAOD_MANACORE
return *this;
}
NeutralParticle_v1::~NeutralParticle_v1(){
#if ( ! defined(XAOD_STANDALONE) ) && ( ! defined(XAOD_MANACORE) )
delete m_perigeeParameters;
#endif // not XAOD_STANDALONE and not XAOD_MANACORE
}
double NeutralParticle_v1::pt() const {
return p4().Pt();
}
double NeutralParticle_v1::eta() const {
return p4().Eta();
}
AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(NeutralParticle_v1,float,double,phi)
double NeutralParticle_v1::m() const {
return p4().M();
}
AUXSTORE_PRIMITIVE_GETTER_WITH_CAST( NeutralParticle_v1, float, double, e)
double NeutralParticle_v1::rapidity() const {
return p4().Rapidity();
}
const NeutralParticle_v1::FourMom_t& NeutralParticle_v1::p4() const {
using namespace std;
// Check if we need to reset the cached object:
if( ! m_p4Cached ) {
float p = 1/fabs(oneOverP());
float thetaT = theta();
float phiT = phi();
float sinTheta= sin(thetaT);
float px = p*sinTheta*cos(phiT);
float py = p*sinTheta*sin(phiT);
float pz = p*cos(thetaT);
float e = pow (139.570,2) + /// @todo Get value from somewhere. Also, the TrackParticle took the Pion mass - do we really want to do this? We have ParticleHypo?
pow( px,2) + pow( py,2) + pow( pz,2);
m_p4.SetPxPyPzE( px, py, pz, sqrt(e) );
m_p4Cached = true;
}
// Return the cached object:
return m_p4;
}
Type::ObjectType NeutralParticle_v1::type() const {
return Type::NeutralParticle;
}
AUXSTORE_PRIMITIVE_GETTER(NeutralParticle_v1, float, d0)
AUXSTORE_PRIMITIVE_GETTER(NeutralParticle_v1, float, z0)
AUXSTORE_PRIMITIVE_GETTER(NeutralParticle_v1, float, phi0)
AUXSTORE_PRIMITIVE_GETTER(NeutralParticle_v1, float, theta)
AUXSTORE_PRIMITIVE_GETTER(NeutralParticle_v1, float, oneOverP)
const DefiningParameters_t& NeutralParticle_v1::definingParameters() const{
static DefiningParameters_t tmp;
tmp << d0(),z0(),phi0(),theta(),oneOverP();
return tmp;
}
void NeutralParticle_v1::setDefiningParameters(float d0, float z0, float phi0, float theta, float oneOverP) {
m_perigeeCached=false;
#if ( ! defined(XAOD_STANDALONE) ) && ( ! defined(XAOD_MANACORE) )
delete m_perigeeParameters;
m_perigeeParameters=0;
#endif // not XAOD_STANDALONE and not XAOD_MANACORE
static Accessor< float > acc1( "d0" );
acc1( *this ) = d0;
static Accessor< float > acc2( "z0" );
acc2( *this ) = z0;
static Accessor< float > acc3( "phi" );
acc3( *this ) = phi0;
static Accessor< float > acc4( "theta" );
acc4( *this ) = theta;
static Accessor< float > acc5( "oneOverP" );
acc5( *this ) = oneOverP;
m_p4Cached = false;
return;
}
void NeutralParticle_v1::setDefiningParametersCovMatrix(const xAOD::ParametersCovMatrix_t& cov){
m_perigeeCached=false;
#if ( ! defined(XAOD_STANDALONE) ) && ( ! defined(XAOD_MANACORE) )
delete m_perigeeParameters;
m_perigeeParameters=0;
#endif // not XAOD_STANDALONE and not XAOD_MANACORE
static Accessor< std::vector<float> > acc( "definingParametersCovMatrix" );
std::vector<float>& v = acc(*this);
v.reserve(15);
for (size_t irow = 0; irow<5; ++irow)
for (size_t icol =0; icol<=irow; ++icol)
v.push_back(cov(icol,irow));
}
const xAOD::ParametersCovMatrix_t& NeutralParticle_v1::definingParametersCovMatrix() const {
static Accessor< std::vector<float> > acc( "definingParametersCovMatrix" );
std::vector<float> v = acc(*this);
std::vector<float>::const_iterator it = v.begin();
static xAOD::ParametersCovMatrix_t cov; cov.setZero();
for (size_t irow = 0; irow<5; ++irow)
for (size_t icol =0; icol<=irow; ++icol)
cov.fillSymmetric(icol,irow, *it++);
return cov;
}
const std::vector<float>& NeutralParticle_v1::definingParametersCovMatrixVec() const {
static Accessor< std::vector<float> > acc( "definingParametersCovMatrix" );
return acc(*this);
}
void NeutralParticle_v1::setDefiningParametersCovMatrixVec(const std::vector<float>& cov){
static Accessor< std::vector<float> > acc( "definingParametersCovMatrix" );
acc(*this)=cov;
}
AUXSTORE_PRIMITIVE_GETTER(NeutralParticle_v1, float, vx)
AUXSTORE_PRIMITIVE_GETTER(NeutralParticle_v1, float, vy)
AUXSTORE_PRIMITIVE_GETTER(NeutralParticle_v1, float, vz)
void NeutralParticle_v1::setParametersOrigin(float x, float y, float z){
static Accessor< float > acc1( "vx" );
acc1( *this ) = x;
static Accessor< float > acc2( "vy" );
acc2( *this ) = y;
static Accessor< float > acc3( "vz" );
acc3( *this ) = z;
}
#if ( ! defined(XAOD_STANDALONE) ) && ( ! defined(XAOD_MANACORE) )
const Trk::NeutralPerigee& NeutralParticle_v1::perigeeParameters() const {
static Accessor< float > acc1( "d0" );
static Accessor< float > acc2( "z0" );
static Accessor< float > acc3( "phi" );
static Accessor< float > acc4( "theta" );
static Accessor< float > acc5( "oneOverP" );
static Accessor< std::vector<float> > acc6( "definingParametersCovMatrix" );
ParametersCovMatrix_t* cov = new ParametersCovMatrix_t;
cov->setZero();
auto it= acc6(*this).begin();
for (size_t irow = 0; irow<5; ++irow)
for (size_t icol =0; icol<=irow; ++icol)
cov->fillSymmetric(irow,icol,*it++) ;
m_perigeeParameters = new Trk::NeutralPerigee(acc1(*this),acc2(*this),acc3(*this),acc4(*this),acc5(*this),Trk::PerigeeSurface(Amg::Vector3D(vx(),vy(),vz())),cov);
return *m_perigeeParameters;
}
#endif // not XAOD_STANDALONE and not XAOD_MANACORE
// AUXSTORE_OBJECT_SETTER_AND_GETTER(NeutralParticle_v1, ElementLink< VertexContainer >, vertex, setVertex)
} // namespace xAOD
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "xAODTracking/ParticleCaloExtension.h"
namespace xAOD {
ParticleCaloExtension::ParticleCaloExtension( float charge, std::vector<std::vector<float> >&& parameters,
std::vector<std::vector<float> >&& parametersCovariance,
std::vector<int>&& identifiers ) :
m_charge(charge), m_parameters(parameters),m_parametersCovariance(parametersCovariance),m_identifiers(identifiers)
{
}
ParticleCaloExtension::~ParticleCaloExtension() {
}
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// Local include(s):
#include "xAODTracking/versions/PrepRawDataAuxContainer_v1.h"
namespace xAOD {
PrepRawDataAuxContainer_v1::PrepRawDataAuxContainer_v1()
: AuxContainerBase() {
AUX_VARIABLE( identifier );
AUX_VARIABLE( rdoIdentifierList );
AUX_VARIABLE( localX );
AUX_VARIABLE( localY );
AUX_VARIABLE( localXError );
AUX_VARIABLE( localYError );
AUX_VARIABLE( localXYCorrelation );
AUX_VARIABLE( globalX );
AUX_VARIABLE( globalY );
AUX_VARIABLE( globalZ );
}
} // namespace xAOD
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: PrepRawData_v1.cxx 609799 2014-08-01 14:58:09Z htorres $
// EDM include(s):
#include "xAODCore/AuxStoreAccessorMacros.h"
// Local include(s):
#include "xAODTracking/versions/PrepRawData_v1.h"
namespace xAOD {
PrepRawData_v1::PrepRawData_v1()
: SG::AuxElement() {
}
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( PrepRawData_v1, uint64_t, identifier, setIdentifier)
AUXSTORE_OBJECT_SETTER_AND_GETTER( PrepRawData_v1, std::vector< uint64_t >,
rdoIdentifierList,
setRdoIdentifierList )
AUXSTORE_PRIMITIVE_GETTER( PrepRawData_v1, float, localX )
AUXSTORE_PRIMITIVE_GETTER( PrepRawData_v1, float, localY )
AUXSTORE_PRIMITIVE_GETTER( PrepRawData_v1, float, localXError )
AUXSTORE_PRIMITIVE_GETTER( PrepRawData_v1, float, localYError )
AUXSTORE_PRIMITIVE_GETTER( PrepRawData_v1, float, localXYCorrelation )
void PrepRawData_v1::setLocalPosition(float localX, float localY) {
static Accessor< float > acc1( "localX" );
acc1( *this ) = localX;
static Accessor< float > acc2( "localY" );
acc2( *this ) = localY;
}
void PrepRawData_v1::setLocalPositionError(float localXError, float localYError, float localXYCorrelation) {
static Accessor< float > acc1( "localXError" );
acc1( *this ) = localXError;
static Accessor< float > acc2( "localYError" );
acc2( *this ) = localYError;
static Accessor< float > acc3( "localXYCorrelation" );
acc3( *this ) = localXYCorrelation;
}
AUXSTORE_PRIMITIVE_GETTER( PrepRawData_v1, float, globalX )
AUXSTORE_PRIMITIVE_GETTER( PrepRawData_v1, float, globalY )
AUXSTORE_PRIMITIVE_GETTER( PrepRawData_v1, float, globalZ )
void PrepRawData_v1::setGlobalPosition(float globalX, float globalY, float globalZ) {
static Accessor< float > acc1( "globalX" );
acc1( *this ) = globalX;
static Accessor< float > acc2( "globalY" );
acc2( *this ) = globalY;
static Accessor< float > acc3( "globalZ" );
acc3( *this ) = globalZ;
}
} // namespace xAOD
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TrackParticleAuxContainer_v1.cxx 574812 2013-12-10 12:33:55Z emoyse $
// Local include(s):
#include "xAODTracking/versions/TrackParticleAuxContainer_v1.h"
namespace xAOD {
TrackParticleAuxContainer_v1::TrackParticleAuxContainer_v1()
: AuxContainerBase() {
AUX_VARIABLE( d0 );
AUX_VARIABLE( z0 );
AUX_VARIABLE( phi );
AUX_VARIABLE( theta );
AUX_VARIABLE( qOverP );
AUX_VARIABLE( definingParametersCovMatrix );
AUX_VARIABLE( vx );
AUX_VARIABLE( vy );
AUX_VARIABLE( vz );
AUX_VARIABLE( parameterX );
AUX_VARIABLE( parameterY );
AUX_VARIABLE( parameterZ );
AUX_VARIABLE( parameterPX );
AUX_VARIABLE( parameterPY );
AUX_VARIABLE( parameterPZ );
// AUX_VARIABLE( charge );
AUX_VARIABLE( trackParameterCovarianceMatrices );
AUX_VARIABLE( parameterPosition );
AUX_VARIABLE( chiSquared );
AUX_VARIABLE( numberDoF );
AUX_VARIABLE( trackFitter );
AUX_VARIABLE( particleHypothesis );
AUX_VARIABLE( trackProperties );
AUX_VARIABLE( patternRecoInfo );
// TrackSummary information
#ifndef XAODTRACKPARTICLE_SUMMARYDYNAMIC
// uint8_ts
AUX_VARIABLE( numberOfContribPixelLayers );
AUX_VARIABLE( numberOfBLayerHits );
AUX_VARIABLE( numberOfBLayerOutliers );
AUX_VARIABLE( numberOfBLayerSharedHits );
AUX_VARIABLE( numberOfBLayerSplitHits );
AUX_VARIABLE( expectBLayerHit );
AUX_VARIABLE( numberOfPixelHits );
AUX_VARIABLE( numberOfPixelOutliers );
AUX_VARIABLE( numberOfPixelHoles );
AUX_VARIABLE( numberOfPixelSharedHits );
AUX_VARIABLE( numberOfPixelSplitHits );
AUX_VARIABLE( numberOfGangedPixels );
AUX_VARIABLE( numberOfGangedFlaggedFakes );
AUX_VARIABLE( numberOfPixelDeadSensors );
AUX_VARIABLE( numberOfPixelSpoiltHits );
AUX_VARIABLE( numberOfSCTHits );
AUX_VARIABLE( numberOfSCTOutliers );
AUX_VARIABLE( numberOfSCTHoles );
AUX_VARIABLE( numberOfSCTDoubleHoles );
AUX_VARIABLE( numberOfSCTSharedHits );
AUX_VARIABLE( numberOfSCTDeadSensors );
AUX_VARIABLE( numberOfSCTSpoiltHits );
AUX_VARIABLE( numberOfTRTHits );
AUX_VARIABLE( numberOfTRTOutliers );
AUX_VARIABLE( numberOfTRTHoles );
AUX_VARIABLE( numberOfTRTHighThresholdHits );
AUX_VARIABLE( numberOfTRTHighThresholdOutliers );
AUX_VARIABLE( numberOfTRTDeadStraws );
AUX_VARIABLE( numberOfTRTTubeHits );
AUX_VARIABLE( numberOfTRTXenonHits );
AUX_VARIABLE( numberOfPrecisionLayers );
AUX_VARIABLE( numberOfPrecisionHoleLayers );
AUX_VARIABLE( numberOfPhiLayers );
AUX_VARIABLE( numberOfPhiHoleLayers );
AUX_VARIABLE( numberOfTriggerEtaLayers );