50 vector<reco::PFRecHit>& rechitsCleaned,
54 map<unsigned, unsigned > idSortedRecHits;
55 typedef map<unsigned, unsigned >::iterator
IDH;
69 LogDebug(
"PFRecHitProducerPS") <<
"No EcalPreshower geometry available. putting empty PS rechits collection in event";
88 LogError(
"PFRecHitProducerPS")<<err.str()<<endl;
98 for(IT
i=psrechits.begin();
i!=psrechits.end();
i++) {
108 LogError(
"PFRecHitProducerPS")<<
"warning detid "<<detid.
rawId()
109 <<
" not found in preshower geometry"
118 switch( detid.
plane() ) {
127 <<
"incorrect preshower plane !! plane number "
128 <<detid.
plane()<<endl;
134 position.
x(), position.
y(), position.
z(),
138 assert( corners.size() == 8 );
140 pfrh->
setNECorner( corners[0].
x(), corners[0].
y(), corners[0].
z() );
141 pfrh->
setSECorner( corners[1].
x(), corners[1].
y(), corners[1].
z() );
142 pfrh->
setSWCorner( corners[2].
x(), corners[2].
y(), corners[2].
z() );
143 pfrh->
setNWCorner( corners[3].
x(), corners[3].
y(), corners[3].
z() );
148 rechits.push_back( *pfrh );
150 idSortedRecHits.insert( make_pair(detid.
rawId(), rechits.size()-1 ) );
155 for(
unsigned i=0;
i<rechits.size();
i++ ) {
170 const map<unsigned,unsigned >& sortedHits,
181 switch( rh.
layer() ) {
183 topology = &endcapTopology;
184 geometry = &endcapGeometry;
187 topology = &barrelTopology;
188 geometry = &barrelGeometry;
191 topology = &endcapTopology;
192 geometry = &endcapGeometry;
195 topology = &barrelTopology;
196 geometry = &barrelGeometry;
200 topology = &barrelTopology;
201 geometry = &barrelGeometry;
207 assert( topology && geometry );
214 if( north !=
DetId(0) ) {
215 northeast = navigator.
east();
225 if( south !=
DetId(0) ) {
226 southwest = navigator.
west();
233 if( east !=
DetId(0) ) {
234 southeast = navigator.
south();
239 if( west !=
DetId(0) ) {
240 northwest = navigator.
north();
244 IDH i = sortedHits.find( north.
rawId() );
245 if(i != sortedHits.end() )
248 i = sortedHits.find( northeast.
rawId() );
249 if(i != sortedHits.end() )
252 i = sortedHits.find( south.
rawId() );
253 if(i != sortedHits.end() )
256 i = sortedHits.find( southwest.
rawId() );
257 if(i != sortedHits.end() )
260 i = sortedHits.find( east.
rawId() );
261 if(i != sortedHits.end() )
264 i = sortedHits.find( southeast.
rawId() );
265 if(i != sortedHits.end() )
268 i = sortedHits.find( west.
rawId() );
269 if(i != sortedHits.end() )
272 i = sortedHits.find( northwest.
rawId() );
273 if(i != sortedHits.end() )
void setSECorner(double posx, double posy, double posz)
T getParameter(std::string const &) const
void add4Neighbour(unsigned index)
void add8Neighbour(unsigned index)
void setNECorner(double posx, double posy, double posz)
void home() const
move the navigator back to the starting point
const DetId & detid() const
unsigned detId() const
rechit detId
virtual T west() const
move the navigator west
std::vector< EcalRecHit >::const_iterator const_iterator
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
virtual T north() const
move the navigator north
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
PFLayer::Layer layer() const
rechit layer
void setSWCorner(double posx, double posy, double posz)
void findRecHitNeighbours(reco::PFRecHit &rh, const std::map< unsigned, unsigned > &sortedHits, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorGeometry &barrelGeom, const CaloSubdetectorTopology &endcapTopo, const CaloSubdetectorGeometry &endcapGeom)
virtual T east() const
move the navigator east
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Base producer for particle flow rechits (PFRecHit)
void createRecHits(std::vector< reco::PFRecHit > &rechits, std::vector< reco::PFRecHit > &rechitsCleaned, edm::Event &, const edm::EventSetup &)
edm::InputTag inputTagEcalRecHitsES_
std::vector< LinkConnSpec >::const_iterator IT
void setNWCorner(double posx, double posy, double posz)
search for pointers to neighbours, using neighbours' DetId.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
PFRecHitProducerPS(const edm::ParameterSet &)
T const * product() const
ESHandle< TrackerGeometry > geometry
std::map< unsigned, unsigned >::const_iterator IDH
static int position[264][3]
virtual T south() const
move the navigator south
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell's volume.