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

#include <DTPerformance.h>

Public Types

typedef std::vector< std::pair
< DTPerformanceId,
DTPerformanceData >
>::const_iterator 
const_iterator
 Access methods to data. More...
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 reset content More...
 
 DTPerformance ()
 
 DTPerformance (const std::string &version)
 
const_iterator end () const
 
int get (int wheelId, int stationId, int sectorId, int slId, float &meanT0, float &meanTtrig, float &meanMtime, float &meanNoise, float &meanAfterPulse, float &meanResolution, float &meanEfficiency, DTTimeUnits::type unit) const
 
int get (const DTSuperLayerId &id, float &meanT0, float &meanTtrig, float &meanMtime, float &meanNoise, float &meanAfterPulse, float &meanResolution, float &meanEfficiency, DTTimeUnits::type unit) const
 
int set (int wheelId, int stationId, int sectorId, int slId, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit)
 
int set (const DTSuperLayerId &id, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit)
 
int setSLPerformance (int wheelId, int stationId, int sectorId, int slId, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit)
 
int setSLPerformance (const DTSuperLayerId &id, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit)
 
void setUnit (float unit)
 
int slPerformance (int wheelId, int stationId, int sectorId, int slId, float &meanT0, float &meanTtrig, float &meanMtime, float &meanNoise, float &meanAfterPulse, float &meanResolution, float &meanEfficiency, DTTimeUnits::type unit) const
 get content More...
 
int slPerformance (const DTSuperLayerId &id, float &meanT0, float &meanTtrig, float &meanMtime, float &meanNoise, float &meanAfterPulse, float &meanResolution, float &meanEfficiency, DTTimeUnits::type unit) const
 
float unit () const
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
 ~DTPerformance ()
 

Private Member Functions

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

Private Attributes

std::vector< std::pair
< DTPerformanceId,
DTPerformanceData > > 
dataList
 
std::string dataVersion
 
DTBufferTree< int, int > * dBuf
 
float nsPerCount
 

Detailed Description

Description: Class to hold drift tubes performances ( SL by SL )

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

Definition at line 69 of file DTPerformance.h.

Member Typedef Documentation

Access methods to data.

Definition at line 196 of file DTPerformance.h.

Constructor & Destructor Documentation

DTPerformance::DTPerformance ( )

Constructor

Definition at line 34 of file DTPerformance.cc.

References dataList, and dBuf.

