CMS 3D CMS Logo

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 (DTPerformance const &)=delete
 
 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 ()
 
DTPerformanceoperator= (DTPerformance const &)=delete
 
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

std::string mapName () const
 read and store full content More...
 
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 68 of file DTPerformance.h.

Member Typedef Documentation

◆ const_iterator

Access methods to data.

Definition at line 210 of file DTPerformance.h.

Constructor & Destructor Documentation

◆ DTPerformance() [1/3]

DTPerformance::DTPerformance ( )

Constructor

Definition at line 31 of file DTPerformance.cc.

References dataList.

32  dataList.reserve(1000);
33 }
std::string dataVersion
DTBufferTree< int, int > * dBuf
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList

◆ DTPerformance() [2/3]

DTPerformance::DTPerformance ( DTPerformance const &  )
delete

◆ DTPerformance() [3/3]

DTPerformance::DTPerformance ( const std::string &  version)

Definition at line 35 of file DTPerformance.cc.

References dataList.

37  dataList.reserve(1000);
38 }
const std::string & version() const
access version
std::string dataVersion
DTBufferTree< int, int > * dBuf
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList

◆ ~DTPerformance()

DTPerformance::~DTPerformance ( )

Destructor

Definition at line 54 of file DTPerformance.cc.

54 {}

Member Function Documentation

◆ begin()

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

Definition at line 226 of file DTPerformance.cc.

References dataList.

226 { return dataList.begin(); }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList

◆ clear()

void DTPerformance::clear ( void  )

reset content

Definition at line 135 of file DTPerformance.cc.

References dataList, and initialize().

135  {
136  dataList.clear();
137  initialize();
138  return;
139 }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList

◆ end()

DTPerformance::const_iterator DTPerformance::end ( void  ) const

Definition at line 228 of file DTPerformance.cc.

References dataList.

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

228 { return dataList.end(); }
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList

◆ get() [1/2]

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 63 of file DTPerformance.cc.

References data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTTimeUnits::ns, nsPerCount, edm::second(), and unit().

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

74  {
75  meanT0 = meanTtrig = meanMtime = meanNoise = meanAfterPulse = meanResolution = meanEfficiency = 0.0;
76 
77  std::vector<int> chanKey;
78  chanKey.reserve(4);
79  chanKey.push_back(wheelId);
80  chanKey.push_back(stationId);
81  chanKey.push_back(sectorId);
82  chanKey.push_back(slId);
83  int ientry;
84  //Guarantee const correctness for thread-safety
85  const DTBufferTree<int, int>* constDBuf = dBuf;
86  int searchStatus = constDBuf->find(chanKey.begin(), chanKey.end(), ientry);
87  if (!searchStatus) {
88  const DTPerformanceData& data(dataList[ientry].second);
89  meanT0 = data.meanT0;
90  meanTtrig = data.meanTtrig;
91  meanMtime = data.meanMtime;
92  meanNoise = data.meanNoise;
93  meanAfterPulse = data.meanAfterPulse;
94  meanResolution = data.meanResolution;
95  meanEfficiency = data.meanEfficiency;
96  if (unit == DTTimeUnits::ns) {
97  meanT0 *= nsPerCount;
98  meanTtrig *= nsPerCount;
99  meanMtime *= nsPerCount;
100  }
101  }
102 
103  return searchStatus;
104 }
U second(std::pair< T, U > const &p)
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
DTBufferTree< int, int > * dBuf
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
float unit() const

◆ get() [2/2]

int DTPerformance::get ( const DTSuperLayerId id,
float &  meanT0,
float &  meanTtrig,
float &  meanMtime,
float &  meanNoise,
float &  meanAfterPulse,
float &  meanResolution,
float &  meanEfficiency,
DTTimeUnits::type  unit 
) const

◆ initialize()

void DTPerformance::initialize ( )

Definition at line 236 of file DTPerformance.cc.

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

Referenced by clear().

236  {
237  dBuf->clear();
238 
239  int entryNum = 0;
240  int entryMax = dataList.size();
241  std::vector<int> chanKey;
242  chanKey.reserve(6);
243  while (entryNum < entryMax) {
244  const DTPerformanceId& chan = dataList[entryNum].first;
245 
246  chanKey.clear();
247  chanKey.push_back(chan.wheelId);
248  chanKey.push_back(chan.stationId);
249  chanKey.push_back(chan.sectorId);
250  chanKey.push_back(chan.slId);
251  dBuf->insert(chanKey.begin(), chanKey.end(), entryNum++);
252  }
253  return;
254 }
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTBufferTree< int, int > * dBuf
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList

◆ mapName()

std::string DTPerformance::mapName ( ) const
private

read and store full content

Definition at line 230 of file DTPerformance.cc.

References dataVersion, and Skims_PA_cff::name.

230  {
231  std::stringstream name;
232  name << dataVersion << "_map_Performance" << this;
233  return name.str();
234 }
std::string dataVersion

◆ operator=()

