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 (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, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 
int get (const DTSuperLayerId &id, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
 
int get (const DetId &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, int layerId, int cellId, float &tTrig, DTTimeUnits::type unit) const
 
int get (const DTSuperLayerId &id, float &tTrig, DTTimeUnits::type unit) const
 
int get (const DetId &id, float &tTrig, DTTimeUnits::type unit) const
 
void initialize ()
 
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)
 
int set (const DTSuperLayerId &id, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
int set (const DetId &id, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit)
 
void setUnit (float unit)
 
float unit () const
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
 ~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

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

Constructor

Definition at line 34 of file DTTtrig.cc.

References dataList.

34  : dataVersion(" "), nsPerCount(25.0 / 32.0), dBuf(new DTBufferTree<int, int>) {
35  dataList.reserve(1000);
36 }
float nsPerCount
Definition: DTTtrig.h:150
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:152
std::string dataVersion
Definition: DTTtrig.h:149
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:154
DTTtrig::DTTtrig ( const std::string &  version)

Definition at line 38 of file DTTtrig.cc.

References dataList.

40  dataList.reserve(1000);
41 }
float nsPerCount
Definition: DTTtrig.h:150
const std::string & version() const
access version
Definition: DTTtrig.cc:162
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:152
std::string dataVersion
Definition: DTTtrig.h:149
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:154
DTTtrig::~DTTtrig ( )

Destructor

Definition at line 50 of file DTTtrig.cc.

50 {}
DTTtrig::DTTtrig ( DTTtrig const &  )
privatedelete

Member Function Documentation

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

Definition at line 250 of file DTTtrig.cc.

Referenced by DTtTrigDBValidation::bookHistograms(), DTTTrigCalibration::dumpTTrigMap(), and DTTTrigCalibration::plotTTrig().

250 { return dataList.begin(); }
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:152
void DTTtrig::clear ( void  )
DTTtrig::const_iterator DTTtrig::end ( void  ) const

Definition at line 252 of file DTTtrig.cc.

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

252 { return dataList.end(); }
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:152
int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const

get content

Operations

Definition at line 59 of file DTTtrig.cc.

References DTTtrigData::kFact, DTTtrigData::tTrig, DTTtrigData::tTrms, and unit().

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), DTNoiseCalibration::analyze(), DTtTrigDBValidation::bookHistograms(), DTNoiseTask::bookHistograms(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), dtCalibration::DTTTrigFillWithAverage::correction(), dtCalibration::DTTTrigConstantShift::correction(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), util.rrapi.RRApi::data(), rrapi.RRApi::data(), DTTTrigSyncFromDB::emulatorOffset(), DTTTrigOffsetCalibration::endJob(), DTTTrigCorrection::endJob(), dtCalibration::DTTTrigFillWithAverage::getAverage(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), DTTTrigSyncFromDB::offset(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), util.rrapi.RRApi::reports(), rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), util.rrapi.RRApi::templates(), rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

66  {
67  return get(wheelId, stationId, sectorId, slId, 0, 0, tTrig, tTrms, kFact, unit);
68 }
float unit() const
Definition: DTTtrig.cc:160
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.