34  :
35  dataVersion( " " ) {
36  dataList.reserve( 1000 );
37  dBuf = 0;
38 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
DTBufferTree< int, int > * dBuf
std::string dataVersion
DTPerformance::DTPerformance ( const std::string &  version)

Definition at line 41 of file DTPerformance.cc.

References dataList, and dBuf.

41  :
42  dataVersion( version ) {
43  dataList.reserve( 1000 );
44  dBuf = 0;
45 }
const std::string & version() const
access version
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
DTBufferTree< int, int > * dBuf
std::string dataVersion
DTPerformance::~DTPerformance ( )

Destructor

Definition at line 70 of file DTPerformance.cc.

References dBuf.

70  {
71 // DTDataBuffer<int,int>::dropBuffer( mapName() );
72  delete dBuf;
73 }
DTBufferTree< int, int > * dBuf

Member Function Documentation

DTPerformance::const_iterator DTPerformance::begin ( void  ) const

Definition at line 299 of file DTPerformance.cc.

References dataList.

299  {
300  return dataList.begin();
301 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
void DTPerformance::cacheMap ( ) const
private

read and store full content

Definition at line 316 of file DTPerformance.cc.

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

Referenced by get(), and set().

316  {
317 
318 // std::string mName = mapName();
319 // DTBufferTree<int,int>* dBuf =
320 // DTDataBuffer<int,int>::openBuffer( mName );
321  DTBufferTree<int,int>** pBuf;
322  pBuf = const_cast<DTBufferTree<int,int>**>( &dBuf );
323  *pBuf = new DTBufferTree<int,int>;
324 
325  int entryNum = 0;
326  int entryMax = dataList.size();
327  std::vector<int> chanKey;
328  chanKey.reserve(6);
329  while ( entryNum < entryMax ) {
330 
331  const DTPerformanceId& chan = dataList[entryNum].first;
332 
333  chanKey.clear();
334  chanKey.push_back( chan. wheelId );
335  chanKey.push_back( chan.stationId );
336  chanKey.push_back( chan. sectorId );
337  chanKey.push_back( chan. slId );
338  dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ );
339 
340  }
341 
342  return;
343 
344 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
DTBufferTree< int, int > * dBuf
void DTPerformance::clear ( void  )
DTPerformance::const_iterator DTPerformance::end ( void  ) const

Definition at line 304 of file DTPerformance.cc.

References dataList.

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

304  {
305  return dataList.end();
306 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
int DTPerformance::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  meanT0,
float &  meanTtrig,
float &  meanMtime,
float &  meanNoise,
float &  meanAfterPulse,
float &  meanResolution,
float &  meanEfficiency,
DTTimeUnits::type  unit 
) const

Definition at line 87 of file DTPerformance.cc.

References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTPerformanceData::meanAfterPulse, DTPerformanceData::meanEfficiency, DTPerformanceData::meanMtime, DTPerformanceData::meanNoise, DTPerformanceData::meanResolution, DTPerformanceData::meanT0, DTPerformanceData::meanTtrig, DTTimeUnits::ns, nsPerCount, and edm::second().

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

98  {
99 
100  meanT0 =
101  meanTtrig =
102  meanMtime =
103  meanNoise =
104  meanAfterPulse =
105  meanResolution =
106  meanEfficiency = 0.0;
107 
108 // std::string mName = mapName();
109 // DTBufferTree<int,int>* dBuf =
110 // DTDataBuffer<int,int>::findBuffer( mName );
111 // if ( dBuf == 0 ) {
112 // cacheMap();
113 // dBuf =
114 // DTDataBuffer<int,int>::findBuffer( mName );
115 // }
116  if ( dBuf == 0 ) cacheMap();
117 
118  std::vector<int> chanKey;
119  chanKey.reserve(4);
120  chanKey.push_back( wheelId );
121  chanKey.push_back( stationId );
122  chanKey.push_back( sectorId );
123  chanKey.push_back( slId );
124  int ientry;
125  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
126  if ( !searchStatus ) {
127  const DTPerformanceData& data( dataList[ientry].second );
128  meanT0 = data.meanT0;
129  meanTtrig = data.meanTtrig;
130  meanMtime = data.meanMtime;
131  meanNoise = data.meanNoise;
132  meanAfterPulse = data.meanAfterPulse;
133  meanResolution = data.meanResolution;
134  meanEfficiency = data.meanEfficiency;
135  if ( unit == DTTimeUnits::ns ) {
136  meanT0 *= nsPerCount;
137  meanTtrig *= nsPerCount;
138  meanMtime *= nsPerCount;
139  }
140  }
141 
142  return searchStatus;
143 
144 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
U second(std::pair< T, U > const &p)
float unit() const
void cacheMap() const
read and store full content
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, int > * dBuf
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int DTPerformance::get ( const DTSuperLayerId id,
float &  meanT0,
float &  meanTtrig,
float &  meanMtime,
float &  meanNoise,
float &  meanAfterPulse,
float &  meanResolution,
float &  meanEfficiency,
DTTimeUnits::type  unit 
) const

Definition at line 147 of file DTPerformance.cc.

References unit().

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

155  {
156  return get( id.wheel(),
157  id.station(),
158  id.sector(),
159  id.superLayer(),
160  meanT0,
161  meanTtrig,
162  meanMtime,
163  meanNoise,
164  meanAfterPulse,
165  meanResolution,
166  meanEfficiency,
167  unit );
168 }
float unit() const
std::string DTPerformance::mapName ( ) const
private

Definition at line 309 of file DTPerformance.cc.

References dataVersion, and mergeVDriftHistosByStation::name.

309  {
310  std::stringstream name;
311  name << dataVersion << "_map_Performance" << this;
312  return name.str();
313 }
std::string dataVersion
int DTPerformance::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float  meanT0,
float  meanTtrig,
float  meanMtime,
float  meanNoise,
float  meanAfterPulse,
float  meanResolution,
float  meanEfficiency,
DTTimeUnits::type  unit 
)

Definition at line 196 of file DTPerformance.cc.

References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), combine::key, DTPerformanceData::meanAfterPulse, DTPerformanceData::meanEfficiency, DTPerformanceData::meanMtime, DTPerformanceData::meanNoise, DTPerformanceData::meanResolution, DTPerformanceData::meanT0, DTPerformanceData::meanTtrig, DTTimeUnits::ns, nsPerCount, edm::second(), and DTPerformanceId::stationId.

Referenced by betterConfigParser.BetterConfigParser::getGeneral(), DTPerformanceHandler::getNewObjects(), set(), and setSLPerformance().

207  {
208 
209  if ( unit == DTTimeUnits::ns ) {
210  meanT0 /= nsPerCount;
211  meanTtrig /= nsPerCount;
212  meanMtime /= nsPerCount;
213  }
214 
215 // std::string mName = mapName();
216 // DTBufferTree<int,int>* dBuf =
217 // DTDataBuffer<int,int>::findBuffer( mName );
218 // if ( dBuf == 0 ) {
219 // cacheMap();
220 // dBuf =
221 // DTDataBuffer<int,int>::findBuffer( mName );
222 // }
223  if ( dBuf == 0 ) cacheMap();
224  std::vector<int> chanKey;
225  chanKey.reserve(4);
226  chanKey.push_back( wheelId );
227  chanKey.push_back( stationId );
228  chanKey.push_back( sectorId );
229  chanKey.push_back( slId );
230  int ientry;
231  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
232 
233  if ( !searchStatus ) {
235  data.meanT0 = meanT0;
236  data.meanTtrig = meanTtrig;
237  data.meanMtime = meanMtime;
238  data.meanNoise = meanNoise;
239  data.meanAfterPulse = meanAfterPulse;
240  data.meanResolution = meanResolution;
241  data.meanEfficiency = meanEfficiency;
242  return -1;
243  }
244  else {
246  key. wheelId = wheelId;
247  key.stationId = stationId;
248  key. sectorId = sectorId;
249  key. slId = slId;
251  data.meanT0 = meanT0;
252  data.meanTtrig = meanTtrig;
253  data.meanMtime = meanMtime;
254  data.meanNoise = meanNoise;
255  data.meanAfterPulse = meanAfterPulse;
256  data.meanResolution = meanResolution;
257  data.meanEfficiency = meanEfficiency;
258  ientry = dataList.size();
259  dataList.push_back( std::pair<DTPerformanceId,DTPerformanceData>(
260  key, data ) );
261  dBuf->insert( chanKey.begin(), chanKey.end(), ientry );
262  return 0;
263  }
264 
265  return 99;
266 
267 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
U second(std::pair< T, U > const &p)
float unit() const
void cacheMap() const
read and store full content
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, int > * dBuf
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
list key
Definition: combine.py:13
int DTPerformance::set ( const DTSuperLayerId id,
float  meanT0,
float  meanTtrig,
float  meanMtime,
float  meanNoise,
float  meanAfterPulse,
float  meanResolution,
float  meanEfficiency,
DTTimeUnits::type  unit 
)

Definition at line 270 of file DTPerformance.cc.

References set(), and relativeConstraints::station.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

278  {
279  return set( id.wheel(),
280  id.station(),
281  id.sector(),
282  id.superLayer(),
283  meanT0,
284  meanTtrig,
285  meanMtime,
286  meanNoise,
287  meanAfterPulse,
288  meanResolution,
289  meanEfficiency,
290  unit );
291 }
int set(int wheelId, int stationId, int sectorId, int slId, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit)
float unit() const
int DTPerformance::setSLPerformance ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float  meanT0,
float  meanTtrig,
float  meanMtime,
float  meanNoise,
float  meanAfterPulse,
float  meanResolution,
float  meanEfficiency,
DTTimeUnits::type  unit 
)
inline

Definition at line 143 of file DTPerformance.h.

References set().

155  { return set( wheelId, stationId, sectorId, slId,
156  meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse,
157  meanResolution, meanEfficiency, unit ); };
int set(int wheelId, int stationId, int sectorId, int slId, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit)
float unit() const
int DTPerformance::setSLPerformance ( const DTSuperLayerId id,
float  meanT0,
float  meanTtrig,
float  meanMtime,
float  meanNoise,
float  meanAfterPulse,
float  meanResolution,
float  meanEfficiency,
DTTimeUnits::type  unit 
)
inline

Definition at line 158 of file DTPerformance.h.

References set().

167  { return set( id,
168  meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse,
169  meanResolution, meanEfficiency, unit ); };
int set(int wheelId, int stationId, int sectorId, int slId, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit)
float unit() const
void DTPerformance::setUnit ( float  unit)

Definition at line 294 of file DTPerformance.cc.

References nsPerCount, and unit().

294  {
295  nsPerCount = unit;
296 }
float unit() const
int DTPerformance::slPerformance ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  meanT0,
float &  meanTtrig,
float &  meanMtime,
float &  meanNoise,
float &  meanAfterPulse,
float &  meanResolution,
float &  meanEfficiency,
DTTimeUnits::type  unit 
) const
inline

