test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 Prints the delays for all the detIds. More...
 
void printSummary (std::stringstream &ss) 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 24 of file SiStripBaseDelay.h.

Member Typedef Documentation

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

Definition at line 51 of file SiStripBaseDelay.h.

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

Definition at line 50 of file SiStripBaseDelay.h.

Constructor & Destructor Documentation

SiStripBaseDelay::SiStripBaseDelay ( )
inline

Definition at line 28 of file SiStripBaseDelay.h.

28 {}

Member Function Documentation

uint16_t SiStripBaseDelay::coarseDelay ( const uint32_t  detId)

Definition at line 14 of file SiStripBaseDelay.cc.

References delays_, and SiStripBaseDelay::Delay::detId.

15 {
16  delayConstIt it = std::find_if(delays_.begin(), delays_.end(), boost::bind(&Delay::detId, _1) == detId);
17  if( it != delays_.end() ) {
18  return it->coarseDelay;
19  }
20  return 0;
21 }
std::vector< Delay >::const_iterator delayConstIt
std::vector< Delay > delays_
double SiStripBaseDelay::delay ( const uint32_t  detId) const

Definition at line 32 of file SiStripBaseDelay.cc.

References delays_, SiStripBaseDelay::Delay::detId, and makeDelay().

33 {
34  delayConstIt it = std::find_if(delays_.begin(), delays_.end(), boost::bind(&Delay::detId, _1) == detId);
35  if( it != delays_.end() ) {
36  return makeDelay(it->coarseDelay, it->fineDelay);
37  }
38  return 0;
39 }
std::vector< Delay >::const_iterator delayConstIt
double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
std::vector< Delay > delays_
void SiStripBaseDelay::delays ( std::vector< Delay > &  delays) const
inline

Fill the input container with all the delays.

Definition at line 59 of file SiStripBaseDelay.h.

References delays_.

60  {
61  delays = delays_;
62  }
void delays(std::vector< Delay > &delays) const
Fill the input container with all the delays.
std::vector< Delay > delays_
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 68 of file SiStripBaseDelay.h.

References delays_.

69  {
70  return delays_.size();
71  }
std::vector< Delay > delays_
void SiStripBaseDelay::detIds ( std::vector< uint32_t > &  detIdVector) const

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

Definition at line 41 of file SiStripBaseDelay.cc.

References delays_.

42 {
43  std::vector<Delay>::const_iterator it = delays_.begin();
44  for( ; it != delays_.end(); ++it ) {
45  detIdVector.push_back(it->detId);
46  }
47 }
std::vector< Delay > delays_
uint16_t SiStripBaseDelay::fineDelay ( const uint32_t  detId) const

Definition at line 23 of file SiStripBaseDelay.cc.

References delays_, and SiStripBaseDelay::Delay::detId.

24 {
25  delayConstIt it = std::find_if(delays_.begin(), delays_.end(), boost::bind(&Delay::detId, _1) == detId);
26  if( it != delays_.end() ) {
27  return it->fineDelay;
28  }
29  return 0;
30 }
std::vector< Delay >::const_iterator delayConstIt
std::vector< Delay > delays_
double SiStripBaseDelay::makeDelay ( const uint16_t  coarseDelay,
const uint16_t  fineDelay 
) const
inlineprivate

Definition at line 80 of file SiStripBaseDelay.h.

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

81  {
82  return( coarseDelay*25 + fineDelay*(25/24.) );
83  }
uint16_t coarseDelay(const uint32_t detId)
uint16_t fineDelay(const uint32_t detId) const
void SiStripBaseDelay::printDebug ( std::stringstream &  ss) const

Prints the delays for all the detIds.

Definition at line 61 of file SiStripBaseDelay.cc.

References delays_, makeDelay(), and printSummary().

62 {
64  delayConstIt it = delays_.begin();
65  ss << std::endl << "All pedestal values:" << std::endl;
66  for( ; it != delays_.end(); ++it ) {
67  ss << "detId = " << it->detId << " delay = " << makeDelay(it->coarseDelay, it->fineDelay) << std::endl;
68  }
69 }
std::vector< Delay >::const_iterator delayConstIt
double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
void printSummary(std::stringstream &ss) const
Prints the average value of the delays for all layers and wheels in the SiStripTracker.
std::vector< Delay > delays_
void SiStripBaseDelay::printSummary ( std::stringstream &  ss) const

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

Definition at line 49 of file SiStripBaseDelay.cc.

References SiStripDetSummary::add(), delays_, makeDelay(), and SiStripDetSummary::print().

Referenced by printDebug().

50 {
51  ss << "Total number of delays = " << delays_.size() << std::endl;
52  SiStripDetSummary summaryDelays;
53  delayConstIt it = delays_.begin();
54  for( ; it != delays_.end(); ++it ) {
55  summaryDelays.add(it->detId, makeDelay(it->coarseDelay, it->fineDelay));
56  }
57  ss << std::endl << "Summary:" << std::endl;
58  summaryDelays.print(ss);
59 }
std::vector< Delay >::const_iterator delayConstIt
double makeDelay(const uint16_t coarseDelay, const uint16_t fineDelay) const
void print(std::stringstream &ss, const bool mean=true) const
std::vector< Delay > delays_
void add(const DetId &detid, const float &value)
Used to compute the mean value of the value variable divided by subdetector, layer and mono/stereo...
bool SiStripBaseDelay::put ( const uint32_t  detId,
const uint16_t  coarseDelay,
const uint16_t  fineDelay 
)

Definition at line 8 of file SiStripBaseDelay.cc.

References delays_.

Referenced by SiStripBaseDelayGenerator::createObject().

9 {
10  delays_.push_back(Delay(detId, coarseDelay, fineDelay));
11  return true;
12 }
uint16_t coarseDelay(const uint32_t detId)
uint16_t fineDelay(const uint32_t detId) const
std::vector< Delay > delays_
template<class Archive >
void SiStripBaseDelay::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 87 of file SiStripBaseDelay.h.

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

Definition at line 87 of file SiStripBaseDelay.h.

Member Data Documentation

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