BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesGeoSelector Class Reference

#include <BesGeoSelector.h>

Public Member Functions

 BesGeoSelector ()
 
void addGeomFile (const char *fname, int startno)
 
void clear ()
 
const char * getGeomFileNameFromRunNo (int run_no)
 
bool hasGeomFile (const char *fname)
 

Detailed Description

Definition at line 29 of file BesGeoSelector.h.

Constructor & Destructor Documentation

◆ BesGeoSelector()

BesGeoSelector::BesGeoSelector ( )

Definition at line 13 of file BesGeoSelector.cxx.

14{}

Member Function Documentation

◆ addGeomFile()

void BesGeoSelector::addGeomFile ( const char *  fname,
int  startno 
)

Definition at line 16 of file BesGeoSelector.cxx.

17{
18 cout << "BesGeoSelector: " << fname << " start phase " << startno << endl;
19 fgeom.push_back(GeomFileInfo(fname, startno));
20 sort(fgeom.begin(), fgeom.end());
21}

Referenced by BesClient::InitGeoSelector().

◆ clear()

void BesGeoSelector::clear ( )

Definition at line 23 of file BesGeoSelector.cxx.

24{
25 fgeom.clear();
26}

◆ getGeomFileNameFromRunNo()

const char * BesGeoSelector::getGeomFileNameFromRunNo ( int  run_no)

Definition at line 29 of file BesGeoSelector.cxx.

30{
31 DetVerSvc dvs("DetVerSvc", Gaudi::svcLocator()); //For converting runno to phase
32 dvs.initialize();
33 int absno = (run_no >= 0 ? run_no : -run_no);
34
35 for (vector<GeomFileInfo>::reverse_iterator i = fgeom.rbegin(); i != fgeom.rend(); ++i)
36 {
37 // if (absno >= i->startno)
38 // {
39 // return i->filename.c_str();
40 // }
41
42 //In BOSS 7.0.3, use DecVerSvc package to choose geometry
43 int phase = dvs.fromRun(absno);
44 if (phase >= i->startno)
45 {
46 return i->filename.c_str();
47 }
48 }
49 cout << "BesGeoSelector Error: There is no suitable detector geometry!" << endl;
50 return "";
51}

Referenced by BesClient::GetEvent().

◆ hasGeomFile()

bool BesGeoSelector::hasGeomFile ( const char *  fname)

Definition at line 54 of file BesGeoSelector.cxx.

55{
56 string filename(fname);
57 for (vector<GeomFileInfo>::iterator i = fgeom.begin(); i != fgeom.end(); ++i)
58 {
59 if (filename == i->filename) return true;
60 }
61 return false;
62}

Referenced by BesClient::OpenGeoFile().


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