BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
calibUtil::StripSrv Class Reference

#include <StripSrv.h>

Classes

struct  stowerRC
 Clients should use as return values for readData. More...

Public Types

enum  eBadType {
  UNKNOWN_BADTYPE , DEAD , HOT , UNKNOWN_BADTYPE ,
  DEAD , HOT , UNKNOWN_BADTYPE , DEAD ,
  HOT
}
enum  eBadType {
  UNKNOWN_BADTYPE , DEAD , HOT , UNKNOWN_BADTYPE ,
  DEAD , HOT , UNKNOWN_BADTYPE , DEAD ,
  HOT
}
enum  eBadType {
  UNKNOWN_BADTYPE , DEAD , HOT , UNKNOWN_BADTYPE ,
  DEAD , HOT , UNKNOWN_BADTYPE , DEAD ,
  HOT
}
typedef struct calibUtil::StripSrv::stowerRC towerRC
 Clients should use as return values for readData.
typedef std::vector< unsigned short int > StripCol
typedef struct calibUtil::StripSrv::stowerRC towerRC
 Clients should use as return values for readData.
typedef std::vector< unsigned short int > StripCol
typedef struct calibUtil::StripSrv::stowerRC towerRC
 Clients should use as return values for readData.
typedef std::vector< unsigned short int > StripCol

Public Member Functions

 StripSrv (std::string xmlFileName)
 StripSrv (eBadType badType, const GenericSrv &gen)
 Constructor to be used when creating new calibrations.
 ~StripSrv ()
 destructor. Deallocates memory
eBadType getBadType () const
 returns the status (Hot or Dead) of the strip
void getBadTowers (std::vector< towerRC > &towerIds) const
 lists all towers with bad strips
std::string getInst () const
 methods giving access to generic data
std::string getTimestamp () const
 Get timestamp.
std::string getCalType () const
 Get calibration type.
std::string getFmtVer () const
 Get format Version.
eVisitorRet traverseInfo (ClientObject *client) const
 call back method for client to access large data
eVisitorRet writeXml (std::ostream *out)
 StripSrv (std::string xmlFileName)
 StripSrv (eBadType badType, const GenericSrv &gen)
 Constructor to be used when creating new calibrations.
 ~StripSrv ()
 destructor. Deallocates memory
eBadType getBadType () const
 returns the status (Hot or Dead) of the strip
void getBadTowers (std::vector< towerRC > &towerIds) const
 lists all towers with bad strips
std::string getInst () const
 methods giving access to generic data
std::string getTimestamp () const
 Get timestamp.
std::string getCalType () const
 Get calibration type.
std::string getFmtVer () const
 Get format Version.
eVisitorRet traverseInfo (ClientObject *client) const
 call back method for client to access large data
eVisitorRet writeXml (std::ostream *out)
 StripSrv (std::string xmlFileName)
 StripSrv (eBadType badType, const GenericSrv &gen)
 Constructor to be used when creating new calibrations.
 ~StripSrv ()
 destructor. Deallocates memory
eBadType getBadType () const
 returns the status (Hot or Dead) of the strip
void getBadTowers (std::vector< towerRC > &towerIds) const
 lists all towers with bad strips
std::string getInst () const
 methods giving access to generic data
std::string getTimestamp () const
 Get timestamp.
std::string getCalType () const
 Get calibration type.
std::string getFmtVer () const
 Get format Version.
eVisitorRet traverseInfo (ClientObject *client) const
 call back method for client to access large data
eVisitorRet writeXml (std::ostream *out)

Detailed Description

Member Typedef Documentation

◆ StripCol [1/3]

typedef std::vector<unsigned short int> calibUtil::StripSrv::StripCol

◆ StripCol [2/3]

typedef std::vector<unsigned short int> calibUtil::StripSrv::StripCol

◆ StripCol [3/3]

typedef std::vector<unsigned short int> calibUtil::StripSrv::StripCol

◆ towerRC [1/3]

Clients should use as return values for readData.

