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 (DTTtrig const &)=delete
 
 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 ()
 
DTTtrigoperator= (DTTtrig const &)=delete
 
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

std::string mapName () const
 
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 141 of file DTTtrig.h.

Constructor & Destructor Documentation

◆ DTTtrig() [1/3]

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:149
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:151
std::string dataVersion
Definition: DTTtrig.h:148
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:153

◆ DTTtrig() [2/3]

DTTtrig::DTTtrig ( DTTtrig const &  )
delete

◆ DTTtrig() [3/3]

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:149
const std::string & version() const
access version
Definition: DTTtrig.cc:162
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:151
std::string dataVersion
Definition: DTTtrig.h:148
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:153

◆ ~DTTtrig()

DTTtrig::~DTTtrig ( )

Destructor

Definition at line 50 of file DTTtrig.cc.

50 {}

Member Function Documentation

◆ begin()

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

Definition at line 250 of file DTTtrig.cc.

References dataList.

Referenced by DTtTrigDBValidation::bookHistograms().

250 { return dataList.begin(); }
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:151

◆ clear()

void DTTtrig::clear ( void  )

reset content

Definition at line 166 of file DTTtrig.cc.

References dataList, and initialize().

Referenced by BeautifulSoup.Tag::setString().

166  {
167  dataList.clear();
168  initialize();
169  return;
170 }
void initialize()
Definition: DTTtrig.cc:260
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:151

◆ end()

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

Definition at line 252 of file DTTtrig.cc.

References dataList.

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

252 { return dataList.end(); }
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:151

◆ get() [1/8]

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 dttriganalyzer_cfi::tTrig, and unit().

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), DTNoiseCalibration::analyze(), DTDigiTask::analyze(), DTtTrigDBValidation::bookHistograms(), DTNoiseTask::bookHistograms(), rrapi.RRApi::columns(), util.rrapi.RRApi::columns(), dtCalibration::DTTTrigFillWithAverage::correction(), dtCalibration::DTTTrigConstantShift::correction(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), DTTTrigSyncFromDB::emulatorOffset(), DTTTrigCorrectionFirst::endJob(), DTTTrigCorrection::endJob(), DTTTrigOffsetCalibration::endJob(), dtCalibration::DTTTrigFillWithAverage::getAverage(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.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(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.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

◆ get() [2/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.

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(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), 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(), 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:149
U second(std::pair< T, U > const &p)
float unit() const
Definition: DTTtrig.cc:160
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:151
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:153
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ get() [3/8]

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

◆ get() [4/8]

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

Definition at line 110 of file DTTtrig.cc.

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

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), 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(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

110  {
111  DTWireId wireId(id.rawId());
112  return get(wireId.wheel(),
113  wireId.station(),
114  wireId.sector(),
115  wireId.superLayer(),
116  wireId.layer(),
117  wireId.wire(),
118  tTrig,
119  tTrms,
120  kFact,
121  unit);
122 }
float unit() const
Definition: DTTtrig.cc:160

◆ 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,
int  layerId,
int  cellId,
float &  tTrig,
DTTimeUnits::type  unit 
) const

◆ get() [7/8]

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

◆ get() [8/8]

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

◆ initialize()

void DTTtrig::initialize ( )

Definition at line 260 of file DTTtrig.cc.

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

Referenced by clear().

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 }
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:151
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:153
int insert(ElementKey fKey, ElementKey lKey, Content cont)

◆ mapName()

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

Definition at line 254 of file DTTtrig.cc.

References dataVersion, and 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:148

◆ operator=()

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

◆ serialize()

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

◆ set() [1/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.

References dttriganalyzer_cfi::tTrig, and unit().

Referenced by DTTTrigWriter::analyze(), DTTTrigCorrectionFirst::endJob(), and DTTTrigCorrection::endJob().

173  {
174  return set(wheelId, stationId, sectorId, slId, 0, 0, tTrig, tTrms, kFact, unit);
175 }
float unit() const
Definition: DTTtrig.cc:160

◆ set() [2/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.

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

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 }
float nsPerCount
Definition: DTTtrig.h:149
U second(std::pair< T, U > const &p)
float unit() const
Definition: DTTtrig.cc:160
std::vector< std::pair< DTTtrigId, DTTtrigData > > dataList
Definition: DTTtrig.h:151
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTTtrig.h:153
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int insert(ElementKey fKey, ElementKey lKey, Content cont)

◆ set() [3/4]

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

Definition at line 230 of file DTTtrig.cc.

References dttriganalyzer_cfi::tTrig, 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

◆ set() [4/4]

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

Definition at line 234 of file DTTtrig.cc.

References DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), dttriganalyzer_cfi::tTrig, 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

◆ setUnit()

void DTTtrig::setUnit ( float  unit)

Definition at line 248 of file DTTtrig.cc.

References nsPerCount, and unit().

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

◆ unit()

float DTTtrig::unit ( ) const

Definition at line 160 of file DTTtrig.cc.

References nsPerCount.

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

160 { return nsPerCount; }
float nsPerCount
Definition: DTTtrig.h:149

◆ version() [1/2]

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

access version

Definition at line 162 of file DTTtrig.cc.

References dataVersion.

Referenced by DTtTrigDBValidation::bookHistograms(), validation.Sample::datasetpattern(), validation.Sample::filename(), and DTTTrigSyncFromDB::setES().

162 { return dataVersion; }
std::string dataVersion
Definition: DTTtrig.h:148

◆ version() [2/2]

std::string & DTTtrig::version ( )

Definition at line 164 of file DTTtrig.cc.

References dataVersion.

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

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 157 of file DTTtrig.h.

◆ cond::serialization::access

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

Definition at line 157 of file DTTtrig.h.

Member Data Documentation

◆ dataList

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

Definition at line 151 of file DTTtrig.h.

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

◆ dataVersion

std::string DTTtrig::dataVersion
private

Definition at line 148 of file DTTtrig.h.

Referenced by mapName(), and version().

◆ dBuf

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

Definition at line 153 of file DTTtrig.h.

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

◆ nsPerCount

float DTTtrig::nsPerCount
private

Definition at line 149 of file DTTtrig.h.

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