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

#include <DTRangeT0.h>

Public Types

typedef std::vector< std::pair
< DTRangeT0Id, DTRangeT0Data >
>::const_iterator 
const_iterator
 Access methods to data. More...
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 reset content More...
 
 DTRangeT0 ()
 
 DTRangeT0 (const std::string &version)
 
const_iterator end () const
 
int get (int wheelId, int stationId, int sectorId, int slId, int &t0min, int &t0max) const
 
int get (const DTSuperLayerId &id, int &t0min, int &t0max) const
 
int set (int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
 
int set (const DTSuperLayerId &id, int t0min, int t0max)
 
int setSLRangeT0 (int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
 
int setSLRangeT0 (const DTSuperLayerId &id, int t0min, int t0max)
 
int slRangeT0 (int wheelId, int stationId, int sectorId, int slId, int &t0min, int &t0max) const
 get content More...
 
int slRangeT0 (const DTSuperLayerId &id, int &t0min, int &t0max) const
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
 ~DTRangeT0 ()
 

Private Member Functions

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

Private Attributes

std::vector< std::pair
< DTRangeT0Id, DTRangeT0Data > > 
dataList
 
std::string dataVersion
 
DTBufferTree< int, int > * dBuf
 

Detailed Description

Description: Class to hold drift tubes T0 range ( SL by SL min - max T0 )

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

Definition at line 64 of file DTRangeT0.h.

Member Typedef Documentation

Access methods to data.

Definition at line 134 of file DTRangeT0.h.

Constructor & Destructor Documentation

DTRangeT0::DTRangeT0 ( )

Constructor

Definition at line 34 of file DTRangeT0.cc.

References dataList, and dBuf.

34  :
35  dataVersion( " " ) {
36  dataList.reserve( 1000 );
37  dBuf = 0;
38 }
std::string dataVersion
Definition: DTRangeT0.h:140
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:142
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:144
DTRangeT0::DTRangeT0 ( const std::string &  version)

Definition at line 41 of file DTRangeT0.cc.

References dataList, and dBuf.

41  :
42  dataVersion( version ) {
43  dataList.reserve( 1000 );
44  dBuf = 0;
45 }
std::string dataVersion
Definition: DTRangeT0.h:140
const std::string & version() const
access version
Definition: DTRangeT0.cc:133
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:142
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:144
DTRangeT0::~DTRangeT0 ( )

Destructor

Definition at line 65 of file DTRangeT0.cc.

References dBuf.

65  {
66 // DTDataBuffer<int,int>::dropBuffer( mapName() );
67  delete dBuf;
68 }
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:144

Member Function Documentation

DTRangeT0::const_iterator DTRangeT0::begin ( void  ) const

Definition at line 214 of file DTRangeT0.cc.

References dataList.

214  {
215  return dataList.begin();
216 }
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:142
void DTRangeT0::cacheMap ( ) const
private

read and store full content

Definition at line 231 of file DTRangeT0.cc.

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

Referenced by get(), and set().

231  {
232 
233 // std::string mName = mapName();
234 // DTBufferTree<int,int>* dBuf =
235 // DTDataBuffer<int,int>::openBuffer( mName );
236  DTBufferTree<int,int>** pBuf;
237  pBuf = const_cast<DTBufferTree<int,int>**>( &dBuf );
238  *pBuf = new DTBufferTree<int,int>;
239 
240  int entryNum = 0;
241  int entryMax = dataList.size();
242  std::vector<int> chanKey;
243  chanKey.reserve(4);
244  while ( entryNum < entryMax ) {
245 
246  const DTRangeT0Id& chan = dataList[entryNum].first;
247 
248  chanKey.clear();
249  chanKey.push_back( chan. wheelId );
250  chanKey.push_back( chan.stationId );
251  chanKey.push_back( chan. sectorId );
252  chanKey.push_back( chan. slId );
253  dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ );
254 
255  }
256 
257  return;
258 
259 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:142
int stationId
Definition: DTRangeT0.h:44
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:144
void DTRangeT0::clear ( void  )
DTRangeT0::const_iterator DTRangeT0::end ( void  ) const

Definition at line 219 of file DTRangeT0.cc.

References dataList.

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

219  {
220  return dataList.end();
221 }
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:142
int DTRangeT0::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int &  t0min,
int &  t0max 
) const

Definition at line 82 of file DTRangeT0.cc.

References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), edm::second(), DTRangeT0Data::t0max, and DTRangeT0Data::t0min.

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

