BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Simulation/BOOST/EmcSim/include/EmcSim/BesEmcDigitizer.hh
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oreiented Simulation Tool //
3//---------------------------------------------------------------------------//
4// Descpirtion: EMC detector
5// Author: Hemiao
6// Created: Sep, 2004
7// Comment:
8//---------------------------------------------------------------------------//
9// $Id:BesEmcDigitizer.hh
10
11#ifndef BesEmcDigitizer_h
12#define BesEmcDigitizer_h 1
13
14#include "BesEmcDigi.hh"
15#include "BesEmcHit.hh"
16
17#include "G4VDigitizerModule.hh"
18#include "GaudiKernel/NTuple.h"
19#include "globals.hh"
20#include <vector>
21
22#include "EmcCalibConstSvc/IEmcCalibConstSvc.h"
23#include "G4Svc/IG4Svc.h"
24
25using namespace std;
26
27// class BesEmcHit;
28// class G4Svc;
29// class IEmcCalibConstSvc;
30
31class CrystalSingle {
32 friend class BesEmcDigitizer;
33
34public:
35 CrystalSingle() { hitIndexes = new vector<G4int>; }
36 CrystalSingle( const CrystalSingle& right ) {
37 partId = right.partId;
38 nTheta = right.nTheta;
39 nPhi = right.nPhi;
40 edep = right.edep;
41 hitIndexes = right.hitIndexes;
42 }
43 const CrystalSingle& operator=( const CrystalSingle& right ) {
44 partId = right.partId;
45 nTheta = right.nTheta;
46 nPhi = right.nPhi;
47 edep = right.edep;
48 hitIndexes = right.hitIndexes;
49 return *this;
50 }
51 ~CrystalSingle() { delete hitIndexes; }
52
53 G4int GetPartId() { return partId; }
54 G4int GetNTheta() { return nTheta; }
55 G4int GetNPhi() { return nPhi; }
56 G4double GetEdep() { return edep; }
57 vector<G4int>* GetHitIndexes() { return hitIndexes; }
58
59 void SetPartId( G4int id ) { partId = id; }
60 void SetNTheta( G4int theta ) { nTheta = theta; }
61 void SetNPhi( G4int phi ) { nPhi = phi; }
62 void SetEdep( G4double e ) { edep = e; }
63 void AddEdep( G4double e ) { edep += e; }
64
65private:
66 G4int partId;
67 G4int nTheta;
68 G4int nPhi;
69 G4double edep;
70 vector<G4int>* hitIndexes;
71};
72
73class BesEmcDigitizer : public G4VDigitizerModule {
74public:
75 BesEmcDigitizer( G4String modName );
77
78public:
79 virtual void Digitize();
81 // Add noise to 5x5 matrix around the seed
82 virtual void AddNoise5x5( G4double coherentNoise );
83 // Add noise to all crystals
84 virtual void AddNoiseAll( G4double coherentNoise );
85
86private: // memory size needed optimizing
87 void Initialize();
88 // void Smear();
89
90private:
91 BesEmcDigitsCollection* m_besEmcDigitsCollection;
92 vector<CrystalSingle*>* m_crystalGroup;
93 G4double m_energy;
94
95private:
96 // G4Svc* m_G4Svc; // mrli
97 IG4Svc* m_G4Svc;
98 IEmcCalibConstSvc* m_emcCalibConstSvc;
99 NTuple::Tuple* m_tupleEmc1; // digi level
100 NTuple::Item<long> m_partId;
101 NTuple::Item<long> m_nTheta;
102 NTuple::Item<long> m_nPhi;
103 NTuple::Item<double> m_eDep;
104 NTuple::Item<long> m_nHits;
105 NTuple::Item<double> m_adc;
106 NTuple::Item<long> m_tdc;
107
108 NTuple::Tuple* m_tupleEmc2; // event level
109 NTuple::Item<double> m_eTot;
110 NTuple::Item<long> m_nDigi;
111};
112#endif
G4TDigiCollection< BesEmcDigi > BesEmcDigitsCollection
G4THitsCollection< BesEmcHit > BesEmcHitsCollection
virtual void GroupHits(BesEmcHitsCollection *)
virtual void AddNoise5x5(G4double coherentNoise)
virtual void AddNoiseAll(G4double coherentNoise)
virtual void Digitize()
BesEmcDigitizer(G4String modName)
const CrystalSingle & operator=(const CrystalSingle &right)