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
DTCCBConfig Class Reference

#include <DTCCBConfig.h>

Public Types

typedef
ccb_config_map::const_iterator 
ccb_config_iterator
 
typedef std::vector< std::pair
< DTCCBId, std::vector< int > > > 
ccb_config_map
 
typedef std::vector< std::pair
< DTCCBId, int >
>::const_iterator 
const_iterator
 Access methods to data. More...
 

Public Member Functions

int appendConfigKey (int wheelId, int stationId, int sectorId, const std::vector< int > &confKey)
 
int appendConfigKey (const DTChamberId &id, const std::vector< int > &confKey)
 
const_iterator begin () const
 
void clear ()
 reset content More...
 
int configKey (int wheelId, int stationId, int sectorId, std::vector< int > &confKey) const
 
int configKey (const DTChamberId &id, std::vector< int > &confKey) const
 
ccb_config_map configKeyMap () const
 
 DTCCBConfig ()
 
 DTCCBConfig (const std::string &version)
 
const_iterator end () const
 
std::vector< DTConfigKeyfullKey () const
 get content More...
 
int setConfigKey (int wheelId, int stationId, int sectorId, const std::vector< int > &confKey)
 
int setConfigKey (const DTChamberId &id, const std::vector< int > &confKey)
 
void setFullKey (const std::vector< DTConfigKey > &)
 
void setStamp (int s)
 
int stamp () const
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
virtual ~DTCCBConfig ()
 

Private Member Functions

void cacheMap () const
 read and store full content More...
 
void resetMap () const
 

Private Attributes

std::vector< std::pair
< DTCCBId, int > > 
dataList
 
std::string dataVersion
 
DTBufferTree< int, std::vector
< int > * > * 
dBuf
 
std::vector< DTConfigKeyfullConfigKey
 
int timeStamp
 

Detailed Description

Description: Class to hold configuration identifier for chambers

Date:
2010/01/20 18:20:07
Revision:
1.4
Author
Paolo Ronchese INFN Padova

Definition at line 63 of file DTCCBConfig.h.

Member Typedef Documentation

typedef ccb_config_map::const_iterator DTCCBConfig::ccb_config_iterator

Definition at line 88 of file DTCCBConfig.h.

typedef std::vector< std::pair< DTCCBId,std::vector<int> > > DTCCBConfig::ccb_config_map

Definition at line 87 of file DTCCBConfig.h.

typedef std::vector< std::pair<DTCCBId,int> >::const_iterator DTCCBConfig::const_iterator

Access methods to data.

Definition at line 118 of file DTCCBConfig.h.

Constructor & Destructor Documentation

DTCCBConfig::DTCCBConfig ( )

Constructor

Definition at line 35 of file DTCCBConfig.cc.

References dataList, and dBuf.

35  :
36  dataVersion( " " ) {
37  dataList.reserve( 1000 );
38  dBuf = 0;
39 }
std::vector< std::pair< DTCCBId, int > > dataList
Definition: DTCCBConfig.h:127
std::string dataVersion
Definition: DTCCBConfig.h:125
DTBufferTree< int, std::vector< int > * > * dBuf
Definition: DTCCBConfig.h:129
DTCCBConfig::DTCCBConfig ( const std::string &  version)

Definition at line 42 of file DTCCBConfig.cc.

References dataList, and dBuf.

42  :
43  dataVersion( version ) {
44  dataList.reserve( 1000 );
45  dBuf = 0;
46 }
std::vector< std::pair< DTCCBId, int > > dataList
Definition: DTCCBConfig.h:127
const std::string & version() const
access version
Definition: DTCCBConfig.cc:172
std::string dataVersion
Definition: DTCCBConfig.h:125
DTBufferTree< int, std::vector< int > * > * dBuf
Definition: DTCCBConfig.h:129
DTCCBConfig::~DTCCBConfig ( )
virtual

Destructor

Definition at line 65 of file DTCCBConfig.cc.

References dBuf, and resetMap().

65  {
66  resetMap();
67 // DTDataBuffer< int,std::vector<int>* >::dropBuffer( mapName() );
68  delete dBuf;
69 }
void resetMap() const
Definition: DTCCBConfig.cc:396
DTBufferTree< int, std::vector< int > * > * dBuf
Definition: DTCCBConfig.h:129

Member Function Documentation

