1 #ifndef __Basic2DGenericPFlowPositionCalc_H__ 2 #define __Basic2DGenericPFlowPositionCalc_H__ 23 std::vector<double> logWeightDenom;
24 std::vector<float> logWeightDenomInv;
26 if(conf.
exists(
"logWeightDenominatorByDetector")) {
28 const std::vector<edm::ParameterSet>& logWeightDenominatorByDetectorPSet = conf.
getParameterSetVector(
"logWeightDenominatorByDetector");
30 for(
const auto&
pset : logWeightDenominatorByDetectorPSet ) {
31 if(!
pset.exists(
"detector")) {
33 <<
"logWeightDenominator : detector not specified";
39 std::vector<int> depthsT=
pset.getParameter<std::vector<int> >(
"depths");
40 std::vector<double> logWeightDenomT=
pset.getParameter<std::vector<double> >(
"logWeightDenominator");
41 if(logWeightDenomT.size()!=depthsT.size()) {
43 <<
"logWeightDenominator mismatch with the numbers of depths";
45 for(
unsigned int i=0;
i < depthsT.size();++
i){
46 if(det==
std::string(
"HCAL_BARREL1")) detectorEnum.push_back(1);
47 if(det==
std::string(
"HCAL_ENDCAP")) detectorEnum.push_back(2);
48 depths.push_back(depthsT[
i]);
49 logWeightDenom.push_back(logWeightDenomT[i]);
54 detectorEnum.push_back(0);
56 logWeightDenom.push_back(conf.
getParameter<
double>(
"logWeightDenominator"));
59 for(
unsigned int i=0;
i < depths.size();++
i){
60 logWeightDenomInv.push_back(1./logWeightDenom[
i]);
64 _logWeightDenom = std::make_tuple(detectorEnum,depths,logWeightDenomInv);
67 if( conf.
exists(
"timeResolutionCalcBarrel") ) {
73 if( conf.
exists(
"timeResolutionCalcEndcap") ) {
85 edm::LogError(
"Basic2DGenericPFlowPositionCalc") <<
"posCalcNCrystals not valid";
111 "Basic2DGenericPFlowPositionCalc");
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
std::tuple< std::vector< int >,std::vector< int >, std::vector< float > > _logWeightDenom
void calculateAndSetPositions(reco::PFClusterCollection &) override
ParameterSet const & getParameterSet(std::string const &) const
std::unique_ptr< CaloRecHitResolutionProvider > _timeResolutionCalcBarrel
void calculateAndSetPosition(reco::PFCluster &) override
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