28 barrelSuperClusterProducer_ =
30 endcapSuperClusterProducer_ =
44 cluster_pt_thresh_ = ps.
getParameter<
double>(
"cluster_pt_thresh");
45 single_cluster_thresh_ = ps.
getParameter<
double>(
"single_cluster_thresh");
48 produces<EBDigiCollection>(selectedEcalEBDigiCollection_);
49 produces<EEDigiCollection>(selectedEcalEEDigiCollection_);
59 evt.
getByToken(barrelSuperClusterProducer_, pBarrelSuperClusters);
67 evt.
getByToken(endcapSuperClusterProducer_, pEndcapSuperClusters);
74 bool meet_single_thresh =
false;
76 for (
int loop=0;
loop<int(BarrelSuperClusters.size());
loop++){
78 float eta1 = clus1.
eta();
79 float energy1 = clus1.
energy();
80 float theta1 = 2*atan(
exp(-1.*eta1));
81 float cluspt1 = energy1 *
sin(theta1);
82 if (cluspt1 > cluster_pt_thresh_){
83 saveBarrelSuperClusters.push_back(clus1);
84 if (cluspt1 > single_cluster_thresh_)
85 meet_single_thresh =
true;
91 for (
int loop=0;
loop<int(EndcapSuperClusters.size());
loop++){
93 float eta1 = clus1.
eta();
94 float energy1 = clus1.
energy();
95 float theta1 = 2*atan(
exp(-1.*eta1));
96 float cluspt1 = energy1 *
sin(theta1);
97 if (cluspt1 > cluster_pt_thresh_){
98 saveEndcapSuperClusters.push_back(clus1);
99 if (cluspt1 > single_cluster_thresh_)
100 meet_single_thresh =
true;
106 int TotClus = saveBarrelSuperClusters.size() + saveEndcapSuperClusters.size();
108 if (TotClus >= nclus_sel_ || meet_single_thresh){
110 if (saveBarrelSuperClusters.size() > 0){
130 std::vector<DetId> saveTheseDetIds;
132 for (
int loop = 0;
loop < int(saveBarrelSuperClusters.size());
loop++){
137 std::pair<DetId, float> EDetty =
138 EcalClusterTools::getMaximum(*bc,rechits);
140 std::vector<DetId> detvec =
141 EcalClusterTools::matrixDetId(topology,EDetty.first, -1, 1, -1, 1);
143 for (
int ik = 0;ik<int(detvec.size());++ik)
144 saveTheseDetIds.push_back(detvec[ik]);
147 for (
int detloop=0; detloop < int(saveTheseDetIds.size());++detloop){
151 blah!=digis->
end();blah++){
153 if (detL == blah->id()){
155 SEBDigiCol->push_back(detL);
158 for (
int iq =0;iq<myDigi.
size();++iq){
172 if (saveEndcapSuperClusters.size() > 0){
192 std::set<DetId> saveTheseDetIds;
194 for (
int loop = 0;
loop < int(saveEndcapSuperClusters.size());
loop++){
199 std::pair<DetId, float> EDetty = EcalClusterTools::getMaximum(*bc,rechits);
201 std::vector<DetId> detvec =
202 EcalClusterTools::matrixDetId(topology,EDetty.first, -1, 1, -1, 1);
204 for (
int ik = 0;ik<int(detvec.size());++ik)
205 saveTheseDetIds.insert(detvec[ik]);
209 blah!=digis->
end();blah++){
210 std::set<DetId>::const_iterator finder = saveTheseDetIds.find(blah->id());
211 if (finder!=saveTheseDetIds.end()){
214 if (detL == blah->id()){
216 SEEDigiCol->push_back(detL);
218 for (
int iq =0;iq<myDigi.
size();++iq){
225 if (eecounter >=
int(saveTheseDetIds.size()))
break;
238 evt.
put(SEBDigiCol, selectedEcalEBDigiCollection_);
239 evt.
put(SEEDigiCol, selectedEcalEEDigiCollection_);
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
EcalMGPASample sample(int i) const
const_iterator begin() const
uint16_t raw() const
get the raw word
double eta() const
pseudorapidity of cluster centroid
T const * get() const
Returns C++ pointer to the item.
EcalDigiSelector(const edm::ParameterSet &ps)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
double energy() const
cluster energy
void produce(edm::Event &, const edm::EventSetup &)
T const * product() const
T const * product() const
const_iterator end() const
void setSample(int i, EcalMGPASample sam)
const CaloClusterPtr & seed() const
seed BasicCluster