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 }
MonitorElement * hist_EE_BC_NumRecHits_
MonitorElement * hist_EB_BC_Eta_
MonitorElement * hist_EE_BC_ET_vs_R_
MonitorElement * hist_EE_BC_Phi_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
int bins
Definition: HistSpec.h:9
MonitorElement * hist_EB_BC_NumRecHits_
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * hist_EE_BC_ET_vs_Phi_
T const * product() const
Definition: Handle.h:70
MonitorElement * hist_EB_BC_ET_
double max
Definition: HistSpec.h:8
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:526
Log< level::Error, false > LogError
MonitorElement * hist_EB_BC_ET_vs_Eta_
MonitorElement * hist_EE_BC_ET_vs_Eta_
double min
Definition: HistSpec.h:7
void Fill(long long x)
MonitorElement * hist_EB_BC_ET_vs_Phi_
MonitorElement * hist_EE_BC_Eta_
T sqrt(T t)
Definition: SSEVec.h:23
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
EgammaBasicClusters(const edm::ParameterSet &)
MonitorElement * hist_EB_BC_Phi_
edm::EDGetTokenT< reco::BasicClusterCollection > barrelBasicClusterCollection_
MonitorElement * hist_EE_BC_ET_
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:221
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * hist_EB_BC_Size_
fixed size matrix
HLT enums.
MonitorElement * hist_EE_BC_Size_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
edm::EDGetTokenT< reco::BasicClusterCollection > endcapBasicClusterCollection_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
Definition: Run.h:45