Skip to content
Snippets Groups Projects
Select Git revision
  • bc01b8fbb35ef31f67a26a2340313ea7a7ab10d7
  • master default protected
  • 11-helicity-logging-levels
  • develop
  • v1.3-dev
  • features/online
  • v1.4.0
  • v1.3.1
  • v1.3.0
  • v2.0.0_dev
  • v1.2.0
  • v1.1.9
  • v1.1.8
  • v1.1.7
  • v1.1.6
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.0
  • v1.1.1
  • v1.0.0
  • v0.96
  • v0.95
  • hcana_podd_1.5.28
  • HitMaps
26 results

THcDCTrack.cxx

Blame
  • user avatar
    Stephen A. Wood authored and Stephen Wood committed
    827a26c9
    History
    THcDCTrack.cxx 1.57 KiB
    /** \class THcDCTrack
        \ingroup DetSupport
    
     Class representing a track found from linking DC Space points
    
    */
    
    #include "THcDCHit.h"
    #include "THcDCTrack.h"
    #include "THcSpacePoint.h"
    THcDCTrack::THcDCTrack(Int_t nplanes) : fnSP(0), fNHits(0)
    {
      fHits.clear();
      fCoords.resize(nplanes);
      fResiduals.resize(nplanes);
      fResidualsExclPlane.resize(nplanes);
      fDoubleResiduals.resize(nplanes);
    }
    
    void THcDCTrack::AddHit(THcDCHit * hit, Double_t dist, Int_t lr)
    {
      /**
         Add hit to list of hits associated with the track
      */
      Hit newhit;
      newhit.dchit = hit;
      newhit.distCorr = dist;
      newhit.lr = lr;
      fHits.push_back(newhit);
      fNHits++;
    }
    void THcDCTrack::AddSpacePoint( THcSpacePoint* sp )
    {
      /**
         Add a space point to the list of space points associated with the track.
         All hits in the SP are added to the tracks hit list.
      */
    
      if (fnSP <10) {
        fSp[fnSP++] = sp;
        // Copy all the hits from the space point into the track
        // Will need to also copy the corrected distance and lr information
        for(Int_t ihit=0;ihit<sp->GetNHits();ihit++) {
          AddHit(sp->GetHit(ihit),sp->GetHitDist(ihit),sp->GetHitLR(ihit));
        }
      }
    }
    
    void THcDCTrack::Clear( const Option_t* )
    {
      /**
         Clear the space point and hit lists
      */
      fnSP = 0;
      fSp1_ID=-1;
      fSp2_ID=-1;
      ClearHits();
      // Need to set default values  (0 or -100)
      //fCoords.clear();
      //fResiduals.clear();
      //fDoubleResiduals.clear();
    }
    void THcDCTrack::ClearHits( )
    {
      fNHits = 0;
      fHits.clear();
    }
    
    ClassImp(THcDCTrack)
    
    ///////////////////////////////////////////////////////////////////////////////