BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcRecGeoSvc Class Reference

#include <EmcRecGeoSvc.h>

+ Inheritance diagram for EmcRecGeoSvc:

Public Member Functions

 EmcRecGeoSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~EmcRecGeoSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual EmcRecCrystal GetCrystal (const Identifier &id) const
 
virtual HepPoint3D GetCrystalPoint (const Identifier &id, const int i) const
 
virtual HepPoint3D GetCCenter (const Identifier &id) const
 
virtual HepPoint3D GetCFrontCenter (const Identifier &id) const
 
virtual double GetBarrelR () const
 
virtual double GetBarrelOffset1 () const
 
virtual double GetBarrelOffset2 () const
 
virtual double GetBarrelh1 () const
 
virtual double GetBarrelh2 () const
 
virtual double GetBarrelh3 () const
 
virtual double GetBarrelL () const
 
virtual int GetBarrelNPhiMax () const
 
virtual int GetBarrelNThetaMax () const
 
virtual EmcRecCrystal GetCrystal (const Identifier &id) const =0
 
virtual HepPoint3D GetCrystalPoint (const Identifier &id, const int i) const =0
 
virtual HepPoint3D GetCCenter (const Identifier &id) const =0
 
virtual HepPoint3D GetCFrontCenter (const Identifier &id) const =0
 
virtual double GetBarrelR () const =0
 
virtual double GetBarrelOffset1 () const =0
 
virtual double GetBarrelOffset2 () const =0
 
virtual double GetBarrelh1 () const =0
 
virtual double GetBarrelh2 () const =0
 
virtual double GetBarrelh3 () const =0
 
virtual double GetBarrelL () const =0
 
virtual int GetBarrelNPhiMax () const =0
 
virtual int GetBarrelNThetaMax () const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from IEmcRecGeoSvc
static const InterfaceID & interfaceID ()
 

Detailed Description

Definition at line 28 of file EmcRecGeoSvc.h.

Constructor & Destructor Documentation

◆ EmcRecGeoSvc()

EmcRecGeoSvc::EmcRecGeoSvc ( const std::string &  name,
ISvcLocator *  svcloc 
)

Definition at line 15 of file EmcRecGeoSvc.cxx.

15 : Service(name, svcloc)
16{
17 fGdml = true;
18
19 // Declare the properties
20 declareProperty("Gdml",fGdml);
21
22 if(fGdml) {
23 fROOTGeo = new EmcRecROOTGeo();
24 }
25}

◆ ~EmcRecGeoSvc()

EmcRecGeoSvc::~EmcRecGeoSvc ( )

Definition at line 27 of file EmcRecGeoSvc.cxx.

28{
29 if(fGdml) {
30 if(fROOTGeo) delete fROOTGeo;
31 }
32}

Member Function Documentation

◆ finalize()

StatusCode EmcRecGeoSvc::finalize ( )
virtual

Definition at line 59 of file EmcRecGeoSvc.cxx.

59 {
60 MsgStream log(messageService(), name());
61 log << MSG::INFO << name() << ": End of Run" << endreq;
62 return StatusCode::SUCCESS;
63}

◆ GetBarrelh1()

double EmcRecGeoSvc::GetBarrelh1 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 143 of file EmcRecGeoSvc.cxx.

144{
145 return fBarrel.GetBarrelh1()/cm;
146}
double GetBarrelh1() const

◆ GetBarrelh2()

double EmcRecGeoSvc::GetBarrelh2 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 148 of file EmcRecGeoSvc.cxx.

149{
150 return fBarrel.GetBarrelh2()/cm;
151}
double GetBarrelh2() const

◆ GetBarrelh3()

double EmcRecGeoSvc::GetBarrelh3 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 153 of file EmcRecGeoSvc.cxx.

154{
155 return fBarrel.GetBarrelh3()/cm;
156}
double GetBarrelh3() const

◆ GetBarrelL()

double EmcRecGeoSvc::GetBarrelL ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 158 of file EmcRecGeoSvc.cxx.

159{
160 return fBarrel.GetBarrelL()/cm;
161}
double GetBarrelL() const

◆ GetBarrelNPhiMax()

int EmcRecGeoSvc::GetBarrelNPhiMax ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 163 of file EmcRecGeoSvc.cxx.

164{
165 return fBarrel.GetBarrelNPhiMax();
166}
int GetBarrelNPhiMax() const

◆ GetBarrelNThetaMax()

int EmcRecGeoSvc::GetBarrelNThetaMax ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 168 of file EmcRecGeoSvc.cxx.

169{
170 return fBarrel.GetBarrelNThetaMax();
171}
int GetBarrelNThetaMax() const

◆ GetBarrelOffset1()

