83 unsigned int planes_required,
95 tagRecHit(conf.getParameter<edm::
InputTag>(
"tagRecHit")),
96 verbosity(conf.getUntrackedParameter<unsigned int>(
"verbosity", 0)),
97 minPlanesPerProjectionToSearch(conf.getParameter<unsigned int>(
"minPlanesPerProjectionToSearch")),
98 minPlanesPerProjectionToFit(conf.getParameter<unsigned int>(
"minPlanesPerProjectionToFit")),
99 maxHitsPerPlaneToSearch(conf.getParameter<unsigned int>(
"maxHitsPerPlaneToSearch")),
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)
193 unsigned int plane = detId % 10;
196 RPData &
data = rpData[rpId];
202 auto &ods = data.hits_U.find_or_insert(ids.detId());
204 data.planeOccupancy_U[plane]++;
206 auto &ods = data.hits_V.find_or_insert(ids.detId());
208 data.planeOccupancy_V[plane]++;
214 for (
auto it : rpData)
216 unsigned int rpId = it.first;
217 RPData &
data = it.second;
228 minPlanesPerProjectionToFit_U = setIt->second.minPlanesPerProjectionToFit_U;
229 minPlanesPerProjectionToFit_V = setIt->second.minPlanesPerProjectionToFit_V;
230 threshold_U = setIt->second.threshold_U;
231 threshold_V = setIt->second.threshold_V;
234 auto &uColl = data.planeOccupancy_U;
235 auto &vColl = data.planeOccupancy_V;
241 <<
"\n\t\tall planes: u = " << uColl.size() <<
", v = " << vColl.size();
245 unsigned int uPlanes = 0, vPlanes = 0;
246 for (
auto pit : uColl)
250 for (
auto pit : vColl)
255 LogVerbatim(
"TotemRPUVPatternFinder") <<
"\t\tplanes with clean data: u = " << uPlanes <<
", v = " << vPlanes;
265 double z0 = geometry->GetRPDevice(rpId)->translation().z();
274 LogVerbatim(
"TotemRPUVPatternFinder") <<
"\t\tpatterns:";
275 for (
const auto &
p : patterns)
277 unsigned int n_hits = 0;
278 for (
auto &hds :
p.getHits())
279 n_hits += hds.size();
283 <<
", a = " <<
p.getA()
284 <<
", b = " <<
p.getB()
285 <<
", w = " <<
p.getW()
286 <<
", fittable = " <<
p.getFittable()
287 <<
", hits = " << n_hits;
T getParameter(std::string const &) const
TotemRPUVPatternFinder(const edm::ParameterSet &conf)
PhiMemoryImage patterns[9]
void push_back(const T &t)
FastLineRecognition * lrcgn
the line recognition algorithm
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static unsigned int rpOfDet(unsigned int i)
returns ID of RP for given detector ID ''i''
#define DEFINE_FWK_MODULE(type)
void resetGeometry(const TotemRPGeometry *_g)
static unsigned int rawToDecId(unsigned int raw)
fast conversion Raw to Decimal ID
bool isStripsCoordinateUDirection() const
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
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 ...
unsigned char minPlanesPerProjectionToFit_V
virtual ~TotemRPUVPatternFinder()
edm::EDGetTokenT< edm::DetSetVector< TotemRPRecHit > > detSetVectorTotemRPRecHitToken
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Class performing optimized hough transform to recognize lines.
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
T const * product() const
bool check(const edm::EventSetup &iSetup)
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
unsigned char minPlanesPerProjectionToFit_U
double max_a_toFit
maximal angle (in any projection) to mark candidate as fittable - controls track parallelity ...