DTPerformance& DTPerformance::operator= ( DTPerformance const &  )
delete

◆ serialize()

template<class Archive >
void DTPerformance::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ set() [1/2]

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 141 of file DTPerformance.cc.

References data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), crabWrapper::key, DTTimeUnits::ns, nsPerCount, edm::second(), and unit().

Referenced by DTPerformanceHandler::getNewObjects().

152  {
153  if (unit == DTTimeUnits::ns) {
154  meanT0 /= nsPerCount;
155  meanTtrig /= nsPerCount;
156  meanMtime /= nsPerCount;
157  }
158 
159  std::vector<int> chanKey;
160  chanKey.reserve(4);
161  chanKey.push_back(wheelId);
162  chanKey.push_back(stationId);
163  chanKey.push_back(sectorId);
164  chanKey.push_back(slId);
165  int ientry;
166  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
167 
168  if (!searchStatus) {
170  data.meanT0 = meanT0;
171  data.meanTtrig = meanTtrig;
172  data.meanMtime = meanMtime;
173  data.meanNoise = meanNoise;
174  data.meanAfterPulse = meanAfterPulse;
175  data.meanResolution = meanResolution;
176  data.meanEfficiency = meanEfficiency;
177  return -1;
178  } else {
180  key.wheelId = wheelId;
181  key.stationId = stationId;
182  key.sectorId = sectorId;
183  key.slId = slId;
185  data.meanT0 = meanT0;
186  data.meanTtrig = meanTtrig;
187  data.meanMtime = meanMtime;
188  data.meanNoise = meanNoise;
189  data.meanAfterPulse = meanAfterPulse;
190  data.meanResolution = meanResolution;
191  data.meanEfficiency = meanEfficiency;
192  ientry = dataList.size();
193  dataList.push_back(std::pair<DTPerformanceId, DTPerformanceData>(key, data));
194  dBuf->insert(chanKey.begin(), chanKey.end(), ientry);
195  return 0;
196  }
197 
198  return 99;
199 }
U second(std::pair< T, U > const &p)
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTBufferTree< int, int > * dBuf
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
float unit() const

◆ set() [2/2]

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 201 of file DTPerformance.cc.

References unit().

209  {
210  return set(id.wheel(),
211  id.station(),
212  id.sector(),
213  id.superLayer(),
214  meanT0,
215  meanTtrig,
216  meanMtime,
217  meanNoise,
218  meanAfterPulse,
219  meanResolution,
220  meanEfficiency,
221  unit);
222 }
float unit() const

◆ setSLPerformance() [1/2]

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

161  {
162  return set(wheelId,
163  stationId,
164  sectorId,
165  slId,
166  meanT0,
167  meanTtrig,
168  meanMtime,
169  meanNoise,
170  meanAfterPulse,
171  meanResolution,
172  meanEfficiency,
173  unit);
174  };
float unit() const

◆ setSLPerformance() [2/2]

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 175 of file DTPerformance.h.

References l1ctLayer2EG_cff::id, and unit().

183  {
184  return set(id, meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse, meanResolution, meanEfficiency, unit);
185  };
float unit() const

◆ setUnit()

void DTPerformance::setUnit ( float  unit)

Definition at line 224 of file DTPerformance.cc.

References nsPerCount, and unit().

224 { nsPerCount = unit; }
float unit() const

◆ slPerformance() [1/2]

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 84 of file DTPerformance.h.

95  {
96  return get(wheelId,
97  stationId,
98  sectorId,
99  slId,
100  meanT0,
101  meanTtrig,
102  meanMtime,
103  meanNoise,
104  meanAfterPulse,
105  meanResolution,
106  meanEfficiency,
107  unit);
108  };
float unit() const

◆ slPerformance() [2/2]

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 109 of file DTPerformance.h.

References l1ctLayer2EG_cff::id, and unit().

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

◆ unit()

float DTPerformance::unit ( ) const

Definition at line 129 of file DTPerformance.cc.

References nsPerCount.

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

129 { return nsPerCount; }

◆ version() [1/2]

const std::string & DTPerformance::version ( ) const

access version

Definition at line 131 of file DTPerformance.cc.

References dataVersion.

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

131 { return dataVersion; }
std::string dataVersion

◆ version() [2/2]

std::string & DTPerformance::version ( )

Definition at line 133 of file DTPerformance.cc.

References dataVersion.

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

133 { return dataVersion; }
std::string dataVersion

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 227 of file DTPerformance.h.

◆ cond::serialization::access

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

Definition at line 227 of file DTPerformance.h.

Member Data Documentation

◆ dataList

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

Definition at line 220 of file DTPerformance.h.

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

◆ dataVersion

std::string DTPerformance::dataVersion
private

Definition at line 217 of file DTPerformance.h.

Referenced by mapName(), and version().

◆ dBuf

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

Definition at line 222 of file DTPerformance.h.

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

◆ nsPerCount

float DTPerformance::nsPerCount
private

Definition at line 218 of file DTPerformance.h.

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