CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
PFHcalRecHitCreator< Digi, Geometry, Layer, Detector > Class Template Referencefinal

#include <PFHcalRecHitCreator.h>

Inheritance diagram for PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >:
PFRecHitCreatorBase

Public Member Functions

void importRecHits (std::unique_ptr< reco::PFRecHitCollection > &out, std::unique_ptr< reco::PFRecHitCollection > &cleaned, const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 PFHcalRecHitCreator (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
- Public Member Functions inherited from PFRecHitCreatorBase
virtual void init (const edm::EventSetup &es)
 
 PFRecHitCreatorBase ()
 
 PFRecHitCreatorBase (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
virtual ~PFRecHitCreatorBase ()=default
 

Protected Attributes

int hoDepth_
 
edm::EDGetTokenT< edm::SortedCollection< Digi > > recHitToken_
 
- Protected Attributes inherited from PFRecHitCreatorBase
std::vector< std::unique_ptr< PFRecHitQTestBase > > qualityTests_
 

Additional Inherited Members

- Protected Member Functions inherited from PFRecHitCreatorBase
void beginEvent (const edm::Event &event, const edm::EventSetup &setup)
 

Detailed Description

template<typename Digi, typename Geometry, PFLayer::Layer Layer, int Detector>
class PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >

Definition at line 22 of file PFHcalRecHitCreator.h.

Constructor & Destructor Documentation

◆ PFHcalRecHitCreator()

template<typename Digi , typename Geometry , PFLayer::Layer Layer, int Detector>
PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >::PFHcalRecHitCreator ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)
inline

Member Function Documentation

◆ importRecHits()

template<typename Digi , typename Geometry , PFLayer::Layer Layer, int Detector>
void PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >::importRecHits ( std::unique_ptr< reco::PFRecHitCollection > &  out,
std::unique_ptr< reco::PFRecHitCollection > &  cleaned,
const edm::Event iEvent,
const edm::EventSetup iSetup 
)
inlineoverridevirtual

Implements PFRecHitCreatorBase.

Definition at line 28 of file PFHcalRecHitCreator.h.

31  {
32  beginEvent(iEvent, iSetup);
33 
35 
37  iSetup.get<CaloGeometryRecord>().get(geoHandle);
38  edm::ESHandle<HcalTopology> hcalTopology;
39  iSetup.get<HcalRecNumberingRecord>().get(hcalTopology);
40 
41  // get the hcal geometry and topology
43  const Geometry* hcalGeo = dynamic_cast<const Geometry*>(gTmp);
44  const HcalTopology* theHcalTopology = hcalTopology.product();
45 
46  iEvent.getByToken(recHitToken_, recHitHandle);
47  for (const auto& erh : *recHitHandle) {
48  HcalDetId detid = (HcalDetId)erh.detid();
50 
51  //since hbhe are together kill other detector
52  if (esd != Detector && Detector != HcalOther)
53  continue;
54 
55  if (theHcalTopology->getMergePositionFlag() && esd == HcalEndcap) {
56  detid = theHcalTopology->idFront(detid);
57  }
58 
59  auto energy = erh.energy();
60  auto time = erh.time();
61  auto depth = detid.depth();
62 
63  auto thisCell = hcalGeo->getGeometry(detid);
64 
65  // find rechit geometry
66  if (!thisCell) {
67  edm::LogError("PFHcalRecHitCreator")
68  << "warning detid " << detid.rawId() << " not found in geometry" << std::endl;
69  continue;
70  }
71 
72  reco::PFRecHit rh(thisCell, detid.rawId(), Layer, energy);
73  rh.setTime(time); //Mike: This we will use later
74  rh.setDepth(depth);
75 
76  bool rcleaned = false;
77  bool keep = true;
78 
79  //Apply Q tests
80  for (const auto& qtest : qualityTests_) {
81  if (!qtest->test(rh, erh, rcleaned)) {
82  keep = false;
83  }
84  }
85 
86  if (keep) {
87  out->push_back(std::move(rh));
88  } else if (rcleaned)
89  cleaned->push_back(std::move(rh));
90  }
91  }

References PFRecHitCreatorBase::beginEvent(), LEDCalibrationChannels::depth, HcalDetId::depth(), align::Detector, HCALHighEnergyHPDFilter_cfi::energy, edm::EventSetup::get(), get, HcalTopology::getMergePositionFlag(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalEndcap, HcalOther, HcalTopology::idFront(), iEvent, keep, eostools::move(), MillePedeFileConverter_cfg::out, edm::ESHandle< T >::product(), PFRecHitCreatorBase::qualityTests_, DetId::rawId(), PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >::recHitToken_, reco::PFRecHit::setTime(), DetId::subdetId(), and protons_cff::time.

Member Data Documentation

◆ hoDepth_

template<typename Digi , typename Geometry , PFLayer::Layer Layer, int Detector>
int PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >::hoDepth_
protected

Definition at line 95 of file PFHcalRecHitCreator.h.

◆ recHitToken_

template<typename Digi , typename Geometry , PFLayer::Layer Layer, int Detector>
edm::EDGetTokenT<edm::SortedCollection<Digi> > PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >::recHitToken_
protected
HcalOther
Definition: HcalAssistant.h:38
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HcalTopology::idFront
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
PFRecHitCreatorBase::beginEvent
void beginEvent(const edm::Event &event, const edm::EventSetup &setup)
Definition: PFRecHitCreatorBase.h:43
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
HcalTopology
Definition: HcalTopology.h:26
DetId::Hcal
Definition: DetId.h:28
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
protons_cff.time
time
Definition: protons_cff.py:39
edm::SortedCollection
Definition: SortedCollection.h:49
HcalDetId::depth
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
HcalTopology::getMergePositionFlag
bool getMergePositionFlag() const
Definition: HcalTopology.h:167
edm::Handle
Definition: AssociativeIterator.h:50
LayerTriplets::Layer
SeedingLayerSetsHits::SeedingLayer Layer
Definition: LayerTriplets.h:14
PFRecHitCreatorBase::PFRecHitCreatorBase
PFRecHitCreatorBase()
Definition: PFRecHitCreatorBase.h:25
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
PFRecHitCreatorBase::qualityTests_
std::vector< std::unique_ptr< PFRecHitQTestBase > > qualityTests_
Definition: PFRecHitCreatorBase.h:48
edm::ESHandle< CaloGeometry >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
HcalDetId
Definition: HcalDetId.h:12
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
PFHcalRecHitCreator::recHitToken_
edm::EDGetTokenT< edm::SortedCollection< Digi > > recHitToken_
Definition: PFHcalRecHitCreator.h:94
align::Detector
Definition: StructureType.h:92
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HcalEndcap
Definition: HcalAssistant.h:34
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::PFRecHit
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
reco::PFRecHit::setTime
void setTime(double time)
Definition: PFRecHit.h:73
keep
const int keep
Definition: GenParticlePruner.cc:48
edm::InputTag
Definition: InputTag.h:15
Geometry
Class Geometry Contains vector for fit parameters (mean, sigma, etc.) obtained from multiple IOVs See...
Definition: DMRtrends.cc:182