25#include "G4DigiManager.hh"
28#include "GaudiKernel/ISvcLocator.h"
29#include "GaudiKernel/Bootstrap.h"
30#include "GaudiKernel/IDataProviderSvc.h"
35#include "GaudiKernel/MsgStream.h"
40 :G4VDigitizerModule(modName)
42 collectionName.push_back(
"BesTofDigitsCollection");
43 m_besTofDigitsCollection=0;
66 std::cout << std::endl <<
"BesTofDigitizer You are using the new EC Tof (MRPC) Digitizer!" << std::endl;
71 std::cout << std::endl <<
"BesTofDigitizer You are using the old EC Tof Digitizer!" << std::endl;
87 G4DigiManager* digiManager = G4DigiManager::GetDMpointer();
88 G4int THCID = digiManager->GetHitsCollectionID(
"BesTofHitsCollection");
100 m_scintGroup =
new vector<ScintSingle*>;
102 G4int size=m_scintGroup->size();
109 for (G4int i=0;i<size;i++)
111 scint = (*m_scintGroup)[i];
119 tofDMBr1->
Digitize(scint,m_besTofDigitsCollection);
120 else if (m_versionBr==2){
122 tofDMBr2->
Digitize(scint,m_besTofDigitsCollection);
125 tofDMBr2->
Digitize(scint,m_besTofDigitsCollection);
130 tofDMEc1->
Digitize(scint,m_besTofDigitsCollection);
131 else if (m_versionEc==2)
132 tofDMEc2->
Digitize(scint,m_besTofDigitsCollection);
133 else if (m_versionEc==3){
134 tofDMEc3->
Digitize(scint,m_besTofDigitsCollection);}
135 else if (m_versionEc==4)
136 tofDMEc4->
Digitize(scint,m_besTofDigitsCollection);
139 cout <<
"Warning: BesTofDigitizerEcV2 is utilized otherwise!" << endl;
140 tofDMEc2->
Digitize(scint,m_besTofDigitsCollection);
146 for (
size_t i=0;i<m_scintGroup->size();i++)
148 delete (*m_scintGroup)[i];
152 m_scintGroup->clear();
158 StoreDigiCollection(m_besTofDigitsCollection);
163 G4int partId, scinNb,size,flag;
166 G4int nHits = m_THC->entries();
169 for (G4int i=0;i<nHits;i++)
175 size=m_scintGroup->size();
180 for (G4int j=0; j<size;j++)
182 oldScint = (*m_scintGroup)[j];
202 m_scintGroup->push_back(newScint);
G4TDigiCollection< BesTofDigi > BesTofDigitsCollection
G4THitsCollection< BesTofHit > BesTofHitsCollection
virtual void Digitize(ScintSingle *, BesTofDigitsCollection *)
virtual void Digitize(ScintSingle *, BesTofDigitsCollection *)
virtual void Digitize(ScintSingle *, BesTofDigitsCollection *)
virtual void Digitize(ScintSingle *, BesTofDigitsCollection *)
virtual void Digitize(ScintSingle *, BesTofDigitsCollection *)
virtual void Digitize(ScintSingle *, BesTofDigitsCollection *)
BesTofDigitizer(G4String modName)
vector< G4int > * GetHitIndexes()