CMS 3D CMS Logo

Multiplicities.h
Go to the documentation of this file.
1 #ifndef DPGAnalysis_SiStripTools_Multiplicities_H
2 #define DPGAnalysis_SiStripTools_Multiplicities_H
3 
4 #ifndef __ROOTCLING__
10 #endif
11 
15 
20 
22 
26 
27 namespace edm {
28  class EventSetup;
29 };
30 
31 #include <string>
32 
34 public:
36 #ifndef __ROOTCLING__
39 #endif
40 
41  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
42  int mult() const;
43 
44 private:
47  int m_mult;
48 #ifndef __ROOTCLING__
50 #endif
51 };
52 
53 template <class T>
55 public:
57 #ifndef __ROOTCLING__
60 #endif
61 
62  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
63  int mult() const;
64  // int mult;
65 
66 private:
67  int m_modthr;
70  int m_mult;
71 #ifndef __ROOTCLING__
73 #endif
74 };
75 
76 template <class T>
78  : m_modthr(-1),
79  m_useQuality(false),
80  m_qualityLabel(),
81  m_mult(0)
82 #ifndef __ROOTCLING__
83  ,
84  m_collection()
85 #endif
86 {
87 }
88 
89 #ifndef __ROOTCLING__
90 template <class T>
92  : m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
93  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality", false)),
94  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel", "")),
95  m_mult(0),
96  m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))) {}
97 template <class T>
99  : m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
100  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality", false)),
101  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel", "")),
102  m_mult(0),
103  m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))) {}
104 #endif
105 
106 #ifndef __ROOTCLING__
107 template <class T>
109  m_mult = 0;
110 
111  edm::ESHandle<SiStripQuality> qualityHandle;
112  if (m_useQuality) {
113  iSetup.get<SiStripQualityRcd>().get(m_qualityLabel, qualityHandle);
114  }
115 
116  edm::Handle<T> digis;
117  iEvent.getByToken(m_collection, digis);
118 
119  for (typename T::const_iterator it = digis->begin(); it != digis->end(); it++) {
120  if (!m_useQuality || !qualityHandle->IsModuleBad(it->detId())) {
121  if (m_modthr < 0 || int(it->size()) < m_modthr) {
122  m_mult += it->size();
123  // mult += it->size();
124  }
125  }
126  }
127 }
128 #endif
129 
130 template <class T>
132  return m_mult;
133 }
134 
135 template <class T1, class T2>
137 public:
139 #ifndef __ROOTCLING__
142 #endif
143 
144  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
145  int mult1() const;
146  int mult2() const;
147 
148 private:
151 };
152 
153 template <class T1, class T2>
154 MultiplicityPair<T1, T2>::MultiplicityPair() : m_multiplicity1(), m_multiplicity2() {}
155 
156 #ifndef __ROOTCLING__
157 template <class T1, class T2>
159  : m_multiplicity1(iConfig.getParameter<edm::ParameterSet>("firstMultiplicityConfig"), iC),
160  m_multiplicity2(iConfig.getParameter<edm::ParameterSet>("secondMultiplicityConfig"), iC) {}
161 template <class T1, class T2>
163  : m_multiplicity1(iConfig.getParameter<edm::ParameterSet>("firstMultiplicityConfig"), iC),
164  m_multiplicity2(iConfig.getParameter<edm::ParameterSet>("secondMultiplicityConfig"), iC) {}
165 #endif
166 
167 template <class T1, class T2>
169  m_multiplicity1.getEvent(iEvent, iSetup);
170  m_multiplicity2.getEvent(iEvent, iSetup);
171 }
172 
173 template <class T1, class T2>
175  return m_multiplicity1.mult();
176 }
177 
178 template <class T1, class T2>
180  return m_multiplicity2.mult();
181 }
182 
191 
192 #endif // DPGAnalysis_SiStripTools_Multiplicities_H
Handle.h
electrons_cff.bool
bool
Definition: electrons_cff.py:372
MultiplicityPair
Definition: Multiplicities.h:136
MessageLogger.h
funct::false
false
Definition: Factorize.h:34
ESHandle.h
MultiplicityPair::getEvent
void getEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: Multiplicities.h:168
edm::EDGetTokenT< ClusterSummary >
edm
HLT enums.
Definition: AlignableModifier.h:19
SiStripQuality::IsModuleBad
bool IsModuleBad(const uint32_t &detid) const
Definition: SiStripQuality.cc:604
SiPixelCluster.h
ClusterSummarySingleMultiplicity
Definition: Multiplicities.h:33
MultiplicityPair::m_multiplicity1
T1 m_multiplicity1
Definition: Multiplicities.h:149
SingleSiPixelClusterMultiplicity
SingleMultiplicity< edmNew::DetSetVector< SiPixelCluster > > SingleSiPixelClusterMultiplicity
Definition: Multiplicities.h:185
edm::Handle
Definition: AssociativeIterator.h:50
SingleMultiplicity
Definition: Multiplicities.h:54
MultiplicityPair::mult1
int mult1() const
Definition: Multiplicities.h:174
ClusterSummary.h
SingleMultiplicity::SingleMultiplicity
SingleMultiplicity()
Definition: Multiplicities.h:77
ClusterSummarySingleMultiplicity::ClusterSummarySingleMultiplicity
ClusterSummarySingleMultiplicity()
Definition: Multiplicities.cc:3
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
SiStripQualityRcd
Definition: SiStripDependentRecords.h:56
SiStripDigi.h
ClusterSummarySingleMultiplicity::m_subdetenum
ClusterSummary::CMSTracker m_subdetenum
Definition: Multiplicities.h:45
ClusterSummarySingleMultiplicity::mult
int mult() const
Definition: Multiplicities.cc:41
SingleMultiplicity::mult
int mult() const
Definition: Multiplicities.h:131
edm::ESHandle< SiStripQuality >
SingleMultiplicity::m_modthr
int m_modthr
Definition: Multiplicities.h:67
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
SiStripCluster.h
MultiplicityPair::MultiplicityPair
MultiplicityPair()
Definition: Multiplicities.h:154
Event.h
ParameterSet
Definition: Functions.h:16
ClusterSummary::VariablePlacement
VariablePlacement
Definition: ClusterSummary.h:99
ClusterSummarySingleMultiplicity::getEvent
void getEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: Multiplicities.cc:20
ClusterSummaryMultiplicityPair
MultiplicityPair< ClusterSummarySingleMultiplicity, ClusterSummarySingleMultiplicity > ClusterSummaryMultiplicityPair
Definition: Multiplicities.h:190
ClusterSummarySingleMultiplicity::m_mult
int m_mult
Definition: Multiplicities.h:47
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
ClusterSummarySingleMultiplicity::m_varenum
ClusterSummary::VariablePlacement m_varenum
Definition: Multiplicities.h:46
SingleMultiplicity::getEvent
void getEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: Multiplicities.h:108
SingleMultiplicity::m_collection
edm::EDGetTokenT< T > m_collection
Definition: Multiplicities.h:72
SingleSiStripClusterMultiplicity
SingleMultiplicity< edmNew::DetSetVector< SiStripCluster > > SingleSiStripClusterMultiplicity
Definition: Multiplicities.h:184
MultiplicityPair::m_multiplicity2
T2 m_multiplicity2
Definition: Multiplicities.h:150
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
get
#define get
SingleSiStripDigiMultiplicity
SingleMultiplicity< edm::DetSetVector< SiStripDigi > > SingleSiStripDigiMultiplicity
Definition: Multiplicities.h:183
ClusterSummary::CMSTracker
CMSTracker
Definition: ClusterSummary.h:83
std
Definition: JetResolutionObject.h:76
SingleMultiplicity::m_mult
int m_mult
Definition: Multiplicities.h:70
SingleMultiplicity::m_useQuality
bool m_useQuality
Definition: Multiplicities.h:68
T
long double T
Definition: Basic3DVectorLD.h:48
SiStripQuality.h
SiStripQualityRcd.h
EventSetup.h
SiPixelClusterSiStripClusterMultiplicityPair
MultiplicityPair< SingleMultiplicity< edmNew::DetSetVector< SiPixelCluster > >, SingleMultiplicity< edmNew::DetSetVector< SiStripCluster > > > SiPixelClusterSiStripClusterMultiplicityPair
Definition: Multiplicities.h:188
DetSet.h
ConsumesCollector.h
MultiplicityPair::mult2
int mult2() const
Definition: Multiplicities.h:179
EventSetup
ParameterSet.h
SingleMultiplicity::m_qualityLabel
std::string m_qualityLabel
Definition: Multiplicities.h:69
edm::Event
Definition: Event.h:73
DetSetVectorNew.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
ClusterSummarySingleMultiplicity::m_collection
edm::EDGetTokenT< ClusterSummary > m_collection
Definition: Multiplicities.h:49