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 assert(), PFRecHitCreatorBase::beginEvent(), HcalDetId::depth(), HLT_25ns14e33_v1_cff::depth, cond::rpcobgas::detid, relval_parameters_module::energy, edm::EventSetup::get(), edm::Event::getByToken(), CaloCellGeometry::getCorners(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), DetId::Hcal, PFLayer::HCAL_BARREL1, PFLayer::HCAL_ENDCAP, HcalBarrel, HcalEndcap, keep, point, position, PFRecHitCreatorBase::qualityTests_, DetId::rawId(), recHitToken_, reco::PFRecHit::setTime(), EZArrayFL< T >::size(), DetId::subdetId(), cond::rpcobgas::time, x, y, and z.

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  double energy = erh.energy();
49  double time = erh.time();
50  int depth = detid.depth();
51 
53  math::XYZVector axis;
54 
55  const CaloCellGeometry *thisCell=0;
57  switch(esd) {
58  case HcalBarrel:
59  thisCell =hcalBarrelGeo->getGeometry(detid);
60  layer =PFLayer::HCAL_BARREL1;
61  break;
62 
63  case HcalEndcap:
64  thisCell =hcalEndcapGeo->getGeometry(detid);
65  layer =PFLayer::HCAL_ENDCAP;
66  break;
67  default:
68  break;
69  }
70 
71  // find rechit geometry
72  if(!thisCell) {
73  edm::LogError("PFHBHERecHitCreator")
74  <<"warning detid "<<detid.rawId()
75  <<" not found in geometry"<<std::endl;
76  continue;
77  }
78 
79  auto const point = thisCell->getPosition();
80  position.SetCoordinates ( point.x(),
81  point.y(),
82  point.z() );
83 
84  reco::PFRecHit rh( detid.rawId(),layer,
85  energy,
86  position.x(), position.y(), position.z(),
87  0,0,0);
88  rh.setTime(time); //Mike: This we will use later
89  rh.setDepth(depth);
90  const CaloCellGeometry::CornersVec& corners = thisCell->getCorners();
91  assert( corners.size() == 8 );
92 
93  rh.setNECorner( corners[0].x(), corners[0].y(), corners[0].z());
94  rh.setSECorner( corners[1].x(), corners[1].y(), corners[1].z());
95  rh.setSWCorner( corners[2].x(), corners[2].y(), corners[2].z());
96  rh.setNWCorner( corners[3].x(), corners[3].y(), corners[3].z());
97 
98 
99  bool rcleaned = false;
100  bool keep=true;
101 
102  //Apply Q tests
103  for( const auto& qtest : qualityTests_ ) {
104  if (!qtest->test(rh,erh,rcleaned)) {
105  keep = false;
106 
107  }
108  }
109 
110  if(keep) {
111  out->push_back(rh);
112  }
113  else if (rcleaned)
114  cleaned->push_back(rh);
115  }
116  }
std::vector< std::unique_ptr< PFRecHitQTestBase > > qualityTests_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
assert(m_qm.get())
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.h:55
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:35
HcalSubdetector
Definition: HcalAssistant.h:31
void beginEvent(const edm::Event &event, const edm::EventSetup &setup)
void setTime(double time)
Definition: PFRecHit.h:78
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
tuple out
Definition: dbtoconf.py:99
Layer
layer definition
Definition: PFLayer.h:31
size_type size() const
Definition: EZArrayFL.h:81
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const T & get() const
Definition: EventSetup.h:55
static int position[264][3]
Definition: ReadPGInfo.cc:509
const CornersVec & getCorners() const
Returns the corner points of this cell&#39;s volume.
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit > > recHitToken_
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5

Member Data Documentation

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

Definition at line 121 of file PFHBHERecHitCreator.h.

Referenced by importRecHits(), and PFHBHERecHitCreator().