Implements PFRecHitCreatorBase.
Definition at line 42 of file PFHFRecHitCreator.h.
References a, funct::abs(), b, PFRecHitCreatorBase::beginEvent(), particleFlowClusterECALTimeSelected_cfi::depth, HcalDetId::depth(), edm::EventSetup::get(), edm::Event::getByToken(), CaloSubdetectorGeometry::getGeometry(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalForward, PFLayer::HF_EM, PFLayer::HF_HAD, HFCalib_, HcalDetId::ieta(), HcalDetId::iphi(), keep, longFibre_Cut, longFibre_Fraction, eostools::move(), PFRecHitCreatorBase::qualityTests_, DetId::rawId(), recHitToken_, reco::PFRecHit::setEnergy(), reco::PFRecHit::setTime(), shortFibre_Cut, shortFibre_Fraction, MCScenario_CRAFT1_22X::sorter(), thresh_HF_, and ntuplemaker::time.
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);
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
std::vector< std::unique_ptr< PFRecHitQTestBase > > qualityTests_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::SortedCollection< HFRecHit > > recHitToken_
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
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)
double longFibre_Fraction