ATLAS Offline Software
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 
22 namespace 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
xAOD::heavyIonAccessorV1Float
const SG::AuxElement::Accessor< float > * heavyIonAccessorV1Float(TruthEvent_v1::HIParam type)
Helper function for getting accessors for floating point HI information.
Definition: TruthAccessors_v1.cxx:105
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::TruthEvent_v1::PdfParam
PdfParam
Accessor enums for PDF info parameter lookup.
Definition: TruthEvent_v1.h:74
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
xAOD::TruthEvent_v1
Class describing a signal truth event in the MC record.
Definition: TruthEvent_v1.h:35
xAOD::pdfInfoAccessorV1Float
const SG::AuxElement::Accessor< float > * pdfInfoAccessorV1Float(TruthEvent_v1::PdfParam type)
Helper function for getting accessors for floating point PDF information.
Definition: TruthAccessors_v1.cxx:61
TruthAccessors_v1.h
DEFINE_ACCESSOR
#define DEFINE_ACCESSOR(PARENT, TYPE, NAME)
Helper macro for managing cluster moment Accessor objects.
Definition: TruthAccessors_v1.cxx:14
xAOD::pdfInfoAccessorV1Int
const SG::AuxElement::Accessor< int > * pdfInfoAccessorV1Int(TruthEvent_v1::PdfParam type)
Helper function for getting accessors for integer type PDF information.
Definition: TruthAccessors_v1.cxx:42
xAOD::heavyIonAccessorV1Int
const SG::AuxElement::Accessor< int > * heavyIonAccessorV1Int(TruthEvent_v1::HIParam type)
Helper function for getting accessors for integer type HI information.
Definition: TruthAccessors_v1.cxx:81
xAOD::polarizationAccessorV1
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...
Definition: TruthAccessors_v1.cxx:25
xAOD::TruthParticle_v1::PolParam
PolParam
Polarization parameter types.
Definition: TruthParticle_v1.h:321
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::TruthEvent_v1::HIParam
HIParam
Heavy ion parameter enum.
Definition: TruthEvent_v1.h:130