BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcMcHitBuilder Class Reference

#include <EmcMcHitBuilder.h>

+ Inheritance diagram for EmcMcHitBuilder:

Public Member Functions

 EmcMcHitBuilder ()
 
virtual ~EmcMcHitBuilder ()
 
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 &, EmcTruth_t &)
 
virtual StatusCode pack (EmcMcHitCol *emcMcHitCol, WriteRawEvent *&re)
 
 EmcMcHitBuilder ()
 
virtual ~EmcMcHitBuilder ()
 
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 &, EmcTruth_t &)
 
virtual StatusCode pack (EmcMcHitCol *emcMcHitCol, 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_totalEdepCoeff
 

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

◆ EmcMcHitBuilder() [1/2]

EmcMcHitBuilder::EmcMcHitBuilder ( )

Definition at line 7 of file EmcMcHitBuilder.cxx.

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

◆ ~EmcMcHitBuilder() [1/2]

virtual EmcMcHitBuilder::~EmcMcHitBuilder ( )
inlinevirtual

◆ EmcMcHitBuilder() [2/2]

EmcMcHitBuilder::EmcMcHitBuilder ( )

◆ ~EmcMcHitBuilder() [2/2]

virtual EmcMcHitBuilder::~EmcMcHitBuilder ( )
inlinevirtual

Member Function Documentation

◆ getREID() [1/2]

uint32_t EmcMcHitBuilder::getREID ( uint32_t  reid)
virtual

Implements Builder.

Definition at line 119 of file EmcMcHitBuilder.cxx.

120{
121 return 0;
122}

◆ getREID() [2/2]

virtual uint32_t EmcMcHitBuilder::getREID ( uint32_t  reid)
virtual

Implements Builder.

◆ getTEID() [1/2]

uint32_t EmcMcHitBuilder::getTEID ( uint32_t  teid)
virtual

Implements Builder.

Definition at line 113 of file EmcMcHitBuilder.cxx.

114{
115 return 0;
116}

◆ getTEID() [2/2]

virtual uint32_t EmcMcHitBuilder::getTEID ( uint32_t  teid)
virtual

Implements Builder.

◆ initialize() [1/2]

StatusCode EmcMcHitBuilder::initialize ( string &  initFile)
virtual

Reimplemented from Builder.

Definition at line 75 of file EmcMcHitBuilder.cxx.

76{
77 ifstream f;
78
79 //read init file
80 f.open(initFile.c_str());
81
82 if ( f.bad() ) {
83 cerr << "Error: could not open file " << initFile << endl;
84 return StatusCode::FAILURE;
85 }
86
87 if (!Builder::find( f, "##EmcTruthConf", initFile)) {
88 cerr << "Error: could not find '##EmcTruthConf' in file " << initFile << endl;
89 return StatusCode::FAILURE;
90 }
91
92 if ( !Builder::expect( f, "#EmcTruthShift", initFile) ||
93 !Builder::expectInt( f, "trackIndex", initFile, m_trackIndexIndex, m_trackIndexMask) ||
94 !Builder::expectInt( f, "partId", initFile, m_partIdIndex, m_partIdMask) ||
95 !Builder::expectInt( f, "numTheta", initFile, m_numThetaIndex, m_numThetaMask) ||
96 !Builder::expectInt( f, "numPhi", initFile, m_numPhiIndex, m_numPhiMask) ||
97 !Builder::expect( f, "#EmcTruthCoeff", initFile) ||
98 !Builder::expectLong( f, "x", initFile, m_xCoeff) ||
99 !Builder::expectLong( f, "y", initFile, m_yCoeff) ||
100 !Builder::expectLong( f, "z", initFile, m_zCoeff) ||
101 !Builder::expectLong( f, "px", initFile, m_pxCoeff) ||
102 !Builder::expectLong( f, "py", initFile, m_pyCoeff) ||
103 !Builder::expectLong( f, "pz", initFile, m_pzCoeff) ||
104 !Builder::expectLong( f, "totalEdep", initFile, m_totalEdepCoeff) )
105 return StatusCode::FAILURE;
106
107 f.close();
108
109 return StatusCode::SUCCESS;
110}
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 EmcMcHitBuilder().

◆ initialize() [2/2]

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

Reimplemented from Builder.

◆ pack() [1/2]

StatusCode EmcMcHitBuilder::pack ( EmcMcHitCol *  emcMcHitCol,
WriteRawEvent *&  re 
)
virtual

Definition at line 34 of file EmcMcHitBuilder.cxx.

35{
36 /*
37 if (emcMcHitCol == NULL) {
38 cout << "EmcMcHitBuilder::pack cant get EmcMcHitCol" << endl;
39 return StatusCode::FAILURE;
40 }
41
42 vector<uint32_t> *emcReMcHitVec = new vector<uint32_t>;
43 EmcTruth_t m_EmcTruth;
44
45 EmcMcHitCol::const_iterator pEmcMcHit = emcMcHitCol->begin();
46 for ( ; pEmcMcHit != emcMcHitCol->end(); pEmcMcHit++) {
47 // Make the EmcTruth Data
48 makeEmcTruth(pEmcMcHit, m_EmcTruth);
49 // pack
50 uint32_t helpVal = (m_EmcTruth.trackIndex<<m_trackIndexIndex) & m_trackIndexMask;
51 helpVal |= ((m_EmcTruth.partId<<m_partIdIndex) & m_partIdMask);
52 helpVal |= ((m_EmcTruth.numTheta<<m_numThetaIndex) & m_numThetaMask);
53 helpVal |= ((m_EmcTruth.numPhi<<m_numPhiIndex) & m_numPhiMask);
54 // fill the McHit vector
55 emcReMcHitVec->push_back(helpVal);
56 emcReMcHitVec->push_back(m_EmcTruth.x);
57 emcReMcHitVec->push_back(m_EmcTruth.y);
58 emcReMcHitVec->push_back(m_EmcTruth.z);
59 emcReMcHitVec->push_back(m_EmcTruth.px);
60 emcReMcHitVec->push_back(m_EmcTruth.py);
61 emcReMcHitVec->push_back(m_EmcTruth.pz);
62 emcReMcHitVec->push_back(m_EmcTruth.totalEdep);
63 }
64
65 OfflineEventFormat::SubDetectorHeader sh(OfflineEventFormat::EMCTRUTH);
66 SubRawEvent *sub = new SubRawEvent(sh, emcReMcHitVec);
67 re->append(sub);
68 */
69
70 return StatusCode::SUCCESS;
71}

Referenced by RawDataEmcMcHitCnv::createRep().

◆ pack() [2/2]

virtual StatusCode EmcMcHitBuilder::pack ( EmcMcHitCol *  emcMcHitCol,
WriteRawEvent *&  re 
)
virtual

◆ unPack() [1/2]

void EmcMcHitBuilder::unPack ( vector< uint32_t >::const_iterator &  iter,
vector< uint32_t >::const_iterator &  eiter,
EmcTruth_t et 
)
virtual

Definition at line 13 of file EmcMcHitBuilder.cxx.

15{
16 uint32_t helpVal = *(iter++); assert(iter != eiter);
17 et.x = *(iter++); assert(iter != eiter);
18 et.y = *(iter++); assert(iter != eiter);
19 et.z = *(iter++); assert(iter != eiter);
20 et.px = *(iter++); assert(iter != eiter);
21 et.py = *(iter++); assert(iter != eiter);
22 et.pz = *(iter++); assert(iter != eiter);
23 et.totalEdep = *(iter++);
24
25 et.trackIndex = (helpVal&m_trackIndexMask) >> m_trackIndexIndex;
26 et.partId = (helpVal&m_partIdMask) >> m_partIdIndex;
27 et.numTheta = (helpVal&m_numThetaMask) >> m_numThetaIndex;
28 et.numPhi = (helpVal&m_numPhiMask) >> m_numPhiIndex;
29
30 return;
31}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

Referenced by RawDataEmcMcHitCnv::createObj().

◆ unPack() [2/2]

virtual void EmcMcHitBuilder::unPack ( vector< uint32_t >::const_iterator &  ,
vector< uint32_t >::const_iterator &  ,
EmcTruth_t  
)
virtual

Member Data Documentation

◆ m_pxCoeff

uint64_t EmcMcHitBuilder::m_pxCoeff

◆ m_pyCoeff

uint64_t EmcMcHitBuilder::m_pyCoeff

◆ m_pzCoeff

uint64_t EmcMcHitBuilder::m_pzCoeff

◆ m_totalEdepCoeff

uint64_t EmcMcHitBuilder::m_totalEdepCoeff

◆ m_xCoeff

uint64_t EmcMcHitBuilder::m_xCoeff

◆ m_yCoeff

uint64_t EmcMcHitBuilder::m_yCoeff

◆ m_zCoeff

uint64_t EmcMcHitBuilder::m_zCoeff

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