#include <CondFormats/DTObjects/interface/DTDeadFlag.h>
Public Types | |
typedef std::vector< std::pair < DTDeadFlagId, DTDeadFlagData > >::const_iterator | const_iterator |
Access methods to data. | |
Public Member Functions | |
const_iterator | begin () const |
int | cellStatus (const DTWireId &id, bool &dead_HV, bool &dead_TP, bool &dead_RO, bool &discCat) const |
int | cellStatus (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool &dead_HV, bool &dead_TP, bool &dead_RO, bool &discCat) const |
Operations. | |
void | clear () |
reset content | |
DTDeadFlag (const std::string &version) | |
DTDeadFlag () | |
Constructor. | |
const_iterator | end () const |
int | get (const DTWireId &id, bool &dead_HV, bool &dead_TP, bool &dead_RO, bool &discCat) const |
int | get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool &dead_HV, bool &dead_TP, bool &dead_RO, bool &discCat) const |
int | setCellDead_HV (const DTWireId &id, bool flag) |
int | setCellDead_HV (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool flag) |
int | setCellDead_RO (const DTWireId &id, bool flag) |
int | setCellDead_RO (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool flag) |
int | setCellDead_TP (const DTWireId &id, bool flag) |
int | setCellDead_TP (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool flag) |
int | setCellDiscCat (const DTWireId &id, bool flag) |
int | setCellDiscCat (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool flag) |
int | setCellStatus (const DTWireId &id, bool dead_HV, bool dead_TP, bool dead_RO, bool discCat) |
int | setCellStatus (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool dead_HV, bool dead_TP, bool dead_RO, bool discCat) |
std::string & | version () |
const std::string & | version () const |
access version | |
~DTDeadFlag () | |
Destructor. | |
Private Member Functions | |
void | cacheMap () const |
read and store full content | |
std::string | mapName () const |
Private Attributes | |
std::vector< std::pair < DTDeadFlagId, DTDeadFlagData > > | dataList |
std::string | dataVersion |
Definition at line 66 of file DTDeadFlag.h.
typedef std::vector< std::pair<DTDeadFlagId, DTDeadFlagData> >::const_iterator DTDeadFlag::const_iterator |
DTDeadFlag::DTDeadFlag | ( | ) |
Constructor.
Definition at line 29 of file DTDeadFlag.cc.
References dataList.
00029 : 00030 dataVersion( " " ) { 00031 dataList.reserve( 1000 ); 00032 }
DTDeadFlag::DTDeadFlag | ( | const std::string & | version | ) |
Definition at line 35 of file DTDeadFlag.cc.
References dataList.
00035 : 00036 dataVersion( version ) { 00037 dataList.reserve( 1000 ); 00038 }
DTDeadFlag::~DTDeadFlag | ( | ) |
Destructor.
Definition at line 62 of file DTDeadFlag.cc.
References DTDataBuffer< Key, Content >::dropBuffer(), and mapName().
00062 { 00063 DTDataBuffer<int,int>::dropBuffer( mapName() ); 00064 }
DTDeadFlag::const_iterator DTDeadFlag::begin | ( | ) | const |
Definition at line 408 of file DTDeadFlag.cc.
References dataList.
00408 { 00409 return dataList.begin(); 00410 }
void DTDeadFlag::cacheMap | ( | ) | const [private] |
read and store full content
Definition at line 425 of file DTDeadFlag.cc.
References dataList, DTBufferTree< Key, Content >::insert(), mapName(), DTDataBuffer< Key, Content >::openBuffer(), and DTDeadFlagId::stationId.
Referenced by get(), and setCellStatus().
00425 { 00426 00427 std::string mName = mapName(); 00428 DTBufferTree<int,int>* dBuf = 00429 DTDataBuffer<int,int>::openBuffer( mName ); 00430 00431 int entryNum = 0; 00432 int entryMax = dataList.size(); 00433 std::vector<int> chanKey; 00434 chanKey.reserve(6); 00435 while ( entryNum < entryMax ) { 00436 00437 const DTDeadFlagId& chan = dataList[entryNum].first; 00438 00439 chanKey.clear(); 00440 chanKey.push_back( chan. wheelId ); 00441 chanKey.push_back( chan.stationId ); 00442 chanKey.push_back( chan. sectorId ); 00443 chanKey.push_back( chan. slId ); 00444 chanKey.push_back( chan. layerId ); 00445 chanKey.push_back( chan. cellId ); 00446 dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ ); 00447 00448 } 00449 00450 return; 00451 00452 }
int DTDeadFlag::cellStatus | ( | const DTWireId & | id, | |
bool & | dead_HV, | |||
bool & | dead_TP, | |||
bool & | dead_RO, | |||
bool & | discCat | |||
) | const [inline] |
int DTDeadFlag::cellStatus | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
int | layerId, | |||
int | cellId, | |||
bool & | dead_HV, | |||
bool & | dead_TP, | |||
bool & | dead_RO, | |||
bool & | discCat | |||
) | const [inline] |
Operations.
get content
Definition at line 82 of file DTDeadFlag.h.
Referenced by setCellDead_HV(), setCellDead_RO(), setCellDead_TP(), and setCellDiscCat().
00092 { return get( wheelId, stationId, sectorId, slId, layerId, cellId, 00093 dead_HV, dead_TP, dead_RO, discCat ); };
reset content
Definition at line 151 of file DTDeadFlag.cc.
References dataList, DTDataBuffer< Key, Content >::dropBuffer(), and mapName().
00151 { 00152 DTDataBuffer<int,int>::dropBuffer( mapName() ); 00153 dataList.clear(); 00154 return; 00155 }
DTDeadFlag::const_iterator DTDeadFlag::end | ( | ) | const |
Definition at line 413 of file DTDeadFlag.cc.
References dataList.
00413 { 00414 return dataList.end(); 00415 }
int DTDeadFlag::get | ( | const DTWireId & | id, | |
bool & | dead_HV, | |||
bool & | dead_TP, | |||
bool & | dead_RO, | |||
bool & | discCat | |||
) | const |
Definition at line 125 of file DTDeadFlag.cc.
00129 { 00130 return get( id.wheel(), 00131 id.station(), 00132 id.sector(), 00133 id.superLayer(), 00134 id.layer(), 00135 id.wire(), 00136 dead_HV, dead_TP, dead_RO, discCat ); 00137 }
int DTDeadFlag::get | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
int | layerId, | |||
int | cellId, | |||
bool & | dead_HV, | |||
bool & | dead_TP, | |||
bool & | dead_RO, | |||
bool & | discCat | |||
) | const |
Definition at line 78 of file DTDeadFlag.cc.
References cacheMap(), data, dataList, DTDeadFlagData::dead_HV, DTDeadFlagData::dead_RO, DTDeadFlagData::dead_TP, DTDeadFlagData::discCat, DTBufferTree< Key, Content >::find(), DTDataBuffer< Key, Content >::findBuffer(), mapName(), and edm::second().
00087 { 00088 00089 dead_HV = 00090 dead_TP = 00091 dead_RO = 00092 discCat = false; 00093 00094 std::string mName = mapName(); 00095 DTBufferTree<int,int>* dBuf = 00096 DTDataBuffer<int,int>::findBuffer( mName ); 00097 if ( dBuf == 0 ) { 00098 cacheMap(); 00099 dBuf = 00100 DTDataBuffer<int,int>::findBuffer( mName ); 00101 } 00102 std::vector<int> chanKey; 00103 chanKey.reserve(6); 00104 chanKey.push_back( wheelId ); 00105 chanKey.push_back( stationId ); 00106 chanKey.push_back( sectorId ); 00107 chanKey.push_back( slId ); 00108 chanKey.push_back( layerId ); 00109 chanKey.push_back( cellId ); 00110 int ientry; 00111 int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry ); 00112 if ( !searchStatus ) { 00113 const DTDeadFlagData& data( dataList[ientry].second ); 00114 dead_HV = data.dead_HV; 00115 dead_TP = data.dead_TP; 00116 dead_RO = data.dead_RO; 00117 discCat = data.discCat; 00118 } 00119 00120 return searchStatus; 00121 00122 }
std::string DTDeadFlag::mapName | ( | ) | const [private] |
Definition at line 418 of file DTDeadFlag.cc.
References dataVersion, and name.
Referenced by cacheMap(), clear(), get(), setCellStatus(), and ~DTDeadFlag().
00418 { 00419 std::stringstream name; 00420 name << dataVersion << "_map_DeadFlag" << this; 00421 return name.str(); 00422 }
Definition at line 267 of file DTDeadFlag.cc.
References setCellDead_HV(), and muonGeometry::wheel.
00268 { 00269 return setCellDead_HV( id.wheel(), 00270 id.station(), 00271 id.sector(), 00272 id.superLayer(), 00273 id.layer(), 00274 id.wire(), 00275 flag ); 00276 }
int DTDeadFlag::setCellDead_HV | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
int | layerId, | |||
int | cellId, | |||
bool | flag | |||
) |
Definition at line 236 of file DTDeadFlag.cc.
References cellStatus(), setCellStatus(), and StDecayID::status.
Referenced by setCellDead_HV().
00242 { 00243 00244 bool dead_HV; 00245 bool dead_TP; 00246 bool dead_RO; 00247 bool discCat; 00248 int status = cellStatus( wheelId, 00249 stationId, 00250 sectorId, 00251 slId, 00252 layerId, 00253 cellId, 00254 dead_HV, dead_TP, dead_RO, discCat ); 00255 setCellStatus( wheelId, 00256 stationId, 00257 sectorId, 00258 slId, 00259 layerId, 00260 cellId, 00261 flag, dead_TP, dead_RO, discCat ); 00262 return status; 00263 00264 }
Definition at line 353 of file DTDeadFlag.cc.
References setCellDead_RO(), and muonGeometry::wheel.
00354 { 00355 return setCellDead_RO( id.wheel(), 00356 id.station(), 00357 id.sector(), 00358 id.superLayer(), 00359 id.layer(), 00360 id.wire(), 00361 flag ); 00362 }
int DTDeadFlag::setCellDead_RO | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
int | layerId, | |||
int | cellId, | |||
bool | flag | |||
) |
Definition at line 322 of file DTDeadFlag.cc.
References cellStatus(), setCellStatus(), and StDecayID::status.
Referenced by setCellDead_RO().
00328 { 00329 00330 bool dead_HV; 00331 bool dead_TP; 00332 bool dead_RO; 00333 bool discCat; 00334 int status = cellStatus( wheelId, 00335 stationId, 00336 sectorId, 00337 slId, 00338 layerId, 00339 cellId, 00340 dead_HV, dead_TP, dead_RO, discCat ); 00341 setCellStatus( wheelId, 00342 stationId, 00343 sectorId, 00344 slId, 00345 layerId, 00346 cellId, 00347 dead_HV, dead_TP, flag, discCat ); 00348 return status; 00349 00350 }
Definition at line 310 of file DTDeadFlag.cc.
References setCellDead_TP(), and muonGeometry::wheel.
00311 { 00312 return setCellDead_TP( id.wheel(), 00313 id.station(), 00314 id.sector(), 00315 id.superLayer(), 00316 id.layer(), 00317 id.wire(), 00318 flag ); 00319 }
int DTDeadFlag::setCellDead_TP | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
int | layerId, | |||
int | cellId, | |||
bool | flag | |||
) |
Definition at line 279 of file DTDeadFlag.cc.
References cellStatus(), setCellStatus(), and StDecayID::status.
Referenced by DTTPDeadWriter::analyze(), and setCellDead_TP().
00285 { 00286 00287 bool dead_HV; 00288 bool dead_TP; 00289 bool dead_RO; 00290 bool discCat; 00291 int status = cellStatus( wheelId, 00292 stationId, 00293 sectorId, 00294 slId, 00295 layerId, 00296 cellId, 00297 dead_HV, dead_TP, dead_RO, discCat ); 00298 setCellStatus( wheelId, 00299 stationId, 00300 sectorId, 00301 slId, 00302 layerId, 00303 cellId, 00304 dead_HV, flag, dead_RO, discCat ); 00305 return status; 00306 00307 }
Definition at line 396 of file DTDeadFlag.cc.
References setCellDiscCat(), and muonGeometry::wheel.
00397 { 00398 return setCellDiscCat( id.wheel(), 00399 id.station(), 00400 id.sector(), 00401 id.superLayer(), 00402 id.layer(), 00403 id.wire(), 00404 flag ); 00405 }
int DTDeadFlag::setCellDiscCat | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
int | layerId, | |||
int | cellId, | |||
bool | flag | |||
) |
Definition at line 365 of file DTDeadFlag.cc.
References cellStatus(), setCellStatus(), and StDecayID::status.
Referenced by setCellDiscCat().
00371 { 00372 00373 bool dead_HV; 00374 bool dead_TP; 00375 bool dead_RO; 00376 bool discCat; 00377 int status = cellStatus( wheelId, 00378 stationId, 00379 sectorId, 00380 slId, 00381 layerId, 00382 cellId, 00383 dead_HV, dead_TP, dead_RO, discCat ); 00384 setCellStatus( wheelId, 00385 stationId, 00386 sectorId, 00387 slId, 00388 layerId, 00389 cellId, 00390 dead_HV, dead_TP, dead_RO, flag ); 00391 return status; 00392 00393 }
int DTDeadFlag::setCellStatus | ( | const DTWireId & | id, | |
bool | dead_HV, | |||
bool | dead_TP, | |||
bool | dead_RO, | |||
bool | discCat | |||
) |
Definition at line 221 of file DTDeadFlag.cc.
References setCellStatus(), and muonGeometry::wheel.
00225 { 00226 return setCellStatus( id.wheel(), 00227 id.station(), 00228 id.sector(), 00229 id.superLayer(), 00230 id.layer(), 00231 id.wire(), 00232 dead_HV, dead_TP, dead_RO, discCat ); 00233 }
int DTDeadFlag::setCellStatus | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
int | layerId, | |||
int | cellId, | |||
bool | dead_HV, | |||
bool | dead_TP, | |||
bool | dead_RO, | |||
bool | discCat | |||
) |
Definition at line 158 of file DTDeadFlag.cc.
References cacheMap(), data, dataList, DTDeadFlagData::dead_HV, DTDeadFlagData::dead_RO, DTDeadFlagData::dead_TP, DTDeadFlagData::discCat, DTBufferTree< Key, Content >::find(), DTDataBuffer< Key, Content >::findBuffer(), DTBufferTree< Key, Content >::insert(), getDQMSummary::key, mapName(), edm::second(), and DTDeadFlagId::stationId.
Referenced by DTDeadFlagHandler::getNewObjects(), setCellDead_HV(), setCellDead_RO(), setCellDead_TP(), setCellDiscCat(), and setCellStatus().
00167 { 00168 00169 std::string mName = mapName(); 00170 DTBufferTree<int,int>* dBuf = 00171 DTDataBuffer<int,int>::findBuffer( mName ); 00172 if ( dBuf == 0 ) { 00173 cacheMap(); 00174 dBuf = 00175 DTDataBuffer<int,int>::findBuffer( mName ); 00176 } 00177 std::vector<int> chanKey; 00178 chanKey.reserve(6); 00179 chanKey.push_back( wheelId ); 00180 chanKey.push_back( stationId ); 00181 chanKey.push_back( sectorId ); 00182 chanKey.push_back( slId ); 00183 chanKey.push_back( layerId ); 00184 chanKey.push_back( cellId ); 00185 int ientry; 00186 int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry ); 00187 00188 if ( !searchStatus ) { 00189 DTDeadFlagData& data( dataList[ientry].second ); 00190 data.dead_HV = dead_HV; 00191 data.dead_TP = dead_TP; 00192 data.dead_RO = dead_RO; 00193 data.discCat = discCat; 00194 return -1; 00195 } 00196 else { 00197 DTDeadFlagId key; 00198 key. wheelId = wheelId; 00199 key.stationId = stationId; 00200 key. sectorId = sectorId; 00201 key. slId = slId; 00202 key. layerId = layerId; 00203 key. cellId = cellId; 00204 DTDeadFlagData data; 00205 data.dead_HV = dead_HV; 00206 data.dead_TP = dead_TP; 00207 data.dead_RO = dead_RO; 00208 data.discCat = discCat; 00209 ientry = dataList.size(); 00210 dataList.push_back( std::pair<const DTDeadFlagId, 00211 DTDeadFlagData>( key, data ) ); 00212 dBuf->insert( chanKey.begin(), chanKey.end(), ientry ); 00213 return 0; 00214 } 00215 00216 return 99; 00217 00218 }
std::string & DTDeadFlag::version | ( | ) |
Definition at line 146 of file DTDeadFlag.cc.
References dataVersion.
00146 { 00147 return dataVersion; 00148 }
const std::string & DTDeadFlag::version | ( | ) | const |
access version
Definition at line 141 of file DTDeadFlag.cc.
References dataVersion.
00141 { 00142 return dataVersion; 00143 }
std::vector< std::pair<DTDeadFlagId,DTDeadFlagData> > DTDeadFlag::dataList [private] |
Definition at line 191 of file DTDeadFlag.h.
Referenced by begin(), cacheMap(), clear(), DTDeadFlag(), end(), get(), and setCellStatus().
std::string DTDeadFlag::dataVersion [private] |