Commit 06b920d4 authored by John Derek Chapman's avatar John Derek Chapman Committed by Graeme Stewart
Browse files

src/McEventCollectionCnv_p5.cxx - clear Flow member variable of new transient...

src/McEventCollectionCnv_p5.cxx - clear Flow member variable of new transient GenParticle before filling it from the persistent information. Test fix for ATLASSIM-528. Tagged GeneratorObjectsTPCnv-00-06-03-01 (GeneratorObjectsTPCnv-00-06-03-01)
parent e8dc5447
<lcgdict>
<!-- T/P converter dictionaries: needed for ARA -->
<class name="ITPConverterFor<McEventCollection>"/>
<!-- version _p3 -->
<class name="T_TPCnv<McEventCollection,McEventCollection_p3>"/>
<class name="McEventCollectionCnv_p3"/>
<class name="T_AthenaPoolTPCnvBase<McEventCollection,McEventCollection_p3>"/>
<class name="T_AthenaPoolTPPolyCnvBase<McEventCollection,McEventCollection,McEventCollection_p3>"/>
<class name="T_AthenaPoolTPAbstractPolyCnvBase<McEventCollection,McEventCollection,McEventCollection_p3>"/>
<!-- version _p4 -->
<class name="T_TPCnv<McEventCollection,McEventCollection_p4>"/>
<class name="McEventCollectionCnv_p4"/>
<class name="T_AthenaPoolTPCnvBase<McEventCollection,McEventCollection_p4>"/>
<class name="T_AthenaPoolTPPolyCnvBase<McEventCollection,McEventCollection,McEventCollection_p4>"/>
<class name="T_AthenaPoolTPAbstractPolyCnvBase<McEventCollection,McEventCollection,McEventCollection_p4>"/>
<!-- version _p5 -->
<class name="T_TPCnv<McEventCollection,McEventCollection_p5>"/>
<class name="McEventCollectionCnv_p5"/>
<class name="T_AthenaPoolTPCnvBase<McEventCollection,McEventCollection_p5>"/>
<class name="T_AthenaPoolTPPolyCnvBase<McEventCollection,McEventCollection,McEventCollection_p5>"/>
<class name="T_AthenaPoolTPAbstractPolyCnvBase<McEventCollection,McEventCollection,McEventCollection_p5>"/>
</lcgdict>
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// GenEventCnv_p1.h
// Header file for class GenEventCnv_p1
// Author: S.Binet<binet@cern.ch>
///////////////////////////////////////////////////////////////////
#ifndef GENERATOROBJECTSTPCNV_GENEVENTCNV_P1_H
#define GENERATOROBJECTSTPCNV_GENEVENTCNV_P1_H
// STL includes
// SGTools includes
#include "SGTools/unordered_map.h" // move to STL once available
// AthenaPoolCnvSvc includes
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
// HepMC includes
#define private public
#define protected public
#include "HepMC/GenEvent.h"
#include "HepMC/GenVertex.h"
#include "HepMC/GenParticle.h"
#undef private
#undef protected
// GeneratorObjectsTPCnv includes
#include "GeneratorObjectsTPCnv/GenEvent_p1.h"
// Forward declaration
class MsgStream;
namespace HepMC { struct DataPool; }
class GenEventCnv_p1 : public T_AthenaPoolTPCnvBase<HepMC::GenEvent,
GenEvent_p1>
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
/** constructor:
*/
GenEventCnv_p1( HepMC::DataPool* pool = 0 );
/** Destructor:
*/
//virtual ~GenEventCnv_p1();
///////////////////////////////////////////////////////////////////
// Const methods:
///////////////////////////////////////////////////////////////////
/** Method creating the transient representation of @c HepMC::GenEvent
* from its persistent representation @c GenEvent_p1
*/
virtual void persToTrans( const GenEvent_p1* persObj,
HepMC::GenEvent* transObj,
MsgStream& msg );
/** Method creating the persistent representation @c GenEvent_p1
* from its transient representation @c HepMC::GenEvent
*/
virtual void transToPers( const HepMC::GenEvent* transObj,
GenEvent_p1* persObj,
MsgStream& msg );
///////////////////////////////////////////////////////////////////
// Non-const methods:
///////////////////////////////////////////////////////////////////
/// reset the @ HepMC::DataPool pointer
void setDataPool( HepMC::DataPool* pool );
///////////////////////////////////////////////////////////////////
// Protected methods:
///////////////////////////////////////////////////////////////////
protected:
typedef SG::unordered_map<HepMC::GenParticle*,int> ParticlesMap_t;
/** @brief Create a transient @c GenVertex from a persistent one (version 1)
* It returns the new @c GenVertex.
* This method calls @c createGenParticle for each of the out-going
* particles and only for the in-going particle which are orphans (no
* production vertex): for optimisation purposes.
* Note that the map being passed as an argument is to hold the association
* of barcodes to particle so that we can reconnect all the (non-orphan)
* particles to their decay vertex (if any).
*/
HepMC::GenVertex*
createGenVertex( const GenEvent_p1& persEvt,
const GenVertex_p1& vtx,
ParticlesMap_t& bcToPart ) const;
/** @brief Create a transient @c GenParticle from a persistent one (vers.1)
* It returns the new @c GenParticle. Note that the map being passed as an
* argument is to hold the association of barcodes to particle so that
* we can reconnect all the particles to their decay vertex (if any).
*/
HepMC::GenParticle*
createGenParticle( const GenParticle_p1& p,
ParticlesMap_t& partToEndVtx ) const;
///////////////////////////////////////////////////////////////////
// Protected data:
///////////////////////////////////////////////////////////////////
protected:
/// a PIMPL idiom to hide the DataPools (and their specialized destructors)
/// from the outside world
HepMC::DataPool* m_pool;
};
///////////////////////////////////////////////////////////////////
/// Inline methods:
///////////////////////////////////////////////////////////////////
#endif //> GENERATOROBJECTSTPCNV_GENEVENTCNV_P1_H
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// GenEvent_p1.h
// Header file for class GenEvent_p1
// Author: S.Binet<binet@cern.ch>
// Date: April 2006
///////////////////////////////////////////////////////////////////
#ifndef GENERATOROBJECTSTPCNV_GENEVENT_P1_H
#define GENERATOROBJECTSTPCNV_GENEVENT_P1_H
// STL includes
#include <vector>
#include <utility> //> for std::pair
// GeneratorObjectsTPCnv includes
#include "GeneratorObjectsTPCnv/GenVertex_p1.h"
#include "GeneratorObjectsTPCnv/GenParticle_p1.h"
// forward declarations
class GenEventCnv_p1;
class GenEvent_p1
{
///////////////////////////////////////////////////////////////////
// Friend classes
///////////////////////////////////////////////////////////////////
// Make the AthenaPoolCnv class our friend.
friend class GenEventCnv_p1;
///////////////////////////////////////////////////////////////////
// Public methods
///////////////////////////////////////////////////////////////////
public:
/** Default constructor
*/
GenEvent_p1();
///////////////////////////////////////////////////////////////////
// Protected data:
///////////////////////////////////////////////////////////////////
protected:
/** Id of the processus being generated
*/
int m_signalProcessId;
/** Event number
*/
int m_eventNbr;
/** Energy scale. see hep-ph/0109068
*/
double m_eventScale;
/** value of the QCD coupling. see hep-ph/0109068
*/
double m_alphaQCD;
/** value of the QED coupling. see hep-ph/0109068
*/
double m_alphaQED;
/** Barcode of the GenVertex holding the signal process.
* 0 means that no signal process vertex has been written out.
* This may come from upstream limitations (like HEPEVT)
*/
int m_signalProcessVtx;
/** Weights for this event.
* First weight is used by default for hit and miss.
*/
std::vector<double> m_weights;
/** Container of random numbers for the generator states
*/
std::vector<long int> m_randomStates;
/** Vector of vertices composing this event.
* The vertices are ordered by barcodes.
*/
std::vector<GenVertex_p1> m_vertices;
/** Vector of particles composing this event.
* The particles are ordered by barcodes.
*/
std::vector<GenParticle_p1> m_particles;
};
///////////////////////////////////////////////////////////////////
/// Inline methods:
///////////////////////////////////////////////////////////////////
inline GenEvent_p1::GenEvent_p1():
m_signalProcessId ( -1 ),
m_eventNbr ( -1 ),
m_eventScale ( -1 ),
m_alphaQCD ( -1 ),
m_alphaQED ( -1 ),
m_signalProcessVtx ( 0 ),
m_weights ( ),
m_randomStates ( ),
m_vertices ( ),
m_particles ( )
{}
#endif //> GENERATOROBJECTSTPCNV_GENEVENT_P1_H
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// GenEvent_p2.h
// Header file for class GenEvent_p2
// Author: S.Binet<binet@cern.ch>
// Date: October 2006
///////////////////////////////////////////////////////////////////
#ifndef GENERATOROBJECTSTPCNV_GENEVENT_P2_H
#define GENERATOROBJECTSTPCNV_GENEVENT_P2_H
// STL includes
#include <vector>
#include <utility> //> for std::pair
// forward declarations
class McEventCollectionCnv_p2;
class GenEvent_p2
{
///////////////////////////////////////////////////////////////////
// Friend classes
///////////////////////////////////////////////////////////////////
// Make the AthenaPoolCnv class our friend
friend class McEventCollectionCnv_p2;
///////////////////////////////////////////////////////////////////
// Public methods
///////////////////////////////////////////////////////////////////
public:
/** Default constructor
*/
GenEvent_p2();
/** Constructor with parameters
*/
GenEvent_p2( int signalProcessId,
int eventNbr,
double eventScale,
double alphaQCD,
double alphaQED,
int signalProcessVtx,
const std::vector<double>& weights,
const std::vector<long int>& randomStates,
unsigned int verticesBegin,
unsigned int verticesEnd,
unsigned int particlesBegin,
unsigned int particlesEnd );
///////////////////////////////////////////////////////////////////
// Const methods:
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// Protected data:
///////////////////////////////////////////////////////////////////
protected:
/** Id of the processus being generated
*/
int m_signalProcessId;
/** Event number
*/
int m_eventNbr;
/** Energy scale. see hep-ph/0109068
*/
double m_eventScale;
/** value of the QCD coupling. see hep-ph/0109068
*/
double m_alphaQCD;
/** value of the QED coupling. see hep-ph/0109068
*/
double m_alphaQED;
/** Barcode of the GenVertex holding the signal process.
* 0 means that no signal process vertex has been written out.
* This may come from upstream limitations (like HEPEVT)
*/
int m_signalProcessVtx;
/** Weights for this event.
* First weight is used by default for hit and miss.
*/
std::vector<double> m_weights;
/** Container of random numbers for the generator states
*/
std::vector<long int> m_randomStates;
/** Begin position in the vector of vertices composing this event.
*/
unsigned int m_verticesBegin;
/** End position in the vector of vertices composing this event.
*/
unsigned int m_verticesEnd;
/** Begin position in the vector of particles composing this event.
*/
unsigned int m_particlesBegin;
/** End position in the vector of particles composing this event.
*/
unsigned int m_particlesEnd;
};
///////////////////////////////////////////////////////////////////
/// Inline methods:
///////////////////////////////////////////////////////////////////
inline GenEvent_p2::GenEvent_p2():
m_signalProcessId ( -1 ),
m_eventNbr ( -1 ),
m_eventScale ( -1 ),
m_alphaQCD ( -1 ),
m_alphaQED ( -1 ),
m_signalProcessVtx ( 0 ),
m_weights ( ),
m_randomStates ( ),
m_verticesBegin ( 0 ),
m_verticesEnd ( 0 ),
m_particlesBegin ( 0 ),
m_particlesEnd ( 0 )
{}
inline GenEvent_p2::GenEvent_p2( int signalProcessId,
int eventNbr,
double eventScale,
double alphaQCD,
double alphaQED,
int signalProcessVtx,
const std::vector<double>& weights,
const std::vector<long int>& randomStates,
unsigned int verticesBegin,
unsigned int verticesEnd,
unsigned int particlesBegin,
unsigned int particlesEnd ) :
m_signalProcessId ( signalProcessId ),
m_eventNbr ( eventNbr ),
m_eventScale ( eventScale ),
m_alphaQCD ( alphaQCD ),
m_alphaQED ( alphaQED ),
m_signalProcessVtx ( signalProcessVtx ),
m_weights ( weights ),
m_randomStates ( randomStates ),
m_verticesBegin ( verticesBegin ),
m_verticesEnd ( verticesEnd ),
m_particlesBegin ( particlesBegin ),
m_particlesEnd ( particlesEnd )
{}
#endif //> GENERATOROBJECTSTPCNV_GENEVENT_P2_H
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// GenEvent_p2.h
// Header file for class GenEvent_p2
// Author: S.Binet<binet@cern.ch>
// Date: March 2007
///////////////////////////////////////////////////////////////////
#ifndef GENERATOROBJECTSTPCNV_GENEVENT_P3_H
#define GENERATOROBJECTSTPCNV_GENEVENT_P3_H
// STL includes
#include <vector>
#include <utility> //> for std::pair
// forward declarations
class McEventCollectionCnv_p3;
class GenEvent_p3
{
///////////////////////////////////////////////////////////////////
// Friend classes
///////////////////////////////////////////////////////////////////
// Make the AthenaPoolCnv class our friend
friend class McEventCollectionCnv_p3;
///////////////////////////////////////////////////////////////////
// Public methods
///////////////////////////////////////////////////////////////////
public:
/** Default constructor
*/
GenEvent_p3();
/** Constructor with parameters
*/
GenEvent_p3( int signalProcessId,
int eventNbr,
double eventScale,
double alphaQCD,
double alphaQED,
int signalProcessVtx,
const std::vector<double>& weights,
const std::vector<long int>& randomStates,
unsigned int verticesBegin,
unsigned int verticesEnd,
unsigned int particlesBegin,
unsigned int particlesEnd );
///////////////////////////////////////////////////////////////////
// Const methods:
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// Protected data:
///////////////////////////////////////////////////////////////////
protected:
/** Id of the processus being generated
*/
int m_signalProcessId;
/** Event number
*/
int m_eventNbr;
/** Energy scale. see hep-ph/0109068
*/
double m_eventScale;
/** value of the QCD coupling. see hep-ph/0109068
*/
double m_alphaQCD;
/** value of the QED coupling. see hep-ph/0109068
*/
double m_alphaQED;
/** Barcode of the GenVertex holding the signal process.
* 0 means that no signal process vertex has been written out.
* This may come from upstream limitations (like HEPEVT)
*/
int m_signalProcessVtx;
/** Weights for this event.
* First weight is used by default for hit and miss.
*/
std::vector<double> m_weights;
/** Container of random numbers for the generator states
*/
std::vector<long int> m_randomStates;
/** Begin position in the vector of vertices composing this event.
*/
unsigned int m_verticesBegin;
/** End position in the vector of vertices composing this event.
*/
unsigned int m_verticesEnd;
/** Begin position in the vector of particles composing this event.
*/
unsigned int m_particlesBegin;
/** End position in the vector of particles composing this event.
*/
unsigned int m_particlesEnd;
};
///////////////////////////////////////////////////////////////////
/// Inline methods:
///////////////////////////////////////////////////////////////////
inline GenEvent_p3::GenEvent_p3():
m_signalProcessId ( -1 ),
m_eventNbr ( -1 ),
m_eventScale ( -1 ),
m_alphaQCD ( -1 ),
m_alphaQED ( -1 ),
m_signalProcessVtx ( 0 ),
m_weights ( ),
m_randomStates ( ),
m_verticesBegin ( 0 ),
m_verticesEnd ( 0 ),
m_particlesBegin ( 0 ),
m_particlesEnd ( 0 )
{}
inline GenEvent_p3::GenEvent_p3( int signalProcessId,
int eventNbr,
double eventScale,
double alphaQCD,
double alphaQED,
int signalProcessVtx,
const std::vector<double>& weights,
const std::vector<long int>& randomStates,
unsigned int verticesBegin,
unsigned int verticesEnd,
unsigned int particlesBegin,
unsigned int particlesEnd ) :
m_signalProcessId ( signalProcessId ),
m_eventNbr ( eventNbr ),
m_eventScale ( eventScale ),
m_alphaQCD ( alphaQCD ),
m_alphaQED ( alphaQED ),
m_signalProcessVtx ( signalProcessVtx ),
m_weights ( weights ),
m_randomStates ( randomStates ),
m_verticesBegin ( verticesBegin ),
m_verticesEnd ( verticesEnd ),
m_particlesBegin ( particlesBegin ),
m_particlesEnd ( particlesEnd )
{}
#endif //> GENERATOROBJECTSTPCNV_GENEVENT_P3_H
///////////////////////// -*- C++ -*- /////////////////////////////