BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
TofMcHitBuilder Class Reference

#include <TofMcHitBuilder.h>

+ Inheritance diagram for TofMcHitBuilder:

Public Member Functions

 TofMcHitBuilder ()
 
virtual ~TofMcHitBuilder ()
 
virtual StatusCode initialize (string &initFile)
 
virtual uint32_t getTEID (uint32_t teid)
 
virtual uint32_t getREID (uint32_t reid)
 
virtual void unPack (vector< uint32_t >::const_iterator &, vector< uint32_t >::const_iterator &, TofTruth_t &)
 
virtual StatusCode pack (TofMcHitCol *tofMcHitCol, WriteRawEvent *&re)
 
 TofMcHitBuilder ()
 
virtual ~TofMcHitBuilder ()
 
virtual StatusCode initialize (string &initFile)
 
virtual uint32_t getTEID (uint32_t teid)
 
virtual uint32_t getREID (uint32_t reid)
 
virtual void unPack (vector< uint32_t >::const_iterator &, vector< uint32_t >::const_iterator &, TofTruth_t &)
 
virtual StatusCode pack (TofMcHitCol *tofMcHitCol, WriteRawEvent *&re)
 
virtual StatusCode initialize (string &initFile)
 
virtual uint32_t getTEID (uint32_t teid)=0
 
virtual uint32_t getREID (uint32_t reid)=0
 
virtual StatusCode initialize (string &initFile)
 
virtual uint32_t getTEID (uint32_t teid)=0
 
virtual uint32_t getREID (uint32_t reid)=0
 

Public Attributes

uint64_t m_xCoeff
 
uint64_t m_yCoeff
 
uint64_t m_zCoeff
 
uint64_t m_pxCoeff
 
uint64_t m_pyCoeff
 
uint64_t m_pzCoeff
 
uint64_t m_trackLengthCoeff
 
uint64_t m_timeCoeff
 

Additional Inherited Members

- Public Types inherited from Builder
typedef std::map< uint32_t, uint32_t > TE2REMAP
 
typedef std::map< uint32_t, uint32_t > TE2REMAP
 
- Static Public Member Functions inherited from Builder
static bool expect (ifstream &f, string msg, string fname)
 
static bool expectInt (ifstream &f, string msg, string fname, uint32_t &val1, uint32_t &val2)
 
static bool expectLong (ifstream &f, string msg, string fname, uint64_t &val)
 
static bool find (ifstream &f, string msg, string fname)
 
static bool expect (ifstream &f, string msg, string fname)
 
static bool expectInt (ifstream &f, string msg, string fname, uint32_t &val1, uint32_t &val2)
 
static bool expectLong (ifstream &f, string msg, string fname, uint64_t &val)
 
static bool find (ifstream &f, string msg, string fname)
 
- Protected Member Functions inherited from Builder
 Builder ()
 
virtual ~Builder ()
 
void append2event (WriteRawEvent *&re, uint32_t source_id, uint32_t size)
 
 Builder ()
 
virtual ~Builder ()
 
void append2event (WriteRawEvent *&re, uint32_t source_id, uint32_t size)
 
- Protected Attributes inherited from Builder
PropertyMgr m_propMgr
 
uint32_t * m_buf
 
uint32_t m_status
 
- Static Protected Attributes inherited from Builder
static string m_confFile
 

Detailed Description

Constructor & Destructor Documentation

◆ TofMcHitBuilder() [1/2]

TofMcHitBuilder::TofMcHitBuilder ( )

Definition at line 7 of file TofMcHitBuilder.cxx.

8 :Builder()
9{
11}
Builder()
Definition: Builder.cxx:8
virtual StatusCode initialize(string &initFile)

◆ ~TofMcHitBuilder() [1/2]

virtual TofMcHitBuilder::~TofMcHitBuilder ( )
inlinevirtual

◆ TofMcHitBuilder() [2/2]

TofMcHitBuilder::TofMcHitBuilder ( )

◆ ~TofMcHitBuilder() [2/2]

virtual TofMcHitBuilder::~TofMcHitBuilder ( )
inlinevirtual

