CMS 3D CMS Logo

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

#include <DTTtrig.h>

Public Types

typedef std::vector< std::pair< DTTtrigId, DTTtrigData > >::const_iterator const_iterator
 Access methods to data. More...
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 reset content More...
 
 DTTtrig ()
 
 DTTtrig (const std::string &version)
 
const_iterator end () const
 
int get (const DetId &id, float &tTrig, DTTimeUnits::type unit) const
 
int get (const DetId &id, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 
int get (const DTSuperLayerId &id, float &tTrig, DTTimeUnits::type unit) const
 
int get (const DTSuperLayerId &id, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int slId, float &tTrig, DTTimeUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 get content More...
 
int get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &tTrig, DTTimeUnits::type unit) const
 
int get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 
void initialize ()
 
int set (const DetId &id, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
int set (const DTSuperLayerId &id, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
int set (int wheelId, int stationId, int sectorId, int slId, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
int set (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
void setUnit (float unit)
 
float unit () const
 
std::string & version ()
 
const std::string & version () const
 access version More...
 
 ~DTTtrig ()
 

Private Member Functions

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

Private Attributes

std::vector< std::pair< DTTtrigId, DTTtrigData > > 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 TTrigs ( SL by SL time offsets )

Author
Paolo Ronchese INFN Padova

Definition at line 68 of file DTTtrig.h.

Member Typedef Documentation

◆ const_iterator

typedef std::vector<std::pair<DTTtrigId, DTTtrigData> >::const_iterator DTTtrig::const_iterator

Access methods to data.

Definition at line 139 of file DTTtrig.h.

Constructor & Destructor Documentation

◆ DTTtrig() [1/3]

DTTtrig::DTTtrig ( )

Constructor

Definition at line 34 of file DTTtrig.cc.

34  : dataVersion(" "), nsPerCount(25.0 / 32.0), dBuf(new DTBufferTree<int, int>) {
35  dataList.reserve(1000);
36 }

References dataList.

◆ DTTtrig() [2/3]

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

Definition at line 38 of file DTTtrig.cc.

40  dataList.reserve(1000);
41 }

References dataList.

◆ ~DTTtrig()

DTTtrig::~DTTtrig ( )

Destructor

Definition at line 50 of file DTTtrig.cc.

50 {}

◆ DTTtrig() [3/3]

DTTtrig::DTTtrig ( DTTtrig const &  )
privatedelete

Member Function Documentation

◆ begin()

DTTtrig::const_iterator DTTtrig::begin ( void  ) const

Definition at line 250 of file DTTtrig.cc.

250 { return dataList.begin(); }

References dataList.

Referenced by DTtTrigDBValidation::bookHistograms().

◆ clear()

void DTTtrig::clear ( void  )

reset content

Definition at line 166 of file DTTtrig.cc.

166  {
167  dataList.clear();
168  initialize();
169  return;
170 }

References dataList, and initialize().

Referenced by BeautifulSoup.Tag::setString().

◆ end()

DTTtrig::const_iterator DTTtrig::end ( void  ) const

Definition at line 252 of file DTTtrig.cc.

252 { return dataList.end(); }

References dataList.

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

◆ get() [1/8]

int DTTtrig::get ( const DetId id,
float &  tTrig,
DTTimeUnits::type  unit 
) const

◆ get() [2/8]

int DTTtrig::get ( const DetId id,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const

◆ get() [3/8]

int DTTtrig::get ( const DTSuperLayerId id,
float &  tTrig,
DTTimeUnits::type  unit 
) const

◆ get() [4/8]

int DTTtrig::get ( const DTSuperLayerId id,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const

◆ get() [5/8]

int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  tTrig,
DTTimeUnits::type  unit 
) const

◆ get() [6/8]

int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const

◆ get() [7/8]

int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  tTrig,
DTTimeUnits::type  unit 
) const

◆ get() [8/8]

int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const

Definition at line 70 of file DTTtrig.cc.

79  {
80  tTrig = tTrms = kFact = 0.0;
81 
82  std::vector<int> chanKey;
83  chanKey.reserve(6);
84  chanKey.push_back(wheelId);
85  chanKey.push_back(stationId);
86  chanKey.push_back(sectorId);
87  chanKey.push_back(slId);
88  chanKey.push_back(layerId);
89  chanKey.push_back(cellId);
90  int ientry;
91  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
92  if (!searchStatus) {
93  const DTTtrigData& data(dataList[ientry].second);
94  tTrig = data.tTrig;
95  tTrms = data.tTrms;
96  kFact = data.kFact;
97  if (unit == DTTimeUnits::ns) {
98  tTrig *= nsPerCount;
99  tTrms *= nsPerCount;
100  }
101  }
102 
103  return searchStatus;
104 }

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

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

◆ initialize()

void DTTtrig::initialize ( )

Definition at line 260 of file DTTtrig.cc.

260  {
261  dBuf->clear();
262 
263  int entryNum = 0;
264  int entryMax = dataList.size();
265  std::vector<int> chanKey;
266  chanKey.reserve(6);
267  while (entryNum < entryMax) {
268  const DTTtrigId& chan = dataList[entryNum].first;
269 
270  chanKey.clear();
271  chanKey.push_back(chan.wheelId);
272  chanKey.push_back(chan.stationId);
273  chanKey.push_back(chan.sectorId);
274  chanKey.push_back(chan.slId);
275  chanKey.push_back(chan.layerId);
276  chanKey.push_back(chan.cellId);
277  dBuf->insert(chanKey.begin(), chanKey.end(), entryNum++);
278  }
279  return;
280 }

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

Referenced by clear().

◆ mapName()

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

Definition at line 254 of file DTTtrig.cc.

254  {
255  std::stringstream name;
256  name << dataVersion << "_map_Ttrig" << this;
257  return name.str();
258 }

References dataVersion, and Skims_PA_cff::name.

◆ operator=()

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

◆ serialize()

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

◆ set() [1/4]

int DTTtrig::set ( const DetId id,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 234 of file DTTtrig.cc.

234  {
235  DTWireId wireId(id.rawId());
236  return set(wireId.wheel(),
237  wireId.station(),
238  wireId.sector(),
239  wireId.superLayer(),
240  wireId.layer(),
241  wireId.wire(),
242  tTrig,
243  tTrms,
244  kFact,
245  unit);
246 }

References DTLayerId::layer(), DTChamberId::sector(), set(), DTChamberId::station(), DTSuperLayerId::superLayer(), dttriganalyzer_cfi::tTrig, unit(), DTChamberId::wheel(), and DTWireId::wire().

◆ set() [2/4]

int DTTtrig::set ( const DTSuperLayerId id,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 230 of file DTTtrig.cc.

230  {
231  return set(id.wheel(), id.station(), id.sector(), id.superLayer(), 0, 0, tTrig, tTrms, kFact, unit);
232 }

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

◆ set() [3/4]

int DTTtrig::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 172 of file DTTtrig.cc.

173  {
174  return set(wheelId, stationId, sectorId, slId, 0, 0, tTrig, tTrms, kFact, unit);
175 }

References dttriganalyzer_cfi::tTrig, and unit().

Referenced by DTTTrigCorrectionFirst::endJob(), DTTTrigCorrection::endJob(), and set().

◆ set() [4/4]

int DTTtrig::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 177 of file DTTtrig.cc.

186  {
187  if (unit == DTTimeUnits::ns) {
188  tTrig /= nsPerCount;
189  tTrms /= nsPerCount;
190  }
191 
192  std::vector<int> chanKey;
193  chanKey.reserve(6);
194  chanKey.push_back(wheelId);
195  chanKey.push_back(stationId);
196  chanKey.push_back(sectorId);
197  chanKey.push_back(slId);
198  chanKey.push_back(layerId);
199  chanKey.push_back(cellId);
200  int ientry;
201  int searchStatus = dBuf->find(chanKey.begin(), chanKey.end(), ientry);
202 
203  if (!searchStatus) {
204  DTTtrigData& data(dataList[ientry].second);
205  data.tTrig = tTrig;
206  data.tTrms = tTrms;
207  data.kFact = kFact;
208  return -1;
209  } else {
210  DTTtrigId key;
211  key.wheelId = wheelId;
212  key.stationId = stationId;
213  key.sectorId = sectorId;
214  key.slId = slId;
215  key.layerId = layerId;
216  key.cellId = cellId;
218  data.tTrig = tTrig;
219  data.tTrms = tTrms;
220  data.kFact = kFact;
221  ientry = dataList.size();
222  dataList.push_back(std::pair<DTTtrigId, DTTtrigData>(key, data));
223  dBuf->insert(chanKey.begin(), chanKey.end(), ientry);
224  return 0;
225  }
226 
227  return 99;
228 }

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

◆ setUnit()

void DTTtrig::setUnit ( float  unit)

Definition at line 248 of file DTTtrig.cc.

248 { nsPerCount = unit; }

References nsPerCount, and unit().

◆ unit()

float DTTtrig::unit ( ) const

Definition at line 160 of file DTTtrig.cc.

160 { return nsPerCount; }

References nsPerCount.

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

◆ version() [1/2]

std::string & DTTtrig::version ( )

Definition at line 164 of file DTTtrig.cc.

164 { return dataVersion; }

References dataVersion.

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

◆ version() [2/2]

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 158 of file DTTtrig.h.

◆ cond::serialization::access

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

Definition at line 158 of file DTTtrig.h.

Member Data Documentation

◆ dataList

std::vector<std::pair<DTTtrigId, DTTtrigData> > DTTtrig::dataList
private

Definition at line 152 of file DTTtrig.h.

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

◆ dataVersion

std::string DTTtrig::dataVersion
private

Definition at line 149 of file DTTtrig.h.

Referenced by mapName(), and version().

◆ dBuf

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

Definition at line 154 of file DTTtrig.h.

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

◆ nsPerCount

float DTTtrig::nsPerCount
private

Definition at line 150 of file DTTtrig.h.

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

DTTtrig::unit
float unit() const
Definition: DTTtrig.cc:160
DTTtrig::version
const std::string & version() const
access version
Definition: DTTtrig.cc:162
DTTtrig::nsPerCount
float nsPerCount
Definition: DTTtrig.h:150
DTTtrigData
Definition: DTTtrig.h:56
DTTtrigId
Definition: DTTtrig.h:41
mps_update.status
status
Definition: mps_update.py:69
relativeConstraints.station
station
Definition: relativeConstraints.py:67
dttriganalyzer_cfi.tTrig
tTrig
Definition: dttriganalyzer_cfi.py:11
DTBufferTree::clear
void clear()
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
DTTtrig::dBuf
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:154
DTTtrig::dataList
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:152
DTBufferTree::insert
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTWireId
Definition: DTWireId.h:12
DTTimeUnits::ns
Definition: DTTimeUnits.h:32
DTTtrig::get
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
Definition: DTTtrig.cc:59
DTTtrig::initialize
void initialize()
Definition: DTTtrig.cc:260
DTTtrig::dataVersion
std::string dataVersion
Definition: DTTtrig.h:149
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTBufferTree< int, int >
DTTtrig::set
int set(int wheelId, int stationId, int sectorId, int slId, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
Definition: DTTtrig.cc:172
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
DTBufferTree::find
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
crabWrapper.key
key
Definition: crabWrapper.py:19