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 
4 #ifndef __GCCXML__
8 #endif
9 
13 
17 
19 
24 
25 #include <string>
26 
28 
29  public:
32 
33  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
34  int mult() const;
35 
36  private:
40  std::vector<std::string> m_clustsummvar;
41  int m_mult;
42 
43 };
44 
45 
46 
47 template <class T>
49 
50  public:
52  SingleMultiplicity(const edm::ParameterSet& iConfig);
53 
54 
55  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
56  int mult() const;
57  // int mult;
58 
59  private:
60 
62  int m_modthr;
65  int m_mult;
66 };
67 
68 template <class T>
70  // mult(0),
71  m_collection(), m_modthr(-1), m_useQuality(false), m_qualityLabel(),
72  m_mult(0)
73 { }
74 
75 template <class T>
77  // mult(0),
78  m_collection(iConfig.getParameter<edm::InputTag>("collectionName")),
79  m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
80  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
81  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel","")),
82  m_mult(0)
83 { }
84 
85 #ifndef __GCCXML__
86 template <class T>
87 void
89 
90  m_mult = 0;
91  // mult = 0;
92 
93  edm::ESHandle<SiStripQuality> qualityHandle;
94  if( m_useQuality) {
95  iSetup.get<SiStripQualityRcd>().get(m_qualityLabel,qualityHandle);
96  }
97 
98  edm::Handle<T> digis;
99  iEvent.getByLabel(m_collection,digis);
100 
101 
102  for(typename T::const_iterator it = digis->begin();it!=digis->end();it++) {
103 
104  if(!m_useQuality || !qualityHandle->IsModuleBad(it->detId()) ) {
105  if(m_modthr < 0 || int(it->size()) < m_modthr ) {
106  m_mult += it->size();
107  // mult += it->size();
108  }
109  }
110  }
111 }
112 #endif
113 
114 
115 template<class T>
116 int SingleMultiplicity<T>::mult() const { return m_mult; }
117 
118 template <class T1, class T2>
120 
121  public:
123  MultiplicityPair(const edm::ParameterSet& iConfig);
124 
125  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
126  int mult1() const;
127  int mult2() const;
128  // int mult1;
129  // int mult2;
130 
131  private:
132 
135 
136  };
137 
138 template <class T1, class T2>
140  // mult1(0),mult2(0),
141  m_multiplicity1(), m_multiplicity2()
142 { }
143 
144 template <class T1, class T2>
146  // mult1(0),mult2(0),
147  m_multiplicity1(iConfig.getParameter<edm::ParameterSet>("firstMultiplicityConfig")),
148  m_multiplicity2(iConfig.getParameter<edm::ParameterSet>("secondMultiplicityConfig"))
149 { }
150 
151 template <class T1, class T2>
152  void
154 
155  m_multiplicity1.getEvent(iEvent,iSetup);
156  m_multiplicity2.getEvent(iEvent,iSetup);
157 
158  // mult1=m_multiplicity1.mult;
159  // mult2=m_multiplicity2.mult;
160 
161 }
162 
163 template<class T1, class T2>
164  int MultiplicityPair<T1,T2>::mult1() const { return m_multiplicity1.mult(); }
165 
166 template<class T1, class T2>
167  int MultiplicityPair<T1,T2>::mult2() const { return m_multiplicity2.mult(); }
168 
175 
176 
177 #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:390
const T & get() const
Definition: EventSetup.h:55
MultiplicityPair< SingleMultiplicity< edmNew::DetSetVector< SiPixelCluster > >,SingleMultiplicity< edmNew::DetSetVector< SiStripCluster > > > SiPixelClusterSiStripClusterMultiplicityPair
volatile std::atomic< bool > shutdown_flag false
SingleMultiplicity< edm::DetSetVector< SiStripDigi > > SingleSiStripDigiMultiplicity