ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
JiveXML::TruthParticleRetriever Class Reference

#include <TruthParticleRetriever.h>

Inheritance diagram for JiveXML::TruthParticleRetriever:
Collaboration diagram for JiveXML::TruthParticleRetriever:

Public Member Functions

 TruthParticleRetriever (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor. More...
 
virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool)
 Retrieve all the data. More...
 
virtual std::string dataTypeName () const
 Return the name of the data type. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Return the interface identifier. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

const std::string m_typeName
 The data type that is generated by this retriever. More...
 
std::string m_sgKey
 properties: More...
 
int m_truthStatus
 
int m_truthMaximumPdgId
 
float m_truthPtCut
 
bool m_skimTruth
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 17 of file TruthParticleRetriever.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TruthParticleRetriever()

JiveXML::TruthParticleRetriever::TruthParticleRetriever ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard Constructor.

Definition at line 17 of file TruthParticleRetriever.cxx.

17  :
19  m_typeName("CompositeParticle")
20  {
21 
22  declareInterface<IDataRetriever>(this);
23 
24  declareProperty("StoreGateKey", m_sgKey = "SpclMC","StoreGate key for TruthParticles");
25  declareProperty("TruthStatus", m_truthStatus = 2,"Truth status cut, currently not applied"); // currently unused
26  declareProperty("TruthMaximumPdgId", m_truthMaximumPdgId = 40,
27  "Maximum Truth PDG-ID, default:< 40");
28  declareProperty("TruthPtCut", m_truthPtCut = 10.,"pT cut on Truth, default 10 GeV");
29  declareProperty("SkimTruth", m_skimTruth = true,"Some criteria to skim most important Truth info ");
30  }

Member Function Documentation

◆ dataTypeName()

virtual std::string JiveXML::TruthParticleRetriever::dataTypeName ( ) const
inlinevirtual

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 28 of file TruthParticleRetriever.h.

28 { return m_typeName; };

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & JiveXML::IDataRetriever::interfaceID ( )
inlinestaticinherited

Return the interface identifier.

Definition at line 40 of file IDataRetriever.h.

