BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
MucMcHitBuilder Class Reference

#include <MucMcHitBuilder.h>

+ Inheritance diagram for MucMcHitBuilder:

Public Member Functions

 MucMcHitBuilder ()
 
virtual ~MucMcHitBuilder ()
 
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 &, MucTruth_t &)
 
virtual StatusCode pack (MucMcHitCol *mucMcHitCol, WriteRawEvent *&re)
 
 MucMcHitBuilder ()
 
virtual ~MucMcHitBuilder ()
 
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 &, MucTruth_t &)
 
virtual StatusCode pack (MucMcHitCol *mucMcHitCol, 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
 

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, uint32_t shift=0)
 
 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

Constructor & Destructor Documentation

◆ MucMcHitBuilder() [1/2]

MucMcHitBuilder::MucMcHitBuilder ( )

Definition at line 7 of file MucMcHitBuilder.cxx.

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

◆ ~MucMcHitBuilder() [1/2]

virtual MucMcHitBuilder::~MucMcHitBuilder ( )
inlinevirtual

◆ MucMcHitBuilder() [2/2]

MucMcHitBuilder::MucMcHitBuilder ( )

◆ ~MucMcHitBuilder() [2/2]

virtual MucMcHitBuilder::~MucMcHitBuilder ( )
inlinevirtual

Member Function Documentation

◆ getREID() [1/2]

uint32_t MucMcHitBuilder::getREID ( uint32_t  reid)
virtual

Implements Builder.

Definition at line 120 of file MucMcHitBuilder.cxx.

121{
122 return 0;
123}

◆ getREID() [2/2]

virtual uint32_t MucMcHitBuilder::getREID ( uint32_t  reid)
virtual

Implements Builder.

◆ getTEID() [1/2]

uint32_t MucMcHitBuilder::getTEID ( uint32_t  teid)
virtual

Implements Builder.

Definition at line 114 of file MucMcHitBuilder.cxx.

115{
116 return 0;
117}

◆ getTEID() [2/2]

virtual uint32_t MucMcHitBuilder::getTEID ( uint32_t  teid)
virtual

Implements Builder.

◆ initialize() [1/2]

StatusCode MucMcHitBuilder::initialize ( string &  initFile)
virtual

Reimplemented from Builder.

Definition at line 76 of file MucMcHitBuilder.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, "##MucTruthConf", initFile)) {
89 cerr << "Error: could not find '##MucTruthConf' in file " << initFile << endl;
90 return StatusCode::FAILURE;
91 }
92
93 if ( !Builder::expect( f, "#MucTruthShift", 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, "segId", initFile, m_segIdIndex, m_segIdMask) ||
97 !Builder::expectInt( f, "gapId", initFile, m_gapIdIndex, m_gapIdMask) ||
98 !Builder::expectInt( f, "stripId", initFile, m_stripIdIndex, m_stripIdMask) ||
99 !Builder::expect( f, "#MucTruthCoeff", initFile) ||
100 !Builder::expectLong( f, "x", initFile, m_xCoeff) ||
101 !Builder::expectLong( f, "y", initFile, m_yCoeff) ||
102 !Builder::expectLong( f, "z", initFile, m_zCoeff) ||
103 !Builder::expectLong( f, "px", initFile, m_pxCoeff) ||
104 !Builder::expectLong( f, "py", initFile, m_pyCoeff) ||
105 !Builder::expectLong( f, "pz", initFile, m_pzCoeff) )
106 return StatusCode::FAILURE;
107
108 f.close();
109
110 return StatusCode::SUCCESS;
111}
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)
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")

Referenced by MucMcHitBuilder().

◆ initialize() [2/2]

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

Reimplemented from Builder.

◆ pack() [1/2]

StatusCode MucMcHitBuilder::pack ( MucMcHitCol *  mucMcHitCol,
WriteRawEvent *&  re 
)
virtual

Definition at line 34 of file MucMcHitBuilder.cxx.

