1 #ifndef __CorrectedECALPFClusterProducer__ 2 #define __CorrectedECALPFClusterProducer__ 23 bool sortByKey(
const EEPSPair&
a,
const EEPSPair&
b) {
24 return a.first < b.first;
33 if( eeclus.
z()*psclus.
z() < 0 )
return -1.0;
34 auto deta=
std::abs(eepos.eta() - pspos.eta());
35 if( deta > 0.3 )
return -1.0;
37 if( dphi > 0.6 )
return -1.0;
52 _inputPS = consumes<reco::PFClusterCollection>( inputPS );
57 produces<reco::PFCluster::EEtoPSAssociation>();
58 produces<reco::PFClusterCollection>();
75 auto clusters_out = std::make_unique<reco::PFClusterCollection>();
76 auto association_out = std::make_unique<reco::PFCluster::EEtoPSAssociation>();
83 auto const & ecals = *handleECAL;
84 auto const &
pss = *handlePS;
86 clusters_out->reserve(ecals.size());
87 association_out->reserve(ecals.size());
88 clusters_out->insert(clusters_out->end(),
89 ecals.begin(),ecals.end());
91 for(
unsigned i = 0;
i <
pss.size(); ++
i ) {
92 switch(
pss[
i].layer() ) {
102 for(
size_t ic = 0; ic < ecals.size(); ++ic ) {
104 auto dist = testPreshowerDistance(ecals[ic],
pss[
i]);
106 if( dist < min_dist ) {
113 association_out->push_back(std::make_pair(eematch,psclus));
118 _corrector->correctEnergies(e,es,*association_out,*clusters_out);
120 association_out->shrink_to_fit();
128 desc.
add<
double>(
"minimumPSEnergy",0.0);
132 psd0.
add<
bool>(
"applyCrackCorrections",
false);
133 psd0.
add<
bool>(
"applyMVACorrections",
false);
134 psd0.
add<
bool>(
"srfAwareCorrection",
false);
135 psd0.
add<
bool>(
"setEnergyUncertainty",
false);
136 psd0.
add<
bool>(
"autoDetectBunchSpacing",
true);
137 psd0.
add<
int>(
"bunchSpacing",25);
138 psd0.
add<
double>(
"maxPtForMVAEvaluation",-99.);
148 descriptions.
add(
"particleFlowClusterECAL",desc);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::PFClusterCollection > _inputPS
std::pair< ALIstring, ALIstring > pss
CorrectedECALPFClusterProducer(const edm::ParameterSet &conf)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static double testECALAndPSByRecHit(const reco::PFCluster &clusterECAL, const reco::PFCluster &clusterPS, bool debug=false)
double z() const
z coordinate of cluster centroid
#define DEFINE_FWK_MODULE(type)
Container::value_type value_type
const REPPoint & positionREP() const
cluster position: rho, eta, phi
void produce(edm::Event &e, const edm::EventSetup &es) override
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const double _minimumPSEnergy
edm::EDGetTokenT< reco::PFClusterCollection > _inputECAL
std::unique_ptr< PFClusterEMEnergyCorrector > _corrector
ParameterSet const & getParameterSet(std::string const &) const
reco::PFCluster::EEtoPSAssociation::value_type EEPSPair
bool sortByKey(const EEPSPair &a, const EEPSPair &b)
void add(std::string const &label, ParameterSetDescription const &psetDescription)