17 const auto v = position - origin;
21 #include <unordered_map>
45 "SuperClusterImporter");
52 _srcTowers(sumes.consumes<
CaloTowerCollection>(conf.getParameter<edm::InputTag>(
"source_towers"))),
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);
91 const double scpT =
ptFast(sc->energy(),sc->position(),
_zero);
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);
110 const double scpT =
ptFast(sc->energy(),sc->position(),
_zero);
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)
static int position[TOTALCHAMBERS][3]
SuperClusterImporter(const edm::ParameterSet &, edm::ConsumesCollector &)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::unique_ptr< EgammaHadTower > _hadTower
Container::value_type value_type
edm::EDGetTokenT< CaloTowerCollection > _srcTowers
XYZPointD XYZPoint
point in space with cartesian internal representation
_superClustersArePF(conf.getParameter< bool >("superClustersArePF"))
T const * product() const
#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)