83 unsigned int planes_required,
96 verbosity(conf.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
100 lrcgn(new
FastLineRecognition(conf.getParameter<double>(
"clusterSize_a"), conf.getParameter<double>(
"clusterSize_b"))),
101 threshold(conf.getParameter<double>(
"threshold")),
102 max_a_toFit(conf.getParameter<double>(
"max_a_toFit"))
104 for (
const auto &ps : conf.
getParameter< vector<ParameterSet> >(
"exceptionalSettings"))
106 unsigned int rpId = ps.getParameter<
unsigned int>(
"rpId");
110 settings.minPlanesPerProjectionToFit_V = ps.getParameter<
unsigned int>(
"minPlanesPerProjectionToFit_V");
111 settings.threshold_U = ps.getParameter<
double>(
"threshold_U");
112 settings.threshold_V = ps.getParameter<
double>(
"threshold_V");
119 produces<DetSetVector<TotemRPUVPattern>>();
132 double z0,
double threshold_loc,
unsigned int planes_required,
140 for (
auto &
p : newPatterns)
142 p.setProjection(proj);
146 set<unsigned int> planes;
147 for (
const auto &ds :
p.getHits())
150 if (planes.size() < planes_required)
151 p.setFittable(
false);
154 p.setFittable(
false);
166 <<
">> TotemRPUVPatternFinder::produce " <<
event.id().run() <<
":" <<
event.id().event();
185 map<uint8_t, uint16_t> planeOccupancy_U, planeOccupancy_V;
187 map<unsigned int, RPData> rpData;
189 for (
auto &ids : *input)
192 unsigned int plane = detId.
plane();
193 bool uDir = detId.isStripsCoordinateUDirection();
197 RPData &
data = rpData[rpId];
203 auto &ods = data.hits_U.find_or_insert(ids.detId());
205 data.planeOccupancy_U[plane]++;
207 auto &ods = data.hits_V.find_or_insert(ids.detId());
209 data.planeOccupancy_V[plane]++;
215 for (
auto it : rpData)
218 RPData &
data = it.second;
229 minPlanesPerProjectionToFit_U = setIt->second.minPlanesPerProjectionToFit_U;
230 minPlanesPerProjectionToFit_V = setIt->second.minPlanesPerProjectionToFit_V;
231 threshold_U = setIt->second.threshold_U;
232 threshold_V = setIt->second.threshold_V;
235 auto &uColl = data.planeOccupancy_U;
236 auto &vColl = data.planeOccupancy_V;
242 <<
"\n\t\tall planes: u = " << uColl.size() <<
", v = " << vColl.size();
246 unsigned int uPlanes = 0, vPlanes = 0;
247 for (
auto pit : uColl)
251 for (
auto pit : vColl)
256 LogVerbatim(
"TotemRPUVPatternFinder") <<
"\t\tplanes with clean data: u = " << uPlanes <<
", v = " << vPlanes;
275 LogVerbatim(
"TotemRPUVPatternFinder") <<
"\t\tpatterns:";
276 for (
const auto &
p : patterns)
278 unsigned int n_hits = 0;
279 for (
auto &hds :
p.getHits())
280 n_hits += hds.size();
284 <<
", a = " <<
p.getA()
285 <<
", b = " <<
p.getB()
286 <<
", w = " <<
p.getW()
287 <<
", fittable = " <<
p.getFittable()
288 <<
", hits = " << n_hits;
Detector ID class for TOTEM Si strip detectors.
T getParameter(std::string const &) const
TotemRPUVPatternFinder(const edm::ParameterSet &conf)
void push_back(const T &t)
FastLineRecognition * lrcgn
the line recognition algorithm
const DetGeomDesc * GetRPDevice(unsigned int id) const
returns geometry of a RP box
#define DEFINE_FWK_MODULE(type)
void resetGeometry(const TotemRPGeometry *_g)
void getPatterns(const edm::DetSetVector< TotemRPRecHit > &input, double _z0, double threshold, edm::DetSet< TotemRPUVPattern > &patterns)
Event setup record containing the real (actual) geometry information.
static std::string const input
const PhiMemoryImage patterns[9]
reference find_or_insert(det_id_type id)
block of (exceptional) settings for 1 RP
std::map< unsigned int, RPSettings > exceptionalSettings
exceptional settings: RP Id –> settings
double threshold
minimal weight of (Hough) cluster to accept it as candidate
void recognizeAndSelect(TotemRPUVPattern::ProjectionType proj, double z0, double threshold, unsigned int planes_required, const edm::DetSetVector< TotemRPRecHit > &hits, edm::DetSet< TotemRPUVPattern > &patterns)
executes line recognition in a projection
unsigned char minPlanesPerProjectionToFit
minimal required number of active planes per projection to mark track candidate as fittable ...
DDTranslation translation() const
unsigned char minPlanesPerProjectionToFit_V
CTPPSDetId getRPId() const
virtual ~TotemRPUVPatternFinder()
edm::EDGetTokenT< edm::DetSetVector< TotemRPRecHit > > detSetVectorTotemRPRecHitToken
Class performing optimized hough transform to recognize lines.
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
bool check(const edm::EventSetup &iSetup)
Base class for CTPPS detector IDs.
unsigned char minPlanesPerProjectionToSearch
minimal required number of active planes per projection to even start track recognition ...
Class to recognize straight line tracks, based on optimized Hough trasform.
ESHandle< TrackerGeometry > geometry
char data[epos_bytes_allocation]
unsigned int maxHitsPerPlaneToSearch
above this limit, planes are considered noisy
T const * product() const
unsigned char minPlanesPerProjectionToFit_U
double max_a_toFit
maximal angle (in any projection) to mark candidate as fittable - controls track parallelity ...