17 const auto v = position - origin;
21 #include <unordered_map>
45 "SuperClusterImporter");
53 _maxHoverE(conf.getParameter<double>(
"maximumHoverE")),
54 _pTbyPass(conf.getParameter<double>(
"minPTforBypass")),
55 _minSCPt(conf.getParameter<double>(
"minSuperClusterPt")),
76 elems.reserve(elems.size()+eb_scs->size()+ee_scs->size());
78 auto SCs_end = std::partition(elems.begin(),elems.end(),
79 [](
const ElementType&
a){
83 auto bsc = eb_scs->cbegin();
84 auto esc = eb_scs->cend();
87 for(
auto sc = bsc;
sc != esc; ++
sc ) {
90 auto sc_elem = std::find_if(elems.begin(),SCs_end,myEqual);
92 const double H_tower = (
_hadTower->getDepth1HcalESum(*
sc) +
94 const double HoverE = H_tower/
sc->
energy();
95 if( sc_elem == SCs_end && scpT >
_minSCPt &&
99 SCs_end = elems.insert(SCs_end,ElementType(scbe));
104 bsc = ee_scs->cbegin();
105 esc = ee_scs->cend();
106 for(
auto sc = bsc;
sc != esc; ++
sc ) {
109 auto sc_elem = std::find_if(elems.begin(),SCs_end,myEqual);
111 const double H_tower = (
_hadTower->getDepth1HcalESum(*
sc) +
113 const double HoverE = H_tower/
sc->
energy();
114 if( sc_elem == SCs_end && scpT >
_minSCPt &&
118 SCs_end = elems.insert(SCs_end,ElementType(scbe));
122 elems.shrink_to_fit();
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< reco::SuperClusterCollection > _srcEE
void importToBlock(const edm::Event &, ElementList &) const override
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
edm::EDGetTokenT< reco::SuperClusterCollection > _srcEB
double ptFast(const double energy, const math::XYZPoint &position, const math::XYZPoint &origin)
SuperClusterImporter(const edm::ParameterSet &, edm::ConsumesCollector &)
Container::value_type value_type
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
float energy() const
Energy. Note this is taken from the first SimTrack only.
std::unique_ptr< EgammaHadTower > _hadTower
edm::EDGetTokenT< CaloTowerCollection > _srcTowers
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
_superClustersArePF(conf.getParameter< bool >("superClustersArePF"))
static int position[264][3]
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
static const math::XYZPoint _zero
void updateEventSetup(const edm::EventSetup &es) override
void setFromPFSuperCluster(bool val)