65 barrelSuperClusterProducer_ =
67 endcapSuperClusterProducer_ =
76 caloTopologyToken_ = esConsumes<CaloTopology, CaloTopologyRecord>();
78 cluster_pt_thresh_ = ps.
getParameter<
double>(
"cluster_pt_thresh");
79 single_cluster_thresh_ = ps.
getParameter<
double>(
"single_cluster_thresh");
82 produces<EBDigiCollection>(selectedEcalEBDigiCollection_);
83 produces<EEDigiCollection>(selectedEcalEEDigiCollection_);
90 evt.
getByToken(barrelSuperClusterProducer_, pBarrelSuperClusters);
98 evt.
getByToken(endcapSuperClusterProducer_, pEndcapSuperClusters);
105 bool meet_single_thresh =
false;
110 float energy1 = clus1.
energy();
111 float theta1 = 2 * atan(
exp(-1. *
eta1));
112 float cluspt1 = energy1 *
sin(theta1);
113 if (cluspt1 > cluster_pt_thresh_) {
114 saveBarrelSuperClusters.push_back(clus1);
115 if (cluspt1 > single_cluster_thresh_)
116 meet_single_thresh =
true;
124 float energy1 = clus1.
energy();
125 float theta1 = 2 * atan(
exp(-1. *
eta1));
126 float cluspt1 = energy1 *
sin(theta1);
127 if (cluspt1 > cluster_pt_thresh_) {
128 saveEndcapSuperClusters.push_back(clus1);
129 if (cluspt1 > single_cluster_thresh_)
130 meet_single_thresh =
true;
134 auto SEBDigiCol = std::make_unique<EBDigiCollection>();
135 auto SEEDigiCol = std::make_unique<EEDigiCollection>();
136 int TotClus = saveBarrelSuperClusters.size() + saveEndcapSuperClusters.size();
138 if (TotClus >= nclus_sel_ || meet_single_thresh) {
139 if (!saveBarrelSuperClusters.empty()) {
155 std::vector<DetId> saveTheseDetIds;
157 for (
int loop = 0;
loop <
int(saveBarrelSuperClusters.size());
loop++) {
162 DetId maxDetId = EcalClusterTools::getMaximum(*bc,
rechits).first;
165 saveTheseDetIds.push_back(detId);
167 for (
int detloop = 0; detloop <
int(saveTheseDetIds.size()); ++detloop) {
171 if (detL == blah->id()) {
173 SEBDigiCol->push_back(detL);
176 for (
int iq = 0; iq < myDigi.
size(); ++iq) {
188 if (!saveEndcapSuperClusters.empty()) {
206 std::set<DetId> saveTheseDetIds;
208 for (
int loop = 0;
loop <
int(saveEndcapSuperClusters.size());
loop++) {
213 DetId maxDetId = EcalClusterTools::getMaximum(*bc,
rechits).first;
216 saveTheseDetIds.insert(detId);
220 std::set<DetId>::const_iterator
finder = saveTheseDetIds.find(blah->id());
221 if (
finder != saveTheseDetIds.end()) {
224 if (detL == blah->id()) {
226 SEEDigiCol->push_back(detL);
228 for (
int iq = 0; iq < myDigi.
size(); ++iq) {
234 if (eecounter >=
int(saveTheseDetIds.size()))
247 evt.
put(
std::move(SEBDigiCol), selectedEcalEBDigiCollection_);
248 evt.
put(
std::move(SEEDigiCol), selectedEcalEEDigiCollection_);