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,
182 switch( rh.
layer() ) {
184 topology = &endcapTopology;
185 geometry = &endcapGeometry;
188 topology = &barrelTopology;
189 geometry = &barrelGeometry;
192 topology = &endcapTopology;
193 geometry = &endcapGeometry;
194 othergeometry = &barrelGeometry;
197 topology = &barrelTopology;
198 geometry = &barrelGeometry;
199 othergeometry = &endcapGeometry;
203 topology = &barrelTopology;
204 geometry = &barrelGeometry;
205 othergeometry = &endcapGeometry;
211 assert( topology && geometry );
218 if( north !=
DetId(0) ) {
219 northeast = navigator.
east();
229 if( south !=
DetId(0) ) {
230 southwest = navigator.
west();
237 if( east !=
DetId(0) ) {
238 southeast = navigator.
south();
243 if( west !=
DetId(0) ) {
244 northwest = navigator.
north();
248 IDH i = sortedHits.find( north.
rawId() );
249 if(i != sortedHits.end() )
252 i = sortedHits.find( northeast.
rawId() );
253 if(i != sortedHits.end() )
256 i = sortedHits.find( south.
rawId() );
257 if(i != sortedHits.end() )
260 i = sortedHits.find( southwest.
rawId() );
261 if(i != sortedHits.end() )
264 i = sortedHits.find( east.
rawId() );
265 if(i != sortedHits.end() )
268 i = sortedHits.find( southeast.
rawId() );
269 if(i != sortedHits.end() )
272 i = sortedHits.find( west.
rawId() );
273 if(i != sortedHits.end() )
276 i = sortedHits.find( northwest.
rawId() );
277 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< T >::const_iterator const_iterator
virtual T north() const
move the navigator north
static int position[TOTALCHAMBERS][3]
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
virtual T south() const
move the navigator south
const GlobalPoint & getPosition() const
virtual const CornersVec & getCorners() const =0