Skip to content
Snippets Groups Projects
Commit 167581cb authored by Roland Jansky's avatar Roland Jansky
Browse files

removing duplicate truth files

parent 03d551c7
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 1799 deletions
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TruthAccessors_v1.cxx 623284 2014-10-22 14:07:48Z krasznaa $
// System include(s):
#include <iostream>
// Local include(s):
#include "TruthAccessors_v1.h"
/// Helper macro for managing cluster moment Accessor objects
#define DEFINE_ACCESSOR( PARENT, TYPE, NAME ) \
case PARENT::NAME: \
{ \
static SG::AuxElement::Accessor< TYPE > a( #NAME ); \
return &a; \
} \
break
namespace xAOD {
SG::AuxElement::Accessor< float >*
polarizationAccessorV1( TruthParticle_v1::PolParam type ) {
switch( type ) {
DEFINE_ACCESSOR( TruthParticle_v1, float, polarizationTheta );
DEFINE_ACCESSOR( TruthParticle_v1, float, polarizationPhi );
default:
std::cerr << "xAOD::polarizationAccessorV1 ERROR Unknown PolParam ("
<< type << ") requested" << std::endl;
return 0;
}
return 0;
}
SG::AuxElement::Accessor< int >*
pdfInfoAccessorV1Int( TruthEvent_v1::PdfParam type ) {
switch( type ) {
DEFINE_ACCESSOR( TruthEvent_v1, int, PDGID1 );
DEFINE_ACCESSOR( TruthEvent_v1, int, PDGID2 );
DEFINE_ACCESSOR( TruthEvent_v1, int, PDFID1 );
DEFINE_ACCESSOR( TruthEvent_v1, int, PDFID2 );
default:
std::cerr << "xAOD::pdfInfoAccessorV1Int ERROR Unknown PdfParam ("
<< type << ") requested" << std::endl;
return 0;
}
return 0;
}
SG::AuxElement::Accessor< float >*
pdfInfoAccessorV1Float( TruthEvent_v1::PdfParam type ) {
switch( type ) {
DEFINE_ACCESSOR( TruthEvent_v1, float, X1 );
DEFINE_ACCESSOR( TruthEvent_v1, float, X2 );
DEFINE_ACCESSOR( TruthEvent_v1, float, Q );
DEFINE_ACCESSOR( TruthEvent_v1, float, XF1 );
DEFINE_ACCESSOR( TruthEvent_v1, float, XF2 );
default:
std::cerr << "xAOD::pdfInfoAccessorV1Float ERROR Unknown ParamDef ("
<< type << ") requested" << std::endl;
return 0;
}
return 0;
}
SG::AuxElement::Accessor< int >*
heavyIonAccessorV1Int( TruthEvent_v1::HIParam type ) {
switch( type ) {
DEFINE_ACCESSOR( TruthEvent_v1, int, NCOLLHARD );
DEFINE_ACCESSOR( TruthEvent_v1, int, NPARTPROJ );
DEFINE_ACCESSOR( TruthEvent_v1, int, NPARTTARG );
DEFINE_ACCESSOR( TruthEvent_v1, int, NCOLL );
DEFINE_ACCESSOR( TruthEvent_v1, int, SPECTATORNEUTRONS );
DEFINE_ACCESSOR( TruthEvent_v1, int, SPECTATORPROTONS );
DEFINE_ACCESSOR( TruthEvent_v1, int, NNWOUNDEDCOLLISIONS );
DEFINE_ACCESSOR( TruthEvent_v1, int, NWOUNDEDNCOLLISIONS );
DEFINE_ACCESSOR( TruthEvent_v1, int, NWOUNDEDNWOUNDEDCOLLISIONS );
default:
std::cerr << "xAOD::heavyIonAccessorV1Int ERROR Unknown HIParam ("
<< type << ") requested" << std::endl;
return 0;
}
return 0;
}
SG::AuxElement::Accessor< float >*
heavyIonAccessorV1Float( TruthEvent_v1::HIParam type ) {
switch( type ) {
DEFINE_ACCESSOR( TruthEvent_v1, float, IMPACTPARAMETER );
DEFINE_ACCESSOR( TruthEvent_v1, float, EVENTPLANEANGLE );
DEFINE_ACCESSOR( TruthEvent_v1, float, ECCENTRICITY );
DEFINE_ACCESSOR( TruthEvent_v1, float, SIGMAINELNN );
DEFINE_ACCESSOR( TruthEvent_v1, float, CENTRALITY );
default:
std::cerr << "xAOD::heavyIonAccessorV1Float ERROR Unknown HIParam ("
<< type << ") requested" << std::endl;
return 0;
}
return 0;
}
} // namespace xAOD
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TruthAccessors_v1.h 623284 2014-10-22 14:07:48Z krasznaa $
#ifndef XAODTRUTH_TRUTHACCESSORS_V1_H
#define XAODTRUTH_TRUTHACCESSORS_V1_H
// EDM include(s):
#include "AthContainers/AuxElement.h"
// Local include(s):
#include "xAODTruth/TruthEvent.h"
#include "xAODTruth/TruthParticle.h"
namespace xAOD {
/// This function holds on to Accessor objects that can be used by each
/// TruthParticle_v1 object at runtime to get/set parameter values on
/// themselves.
SG::AuxElement::Accessor< float >*
polarizationAccessorV1( TruthParticle_v1::PolParam type );
/// Helper function for getting accessors for integer type PDF information
SG::AuxElement::Accessor< int >*
pdfInfoAccessorV1Int( TruthEvent_v1::PdfParam type );
/// Helper function for getting accessors for floating point PDF information
SG::AuxElement::Accessor< float >*
pdfInfoAccessorV1Float( TruthEvent_v1::PdfParam type );
/// Helper function for getting accessors for integer type HI information
SG::AuxElement::Accessor< int >*
heavyIonAccessorV1Int( TruthEvent_v1::HIParam type );
/// Helper function for getting accessors for floating point HI information
SG::AuxElement::Accessor< float >*
heavyIonAccessorV1Float( TruthEvent_v1::HIParam type );
} // namespace xAOD
#endif // XAODTRUTH_TRUTHACCESSORS_V1_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
// Local include(s):
#include "xAODTruth/versions/TruthMetaDataAuxContainer_v1.h"
namespace xAOD {
TruthMetaDataAuxContainer_v1::TruthMetaDataAuxContainer_v1()
: AuxContainerBase() {
AUX_VARIABLE( weightNames );
AUX_VARIABLE( mcChannelNumber );
}
} // namespace xAOD
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
// xAOD include(s):
#include "xAODCore/AuxStoreAccessorMacros.h"
// Local include(s):
#include "xAODTruth/versions/TruthMetaData_v1.h"
namespace xAOD {
TruthMetaData_v1::TruthMetaData_v1(): SG::AuxElement() {}
//Arguments for MACRO are as follows: AUXSTORE_OBJECT/PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
AUXSTORE_OBJECT_SETTER_AND_GETTER(TruthMetaData_v1, std::vector < std::string >, weightNames, setWeightNames )
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TruthMetaData_v1, uint32_t, mcChannelNumber, setMcChannelNumber )
}
//
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TruthParticleAuxContainer_v1.cxx 622193 2014-10-16 16:08:34Z krasznaa $
// Local include(s):
#include "xAODTruth/versions/TruthParticleAuxContainer_v1.h"
namespace xAOD {
TruthParticleAuxContainer_v1::TruthParticleAuxContainer_v1()
: AuxContainerBase() {
AUX_VARIABLE( pdgId );
AUX_VARIABLE( barcode );
AUX_VARIABLE( status );
AUX_VARIABLE( prodVtxLink );
AUX_VARIABLE( decayVtxLink );
AUX_VARIABLE( px );
AUX_VARIABLE( py );
AUX_VARIABLE( pz );
AUX_VARIABLE( e );
AUX_VARIABLE( m );
}
} // namespace xAOD
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TruthParticle_v1.cxx 690336 2015-08-20 10:54:57Z abuckley $
// System include(s):
#include <cmath>
#include <iostream>
#include <stdexcept>
// Utility include(s):
#include "TruthUtils/PIDHelpers.h"
// xAOD include(s):
#include "xAODCore/AuxStoreAccessorMacros.h"
// Local include(s):
#include "xAODTruth/versions/TruthParticle_v1.h"
#include "xAODTruth/TruthVertexContainer.h"
#include "TruthAccessors_v1.h"
namespace xAOD {
TruthParticle_v1::TruthParticle_v1()
: IParticle(), m_p4(), m_p4Cached( false ) {
}
/////////////////////////////////////////////////////////////////////////////
//
// Implementation for functions identifying the particle in the MC record
//
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( TruthParticle_v1, int, pdgId,
setPdgId )
int TruthParticle_v1::absPdgId() const {
return std::abs( pdgId() );
}
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( TruthParticle_v1, int, barcode,
setBarcode )
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( TruthParticle_v1, int, status,
setStatus )
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// Implementation of the links to the vertices
//
/// Accessor for the production vertex
static SG::AuxElement::Accessor< ElementLink< TruthVertexContainer > >
prodVtxLinkAcc( "prodVtxLink" );
/// Accessor for the decay vertex
static SG::AuxElement::Accessor< ElementLink< TruthVertexContainer > >
decayVtxLinkAcc( "decayVtxLink" );
bool TruthParticle_v1::hasProdVtx() const {
return ( prodVtxLinkAcc.isAvailable( *this ) &&
prodVtxLinkAcc( *this ).isValid() );
}
const TruthVertex* TruthParticle_v1::prodVtx() const {
return hasProdVtx() ? *prodVtxLink() : 0;
}
AUXSTORE_OBJECT_SETTER_AND_GETTER( TruthParticle_v1,
ElementLink< TruthVertexContainer >,
prodVtxLink, setProdVtxLink )
bool TruthParticle_v1::hasDecayVtx() const {
return ( decayVtxLinkAcc.isAvailable( *this ) &&
decayVtxLinkAcc( *this ).isValid() );
}
const TruthVertex* TruthParticle_v1::decayVtx() const {
return hasDecayVtx() ? *decayVtxLink() : 0;
}
AUXSTORE_OBJECT_SETTER_AND_GETTER( TruthParticle_v1,
ElementLink< TruthVertexContainer >,
decayVtxLink, setDecayVtxLink )
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// Direct access to parents and children
//
size_t TruthParticle_v1::nParents() const {
return hasProdVtx() ? prodVtx()->nIncomingParticles() : 0;
}
const TruthParticle_v1* TruthParticle_v1::parent( size_t i ) const {
return hasProdVtx() ? prodVtx()->incomingParticle( i ) : 0;
}
size_t TruthParticle_v1::nChildren() const {
return hasDecayVtx() ? decayVtx()->nOutgoingParticles() : 0;
}
const TruthParticle_v1* TruthParticle_v1::child( size_t i ) const {
return hasDecayVtx() ? decayVtx()->outgoingParticle( i ) : 0;
}
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// Implementation of the IParticle interface
//
double TruthParticle_v1::pt() const {
// Do the calculation by hand:
const double localPx = static_cast< double >( px() );
const double localPy = static_cast< double >( py() );
return std::sqrt( localPx * localPx + localPy * localPy );
}
double TruthParticle_v1::eta() const {
// Calculate the pseudo-rapidity using TLorentzVector.
// Could do something more lightweight later on.
return p4().Eta();
}
double TruthParticle_v1::phi() const {
// Calculate the azimuth angle using TLorentzVector.
// Could do something more lightweight later on.
return p4().Phi();
}
AUXSTORE_PRIMITIVE_GETTER_WITH_CAST( TruthParticle_v1, float, double, m )
AUXSTORE_PRIMITIVE_GETTER_WITH_CAST( TruthParticle_v1, float, double, e )
double TruthParticle_v1::rapidity() const {
return p4().Rapidity();
}
const TruthParticle_v1::FourMom_t& TruthParticle_v1::p4() const {
// Cache the 4-momentum if it's not already:
if( ! m_p4Cached ) {
m_p4.SetPxPyPzE( px(), py(), pz(), e() );
m_p4Cached = true;
}
return m_p4;
}
Type::ObjectType TruthParticle_v1::type() const {
return Type::TruthParticle;
}
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// Implementation of the truth particle specific 4-momentum functions
//
double TruthParticle_v1::abseta() const {
return std::abs( eta() );
}
double TruthParticle_v1::absrapidity() const {
return std::abs( rapidity() );
}
AUXSTORE_PRIMITIVE_GETTER( TruthParticle_v1, float, px )
void TruthParticle_v1::setPx( float value ) {
static Accessor< float > acc( "px" );
m_p4Cached = false;
acc( *this ) = value;
return;
}
AUXSTORE_PRIMITIVE_GETTER( TruthParticle_v1, float, py )
void TruthParticle_v1::setPy( float value ) {
static Accessor< float > acc( "py" );
m_p4Cached = false;
acc( *this ) = value;
return;
}
AUXSTORE_PRIMITIVE_GETTER( TruthParticle_v1, float, pz )
void TruthParticle_v1::setPz( float value ) {
static Accessor< float > acc( "pz" );
m_p4Cached = false;
acc( *this ) = value;
return;
}
void TruthParticle_v1::setE( float value ) {
static Accessor< float > acc( "e" );
m_p4Cached = false;
acc( *this ) = value;
return;
}
void TruthParticle_v1::setM( float value ) {
static Accessor< float > acc( "m" );
// note: this does not invalidate the cache
acc( *this ) = value;
return;
}
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// Implementation of the particle species decoder functions
//
/// Helper macro to implement the functions that rely in functions from MC::PID
#define MC_PID_HELPER( TYPE, FNAME ) \
TYPE TruthParticle_v1::FNAME() const { \
return MC::PID::FNAME( pdgId() ); \
}
MC_PID_HELPER( double, charge )
MC_PID_HELPER( int, threeCharge )
MC_PID_HELPER( bool, isCharged )
MC_PID_HELPER( bool, isNeutral )
MC_PID_HELPER( bool, isPhoton )
MC_PID_HELPER( bool, isLepton )
MC_PID_HELPER( bool, isChLepton )
MC_PID_HELPER( bool, isElectron )
MC_PID_HELPER( bool, isMuon )
MC_PID_HELPER( bool, isTau )
MC_PID_HELPER( bool, isNeutrino )
MC_PID_HELPER( bool, isHadron )
MC_PID_HELPER( bool, isMeson )
MC_PID_HELPER( bool, isBaryon )
MC_PID_HELPER( bool, hasStrange )
MC_PID_HELPER( bool, hasCharm )
MC_PID_HELPER( bool, hasBottom )
MC_PID_HELPER( bool, isLightMeson )
MC_PID_HELPER( bool, isLightBaryon )
MC_PID_HELPER( bool, isLightHadron )
MC_PID_HELPER( bool, isHeavyMeson )
MC_PID_HELPER( bool, isHeavyBaryon )
MC_PID_HELPER( bool, isHeavyHadron )
MC_PID_HELPER( bool, isBottomMeson )
MC_PID_HELPER( bool, isBottomBaryon )
MC_PID_HELPER( bool, isBottomHadron )
MC_PID_HELPER( bool, isCharmMeson )
MC_PID_HELPER( bool, isCharmBaryon )
MC_PID_HELPER( bool, isCharmHadron )
MC_PID_HELPER( bool, isStrangeMeson )
MC_PID_HELPER( bool, isStrangeBaryon )
MC_PID_HELPER( bool, isStrangeHadron )
MC_PID_HELPER( bool, isQuark )
MC_PID_HELPER( bool, isParton )
MC_PID_HELPER( bool, isTop )
MC_PID_HELPER( bool, isW )
MC_PID_HELPER( bool, isZ )
MC_PID_HELPER( bool, isHiggs )
MC_PID_HELPER( bool, isResonance )
MC_PID_HELPER( bool, isGenSpecific )
// Forget about this macro:
#undef MC_PID_HELPER
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// Implementation of the optional polarization accessors
//
bool TruthParticle_v1::polarizationParameter( float& value,
PolParam param ) const {
// Get the accessor object:
Accessor< float >* acc = polarizationAccessorV1( param );
if( ! acc ) {
// The user asked for a non-existent parameter type. o.O
std::cerr << "xAOD::TruthParticle_v1::polarizationParameter ERROR "
<< "Request for an unknown (" << param << ") polarization "
<< "parameter type" << std::endl;
return false;
}
// Check if the variable is available:
if( ! acc->isAvailable( *this ) ) {
// No, it is not.
return false;
}
// Read the value:
value = ( *acc )( *this );
return true;
}
bool TruthParticle_v1::setPolarizationParameter( float value,
PolParam param ) {
// Get the accessor object:
Accessor< float >* acc = polarizationAccessorV1( param );
if( ! acc ) {
// The user asked for a non-existent parameter type. o.O
std::cerr << "xAOD::TruthParticle_v1::setPolarizationParameter ERROR "
<< "Request for an unknown (" << param << ") polarization "
<< "parameter type" << std::endl;
return false;
}
// Set the value:
( *acc )( *this ) = value;
return true;
}
float TruthParticle_v1::polarizationPatameter( PolParam param ) const {
// Get the accessor object:
Accessor< float >* acc = polarizationAccessorV1( param );
if( ! acc ) {
// Throw an exception:
throw std::runtime_error( "Unrecognized polarization parameter "
"requested" );
}
// Read the value:
return ( *acc )( *this );
}
TruthParticle_v1::Polarization TruthParticle_v1::polarization() const {
// Construct the object:
Polarization rtn;
polarizationParameter( rtn.phi, polarizationPhi );
polarizationParameter( rtn.theta, polarizationTheta );
return rtn;
}
//
/////////////////////////////////////////////////////////////////////////////
void TruthParticle_v1::toPersistent() {
if( prodVtxLinkAcc.isAvailableWritable( *this ) ) {
prodVtxLinkAcc( *this ).toPersistent();
}
if( decayVtxLinkAcc.isAvailableWritable( *this ) ) {
decayVtxLinkAcc( *this ).toPersistent();
}
return;
}
} // namespace xAOD
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TruthVertexAuxContainer_v1.cxx 624338 2014-10-27 15:08:55Z krasznaa $
// Local include(s):
#include "xAODTruth/versions/TruthVertexAuxContainer_v1.h"
namespace xAOD {
TruthVertexAuxContainer_v1::TruthVertexAuxContainer_v1()
: AuxContainerBase() {
AUX_VARIABLE( id );
AUX_VARIABLE( barcode );
AUX_VARIABLE( incomingParticleLinks );
AUX_VARIABLE( outgoingParticleLinks );
AUX_VARIABLE( x );
AUX_VARIABLE( y );
AUX_VARIABLE( z );
AUX_VARIABLE( t );
}
} // namespace xAOD
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TruthVertex_v1.cxx 624338 2014-10-27 15:08:55Z krasznaa $
// System include(s):
#include <cmath>
// xAOD include(s):
#include "xAODCore/AuxStoreAccessorMacros.h"
// Local include(s):
#include "xAODTruth/versions/TruthVertex_v1.h"
#include "xAODTruth/TruthParticleContainer.h"
namespace xAOD {
TruthVertex_v1::TruthVertex_v1()
: SG::AuxElement(), m_v4(), m_v4Cached( false ) {
}
/////////////////////////////////////////////////////////////////////////////
//
// Implementation for the "MC specific" functions
//
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( TruthVertex_v1, int, id, setId )
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( TruthVertex_v1, int, barcode,
setBarcode )
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// Implementation for the links to the truth particles
//
AUXSTORE_OBJECT_SETTER_AND_GETTER( TruthVertex_v1, TruthVertex_v1::TPLinks_t,
incomingParticleLinks,
setIncomingParticleLinks )
/// Accessor for the incoming particles
static SG::AuxElement::Accessor< TruthVertex_v1::TPLinks_t >
incomingParticleLinksAcc( "incomingParticleLinks" );
size_t TruthVertex_v1::nIncomingParticles() const {
// Check if the variable is available:
if( ! incomingParticleLinksAcc.isAvailable( *this ) ) {
// If not, just tell the user that there aren't any incoming particles:
return 0;
}
// Return the size of the vector:
return incomingParticleLinksAcc( *this ).size();
}
const TruthParticle* TruthVertex_v1::incomingParticle( size_t index ) const {
// Check that the variable exists, and that it has enough elements in it:
if( ( ! incomingParticleLinksAcc.isAvailable( *this ) ) ||
( incomingParticleLinksAcc( *this ).size() <= index ) ) {
return 0;
}
// Retrieve the link object and check its validity:
const TPLink_t& ipl = incomingParticleLinksAcc( *this )[ index ];
if( ! ipl.isValid() ) {
return 0;
}
// Finally, de-reference the link:
return *ipl;
}
void TruthVertex_v1::addIncomingParticleLink( const TPLink_t& link ) {
incomingParticleLinksAcc( *this ).push_back( link );
return;
}
void TruthVertex_v1::clearIncomingParticleLinks() {
incomingParticleLinksAcc( *this ).clear();
return;
}
AUXSTORE_OBJECT_SETTER_AND_GETTER( TruthVertex_v1, TruthVertex_v1::TPLinks_t,
outgoingParticleLinks,
setOutgoingParticleLinks )
/// Accessor for the outgoing particles
static SG::AuxElement::Accessor< TruthVertex_v1::TPLinks_t >
outgoingParticleLinksAcc( "outgoingParticleLinks" );
size_t TruthVertex_v1::nOutgoingParticles() const {
// Check if the variable is available:
if( ! outgoingParticleLinksAcc.isAvailable( *this ) ) {
// If not, just tell the user that there aren't any outgoing particles:
return 0;
}
// Return the size of the vector:
return outgoingParticleLinksAcc( *this ).size();
}
const TruthParticle* TruthVertex_v1::outgoingParticle( size_t index ) const {
// Check that the variable exists, and that it has enough elements in it:
if( ( ! outgoingParticleLinksAcc.isAvailable( *this ) ) ||
( outgoingParticleLinksAcc( *this ).size() <= index ) ) {
return 0;
}
// Retrieve the link object and check its validity:
const TPLink_t& opl = outgoingParticleLinksAcc( *this )[ index ];
if( ! opl.isValid() ) {
return 0;
}
// Finally, de-reference the link:
return *opl;
}
void TruthVertex_v1::addOutgoingParticleLink( const TPLink_t& link ) {
outgoingParticleLinksAcc( *this ).push_back( link );
return;
}
void TruthVertex_v1::clearOutgoingParticleLinks() {
outgoingParticleLinksAcc( *this ).clear();
return;
}
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// Implementation of the functions specifying the vertex's position
//
AUXSTORE_PRIMITIVE_GETTER( TruthVertex_v1, float, x )
void TruthVertex_v1::setX( float x ) {
static SG::AuxElement::Accessor< float > acc( "x" );
m_v4Cached = false;
acc( *this ) = x;
return;
}
AUXSTORE_PRIMITIVE_GETTER( TruthVertex_v1, float, y )
void TruthVertex_v1::setY( float y ) {
static SG::AuxElement::Accessor< float > acc( "y" );
m_v4Cached = false;
acc( *this ) = y;
return;
}
AUXSTORE_PRIMITIVE_GETTER( TruthVertex_v1, float, z )
void TruthVertex_v1::setZ( float z ) {
static SG::AuxElement::Accessor< float > acc( "z" );
m_v4Cached = false;
acc( *this ) = z;
return;
}
float TruthVertex_v1::perp() const {
// Do the calculation by hand. Could make it faster than this even in a
// future iteration...
return std::sqrt( x() * x() + y() * y() );
}
float TruthVertex_v1::eta() const {
// This is not necessarily what Andy was thinking about...
return v4().Eta();
}
float TruthVertex_v1::phi() const {
// This is not necessarily what Andy was thinking about...
return v4().Phi();
}
AUXSTORE_PRIMITIVE_GETTER( TruthVertex_v1, float, t )
void TruthVertex_v1::setT( float t ) {
static SG::AuxElement::Accessor< float > acc( "t" );
m_v4Cached = false;
acc( *this ) = t;
return;
}
const TruthVertex_v1::FourVec_t& TruthVertex_v1::v4() const {
// Cache the 4-vector if it's not already:
if( ! m_v4Cached ) {
m_v4.SetXYZT( x(), y(), z(), t() );
m_v4Cached = true;
}
// Return the cached object:
return m_v4;
}
//
/////////////////////////////////////////////////////////////////////////////
Type::ObjectType TruthVertex_v1::type() const {
return Type::TruthVertex;
}
void TruthVertex_v1::toPersistent() {
// Prepare the incoming particle links for persistification:
if( incomingParticleLinksAcc.isAvailableWritable( *this ) ) {
TPLinks_t::iterator itr = incomingParticleLinksAcc( *this ).begin();
TPLinks_t::iterator end = incomingParticleLinksAcc( *this ).end();
for( ; itr != end; ++itr ) {
itr->toPersistent();
}
}
// Prepare the outgoing particle links for persistification:
if( outgoingParticleLinksAcc.isAvailableWritable( *this ) ) {
TPLinks_t::iterator itr = outgoingParticleLinksAcc( *this ).begin();
TPLinks_t::iterator end = outgoingParticleLinksAcc( *this ).end();
for( ; itr != end; ++itr ) {
itr->toPersistent();
}
}
return;
}
} // namespace xAOD
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRUTH_TRUTHEVENTBASE_H
#define XAODTRUTH_TRUTHEVENTBASE_H
#include "xAODTruth/versions/TruthEventBase_v1.h"
namespace xAOD {
/// Typedef to implementation
typedef TruthEventBase_v1 TruthEventBase;
}
#endif
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TruthEventBaseContainer.h 622193 2014-10-16 16:08:34Z krasznaa $
#ifndef XAODTRUTH_TRUTHEVENTBASECONTAINER_H
#define XAODTRUTH_TRUTHEVENTBASECONTAINER_H
// Local include(s):
#include "xAODTruth/TruthEventBase.h"
#include "xAODTruth/versions/TruthEventBaseContainer_v1.h"
namespace xAOD {
/// Declare the latest version of the truth event container
typedef TruthEventBaseContainer_v1 TruthEventBaseContainer;
}
// Declare a CLID for the class for Athena:
#include "xAODCore/CLASS_DEF.h"
CLASS_DEF( xAOD::TruthEventBaseContainer, 1280408222, 1 )
#endif // XAODTRUTH_TRUTHEVENTBASECONTAINER_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRUTH_TRUTHMETADATA_H
#define XAODTRUTH_TRUTHMETADATA_H
#include "xAODTruth/versions/TruthMetaData_v1.h"
namespace xAOD {
/// Typedef to implementation
typedef TruthMetaData_v1 TruthMetaData;
}
#endif
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
#ifndef XAODTRUTH_TRUTHMETADATAAUXCONTAINER_H
#define XAODTRUTH_TRUTHMETADATAAUXCONTAINER_H
// Local include(s):
#include "xAODTruth/versions/TruthMetaDataAuxContainer_v1.h"
namespace xAOD {
/// Declare the latest version of the truth vertex auxiliary container
typedef TruthMetaDataAuxContainer_v1 TruthMetaDataAuxContainer;
}
// Declare a CLID for the class
#include "xAODCore/CLASS_DEF.h"
CLASS_DEF( xAOD::TruthMetaDataAuxContainer, 1094306618, 1 )
#endif // XAODTRUTH_TRUTHMETADATAAUXCONTAINER_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
#ifndef XAODTRUTH_TRUTHMETADATACONTAINER_H
#define XAODTRUTH_TRUTHMETADATACONTAINER_H
// Local include(s):
#include "xAODTruth/TruthMetaData.h"
#include "xAODTruth/versions/TruthMetaDataContainer_v1.h"
namespace xAOD {
/// Declare the latest version of the truth vertex container
typedef TruthMetaDataContainer_v1 TruthMetaDataContainer;
}
// Declare a CLID for the class for Athena:
#include "xAODCore/CLASS_DEF.h"
CLASS_DEF( xAOD::TruthMetaDataContainer, 1188015687, 1 )
#endif // XAODTRUTH_TRUTHMETADATACONTAINER_H
#ifndef XAODTRUTH_TRUTHEVENT_H
#define XAODTRUTH_TRUTHEVENT_H
// System include(s):
#include <utility>
#include <vector>
// EDM include(s):
#include "AthContainers/AuxElement.h"
#include "AthLinks/ElementLink.h"
#include "xAODBase/ObjectType.h"
// Local include(s):
#include "xAODTruth/TruthEventBase.h"
#include "xAODTruth/TruthParticleContainer.h"
#include "xAODTruth/TruthVertexContainer.h"
namespace xAOD {
/// Class describing a signal truth event in the MC record
///
class TruthEvent : public SG::AuxElement {
public:
/// Default constructor
TruthEvent();
/// Virtual destructor, to make vtable happy
virtual ~TruthEvent() {}
/// @name Access to all the particles associated with the event
/// @{
/// Type of a single truth particle link
typedef ElementLink< TruthParticleContainer > TruthParticleLink_t;
/// Type of the truth particle links vector
typedef std::vector< TruthParticleLink_t > TruthParticleLinks_t;
/// Get all the truth particles
const TruthParticleLinks_t& truthParticleLinks() const;
/// Set all the truth particles
void setTruthParticleLinks( const TruthParticleLinks_t& plinks );
/// Get the number of truth particles
size_t nTruthParticles() const;
/// Get the link to one of the truth particles
const TruthParticleLink_t& truthParticleLink( size_t index ) const;
/// Get a pointer to one of the truth particles
const TruthParticle* truthParticle( size_t index ) const;
/// Add one truth particle
void addTruthParticleLink( const TruthParticleLink_t& plink );
/// Remove all truth particles
void clearTruthParticleLinks();
/// @}
/// @name Access to all the vertices associated with the event
/// @{
/// Type of a single truth vertex link
typedef ElementLink< TruthVertexContainer > TruthVertexLink_t;
/// Type of the truth particle links vector
typedef std::vector< TruthVertexLink_t > TruthVertexLinks_t;
/// Get all the truth vertices
const TruthVertexLinks_t& truthVertexLinks() const;
/// Set all the truth vertices
void setTruthVertexLinks( const TruthVertexLinks_t& links );
/// Get the number of truth vertices
size_t nTruthVertices() const;
/// Get the link to one of the truth vertices
const TruthVertexLink_t& truthVertexLink( size_t index ) const;
/// Get a pointer to one of the truth vertices
const TruthVertex* truthVertex( size_t index ) const;
/// Add one truth vertex
void addTruthVertexLink( const TruthVertexLink_t& vlink );
/// Remove all truth vertices
void clearTruthVertexLinks();
/// @}
/// @name Simple event properties
/// @{
/// Const access to the weights vector
/// @todo Need to add the map-like interface for the weights: very important!
const std::vector< float >& weights() const;
/// Set the event weights
/// @todo Need to add named weight access: vector<string>
void setWeights( const std::vector< float >& weights );
/// Get the cross section
float crossSection() const;
/// Set the cross-section
void setCrossSection( float value );
/// Get the cross section error
float crossSectionError() const;
/// Set the cross-section error
void setCrossSectionError( float value );
/// Set the cross-section and its error
void setCrossSection( float value, float error );
/// @}
/// @name Parton density info
///
/// Optional due to particle gun & NLO events where a single PDF info
/// doesn't work.
///
/// @{
/// Accessor enums for PDF info parameter lookup
enum PdfParam {
PDGID1 = 0, ///< [int]
PDGID2 = 1, ///< [int]
PDFID1 = 2, ///< [int]
PDFID2 = 3, ///< [int]
X1 = 4, ///< [float]
X2 = 5, ///< [float]
SCALE = 6, ///< Not implemented!!!
Q = 6, ///< [float]
PDF1 = 7, ///< Not implemented!!!
PDF2 = 8, ///< Not implemented!!!
XF1 = 7, ///< [float]
XF2 = 8 ///< [float]
}; // enum PdfParam
/// Read an integer PDF info parameter
bool pdfInfoParameter( int& value, PdfParam parameter ) const;
/// Read a floating point PDF info parameter
bool pdfInfoParameter( float& value, PdfParam parameter ) const;
/// Set an integer PDF info parameter
bool setPdfInfoParameter( int value, PdfParam parameter );
/// Set a floating point PDF info parameter
bool setPdfInfoParameter( float value, PdfParam parameter );
/// Helper struct holding a full set of PDF info values
struct PdfInfo {
/// Constructor to set (invalid) defaults
PdfInfo();
/// Check if all the variables in the object are valid
bool valid() const;
int pdgId1;
int pdgId2;
int pdfId1;
int pdfId2;
float x1;
float x2;
float Q;
float xf1;
float xf2;
}; // struct PdfInfo
/// Retrieve a full PdfInfo with a single call
/// @note May have invalid values -- use valid() to check.
PdfInfo pdfInfo() const;
/// @}
/// @name Links to particles and vertices in the event
/// @{
/// Pointer to a vertex representing the primary interaction point
///
/// The naming of the function is a bit misleading. The returned vertex
/// can only be interpreted as an interaction *position*.
///
const TruthVertex* signalProcessVertex() const;
/// Link to the vertex representing the primary interaction point
const TruthVertexLink_t& signalProcessVertexLink() const;
/// Set pointer to a vertex representing the primary interaction point
void setSignalProcessVertexLink( const TruthVertexLink_t& link );
/// Get the link to the first incoming primary particle
const TruthParticleLink_t& primaryParticleLink() const;
/// Set one incoming primary particle
void setPrimaryParticleLink( const TruthParticleLink_t& pcl );
/// @}
/// The type of the object as a simple enumeration
virtual Type::ObjectType type() const;
/// Function making sure that the object is ready for persistification
void toPersistent();
}; // class TruthEvent
} // namespace xAOD
// Declare the base class of TruthEvent to StoreGate:
#include "xAODCore/BaseInfo.h"
SG_BASE( xAOD::TruthEvent, SG::AuxElement );
#endif // XAODTRUTH_TRUTHEVENT_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
#ifndef XAODTRUTH_VERSIONS_TRUTHMETADATAAUXCONTAINER_V1_H
#define XAODTRUTH_VERSIONS_TRUTHMETADATAAUXCONTAINER_V1_H
// System include(s):
#include <vector>
// EDM include(s):
#include "AthLinks/ElementLink.h"
#include "xAODCore/AuxContainerBase.h"
// Local include(s):
#include "xAODTruth/TruthParticleContainer.h"
namespace xAOD {
/// Auxiliary store for the truth meta data
///
/// @author Tobias Bisanz <tobias.bisanz@cern.ch>
///
/// $Revision$
/// $Date$
///
class TruthMetaDataAuxContainer_v1 : public AuxContainerBase {
public:
/// Default constructor
TruthMetaDataAuxContainer_v1();
private:
//Two vectors (of vectors) to store association between weight name and weight
//index. No std::map is used for increased read-back speed in ROOT
std::vector < std::vector < std::string > > weightNames;
std::vector < uint32_t > mcChannelNumber;
}; // class TruthMetaDataAuxContainer_v1
} // namespace xAOD
// StoreGate registration
#include "xAODCore/BaseInfo.h"
SG_BASE( xAOD::TruthMetaDataAuxContainer_v1, xAOD::AuxContainerBase );
#endif // XAODTRUTH_VERSIONS_TRUTHMETADATAAUXCONTAINER_V1_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
#ifndef XAODTRUTH_VERSIONS_TRUTHMETADATACONTAINER_V1_H
#define XAODTRUTH_VERSIONS_TRUTHMETADATACONTAINER_V1_H
// EDM include(s):
#include "AthContainers/DataVector.h"
// Local include(s):
#include "xAODTruth/versions/TruthMetaData_v1.h"
namespace xAOD {
// Alias
typedef DataVector< TruthMetaData_v1 > TruthMetaDataContainer_v1;
}
#endif // XAODTRUTH_VERSIONS_TRUTHMETADATACONTAINER_V1_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
#ifndef XAODTRUTH_VERSIONS_TRUTHMETADATA_V1_H
#define XAODTRUTH_VERSIONS_TRUTHMETADATA_V1_H
// EDM include(s):
#include "AthContainers/AuxElement.h"
#include "AthLinks/ElementLink.h"
// xAOD include(s):
#include "xAODBase/ObjectType.h"
namespace xAOD {
/// Class describing meta data for truth records
///
///
/// @author Tobias Bisanz <tobias.bisanz@cern.ch>
///
/// $Revision$
/// $Date$
///
class TruthMetaData_v1 : public SG::AuxElement {
public:
/// Default constructor
TruthMetaData_v1();
/// @name Simple truth meta data properties
/// @{
uint32_t mcChannelNumber() const;
void setMcChannelNumber( uint32_t value );
const std::vector< std::string >& weightNames() const;
void setWeightNames( const std::vector< std::string >& value );
/// @}
private:
}; // class TruthMetaData_v1
} // namespace xAOD
// Declare the inheritance of the type to StoreGate:
#include "xAODCore/BaseInfo.h"
SG_BASE( xAOD::TruthMetaData_v1, SG::AuxElement );
#endif // XAODTRUTH_VERSIONS_TRUTHMETADATA_V1_H
// -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRUTH_VERSIONS_TRUTHPARTICLEAUXCONTAINER_V1_H
#define XAODTRUTH_VERSIONS_TRUTHPARTICLEAUXCONTAINER_V1_H
#include <vector>
#include "AthLinks/ElementLink.h"
#include "xAODCore/AuxContainerBase.h"
#include "xAODTruth/TruthParticleContainer.h"
#include "xAODTruth/TruthVertexContainer.h"
namespace xAOD {
/// Auxiliary store for the truth vertices
///
/// @author Andy Buckley <Andy.Buckey@cern.ch>
/// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
/// @author Jovan Mitrevski <Jovan.Mitrevski@cern.h>
///
class TruthParticleAuxContainer_v1 : public AuxContainerBase {
public:
/// Default constructor
TruthParticleAuxContainer_v1();
private:
std::vector< int > pdgId;
std::vector< int > barcode;
std::vector< int > status;
std::vector< ElementLink< TruthVertexContainer > > prodVtxLink;
std::vector< ElementLink< TruthVertexContainer > > decayVtxLink;
std::vector< float > px;
std::vector< float > py;
std::vector< float > pz;
std::vector< float > e;
std::vector< float > m; // needed since not necessarily on shell
}; // class TruthParticleAuxContainer_v1
} // namespace xAOD
// StoreGate registration
#include "xAODCore/BaseInfo.h"
SG_BASE( xAOD::TruthParticleAuxContainer_v1, xAOD::AuxContainerBase );
#endif // XAODTRUTH_VERSIONS_TRUTHPARTICLEAUXCONTAINER_V1_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TruthParticleContainer_v1.h 622193 2014-10-16 16:08:34Z krasznaa $
#ifndef XAODTRUTH_VERSIONS_TRUTHPARTICLECONTAINER_V1_H
#define XAODTRUTH_VERSIONS_TRUTHPARTICLECONTAINER_V1_H
// EDM include(s):
#include "AthContainers/DataVector.h"
#include "xAODBase/IParticleContainer.h"
// Local include(s):
#include "xAODTruth/versions/TruthParticle_v1.h"
#include "xAODTruth/TruthParticleContainerFwd.h" // Only as long as this is the most recent version...
namespace xAOD {
// Alias
typedef DataVector< TruthParticle_v1 > TruthParticleContainer_v1;
}
#endif // XAODTRUTH_VERSIONS_TRUTHPARTICLECONTAINER_V1_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TruthParticle_v1.h 624338 2014-10-27 15:08:55Z krasznaa $
#ifndef XAODTRUTH_VERSIONS_TRUTHPARTICLE_V1_H
#define XAODTRUTH_VERSIONS_TRUTHPARTICLE_V1_H
// EDM include(s):
#include "AthLinks/ElementLink.h"
// xAOD include(s):
#include "xAODBase/IParticle.h"
#include "xAODBase/ObjectType.h"
// Local include(s):
#include "xAODTruth/TruthVertexContainerFwd.h"
namespace xAOD {
/// Class describing a truth particle in the MC record
///
/// The xAOD truth record mimicks the structure of HepMC. Truth particles
/// and truth vertices form a decay tree. Where each truth particle is
/// connected to a single production and decay vertex. And each vertex is
/// connected to one or more incoming, and one or more outgoing particles.
///
/// @author Andy Buckley <Andy.Buckley@cern.ch>
/// @author Jovan Mitrevski <Jovan.Mitrevski@cern.ch>
///
/// $Revision: 624338 $
/// $Date: 2014-10-27 16:08:55 +0100 (Mon, 27 Oct 2014) $
///
class TruthParticle_v1 : public IParticle {
public:
/// Default constructor
TruthParticle_v1();
/// @name Functions identifying the particle in the MC record
/// @{
/// Set PDG ID code
void setPdgId( int pid );
/// PDG ID code
int pdgId() const;
/// Absolute PDG ID code (often useful)
int absPdgId() const;
/// Barcode
/// @note Meaning of barcode may change -- be careful!
int barcode() const;
/// Set barcode
void setBarcode( int value );
/// Status code
int status() const;
/// Set status code
void setStatus( int value );
/// @}
/// @name Links to the production and decay vertices
/// @{
/// Check for a production vertex on this particle
bool hasProdVtx() const;
/// The production vertex of this particle
const TruthVertex_v1* prodVtx() const;
/// The production vertex link of this particle
const ElementLink< TruthVertexContainer >& prodVtxLink() const;
/// Set the production vertex of the particle
void setProdVtxLink( const ElementLink< TruthVertexContainer >& link );
/// Check for a decay vertex on this particle
bool hasDecayVtx() const;
/// The decay vertex of this particle
const TruthVertex_v1* decayVtx() const;
/// The decay vertex link of this particle
const ElementLink< TruthVertexContainer >& decayVtxLink() const;
/// Set the decay vertex of the particle
void setDecayVtxLink( const ElementLink< TruthVertexContainer >& link );
/// @}
/// @name Particle connection / origin / decay information
/// @{
/// Number of parents of this particle
size_t nParents() const;
/// Retrieve the i-th mother (TruthParticle) of this TruthParticle
const TruthParticle_v1* parent( size_t i = 0 ) const;
/// Number of children of this particle
size_t nChildren() const;
/// Retrieve the i-th mother (TruthParticle) of this TruthParticle
const TruthParticle_v1* child( size_t i = 0 ) const;
/// @todo Add mappings of e.g. isPrimary, isDecayed, isPrompt,
/// isFromDecay, hasHadronicDecay, hasLeptonicDecay,
/// isHadronic/LeptonicTau ...
/// @todo Add isFirstWith, isLastWith
/// @}
/// @name Functions implementing the xAOD::IParticle interface
/// @{
/// The transverse momentum (\f$p_T\f$) of the particle
virtual double pt() const;
/// The pseudorapidity (\f$\eta\f$) of the particle
virtual double eta() const;
/// The azimuthal angle (\f$\phi\f$) of the particle
virtual double phi() const;
/// The mass of the particle
///
/// Note, not necessarily = \f$E^2-p^2\f$ if not on mass shell.
///
virtual double m() const;
/// The total energy of the particle
virtual double e() const;
/// The true rapidity (\f$y\f$) of the particle
virtual double rapidity() const;
/// Definition of the 4-momentum type
typedef IParticle::FourMom_t FourMom_t;
/// The full 4-momentum of the particle
///
/// Note that m may not be right, though, if not on mass shell. In which
/// case <code>p4().M()</code> will be different from <code>m()</code>.
///
virtual const FourMom_t& p4() const;
/// The type of the object as a simple enumeration
virtual Type::ObjectType type() const;
/// @}
/// @name 4-momentum accessors specific to truth particles
/// @{
/// The absolute pseudorapidity (\f$|\eta|\f$) of the particle
/// @todo Remove this when/if supported in xAOD::IParticle
double abseta() const;
/// The true absolute rapidity (\f$|y|\f$) of the particle
/// @todo Remove this when/if supported in xAOD::IParticle
double absrapidity() const;
/// The x component of the particle's momentum
float px() const;
/// Set the x component of the particle's momentum
void setPx( float value );
/// The y component of the particle's momentum
float py() const;
/// Set the y component of the particle's momentum
void setPy( float value );
/// The z component of the particle's momentum
float pz() const;
/// Set the z component of the particle's momentum
void setPz( float value );
/// Set the energy of the particle
void setE( float value );
/// Also store the mass
void setM( float value );
/// @}
/// @name Particle species information
///
/// Just convenience methods here, since they all just forward to the
/// utility functions operating on the PDG particle ID code.
///
/// @{
/// Physical charge
double charge() const;
/// 3 x the physical charge (so it can be an int for quarks)
int threeCharge() const;
/// Whether the particle is electrically charged
bool isCharged() const;
/// Whether the particle is electrically neutral
bool isNeutral() const;
/// Whether the particle is a photon
bool isPhoton() const;
/// Whether the particle is a lepton
bool isLepton() const;
/// Whether the particle is a charged lepton
bool isChLepton() const;
/// Whether the particle is an electron (or positron)
bool isElectron() const;
/// Whether the particle is a muon (or antimuon)
bool isMuon() const;
/// Whether the particle is a tau (or antitau)
bool isTau() const;
/// Whether the particle is a neutrino (or antineutrino)
bool isNeutrino() const;
/// Whether the particle is a hadron
bool isHadron() const;
/// Whether the particle is a meson
bool isMeson() const;
/// Whether the particle is a baryon
bool isBaryon() const;
/// Whether the particle contains a strange quark (or antiquark)
bool hasStrange() const;
/// Whether the particle contains a charm quark (or antiquark)
bool hasCharm() const;
/// Whether the particle contains a bottom quark (or antiquark)
bool hasBottom() const;
/// Determine if the PID is that of a light flavour (not b or c) meson
bool isLightMeson() const;
/// Determine if the PID is that of a light flavour (not b or c) baryon
bool isLightBaryon() const;
/// Determine if the PID is that of a light flavour (not b or c) hadron
bool isLightHadron() const;
/// Determine if the PID is that of a heavy flavour (b or c) meson
bool isHeavyMeson() const;
/// Determine if the PID is that of a heavy flavour (b or c) baryon
bool isHeavyBaryon() const;
/// Determine if the PID is that of a heavy flavour (b or c) hadron
bool isHeavyHadron() const;
/// Determine if the PID is that of a b-meson.
bool isBottomMeson() const;
/// Determine if the PID is that of a b-baryon.
bool isBottomBaryon() const;
/// Determine if the PID is that of a b-hadron.
bool isBottomHadron() const;
/// @brief Determine if the PID is that of a c-meson.
///
/// Specifically, the _heaviest_ quark is a c: a B_c is a b-meson and NOT
/// a c-meson. Charmonia (closed charm) are counted as c-mesons here.
///
bool isCharmMeson() const;
/// @brief Determine if the PID is that of a c-baryon.
///
/// Specifically, the _heaviest_ quark is a c: a baryon containing a b & c
/// is a b-baryon and NOT a c-baryon. To test for the simpler case, just
/// use a combination of hasCharm() and isBaryon().
///
bool isCharmBaryon() const;
/// Determine if the PID is that of a c-hadron.
bool isCharmHadron() const;
/// Determine if the PID is that of a strange meson
bool isStrangeMeson() const;
/// Determine if the PID is that of a strange baryon
bool isStrangeBaryon() const;
/// Determine if the PID is that of a strange hadron
bool isStrangeHadron() const;
/// Check if this particle is a quark
bool isQuark() const;
/// Check if this particle is a parton
bool isParton() const;
/// Check if this particle is a top quark
bool isTop() const;
/// Check if this particle is a W boson
bool isW() const;
/// Check if this particle is a Z boson
bool isZ() const;
/// Check if this particle is a Higgs boson
bool isHiggs() const;
/// Check if this particle is a resonant state
bool isResonance() const;
/// Check if this is a generator specific (non-physical) particle
bool isGenSpecific() const;
/// @}
/// @name Polarization properties (optional)
/// @{
/// Polarization parameter types
enum PolParam {
polarizationPhi = 0, ///< Polarization in (\f$\phi\f$)
polarizationTheta = 1 ///< Polarization in (\f$\theta\f$)
};
/// Accessor for polarization parameters
///
/// Generic C++ code should use this function to retrieve the polarization
/// parameters of a truth particle. Since these parameters are optional,
/// the function is designed to tell the user whether the requested
/// parameter could be retrieved or not.
///
/// @param value The polarization parameter value read from the object
/// @param parameter The polarization parameter that we are interested in
/// @return <code>true</code> if the retrieval was successful,
/// <code>false</code> if it wasn't
///
bool polarizationParameter( float& value, PolParam parameter ) const;
/// Set method for polarization parameter values
///
/// In order to keep the symmetry with the getter function, this setter
/// communicates a possible failure in its operation through a return
/// value. Setting a polariozation parameter is much less likely to fail
/// than retrieving one, but in some situations it may still happen...
///
/// @param value The polarization parameter value to set on the object
/// @param parameter The polarization parameter type that we want to set
/// @return <code>true</code> if the operation was successful, or
/// <code>false</code> if it wasn't
///
bool setPolarizationParameter( float value, PolParam parameter );
/// Convenience accessor for a polariozation parameter.
///
/// Throws an exception if the request can't be completed. It should
/// mostly be used in PyROOT, as the other form of this function is very
/// hard to use there. But one needs to know for sure that the requested
/// parameter will exist.
///
/// @param parameter The polarion parameter that we are interested in
/// @return The value of the polarization parameter requested
///
float polarizationPatameter( PolParam parameter ) const;
/// Single container for full polarization information
///
/// It can be used as a convenient way for accessing the polarization of
/// the particle with a single call.
///
struct Polarization {
/// Constructor to set (invalid) defaults
/// @todo Use C++11 inline member init when allowed
Polarization()
: phi( -1.0 ), theta( -1.0 ) {}
/// Check if the stored values are valid
bool valid() const {
return ( ( phi > 0.0 ) && ( theta > 0.0 ) );
}
float phi; ///< Polarization in (\f$\phi\f$)
float theta; ///< Polarization in (\f$\theta\f$)
}; // struct Polarization
/// Retrieve a full Polarization with a single call
///
/// @note May have invalid values -- use valid() to check.
///
/// @return An object holding the full polarization information
///
Polarization polarization() const;
/// @}
/// Function making sure that the object is ready for persistification
void toPersistent();
private:
/// Cached four momentum
mutable FourMom_t m_p4;
/// Flag specifying if the four-momentum is cached
mutable bool m_p4Cached;
}; // class TruthParticle_v1
} // namespace xAOD
#endif // XAODTRUTH_VERSIONS_TRUTHPARTICLE_V1_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment