175 std::vector<CTPPSPixelDetId> listOfPotWithHighOccupancyPlanes;
176 std::map<CTPPSPixelDetId, uint32_t> mapHitPerPot;
178 for(
const auto & recHitSet : recHitVector){
180 if(
verbosity_>2)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
"Hits found in plane = "<<recHitSet.detId()<<
" number = " << recHitSet.size() ;
182 uint32_t hitOnPlane = recHitSet.size();
185 if(mapHitPerPot.find(tmpRomanPotId)==mapHitPerPot.end()){
186 mapHitPerPot[tmpRomanPotId] = hitOnPlane;
188 else mapHitPerPot[tmpRomanPotId]+=hitOnPlane;
192 if(
verbosity_>2)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
" ---> To many hits in the plane, pot will be excluded from tracking cleared";
193 listOfPotWithHighOccupancyPlanes.push_back(tmpRomanPotId);
198 for(
const auto & recHitSet : recHitVector){
200 const auto tmpRomanPotId = tmpDetectorId.
getRPId();
203 find (listOfPotWithHighOccupancyPlanes.begin(), listOfPotWithHighOccupancyPlanes.end(), tmpRomanPotId) != listOfPotWithHighOccupancyPlanes.end() ){
218 std::vector<RPixDetPatternFinder::Road> patternVector =
patternFinder_->getPatterns();
221 int numberOfTracks = 0;
223 for(
const auto &
pattern : patternVector){
227 std::map<CTPPSPixelDetId, std::vector<RPixDetPatternFinder::PointInPlane> > hitOnPlaneMap;
234 if(tmpRomanPotId!=romanPotId){
235 throw cms::Exception(
"CTPPSPixelLocalTrackProducer") <<
"Hits in the pattern must belong to the same tracking station";
238 if(hitOnPlaneMap.find(hitDetId)==hitOnPlaneMap.end()){
239 std::vector<RPixDetPatternFinder::PointInPlane> hitOnPlane;
240 hitOnPlane.push_back(
hit);
241 hitOnPlaneMap[hitDetId] = hitOnPlane;
243 else hitOnPlaneMap[hitDetId].push_back(
hit);
253 std::vector<CTPPSPixelLocalTrack> tmpTracksVector =
trackFinder_->getLocalTracks();
255 if(
verbosity_>2)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
"tmpTracksVector = "<<tmpTracksVector.size();
257 if(
verbosity_>2)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
" ---> To many tracks in the pattern, cleared";
261 for(
const auto &
track : tmpTracksVector){
270 if(
verbosity_>1)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
"Number of tracks will be saved = "<<numberOfTracks;
272 for(
const auto &
track : foundTracks){
275 if(
verbosity_>1)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
" ---> Too many tracks in the pot, cleared";
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void push_back(const T &t)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Run const & getRun() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Event setup record containing the real (actual) geometry information.
reference find_or_insert(det_id_type id)
std::unique_ptr< RPixDetTrackFinder > trackFinder_
CTPPSDetId getRPId() const
The manager class for TOTEM RP geometry.
CLHEP::Hep3Vector getRPTranslation(unsigned int id) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelRecHit > > tokenCTPPSPixelRecHit_
bool check(const edm::EventSetup &iSetup)
std::unique_ptr< RPixDetPatternFinder > patternFinder_