CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
DTMtime Class Reference

#include <DTMtime.h>

Public Types

typedef std::vector< std::pair< DTMtimeId, DTMtimeData > >::const_iterator const_iterator
 Access methods to data. More...
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 reset content More...
 
 DTMtime ()
 
 DTMtime (const std::string &version)
 
const_iterator end () const
 
int get (const DetId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
 
int get (const DetId &id, float &mTime, float &mTrms, DTVelocityUnits::type unit) const
 
int get (const DTSuperLayerId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
 
int get (const DTSuperLayerId &id, float &mTime, float &mTrms, DTVelocityUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTVelocityUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &mTime, float &mTrms, DTVelocityUnits::type unit) const
 
void initialize ()
 
int set (const DetId &id, float mTime, float mTrms, DTTimeUnits::type unit)
 
int set (const DetId &id, float mTime, float mTrms, DTVelocityUnits::type unit)
 
int set (const DTSuperLayerId &id, float mTime, float mTrms, DTTimeUnits::type unit)
 
int set (const DTSuperLayerId &id, float mTime, float mTrms, DTVelocityUnits::type unit)
 
int set (int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit)
 
int set (int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTVelocityUnits::type unit)
 
int set (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float mTime, float mTrms, DTTimeUnits::type unit)
 
int set (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float mTime, float mTrms, DTVelocityUnits::type unit)
 
int setSLMtime (const DetId &id, float mTime, float mTrms, DTTimeUnits::type unit)
 
int setSLMtime (const DTSuperLayerId &id, float mTime, float mTrms, DTTimeUnits::type unit)
 
int setSLMtime (int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit)
 
int setSLMtime (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float mTime, float mTrms, DTTimeUnits::type unit)
 
void setUnit (float unit)
 
int slMtime (const DetId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
 
int slMtime (const DTSuperLayerId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
 
int slMtime (int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
 get content More...
 
int slMtime (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
 
float unit () const
 
std::string & version ()
 
const std::string & version () const
 access version More...
 
 ~DTMtime ()
 

Private Member Functions

 DTMtime (DTMtime const &)=delete
 
std::string mapName () const
 read and store full content More...
 
DTMtimeoperator= (DTMtime const &)=delete
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< std::pair< DTMtimeId, DTMtimeData > > dataList
 
std::string dataVersion
 
edm::ConstRespectingPtr< 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 mean-times ( SL by SL mean-time calculation )

Author
Paolo Ronchese INFN Padova

Definition at line 68 of file DTMtime.h.

Member Typedef Documentation

◆ const_iterator

typedef std::vector<std::pair<DTMtimeId, DTMtimeData> >::const_iterator DTMtime::const_iterator

Access methods to data.

Definition at line 184 of file DTMtime.h.

Constructor & Destructor Documentation

◆ DTMtime() [1/3]

DTMtime::DTMtime ( )

Constructor

Definition at line 31 of file DTMtime.cc.

31  : dataVersion(" "), nsPerCount(25.0 / 32.0), dBuf(new DTBufferTree<int, int>) {
32  dataList.reserve(1000);
33 }

References dataList.

◆ DTMtime() [2/3]

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

Definition at line 35 of file DTMtime.cc.

37  dataList.reserve(1000);
38 }

References dataList.

◆ ~DTMtime()

DTMtime::~DTMtime ( )

Destructor

Definition at line 47 of file DTMtime.cc.

47 {}

◆ DTMtime() [3/3]

DTMtime::DTMtime ( DTMtime const &  )
privatedelete

Member Function Documentation

◆ begin()

DTMtime::const_iterator DTMtime::begin ( void  ) const

Definition at line 284 of file DTMtime.cc.

284 { return dataList.begin(); }

References dataList.

◆ clear()

void DTMtime::clear ( void  )

reset content

Definition at line 162 of file DTMtime.cc.

162  {
163  dataList.clear();
164  initialize();
165  return;
166 }

References dataList, and initialize().

Referenced by BeautifulSoup.Tag::setString().

◆ end()

DTMtime::const_iterator DTMtime::end ( void  ) const

Definition at line 286 of file DTMtime.cc.

286 { return dataList.end(); }

References dataList.

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

◆ get() [1/8]

int DTMtime::get ( const DetId id,
float &  mTime,
float &  mTrms,
DTTimeUnits::type  unit 
) const

◆ get() [2/8]

int DTMtime::get ( const DetId id,
float &  mTime,
float &  mTrms,
DTVelocityUnits::type  unit 
) const

◆ get() [3/8]

int DTMtime::get ( const DTSuperLayerId id,
float &  mTime,
float &  mTrms,
DTTimeUnits::type  unit 
) const

◆ get() [4/8]

int DTMtime::get ( const DTSuperLayerId id,
float &  mTime,
float &  mTrms,
DTVelocityUnits::type  unit 
) const

◆ get() [5/8]

int DTMtime::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  mTime,
float &  mTrms,
DTTimeUnits::type  unit 
) const

◆ get() [6/8]

int DTMtime::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  mTime,
float &  mTrms,
DTVelocityUnits::type  unit 
) const

◆ get() [7/8]

int DTMtime::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  mTime,
float &  mTrms,
DTTimeUnits::type  unit 
) const

Definition at line 66 of file DTMtime.cc.

74  {
75  mTime = mTrms = 0.0;
76 
77  std::vector<int> chanKey;
78  chanKey.reserve(6);
79  chanKey.push_back(wheelId);
80  chanKey.push_back(stationId);
81  chanKey.push_back(sectorId);
82  chanKey.push_back(slId);
83  chanKey.push_back(layerId);
84  chanKey.push_back(cellId);
85  int ientry;
86  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
87  if (!searchStatus) {
88  const DTMtimeData& data(dataList[ientry].second);
89  mTime = data.mTime;
90  mTrms = data.mTrms;
91  if (unit == DTTimeUnits::ns) {
92  mTime *= nsPerCount;
93  mTrms *= nsPerCount;
94  }
95  }
96 
97  return searchStatus;
98 }

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

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

◆ get() [8/8]

int DTMtime::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  mTime,
float &  mTrms,
DTVelocityUnits::type  unit 
) const

◆ initialize()

void DTMtime::initialize ( )

Definition at line 294 of file DTMtime.cc.

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  const DTMtimeId& chan = dataList[entryNum].first;
303 
304  chanKey.clear();
305  chanKey.push_back(chan.wheelId);
306  chanKey.push_back(chan.stationId);
307  chanKey.push_back(chan.sectorId);
308  chanKey.push_back(chan.slId);
309  chanKey.push_back(chan.layerId);
310  chanKey.push_back(chan.cellId);
311  dBuf->insert(chanKey.begin(), chanKey.end(), entryNum++);
312  }
313 
314  return;
315 }

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

Referenced by clear().

◆ mapName()

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

read and store full content

Definition at line 288 of file DTMtime.cc.

288  {
289  std::stringstream name;
290  name << dataVersion << "_map_Mtime" << this;
291  return name.str();
292 }

References dataVersion, and Skims_PA_cff::name.

◆ operator=()

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

◆ serialize()

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

◆ set() [1/8]

int DTMtime::set ( const DetId id,
float  mTime,
float  mTrms,
DTTimeUnits::type  unit 
)

Definition at line 256 of file DTMtime.cc.

256  {
257  DTWireId wireId(id.rawId());
258  return set(wireId.wheel(),
259  wireId.station(),
260  wireId.sector(),
261  wireId.superLayer(),
262  wireId.layer(),
263  wireId.wire(),
264  mTime,
265  mTrms,
266  unit);
267 }

References DTLayerId::layer(), DTChamberId::sector(), set(), DTChamberId::station(), DTSuperLayerId::superLayer(), unit(), DTChamberId::wheel(), and DTWireId::wire().

◆ set() [2/8]

int DTMtime::set ( const DetId id,
float  mTime,
float  mTrms,
DTVelocityUnits::type  unit 
)

Definition at line 269 of file DTMtime.cc.

269  {
270  DTWireId wireId(id.rawId());
271  return set(wireId.wheel(),
272  wireId.station(),
273  wireId.sector(),
274  wireId.superLayer(),
275  wireId.layer(),
276  wireId.wire(),
277  mTime,
278  mTrms,
279  unit);
280 }

References DTLayerId::layer(), DTChamberId::sector(), set(), DTChamberId::station(), DTSuperLayerId::superLayer(), unit(), DTChamberId::wheel(), and DTWireId::wire().

◆ set() [3/8]

int DTMtime::set ( const DTSuperLayerId id,
float  mTime,
float  mTrms,
DTTimeUnits::type  unit 
)

Definition at line 248 of file DTMtime.cc.

248  {
249  return set(id.wheel(), id.station(), id.sector(), id.superLayer(), 0, 0, mTime, mTrms, unit);
250 }

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

◆ set() [4/8]

int DTMtime::set ( const DTSuperLayerId id,
float  mTime,
float  mTrms,
DTVelocityUnits::type  unit 
)

Definition at line 252 of file DTMtime.cc.

252  {
253  return set(id.wheel(), id.station(), id.sector(), id.superLayer(), 0, 0, mTime, mTrms, unit);
254 }

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

◆ set() [5/8]

int DTMtime::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float  mTime,
float  mTrms,
DTTimeUnits::type  unit 
)

Definition at line 168 of file DTMtime.cc.

168  {
169  return set(wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit);
170 }

References unit().

Referenced by DTVDriftWriter::endJob(), DTVDriftCalibration::endJob(), set(), and setSLMtime().

◆ set() [6/8]

int DTMtime::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float  mTime,
float  mTrms,
DTVelocityUnits::type  unit 
)

Definition at line 172 of file DTMtime.cc.

173  {
174  return set(wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit);
175 }

References set(), and unit().

◆ set() [7/8]

int DTMtime::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float  mTime,
float  mTrms,
DTTimeUnits::type  unit 
)

Definition at line 177 of file DTMtime.cc.

185  {
186  if (unit == DTTimeUnits::ns) {
187  mTime /= nsPerCount;
188  mTrms /= nsPerCount;
189  }
190 
191  std::vector<int> chanKey;
192  chanKey.reserve(6);
193  chanKey.push_back(wheelId);
194  chanKey.push_back(stationId);
195  chanKey.push_back(sectorId);
196  chanKey.push_back(slId);
197  chanKey.push_back(layerId);
198  chanKey.push_back(cellId);
199  int ientry;
200  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
201 
202  if (!searchStatus) {
203  DTMtimeData& data(dataList[ientry].second);
204  data.mTime = mTime;
205  data.mTrms = mTrms;
206  return -1;
207  } else {
208  DTMtimeId key;
209  key.wheelId = wheelId;
210  key.stationId = stationId;
211  key.sectorId = sectorId;
212  key.slId = slId;
213  key.layerId = layerId;
214  key.cellId = cellId;
216  data.mTime = mTime;
217  data.mTrms = mTrms;
218  ientry = dataList.size();
219  dataList.push_back(std::pair<DTMtimeId, DTMtimeData>(key, data));
220  dBuf->insert(chanKey.begin(), chanKey.end(), ientry);
221  return 0;
222  }
223 
224  return 99;
225 }

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

◆ set() [8/8]

int DTMtime::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float  mTime,
float  mTrms,
DTVelocityUnits::type  unit 
)

Definition at line 227 of file DTMtime.cc.

235  {
237  mTrms /= mTime;
238  mTime = 2.1 / mTime;
239  }
241  mTime *= nsPerCount;
242  mTrms /= mTime;
243  mTime = 2.1 / mTime;
244  }
245  return set(wheelId, stationId, sectorId, slId, layerId, cellId, mTime, mTrms, DTTimeUnits::counts);
246 }

References DTVelocityUnits::cm_per_count, DTVelocityUnits::cm_per_ns, DTTimeUnits::counts, nsPerCount, set(), and unit().

◆ setSLMtime() [1/4]

int DTMtime::setSLMtime ( const DetId id,
float  mTime,
float  mTrms,
DTTimeUnits::type  unit 
)
inline

Definition at line 154 of file DTMtime.h.

154  {
155  return set(id, mTime, mTrms, unit);
156  };

References set(), and unit().

◆ setSLMtime() [2/4]

int DTMtime::setSLMtime ( const DTSuperLayerId id,
float  mTime,
float  mTrms,
DTTimeUnits::type  unit 
)
inline

Definition at line 151 of file DTMtime.h.

151  {
152  return set(id, mTime, mTrms, unit);
153  };

References set(), and unit().

◆ setSLMtime() [3/4]

int DTMtime::setSLMtime ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float  mTime,
float  mTrms,
DTTimeUnits::type  unit 
)
inline

Definition at line 137 of file DTMtime.h.

137  {
138  return set(wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit);
139  };

References set(), and unit().

◆ setSLMtime() [4/4]

int DTMtime::setSLMtime ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float  mTime,
float  mTrms,
DTTimeUnits::type  unit 
)
inline

Definition at line 140 of file DTMtime.h.

