BOSS 8.0.0
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 15 of file EmcRecGeoSvc.cxx.

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

Referenced by EmcRecGeoSvc().

◆ ~EmcRecGeoSvc()

EmcRecGeoSvc::~EmcRecGeoSvc ( )

Definition at line 25 of file EmcRecGeoSvc.cxx.

25 {
26 if ( fGdml )
27 {
28 if ( fROOTGeo ) delete fROOTGeo;
29 }
30}

Member Function Documentation

◆ finalize()

StatusCode EmcRecGeoSvc::finalize ( )
virtual

Definition at line 54 of file EmcRecGeoSvc.cxx.

54 {
55 MsgStream log( msgSvc(), name() );
56 log << MSG::INFO << name() << ": End of Run" << endmsg;
57 return StatusCode::SUCCESS;
58}
IMessageSvc * msgSvc()

◆ GetBarrelh1()

double EmcRecGeoSvc::GetBarrelh1 ( ) const
virtual

Definition at line 116 of file EmcRecGeoSvc.cxx.

116{ return fBarrel.GetBarrelh1() / cm; }

◆ GetBarrelh2()

double EmcRecGeoSvc::GetBarrelh2 ( ) const
virtual

Definition at line 118 of file EmcRecGeoSvc.cxx.

118{ return fBarrel.GetBarrelh2() / cm; }

◆ GetBarrelh3()

double EmcRecGeoSvc::GetBarrelh3 ( ) const
virtual

Definition at line 120 of file EmcRecGeoSvc.cxx.

120{ return fBarrel.GetBarrelh3() / cm; }

◆ GetBarrelL()

double EmcRecGeoSvc::GetBarrelL ( ) const
virtual

Definition at line 122 of file EmcRecGeoSvc.cxx.

122{ return fBarrel.GetBarrelL() / cm; }

◆ GetBarrelNPhiMax()

int EmcRecGeoSvc::GetBarrelNPhiMax ( ) const
virtual

Definition at line 124 of file EmcRecGeoSvc.cxx.

124{ return fBarrel.GetBarrelNPhiMax(); }

◆ GetBarrelNThetaMax()

int EmcRecGeoSvc::GetBarrelNThetaMax ( ) const
virtual

Definition at line 126 of file EmcRecGeoSvc.cxx.

126{ return fBarrel.GetBarrelNThetaMax(); }

◆ GetBarrelOffset1()

double EmcRecGeoSvc::GetBarrelOffset1 ( ) const
virtual

Definition at line 112 of file EmcRecGeoSvc.cxx.

112{ return fBarrel.GetBarrelOffset1() / cm; }

◆ GetBarrelOffset2()

double EmcRecGeoSvc::GetBarrelOffset2 ( ) const
virtual

Definition at line 114 of file EmcRecGeoSvc.cxx.

114{ return fBarrel.GetBarrelOffset2() / cm; }

◆ GetBarrelR()

double EmcRecGeoSvc::GetBarrelR ( ) const
virtual

Definition at line 110 of file EmcRecGeoSvc.cxx.

110{ return fBarrel.GetBarrelR() / cm; }

◆ GetCCenter()

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

Definition at line 84 of file EmcRecGeoSvc.cxx.

84 {
85 if ( fGdml ) { return fROOTGeo->GetCCenter( id ) / cm; }
86 else
87 {
88 HepPoint3D center;
89
90 if ( EmcID::is_barrel( id ) ) { center = fBarrel.GetCCenter( id ); }
91 else { center = fEndCap.GetCCenter( id ); }
92
93 return center / cm;
94 }
95}
HepGeom::Point3D< double > HepPoint3D
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition EmcID.cxx:30

◆ GetCFrontCenter()

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

Definition at line 97 of file EmcRecGeoSvc.cxx.

97 {
98 if ( fGdml ) { return fROOTGeo->GetCFrontCenter( id ) / cm; }
99 else
100 {
101 HepPoint3D frontCenter;
102
103 if ( EmcID::is_barrel( id ) ) { frontCenter = fBarrel.GetCFrontCenter( id ); }
104 else { frontCenter = fEndCap.GetCFrontCenter( id ); }
105
106 return frontCenter / cm;
107 }
108}

◆ GetCrystal()

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

Definition at line 60 of file EmcRecGeoSvc.cxx.

60 {
61 if ( fGdml ) { return fROOTGeo->GetCrystal( id ); }
62 else
63 {
64 EmcRecCrystal cry;
65
66 if ( EmcID::is_barrel( id ) ) { cry = fBarrel.GetCrystal( id ); }
67 else { cry = fEndCap.GetCrystal( id ); }
68
69 return cry;
70 }
71}

◆ GetCrystalPoint()

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

Definition at line 73 of file EmcRecGeoSvc.cxx.

73 {
74 EmcRecCrystal cry;
75 if ( fGdml ) { cry = fROOTGeo->GetCrystal( id ); }
76 else
77 {
78 if ( EmcID::is_barrel( id ) ) { cry = fBarrel.GetCrystal( id ); }
79 else { cry = fEndCap.GetCrystal( id ); }
80 }
81 return cry.Get( i ) / cm;
82}

◆ initialize()

StatusCode EmcRecGeoSvc::initialize ( )
virtual

Definition at line 42 of file EmcRecGeoSvc.cxx.

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

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