CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
BesMucDigitizer Class Reference

#include <BesMucDigitizer.hh>

+ Inheritance diagram for BesMucDigitizer:

Public Member Functions

 BesMucDigitizer (G4String modName)
 
 ~BesMucDigitizer ()
 
virtual void Digitize ()
 

Detailed Description

Definition at line 23 of file BesMucDigitizer.hh.

Constructor & Destructor Documentation

◆ BesMucDigitizer()

BesMucDigitizer::BesMucDigitizer ( G4String modName)

Definition at line 31 of file BesMucDigitizer.cc.

32:G4VDigitizerModule(modName)
33{
34 collectionName.push_back("BesMucDigisCollection");
35 m_besMucDigisCollection=0;
36
37 //Standard unit: length in mm; time in ns; energy in MeV; att in mm;
38 //Here: att in mm; vel in m/s; threshold in MeV; mucRes in ps;
39
40
41 //retrieve G4Svc
42 ISvcLocator* svcLocator = Gaudi::svcLocator();
43 IG4Svc* tmpSvc;
44 StatusCode sc=svcLocator->service("G4Svc", tmpSvc);
45 m_G4Svc=dynamic_cast<G4Svc *>(tmpSvc);
46
47 //get Muc Ntuple from G4Svc
48 if(m_G4Svc->MucRootFlag())
49 {
50 m_tupleMuc = m_G4Svc->GetTupleMuc();
51 sc = m_tupleMuc->addItem("part",m_part);
52 sc = m_tupleMuc->addItem("seg",m_seg);
53 sc = m_tupleMuc->addItem("gap",m_gap);
54 sc = m_tupleMuc->addItem("strip",m_strip);
55
56 }
57
58
59
60
61 Initialize();
62}
Definition G4Svc.h:32
bool MucRootFlag()
Definition G4Svc.h:129
NTuple::Tuple * GetTupleMuc()
Definition G4Svc.h:122

◆ ~BesMucDigitizer()

BesMucDigitizer::~BesMucDigitizer ( )

Definition at line 64 of file BesMucDigitizer.cc.

65{
66}

Member Function Documentation

◆ Digitize()

void BesMucDigitizer::Digitize ( )
virtual

Definition at line 82 of file BesMucDigitizer.cc.

83{
84 Initialize();
85
86 m_besMucDigisCollection = new BesMucDigisCollection(moduleName, collectionName[0]);
87 G4DigiManager* DigiMan = G4DigiManager::GetDMpointer();
88
89 //hits collection ID
90 G4int THCID;
91 THCID = DigiMan->GetHitsCollectionID("BesMucHitsCollection");
92
93 //hits collection
94 BesMucHitsCollection* THC = 0;
95 THC = (BesMucHitsCollection*) (DigiMan->GetHitsCollection(THCID));
96
97 if(THC) {
98 G4int trackIndex, part, seg, gap, strip;
99 BesMucDigit *aDigit = new BesMucDigit();
100
101 G4int n_hit = THC->entries();
102 for(G4int i = 0; i < n_hit; i++) {
103 aDigit->SetHit((*THC)[i]);
104 trackIndex = aDigit->GetTrackIndex();
105 part = aDigit->GetPart();
106 seg = aDigit->GetSeg();
107 gap = aDigit->GetGap();
108 strip = aDigit->GetNearestStripNo();
109
110 //fill muc Ntuple
111 if(m_G4Svc->MucRootFlag())
112 {
113 m_part = part;
114 m_seg = seg;
115 m_gap = gap;
116 m_strip = strip;
117
118 m_tupleMuc->write();
119 }
120
121 (*THC)[i]->SetPart(part);
122 (*THC)[i]->SetSeg(seg);
123 (*THC)[i]->SetGap(gap);
124 (*THC)[i]->SetStrip(strip);
125 if(m_stripID[part][seg][gap][strip] == 0) {
126 NewDigi(trackIndex, part, seg, gap, strip);
127 }
128 else {
129 OldDigi();
130 }
131 }
132 //Smear();
133 StoreDigiCollection(m_besMucDigisCollection);
134 delete aDigit;
135 }
136}
G4TDigiCollection< BesMucDigi > BesMucDigisCollection
Definition BesMucDigi.hh:56
G4THitsCollection< BesMucHit > BesMucHitsCollection
Definition BesMucHit.hh:104
G4int GetGap()
G4int GetPart()
G4int GetTrackIndex()
G4int GetNearestStripNo()
G4int GetSeg()
void SetHit(BesMucHit *hit)

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