70{
72
73
75 ("BesEmcDigitizer","BesEmcDigitsCollection");
76 G4DigiManager* DigiMan = G4DigiManager::GetDMpointer();
77
78
79
80 G4int EHCID;
81 EHCID = DigiMan->GetHitsCollectionID("BesEmcHitsCollection");
82
83
86
87 if (EHC)
88 {
89
90 m_crystalGroup = new vector<CrystalSingle*>;
92 G4int size=m_crystalGroup->size();
94 G4int partId, nTheta,
nPhi, nHits;
95 G4double eTot=0, eDigi;
97
99
100 for(G4int i=0;i<size;i++)
101 {
102 cryst = (*m_crystalGroup)[i];
108 eTot += eDigi;
109
113
114 const int indexSize = 200;
115 G4double e[indexSize];
116 for(G4int i=0;i<indexSize;i++)
117 e[i]=0;
118 G4int index=0;
120
121 for(G4int j=0;j<nHits;j++)
122 {
126 if(index<indexSize&&index>=0)
128 else
129 G4cout<<"Track index overload!"<<G4endl;
130 }
131
132 G4double maxi=e[0];
133 for(G4int i=1;i<indexSize;i++)
134 {
135 if(e[i]>maxi)
136 {
137 maxi = e[i];
138 index = i;
139 }
140 }
141
142 if(eDigi>0)
143 {
150
154
155
156 m_energy = wave->
max(
bin);
157
158 m_energy -= 0.46*MeV;
161
163 {
164 G4int index = m_emcCalibConstSvc->
getIndex(partId,nTheta,
nPhi);
166
168
171
172 if (emaxData>0) {
173
174 adc2e=emaxData/2.5;
175 }
176 }
177
178 if(adc2e<=1e-5)
179 {
180 m_energy = 0;
181 }
182 else if (m_G4Svc->
EmcElecSatuDead()==1&&CrystalDeadEcut>0&&m_energy/1000.0>CrystalDeadEcut)
183 {
184
185 m_energy = 0;
186 }
187 else
188 {
189
190 m_energy /= adc2e;
191
192
193
194 }
195 }
196
197
199 {
200 m_partId = partId;
201 m_nTheta = nTheta;
203 m_eDep = eDigi;
204 m_nHits = nHits;
205 m_adc = m_energy;
207 m_tupleEmc1->write();
208 }
209
213 m_besEmcDigitsCollection->insert(digi);
214 }
215 }
216
217
221 ;
222
223
224
226 {
227 m_eTot = eTot;
228 m_nDigi = size;
229 m_tupleEmc2->write();
230 }
231
232 StoreDigiCollection(m_besEmcDigitsCollection);
233
234 for(size_t i=0;i<m_crystalGroup->size();i++)
235 {
236 delete (*m_crystalGroup)[i];
237 }
238 m_crystalGroup->clear();
239 delete m_crystalGroup;
240 }
241}
G4TDigiCollection< BesEmcDigi > BesEmcDigitsCollection
G4THitsCollection< BesEmcHit > BesEmcHitsCollection
************Class m_ypar INTEGER m_KeyWgt INTEGER m_KeyIHVP INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
virtual void AddNoise5x5(G4double coherentNoise)
virtual void GroupHits(BesEmcHitsCollection *)
G4double GetEdepCrystal()
vector< G4int > * GetHitIndexes()
double EmcCoherentNoise()
virtual double getDigiCalibConst(int No) const =0
virtual double getCrystalDeadEcut(int Index) const =0
virtual int getIndex(unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const =0
virtual double getCrystalEmaxData(int Index) const =0