1 #ifndef RecoParticleFlow_PFClusterProducer_PFHFRecHitCreator_h
2 #define RecoParticleFlow_PFClusterProducer_PFHFRecHitCreator_h
59 for(
const auto& erh : *recHitHandle ) {
63 auto energy = erh.energy();
64 auto time = erh.time();
69 thisCell = zp->forPF();
74 <<
"warning detid "<<detid.
rawId()
75 <<
" not found in geometry"<<std::endl;
86 bool rcleaned =
false;
91 if (!qtest->test(rh,erh,rcleaned)) {
106 std::sort(tmpOut.begin(),tmpOut.end(),
sorter);
114 for (
auto&
hit : tmpOut) {
120 if (detid.
depth()==1) {
124 auto found_hit = std::lower_bound(tmpOut.begin(),tmpOut.end(),
128 return a.detId() <
b.rawId();
130 if( found_hit != tmpOut.end() && found_hit->detId() == shortID.rawId() ) {
131 sHORT = found_hit->energy();
133 double energy = lONG-sHORT;
141 out->push_back(newHit);
152 out->push_back(newHit);
160 auto found_hit = std::lower_bound(tmpOut.begin(),tmpOut.end(),
164 return a.detId() <
b.rawId();
167 if( found_hit != tmpOut.end() && found_hit->detId() == longID.rawId() ) {
168 lONG = found_hit->energy();
182 out->push_back(newHit);
191 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
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
void setEnergy(float energy)
void importRecHits(std::auto_ptr< reco::PFRecHitCollection > &out, std::auto_ptr< reco::PFRecHitCollection > &cleaned, const edm::Event &iEvent, const edm::EventSetup &iSetup)
double longFibre_Fraction