1 #ifndef __Basic2DGenericPFlowPositionCalc_H__ 2 #define __Basic2DGenericPFlowPositionCalc_H__ 21 std::vector<double> logWeightDenom;
22 std::vector<float> logWeightDenomInv;
24 if (conf.
exists(
"logWeightDenominatorByDetector")) {
25 const std::vector<edm::ParameterSet>& logWeightDenominatorByDetectorPSet =
28 for (
const auto&
pset : logWeightDenominatorByDetectorPSet) {
29 if (!
pset.exists(
"detector")) {
30 throw cms::Exception(
"logWeightDenominatorByDetectorPSet") <<
"logWeightDenominator : detector not specified";
36 std::vector<int> depthsT =
pset.getParameter<std::vector<int> >(
"depths");
37 std::vector<double> logWeightDenomT =
pset.getParameter<std::vector<double> >(
"logWeightDenominator");
38 if (logWeightDenomT.size() != depthsT.size()) {
39 throw cms::Exception(
"logWeightDenominator") <<
"logWeightDenominator mismatch with the numbers of depths";
41 for (
unsigned int i = 0;
i < depthsT.size(); ++
i) {
43 detectorEnum.push_back(1);
45 detectorEnum.push_back(2);
46 depths.push_back(depthsT[
i]);
47 logWeightDenom.push_back(logWeightDenomT[i]);
52 detectorEnum.push_back(0);
54 logWeightDenom.push_back(conf.
getParameter<
double>(
"logWeightDenominator"));
57 for (
unsigned int i = 0;
i < depths.size(); ++
i) {
58 logWeightDenomInv.push_back(1. / logWeightDenom[
i]);
62 _logWeightDenom = std::make_tuple(detectorEnum, depths, logWeightDenomInv);
65 if (conf.
exists(
"timeResolutionCalcBarrel")) {
70 if (conf.
exists(
"timeResolutionCalcEndcap")) {
81 edm::LogError(
"Basic2DGenericPFlowPositionCalc") <<
"posCalcNCrystals not valid";
94 std::tuple<std::vector<int>, std::vector<int>, std::vector<float> >
_logWeightDenom;
T getParameter(std::string const &) const
Basic2DGenericPFlowPositionCalc(const edm::ParameterSet &conf)
VParameterSet const & getParameterSetVector(std::string const &name) const
void calculateAndSetPositionActual(reco::PFCluster &) const
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void calculateAndSetPositions(reco::PFClusterCollection &) override
ParameterSet const & getParameterSet(std::string const &) const
std::unique_ptr< CaloRecHitResolutionProvider > _timeResolutionCalcBarrel
void calculateAndSetPosition(reco::PFCluster &) override
std::tuple< std::vector< int >, std::vector< int >, std::vector< float > > _logWeightDenom
const int _posCalcNCrystals
std::unique_ptr< CaloRecHitResolutionProvider > _timeResolutionCalcEndcap
Basic2DGenericPFlowPositionCalc & operator=(const Basic2DGenericPFlowPositionCalc &)=delete
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
#define DEFINE_EDM_PLUGIN(factory, type, name)
const float _minAllowedNorm