PATHFINDER

General Information

PATHFINDER is a package which provides a track finding algorithm using a Hough Transformation as well as a very simple track generator. As input it needs hits (points in 3D space) and steering parameter. The positons of the hits must be given in cartesian coordinates. For more details see below. The search is done, depending on the track model, in two or three steps.

Limits/ Features of the Algorithm

Plans for the next release

( (./) means it is already in the head version of the trunk or was at least implemented in a branch.)

Usage

How to get PATHFINDER

Getting Started

Have a look at the examples coming along with PATHFINDER.

Track Finding

PATHFINDER has a class called FinderParameter. In order to use PATHFINDER these parameters need to be set by the user.

Example code:

   1 //FinderParameter* myFinderParameter= new FinderParameter(true, false) //straight line
   2 FinderParameter* myFinderParameter= new FinderParameter(false, true) //helix
   3 myFinderParameter -> setVertex(0.,0.);
   4 myFinderParameter -> setFindCurler(false);
   5 myFinderParameter -> setMaxXYDistance(5.);
   6 myFinderParameter -> setMaxSZDistance(5.);
   7 myFinderParameter -> setMaxXYDistanceFit(3.);
   8 myFinderParameter -> setMaxSZDistanceFit(3.);
   9 myFinderParameter -> setMinimumHitNumber(5);
  10 myFinderParameter -> setNumberXYThetaBins(200);
  11 myFinderParameter -> setNumberXYDzeroBins(200);
  12 myFinderParameter -> setNumberXYOmegaBins(200);
  13 myFinderParameter -> setNumberSZThetaBins(200);
  14 myFinderParameter -> setNumberSZDzeroBins(200);
  15 myFinderParameter -> setMaxDxy(10.);//for helix
  16 //myFinderParameter -> setMaxDxy(3200.);//for straight line
  17 myFinderParameter -> setMaxDsz(3200.);
  18 myFinderParameter -> setSearchNeighborhood(false);
  19 myFinderParameter -> setSaveRootFile(false);

/!\ Attention: The number of bins cannot be larger than 1000 bins! /!\

/!\ Attention: The value for _maxDxy has very different values for straight lines and helices. For more details see Additional notes on track finding /!\

Apart from that PATHFINDER also needs hits as input. The class for hits in PATHFINDER is called basicHit. The constructor takes three doubles as parameters which are the x,y,z position of the hit ( /!\ cartesian coordinates! /!\ ). To use PATHFINDER a vector of basicHits needs to be created.

Example code:

   1 basicHit myHit(xpos, ypos, zpos);
   2 myBasicHitVector.push_back(myHit);

Then the finding of tracks can be done.

Example code:

   1 HoughTrafoTrackFinder myTrackFinder;
   2 myTrackFinder.setFinderParameter(*myFinderParameter);
   3 myTrackFinder.setInitialHits(myBasicHitVector);
   4 bool track_found = myTrackFinder.find();

PATHFINDER then gives back a vector of TrackFinderTrack, which contains the track parameters and the hits on the track.

Example code:

   1 vector<TrackFinderTrack> foundTracks = myTrackFinder.getTracks();
   2 //get track parameters of first track in vector
   3 TrackParameterFull recoTrackParam = foundTracks[0].getTrackParameter();
   4 
   5 double d0 = recoTrackParam.getDZero();
   6 double phi = recoTrackParam.getPhi();
   7 double omega = recoTrackParam.getOmega();
   8 double z0 = recoTrackParam.getZZero();
   9 double tanl = recoTrackParam.getTanLambda();
  10 
  11 double d0Error = recoTrackParam.getDZeroError();
  12 double phiError = recoTrackParam.getPhiError();
  13 double omegaError = recoTrackParam.getOmegaError();
  14 double z0Error = recoTrackParam.getZZeroError();
  15 double tanlError = recoTrackParam.getTanLambdaError();
  16 
  17 //get hits on track
  18 vector<basicHit> hitsOnTrack = foundTracks[0].getHitsOnTrack();

Additional notes on track finding (Read this in case you have trouble finding tracks!)

Track Generation

To use the track generation implemented in PATHFINDER three steering classes are needed.

To fix a track parameter, upper and lower limit have to be set to the same value. In all other cases the minimum value for a parameter always needs to be smaller than the maximum value.

In addition to these steering classes the track type needs to be defined. This is done via an integer. It is 0 for straight lines, 1 for helix segments and 2 for curler

Example Code:

   1 unsigned int track_type = 2;//0 = straight line, 1 = helix segment, 2 = curler
   2 

The actual generation of tracks is done with a class called TrackGenerator. This class can only create one event at a time, so the loop over several events has to be provided by an external program. TrackGenerator gives back a vector with the simulated tracks (track parameters + hits on track), a vector containing all noise hits and a vector containing all hits in the event (hits on track + noise hits)

Example Code:

   1 TrackGenerator newTrackGen(track_type, TrackParameterLimits, EventType, Detectortrype);
   2 
   3 for(unsigned int event = 0; event<nevents; event++)
   4 {
   5  newTrackgen.generateTracks(event);
   6  vector<TrackFinderTrack*> simtracks = newTrackGen.getGeneratorTracks();
   7  vector<basicHit> allhits = newTrackGen.getHits();
   8  vector<basicHit> noisehits = newTrackGen.getNoiseHits();
   9  for(unsigned int i = 0; i<simtracks.size(); i++)
  10  {
  11   TrackParameterFull currentTrackParameters = simtracks[i]->getTrackParameter();
  12   vector<basicHit> currentTrackHits = simtracks[i]->getHitsOnTrack();
  13   double d0 = currentTrackParameters.getDZero();
  14   double phi = currentTrackParameters.getPhi();
  15   double omega = currentTrackParameters.getOmega();
  16   double tanl = currentTrackParameters.getTanLambda();
  17   double z0 = currentTrackParameters.getZZero();
  18   for(unsigned int j =0; j<currentTrackHits.size(); j++)
  19   {
  20    double pos[3];
  21    pos[0] = currentTrackHits[j].getX();
  22    pos[1] = currentTrackHits[j].getY();
  23    pos[2] = currentTrackHits[j].getZ();
  24   }
  25  }
  26 }

/!\ Note: For event numbers larger than about 2500 the random number for phi is not uniformly distributed.

PATHFINDER Class Diagrams

Track Finding

attachment:ClassDiagramPATHFINDER_v00-04_TrackFinding.png

Track Generation

attachment:ClassDiagramPATHFINDER_v00-04_TrackGeneration.png

RootFileWriter

(for debugging use only)

attachment:ClassDiagramPATHFINDERRootFileWriter.png


CategoryTpc

PATHFINDER (last edited 2013-04-29 09:37:18 by IsaHeinze)