173 bool isBadPot_45_220 =
false;
178 std::map<uint32_t, CTPPSPixelROCAnalysisMask>
const &maschera =
mask.analysisMask;
180 bool mask_45_220[6][6] = {{
false}};
181 for (
auto const &det : maschera) {
183 unsigned int rocNum = (det.first & rocMask) >> rocOffset;
184 if (rocNum > 5 || detId.plane() > 5)
185 throw cms::Exception(
"InvalidRocOrPlaneNumber") <<
"roc number from mask: " << rocNum;
187 if (detId.arm() == 0 && detId.station() == 2 && detId.rp() == 3) {
188 if (det.second.maskedPixels.size() == rocSizeInPixels) {
189 mask_45_220[detId.plane()][rocNum] =
true;
195 isBadPot_45_220 = mask_45_220[1][4] && mask_45_220[1][5] && mask_45_220[2][4] && mask_45_220[2][5] &&
196 mask_45_220[3][4] && mask_45_220[3][5] && mask_45_220[4][4] && mask_45_220[4][5];
198 std::vector<CTPPSPixelDetId> listOfPotWithHighOccupancyPlanes;
199 std::map<CTPPSPixelDetId, uint32_t> mapHitPerPot;
201 for (
const auto &recHitSet : recHitVector) {
204 <<
"Hits found in plane = " << recHitSet.detId() <<
" number = " << recHitSet.size();
206 uint32_t hitOnPlane = recHitSet.size();
209 if (mapHitPerPot.find(tmpRomanPotId) == mapHitPerPot.end()) {
210 mapHitPerPot[tmpRomanPotId] = hitOnPlane;
212 mapHitPerPot[tmpRomanPotId] += hitOnPlane;
218 <<
" ---> To many hits in the plane, pot will be excluded from tracking cleared";
219 listOfPotWithHighOccupancyPlanes.push_back(tmpRomanPotId);
224 for (
const auto &recHitSet : recHitVector) {
226 const auto tmpRomanPotId = tmpDetectorId.
rpId();
229 find(listOfPotWithHighOccupancyPlanes.begin(), listOfPotWithHighOccupancyPlanes.end(), tmpRomanPotId) !=
230 listOfPotWithHighOccupancyPlanes.end()) {
244 std::vector<RPixDetPatternFinder::Road> patternVector =
patternFinder_->getPatterns();
247 int numberOfTracks = 0;
249 for (
const auto &
pattern : patternVector) {
253 std::map<CTPPSPixelDetId, std::vector<RPixDetPatternFinder::PointInPlane>>
261 if (tmpRomanPotId != romanPotId) {
263 <<
"Hits in the pattern must belong to the same tracking station";
266 if (hitOnPlaneMap.find(hitDetId) ==
267 hitOnPlaneMap.end()) {
268 std::vector<RPixDetPatternFinder::PointInPlane> hitOnPlane;
269 hitOnPlane.push_back(
hit);
270 hitOnPlaneMap[hitDetId] = hitOnPlane;
272 hitOnPlaneMap[hitDetId].push_back(
hit);
281 std::vector<CTPPSPixelLocalTrack> tmpTracksVector =
trackFinder_->getLocalTracks();
284 edm::LogInfo(
"CTPPSPixelLocalTrackProducer") <<
"tmpTracksVector = " << tmpTracksVector.size();
287 edm::LogInfo(
"CTPPSPixelLocalTrackProducer") <<
" ---> To many tracks in the pattern, cleared";
291 for (
const auto &
track : tmpTracksVector) {
299 edm::LogInfo(
"CTPPSPixelLocalTrackProducer") <<
"Number of tracks will be saved = " << numberOfTracks;
301 for (
const auto &
track : foundTracks) {
304 <<
"Track found in detId = " <<
track.detId() <<
" number = " <<
track.size();
307 edm::LogInfo(
"CTPPSPixelLocalTrackProducer") <<
" ---> Too many tracks in the pot, cleared";
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher_
const int maxTrackPerPattern_
const edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenCTPPSPixelAnalysisMask_
void push_back(const T &t)
const edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelRecHit > > tokenCTPPSPixelRecHit_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
reference find_or_insert(det_id_type id)
std::unique_ptr< RPixDetTrackFinder > trackFinder_
const int maxHitPerRomanPot_
bool getData(T &iHolder) const
const edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > tokenCTPPSGeometry_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
The manager class for TOTEM RP geometry.
Log< level::Info, false > LogInfo
const int maxTrackPerRomanPot_
bool check(const edm::EventSetup &iSetup)
std::unique_ptr< RPixDetPatternFinder > patternFinder_
const int maxHitPerPlane_