◆ towerRC [2/3]

Clients should use as return values for readData.

◆ towerRC [3/3]

Clients should use as return values for readData.

Member Enumeration Documentation

◆ eBadType [1/3]

◆ eBadType [2/3]

Enumerator
UNKNOWN_BADTYPE 
DEAD 
HOT 
UNKNOWN_BADTYPE 
DEAD 
HOT 
UNKNOWN_BADTYPE 
DEAD 
HOT 

Definition at line 60 of file InstallArea/x86_64-el9-gcc13-dbg/include/calibUtil/StripSrv.h.

◆ eBadType [3/3]

Enumerator
UNKNOWN_BADTYPE 
DEAD 
HOT 
UNKNOWN_BADTYPE 
DEAD 
HOT 
UNKNOWN_BADTYPE 
DEAD 
HOT 

Definition at line 60 of file InstallArea/x86_64-el9-gcc13-opt/include/calibUtil/StripSrv.h.

Constructor & Destructor Documentation

◆ StripSrv() [1/6]

calibUtil::StripSrv::StripSrv ( std::string xmlFileName)

constructor. Initializes strip service by creating a DOM structure out of the XML file and filling in the internal data structures

Definition at line 31 of file StripSrv.cxx.

32 : m_badType( UNKNOWN_BADTYPE ), m_state( FROM_PERS ), m_genSrv( 0 ) {
33 using xmlBase::Dom;
34 using XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument;
35
36 xmlBase::XmlParser* parser = new xmlBase::XmlParser();
37 DOMDocument* doc = parser->parse( xmlFileName.c_str() );
38
39 if ( doc == 0 )
40 {
41 std::cerr << "Error parsing document" << xmlFileName << std::endl;
42 return;
43 }
44
45 DOMElement* docElt = doc->getDocumentElement();
46 m_genSrv = new GenericSrv( docElt );
47
48 std::vector<DOMElement*> towers;
49
50 Dom::getDescendantsByTagName( docElt, "tower", towers );
51 unsigned nTower = towers.size();
52
53 m_towers.reserve( nTower );
54
55 std::string bString = Dom::getAttribute( docElt, "badType" );
56 if ( !bString.compare( "hot" ) ) m_badType = HOT;
57 else if ( !bString.compare( "dead" ) ) m_badType = DEAD;
58 else m_badType = UNKNOWN_BADTYPE;
59
60 for ( unsigned int iTower = 0; iTower < nTower; iTower++ )
61 {
62 Tower tower;
63 tower.m_uniplanes.clear();
64 try
65 {
66 tower.m_row = Dom::getIntAttribute( towers[iTower], "row" );
67 tower.m_col = Dom::getIntAttribute( towers[iTower], "col" );
68 } catch ( xmlBase::DomException ex )
69 {
70 std::cerr << "From calibUtil::StripSrv::StripSrv" << std::endl
71 << ex.getMsg() << std::endl;
72 throw ex;
73 }
74
75 tower.m_howBad = 0;
76 tower.m_allBad = 0;
77
78 std::string attValue = Dom::getAttribute( towers[iTower], "nOnbdCalib" );
79 if ( attValue.compare( "true" ) == 0 ) { tower.m_howBad |= vCALIBUTIL_nOnbdCalib; }
80 attValue = Dom::getAttribute( towers[iTower], "nOnbdTrig" );
81 if ( attValue.compare( "true" ) == 0 ) { tower.m_howBad |= vCALIBUTIL_nOnbdTrig; }
82 attValue = Dom::getAttribute( towers[iTower], "nOnbdData" );
83 if ( attValue.compare( "true" ) == 0 ) { tower.m_howBad |= vCALIBUTIL_nOnbdData; }
84 if ( tower.m_howBad )
85 {
86 tower.m_allBad = 1;
87 goto NEXT;
88 } // otherwise have to process individual uniplane elements
89
90 {
91 DOMElement* uniElt = Dom::getFirstChildElement( towers[iTower] );
92
93 while ( uniElt != 0 )
94 {
95 Uniplane uni;
96 uni.m_howBad = 0;
97 fillUni( uniElt, &uni );
98 // if bad status, complain and return
99
100 tower.m_uniplanes.push_back( uni );
101 uniElt = Dom::getSiblingElement( uniElt );
102 }
103 }
104 NEXT:
105 m_towers.push_back( tower );
106 // towerElt = Dom::getSiblingElement(towerElt);
107 }
108 }
DOMDocument * parse(const char *const filename, const std::string &docType=std::string(""))
Parse an xml file, returning document node if successful.

