CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
DTLVStatus Class Reference

#include <DTLVStatus.h>

Public Types

typedef std::vector< std::pair
< DTLVStatusId, DTLVStatusData >
>::const_iterator 
const_iterator
 Access methods to data. More...
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 reset content More...
 
 DTLVStatus ()
 
 DTLVStatus (const std::string &version)
 
const_iterator end () const
 
int get (int wheelId, int stationId, int sectorId, int &flagCFE, int &flagDFE, int &flagCMC, int &flagDMC) const
 get content More...
 
int get (const DTChamberId &id, int &flagCFE, int &flagDFE, int &flagCMC, int &flagDMC) const
 
int set (int wheelId, int stationId, int sectorId, int flagCFE, int flagDFE, int flagCMC, int flagDMC)
 
int set (const DTChamberId &id, int flagCFE, int flagDFE, int flagCMC, int flagDMC)
 
int setFlagCFE (int wheelId, int stationId, int sectorId, int flag)
 
int setFlagCFE (const DTChamberId &id, int flag)
 
int setFlagCMC (int wheelId, int stationId, int sectorId, int flag)
 
int setFlagCMC (const DTChamberId &id, int flag)
 
int setFlagDFE (int wheelId, int stationId, int sectorId, int flag)
 
int setFlagDFE (const DTChamberId &id, int flag)
 
int setFlagDMC (int wheelId, int stationId, int sectorId, int flag)
 
int setFlagDMC (const DTChamberId &id, int flag)
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
 ~DTLVStatus ()
 

Private Member Functions

void cacheMap () const
 read and store full content More...
 
std::string mapName () const
 

Private Attributes

std::vector< std::pair
< DTLVStatusId, DTLVStatusData > > 
dataList
 
std::string dataVersion
 
DTBufferTree< int, int > * dBuf
 

Detailed Description

Description: Class to hold CCB status

Date:
2009/03/26 14:10:59
Revision:
1.1
Author
Paolo Ronchese INFN Padova

Definition at line 64 of file DTLVStatus.h.

Member Typedef Documentation

Access methods to data.

Definition at line 140 of file DTLVStatus.h.

Constructor & Destructor Documentation

DTLVStatus::DTLVStatus ( )

Constructor

Definition at line 35 of file DTLVStatus.cc.

References dataList, and dBuf.

35  :
36  dataVersion( " " ) {
37  dataList.reserve( 10 );
38  dBuf = 0;
39 }
std::string dataVersion
Definition: DTLVStatus.h:146
DTBufferTree< int, int > * dBuf
Definition: DTLVStatus.h:150
std::vector< std::pair< DTLVStatusId, DTLVStatusData > > dataList
Definition: DTLVStatus.h:148
DTLVStatus::DTLVStatus ( const std::string &  version)

Definition at line 42 of file DTLVStatus.cc.

References dataList, and dBuf.

42  :
43  dataVersion( version ) {
44  dataList.reserve( 10 );
45  dBuf = 0;
46 }
const std::string & version() const
access version
Definition: DTLVStatus.cc:142
std::string dataVersion
Definition: DTLVStatus.h:146
DTBufferTree< int, int > * dBuf
Definition: DTLVStatus.h:150
std::vector< std::pair< DTLVStatusId, DTLVStatusData > > dataList
Definition: DTLVStatus.h:148
DTLVStatus::~DTLVStatus ( )

Destructor

Definition at line 67 of file DTLVStatus.cc.

References dBuf.

67  {
68 // DTDataBuffer<int,int>::dropBuffer( mapName() );
69  delete dBuf;
70 }
DTBufferTree< int, int > * dBuf
Definition: DTLVStatus.h:150

Member Function Documentation

DTLVStatus::const_iterator DTLVStatus::begin ( void  ) const

Definition at line 367 of file DTLVStatus.cc.

References dataList.

367  {
368  return dataList.begin();
369 }
std::vector< std::pair< DTLVStatusId, DTLVStatusData > > dataList
Definition: DTLVStatus.h:148
void DTLVStatus::cacheMap ( ) const
private

read and store full content

Definition at line 384 of file DTLVStatus.cc.

References dataList, dBuf, DTBufferTree< Key, Content >::insert(), and DTLVStatusId::stationId.

Referenced by get(), and set().

