1 #ifndef RecoParticleFlow_PFClusterProducer_PFHFRecHitCreator_h
2 #define RecoParticleFlow_PFClusterProducer_PFHFRecHitCreator_h
57 for(
const auto& erh : *recHitHandle ) {
61 double energy = erh.energy();
62 double time = erh.time();
73 <<
"warning detid "<<detid.
rawId()
74 <<
" not found in geometry"<<std::endl;
82 double depth_correction;
93 position.SetCoordinates (
point.x(),
95 point.z()+depth_correction );
100 position.x(), position.y(), position.z(),
108 rh.setNECorner( corners[0].
x(), corners[0].
y(), corners[0].
z()+depth_correction);
109 rh.setSECorner( corners[1].
x(), corners[1].
y(), corners[1].
z()+depth_correction);
110 rh.setSWCorner( corners[2].
x(), corners[2].
y(), corners[2].
z()+depth_correction);
111 rh.setNWCorner( corners[3].
x(), corners[3].
y(), corners[3].
z()+depth_correction);
114 bool rcleaned =
false;
119 if (!qtest->test(rh,erh,rcleaned)) {
126 tmpOut.push_back(rh);
129 cleaned->push_back(rh);
134 std::sort(tmpOut.begin(),tmpOut.end(),
sorter);
142 for (
auto&
hit : tmpOut) {
148 if (detid.
depth()==1) {
153 auto found_hit = std::lower_bound(tmpOut.begin(),tmpOut.end(),
159 if( found_hit != tmpOut.end() && (
HcalDetId)(found_hit->detId()) == (
HcalDetId)(shortID.rawId()) ) {
160 sHORT = found_hit->energy();
162 double energy = lONG-sHORT;
170 out->push_back(newHit);
181 out->push_back(newHit);
190 auto found_hit = std::lower_bound(tmpOut.begin(),tmpOut.end(),
197 if( found_hit != tmpOut.end() && (
HcalDetId)(found_hit->detId()) == (
HcalDetId)(longID.rawId()) ) {
198 lONG = found_hit->energy();
212 out->push_back(newHit);
221 out->push_back(newHit);
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::vector< std::unique_ptr< PFRecHitQTestBase > > qualityTests_
PFHFRecHitCreator(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
unsigned detId() const
rechit detId
edm::EDGetTokenT< edm::SortedCollection< HFRecHit > > recHitToken_
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
bool operator()(const reco::PFRecHit &a, const reco::PFRecHit &b)
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
void setEnergy(double energy)
int depth() const
get the tower depth
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
double shortFibre_Fraction
int ieta() const
get the cell ieta
Abs< T >::type abs(const T &t)
void beginEvent(const edm::Event &event, const edm::EventSetup &setup)
void setTime(double time)
int iphi() const
get the cell iphi
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
static int position[264][3]
void importRecHits(std::auto_ptr< reco::PFRecHitCollection > &out, std::auto_ptr< reco::PFRecHitCollection > &cleaned, const edm::Event &iEvent, const edm::EventSetup &iSetup)
const CornersVec & getCorners() const
Returns the corner points of this cell's volume.
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
double longFibre_Fraction
*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