◆ StripSrv() [2/6]

calibUtil::StripSrv::StripSrv ( eBadType badType,
const GenericSrv & gen )

Constructor to be used when creating new calibrations.

Definition at line 25 of file StripSrv.cxx.

26 : m_badType( badType ), m_state( BUILDING ) {
27 m_genSrv = new GenericSrv( gen );
28 }

◆ ~StripSrv() [1/3]

calibUtil::StripSrv::~StripSrv ( )

destructor. Deallocates memory

destructor used to deallocate memory

Definition at line 111 of file StripSrv.cxx.

111{ delete m_genSrv; }

◆ StripSrv() [3/6]

calibUtil::StripSrv::StripSrv ( std::string xmlFileName)

constructor. Initializes strip service by creating a DOM structure out of the XML file and filling in the internal data structures

◆ StripSrv() [4/6]

calibUtil::StripSrv::StripSrv ( eBadType badType,
const GenericSrv & gen )

Constructor to be used when creating new calibrations.

◆ ~StripSrv() [2/3]

calibUtil::StripSrv::~StripSrv ( )

destructor. Deallocates memory

◆ StripSrv() [5/6]

calibUtil::StripSrv::StripSrv ( std::string xmlFileName)

constructor. Initializes strip service by creating a DOM structure out of the XML file and filling in the internal data structures

◆ StripSrv() [6/6]

calibUtil::StripSrv::StripSrv ( eBadType badType,
const GenericSrv & gen )

Constructor to be used when creating new calibrations.

◆ ~StripSrv() [3/3]

calibUtil::StripSrv::~StripSrv ( )

destructor. Deallocates memory

Member Function Documentation

◆ getBadTowers() [1/3]

void calibUtil::StripSrv::getBadTowers ( std::vector< towerRC > & towerIds) const

lists all towers with bad strips

Lists all towers with bad strips.

Definition at line 117 of file StripSrv.cxx.

117 {
118 std::vector<Tower>::const_iterator it = m_towers.begin();
119 while ( it != m_towers.end() )
120 {
121
122 towerRC trc;
123 towerRCs.reserve( m_towers.size() );
124 trc.row = it->m_row;
125 trc.col = it->m_col;
126 towerRCs.push_back( trc );
127 it++;
128 }
129 }
struct calibUtil::StripSrv::stowerRC towerRC
Clients should use as return values for readData.

◆ getBadTowers() [2/3]

void calibUtil::StripSrv::getBadTowers ( std::vector< towerRC > & towerIds) const

lists all towers with bad strips

◆ getBadTowers() [3/3]

void calibUtil::StripSrv::getBadTowers ( std::vector< towerRC > & towerIds) const

lists all towers with bad strips

◆ getBadType() [1/3]

StripSrv::eBadType calibUtil::StripSrv::getBadType ( ) const

returns the status (Hot or Dead) of the strip

returns the status (Hot or Dead) of the strips

Definition at line 114 of file StripSrv.cxx.

114{ return m_badType; }

◆ getBadType() [2/3]

eBadType calibUtil::StripSrv::getBadType ( ) const

returns the status (Hot or Dead) of the strip

◆ getBadType() [3/3]

eBadType calibUtil::StripSrv::getBadType ( ) const

returns the status (Hot or Dead) of the strip

◆ getCalType() [1/3]

std::string calibUtil::StripSrv::getCalType ( ) const

Get calibration type.

