5#ifndef TILECOSMICALGS_TILEMUONFITTER_H
6#define TILECOSMICALGS_TILEMUONFITTER_H
45#include "GaudiKernel/ToolHandle.h"
46#include "Gaudi/Property.h"
97 virtual StatusCode
execute(
const EventContext& ctx)
override;
98 virtual StatusCode
finalize()
override;
148 , std::vector<int> & segModule, std::vector<int> & segSampling,
int index);
151 void energyInTrack(std::vector<double> & etop, std::vector<double> & ebot
152 , std::vector<IdentifierHash> & cells,
int index);
163 bool checkLBr(
double x1, uint8_t s1);
165 bool checkEBr(
double x1, uint8_t s1);
181 void cart2hough(
float x1,
float y1,
float x2,
float y2,
double &raio,
double &angu);
182 void hough2cart(
double r,
double a,
double offset,
double &aa,
double &bb);
185 unsigned int CntCells(
unsigned int index1,
unsigned int index2,
double &skew);
186 bool guessTrack(
unsigned int &index1,
unsigned int &index2);
190 void doHough(
double &rxy,
double &axy,
double &rzy,
double &azy);
191 void addTrack(
double aa,
double bb,
double cc,
double dd);
213 Gaudi::Property<bool>
m_doDensity{
this,
"DoDensityWeighting",
true};
215 Gaudi::Property<std::string>
m_beamType{
this,
"BeamType",
"cosmics"};
267 "Input CaloCellContainer name" };
272 "Output TileCosmicMuonContainer name"};
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Container class for CaloCell.
CaloCell_Base_ID::SUBCALO SUBCALO
This is a "hash" representation of an Identifier.
Auxiliary to TileMuonFitter.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Helper class for TileCal online (hardware) identifiers.
Helper class for TileCal offline identifiers.
bool isHaloMuon(double azy)
void addTrack(double aa, double bb, double cc, double dd)
void doHough(double &rxy, double &axy, double &rzy, double &azy)
int whichEBr(double x1)
Returns sampling index if x1 is within EB r coordinate bounds.
unsigned int CntCells(unsigned int index1, unsigned int index2, double &skew)
std::vector< double > m_tileDD_zEBC
Z bounds of EBC, loaded from Detector Description.
TileMuonFitter(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
void trackSegmentIntersection(std::vector< double > &segPath, std::vector< int > &segPartition, std::vector< int > &segModule, std::vector< int > &segSampling, int index)
Calculates length of track intersection with TileCal (by sampling and module).
std::vector< double > m_tileDD_zLB
Z bounds of LB, loaded from Detector Description.
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
std::vector< IdentifierHash > m_cellHash
Selected cell's identifier hash.
void hough2cart(double r, double a, double offset, double &aa, double &bb)
void buildComTimeAtYequal0(int fitok)
Creates output ComTime object in StoreGate.
Gaudi::Property< int > m_minimumCells
Minimum number of cells needed for fit.
Gaudi::Property< double > m_deltaTimeCut
Cell Delta Time cut.
void buildTileCosmicMuonAtYequal0(int fitok)
Creates output TileCosmicMuon object in StoreGate.
void buildCells()
Creates an internal cell container (just vectors) from the input CaloCellContainer.
const CaloCellContainer * m_caloCells
bool guessTrack(unsigned int &index1, unsigned int &index2)
void buildComTime(int fitok)
Selects between the two next methods.
virtual bool isClonable() const override final
Specify if the algorithm is clonable.
int m_nCells
Number of cells selected for fit.
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
void buildTileCosmicMuonAtZequal0(int fitok)
Creates output TileCosmicMuon object in StoreGate.
bool checkLBr(double x1, uint8_t s1)
Checks if x1 is within LB r coordinate bounds for sampling s1.
unsigned int buildCellInfoVector()
std::vector< CellInfo > m_cellInfo
int whichModule(CLHEP::Hep3Vector tempvec)
Returns module index for TVector3 input.
void points2dir(CellInfo &ci1, CellInfo &ci2, float *w)
std::vector< double > m_cellEnergy
Selected cell's energy.
int fitTrack()
Fits a straight track to the cell centers, using the auxiliary class TileMuonTrackDistance.
void calculateTime()
Calculates time in reference plane.
std::vector< CLHEP::Hep3Vector > m_cellPosition
Position of selected cell's center.
virtual StatusCode initialize() override
void buildComTimeAtZequal0(int fitok)
Creates output ComTime object in StoreGate.
std::vector< std::vector< double > > m_linePar
Vector with the fitted four track parameters.
void calculateTimeAtZequal0()
Extrapolates cell time to z=0.
const TileDetDescrManager * m_tileMgr
std::vector< double > m_cellWeight
Selected cell's weight for fit.
bool checkEBz(double x1)
Checks if x1 is within EB z coordinate bounds.
void trackIntersection(std::vector< double > <op, std::vector< double > &lbot, int index)
Calculates length of track intersection with TileCal (by sampling).
SG::WriteHandleKey< TileCosmicMuonContainer > m_cosmicMuonContainerKey
Gaudi::Property< bool > m_doHoughTransform
Flag to use Hough Transform instead of Fit.
float dist2line(CellInfo &ci, float *pos, float *w)
virtual ~TileMuonFitter()
virtual StatusCode finalize() override
Gaudi::Property< bool > m_doWeighted
Flag to weigh or not the chi-square with an energy parameter.
Gaudi::Property< std::string > m_beamType
Flag to indicate: cosmics, singlebeam or collisions.
bool checkEBCz(double x1)
Checks if x1 is within EBC z coordinate bounds.
Gaudi::Property< double > m_eThreshold
Cell energy threshold.
std::vector< double > m_fitMinimum
Chi-square minumum.
void cart2hough(float x1, float y1, float x2, float y2, double &raio, double &angu)
std::vector< double > m_tileDD_zEBA
Z bounds of EBA, loaded from Detector Description.
bool checkEBAz(double x1)
Checks if x1 is within EBA z coordinate bounds.
void buildTileCosmicMuon(int fitok)
Selects between the two next methods.
void calculateTimeAtYequal0()
Extrapolates cell time to y=0.
std::vector< double > m_zeroCrossingTime
Time at y=0.
int whichLBr(double x1)
Returns sampling index if x1 is within LB r coordinate bounds.
int houghTrack()
Fits a straight track to the cells centers, using a Hough Transform algorithm.
const TileHWID * m_tileHWID
float selectCells(float *p, float *w)
std::vector< double > m_cellTime
Selected cell's time.
bool checkLBz(double x1)
Checks if x1 is within LB z coordinate bounds.
std::vector< double > m_tileDD_radiusEB
Radial bounds of the 3 samplings in EB, loaded from Detector Description.
Gaudi::Property< bool > m_doDensity
Flag defining the energy weighting parameter: energy density or plain energy.
std::vector< double > m_cellDeltaTime
Selected cell's time difference between two PMTs.
static const CaloCell_ID::SUBCALO m_caloIndex
std::vector< double > m_tileDD_radiusLB
Radial bounds of the 3 samplings in LB, loaded from Detector Description.
bool checkEBr(double x1, uint8_t s1)
Checks if x1 is within EB r coordinate bounds for sampling s1.
void energyInTrack(std::vector< double > &etop, std::vector< double > &ebot, std::vector< IdentifierHash > &cells, int index)
Sums up energy in TileCal cells close to the track (by sampling).
ROOT::Minuit2::TileMuonTrackDistance * m_theTrack
Auxiliary class representing the function to be minimized - weighted sum of squares of orthogonal dis...
SG::WriteHandleKey< ComTime > m_comTimeKey
bool eventSelection()
Checks if there are good cells on the top and bottom modules.
void setEventDefaults()
Reset variables.