CGEM BOSS 6.6.5.i
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 11 of file BesGeoSelector.cxx.

11{}

Member Function Documentation

◆ addGeomFile()

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

Definition at line 13 of file BesGeoSelector.cxx.

14{
15 cout << "BesGeoSelector: " << fname << " start number " << startno << endl;
16 fgeom.push_back(GeomFileInfo(fname, startno));
17 sort(fgeom.begin(), fgeom.end());
18}

Referenced by BesClient::InitGeoSelector().

◆ clear()

void BesGeoSelector::clear ( )

Definition at line 20 of file BesGeoSelector.cxx.

21{
22 fgeom.clear();
23}

◆ getGeomFileNameFromRunNo()

const char * BesGeoSelector::getGeomFileNameFromRunNo ( int run_no)

Definition at line 26 of file BesGeoSelector.cxx.

27{
28 int absno = (run_no >= 0 ? run_no : -run_no);
29 for (vector<GeomFileInfo>::reverse_iterator i = fgeom.rbegin(); i != fgeom.rend(); ++i)
30 {
31 if (absno >= i->startno)
32 {
33 return i->filename.c_str();
34 }
35 }
36 cout << "BesGeoSelector Error: There is no suitable detector geometry!" << endl;
37 return "";
38}

Referenced by BesClient::GetEvent().

◆ hasGeomFile()

bool BesGeoSelector::hasGeomFile ( const char * fname)

Definition at line 41 of file BesGeoSelector.cxx.

42{
43 string filename(fname);
44 for (vector<GeomFileInfo>::iterator i = fgeom.begin(); i != fgeom.end(); ++i)
45 {
46 if (filename == i->filename) return true;
47 }
48 return false;
49}

Referenced by BesClient::OpenGeoFile().


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