148  {
149  return set(wheelId, stationId, sectorId, slId, layerId, cellId, mTime, mTrms, unit);
150  };

References set(), and unit().

◆ setUnit()

void DTMtime::setUnit ( float  unit)

Definition at line 282 of file DTMtime.cc.

282 { nsPerCount = unit; }

References nsPerCount, and unit().

◆ slMtime() [1/4]

int DTMtime::slMtime ( const DetId id,
float &  mTime,
float &  mTrms,
DTTimeUnits::type  unit 
) const
inline

Definition at line 100 of file DTMtime.h.

100  {
101  return get(id, mTime, mTrms, unit);
102  };

References get(), and unit().

◆ slMtime() [2/4]

int DTMtime::slMtime ( const DTSuperLayerId id,
float &  mTime,
float &  mTrms,
DTTimeUnits::type  unit 
) const
inline

Definition at line 97 of file DTMtime.h.

97  {
98  return get(id, mTime, mTrms, unit);
99  };

References get(), and unit().

◆ slMtime() [3/4]

int DTMtime::slMtime ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  mTime,
float &  mTrms,
DTTimeUnits::type  unit 
) const
inline

get content

Operations

Definition at line 82 of file DTMtime.h.

83  {
84  return get(wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit);
85  };

◆ slMtime() [4/4]

int DTMtime::slMtime ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  mTime,
float &  mTrms,
DTTimeUnits::type  unit 
) const
inline

Definition at line 86 of file DTMtime.h.

94  {
95  return get(wheelId, stationId, sectorId, slId, layerId, cellId, mTime, mTrms, unit);
96  };

References get(), and unit().

◆ unit()

float DTMtime::unit ( ) const

Definition at line 156 of file DTMtime.cc.

156 { return nsPerCount; }

References nsPerCount.

Referenced by get(), set(), setSLMtime(), setUnit(), and slMtime().

◆ version() [1/2]

std::string & DTMtime::version ( )

Definition at line 160 of file DTMtime.cc.

160 { return dataVersion; }

References dataVersion.

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

◆ version() [2/2]

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

access version

Definition at line 158 of file DTMtime.cc.

158 { return dataVersion; }

References dataVersion.

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 204 of file DTMtime.h.

◆ cond::serialization::access

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

Definition at line 204 of file DTMtime.h.

Member Data Documentation

◆ dataList

std::vector<std::pair<DTMtimeId, DTMtimeData> > DTMtime::dataList
private

Definition at line 197 of file DTMtime.h.

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

◆ dataVersion

std::string DTMtime::dataVersion
private

Definition at line 194 of file DTMtime.h.

Referenced by mapName(), and version().

◆ dBuf

edm::ConstRespectingPtr<DTBufferTree<int, int> > DTMtime::dBuf
private

Definition at line 199 of file DTMtime.h.

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

◆ nsPerCount

float DTMtime::nsPerCount
private

Definition at line 195 of file DTMtime.h.

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

mps_update.status
status
Definition: mps_update.py:69
DTMtime::initialize
void initialize()
Definition: DTMtime.cc:294
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DTBufferTree::clear
void clear()
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
DTMtime::set
int set(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.cc:168
DTBufferTree::insert
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTWireId
Definition: DTWireId.h:12
DTMtimeData
Definition: DTMtime.h:57
DTTimeUnits::ns
Definition: DTTimeUnits.h:32
DTMtime::dataList
std::vector< std::pair< DTMtimeId, DTMtimeData > > dataList
Definition: DTMtime.h:197
DTMtime::nsPerCount
float nsPerCount
Definition: DTMtime.h:195
DTVelocityUnits::cm_per_ns
Definition: DTVelocityUnits.h:32
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTMtime::version
const std::string & version() const
access version
Definition: DTMtime.cc:158
DTBufferTree< int, int >
DTVelocityUnits::cm_per_count
Definition: DTVelocityUnits.h:32
DTMtime::dataVersion
std::string dataVersion
Definition: DTMtime.h:194
DTTimeUnits::counts
Definition: DTTimeUnits.h:32
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
DTMtime::unit
float unit() const
Definition: DTMtime.cc:156
DTMtimeId
Definition: DTMtime.h:42
DTMtime::dBuf
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTMtime.h:199
DTBufferTree::find
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
crabWrapper.key
key
Definition: crabWrapper.py:19
DTMtime::get
int get(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.cc:56