81 if (patternFinderAlgorithm ==
"RPixRoadFinder") {
85 <<
"Pattern finder algorithm" << patternFinderAlgorithm <<
" does not exist";
94 if (trackFitterAlgorithm ==
"RPixPlaneCombinatoryTracking") {
98 <<
"Tracking fitter algorithm" << trackFitterAlgorithm <<
" does not exist";
105 produces<edm::DetSetVector<CTPPSPixelLocalTrack>>();
118 ->setComment(
"label of the RecHits input for the tracking algorithm");
119 desc.
add<
std::string>(
"patternFinderAlgorithm",
"RPixRoadFinder")->setComment(
"algorithm type for pattern finder");
120 desc.
add<
std::string>(
"trackFinderAlgorithm",
"RPixPlaneCombinatoryTracking")
121 ->setComment(
"algorithm type for track finder");
122 desc.
add<
uint>(
"trackMinNumberOfPoints", 3)->setComment(
"minimum number of planes to produce a track");
123 desc.
addUntracked<
int>(
"verbosity", 0)->setComment(
"verbosity for track producer");
124 desc.
add<
double>(
"maximumChi2OverNDF", 5.)->
setComment(
"maximum Chi2OverNDF for accepting the track");
125 desc.
add<
double>(
"maximumXLocalDistanceFromTrack", 0.2)
126 ->
setComment(
"maximum x distance in mm to associate a point not used for fit to the track");
127 desc.
add<
double>(
"maximumYLocalDistanceFromTrack", 0.3)
128 ->
setComment(
"maximum y distance in mm to associate a point not used for fit to the track");
129 desc.
add<
int>(
"maxHitPerPlane", 20)
130 ->setComment(
"maximum hits per plane, events with higher number will not be fitted");
131 desc.
add<
int>(
"maxHitPerRomanPot", 60)
132 ->setComment(
"maximum hits per roman pot, events with higher number will not be fitted");
133 desc.
add<
int>(
"maxTrackPerRomanPot", 10)
134 ->setComment(
"maximum tracks per roman pot, events with higher track will not be saved");
135 desc.
add<
int>(
"maxTrackPerPattern", 5)
136 ->setComment(
"maximum tracks per pattern, events with higher track will not be saved");
137 desc.
add<
int>(
"numberOfPlanesPerPot", 6)->setComment(
"number of planes per pot");
138 desc.
add<
double>(
"roadRadius", 1.0)->
setComment(
"radius of pattern search window");
139 desc.
add<
int>(
"minRoadSize", 3)->setComment(
"minimum number of points in a pattern");
140 desc.
add<
int>(
"maxRoadSize", 20)->setComment(
"maximum number of points in a pattern");
142 descriptions.
add(
"ctppsPixelLocalTracks", desc);
160 std::vector<CTPPSPixelDetId> listOfPotWithHighOccupancyPlanes;
161 std::map<CTPPSPixelDetId, uint32_t> mapHitPerPot;
163 for (
const auto &recHitSet : recHitVector) {
166 <<
"Hits found in plane = " << recHitSet.detId() <<
" number = " << recHitSet.size();
168 uint32_t hitOnPlane = recHitSet.size();
171 if (mapHitPerPot.find(tmpRomanPotId) == mapHitPerPot.end()) {
172 mapHitPerPot[tmpRomanPotId] = hitOnPlane;
174 mapHitPerPot[tmpRomanPotId] += hitOnPlane;
180 <<
" ---> To many hits in the plane, pot will be excluded from tracking cleared";
181 listOfPotWithHighOccupancyPlanes.push_back(tmpRomanPotId);
186 for (
const auto &recHitSet : recHitVector) {
188 const auto tmpRomanPotId = tmpDetectorId.
rpId();
191 find(listOfPotWithHighOccupancyPlanes.begin(), listOfPotWithHighOccupancyPlanes.end(), tmpRomanPotId) !=
192 listOfPotWithHighOccupancyPlanes.end()) {
206 std::vector<RPixDetPatternFinder::Road> patternVector =
patternFinder_->getPatterns();
209 int numberOfTracks = 0;
211 for (
const auto &
pattern : patternVector) {
215 std::map<CTPPSPixelDetId, std::vector<RPixDetPatternFinder::PointInPlane>>
223 if (tmpRomanPotId != romanPotId) {
225 <<
"Hits in the pattern must belong to the same tracking station";
228 if (hitOnPlaneMap.find(hitDetId) ==
229 hitOnPlaneMap.end()) {
230 std::vector<RPixDetPatternFinder::PointInPlane> hitOnPlane;
231 hitOnPlane.push_back(
hit);
232 hitOnPlaneMap[hitDetId] = hitOnPlane;
234 hitOnPlaneMap[hitDetId].push_back(
hit);
243 std::vector<CTPPSPixelLocalTrack> tmpTracksVector =
trackFinder_->getLocalTracks();
246 edm::LogInfo(
"CTPPSPixelLocalTrackProducer") <<
"tmpTracksVector = " << tmpTracksVector.size();
249 edm::LogInfo(
"CTPPSPixelLocalTrackProducer") <<
" ---> To many tracks in the pattern, cleared";
253 for (
const auto &
track : tmpTracksVector) {
261 edm::LogInfo(
"CTPPSPixelLocalTrackProducer") <<
"Number of tracks will be saved = " << numberOfTracks;
263 for (
const auto &
track : foundTracks) {
266 <<
"Track found in detId = " <<
track.detId() <<
" number = " <<
track.size();
269 edm::LogInfo(
"CTPPSPixelLocalTrackProducer") <<
" ---> Too many tracks in the pot, cleared";