28 theHitThreshold(conf.getParameter<double>(
"HitThreshold")),
29 theSeedThreshold(conf.getParameter<double>(
"SeedThreshold")),
30 theClusterThreshold(conf.getParameter<double>(
"ClusterThreshold")),
31 theTimeThreshold(conf.getParameter<double>(
"TimeThreshold")),
32 thePositionThreshold(conf.getParameter<double>(
"PositionThreshold")),
36 theBuffer(theNumOfRows, theNumOfCols),
37 bufferAlreadySet(
false) {}
43 desc.add<
double>(
"HitThreshold", 0.);
44 desc.add<
double>(
"SeedThreshold", 0.);
45 desc.add<
double>(
"ClusterThreshold", 0.);
46 desc.add<
double>(
"TimeThreshold", 10.);
47 desc.add<
double>(
"PositionThreshold", -1.0);
57 const auto& thedet =
geom->idToDet(
id);
58 if (thedet ==
nullptr) {
60 <<
"GeographicalID: " << std::hex <<
id.rawId() <<
" is invalid!" <<
std::dec << std::endl;
67 unsigned int nrows = topol.
nrows();
99 edm::LogInfo(
"MTDThresholdClusterizer") <<
"No hits to clusterize";
103 LogDebug(
"MTDThresholdClusterizer") <<
"Input collection " <<
input.size();
106 std::set<unsigned> geoIds;
107 std::multimap<unsigned, unsigned> geoIdToIdx;
114 <<
"MTDDetId: " << std::hex << mtdId.
rawId() <<
" is invalid!" <<
std::dec << std::endl;
122 geoIds.emplace(
geoId);
128 geoIds.emplace(
geoId);
132 <<
"MTDDetId: " << std::hex << mtdId.
rawId() <<
" is invalid!" <<
std::dec << std::endl;
137 for (
unsigned id : geoIds) {
142 auto range = geoIdToIdx.equal_range(
id);
143 LogDebug(
"MTDThresholdClusterizer") <<
"Matching Ids for " << std::hex <<
id <<
std::dec <<
" [" 144 <<
range.first->second <<
"," <<
range.second->second <<
"]";
148 for (
auto itr =
range.first; itr !=
range.second; ++itr) {
149 const unsigned hitidx = itr->second;
155 for (
unsigned int i = 0;
i <
theSeeds.size();
i++) {
163 <<
"putting in this cluster " <<
i <<
" #hits:" << cluster.
size() <<
" E:" << cluster.
energy()
164 <<
" T:" << cluster.
time() <<
" X:" << cluster.
x() <<
" Y:" << cluster.
y();
173 for (
auto itr =
range.first; itr !=
range.second; ++itr) {
174 const unsigned hitidx = itr->second;
194 int row = itr->row();
195 int col = itr->column();
197 float energy = itr->energy();
198 float time = itr->time();
199 float timeError = itr->timeError();
216 global_point = det->toGlobal(lp);
229 global_point = det->toGlobal(lp);
232 LogDebug(
"MTDThresholdClusterizer") <<
"ROW " << row <<
" COL " <<
col <<
" ENERGY " <<
energy <<
" TIME " <<
time;
257 acluster.
add(
hit, seed_energy, seed_time, seed_time_error);
259 bool stopClus =
false;
261 while (!acluster.
empty() && !stopClus) {
263 auto curInd = acluster.
top();
265 for (
auto c =
std::max(0,
int(acluster.
y[curInd] - 1));
268 for (
auto r =
std::max(0,
int(acluster.
x[curInd] - 1));
282 (hit_error_xx + seed_error_xx + hit_error_yy + seed_error_yy))
300 acluster.
time.data(),
uint8_t geoId(const VFATFrame &frame)
retrieve the GEO information for this channel
void clusterize(const FTLRecHitCollection &input, const MTDGeometry *geom, const MTDTopology *topo, FTLClusterCollection &output) override
Cluster hits. This method operates on a matrix of hits and finds the largest contiguous cluster aroun...
int getMTDTopologyMode() const
void push_back(data_type const &d)
float energy(uint row, uint col) const
float time(uint row, uint col) const
LocalError local_error(uint row, uint col) const
static void fillPSetDescription(edm::ParameterSetDescription &desc)
~MTDThresholdClusterizer() override
virtual const PixelTopology & specificTopology() const
FTLRecHitCollection::const_iterator RecHitIterator
std::vector< T >::const_iterator const_iterator
const float thePositionThreshold
const float theClusterThreshold
int mtdSubDetector() const
const float theHitThreshold
Clustering-related quantities:
int theNumOfRows
Geometry-related information.
MTDThresholdClusterizer(edm::ParameterSet const &conf)
Constructor:
GeomDetEnumerators::Location subDet(uint row, uint col) const
Use subDet to identify whether the Hit is in BTL or ETL.
bool add(FTLCluster::FTLHitPos const &p, float const ienergy, float const itime, float const itimeError)
Detector identifier base class for the MIP Timing Layer.
static std::string const input
float time_error(uint row, uint col) const
void copy_to_buffer(RecHitIterator itr, const MTDGeometry *geom, const MTDTopology *topo)
Copy FTLRecHit into the buffer, identify seeds.
GlobalPoint global_point(uint row, uint col) const
bool setup(const MTDGeometry *geometry, const MTDTopology *topo, const DetId &id)
LocalError localError() const
std::array< float, MAXSIZE > timeError
int ncolumns() const override
Abs< T >::type abs(const T &t)
int nrows() const override
std::vector< FTLCluster::FTLHitPos > theSeeds
std::array< UShort, MAXSIZE > x
std::array< float, MAXSIZE > time
Log< level::Info, false > LogInfo
const float theTimeThreshold
constexpr uint32_t rawId() const
get the raw id
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
std::pair< float, float > pitch() const override
MTDArrayBuffer theBuffer
Data storage.
FTLCluster make_cluster(const FTLCluster::FTLHitPos &hit)
The actual clustering algorithm: group the neighboring hits around the seed.
void set(uint row, uint col, GeomDetEnumerators::Location subDet, float energy, float time, float time_error, const LocalError &local_error, const GlobalPoint &global_point)
Detector identifier class for the Endcap Timing Layer.
SubDetector subDetector() const
static int position[264][3]
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
void clear_buffer(RecHitIterator itr)
Clear the internal buffer array.
BTLDetId::CrysLayout crysLayoutFromTopoMode(const int &topoMode)
std::array< UShort, MAXSIZE > y
LocalPoint localPosition(const MeasurementPoint &mp) const override
void clear(uint row, uint col)
std::array< float, MAXSIZE > energy
void setSize(uint rows, uint cols)
const float theSeedThreshold