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 Reference

#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(), align::Detector, cond::rpcobgas::detid, relval_parameters_module::energy, edm::EventSetup::get(), edm::Event::getByToken(), CaloCellGeometry::getCorners(), CaloCellGeometry::getPosition(), DetId::Hcal, HcalOther, keep, point, position, PFRecHitCreatorBase::qualityTests_, DetId::rawId(), PFHcalRecHitCreator< Digi, Geometry, Layer, Detector >::recHitToken_, reco::PFRecHit::setTime(), EZArrayFL< T >::size(), DetId::subdetId(), cond::rpcobgas::time, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

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  double energy = erh.energy();
57  double time = erh.time();
58  int depth =detid.depth();
59 
61  math::XYZVector axis;
62 
63  const CaloCellGeometry *thisCell;
64  thisCell= hcalGeo->getGeometry(detid);
65 
66  // find rechit geometry
67  if(!thisCell) {
68  edm::LogError("PFHcalRecHitCreator")
69  <<"warning detid "<<detid.rawId()
70  <<" not found in geometry"<<std::endl;
71  continue;
72  }
73 
74  auto const point = thisCell->getPosition();
75  position.SetCoordinates ( point.x(),
76  point.y(),
77  point.z() );
78 
79 
80 
81 
82  reco::PFRecHit rh( detid.rawId(),Layer,
83  energy,
84  position.x(), position.y(), position.z(),
85  0,0,0);
86  rh.setTime(time); //Mike: This we will use later
87  rh.setDepth(depth);
88 
89  const CaloCellGeometry::CornersVec& corners = thisCell->getCorners();
90  assert( corners.size() == 8 );
91 
92  rh.setNECorner( corners[0].x(), corners[0].y(), corners[0].z());
93  rh.setSECorner( corners[1].x(), corners[1].y(), corners[1].z());
94  rh.setSWCorner( corners[2].x(), corners[2].y(), corners[2].z());
95  rh.setNWCorner( corners[3].x(), corners[3].y(), corners[3].z());
96 
97 
98  bool rcleaned = false;
99  bool keep=true;
100 
101  //Apply Q tests
102  for( const auto& qtest : qualityTests_ ) {
103  if (!qtest->test(rh,erh,rcleaned)) {
104  keep = false;
105 
106  }
107  }
108 
109  if(keep) {
110  out->push_back(rh);
111  }
112  else if (rcleaned)
113  cleaned->push_back(rh);
114  }
115  }
std::vector< std::unique_ptr< PFRecHitQTestBase > > qualityTests_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
float float float z
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
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.h:40
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:35
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:75
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
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
Definition: DDAxes.h:10
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.
*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

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

Definition at line 121 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