int DTCCBConfig::appendConfigKey ( int  wheelId,
int  stationId,
int  sectorId,
const std::vector< int > &  confKey 
)

Definition at line 278 of file DTCCBConfig.cc.

References cacheMap(), dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), combine::key, and DTCCBId::stationId.

Referenced by appendConfigKey(), DTUserKeyedConfigHandler::getNewObjects(), and DTKeyedConfigHandler::getNewObjects().

281  {
282 
283 // std::string mName = mapName();
284 // DTBufferTree< int,std::vector<int>* >* dBuf =
285 // DTDataBuffer< int,std::vector<int>* >::findBuffer( mName );
286 // if ( dBuf == 0 ) {
287 // cacheMap();
288 // dBuf =
289 // DTDataBuffer< int,std::vector<int>* >::findBuffer( mName );
290 // }
291  if ( dBuf == 0 ) cacheMap();
292 
293  std::vector<int> chanKey;
294  chanKey.reserve(3);
295  chanKey.push_back( wheelId );
296  chanKey.push_back( stationId );
297  chanKey.push_back( sectorId );
298 
299  DTCCBId ccbId;
300  ccbId. wheelId = wheelId;
301  ccbId.stationId = stationId;
302  ccbId. sectorId = sectorId;
303  std::vector<int>::const_iterator iter = confKey.begin();
304  std::vector<int>::const_iterator iend = confKey.end();
305  int key;
306 
307  std::vector<int>* confPtr;
308  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), confPtr );
309 
310  if ( searchStatus ) {
311  dBuf->insert( chanKey.begin(),
312  chanKey.end(), confPtr = new std::vector<int>( confKey ) );
313  }
314 
315  while ( iter != iend ) {
316  key = *iter++;
317  dataList.push_back( std::pair<DTCCBId,int>( ccbId, key ) );
318  confPtr->push_back( key );
319  }
320 
321  if ( !searchStatus ) {
322  return -1;
323  }
324  else {
325  return 0;
326  }
327 
328 }
std::vector< std::pair< DTCCBId, int > > dataList
Definition: DTCCBConfig.h:127
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
void cacheMap() const
read and store full content
Definition: DTCCBConfig.cc:359
int stationId
Definition: DTCCBConfig.h:44
int find(ElementKey fKey, ElementKey lKey, Content &cont)
list key
Definition: combine.py:13
DTBufferTree< int, std::vector< int > * > * dBuf
Definition: DTCCBConfig.h:129
int DTCCBConfig::appendConfigKey ( const DTChamberId id,
const std::vector< int > &  confKey 
)

Definition at line 331 of file DTCCBConfig.cc.

References appendConfigKey(), and relativeConstraints::station.

332  {
333  return appendConfigKey( id.wheel(),
334  id.station(),
335  id.sector(),
336  confKey );
337 }
int appendConfigKey(int wheelId, int stationId, int sectorId, const std::vector< int > &confKey)
Definition: DTCCBConfig.cc:278
DTCCBConfig::const_iterator DTCCBConfig::begin ( void  ) const

Definition at line 340 of file DTCCBConfig.cc.

References dataList.

Referenced by configKeyMap(), DTUserKeyedConfigHandler::getNewObjects(), and DTKeyedConfigHandler::getNewObjects().

340  {
341  return dataList.begin();
342 }
std::vector< std::pair< DTCCBId, int > > dataList
Definition: DTCCBConfig.h:127
void DTCCBConfig::cacheMap ( ) const
private

read and store full content

Definition at line 359 of file DTCCBConfig.cc.

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

Referenced by appendConfigKey(), configKey(), and setConfigKey().

