BOSS 7.1.0
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 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 ()
 

Static Public Member Functions

static bool getSagFlag (void)
 

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 : base_class(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 ( )

Definition at line 692 of file MdcGeomSvc.cxx.

692{}

Referenced by main().

◆ End()

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

Definition at line 811 of file MdcGeomSvc.cxx.

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

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)

Definition at line 798 of file MdcGeomSvc.cxx.

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

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ getGeneralLayerSize()

const int MdcGeomSvc::getGeneralLayerSize ( )

Definition at line 682 of file MdcGeomSvc.cxx.

683{
684 return fGenerals.size();
685}

◆ getLayerSize()

const int MdcGeomSvc::getLayerSize ( )

Definition at line 672 of file MdcGeomSvc.cxx.

673{
674 return fLayers.size();
675}

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

◆ getSagFlag()

bool MdcGeomSvc::getSagFlag ( void  )
static

Definition at line 819 of file MdcGeomSvc.cxx.

819 {
820
821 return m_doSag;
822}

Referenced by MdcGeoWire::Sag().

◆ getSegmentNo()

const int MdcGeomSvc::getSegmentNo ( )

Definition at line 687 of file MdcGeomSvc.cxx.

688{
689 return fEnd.size();
690}

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ getSuperLayerSize()

const int MdcGeomSvc::getSuperLayerSize ( )

Definition at line 677 of file MdcGeomSvc.cxx.

678{
679 return fSupers.size();
680}

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

◆ getWireSize()

const int MdcGeomSvc::getWireSize ( )

Definition at line 667 of file MdcGeomSvc.cxx.

668{
669 return fWires.size();
670}

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 739 of file MdcGeomSvc.cxx.

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

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

◆ Misc()

const MdcGeoMisc *const MdcGeomSvc::Misc ( void  )

Definition at line 806 of file MdcGeomSvc.cxx.

806 {
807 return & fMisc;
808}

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ SuperLayer()

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

Definition at line 790 of file MdcGeomSvc.cxx.

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

◆ Wire() [1/2]

◆ Wire() [2/2]

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

Definition at line 774 of file MdcGeomSvc.cxx.

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

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: