CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DigiCollectionProfiler< T > Class Template Reference

#include <DigiCollectionProfiler.h>

Public Member Functions

 DigiCollectionProfiler ()
 
 DigiCollectionProfiler (const edm::ParameterSet &iConfig)
 
void fill (edm::Handle< T > digis, const std::vector< TH1F * > &, const std::vector< TProfile * > &, const std::vector< TH2F * > &) const
 
template<>
void fill (edm::Handle< edm::DetSetVector< SiStripDigi > > digis, const std::vector< TH1F * > &hist, const std::vector< TProfile * > &hprof, const std::vector< TH2F * > &hist2d) const
 
template<>
void fill (edm::Handle< edm::DetSetVector< SiStripRawDigi > > digis, const std::vector< TH1F * > &hist, const std::vector< TProfile * > &hprof, const std::vector< TH2F * > &hist2d) const
 
template<>
void fill (edm::Handle< edmNew::DetSetVector< SiStripCluster > > digis, const std::vector< TH1F * > &hist, const std::vector< TProfile * > &hprof, const std::vector< TH2F * > &hist2d) const
 
 ~DigiCollectionProfiler ()
 

Private Attributes

bool m_folded
 
std::vector< DetIdSelectorm_selections
 
bool m_want1dHisto
 
bool m_want2dHisto
 
bool m_wantProfile
 

Detailed Description

template<class T>
class DigiCollectionProfiler< T >

Definition at line 19 of file DigiCollectionProfiler.h.

Constructor & Destructor Documentation

template<class T >
DigiCollectionProfiler< T >::DigiCollectionProfiler ( )
template<class T >
DigiCollectionProfiler< T >::DigiCollectionProfiler ( const edm::ParameterSet iConfig)

Definition at line 44 of file DigiCollectionProfiler.h.

References edm::ParameterSet::getParameter(), DigiCollectionProfiler< T >::m_selections, and corrVsCorr::selection.

