CMS 3D CMS Logo

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

#include <SiStripBaseDelay.h>

Classes

struct  Delay
 

Public Types

typedef std::vector< Delay >::const_iterator delayConstIt
 
typedef std::vector< Delay >::iterator delayIt
 

Public Member Functions

uint16_t coarseDelay (const uint32_t detId)
 
double delay (const uint32_t detId) const
 
void delays (std::vector< Delay > &delays) const
 Fill the input container with all the delays. More...
 
uint32_t delaysSize () const
 Get the total number of delays stored (should equal the total number of modules in the SiStripTracker) More...
 
void detIds (std::vector< uint32_t > &detIdVector) const
 Get the list of all detIds for which a delay is stored. More...
 
uint16_t fineDelay (const uint32_t detId) const
 
void printDebug (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 Prints the delays for all the detIds. More...
 
void printSummary (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 Prints the average value of the delays for all layers and wheels in the SiStripTracker. More...
 
bool put (const uint32_t detId, const uint16_t coarseDelay, const uint16_t fineDelay)
 
 SiStripBaseDelay ()
 

Private Member Functions

double makeDelay (const uint16_t coarseDelay, const uint16_t fineDelay) const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< Delaydelays_
 

Friends

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

Detailed Description

Author: M. De Mattia (demat.nosp@m.tia@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t) 25/10/2010:

Base Delay object containing the PLL or time of flight delays.
It stores the values in a vector<Delay>, which is not sorted.
This object can be used directly to access the information on the delays for each detId. However, it is recommended to use the SiStripDelay dependent record which is able to combine multiple BaseDelays and provides a much faster access to the information.

Definition at line 23 of file SiStripBaseDelay.h.

Member Typedef Documentation

◆ delayConstIt

typedef std::vector<Delay>::const_iterator SiStripBaseDelay::delayConstIt

Definition at line 40 of file SiStripBaseDelay.h.

◆ delayIt

typedef std::vector<Delay>::iterator SiStripBaseDelay::delayIt

Definition at line 39 of file SiStripBaseDelay.h.

Constructor & Destructor Documentation

◆ SiStripBaseDelay()

SiStripBaseDelay::SiStripBaseDelay ( )
inline

Definition at line 25 of file SiStripBaseDelay.h.

25 {}

Member Function Documentation

◆ coarseDelay()

uint16_t SiStripBaseDelay::coarseDelay ( const uint32_t  detId)

Definition at line 13 of file SiStripBaseDelay.cc.

References delays_, and x.

Referenced by makeDelay(), and put().

13  {
14  delayConstIt it = std::find_if(delays_.begin(), delays_.end(), [&](auto& x) { return x.detId == detId; });
15  if (it != delays_.end()) {
16  return it->coarseDelay;
17  }
18  return 0;
19 }
std::vector< Delay >::const_iterator delayConstIt
std::vector< Delay > delays_

◆ delay()

double SiStripBaseDelay::delay ( const uint32_t  detId) const

Definition at line 29 of file SiStripBaseDelay.cc.

References delays_, makeDelay(), and x.

29  {
30  delayConstIt it = std::find_if(delays_.begin(), delays_.end(), [&](auto& x) { return x.detId == detId; });
31  if (it != delays_.end()) {
32  return makeDelay(it->coarseDelay, it->fineDelay);
33  }
34  return 0;
35 }
double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
std::vector< Delay >::const_iterator delayConstIt
std::vector< Delay > delays_

◆ delays()

void SiStripBaseDelay::delays ( std::vector< Delay > &  delays) const
inline

Fill the input container with all the delays.

Definition at line 48 of file SiStripBaseDelay.h.

References delays_.

48 { delays = delays_; }
void delays(std::vector< Delay > &delays) const
Fill the input container with all the delays.
std::vector< Delay > delays_

◆ delaysSize()

uint32_t SiStripBaseDelay::delaysSize ( ) const
inline

Get the total number of delays stored (should equal the total number of modules in the SiStripTracker)

Definition at line 54 of file SiStripBaseDelay.h.

References delays_.

54 { return delays_.size(); }
std::vector< Delay > delays_

◆ detIds()

void SiStripBaseDelay::detIds ( std::vector< uint32_t > &  detIdVector) const

Get the list of all detIds for which a delay is stored.

Definition at line 37 of file SiStripBaseDelay.cc.

References delays_.

37  {
38  std::vector<Delay>::const_iterator it = delays_.begin();
39  for (; it != delays_.end(); ++it) {
40  detIdVector.push_back(it->detId);
41  }
42 }
std::vector< Delay > delays_

◆ fineDelay()

uint16_t SiStripBaseDelay::fineDelay ( const uint32_t  detId) const

Definition at line 21 of file SiStripBaseDelay.cc.

References delays_, and x.

Referenced by makeDelay(), and put().

21  {
22  delayConstIt it = std::find_if(delays_.begin(), delays_.end(), [&](auto& x) { return x.detId == detId; });
23  if (it != delays_.end()) {
24  return it->fineDelay;
25  }
26  return 0;
27 }
std::vector< Delay >::const_iterator delayConstIt
std::vector< Delay > delays_

◆ makeDelay()

double SiStripBaseDelay::makeDelay ( const uint16_t  coarseDelay,
const uint16_t  fineDelay 
) const
inlineprivate

Definition at line 62 of file SiStripBaseDelay.h.

References coarseDelay(), and fineDelay().

Referenced by delay(), printDebug(), and printSummary().

62  {
63  return (coarseDelay * 25 + fineDelay * (25 / 24.));
64  }
uint16_t coarseDelay(const uint32_t detId)
uint16_t fineDelay(const uint32_t detId) const

◆ printDebug()

void SiStripBaseDelay::printDebug ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Prints the delays for all the detIds.

Definition at line 55 of file SiStripBaseDelay.cc.

References delays_, makeDelay(), printSummary(), and contentValuesCheck::ss.

55  {
56  printSummary(ss, trackerTopo);
57  delayConstIt it = delays_.begin();
58  ss << std::endl << "All pedestal values:" << std::endl;
59  for (; it != delays_.end(); ++it) {
60  ss << "detId = " << it->detId << " delay = " << makeDelay(it->coarseDelay, it->fineDelay) << std::endl;
61  }
62 }
double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints the average value of the delays for all layers and wheels in the SiStripTracker.
std::vector< Delay >::const_iterator delayConstIt
std::vector< Delay > delays_

◆ printSummary()

void SiStripBaseDelay::printSummary ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Prints the average value of the delays for all layers and wheels in the SiStripTracker.

Definition at line 44 of file SiStripBaseDelay.cc.

References delays_, makeDelay(), and contentValuesCheck::ss.

Referenced by printDebug().

44  {
45  ss << "Total number of delays = " << delays_.size() << std::endl;
46  SiStripDetSummary summaryDelays{trackerTopo};
47  delayConstIt it = delays_.begin();
48  for (; it != delays_.end(); ++it) {
49  summaryDelays.add(it->detId, makeDelay(it->coarseDelay, it->fineDelay));
50  }
51  ss << std::endl << "Summary:" << std::endl;
52  summaryDelays.print(ss);
53 }
double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
std::vector< Delay >::const_iterator delayConstIt
std::vector< Delay > delays_

◆ put()

bool SiStripBaseDelay::put ( const uint32_t  detId,
const uint16_t  coarseDelay,
const uint16_t  fineDelay 
)

Definition at line 8 of file SiStripBaseDelay.cc.

References coarseDelay(), delays_, and fineDelay().

8  {
9  delays_.push_back(Delay(detId, coarseDelay, fineDelay));
10  return true;
11 }
uint16_t coarseDelay(const uint32_t detId)
uint16_t fineDelay(const uint32_t detId) const
std::vector< Delay > delays_

◆ serialize()

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 68 of file SiStripBaseDelay.h.

◆ cond::serialization::access

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

Definition at line 68 of file SiStripBaseDelay.h.

Member Data Documentation

◆ delays_

std::vector<Delay> SiStripBaseDelay::delays_
private