CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
SuperClusterImporter Class Reference
Inheritance diagram for SuperClusterImporter:
BlockElementImporterBase

Public Member Functions

void importToBlock (const edm::Event &, ElementList &) const override
 
 SuperClusterImporter (const edm::ParameterSet &, edm::ConsumesCollector &)
 
void updateEventSetup (const edm::EventSetup &es) override
 
- Public Member Functions inherited from BlockElementImporterBase
 BlockElementImporterBase (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
 BlockElementImporterBase (const BlockElementImporterBase &)=delete
 
const std::string & name () const
 
BlockElementImporterBaseoperator= (const BlockElementImporterBase &)=delete
 
virtual ~BlockElementImporterBase ()=default
 

Private Attributes

const edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord_ctmapToken
 
const double _maxHoverE
 
const double _minSCPt
 
const double _pTbyPass
 
edm::EDGetTokenT< reco::SuperClusterCollection_srcEB
 
edm::EDGetTokenT< reco::SuperClusterCollection_srcEE
 
bool _superClustersArePF
 
CaloGeometry const * caloGeom_
 
const edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeometryToken_
 
bool cutsFromDB
 
const edm::EDGetTokenT< HBHERecHitCollectionhbheRecHitsTag_
 
HcalChannelQuality const * hcalChannelQual_
 
const edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdhcalChannelQualityToken_
 
HcalPFCuts const * hcalCuts = nullptr
 
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcdhcalCutsToken_
 
HcalSeverityLevelComputer const * hcalSev_
 
const edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcdhcalSevLvlComputerToken_
 
HcalTopology const * hcalTopo_
 
const edm::ESGetToken< HcalTopology, HcalRecNumberingRecordhcalTopologyToken_
 
const int maxSeverityHB_
 
const int maxSeverityHE_
 
CaloTowerConstituentsMap const * towerMap_
 

Static Private Attributes

static const math::XYZPoint _zero = math::XYZPoint(0, 0, 0)
 

Additional Inherited Members

- Public Types inherited from BlockElementImporterBase
typedef std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
 
enum  VetoMode { pfRecTrackCollection = 0, ticlSeedingRegion = 1, pfCandidateCollection = 2 }
 

Detailed Description

Definition at line 29 of file SuperClusterImporter.cc.

Constructor & Destructor Documentation

◆ SuperClusterImporter()

SuperClusterImporter::SuperClusterImporter ( const edm::ParameterSet conf,
edm::ConsumesCollector cc 
)

Definition at line 65 of file SuperClusterImporter.cc.

References edm::BeginLuminosityBlock, and gpuPixelDoublets::cc.

67  _srcEB(cc.consumes<reco::SuperClusterCollection>(conf.getParameter<edm::InputTag>("source_eb"))),
68  _srcEE(cc.consumes<reco::SuperClusterCollection>(conf.getParameter<edm::InputTag>("source_ee"))),
69  _maxHoverE(conf.getParameter<double>("maximumHoverE")),
70  _pTbyPass(conf.getParameter<double>("minPTforBypass")),
71  _minSCPt(conf.getParameter<double>("minSuperClusterPt")),
72  hbheRecHitsTag_(cc.consumes(conf.getParameter<edm::InputTag>("hbheRecHitsTag"))),
73  maxSeverityHB_(conf.getParameter<int>("maxSeverityHB")),
74  maxSeverityHE_(conf.getParameter<int>("maxSeverityHE")),
75  cutsFromDB(conf.getParameter<bool>("usePFThresholdsFromDB")),
76  _superClustersArePF(conf.getParameter<bool>("superClustersArePF")),
82  if (cutsFromDB) {
84  edm::ESInputTag("", "withTopo"));
85  }
86 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > _ctmapToken
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::EDGetTokenT< reco::SuperClusterCollection > _srcEE
edm::EDGetTokenT< reco::SuperClusterCollection > _srcEB
BlockElementImporterBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
const edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcalTopologyToken_
const edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > hcalSevLvlComputerToken_
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
const edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitsTag_
const edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > hcalChannelQualityToken_

Member Function Documentation

◆ importToBlock()

void SuperClusterImporter::importToBlock ( const edm::Event e,
BlockElementImporterBase::ElementList elems 
) const
overridevirtual

Implements BlockElementImporterBase.

Definition at line 99 of file SuperClusterImporter.cc.

