ATLAS Offline Software
Loading...
Searching...
No Matches
TruthAccessors_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: TruthAccessors_v1.cxx 623284 2014-10-22 14:07:48Z krasznaa $
6
7// System include(s):
8#include <iostream>
9
10// Local include(s):
11#include "TruthAccessors_v1.h"
12
14#define DEFINE_ACCESSOR( PARENT, TYPE, NAME ) \
15 case PARENT::NAME: \
16 { \
17 static const SG::AuxElement::Accessor< TYPE > a( #NAME ); \
18 return &a; \
19 } \
20 break
21
22namespace xAOD {
23
26
27 switch( type ) {
28
29 DEFINE_ACCESSOR( TruthParticle_v1, float, polarizationTheta );
30 DEFINE_ACCESSOR( TruthParticle_v1, float, polarizationPhi );
31
32 default:
33 std::cerr << "xAOD::polarizationAccessorV1 ERROR Unknown PolParam ("
34 << type << ") requested" << std::endl;
35 return nullptr;
36 }
37
38 return nullptr;
39 }
40
43
44 switch( type ) {
45
46 DEFINE_ACCESSOR( TruthEvent_v1, int, PDGID1 );
47 DEFINE_ACCESSOR( TruthEvent_v1, int, PDGID2 );
48 DEFINE_ACCESSOR( TruthEvent_v1, int, PDFID1 );
49 DEFINE_ACCESSOR( TruthEvent_v1, int, PDFID2 );
50
51 default:
52 std::cerr << "xAOD::pdfInfoAccessorV1Int ERROR Unknown PdfParam ("
53 << type << ") requested" << std::endl;
54 return nullptr;
55 }
56
57 return nullptr;
58 }
59
62
63 switch( type ) {
64
65 DEFINE_ACCESSOR( TruthEvent_v1, float, X1 );
66 DEFINE_ACCESSOR( TruthEvent_v1, float, X2 );
67 DEFINE_ACCESSOR( TruthEvent_v1, float, Q );
68 DEFINE_ACCESSOR( TruthEvent_v1, float, XF1 );
69 DEFINE_ACCESSOR( TruthEvent_v1, float, XF2 );
70
71 default:
72 std::cerr << "xAOD::pdfInfoAccessorV1Float ERROR Unknown ParamDef ("
73 << type << ") requested" << std::endl;
74 return nullptr;
75 }
76
77 return nullptr;
78 }
79
82
83 switch( type ) {
84
85 DEFINE_ACCESSOR( TruthEvent_v1, int, NCOLLHARD );
86 DEFINE_ACCESSOR( TruthEvent_v1, int, NPARTPROJ );
87 DEFINE_ACCESSOR( TruthEvent_v1, int, NPARTTARG );
88 DEFINE_ACCESSOR( TruthEvent_v1, int, NCOLL );
89 DEFINE_ACCESSOR( TruthEvent_v1, int, SPECTATORNEUTRONS );
90 DEFINE_ACCESSOR( TruthEvent_v1, int, SPECTATORPROTONS );
91 DEFINE_ACCESSOR( TruthEvent_v1, int, NNWOUNDEDCOLLISIONS );
92 DEFINE_ACCESSOR( TruthEvent_v1, int, NWOUNDEDNCOLLISIONS );
93 DEFINE_ACCESSOR( TruthEvent_v1, int, NWOUNDEDNWOUNDEDCOLLISIONS );
94
95 default:
96 std::cerr << "xAOD::heavyIonAccessorV1Int ERROR Unknown HIParam ("
97 << type << ") requested" << std::endl;
98 return nullptr;
99 }
100
101 return nullptr;
102 }
103
106
107 switch( type ) {
108
109 DEFINE_ACCESSOR( TruthEvent_v1, float, IMPACTPARAMETER );
110 DEFINE_ACCESSOR( TruthEvent_v1, float, EVENTPLANEANGLE );
111 DEFINE_ACCESSOR( TruthEvent_v1, float, ECCENTRICITY );
112 DEFINE_ACCESSOR( TruthEvent_v1, float, SIGMAINELNN );
113 DEFINE_ACCESSOR( TruthEvent_v1, float, CENTRALITY );
114
115 default:
116 std::cerr << "xAOD::heavyIonAccessorV1Float ERROR Unknown HIParam ("
117 << type << ") requested" << std::endl;
118 return nullptr;
119 }
120
121 return nullptr;
122 }
123
124} // namespace xAOD
#define DEFINE_ACCESSOR(TYPE, NAME)
Helper macro for Accessor objects.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
Class describing a signal truth event in the MC record.
PdfParam
Accessor enums for PDF info parameter lookup.
HIParam
Heavy ion parameter enum.
Class describing a truth particle in the MC record.
PolParam
Polarization parameter types.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
const SG::AuxElement::Accessor< float > * polarizationAccessorV1(TruthParticle_v1::PolParam type)
This function holds on to Accessor objects that can be used by each TruthParticle_v1 object at runtim...
const SG::AuxElement::Accessor< int > * pdfInfoAccessorV1Int(TruthEvent_v1::PdfParam type)
Helper function for getting accessors for integer type PDF information.
const SG::AuxElement::Accessor< int > * heavyIonAccessorV1Int(TruthEvent_v1::HIParam type)
Helper function for getting accessors for integer type HI information.
const SG::AuxElement::Accessor< float > * pdfInfoAccessorV1Float(TruthEvent_v1::PdfParam type)
Helper function for getting accessors for floating point PDF information.
const SG::AuxElement::Accessor< float > * heavyIonAccessorV1Float(TruthEvent_v1::HIParam type)
Helper function for getting accessors for floating point HI information.