BOSS 7.0.6
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)
 
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
 
- 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)
 
- Protected Member Functions inherited from Builder
 Builder ()
 
virtual ~Builder ()
 
void append2event (WriteRawEvent *&re, uint32_t source_id, uint32_t size, uint32_t shift=0)
 
- 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

Definition at line 12 of file EmcMcHitBuilder.h.

Constructor & Destructor Documentation

◆ EmcMcHitBuilder()

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()

virtual EmcMcHitBuilder::~EmcMcHitBuilder ( )
inlinevirtual

Definition at line 17 of file EmcMcHitBuilder.h.

17{};

Member Function Documentation

◆ getREID()

uint32_t EmcMcHitBuilder::getREID ( uint32_t  reid)
virtual

Implements Builder.

Definition at line 119 of file EmcMcHitBuilder.cxx.

120{
121 return 0;
122}

◆ getTEID()

uint32_t EmcMcHitBuilder::getTEID ( uint32_t  teid)
virtual

Implements Builder.

Definition at line 113 of file EmcMcHitBuilder.cxx.

114{
115 return 0;
116}

◆ initialize()

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 find(ifstream &f, string msg, string fname)
Definition: Builder.cxx:60
static bool expect(ifstream &f, string msg, string fname)
Definition: Builder.cxx:28
static bool expectLong(ifstream &f, string msg, string fname, uint64_t &val)
Definition: Builder.cxx:52
static bool expectInt(ifstream &f, string msg, string fname, uint32_t &val1, uint32_t &val2)
Definition: Builder.cxx:44
uint64_t m_totalEdepCoeff
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
std::ifstream ifstream
Definition: bpkt_streams.h:44

Referenced by EmcMcHitBuilder().

◆ pack()

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().

◆ unPack()

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().

Member Data Documentation

◆ m_pxCoeff

uint64_t EmcMcHitBuilder::m_pxCoeff

Definition at line 43 of file EmcMcHitBuilder.h.

Referenced by RawDataEmcMcHitCnv::createObj(), and initialize().

◆ m_pyCoeff

uint64_t EmcMcHitBuilder::m_pyCoeff

Definition at line 44 of file EmcMcHitBuilder.h.

Referenced by RawDataEmcMcHitCnv::createObj(), and initialize().

◆ m_pzCoeff

uint64_t EmcMcHitBuilder::m_pzCoeff

Definition at line 45 of file EmcMcHitBuilder.h.

Referenced by RawDataEmcMcHitCnv::createObj(), and initialize().

◆ m_totalEdepCoeff

uint64_t EmcMcHitBuilder::m_totalEdepCoeff

Definition at line 46 of file EmcMcHitBuilder.h.

Referenced by RawDataEmcMcHitCnv::createObj(), and initialize().

◆ m_xCoeff

uint64_t EmcMcHitBuilder::m_xCoeff

Definition at line 40 of file EmcMcHitBuilder.h.

Referenced by RawDataEmcMcHitCnv::createObj(), and initialize().

◆ m_yCoeff

uint64_t EmcMcHitBuilder::m_yCoeff

Definition at line 41 of file EmcMcHitBuilder.h.

Referenced by RawDataEmcMcHitCnv::createObj(), and initialize().

◆ m_zCoeff

uint64_t EmcMcHitBuilder::m_zCoeff

Definition at line 42 of file EmcMcHitBuilder.h.

Referenced by RawDataEmcMcHitCnv::createObj(), and initialize().


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