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 | Friends
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 &)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

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

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

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),
36  dataList.reserve( 1000 );
37 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
DTBufferTree< int, int > * dBuf
std::string dataVersion
DTPerformance::DTPerformance ( const std::string &  version)

Definition at line 40 of file DTPerformance.cc.

References dataList.

40  :
42  nsPerCount(0.0),
44  dataList.reserve( 1000 );
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.

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

Member Function Documentation

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

Definition at line 278 of file DTPerformance.cc.

References dataList.

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

Definition at line 283 of file DTPerformance.cc.

References dataList.

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

283  {
284  return dataList.end();
285 }
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, 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(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), 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  //Guarantee const correctness for thread-safety
114  const DTBufferTree<int,int>* constDBuf = dBuf;
115  int searchStatus = constDBuf->find( chanKey.begin(), chanKey.end(), ientry );
116  if ( !searchStatus ) {
117  const DTPerformanceData& data( dataList[ientry].second );
118  meanT0 = data.meanT0;
119  meanTtrig = data.meanTtrig;
120  meanMtime = data.meanMtime;
121  meanNoise = data.meanNoise;
122  meanAfterPulse = data.meanAfterPulse;
123  meanResolution = data.meanResolution;
124  meanEfficiency = data.meanEfficiency;
125  if ( unit == DTTimeUnits::ns ) {
126  meanT0 *= nsPerCount;
127  meanTtrig *= nsPerCount;
128  meanMtime *= nsPerCount;
129  }
130  }
131 
132  return searchStatus;
133 
134 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
float unit() const
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
void DTPerformance::initialize ( )

Definition at line 295 of file DTPerformance.cc.

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

Referenced by clear().

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

read and store full content

Definition at line 288 of file DTPerformance.cc.

References dataVersion, and mergeVDriftHistosByStation::name.

288  {
289  std::stringstream name;
290  name << dataVersion << "_map_Performance" << this;
291  return name.str();
292 }
std::string dataVersion
DTPerformance& DTPerformance::operator= ( DTPerformance const &  )
private
template<class Archive >
void DTPerformance::serialize ( Archive &  ar,
const unsigned int  version 
)
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 184 of file DTPerformance.cc.

References data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), relval_steps::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().

195  {
196 
197  if ( unit == DTTimeUnits::ns ) {
198  meanT0 /= nsPerCount;
199  meanTtrig /= nsPerCount;
200  meanMtime /= nsPerCount;
201  }
202 
203  std::vector<int> chanKey;
204  chanKey.reserve(4);
205  chanKey.push_back( wheelId );
206  chanKey.push_back( stationId );
207  chanKey.push_back( sectorId );
208  chanKey.push_back( slId );
209  int ientry;
210  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
211 
212  if ( !searchStatus ) {
214  data.meanT0 = meanT0;
215  data.meanTtrig = meanTtrig;
216  data.meanMtime = meanMtime;
217  data.meanNoise = meanNoise;
218  data.meanAfterPulse = meanAfterPulse;
219  data.meanResolution = meanResolution;
220  data.meanEfficiency = meanEfficiency;
221  return -1;
222  }
223  else {
225  key. wheelId = wheelId;
226  key.stationId = stationId;
227  key. sectorId = sectorId;
228  key. slId = slId;
230  data.meanT0 = meanT0;
231  data.meanTtrig = meanTtrig;
232  data.meanMtime = meanMtime;
233  data.meanNoise = meanNoise;
234  data.meanAfterPulse = meanAfterPulse;
235  data.meanResolution = meanResolution;
236  data.meanEfficiency = meanEfficiency;
237  ientry = dataList.size();
238  dataList.push_back( std::pair<DTPerformanceId,DTPerformanceData>(
239  key, data ) );
240  dBuf->insert( chanKey.begin(), chanKey.end(), ientry );
241  return 0;
242  }
243 
244  return 99;
245 
246 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
float unit() const
DTBufferTree< int, int > * dBuf
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int insert(ElementKey fKey, ElementKey lKey, Content cont)
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 249 of file DTPerformance.cc.

References set(), and relativeConstraints::station.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

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

References nsPerCount, and unit().

273  {
274  nsPerCount = unit;
275 }
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 161 of file DTPerformance.cc.

References nsPerCount.

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

161  {
162  return nsPerCount;
163 }
const std::string & DTPerformance::version ( ) const

access version

Definition at line 167 of file DTPerformance.cc.

References dataVersion.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

167  {
168  return dataVersion;
169 }
std::string dataVersion
std::string & DTPerformance::version ( )

Definition at line 172 of file DTPerformance.cc.

References dataVersion.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

172  {
173  return dataVersion;
174 }
std::string dataVersion

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 225 of file DTPerformance.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 225 of file DTPerformance.h.

Member Data Documentation

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().

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

Definition at line 219 of file DTPerformance.h.

Referenced by get(), initialize(), and set().

float DTPerformance::nsPerCount
private

Definition at line 215 of file DTPerformance.h.

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