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++) {
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++) {
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_);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Sin< T >::type sin(const T &t)
T const * product() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::string selectedEcalEEDigiCollection_
double getMaximum(TObjArray *array)
edm::EDGetTokenT< reco::SuperClusterCollection > barrelSuperClusterProducer_
std::string selectedEcalEBDigiCollection_
T const * product() const
EcalDigiSelector(const edm::ParameterSet &ps)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
double cluster_pt_thresh_
EcalMGPASample sample(int i) const
edm::EDGetTokenT< EEDigiCollection > EcalEEDigiToken_
#define DEFINE_FWK_MODULE(type)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
T const * get() const
Returns C++ pointer to the item.
const_iterator end() const
double energy() const
cluster energy
const_iterator begin() const
The iterator returned can not safely be used across threads.
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
const CaloClusterPtr & seed() const
seed BasicCluster
double eta() const
pseudorapidity of cluster centroid
edm::EDGetTokenT< EBDigiCollection > EcalEBDigiToken_
edm::EDGetTokenT< EcalRecHitCollection > EcalEERecHitToken_
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::SuperClusterCollection > endcapSuperClusterProducer_
uint16_t raw() const
get the raw word
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopologyToken_
edm::EDGetTokenT< EcalRecHitCollection > EcalEBRecHitToken_
double single_cluster_thresh_