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 
8 
12 
17 
19 
23 
24 namespace edm {
25  class EventSetup;
26 };
27 
28 #include <string>
29 
31 public:
35 
36  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
37  int mult() const;
38 
39 private:
42  int m_mult;
44 };
45 
46 template <class T>
48 public:
52 
53  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
54  int mult() const;
55  // int mult;
56 
57 private:
58  int m_modthr;
61  int m_mult;
63 };
64 
65 template <class T>
66 SingleMultiplicity<T>::SingleMultiplicity() : m_modthr(-1), m_useQuality(false), m_mult(0), m_collection() {}
67 
68 template <class T>
70  : m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
71  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality", false)),
72  m_qualityToken(m_useQuality
73  ? decltype(m_qualityToken){iC.esConsumes<SiStripQuality, SiStripQualityRcd>(
74  edm::ESInputTag{"", iConfig.getUntrackedParameter<std::string>("qualityLabel", "")})}
75  : decltype(m_qualityToken){}),
76  m_mult(0),
77  m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))) {}
78 template <class T>
80  : m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
81  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality", false)),
82  m_qualityToken(m_useQuality
83  ? decltype(m_qualityToken){iC.esConsumes<SiStripQuality, SiStripQualityRcd>(
84  edm::ESInputTag(iConfig.getUntrackedParameter<std::string>("qualityLabel", "")))}
85  : decltype(m_qualityToken){}),
86  m_mult(0),
87  m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))) {}
88 
89 template <class T>
91  m_mult = 0;
92 
93  const SiStripQuality* quality = nullptr;
94  if (m_useQuality) {
95  quality = &iSetup.getData(m_qualityToken);
96  }
97 
98  edm::Handle<T> digis;
99  iEvent.getByToken(m_collection, digis);
100 
101  for (typename T::const_iterator it = digis->begin(); it != digis->end(); it++) {
102  if (!m_useQuality || !quality->IsModuleBad(it->detId())) {
103  if (m_modthr < 0 || int(it->size()) < m_modthr) {
104  m_mult += it->size();
105  // mult += it->size();
106  }
107  }
108  }
109 }
110 
111 template <class T>
113  return m_mult;
114 }
115 
116 template <class T1, class T2>
118 public:
122 
123  void getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup);
124  int mult1() const;
125  int mult2() const;
126 
127 private:
130 };
131 
132 template <class T1, class T2>
133 MultiplicityPair<T1, T2>::MultiplicityPair() : m_multiplicity1(), m_multiplicity2() {}
134 
135 template <class T1, class T2>
137  : m_multiplicity1(iConfig.getParameter<edm::ParameterSet>("firstMultiplicityConfig"), iC),
138  m_multiplicity2(iConfig.getParameter<edm::ParameterSet>("secondMultiplicityConfig"), iC) {}
139 template <class T1, class T2>
141  : m_multiplicity1(iConfig.getParameter<edm::ParameterSet>("firstMultiplicityConfig"), iC),
142  m_multiplicity2(iConfig.getParameter<edm::ParameterSet>("secondMultiplicityConfig"), iC) {}
143 
144 template <class T1, class T2>
146  m_multiplicity1.getEvent(iEvent, iSetup);
147  m_multiplicity2.getEvent(iEvent, iSetup);
148 }
149 
150 template <class T1, class T2>
152  return m_multiplicity1.mult();
153 }
154 
155 template <class T1, class T2>
157  return m_multiplicity2.mult();
158 }
159 
168 
169 #endif // DPGAnalysis_SiStripTools_Multiplicities_H
Handle.h
electrons_cff.bool
bool
Definition: electrons_cff.py:393
edm::ESInputTag
Definition: ESInputTag.h:87
MultiplicityPair
Definition: Multiplicities.h:117
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
MultiplicityPair::getEvent
void getEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: Multiplicities.h:145
AlCaHarvesting_cff.SiStripQuality
SiStripQuality
Definition: AlCaHarvesting_cff.py:223
edm::EDGetTokenT< ClusterSummary >
edm
HLT enums.
Definition: AlignableModifier.h:19
SiPixelCluster.h
ClusterSummarySingleMultiplicity
Definition: Multiplicities.h:30
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
MultiplicityPair::m_multiplicity1
T1 m_multiplicity1
Definition: Multiplicities.h:128
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
SingleSiPixelClusterMultiplicity
SingleMultiplicity< edmNew::DetSetVector< SiPixelCluster > > SingleSiPixelClusterMultiplicity
Definition: Multiplicities.h:162
edm::Handle
Definition: AssociativeIterator.h:50
SingleMultiplicity
Definition: Multiplicities.h:47
MultiplicityPair::mult1
int mult1() const
Definition: Multiplicities.h:151
ClusterSummary.h
SingleMultiplicity::SingleMultiplicity
SingleMultiplicity()
Definition: Multiplicities.h:66
ClusterSummarySingleMultiplicity::ClusterSummarySingleMultiplicity
ClusterSummarySingleMultiplicity()
Definition: Multiplicities.cc:3
SiStripQualityRcd
Definition: SiStripDependentRecords.h:55
SiStripDigi.h
ClusterSummarySingleMultiplicity::m_subdetenum
ClusterSummary::CMSTracker m_subdetenum
Definition: Multiplicities.h:40
ClusterSummarySingleMultiplicity::mult
int mult() const
Definition: Multiplicities.cc:41
SingleMultiplicity::mult
int mult() const
Definition: Multiplicities.h:112
SingleMultiplicity::m_modthr
int m_modthr
Definition: Multiplicities.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripCluster.h
MultiplicityPair::MultiplicityPair
MultiplicityPair()
Definition: Multiplicities.h:133
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:167
ClusterSummarySingleMultiplicity::m_mult
int m_mult
Definition: Multiplicities.h:42
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
ClusterSummarySingleMultiplicity::m_varenum
ClusterSummary::VariablePlacement m_varenum
Definition: Multiplicities.h:41
SingleMultiplicity::getEvent
void getEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: Multiplicities.h:90
SingleMultiplicity::m_collection
edm::EDGetTokenT< T > m_collection
Definition: Multiplicities.h:62
SingleSiStripClusterMultiplicity
SingleMultiplicity< edmNew::DetSetVector< SiStripCluster > > SingleSiStripClusterMultiplicity
Definition: Multiplicities.h:161
MultiplicityPair::m_multiplicity2
T2 m_multiplicity2
Definition: Multiplicities.h:129
edm::EventSetup
Definition: EventSetup.h:57
SingleMultiplicity::m_qualityToken
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > m_qualityToken
Definition: Multiplicities.h:60
DetSetVector.h
edm::ESGetToken< SiStripQuality, SiStripQualityRcd >
SingleSiStripDigiMultiplicity
SingleMultiplicity< edm::DetSetVector< SiStripDigi > > SingleSiStripDigiMultiplicity
Definition: Multiplicities.h:160
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
ClusterSummary::CMSTracker
CMSTracker
Definition: ClusterSummary.h:83
SingleMultiplicity::m_mult
int m_mult
Definition: Multiplicities.h:61
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
SingleMultiplicity::m_useQuality
bool m_useQuality
Definition: Multiplicities.h:59
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:165
DetSet.h
ConsumesCollector.h
MultiplicityPair::mult2
int mult2() const
Definition: Multiplicities.h:156
EventSetup
ParameterSet.h
edm::Event
Definition: Event.h:73
DetSetVectorNew.h
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
ClusterSummarySingleMultiplicity::m_collection
edm::EDGetTokenT< ClusterSummary > m_collection
Definition: Multiplicities.h:43
SiStripQuality
Definition: SiStripQuality.h:32