359  {
360 
361 // std::string mName = mapName();
362 // DTBufferTree< int,std::vector<int>* >* dBuf =
363 // DTDataBuffer< int,std::vector<int>* >::openBuffer( mName );
365  pBuf = const_cast<DTBufferTree< int,std::vector<int>* >**>( &dBuf );
366  *pBuf = new DTBufferTree< int,std::vector<int>* >;
367  dBuf->setDefault( 0 );
368 
369  const_iterator iter = dataList.begin();
370  const_iterator iend = dataList.end();
371  std::vector<int> chanKey;
372  chanKey.reserve(3);
373  while ( iter != iend ) {
374 
375  const DTCCBId& chan = iter->first;
376 
377  chanKey.clear();
378  chanKey.push_back( chan. wheelId );
379  chanKey.push_back( chan.stationId );
380  chanKey.push_back( chan. sectorId );
381  std::vector<int>* ccbConfPtr;
382  int searchStatus = dBuf->find( chanKey.begin(),
383  chanKey.end(), ccbConfPtr );
384  if ( searchStatus ) dBuf->insert( chanKey.begin(),
385  chanKey.end(),
386  ccbConfPtr = new std::vector<int> );
387  ccbConfPtr->push_back( iter->second );
388 
389  iter++;
390 
391  }
392 
393 }
std::vector< std::pair< DTCCBId, int > > dataList
Definition: DTCCBConfig.h:127
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
std::vector< std::pair< DTCCBId, int > >::const_iterator const_iterator
Access methods to data.
Definition: DTCCBConfig.h:118
int stationId
Definition: DTCCBConfig.h:44
static void setDefault(const Content &def)
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, std::vector< int > * > * dBuf
Definition: DTCCBConfig.h:129
void DTCCBConfig::clear ( void  )
int DTCCBConfig::configKey ( int  wheelId,
int  stationId,
int  sectorId,
std::vector< int > &  confKey 
) const

Definition at line 93 of file DTCCBConfig.cc.

References cacheMap(), dBuf, and DTBufferTree< Key, Content >::find().

Referenced by configKey().

96  {
97 
98  confKey.clear();
99 // std::string mName = mapName();
100 // DTBufferTree< int,std::vector<int>* >* dBuf =
101 // DTDataBuffer< int,std::vector<int>* >::findBuffer( mName );
102 // if ( dBuf == 0 ) {
103 // cacheMap();
104 // dBuf =
105 // DTDataBuffer< int,std::vector<int>* >::findBuffer( mName );
106 // }
107  if ( dBuf == 0 ) cacheMap();
108 
109  std::vector<int> chanKey;
110  chanKey.reserve(3);
111  chanKey.push_back( wheelId );
112  chanKey.push_back( stationId );
113  chanKey.push_back( sectorId );
114  std::vector<int>* confPtr;
115  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), confPtr );
116  if ( !searchStatus ) confKey = *confPtr;
117 
118  return searchStatus;
119 
120 }
void cacheMap() const
read and store full content
Definition: DTCCBConfig.cc:359
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, std::vector< int > * > * dBuf
Definition: DTCCBConfig.h:129
int DTCCBConfig::configKey ( const DTChamberId id,
std::vector< int > &  confKey 
) const

Definition at line 123 of file DTCCBConfig.cc.

References configKey(), and relativeConstraints::station.

124  {
125  return configKey( id.wheel(),
126  id.station(),
127  id.sector(),
128  confKey );
129 }
int configKey(int wheelId, int stationId, int sectorId, std::vector< int > &confKey) const
Definition: DTCCBConfig.cc:93
DTCCBConfig::ccb_config_map DTCCBConfig::configKeyMap ( ) const

Definition at line 133 of file DTCCBConfig.cc.

References begin(), end(), and DTCCBId::stationId.

133  {
134 
135  ccb_config_map keyList;
136  std::vector< std::pair<DTCCBId,int>* > tempList;
137  const_iterator d_iter = begin();
138  const_iterator d_iend = end();
139  while ( d_iter != d_iend ) tempList.push_back(
140  new std::pair<DTCCBId,int>( *d_iter++ ) );
141  std::vector< std::pair<DTCCBId,int>* >::iterator t_iter = tempList.begin();
142  std::vector< std::pair<DTCCBId,int>* >::iterator t_iend = tempList.end();
143  while ( t_iter != t_iend ) {
144  std::pair<DTCCBId,int>* ptr = *t_iter++;
145  if ( ptr == 0 ) continue;
146  DTCCBId& ccbId = ptr->first;
147  std::vector<int> cfgKeys;
148  cfgKeys.push_back( ptr->second );
149  std::vector< std::pair<DTCCBId,int>* >::iterator n_iter( t_iter );
150  while( n_iter != t_iend ) {
151  std::pair<DTCCBId,int>*& pck = *n_iter++;
152  if ( pck == 0 ) continue;
153  DTCCBId& chkId = pck->first;
154  if ( ( chkId. wheelId == ccbId. wheelId ) &&
155  ( chkId.stationId == ccbId.stationId ) &&
156  ( chkId. sectorId == ccbId. sectorId ) ) {
157  cfgKeys.push_back( pck->second );
158  delete pck;
159  pck = 0;
160  }
161  }
162  keyList.push_back( std::pair< DTCCBId,std::vector<int> >( ccbId,
163  cfgKeys ) );
164  delete ptr;
165  }
166  return keyList;
167 
168 }
const_iterator end() const
Definition: DTCCBConfig.cc:345
std::vector< std::pair< DTCCBId, int > >::const_iterator const_iterator
Access methods to data.
Definition: DTCCBConfig.h:118
int stationId
Definition: DTCCBConfig.h:44
std::vector< std::pair< DTCCBId, std::vector< int > > > ccb_config_map
Definition: DTCCBConfig.h:87
const_iterator begin() const
Definition: DTCCBConfig.cc:340
DTCCBConfig::const_iterator DTCCBConfig::end ( void  ) const

