CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Multiplicities.h
Go to the documentation of this file.
1 #ifndef DPGAnalysis_SiStripTools_Multiplicities_H
2 #define DPGAnalysis_SiStripTools_Multiplicities_H
3 
9 
13 
15 
21 
22 #include <string>
23 
25 
26  public:
29 
30  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
31  int mult() const;
32 
33  private:
36  std::string m_subdetvar;
37  std::vector<std::string> m_clustsummvar;
38  int m_mult;
39 
40 };
41 
42 
43 
44 template <class T>
46 
47  public:
49  SingleMultiplicity(const edm::ParameterSet& iConfig);
50 
51 
52  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
53  int mult() const;
54  // int mult;
55 
56  private:
57 
59  int m_modthr;
61  std::string m_qualityLabel;
62  int m_mult;
63 };
64 
65 template <class T>
67  // mult(0),
68  m_collection(), m_modthr(-1), m_useQuality(false), m_qualityLabel(),
69  m_mult(0)
70 { }
71 
72 template <class T>
74  // mult(0),
75  m_collection(iConfig.getParameter<edm::InputTag>("collectionName")),
76  m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
77  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
78  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel","")),
79  m_mult(0)
80 { }
81 
82 template <class T>
83 void
85 
86  m_mult = 0;
87  // mult = 0;
88 
89  edm::ESHandle<SiStripQuality> qualityHandle;
90  if( m_useQuality) {
91  iSetup.get<SiStripQualityRcd>().get(m_qualityLabel,qualityHandle);
92  }
93 
94  edm::Handle<T> digis;
95  iEvent.getByLabel(m_collection,digis);
96 
97 
98  for(typename T::const_iterator it = digis->begin();it!=digis->end();it++) {
99 
100  if(!m_useQuality || !qualityHandle->IsModuleBad(it->detId()) ) {
101  if(m_modthr < 0 || int(it->size()) < m_modthr ) {
102  m_mult += it->size();
103  // mult += it->size();
104  }
105  }
106  }
107 }
108 
109 
110 template<class T>
111 int SingleMultiplicity<T>::mult() const { return m_mult; }
112 
113 template <class T1, class T2>
115 
116  public:
118  MultiplicityPair(const edm::ParameterSet& iConfig);
119 
120  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
121  int mult1() const;
122  int mult2() const;
123  // int mult1;
124  // int mult2;
125 
126  private:
127 
130 
131  };
132 
133 template <class T1, class T2>
135  // mult1(0),mult2(0),
136  m_multiplicity1(), m_multiplicity2()
137 { }
138 
139 template <class T1, class T2>
141  // mult1(0),mult2(0),
142  m_multiplicity1(iConfig.getParameter<edm::ParameterSet>("firstMultiplicityConfig")),
143  m_multiplicity2(iConfig.getParameter<edm::ParameterSet>("secondMultiplicityConfig"))
144 { }
145 
146 template <class T1, class T2>
147  void
149 
150  m_multiplicity1.getEvent(iEvent,iSetup);
151  m_multiplicity2.getEvent(iEvent,iSetup);
152 
153  // mult1=m_multiplicity1.mult;
154  // mult2=m_multiplicity2.mult;
155 
156 }
157 
158 template<class T1, class T2>
159  int MultiplicityPair<T1,T2>::mult1() const { return m_multiplicity1.mult(); }
160 
161 template<class T1, class T2>
162  int MultiplicityPair<T1,T2>::mult2() const { return m_multiplicity2.mult(); }
163 
170 
171 
172 #endif // DPGAnalysis_SiStripTools_Multiplicities_H
std::string m_qualityLabel
int mult2() const
int mult1() const
void getEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup)
MultiplicityPair< ClusterSummarySingleMultiplicity, ClusterSummarySingleMultiplicity > ClusterSummaryMultiplicityPair
void getEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup)
std::vector< std::string > m_clustsummvar
int iEvent
Definition: GenABIO.cc:243
SingleMultiplicity< edmNew::DetSetVector< SiPixelCluster > > SingleSiPixelClusterMultiplicity
edm::InputTag m_collection
SingleMultiplicity< edmNew::DetSetVector< SiStripCluster > > SingleSiStripClusterMultiplicity
void getEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
const T & get() const
Definition: EventSetup.h:55
MultiplicityPair< SingleMultiplicity< edmNew::DetSetVector< SiPixelCluster > >,SingleMultiplicity< edmNew::DetSetVector< SiStripCluster > > > SiPixelClusterSiStripClusterMultiplicityPair
SingleMultiplicity< edm::DetSetVector< SiStripDigi > > SingleSiStripDigiMultiplicity