CGEM BOSS 6.6.5.f
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 ()
 
 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)
 
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
 
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 bool getSagFlag (void)
 
- Static Public Member Functions inherited from IMdcGeomSvc
static const InterfaceID & interfaceID ()
 
static const InterfaceID & interfaceID ()
 

Static Public Attributes

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

Detailed Description

Constructor & Destructor Documentation

◆ MdcGeomSvc() [1/2]

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}

◆ ~MdcGeomSvc() [1/2]

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}

◆ MdcGeomSvc() [2/2]

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

◆ ~MdcGeomSvc() [2/2]

MdcGeomSvc::~MdcGeomSvc ( )

Member Function Documentation

◆ Dump() [1/2]

void MdcGeomSvc::Dump ( )
virtual

Implements IMdcGeomSvc.

Definition at line 696 of file MdcGeomSvc.cxx.

696{}

Referenced by main().

◆ Dump() [2/2]

void MdcGeomSvc::Dump ( )
virtual

Implements IMdcGeomSvc.

◆ End() [1/2]

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().

◆ End() [2/2]

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

◆ finalize() [1/2]

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().

◆ finalize() [2/2]

virtual StatusCode MdcGeomSvc::finalize ( )
virtual

◆ GeneralLayer() [1/2]

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().

◆ GeneralLayer() [2/2]

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

Implements IMdcGeomSvc.

◆ getGeneralLayerSize() [1/2]

const int MdcGeomSvc::getGeneralLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 686 of file MdcGeomSvc.cxx.

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

◆ getGeneralLayerSize() [2/2]

const int MdcGeomSvc::getGeneralLayerSize ( )
virtual

Implements IMdcGeomSvc.

◆ getLayerSize() [1/2]

const int MdcGeomSvc::getLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 676 of file MdcGeomSvc.cxx.

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

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

◆ getLayerSize() [2/2]

const int MdcGeomSvc::getLayerSize ( )
virtual

Implements IMdcGeomSvc.

◆ getSagFlag() [1/2]

bool MdcGeomSvc::getSagFlag ( void  )
static

Definition at line 823 of file MdcGeomSvc.cxx.

823 {
824
825 return m_doSag;
826}

Referenced by MdcGeoWire::Sag().

◆ getSagFlag() [2/2]

static bool MdcGeomSvc::getSagFlag ( void  )
static

◆ getSegmentNo() [1/2]

const int MdcGeomSvc::getSegmentNo ( )

Definition at line 691 of file MdcGeomSvc.cxx.

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

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ getSegmentNo() [2/2]

const int MdcGeomSvc::getSegmentNo ( )

◆ getSuperLayerSize() [1/2]

const int MdcGeomSvc::getSuperLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 681 of file MdcGeomSvc.cxx.

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

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

◆ getSuperLayerSize() [2/2]

const int MdcGeomSvc::getSuperLayerSize ( )
virtual

Implements IMdcGeomSvc.

◆ getWireSize() [1/2]

const int MdcGeomSvc::getWireSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 671 of file MdcGeomSvc.cxx.

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

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

◆ getWireSize() [2/2]

const int MdcGeomSvc::getWireSize ( )
virtual

Implements IMdcGeomSvc.

◆ handle() [1/2]

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}

◆ handle() [2/2]

void MdcGeomSvc::handle ( const Incident &  inc)

◆ initialize() [1/2]

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().

◆ initialize() [2/2]

virtual StatusCode MdcGeomSvc::initialize ( )
virtual

◆ Layer() [1/2]

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

Implements IMdcGeomSvc.

Definition at line 786 of file MdcGeomSvc.cxx.

786 {
787 if (id < fLayers.size())
788 return fLayers[id];
789
790 return 0;
791 }

Referenced by BesMdcSD::Distance(), KalFitAlg::execute(), BesMdcGeoParameter::InitFromSvc(), MdcDetector::MdcDetector(), MdcTrackUtil::nLayerTrackPassed(), BesMdcSD::ProcessHits(), KalFitAlg::set_Mdc(), HoughHit::slayerType(), and Wire().

◆ Layer() [2/2]

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

Implements IMdcGeomSvc.

◆ Misc() [1/2]

const MdcGeoMisc *const MdcGeomSvc::Misc ( void  )

Definition at line 810 of file MdcGeomSvc.cxx.

810 {
811 return & fMisc;
812}

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ Misc() [2/2]

const MdcGeoMisc *const MdcGeomSvc::Misc ( void  )

◆ queryInterface() [1/2]

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}

◆ queryInterface() [2/2]

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

◆ SuperLayer() [1/2]

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 }

◆ SuperLayer() [2/2]

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

Implements IMdcGeomSvc.

◆ Wire() [1/4]

const MdcGeoWire *const MdcGeomSvc::Wire ( unsigned  id)
virtual

◆ Wire() [2/4]

const MdcGeoWire *const MdcGeomSvc::Wire ( unsigned  id)
virtual

Implements IMdcGeomSvc.

◆ Wire() [3/4]

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 }
const MdcGeoLayer *const Layer(unsigned id)
Definition: MdcGeomSvc.cxx:786

◆ Wire() [4/4]

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

Implements IMdcGeomSvc.

Member Data Documentation

◆ m_doSag

bool MdcGeomSvc::m_doSag = true
static

◆ m_nomcalignment

bool MdcGeomSvc::m_nomcalignment =true
static

Definition at line 56 of file InstallArea/include/MdcGeomSvc/MdcGeomSvc/MdcGeomSvc.h.

Referenced by handle(), and MdcGeomSvc().

◆ m_readAlignParDataBase

bool MdcGeomSvc::m_readAlignParDataBase = true
static

Definition at line 55 of file InstallArea/include/MdcGeomSvc/MdcGeomSvc/MdcGeomSvc.h.

Referenced by handle(), and MdcGeomSvc().


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