86 if(patternFinderAlgorithm ==
"RPixRoadFinder"){
90 throw cms::Exception(
"CTPPSPixelLocalTrackProducer") <<
"Pattern finder algorithm" << patternFinderAlgorithm <<
" does not exist";
99 if(trackFitterAlgorithm ==
"RPixPlaneCombinatoryTracking"){
103 throw cms::Exception(
"CTPPSPixelLocalTrackProducer") <<
"Tracking fitter algorithm" << trackFitterAlgorithm <<
" does not exist";
110 produces<edm::DetSetVector<CTPPSPixelLocalTrack> > ();
125 ->setComment(
"label of the RecHits input for the tracking algorithm" );
126 desc.
add<
std::string> (
"patternFinderAlgorithm" ,
"RPixRoadFinder" )
127 ->setComment(
"algorithm type for pattern finder" );
128 desc.
add<
std::string> (
"trackFinderAlgorithm" ,
"RPixPlaneCombinatoryTracking")
129 ->setComment(
"algorithm type for track finder" );
130 desc.
add<
uint> (
"trackMinNumberOfPoints" , 3 )
131 ->setComment(
"minimum number of planes to produce a track" );
133 ->setComment(
"verbosity for track producer" );
134 desc.
add<
double> (
"maximumChi2OverNDF" , 5. )
135 ->setComment(
"maximum Chi2OverNDF for accepting the track" );
136 desc.
add<
double> (
"maximumXLocalDistanceFromTrack" , 0.2 )
137 ->setComment(
"maximum x distance in mm to associate a point not used for fit to the track" );
138 desc.
add<
double> (
"maximumYLocalDistanceFromTrack" , 0.3 )
139 ->setComment(
"maximum y distance in mm to associate a point not used for fit to the track" );
140 desc.
add<
int> (
"maxHitPerPlane" , 20 )
141 ->setComment(
"maximum hits per plane, events with higher number will not be fitted" );
142 desc.
add<
int> (
"maxHitPerRomanPot" , 60 )
143 ->setComment(
"maximum hits per roman pot, events with higher number will not be fitted" );
144 desc.
add<
int> (
"maxTrackPerRomanPot" , 10 )
145 ->setComment(
"maximum tracks per roman pot, events with higher track will not be saved" );
146 desc.
add<
int> (
"maxTrackPerPattern" , 5 )
147 ->setComment(
"maximum tracks per pattern, events with higher track will not be saved" );
148 desc.
add<
int> (
"numberOfPlanesPerPot" , 6 )
149 ->setComment(
"number of planes per pot" );
150 desc.
add<
double> (
"roadRadius" , 1.0 )
151 ->setComment(
"radius of pattern search window" );
152 desc.
add<
int> (
"minRoadSize" , 3 )
153 ->setComment(
"minimum number of points in a pattern" );
154 desc.
add<
int> (
"maxRoadSize" , 20 )
155 ->setComment(
"maximum number of points in a pattern" );
157 descriptions.
add(
"ctppsPixelLocalTracks", desc);
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;
235 if(tmpRomanPotId!=romanPotId){
236 throw cms::Exception(
"CTPPSPixelLocalTrackProducer") <<
"Hits in the pattern must belong to the same tracking station";
239 if(hitOnPlaneMap.find(hitDetId)==hitOnPlaneMap.end()){
240 std::vector<RPixDetPatternFinder::PointInPlane> hitOnPlane;
241 hitOnPlane.push_back(
hit);
242 hitOnPlaneMap[hitDetId] = hitOnPlane;
244 else hitOnPlaneMap[hitDetId].push_back(
hit);
254 std::vector<CTPPSPixelLocalTrack> tmpTracksVector =
trackFinder_->getLocalTracks();
256 if(
verbosity_>2)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
"tmpTracksVector = "<<tmpTracksVector.size();
258 if(
verbosity_>2)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
" ---> To many tracks in the pattern, cleared";
263 for(
const auto &
track : tmpTracksVector){
272 if(
verbosity_>1)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
"Number of tracks will be saved = "<<numberOfTracks;
274 for(
const auto &
track : foundTracks){
277 if(
verbosity_>1)
edm::LogInfo(
"CTPPSPixelLocalTrackProducer")<<
" ---> To many tracks in the pot, cleared";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void push_back(const T &t)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~CTPPSPixelLocalTrackProducer() override
void produce(edm::Event &, const edm::EventSetup &) override
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.
static std::string const input
reference find_or_insert(det_id_type id)
std::unique_ptr< RPixDetTrackFinder > trackFinder_
std::vector< uint32_t > listOfAllPlanes_
uint32_t numberOfPlanesPerPot_
CTPPSDetId getRPId() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
The manager class for TOTEM RP geometry.
void run(const edm::DetSetVector< CTPPSPixelRecHit > &input, edm::DetSetVector< CTPPSPixelLocalTrack > &output)
CLHEP::Hep3Vector getRPTranslation(unsigned int id) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelRecHit > > tokenCTPPSPixelRecHit_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool check(const edm::EventSetup &iSetup)
std::unique_ptr< RPixDetPatternFinder > patternFinder_
CTPPSPixelLocalTrackProducer(const edm::ParameterSet ¶meterSet)
ParameterSet const & parameterSet(Provenance const &provenance)