Skip to content
Snippets Groups Projects
Commit 738b7704 authored by Dave Casper's avatar Dave Casper
Browse files

Hit classes/converters for Faser SCT hits (untested)

parent e7c28a8b
No related branches found
No related tags found
1 merge request!33Simulation, persistence and display of SCT hits
Showing
with 324 additions and 0 deletions
################################################################################
# Package: TrackerSimEventAthenaPool
################################################################################
# Declare the package name:
atlas_subdir( TrackerSimEventAthenaPool )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PRIVATE
AtlasTest/TestTools
Database/AthenaPOOL/AthenaPoolCnvSvc
Database/AthenaPOOL/AthenaPoolUtilities
Database/AtlasSealCLHEP
GaudiKernel
Tracker/TrackerEventCnv/TrackerSimEventTPCnv
Tracker/TrackerSimEvent )
# External dependencies:
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
# Component(s) in the package:
atlas_add_poolcnv_library( TrackerSimEventAthenaPoolPoolCnv
src/*.cxx
FILES TrackerSimEvent/FaserSiHitCollection.h
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel TrackerSimEventTPCnv TrackerSimEvent )
atlas_add_dictionary( TrackerSimEventAthenaPoolCnvDict
TrackerSimEventAthenaPool/TrackerSimEventAthenaPoolCnvDict.h
TrackerSimEventAthenaPool/selection.xml
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel TrackerSimEventTPCnv TrackerSimEvent )
# Install files from the package:
atlas_install_headers( TrackerSimEventAthenaPool )
atlas_install_joboptions( share/*.py )
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SCINTSIMEVENTATHENAPOOLDICT_H
#define SCINTSIMEVENTATHENAPOOLDICT_H
#endif
<lcgdict>
</lcgdict>
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#include "TrackerSimEventTPCnv/TrackerHits/FaserSiHitCollectionCnv_p1.h"
#include "TrackerSimEventTPCnv/TrackerHits/FaserSiHit_p1.h"
#include "FaserSiHitCollectionCnv.h"
FaserSiHitCollection_PERS* FaserSiHitCollectionCnv::createPersistent(FaserSiHitCollection* transCont) {
MsgStream mlog(msgSvc(), "FaserSiHitCollectionConverter" );
FaserSiHitCollectionCnv_PERS converter;
FaserSiHitCollection_PERS *persObj = converter.createPersistent( transCont, mlog );
return persObj;
}
FaserSiHitCollection* FaserSiHitCollectionCnv::createTransient() {
MsgStream mlog(msgSvc(), "FaserSiHitCollectionConverter" );
FaserSiHitCollectionCnv_p1 converter_p1;
static const pool::Guid p1_guid("FF9508DE-3E25-425D-9556-16D319DCE0E1");
FaserSiHitCollection *trans_cont(0);
if( this->compareClassGuid(p1_guid)) {
std::unique_ptr< FaserSiHitCollection_p1 > col_vect( this->poolReadObject< FaserSiHitCollection_p1 >() );
trans_cont = converter_p1.createTransient( col_vect.get(), mlog );
} else {
throw std::runtime_error("Unsupported persistent version of Data container");
}
return trans_cont;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef FASERSIHITCOLLECTIONCNV
#define FASERSIHITCOLLECTIONCNV
#include "TrackerSimEvent/FaserSiHitCollection.h"
#include "TrackerSimEventTPCnv/TrackerHits/FaserSiHitCollection_p1.h"
#include "TrackerSimEventTPCnv/TrackerHits/FaserSiHitCollectionCnv_p1.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// Gaudi
#include "GaudiKernel/MsgStream.h"
// typedef to the latest persistent version
typedef FaserSiHitCollection_p1 FaserSiHitCollection_PERS;
typedef FaserSiHitCollectionCnv_p1 FaserSiHitCollectionCnv_PERS;
class FaserSiHitCollectionCnv : public T_AthenaPoolCustomCnv<FaserSiHitCollection, FaserSiHitCollection_PERS > {
friend class CnvFactory<FaserSiHitCollectionCnv>;
public:
FaserSiHitCollectionCnv(ISvcLocator* svcloc) :
T_AthenaPoolCustomCnv<FaserSiHitCollection, FaserSiHitCollection_PERS >( svcloc) {}
protected:
FaserSiHitCollection_PERS* createPersistent(FaserSiHitCollection* transCont);
FaserSiHitCollection* createTransient ();
};
#endif
###############################################################################
# Package: TrackerSimEventTPCnv
################################################################################
# Declare the package name:
atlas_subdir( TrackerSimEventTPCnv )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Database/AthenaPOOL/AthenaPoolCnvSvc
GaudiKernel
Generators/GeneratorObjectsTPCnv
Tracker/TrackerSimEvent
PRIVATE
AtlasTest/TestTools
Control/StoreGate
DetectorDescription/Identifier )
# External dependencies:
find_package( CLHEP )
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
# Component(s) in the package:
atlas_add_library( TrackerSimEventTPCnv
src/TrackerHits/*.cxx
PUBLIC_HEADERS TrackerSimEventTPCnv
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
LINK_LIBRARIES GaudiKernel GeneratorObjectsTPCnv TrackerSimEvent AthenaPoolCnvSvcLib StoreGateLib SGtests
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} TestTools Identifier )
atlas_add_dictionary( TrackerSimEventTPCnvDict
TrackerSimEventTPCnv/TrackerSimEventTPCnvDict.h
TrackerSimEventTPCnv/selection.xml
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv TrackerSimEvent TestTools StoreGateLib SGtests Identifier TrackerSimEventTPCnv )
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef FASERSIHITCNV_P1_H
#define FASERSIHITCNV_P1_H
/*
Transient/Persistent converter for FaserSiHit class
*/
#include "TrackerSimEvent/FaserSiHit.h"
#include "FaserSiHit_p1.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
class MsgStream;
class FaserSiHitCnv_p1 : public T_AthenaPoolTPCnvBase<FaserSiHit, FaserSiHit_p1>
{
public:
FaserSiHitCnv_p1() {}
virtual void persToTrans(const FaserSiHit_p1* persObj, FaserSiHit*
transObj, MsgStream &log);
virtual void transToPers(const FaserSiHit* transObj, FaserSiHit_p1*
persObj, MsgStream &log);
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef FASERSIHITCOLLECTIONCNV_P1_H
#define FASERSIHITCOLLECTIONCNV_P1_H
// FaserSiHitCollectionCnv_p1, T/P separation of FaserSi Hits
// author D.Costanzo <davide.costanzo@cern.ch>
// author O.Arnaez <olivier.arnaez@cern.ch>
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
#include "TrackerSimEvent/FaserSiHitCollection.h"
#include "FaserSiHitCollection_p1.h"
class FaserSiHitCollectionCnv_p1 : public T_AthenaPoolTPCnvBase<FaserSiHitCollection, FaserSiHitCollection_p1>
{
public:
FaserSiHitCollectionCnv_p1() {};
virtual FaserSiHitCollection* createTransient(const FaserSiHitCollection_p1* persObj, MsgStream &log);
virtual void persToTrans(const FaserSiHitCollection_p1* persCont,
FaserSiHitCollection* transCont,
MsgStream &log) ;
virtual void transToPers(const FaserSiHitCollection* transCont,
FaserSiHitCollection_p1* 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 FASERSIHITCOLLECTION_P1_H
#define FASERSIHITCOLLECTION_P1_H
/*
Authors: Davide Costanzo Rob Duxfield
*/
#include <vector>
#include <string>
class FaserSiHitCollection_p1
{
public:
/// Default constructor
FaserSiHitCollection_p1 ();
//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_mcEvtIndex;
std::vector<char> m_evtColl;
std::vector<unsigned short> m_nBC;
std::vector<unsigned long> m_id;
std::vector<unsigned short> m_nId;
};
// inlines
inline
FaserSiHitCollection_p1::FaserSiHitCollection_p1 () {}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef FASERSIHIT_P1_H
#define FASERSIHIT_P1_H
#include "GeneratorObjectsTPCnv/HepMcParticleLink_p2.h"
class FaserSiHit_p1 {
public:
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_p2 m_partLink;
unsigned int m_ID;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRACKERSIMEVENTTPCNV_TRACKERSIMEVENTTPCNVDICT_H
#define TRACKERSIMEVENTTPCNV_TRACKERSIMEVENTTPCNVDICT_H
//-----------------------------------------------------------------------------
//
// file: TrackerSimEventTPCnvDict_p1.h
//
//-----------------------------------------------------------------------------
#include "TrackerSimEventTPCnv/TrackerHits/FaserSiHitCnv_p1.h"
#include "TrackerSimEventTPCnv/TrackerHits/FaserSiHitCollectionCnv_p1.h"
#include "TrackerSimEventTPCnv/TrackerHits/FaserSiHitCollection_p1.h"
#include "TrackerSimEventTPCnv/TrackerHits/FaserSiHit_p1.h"
#endif // TRACKERSIMEVENTTPCNV_TRACKERSIMEVENTTPCNVDICT_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment