EmcRecGeoSvc Class Reference

#include <EmcRecGeoSvc.h>

Inheritance diagram for EmcRecGeoSvc:

IEmcRecGeoSvc List of all members.

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

Static Public Member Functions

static const InterfaceID & interfaceID ()

Private Attributes

EmcRecBarrelGeo fBarrel
EmcRecEndCapGeo fEndCap
EmcRecROOTGeofROOTGeo
bool fGdml

Detailed Description

Definition at line 28 of file EmcRecGeoSvc.h.


Constructor & Destructor Documentation

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

Definition at line 15 of file EmcRecGeoSvc.cxx.

References fGdml, and fROOTGeo.

00015                                                                        : Service(name, svcloc) 
00016 {
00017   fGdml = true;
00018 
00019   // Declare the properties  
00020   declareProperty("Gdml",fGdml);
00021 
00022   if(fGdml) {
00023     fROOTGeo = new EmcRecROOTGeo();
00024   }
00025 }

EmcRecGeoSvc::~EmcRecGeoSvc (  ) 

Definition at line 27 of file EmcRecGeoSvc.cxx.

References fGdml, and fROOTGeo.

00028 {
00029   if(fGdml) {
00030     if(fROOTGeo) delete fROOTGeo;
00031   }
00032 }


Member Function Documentation

StatusCode EmcRecGeoSvc::finalize (  )  [virtual]

Definition at line 59 of file EmcRecGeoSvc.cxx.

References Bes_Common::INFO.

00059                                     {
00060   MsgStream log(messageService(), name());
00061   log << MSG::INFO << name() << ": End of Run" << endreq;
00062   return StatusCode::SUCCESS;
00063 }

double EmcRecGeoSvc::GetBarrelh1 (  )  const [virtual]

Implements IEmcRecGeoSvc.

Definition at line 143 of file EmcRecGeoSvc.cxx.

References fBarrel, and EmcRecBarrelGeo::GetBarrelh1().

00144 {
00145   return fBarrel.GetBarrelh1()/cm;
00146 }

double EmcRecGeoSvc::GetBarrelh2 (  )  const [virtual]

Implements IEmcRecGeoSvc.

Definition at line 148 of file EmcRecGeoSvc.cxx.

References fBarrel, and EmcRecBarrelGeo::GetBarrelh2().

00149 {
00150   return fBarrel.GetBarrelh2()/cm;
00151 }

double EmcRecGeoSvc::GetBarrelh3 (  )  const [virtual]

Implements IEmcRecGeoSvc.

Definition at line 153 of file EmcRecGeoSvc.cxx.

References fBarrel, and EmcRecBarrelGeo::GetBarrelh3().

00154 {
00155   return fBarrel.GetBarrelh3()/cm;
00156 }

double EmcRecGeoSvc::GetBarrelL (  )  const [virtual]

Implements IEmcRecGeoSvc.

Definition at line 158 of file EmcRecGeoSvc.cxx.

References fBarrel, and EmcRecBarrelGeo::GetBarrelL().

00159 {
00160   return fBarrel.GetBarrelL()/cm;
00161 }

int EmcRecGeoSvc::GetBarrelNPhiMax (  )  const [virtual]

Implements IEmcRecGeoSvc.

Definition at line 163 of file EmcRecGeoSvc.cxx.

References fBarrel, and EmcRecBarrelGeo::GetBarrelNPhiMax().

00164 {
00165   return fBarrel.GetBarrelNPhiMax();
00166 }

int EmcRecGeoSvc::GetBarrelNThetaMax (  )  const [virtual]

Implements IEmcRecGeoSvc.

Definition at line 168 of file EmcRecGeoSvc.cxx.

References fBarrel, and EmcRecBarrelGeo::GetBarrelNThetaMax().

00169 {
00170   return fBarrel.GetBarrelNThetaMax();
00171 }

double EmcRecGeoSvc::GetBarrelOffset1 (  )  const [virtual]

Implements IEmcRecGeoSvc.

Definition at line 133 of file EmcRecGeoSvc.cxx.

References fBarrel, and EmcRecBarrelGeo::GetBarrelOffset1().

00134 {
00135   return fBarrel.GetBarrelOffset1()/cm;
00136 }

double EmcRecGeoSvc::GetBarrelOffset2 (  )  const [virtual]

Implements IEmcRecGeoSvc.

Definition at line 138 of file EmcRecGeoSvc.cxx.

References fBarrel, and EmcRecBarrelGeo::GetBarrelOffset2().

00139 {
00140   return fBarrel.GetBarrelOffset2()/cm;
00141 }

double EmcRecGeoSvc::GetBarrelR (  )  const [virtual]

Implements IEmcRecGeoSvc.

Definition at line 128 of file EmcRecGeoSvc.cxx.

References fBarrel, and EmcRecBarrelGeo::GetBarrelR().

00129 {
00130   return fBarrel.GetBarrelR()/cm;
00131 }

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

Implements IEmcRecGeoSvc.

Definition at line 96 of file EmcRecGeoSvc.cxx.

References fBarrel, fEndCap, fGdml, fROOTGeo, EmcRecEndCapGeo::GetCCenter(), EmcRecBarrelGeo::GetCCenter(), EmcRecROOTGeo::GetCCenter(), and EmcID::is_barrel().

00096                                                              {
00097   if(fGdml) {
00098     return fROOTGeo->GetCCenter(id)/cm;
00099   } else {
00100     HepPoint3D center;
00101 
00102     if(EmcID::is_barrel(id)) {
00103       center=fBarrel.GetCCenter(id);
00104     } else {
00105       center=fEndCap.GetCCenter(id);
00106     }
00107 
00108     return center/cm;
00109   }
00110 }

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

