CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
DTTPGParameters Class Reference

#include <DTTPGParameters.h>

Public Types

typedef std::vector< std::pair
< DTTPGParametersId,
DTTPGParametersData >
>::const_iterator 
const_iterator
 Access methods to data. More...
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 reset content More...
 
int clock () const
 
 DTTPGParameters ()
 
 DTTPGParameters (const std::string &version)
 
const_iterator end () const
 
int get (int wheelId, int stationId, int sectorId, int &nc, float &ph, DTTimeUnits::type unit) const
 get content More...
 
int get (const DTChamberId &id, int &nc, float &ph, DTTimeUnits::type unit) const
 
void initialize ()
 
DTTPGParametersoperator= (DTTPGParameters const &)
 
int set (int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
 
int set (const DTChamberId &id, int nc, float ph, DTTimeUnits::type unit)
 
void setClock (int clock)
 
void setUnit (float unit)
 
float totalTime (int wheelId, int stationId, int sectorId, DTTimeUnits::type unit) const
 
float totalTime (const DTChamberId &id, DTTimeUnits::type unit) const
 
float unit () const
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
 ~DTTPGParameters ()
 

Private Member Functions

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

Private Attributes

int clockLength
 
std::vector< std::pair
< DTTPGParametersId,
DTTPGParametersData > > 
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 TPG parameters

Author
Paolo Ronchese INFN Padova

Definition at line 70 of file DTTPGParameters.h.

Member Typedef Documentation

Access methods to data.

Definition at line 129 of file DTTPGParameters.h.

Constructor & Destructor Documentation

DTTPGParameters::DTTPGParameters ( )

Constructor

Definition at line 32 of file DTTPGParameters.cc.

References dataList.

32  :
33  dataVersion( " " ),
34  nsPerCount( 25.0 / 32.0 ),
35  clockLength( 32 ),
37  dataList.reserve( 250 );
38 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
std::string dataVersion
std::vector< std::pair< DTTPGParametersId, DTTPGParametersData > > dataList
DTTPGParameters::DTTPGParameters ( const std::string &  version)

Definition at line 41 of file DTTPGParameters.cc.

References dataList.

41  :
43  nsPerCount( 25.0 / 32.0 ),
44  clockLength( 32 ),
46  dataList.reserve( 250 );
47 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
const std::string & version() const
access version
std::string dataVersion
std::vector< std::pair< DTTPGParametersId, DTTPGParametersData > > dataList
DTTPGParameters::~DTTPGParameters ( )

Destructor

Definition at line 78 of file DTTPGParameters.cc.

78  {
79 }
DTTPGParameters::DTTPGParameters ( DTTPGParameters const &  )
private

Member Function Documentation

DTTPGParameters::const_iterator DTTPGParameters::begin ( void  ) const

Definition at line 250 of file DTTPGParameters.cc.

References dataList.

Referenced by DTLocalTriggerSynchTest::dqmEndJob().

250  {
251  return dataList.begin();
252 }
std::vector< std::pair< DTTPGParametersId, DTTPGParametersData > > dataList
void DTTPGParameters::clear ( void  )
int DTTPGParameters::clock ( ) const

Definition at line 156 of file DTTPGParameters.cc.

References clockLength.

Referenced by setClock(), and totalTime().

156  {
157  return clockLength;
158 }
DTTPGParameters::const_iterator DTTPGParameters::end ( void  ) const

Definition at line 255 of file DTTPGParameters.cc.

References dataList.

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

255  {
256  return dataList.end();
257 }
std::vector< std::pair< DTTPGParametersId, DTTPGParametersData > > dataList
int DTTPGParameters::get ( int  wheelId,
int  stationId,
int  sectorId,
int &  nc,
float &  ph,
DTTimeUnits::type  unit 
) const

get content

Operations

Definition at line 93 of file DTTPGParameters.cc.

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

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), rrapi.RRApi::columns(), rrapi.RRApi::count(), rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), DTConfigPedestals::getOffset(), betterConfigParser.BetterConfigParser::getResultingSection(), DTConfigPedestals::print(), rrapi.RRApi::report(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

98  {
99 
100  nc = 0;
101  ph = 0.0;
102 
103  std::vector<int> chanKey;
104  chanKey.reserve(3);
105  chanKey.push_back( wheelId );
106  chanKey.push_back( stationId );
107  chanKey.push_back( sectorId );
108  int ientry;
109  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
110  if ( !searchStatus ) {
111  const DTTPGParametersData& data( dataList[ientry].second );
112  nc = data.nClock;
113  ph = data.tPhase;
114  if ( unit == DTTimeUnits::ns ) {
115  ph *= nsPerCount;
116  }
117  }
118 
119  return searchStatus;
120 
121 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
float unit() const
std::vector< std::pair< DTTPGParametersId, DTTPGParametersData > > dataList
int DTTPGParameters::get ( const DTChamberId id,
int &  nc,
float &  ph,
DTTimeUnits::type  unit 
) const
void DTTPGParameters::initialize ( )

Definition at line 267 of file DTTPGParameters.cc.

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

Referenced by clear(), and operator=().

267  {
268 
269  dBuf->clear();
270 
271  int entryNum = 0;
272  int entryMax = dataList.size();
273  std::vector<int> chanKey;
274  chanKey.reserve(3);
275  while ( entryNum < entryMax ) {
276 
277  const DTTPGParametersId& chan = dataList[entryNum].first;
278 
279  chanKey.clear();
280  chanKey.push_back( chan. wheelId );
281  chanKey.push_back( chan.stationId );
282  chanKey.push_back( chan. sectorId );
283  dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ );
284 
285  }
286 
287  return;
288 
289 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
int insert(ElementKey fKey, ElementKey lKey, Content cont)
std::vector< std::pair< DTTPGParametersId, DTTPGParametersData > > dataList
std::string DTTPGParameters::mapName ( ) const
private

Definition at line 260 of file DTTPGParameters.cc.

References dataVersion, and mergeVDriftHistosByStation::name.

260  {
261  std::stringstream name;
262  name << dataVersion << "_map_TTPG" << this;
263  return name.str();
264 }
std::string dataVersion
DTTPGParameters & DTTPGParameters::operator= ( DTTPGParameters const &  rhs)

Definition at line 50 of file DTTPGParameters.cc.

References clockLength, dataList, dataVersion, initialize(), and nsPerCount.

50  {
51  if (this != &rhs) {
52  dataVersion = rhs.dataVersion;
53  nsPerCount = rhs.nsPerCount;
54  clockLength = rhs.clockLength;
55  dataList = rhs.dataList;
56  initialize();
57  }
58  return *this;
59 }
std::string dataVersion
std::vector< std::pair< DTTPGParametersId, DTTPGParametersData > > dataList
template<class Archive >
void DTTPGParameters::serialize ( Archive &  ar,
const unsigned int  version 
)
private
int DTTPGParameters::set ( int  wheelId,
int  stationId,
int  sectorId,
int  nc,
float  ph,
DTTimeUnits::type  unit 
)

Definition at line 184 of file DTTPGParameters.cc.

References data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), relval_steps::key, DTTPGParametersData::nClock, DTTimeUnits::ns, nsPerCount, edm::second(), DTTPGParametersId::stationId, and DTTPGParametersData::tPhase.

Referenced by DTConfigTrivialProducer::buildTrivialPedestals(), DTConfigDBProducer::buildTrivialPedestals(), DTLocalTriggerSynchTest::dqmEndJob(), betterConfigParser.BetterConfigParser::getGeneral(), DTTPGParametersHandler::getNewObjects(), and set().

189  {
190 
191  if ( unit == DTTimeUnits::ns ) {
192  ph /= nsPerCount;
193  }
194 
195  std::vector<int> chanKey;
196  chanKey.reserve(3);
197  chanKey.push_back( wheelId );
198  chanKey.push_back( stationId );
199  chanKey.push_back( sectorId );
200  int ientry;
201  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
202 
203  if ( !searchStatus ) {
205  data.nClock = nc;
206  data.tPhase = ph;
207  return -1;
208  }
209  else {
211  key. wheelId = wheelId;
212  key.stationId = stationId;
213  key. sectorId = sectorId;
215  data.nClock = nc;
216  data.tPhase = ph;
217  ientry = dataList.size();
218  dataList.push_back( std::pair<DTTPGParametersId,
219  DTTPGParametersData>( key, data ) );
220  dBuf->insert( chanKey.begin(), chanKey.end(), ientry );
221  return 0;
222  }
223 
224  return 99;
225 
226 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int insert(ElementKey fKey, ElementKey lKey, Content cont)
float unit() const
std::vector< std::pair< DTTPGParametersId, DTTPGParametersData > > dataList
int DTTPGParameters::set ( const DTChamberId id,
int  nc,
float  ph,
DTTimeUnits::type  unit 
)

Definition at line 229 of file DTTPGParameters.cc.

References set(), and relativeConstraints::station.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

232  {
233  return set( id.wheel(),
234  id.station(),
235  id.sector(),
236  nc, ph, unit );
237 }
int set(int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
float unit() const
void DTTPGParameters::setClock ( int  clock)

Definition at line 240 of file DTTPGParameters.cc.

References clock(), and clockLength.

240  {
241  clockLength = clock;
242 }
int clock() const
void DTTPGParameters::setUnit ( float  unit)

Definition at line 245 of file DTTPGParameters.cc.

References nsPerCount, and unit().

245  {
246  nsPerCount = unit;
247 }
float unit() const
float DTTPGParameters::totalTime ( int  wheelId,
int  stationId,
int  sectorId,
DTTimeUnits::type  unit 
) const

Definition at line 135 of file DTTPGParameters.cc.

References GetRecoTauVFromDQM_MC_cff::cl, clock(), DTTimeUnits::ns, nsPerCount, and unit().

Referenced by totalTime().

138  {
139  int cl = 0;
140  float ph = 0.0;
141  get( wheelId, stationId, sectorId, cl, ph, unit );
142  if ( unit == DTTimeUnits::ns ) return ( cl * clock() * nsPerCount ) + ph;
143  else return ( cl * clock() ) + ph;
144 }
int clock() const
float unit() const
float DTTPGParameters::totalTime ( const DTChamberId id,
DTTimeUnits::type  unit 
) const

Definition at line 147 of file DTTPGParameters.cc.

References relativeConstraints::station, and totalTime().

148  {
149  return totalTime( id.wheel(),
150  id.station(),
151  id.sector(),
152  unit );
153 }
float totalTime(int wheelId, int stationId, int sectorId, DTTimeUnits::type unit) const
float unit() const
float DTTPGParameters::unit ( ) const

Definition at line 161 of file DTTPGParameters.cc.

References nsPerCount.

Referenced by get(), setUnit(), and totalTime().

161  {
162  return nsPerCount;
163 }
const std::string & DTTPGParameters::version ( ) const

access version

Definition at line 167 of file DTTPGParameters.cc.

References dataVersion.

167  {
168  return dataVersion;
169 }
std::string dataVersion
std::string & DTTPGParameters::version ( )

Definition at line 172 of file DTTPGParameters.cc.

References dataVersion.

172  {
173  return dataVersion;
174 }
std::string dataVersion

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 152 of file DTTPGParameters.h.

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

Definition at line 152 of file DTTPGParameters.h.

Member Data Documentation

int DTTPGParameters::clockLength
private

Definition at line 143 of file DTTPGParameters.h.

Referenced by clock(), operator=(), and setClock().

std::vector< std::pair<DTTPGParametersId,DTTPGParametersData> > DTTPGParameters::dataList
private

Definition at line 145 of file DTTPGParameters.h.

Referenced by begin(), clear(), DTTPGParameters(), end(), get(), initialize(), operator=(), and set().

std::string DTTPGParameters::dataVersion
private

Definition at line 141 of file DTTPGParameters.h.

Referenced by mapName(), operator=(), and version().

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

Definition at line 147 of file DTTPGParameters.h.

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

float DTTPGParameters::nsPerCount
private

Definition at line 142 of file DTTPGParameters.h.

Referenced by get(), operator=(), set(), setUnit(), totalTime(), and unit().