35{
36/*
37
38 if (mucMcHitCol == NULL) {
39 cout << "MucMcHitBuilder::pack cant get MucMcHitCol" << endl;
40 return StatusCode::FAILURE;
41 }
42
43 vector<uint32_t> *mucReMcHitVec = new vector<uint32_t>;
44 MucTruth_t m_MucTruth;
45
46 MucMcHitCol::const_iterator pMucMcHit = mucMcHitCol->begin();
47 for ( ; pMucMcHit != mucMcHitCol->end(); pMucMcHit++) {
48 //make the MucTruth data
49 makeMucTruth(pMucMcHit, m_MucTruth);
50 //pack integers in mucTruth
51 uint32_t helpVal = (m_MucTruth.trackIndex<<m_trackIndexIndex) & m_trackIndexMask;
52 helpVal |= ((m_MucTruth.partId<<m_partIdIndex) & m_partIdMask);
53 helpVal |= ((m_MucTruth.segId<<m_segIdIndex) & m_segIdMask);
54 helpVal |= ((m_MucTruth.gapId<<m_gapIdIndex) & m_gapIdMask);
55 helpVal |= ((m_MucTruth.stripId<<m_stripIdIndex) & m_stripIdMask);
56 //fill the McHit vector
57 mucReMcHitVec->push_back(helpVal);
58 mucReMcHitVec->push_back(m_MucTruth.x);
59 mucReMcHitVec->push_back(m_MucTruth.y);
60 mucReMcHitVec->push_back(m_MucTruth.z);
61 mucReMcHitVec->push_back(m_MucTruth.px);
62 mucReMcHitVec->push_back(m_MucTruth.py);
63 mucReMcHitVec->push_back(m_MucTruth.pz);
64 }
65
66 OfflineEventFormat::SubDetectorHeader sh(OfflineEventFormat::MUCTRUTH);
67 SubRawEvent *sub = new SubRawEvent(sh, mucReMcHitVec);
68 re->append(sub);
69 */
70
71 return StatusCode::SUCCESS;
72}

Referenced by RawDataMucMcHitCnv::createRep().

◆ pack() [2/2]

virtual StatusCode MucMcHitBuilder::pack ( MucMcHitCol *  mucMcHitCol,
WriteRawEvent *&  re 
)
virtual

◆ unPack() [1/2]

void MucMcHitBuilder::unPack ( vector< uint32_t >::const_iterator &  iter,
vector< uint32_t >::const_iterator &  eiter,
MucTruth_t mt 
)
virtual

Definition at line 13 of file MucMcHitBuilder.cxx.

15{
16 uint32_t helpVal = *(iter++); assert(iter != eiter);
17 mt.x = *(iter++); assert(iter != eiter);
18 mt.y = *(iter++); assert(iter != eiter);
19 mt.z = *(iter++); assert(iter != eiter);
20 mt.px = *(iter++); assert(iter != eiter);
21 mt.py = *(iter++); assert(iter != eiter);
22 mt.pz = *(iter++);
23
24 mt.trackIndex = (helpVal&m_trackIndexMask) >> m_trackIndexIndex;
25 mt.partId = (helpVal&m_partIdMask) >> m_partIdIndex;
26 mt.segId = (helpVal&m_segIdMask) >> m_segIdIndex;
27 mt.gapId = (helpVal&m_gapIdMask) >> m_gapIdIndex;
28 mt.stripId = (helpVal&m_stripIdMask) >> m_stripIdIndex;
29
30 return;
31}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

Referenced by RawDataMucMcHitCnv::createObj().

◆ unPack() [2/2]

virtual void MucMcHitBuilder::unPack ( vector< uint32_t >::const_iterator &  ,
vector< uint32_t >::const_iterator &  ,
MucTruth_t  
)
virtual

Member Data Documentation

◆ m_pxCoeff

uint64_t MucMcHitBuilder::m_pxCoeff

◆ m_pyCoeff

uint64_t MucMcHitBuilder::m_pyCoeff

◆ m_pzCoeff

uint64_t MucMcHitBuilder::m_pzCoeff

◆ m_xCoeff

uint64_t MucMcHitBuilder::m_xCoeff

◆ m_yCoeff

uint64_t MucMcHitBuilder::m_yCoeff

◆ m_zCoeff

uint64_t MucMcHitBuilder::m_zCoeff

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