86 unsigned int planes_required,
100 verbosity(conf.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
101 minPlanesPerProjectionToSearch(conf.getParameter<unsigned
int>(
"minPlanesPerProjectionToSearch")),
102 minPlanesPerProjectionToFit(conf.getParameter<unsigned
int>(
"minPlanesPerProjectionToFit")),
103 maxHitsPerPlaneToSearch(conf.getParameter<unsigned
int>(
"maxHitsPerPlaneToSearch")),
105 conf.getParameter<double>(
"clusterSize_b"))),
106 threshold(conf.getParameter<double>(
"threshold")),
107 max_a_toFit(conf.getParameter<double>(
"max_a_toFit")) {
108 for (
const auto &ps : conf.
getParameter<vector<ParameterSet>>(
"exceptionalSettings")) {
109 unsigned int rpId = ps.getParameter<
unsigned int>(
"rpId");
113 settings.minPlanesPerProjectionToFit_V = ps.getParameter<
unsigned int>(
"minPlanesPerProjectionToFit_V");
114 settings.threshold_U = ps.getParameter<
double>(
"threshold_U");
115 settings.threshold_V = ps.getParameter<
double>(
"threshold_V");
123 produces<DetSetVector<TotemRPUVPattern>>();
134 double threshold_loc,
135 unsigned int planes_required,
143 for (
auto &
p : newPatterns) {
144 p.setProjection(
proj);
148 set<unsigned int> planes;
149 for (
const auto &ds :
p.hits())
152 if (planes.size() < planes_required)
153 p.setFittable(
false);
156 p.setFittable(
false);
167 <<
">> 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) {
191 unsigned int plane = detId.
plane();
192 bool uDir = detId.isStripsCoordinateUDirection();
198 for (
auto &
h : ids) {
200 auto &ods =
data.hits_U.find_or_insert(ids.detId());
202 data.planeOccupancy_U[plane]++;
204 auto &ods =
data.hits_V.find_or_insert(ids.detId());
206 data.planeOccupancy_V[plane]++;
212 for (
auto const &it : rpData) {
214 RPData
const &
data = it.second;
224 minPlanesPerProjectionToFit_U = setIt->second.minPlanesPerProjectionToFit_U;
225 minPlanesPerProjectionToFit_V = setIt->second.minPlanesPerProjectionToFit_V;
226 threshold_U = setIt->second.threshold_U;
227 threshold_V = setIt->second.threshold_V;
230 auto &uColl =
data.planeOccupancy_U;
231 auto &vColl =
data.planeOccupancy_V;
235 <<
"\tRP " <<
rpId <<
"\n\t\tall planes: u = " << uColl.size() <<
", v = " << vColl.size();
239 unsigned int uPlanes = 0, vPlanes = 0;
240 for (
auto pit : uColl)
244 for (
auto pit : vColl)
249 LogVerbatim(
"TotemRPUVPatternFinder") <<
"\t\tplanes with clean data: u = " << uPlanes <<
", v = " << vPlanes;
267 LogVerbatim(
"TotemRPUVPatternFinder") <<
"\t\tpatterns:";
268 for (
const auto &
p : patterns) {
269 unsigned int n_hits = 0;
270 for (
auto &hds :
p.hits())
271 n_hits += hds.size();
275 <<
", b = " <<
p.b() <<
", w = " <<
p.w() <<
", fittable = " <<
p.fittable() <<
", hits = " << n_hits;
290 ->setComment(
"input rechits collection to retrieve");
291 desc.addUntracked<
unsigned int>(
"verbosity", 0);
292 desc.add<
unsigned int>(
"maxHitsPerPlaneToSearch", 5)
293 ->setComment(
"minimum threshold of hits multiplicity to flag the pattern as dirty");
294 desc.add<
unsigned int>(
"minPlanesPerProjectionToSearch", 3)
296 "minimal number of reasonable (= not empty and not dirty) planes per projection and per RP, to start the "
298 desc.add<
double>(
"clusterSize_a", 0.02 )
299 ->setComment(
"(full) cluster size (in rad) in slope-intercept space");
300 desc.add<
double>(
"clusterSize_b", 0.3 );
302 desc.add<
double>(
"threshold", 2.99)
304 "minimal weight of (Hough) cluster to accept it as candidate\n"
305 " weight of cluster = sum of weights of contributing points\n"
306 " weight of point = sigma0 / sigma_of_point\n"
307 "most often: weight of point ~ 1, thus cluster weight is roughly number of contributing points");
309 desc.add<
unsigned int>(
"minPlanesPerProjectionToFit", 3)
311 "minimal number of planes (in the recognised patterns) per projection and per RP, to tag the candidate as "
314 desc.add<
bool>(
"allowAmbiguousCombination",
false)
316 "whether to allow combination of most significant U and V pattern, in case there several of them.\n"
317 "don't set it to True, unless you have reason");
319 desc.add<
double>(
"max_a_toFit", 10.0)
321 "maximal angle (in any projection) to mark the candidate as fittable -> controls track parallelity with "
323 "huge value -> no constraint");
326 exceptions_validator.
add<
unsigned int>(
"rpId")->setComment(
"RP id according to CTPPSDetId");
327 exceptions_validator.
add<
unsigned int>(
"minPlanesPerProjectionToFit_U");
328 exceptions_validator.
add<
unsigned int>(
"minPlanesPerProjectionToFit_V");
329 exceptions_validator.
add<
double>(
"threshold_U");
330 exceptions_validator.
add<
double>(
"threshold_V");
332 std::vector<edm::ParameterSet> exceptions_default;
333 desc.addVPSet(
"exceptionalSettings", exceptions_validator, exceptions_default);
335 descr.
add(
"totemRPUVPatternFinder",
desc);