#include <BesEmcDigitization.hh>
Public Member Functions | |
BesEmcDigitization () | |
~BesEmcDigitization () | |
G4bool | Digitize (const G4Event *, G4double) |
G4double | GetEmcSignal (G4int, G4int) |
G4int | GetNSignal () |
G4double * | GetESignal () |
G4int * | GetNThetaSignal () |
G4int * | GetNPhiSignal () |
void | Print () |
Private Attributes | |
G4int | calorimeterCollID |
G4int | fNHits |
G4double | fTotECrystal |
G4double | fTotLCrystal |
G4double | fSingleECrystal [50][150] |
G4int | fNCrystalSignal |
G4double * | fEnergySignal |
G4int * | fNThetaSignal |
G4int * | fNPhiSignal |
Definition at line 16 of file BesEmcDigitization.hh.
BesEmcDigitization::BesEmcDigitization | ( | ) |
Definition at line 21 of file BesEmcDigitization.cc.
References calorimeterCollID, fSingleECrystal, genRecEmupikp::i, and ganga-rec::j.
00022 :calorimeterCollID(-1),fNHits(0),fTotECrystal(0),fTotLCrystal(0), 00023 fNCrystalSignal(0) 00024 { 00025 for(int i=0;i<50;i++) 00026 {for(int j=0;j<150;j++) 00027 fSingleECrystal[i][j]=0; 00028 } 00029 G4SDManager * SDman = G4SDManager::GetSDMpointer(); 00030 calorimeterCollID= SDman->GetCollectionID("CalCollection"); 00031 }
BesEmcDigitization::~BesEmcDigitization | ( | ) |
Definition at line 33 of file BesEmcDigitization.cc.
References fEnergySignal, fNPhiSignal, and fNThetaSignal.
00034 { 00035 delete[]fEnergySignal; 00036 delete[]fNThetaSignal; 00037 delete[]fNPhiSignal; 00038 }
G4bool BesEmcDigitization::Digitize | ( | const G4Event * | , | |
G4double | ||||
) |
Definition at line 40 of file BesEmcDigitization.cc.
References calorimeterCollID, fEnergySignal, fNCrystalSignal, fNHits, fNPhiSignal, fNThetaSignal, fSingleECrystal, fTotECrystal, fTotLCrystal, genRecEmupikp::i, ganga-rec::j, and nPhi.
00041 { 00042 G4HCofThisEvent* HCE = evt->GetHCofThisEvent(); 00043 BesEmcHitsCollection* CHC = 0; 00044 00045 if (HCE) 00046 CHC = (BesEmcHitsCollection*)(HCE->GetHC(calorimeterCollID)); 00047 else 00048 return false; 00049 00050 G4int i=0,j=0; 00051 if (CHC) 00052 { 00053 fNHits = CHC->entries(); 00054 if(fNHits) 00055 for (i=0;i<fNHits;i++) 00056 { 00057 fTotECrystal += (*CHC)[i]->GetEdepCrystal(); 00058 fTotLCrystal += (*CHC)[i]->GetTrakCrystal(); 00059 G4int nTheta=45-(*CHC)[i]->GetNumThetaCrystal(); 00060 G4int nPhi =(*CHC)[i]->GetNumPhiCrystal(); 00061 if(nTheta>0&&nTheta<50&&nPhi>0&&nPhi<150)//waiting upgrade 00062 { 00063 fSingleECrystal[nTheta][nPhi]+=(*CHC)[i]->GetEdepCrystal(); 00064 //G4cout << "EMC Hit in crystal(" 00065 // << nTheta << "," <<nPhi<< ")" << G4endl; 00066 } 00067 else 00068 { 00069 G4cout << "EMC Hit out range:" 00070 << nTheta <<','<< nPhi << G4endl; 00071 } 00072 } 00073 } 00074 else 00075 return false; 00076 00077 for(i=1;i<50;i++) 00078 {for(j=1;j<150;j++) 00079 { 00080 if(fSingleECrystal[i][j]>ecut) 00081 { 00082 fNCrystalSignal++; 00083 } 00084 } 00085 } 00086 if((fEnergySignal=new G4double[fNCrystalSignal+1])==NULL|| 00087 (fNThetaSignal=new G4int[fNCrystalSignal+1])==NULL|| 00088 (fNPhiSignal=new G4int[fNCrystalSignal+1])==NULL) 00089 { 00090 G4Exception("BesEmcDigitization:can't allocate memory for Signal"); 00091 } 00092 G4int n=0; 00093 for(i=1;i<50;i++) 00094 {for(j=1;j<150;j++) 00095 { 00096 if(fSingleECrystal[i][j]>ecut) 00097 { 00098 n++; 00099 fEnergySignal[n]=fSingleECrystal[i][j]; 00100 fNThetaSignal[n]=45-i; 00101 fNPhiSignal [n]=j; 00102 } 00103 } 00104 } 00105 00106 return true; 00107 }
G4double BesEmcDigitization::GetEmcSignal | ( | G4int | , | |
G4int | ||||
) |
Definition at line 109 of file BesEmcDigitization.cc.
References fSingleECrystal.
00110 { 00111 if(nTheta>0&&nTheta<50&&nPhi>0&&nPhi<150) 00112 return fSingleECrystal[nTheta][nPhi]; 00113 else 00114 return 0; 00115 }
G4double* BesEmcDigitization::GetESignal | ( | ) | [inline] |
Definition at line 27 of file BesEmcDigitization.hh.
References fEnergySignal.
00027 {return fEnergySignal;};
G4int* BesEmcDigitization::GetNPhiSignal | ( | ) | [inline] |
Definition at line 29 of file BesEmcDigitization.hh.
References fNPhiSignal.
00029 {return fNPhiSignal;};
G4int BesEmcDigitization::GetNSignal | ( | ) | [inline] |
Definition at line 25 of file BesEmcDigitization.hh.
References fNCrystalSignal.
00025 {return fNCrystalSignal;};//amount of crystals
G4int* BesEmcDigitization::GetNThetaSignal | ( | ) | [inline] |
Definition at line 28 of file BesEmcDigitization.hh.
References fNThetaSignal.
00028 {return fNThetaSignal;};
void BesEmcDigitization::Print | ( | ) |
Definition at line 117 of file BesEmcDigitization.cc.
References fNHits, fTotECrystal, and fTotLCrystal.
00118 { 00119 G4cout 00120 << " Absorber: total energy: " 00121 << fTotECrystal/GeV << " GeV" << G4endl 00122 << " total track length: " 00123 << fTotLCrystal/cm << " cm" << G4endl; 00124 00125 G4cout << "\n " << fNHits 00126 << " hits are stored in BesEmcHitsCollection." << G4endl; 00127 }
G4int BesEmcDigitization::calorimeterCollID [private] |
Definition at line 33 of file BesEmcDigitization.hh.
Referenced by BesEmcDigitization(), and Digitize().
G4double* BesEmcDigitization::fEnergySignal [private] |
Definition at line 39 of file BesEmcDigitization.hh.
Referenced by Digitize(), GetESignal(), and ~BesEmcDigitization().
G4int BesEmcDigitization::fNCrystalSignal [private] |
G4int BesEmcDigitization::fNHits [private] |
G4int* BesEmcDigitization::fNPhiSignal [private] |
Definition at line 41 of file BesEmcDigitization.hh.
Referenced by Digitize(), GetNPhiSignal(), and ~BesEmcDigitization().
G4int* BesEmcDigitization::fNThetaSignal [private] |
Definition at line 40 of file BesEmcDigitization.hh.
Referenced by Digitize(), GetNThetaSignal(), and ~BesEmcDigitization().
G4double BesEmcDigitization::fSingleECrystal[50][150] [private] |
Definition at line 37 of file BesEmcDigitization.hh.
Referenced by BesEmcDigitization(), Digitize(), and GetEmcSignal().
G4double BesEmcDigitization::fTotECrystal [private] |
G4double BesEmcDigitization::fTotLCrystal [private] |