Commit cd68522d authored by James William Howarth's avatar James William Howarth Committed by Graeme Stewart
Browse files

'Fix for CMT issues' (TrigFTK_RawDataTPCnv-00-00-02)

parent a1bafede
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGFTK_RAWTRACKTPCNV_FTK_RAWTRACKCNV_p1_H
#define TRIGFTK_RAWTRACKTPCNV_FTK_RAWTRACKCNV_p1_H
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
#include "TrigFTK_RawData/FTK_RawTrack.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrack_p1.h"
class MsgStream;
class FTK_RawTrackCnv_p1: public T_AthenaPoolTPCnvBase<FTK_RawTrack, FTK_RawTrack_p1>
{
public:
FTK_RawTrackCnv_p1() {}
virtual void persToTrans( const FTK_RawTrack_p1 *, FTK_RawTrack *, MsgStream& );
virtual void transToPers( const FTK_RawTrack *, FTK_RawTrack_p1 *, MsgStream& );
enum {th1=0, th2=1, th3=2, th4=3, th5=4};
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGFTK_RAWTRACKTPCNV_FTK_RAWTRACKCONTAINERCNV_P1_H
#define TRIGFTK_RAWTRACKTPCNV_FTK_RAWTRACKCONTAINERCNV_P1_H
#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackCnv_p1.h"
#include "TrigFTK_RawData/FTK_RawTrackContainer.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackContainer_p1.h"
class MsgStream;
class FTK_RawTrackContainerCnv_p1
: public T_AthenaPoolTPCnvBase<FTK_RawTrackContainer, FTK_RawTrackContainer_p1>
{
public:
FTK_RawTrackContainerCnv_p1() {}
virtual void persToTrans( const FTK_RawTrackContainer_p1*, FTK_RawTrackContainer*, MsgStream& );
virtual void transToPers( const FTK_RawTrackContainer*, FTK_RawTrackContainer_p1*, MsgStream& );
virtual void initPrivateConverters( AthenaPoolTopLevelTPCnvBase *topCnv ) {
m_FTK_RawTrackVectorCnv.setTopConverter( topCnv, 0 );
}
private:
typedef T_AthenaPoolTPPtrVectorCnv< FTK_RawTrackContainer,
std::vector<TPObjRef>,
ITPConverterFor<FTK_RawTrack> > FTK_RawTrackVectorCnv_p1;
FTK_RawTrackVectorCnv_p1 m_FTK_RawTrackVectorCnv;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGFTK_RAWDATATPCNV_FTK_RAWTRACKCONTAINERCNV_tlp1_H
#define TRIGFTK_RAWDATATPCNV_FTK_RAWTRACKCONTAINERCNV_tlp1_H
#include "AthenaPoolCnvSvc/AthenaPoolTopLevelTPConverter.h"
#include "FTK_RawTrackContainerCnv_p1.h"
#include "FTK_RawTrackCnv_p1.h"
#include "FTK_RawTrackContainer_tlp1.h"
class FTK_RawTrackContainerCnv_tlp1 : public AthenaPoolTopLevelTPConverter<FTK_RawTrackContainerCnv_p1, FTK_RawTrackContainer_tlp1>
{
public:
FTK_RawTrackContainerCnv_tlp1();
virtual ~FTK_RawTrackContainerCnv_tlp1() {}
virtual void setPStorage( FTK_RawTrackContainer_tlp1 *storage );
protected:
FTK_RawTrackContainerCnv_p1 m_FTK_RawTrackContainerCnv;
FTK_RawTrackCnv_p1 m_FTK_RawTrackCnv;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGINDETEVENT_FTK_RAWTRACKCONTAINER_P1_H
#define TRIGINDETEVENT_FTK_RAWTRACKCONTAINER_P1_H
#include "AthenaPoolUtilities/TPObjRef.h"
#include <vector>
class FTK_RawTrackContainer_p1{
public:
FTK_RawTrackContainer_p1() {}
friend class FTK_RawTrackContainerCnv_p1;
private:
std::vector<TPObjRef> m_FTK_RawTrackVector;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGFTK_RAWDATATPCNV_FTK_RAWTRACKCONTAINER_tlp4_H
#define TRIGFTK_RAWDATATPCNV_FTK_RAWTRACKCONTAINER_tlp4_H
#include "FTK_RawTrackContainer_p1.h"
#include "FTK_RawTrack_p1.h"
class FTK_RawTrackContainer_tlp1
{
public:
FTK_RawTrackContainer_tlp1() {}
friend class FTK_RawTrackContainerCnv_tlp1;
private:
std::vector< FTK_RawTrackContainer_p1 > m_FTK_RawTrackContainers;
std::vector< FTK_RawTrack_p1 > m_FTK_RawTracks;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TrigFTK_RawDataTPCnv_FTK_RawTrack_p1_H
#define TrigFTK_RawDataTPCnv_FTK_RawTrack_p1_H
#include "TrigFTK_RawData/FTK_RawTrack.h"
#include <stdint.h>
class FTK_RawTrack_p1
{
public:
FTK_RawTrack_p1() {}
friend class FTK_RawTrackCnv_p1;
private:
uint32_t m_pars[5];
uint32_t m_pars_pix[8];
uint32_t m_pars_sct[8];
signed long m_barcodes_sct[8];
signed long m_barcodes_pix[4];
signed long m_barcode;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGFTK_RAWDATATPCNV_TRIGINDETEVENTTPCNVDICT1_H
#define TRIGFTK_RAWDATATPCNV_TRIGINDETEVENTTPCNVDICT1_H
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackContainer_tlp1.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackContainerCnv_tlp1.h"
//dummy instances of all objects using std::vector<TPObjRef> for the dictionary
struct dummy_TrigFTK_RawDataTPCnvDict1
{
std::vector<FTK_RawTrackContainer_p1> m_dummyFTK_RawTrackContainer_p1;
std::vector<FTK_RawTrack_p1> m_dummyFTK_RawTrack_p1;
};
#endif
<lcgdict>
<!-- FTKRawTrack-->
<class name="FTK_RawTrack_p1" />
<class name="std::vector<FTK_RawTrack_p1>" />
<class name="FTK_RawTrackContainer_tlp1" id="C1A5436E-8520-4399-82FC-E6828B19688D" />
<class name="FTK_RawTrackContainer_p1" id="FF688A0E-527F-4F88-9738-830F97EC0CFD" />
<class name="std::vector<FTK_RawTrackContainer_p1>"/>
</lcgdict>
package TrigFTK_RawDataTPCnv
author James Howarth <jhowarth@cern.ch>
use AtlasPolicy AtlasPolicy-*
use AthenaPoolCnvSvc AthenaPoolCnvSvc-* Database/AthenaPOOL
use AthenaPoolUtilities AthenaPoolUtilities-* Database/AthenaPOOL
#use EventCommonTPCnv EventCommonTPCnv-* Event
#use InDetIdentifier InDetIdentifier-* InnerDetector/InDetDetDescr
#use StoreGate StoreGate-* Control
#use RootConversions RootConversions-* Database/AthenaPOOL
#use Identifier Identifier-* DetectorDescription
# use statements for data packages
#use FourMom FourMom-* Event
use TrigFTK_RawData TrigFTK_RawData-* Trigger/TrigFTK
#private
#use IdDictParser IdDictParser-* DetectorDescription
#end_private
branches TrigFTK_RawDataTPCnv src
library TrigFTK_RawDataTPCnv *.cxx
apply_pattern tpcnv_library
private
use AthenaKernel AthenaKernel-* Control
use AtlasReflex AtlasReflex-* External
# Create a dictionary for the persistent representation
# of transient classes. If we make a single dictionary,
# the compiler runs out of memory on the generated source.
apply_pattern lcgdict dict=TrigFTK_RawDataTPCnv1 \
selectionfile=selection1.xml \
headerfiles="../TrigFTK_RawDataTPCnv/TrigFTK_RawDataTPCnvDict1.h"
end_private
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#define private public
#define protected public
#include "TrigFTK_RawData/FTK_RawTrack.h"
#undef private
#undef protected
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackCnv_p1.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrack_p1.h"
void FTK_RawTrackCnv_p1::persToTrans(const FTK_RawTrack_p1* persObj,
FTK_RawTrack* transObj,
MsgStream &log)
{
log << MSG::INFO << "FTK_RawTrackCnv_p1::persToTrans called" << endreq;
// log << MSG::ATH << "FTK_RawTrackCnv_p1:: m_pars[th1] = " << persObj->m_pars[th1] << endreq;
// log << MSG::ATH << "FTK_RawTrackCnv_p1:: m_pars[th2] = " << persObj->m_pars[th2] << endreq;
// log << MSG::ATH << "FTK_RawTrackCnv_p1:: m_pars[th3] = " << persObj->m_pars[th3] << endreq;
// log << MSG::ATH << "FTK_RawTrackCnv_p1:: m_pars[th4] = " << persObj->m_pars[th4] << endreq;
// log << MSG::ATH << "FTK_RawTrackCnv_p1:: m_pars[th5] = " << persObj->m_pars[th5] << endreq;
// log << MSG::ATH << "FTK_RawTrackCnv_p1:: m_pars[th4] = " << persObj->m_barcode << endreq;
transObj->setTH1(persObj->m_pars[th1]);
transObj->setTH2(persObj->m_pars[th2]);
transObj->setTH3(persObj->m_pars[th3]);
transObj->setTH4(persObj->m_pars[th4]);
transObj->setTH5(persObj->m_pars[th5]);
transObj->setBarcode(persObj->m_barcode);
// Pixel Clusters //
FTK_RawPixelCluster pixel_1(0), pixel_2(1), pixel_3(2), pixel_4(3);
/*FTK_RawPixelCluster* pixel_1 = new FTK_RawPixelCluster(0);
FTK_RawPixelCluster* pixel_2 = new FTK_RawPixelCluster(1);
FTK_RawPixelCluster* pixel_3 = new FTK_RawPixelCluster(2);
FTK_RawPixelCluster* pixel_4 = new FTK_RawPixelCluster(3);
pixel_1->setWordA(persObj->m_pars_pix[0]);
pixel_1->setWordB(persObj->m_pars_pix[1]);
pixel_1->setBarcode(persObj->m_barcodes_pix[0]);
// log << MSG::INFO << persObj->m_barcodes_pix[0] << endreq;
pixel_2->setWordA(persObj->m_pars_pix[2]);
pixel_2->setWordB(persObj->m_pars_pix[3]);
pixel_2->setBarcode(persObj->m_barcodes_pix[1]);
pixel_3->setWordA(persObj->m_pars_pix[4]);
pixel_3->setWordB(persObj->m_pars_pix[5]);
pixel_3->setBarcode(persObj->m_barcodes_pix[2]);
pixel_4->setWordA(persObj->m_pars_pix[6]);
pixel_4->setWordB(persObj->m_pars_pix[7]);
pixel_3->setBarcode(persObj->m_barcodes_pix[3]);
std::vector<FTK_RawPixelCluster*> pixel_clusters;
pixel_clusters.push_back(pixel_1);
pixel_clusters.push_back(pixel_2);
pixel_clusters.push_back(pixel_3);
pixel_clusters.push_back(pixel_4);
transObj->setPixelClusters(pixel_clusters);*/
pixel_1.setWordA(persObj->m_pars_pix[0]);
pixel_1.setWordB(persObj->m_pars_pix[1]);
pixel_1.setBarcode(persObj->m_barcodes_pix[0]);
pixel_2.setWordA(persObj->m_pars_pix[2]);
pixel_2.setWordB(persObj->m_pars_pix[3]);
pixel_2.setBarcode(persObj->m_barcodes_pix[1]);
pixel_3.setWordA(persObj->m_pars_pix[4]);
pixel_3.setWordB(persObj->m_pars_pix[5]);
pixel_3.setBarcode(persObj->m_barcodes_pix[2]);
pixel_4.setWordA(persObj->m_pars_pix[6]);
pixel_4.setWordB(persObj->m_pars_pix[7]);
pixel_4.setBarcode(persObj->m_barcodes_pix[3]);
std::vector<FTK_RawPixelCluster> pixel_clusters;
pixel_clusters.push_back(pixel_1);
pixel_clusters.push_back(pixel_2);
pixel_clusters.push_back(pixel_3);
pixel_clusters.push_back(pixel_4);
transObj->setPixelClusters(pixel_clusters);
// SCT Clusters //
FTK_RawSCT_Cluster sct_1(4), sct_2(5), sct_3(6), sct_4(7), sct_5(8), sct_6(9), sct_7(10), sct_8(11);
sct_1.setWord( persObj->m_pars_sct[0]);
sct_1.setBarcode( persObj->m_barcodes_sct[0]);
sct_2.setWord( persObj->m_pars_sct[1]);
sct_2.setBarcode( persObj->m_barcodes_sct[1]);
sct_3.setWord( persObj->m_pars_sct[2]);
sct_3.setBarcode( persObj->m_barcodes_sct[2]);
sct_4.setWord( persObj->m_pars_sct[3]);
sct_4.setBarcode( persObj->m_barcodes_sct[3]);
sct_5.setWord( persObj->m_pars_sct[4]);
sct_5.setBarcode( persObj->m_barcodes_sct[4]);
sct_6.setWord( persObj->m_pars_sct[5]);
sct_6.setBarcode( persObj->m_barcodes_sct[5]);
sct_7.setWord( persObj->m_pars_sct[6]);
sct_7.setBarcode( persObj->m_barcodes_sct[6]);
sct_8.setWord( persObj->m_pars_sct[7]);
sct_8.setBarcode( persObj->m_barcodes_sct[7]);
std::vector<FTK_RawSCT_Cluster> sct_clusters;
sct_clusters.push_back(sct_1);
sct_clusters.push_back(sct_2);
sct_clusters.push_back(sct_3);
sct_clusters.push_back(sct_4);
sct_clusters.push_back(sct_5);
sct_clusters.push_back(sct_6);
sct_clusters.push_back(sct_7);
sct_clusters.push_back(sct_8);
transObj->setSCTClusters(sct_clusters);
}
void FTK_RawTrackCnv_p1::transToPers(const FTK_RawTrack* transObj,
FTK_RawTrack_p1* persObj,
MsgStream &log)
{
log << MSG::DEBUG << "FTK_RawTrackCnv_p1::transToPers called" << endreq;
persObj->m_pars[th1] = transObj->getTH1();
persObj->m_pars[th2] = transObj->getTH2();
persObj->m_pars[th3] = transObj->getTH3();
persObj->m_pars[th4] = transObj->getTH4();
persObj->m_pars[th5] = transObj->getTH5();
persObj->m_barcode = transObj->getBarcode();
// Pixel Clusters //
/* persObj->m_pars_pix[0] = transObj->getPixelCluster(0).getWordA();
persObj->m_pars_pix[1] = transObj->getPixelCluster(0).getWordB();
persObj->m_barcodes_pix[0] = transObj->getPixelCluster(0).getBarcode();
persObj->m_pars_pix[2] = transObj->getPixelCluster(1).getWordA();
persObj->m_pars_pix[3] = transObj->getPixelCluster(1).getWordB();
persObj->m_barcodes_pix[1] = transObj->getPixelCluster(1).getBarcode();
persObj->m_pars_pix[4] = transObj->getPixelCluster(2).getWordA();
persObj->m_pars_pix[5] = transObj->getPixelCluster(2).getWordB();
persObj->m_barcodes_pix[2] = transObj->getPixelCluster(2).getBarcode();
persObj->m_pars_pix[6] = transObj->getPixelCluster(3).getWordA();
persObj->m_pars_pix[7] = transObj->getPixelCluster(3).getWordB();
persObj->m_barcodes_pix[3] = transObj->getPixelCluster(3).getBarcode();
// SCT Clusters //
persObj->m_pars_sct[0] = transObj->getSCTCluster(0).getWord();
persObj->m_barcodes_sct[0] = transObj->getSCTCluster(0).getBarcode();
persObj->m_pars_sct[1] = transObj->getSCTCluster(1).getWord();
persObj->m_barcodes_sct[1] = transObj->getSCTCluster(1).getBarcode();
persObj->m_pars_sct[2] = transObj->getSCTCluster(2).getWord();
persObj->m_barcodes_sct[2] = transObj->getSCTCluster(2).getBarcode();
persObj->m_pars_sct[3] = transObj->getSCTCluster(3).getWord();
persObj->m_barcodes_sct[3] = transObj->getSCTCluster(3).getBarcode();
persObj->m_pars_sct[4] = transObj->getSCTCluster(4).getWord();
persObj->m_barcodes_sct[4] = transObj->getSCTCluster(4).getBarcode();
persObj->m_pars_sct[5] = transObj->getSCTCluster(5).getWord();
persObj->m_barcodes_sct[5] = transObj->getSCTCluster(5).getBarcode();
persObj->m_pars_sct[6] = transObj->getSCTCluster(6).getWord();
persObj->m_barcodes_sct[6] = transObj->getSCTCluster(6).getBarcode();
persObj->m_pars_sct[7] = transObj->getSCTCluster(7).getWord();
persObj->m_barcodes_sct[7] = transObj->getSCTCluster(7).getBarcode();*/
FTK_RawTrack trans_track = *(const_cast<FTK_RawTrack*>(transObj));
// Pixel Clusters //
// persObj->m_pars_pix[0] = trans_track.getPixelCluster(0).getWordA();
// persObj->m_pars_pix[1] = trans_track.getPixelCluster(0).getWordB();
// persObj->m_barcodes_pix[0] = trans_track.getPixelCluster(0).getBarcode();
persObj->m_pars_pix[0] = trans_track.getPixelWordA(0);
persObj->m_pars_pix[1] = trans_track.getPixelWordB(0);
persObj->m_barcodes_pix[0] = trans_track.getPixelBarcode(0);
// log << MSG::INFO << "FTK_RawTrackCnv_p1::pixel barcode" << trans_track.getPixelCluster(0)->getBarcode() << endreq;
// log << MSG::INFO << "FTK_RawTrackCnv_p1::pixel barcode" << persObj->m_barcodes_pix[0] << endreq;
persObj->m_pars_pix[2] = trans_track.getPixelCluster(1).getWordA();
persObj->m_pars_pix[3] = trans_track.getPixelCluster(1).getWordB();
persObj->m_barcodes_pix[1] = trans_track.getPixelCluster(1).getBarcode();
persObj->m_pars_pix[4] = trans_track.getPixelCluster(2).getWordA();
persObj->m_pars_pix[5] = trans_track.getPixelCluster(2).getWordB();
persObj->m_barcodes_pix[2] = trans_track.getPixelCluster(2).getBarcode();
persObj->m_pars_pix[6] = trans_track.getPixelCluster(3).getWordA();
persObj->m_pars_pix[7] = trans_track.getPixelCluster(3).getWordB();
persObj->m_barcodes_pix[3] = trans_track.getPixelCluster(3).getBarcode();
// SCT Clusters //
persObj->m_pars_sct[0] = trans_track.getSCTCluster(0).getWord();
persObj->m_barcodes_sct[0] = trans_track.getSCTCluster(0).getBarcode();
persObj->m_pars_sct[1] = trans_track.getSCTCluster(1).getWord();
persObj->m_barcodes_sct[1] = trans_track.getSCTCluster(1).getBarcode();
persObj->m_pars_sct[2] = trans_track.getSCTCluster(2).getWord();
persObj->m_barcodes_sct[2] = trans_track.getSCTCluster(2).getBarcode();
persObj->m_pars_sct[3] = trans_track.getSCTCluster(3).getWord();
persObj->m_barcodes_sct[3] = trans_track.getSCTCluster(3).getBarcode();
persObj->m_pars_sct[4] = trans_track.getSCTCluster(4).getWord();
persObj->m_barcodes_sct[4] = trans_track.getSCTCluster(4).getBarcode();
persObj->m_pars_sct[5] = trans_track.getSCTCluster(5).getWord();
persObj->m_barcodes_sct[5] = trans_track.getSCTCluster(5).getBarcode();
persObj->m_pars_sct[6] = trans_track.getSCTCluster(6).getWord();
persObj->m_barcodes_sct[6] = trans_track.getSCTCluster(6).getBarcode();
persObj->m_pars_sct[7] = trans_track.getSCTCluster(7).getWord();
persObj->m_barcodes_sct[7] = trans_track.getSCTCluster(7).getBarcode();
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#define private public
#define protected public
#include "TrigFTK_RawData/FTK_RawTrackContainer.h"
#undef private
#undef protected
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackContainerCnv_p1.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackContainer_p1.h"
void FTK_RawTrackContainerCnv_p1::persToTrans(const FTK_RawTrackContainer_p1* persObj,
FTK_RawTrackContainer* transObj,
MsgStream &log)
{
log << MSG::DEBUG << "FTK_RawTrackContainerCnv_p1::persToTrans called " << endreq;
m_FTK_RawTrackVectorCnv.persToTrans( &(persObj->m_FTK_RawTrackVector), transObj, log );
}
void FTK_RawTrackContainerCnv_p1::transToPers(const FTK_RawTrackContainer* transObj,
FTK_RawTrackContainer_p1* persObj,
MsgStream &log)
{
log << MSG::DEBUG << "FTK_RawTrackContainerCnv_p1::transToPers called " << endreq;
m_FTK_RawTrackVectorCnv.transToPers( transObj, &(persObj->m_FTK_RawTrackVector), log );
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackContainerCnv_tlp1.h"
//constructor
FTK_RawTrackContainerCnv_tlp1::FTK_RawTrackContainerCnv_tlp1(){
// add the "main" base class converter
addMainTPConverter();
// add all converters needed in the top level converter
// do not change the order of adding converters
addTPConverter( &m_FTK_RawTrackCnv );
}
void FTK_RawTrackContainerCnv_tlp1::setPStorage( FTK_RawTrackContainer_tlp1* storage ){
//for the base class converter
setMainCnvPStorage( &storage->m_FTK_RawTrackContainers );
//for all other converters defined in the base class
m_FTK_RawTrackCnv. setPStorage( &storage->m_FTK_RawTracks );
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// generate the T/P converter entries
#include "AthenaKernel/TPCnvFactory.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrack_p1.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackContainer_p1.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackContainerCnv_tlp1.h"
#include "TrigFTK_RawDataTPCnv/FTK_RawTrackContainer_tlp1.h"
DECLARE_TPCNV_FACTORY(FTK_RawTrackContainerCnv_tlp1,
FTK_RawTrackContainer,
FTK_RawTrackContainer_tlp1,
Athena::TPCnvVers::Current)