test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
PFHBHERecHitCreator Class Reference

#include <PFHBHERecHitCreator.h>

Inheritance diagram for PFHBHERecHitCreator:
PFRecHitCreatorBase

Public Member Functions

void importRecHits (std::auto_ptr< reco::PFRecHitCollection > &out, std::auto_ptr< reco::PFRecHitCollection > &cleaned, const edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 PFHBHERecHitCreator (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
- Public Member Functions inherited from PFRecHitCreatorBase
 PFRecHitCreatorBase ()
 
 PFRecHitCreatorBase (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 

Protected Attributes

edm::EDGetTokenT
< edm::SortedCollection
< HBHERecHit > > 
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

Definition at line 19 of file PFHBHERecHitCreator.h.

Constructor & Destructor Documentation

PFHBHERecHitCreator::PFHBHERecHitCreator ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)
inline

Definition at line 22 of file PFHBHERecHitCreator.h.

References edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), and recHitToken_.

22  :
23  PFRecHitCreatorBase(iConfig,iC)
24  {
26  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit > > recHitToken_

Member Function Documentation

void PFHBHERecHitCreator::importRecHits ( std::auto_ptr< reco::PFRecHitCollection > &  out,
std::auto_ptr< reco::PFRecHitCollection > &  cleaned,
const edm::Event iEvent,
const edm::EventSetup iSetup 
)
inlinevirtual

Implements PFRecHitCreatorBase.

Definition at line 28 of file PFHBHERecHitCreator.h.

References PFRecHitCreatorBase::beginEvent(), HcalDetId::depth(), HLT_25ns10e33_v2_cff::depth, relval_parameters_module::energy, edm::EventSetup::get(), edm::Event::getByToken(), CaloSubdetectorGeometry::getGeometry(), DetId::Hcal, PFLayer::HCAL_BARREL1, PFLayer::HCAL_ENDCAP, HcalBarrel, HcalEndcap, keep, eostools::move(), PFRecHitCreatorBase::qualityTests_, DetId::rawId(), recHitToken_, reco::PFRecHit::setTime(), and DetId::subdetId().

28  {
29 
30  beginEvent(iEvent,iSetup);
31 
33 
35  iSetup.get<CaloGeometryRecord>().get(geoHandle);
36 
37  // get the ecal geometry
38  const CaloSubdetectorGeometry *hcalBarrelGeo =
39  geoHandle->getSubdetectorGeometry(DetId::Hcal, HcalBarrel);
40  const CaloSubdetectorGeometry *hcalEndcapGeo =
41  geoHandle->getSubdetectorGeometry(DetId::Hcal, HcalEndcap);
42 
43  iEvent.getByToken(recHitToken_,recHitHandle);
44  for( const auto& erh : *recHitHandle ) {
45  const HcalDetId& detid = (HcalDetId)erh.detid();
47 
48  auto energy = erh.energy();
49  auto time = erh.time();
50  auto depth = detid.depth();
51 
52  const CaloCellGeometry *thisCell=nullptr;
54  switch(esd) {
55  case HcalBarrel:
56  thisCell =hcalBarrelGeo->getGeometry(detid);
57  layer =PFLayer::HCAL_BARREL1;
58  break;
59 
60  case HcalEndcap:
61  thisCell =hcalEndcapGeo->getGeometry(detid);
62  layer =PFLayer::HCAL_ENDCAP;
63  break;
64  default:
65  break;
66  }
67 
68  // find rechit geometry
69  if(!thisCell) {
70  edm::LogError("PFHBHERecHitCreator")
71  <<"warning detid "<<detid.rawId()
72  <<" not found in geometry"<<std::endl;
73  continue;
74  }
75 
76  reco::PFRecHit rh(thisCell, detid.rawId(),layer,
77  energy);
78  rh.setTime(time); //Mike: This we will use later
79  rh.setDepth(depth);
80 
81  bool rcleaned = false;
82  bool keep=true;
83 
84  //Apply Q tests
85  for( const auto& qtest : qualityTests_ ) {
86  if (!qtest->test(rh,erh,rcleaned)) {
87  keep = false;
88 
89  }
90  }
91 
92  if(keep) {
93  out->push_back(std::move(rh));
94  }
95  else if (rcleaned)
96  cleaned->push_back(std::move(rh));
97  }
98  }
std::vector< std::unique_ptr< PFRecHitQTestBase > > qualityTests_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const int keep
int depth() const
get the tower depth
Definition: HcalDetId.cc:106
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
def move
Definition: eostools.py:510
HcalSubdetector
Definition: HcalAssistant.h:31
void beginEvent(const edm::Event &event, const edm::EventSetup &setup)
void setTime(double time)
Definition: PFRecHit.h:79
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Layer
layer definition
Definition: PFLayer.h:31
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit > > recHitToken_

Member Data Documentation

edm::EDGetTokenT<edm::SortedCollection<HBHERecHit> > PFHBHERecHitCreator::recHitToken_
protected

Definition at line 103 of file PFHBHERecHitCreator.h.

Referenced by importRecHits(), and PFHBHERecHitCreator().