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 (const std::string &version)
 
const_iterator end () 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 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
 
void initialize ()
 
int set (const DTSuperLayerId &id, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type 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)
 
int setSLPerformance (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)
 
void setUnit (float unit)
 
int slPerformance (const DTSuperLayerId &id, float &meanT0, float &meanTtrig, float &meanMtime, float &meanNoise, float &meanAfterPulse, float &meanResolution, float &meanEfficiency, DTTimeUnits::type unit) const
 
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...
 
float unit () const
 
std::string & version ()
 
const std::string & version () const
 access version More...
 
 ~DTPerformance ()
 

Private Member Functions

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

Constructor & Destructor Documentation

◆ DTPerformance() [1/3]

DTPerformance::DTPerformance ( )

Constructor

Definition at line 31 of file DTPerformance.cc.

32  dataList.reserve(1000);
33 }

References dataList.

◆ DTPerformance() [2/3]

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

Definition at line 35 of file DTPerformance.cc.

37  dataList.reserve(1000);
38 }

References dataList.

◆ ~DTPerformance()

DTPerformance::~DTPerformance ( )

Destructor

Definition at line 54 of file DTPerformance.cc.

54 {}

◆ DTPerformance() [3/3]

DTPerformance::DTPerformance ( DTPerformance const &  )
privatedelete

Member Function Documentation

◆ begin()

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

Definition at line 226 of file DTPerformance.cc.

226 { return dataList.begin(); }

References dataList.

◆ clear()

void DTPerformance::clear ( void  )

reset content

Definition at line 135 of file DTPerformance.cc.

135  {
136  dataList.clear();
137  initialize();
138  return;
139 }

References dataList, and initialize().

Referenced by BeautifulSoup.Tag::setString().

◆ end()

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

Definition at line 228 of file DTPerformance.cc.

228 { return dataList.end(); }

References dataList.

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

◆ get() [1/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

◆ get() [2/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.

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 }

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

◆ initialize()

void DTPerformance::initialize ( )

Definition at line 236 of file DTPerformance.cc.

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 }

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

Referenced by clear().

◆ mapName()

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

read and store full content

Definition at line 230 of file DTPerformance.cc.

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

References dataVersion, and Skims_PA_cff::name.

◆ operator=()

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

◆ serialize()

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

◆ set() [1/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.

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 }

References set(), relativeConstraints::station, unit(), and makeMuonMisalignmentScenario::wheel.

◆ set() [2/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.

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 }

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(), set(), and setSLPerformance().

◆ setSLPerformance() [1/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 173 of file DTPerformance.h.

181  {
182  return set(id, meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse, meanResolution, meanEfficiency, unit);
183  };

References set(), and unit().

◆ setSLPerformance() [2/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 148 of file DTPerformance.h.

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

References set(), and unit().

◆ setUnit()

void DTPerformance::setUnit ( float  unit)

Definition at line 224 of file DTPerformance.cc.

224 { nsPerCount = unit; }

References nsPerCount, and unit().

◆ slPerformance() [1/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 107 of file DTPerformance.h.

115  {
116  return get(id, meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse, meanResolution, meanEfficiency, unit);
117  };

References get(), and unit().

◆ slPerformance() [2/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 82 of file DTPerformance.h.

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

◆ unit()

float DTPerformance::unit ( ) const

Definition at line 129 of file DTPerformance.cc.

129 { return nsPerCount; }

References nsPerCount.

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

◆ version() [1/2]

std::string & DTPerformance::version ( )

Definition at line 133 of file DTPerformance.cc.

133 { return dataVersion; }

References dataVersion.

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

◆ version() [2/2]

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

access version

Definition at line 131 of file DTPerformance.cc.

131 { return dataVersion; }

References dataVersion.

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 228 of file DTPerformance.h.

◆ cond::serialization::access

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

Definition at line 228 of file DTPerformance.h.

Member Data Documentation

◆ dataList

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

Definition at line 221 of file DTPerformance.h.

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

◆ dataVersion

std::string DTPerformance::dataVersion
private

Definition at line 218 of file DTPerformance.h.

Referenced by mapName(), and version().

◆ dBuf

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

Definition at line 223 of file DTPerformance.h.

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

◆ nsPerCount

float DTPerformance::nsPerCount
private

Definition at line 219 of file DTPerformance.h.

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

DTPerformanceId
Definition: DTPerformance.h:39
DTPerformance::nsPerCount
float nsPerCount
Definition: DTPerformance.h:219
DTPerformance::dBuf
DTBufferTree< int, int > * dBuf
Definition: DTPerformance.h:223
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DTBufferTree::clear
void clear()
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
DTPerformance::version
const std::string & version() const
access version
Definition: DTPerformance.cc:131
DTPerformance::dataList
std::vector< std::pair< DTPerformanceId, DTPerformanceData > > dataList
Definition: DTPerformance.h:221
DTBufferTree::insert
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTPerformance::dataVersion
std::string dataVersion
Definition: DTPerformance.h:218
DTTimeUnits::ns
Definition: DTTimeUnits.h:32
DTPerformance::initialize
void initialize()
Definition: DTPerformance.cc:236
DTPerformance::get
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
Definition: DTPerformance.cc:63
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTBufferTree< int, int >
DTPerformance::unit
float unit() const
Definition: DTPerformance.cc:129
DTPerformanceData
Definition: DTPerformance.h:52
DTPerformance::set
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)
Definition: DTPerformance.cc:141
officialStyle.chan
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi....
Definition: officialStyle.py:106
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DTBufferTree::find
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
crabWrapper.key
key
Definition: crabWrapper.py:19