CMS 3D CMS Logo

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 (const DTChamberId &id, int &nc, float &ph, DTTimeUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int &nc, float &ph, DTTimeUnits::type unit) const
 get content More...
 
void initialize ()
 
DTTPGParametersoperator= (DTTPGParameters const &)
 
int set (const DTChamberId &id, int nc, float ph, DTTimeUnits::type unit)
 
int set (int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
 
void setClock (int clock)
 
void setUnit (float unit)
 
float totalTime (const DTChamberId &id, DTTimeUnits::type unit) const
 
float totalTime (int wheelId, int stationId, int sectorId, DTTimeUnits::type unit) const
 
float unit () const
 
std::string & version ()
 
const std::string & version () const
 access version More...
 
 ~DTTPGParameters ()
 

Private Member Functions

 DTTPGParameters (DTTPGParameters const &)=delete
 
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 62 of file DTTPGParameters.h.

Member Typedef Documentation

◆ const_iterator

Access methods to data.

Definition at line 96 of file DTTPGParameters.h.

Constructor & Destructor Documentation

◆ DTTPGParameters() [1/3]

DTTPGParameters::DTTPGParameters ( )

Constructor

Definition at line 31 of file DTTPGParameters.cc.

32  : dataVersion(" "), nsPerCount(25.0 / 32.0), clockLength(32), dBuf(new DTBufferTree<int, int>) {
33  dataList.reserve(250);
34 }

References dataList.

◆ DTTPGParameters() [2/3]

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

Definition at line 36 of file DTTPGParameters.cc.

38  dataList.reserve(250);
39 }

References dataList.

◆ ~DTTPGParameters()

DTTPGParameters::~DTTPGParameters ( )

Destructor

Definition at line 59 of file DTTPGParameters.cc.

59 {}

◆ DTTPGParameters() [3/3]

DTTPGParameters::DTTPGParameters ( DTTPGParameters const &  )
privatedelete

Member Function Documentation

◆ begin()

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

Definition at line 166 of file DTTPGParameters.cc.

166 { return dataList.begin(); }

References dataList.

Referenced by DTLocalTriggerSynchTest::dqmEndJob().

◆ clear()

void DTTPGParameters::clear ( void  )

reset content

Definition at line 117 of file DTTPGParameters.cc.

117  {
118  dataList.clear();
119  initialize();
120  return;
121 }

References dataList, and initialize().

Referenced by BeautifulSoup.Tag::setString().

◆ clock()

int DTTPGParameters::clock ( ) const

Definition at line 109 of file DTTPGParameters.cc.

109 { return clockLength; }

References clockLength.

Referenced by setClock(), and totalTime().

◆ end()

DTTPGParameters::const_iterator DTTPGParameters::end ( void  ) const

Definition at line 168 of file DTTPGParameters.cc.

168 { return dataList.end(); }

References dataList.

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

◆ get() [1/2]

int DTTPGParameters::get ( const DTChamberId id,
int &  nc,
float &  ph,
DTTimeUnits::type  unit 
) const

◆ get() [2/2]

int DTTPGParameters::get ( int  wheelId,
int  stationId,
int  sectorId,
int &  nc,
float &  ph,
DTTimeUnits::type  unit 
) const

get content

Operations

Definition at line 68 of file DTTPGParameters.cc.

68  {
69  nc = 0;
70  ph = 0.0;
71 
72  std::vector<int> chanKey;
73  chanKey.reserve(3);
74  chanKey.push_back(wheelId);
75  chanKey.push_back(stationId);
76  chanKey.push_back(sectorId);
77  int ientry;
78  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
79  if (!searchStatus) {
80  const DTTPGParametersData& data(dataList[ientry].second);
81  nc = data.nClock;
82  ph = data.tPhase;
83  if (unit == DTTimeUnits::ns) {
84  ph *= nsPerCount;
85  }
86  }
87 
88  return searchStatus;
89 }

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

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(), DTConfigPedestals::getOffset(), betterConfigParser.BetterConfigParser::getResultingSection(), DTConfigPedestals::print(), 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(), totalTime(), rrapi.RRApi::workspaces(), and util.rrapi.RRApi::workspaces().

◆ initialize()

void DTTPGParameters::initialize ( )

Definition at line 176 of file DTTPGParameters.cc.

176  {
177  dBuf->clear();
178 
179  int entryNum = 0;
180  int entryMax = dataList.size();
181  std::vector<int> chanKey;
182  chanKey.reserve(3);
183  while (entryNum < entryMax) {
184  const DTTPGParametersId& chan = dataList[entryNum].first;
185 
186  chanKey.clear();
187  chanKey.push_back(chan.wheelId);
188  chanKey.push_back(chan.stationId);
189  chanKey.push_back(chan.sectorId);
190  dBuf->insert(chanKey.begin(), chanKey.end(), entryNum++);
191  }
192 
193  return;
194 }

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

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

◆ mapName()

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

Definition at line 170 of file DTTPGParameters.cc.

170  {
171  std::stringstream name;
172  name << dataVersion << "_map_TTPG" << this;
173  return name.str();
174 }

References dataVersion, and Skims_PA_cff::name.

◆ operator=()

DTTPGParameters & DTTPGParameters::operator= ( DTTPGParameters const &  rhs)

Definition at line 41 of file DTTPGParameters.cc.

41  {
42  if (this != &rhs) {
43  dataVersion = rhs.dataVersion;
44  nsPerCount = rhs.nsPerCount;
45  clockLength = rhs.clockLength;
46  dataList = rhs.dataList;
47  initialize();
48  }
49  return *this;
50 }

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

◆ serialize()

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

◆ set() [1/2]

int DTTPGParameters::set ( const DTChamberId id,
int  nc,
float  ph,
DTTimeUnits::type  unit 
)

Definition at line 158 of file DTTPGParameters.cc.

158  {
159  return set(id.wheel(), id.station(), id.sector(), nc, ph, unit);
160 }

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

◆ set() [2/2]

int DTTPGParameters::set ( int  wheelId,
int  stationId,
int  sectorId,
int  nc,
float  ph,
DTTimeUnits::type  unit 
)

Definition at line 123 of file DTTPGParameters.cc.

123  {
124  if (unit == DTTimeUnits::ns) {
125  ph /= nsPerCount;
126  }
127 
128  std::vector<int> chanKey;
129  chanKey.reserve(3);
130  chanKey.push_back(wheelId);
131  chanKey.push_back(stationId);
132  chanKey.push_back(sectorId);
133  int ientry;
134  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
135 
136  if (!searchStatus) {
138  data.nClock = nc;
139  data.tPhase = ph;
140  return -1;
141  } else {
143  key.wheelId = wheelId;
144  key.stationId = stationId;
145  key.sectorId = sectorId;
147  data.nClock = nc;
148  data.tPhase = ph;
149  ientry = dataList.size();
150  dataList.push_back(std::pair<DTTPGParametersId, DTTPGParametersData>(key, data));
151  dBuf->insert(chanKey.begin(), chanKey.end(), ientry);
152  return 0;
153  }
154 
155  return 99;
156 }

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

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

◆ setClock()

void DTTPGParameters::setClock ( int  clock)

Definition at line 162 of file DTTPGParameters.cc.

162 { clockLength = clock; }

References clock(), and clockLength.

◆ setUnit()

void DTTPGParameters::setUnit ( float  unit)

Definition at line 164 of file DTTPGParameters.cc.

164 { nsPerCount = unit; }

References nsPerCount, and unit().

◆ totalTime() [1/2]

float DTTPGParameters::totalTime ( const DTChamberId id,
DTTimeUnits::type  unit 
) const

Definition at line 105 of file DTTPGParameters.cc.

105  {
106  return totalTime(id.wheel(), id.station(), id.sector(), unit);
107 }

References relativeConstraints::station, totalTime(), unit(), and makeMuonMisalignmentScenario::wheel.

◆ totalTime() [2/2]

float DTTPGParameters::totalTime ( int  wheelId,
int  stationId,
int  sectorId,
DTTimeUnits::type  unit 
) const

Definition at line 95 of file DTTPGParameters.cc.

95  {
96  int cl = 0;
97  float ph = 0.0;
98  get(wheelId, stationId, sectorId, cl, ph, unit);
99  if (unit == DTTimeUnits::ns)
100  return (cl * clock() * nsPerCount) + ph;
101  else
102  return (cl * clock()) + ph;
103 }

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

Referenced by totalTime().

◆ unit()

float DTTPGParameters::unit ( ) const

Definition at line 111 of file DTTPGParameters.cc.

111 { return nsPerCount; }

References nsPerCount.

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

◆ version() [1/2]

std::string & DTTPGParameters::version ( )

Definition at line 115 of file DTTPGParameters.cc.

115 { return dataVersion; }

References dataVersion.

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

◆ version() [2/2]

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

access version

Definition at line 113 of file DTTPGParameters.cc.

113 { 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 117 of file DTTPGParameters.h.

◆ cond::serialization::access

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

Definition at line 117 of file DTTPGParameters.h.

Member Data Documentation

◆ clockLength

int DTTPGParameters::clockLength
private

Definition at line 109 of file DTTPGParameters.h.

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

◆ dataList

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

Definition at line 111 of file DTTPGParameters.h.

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

◆ dataVersion

std::string DTTPGParameters::dataVersion
private

Definition at line 107 of file DTTPGParameters.h.

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

◆ dBuf

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

Definition at line 113 of file DTTPGParameters.h.

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

◆ nsPerCount

float DTTPGParameters::nsPerCount
private

Definition at line 108 of file DTTPGParameters.h.

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

DTTPGParameters::set
int set(int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
Definition: DTTPGParameters.cc:123
DTTPGParameters::initialize
void initialize()
Definition: DTTPGParameters.cc:176
DTTPGParameters::clock
int clock() const
Definition: DTTPGParameters.cc:109
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
DTTPGParameters::get
int get(int wheelId, int stationId, int sectorId, int &nc, float &ph, DTTimeUnits::type unit) const
get content
Definition: DTTPGParameters.cc:68
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
DTTPGParametersData
Definition: DTTPGParameters.h:51
DTBufferTree::insert
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTTimeUnits::ns
Definition: DTTimeUnits.h:32
DTTPGParameters::nsPerCount
float nsPerCount
Definition: DTTPGParameters.h:108
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTBufferTree< int, int >
DTTPGParameters::version
const std::string & version() const
access version
Definition: DTTPGParameters.cc:113
DTTPGParameters::clockLength
int clockLength
Definition: DTTPGParameters.h:109
DTTPGParameters::dataList
std::vector< std::pair< DTTPGParametersId, DTTPGParametersData > > dataList
Definition: DTTPGParameters.h:111
DTTPGParameters::dBuf
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTPGParameters.h:113
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
DTTPGParameters::unit
float unit() const
Definition: DTTPGParameters.cc:111
DTTPGParameters::dataVersion
std::string dataVersion
Definition: DTTPGParameters.h:107
DTTPGParametersId
Definition: DTTPGParameters.h:39
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DTTPGParameters::totalTime
float totalTime(int wheelId, int stationId, int sectorId, DTTimeUnits::type unit) const
Definition: DTTPGParameters.cc:95
DTBufferTree::find
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
crabWrapper.key
key
Definition: crabWrapper.py:19