CMS 3D CMS Logo

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

#include <DTTtrig.h>

Public Types

typedef std::vector< std::pair< DTTtrigId, DTTtrigData > >::const_iterator const_iterator
 Access methods to data. More...
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 reset content More...
 
 DTTtrig ()
 
 DTTtrig (const std::string &version)
 
const_iterator end () const
 
int get (int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 get content More...
 
int get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 
int get (const DTSuperLayerId &id, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 
int get (const DetId &id, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int slId, float &tTrig, DTTimeUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &tTrig, DTTimeUnits::type unit) const
 
int get (const DTSuperLayerId &id, float &tTrig, DTTimeUnits::type unit) const
 
int get (const DetId &id, float &tTrig, DTTimeUnits::type unit) const
 
void initialize ()
 
int set (int wheelId, int stationId, int sectorId, int slId, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
int set (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
int set (const DTSuperLayerId &id, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
int set (const DetId &id, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
void setUnit (float unit)
 
float unit () const
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
 ~DTTtrig ()
 

Private Member Functions

 DTTtrig (DTTtrig const &)=delete
 
std::string mapName () const
 
DTTtrigoperator= (DTTtrig const &)=delete
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< std::pair< DTTtrigId, DTTtrigData > > 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 TTrigs ( SL by SL time offsets )

Author
Paolo Ronchese INFN Padova

Definition at line 76 of file DTTtrig.h.

Member Typedef Documentation

typedef std::vector< std::pair<DTTtrigId, DTTtrigData> >::const_iterator DTTtrig::const_iterator

Access methods to data.

Definition at line 183 of file DTTtrig.h.

Constructor & Destructor Documentation

DTTtrig::DTTtrig ( )

Constructor

Definition at line 35 of file DTTtrig.cc.

References dataList.

35  :
36  dataVersion( " " ),
37  nsPerCount( 25.0 / 32.0 ),
39  dataList.reserve( 1000 );
40 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:199
float nsPerCount
Definition: DTTtrig.h:195
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:197
std::string dataVersion
Definition: DTTtrig.h:194
DTTtrig::DTTtrig ( const std::string &  version)

Definition at line 43 of file DTTtrig.cc.

References dataList.

43  :
45  nsPerCount( 25.0 / 32.0 ),
47  dataList.reserve( 1000 );
48 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:199
float nsPerCount
Definition: DTTtrig.h:195
const std::string & version() const
access version
Definition: DTTtrig.cc:231
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:197
std::string dataVersion
Definition: DTTtrig.h:194
DTTtrig::~DTTtrig ( )

Destructor

Definition at line 71 of file DTTtrig.cc.

71  {
72 }
DTTtrig::DTTtrig ( DTTtrig const &  )
privatedelete

Member Function Documentation

DTTtrig::const_iterator DTTtrig::begin ( void  ) const

Definition at line 354 of file DTTtrig.cc.

Referenced by DTtTrigDBValidation::bookHistograms(), DTTTrigCalibration::dumpTTrigMap(), and DTTTrigCalibration::plotTTrig().

354  {
355  return dataList.begin();
356 }
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:197
void DTTtrig::clear ( void  )
DTTtrig::const_iterator DTTtrig::end ( void  ) const

Definition at line 359 of file DTTtrig.cc.

Referenced by DTtTrigDBValidation::bookHistograms(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), DTTTrigCalibration::dumpTTrigMap(), and DTTTrigCalibration::plotTTrig().

359  {
360  return dataList.end();
361 }
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:197
int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const

Definition at line 100 of file DTTtrig.cc.

References data, DTTtrigData::kFact, DTTimeUnits::ns, edm::second(), DTTtrigData::tTrig, and DTTtrigData::tTrms.

Referenced by Options.Options::__getitem__(), betterConfigParser.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::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.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().

109  {
110 
111  tTrig =
112  tTrms =
113  kFact = 0.0;
114 
115  std::vector<int> chanKey;
116  chanKey.reserve(6);
117  chanKey.push_back( wheelId );
118  chanKey.push_back( stationId );
119  chanKey.push_back( sectorId );
120  chanKey.push_back( slId );
121  chanKey.push_back( layerId );
122  chanKey.push_back( cellId );
123  int ientry;
124  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
125  if ( !searchStatus ) {
126  const DTTtrigData& data( dataList[ientry].second );
127  tTrig = data.tTrig;
128  tTrms = data.tTrms;
129  kFact = data.kFact;
130  if ( unit == DTTimeUnits::ns ) {
131  tTrig *= nsPerCount;
132  tTrms *= nsPerCount;
133  }
134  }
135 
136  return searchStatus;
137 
138 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:199
float nsPerCount
Definition: DTTtrig.h:195
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:197
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
float unit() const
Definition: DTTtrig.cc:225
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int DTTtrig::get ( const DTSuperLayerId id,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( const DetId id,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  tTrig,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  tTrig,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( const DTSuperLayerId id,
float &  tTrig,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( const DetId id,
float &  tTrig,
DTTimeUnits::type  unit 
) const
void DTTtrig::initialize ( )

Definition at line 371 of file DTTtrig.cc.

References officialStyle::chan, and DTTtrigId::stationId.

371  {
372 
373  dBuf->clear();
374 
375  int entryNum = 0;
376  int entryMax = dataList.size();
377  std::vector<int> chanKey;
378  chanKey.reserve(6);
379  while ( entryNum < entryMax ) {
380 
381  const DTTtrigId& chan = dataList[entryNum].first;
382 
383  chanKey.clear();
384  chanKey.push_back( chan. wheelId );
385  chanKey.push_back( chan.stationId );
386  chanKey.push_back( chan. sectorId );
387  chanKey.push_back( chan. slId );
388  chanKey.push_back( chan. layerId );
389  chanKey.push_back( chan. cellId );
390  dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ );
391  }
392  return;
393 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:199
int stationId
Definition: DTTtrig.h:49
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:197
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)
std::string DTTtrig::mapName ( ) const
private

Definition at line 364 of file DTTtrig.cc.

References dataset::name.

364  {
365  std::stringstream name;
366  name << dataVersion << "_map_Ttrig" << this;
367  return name.str();
368 }
std::string dataVersion
Definition: DTTtrig.h:194
DTTtrig& DTTtrig::operator= ( DTTtrig const &  )
privatedelete
template<class Archive >
void DTTtrig::serialize ( Archive &  ar,
const unsigned int  version 
)
private
int DTTtrig::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 248 of file DTTtrig.cc.

References DTTtrigData::kFact, DTTtrigData::tTrig, DTTtrigData::tTrms, and csvLumiCalc::unit.

Referenced by DTTTrigCorrectionFirst::endJob(), DTTTrigOffsetCalibration::endJob(), DTTTrigCorrection::endJob(), and DTTTrigCalibration::endJob().

255  {
256  return set( wheelId, stationId, sectorId,
257  slId, 0, 0,
258  tTrig, tTrms, kFact, unit );
259 
260 }
float unit() const
Definition: DTTtrig.cc:225
int DTTtrig::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 263 of file DTTtrig.cc.

References data, crabWrapper::key, DTTtrigData::kFact, DTTimeUnits::ns, edm::second(), DTTtrigId::stationId, DTTtrigData::tTrig, and DTTtrigData::tTrms.

272  {
273 
274  if ( unit == DTTimeUnits::ns ) {
275  tTrig /= nsPerCount;
276  tTrms /= nsPerCount;
277  }
278 
279  std::vector<int> chanKey;
280  chanKey.reserve(6);
281  chanKey.push_back( wheelId );
282  chanKey.push_back( stationId );
283  chanKey.push_back( sectorId );
284  chanKey.push_back( slId );
285  chanKey.push_back( layerId );
286  chanKey.push_back( cellId );
287  int ientry;
288  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
289 
290  if ( !searchStatus ) {
291  DTTtrigData& data( dataList[ientry].second );
292  data.tTrig = tTrig;
293  data.tTrms = tTrms;
294  data.kFact = kFact;
295  return -1;
296  }
297  else {
298  DTTtrigId key;
299  key. wheelId = wheelId;
300  key.stationId = stationId;
301  key. sectorId = sectorId;
302  key. slId = slId;
303  key. layerId = layerId;
304  key. cellId = cellId;
306  data.tTrig = tTrig;
307  data.tTrms = tTrms;
308  data.kFact = kFact;
309  ientry = dataList.size();
310  dataList.push_back( std::pair<DTTtrigId,DTTtrigData>( key, data ) );
311  dBuf->insert( chanKey.begin(), chanKey.end(), ientry );
312  return 0;
313  }
314 
315  return 99;
316 
317 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:199
float nsPerCount
Definition: DTTtrig.h:195
float tTrms
Definition: DTTtrig.h:68
int stationId
Definition: DTTtrig.h:49
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:197
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
float unit() const
Definition: DTTtrig.cc:225
float kFact
Definition: DTTtrig.h:69
float tTrig
Definition: DTTtrig.h:67
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int insert(ElementKey fKey, ElementKey lKey, Content cont)
int DTTtrig::set ( const DTSuperLayerId id,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 320 of file DTTtrig.cc.

References DTTtrigData::kFact, DTTtrigData::tTrig, DTTtrigData::tTrms, and csvLumiCalc::unit.

324  {
325  return set( id.wheel(),
326  id.station(),
327  id.sector(),
328  id.superLayer(), 0, 0,
329  tTrig, tTrms, kFact, unit );
330 }
float unit() const
Definition: DTTtrig.cc:225
int DTTtrig::set ( const DetId id,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 333 of file DTTtrig.cc.

References DTTtrigData::kFact, DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), DTTtrigData::tTrig, DTTtrigData::tTrms, csvLumiCalc::unit, DTChamberId::wheel(), and DTWireId::wire().

337  {
338  DTWireId wireId( id.rawId() );
339  return set( wireId.wheel(),
340  wireId.station(),
341  wireId.sector(),
342  wireId.superLayer(),
343  wireId.layer(),
344  wireId.wire(),
345  tTrig, tTrms, kFact, unit );
346 }
float unit() const
Definition: DTTtrig.cc:225
void DTTtrig::setUnit ( float  unit)

Definition at line 349 of file DTTtrig.cc.

References csvLumiCalc::unit.

349  {
350  nsPerCount = unit;
351 }
float nsPerCount
Definition: DTTtrig.h:195
float unit() const
Definition: DTTtrig.cc:225
float DTTtrig::unit ( ) const

Definition at line 225 of file DTTtrig.cc.

225  {
226  return nsPerCount;
227 }
float nsPerCount
Definition: DTTtrig.h:195
const std::string & DTTtrig::version ( ) const
std::string & DTTtrig::version ( )

Definition at line 236 of file DTTtrig.cc.

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

236  {
237  return dataVersion;
238 }
std::string dataVersion
Definition: DTTtrig.h:194

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 204 of file DTTtrig.h.

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

Definition at line 204 of file DTTtrig.h.

Member Data Documentation

std::vector< std::pair<DTTtrigId,DTTtrigData> > DTTtrig::dataList
private

Definition at line 197 of file DTTtrig.h.

Referenced by DTTtrig().

std::string DTTtrig::dataVersion
private

Definition at line 194 of file DTTtrig.h.

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

Definition at line 199 of file DTTtrig.h.

float DTTtrig::nsPerCount
private

Definition at line 195 of file DTTtrig.h.