CMS 3D CMS Logo

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

#include <PFEcalRecHitCreatorMaxSample.h>

Inheritance diagram for PFEcalRecHitCreatorMaxSample< 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
 
 PFEcalRecHitCreatorMaxSample (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

edm::EDGetTokenT< EcalRecHitCollectionrecHitToken_
 
- 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 Geometry, PFLayer::Layer Layer, int Detector>
class PFEcalRecHitCreatorMaxSample< Geometry, Layer, Detector >

Definition at line 27 of file PFEcalRecHitCreatorMaxSample.h.

Constructor & Destructor Documentation

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

Member Function Documentation

template<typename Geometry , PFLayer::Layer Layer, int Detector>
void PFEcalRecHitCreatorMaxSample< 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 36 of file PFEcalRecHitCreatorMaxSample.h.

References PFRecHitCreatorBase::beginEvent(), align::Detector, DetId::Ecal, edm::EventSetup::get(), edm::Event::getByToken(), CaloGeometry::getSubdetectorGeometry(), keep, PFRecHitCreatorBase::qualityTests_, DetId::rawId(), PFEcalRecHitCreatorMaxSample< Geometry, Layer, Detector >::recHitToken_, and ntuplemaker::time.

36  {
37 
38  beginEvent(iEvent,iSetup);
39 
41 
43  iSetup.get<CaloGeometryRecord>().get(geoHandle);
44 
45  // get the ecal geometry
46  const CaloSubdetectorGeometry *gTmp =
48 
49  const Geometry *ecalGeo = dynamic_cast<const Geometry*>(gTmp);
50 
51  iEvent.getByToken(recHitToken_,recHitHandle);
52  for(const auto& erh : *recHitHandle ) {
53  const DetId& detid = erh.detid();
54  auto energy = erh.energy();
55  auto time = erh.time();
56 
57  std::shared_ptr<const CaloCellGeometry> thisCell= ecalGeo->getGeometry(detid);
58 
59  // find rechit geometry
60  if(!thisCell) {
61  edm::LogError("PFEcalRecHitCreatorMaxSample")
62  <<"warning detid "<<detid.rawId()
63  <<" not found in geometry"<<std::endl;
64  continue;
65  }
66 
67 
68  reco::PFRecHit rh(thisCell, detid.rawId(),Layer,
69  energy);
70 
71 
72  bool rcleaned = false;
73  bool keep=true;
74  bool hi = true; // this is std version for which the PF ZS is always applied
75 
76  //Apply Q tests
77  for( const auto& qtest : qualityTests_ ) {
78  if (!qtest->test(rh,erh,rcleaned,hi)) {
79  keep = false;
80  }
81  }
82 
83  if(keep) {
84  rh.setTime(time);
85  rh.setDepth(1);
86  out->push_back(rh);
87  }
88  else if (rcleaned)
89  cleaned->push_back(rh);
90  }
91  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
std::vector< std::unique_ptr< PFRecHitQTestBase > > qualityTests_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< EcalRecHitCollection > recHitToken_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
SeedingLayerSetsHits::SeedingLayer Layer
Definition: LayerTriplets.h:14
const int keep
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:32
void beginEvent(const edm::Event &event, const edm::EventSetup &setup)
Definition: DetId.h:18
T get() const
Definition: EventSetup.h:68

Member Data Documentation

template<typename Geometry , PFLayer::Layer Layer, int Detector>
edm::EDGetTokenT<EcalRecHitCollection> PFEcalRecHitCreatorMaxSample< Geometry, Layer, Detector >::recHitToken_
protected