BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEmcDigitization Class Reference

#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 ()
 BesEmcDigitization ()
 ~BesEmcDigitization ()
G4bool Digitize (const G4Event *, G4double)
G4double GetEmcSignal (G4int, G4int)
G4int GetNSignal ()
G4double * GetESignal ()
G4int * GetNThetaSignal ()
G4int * GetNPhiSignal ()
void Print ()
 BesEmcDigitization ()
 ~BesEmcDigitization ()
G4bool Digitize (const G4Event *, G4double)
G4double GetEmcSignal (G4int, G4int)
G4int GetNSignal ()
G4double * GetESignal ()
G4int * GetNThetaSignal ()
G4int * GetNPhiSignal ()
void Print ()

Detailed Description

Constructor & Destructor Documentation

◆ BesEmcDigitization() [1/3]

BesEmcDigitization::BesEmcDigitization ( )

Definition at line 22 of file BesEmcDigitization.cc.

23 : calorimeterCollID( -1 )
24 , fNHits( 0 )
25 , fTotECrystal( 0 )
26 , fTotLCrystal( 0 )
27 , fNCrystalSignal( 0 ) {
28 for ( int i = 0; i < 50; i++ )
29 {
30 for ( int j = 0; j < 150; j++ ) fSingleECrystal[i][j] = 0;
31 }
32 G4SDManager* SDman = G4SDManager::GetSDMpointer();
33 calorimeterCollID = SDman->GetCollectionID( "CalCollection" );
34}

◆ ~BesEmcDigitization() [1/3]

BesEmcDigitization::~BesEmcDigitization ( )

Definition at line 36 of file BesEmcDigitization.cc.

36 {
37 delete[] fEnergySignal;
38 delete[] fNThetaSignal;
39 delete[] fNPhiSignal;
40}

◆ BesEmcDigitization() [2/3]

BesEmcDigitization::BesEmcDigitization ( )

◆ ~BesEmcDigitization() [2/3]

BesEmcDigitization::~BesEmcDigitization ( )

◆ BesEmcDigitization() [3/3]

BesEmcDigitization::BesEmcDigitization ( )

◆ ~BesEmcDigitization() [3/3]

BesEmcDigitization::~BesEmcDigitization ( )

Member Function Documentation

◆ Digitize() [1/3]

G4bool BesEmcDigitization::Digitize ( const G4Event * evt,
G4double ecut )

Definition at line 42 of file BesEmcDigitization.cc.

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

◆ Digitize() [2/3]

G4bool BesEmcDigitization::Digitize ( const G4Event * ,
G4double  )

◆ Digitize() [3/3]

G4bool BesEmcDigitization::Digitize ( const G4Event * ,
G4double  )

◆ GetEmcSignal() [1/3]

G4double BesEmcDigitization::GetEmcSignal ( G4int nTheta,
G4int nPhi )

Definition at line 104 of file BesEmcDigitization.cc.

104 {
105 if ( nTheta > 0 && nTheta < 50 && nPhi > 0 && nPhi < 150 )
106 return fSingleECrystal[nTheta][nPhi];
107 else return 0;
108}

◆ GetEmcSignal() [2/3]

G4double BesEmcDigitization::GetEmcSignal ( G4int ,
G4int  )

◆ GetEmcSignal() [3/3]

G4double BesEmcDigitization::GetEmcSignal ( G4int ,
G4int  )

◆ GetESignal() [1/3]

G4double * BesEmcDigitization::GetESignal ( )
inline

Definition at line 28 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcDigitization.hh.

28{ return fEnergySignal; };

◆ GetESignal() [2/3]

G4double * BesEmcDigitization::GetESignal ( )
inline

Definition at line 28 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcDigitization.hh.

28{ return fEnergySignal; };

◆ GetESignal() [3/3]

G4double * BesEmcDigitization::GetESignal ( )
inline

Definition at line 28 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcDigitization.hh.

28{ return fEnergySignal; };

◆ GetNPhiSignal() [1/3]

G4int * BesEmcDigitization::GetNPhiSignal ( )
inline

Definition at line 30 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcDigitization.hh.

30{ return fNPhiSignal; };

◆ GetNPhiSignal() [2/3]

G4int * BesEmcDigitization::GetNPhiSignal ( )
inline

Definition at line 30 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcDigitization.hh.

30{ return fNPhiSignal; };

◆ GetNPhiSignal() [3/3]

G4int * BesEmcDigitization::GetNPhiSignal ( )
inline

Definition at line 30 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcDigitization.hh.

30{ return fNPhiSignal; };

◆ GetNSignal() [1/3]

G4int BesEmcDigitization::GetNSignal ( )
inline

Definition at line 24 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcDigitization.hh.

24 {
25 return fNCrystalSignal;
26 }; // amount of crystals

◆ GetNSignal() [2/3]

G4int BesEmcDigitization::GetNSignal ( )
inline

Definition at line 24 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcDigitization.hh.

24 {
25 return fNCrystalSignal;
26 }; // amount of crystals

◆ GetNSignal() [3/3]

G4int BesEmcDigitization::GetNSignal ( )
inline

Definition at line 24 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcDigitization.hh.

24 {
25 return fNCrystalSignal;
26 }; // amount of crystals

◆ GetNThetaSignal() [1/3]

G4int * BesEmcDigitization::GetNThetaSignal ( )
inline

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-dbg/include/EmcSim/BesEmcDigitization.hh.

29{ return fNThetaSignal; };

◆ GetNThetaSignal() [2/3]

G4int * BesEmcDigitization::GetNThetaSignal ( )
inline

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-opt/include/EmcSim/BesEmcDigitization.hh.

29{ return fNThetaSignal; };

◆ GetNThetaSignal() [3/3]

G4int * BesEmcDigitization::GetNThetaSignal ( )
inline

Definition at line 29 of file Simulation/BOOST/EmcSim/include/EmcSim/BesEmcDigitization.hh.

29{ return fNThetaSignal; };

◆ Print() [1/3]

void BesEmcDigitization::Print ( )

Definition at line 110 of file BesEmcDigitization.cc.

110 {
111 G4cout << " Absorber: total energy: " << fTotECrystal / GeV << " GeV" << G4endl
112 << " total track length: " << fTotLCrystal / cm << " cm" << G4endl;
113
114 G4cout << "\n " << fNHits << " hits are stored in BesEmcHitsCollection." << G4endl;
115}

◆ Print() [2/3]

void BesEmcDigitization::Print ( )

◆ Print() [3/3]

void BesEmcDigitization::Print ( )

The documentation for this class was generated from the following files: