10#include "BesEmcDigitization.hh"
11#include "BesEmcHit.hh"
14#include "G4EventManager.hh"
15#include "G4HCofThisEvent.hh"
16#include "G4VHitsCollection.hh"
17#include "G4SDManager.hh"
19#include "G4UnitsTable.hh"
22 :calorimeterCollID(-1),fNHits(0),fTotECrystal(0),fTotLCrystal(0),
26 {
for(
int j=0;j<150;j++)
27 fSingleECrystal[i][j]=0;
29 G4SDManager * SDman = G4SDManager::GetSDMpointer();
30 calorimeterCollID= SDman->GetCollectionID(
"CalCollection");
35 delete[]fEnergySignal;
36 delete[]fNThetaSignal;
42 G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
53 fNHits = CHC->entries();
55 for (i=0;i<fNHits;i++)
57 fTotECrystal += (*CHC)[i]->GetEdepCrystal();
58 fTotLCrystal += (*CHC)[i]->GetTrakCrystal();
59 G4int nTheta=45-(*CHC)[i]->GetNumThetaCrystal();
60 G4int
nPhi =(*CHC)[i]->GetNumPhiCrystal();
61 if(nTheta>0&&nTheta<50&&nPhi>0&&
nPhi<150)
63 fSingleECrystal[nTheta][
nPhi]+=(*CHC)[i]->GetEdepCrystal();
69 G4cout <<
"EMC Hit out range:"
70 << nTheta <<
','<<
nPhi << G4endl;
80 if(fSingleECrystal[i][j]>ecut)
86 if((fEnergySignal=
new G4double[fNCrystalSignal+1])==NULL||
87 (fNThetaSignal=
new G4int[fNCrystalSignal+1])==NULL||
88 (fNPhiSignal=
new G4int[fNCrystalSignal+1])==NULL)
90 G4Exception(
"BesEmcDigitization:can't allocate memory for Signal");
96 if(fSingleECrystal[i][j]>ecut)
99 fEnergySignal[
n]=fSingleECrystal[i][j];
100 fNThetaSignal[
n]=45-i;
111 if(nTheta>0&&nTheta<50&&nPhi>0&&
nPhi<150)
112 return fSingleECrystal[nTheta][
nPhi];
120 <<
" Absorber: total energy: "
121 << fTotECrystal/GeV <<
" GeV" << G4endl
122 <<
" total track length: "
123 << fTotLCrystal/cm <<
" cm" << G4endl;
125 G4cout <<
"\n " << fNHits
126 <<
" hits are stored in BesEmcHitsCollection." << G4endl;
G4THitsCollection< BesEmcHit > BesEmcHitsCollection
G4double GetEmcSignal(G4int, G4int)
G4bool Digitize(const G4Event *, G4double)