1 #ifndef RecoParticleFlow_PFClusterProducer_PFHFRecHitCreator_h 2 #define RecoParticleFlow_PFClusterProducer_PFHFRecHitCreator_h 59 for(
const auto& erh : *recHitHandle ) {
64 if(
depth > 2 )
continue;
66 auto energy = erh.energy();
67 auto time = erh.time();
70 auto zp =
dynamic_cast<IdealZPrism const*
>(thisCell);
72 thisCell = zp->forPF();
77 <<
"warning detid "<<detid.
rawId()
78 <<
" not found in geometry"<<std::endl;
89 bool rcleaned =
false;
94 if (!qtest->test(rh,erh,rcleaned)) {
109 std::sort(tmpOut.begin(),tmpOut.end(),
sorter);
117 for (
auto&
hit : tmpOut) {
123 if (detid.
depth()==1) {
127 auto found_hit = std::lower_bound(tmpOut.begin(),tmpOut.end(),
131 return a.detId() <
b.rawId();
133 if( found_hit != tmpOut.end() && found_hit->detId() == shortID.rawId() ) {
134 sHORT = found_hit->energy();
136 double energy = lONG-sHORT;
144 out->push_back(newHit);
149 double energy = lONG;
155 out->push_back(newHit);
163 auto found_hit = std::lower_bound(tmpOut.begin(),tmpOut.end(),
167 return a.detId() <
b.rawId();
169 double energy = 2*sHORT;
170 if( found_hit != tmpOut.end() && found_hit->detId() == longID.rawId() ) {
171 lONG = found_hit->energy();
185 out->push_back(newHit);
194 out->push_back(newHit);
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
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
void importRecHits(std::unique_ptr< reco::PFRecHitCollection > &out, std::unique_ptr< reco::PFRecHitCollection > &cleaned, const edm::Event &iEvent, const edm::EventSetup &iSetup)
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)
double longFibre_Fraction