Member Function Documentation

◆ getREID() [1/2]

uint32_t TofMcHitBuilder::getREID ( uint32_t  reid)
virtual

Implements Builder.

Definition at line 121 of file TofMcHitBuilder.cxx.

122{
123 return 0;
124}

◆ getREID() [2/2]

virtual uint32_t TofMcHitBuilder::getREID ( uint32_t  reid)
virtual

Implements Builder.

◆ getTEID() [1/2]

uint32_t TofMcHitBuilder::getTEID ( uint32_t  teid)
virtual

Implements Builder.

Definition at line 115 of file TofMcHitBuilder.cxx.

116{
117 return 0;
118}

◆ getTEID() [2/2]

virtual uint32_t TofMcHitBuilder::getTEID ( uint32_t  teid)
virtual

Implements Builder.

◆ initialize() [1/2]

StatusCode TofMcHitBuilder::initialize ( string &  initFile)
virtual

Reimplemented from Builder.

Definition at line 76 of file TofMcHitBuilder.cxx.

77{
78 ifstream f;
79
80 //read init file
81 f.open(initFile.c_str());
82
83 if ( f.bad() ) {
84 cerr << "Error: could not open file " << initFile << endl;
85 return StatusCode::FAILURE;
86 }
87
88 if (!Builder::find( f, "##TofTruthConf", initFile)) {
89 cerr << "Error: could not find '##TofTruthConf' in file " << initFile << endl;
90 return StatusCode::FAILURE;
91 }
92
93 if ( !Builder::expect( f, "#TofTruthShift", initFile) ||
94 !Builder::expectInt( f, "trackIndex", initFile, m_trackIndexIndex, m_trackIndexMask) ||
95 !Builder::expectInt( f, "partId", initFile, m_partIdIndex, m_partIdMask) ||
96 !Builder::expectInt( f, "scinNb", initFile, m_scinNbIndex, m_scinNbMask) ||
97 !Builder::expectInt( f, "strip", initFile, m_stripIndex, m_stripMask) ||
98 !Builder::expect( f, "#TofTruthCoeff", initFile) ||
99 !Builder::expectLong( f, "x", initFile, m_xCoeff) ||
100 !Builder::expectLong( f, "y", initFile, m_yCoeff) ||
101 !Builder::expectLong( f, "z", initFile, m_zCoeff) ||
102 !Builder::expectLong( f, "px", initFile, m_pxCoeff) ||
103 !Builder::expectLong( f, "py", initFile, m_pyCoeff) ||
104 !Builder::expectLong( f, "pz", initFile, m_pzCoeff) ||
105 !Builder::expectLong( f, "trackLength", initFile, m_trackLengthCoeff) ||
106 !Builder::expectLong( f, "time", initFile, m_timeCoeff) )
107 return StatusCode::FAILURE;
108
109 f.close();
110
111 return StatusCode::SUCCESS;
112}
static bool expectLong(ifstream &f, string msg, string fname, uint64_t &val)
static bool expect(ifstream &f, string msg, string fname)
static bool expectInt(ifstream &f, string msg, string fname, uint32_t &val1, uint32_t &val2)
static bool find(ifstream &f, string msg, string fname)

Referenced by TofMcHitBuilder().

◆ initialize() [2/2]

virtual StatusCode TofMcHitBuilder::initialize ( string &  initFile)
virtual

Reimplemented from Builder.

◆ pack() [1/2]

StatusCode TofMcHitBuilder::pack ( TofMcHitCol *  tofMcHitCol,
WriteRawEvent *&  re 
)
virtual

Definition at line 35 of file TofMcHitBuilder.cxx.

