5#ifndef MUONLAYERHOUGH_H
6#define MUONLAYERHOUGH_H
21 using HitVec = std::vector<std::shared_ptr<MuonHough::Hit>>;
31 float referencePosition_,
float yMinRange_,
32 float yMaxRange_,
float yBinSize_,
float thetaStep_,
33 unsigned int nthetaSamples_) :
90 if (region != DetRegIdx::Barrel && chIndex != ChIdx::BEE) {
return true; }
127 int bin(
const Hit& hit)
const;
130 int bin(
float x,
float y)
const;
133 float yval(
int posBin)
const;
136 void pars(
int posBin,
int ,
float&
x,
float&
y)
const;
154 std::pair<int, int>
range(
const float x,
const float y1,
const float y2,
const int bintheta)
const;
157 std::pair<float, float>
maximum(
float x,
float y,
int& posbin,
int& thetabin)
const;
163 void fill(
float x,
float y,
float weight);
172 std::vector<TH1*>
rootHistos(
const std::string& prefix,
const float* rmin = 0,
const float* rmax = 0)
const;
186 std::vector<std::unique_ptr<unsigned int[]> >
m_histos;
195 if (in < 0 || in >=
m_nbins) in = -1;
const boost::regex ref(r_ef)
struct containing all hit information needed for the Hough transform
float x
layer identifier (packed word containing technology/sublayer)
float ymin
global hit position (x=r in barrel, x=z in endcap)
float w
maximum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
float extrapolate(const MuonLayerHough::Maximum &ref, const MuonLayerHough::Maximum &ex, bool doparabolic=false)
std::vector< RegionDescriptor > RegionDescriptionVec
std::vector< std::shared_ptr< MuonHough::Hit > > HitVec
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
ChIndex
enum to classify the different chamber layers in the muon spectrometer
struct representing the maximum in the hough space
float getGlobalTheta() const
const MuonLayerHough * hough
void pars(int posBin, int, float &x, float &y) const
calculate x,y for the given position bin
void reset()
reset the transform
int bin(const Hit &hit) const
calculate the position bin the hit will endup in
void associateHitsToMaximum(Maximum &maximum, const HitVec &hits) const
associates the list of input hits to the provided maximum
void setDebug(bool d)
enable debug output
RegionDescriptor m_descriptor
std::pair< float, float > maximum(float x, float y, int &posbin, int &thetabin) const
returns a pair with the position and angle corresponing to the input x,y values
~MuonLayerHough()=default
destructor
std::vector< std::unique_ptr< unsigned int[]> > m_histos
int m_nbins
inverse binsize
std::vector< TH1 * > rootHistos(const std::string &prefix, const float *rmin=0, const float *rmax=0) const
returns a vector with all the histograms of the hough as TH1*
float layerConfirmation(const Hit &hit, float range=1000.) const
calculate the highest value of the hough transform within the specified range for the given hit
float yval(int posBin) const
access to y coordinate of a given bin
void fillLayer2(const HitVec &hits, bool subtract=false)
bool findMaximum(Maximum &maximum, const MuonLayerHoughSelector &selector) const
find the highest maximum that is above maxval
MuonLayerHough(const RegionDescriptor &descriptor)
constructor
float m_invbinsize
binsize
Muon::MuonStationIndex::DetectorRegionIndex DetRegIdx
void fill(const Hit &hit)
fill the hough space with a single position
Muon::MuonStationIndex::ChIndex ChIdx
void fillLayer(const HitVec &hits, bool substract=false)
fill the hough space with a vector of hits using the layer mode
std::pair< int, int > range(const float x, const float y1, const float y2, const int bintheta) const
calculates the first and last bin the hit should be filled in for a given theta bin
struct containing all information to build a Hough transform for a given chamber index
Muon::MuonStationIndex::DetectorRegionIndex DetRegIdx
Muon::MuonStationIndex::ChIndex ChIdx
RegionDescriptor()=default
unsigned int nthetaSamples
RegionDescriptor(int sector_, DetRegIdx region_, ChIdx chIndex_, float referencePosition_, float yMinRange_, float yMaxRange_, float yBinSize_, float thetaStep_, unsigned int nthetaSamples_)