get content

Operations

Definition at line 85 of file DTPerformance.h.

97  { return get( wheelId, stationId, sectorId, slId,
98  meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse,
99  meanResolution, meanEfficiency, unit ); };
float unit() const
int DTPerformance::slPerformance ( const DTSuperLayerId id,
float &  meanT0,
float &  meanTtrig,
float &  meanMtime,
float &  meanNoise,
float &  meanAfterPulse,
float &  meanResolution,
float &  meanEfficiency,
DTTimeUnits::type  unit 
) const
inline

Definition at line 100 of file DTPerformance.h.

References errorMatrix2Lands_multiChannel::id, and unit().

109  { return get( id,
110  meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse,
111  meanResolution, meanEfficiency, unit ); };
float unit() const
float DTPerformance::unit ( ) const

Definition at line 171 of file DTPerformance.cc.

References nsPerCount.

Referenced by get(), setUnit(), and slPerformance().

171  {
172  return nsPerCount;
173 }
const std::string & DTPerformance::version ( ) const

access version

Definition at line 177 of file DTPerformance.cc.

References dataVersion.

177  {
178  return dataVersion;
179 }
std::string dataVersion
std::string & DTPerformance::version ( )

Definition at line 182 of file DTPerformance.cc.

References dataVersion.

182  {
183  return dataVersion;
184 }
std::string dataVersion

Member Data Documentation

std::vector< std::pair<DTPerformanceId,DTPerformanceData> > DTPerformance::dataList
private

Definition at line 205 of file DTPerformance.h.

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

std::string DTPerformance::dataVersion
private

Definition at line 202 of file DTPerformance.h.

Referenced by mapName(), and version().

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

Definition at line 207 of file DTPerformance.h.

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

float DTPerformance::nsPerCount
private

Definition at line 203 of file DTPerformance.h.

Referenced by get(), set(), setUnit(), and unit().