CMS 3D CMS Logo

EgammaBasicClusters.cc
Go to the documentation of this file.
2 
5 
8 
10 
12 
14  : barrelBasicClusterCollection_(
15  consumes<reco::BasicClusterCollection>(ps.getParameter<edm::InputTag>("barrelBasicClusterCollection"))),
16  endcapBasicClusterCollection_(
17  consumes<reco::BasicClusterCollection>(ps.getParameter<edm::InputTag>("endcapBasicClusterCollection"))),
18  hsSize_(ps, "Size"),
19  hsNumRecHits_(ps, "NumRecHits"),
20  hsET_(ps, "ET"),
21  hsEta_(ps, "Eta"),
22  hsPhi_(ps, "Phi"),
23  hsR_(ps, "R"),
24  hist_EB_BC_Size_(nullptr),
25  hist_EE_BC_Size_(nullptr),
26  hist_EB_BC_NumRecHits_(nullptr),
27  hist_EE_BC_NumRecHits_(nullptr),
28  hist_EB_BC_ET_(nullptr),
29  hist_EE_BC_ET_(nullptr),
30  hist_EB_BC_Eta_(nullptr),
31  hist_EE_BC_Eta_(nullptr),
32  hist_EB_BC_Phi_(nullptr),
33  hist_EE_BC_Phi_(nullptr),
34  hist_EB_BC_ET_vs_Eta_(nullptr),
35  hist_EB_BC_ET_vs_Phi_(nullptr),
36  hist_EE_BC_ET_vs_Eta_(nullptr),
37  hist_EE_BC_ET_vs_Phi_(nullptr),
38  hist_EE_BC_ET_vs_R_(nullptr) {}
39 
41 
43  _ibooker.setCurrentFolder("EcalClusterV/EcalBasicClusters/");
44 
46  _ibooker.book1D("hist_EB_BC_Size_", "# Basic Clusters in Barrel", hsSize_.bins, hsSize_.min, hsSize_.max);
48  _ibooker.book1D("hist_EE_BC_Size_", "# Basic Clusters in Endcap", hsSize_.bins, hsSize_.min, hsSize_.max);
49 
50  hist_EB_BC_NumRecHits_ = _ibooker.book1D("hist_EB_BC_NumRecHits_",
51  "# of RecHits in Basic Clusters in Barrel",
55  hist_EE_BC_NumRecHits_ = _ibooker.book1D("hist_EE_BC_NumRecHits_",
56  "# of RecHits in Basic Clusters in Endcap",
60 
62  _ibooker.book1D("hist_EB_BC_ET_", "ET of Basic Clusters in Barrel", hsET_.bins, hsET_.min, hsET_.max);
64  _ibooker.book1D("hist_EE_BC_ET_", "ET of Basic Clusters in Endcap", hsET_.bins, hsET_.min, hsET_.max);
65 
67  _ibooker.book1D("hist_EB_BC_Eta_", "Eta of Basic Clusters in Barrel", hsEta_.bins, hsEta_.min, hsEta_.max);
69  _ibooker.book1D("hist_EE_BC_Eta_", "Eta of Basic Clusters in Endcap", hsEta_.bins, hsEta_.min, hsEta_.max);
70 
72  _ibooker.book1D("hist_EB_BC_Phi_", "Phi of Basic Clusters in Barrel", hsPhi_.bins, hsPhi_.min, hsPhi_.max);
74  _ibooker.book1D("hist_EE_BC_Phi_", "Phi of Basic Clusters in Endcap", hsPhi_.bins, hsPhi_.min, hsPhi_.max);
75 
76  hist_EB_BC_ET_vs_Eta_ = _ibooker.book2D("hist_EB_BC_ET_vs_Eta_",
77  "Basic Cluster ET versus Eta in Barrel",
78  hsET_.bins,
79  hsET_.min,
80  hsET_.max,
81  hsEta_.bins,
82  hsEta_.min,
83  hsEta_.max);
84 
85  hist_EB_BC_ET_vs_Phi_ = _ibooker.book2D("hist_EB_BC_ET_vs_Phi_",
86  "Basic Cluster ET versus Phi in Barrel",
87  hsET_.bins,
88  hsET_.min,
89  hsET_.max,
90  hsPhi_.bins,
91  hsPhi_.min,
92  hsPhi_.max);
93 
94  hist_EE_BC_ET_vs_Eta_ = _ibooker.book2D("hist_EE_BC_ET_vs_Eta_",
95  "Basic Cluster ET versus Eta in Endcap",
96  hsET_.bins,
97  hsET_.min,
98  hsET_.max,
99  hsEta_.bins,
100  hsEta_.min,
101  hsEta_.max);
102 
103  hist_EE_BC_ET_vs_Phi_ = _ibooker.book2D("hist_EE_BC_ET_vs_Phi_",
104  "Basic Cluster ET versus Phi in Endcap",
105  hsET_.bins,
106  hsET_.min,
107  hsET_.max,
108  hsPhi_.bins,
109  hsPhi_.min,
110  hsPhi_.max);
111 
112  hist_EE_BC_ET_vs_R_ = _ibooker.book2D("hist_EE_BC_ET_vs_R_",
113  "Basic Cluster ET versus Radius in Endcap",
114  hsET_.bins,
115  hsET_.min,
116  hsET_.max,
117  hsR_.bins,
118  hsR_.min,
119  hsR_.max);
120 }
121 
123  edm::Handle<reco::BasicClusterCollection> pBarrelBasicClusters;
124  evt.getByToken(barrelBasicClusterCollection_, pBarrelBasicClusters);
125  if (!pBarrelBasicClusters.isValid()) {
126  Labels l;
127  labelsForToken(barrelBasicClusterCollection_, l);
128  edm::LogError("EgammaBasicClusters") << "Error! can't get collection with label " << l.module;
129  }
130 
131  const reco::BasicClusterCollection *barrelBasicClusters = pBarrelBasicClusters.product();
132  hist_EB_BC_Size_->Fill(barrelBasicClusters->size());
133 
134  for (reco::BasicClusterCollection::const_iterator aClus = barrelBasicClusters->begin();
135  aClus != barrelBasicClusters->end();
136  aClus++) {
137  hist_EB_BC_NumRecHits_->Fill(aClus->size());
138  hist_EB_BC_ET_->Fill(aClus->energy() / std::cosh(aClus->position().eta()));
139  hist_EB_BC_Eta_->Fill(aClus->position().eta());
140  hist_EB_BC_Phi_->Fill(aClus->position().phi());
141 
142  hist_EB_BC_ET_vs_Eta_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta());
143  hist_EB_BC_ET_vs_Phi_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi());
144  }
145 
146  edm::Handle<reco::BasicClusterCollection> pEndcapBasicClusters;
147 
148  evt.getByToken(endcapBasicClusterCollection_, pEndcapBasicClusters);
149  if (!pEndcapBasicClusters.isValid()) {
150  Labels l;
151  labelsForToken(endcapBasicClusterCollection_, l);
152  edm::LogError("EgammaBasicClusters") << "Error! can't get collection with label " << l.module;
153  }
154 
155  const reco::BasicClusterCollection *endcapBasicClusters = pEndcapBasicClusters.product();
156  hist_EE_BC_Size_->Fill(endcapBasicClusters->size());
157 
158  for (reco::BasicClusterCollection::const_iterator aClus = endcapBasicClusters->begin();
159  aClus != endcapBasicClusters->end();
160  aClus++) {
161  hist_EE_BC_NumRecHits_->Fill(aClus->size());
162  hist_EE_BC_ET_->Fill(aClus->energy() / std::cosh(aClus->position().eta()));
163  hist_EE_BC_Eta_->Fill(aClus->position().eta());
164  hist_EE_BC_Phi_->Fill(aClus->position().phi());
165 
166  hist_EE_BC_ET_vs_Eta_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->eta());
167  hist_EE_BC_ET_vs_Phi_->Fill(aClus->energy() / std::cosh(aClus->position().eta()), aClus->phi());
168  hist_EE_BC_ET_vs_R_->Fill(aClus->energy() / std::cosh(aClus->position().eta()),
169  std::sqrt(std::pow(aClus->x(), 2) + std::pow(aClus->y(), 2)));
170  }
171 }
EgammaBasicClusters.h
EgammaBasicClusters::hist_EE_BC_Size_
MonitorElement * hist_EE_BC_Size_
Definition: EgammaBasicClusters.h:43
Handle.h
EgammaBasicClusters::hist_EB_BC_Size_
MonitorElement * hist_EB_BC_Size_
Definition: EgammaBasicClusters.h:42
EgammaBasicClusters::hist_EE_BC_NumRecHits_
MonitorElement * hist_EE_BC_NumRecHits_
Definition: EgammaBasicClusters.h:45
EgammaBasicClusters::hist_EB_BC_ET_vs_Eta_
MonitorElement * hist_EB_BC_ET_vs_Eta_
Definition: EgammaBasicClusters.h:52
MessageLogger.h
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::Run
Definition: Run.h:45
BasicCluster.h
edm
HLT enums.
Definition: AlignableModifier.h:19
EgammaBasicClusters::hist_EE_BC_ET_vs_Phi_
MonitorElement * hist_EE_BC_ET_vs_Phi_
Definition: EgammaBasicClusters.h:55
EgammaBasicClusters::hsPhi_
HistSpec hsPhi_
Definition: EgammaBasicClusters.h:39
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
HistSpec::bins
int bins
Definition: HistSpec.h:9
EgammaBasicClusters::hist_EE_BC_ET_vs_Eta_
MonitorElement * hist_EE_BC_ET_vs_Eta_
Definition: EgammaBasicClusters.h:54
DQMStore.h
EgammaBasicClusters::EgammaBasicClusters
EgammaBasicClusters(const edm::ParameterSet &)
Definition: EgammaBasicClusters.cc:13
EgammaBasicClusters::hist_EB_BC_Phi_
MonitorElement * hist_EB_BC_Phi_
Definition: EgammaBasicClusters.h:50
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
EgammaBasicClusters::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: EgammaBasicClusters.cc:42
EgammaBasicClusters::hist_EE_BC_Phi_
MonitorElement * hist_EE_BC_Phi_
Definition: EgammaBasicClusters.h:51
MakerMacros.h
EgammaBasicClusters::hsET_
HistSpec hsET_
Definition: EgammaBasicClusters.h:37
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
HistSpec::max
double max
Definition: HistSpec.h:8
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
EgammaBasicClusters::~EgammaBasicClusters
~EgammaBasicClusters() override
Definition: EgammaBasicClusters.cc:40
reco::BasicClusterCollection
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
Definition: BasicClusterFwd.h:16
EgammaBasicClusters::hist_EE_BC_ET_vs_R_
MonitorElement * hist_EE_BC_ET_vs_R_
Definition: EgammaBasicClusters.h:56
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
EgammaBasicClusters::hsNumRecHits_
HistSpec hsNumRecHits_
Definition: EgammaBasicClusters.h:36
EgammaBasicClusters::endcapBasicClusterCollection_
edm::EDGetTokenT< reco::BasicClusterCollection > endcapBasicClusterCollection_
Definition: EgammaBasicClusters.h:33
EgammaBasicClusters::hist_EE_BC_Eta_
MonitorElement * hist_EE_BC_Eta_
Definition: EgammaBasicClusters.h:49
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
EgammaBasicClusters::hist_EE_BC_ET_
MonitorElement * hist_EE_BC_ET_
Definition: EgammaBasicClusters.h:47
HistSpec::min
double min
Definition: HistSpec.h:7
EgammaBasicClusters::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: EgammaBasicClusters.cc:122
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
EgammaBasicClusters::hist_EB_BC_ET_vs_Phi_
MonitorElement * hist_EB_BC_ET_vs_Phi_
Definition: EgammaBasicClusters.h:53
EgammaBasicClusters::hsSize_
HistSpec hsSize_
Definition: EgammaBasicClusters.h:35
EgammaBasicClusters::hsR_
HistSpec hsR_
Definition: EgammaBasicClusters.h:40
dqm::implementation::IBooker
Definition: DQMStore.h:43
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
EgammaBasicClusters::hist_EB_BC_ET_
MonitorElement * hist_EB_BC_ET_
Definition: EgammaBasicClusters.h:46
EgammaBasicClusters::barrelBasicClusterCollection_
edm::EDGetTokenT< reco::BasicClusterCollection > barrelBasicClusterCollection_
Definition: EgammaBasicClusters.h:32
EgammaBasicClusters::hsEta_
HistSpec hsEta_
Definition: EgammaBasicClusters.h:38
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
EgammaBasicClusters::hist_EB_BC_NumRecHits_
MonitorElement * hist_EB_BC_NumRecHits_
Definition: EgammaBasicClusters.h:44
EgammaBasicClusters::hist_EB_BC_Eta_
MonitorElement * hist_EB_BC_Eta_
Definition: EgammaBasicClusters.h:48