384  {
385 
386 // std::string mName = mapName();
387 // DTBufferTree<int,int>* dBuf =
388 // DTDataBuffer<int,int>::openBuffer( mName );
389  DTBufferTree<int,int>** pBuf;
390  pBuf = const_cast<DTBufferTree<int,int>**>( &dBuf );
391  *pBuf = new DTBufferTree<int,int>;
392 
393  int entryNum = 0;
394  int entryMax = dataList.size();
395  std::vector<int> chanKey;
396  chanKey.reserve(3);
397  while ( entryNum < entryMax ) {
398 
399  const DTLVStatusId& chan = dataList[entryNum].first;
400 
401  chanKey.clear();
402  chanKey.push_back( chan. wheelId );
403  chanKey.push_back( chan.stationId );
404  chanKey.push_back( chan. sectorId );
405  dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ );
406 
407  }
408 
409  return;
410 
411 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
DTBufferTree< int, int > * dBuf
Definition: DTLVStatus.h:150
std::vector< std::pair< DTLVStatusId, DTLVStatusData > > dataList
Definition: DTLVStatus.h:148
void DTLVStatus::clear ( void  )
DTLVStatus::const_iterator DTLVStatus::end ( void  ) const

Definition at line 372 of file DTLVStatus.cc.

References dataList.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

372  {
373  return dataList.end();
374 }
std::vector< std::pair< DTLVStatusId, DTLVStatusData > > dataList
Definition: DTLVStatus.h:148
int DTLVStatus::get ( int  wheelId,
int  stationId,
int  sectorId,
int &  flagCFE,
int &  flagDFE,
int &  flagCMC,
int &  flagDMC 
) const

get content

Operations

Definition at line 84 of file DTLVStatus.cc.

References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTLVStatusData::flagCFE, DTLVStatusData::flagCMC, DTLVStatusData::flagDFE, DTLVStatusData::flagDMC, and edm::second().

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), and betterConfigParser.BetterConfigParser::getResultingSection().

90  {
91  flagCFE = 0;
92  flagDFE = 0;
93  flagCMC = 0;
94  flagDMC = 0;
95 
96 // std::string mName = mapName();
97 // DTBufferTree<int,int>* dBuf =
98 // DTDataBuffer<int,int>::findBuffer( mName );
99 // if ( dBuf == 0 ) {
100 // cacheMap();
101 // dBuf =
102 // DTDataBuffer<int,int>::findBuffer( mName );
103 // }
104  if ( dBuf == 0 ) cacheMap();
105 
106  std::vector<int> chanKey;
107  chanKey.reserve(3);
108  chanKey.push_back( wheelId );
109  chanKey.push_back( stationId );
110  chanKey.push_back( sectorId );
111  int ientry;
112  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
113  if ( !searchStatus ) {
114  const DTLVStatusData& data( dataList[ientry].second );
115  flagCFE = data.flagCFE;
116  flagDFE = data.flagDFE;
117  flagCMC = data.flagCMC;
118  flagDMC = data.flagDMC;
119  }
120 
121  return searchStatus;
122 
123 }
DTBufferTree< int, int > * dBuf
Definition: DTLVStatus.h:150
std::vector< std::pair< DTLVStatusId, DTLVStatusData > > dataList
Definition: DTLVStatus.h:148
U second(std::pair< T, U > const &p)
int find(ElementKey fKey, ElementKey lKey, Content &cont)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void cacheMap() const
read and store full content
Definition: DTLVStatus.cc:384
int DTLVStatus::get ( const DTChamberId id,
int &  flagCFE,
int &  flagDFE,
int &  flagCMC,
int &  flagDMC 
) const

Definition at line 126 of file DTLVStatus.cc.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), and betterConfigParser.BetterConfigParser::getResultingSection().

130  {
131  return get( id.wheel(),
132  id.station(),
133  id.sector(),
134  flagCFE,
135  flagDFE,
136  flagCMC,
137  flagDMC );
138 }
std::string DTLVStatus::mapName ( ) const
private

Definition at line 377 of file DTLVStatus.cc.

References dataVersion, and mergeVDriftHistosByStation::name.

377  {
378  std::stringstream name;
379  name << dataVersion << "_map_Mtime" << this;
380  return name.str();
381 }
std::string dataVersion
Definition: DTLVStatus.h:146
int DTLVStatus::set ( int  wheelId,
int  stationId,
int  sectorId,
int  flagCFE,
int  flagDFE,
int  flagCMC,
int  flagDMC 
)

Definition at line 161 of file DTLVStatus.cc.

References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTLVStatusData::flagCFE, DTLVStatusData::flagCMC, DTLVStatusData::flagDFE, DTLVStatusData::flagDMC, DTBufferTree< Key, Content >::insert(), combine::key, edm::second(), and DTLVStatusId::stationId.

