CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 21 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 46 of file DigiCollectionProfiler.h.

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

46  :
47  m_folded(iConfig.getUntrackedParameter<bool>("foldedStrips",false)),
48  m_want1dHisto(iConfig.getUntrackedParameter<bool>("want1dHisto",true)),
49  m_wantProfile(iConfig.getUntrackedParameter<bool>("wantProfile",true)),
50  m_want2dHisto(iConfig.getUntrackedParameter<bool>("want2dHisto",false))
51 
52 {
53 
54  std::vector<edm::ParameterSet> selconfigs = iConfig.getParameter<std::vector<edm::ParameterSet> >("selections");
55 
56  for(std::vector<edm::ParameterSet>::const_iterator selconfig=selconfigs.begin();selconfig!=selconfigs.end();++selconfig) {
57  DetIdSelector selection(*selconfig);
58  m_selections.push_back(selection);
59  }
60 
61 }
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:98
template<class T >
DigiCollectionProfiler< T >::~DigiCollectionProfiler ( )
inline

Definition at line 26 of file DigiCollectionProfiler.h.

26 {};

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 64 of file DigiCollectionProfiler.h.

64  {
65 
66 }
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 70 of file DigiCollectionProfiler.h.

References mod().

70  {
71 
73 
74  for(unsigned int isel=0;isel< m_selections.size(); ++isel) {
75 
76  if(m_selections[isel].isSelected(mod->detId())) {
77  TH1F* tobefilled1d=0;
78  TProfile* tobefilledprof=0;
79  TH2F* tobefilled2d=0;
80 
81  if(m_want1dHisto) tobefilled1d = hist[isel];
82  if(m_wantProfile) tobefilledprof = hprof[isel];
83  if(m_want2dHisto) tobefilled2d = hist2d[isel];
84 
85  for(edm::DetSet<SiStripDigi>::const_iterator digi=mod->begin();digi!=mod->end();digi++) {
86 
87  if(digi->adc()>0) {
88  unsigned int strip = digi->strip();
89  if(m_folded) strip = strip%256;
90  if(tobefilled1d) tobefilled1d->Fill(strip);
91  if(tobefilledprof) tobefilledprof->Fill(strip,digi->adc());
92  if(tobefilled2d) tobefilled2d->Fill(strip,digi->adc());
93  }
94  }
95  }
96  }
97  }
98 }
std::vector< DetIdSelector > m_selections
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:361
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:346
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104
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 101 of file DigiCollectionProfiler.h.

References mod().

101  {
102 
104 
105  for(unsigned int isel=0;isel< m_selections.size(); ++isel) {
106 
107  if(m_selections[isel].isSelected(mod->detId())) {
108  TH1F* tobefilled1d=0;
109  TProfile* tobefilledprof=0;
110  TH2F* tobefilled2d=0;
111 
112  if(m_want1dHisto) tobefilled1d = hist[isel];
113  if(m_wantProfile) tobefilledprof = hprof[isel];
114  if(m_want2dHisto) tobefilled2d = hist2d[isel];
115 
116  unsigned int istrip=0;
117  for(edm::DetSet<SiStripRawDigi>::const_iterator digi=mod->begin();digi!=mod->end();digi++,++istrip) {
118 
119  if(digi->adc()>0) {
120  unsigned int strip = istrip;
121  if(m_folded) strip = strip%256;
122  if(tobefilled1d) tobefilled1d->Fill(strip);
123  if(tobefilledprof) tobefilledprof->Fill(strip,digi->adc());
124  if(tobefilled2d) tobefilled2d->Fill(strip,digi->adc());
125  }
126  }
127  }
128  }
129  }
130 }
std::vector< DetIdSelector > m_selections
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:361
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:346
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104
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 133 of file DigiCollectionProfiler.h.

References mod().

133  {
134 
136 
137  for(unsigned int isel=0;isel< m_selections.size(); ++isel) {
138 
139  if(m_selections[isel].isSelected(mod->detId())) {
140  TH1F* tobefilled1d=0;
141  TProfile* tobefilledprof=0;
142  TH2F* tobefilled2d=0;
143 
144  if(m_want1dHisto) tobefilled1d = hist[isel];
145  if(m_wantProfile) tobefilledprof = hprof[isel];
146  if(m_want2dHisto) tobefilled2d = hist2d[isel];
147 
148  for(edmNew::DetSet<SiStripCluster>::const_iterator clus=mod->begin();clus!=mod->end();clus++) {
149 
150  for(unsigned int digi=0; digi < clus->amplitudes().size() ; ++digi) {
151 
152  if(clus->amplitudes()[digi]>0) {
153  unsigned int strip = clus->firstStrip()+digi;
154  if(m_folded) strip = strip%256;
155  if(tobefilled1d) tobefilled1d->Fill(strip);
156  if(tobefilledprof) tobefilledprof->Fill(strip,clus->amplitudes()[digi]);
157  if(tobefilled2d) tobefilled2d->Fill(strip,clus->amplitudes()[digi]);
158  }
159  }
160  }
161  }
162  }
163  }
164 }
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
std::vector< DetIdSelector > m_selections
data_type const * const_iterator
Definition: DetSetNew.h:30
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
const_iterator begin(bool update=false) const

Member Data Documentation

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

Definition at line 32 of file DigiCollectionProfiler.h.

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

Definition at line 33 of file DigiCollectionProfiler.h.

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

Definition at line 35 of file DigiCollectionProfiler.h.

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

Definition at line 34 of file DigiCollectionProfiler.h.