BOSS 7.1.2
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 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
 

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 17 of file EmcRecGeoSvc.cxx.

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

◆ ~EmcRecGeoSvc()

EmcRecGeoSvc::~EmcRecGeoSvc ( )

Definition at line 29 of file EmcRecGeoSvc.cxx.

30{
31 if(fGdml) {
32 if(fROOTGeo) delete fROOTGeo;
33 }
34}

Member Function Documentation

◆ finalize()

StatusCode EmcRecGeoSvc::finalize ( )
virtual

Definition at line 61 of file EmcRecGeoSvc.cxx.

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

◆ GetBarrelh1()

double EmcRecGeoSvc::GetBarrelh1 ( ) const
virtual

Definition at line 145 of file EmcRecGeoSvc.cxx.

146{
147 return fBarrel.GetBarrelh1()/cm;
148}
double GetBarrelh1() const

◆ GetBarrelh2()

double EmcRecGeoSvc::GetBarrelh2 ( ) const
virtual

Definition at line 150 of file EmcRecGeoSvc.cxx.

151{
152 return fBarrel.GetBarrelh2()/cm;
153}
double GetBarrelh2() const

◆ GetBarrelh3()

double EmcRecGeoSvc::GetBarrelh3 ( ) const
virtual

Definition at line 155 of file EmcRecGeoSvc.cxx.

156{
157 return fBarrel.GetBarrelh3()/cm;
158}
double GetBarrelh3() const

◆ GetBarrelL()

double EmcRecGeoSvc::GetBarrelL ( ) const
virtual

Definition at line 160 of file EmcRecGeoSvc.cxx.

161{
162 return fBarrel.GetBarrelL()/cm;
163}
double GetBarrelL() const

◆ GetBarrelNPhiMax()

int EmcRecGeoSvc::GetBarrelNPhiMax ( ) const
virtual

Definition at line 165 of file EmcRecGeoSvc.cxx.

166{
167 return fBarrel.GetBarrelNPhiMax();
168}
int GetBarrelNPhiMax() const

◆ GetBarrelNThetaMax()

int EmcRecGeoSvc::GetBarrelNThetaMax ( ) const
virtual

Definition at line 170 of file EmcRecGeoSvc.cxx.

171{
172 return fBarrel.GetBarrelNThetaMax();
173}
int GetBarrelNThetaMax() const

◆ GetBarrelOffset1()

double EmcRecGeoSvc::GetBarrelOffset1 ( ) const
virtual

Definition at line 135 of file EmcRecGeoSvc.cxx.

136{
137 return fBarrel.GetBarrelOffset1()/cm;
138}
double GetBarrelOffset1() const

◆ GetBarrelOffset2()

double EmcRecGeoSvc::GetBarrelOffset2 ( ) const
virtual

Definition at line 140 of file EmcRecGeoSvc.cxx.

141{
142 return fBarrel.GetBarrelOffset2()/cm;
143}
double GetBarrelOffset2() const

◆ GetBarrelR()

double EmcRecGeoSvc::GetBarrelR ( ) const
virtual

Definition at line 130 of file EmcRecGeoSvc.cxx.

131{
132 return fBarrel.GetBarrelR()/cm;
133}
double GetBarrelR() const

◆ GetCCenter()

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

Definition at line 98 of file EmcRecGeoSvc.cxx.

98 {
99 if(fGdml) {
100 return fROOTGeo->GetCCenter(id)/cm;
101 } else {
102 HepPoint3D center;
103
104 if(EmcID::is_barrel(id)) {
105 center=fBarrel.GetCCenter(id);
106 } else {
107 center=fEndCap.GetCCenter(id);
108 }
109
110 return center/cm;
111 }
112}
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

Definition at line 114 of file EmcRecGeoSvc.cxx.

114 {
115 if(fGdml) {
116 return fROOTGeo->GetCFrontCenter(id)/cm;
117 } else {
118 HepPoint3D frontCenter;
119
120 if(EmcID::is_barrel(id)) {
121 frontCenter=fBarrel.GetCFrontCenter(id);
122 } else {
123 frontCenter=fEndCap.GetCFrontCenter(id);
124 }
125
126 return frontCenter/cm;
127 }
128}
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

Definition at line 67 of file EmcRecGeoSvc.cxx.

67 {
68 if(fGdml) {
69 return fROOTGeo->GetCrystal(id);
70 } else {
71 EmcRecCrystal cry;
72
73 if(EmcID::is_barrel(id)) {
74 cry=fBarrel.GetCrystal(id);
75 } else {
76 cry=fEndCap.GetCrystal(id);
77 }
78
79 return cry;
80 }
81
82}
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

Definition at line 84 of file EmcRecGeoSvc.cxx.

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

◆ initialize()

StatusCode EmcRecGeoSvc::initialize ( )
virtual

Definition at line 46 of file EmcRecGeoSvc.cxx.

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

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