Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-14 23:24:28

0001 #include "FWCore/Framework/interface/MakerMacros.h"
0002 #include "RecoLocalTracker/SubCollectionProducers/interface/StripClusterSelectorTopBottom.h"
0003 
0004 void StripClusterSelectorTopBottom::produce(edm::StreamID, edm::Event& event, const edm::EventSetup& setup) const {
0005   edm::Handle<edmNew::DetSetVector<SiStripCluster>> input;
0006   event.getByToken(token_, input);
0007 
0008   const TrackerGeometry& theTracker = setup.getData(tTrackerGeom_);
0009 
0010   auto output = std::make_unique<edmNew::DetSetVector<SiStripCluster>>();
0011 
0012   for (edmNew::DetSetVector<SiStripCluster>::const_iterator clustSet = input->begin(); clustSet != input->end();
0013        ++clustSet) {
0014     edmNew::DetSet<SiStripCluster>::const_iterator clustIt = clustSet->begin();
0015     edmNew::DetSet<SiStripCluster>::const_iterator end = clustSet->end();
0016 
0017     DetId detIdObject(clustSet->detId());
0018     edmNew::DetSetVector<SiStripCluster>::FastFiller spc(*output, detIdObject.rawId());
0019     const StripGeomDetUnit* theGeomDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(detIdObject));
0020     const StripTopology* topol = dynamic_cast<const StripTopology*>(&(theGeomDet->specificTopology()));
0021 
0022     for (; clustIt != end; ++clustIt) {
0023       LocalPoint lpclust = topol->localPosition(clustIt->barycenter());
0024       GlobalPoint GPclust = theGeomDet->surface().toGlobal(Local3DPoint(lpclust.x(), lpclust.y(), lpclust.z()));
0025       double clustY = GPclust.y();
0026       if ((clustY * y_) > 0) {
0027         spc.push_back(*clustIt);
0028       }
0029     }
0030   }
0031   event.put(std::move(output));
0032 }
0033 
0034 DEFINE_FWK_MODULE(StripClusterSelectorTopBottom);