StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcDataDrivenMcReplaceInfo.cxx
1 //
2 // Ilya Selyuzhenkov <ilya.selyuzhenkov@gmail.com>
3 // Indiana University Cyclotron Facility
4 //
5 // Pibero Djawotho <pibero@indiana.edu>
6 // Indiana University Cyclotron Facility
7 //
8 
9 #include "StEEmcDataDrivenMcReplaceInfo.h"
10 
12 
13 StEEmcDataDrivenMcReplaceInfo::StEEmcDataDrivenMcReplaceInfo()
14 {
15  InitArrays();
16  Clear();
17 }
18 
19 void StEEmcDataDrivenMcReplaceInfo::Clear(Option_t* options)
20 {
21  pid = -999;
22  parentPid = -999;
23  firstHadronPid = -999;
24  libraryShapeId = -999;
25  momentum.SetXYZ(-999, -999,-999);
26  energy = -999;
27  energyScaleU = -999;
28  energyScaleV = -999;
29  highStripShiftU = -999;
30  highStripShiftV = -999;
31  libraryBinId = -999;
32  memset(dEnergy, 0, sizeof(dEnergy));
33  memset(totalEnergy, 0, sizeof(totalEnergy));
34  memset(totalEnergyScaled, 0, sizeof(totalEnergyScaled));
35 
36  mMcHitsEsmdU->Clear();
37  mMcHitsEsmdV->Clear();
38 }
39 
40 void StEEmcDataDrivenMcReplaceInfo::InitArrays()
41 {
42  mMcHitsEsmdU = new TClonesArray("StMcCalorimeterHit",1000);
43  mMcHitsEsmdV = new TClonesArray("StMcCalorimeterHit",1000);
44 }
45 
46 StMcCalorimeterHit* StEEmcDataDrivenMcReplaceInfo::newMcHitEsmdU()
47 {
48  TClonesArray &mMcHitsEsmdUs = *mMcHitsEsmdU;
49  return new (mMcHitsEsmdUs[mMcHitsEsmdUs.GetEntriesFast()]) StMcCalorimeterHit;
50 }
51 
52 StMcCalorimeterHit *StEEmcDataDrivenMcReplaceInfo::newMcHitEsmdV()
53 {
54  TClonesArray &mMcHitsEsmdVs = *mMcHitsEsmdV;
55  return new (mMcHitsEsmdVs[mMcHitsEsmdVs.GetEntriesFast()]) StMcCalorimeterHit;
56 }
57 
58 StMcCalorimeterHit *StEEmcDataDrivenMcReplaceInfo::addMcHitEsmdU(StMcCalorimeterHit* hit)
59 {
60  TClonesArray &mMcHitsEsmdUs = *mMcHitsEsmdU;
61  StMcCalorimeterHit* mcHitEsmdU = new (mMcHitsEsmdUs[mMcHitsEsmdUs.GetEntriesFast()]) StMcCalorimeterHit(*hit);
62  mcHitEsmdU->setParentTrack(0);
63  return mcHitEsmdU;
64 }
65 
66 StMcCalorimeterHit *StEEmcDataDrivenMcReplaceInfo::addMcHitEsmdV(StMcCalorimeterHit* hit)
67 {
68  TClonesArray &mMcHitsEsmdVs = *mMcHitsEsmdV;
69  StMcCalorimeterHit *mcHitEsmdV = new (mMcHitsEsmdVs[mMcHitsEsmdVs.GetEntriesFast()]) StMcCalorimeterHit(*hit);
70  mcHitEsmdV->setParentTrack(0);
71  return mcHitEsmdV;
72 }