BOSS 7.0.5
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
 
 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
 
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 ()
 
static const InterfaceID & interfaceID ()
 

Detailed Description

Constructor & Destructor Documentation

◆ EmcRecGeoSvc() [1/2]

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() [1/2]

EmcRecGeoSvc::~EmcRecGeoSvc ( )

Definition at line 27 of file EmcRecGeoSvc.cxx.

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

◆ EmcRecGeoSvc() [2/2]

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

◆ ~EmcRecGeoSvc() [2/2]

EmcRecGeoSvc::~EmcRecGeoSvc ( )

Member Function Documentation

◆ finalize() [1/2]

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}

◆ finalize() [2/2]

virtual StatusCode EmcRecGeoSvc::finalize ( )
virtual

◆ GetBarrelh1() [1/2]

double EmcRecGeoSvc::GetBarrelh1 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 143 of file EmcRecGeoSvc.cxx.

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

◆ GetBarrelh1() [2/2]

virtual double EmcRecGeoSvc::GetBarrelh1 ( ) const
virtual

Implements IEmcRecGeoSvc.

◆ GetBarrelh2() [1/2]

double EmcRecGeoSvc::GetBarrelh2 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 148 of file EmcRecGeoSvc.cxx.

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

◆ GetBarrelh2() [2/2]

virtual double EmcRecGeoSvc::GetBarrelh2 ( ) const
virtual

Implements IEmcRecGeoSvc.

◆ GetBarrelh3() [1/2]

double EmcRecGeoSvc::GetBarrelh3 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 153 of file EmcRecGeoSvc.cxx.

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

◆ GetBarrelh3() [2/2]

virtual double EmcRecGeoSvc::GetBarrelh3 ( ) const
virtual

Implements IEmcRecGeoSvc.

◆ GetBarrelL() [1/2]

double EmcRecGeoSvc::GetBarrelL ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 158 of file EmcRecGeoSvc.cxx.

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

◆ GetBarrelL() [2/2]

virtual double EmcRecGeoSvc::GetBarrelL ( ) const
virtual

Implements IEmcRecGeoSvc.

◆ GetBarrelNPhiMax() [1/2]

int EmcRecGeoSvc::GetBarrelNPhiMax ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 163 of file EmcRecGeoSvc.cxx.

◆ GetBarrelNPhiMax() [2/2]

virtual int EmcRecGeoSvc::GetBarrelNPhiMax ( ) const
virtual

Implements IEmcRecGeoSvc.

◆ GetBarrelNThetaMax() [1/2]

int EmcRecGeoSvc::GetBarrelNThetaMax ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 168 of file EmcRecGeoSvc.cxx.

◆ GetBarrelNThetaMax() [2/2]

virtual int EmcRecGeoSvc::GetBarrelNThetaMax ( ) const
virtual

Implements IEmcRecGeoSvc.

◆ GetBarrelOffset1() [1/2]

double EmcRecGeoSvc::GetBarrelOffset1 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 133 of file EmcRecGeoSvc.cxx.

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

◆ GetBarrelOffset1() [2/2]

virtual double EmcRecGeoSvc::GetBarrelOffset1 ( ) const
virtual

Implements IEmcRecGeoSvc.

◆ GetBarrelOffset2() [1/2]

double EmcRecGeoSvc::GetBarrelOffset2 ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 138 of file EmcRecGeoSvc.cxx.

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

◆ GetBarrelOffset2() [2/2]

virtual double EmcRecGeoSvc::GetBarrelOffset2 ( ) const
virtual

Implements IEmcRecGeoSvc.

◆ GetBarrelR() [1/2]

double EmcRecGeoSvc::GetBarrelR ( ) const
virtual

Implements IEmcRecGeoSvc.

Definition at line 128 of file EmcRecGeoSvc.cxx.

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

◆ GetBarrelR() [2/2]

virtual double EmcRecGeoSvc::GetBarrelR ( ) const
virtual

Implements IEmcRecGeoSvc.

◆ GetCCenter() [1/2]

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

◆ GetCCenter() [2/2]

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

Implements IEmcRecGeoSvc.

◆ GetCFrontCenter() [1/2]

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

◆ GetCFrontCenter() [2/2]

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

Implements IEmcRecGeoSvc.

◆ GetCrystal() [1/2]

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

◆ GetCrystal() [2/2]

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

Implements IEmcRecGeoSvc.

◆ GetCrystalPoint() [1/2]

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}

◆ GetCrystalPoint() [2/2]

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

Implements IEmcRecGeoSvc.

◆ initialize() [1/2]

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}

◆ initialize() [2/2]

virtual StatusCode EmcRecGeoSvc::initialize ( )
virtual

◆ queryInterface() [1/2]

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}

◆ queryInterface() [2/2]

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

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