BOSS 7.0.7
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
59
60}
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 112 of file MdcGeomSvc.cxx.

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

Member Function Documentation

◆ Dump()

void MdcGeomSvc::Dump ( )
virtual

Implements IMdcGeomSvc.

Definition at line 694 of file MdcGeomSvc.cxx.

694{}

Referenced by main().

◆ End()

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

Definition at line 813 of file MdcGeomSvc.cxx.

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

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ finalize()

StatusCode MdcGeomSvc::finalize ( )
virtual

Definition at line 106 of file MdcGeomSvc.cxx.

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

Referenced by main().

◆ GeneralLayer()

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

Implements IMdcGeomSvc.

Definition at line 800 of file MdcGeomSvc.cxx.

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

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ getGeneralLayerSize()

const int MdcGeomSvc::getGeneralLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 684 of file MdcGeomSvc.cxx.

685{
686 return fGenerals.size();
687}

◆ getLayerSize()

const int MdcGeomSvc::getLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 674 of file MdcGeomSvc.cxx.

675{
676 return fLayers.size();
677}

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

◆ getSagFlag()

bool MdcGeomSvc::getSagFlag ( void  )
static

Definition at line 821 of file MdcGeomSvc.cxx.

821 {
822
823 return m_doSag;
824}

Referenced by MdcGeoWire::Sag().

◆ getSegmentNo()

const int MdcGeomSvc::getSegmentNo ( )

Definition at line 689 of file MdcGeomSvc.cxx.

690{
691 return fEnd.size();
692}

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ getSuperLayerSize()

const int MdcGeomSvc::getSuperLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 679 of file MdcGeomSvc.cxx.

680{
681 return fSupers.size();
682}

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

◆ getWireSize()

const int MdcGeomSvc::getWireSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 669 of file MdcGeomSvc.cxx.

670{
671 return fWires.size();
672}

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

◆ handle()

void MdcGeomSvc::handle ( const Incident &  inc)

this handle function is prepared for special use

Definition at line 741 of file MdcGeomSvc.cxx.

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

◆ initialize()

StatusCode MdcGeomSvc::initialize ( )
virtual

Definition at line 72 of file MdcGeomSvc.cxx.

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

Referenced by main().

◆ Layer()

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

Implements IMdcGeomSvc.

Definition at line 784 of file MdcGeomSvc.cxx.

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

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

◆ Misc()

const MdcGeoMisc *const MdcGeomSvc::Misc ( void  )

Definition at line 808 of file MdcGeomSvc.cxx.

808 {
809 return & fMisc;
810}

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ queryInterface()

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

Definition at line 62 of file MdcGeomSvc.cxx.

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

◆ SuperLayer()

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

Implements IMdcGeomSvc.

Definition at line 792 of file MdcGeomSvc.cxx.

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

◆ Wire() [1/2]

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

◆ Wire() [2/2]

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

Implements IMdcGeomSvc.

Definition at line 776 of file MdcGeomSvc.cxx.

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

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: