67 std::map<std::string,double> providedParameters;
68 providedParameters.insert(std::make_pair(
"LogWeighted",ps.
getParameter<
bool>(
"posCalc_logweight")));
69 providedParameters.insert(std::make_pair(
"T0_barl",ps.
getParameter<
double>(
"posCalc_t0")));
70 providedParameters.insert(std::make_pair(
"W0",ps.
getParameter<
double>(
"posCalc_w0")));
71 providedParameters.insert(std::make_pair(
"X0",ps.
getParameter<
double>(
"posCalc_x0")));
99 edm::LogWarning(
"MissingInput")<<
"could not get a handle on the clean Super Clusters!";
107 edm::LogWarning(
"MissingInput")<<
"could not get a handle on the unclean Super Clusters!";
125 int uncleanSize = pUncleanSC->size();
126 int cleanSize = pCleanSC->size();
128 LogDebug(
"EcalCleaning") <<
"Size of Clean Collection: " << cleanSize
129 <<
", uncleanSize: " << uncleanSize << std::endl;
132 std::vector<int> isUncleanOnly;
133 std::vector<int> basicClusterOwner;
134 std::vector<int> isSeed;
135 for (
int isc =0; isc< uncleanSize; ++isc) {
137 const std::vector< std::pair<DetId, float> > & uhits = unscRef->hitsAndFractions();
138 int uhitsSize = uhits.size();
139 bool foundTheSame =
false;
140 for (
int jsc=0; jsc < cleanSize; ++jsc) {
142 const std::vector< std::pair<DetId, float> > & chits = cscRef->hitsAndFractions();
143 int chitsSize = chits.size();
145 if (unscRef->seed()->seed() == cscRef->seed()->seed() && chitsSize == uhitsSize) {
149 for (
int i=0;
i< chitsSize; ++
i) {
150 if (uhits[
i].
first != chits[
i].
first ) { foundTheSame=
false;
break;}
156 isUncleanOnly.push_back(0);
161 if (not foundTheSame) {
163 isUncleanOnly.push_back(1);
167 basicClusters.push_back(**bciter);
168 basicClusterOwner.push_back(isc);
172 int bcSize = basicClusters.size();
174 LogDebug(
"EcalCleaning") <<
"Found cleaned SC: " << cleanSize <<
" uncleaned SC: "
175 << uncleanSize <<
" from which " << scRefs->
size()
176 <<
" will become refs to the cleaned collection" ;
183 basicClusters_p->assign(basicClusters.begin(), basicClusters.end());
187 edm::LogWarning(
"MissingInput")<<
"could not get a handle on the BasicClusterCollection!" << std::endl;
191 LogDebug(
"EcalCleaning")<<
"Got the BasicClusters from the event again";
195 for (
int isc=0; isc< uncleanSize; ++isc) {
196 if (isUncleanOnly[isc]==1) {
201 for (
int jbc=0; jbc< bcSize; ++jbc) {
202 if (basicClusterOwner[jbc]==isc) {
205 if (energy< currentClu->
energy()) {
206 energy = currentClu->energy(); seed = currentClu;
211 reco::SuperCluster newSC(unscRef->energy(), unscRef->position(), seed, clusterPtrVector );
212 superClusters.push_back(newSC);
217 std::auto_ptr< reco::SuperClusterRefVector > scRefs_p( scRefs );
223 superClusters_p->assign(superClusters.begin(), superClusters.end());
225 LogDebug(
"EcalCleaning")<<
"Hybrid Clusters (Basic/Super) added to the Event! :-)";
T getParameter(std::string const &) const
void push_back(Ptr< T > const &iPtr)
std::string refScCollection_
edm::Ptr< CaloCluster > CaloClusterPtr
edm::InputTag cleanScInputTag_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::string scCollection_
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
std::string hitcollection_
edm::RefVector< SuperClusterCollection > SuperClusterRefVector
vector of references to objects in the same colletion of SuperCluster objects
std::string bcCollection_
CleanAndMergeProducer(const edm::ParameterSet &ps)
edm::InputTag uncleanScInputTag_