|
|
Go to the documentation of this file.
25 std::cout << x << std::endl; \
36 theHitThreshold(conf.getParameter<double>(
"HitThreshold")),
37 theSeedThreshold(conf.getParameter<double>(
"SeedThreshold")),
38 theClusterThreshold(conf.getParameter<double>(
"ClusterThreshold")),
39 theTimeThreshold(conf.getParameter<double>(
"TimeThreshold")),
40 thePositionThreshold(conf.getParameter<double>(
"PositionThreshold")),
44 theBuffer(theNumOfRows, theNumOfCols),
45 bufferAlreadySet(
false) {}
51 desc.add<
double>(
"HitThreshold", 0.);
52 desc.add<
double>(
"SeedThreshold", 0.);
53 desc.add<
double>(
"ClusterThreshold", 0.);
54 desc.add<
double>(
"TimeThreshold", 10.);
55 desc.add<
double>(
"PositionThreshold", -1.0);
65 const auto& thedet =
geom->idToDet(
id);
66 if (thedet ==
nullptr) {
68 <<
"GeographicalID: " << std::hex <<
id.rawId() <<
" is invalid!" <<
std::dec << std::endl;
71 const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
75 unsigned int nrows = topol.
nrows();
76 unsigned int ncols = topol.ncolumns();
107 edm::LogInfo(
"MTDThresholdClusterizer") <<
"No hits to clusterize";
114 std::set<unsigned> geoIds;
115 std::multimap<unsigned, unsigned> geoIdToIdx;
122 <<
"MTDDetId: " << std::hex << mtdId.
rawId() <<
" is invalid!" <<
std::dec << std::endl;
129 geoIdToIdx.emplace(geoId,
index);
130 geoIds.emplace(geoId);
134 DetId geoId = hitId.geographicalId();
135 geoIdToIdx.emplace(geoId,
index);
136 geoIds.emplace(geoId);
140 <<
"MTDDetId: " << std::hex << mtdId.
rawId() <<
" is invalid!" <<
std::dec << std::endl;
145 for (
unsigned id : geoIds) {
150 auto range = geoIdToIdx.equal_range(
id);
151 DEBUG(
"Matching Ids for " << std::hex <<
id <<
std::dec <<
" [" <<
range.first->second <<
","
152 <<
range.second->second <<
"]");
156 for (
auto itr =
range.first; itr !=
range.second; ++itr) {
157 const unsigned hitidx = itr->second;
163 for (
unsigned int i = 0;
i <
theSeeds.size();
i++) {
170 DEBUG(
"putting in this cluster " <<
i <<
" #hits:" << cluster.
size() <<
" E:" << cluster.
energy()
171 <<
" T:" << cluster.
time() <<
" X:" << cluster.
x() <<
" Y:" << cluster.
y());
180 for (
auto itr =
range.first; itr !=
range.second; ++itr) {
181 const unsigned hitidx = itr->second;
201 int row = itr->row();
202 int col = itr->column();
204 float energy = itr->energy();
205 float time = itr->time();
206 float timeError = itr->timeError();
215 const auto& det =
geom->idToDet(geoId);
216 const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(det->topology());
223 global_point = det->toGlobal(lp);
229 DetId geoId =
id.geographicalId();
230 const auto& det =
geom->idToDet(geoId);
231 const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(det->topology());
236 global_point = det->toGlobal(lp);
264 acluster.
add(
hit, seed_energy, seed_time, seed_time_error);
266 bool stopClus =
false;
268 while (!acluster.
empty() && !stopClus) {
270 auto curInd = acluster.
top();
272 for (
auto c =
std::max(0,
int(acluster.
y[curInd] - 1));
275 for (
auto r =
std::max(0,
int(acluster.
x[curInd] - 1));
289 (hit_error_xx + seed_error_xx + hit_error_yy + seed_error_yy))
307 acluster.
time.data(),
MTDThresholdClusterizer(edm::ParameterSet const &conf)
Constructor:
std::vector< T >::const_iterator const_iterator
static const std::string input
FTLRecHitCollection::const_iterator RecHitIterator
void clear_buffer(RecHitIterator itr)
Clear the internal buffer array.
void copy_to_buffer(RecHitIterator itr, const MTDGeometry *geom, const MTDTopology *topo)
Copy FTLRecHit into the buffer, identify seeds.
const float theHitThreshold
Clustering-related quantities:
const float theSeedThreshold
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)
Log< level::Info, false > LogInfo
int getMTDTopologyMode() const
GlobalPoint global_point(uint row, uint col) 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
const float theTimeThreshold
LocalError localError() const
const float theClusterThreshold
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)
LocalError local_error(uint row, uint col) const
float energy(uint row, uint col) const
MTDArrayBuffer theBuffer
Data storage.
static int position[264][3]
void setSize(uint rows, uint cols)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
void set(uint row, uint col, GeomDetEnumerators::Location subDet, float energy, float time, float time_error, const LocalError &local_error, const GlobalPoint &global_point)
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...
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Abs< T >::type abs(const T &t)
SubDetector subDetector() const
float time_error(uint row, uint col) const
const float thePositionThreshold
GeomDetEnumerators::Location subDet(uint row, uint col) const
Use subDet to identify whether the Hit is in BTL or ETL.