36{
37/*
38 if (tofMcHitCol == NULL) {
39 cout << "TofMcHitBuilder::pack cant get TofMcHitCol" << endl;
40 return StatusCode::FAILURE;
41 }
42
43 vector<uint32_t> *tofReMcHitVec = new vector<uint32_t>;
44 TofTruth_t m_TofTruth;
45
46 TofMcHitCol::const_iterator pTofMcHit = tofMcHitCol->begin();
47 for ( ; pTofMcHit != tofMcHitCol->end(); pTofMcHit++) {
48 // make TofTruth_t data
49 makeTofTruth(pTofMcHit, m_TofTruth);
50 //pack the int numbers
51 uint32_t helpVal = (m_TofTruth.trackIndex<<m_trackIndexIndex) & m_trackIndexMask;
52 helpVal |= ((m_TofTruth.partId<<m_partIdIndex) & m_partIdMask);
53 helpVal |= ((m_TofTruth.scinNb<<m_scinNbIndex) & m_scinNbMask);
54 //fill the McHit vector
55 tofReMcHitVec->push_back(helpVal);
56 tofReMcHitVec->push_back(m_TofTruth.x);
57 tofReMcHitVec->push_back(m_TofTruth.y);
58 tofReMcHitVec->push_back(m_TofTruth.z);
59 tofReMcHitVec->push_back(m_TofTruth.px);
60 tofReMcHitVec->push_back(m_TofTruth.py);
61 tofReMcHitVec->push_back(m_TofTruth.pz);
62 tofReMcHitVec->push_back(m_TofTruth.trackLength);
63 tofReMcHitVec->push_back(m_TofTruth.time);
64 }
65
66 OfflineEventFormat::SubDetectorHeader sh(OfflineEventFormat::TOFTRUTH);
67 SubRawEvent *sub = new SubRawEvent(sh, tofReMcHitVec);
68 re->append(sub);
69*/
70
71 return StatusCode::SUCCESS;
72}

Referenced by RawDataTofMcHitCnv::createRep().

◆ pack() [2/2]

virtual StatusCode TofMcHitBuilder::pack ( TofMcHitCol *  tofMcHitCol,
WriteRawEvent *&  re 
)
virtual

◆ unPack() [1/2]

void TofMcHitBuilder::unPack ( vector< uint32_t >::const_iterator &  iter,
vector< uint32_t >::const_iterator &  eiter,
TofTruth_t tt 
)
virtual

Definition at line 13 of file TofMcHitBuilder.cxx.

15{
16 uint32_t helpVal = *(iter++); assert(iter != eiter);
17 tt.x = *(iter++); assert(iter != eiter);
18 tt.y = *(iter++); assert(iter != eiter);
19 tt.z = *(iter++); assert(iter != eiter);
20 tt.px = *(iter++); assert(iter != eiter);
21 tt.py = *(iter++); assert(iter != eiter);
22 tt.pz = *(iter++); assert(iter != eiter);
23 tt.trackLength= *(iter++); assert(iter != eiter);
24 tt.time = *(iter++);
25
26 tt.trackIndex = (helpVal&m_trackIndexMask) >> m_trackIndexIndex;
27 tt.partId = (helpVal&m_partIdMask) >> m_partIdIndex;
28 tt.scinNb = (helpVal&m_scinNbMask) >> m_scinNbIndex;
29 tt.strip = (helpVal&m_stripMask) >> m_stripIndex;
30
31 return;
32}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

Referenced by RawDataTofMcHitCnv::createObj().

◆ unPack() [2/2]

virtual void TofMcHitBuilder::unPack ( vector< uint32_t >::const_iterator &  ,
vector< uint32_t >::const_iterator &  ,
TofTruth_t  
)
virtual

Member Data Documentation

◆ m_pxCoeff

uint64_t TofMcHitBuilder::m_pxCoeff

◆ m_pyCoeff

uint64_t TofMcHitBuilder::m_pyCoeff

◆ m_pzCoeff

uint64_t TofMcHitBuilder::m_pzCoeff

◆ m_timeCoeff

uint64_t TofMcHitBuilder::m_timeCoeff

◆ m_trackLengthCoeff

uint64_t TofMcHitBuilder::m_trackLengthCoeff

◆ m_xCoeff

uint64_t TofMcHitBuilder::m_xCoeff

◆ m_yCoeff

uint64_t TofMcHitBuilder::m_yCoeff

◆ m_zCoeff

uint64_t TofMcHitBuilder::m_zCoeff

The documentation for this class was generated from the following files: