|
|
Go to the documentation of this file.
23 std::cout << x << std::endl; \
34 theHitThreshold(conf.getParameter<double>(
"HitThreshold")),
35 theSeedThreshold(conf.getParameter<double>(
"SeedThreshold")),
36 theClusterThreshold(conf.getParameter<double>(
"ClusterThreshold")),
37 theTimeThreshold(conf.getParameter<double>(
"TimeThreshold")),
41 theBuffer(theNumOfRows, theNumOfCols),
42 bufferAlreadySet(
false) {}
48 desc.
add<
double>(
"HitThreshold", 0.);
49 desc.
add<
double>(
"SeedThreshold", 0.);
50 desc.
add<
double>(
"ClusterThreshold", 0.);
51 desc.
add<
double>(
"TimeThreshold", 10.);
61 const auto& thedet =
geom->idToDet(
id);
62 if (thedet ==
nullptr) {
64 <<
"GeographicalID: " << std::hex <<
id.rawId() <<
" is invalid!" <<
std::dec << std::endl;
67 const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
71 unsigned int nrows = topol.
nrows();
72 unsigned int ncols = topol.ncolumns();
103 edm::LogInfo(
"MTDThresholdClusterizer") <<
"No hits to clusterize";
110 std::set<unsigned> geoIds;
111 std::multimap<unsigned, unsigned> geoIdToIdx;
118 <<
"MTDDetId: " << std::hex << mtdId.
rawId() <<
" is invalid!" <<
std::dec << std::endl;
125 geoIdToIdx.emplace(geoId,
index);
126 geoIds.emplace(geoId);
130 DetId geoId = hitId.geographicalId();
131 geoIdToIdx.emplace(geoId,
index);
132 geoIds.emplace(geoId);
136 <<
"MTDDetId: " << std::hex << mtdId.
rawId() <<
" is invalid!" <<
std::dec << std::endl;
141 for (
unsigned id : geoIds) {
146 auto range = geoIdToIdx.equal_range(
id);
147 DEBUG(
"Matching Ids for " << std::hex <<
id <<
std::dec <<
" [" <<
range.first->second <<
","
148 <<
range.second->second <<
"]");
153 const unsigned hitidx =
itr->second;
159 for (
unsigned int i = 0;
i <
theSeeds.size();
i++) {
166 DEBUG(
"putting in this cluster " <<
i <<
" #hits:" << cluster.
size() <<
" E:" << cluster.
energy()
167 <<
" T:" << cluster.
time() <<
" X:" << cluster.
x() <<
" Y:" << cluster.
y());
177 const unsigned hitidx =
itr->second;
196 int row =
itr->row();
200 float timeError =
itr->timeError();
222 acluster.
add(
hit, seed_energy, seed_time, seed_time_error);
224 bool stopClus =
false;
226 while (!acluster.
empty() && !stopClus) {
228 auto curInd = acluster.
top();
230 for (
auto c =
std::max(0,
int(acluster.
y[curInd] - 1));
233 for (
auto r =
std::max(0,
int(acluster.
x[curInd] - 1));
255 acluster.
time.data(),
MTDThresholdClusterizer(edm::ParameterSet const &conf)
Constructor:
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< T >::const_iterator const_iterator
static const std::string input
FTLRecHitCollection::const_iterator RecHitIterator
float theClusterThreshold
void clear_buffer(RecHitIterator itr)
Clear the internal buffer array.
void set(uint row, uint col, float energy, float time, float time_error)
std::array< UShort, MAXSIZE > x
bool add(FTLCluster::FTLHitPos const &p, float const ienergy, float const itime, float const itimeError)
int nrows() const override
std::array< UShort, MAXSIZE > y
virtual const PixelTopology & specificTopology() const
Detector identifier class for the Endcap Timing Layer.
void push_back(data_type const &d)
int getMTDTopologyMode() const
std::array< float, MAXSIZE > timeError
~MTDThresholdClusterizer() override
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0,...
std::array< float, MAXSIZE > time
std::vector< FTLCluster::FTLHitPos > theSeeds
void copy_to_buffer(RecHitIterator itr)
Copy FTLRecHit into the buffer, identify seeds.
std::array< float, MAXSIZE > energy
float time(uint row, uint col) const
FTLCluster make_cluster(const FTLCluster::FTLHitPos &hit)
The actual clustering algorithm: group the neighboring hits around the seed.
int mtdSubDetector() const
int theNumOfRows
Geometry-related information.
void clear(uint row, uint col)
bool setup(const MTDGeometry *geometry, const MTDTopology *topo, const DetId &id)
BTLDetId::CrysLayout crysLayoutFromTopoMode(const int &topoMode)
float energy(uint row, uint col) const
MTDArrayBuffer theBuffer
Data storage.
static void fillDescriptions(edm::ParameterSetDescription &desc)
void setSize(uint rows, uint cols)
std::vector< std::pair< float, float > >::iterator itr
constexpr uint32_t rawId() const
get the raw id
Detector identifier base class for the MIP Timing Layer.
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...
Abs< T >::type abs(const T &t)
float theHitThreshold
Clustering-related quantities:
SubDetector subDetector() const
float time_error(uint row, uint col) const