Definition at line 345 of file DTCCBConfig.cc.

References dataList.

Referenced by configKeyMap(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), DTUserKeyedConfigHandler::getNewObjects(), and DTKeyedConfigHandler::getNewObjects().

345  {
346  return dataList.end();
347 }
std::vector< std::pair< DTCCBId, int > > dataList
Definition: DTCCBConfig.h:127
std::vector< DTConfigKey > DTCCBConfig::fullKey ( ) const

get content

Operations

Definition at line 83 of file DTCCBConfig.cc.

References fullConfigKey.

83  {
84  return fullConfigKey;
85 }
std::vector< DTConfigKey > fullConfigKey
Definition: DTCCBConfig.h:126
void DTCCBConfig::resetMap ( ) const
private

Definition at line 396 of file DTCCBConfig.cc.

References DTBufferTree< Key, Content >::contList(), dBuf, and list().

Referenced by clear(), and ~DTCCBConfig().

396  {
397 // std::string mName = mapName();
398 // DTBufferTree< int,std::vector<int>* >* dBuf =
399 // DTDataBuffer< int,std::vector<int>* >::findBuffer( mName );
400  if ( dBuf != 0 ) {
401  std::vector< std::vector<int>* > list( dBuf->contList() );
402  std::vector< std::vector<int>* >::const_iterator iter = list.begin();
403  std::vector< std::vector<int>* >::const_iterator iend = list.end();
404  while ( iter != iend ) delete *iter++;
405  }
406  return;
407 }
std::vector< std::pair< DTCCBId, int > >::const_iterator const_iterator
Access methods to data.
Definition: DTCCBConfig.h:118
std::vector< Content > contList()
DTBufferTree< int, std::vector< int > * > * dBuf
Definition: DTCCBConfig.h:129
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
int DTCCBConfig::setConfigKey ( int  wheelId,
int  stationId,
int  sectorId,
const std::vector< int > &  confKey 
)

Definition at line 202 of file DTCCBConfig.cc.

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

Referenced by setConfigKey().

