75 {
76
78 G4DigiManager* digiManager = G4DigiManager::GetDMpointer();
79 G4int THCID = digiManager->GetHitsCollectionID( "BesTofHitsCollection" );
81
82 if ( m_THC )
83 {
84 m_scintGroup = new vector<ScintSingle*>;
85
87 G4int size = m_scintGroup->size();
88
89
90
91
92 ScintSingle* scint;
93 G4int partId;
94 for ( G4int i = 0; i < size; i++ )
95 {
96 scint = ( *m_scintGroup )[i];
98
99
100
101
102 if ( partId == 1 )
103 {
104 if ( m_versionBr == 1 ) tofDMBr1->Digitize( scint, m_besTofDigitsCollection );
105 else if ( m_versionBr == 2 )
106 {
107
108 tofDMBr2->Digitize( scint, m_besTofDigitsCollection );
109 }
110 else { tofDMBr2->Digitize( scint, m_besTofDigitsCollection ); }
111 }
112 else
113 {
114 if ( m_versionEc == 1 ) { tofDMEc1->Digitize( scint, m_besTofDigitsCollection ); }
115 else if ( m_versionEc == 2 ) { tofDMEc2->Digitize( scint, m_besTofDigitsCollection ); }
116 else if ( m_versionEc == 3 ) { tofDMEc3->Digitize( scint, m_besTofDigitsCollection ); }
117 else if ( m_versionEc == 4 ) { tofDMEc4->Digitize( scint, m_besTofDigitsCollection ); }
118 else
119 {
120 cout << "TofSim: Warning: BesTofDigitizerEcV2 is utilized otherwise!" << endl;
121 tofDMEc2->Digitize( scint, m_besTofDigitsCollection );
122 }
123 }
124 }
125
126 if ( m_scintGroup )
127 {
128 for ( size_t i = 0; i < m_scintGroup->size(); i++ )
129 {
130 delete ( *m_scintGroup )[i];
131
132
133 }
134 m_scintGroup->clear();
135 delete m_scintGroup;
136 }
137 }
138
139 StoreDigiCollection( m_besTofDigitsCollection );
140}
G4TDigiCollection< BesTofDigi > BesTofDigitsCollection
G4THitsCollection< BesTofHit > BesTofHitsCollection