22 std::cout << x << std::endl; \ 33 theHitThreshold(conf.getParameter<double>(
"HitThreshold")),
34 theSeedThreshold(conf.getParameter<double>(
"SeedThreshold")),
35 theClusterThreshold(conf.getParameter<double>(
"ClusterThreshold")),
36 theTimeThreshold(conf.getParameter<double>(
"TimeThreshold")),
40 theBuffer(theNumOfRows, theNumOfCols),
41 bufferAlreadySet(
false) {}
47 desc.
add<
double>(
"HitThreshold", 0.);
48 desc.
add<
double>(
"SeedThreshold", 0.);
49 desc.
add<
double>(
"ClusterThreshold", 0.);
50 desc.
add<
double>(
"TimeThreshold", 10.);
60 const auto& thedet = geom->
idToDet(
id);
61 if (thedet ==
nullptr) {
63 <<
"GeographicalID: " << std::hex <<
id.rawId() <<
" is invalid!" <<
std::dec << std::endl;
70 unsigned int nrows = topol.
nrows();
102 edm::LogInfo(
"MTDThresholdClusterizer") <<
"No hits to clusterize";
106 DEBUG(
"Input collection " << input.
size());
107 assert(output.
empty());
109 std::set<unsigned> geoIds;
110 std::multimap<unsigned, unsigned> geoIdToIdx;
113 for (
const auto&
hit : input) {
117 <<
"MTDDetId: " << std::hex << mtdId.
rawId() <<
" is invalid!" <<
std::dec << std::endl;
122 DetId geoId = hitId.geographicalId(
124 geoIdToIdx.emplace(geoId, index);
125 geoIds.emplace(geoId);
129 DetId geoId = hitId.geographicalId();
130 geoIdToIdx.emplace(geoId, index);
131 geoIds.emplace(geoId);
135 <<
"MTDDetId: " << std::hex << mtdId.
rawId() <<
" is invalid!" <<
std::dec << std::endl;
140 for (
unsigned id : geoIds) {
145 auto range = geoIdToIdx.equal_range(
id);
146 DEBUG(
"Matching Ids for " << std::hex <<
id <<
std::dec <<
" [" <<
range.first->second <<
"," 147 <<
range.second->second <<
"]");
151 for (
auto itr =
range.first; itr !=
range.second; ++itr) {
152 const unsigned hitidx = itr->second;
158 for (
unsigned int i = 0;
i <
theSeeds.size();
i++) {
165 DEBUG(
"putting in this cluster " << i <<
" #hits:" << cluster.
size() <<
" E:" << cluster.
energy()
166 <<
" T:" << cluster.
time() <<
" X:" << cluster.
x() <<
" Y:" << cluster.
y());
175 for (
auto itr =
range.first; itr !=
range.second; ++itr) {
176 const unsigned hitidx = itr->second;
195 int row = itr->row();
196 int col = itr->column();
197 float energy = itr->energy();
198 float time = itr->time();
199 float timeError = itr->timeError();
201 DEBUG(
"ROW " << row <<
" COL " << col <<
" ENERGY " << energy <<
" TIME " << time);
221 acluster.
add(hit, seed_energy, seed_time, seed_time_error);
223 bool stopClus =
false;
225 while (!acluster.
empty() && !stopClus) {
227 auto curInd = acluster.
top();
229 for (
auto c =
std::max(0,
int(acluster.
y[curInd] - 1));
232 for (
auto r =
std::max(0,
int(acluster.
x[curInd] - 1));
254 acluster.
time.data(),
float time_error(uint row, uint col) const
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...
void push_back(data_type const &d)
float theHitThreshold
Clustering-related quantities:
~MTDThresholdClusterizer() override
FTLRecHitCollection::const_iterator RecHitIterator
int getMTDTopologyMode() const
constexpr uint32_t rawId() const
get the raw id
std::vector< T >::const_iterator const_iterator
int ncolumns() const override
int theNumOfRows
Geometry-related information.
MTDThresholdClusterizer(edm::ParameterSet const &conf)
Constructor:
bool add(FTLCluster::FTLHitPos const &p, float const ienergy, float const itime, float const itimeError)
int nrows() const override
Detector identifier base class for the MIP Timing Layer.
static std::string const input
static void fillDescriptions(edm::ParameterSetDescription &desc)
float time(uint row, uint col) const
const MTDGeomDet * idToDet(DetId) const override
bool setup(const MTDGeometry *geometry, const MTDTopology *topo, const DetId &id)
std::array< float, MAXSIZE > timeError
virtual const PixelTopology & specificTopology() const
constexpr int row() const
float energy(uint row, uint col) const
Abs< T >::type abs(const T &t)
std::vector< FTLCluster::FTLHitPos > theSeeds
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void copy_to_buffer(RecHitIterator itr)
Copy FTLRecHit into the buffer, identify seeds.
std::array< UShort, MAXSIZE > x
std::array< float, MAXSIZE > time
const_iterator end() const
MTDArrayBuffer theBuffer
Data storage.
SubDetector subDetector() const
FTLCluster make_cluster(const FTLCluster::FTLHitPos &hit)
The actual clustering algorithm: group the neighboring hits around the seed.
Detector identifier class for the Endcap Timing Layer.
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
int mtdSubDetector() const
void set(uint row, uint col, float energy, float time, float time_error)
float theClusterThreshold
void clear_buffer(RecHitIterator itr)
Clear the internal buffer array.
std::array< UShort, MAXSIZE > y
constexpr int col() const
void clear(uint row, uint col)
std::array< float, MAXSIZE > energy
void setSize(uint rows, uint cols)
const_iterator begin() const