CMS 3D CMS Logo

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

#include <DTRangeT0.h>

Public Types

typedef std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > >::const_iterator const_iterator
 Access methods to data. More...
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 reset content More...
 
 DTRangeT0 ()
 
 DTRangeT0 (DTRangeT0 const &)=delete
 
 DTRangeT0 (const std::string &version)
 
const_iterator end () const
 
int get (int wheelId, int stationId, int sectorId, int slId, int &t0min, int &t0max) const
 
int get (const DTSuperLayerId &id, int &t0min, int &t0max) const
 
void initialize ()
 
DTRangeT0operator= (DTRangeT0 const &)=delete
 
int set (int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
 
int set (const DTSuperLayerId &id, int t0min, int t0max)
 
int setSLRangeT0 (int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
 
int setSLRangeT0 (const DTSuperLayerId &id, int t0min, int t0max)
 
int slRangeT0 (int wheelId, int stationId, int sectorId, int slId, int &t0min, int &t0max) const
 get content More...
 
int slRangeT0 (const DTSuperLayerId &id, int &t0min, int &t0max) const
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
 ~DTRangeT0 ()
 

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< DTRangeT0Id, DTRangeT0Data > > dataList
 
std::string dataVersion
 
DTBufferTree< int, int > * dBuf
 

Friends

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

Detailed Description

Description: Class to hold drift tubes T0 range ( SL by SL min - max T0 )

Author
Paolo Ronchese INFN Padova

Definition at line 63 of file DTRangeT0.h.

Member Typedef Documentation

◆ const_iterator

Access methods to data.

Definition at line 101 of file DTRangeT0.h.

Constructor & Destructor Documentation

◆ DTRangeT0() [1/3]

DTRangeT0::DTRangeT0 ( )

Constructor

Definition at line 31 of file DTRangeT0.cc.

References dataList.

31 : dataVersion(" "), dBuf(new DTBufferTree<int, int>) { dataList.reserve(1000); }
std::string dataVersion
Definition: DTRangeT0.h:108
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:110
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:112

◆ DTRangeT0() [2/3]

DTRangeT0::DTRangeT0 ( DTRangeT0 const &  )
delete

◆ DTRangeT0() [3/3]

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

Definition at line 33 of file DTRangeT0.cc.

References dataList.

34  dataList.reserve(1000);
35 }
std::string dataVersion
Definition: DTRangeT0.h:108
const std::string & version() const
access version
Definition: DTRangeT0.cc:79
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:110
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:112

◆ ~DTRangeT0()

DTRangeT0::~DTRangeT0 ( )

Destructor

Definition at line 44 of file DTRangeT0.cc.

44 {}

Member Function Documentation

◆ begin()

DTRangeT0::const_iterator DTRangeT0::begin ( void  ) const

Definition at line 126 of file DTRangeT0.cc.

References dataList.

126 { return dataList.begin(); }
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:110

◆ clear()

void DTRangeT0::clear ( void  )

reset content

Definition at line 83 of file DTRangeT0.cc.

References dataList, and initialize().

Referenced by BeautifulSoup.Tag::setString().

83  {
84  dataList.clear();
85  initialize();
86  return;
87 }
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:110
void initialize()
Definition: DTRangeT0.cc:136

◆ end()

DTRangeT0::const_iterator DTRangeT0::end ( void  ) const

Definition at line 128 of file DTRangeT0.cc.

References dataList.

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

128 { return dataList.end(); }
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:110

◆ get() [1/2]

int DTRangeT0::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int &  t0min,
int &  t0max 
) const

Definition at line 53 of file DTRangeT0.cc.

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

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

53  {
54  t0min = t0max = 0;
55 
56  std::vector<int> chanKey;
57  chanKey.reserve(4);
58  chanKey.push_back(wheelId);
59  chanKey.push_back(stationId);
60  chanKey.push_back(sectorId);
61  chanKey.push_back(slId);
62  int ientry;
63  //Guarantee const correctness for thread-safety
64  const DTBufferTree<int, int>* constDBuf = dBuf;
65  int searchStatus = constDBuf->find(chanKey.begin(), chanKey.end(), ientry);
66  if (!searchStatus) {
67  const DTRangeT0Data& data(dataList[ientry].second);
68  t0min = data.t0min;
69  t0max = data.t0max;
70  }
71 
72  return searchStatus;
73 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:110
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:112

◆ get() [2/2]

int DTRangeT0::get ( const DTSuperLayerId id,
int &  t0min,
int &  t0max 
) const

◆ initialize()

void DTRangeT0::initialize ( )

Definition at line 136 of file DTRangeT0.cc.

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

Referenced by clear().

136  {
137  dBuf->clear();
138 
139  int entryNum = 0;
140  int entryMax = dataList.size();
141  std::vector<int> chanKey;
142  chanKey.reserve(4);
143  while (entryNum < entryMax) {
144  const DTRangeT0Id& chan = dataList[entryNum].first;
145 
146  chanKey.clear();
147  chanKey.push_back(chan.wheelId);
148  chanKey.push_back(chan.stationId);
149  chanKey.push_back(chan.sectorId);
150  chanKey.push_back(chan.slId);
151  dBuf->insert(chanKey.begin(), chanKey.end(), entryNum++);
152  }
153  return;
154 }
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:110
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
Definition: DTRangeT0.h:112

◆ mapName()

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

read and store full content

Definition at line 130 of file DTRangeT0.cc.

References dataVersion, and Skims_PA_cff::name.

130  {
131  std::stringstream name;
132  name << dataVersion << "_map_RangeT0" << this;
133  return name.str();
134 }
std::string dataVersion
Definition: DTRangeT0.h:108

◆ operator=()

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

◆ serialize()

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

◆ set() [1/2]

int DTRangeT0::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  t0min,
int  t0max 
)

