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

 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

Access methods to data.

Definition at line 99 of file DTRangeT0.h.

Constructor & Destructor Documentation

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:109
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:111
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:113
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:109
const std::string & version() const
access version
Definition: DTRangeT0.cc:79
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:111
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:113
DTRangeT0::~DTRangeT0 ( )

Destructor

Definition at line 44 of file DTRangeT0.cc.

44 {}
DTRangeT0::DTRangeT0 ( DTRangeT0 const &  )
privatedelete

Member Function Documentation

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

Definition at line 126 of file DTRangeT0.cc.

126 { return dataList.begin(); }
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:111
void DTRangeT0::clear ( void  )
DTRangeT0::const_iterator DTRangeT0::end ( void  ) const

Definition at line 128 of file DTRangeT0.cc.

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

128 { return dataList.end(); }
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:111
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, DTBufferTree< Key, Content >::find(), edm::second(), DTRangeT0Data::t0max, and DTRangeT0Data::t0min.

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

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 }
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:111
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DTBufferTree< int, int > * dBuf
Definition: DTRangeT0.h:113
int DTRangeT0::get ( const DTSuperLayerId id,
int &  t0min,
int &  t0max 
) const
void DTRangeT0::initialize ( )

Definition at line 136 of file DTRangeT0.cc.

References officialStyle::chan, DTRangeT0Id::sectorId, DTRangeT0Id::slId, DTRangeT0Id::stationId, and DTRangeT0Id::wheelId.

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 }
int wheelId
Definition: DTRangeT0.h:44
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:111
int sectorId
Definition: DTRangeT0.h:46
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:113
int stationId
Definition: DTRangeT0.h:45
std::string DTRangeT0::mapName ( ) const
private

read and store full content

Definition at line 130 of file DTRangeT0.cc.

References 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:109
DTRangeT0& DTRangeT0::operator= ( DTRangeT0 const &  )
privatedelete
template<class Archive >
void DTRangeT0::serialize ( Archive &  ar,
const unsigned int  version 
)
private
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, crabWrapper::key, edm::second(), DTRangeT0Id::sectorId, DTRangeT0Id::slId, DTRangeT0Id::stationId, DTRangeT0Data::t0max, DTRangeT0Data::t0min, and DTRangeT0Id::wheelId.

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 }
int wheelId
Definition: DTRangeT0.h:44
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
std::vector< std::pair< DTRangeT0Id, DTRangeT0Data > > dataList
Definition: DTRangeT0.h:111
int sectorId
Definition: DTRangeT0.h:46
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:113
int stationId
Definition: DTRangeT0.h:45
int DTRangeT0::set ( const DTSuperLayerId id,
int  t0min,
int  t0max 
)

Definition at line 122 of file DTRangeT0.cc.

References DTRangeT0Data::t0max, and DTRangeT0Data::t0min.

122  {
123  return set(id.wheel(), id.station(), id.sector(), id.superLayer(), t0min, t0max);
124 }
int DTRangeT0::setSLRangeT0 ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  t0min,
int  t0max 
)
inline

Definition at line 91 of file DTRangeT0.h.

References DTRangeT0Id::sectorId, DTRangeT0Id::slId, DTRangeT0Id::stationId, and DTRangeT0Id::wheelId.

91  {
92  return set(wheelId, stationId, sectorId, slId, t0min, t0max);
93  };
int DTRangeT0::setSLRangeT0 ( const DTSuperLayerId id,
int  t0min,
int  t0max 
)
inline
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  };
int DTRangeT0::slRangeT0 ( const DTSuperLayerId id,
int &  t0min,
int &  t0max 
) const
inline
const std::string & DTRangeT0::version ( ) const

access version

Definition at line 79 of file DTRangeT0.cc.

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

79 { return dataVersion; }
std::string dataVersion
Definition: DTRangeT0.h:109
std::string & DTRangeT0::version ( )

Definition at line 81 of file DTRangeT0.cc.

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

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

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 118 of file DTRangeT0.h.

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

Definition at line 118 of file DTRangeT0.h.

Member Data Documentation

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

Definition at line 111 of file DTRangeT0.h.

Referenced by DTRangeT0().

std::string DTRangeT0::dataVersion
private

Definition at line 109 of file DTRangeT0.h.

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

Definition at line 113 of file DTRangeT0.h.