24 barrelSuperClusterProducer_ =
26 endcapSuperClusterProducer_ =
35 caloTopologyToken_ = esConsumes<CaloTopology, CaloTopologyRecord>();
37 cluster_pt_thresh_ = ps.
getParameter<
double>(
"cluster_pt_thresh");
38 single_cluster_thresh_ = ps.
getParameter<
double>(
"single_cluster_thresh");
41 produces<EBDigiCollection>(selectedEcalEBDigiCollection_);
42 produces<EEDigiCollection>(selectedEcalEEDigiCollection_);
49 evt.
getByToken(barrelSuperClusterProducer_, pBarrelSuperClusters);
57 evt.
getByToken(endcapSuperClusterProducer_, pEndcapSuperClusters);
64 bool meet_single_thresh =
false;
69 float energy1 = clus1.
energy();
70 float theta1 = 2 * atan(
exp(-1. *
eta1));
71 float cluspt1 = energy1 *
sin(theta1);
72 if (cluspt1 > cluster_pt_thresh_) {
73 saveBarrelSuperClusters.push_back(clus1);
74 if (cluspt1 > single_cluster_thresh_)
75 meet_single_thresh =
true;
83 float energy1 = clus1.
energy();
84 float theta1 = 2 * atan(
exp(-1. *
eta1));
85 float cluspt1 = energy1 *
sin(theta1);
86 if (cluspt1 > cluster_pt_thresh_) {
87 saveEndcapSuperClusters.push_back(clus1);
88 if (cluspt1 > single_cluster_thresh_)
89 meet_single_thresh =
true;
93 auto SEBDigiCol = std::make_unique<EBDigiCollection>();
94 auto SEEDigiCol = std::make_unique<EEDigiCollection>();
95 int TotClus = saveBarrelSuperClusters.size() + saveEndcapSuperClusters.size();
97 if (TotClus >= nclus_sel_ || meet_single_thresh) {
98 if (!saveBarrelSuperClusters.empty()) {
114 std::vector<DetId> saveTheseDetIds;
116 for (
int loop = 0;
loop <
int(saveBarrelSuperClusters.size());
loop++) {
121 DetId maxDetId = EcalClusterTools::getMaximum(*bc,
rechits).first;
124 saveTheseDetIds.push_back(detId);
126 for (
int detloop = 0; detloop <
int(saveTheseDetIds.size()); ++detloop) {
130 if (detL == blah->id()) {
132 SEBDigiCol->push_back(detL);
135 for (
int iq = 0; iq < myDigi.
size(); ++iq) {
147 if (!saveEndcapSuperClusters.empty()) {
165 std::set<DetId> saveTheseDetIds;
167 for (
int loop = 0;
loop <
int(saveEndcapSuperClusters.size());
loop++) {
172 DetId maxDetId = EcalClusterTools::getMaximum(*bc,
rechits).first;
175 saveTheseDetIds.insert(detId);
179 std::set<DetId>::const_iterator
finder = saveTheseDetIds.find(blah->id());
180 if (
finder != saveTheseDetIds.end()) {
183 if (detL == blah->id()) {
185 SEEDigiCol->push_back(detL);
187 for (
int iq = 0; iq < myDigi.
size(); ++iq) {
193 if (eecounter >=
int(saveTheseDetIds.size()))
206 evt.
put(
std::move(SEBDigiCol), selectedEcalEBDigiCollection_);
207 evt.
put(
std::move(SEEDigiCol), selectedEcalEEDigiCollection_);