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 (const std::string &version)
 
const_iterator end () const
 
int get (const DTSuperLayerId &id, int &t0min, int &t0max) const
 
int get (int wheelId, int stationId, int sectorId, int slId, int &t0min, int &t0max) const
 
void initialize ()
 
int set (const DTSuperLayerId &id, int t0min, int t0max)
 
int set (int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
 
int setSLRangeT0 (const DTSuperLayerId &id, int t0min, int t0max)
 
int setSLRangeT0 (int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
 
int slRangeT0 (const DTSuperLayerId &id, int &t0min, int &t0max) const
 
int slRangeT0 (int wheelId, int stationId, int sectorId, int slId, int &t0min, int &t0max) const
 get content More...
 
std::string & version ()
 
const std::string & version () const
 access version More...
 
 ~DTRangeT0 ()
 

Private Member Functions

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

Constructor & Destructor Documentation

◆ DTRangeT0() [1/3]

DTRangeT0::DTRangeT0 ( )

Constructor

Definition at line 31 of file DTRangeT0.cc.

31 : dataVersion(" "), dBuf(new DTBufferTree<int, int>) { dataList.reserve(1000); }

References dataList.

◆ DTRangeT0() [2/3]

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

Definition at line 33 of file DTRangeT0.cc.

34  dataList.reserve(1000);
35 }

References dataList.

◆ ~DTRangeT0()

DTRangeT0::~DTRangeT0 ( )

Destructor

Definition at line 44 of file DTRangeT0.cc.

44 {}

◆ DTRangeT0() [3/3]

DTRangeT0::DTRangeT0 ( DTRangeT0 const &  )
privatedelete

Member Function Documentation

◆ begin()

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

Definition at line 126 of file DTRangeT0.cc.

126 { return dataList.begin(); }

References dataList.

◆ clear()

void DTRangeT0::clear ( void  )

reset content

Definition at line 83 of file DTRangeT0.cc.

83  {
84  dataList.clear();
85  initialize();
86  return;
87 }

References dataList, and initialize().

Referenced by BeautifulSoup.Tag::setString().

◆ end()

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

Definition at line 128 of file DTRangeT0.cc.

128 { return dataList.end(); }

References dataList.

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

◆ get() [1/2]

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

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

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 }

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

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

◆ initialize()

void DTRangeT0::initialize ( )

Definition at line 136 of file DTRangeT0.cc.

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 }

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

Referenced by clear().

◆ mapName()

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

read and store full content

Definition at line 130 of file DTRangeT0.cc.

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

References dataVersion, and Skims_PA_cff::name.

◆ operator=()

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

◆ serialize()

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

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

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

◆ set() [2/2]

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

Definition at line 89 of file DTRangeT0.cc.

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 }

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

Referenced by DTRangeT0Handler::getNewObjects(), set(), and setSLRangeT0().

◆ setSLRangeT0() [1/2]

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

Definition at line 94 of file DTRangeT0.h.

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

References set().

◆ setSLRangeT0() [2/2]

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

Definition at line 91 of file DTRangeT0.h.

91  {
92  return set(wheelId, stationId, sectorId, slId, t0min, t0max);
93  };

References set().

◆ slRangeT0() [1/2]

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

Definition at line 80 of file DTRangeT0.h.

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

References get().

◆ slRangeT0() [2/2]

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

get content

Operations

Definition at line 77 of file DTRangeT0.h.

77  {
78  return get(wheelId, stationId, sectorId, slId, t0min, t0max);
79  };

◆ version() [1/2]

std::string & DTRangeT0::version ( )

Definition at line 81 of file DTRangeT0.cc.

81 { return dataVersion; }

References dataVersion.

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

◆ version() [2/2]

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

access version

Definition at line 79 of file DTRangeT0.cc.

79 { 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 118 of file DTRangeT0.h.

◆ cond::serialization::access

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

Definition at line 118 of file DTRangeT0.h.

Member Data Documentation

◆ dataList

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

Definition at line 111 of file DTRangeT0.h.

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

◆ dataVersion

std::string DTRangeT0::dataVersion
private

Definition at line 109 of file DTRangeT0.h.

Referenced by mapName(), and version().

◆ dBuf

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

Definition at line 113 of file DTRangeT0.h.

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

DTRangeT0::version
const std::string & version() const
access version
Definition: DTRangeT0.cc:79
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
DTRangeT0Data
Definition: DTRangeT0.h:52
DTRangeT0Id
Definition: DTRangeT0.h:39
DTBufferTree::insert
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTRangeT0::set
int set(int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max)
Definition: DTRangeT0.cc:89
DTRangeT0::dataList
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:111
DTRangeT0::get
int get(int wheelId, int stationId, int sectorId, int slId, int &t0min, int &t0max) const
Definition: DTRangeT0.cc:53
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTBufferTree< int, int >
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
DTRangeT0::dataVersion
std::string dataVersion
Definition: DTRangeT0.h:109
DTBufferTree::find
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
crabWrapper.key
key
Definition: crabWrapper.py:19
DTRangeT0::dBuf
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:113
DTRangeT0::initialize
void initialize()
Definition: DTRangeT0.cc:136