References data, DTTtrigData::kFact, DTTimeUnits::ns, edm::second(), DTTtrigData::tTrig, and DTTtrigData::tTrms.

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

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 }
float nsPerCount
Definition: DTTtrig.h:150
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:152
float unit() const
Definition: DTTtrig.cc:160
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:154
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int DTTtrig::get ( const DTSuperLayerId id,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( const DetId id,
float &  tTrig,
float &  tTrms,
float &  kFact,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
float &  tTrig,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  tTrig,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( const DTSuperLayerId id,
float &  tTrig,
DTTimeUnits::type  unit 
) const
int DTTtrig::get ( const DetId id,
float &  tTrig,
DTTimeUnits::type  unit 
) const
void DTTtrig::initialize ( )

Definition at line 260 of file DTTtrig.cc.

References DTTtrigId::cellId, officialStyle::chan, DTTtrigId::layerId, DTTtrigId::sectorId, DTTtrigId::slId, DTTtrigId::stationId, and DTTtrigId::wheelId.

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 }
int wheelId
Definition: DTTtrig.h:46
int stationId
Definition: DTTtrig.h:47
int sectorId
Definition: DTTtrig.h:48
int cellId
Definition: DTTtrig.h:51
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:152
int slId
Definition: DTTtrig.h:49
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:154
int insert(ElementKey fKey, ElementKey lKey, Content cont)
int layerId
Definition: DTTtrig.h:50
std::string DTTtrig::mapName ( ) const
private

Definition at line 254 of file DTTtrig.cc.

References Skims_PA_cff::name.

254  {
255  std::stringstream name;
256  name << dataVersion << "_map_Ttrig" << this;
257  return name.str();
258 }
std::string dataVersion
Definition: DTTtrig.h:149
DTTtrig& DTTtrig::operator= ( DTTtrig const &  )
privatedelete
template<class Archive >
void DTTtrig::serialize ( Archive &  ar,
const unsigned int  version 
)
private
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.

References DTTtrigData::kFact, DTTtrigData::tTrig, DTTtrigData::tTrms, and unit().

Referenced by DTTTrigCorrectionFirst::endJob(), DTTTrigOffsetCalibration::endJob(), DTTTrigCorrection::endJob(), and DTTTrigCalibration::endJob().

173  {
174  return set(wheelId, stationId, sectorId, slId, 0, 0, tTrig, tTrms, kFact, unit);
175 }
float unit() const
Definition: DTTtrig.cc:160
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.

References DTTtrigId::cellId, data, crabWrapper::key, DTTtrigData::kFact, DTTtrigId::layerId, DTTimeUnits::ns, edm::second(), DTTtrigId::sectorId, DTTtrigId::slId, DTTtrigId::stationId, DTTtrigData::tTrig, DTTtrigData::tTrms, and DTTtrigId::wheelId.

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 }
int wheelId
Definition: DTTtrig.h:46
float nsPerCount
Definition: DTTtrig.h:150
float tTrms
Definition: DTTtrig.h:62
int stationId
Definition: DTTtrig.h:47
int sectorId
Definition: DTTtrig.h:48
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
U second(std::pair< T, U > const &p)
int cellId
Definition: DTTtrig.h:51
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:152
float unit() const
Definition: DTTtrig.cc:160
float kFact
Definition: DTTtrig.h:63
float tTrig
Definition: DTTtrig.h:61
int slId
Definition: DTTtrig.h:49
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:154
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int insert(ElementKey fKey, ElementKey lKey, Content cont)
int layerId
Definition: DTTtrig.h:50
int DTTtrig::set ( const DTSuperLayerId id,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 230 of file DTTtrig.cc.

References DTTtrigData::kFact, DTTtrigData::tTrig, DTTtrigData::tTrms, and unit().

230  {
231  return set(id.wheel(), id.station(), id.sector(), id.superLayer(), 0, 0, tTrig, tTrms, kFact, unit);
232 }
float unit() const
Definition: DTTtrig.cc:160
int DTTtrig::set ( const DetId id,
float  tTrig,
float  tTrms,
float  kFact,
DTTimeUnits::type  unit 
)

Definition at line 234 of file DTTtrig.cc.

References DTTtrigData::kFact, DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), DTTtrigData::tTrig, DTTtrigData::tTrms, unit(), DTChamberId::wheel(), and DTWireId::wire().

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 }
float unit() const
Definition: DTTtrig.cc:160
void DTTtrig::setUnit ( float  unit)

Definition at line 248 of file DTTtrig.cc.

References unit().

248 { nsPerCount = unit; }
float nsPerCount
Definition: DTTtrig.h:150
float unit() const
Definition: DTTtrig.cc:160
float DTTtrig::unit ( ) const

Definition at line 160 of file DTTtrig.cc.

160 { return nsPerCount; }
float nsPerCount
Definition: DTTtrig.h:150
const std::string & DTTtrig::version ( ) const
std::string & DTTtrig::version ( )

Definition at line 164 of file DTTtrig.cc.

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

164 { return dataVersion; }
std::string dataVersion
Definition: DTTtrig.h:149

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 158 of file DTTtrig.h.

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

Definition at line 158 of file DTTtrig.h.

Member Data Documentation

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

Definition at line 152 of file DTTtrig.h.

Referenced by DTTtrig().

std::string DTTtrig::dataVersion
private

Definition at line 149 of file DTTtrig.h.

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

Definition at line 154 of file DTTtrig.h.

float DTTtrig::nsPerCount
private

Definition at line 150 of file DTTtrig.h.