CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcGeomSvc Class Reference

#include <MdcGeomSvc.h>

+ Inheritance diagram for MdcGeomSvc:

Public Member Functions

 MdcGeomSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~MdcGeomSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void handle (const Incident &inc)
 this handle function is prepared for special use
 
const MdcGeoWire *const Wire (unsigned id)
 
const MdcGeoWire *const Wire (unsigned lyrid, unsigned wirid)
 
const MdcGeoLayer *const Layer (unsigned id)
 
const MdcGeoSuper *const SuperLayer (unsigned id)
 
const MdcGeoGeneral *const GeneralLayer (unsigned id)
 
const MdcGeoMisc *const Misc (void)
 
const MdcGeoEnd *const End (unsigned id)
 
const int getWireSize ()
 
const int getLayerSize ()
 
const int getSuperLayerSize ()
 
const int getGeneralLayerSize ()
 
const int getSegmentNo ()
 
void Dump ()
 
virtual const MdcGeoWire *const Wire (unsigned id)=0
 
virtual const MdcGeoWire *const Wire (unsigned lyrid, unsigned wirid)=0
 
virtual const MdcGeoLayer *const Layer (unsigned id)=0
 
virtual const MdcGeoSuper *const SuperLayer (unsigned id)=0
 
virtual const MdcGeoGeneral *const GeneralLayer (unsigned id)=0
 
virtual const int getWireSize ()=0
 
virtual const int getLayerSize ()=0
 
virtual const int getSuperLayerSize ()=0
 
virtual const int getGeneralLayerSize ()=0
 
virtual void Dump ()=0
 

Static Public Member Functions

static bool getSagFlag (void)
 
- Static Public Member Functions inherited from IMdcGeomSvc
static const InterfaceID & interfaceID ()
 

Static Public Attributes

static bool m_doSag = true
 
static bool m_readAlignParDataBase = true
 
static bool m_nomcalignment =true
 

Detailed Description

Definition at line 25 of file MdcGeomSvc.h.

Constructor & Destructor Documentation

◆ MdcGeomSvc()

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

Definition at line 30 of file MdcGeomSvc.cxx.

30 : Service(name, svcloc) {
31 if(getenv("MDCGEOMSVCROOT")){
32 m_alignFilePath = std::string(getenv("MDCGEOMSVCROOT"))+std::string("/share/MdcAlignPar.dat");
33 //std::cout<<" the MDC alignment file: "<<m_alignFilePath<<std::endl;
34
35 m_wirePosFilePath = std::string(getenv("MDCGEOMSVCROOT"))+std::string("/share/WirePosCalib.dat");
36 //std::cout<<" the MDC wire position file: "<<m_wirePosFilePath<<std::endl;
37
38 m_wireTensionFilePath = std::string(getenv("MDCGEOMSVCROOT"))+std::string("/share/mdcWireTension.dat");
39 //std::cout<<" the MDC wire tension file: "<<m_wireTensionFilePath<<std::endl;
40
41 }
42 else {
43 std::cout<<"A fatal error, contact wangjk..."<<std::endl;
44 }
45
46 declareProperty("doSag", m_doSag = true);
47 declareProperty("readAlignParDataBase", m_readAlignParDataBase = true);
48 declareProperty("mcnoalignment",m_nomcalignment=true);
49 declareProperty("wholeShiftX",m_wholeShiftX = 0.);
50 declareProperty("wholeShiftY",m_wholeShiftY = 0.);
51 declareProperty("wholeShiftZ",m_wholeShiftZ = 0.);
52 declareProperty("wholeRotatX",m_wholeRotatX = 0.);
53 declareProperty("wholeRotatY",m_wholeRotatY = 0.);
54 declareProperty("wholeRotatZ",m_wholeRotatZ = 0.);
55 declareProperty("alignFilePath",m_alignFilePath);
56 declareProperty("wirePosFilePath",m_wirePosFilePath);
57 declareProperty("wireTensionFilePath",m_wireTensionFilePath);
58 declareProperty("useCGEM",m_useCgem = true);
59
60
61}
static bool m_readAlignParDataBase
Definition: MdcGeomSvc.h:55
static bool m_doSag
Definition: MdcGeomSvc.h:54
static bool m_nomcalignment
Definition: MdcGeomSvc.h:56

◆ ~MdcGeomSvc()