Referenced by betterConfigParser.BetterConfigParser::getGeneral(), set(), setFlagCFE(), setFlagCMC(), setFlagDFE(), and setFlagDMC().

167  {
168 
169 // std::string mName = mapName();
170 // DTBufferTree<int,int>* dBuf =
171 // DTDataBuffer<int,int>::findBuffer( mName );
172 // if ( dBuf == 0 ) {
173 // cacheMap();
174 // dBuf =
175 // DTDataBuffer<int,int>::findBuffer( mName );
176 // }
177  if ( dBuf == 0 ) cacheMap();
178  std::vector<int> chanKey;
179  chanKey.reserve(3);
180  chanKey.push_back( wheelId );
181  chanKey.push_back( stationId );
182  chanKey.push_back( sectorId );
183  int ientry;
184  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
185 
186  if ( !searchStatus ) {
187  DTLVStatusData& data( dataList[ientry].second );
188  data.flagCFE = flagCFE;
189  data.flagDFE = flagDFE;
190  data.flagCMC = flagCMC;
191  data.flagDMC = flagDMC;
192  return -1;
193  }
194  else {
196  key. wheelId = wheelId;
197  key.stationId = stationId;
198  key. sectorId = sectorId;
200  data.flagCFE = flagCFE;
201  data.flagDFE = flagDFE;
202  data.flagCMC = flagCMC;
203  data.flagDMC = flagDMC;
204  ientry = dataList.size();
205  dataList.push_back( std::pair<DTLVStatusId,
206  DTLVStatusData>( key, data ) );
207  dBuf->insert( chanKey.begin(), chanKey.end(), ientry );
208  return 0;
209  }
210 
211  return 99;
212 
213 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
DTBufferTree< int, int > * dBuf
Definition: DTLVStatus.h:150
std::vector< std::pair< DTLVStatusId, DTLVStatusData > > dataList
Definition: DTLVStatus.h:148
U second(std::pair< T, U > const &p)
int find(ElementKey fKey, ElementKey lKey, Content &cont)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
list key
Definition: combine.py:13
void cacheMap() const
read and store full content
Definition: DTLVStatus.cc:384
int DTLVStatus::set ( const DTChamberId id,
int  flagCFE,
int  flagDFE,
int  flagCMC,
int  flagDMC 
)

Definition at line 216 of file DTLVStatus.cc.

References set(), and relativeConstraints::station.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

220  {
221  return set( id.wheel(),
222  id.station(),
223  id.sector(),
224  flagCFE,
225  flagDFE,
226  flagCMC,
227  flagDMC );
228 }
int set(int wheelId, int stationId, int sectorId, int flagCFE, int flagDFE, int flagCMC, int flagDMC)
Definition: DTLVStatus.cc:161
int DTLVStatus::setFlagCFE ( int  wheelId,
int  stationId,
int  sectorId,
int  flag 
)

Definition at line 231 of file DTLVStatus.cc.

References set().

Referenced by setFlagCFE().

234  {
235  int flagCFE;
236  int flagDFE;
237  int flagCMC;
238  int flagDMC;
239  get( wheelId,
240  stationId,
241  sectorId,
242  flagCFE,
243  flagDFE,
244  flagCMC,
245  flagDMC );
246  return set( wheelId,
247  stationId,
248  sectorId,
249  flag,
250  flagDFE,
251  flagCMC,
252  flagDMC );
253 }
int set(int wheelId, int stationId, int sectorId, int flagCFE, int flagDFE, int flagCMC, int flagDMC)
Definition: DTLVStatus.cc:161
int DTLVStatus::setFlagCFE ( const DTChamberId id,
int  flag 
)

Definition at line 256 of file DTLVStatus.cc.

References setFlagCFE(), and relativeConstraints::station.

257  {
258  return setFlagCFE( id.wheel(),
259  id.station(),
260  id.sector(),
261  flag );
262 }
int setFlagCFE(int wheelId, int stationId, int sectorId, int flag)
Definition: DTLVStatus.cc:231
int DTLVStatus::setFlagCMC ( int  wheelId,
int  stationId,
int  sectorId,
int  flag 
)

Definition at line 299 of file DTLVStatus.cc.

References set().

Referenced by setFlagCMC().

302  {
303  int flagCFE;
304  int flagDFE;
305  int flagCMC;
306  int flagDMC;
307  get( wheelId,
308  stationId,
309  sectorId,
310  flagCFE,
311  flagDFE,
312  flagCMC,
313  flagDMC );
314  return set( wheelId,
315  stationId,
316  sectorId,
317  flagCFE,
318  flagDFE,
319  flag,
320  flagDMC );
321 }
int set(int wheelId, int stationId, int sectorId, int flagCFE, int flagDFE, int flagCMC, int flagDMC)
Definition: DTLVStatus.cc:161
int DTLVStatus::setFlagCMC ( const DTChamberId id,
int  flag 
)

Definition at line 324 of file DTLVStatus.cc.

References setFlagCMC(), and relativeConstraints::station.

325  {
326  return setFlagCMC( id.wheel(),
327  id.station(),
328  id.sector(),
329  flag );
330 }
int setFlagCMC(int wheelId, int stationId, int sectorId, int flag)
Definition: DTLVStatus.cc:299
int DTLVStatus::setFlagDFE ( int  wheelId,
int  stationId,
int  sectorId,
int  flag 
)

Definition at line 265 of file DTLVStatus.cc.

References set().

Referenced by setFlagDFE().

268  {
269  int flagCFE;
270  int flagDFE;
271  int flagCMC;
272  int flagDMC;
273  get( wheelId,
274  stationId,
275  sectorId,
276  flagCFE,
277  flagDFE,
278  flagCMC,
279  flagDMC );
280  return set( wheelId,
281  stationId,
282  sectorId,
283  flagCFE,
284  flag,
285  flagCMC,
286  flagDMC );
287 }
int set(int wheelId, int stationId, int sectorId, int flagCFE, int flagDFE, int flagCMC, int flagDMC)
Definition: DTLVStatus.cc:161
int DTLVStatus::setFlagDFE ( const DTChamberId id,
int  flag 
)

Definition at line 290 of file DTLVStatus.cc.

References setFlagDFE(), and relativeConstraints::station.

291  {
292  return setFlagDFE( id.wheel(),
293  id.station(),
294  id.sector(),
295  flag );
296 }
int setFlagDFE(int wheelId, int stationId, int sectorId, int flag)
Definition: DTLVStatus.cc:265
int DTLVStatus::setFlagDMC ( int  wheelId,
int  stationId,
int  sectorId,
int  flag 
)

Definition at line 333 of file DTLVStatus.cc.

References set().

Referenced by setFlagDMC().

336  {
337  int flagCFE;
338  int flagDFE;
339  int flagCMC;
340  int flagDMC;
341  get( wheelId,
342  stationId,
343  sectorId,
344  flagCFE,
345  flagDFE,
346  flagCMC,
347  flagDMC );
348  return set( wheelId,
349  stationId,
350  sectorId,
351  flagCFE,
352  flagDFE,
353  flagCMC,
354  flag );
355 }
int set(int wheelId, int stationId, int sectorId, int flagCFE, int flagDFE, int flagCMC, int flagDMC)
Definition: DTLVStatus.cc:161
int DTLVStatus::setFlagDMC ( const DTChamberId id,
int  flag 
)

Definition at line 358 of file DTLVStatus.cc.

References setFlagDMC(), and relativeConstraints::station.

359  {
360  return setFlagDMC( id.wheel(),
361  id.station(),
362  id.sector(),
363  flag );
364 }
int setFlagDMC(int wheelId, int stationId, int sectorId, int flag)
Definition: DTLVStatus.cc:333
const std::string & DTLVStatus::version ( ) const

access version

Definition at line 142 of file DTLVStatus.cc.

References dataVersion.

142  {
143  return dataVersion;
144 }
std::string dataVersion
Definition: DTLVStatus.h:146
std::string & DTLVStatus::version ( )

Definition at line 147 of file DTLVStatus.cc.

References dataVersion.

147  {
148  return dataVersion;
149 }
std::string dataVersion
Definition: DTLVStatus.h:146

Member Data Documentation

std::vector< std::pair<DTLVStatusId,DTLVStatusData> > DTLVStatus::dataList
private

Definition at line 148 of file DTLVStatus.h.

Referenced by begin(), cacheMap(), clear(), DTLVStatus(), end(), get(), and set().

std::string DTLVStatus::dataVersion
private

Definition at line 146 of file DTLVStatus.h.

Referenced by mapName(), and version().

DTBufferTree<int,int>* DTLVStatus::dBuf
private

Definition at line 150 of file DTLVStatus.h.

Referenced by cacheMap(), clear(), DTLVStatus(), get(), set(), and ~DTLVStatus().