1#include "RawDataCnv/EventManagement/TofMcHitBuilder.h"
2#include "Identifier/TofID.h"
10 vector<uint32_t>::const_iterator& eiter,
TofTruth_t& tt ) {
11 uint32_t helpVal = *(
iter++ );
12 assert(
iter != eiter );
14 assert(
iter != eiter );
16 assert(
iter != eiter );
18 assert(
iter != eiter );
20 assert(
iter != eiter );
22 assert(
iter != eiter );
24 assert(
iter != eiter );
26 assert(
iter != eiter );
29 tt.
trackIndex = ( helpVal & m_trackIndexMask ) >> m_trackIndexIndex;
30 tt.
partId = ( helpVal & m_partIdMask ) >> m_partIdIndex;
31 tt.
scinNb = ( helpVal & m_scinNbMask ) >> m_scinNbIndex;
32 tt.
strip = ( helpVal & m_stripMask ) >> m_stripIndex;
72 return StatusCode::SUCCESS;
81 f.open( initFile.c_str() );
85 cerr <<
"Error: could not open file " << initFile << endl;
86 return StatusCode::FAILURE;
91 cerr <<
"Error: could not find '##TofTruthConf' in file " << initFile << endl;
92 return StatusCode::FAILURE;
109 return StatusCode::FAILURE;
113 return StatusCode::SUCCESS;
120void TofMcHitBuilder::makeTofTruth( TofMcHitCol::const_iterator& pTofMcHit,
TofTruth_t& tt ) {
121 Identifier ident = ( *pTofMcHit )->identify();
123 uint32_t scinNum = 0;
140 tt.
trackIndex = ( *pTofMcHit )->getTrackIndex();
144 tt.
x = int( ( *pTofMcHit )->getPositionX() *
m_xCoeff );
145 tt.
y = int( ( *pTofMcHit )->getPositionY() *
m_yCoeff );
146 tt.
z = int( ( *pTofMcHit )->getPositionZ() *
m_zCoeff );
147 tt.
px = int( ( *pTofMcHit )->getPx() *
m_pxCoeff );
148 tt.
py = int( ( *pTofMcHit )->getPy() *
m_pyCoeff );
149 tt.
pz = int( ( *pTofMcHit )->getPz() *
m_pzCoeff );
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
eformat::write::FullEventFragment WriteRawEvent
static bool find(ifstream &f, string msg, string fname)
static bool expect(ifstream &f, string msg, string fname)
static bool expectLong(ifstream &f, string msg, string fname, uint64_t &val)
static bool expectInt(ifstream &f, string msg, string fname, uint32_t &val1, uint32_t &val2)
static int endcap(const Identifier &id)
static int strip(const Identifier &id)
static bool is_scin(const Identifier &id)
static value_type getPHI_BARREL_MAX()
static bool is_barrel(const Identifier &id)
Test for barrel.
static bool is_mrpc(const Identifier &id)
static int phi_module(const Identifier &id)
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0).
static int layer(const Identifier &id)
static int module(const Identifier &id)
virtual uint32_t getREID(uint32_t reid)
virtual StatusCode initialize(string &initFile)
virtual void unPack(vector< uint32_t >::const_iterator &, vector< uint32_t >::const_iterator &, TofTruth_t &)
uint64_t m_trackLengthCoeff
virtual StatusCode pack(TofMcHitCol *tofMcHitCol, WriteRawEvent *&re)
virtual uint32_t getTEID(uint32_t teid)
ObjectVector< TofMcHit > TofMcHitCol