42 cluster_pt_thresh_ = ps.
getParameter<
double>(
"cluster_pt_thresh");
43 single_cluster_thresh_ = ps.
getParameter<
double>(
"single_cluster_thresh");
46 produces<EBDigiCollection>(selectedEcalEBDigiCollection_);
47 produces<EEDigiCollection>(selectedEcalEEDigiCollection_);
62 evt.
getByLabel(barrelSuperClusterProducer_, pBarrelSuperClusters);
63 if (!pBarrelSuperClusters.
isValid()){
65 <<
"can't get collection with label " << barrelSuperClusterProducer_ ;
73 evt.
getByLabel(endcapSuperClusterProducer_, pEndcapSuperClusters);
74 if (!pEndcapSuperClusters.
isValid()){
76 <<
"Error! can't get collection with label " << endcapSuperClusterProducer_;
83 bool meet_single_thresh =
false;
85 for (
int loop=0;
loop<int(BarrelSuperClusters.size());
loop++){
87 float eta1 = clus1.
eta();
88 float energy1 = clus1.
energy();
89 float theta1 = 2*atan(
exp(-1.*eta1));
90 float cluspt1 = energy1 *
sin(theta1);
91 if (cluspt1 > cluster_pt_thresh_){
92 saveBarrelSuperClusters.push_back(clus1);
93 if (cluspt1 > single_cluster_thresh_)
94 meet_single_thresh =
true;
100 for (
int loop=0;
loop<int(EndcapSuperClusters.size());
loop++){
102 float eta1 = clus1.
eta();
103 float energy1 = clus1.
energy();
104 float theta1 = 2*atan(
exp(-1.*eta1));
105 float cluspt1 = energy1 *
sin(theta1);
106 if (cluspt1 > cluster_pt_thresh_){
107 saveEndcapSuperClusters.push_back(clus1);
108 if (cluspt1 > single_cluster_thresh_)
109 meet_single_thresh =
true;
115 int TotClus = saveBarrelSuperClusters.size() + saveEndcapSuperClusters.size();
119 if (TotClus >= nclus_sel_ || meet_single_thresh){
121 if (saveBarrelSuperClusters.size() > 0){
135 <<
"can't get collection with label " << EcalEBDigiTag_ ;
140 std::vector<DetId> saveTheseDetIds;
142 for (
int loop = 0;
loop < int(saveBarrelSuperClusters.size());
loop++){
147 std::pair<DetId, float> EDetty = tooly.
getMaximum(*bc);
149 std::vector<DetId> detvec = tooly.
matrixDetId(EDetty.first, -1, 1, -1, 1);
151 for (
int ik = 0;ik<int(detvec.size());++ik)
152 saveTheseDetIds.push_back(detvec[ik]);
155 for (
int detloop=0; detloop < int(saveTheseDetIds.size());++detloop){
159 blah!=digis->
end();blah++){
161 if (detL == blah->id()){
163 SEBDigiCol->push_back(detL);
166 for (
int iq =0;iq<myDigi.
size();++iq){
183 if (saveEndcapSuperClusters.size() > 0){
191 <<
"can't get collection with label " << EcalEEDigiTag_ ;
197 std::set<DetId> saveTheseDetIds;
199 for (
int loop = 0;
loop < int(saveEndcapSuperClusters.size());
loop++){
204 std::pair<DetId, float> EDetty = tooly.
getMaximum(*bc);
206 std::vector<DetId> detvec = tooly.
matrixDetId(EDetty.first, -1, 1, -1, 1);
208 for (
int ik = 0;ik<int(detvec.size());++ik)
210 saveTheseDetIds.insert(detvec[ik]);
214 blah!=digis->
end();blah++){
215 std::set<DetId>::const_iterator finder = saveTheseDetIds.find(blah->id());
216 if (finder!=saveTheseDetIds.end()){
219 if (detL == blah->id()){
221 SEEDigiCol->push_back(detL);
223 for (
int iq =0;iq<myDigi.
size();++iq){
230 if (eecounter >=
int(saveTheseDetIds.size()))
break;
245 evt.
put(SEBDigiCol, selectedEcalEBDigiCollection_);
246 evt.
put(SEEDigiCol, selectedEcalEEDigiCollection_);
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void produce(edm::Event &, const edm::EventSetup &)
T const * product() const
const_iterator end() const
virtual ~EcalDigiSelector()
void setSample(int i, EcalMGPASample sam)
const CaloClusterPtr & seed() const
seed BasicCluster