Implements IEmcRecGeoSvc.

Definition at line 112 of file EmcRecGeoSvc.cxx.

References fBarrel, fEndCap, fGdml, fROOTGeo, EmcRecEndCapGeo::GetCFrontCenter(), EmcRecBarrelGeo::GetCFrontCenter(), EmcRecROOTGeo::GetCFrontCenter(), and EmcID::is_barrel().

00112                                                                   {
00113   if(fGdml) {
00114     return fROOTGeo->GetCFrontCenter(id)/cm;
00115   } else {
00116     HepPoint3D frontCenter;
00117 
00118     if(EmcID::is_barrel(id)) {
00119       frontCenter=fBarrel.GetCFrontCenter(id);
00120     } else {
00121       frontCenter=fEndCap.GetCFrontCenter(id);
00122     }
00123 
00124     return frontCenter/cm;
00125   }
00126 }

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

Implements IEmcRecGeoSvc.

Definition at line 65 of file EmcRecGeoSvc.cxx.

References fBarrel, fEndCap, fGdml, fROOTGeo, EmcRecEndCapGeo::GetCrystal(), EmcRecBarrelGeo::GetCrystal(), EmcRecROOTGeo::GetCrystal(), and EmcID::is_barrel().

00065                                                                 {
00066   if(fGdml) {
00067     return fROOTGeo->GetCrystal(id);
00068   } else {
00069     EmcRecCrystal cry;
00070 
00071     if(EmcID::is_barrel(id)) {
00072       cry=fBarrel.GetCrystal(id);
00073     } else {
00074       cry=fEndCap.GetCrystal(id);
00075     }
00076 
00077     return cry;
00078   }
00079 
00080 }

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

Implements IEmcRecGeoSvc.

Definition at line 82 of file EmcRecGeoSvc.cxx.

References fBarrel, fEndCap, fGdml, fROOTGeo, EmcRecCrystal::Get(), EmcRecEndCapGeo::GetCrystal(), EmcRecBarrelGeo::GetCrystal(), EmcRecROOTGeo::GetCrystal(), and EmcID::is_barrel().

00082                                                                                {
00083   EmcRecCrystal cry;
00084   if(fGdml) {
00085     cry=fROOTGeo->GetCrystal(id);
00086   } else {
00087     if(EmcID::is_barrel(id)) {
00088       cry=fBarrel.GetCrystal(id);
00089     } else {
00090       cry=fEndCap.GetCrystal(id);
00091     }
00092   }
00093   return cry.Get(i)/cm;
00094 }

StatusCode EmcRecGeoSvc::initialize (  )  [virtual]

Definition at line 44 of file EmcRecGeoSvc.cxx.

References fGdml, fROOTGeo, Bes_Common::INFO, and EmcRecROOTGeo::InitFromXML().

00044                                       {
00045   MsgStream log(messageService(), name());
00046   log << MSG::INFO << name() << ": Start of run initialisation" << endreq;
00047 
00048   StatusCode sc = Service::initialize();
00049   if ( sc.isFailure() ) return sc;
00050 
00051   // initialize geometry from gdml
00052   if(fGdml) {
00053     fROOTGeo->InitFromXML();
00054   }
00055   return StatusCode::SUCCESS;
00056 }

static const InterfaceID& IEmcRecGeoSvc::interfaceID (  )  [inline, static, inherited]

Definition at line 42 of file IEmcRecGeoSvc.h.

References IID_IEmcRecGeoSvc().

00042 { return IID_IEmcRecGeoSvc; } 

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

Definition at line 34 of file EmcRecGeoSvc.cxx.

References IID_IEmcRecGeoSvc().

00034                                                                                      {
00035 
00036   if ( IID_IEmcRecGeoSvc.versionMatch(riid) ) { 
00037     *ppvInterface = static_cast<IEmcRecGeoSvc*> (this); 
00038   } else { 
00039     return Service::queryInterface(riid, ppvInterface) ; 
00040   }
00041   return StatusCode::SUCCESS;
00042 }


Member Data Documentation

EmcRecBarrelGeo EmcRecGeoSvc::fBarrel [private]

Definition at line 55 of file EmcRecGeoSvc.h.

Referenced by GetBarrelh1(), GetBarrelh2(), GetBarrelh3(), GetBarrelL(), GetBarrelNPhiMax(), GetBarrelNThetaMax(), GetBarrelOffset1(), GetBarrelOffset2(), GetBarrelR(), GetCCenter(), GetCFrontCenter(), GetCrystal(), and GetCrystalPoint().

EmcRecEndCapGeo EmcRecGeoSvc::fEndCap [private]

Definition at line 56 of file EmcRecGeoSvc.h.

Referenced by GetCCenter(), GetCFrontCenter(), GetCrystal(), and GetCrystalPoint().

bool EmcRecGeoSvc::fGdml [private]

Definition at line 60 of file EmcRecGeoSvc.h.

Referenced by EmcRecGeoSvc(), GetCCenter(), GetCFrontCenter(), GetCrystal(), GetCrystalPoint(), initialize(), and ~EmcRecGeoSvc().

EmcRecROOTGeo* EmcRecGeoSvc::fROOTGeo [private]

Definition at line 57 of file EmcRecGeoSvc.h.

Referenced by EmcRecGeoSvc(), GetCCenter(), GetCFrontCenter(), GetCrystal(), GetCrystalPoint(), initialize(), and ~EmcRecGeoSvc().


Generated on Tue Nov 29 23:18:44 2016 for BOSS_7.0.2 by  doxygen 1.4.7