Commit 5afd9d74 authored by Nicholas Styles's avatar Nicholas Styles Committed by Graeme Stewart
Browse files

First try factorising out Sim Hits (InDetEventTPCnv-01-04-00)

	* First try factorising out Sim Hits (go into InDetSimEventTPCnv)
	* Tag as InDetEventTPCnv-01-04-00
parent b095b7da
......@@ -14,13 +14,6 @@
#include "InDetEventTPCnv/InDetTrack_tlp1.h"
#include "InDetEventTPCnv/InDetTrack_tlp2.h"
#include "InDetEventTPCnv/PixelClusterContainer_tlp1.h"
#include "InDetEventTPCnv/InDetHits/SiHit_p1.h"
#include "InDetEventTPCnv/InDetHits/SiHitCollection_p1.h"
#include "InDetEventTPCnv/InDetHits/SiHitCollection_p2.h"
#include "InDetEventTPCnv/InDetHits/TRT_Hit_p1.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollection_p1.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollection_p2.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollection_p3.h"
#include "InDetEventTPCnv/InDetPrepRawData/SiCluster_p1.h"
#include "InDetEventTPCnv/InDetPrepRawData/InDetPRD_Collection_p1.h"
#include "InDetEventTPCnv/InDetPrepRawData/InDetPRD_Container_p1.h"
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SIHITCNV_P1_H
#define SIHITCNV_P1_H
/*
Transient/Persistent converter for SiHit class
Author: Davide Costanzo
*/
#include "InDetSimEvent/SiHit.h"
#include "SiHit_p1.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
class MsgStream;
class SiHitCnv_p1 : public T_AthenaPoolTPCnvBase<SiHit, SiHit_p1>
{
public:
SiHitCnv_p1() {}
virtual void persToTrans(const SiHit_p1* persObj, SiHit*
transObj, MsgStream &log);
virtual void transToPers(const SiHit* transObj, SiHit_p1*
persObj, MsgStream &log);
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#define private public
#include "SiHitCollection_p1.h"
#undef private
#include "InDetSimEvent/SiHitCollection.h"
#include "SiHitCnv_p1.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
typedef T_AtlasHitsVectorCnv< SiHitCollection, SiHitCollection_p1, SiHitCnv_p1 > SiHitCollectionCnv_p1;
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SIHITCOLLECTIONCNV_P2_H
#define SIHITCOLLECTIONCNV_P2_H
// SiHitCollectionCnv_p2, T/P separation of Si Hits
// author D.Costanzo <davide.costanzo@cern.ch>
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
#include "InDetSimEvent/SiHitCollection.h"
#include "SiHitCollection_p2.h"
class SiHitCollectionCnv_p2 : public T_AthenaPoolTPCnvBase<SiHitCollection, SiHitCollection_p2>
{
public:
SiHitCollectionCnv_p2() {};
virtual SiHitCollection* createTransient(const SiHitCollection_p2* persObj, MsgStream &log);
virtual void persToTrans(const SiHitCollection_p2* persCont,
SiHitCollection* transCont,
MsgStream &log) ;
virtual void transToPers(const SiHitCollection* transCont,
SiHitCollection_p2* persCont,
MsgStream &log) ;
private:
static const double m_persEneUnit;
static const double m_persLenUnit;
static const double m_persAngUnit;
static const double m_2bHalfMaximum;
static const int m_2bMaximum;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SIHITCOLLECTION_P1_H
#define SIHITCOLLECTION_P1_H
/*
Persistent represenation of a SiHitContainer,
Author: Davide Costanzo
*/
#include <vector>
#include <string>
#include "SiHit_p1.h"
class SiHitCollection_p1
{
public:
/// typedefs
typedef std::vector<SiHit_p1> HitVector;
typedef HitVector::const_iterator const_iterator;
typedef HitVector::iterator iterator;
/// Default constructor
SiHitCollection_p1 ();
// Accessors
const std::string& name() const;
const HitVector& getVector() const;
private:
std::vector<SiHit_p1> m_cont;
std::string m_name;
};
// inlines
inline
SiHitCollection_p1::SiHitCollection_p1 () {}
inline
const std::string&
SiHitCollection_p1::name() const
{return m_name;}
inline
const std::vector<SiHit_p1>&
SiHitCollection_p1::getVector() const
{return m_cont;}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SIHITCOLLECTION_P2_H
#define SIHITCOLLECTION_P2_H
/*
Authors: Davide Costanzo Rob Duxfield
*/
#include <vector>
#include <string>
class SiHitCollection_p2
{
public:
/// Default constructor
SiHitCollection_p2 ();
private:
std::vector<float> m_hit1_meanTime; // 1 element per string
std::vector<float> m_hit1_x0; //
std::vector<float> m_hit1_y0; //
std::vector<float> m_hit1_z0; //
std::vector<float> m_hit1_theta; //
std::vector<float> m_hit1_phi; //
std::vector<unsigned short> m_nHits; //
std::vector<unsigned short> m_hitEne_2b; // 1 element per hit
std::vector<unsigned short> m_hitLength_2b; //
std::vector<unsigned short> m_dTheta; // 1 element per hit except for first hit in string
std::vector<unsigned short> m_dPhi; //
std::vector<float> m_hitEne_4b; // 1 element per hit with m_hitEne_2b[i] == 2**16
std::vector<float> m_hitLength_4b; // 1 element per hit with m_hitLength_2b[i] == 2**16
std::vector<unsigned long> m_barcode;
std::vector<unsigned short> m_nBC;
std::vector<unsigned long> m_id;
std::vector<unsigned short> m_nId;
};
// inlines
inline
SiHitCollection_p2::SiHitCollection_p2 () {}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SIHIT_P1_H
#define SIHIT_P1_H
#include "GeneratorObjectsTPCnv/HepMcParticleLink_p1.h"
class SiHit_p1 {
public:
SiHit_p1() {};
friend class SiHitCnv_p1;
private:
float m_stX, m_stY, m_stZ;
float m_enX, m_enY, m_enZ;
float m_energyLoss; // deposited energy
float m_meanTime; // time of energy deposition
HepMcParticleLink_p1 m_partLink;
unsigned int m_ID;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRT_HITCNV_P1_H
#define TRT_HITCNV_P1_H
/*
Transient/Persistent converter for TRT_Hit class
Author: Davide Costanzo
*/
#include "InDetSimEvent/TRTUncompressedHit.h"
#include "TRT_Hit_p1.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
class MsgStream;
class TRT_HitCnv_p1 : public T_AthenaPoolTPCnvBase<TRTUncompressedHit, TRT_Hit_p1>
{
public:
TRT_HitCnv_p1() {}
virtual void persToTrans(const TRT_Hit_p1* persObj, TRTUncompressedHit*
transObj, MsgStream &log);
virtual void transToPers(const TRTUncompressedHit* transObj, TRT_Hit_p1*
persObj, MsgStream &log);
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#define private public
#include "TRT_HitCollection_p1.h"
#undef private
#include "InDetSimEvent/TRTUncompressedHitCollection.h"
#include "TRT_HitCnv_p1.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
typedef T_AtlasHitsVectorCnv< TRTUncompressedHitCollection, TRT_HitCollection_p1, TRT_HitCnv_p1 > TRT_HitCollectionCnv_p1;
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRTHITCOLLECTIONCNV_P2_H
#define TRTHITCOLLECTIONCNV_P2_H
// SiHitCollectionCnv_p2, T/P separation of Si Hits
// author Robert Duxfield <r.duxfield@sheffield.ac.uk>
#include "InDetSimEvent/TRTUncompressedHitCollection.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
#include "TRT_HitCollection_p2.h"
class TRT_HitCollectionCnv_p2 : public T_AthenaPoolTPCnvBase<TRTUncompressedHitCollection, TRT_HitCollection_p2>
{
public:
TRT_HitCollectionCnv_p2() {};
virtual TRTUncompressedHitCollection* createTransient(const TRT_HitCollection_p2* persObj, MsgStream &log);
virtual void persToTrans(const TRT_HitCollection_p2* persCont,
TRTUncompressedHitCollection* transCont,
MsgStream &log) ;
virtual void transToPers(const TRTUncompressedHitCollection* transCont,
TRT_HitCollection_p2* persCont,
MsgStream &log) ;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRTHITCOLLECTIONCNV_P3_H
#define TRTHITCOLLECTIONCNV_P3_H
// SiHitCollectionCnv_p2, T/P separation of Si Hits
// author Robert Duxfield <r.duxfield@sheffield.ac.uk>
#include "InDetSimEvent/TRTUncompressedHitCollection.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
#include "TRT_HitCollection_p3.h"
class TRT_HitCollectionCnv_p3 : public T_AthenaPoolTPCnvBase<TRTUncompressedHitCollection, TRT_HitCollection_p3>
{
public:
TRT_HitCollectionCnv_p3() {};
virtual TRTUncompressedHitCollection* createTransient(const TRT_HitCollection_p3* persObj, MsgStream &log);
virtual void persToTrans(const TRT_HitCollection_p3* persCont,
TRTUncompressedHitCollection* transCont,
MsgStream &log) ;
virtual void transToPers(const TRTUncompressedHitCollection* transCont,
TRT_HitCollection_p3* persCont,
MsgStream &log) ;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRT_HITCOLLECTION_P1_H
#define TRT_HITCOLLECTION_P1_H
/*
Persistent represenation of a TRT_HitContainer,
Author: Davide Costanzo
*/
#include <vector>
#include <string>
#include "TRT_Hit_p1.h"
class TRT_HitCollection_p1
{
public:
/// typedefs
typedef std::vector<TRT_Hit_p1> HitVector;
typedef HitVector::const_iterator const_iterator;
typedef HitVector::iterator iterator;
/// Default constructor
TRT_HitCollection_p1 ();
// Accessors
const std::string& name() const;
const HitVector& getVector() const;
private:
std::vector<TRT_Hit_p1> m_cont;
std::string m_name;
};
// inlines
inline
TRT_HitCollection_p1::TRT_HitCollection_p1 () {}
inline
const std::string&
TRT_HitCollection_p1::name() const
{return m_name;}
inline
const std::vector<TRT_Hit_p1>&
TRT_HitCollection_p1::getVector() const
{return m_cont;}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRTHITCOLLECTION_P2_H
#define TRTHITCOLLECTION_P2_H
/*
Author: Rob Duxfield <r.duxfield@sheffield.ac.uk>
*/
#include <vector>
#include <string>
class TRT_HitCollection_p2
{
public:
/// Default constructor
TRT_HitCollection_p2 ();
private:
std::vector<float> m_hit1_startX; // 1 element per string
std::vector<float> m_hit1_startY; //
std::vector<float> m_hit1_startZ; //
std::vector<unsigned short> m_nHits; //
std::vector<float> m_hitEne; // 1 element per hit
std::vector<float> m_meanTime; //
std::vector<float> m_kinEne; //
std::vector<float> m_endX; //
std::vector<float> m_endY; //
std::vector<float> m_endZ; //
std::vector<unsigned long> m_hitId; //
std::vector<unsigned long> m_barcode;
std::vector<unsigned short> m_nBC;
std::vector<long> m_id;
std::vector<unsigned short> m_nId;
};
// inlines
inline
TRT_HitCollection_p2::TRT_HitCollection_p2 () {}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRTHITCOLLECTION_P3_H
#define TRTHITCOLLECTION_P3_H
/*
Author: Rob Duxfield <r.duxfield@sheffield.ac.uk> Spring 2008
_p3 Integer compression: <Andrew.Beddall@cern.ch> Spring 2009
See http://cern.ch/beddall/TRThitCompression/
*/
#include <vector>
#include <string>
class TRT_HitCollection_p3
{
public:
/// Default constructor
TRT_HitCollection_p3 ();
private:
//
// 1 element per string (a string resides in one straw; there may be more than one string in a straw)
//
std::vector<unsigned short> m_nHits; // number of hits in the string (0,1,2 ... ,hundreds).
std::vector<unsigned short> m_strawId2b; // straw id | 24-bit
std::vector<unsigned char> m_strawId1b; // straw id | integer.
std::vector<unsigned char> m_startR; // hit start radius (0, 2 mm) [not always stored].
std::vector<unsigned char> m_startPhi; // hit start phi (-pi, pi).
std::vector<unsigned char> m_startZ; // hit start z (-365, +365 mm), and 1-bit startRflag.
//
// 1 element per hit, there are typically 1 or 2 hits per string, but can be hundreds!
//
std::vector<unsigned short> m_kinEne; // short float, kinematic energy of the particle causing the hit.
std::vector<unsigned short> m_steplength; // short float, g4 step length; endZ is derived from this.
std::vector<unsigned char> m_endR; // hit end radius (0, 2 mm) [Not always stored].
std::vector<unsigned char> m_endPhi; // hit end phi (-pi, pi).
std::vector<unsigned short> m_meanTime; // time to center of the hit, and 1-bit idZsign and 1-bit endRflag.
std::vector<float> m_meanTimeof; // t >= 75 ns overflow to a float.
//
// much less frequent
//
std::vector<float> m_hitEne; // energy deposited; *only stored for photons* (m_id=22)
std::vector<unsigned short> m_nId;
std::vector<unsigned int> m_barcode;
std::vector<unsigned short> m_nBC;
std::vector<int> m_id; // particle code.
};
// inlines
inline
TRT_HitCollection_p3::TRT_HitCollection_p3 () {}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRT_HIT_P1_H
#define TRT_HIT_P1_H
#include "GeneratorObjectsTPCnv/HepMcParticleLink_p1.h"
class TRT_Hit_p1 {
public:
TRT_Hit_p1() {};
friend class TRT_HitCnv_p1;
private:
int hitID; // To identify the hit
HepMcParticleLink_p1 m_partLink; // link to the particle generating the hit
int particleEncoding; // PDG id
float kineticEnergy; // kin energy of the particle
float energyDeposit; // energy deposit by the hit
float preStepX;
float preStepY;
float preStepZ;
float postStepX;
float postStepY;
float postStepZ;
float globalTime;
};
#endif
......@@ -3,17 +3,6 @@
<class name="InDet::Track_tlp1" id="8380F7AC-4A8F-4382-95A5-1234E43D3B08" />
<class name="InDet::Track_tlp2" id="4E3778E2-1497-4F10-8746-AA02319FAC83" />
<!-- InDetHits -->
<class name="SiHit_p1" />
<class name="std::vector<SiHit_p1>" />
<class name="SiHitCollection_p1" id="36D1FF8E-5734-4A93-A133-F286CF47DB72" />
<class name="SiHitCollection_p2" id="BD1469C5-C904-40B8-82B9-43D25888D884" />
<class name="TRT_Hit_p1" />