MdcGeomSvc::~MdcGeomSvc ( )

Definition at line 113 of file MdcGeomSvc.cxx.

113 {
114 for(vector<MdcGeoLayer*>::iterator it1 = fLayers.begin(); it1 != fLayers.end(); it1++) delete *it1;
115 for(vector<MdcGeoSuper*>::iterator it2 = fSupers.begin(); it2 != fSupers.end(); it2++) delete *it2;
116 for(vector<MdcGeoWire*>::iterator it3 = fWires.begin(); it3 != fWires.end(); it3++) delete *it3;
117 for(vector<MdcGeoEnd*>::iterator it4 = fEnd.begin(); it4 != fEnd.end(); it4++) delete *it4;
118 fGenerals.clear();
119 fWires.clear();
120 fLayers.clear();
121 fSupers.clear();
122 fEnd.clear();
123}

Member Function Documentation

◆ Dump()

void MdcGeomSvc::Dump ( )
virtual

Implements IMdcGeomSvc.

Definition at line 696 of file MdcGeomSvc.cxx.

696{}

Referenced by main().

◆ End()

const MdcGeoEnd *const MdcGeomSvc::End ( unsigned  id)

Definition at line 815 of file MdcGeomSvc.cxx.

815 {
816 if (id < fEnd.size())
817 return fEnd[id];
818
819 return 0;
820 }

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ finalize()

StatusCode MdcGeomSvc::finalize ( )
virtual

Definition at line 107 of file MdcGeomSvc.cxx.

107 {
108 MsgStream log(messageService(), name());
109 log << MSG::INFO << name() << ": End of Run" << endreq;
110 return StatusCode::SUCCESS;
111}

Referenced by main().

◆ GeneralLayer()

const MdcGeoGeneral *const MdcGeomSvc::GeneralLayer ( unsigned  id)
virtual

Implements IMdcGeomSvc.

Definition at line 802 of file MdcGeomSvc.cxx.

802 {
803 if (id < fGenerals.size())
804 return & fGenerals[id];
805
806 return 0;
807 }

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ getGeneralLayerSize()

const int MdcGeomSvc::getGeneralLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 686 of file MdcGeomSvc.cxx.

687{
688 return fGenerals.size();
689}

◆ getLayerSize()

const int MdcGeomSvc::getLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 676 of file MdcGeomSvc.cxx.

677{
678 return fLayers.size();
679}

Referenced by DotsConnection::initialize(), DotsHelixFitter::initialize(), MdcDetector::MdcDetector(), and KalFitAlg::set_Mdc().

◆ getSagFlag()

bool MdcGeomSvc::getSagFlag ( void  )
static

Definition at line 823 of file MdcGeomSvc.cxx.

823 {
824
825 return m_doSag;
826}

Referenced by MdcGeoWire::Sag().

◆ getSegmentNo()

const int MdcGeomSvc::getSegmentNo ( )

Definition at line 691 of file MdcGeomSvc.cxx.

692{
693 return fEnd.size();
694}

Referenced by BesMdcGeoParameter::InitFromSvc(), and DotsConnection::initialize().

◆ getSuperLayerSize()

const int MdcGeomSvc::getSuperLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 681 of file MdcGeomSvc.cxx.

682{
683 return fSupers.size();
684}

Referenced by DotsConnection::initialize(), MdcDetector::MdcDetector(), and KalFitAlg::set_Mdc().

◆ getWireSize()

const int MdcGeomSvc::getWireSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 671 of file MdcGeomSvc.cxx.

672{
673 return fWires.size();
674}

Referenced by DotsConnection::initialize(), MdcDetector::MdcDetector(), and KalFitAlg::set_Mdc().

◆ handle()

void MdcGeomSvc::handle ( const Incident &  inc)

this handle function is prepared for special use

Definition at line 743 of file MdcGeomSvc.cxx.

