1 #ifndef RecoParticleFlow_PFClusterProducer_PFHFRecHitCreator_h 2 #define RecoParticleFlow_PFClusterProducer_PFHFRecHitCreator_h 58 for(
const auto& erh : *recHitHandle ) {
63 if(
depth > 2 )
continue;
65 auto energy = erh.energy();
66 auto time = erh.time();
68 std::shared_ptr<const CaloCellGeometry> thisCell= hcalGeo->
getGeometry(detid);
69 auto zp =
dynamic_cast<IdealZPrism const*
>(thisCell.get());
71 thisCell = zp->forPF();
76 <<
"warning detid "<<detid.
rawId()
77 <<
" not found in geometry"<<std::endl;
88 bool rcleaned =
false;
93 if (!qtest->test(rh,erh,rcleaned)) {
113 for (
auto&
hit : tmpOut) {
116 if (detid.
depth()==1) {
117 double lONG=
hit.energy();
124 return a.detId() <
b.rawId();
126 if( found_hit != tmpOut.end() && found_hit->detId() == shortID.rawId() ) {
127 double sHORT = found_hit->energy();
129 double energy = lONG-sHORT;
137 out->push_back(newHit);
142 double energy = lONG;
148 out->push_back(newHit);
154 double sHORT=
hit.energy();
160 return a.detId() <
b.rawId();
162 double energy = 2*sHORT;
163 if( found_hit != tmpOut.end() && found_hit->detId() == longID.rawId() ) {
164 double lONG = found_hit->energy();
178 out->push_back(newHit);
187 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
void importRecHits(std::unique_ptr< reco::PFRecHitCollection > &out, std::unique_ptr< reco::PFRecHitCollection > &cleaned, const edm::Event &iEvent, const edm::EventSetup &iSetup) override
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_
constexpr uint32_t rawId() const
get the raw id
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
bool operator()(const reco::PFRecHit &a, const reco::PFRecHit &b)
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
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
void setEnergy(float energy)
double longFibre_Fraction