45  : m_folded(iConfig.getUntrackedParameter<bool>("foldedStrips", false)),
46  m_want1dHisto(iConfig.getUntrackedParameter<bool>("want1dHisto", true)),
47  m_wantProfile(iConfig.getUntrackedParameter<bool>("wantProfile", true)),
48  m_want2dHisto(iConfig.getUntrackedParameter<bool>("want2dHisto", false))
49 
50 {
51  std::vector<edm::ParameterSet> selconfigs = iConfig.getParameter<std::vector<edm::ParameterSet> >("selections");
52 
53  for (std::vector<edm::ParameterSet>::const_iterator selconfig = selconfigs.begin(); selconfig != selconfigs.end();
54  ++selconfig) {
55  DetIdSelector selection(*selconfig);
56  m_selections.push_back(selection);
57  }
58 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< DetIdSelector > m_selections
selection
main part
Definition: corrVsCorr.py:100
template<class T>
DigiCollectionProfiler< T >::~DigiCollectionProfiler ( )
inline

Definition at line 23 of file DigiCollectionProfiler.h.

References DigiCollectionProfiler< T >::fill().

23 {};

Member Function Documentation

template<class T >
void DigiCollectionProfiler< T >::fill ( edm::Handle< T digis,
const std::vector< TH1F * > &  hist,
const std::vector< TProfile * > &  hprof,
const std::vector< TH2F * > &  hist2d 
) const

Definition at line 61 of file DigiCollectionProfiler.h.

Referenced by DigiCollectionProfiler< T >::~DigiCollectionProfiler().

64  {}
template<>
void DigiCollectionProfiler< edm::DetSetVector< SiStripDigi > >::fill ( edm::Handle< edm::DetSetVector< SiStripDigi > >  digis,
const std::vector< TH1F * > &  hist,
const std::vector< TProfile * > &  hprof,
const std::vector< TH2F * > &  hist2d 
) const

Definition at line 67 of file DigiCollectionProfiler.h.

References DigiCollectionProfiler< T >::m_folded, DigiCollectionProfiler< T >::m_selections, DigiCollectionProfiler< T >::m_want1dHisto, DigiCollectionProfiler< T >::m_want2dHisto, DigiCollectionProfiler< T >::m_wantProfile, mod(), and digitizers_cfi::strip.

70  {
71  for (edm::DetSetVector<SiStripDigi>::const_iterator mod = digis->begin(); mod != digis->end(); mod++) {
72  for (unsigned int isel = 0; isel < m_selections.size(); ++isel) {
73  if (m_selections[isel].isSelected(mod->detId())) {
74  TH1F* tobefilled1d = nullptr;
75  TProfile* tobefilledprof = nullptr;
76  TH2F* tobefilled2d = nullptr;
77 
78  if (m_want1dHisto)
79  tobefilled1d = hist[isel];
80  if (m_wantProfile)
81  tobefilledprof = hprof[isel];
82  if (m_want2dHisto)
83  tobefilled2d = hist2d[isel];
84 
85  for (edm::DetSet<SiStripDigi>::const_iterator digi = mod->begin(); digi != mod->end(); digi++) {
86  if (digi->adc() > 0) {
87  unsigned int strip = digi->strip();
88  if (m_folded)
89  strip = strip % 256;
90  if (tobefilled1d)
91  tobefilled1d->Fill(strip);
92  if (tobefilledprof)
93  tobefilledprof->Fill(strip, digi->adc());
94  if (tobefilled2d)
95  tobefilled2d->Fill(strip, digi->adc());
96  }
97  }
98  }
99  }
100  }
101 }
std::vector< DetIdSelector > m_selections
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
template<>
void DigiCollectionProfiler< edm::DetSetVector< SiStripRawDigi > >::fill ( edm::Handle< edm::DetSetVector< SiStripRawDigi > >  digis,
const std::vector< TH1F * > &  hist,
const std::vector< TProfile * > &  hprof,
const std::vector< TH2F * > &  hist2d 
) const

Definition at line 104 of file DigiCollectionProfiler.h.

References DigiCollectionProfiler< T >::m_folded, DigiCollectionProfiler< T >::m_selections, DigiCollectionProfiler< T >::m_want1dHisto, DigiCollectionProfiler< T >::m_want2dHisto, DigiCollectionProfiler< T >::m_wantProfile, mod(), and digitizers_cfi::strip.

108  {
109  for (edm::DetSetVector<SiStripRawDigi>::const_iterator mod = digis->begin(); mod != digis->end(); mod++) {
110  for (unsigned int isel = 0; isel < m_selections.size(); ++isel) {
111  if (m_selections[isel].isSelected(mod->detId())) {
112  TH1F* tobefilled1d = nullptr;
113  TProfile* tobefilledprof = nullptr;
114  TH2F* tobefilled2d = nullptr;
115 
116  if (m_want1dHisto)
117  tobefilled1d = hist[isel];
118  if (m_wantProfile)
119  tobefilledprof = hprof[isel];
120  if (m_want2dHisto)
121  tobefilled2d = hist2d[isel];
122 
123  unsigned int istrip = 0;
124  for (edm::DetSet<SiStripRawDigi>::const_iterator digi = mod->begin(); digi != mod->end(); digi++, ++istrip) {
125  if (digi->adc() > 0) {
126  unsigned int strip = istrip;
127  if (m_folded)
128  strip = strip % 256;
129  if (tobefilled1d)
130  tobefilled1d->Fill(strip);
131  if (tobefilledprof)
132  tobefilledprof->Fill(strip, digi->adc());
133  if (tobefilled2d)
134  tobefilled2d->Fill(strip, digi->adc());
135  }
136  }
137  }
138  }
139  }
140 }
std::vector< DetIdSelector > m_selections
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
template<>
void DigiCollectionProfiler< edmNew::DetSetVector< SiStripCluster > >::fill ( edm::Handle< edmNew::DetSetVector< SiStripCluster > >  digis,
const std::vector< TH1F * > &  hist,
const std::vector< TProfile * > &  hprof,
const std::vector< TH2F * > &  hist2d 
) const

Definition at line 143 of file DigiCollectionProfiler.h.

References DigiCollectionProfiler< T >::m_folded, DigiCollectionProfiler< T >::m_selections, DigiCollectionProfiler< T >::m_want1dHisto, DigiCollectionProfiler< T >::m_want2dHisto, DigiCollectionProfiler< T >::m_wantProfile, mod(), and digitizers_cfi::strip.

147  {
148  for (edmNew::DetSetVector<SiStripCluster>::const_iterator mod = digis->begin(); mod != digis->end(); mod++) {
149  for (unsigned int isel = 0; isel < m_selections.size(); ++isel) {
150  if (m_selections[isel].isSelected(mod->detId())) {
151  TH1F* tobefilled1d = nullptr;
152  TProfile* tobefilledprof = nullptr;
153  TH2F* tobefilled2d = nullptr;
154 
155  if (m_want1dHisto)
156  tobefilled1d = hist[isel];
157  if (m_wantProfile)
158  tobefilledprof = hprof[isel];
159  if (m_want2dHisto)
160  tobefilled2d = hist2d[isel];
161 
162  for (edmNew::DetSet<SiStripCluster>::const_iterator clus = mod->begin(); clus != mod->end(); clus++) {
163  for (unsigned int digi = 0; digi < clus->amplitudes().size(); ++digi) {
164  if (clus->amplitudes()[digi] > 0) {
165  unsigned int strip = clus->firstStrip() + digi;
166  if (m_folded)
167  strip = strip % 256;
168  if (tobefilled1d)
169  tobefilled1d->Fill(strip);
170  if (tobefilledprof)
171  tobefilledprof->Fill(strip, clus->amplitudes()[digi]);
172  if (tobefilled2d)
173  tobefilled2d->Fill(strip, clus->amplitudes()[digi]);
174  }
175  }
176  }
177  }
178  }
179  }
180 }
std::vector< DetIdSelector > m_selections
data_type const * const_iterator
Definition: DetSetNew.h:31
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

Member Data Documentation

template<class T>
bool DigiCollectionProfiler< T >::m_folded
private

Definition at line 31 of file DigiCollectionProfiler.h.

Referenced by DigiCollectionProfiler< T >::fill().

template<class T>
std::vector<DetIdSelector> DigiCollectionProfiler< T >::m_selections
private
template<class T>
bool DigiCollectionProfiler< T >::m_want1dHisto
private

Definition at line 32 of file DigiCollectionProfiler.h.

Referenced by DigiCollectionProfiler< T >::fill().

template<class T>
bool DigiCollectionProfiler< T >::m_want2dHisto
private

Definition at line 34 of file DigiCollectionProfiler.h.

Referenced by DigiCollectionProfiler< T >::fill().

template<class T>
bool DigiCollectionProfiler< T >::m_wantProfile
private

Definition at line 33 of file DigiCollectionProfiler.h.

Referenced by DigiCollectionProfiler< T >::fill().