5#ifndef TILECOSMICALGS_TILEMUONFITTER_H
6#define TILECOSMICALGS_TILEMUONFITTER_H
45#include "GaudiKernel/ToolHandle.h"
96 virtual StatusCode
execute()
override;
97 virtual StatusCode
finalize()
override;
147 , std::vector<int> & segModule, std::vector<int> & segSampling,
int index);
150 void energyInTrack(std::vector<double> & etop, std::vector<double> & ebot
151 , std::vector<IdentifierHash> & cells,
int index);
162 bool checkLBr(
double x1, uint8_t s1);
164 bool checkEBr(
double x1, uint8_t s1);
180 void cart2hough(
float x1,
float y1,
float x2,
float y2,
double &raio,
double &angu);
181 void hough2cart(
double r,
double a,
double offset,
double &aa,
double &bb);
184 unsigned int CntCells(
unsigned int index1,
unsigned int index2,
double &skew);
185 bool guessTrack(
unsigned int &index1,
unsigned int &index2);
189 void doHough(
double &rxy,
double &axy,
double &rzy,
double &azy);
190 void addTrack(
double aa,
double bb,
double cc,
double dd);
266 "Input CaloCellContainer name" };
271 "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 with parameters:
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 m_doHoughTransform
Flag to use Hough Transform instead of Fit.
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.
int m_minimumCells
Minimum number of cells needed for fit.
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.
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.
double m_deltaTimeCut
Cell Delta Time cut.
virtual bool isClonable() const override final
bool m_doDensity
Flag defining the energy weighting parameter: energy density or plain energy.
int m_nCells
Number of cells selected for fit.
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.
bool m_doWeighted
Flag to weigh or not the chi-square with an energy parameter.
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
std::string m_beamType
Flag to indicate: cosmics, singlebeam or collisions.
float dist2line(CellInfo &ci, float *pos, float *w)
virtual ~TileMuonFitter()
virtual StatusCode finalize() override
bool checkEBCz(double x1)
Checks if x1 is within EBC z coordinate bounds.
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.
double m_eThreshold
Cell energy threshold.
int houghTrack()
Fits a straight track to the cells centers, using a Hough Transform algorithm.
const TileHWID * m_tileHWID
virtual StatusCode execute() override
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.
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.