205  {
206 
207 // std::string mName = mapName();
208 // DTBufferTree< int,std::vector<int>* >* dBuf =
209 // DTDataBuffer< int,std::vector<int>* >::findBuffer( mName );
210 // if ( dBuf == 0 ) {
211 // cacheMap();
212 // dBuf =
213 // DTDataBuffer< int,std::vector<int>* >::findBuffer( mName );
214 // }
215  if ( dBuf == 0 ) cacheMap();
216 
217  std::vector<int> chanKey;
218  chanKey.reserve(3);
219  chanKey.push_back( wheelId );
220  chanKey.push_back( stationId );
221  chanKey.push_back( sectorId );
222 
223  std::vector<int>* confPtr;
224  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), confPtr );
225 
226  if ( !searchStatus ) {
227  std::vector< std::pair<DTCCBId,int> > tempList;
228  const_iterator iter = dataList.begin();
229  const_iterator iend = dataList.end();
230  while ( iter != iend ) {
231  const DTCCBId& ccbId( iter->first );
232 // if ( ( ccbId. wheelId == wheelId ) &&
233 // ( ccbId.stationId == stationId ) &&
234 // ( ccbId. sectorId == sectorId ) ) tempList.push_back( *iter );
235  if ( ( ccbId. wheelId != wheelId ) ||
236  ( ccbId.stationId != stationId ) ||
237  ( ccbId. sectorId != sectorId ) ) tempList.push_back( *iter );
238  ++iter;
239  }
240  dataList = tempList;
241  DTCCBId ccbId;
242  ccbId. wheelId = wheelId;
243  ccbId.stationId = stationId;
244  ccbId. sectorId = sectorId;
245  std::vector<int>::const_iterator cfgIter = confKey.begin();
246  std::vector<int>::const_iterator cfgIend = confKey.end();
247  while ( cfgIter != cfgIend ) dataList.push_back( std::pair<DTCCBId,int>(
248  ccbId, *cfgIter++ ) );
249  *confPtr = confKey;
250  return -1;
251  }
252  else {
253  dBuf->insert( chanKey.begin(),
254  chanKey.end(), new std::vector<int>( confKey ) );
255  DTCCBId ccbId;
256  ccbId. wheelId = wheelId;
257  ccbId.stationId = stationId;
258  ccbId. sectorId = sectorId;
259  std::vector<int>::const_iterator cfgIter = confKey.begin();
260  std::vector<int>::const_iterator cfgIend = confKey.end();
261  while ( cfgIter != cfgIend ) dataList.push_back( std::pair<DTCCBId,int>(
262  ccbId, *cfgIter++ ) );
263  return 0;
264  }
265 
266 }
std::vector< std::pair< DTCCBId, int > > dataList
Definition: DTCCBConfig.h:127
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
void cacheMap() const
read and store full content
Definition: DTCCBConfig.cc:359
std::vector< std::pair< DTCCBId, int > >::const_iterator const_iterator
Access methods to data.
Definition: DTCCBConfig.h:118
int stationId
Definition: DTCCBConfig.h:44
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, std::vector< int > * > * dBuf
Definition: DTCCBConfig.h:129
int DTCCBConfig::setConfigKey ( const DTChamberId id,
const std::vector< int > &  confKey 
)

Definition at line 269 of file DTCCBConfig.cc.

References setConfigKey(), and relativeConstraints::station.

270  {
271  return setConfigKey( id.wheel(),
272  id.station(),
273  id.sector(),
274  confKey );
275 }
int setConfigKey(int wheelId, int stationId, int sectorId, const std::vector< int > &confKey)
Definition: DTCCBConfig.cc:202
void DTCCBConfig::setFullKey ( const std::vector< DTConfigKey > &  key)

Definition at line 192 of file DTCCBConfig.cc.

References fullConfigKey, and combine::key.

Referenced by DTKeyedConfigHandler::getNewObjects(), and DTUserKeyedConfigHandler::getNewObjects().

192  {
193  fullConfigKey = key;
194 }
std::vector< DTConfigKey > fullConfigKey
Definition: DTCCBConfig.h:126
list key
Definition: combine.py:13
void DTCCBConfig::setStamp ( int  s)

Definition at line 197 of file DTCCBConfig.cc.

References alignCSCRings::s, and timeStamp.

Referenced by DTKeyedConfigHandler::getNewObjects(), and DTUserKeyedConfigHandler::getNewObjects().

197  {
198  timeStamp = s;
199 }
int DTCCBConfig::stamp ( ) const

Definition at line 88 of file DTCCBConfig.cc.

References timeStamp.

88  {
89  return timeStamp;
90 }
const std::string & DTCCBConfig::version ( ) const

access version

Definition at line 172 of file DTCCBConfig.cc.

References dataVersion.

172  {
173  return dataVersion;
174 }
std::string dataVersion
Definition: DTCCBConfig.h:125
std::string & DTCCBConfig::version ( )

Definition at line 177 of file DTCCBConfig.cc.

References dataVersion.

177  {
178  return dataVersion;
179 }
std::string dataVersion
Definition: DTCCBConfig.h:125

Member Data Documentation

std::vector< std::pair<DTCCBId,int> > DTCCBConfig::dataList
private

Definition at line 127 of file DTCCBConfig.h.

Referenced by appendConfigKey(), begin(), cacheMap(), clear(), DTCCBConfig(), end(), and setConfigKey().

std::string DTCCBConfig::dataVersion
private

Definition at line 125 of file DTCCBConfig.h.

Referenced by version().

DTBufferTree< int,std::vector<int>* >* DTCCBConfig::dBuf
private
std::vector<DTConfigKey> DTCCBConfig::fullConfigKey
private

Definition at line 126 of file DTCCBConfig.h.

Referenced by fullKey(), and setFullKey().

int DTCCBConfig::timeStamp
private

Definition at line 124 of file DTCCBConfig.h.

Referenced by setStamp(), and stamp().