Definition at line 89 of file DTRangeT0.cc.

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

Referenced by DTRangeT0Handler::getNewObjects().

89  {
90  std::vector<int> chanKey;
91  chanKey.reserve(4);
92  chanKey.push_back(wheelId);
93  chanKey.push_back(stationId);
94  chanKey.push_back(sectorId);
95  chanKey.push_back(slId);
96  int ientry;
97  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
98 
99  if (!searchStatus) {
100  DTRangeT0Data& data(dataList[ientry].second);
101  data.t0min = t0min;
102  data.t0max = t0max;
103  return -1;
104  } else {
106  key.wheelId = wheelId;
107  key.stationId = stationId;
108  key.sectorId = sectorId;
109  key.slId = slId;
111  data.t0min = t0min;
112  data.t0max = t0max;
113  ientry = dataList.size();
114  dataList.push_back(std::pair<DTRangeT0Id, DTRangeT0Data>(key, data));
115  dBuf->insert(chanKey.begin(), chanKey.end(), ientry);
116  return 0;
117  }
118 
119  return 99;
120 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:110
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:112

◆ set() [2/2]

int DTRangeT0::set ( const DTSuperLayerId id,
int  t0min,
int  t0max 
)

Definition at line 122 of file DTRangeT0.cc.

122  {
123  return set(id.wheel(), id.station(), id.sector(), id.superLayer(), t0min, t0max);
124 }

◆ setSLRangeT0() [1/2]

int DTRangeT0::setSLRangeT0 ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  t0min,
int  t0max 
)
inline

Definition at line 93 of file DTRangeT0.h.

93  {
94  return set(wheelId, stationId, sectorId, slId, t0min, t0max);
95  };

◆ setSLRangeT0() [2/2]

int DTRangeT0::setSLRangeT0 ( const DTSuperLayerId id,
int  t0min,
int  t0max 
)
inline

Definition at line 96 of file DTRangeT0.h.

References triggerObjects_cff::id.

96 { return set(id, t0min, t0max); };

◆ slRangeT0() [1/2]

int DTRangeT0::slRangeT0 ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int &  t0min,
int &  t0max 
) const
inline

get content

Operations

Definition at line 79 of file DTRangeT0.h.

79  {
80  return get(wheelId, stationId, sectorId, slId, t0min, t0max);
81  };

◆ slRangeT0() [2/2]

int DTRangeT0::slRangeT0 ( const DTSuperLayerId id,
int &  t0min,
int &  t0max 
) const
inline

Definition at line 82 of file DTRangeT0.h.

References triggerObjects_cff::id.

82 { return get(id, t0min, t0max); };

◆ version() [1/2]

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

access version

Definition at line 79 of file DTRangeT0.cc.

References dataVersion.

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

79 { return dataVersion; }
std::string dataVersion
Definition: DTRangeT0.h:108

◆ version() [2/2]

std::string & DTRangeT0::version ( )

Definition at line 81 of file DTRangeT0.cc.

References dataVersion.

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

81 { return dataVersion; }
std::string dataVersion
Definition: DTRangeT0.h:108

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 117 of file DTRangeT0.h.

◆ cond::serialization::access

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

Definition at line 117 of file DTRangeT0.h.

Member Data Documentation

◆ dataList

std::vector<std::pair<DTRangeT0Id, DTRangeT0Data> > DTRangeT0::dataList
private

Definition at line 110 of file DTRangeT0.h.

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

◆ dataVersion

std::string DTRangeT0::dataVersion
private

Definition at line 108 of file DTRangeT0.h.

Referenced by mapName(), and version().

◆ dBuf

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

Definition at line 112 of file DTRangeT0.h.

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