40 { return IID_IDataRetriever; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ retrieve()

StatusCode JiveXML::TruthParticleRetriever::retrieve ( ToolHandle< IFormatTool > &  FormatTool)
virtual

Retrieve all the data.

Implements JiveXML::IDataRetriever.

Definition at line 34 of file TruthParticleRetriever.cxx.

34  {
35 
36  const TruthParticleContainer *truthCont = NULL;
37 
38  if ( !evtStore()->contains<TruthParticleContainer>(m_sgKey)){
39  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No TruthParticle found in SG at "
40  << m_sgKey << endmsg;
41  return StatusCode::SUCCESS;
42  }
43  if ( evtStore()->retrieve(truthCont,m_sgKey).isFailure() ) {
44  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TruthParticle retrieval from SG failed "
45  << m_sgKey << endmsg;
46  return StatusCode::SUCCESS;
47  }
48  int nTruth = truthCont->size();
49 
50  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Retrieving TruthParticles with size " << nTruth << endmsg;
51 
52 //code from: PhysicsAnalysis/HiggsPhys/HiggsToFourLeptons/src/H4lElectronPerformanceTool.cxx
53 
54  DataVect pt; pt.reserve(nTruth);
55  DataVect phi; phi.reserve(nTruth);
56  DataVect eta; eta.reserve(nTruth);
57  DataVect typeEV; typeEV.reserve(nTruth);
58  DataVect label; label.reserve(nTruth);
59  DataVect typeLabelStr; typeLabelStr.reserve(nTruth);
60  DataVect pdgId; pdgId.reserve(nTruth);
61  DataVect dataType; dataType.reserve(nTruth);
62 
63  TruthParticleContainer::const_iterator mcpartItr = truthCont->begin();
64  TruthParticleContainer::const_iterator mcpartItrE = truthCont->end();
65 
66  std::string truthLabels;
67  std::string statusList="_";
68  std::string typeLabel="n_a";
69  int pdgId2;
70  int motherPdgId;
71  int childPdgId;
72  int countTruth = 1;
73  bool samePdgIdFlag = false;
74  bool initialProcessFlag = false;
75  bool protectedParticleFlag = false;
76 
77  for(; (mcpartItr != mcpartItrE) ; ++mcpartItr) { // loop over TruthParticle
78  samePdgIdFlag = false;
79  initialProcessFlag = false;
80  protectedParticleFlag = false;
81  statusList += std::to_string((*mcpartItr)->status()) + "_";
82 
83  if ( (*mcpartItr)->et()/CLHEP::GeV < m_truthPtCut ){ continue; }
84  if ( abs( (*mcpartItr)->pdgId()) > m_truthMaximumPdgId ){ continue; }
85 
86  pdgId2 = (*mcpartItr)->pdgId();
87 
88  // important particles are protected (can come from gamma etc)
89  if (( abs(pdgId2) == 24 ) || ( abs(pdgId2) == 5 ) ||
90  ( abs(pdgId2) == 6 ) || ( abs(pdgId2) == 23 ) ||
91  ( abs(pdgId2) == 36 ) || ( abs(pdgId2) == 37 ) ||
92  ( abs(pdgId2) == 25 ) ){
93  protectedParticleFlag = true;
94  }
95 
96  // particle has to originate from b,t,W,Z,H,A,H+- only
97  for ( unsigned int iMother = 0; iMother < (*mcpartItr)->nParents(); ++iMother ) {
98  bool motherHasPdgId = (*mcpartItr)->mother(iMother)->hasPdgId();
99  if ( motherHasPdgId ){
100  motherPdgId = (*mcpartItr)->mother(iMother)->pdgId();
101  if ( motherPdgId == pdgId2 ){ samePdgIdFlag = true; }
102  if (( abs(motherPdgId) == 24 ) || ( abs(motherPdgId) == 5 ) ||
103  ( abs(motherPdgId) == 6 ) || ( abs(motherPdgId) == 23 ) ||
104  ( abs(motherPdgId) == 36 ) || ( abs(motherPdgId) == 37 ) ||
105  ( abs(pdgId2) == 25 ) ){
106  initialProcessFlag = true;
107  }
108  }
109  }
110  // jump to next particle (ignore) if PdgId is same as mother
111  if (m_skimTruth){ // some skimming criteria for simpler display of Truth
112  if ( !initialProcessFlag && !protectedParticleFlag ){
113  // if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Particle rejected: not initial process " << endmsg;
114  continue;
115  }
116  }
117  if ( samePdgIdFlag ){
118  // if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Particle rejected: Same PdgId " << endmsg;
119  continue;
120  }
121 
122  pt.push_back( DataType((*mcpartItr)->et()/CLHEP::GeV ) );
123  phi.push_back( DataType((*mcpartItr)->phi() ) );
124  eta.push_back( DataType((*mcpartItr)->eta() ) );
125  dataType.push_back( DataType( (*mcpartItr)->dataType() ));
126 
127 // if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " TruthParticle No:" << countTruth << " pt:"
128 // << (*mcpartItr)->et()/CLHEP::GeV << endmsg;
129 
130  pdgId.push_back( DataType( pdgId2 ));
131 
132  typeLabel = "n_a";
133  if( abs(pdgId2) == 11) typeLabel = "Electron";
134  if( abs(pdgId2) == 12) typeLabel = "NeutrinoElectron";
135  if( abs(pdgId2) == 13) typeLabel = "Muon";
136  if( abs(pdgId2) == 14) typeLabel = "NeutrinoMuon";
137  if( abs(pdgId2) == 15) typeLabel = "Tau";
138  if( abs(pdgId2) == 16) typeLabel = "NeutrinoTau";
139  if( pdgId2 == 6) typeLabel = "Top";
140  if( pdgId2 == -6) typeLabel = "AntiTop";
141  if( pdgId2 == 5) typeLabel = "Bottom";
142  if( pdgId2 == -5) typeLabel = "AntiBottom";
143  if( pdgId2 == 22) typeLabel = "Photon";
144  if( pdgId2 == 23) typeLabel = "Z0";
145  if( pdgId2 == 224) typeLabel = "Wplus";
146  if( pdgId2 == -24) typeLabel = "Wminus";
147  if( pdgId2 == 36) typeLabel = "A0";
148  if( pdgId2 == 25) typeLabel = "Higgs0";
149  if(( abs(pdgId2) >= 1) && ( abs(pdgId2) <= 4)) typeLabel = "LightQuark";
150 
151  typeEV.push_back( DataType( typeLabel ) );
152 
153  truthLabels = "No" + DataType( countTruth ).toString() +"_Pdg="
154  + DataType( (*mcpartItr)->pdgId() ).toString()
155  + "_stat=" + DataType( (*mcpartItr)->status() ).toString()
156  + "_nParents=" + DataType( (*mcpartItr)->nParents() ).toString()
157  + "_nDecay=" + DataType( (*mcpartItr)->nDecay() ).toString();
158 
159  for ( unsigned int iChild = 0; iChild < (*mcpartItr)->nDecay(); ++iChild ) {
160  bool childHasPdgId = (*mcpartItr)->child(iChild)->hasPdgId();
161  if ( childHasPdgId ){
162  childPdgId = (*mcpartItr)->child(iChild)->pdgId();
163  truthLabels += "_CNo=" + DataType(iChild+1).toString() + "_CPdgId=" +
164  DataType( childPdgId ).toString() + "_CET=" +
165  DataType( (*mcpartItr)->child(iChild)->et()/CLHEP::GeV ).toString();
166  if ( (*mcpartItr)->child(iChild)->et()/CLHEP::GeV <= m_truthPtCut ){ continue; }
167  if (childPdgId == -11){
168  truthLabels += "_IntoElectron";
169  typeLabel += "_IntoElectron";
170  }
171  if (childPdgId == 11){
172  truthLabels += "_FromPositron";
173  typeLabel += "_FromPositron";
174  }
175  if (childPdgId == 13){
176  truthLabels += "_IntoMuonMinus";
177  typeLabel += "_IntoMuonMinus";
178  }
179  if (childPdgId == -13){
180  truthLabels += "_IntoMuonPlus";
181  typeLabel += "_IntoMuonPlus";
182  }
183  if (childPdgId == 15){
184  truthLabels += "_IntoTauMinus";
185  typeLabel += "_IntoTauMinus";
186  }
187  if (childPdgId == -15){
188  truthLabels += "_IntoTauPlus";
189  typeLabel += "_IntoTauPlus";
190  }
191  if (childPdgId == 5){
192  truthLabels += "_IntoBottom";
193  typeLabel += "_IntoBottom";
194  }
195  if (childPdgId == -5){
196  truthLabels += "_IntoAntiBottom";
197  typeLabel += "_IntoAntiBottom";
198  }
199  if (childPdgId == 6){
200  truthLabels += "_IntoTop";
201  typeLabel += "_IntoTop";
202  }
203  if (childPdgId == -6){
204  truthLabels += "_IntoAntiTop";
205  typeLabel += "_IntoAntiTop";
206  }
207  if ( ( abs(childPdgId) >= 1) && ( abs(childPdgId) <=4) ) {
208  truthLabels += "_IntoLightQuark";
209  typeLabel += "_IntoLightQuark";
210  }
211  if (childPdgId == -24){
212  truthLabels += "_IntoWminus";
213  typeLabel += "_IntoWminus";
214  }
215  if (childPdgId == 24){
216  truthLabels += "_IntoWplus";
217  typeLabel += "_IntoWplus";
218  }
219  if (childPdgId == 25){
220  truthLabels += "_IntoHiggs0";
221  typeLabel += "_IntoHiggs0";
222  }
223  if (childPdgId == 23){
224  truthLabels += "_IntoZ0";
225  typeLabel += "_IntoZ0";
226  }
227  }
228  }
229  for ( unsigned int iMother = 0; iMother < (*mcpartItr)->nParents(); ++iMother ) {
230  bool motherHasPdgId = (*mcpartItr)->mother(iMother)->hasPdgId();
231  if ( motherHasPdgId ){
232  int motherPdgId = (*mcpartItr)->mother(iMother)->pdgId();
233  truthLabels += "_MNo=" + DataType(iMother+1).toString() + "_MPdgId=" +
234  DataType( motherPdgId ).toString();
235  if ( (*mcpartItr)->mother(iMother)->et()/CLHEP::GeV <= m_truthPtCut ){ continue; }
236  if (motherPdgId == -24){
237  truthLabels += "_FromWminus";
238  typeLabel += "_FromWminus";
239  }
240  if (motherPdgId == 24){
241  truthLabels += "_FromWplus";
242  typeLabel += "_FromWplus";
243  }
244  if (motherPdgId == 25){
245  truthLabels += "_FromHiggs0";
246  typeLabel += "_FromHiggs0";
247  }
248  if (motherPdgId == 23){
249  truthLabels += "_FromZ0";
250  typeLabel += "_FromZ0";
251  }
252  if (motherPdgId == 6){
253  truthLabels += "_FromTop";
254  typeLabel += "_FromTop";
255  }
256  if (motherPdgId == -6){
257  truthLabels += "_FromAntiTop";
258  typeLabel += "_FromAntiTop";
259  }
260  if (motherPdgId == 5){
261  truthLabels += "_FromBottom";
262  typeLabel += "_FromBottom";
263  }
264  if (motherPdgId == -5){
265  truthLabels += "_FromAntiBottom";
266  typeLabel += "_FromAntiBottom";
267  }
268  if (motherPdgId == 36){
269  truthLabels += "_FromA0";
270  typeLabel += "_FromA0";
271  }
272  if (motherPdgId == 37){
273  truthLabels += "_FromHiggsPlus";
274  typeLabel += "_FromHiggsPlus";
275  }
276  if (motherPdgId == -37){
277  truthLabels += "_FromHiggsMinus";
278  typeLabel += "_FromHiggsMinus";
279  }
280  } // end of hasMotherPdgId
281  } // end of MotherParticle loop
282  countTruth++;
283  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TruthParticles label: " << DataType( truthLabels ).toString() << endmsg;
284  label.push_back( DataType( truthLabels ).toString() );
285  typeLabelStr.push_back( DataType( typeLabel ).toString() );
286 
287  // log << MSG::DEBUG << "TruthParticles status: " << statusList << endmsg;
288  } // end of TruthParticle Loop
289  DataMap myDataMap;
290  myDataMap["pt"] = pt;
291  myDataMap["phi"] = phi;
292  myDataMap["eta"] = eta;
293  myDataMap["typeEV"] = typeEV;
294 // myDataMap["label"] = label;
295  myDataMap["label"] = typeLabelStr;
296  myDataMap["pdgId"] = pdgId;
297  myDataMap["dataType"] = dataType;
298 
299  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << ": "<< phi.size() << endmsg;
300 
301  //forward data to formating tool
302  return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap);
303  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_sgKey

std::string JiveXML::TruthParticleRetriever::m_sgKey
private

properties:

Definition at line 36 of file TruthParticleRetriever.h.

◆ m_skimTruth

bool JiveXML::TruthParticleRetriever::m_skimTruth
private

Definition at line 40 of file TruthParticleRetriever.h.

◆ m_truthMaximumPdgId

int JiveXML::TruthParticleRetriever::m_truthMaximumPdgId
private

Definition at line 38 of file TruthParticleRetriever.h.

◆ m_truthPtCut

float JiveXML::TruthParticleRetriever::m_truthPtCut
private

Definition at line 39 of file TruthParticleRetriever.h.

◆ m_truthStatus

int JiveXML::TruthParticleRetriever::m_truthStatus
private

Definition at line 37 of file TruthParticleRetriever.h.

◆ m_typeName

const std::string JiveXML::TruthParticleRetriever::m_typeName
private

The data type that is generated by this retriever.

Definition at line 33 of file TruthParticleRetriever.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
JiveXML::TruthParticleRetriever::m_truthMaximumPdgId
int m_truthMaximumPdgId
Definition: TruthParticleRetriever.h:38
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
JiveXML::TruthParticleRetriever::m_typeName
const std::string m_typeName
The data type that is generated by this retriever.
Definition: TruthParticleRetriever.h:28
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
test_pyathena.pt
pt
Definition: test_pyathena.py:11
JiveXML::TruthParticleRetriever::m_sgKey
std::string m_sgKey
properties:
Definition: TruthParticleRetriever.h:36
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
JiveXML::TruthParticleRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition: TruthParticleRetriever.cxx:34
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
plotBeamSpotCompare.statusList
statusList
Definition: plotBeamSpotCompare.py:200
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
TruthParticleContainer
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticleContainer.h:42
PowhegPy8EG_H2a.pdgId
dictionary pdgId
Definition: PowhegPy8EG_H2a.py:128
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
test_pyathena.parent
parent
Definition: test_pyathena.py:15
JiveXML::TruthParticleRetriever::m_truthStatus
int m_truthStatus
Definition: TruthParticleRetriever.h:37
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
JiveXML::TruthParticleRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition: TruthParticleRetriever.h:28
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
JiveXML::TruthParticleRetriever::m_truthPtCut
float m_truthPtCut
Definition: TruthParticleRetriever.h:39
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
JiveXML::TruthParticleRetriever::m_skimTruth
bool m_skimTruth
Definition: TruthParticleRetriever.h:40
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528