42{
43 G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
45
46 if (HCE)
48 else
49 return false;
50
51 G4int i=0,j=0;
52 if (CHC)
53 {
54 fNHits = CHC->entries();
55 if(fNHits)
56 for (i=0;i<fNHits;i++)
57 {
58 fTotECrystal += (*CHC)[i]->GetEdepCrystal();
59 fTotLCrystal += (*CHC)[i]->GetTrakCrystal();
60 G4int nTheta=45-(*CHC)[i]->GetNumThetaCrystal();
61 G4int
nPhi =(*CHC)[i]->GetNumPhiCrystal();
62 if(nTheta>0&&nTheta<50&&nPhi>0&&
nPhi<150)
63 {
64 fSingleECrystal[nTheta][
nPhi]+=(*CHC)[i]->GetEdepCrystal();
65
66
67 }
68 else
69 {
70 G4cout << "EMC Hit out range:"
71 << nTheta <<
','<<
nPhi << G4endl;
72 }
73 }
74 }
75 else
76 return false;
77
78 for(i=1;i<50;i++)
79 {for(j=1;j<150;j++)
80 {
81 if(fSingleECrystal[i][j]>ecut)
82 {
83 fNCrystalSignal++;
84 }
85 }
86 }
87 if((fEnergySignal=
new G4double[fNCrystalSignal+1])==
NULL||
88 (fNThetaSignal=
new G4int[fNCrystalSignal+1])==
NULL||
89 (fNPhiSignal=
new G4int[fNCrystalSignal+1])==
NULL)
90 {
91
92 G4cout<<"BesEmcDigitization:can't allocate memory for Signal"<<G4endl;
93 exit(-1);
94 }
96 for(i=1;i<50;i++)
97 {for(j=1;j<150;j++)
98 {
99 if(fSingleECrystal[i][j]>ecut)
100 {
102 fEnergySignal[
n]=fSingleECrystal[i][j];
103 fNThetaSignal[
n]=45-i;
105 }
106 }
107 }
108
109 return true;
110}
G4THitsCollection< BesEmcHit > BesEmcHitsCollection