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

◆ DigiCollectionProfiler() [1/2]

template<class T >
DigiCollectionProfiler< T >::DigiCollectionProfiler ( )

◆ DigiCollectionProfiler() [2/2]

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
Definition: ParameterSet.h:303
std::vector< DetIdSelector > m_selections
selection
main part
Definition: corrVsCorr.py:100
T getUntrackedParameter(std::string const &, T const &) const

◆ ~DigiCollectionProfiler()

template<class T>
DigiCollectionProfiler< T >::~DigiCollectionProfiler ( )
inline

Definition at line 23 of file DigiCollectionProfiler.h.

23 {};

Member Function Documentation

◆ fill() [1/4]

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.

64  {}

◆ fill() [2/4]

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
inline

Definition at line 67 of file DigiCollectionProfiler.h.

References compareTotals::hist, isSelected(), mod(), and nano_mu_digi_cff::strip.

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

◆ fill() [3/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
inline

Definition at line 105 of file DigiCollectionProfiler.h.

References compareTotals::hist, isSelected(), mod(), and nano_mu_digi_cff::strip.

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

◆ fill() [4/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
inline

Definition at line 144 of file DigiCollectionProfiler.h.

References compareTotals::hist, isSelected(), mod(), and nano_mu_digi_cff::strip.

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

Member Data Documentation

◆ m_folded

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

Definition at line 31 of file DigiCollectionProfiler.h.

◆ m_selections

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

◆ m_want1dHisto

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

Definition at line 32 of file DigiCollectionProfiler.h.

◆ m_want2dHisto

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

Definition at line 34 of file DigiCollectionProfiler.h.

◆ m_wantProfile

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

Definition at line 33 of file DigiCollectionProfiler.h.