16#include "G4DigiManager.hh"
17#include "Randomize.hh"
19#include "GaudiKernel/ISvcLocator.h"
20#include "GaudiKernel/Bootstrap.h"
21#include "GaudiKernel/IDataProviderSvc.h"
26const G4int BesMucDigitizer::m_nPartMax;
27const G4int BesMucDigitizer::m_nSegMax;
28const G4int BesMucDigitizer::m_nGapMax;
29const G4int BesMucDigitizer::m_nStripMax;
32:G4VDigitizerModule(modName)
34 collectionName.push_back(
"BesMucDigisCollection");
35 m_besMucDigisCollection=0;
42 ISvcLocator* svcLocator = Gaudi::svcLocator();
44 StatusCode sc=svcLocator->service(
"G4Svc", tmpSvc);
45 m_G4Svc=
dynamic_cast<G4Svc *
>(tmpSvc);
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);
68void BesMucDigitizer::Initialize()
70 for(G4int i = 0; i < m_nPartMax; i++) {
71 for(G4int j = 0; j < m_nSegMax; j++) {
72 for(G4int k = 0; k < m_nGapMax; k++) {
73 for(G4int l = 0; l < m_nStripMax; l++) {
74 m_stripID[i][j][k][l] = 0;
87 G4DigiManager* DigiMan = G4DigiManager::GetDMpointer();
91 THCID = DigiMan->GetHitsCollectionID(
"BesMucHitsCollection");
98 G4int trackIndex, part, seg, gap, strip;
101 G4int n_hit = THC->entries();
102 for(G4int i = 0; i < n_hit; i++) {
103 aDigit->
SetHit((*THC)[i]);
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);
133 StoreDigiCollection(m_besMucDigisCollection);
138void BesMucDigitizer::NewDigi(G4int trackIndex, G4int part, G4int seg, G4int gap, G4int strip)
146 m_besMucDigisCollection->insert(digi);
148 m_stripID[part][seg][gap][strip] = 1;
151void BesMucDigitizer::OldDigi()
154void BesMucDigitizer::Smear()
G4TDigiCollection< BesMucDigi > BesMucDigisCollection
G4THitsCollection< BesMucHit > BesMucHitsCollection
void SetPartId(G4int partId)
void SetTrackIndex(G4int index)
void SetSegId(G4int segId)
void SetGapId(G4int gapId)
void SetStripId(G4int stripId)
G4int GetNearestStripNo()
void SetHit(BesMucHit *hit)
BesMucDigitizer(G4String modName)
NTuple::Tuple * GetTupleMuc()