87  {
88 
89  t0min =
90  t0max = 0;
91 
92 // std::string mName = mapName();
93 // DTBufferTree<int,int>* dBuf =
94 // DTDataBuffer<int,int>::findBuffer( mName );
95 // if ( dBuf == 0 ) {
96 // cacheMap();
97 // dBuf =
98 // DTDataBuffer<int,int>::findBuffer( mName );
99 // }
100  if ( dBuf == 0 ) cacheMap();
101 
102  std::vector<int> chanKey;
103  chanKey.reserve(4);
104  chanKey.push_back( wheelId );
105  chanKey.push_back( stationId );
106  chanKey.push_back( sectorId );
107  chanKey.push_back( slId );
108  int ientry;
109  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
110  if ( !searchStatus ) {
111  const DTRangeT0Data& data( dataList[ientry].second );
112  t0min = data.t0min;
113  t0max = data.t0max;
114  }
115 
116  return searchStatus;
117 
118 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:142
int find(ElementKey fKey, ElementKey lKey, Content &cont)
void cacheMap() const
read and store full content
Definition: DTRangeT0.cc:231
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:144
int DTRangeT0::get ( const DTSuperLayerId id,
int &  t0min,
int &  t0max 
) const

Definition at line 121 of file DTRangeT0.cc.

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

123  {
124  return get( id.wheel(),
125  id.station(),
126  id.sector(),
127  id.superLayer(),
128  t0min, t0max );
129 }
std::string DTRangeT0::mapName ( ) const
private

Definition at line 224 of file DTRangeT0.cc.

References dataVersion, and mergeVDriftHistosByStation::name.

224  {
225  std::stringstream name;
226  name << dataVersion << "_map_RangeT0" << this;
227  return name.str();
228 }
std::string dataVersion
Definition: DTRangeT0.h:140
int DTRangeT0::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  t0min,
int  t0max 
)

Definition at line 152 of file DTRangeT0.cc.

References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), combine::key, edm::second(), DTRangeT0Id::stationId, DTRangeT0Data::t0max, and DTRangeT0Data::t0min.

Referenced by betterConfigParser.BetterConfigParser::getGeneral(), DTRangeT0Handler::getNewObjects(), set(), and setSLRangeT0().

157  {
158 
159 // std::string mName = mapName();
160 // DTBufferTree<int,int>* dBuf =
161 // DTDataBuffer<int,int>::findBuffer( mName );
162 // if ( dBuf == 0 ) {
163 // cacheMap();
164 // dBuf =
165 // DTDataBuffer<int,int>::findBuffer( mName );
166 // }
167  if ( dBuf == 0 ) cacheMap();
168  std::vector<int> chanKey;
169  chanKey.reserve(4);
170  chanKey.push_back( wheelId );
171  chanKey.push_back( stationId );
172  chanKey.push_back( sectorId );
173  chanKey.push_back( slId );
174  int ientry;
175  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
176 
177  if ( !searchStatus ) {
178  DTRangeT0Data& data( dataList[ientry].second );
179  data.t0min = t0min;
180  data.t0max = t0max;
181  return -1;
182  }
183  else {
185  key. wheelId = wheelId;
186  key.stationId = stationId;
187  key. sectorId = sectorId;
188  key. slId = slId;
190  data.t0min = t0min;
191  data.t0max = t0max;
192  ientry = dataList.size();
193  dataList.push_back( std::pair<DTRangeT0Id,DTRangeT0Data>( key, data ) );
194  dBuf->insert( chanKey.begin(), chanKey.end(), ientry );
195  return 0;
196  }
197 
198  return 99;
199 
200 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
U second(std::pair< T, U > const &p)
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:142
int find(ElementKey fKey, ElementKey lKey, Content &cont)
void cacheMap() const
read and store full content
Definition: DTRangeT0.cc:231
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
list key
Definition: combine.py:13
int stationId
Definition: DTRangeT0.h:44
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:144
int DTRangeT0::set ( const DTSuperLayerId id,
int  t0min,
int  t0max 
)

Definition at line 203 of file DTRangeT0.cc.

References set(), and relativeConstraints::station.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

205  {
206  return set( id.wheel(),
207  id.station(),
208  id.sector(),
209  id.superLayer(),
210  t0min, t0max );
211 }
int set(int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
Definition: DTRangeT0.cc:152
int DTRangeT0::setSLRangeT0 ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  t0min,
int  t0max 
)
inline

Definition at line 110 of file DTRangeT0.h.

References set().

116  { return set( wheelId, stationId, sectorId, slId, t0min, t0max ); };
int set(int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
Definition: DTRangeT0.cc:152
int DTRangeT0::setSLRangeT0 ( const DTSuperLayerId id,
int  t0min,
int  t0max 
)
inline

Definition at line 117 of file DTRangeT0.h.

References set().

120  { return set( id, t0min, t0max ); };
int set(int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
Definition: DTRangeT0.cc:152
int DTRangeT0::slRangeT0 ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int &  t0min,
int &  t0max 
) const
inline

get content

Operations

Definition at line 80 of file DTRangeT0.h.

86  { return get( wheelId, stationId, sectorId, slId,
87  t0min, t0max ); };
int DTRangeT0::slRangeT0 ( const DTSuperLayerId id,
int &  t0min,
int &  t0max 
) const
inline

Definition at line 88 of file DTRangeT0.h.

References errorMatrix2Lands_multiChannel::id.

91  { return get( id, t0min, t0max ); };
const std::string & DTRangeT0::version ( ) const

access version

Definition at line 133 of file DTRangeT0.cc.

References dataVersion.

133  {
134  return dataVersion;
135 }
std::string dataVersion
Definition: DTRangeT0.h:140
std::string & DTRangeT0::version ( )

Definition at line 138 of file DTRangeT0.cc.

References dataVersion.

138  {
139  return dataVersion;
140 }
std::string dataVersion
Definition: DTRangeT0.h:140

Member Data Documentation

std::vector< std::pair<DTRangeT0Id,DTRangeT0Data> > DTRangeT0::dataList
private

Definition at line 142 of file DTRangeT0.h.

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

std::string DTRangeT0::dataVersion
private

Definition at line 140 of file DTRangeT0.h.

Referenced by mapName(), and version().

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

Definition at line 144 of file DTRangeT0.h.

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