743 {
744 MsgStream log( messageService(), name() );
745 log << MSG::DEBUG << "handle: " << inc.type() << endreq;
746 IDataProviderSvc* m_eventSvc;
747 Gaudi::svcLocator()->service("EventDataSvc", m_eventSvc, true);
748 SmartDataPtr<Event::EventHeader> eventHeader(m_eventSvc,"/Event/EventHeader");
749 if (!eventHeader) {
750 log << MSG::FATAL << "Could not find Event Header" << endreq;
751 }
752 if (m_updataalign) return;
753 if (inc.type() == "NewRun" ){
754 log << MSG::DEBUG << "Begin Event" << endreq;
755 clean();
756 m_updataalign = true;
757 if(m_nomcalignment&&m_mindex==0) {
758 int RunNo=eventHeader->runNumber();
759 if(RunNo<0) m_readAlignParDataBase=false ;
760 else m_readAlignParDataBase=true;
761 m_mindex+=1;
762 cout<<"m__RunNo="<<RunNo<<"m_mindex="<<m_mindex<<endl;
763 }
764 //std::cout<<"############"<<m_readAlignParDataBase<<std::endl;
765 ReadFilePar();
766 }
767}

◆ initialize()

StatusCode MdcGeomSvc::initialize ( )
virtual

Definition at line 73 of file MdcGeomSvc.cxx.

73 {
74 MsgStream log(messageService(), name());
75 log << MSG::INFO << name() << ": Start of run initialisation" << endreq;
76
77 StatusCode sc = Service::initialize();
78 if ( sc.isFailure() ) return sc;
79 m_mindex=0;
80 m_updataalign = false;
81 IIncidentSvc* incsvc;
82 sc = service("IncidentSvc", incsvc);
83 int priority = 100;
84 if( sc.isSuccess() ){
85 incsvc -> addListener(this, "NewRun", priority);
86 }
87
88 // ReadFilePar(); // get geometry data from file SimUtil/dat/Mdc.txt
89 // Fill(); // get geometry data from Database
90
91 sc = service("CalibDataSvc", m_pCalibDataSvc, true);
92
93 if ( !sc.isSuccess() ) {
94 log << MSG::ERROR
95 << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
96 << endreq;
97 return sc;
98 } else {
99 log << MSG::DEBUG
100 << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"
101 << endreq;
102 }
103 ReadFilePar();
104 return StatusCode::SUCCESS;
105}

Referenced by main().

◆ Layer()

const MdcGeoLayer *const MdcGeomSvc::Layer ( unsigned  id)
virtual

◆ Misc()

const MdcGeoMisc *const MdcGeomSvc::Misc ( void  )

Definition at line 810 of file MdcGeomSvc.cxx.

810 {
811 return & fMisc;
812}

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ queryInterface()

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

Definition at line 63 of file MdcGeomSvc.cxx.

63 {
64
65 if ( IID_IMdcGeomSvc.versionMatch(riid) ) {
66 *ppvInterface = static_cast<IMdcGeomSvc*> (this);
67 } else {
68 return Service::queryInterface(riid, ppvInterface) ;
69 }
70 return StatusCode::SUCCESS;
71}

◆ SuperLayer()

const MdcGeoSuper *const MdcGeomSvc::SuperLayer ( unsigned  id)
virtual

Implements IMdcGeomSvc.

Definition at line 794 of file MdcGeomSvc.cxx.

794 {
795 if (id < fSupers.size())
796 return fSupers[id];
797
798 return 0;
799 }

◆ Wire() [1/2]

◆ Wire() [2/2]

const MdcGeoWire *const MdcGeomSvc::Wire ( unsigned  lyrid,
unsigned  wirid 
)
virtual

Implements IMdcGeomSvc.

Definition at line 778 of file MdcGeomSvc.cxx.

778 {
779 if ((lyrid <fLayers.size()) && ((int) wirid < Layer(lyrid)->NCell()))
780 return fWires[Layer(lyrid)->Wirst() + wirid];
781
782 return 0;
783 }
int Wirst(void) const
Definition: MdcGeoLayer.h:157
const MdcGeoLayer *const Layer(unsigned id)
Definition: MdcGeomSvc.cxx:786

Member Data Documentation

◆ m_doSag

bool MdcGeomSvc::m_doSag = true
static

Definition at line 54 of file MdcGeomSvc.h.

Referenced by getSagFlag(), and MdcGeomSvc().

◆ m_nomcalignment

bool MdcGeomSvc::m_nomcalignment =true
static

Definition at line 56 of file MdcGeomSvc.h.

Referenced by handle(), and MdcGeomSvc().

◆ m_readAlignParDataBase

bool MdcGeomSvc::m_readAlignParDataBase = true
static

Definition at line 55 of file MdcGeomSvc.h.

Referenced by handle(), and MdcGeomSvc().


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