27using std::numeric_limits;
74 static int eventNo = 0;
75 cout <<
"LitTrackFinderNN::DoFind: eventNo=" << eventNo++ << endl;
80 unsigned int nofHits =
hits.size();
81 for (
unsigned int iHit = 0; iHit < nofHits; iHit++) {
93 unsigned int nofSeeds = trackSeeds.size();
94 for (
unsigned int iTrack = 0; iTrack < nofSeeds; iTrack++) {
113 unsigned char nofVirtualStations =
fLayout.GetNofVirtualStations();
114 unsigned char nofSteps = (nofVirtualStations - 1) / 2;
115 for (
unsigned char iStep = 0; iStep < nofSteps; iStep++) {
147 if (nofVirtualStations == 1) {
157 unsigned char nofSteps = (nofVirtualStations - 1) / 2;
158 for (
unsigned char iStep = 0; iStep < nofSteps; iStep++) {
189 unsigned int nofTracks =
fTracks.size();
190 for (
unsigned int iTrack = 0; iTrack < nofTracks; iTrack++) {
193 unsigned char nofStations =
fLayout.GetNofStations();
194 for (
int iStation = 0; iStation < nofStations; iStation++) {
202 map<int, LitTrackParamScal> binParamMap;
204 for (itBins = bins.begin(); itBins != bins.end(); itBins++) {
212 map<int, LitTrackParamScal>::iterator itMap;
213 for (itMap = binParamMap.begin(); itMap != binParamMap.end(); itMap++) {
214 (*itMap).second = par;
226 fscal minChiSq = numeric_limits<fscal>::max();
230 unsigned int nofHits =
hits.size();
231 for (
unsigned int iHit = 0; iHit < nofHits; iHit++) {
233 int bin =
fHitData.GetBinByZPos(iStation, hit->
Z);
234 assert(binParamMap.find(bin) != binParamMap.end());
245 bool hitInside = (hit->
X < (tpar.
X + devX)) && (hit->
X > (tpar.
X - devX)) && (hit->
Y < (tpar.
Y + devY))
246 && (hit->
Y > (tpar.
Y - devY));
247 if (!hitInside)
continue;
249 fscal chi = numeric_limits<fscal>::max();
252 if (hitInValidationGate && chi < minChiSq) {
259 if (minHit != NULL) {
279 unsigned int nofTracks =
fTracks.size();
280 for (
unsigned int iTrack = 0; iTrack < nofTracks; iTrack++) {
289 unsigned int nofTracks =
fTracks.size();
290 for (
unsigned int iTrack = 0; iTrack < nofTracks; iTrack++) {
295 for (
unsigned int iHit = 0; iHit < track->
GetNofHits(); iHit++) {
303 unsigned int nofTracks =
fTracks.size();
304 for (
unsigned int iTrack = 0; iTrack < nofTracks; iTrack++) {
static vector< vector< QAHit > > hits
friend fvec sqrt(const fvec &a)
Functions for calculation of the material effects.
Parallel implementation of the nearest neighbor tracking algorithm.
Implementation of the track selection algorithms.
Functor class for convenient memory release.
bool IsEmpty() const
Check if field was set.
static const fscal EPSILON
bool IsEmpty() const
Check if material was set.
fscal GetMaterial(fscal x, fscal y) const
Return material thickness in silicon equivalent for (X, Y) position (scalar version).
Base class for scalar pixel hits.
void IncChiSq(fscal dChiSq)
Increases chi square by dChiSq.
void SetPreviousTrackId(unsigned short previousTrackId)
Sets previous trackId.
const LitTrackParamScal & GetParamFirst() const
Returns first parameter of the track.
void SetNofMissingHits(unsigned short nofMissingHits)
Sets number of missing hits.
unsigned short GetPreviousTrackId() const
Return Previous track index.
void SetNDF(unsigned short NDF)
Sets number of degrees of freedom.
unsigned short GetNofHits() const
Returns number of hits in track.
const LitTrackParamScal & GetParamLast() const
Returns last parameter of the track.
unsigned short GetNofMissingHits() const
Returns number of missing hits.
bool IsGood() const
Returns true if track is good.
void SetParamLast(const LitTrackParamScal ¶m)
Sets last track parameter.
const LitScalPixelHit * GetHit(unsigned short index) const
Returns pointer to the hit.
void SetParamFirst(const LitTrackParamScal ¶m)
Sets first track parameter.
void AddHit(const LitScalPixelHit *hit)
Adds hit to track.
void SetLastStationId(unsigned short lastStationId)
Set last station ID.
const LitVirtualStation< T > & GetVirtualStation(unsigned char virtualStation) const
Return virtual station by index.
unsigned char GetNofVirtualStations() const
Return number of virtual stations.
virtual ~LitTrackFinderNN()
Destructor.
void CopyToOutput(vector< lit::parallel::LitScalTrack * > &tracks)
Copy tracks to output array.
vector< fscal > fChiSqStripHitCut
void PropagateVirtualStations(LitTrackParamScal &par)
vector< int > fMaxNofMissingHits
vector< lit::parallel::LitScalTrack * > fTracks
void ArrangeHits(const vector< lit::parallel::LitScalPixelHit * > &hits)
LitTrackFinderNN()
Constructor.
void RemoveHits()
Write already used hits to a used hits set.
void DoFind(const vector< lit::parallel::LitScalPixelHit * > &hits, const vector< lit::parallel::LitScalTrack * > &trackSeeds, vector< lit::parallel::LitScalTrack * > &tracks)
Main function for track reconstruction.
vector< fscal > fChiSqPixelHitCut
LitDetectorLayoutScal fLayout
void InitTrackSeeds(const vector< lit::parallel::LitScalTrack * > &trackSeeds)
Initialize track seeds and copy to local array.
vector< fscal > fSigmaCoef
void FollowTracks()
Follow tracks through detector.
void PropagateToStation(unsigned char stationId, LitTrackParamScal &par)
const LitFieldGrid & GetField() const
const LitMaterialGrid & GetMaterial() const
LitTrackParam< fscal > LitTrackParamScal
Scalar version of LitTrackParam.
void LitRK4Extrapolation(LitTrackParam< T > &par, T zOut, const LitFieldGrid &field1, const LitFieldGrid &field2, const LitFieldGrid &field3)
LitStation< fscal > LitStationScal
Scalar version of LitStation.
void LitFiltration(LitTrackParam< T > &par, const LitPixelHit< T > &hit, T &chiSq)
Function implements Kalman filter update step for pixel hit.
void LitLineExtrapolation(LitTrackParam< T > &par, T zOut)
Line track extrapolation for the field free regions.
LitVirtualStation< fscal > LitVirtualStationScal
Scalar version of LitVirtualStation.
void DoSelectSharedHits(vector< LitScalTrack * > &tracks)
void LitAddMaterial(LitTrackParam< T > &par, T siliconThickness)
unsigned short NDF(const LitScalTrack &track)
Returns number of degrees of freedom for the track.