double EmcRecGeoSvc::GetBarrelOffset1 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 133 of file EmcRecGeoSvc.cxx.

134{
135 return fBarrel.GetBarrelOffset1()/cm;
136}
double GetBarrelOffset1() const

◆ GetBarrelOffset2()

double EmcRecGeoSvc::GetBarrelOffset2 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 138 of file EmcRecGeoSvc.cxx.

139{
140 return fBarrel.GetBarrelOffset2()/cm;
141}
double GetBarrelOffset2() const

◆ GetBarrelR()

double EmcRecGeoSvc::GetBarrelR ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 128 of file EmcRecGeoSvc.cxx.

129{
130 return fBarrel.GetBarrelR()/cm;
131}
double GetBarrelR() const

◆ GetCCenter()

HepPoint3D EmcRecGeoSvc::GetCCenter ( const Identifier id) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 96 of file EmcRecGeoSvc.cxx.

96 {
97 if(fGdml) {
98 return fROOTGeo->GetCCenter(id)/cm;
99 } else {
100 HepPoint3D center;
101
102 if(EmcID::is_barrel(id)) {
103 center=fBarrel.GetCCenter(id);
104 } else {
105 center=fEndCap.GetCCenter(id);
106 }
107
108 return center/cm;
109 }
110}
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition: EmcID.cxx:32
HepPoint3D GetCCenter(const Identifier &id) const
HepPoint3D GetCCenter(const Identifier &id) const
HepPoint3D GetCCenter(const Identifier &id) const

◆ GetCFrontCenter()

HepPoint3D EmcRecGeoSvc::GetCFrontCenter ( const Identifier id) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 112 of file EmcRecGeoSvc.cxx.

112 {
113 if(fGdml) {
114 return fROOTGeo->GetCFrontCenter(id)/cm;
115 } else {
116 HepPoint3D frontCenter;
117
118 if(EmcID::is_barrel(id)) {
119 frontCenter=fBarrel.GetCFrontCenter(id);
120 } else {
121 frontCenter=fEndCap.GetCFrontCenter(id);
122 }
123
124 return frontCenter/cm;
125 }
126}
HepPoint3D GetCFrontCenter(const Identifier &id) const
HepPoint3D GetCFrontCenter(const Identifier &id) const
HepPoint3D GetCFrontCenter(const Identifier &id) const

◆ GetCrystal()

EmcRecCrystal EmcRecGeoSvc::GetCrystal ( const Identifier id) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 65 of file EmcRecGeoSvc.cxx.

65 {
66 if(fGdml) {
67 return fROOTGeo->GetCrystal(id);
68 } else {
69 EmcRecCrystal cry;
70
71 if(EmcID::is_barrel(id)) {
72 cry=fBarrel.GetCrystal(id);
73 } else {
74 cry=fEndCap.GetCrystal(id);
75 }
76
77 return cry;
78 }
79
80}
EmcRecCrystal GetCrystal(const Identifier &id) const
EmcRecCrystal GetCrystal(const Identifier &id) const
EmcRecCrystal GetCrystal(const Identifier &id) const

◆ GetCrystalPoint()

HepPoint3D EmcRecGeoSvc::GetCrystalPoint ( const Identifier id,
const int  i 
) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 82 of file EmcRecGeoSvc.cxx.

82 {
83 EmcRecCrystal cry;
84 if(fGdml) {
85 cry=fROOTGeo->GetCrystal(id);
86 } else {
87 if(EmcID::is_barrel(id)) {
88 cry=fBarrel.GetCrystal(id);
89 } else {
90 cry=fEndCap.GetCrystal(id);
91 }
92 }
93 return cry.Get(i)/cm;
94}
HepPoint3D Get(int index) const
Definition: EmcRecCrystal.h:83

◆ initialize()

StatusCode EmcRecGeoSvc::initialize ( )
virtual

Definition at line 44 of file EmcRecGeoSvc.cxx.

44 {
45 MsgStream log(messageService(), name());
46 log << MSG::INFO << name() << ": Start of run initialisation" << endreq;
47
48 StatusCode sc = Service::initialize();
49 if ( sc.isFailure() ) return sc;
50
51 // initialize geometry from gdml
52 if(fGdml) {
53 fROOTGeo->InitFromXML();
54 }
55 return StatusCode::SUCCESS;
56}

◆ queryInterface()

StatusCode EmcRecGeoSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvUnknown 
)
virtual

Definition at line 34 of file EmcRecGeoSvc.cxx.

34 {
35
36 if ( IID_IEmcRecGeoSvc.versionMatch(riid) ) {
37 *ppvInterface = static_cast<IEmcRecGeoSvc*> (this);
38 } else {
39 return Service::queryInterface(riid, ppvInterface) ;
40 }
41 return StatusCode::SUCCESS;
42}

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