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
 
void initialize ()
 
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

 DTPerformance (DTPerformance const &)
 
std::string mapName () const
 read and store full content More...
 
DTPerformanceoperator= (DTPerformance const &)
 

Private Attributes

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

Detailed Description

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

Author
Paolo Ronchese INFN Padova

Definition at line 76 of file DTPerformance.h.

Member Typedef Documentation

Access methods to data.

Definition at line 203 of file DTPerformance.h.

Constructor & Destructor Documentation

DTPerformance::DTPerformance ( )

Constructor

Definition at line 32 of file DTPerformance.cc.

References dataList.

32  :
33  dataVersion( " " ),
34  nsPerCount(0.0),
35  dBuf(new DTBufferTree<int,int>) {
36  dataList.reserve( 1000 );
37 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
std::string dataVersion
DTPerformance::DTPerformance ( const std::string &  version)

Definition at line 40 of file DTPerformance.cc.

References dataList.

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

Destructor

Definition at line 70 of file DTPerformance.cc.

70  {
71 }
DTPerformance::DTPerformance ( DTPerformance const &  )
private

Member Function Documentation

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

Definition at line 276 of file DTPerformance.cc.

References dataList.

276  {
277  return dataList.begin();
278 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
void DTPerformance::clear ( void  )
DTPerformance::const_iterator DTPerformance::end ( void  ) const

Definition at line 281 of file DTPerformance.cc.

References dataList.

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

281  {
282  return dataList.end();
283 }
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 85 of file DTPerformance.cc.

References data, dataList, 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(), rrapi.RRApi::columns(), rrapi.RRApi::count(), rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

96  {
97 
98  meanT0 =
99  meanTtrig =
100  meanMtime =
101  meanNoise =
102  meanAfterPulse =
103  meanResolution =
104  meanEfficiency = 0.0;
105 
106  std::vector<int> chanKey;
107  chanKey.reserve(4);
108  chanKey.push_back( wheelId );
109  chanKey.push_back( stationId );
110  chanKey.push_back( sectorId );
111  chanKey.push_back( slId );
112  int ientry;
113  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
114  if ( !searchStatus ) {
115  const DTPerformanceData& data( dataList[ientry].second );
116  meanT0 = data.meanT0;
117  meanTtrig = data.meanTtrig;
118  meanMtime = data.meanMtime;
119  meanNoise = data.meanNoise;
120  meanAfterPulse = data.meanAfterPulse;
121  meanResolution = data.meanResolution;
122  meanEfficiency = data.meanEfficiency;
123  if ( unit == DTTimeUnits::ns ) {
124  meanT0 *= nsPerCount;
125  meanTtrig *= nsPerCount;
126  meanMtime *= nsPerCount;
127  }
128  }
129 
130  return searchStatus;
131 
132 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
U second(std::pair< T, U > const &p)
float unit() const
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 135 of file DTPerformance.cc.

References unit().

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), rrapi.RRApi::columns(), rrapi.RRApi::count(), rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

143  {
144  return get( id.wheel(),
145  id.station(),
146  id.sector(),
147  id.superLayer(),
148  meanT0,
149  meanTtrig,
150  meanMtime,
151  meanNoise,
152  meanAfterPulse,
153  meanResolution,
154  meanEfficiency,
155  unit );
156 }
float unit() const
void DTPerformance::initialize ( )

Definition at line 293 of file DTPerformance.cc.

References dataList, and DTPerformanceId::stationId.

Referenced by clear().

293  {
294 
295  dBuf->clear();
296 
297  int entryNum = 0;
298  int entryMax = dataList.size();
299  std::vector<int> chanKey;
300  chanKey.reserve(6);
301  while ( entryNum < entryMax ) {
302 
303  const DTPerformanceId& chan = dataList[entryNum].first;
304 
305  chanKey.clear();
306  chanKey.push_back( chan. wheelId );
307  chanKey.push_back( chan.stationId );
308  chanKey.push_back( chan. sectorId );
309  chanKey.push_back( chan. slId );
310  dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ );
311  }
312  return;
313 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
std::string DTPerformance::mapName ( ) const
private

read and store full content

Definition at line 286 of file DTPerformance.cc.

References dataVersion, and mergeVDriftHistosByStation::name.

286  {
287  std::stringstream name;
288  name << dataVersion << "_map_Performance" << this;
289  return name.str();
290 }
std::string dataVersion
DTPerformance& DTPerformance::operator= ( DTPerformance const &  )
private
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 182 of file DTPerformance.cc.

References data, dataList, 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().

193  {
194 
195  if ( unit == DTTimeUnits::ns ) {
196  meanT0 /= nsPerCount;
197  meanTtrig /= nsPerCount;
198  meanMtime /= nsPerCount;
199  }
200 
201  std::vector<int> chanKey;
202  chanKey.reserve(4);
203  chanKey.push_back( wheelId );
204  chanKey.push_back( stationId );
205  chanKey.push_back( sectorId );
206  chanKey.push_back( slId );
207  int ientry;
208  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
209 
210  if ( !searchStatus ) {
212  data.meanT0 = meanT0;
213  data.meanTtrig = meanTtrig;
214  data.meanMtime = meanMtime;
215  data.meanNoise = meanNoise;
216  data.meanAfterPulse = meanAfterPulse;
217  data.meanResolution = meanResolution;
218  data.meanEfficiency = meanEfficiency;
219  return -1;
220  }
221  else {
223  key. wheelId = wheelId;
224  key.stationId = stationId;
225  key. sectorId = sectorId;
226  key. slId = slId;
228  data.meanT0 = meanT0;
229  data.meanTtrig = meanTtrig;
230  data.meanMtime = meanMtime;
231  data.meanNoise = meanNoise;
232  data.meanAfterPulse = meanAfterPulse;
233  data.meanResolution = meanResolution;
234  data.meanEfficiency = meanEfficiency;
235  ientry = dataList.size();
236  dataList.push_back( std::pair<DTPerformanceId,DTPerformanceData>(
237  key, data ) );
238  dBuf->insert( chanKey.begin(), chanKey.end(), ientry );
239  return 0;
240  }
241 
242  return 99;
243 
244 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
U second(std::pair< T, U > const &p)
float unit() const
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 247 of file DTPerformance.cc.

References set(), and relativeConstraints::station.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

255  {
256  return set( id.wheel(),
257  id.station(),
258  id.sector(),
259  id.superLayer(),
260  meanT0,
261  meanTtrig,
262  meanMtime,
263  meanNoise,
264  meanAfterPulse,
265  meanResolution,
266  meanEfficiency,
267  unit );
268 }
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 150 of file DTPerformance.h.

References set().

162  { return set( wheelId, stationId, sectorId, slId,
163  meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse,
164  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 165 of file DTPerformance.h.

References set().

174  { return set( id,
175  meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse,
176  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 271 of file DTPerformance.cc.

References nsPerCount, and unit().

271  {
272  nsPerCount = unit;
273 }
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 92 of file DTPerformance.h.

104  { return get( wheelId, stationId, sectorId, slId,
105  meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse,
106  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 107 of file DTPerformance.h.

References unit().

116  { return get( id,
117  meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse,
118  meanResolution, meanEfficiency, unit ); };
float unit() const
float DTPerformance::unit ( ) const

Definition at line 159 of file DTPerformance.cc.

References nsPerCount.

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

159  {
160  return nsPerCount;
161 }
const std::string & DTPerformance::version ( ) const

access version

Definition at line 165 of file DTPerformance.cc.

References dataVersion.

165  {
166  return dataVersion;
167 }
std::string dataVersion
std::string & DTPerformance::version ( )

Definition at line 170 of file DTPerformance.cc.

References dataVersion.

170  {
171  return dataVersion;
172 }
std::string dataVersion

Member Data Documentation

DTPerformance::COND_SERIALIZABLE
private

Definition at line 225 of file DTPerformance.h.

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

Definition at line 219 of file DTPerformance.h.

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

Definition at line 217 of file DTPerformance.h.

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

std::string DTPerformance::dataVersion
private

Definition at line 214 of file DTPerformance.h.

Referenced by mapName(), and version().

float DTPerformance::nsPerCount
private

Definition at line 215 of file DTPerformance.h.

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