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
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::auto_ptr< reco::PFRecHitCollection > &out, std::auto_ptr< reco::PFRecHitCollection > &cleaned, const edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 PFHcalRecHitCreator (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
- Public Member Functions inherited from PFRecHitCreatorBase
 PFRecHitCreatorBase ()
 
 PFRecHitCreatorBase (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 

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 21 of file PFHcalRecHitCreator.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file PFHcalRecHitCreator.h.

References edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), and PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >::recHitToken_.

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

Member Function Documentation

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

References PFRecHitCreatorBase::beginEvent(), HcalDetId::depth(), HLT_25ns10e33_v2_cff::depth, align::Detector, relval_parameters_module::energy, edm::EventSetup::get(), edm::Event::getByToken(), DetId::Hcal, HcalOther, keep, eostools::move(), PFRecHitCreatorBase::qualityTests_, DetId::rawId(), PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >::recHitToken_, reco::PFRecHit::setTime(), and DetId::subdetId().

30  {
31 
32 
33  beginEvent(iEvent,iSetup);
34 
36 
38  iSetup.get<CaloGeometryRecord>().get(geoHandle);
39 
40  // get the ecal geometry
41  const CaloSubdetectorGeometry *gTmp =
42  geoHandle->getSubdetectorGeometry(DetId::Hcal, Detector);
43 
44  const Geometry *hcalGeo =dynamic_cast< const Geometry* > (gTmp);
45 
46  iEvent.getByToken(recHitToken_,recHitHandle);
47  for( const auto& erh : *recHitHandle ) {
48  const HcalDetId& detid = (HcalDetId)erh.detid();
50 
51  //since hbhe are together kill other detector
52  if (esd !=Detector && Detector != HcalOther )
53  continue;
54 
55 
56  auto energy = erh.energy();
57  auto time = erh.time();
58  auto depth =detid.depth();
59 
60 
61  const CaloCellGeometry * thisCell= hcalGeo->getGeometry(detid);
62 
63  // find rechit geometry
64  if(!thisCell) {
65  edm::LogError("PFHcalRecHitCreator")
66  <<"warning detid "<<detid.rawId()
67  <<" not found in geometry"<<std::endl;
68  continue;
69  }
70 
71 
72  reco::PFRecHit rh(thisCell, detid.rawId(),Layer,
73  energy);
74  rh.setTime(time); //Mike: This we will use later
75  rh.setDepth(depth);
76 
77 
78  bool rcleaned = false;
79  bool keep=true;
80 
81  //Apply Q tests
82  for( const auto& qtest : qualityTests_ ) {
83  if (!qtest->test(rh,erh,rcleaned)) {
84  keep = false;
85 
86  }
87  }
88 
89  if(keep) {
90  out->push_back(std::move(rh));
91  }
92  else if (rcleaned)
93  cleaned->push_back(std::move(rh));
94  }
95  }
std::vector< std::unique_ptr< PFRecHitQTestBase > > qualityTests_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
SeedingLayerSetsHits::SeedingLayer Layer
Definition: LayerTriplets.h:14
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:129
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
edm::EDGetTokenT< edm::SortedCollection< Digi > > recHitToken_
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
const T & get() const
Definition: EventSetup.h:56

Member Data Documentation

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

Definition at line 101 of file PFHcalRecHitCreator.h.

template<typename Digi , typename Geometry , PFLayer::Layer Layer, int Detector>
edm::EDGetTokenT<edm::SortedCollection<Digi> > PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >::recHitToken_
protected