Definition at line 140 of file StripSrv.cxx.

140{ return m_genSrv->getCalType(); }

◆ getCalType() [2/3]

std::string calibUtil::StripSrv::getCalType ( ) const

Get calibration type.

◆ getCalType() [3/3]

std::string calibUtil::StripSrv::getCalType ( ) const

Get calibration type.

◆ getFmtVer() [1/3]

std::string calibUtil::StripSrv::getFmtVer ( ) const

Get format Version.

Definition at line 143 of file StripSrv.cxx.

143{ return m_genSrv->getFmtVer(); }

◆ getFmtVer() [2/3]

std::string calibUtil::StripSrv::getFmtVer ( ) const

Get format Version.

◆ getFmtVer() [3/3]

std::string calibUtil::StripSrv::getFmtVer ( ) const

Get format Version.

◆ getInst() [1/3]

std::string calibUtil::StripSrv::getInst ( ) const

methods giving access to generic data

Get instrument name

Definition at line 134 of file StripSrv.cxx.

134{ return m_genSrv->getInst(); }

◆ getInst() [2/3]

std::string calibUtil::StripSrv::getInst ( ) const

methods giving access to generic data

Get instrument name

◆ getInst() [3/3]

std::string calibUtil::StripSrv::getInst ( ) const

methods giving access to generic data

Get instrument name

◆ getTimestamp() [1/3]

std::string calibUtil::StripSrv::getTimestamp ( ) const

Get timestamp.

Definition at line 137 of file StripSrv.cxx.

137{ return m_genSrv->getTimestamp(); }

◆ getTimestamp() [2/3]

std::string calibUtil::StripSrv::getTimestamp ( ) const

Get timestamp.

◆ getTimestamp() [3/3]

std::string calibUtil::StripSrv::getTimestamp ( ) const

Get timestamp.

◆ traverseInfo() [1/3]

eVisitorRet calibUtil::StripSrv::traverseInfo ( ClientObject * client) const

call back method for client to access large data

Definition at line 146 of file StripSrv.cxx.

146 {
147
148 /* NOTE: could also check for empty badLists and only
149 call back client if nonempty.
150 */
151 std::vector<Tower>::const_iterator iTower = m_towers.begin();
152
153 eVisitorRet ret = DONE;
154 while ( iTower != m_towers.end() )
155 {
156 if ( iTower->m_allBad )
157 {
158 ret = client->badTower( iTower->m_row, iTower->m_col, iTower->m_howBad );
159 if ( ret != CONT ) return ret;
160 }
161 // If tower not all bad, loop over planes within towers
162 else
163 {
164 std::vector<Uniplane>::const_iterator iUni = ( iTower->m_uniplanes ).begin();
165 while ( iUni != ( iTower->m_uniplanes ).end() )
166 {
167 ret = client->badPlane( iTower->m_row, iTower->m_col, iUni->m_tray, iUni->m_top,
168 iUni->m_howBad, iUni->m_allBad, ( iUni->m_strips ) );
169 if ( ret != CONT ) return ret;
170 iUni++;
171 }
172 }
173 ++iTower;
174 }
175 // If got to here, traversed the entire data structure without
176 // a murmur from client
177 return DONE;
178 }

◆ traverseInfo() [2/3]

eVisitorRet calibUtil::StripSrv::traverseInfo ( ClientObject * client) const

call back method for client to access large data

◆ traverseInfo() [3/3]

eVisitorRet calibUtil::StripSrv::traverseInfo ( ClientObject * client) const

call back method for client to access large data

◆ writeXml() [1/3]

eVisitorRet calibUtil::StripSrv::writeXml ( std::ostream * out)

Definition at line 303 of file StripSrv.cxx.

303{ return DONE; }

◆ writeXml() [2/3]

eVisitorRet calibUtil::StripSrv::writeXml ( std::ostream * out)

◆ writeXml() [3/3]

eVisitorRet calibUtil::StripSrv::writeXml ( std::ostream * out)

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