References _maxHoverE, _minSCPt, _pTbyPass, _srcEB, _srcEE, _superClustersArePF, _zero, a, bsc_activity_cfg::bsc, caloGeom_, HLT_2024v10_cff::distance, MillePedeFileConverter_cfg::e, edm::Ref< C, T, F >::get(), EgammaHcalIsolation::getHcalESumBc(), hbheRecHitsTag_, hcalChannelQual_, hcalCuts, hcalSev_, hcalTopo_, EgammaHcalIsolation::isBehindClusterSeed, maxSeverityHB_, maxSeverityHE_, l1ctLayer1_patternWriters_cff::partition, ptFast(), reco::PFBlockElement::SC, reco::PFBlockElementSuperCluster::setFromPFSuperCluster(), towerMap_, and EgammaHcalIsolation::withinConeAroundCluster.

99  {
100  auto eb_scs = e.getHandle(_srcEB);
101  auto ee_scs = e.getHandle(_srcEE);
102  elems.reserve(elems.size() + eb_scs->size() + ee_scs->size());
103  // setup our elements so that all the SCs are grouped together
104  auto SCs_end =
105  std::partition(elems.begin(), elems.end(), [](auto const& a) { return a->type() == reco::PFBlockElement::SC; });
106  // add eb superclusters
107  auto bsc = eb_scs->cbegin();
108  auto esc = eb_scs->cend();
109  reco::PFBlockElementSuperCluster* scbe = nullptr;
110  reco::SuperClusterRef scref;
111 
113  0, //outercone
115  0, //innercone
116  {{0, 0, 0, 0}},
117  {{0, 0, 0, 0}},
119  {{0, 0, 0, 0, 0, 0, 0}},
120  {{0, 0, 0, 0, 0, 0, 0}},
122  e.get(hbheRecHitsTag_),
123  caloGeom_,
124  hcalTopo_,
126  hcalSev_,
127  towerMap_);
128 
129  for (auto sc = bsc; sc != esc; ++sc) {
130  scref = reco::SuperClusterRef(eb_scs, std::distance(bsc, sc));
131  PFBlockElementSCEqual myEqual(scref);
132  auto sc_elem = std::find_if(elems.begin(), SCs_end, myEqual);
133  const double scpT = ptFast(sc->energy(), sc->position(), _zero);
134  const double H_tower = thisHcalVar_.getHcalESumBc(scref.get(), 0, hcalCuts);
135  const double HoverE = H_tower / sc->energy();
136  if (sc_elem == SCs_end && scpT > _minSCPt && (scpT > _pTbyPass || HoverE < _maxHoverE)) {
137  scbe = new reco::PFBlockElementSuperCluster(scref);
139  SCs_end = elems.emplace(SCs_end, scbe);
140  ++SCs_end; // point to element *after* the new one
141  }
142  } // loop on eb superclusters
143  // add ee superclusters
144  bsc = ee_scs->cbegin();
145  esc = ee_scs->cend();
146  for (auto sc = bsc; sc != esc; ++sc) {
147  scref = reco::SuperClusterRef(ee_scs, std::distance(bsc, sc));
148  PFBlockElementSCEqual myEqual(scref);
149  auto sc_elem = std::find_if(elems.begin(), SCs_end, myEqual);
150  const double scpT = ptFast(sc->energy(), sc->position(), _zero);
151  const double H_tower = thisHcalVar_.getHcalESumBc(scref.get(), 0, hcalCuts);
152  const double HoverE = H_tower / sc->energy();
153  if (sc_elem == SCs_end && scpT > _minSCPt && (scpT > _pTbyPass || HoverE < _maxHoverE)) {
154  scbe = new reco::PFBlockElementSuperCluster(scref);
156  SCs_end = elems.emplace(SCs_end, scbe);
157  ++SCs_end; // point to element *after* the new one
158  }
159  } // loop on ee superclusters
160  elems.shrink_to_fit();
161 }
CaloGeometry const * caloGeom_
CaloTowerConstituentsMap const * towerMap_
HcalTopology const * hcalTopo_
edm::EDGetTokenT< reco::SuperClusterCollection > _srcEE
double getHcalESumBc(const reco::Candidate *c, int depth, const HcalPFCuts *hcalCuts) const
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)
HcalPFCuts const * hcalCuts
HcalSeverityLevelComputer const * hcalSev_
double a
Definition: hdecay.h:121
const edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitsTag_
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
static const math::XYZPoint _zero
HcalChannelQuality const * hcalChannelQual_

◆ updateEventSetup()

void SuperClusterImporter::updateEventSetup ( const edm::EventSetup es)
overridevirtual

Reimplemented from BlockElementImporterBase.

Definition at line 88 of file SuperClusterImporter.cc.

References _ctmapToken, caloGeom_, caloGeometryToken_, cutsFromDB, edm::EventSetup::getData(), hcalChannelQual_, hcalChannelQualityToken_, hcalCuts, hcalCutsToken_, hcalSev_, hcalSevLvlComputerToken_, hcalTopo_, hcalTopologyToken_, and towerMap_.

88  {
90  if (cutsFromDB) {
92  }
97 }
CaloGeometry const * caloGeom_
CaloTowerConstituentsMap const * towerMap_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > _ctmapToken
HcalTopology const * hcalTopo_
HcalPFCuts const * hcalCuts
HcalSeverityLevelComputer const * hcalSev_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
const edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcalTopologyToken_
const edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > hcalSevLvlComputerToken_
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
const edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > hcalChannelQualityToken_
HcalChannelQuality const * hcalChannelQual_

Member Data Documentation

◆ _ctmapToken

const edm::ESGetToken<CaloTowerConstituentsMap, CaloGeometryRecord> SuperClusterImporter::_ctmapToken
private

Definition at line 52 of file SuperClusterImporter.cc.

Referenced by updateEventSetup().

◆ _maxHoverE

const double SuperClusterImporter::_maxHoverE
private

Definition at line 39 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ _minSCPt

const double SuperClusterImporter::_minSCPt
private

Definition at line 39 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ _pTbyPass

const double SuperClusterImporter::_pTbyPass
private

Definition at line 39 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ _srcEB

edm::EDGetTokenT<reco::SuperClusterCollection> SuperClusterImporter::_srcEB
private

Definition at line 38 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ _srcEE

edm::EDGetTokenT<reco::SuperClusterCollection> SuperClusterImporter::_srcEE
private

Definition at line 38 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ _superClustersArePF

bool SuperClusterImporter::_superClustersArePF
private

Definition at line 49 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ _zero

const math::XYZPoint SuperClusterImporter::_zero = math::XYZPoint(0, 0, 0)
staticprivate

Definition at line 50 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ caloGeom_

CaloGeometry const* SuperClusterImporter::caloGeom_
private

Definition at line 45 of file SuperClusterImporter.cc.

Referenced by importToBlock(), and updateEventSetup().

◆ caloGeometryToken_

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> SuperClusterImporter::caloGeometryToken_
private

Definition at line 53 of file SuperClusterImporter.cc.

Referenced by updateEventSetup().

◆ cutsFromDB

bool SuperClusterImporter::cutsFromDB
private

Definition at line 43 of file SuperClusterImporter.cc.

Referenced by updateEventSetup().

◆ hbheRecHitsTag_

const edm::EDGetTokenT<HBHERecHitCollection> SuperClusterImporter::hbheRecHitsTag_
private

Definition at line 40 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ hcalChannelQual_

HcalChannelQuality const* SuperClusterImporter::hcalChannelQual_
private

Definition at line 47 of file SuperClusterImporter.cc.

Referenced by importToBlock(), and updateEventSetup().

◆ hcalChannelQualityToken_

const edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> SuperClusterImporter::hcalChannelQualityToken_
private

Definition at line 55 of file SuperClusterImporter.cc.

Referenced by updateEventSetup().

◆ hcalCuts

HcalPFCuts const* SuperClusterImporter::hcalCuts = nullptr
private

Definition at line 58 of file SuperClusterImporter.cc.

Referenced by importToBlock(), and updateEventSetup().

◆ hcalCutsToken_

edm::ESGetToken<HcalPFCuts, HcalPFCutsRcd> SuperClusterImporter::hcalCutsToken_
private

Definition at line 57 of file SuperClusterImporter.cc.

Referenced by updateEventSetup().

◆ hcalSev_

HcalSeverityLevelComputer const* SuperClusterImporter::hcalSev_
private

Definition at line 48 of file SuperClusterImporter.cc.

Referenced by importToBlock(), and updateEventSetup().

◆ hcalSevLvlComputerToken_

const edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> SuperClusterImporter::hcalSevLvlComputerToken_
private

Definition at line 56 of file SuperClusterImporter.cc.

Referenced by updateEventSetup().

◆ hcalTopo_

HcalTopology const* SuperClusterImporter::hcalTopo_
private

Definition at line 46 of file SuperClusterImporter.cc.

Referenced by importToBlock(), and updateEventSetup().

◆ hcalTopologyToken_

const edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> SuperClusterImporter::hcalTopologyToken_
private

Definition at line 54 of file SuperClusterImporter.cc.

Referenced by updateEventSetup().

◆ maxSeverityHB_

const int SuperClusterImporter::maxSeverityHB_
private

Definition at line 41 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ maxSeverityHE_

const int SuperClusterImporter::maxSeverityHE_
private

Definition at line 42 of file SuperClusterImporter.cc.

Referenced by importToBlock().

◆ towerMap_

CaloTowerConstituentsMap const* SuperClusterImporter::towerMap_
private

Definition at line 44 of file SuperClusterImporter.cc.

Referenced by importToBlock(), and updateEventSetup().