DataFT Class Reference

#include <DataFT.h>

List of all members.

Public Types

typedef Int_t Count_t
typedef UShort_t Mask_t
typedef std::vector< Mask_tViewMask_t

Public Member Functions

 DataFT (const AlgConfig &ac, const TrackContext &tc)
 ~DataFT ()
Bool_t Init (const TrackContext &)
Bool_t Fill (const TrackContext &)
PlaneDataat (PlaneDataVec_t::size_type index)
const PlaneDataat (PlaneDataVec_t::size_type index) const
Count_t GetNPlanes () const
Count_t GetNUPlanes () const
Count_t GetNVPlanes () const
Count_t GetNPlanesUsed () const
Count_t GetNPlanesMin (Count_t nhitsperview) const
PlaneData::Data_t GetU (Count_t i) const
PlaneData::Data_t GetSigmaU (Count_t i) const
PlaneData::Data_t GetV (Count_t i) const
PlaneData::Data_t GetSigmaV (Count_t i) const
PlaneData::Data_t GetUMean () const
PlaneData::Data_t GetVMean () const
Bool_t IsHitU (Count_t i) const
Bool_t IsHitV (Count_t i) const
Bool_t UHitUse (Count_t i) const
Bool_t VHitUse (Count_t i) const
const ViewMask_tGetUHitUse () const
const ViewMask_tGetVHitUse () const
void SetUHitUse (const ViewMask_t &usehitu)
void SetVHitUse (const ViewMask_t &usehitv)
Int_t GetZdir () const
PlaneData::Data_t GetZVtx () const
PlaneData::Data_t GetZ (Count_t i) const
PlaneData::Data_t GetdZSteel (Count_t i) const
PlaneData::Data_t GetX0 (Count_t i) const
Count_t GetNUHits () const
Count_t GetNVHits () const
Count_t GetNHits () const
Count_t GetNUHitsUsed () const
Count_t GetNVHitsUsed () const
Count_t GetNHitsUsed () const
PlexPlaneId GetBegPlaneId () const
PlexPlaneId GetEndPlaneId () const
PlexPlaneId GetPlaneId (Count_t i) const
Count_t GetPlane (Count_t i) const
Count_t GetBegHit () const
Count_t GetEndHit () const
Count_t GetBegHitUsed () const
Count_t GetEndHitUsed () const
void SetNPlanesUsed (Count_t n)
void SetU (Count_t i, PlaneData::Data_t u)
void SetSigmaU (Count_t i, PlaneData::Data_t eu)
void SetV (Count_t i, PlaneData::Data_t v)
void SetSigmaV (Count_t i, PlaneData::Data_t ev)
void SetUHit (Count_t i)
void SetVHit (Count_t i)
void UnsetUHit (Count_t i)
void UnsetVHit (Count_t i)
void SetUHitUse (Count_t i)
void SetVHitUse (Count_t i)
void UnsetUHitUse (Count_t i)
void UnsetVHitUse (Count_t i)
void SetZ (Count_t i, PlaneData::Data_t z)
void SetdZSteel (Count_t i, PlaneData::Data_t dz)
void SetX0 (Count_t i, PlaneData::Data_t x0)
void SetPlane (Count_t i, PlexPlaneId plane)
PlaneData::Data_t GetUf (Count_t i) const
PlaneData::Data_t GetDudz (Count_t i) const
PlaneData::Data_t GetVf (Count_t i) const
PlaneData::Data_t GetDvdz (Count_t i) const
PlaneData::Data_t GetUlin (Count_t i) const
PlaneData::Data_t GetVlin (Count_t i) const
PlaneData::Data_t GetDudzlin (Count_t i) const
PlaneData::Data_t GetDvdzlin (Count_t i) const
PlaneData::Data_t GetInvP (Count_t i) const
PlaneData::Data_t GetP (Count_t i) const
PlaneData::Data_t GetS (Count_t i) const
PlaneData::Data_t GetR (Count_t i) const
PlaneData::Data_t GetCos (Count_t i) const
Int_t GetEMCharge () const
TVectorD GetTrack () const
void SetUf (Count_t i, PlaneData::Data_t uf)
void SetDudz (Count_t i, PlaneData::Data_t dudz)
void SetVf (Count_t i, PlaneData::Data_t vf)
void SetDvdz (Count_t i, PlaneData::Data_t dvdz)
void SetInvP (Count_t i, PlaneData::Data_t invp)
void SetS (Count_t i, PlaneData::Data_t s)
void SetR (Count_t i, PlaneData::Data_t r)
void SetCos (Count_t i, PlaneData::Data_t cos)
void SetUlin (Count_t i, PlaneData::Data_t ulin)
void SetVlin (Count_t i, PlaneData::Data_t vlin)
void SetDudzlin (Count_t i, PlaneData::Data_t dudzlin)
void SetDvdzlin (Count_t i, PlaneData::Data_t dvdzlin)
void SetInitial (const TVectorD &inittrack)
Count_t SetInitial (const TVectorD &inittrack, Count_t nplanesuse, SwimSwimmer &swimmer)
void FillVectorC (TMatrixD &vC) const
Bool_t FillUArrays (Double_t zu[], Double_t u[], Int_t n)
Bool_t FillVArrays (Double_t zv[], Double_t v[], Int_t n)
Bool_t FillLinWithSpline ()
void PrintData () const
void FillVectorCF (TMatrixD &vC) const
void FillVectorRes (TMatrixD &vRes, PlaneData::Data_t cdata=1., PlaneData::Data_t ctrack=-1.) const
Count_t GetNPlanesPCut (PlaneData::Data_t pcut) const
Count_t SwimAsSwimmer (SwimSwimmer &swimmer)
Count_t SwimAsSwimmer (Count_t nplanes, SwimSwimmer &swimmer)
PlaneData::Data_t ThetaMCS (Count_t i) const
PlaneData::Data_t T (Count_t i, Count_t n) const
void DumpTrack () const
void PrintMomenta () const
void Reset ()
void Config (const AlgConfig &)
void SetHitCoords (Count_t planeIndex, PlaneData::Data_t tpos, PlaneData::Data_t error)
void OneStripPlane (Count_t i, StripMapItr it, const CandTrackHandle *cth)
void TwoStripPlane (Count_t i, StripMapItr lower, StripMapItr upper, const CandTrackHandle *cth)

Private Types

typedef std::vector< PlaneDataPlaneDataVec_t
typedef PlaneDataVec_t::iterator PlaneDataItr
typedef
PlaneDataVec_t::const_iterator 
PlaneDataCItr
typedef
PlaneDataVec_t::const_reverse_iterator 
PlaneDataCRItr
typedef PlaneData::Data_t(DataFT::* FGETTER )(Int_t) const
typedef void(DataFT::* FSETTER )(Int_t, PlaneData::Data_t)
typedef bool(DataFT::* BGETTER )(Int_t) const
typedef const CandStripHandle CSH
typedef CSHCSHPtr
typedef std::vector< CSHPtr >
::iterator 
CSHItr
typedef std::multimap< Int_t,
Reco::Strip_t
StripMap
typedef StripMap::iterator StripMapItr

Private Attributes

Short_t fNPlanesUsed
Short_t fDir
TVectorD fInitialTrack
PlaneData::Data_t fZVtx
PlaneDataVec_t fPlanes
ViewMask_t fUHitUse
ViewMask_t fVHitUse
GeometryHelper fGeo
PlaneData::Data_t fMinStripCharge
Bool_t fSetLPos
Int_t fNHitsInViewMin
bool fUseGeoSwimmer

Detailed Description

Definition at line 31 of file DataFT.h.


Member Typedef Documentation

typedef bool(DataFT::* DataFT::BGETTER)(Int_t) const [private]

Definition at line 49 of file DataFT.h.

typedef Int_t DataFT::Count_t

Definition at line 35 of file DataFT.h.

typedef const CandStripHandle DataFT::CSH [private]

Definition at line 51 of file DataFT.h.

typedef std::vector<CSHPtr>::iterator DataFT::CSHItr [private]

Definition at line 53 of file DataFT.h.

typedef CSH* DataFT::CSHPtr [private]

Definition at line 52 of file DataFT.h.

typedef PlaneData::Data_t(DataFT::* DataFT::FGETTER)(Int_t) const [private]

Definition at line 47 of file DataFT.h.

typedef void(DataFT::* DataFT::FSETTER)(Int_t, PlaneData::Data_t) [private]

Definition at line 48 of file DataFT.h.

typedef UShort_t DataFT::Mask_t

Definition at line 36 of file DataFT.h.

typedef PlaneDataVec_t::const_iterator DataFT::PlaneDataCItr [private]

Definition at line 44 of file DataFT.h.

typedef PlaneDataVec_t::const_reverse_iterator DataFT::PlaneDataCRItr [private]

Definition at line 45 of file DataFT.h.

typedef PlaneDataVec_t::iterator DataFT::PlaneDataItr [private]

Definition at line 43 of file DataFT.h.

typedef std::vector<PlaneData> DataFT::PlaneDataVec_t [private]

Definition at line 41 of file DataFT.h.

typedef std::multimap<Int_t, Reco::Strip_t> DataFT::StripMap [private]

Definition at line 55 of file DataFT.h.

typedef StripMap::iterator DataFT::StripMapItr [private]

Definition at line 56 of file DataFT.h.

typedef std::vector<Mask_t> DataFT::ViewMask_t

Definition at line 37 of file DataFT.h.


Constructor & Destructor Documentation

DataFT::DataFT ( const AlgConfig ac,
const TrackContext tc 
)

Definition at line 57 of file DataFT.cxx.

References Config(), Fill(), FillLinWithSpline(), fNHitsInViewMin, GetNUHits(), GetNVHits(), Init(), and PrintData().

00057                                                           :
00058     fNPlanesUsed(tc.GetNPlanes()), fDir(tc.GetDir()),
00059     fInitialTrack(NTrackParams), fZVtx(0.),
00060     fPlanes(tc.GetNPlanes()),
00061     fUHitUse(tc.GetNPlanes()), fVHitUse(tc.GetNPlanes()),
00062     fGeo(tc), fMinStripCharge(kMinStripCharge),
00063     fSetLPos(kTRUE), fNHitsInViewMin(4),
00064     fUseGeoSwimmer(false)
00065 {
00066     TracerSA trace("DataFT::DataFT(const AlgConfig& , const TrackContext& )");
00067 
00068     Config(ac);
00069 
00070     Bool_t status;
00071 
00072     status = Init(tc);
00073     assert(status && "DataFT::Init(const TrackContext&) failed!");
00074 
00075     status = Fill(tc);
00076     assert(status && "DataFT::Fill(const TrackContext&) failed!");
00077 
00078     if ( GetNUHits() >= fNHitsInViewMin &&
00079             GetNVHits() >= fNHitsInViewMin ) {
00080         status = FillLinWithSpline();
00081         assert(status && "DataFT::FillLinWithSpline() failed!");
00082     }
00083     
00084     PrintData();
00085 }

DataFT::~DataFT (  ) 

Definition at line 91 of file DataFT.cxx.

00092 {
00093     TracerSA trace("DataFT::~DataFT()");
00094 }


Member Function Documentation

const PlaneData& DataFT::at ( PlaneDataVec_t::size_type  index  )  const [inline]

Definition at line 77 of file DataFT.h.

References fPlanes.

00077                                                             {
00078 #ifdef DEBUG
00079         return fPlanes.at(index);
00080 #else
00081         return fPlanes[index];
00082 #endif
00083     };

PlaneData& DataFT::at ( PlaneDataVec_t::size_type  index  )  [inline]
void DataFT::Config ( const AlgConfig ac  ) 

configure from AlgConfig

read configuration parameters from AlgConfig

Definition at line 114 of file DataFT.cxx.

References fMinStripCharge, fNHitsInViewMin, fSetLPos, fUseGeoSwimmer, Registry::GetDouble(), Registry::GetInt(), and Registry::KeyExists().

Referenced by DataFT().

00115 {
00116     TracerSA trace("DataFT::Config(const AlgConfig&)");
00117 
00118     if ( ac.KeyExists("NHitsInViewMin") ) {
00119         fNHitsInViewMin = ac.GetInt("NHitsInViewMin");
00120     }
00121 
00122     if ( ac.KeyExists("MinStripCharge") ) {
00123         fMinStripCharge = ac.GetDouble("MinStripCharge");
00124     }
00125 
00126     if ( ac.KeyExists("SetLPos") ) {
00127         fSetLPos = (Bool_t) ac.GetInt("SetLPos");
00128     }
00129 
00130     if ( ac.KeyExists("UseGeoSwimmer") ) {
00131       fUseGeoSwimmer = ac.GetInt("UseGeoSwimmer");
00132     }
00133 
00134 }

void DataFT::DumpTrack (  )  const

Definition at line 967 of file DataFT.cxx.

References GetDudz(), GetDvdz(), GetInvP(), GetNPlanesUsed(), GetPlane(), GetUf(), GetVf(), GetZ(), Msg::kVerbose, MSG, MSGSTREAM, and ConstFT::TinyNumber.

Referenced by SwimAsSwimmer().

00968 {
00969     TracerSA trace("DataFT::DumpTrack");
00970     // Print out track (for debugging)
00971     if ( GetNPlanesUsed()>0 ) {
00972         MsgFormat ffmt("%7.3f");
00973         MsgStream *mftsa = &MSGSTREAM("FitTrackSA", Msg::kVerbose);
00974         (*mftsa) << "Generated track:\n";
00975         for (Int_t i = 0; i<GetNPlanesUsed(); i++) {
00976             (*mftsa)
00977                 << GetPlane(i) <<  ": u=" << ffmt(GetUf(i))
00978                 << "; du/dz=" << ffmt(GetDudz(i)) <<  "; v=" << ffmt(GetVf(i))
00979                 << "; dv/dz=" << ffmt(GetDvdz(i)) 
00980                 << "; p=" <<ffmt(1./TMath::Max(TinyNumber,(Double_t)GetInvP(i)))
00981                 << "; z=" << ffmt(GetZ(i)) <<  "\n";
00982         }
00983     } else {
00984         MSG("FitTrackSA",Msg::kVerbose) << "No track generated yet!\n";
00985     }
00986 
00987 }

Bool_t DataFT::Fill ( const TrackContext tc  ) 

Definition at line 189 of file DataFT.cxx.

References fDir, fMinStripCharge, GetBegPlaneId(), GetNPlanes(), PlexPlaneId::GetPlane(), TrackContext::GetStripVec(), TrackContext::GetTrackHandle(), it, Msg::kVerbose, MSG, OneStripPlane(), and TwoStripPlane().

Referenced by DataFT().

00190 {
00191   TracerSA trace("DataFT::Fill(const TrackContext&)");
00192 
00193   // convert daughter list to STL vector
00194   //vector<CSHPtr> stripList(DataUtil::CDL2STLvector<CSH>(*tc.GetTrackHandle()));
00195 
00196   Reco::StripVec_t stripList = tc.GetStripVec();
00197   
00198   // sort using ByPlane functor    
00199   sort(stripList.begin(), stripList.end(), Reco::ByPlane());
00200   // reverse order if track direction against Z axis
00201   if (fDir<0) reverse(stripList.begin(), stripList.end());
00202 
00203   // strip _multi_map - can hold more than one strip per plane 
00204   StripMap stripMap;
00205 
00206   // Fill stripMap
00207   for ( Reco::StripIter_t it = stripList.begin();  it != stripList.end(); ++it) {
00208 
00209       MSG("FitTrackSA", Msg::kVerbose)
00210       << "P " << (*it)->GetPlane()
00211       << ": Charge=" << (*it)->GetCharge()
00212       << "; Strip=" << (*it)->GetStrip() << "\n";
00213 
00214       // check if strip is not demux vetoed and charge is not too small
00215       if ( (*it)->GetDemuxVetoFlag() ) continue;
00216       if ( (*it)->GetCharge() < fMinStripCharge ) continue;
00217 
00218       // And add it to the multimap
00219       Int_t plane = (*it)->GetPlane();
00220       stripMap.insert(pair<Int_t, Reco::Strip_t> (plane, *it));
00221   }
00222 
00223   // Loop over planes, use only planes with one or two (consecutive) hit strips
00224   // ignore planes with more than two hit strips - let shower code deal with them
00225   Int_t begplane = GetBegPlaneId().GetPlane();
00226   Int_t nplanes  = GetNPlanes();
00227   for (Int_t i = 0; i < nplanes; ++i) {
00228       Int_t plane = begplane + i*fDir;
00229       switch ( stripMap.count(plane) ) {
00230       case 1:
00231           {
00232           StripMapItr itr = stripMap.find(plane);
00233           OneStripPlane(i, itr, tc.GetTrackHandle());
00234           }
00235           break;
00236 
00237       case 2:
00238           {
00239           StripMapItr itLower = stripMap.lower_bound(plane);
00240           StripMapItr itUpper = stripMap.upper_bound(plane);
00241           TwoStripPlane(i, itLower, itUpper, tc.GetTrackHandle());
00242           }
00243           break;
00244 
00245       default:
00246           // do nothing
00247           assert(1);
00248       }
00249   }
00250   return kTRUE;
00251 }

Bool_t DataFT::FillLinWithSpline (  ) 

Definition at line 753 of file DataFT.cxx.

References FillUArrays(), FillVArrays(), GetNPlanes(), GetNUHits(), GetNVHits(), GetZ(), Msg::kVerbose, MSGSTREAM, SetDudzlin(), SetDvdzlin(), SetUlin(), and SetVlin().

Referenced by DataFT().

00754 {
00755     TracerSA trace("DataFT::FillLinWithSpline()");
00756 
00757     MsgStream *mftsa = &MSGSTREAM("FitTrackSA", Msg::kVerbose);
00758 
00759     const Int_t NU = GetNUHits();
00760     std::vector<Double_t> zu(NU);
00761     std::vector<Double_t> u(NU);
00762     FillUArrays(&zu[0], &u[0], NU);
00763     (*mftsa) << "NU = " << NU << std::endl;
00764     TSpline5 splineU("U", &zu[0], &u[0], NU);
00765 
00766     const Int_t NV = GetNVHits();
00767     std::vector<Double_t> zv(NV);
00768     std::vector<Double_t> v(NV);
00769     FillVArrays(&zv[0], &v[0], NV);
00770     (*mftsa) << "NV = " << NV << std::endl;
00771     TSpline5 splineV("V", &zv[0], &v[0], NV);
00772 
00773     (*mftsa) << "Filling from TSpline: " << "\n";
00774     MsgFormat ffmt("%7.3f");
00775     // fill spline approximation of the track
00776     for (Count_t i = 0; i<GetNPlanes(); ++i) {
00777         Double_t z = (Double_t) GetZ(i);
00778 
00779         (*mftsa) << "z=" << ffmt(z)
00780             << "; US=" << ffmt(splineU.Eval(z))
00781             << "; dU/dZS=" << ffmt(splineU.Derivative(z))
00782             << "; VS=" << ffmt(splineV.Eval(z))
00783             << "; dV/dZS=" << ffmt(splineV.Derivative(z))
00784             << std::endl;
00785 
00786         SetUlin(i, (PlaneData::Data_t) splineU.Eval(z));
00787         SetDudzlin(i, (PlaneData::Data_t) splineU.Derivative(z));
00788         SetVlin(i, (PlaneData::Data_t) splineV.Eval(z));
00789         SetDvdzlin(i, (PlaneData::Data_t) splineV.Derivative(z));
00790     }
00791     return kTRUE;
00792 }

Bool_t DataFT::FillUArrays ( Double_t  zu[],
Double_t  u[],
Int_t  n 
)

Definition at line 694 of file DataFT.cxx.

References GetNPlanes(), GetU(), GetZ(), IsHitU(), Msg::kVerbose, MSGSTREAM, and size.

Referenced by FillLinWithSpline().

00695 {
00696     TracerSA trace("DataFT::FillUArrays(Double_t zu[], Double_t u[],Int_t)");
00697     
00698     Int_t index = 0;    
00699     Count_t size = GetNPlanes();
00700     for (Count_t i = 0; i < size; ++i) {
00701         if ( IsHitU(i) ) {
00702             assert( index < n && "Array bound check failed!");
00703             zu[index] = (Double_t) GetZ(i);
00704             u[index] = (Double_t) GetU(i);
00705             ++index;
00706         }
00707     }
00708     
00709     MsgStream *mftsa = &MSGSTREAM("FitTrackSA", Msg::kVerbose);
00710     (*mftsa) << "Filling UArrays: " << "\n";
00711     MsgFormat ffmt("%7.3f");
00712     // fill spline approximation of the track
00713     for (Count_t i = 0; i<n; ++i) {
00714         (*mftsa) << "z=" << ffmt(zu[i])
00715                  << "; u=" << ffmt(u[i]) << std::endl;
00716     }
00717     return kTRUE;
00718 }

Bool_t DataFT::FillVArrays ( Double_t  zv[],
Double_t  v[],
Int_t  n 
)

Definition at line 724 of file DataFT.cxx.

References GetNPlanes(), GetV(), GetZ(), IsHitV(), Msg::kVerbose, MSGSTREAM, and size.

Referenced by FillLinWithSpline().

00725 {
00726     TracerSA trace("DataFT::FillVArrays(Double_t zv[], Double_t v[],Int_t)");
00727     
00728     Int_t index = 0;
00729     int size = GetNPlanes();
00730     for (int i = 0; i < size; ++i) {
00731         if ( IsHitV(i) ) {
00732             assert( index < n && "Array bound check failed!");
00733             zv[index] = (Double_t) GetZ(i);
00734             v[index] = (Double_t) GetV(i);
00735             ++index;
00736         }
00737     }    
00738     
00739     MsgStream *mftsa = &MSGSTREAM("FitTrackSA", Msg::kVerbose);
00740     (*mftsa) << "Filling VArrays: " << "\n";
00741     MsgFormat ffmt("%7.3f");
00742     // fill spline approximation of the track
00743     for (Count_t i = 0; i<n; ++i) {
00744         (*mftsa) << "z=" << ffmt(zv[i]) << "; v=" << ffmt(v[i]) << std::endl;
00745     }
00746     return kTRUE;
00747 }

void DataFT::FillVectorC ( TMatrixD &  vC  )  const

Definition at line 674 of file DataFT.cxx.

References FillVectorRes().

Referenced by MatrixCalculator::Solve().

00675 {
00676     TracerSA trace("DataFT::FillVectorC");
00677     FillVectorRes(vC, 1., 0.);
00678 }

void DataFT::FillVectorCF ( TMatrixD &  vC  )  const

Definition at line 684 of file DataFT.cxx.

References FillVectorRes().

00685 {
00686     TracerSA trace("DataFT::FillVectorCF");
00687     FillVectorRes(vC, 0., 1.);
00688 }

void DataFT::FillVectorRes ( TMatrixD &  vRes,
PlaneData::Data_t  cdata = 1.,
PlaneData::Data_t  ctrack = -1. 
) const

Definition at line 650 of file DataFT.cxx.

References GetNHitsUsed(), GetNPlanesUsed(), GetU(), GetUf(), GetV(), GetVf(), UHitUse(), and VHitUse().

Referenced by FillVectorC(), FillVectorCF(), and MatrixCalculator::Solve().

00651 {
00652     TracerSA trace("DataFT::FillVectorRes");
00653     vC.ResizeTo(GetNHitsUsed(),1);
00654     Int_t ihits = 0;
00655     for (Int_t i=0; i<GetNPlanesUsed(); ++i) {
00656         if ( UHitUse(i) ) {
00657             vC(ihits,0) = cdata*GetU(i) + ctrack*GetUf(i);
00658             ++ihits;
00659         }
00660     }
00661     for (Int_t i=0; i<GetNPlanesUsed(); ++i) {
00662         if ( VHitUse(i) ) {
00663             vC(ihits,0) = cdata*GetV(i) + ctrack*GetVf(i);
00664             ++ihits;
00665         }
00666     }
00667     return;
00668 }

DataFT::Count_t DataFT::GetBegHit (  )  const

Definition at line 568 of file DataFT.cxx.

References GetNPlanesUsed(), GetPlane(), IsHitU(), IsHitV(), and size.

Referenced by FitContext::FillNtpPlaneInfo().

00569 {
00570     TracerSA trace("DataFT::GetBegHit");
00571     int size = GetNPlanesUsed();
00572     for (int i = 0; i < size; ++i) {
00573         if ( IsHitU(i) || IsHitV(i) ) return GetPlane(i);
00574     }
00575     return 0;
00576 }

DataFT::Count_t DataFT::GetBegHitUsed (  )  const

Definition at line 598 of file DataFT.cxx.

References GetNPlanesUsed(), GetPlane(), size, UHitUse(), and VHitUse().

Referenced by FitContext::FillNtpPlaneInfo().

00599 {
00600     TracerSA trace("DataFT::GetBegHit");
00601     int size = GetNPlanesUsed();
00602     for (int i = 0; i < size; ++i) {
00603         if ( UHitUse(i) || VHitUse(i) ) return GetPlane(i);
00604     }
00605     return 0;
00606 }

PlexPlaneId DataFT::GetBegPlaneId (  )  const [inline]

Definition at line 131 of file DataFT.h.

References fPlanes.

Referenced by Fill(), and FitContext::FillNtpPlaneInfo().

00131 { return fPlanes.begin()->plane; };

PlaneData::Data_t DataFT::GetCos ( Count_t  i  )  const [inline]

Definition at line 189 of file DataFT.h.

References at(), and PlaneData::cos.

Referenced by MatrixCalculator::DiagonalElement(), MatrixCalculator::NonDiagonalElement(), and ThetaMCS().

00189 { return at(i).cos;};

PlaneData::Data_t DataFT::GetDudz ( Count_t  i  )  const [inline]

Definition at line 176 of file DataFT.h.

References at(), and PlaneData::dudz.

Referenced by DumpTrack().

00176 { return at(i).dudz; };

PlaneData::Data_t DataFT::GetDudzlin ( Count_t  i  )  const [inline]

Definition at line 182 of file DataFT.h.

References at(), and PlaneData::dudzlin.

Referenced by TrackEstimatorRange::EstimateTrackParams(), and TrackEstimatorFixed::EstimateTrackParams().

00182 {return at(i).dudzlin;};

PlaneData::Data_t DataFT::GetDvdz ( Count_t  i  )  const [inline]

Definition at line 178 of file DataFT.h.

References at(), and PlaneData::dvdz.

Referenced by DumpTrack().

00178 { return at(i).dvdz; };

PlaneData::Data_t DataFT::GetDvdzlin ( Count_t  i  )  const [inline]

Definition at line 183 of file DataFT.h.

References at(), and PlaneData::dvdzlin.

Referenced by TrackEstimatorRange::EstimateTrackParams(), and TrackEstimatorFixed::EstimateTrackParams().

00183 {return at(i).dvdzlin;};

PlaneData::Data_t DataFT::GetdZSteel ( Count_t  i  )  const [inline]

Definition at line 121 of file DataFT.h.

References at(), and PlaneData::dz.

Referenced by MatrixCalculator::DiagonalElement(), and MatrixCalculator::NonDiagonalElement().

00121 { return at(i).dz;};

Int_t DataFT::GetEMCharge (  )  const

Definition at line 376 of file DataFT.cxx.

References fInitialTrack, ConstFT::kQoverP, and Particle::Sign().

Referenced by SwimAsSwimmer().

00377 {
00378     return (Int_t) TMath::Sign(1., fInitialTrack(kQoverP));
00379 }

DataFT::Count_t DataFT::GetEndHit (  )  const

Definition at line 582 of file DataFT.cxx.

References GetNPlanesUsed(), GetPlane(), IsHitU(), IsHitV(), and size.

Referenced by FitContext::FillNtpPlaneInfo().

00583 {
00584     TracerSA trace("DataFT::GetEndHit");
00585     int size = GetNPlanesUsed();
00586     for (int i = 0; i < size; ++i) {
00587         if ( IsHitU(size-1-i) || IsHitV(size-1-i) ) 
00588             return GetPlane(size-1-i);
00589     }
00590     return 0;
00591 }

DataFT::Count_t DataFT::GetEndHitUsed (  )  const

Definition at line 612 of file DataFT.cxx.

References GetNPlanesUsed(), GetPlane(), size, UHitUse(), and VHitUse().

Referenced by FitContext::FillNtpPlaneInfo().

00613 {
00614     TracerSA trace("DataFT::GetEndHit");
00615     int size = GetNPlanesUsed();
00616     for (int i = 0; i < size; ++i) {
00617         if ( UHitUse(size-1-i) || VHitUse(size-1-i) ) 
00618             return GetPlane(size-1-i);
00619     }
00620     return 0;
00621 }

PlexPlaneId DataFT::GetEndPlaneId (  )  const [inline]

Definition at line 132 of file DataFT.h.

References fPlanes.

Referenced by FitContext::FillNtpPlaneInfo().

00132 { return fPlanes.rbegin()->plane; };

PlaneData::Data_t DataFT::GetInvP ( Count_t  i  )  const [inline]

Definition at line 185 of file DataFT.h.

References at(), and PlaneData::invp.

Referenced by DumpTrack(), GetP(), PrintMomenta(), and ThetaMCS().

00185 { return at(i).invp; };

DataFT::Count_t DataFT::GetNHits (  )  const

Definition at line 481 of file DataFT.cxx.

References GetNPlanes(), IsHitU(), IsHitV(), and size.

00482 {
00483     TracerSA trace("DataFT::GetNHits");
00484     int nhits=0;
00485     int size = GetNPlanes();
00486 
00487     for (int i = 0; i < size; ++i) {
00488         if ( IsHitU(i) ) ++nhits;
00489         if ( IsHitV(i) ) ++nhits;
00490     }
00491     return nhits;
00492 }

DataFT::Count_t DataFT::GetNHitsUsed (  )  const

Definition at line 552 of file DataFT.cxx.

References GetNPlanesUsed(), size, UHitUse(), and VHitUse().

Referenced by FillVectorRes().

00553 {
00554     TracerSA trace("DataFT::GetNHitsUsed");
00555     int nhits=0;
00556     int size = GetNPlanesUsed();
00557     for (int i = 0; i < size; ++i) {
00558         if ( UHitUse(i) ) ++nhits;
00559         if ( VHitUse(i) ) ++nhits;
00560     }
00561     return nhits;
00562 }

Count_t DataFT::GetNPlanes (  )  const [inline]
DataFT::Count_t DataFT::GetNPlanesMin ( Count_t  nhitsperview  )  const

Definition at line 527 of file DataFT.cxx.

References GetNPlanes(), size, UHitUse(), and VHitUse().

00528 {
00529     TracerSA trace("DataFT::GetNPlanesMin");
00530     int nplanesmin=0;
00531     int nuhits=0;
00532     int nvhits=0;
00533 
00534     int size = GetNPlanes();
00535     for (int i = 0; i != size; ++i) {
00536         ++nplanesmin;
00537         if ( UHitUse(i) ) ++nuhits;
00538         if ( VHitUse(i) ) ++nvhits;
00539 
00540         if ( nuhits >= nhitsperview && nvhits >= nhitsperview )
00541                                                         return nplanesmin;
00542     }
00543 
00544     assert(0 && "Not enough planes in view!");
00545     return 0;
00546 }

DataFT::Count_t DataFT::GetNPlanesPCut ( PlaneData::Data_t  pcut  )  const

Definition at line 798 of file DataFT.cxx.

References fNPlanesUsed, fPlanes, and it.

00799 {
00800     TracerSA trace("DataFT::GetNPlanesPCut");
00801     // return number of planes with p>pcut
00802     PlaneData::Data_t invpcut = 1./pcut;
00803     
00804     //CRItr itlastused = fPlanes.rend()-fNPlanesUsed;
00805     for (PlaneDataCRItr it = fPlanes.rend()-fNPlanesUsed; 
00806                                                 it != fPlanes.rend(); ++it) {
00807         if ( fabs(it->invp) < invpcut ) return fPlanes.rend()-it; 
00808     }
00809     
00810     return 0;
00811 }

Count_t DataFT::GetNPlanesUsed (  )  const [inline]
DataFT::Count_t DataFT::GetNUHits (  )  const

Definition at line 449 of file DataFT.cxx.

References GetNPlanes(), IsHitU(), and size.

Referenced by DataFT(), FillLinWithSpline(), and FitContext::FillNtpPlaneInfo().

00450 {
00451     TracerSA trace("DataFT::GetNUHits");
00452     int nhits=0;
00453     int size = GetNPlanes();
00454 
00455     for (int i = 0; i < size; ++i) {
00456         if ( IsHitU(i) ) ++nhits;
00457     }
00458     return nhits;
00459 }

DataFT::Count_t DataFT::GetNUHitsUsed (  )  const

Definition at line 498 of file DataFT.cxx.

References GetNPlanesUsed(), size, and UHitUse().

Referenced by FitContext::FillNtpPlaneInfo(), MatrixCalculator::MakeCovarianceMatrix(), and MatrixCalculator::MakePropagatorMatrix().

00499 {
00500     TracerSA trace("DataFT::GetNUHitsUsed");
00501     int nhits=0;
00502     int size = GetNPlanesUsed();
00503     for (int i = 0; i < size; ++i) {
00504         if ( UHitUse(i) ) ++nhits;
00505     }
00506     return nhits;
00507 }

DataFT::Count_t DataFT::GetNUPlanes (  )  const

Definition at line 413 of file DataFT.cxx.

References fPlanes, it, and PlaneView::kU.

Referenced by FitContext::FillNtpPlaneInfo().

00414 {
00415     TracerSA trace("DataFT::GetNUPlanes");
00416     int nplanes=0;
00417 
00418     PlaneDataCItr beg = fPlanes.begin();
00419     PlaneDataCItr end = fPlanes.end();
00420 
00421     for (PlaneDataCItr it = beg; it != end; ++it) {
00422         if ( it->plane.GetPlaneView() == PlaneView::kU ) ++nplanes;
00423     }
00424     return nplanes;
00425 }

DataFT::Count_t DataFT::GetNVHits (  )  const

Definition at line 465 of file DataFT.cxx.

References GetNPlanes(), IsHitV(), and size.

Referenced by DataFT(), FillLinWithSpline(), and FitContext::FillNtpPlaneInfo().

00466 {
00467     TracerSA trace("DataFT::GetNVHits");
00468     int nhits=0;
00469     int size = GetNPlanes();
00470 
00471     for (int i = 0; i < size; ++i) {
00472         if ( IsHitV(i) ) ++nhits;
00473     }
00474     return nhits;
00475 }

DataFT::Count_t DataFT::GetNVHitsUsed (  )  const

Definition at line 513 of file DataFT.cxx.

References GetNPlanesUsed(), size, and VHitUse().

Referenced by FitContext::FillNtpPlaneInfo(), MatrixCalculator::MakeCovarianceMatrix(), and MatrixCalculator::MakePropagatorMatrix().

00514 {
00515     TracerSA trace("DataFT::GetNVHitsUsed");
00516     int nhits=0;
00517     int size = GetNPlanesUsed();
00518     for (int i = 0; i < size; ++i) {
00519         if ( VHitUse(i) ) ++nhits;
00520     }
00521     return nhits;
00522 }

DataFT::Count_t DataFT::GetNVPlanes (  )  const

Definition at line 431 of file DataFT.cxx.

References fPlanes, it, and PlaneView::kV.

Referenced by FitContext::FillNtpPlaneInfo().

00432 {
00433     TracerSA trace("DataFT::GetNVPlanes");
00434     int nplanes=0;
00435 
00436     PlaneDataCItr beg = fPlanes.begin();
00437     PlaneDataCItr end = fPlanes.end();
00438 
00439     for (PlaneDataCItr it = beg; it != end; ++it) {
00440         if ( it->plane.GetPlaneView() == PlaneView::kV ) ++nplanes;
00441     }
00442     return nplanes;
00443 }

PlaneData::Data_t DataFT::GetP ( Count_t  i  )  const [inline]

Definition at line 186 of file DataFT.h.

References GetInvP().

00186 { return 1./GetInvP(i); };

Count_t DataFT::GetPlane ( Count_t  i  )  const [inline]

Definition at line 134 of file DataFT.h.

References at(), PlexPlaneId::GetPlane(), and PlaneData::plane.

Referenced by DumpTrack(), GetBegHit(), GetBegHitUsed(), GetEndHit(), GetEndHitUsed(), and PrintMomenta().

00134 { return at(i).plane.GetPlane();};

PlexPlaneId DataFT::GetPlaneId ( Count_t  i  )  const [inline]

Definition at line 133 of file DataFT.h.

References at(), and PlaneData::plane.

Referenced by SetHitCoords().

00133 { return at(i).plane;};

PlaneData::Data_t DataFT::GetR ( Count_t  i  )  const [inline]

Definition at line 188 of file DataFT.h.

References at(), and PlaneData::r.

00188 { return at(i).r; };

PlaneData::Data_t DataFT::GetS ( Count_t  i  )  const [inline]

Definition at line 187 of file DataFT.h.

References at(), and PlaneData::s.

00187 { return at(i).s; };

PlaneData::Data_t DataFT::GetSigmaU ( Count_t  i  )  const [inline]

Definition at line 93 of file DataFT.h.

References at(), and PlaneData::eu.

Referenced by MatrixCalculator::MakeCovarianceMatrix().

00093 {return at(i).eu;};

PlaneData::Data_t DataFT::GetSigmaV ( Count_t  i  )  const [inline]

Definition at line 95 of file DataFT.h.

References at(), and PlaneData::ev.

Referenced by MatrixCalculator::MakeCovarianceMatrix().

00095 {return at(i).ev;};

TVectorD DataFT::GetTrack (  )  const [inline]

Definition at line 193 of file DataFT.h.

References fInitialTrack.

Referenced by MatrixCalculator::Solve().

00193 { return fInitialTrack; };

PlaneData::Data_t DataFT::GetU ( Count_t  i  )  const [inline]

Definition at line 92 of file DataFT.h.

References at(), and PlaneData::u.

Referenced by FillUArrays(), and FillVectorRes().

00092 {return at(i).u;};

PlaneData::Data_t DataFT::GetUf ( Count_t  i  )  const [inline]

Definition at line 175 of file DataFT.h.

References at(), and PlaneData::uf.

Referenced by DumpTrack(), FillVectorRes(), GetUMean(), and MatrixCalculator::MakePropagatorMatrix().

00175 { return at(i).uf; };

const ViewMask_t& DataFT::GetUHitUse (  )  const [inline]

Definition at line 111 of file DataFT.h.

References fUHitUse.

Referenced by ConvergenceMaster::BuildMasks().

00111 { return fUHitUse; };

PlaneData::Data_t DataFT::GetUlin ( Count_t  i  )  const [inline]

Definition at line 180 of file DataFT.h.

References at(), and PlaneData::ulin.

Referenced by TrackEstimatorRange::EstimateTrackParams(), and TrackEstimatorFixed::EstimateTrackParams().

00180 {return at(i).ulin;};

PlaneData::Data_t DataFT::GetUMean (  )  const

Definition at line 386 of file DataFT.cxx.

References fNPlanesUsed, and GetUf().

Referenced by FitContext::FillNtpBFieldCalib().

00387 {
00388     if ( fNPlanesUsed > 0 ) {
00389         return (GetUf(0) + GetUf(fNPlanesUsed-1))/2.;
00390     } else {
00391         return GetUf(0);
00392     }
00393 }

PlaneData::Data_t DataFT::GetV ( Count_t  i  )  const [inline]

Definition at line 94 of file DataFT.h.

References at(), and PlaneData::v.

Referenced by FillVArrays(), and FillVectorRes().

00094 {return at(i).v;};

PlaneData::Data_t DataFT::GetVf ( Count_t  i  )  const [inline]

Definition at line 177 of file DataFT.h.

References at(), and PlaneData::vf.

Referenced by DumpTrack(), FillVectorRes(), GetVMean(), and MatrixCalculator::MakePropagatorMatrix().

00177 { return at(i).vf; };

const ViewMask_t& DataFT::GetVHitUse (  )  const [inline]

Definition at line 112 of file DataFT.h.

References fVHitUse.

Referenced by ConvergenceMaster::BuildMasks().

00112 { return fVHitUse; };

PlaneData::Data_t DataFT::GetVlin ( Count_t  i  )  const [inline]

Definition at line 181 of file DataFT.h.

References at(), and PlaneData::vlin.

Referenced by TrackEstimatorRange::EstimateTrackParams(), and TrackEstimatorFixed::EstimateTrackParams().

00181 {return at(i).vlin;};

PlaneData::Data_t DataFT::GetVMean (  )  const

Definition at line 400 of file DataFT.cxx.

References fNPlanesUsed, and GetVf().

Referenced by FitContext::FillNtpBFieldCalib().

00401 {
00402     if ( fNPlanesUsed > 0 ) {
00403         return (GetVf(0) + GetVf(fNPlanesUsed-1))/2.;
00404     } else {
00405         return GetVf(0);
00406     }
00407 }

PlaneData::Data_t DataFT::GetX0 ( Count_t  i  )  const [inline]

Definition at line 122 of file DataFT.h.

References at(), and PlaneData::x0.

Referenced by ThetaMCS().

00122 { return at(i).x0;};

PlaneData::Data_t DataFT::GetZ ( Count_t  i  )  const [inline]
Int_t DataFT::GetZdir (  )  const [inline]

Definition at line 117 of file DataFT.h.

References fDir.

Referenced by SwimAsSwimmer().

00117 { return fDir; };

PlaneData::Data_t DataFT::GetZVtx (  )  const [inline]

Definition at line 119 of file DataFT.h.

References fZVtx.

Referenced by FitContext::FillNtpFitSA().

00119 { return fZVtx; };

Bool_t DataFT::Init ( const TrackContext tc  ) 

Definition at line 140 of file DataFT.cxx.

References fDir, fGeo, fInitialTrack, fNPlanesUsed, fPlanes, fUseGeoSwimmer, fZVtx, TrackContext::GetBegPlane(), VldContext::GetDetector(), GeometryHelper::GetdZSteel(), TrackContext::GetEndPlane(), TrackContext::GetVldContext(), GeometryHelper::GetX0(), GeometryHelper::GetZ(), GeometryHelper::GetZVtx(), GeoSwimmer::Initialize(), GeoSwimmer::Instance(), and it.

Referenced by DataFT().

00141 {
00142     TracerSA trace("DataFT::Init(const TrackContext& )");
00143 
00144     Int_t begin = tc.GetBegPlane();
00145     Int_t end   = tc.GetEndPlane();
00146 
00147     //
00148     fNPlanesUsed = abs(begin - end) + 1;
00149     fDir = end > begin ? 1 : -1;
00150     fInitialTrack.Zero();
00151 
00152     // fill plane information - Z positions, thickness, X0
00153     fPlanes.resize(fNPlanesUsed);
00154     Int_t plane = begin;
00155     VldContext vldc = tc.GetVldContext();
00156 
00157     if(fUseGeoSwimmer) {
00158       GeoSwimmer::Instance()->Initialize(vldc);      
00159     }
00160 
00161     for (PlaneDataItr it = fPlanes.begin(); it != fPlanes.end(); ++it) {
00162         PlexPlaneId planeid = PlexPlaneId(vldc.GetDetector(), plane);
00163         it->plane = planeid;
00164         it->z = fGeo.GetZ(planeid);
00165         it->dz = fGeo.GetdZSteel(planeid);
00166         it->x0 = fGeo.GetX0(planeid);
00167         plane += fDir;
00168     }
00169 
00170     // set vertex z position - either in the middle of 
00171     // the "previous" steel plane or just 0.03m back
00172     // from the begin plane
00173     fZVtx = fGeo.GetZVtx(PlexPlaneId(vldc.GetDetector(), begin), fDir);
00174     
00175     return kTRUE;
00176 }

Bool_t DataFT::IsHitU ( Count_t  i  )  const [inline]

Definition at line 100 of file DataFT.h.

References at(), and PlaneData::uhit.

Referenced by FillUArrays(), GetBegHit(), GetEndHit(), GetNHits(), and GetNUHits().

00100 { return at(i).uhit; };

Bool_t DataFT::IsHitV ( Count_t  i  )  const [inline]

Definition at line 101 of file DataFT.h.

References at(), and PlaneData::vhit.

Referenced by FillVArrays(), GetBegHit(), GetEndHit(), GetNHits(), and GetNVHits().

00101 { return at(i).vhit; };

void DataFT::OneStripPlane ( Count_t  planeIndex,
StripMapItr  it,
const CandTrackHandle cth 
)

set measured coord for a plane with a single strip hit

Definition at line 289 of file DataFT.cxx.

References fGeo, fSetLPos, GeometryHelper::GetRotationCorrectedTPos(), ConstFT::kOneStripError, and SetHitCoords().

Referenced by Fill().

00291 {
00292     TracerSA trace("DataFT::OneStripPlane");
00293     PlaneData::Data_t tpos(0.);
00294     if ( fSetLPos ) {
00295         tpos = fGeo.GetRotationCorrectedTPos(it->second, cth);
00296     } else {
00297         tpos = it->second->GetTPos();
00298     }
00299 
00300     PlaneData::Data_t tposrms = kOneStripError;
00301 
00302     SetHitCoords(planeIndex, tpos, tposrms);
00303 }

void DataFT::PrintData (  )  const

Definition at line 628 of file DataFT.cxx.

References fPlanes, it, Msg::kVerbose, and MSGSTREAM.

Referenced by DataFT().

00629 {
00630     TracerSA trace("DataFT::PrintData");
00631     MsgStream *mftsa = &MSGSTREAM("FitTrackSA", Msg::kVerbose);
00632     (*mftsa) << "Data:\n";
00633     MsgFormat ffmt("%7.3f");
00634     
00635     for (PlaneDataCItr it = fPlanes.begin(); it != fPlanes.end(); ++it) {
00636         (*mftsa) << it->plane 
00637         << ": U=" << ffmt(it->u) << "; EU=" << ffmt(it->eu) 
00638         << "; UL=" << ffmt(it->ulin) << "; dU/dZL=" << ffmt(it->dudzlin) 
00639         << "; V=" << ffmt(it->v) << "; EV=" << ffmt(it->ev) 
00640         << "; VL=" << ffmt(it->vlin) << "; dV/dZL=" << ffmt(it->dvdzlin)
00641         << "; Z=" << ffmt(it->z) << "; X0="   << ffmt(it->x0) << std::endl;
00642     }
00643     return;
00644 }

void DataFT::PrintMomenta (  )  const

Definition at line 993 of file DataFT.cxx.

References GetInvP(), GetNPlanesUsed(), GetPlane(), Msg::kVerbose, and MSGSTREAM.

00994 {
00995     TracerSA trace("DataFT::PrintMomenta");
00996     MsgFormat ffmt("%7.3f");
00997     MsgStream *mftsa = &MSGSTREAM("FitTrackSA", Msg::kVerbose);
00998     (*mftsa) << "Generated track:\n";
00999     for (Int_t i = 0; i<GetNPlanesUsed(); i++) {
01000         (*mftsa) << GetPlane(i) 
01001             << ": p=" << ffmt(1./GetInvP(i)) <<  "\n";
01002     }
01003 
01004 }

void DataFT::Reset (  ) 

Definition at line 100 of file DataFT.cxx.

References fDir, fInitialTrack, fNPlanesUsed, fPlanes, and fZVtx.

00101 {
00102     TracerSA trace("DataFT::Reset()");
00103     fNPlanesUsed = 0;
00104     fDir = 0;
00105     fInitialTrack.Zero();
00106     fZVtx = 0.;
00107     fPlanes.clear();
00108 }

void DataFT::SetCos ( Count_t  i,
PlaneData::Data_t  cos 
) [inline]

Definition at line 202 of file DataFT.h.

References at(), and PlaneData::cos.

00202 { at(i).cos = cos;};

void DataFT::SetDudz ( Count_t  i,
PlaneData::Data_t  dudz 
) [inline]

Definition at line 196 of file DataFT.h.

References at(), and PlaneData::dudz.

00196 { at(i).dudz = dudz; };

void DataFT::SetDudzlin ( Count_t  i,
PlaneData::Data_t  dudzlin 
) [inline]

Definition at line 206 of file DataFT.h.

References at(), and PlaneData::dudzlin.

Referenced by FillLinWithSpline().

00207                                              { at(i).dudzlin = dudzlin; };

void DataFT::SetDvdz ( Count_t  i,
PlaneData::Data_t  dvdz 
) [inline]

Definition at line 198 of file DataFT.h.

References at(), and PlaneData::dvdz.

00198 { at(i).dvdz = dvdz; };

void DataFT::SetDvdzlin ( Count_t  i,
PlaneData::Data_t  dvdzlin 
) [inline]

Definition at line 208 of file DataFT.h.

References at(), and PlaneData::dvdzlin.

Referenced by FillLinWithSpline().

00209                                              { at(i).dvdzlin = dvdzlin; };

void DataFT::SetdZSteel ( Count_t  i,
PlaneData::Data_t  dz 
) [inline]

Definition at line 169 of file DataFT.h.

References at(), and PlaneData::dz.

00169 { at(i).dz = dz; };

void DataFT::SetHitCoords ( Count_t  planeIndex,
PlaneData::Data_t  tpos,
PlaneData::Data_t  error 
)

set measured coordinates

Definition at line 257 of file DataFT.cxx.

References GetPlaneId(), PlaneView::kU, PlaneView::kV, SetSigmaU(), SetSigmaV(), SetU(), SetUHit(), SetUHitUse(), SetV(), SetVHit(), SetVHitUse(), UnsetUHit(), UnsetUHitUse(), UnsetVHit(), and UnsetVHitUse().

Referenced by OneStripPlane(), and TwoStripPlane().

00260 {
00261     TracerSA trace("DataFT::SetHitCoords(Int_t, PlaneData::Data_t, PlaneData::Data_t)");
00262     PlexPlaneId id = GetPlaneId(planeIndex);
00263     if ( id.GetPlaneView() == PlaneView::kU ) {
00264         SetUHit(planeIndex);
00265         SetUHitUse(planeIndex);
00266         SetU(planeIndex, tpos);
00267         SetSigmaU(planeIndex, error);
00268 
00269         UnsetVHit(planeIndex);
00270         UnsetVHitUse(planeIndex);
00271         SetV(planeIndex, 0.0);
00272         SetSigmaV(planeIndex, 0.0);
00273     } else if ( id.GetPlaneView() == PlaneView::kV ) {
00274         SetVHit(planeIndex);
00275         SetVHitUse(planeIndex);
00276         SetV(planeIndex, tpos);
00277         SetSigmaV(planeIndex, error);
00278 
00279         UnsetUHit(planeIndex);
00280         UnsetUHitUse(planeIndex);
00281         SetU(planeIndex, 0.0);
00282         SetSigmaU(planeIndex, 0.0);
00283     }
00284 }

DataFT::Count_t DataFT::SetInitial ( const TVectorD &  inittrack,
Count_t  nplanesuse,
SwimSwimmer swimmer 
)

Definition at line 1021 of file DataFT.cxx.

References fInitialTrack, and SwimAsSwimmer().

01023 {
01024     TracerSA trace("DataFT::SetInitial(const TVectorD&,Int_t,SwimSwimmer&)");
01025     //
01026     fInitialTrack = inittrack;
01027     
01028     return SwimAsSwimmer(nplanesuse, swimmer);
01029 }

void DataFT::SetInitial ( const TVectorD &  inittrack  ) 

Definition at line 1010 of file DataFT.cxx.

References fInitialTrack.

Referenced by FitStateIterating::Iterate(), and FitStateInitial::Iterate().

01011 {
01012     TracerSA trace("DataFT::SetInitial");
01013     //
01014     fInitialTrack = inittrack;
01015     return;
01016 }

void DataFT::SetInvP ( Count_t  i,
PlaneData::Data_t  invp 
) [inline]

Definition at line 199 of file DataFT.h.

References at(), and PlaneData::invp.

00199 { at(i).invp = invp; };

void DataFT::SetNPlanesUsed ( Count_t  n  ) 

Definition at line 364 of file DataFT.cxx.

References fNPlanesUsed, and GetNPlanes().

Referenced by SwimAsSwimmer().

00365 {
00366     TracerSA trace("DataFT::SetNPlanesUsed");
00367     assert( n <= GetNPlanes() && "# of used planes must not be greater "
00368                                 "than the total # of planes!");
00369     fNPlanesUsed = n;
00370 }

void DataFT::SetPlane ( Count_t  i,
PlexPlaneId  plane 
) [inline]

Definition at line 171 of file DataFT.h.

References at(), and PlaneData::plane.

00171 { at(i).plane = plane; };

void DataFT::SetR ( Count_t  i,
PlaneData::Data_t  r 
) [inline]

Definition at line 201 of file DataFT.h.

References at(), and PlaneData::r.

00201 { at(i).r = r; };

void DataFT::SetS ( Count_t  i,
PlaneData::Data_t  s 
) [inline]

Definition at line 200 of file DataFT.h.

References at(), and PlaneData::s.

00200 { at(i).s = s; };

void DataFT::SetSigmaU ( Count_t  i,
PlaneData::Data_t  eu 
) [inline]

Definition at line 145 of file DataFT.h.

References at(), and PlaneData::eu.

Referenced by SetHitCoords().

00145 { at(i).eu = eu; };

void DataFT::SetSigmaV ( Count_t  i,
PlaneData::Data_t  ev 
) [inline]

Definition at line 147 of file DataFT.h.

References at(), and PlaneData::ev.

Referenced by SetHitCoords().

00147 { at(i).ev = ev; };

void DataFT::SetU ( Count_t  i,
PlaneData::Data_t  u 
) [inline]

Definition at line 144 of file DataFT.h.

References at(), and PlaneData::u.

Referenced by SetHitCoords().

00144 { at(i).u = u; };

void DataFT::SetUf ( Count_t  i,
PlaneData::Data_t  uf 
) [inline]

Definition at line 195 of file DataFT.h.

References at(), and PlaneData::uf.

00195 { at(i).uf = uf; };

void DataFT::SetUHit ( Count_t  i  )  [inline]

Definition at line 149 of file DataFT.h.

References at(), and PlaneData::uhit.

Referenced by SetHitCoords().

00149 { at(i).uhit = 1; };

void DataFT::SetUHitUse ( Count_t  i  )  [inline]

Definition at line 162 of file DataFT.h.

References fUHitUse.

00162 { fUHitUse[i] = kTRUE; };

void DataFT::SetUHitUse ( const ViewMask_t usehitu  )  [inline]

Definition at line 114 of file DataFT.h.

References fUHitUse.

Referenced by FitStateInitial::Iterate(), FitStateDiverged::Iterate(), FitStateConverged::Iterate(), and SetHitCoords().

00114 {fUHitUse = usehitu;};

void DataFT::SetUlin ( Count_t  i,
PlaneData::Data_t  ulin 
) [inline]

Definition at line 204 of file DataFT.h.

References at(), and PlaneData::ulin.

Referenced by FillLinWithSpline().

00204 { at(i).ulin = ulin; };

void DataFT::SetV ( Count_t  i,
PlaneData::Data_t  v 
) [inline]

Definition at line 146 of file DataFT.h.

References at(), and PlaneData::v.

Referenced by SetHitCoords().

00146 { at(i).v = v; };

void DataFT::SetVf ( Count_t  i,
PlaneData::Data_t  vf 
) [inline]

Definition at line 197 of file DataFT.h.

References at(), and PlaneData::vf.

00197 { at(i).vf = vf; };

void DataFT::SetVHit ( Count_t  i  )  [inline]

Definition at line 150 of file DataFT.h.

References at(), and PlaneData::vhit.

Referenced by SetHitCoords().

00150 { at(i).vhit = 1; };

void DataFT::SetVHitUse ( Count_t  i  )  [inline]

Definition at line 163 of file DataFT.h.

References fVHitUse.

00163 { fVHitUse[i] = kTRUE; };

void DataFT::SetVHitUse ( const ViewMask_t usehitv  )  [inline]

Definition at line 115 of file DataFT.h.

References fVHitUse.

Referenced by FitStateInitial::Iterate(), FitStateDiverged::Iterate(), FitStateConverged::Iterate(), and SetHitCoords().

00115 {fVHitUse = usehitv;};

void DataFT::SetVlin ( Count_t  i,
PlaneData::Data_t  vlin 
) [inline]

Definition at line 205 of file DataFT.h.

References at(), and PlaneData::vlin.

Referenced by FillLinWithSpline().

00205 { at(i).vlin = vlin; };

void DataFT::SetX0 ( Count_t  i,
PlaneData::Data_t  x0 
) [inline]

Definition at line 170 of file DataFT.h.

References at(), and PlaneData::x0.

00170 { at(i).x0 = x0; };

void DataFT::SetZ ( Count_t  i,
PlaneData::Data_t  z 
) [inline]

Definition at line 168 of file DataFT.h.

References at(), and PlaneData::z.

00168 { at(i).z = z; };

DataFT::Count_t DataFT::SwimAsSwimmer ( Count_t  nplanes,
SwimSwimmer swimmer 
)

Definition at line 817 of file DataFT.cxx.

References DumpTrack(), fGeo, fInitialTrack, fPlanes, fUseGeoSwimmer, fZVtx, SwimParticle::GetCharge(), SwimParticle::GetDirection(), GetEMCharge(), SwimParticle::GetMomentumModulus(), GetNPlanes(), SwimParticle::GetPosition(), SwimParticle::GetRange(), SwimParticle::GetS(), GetZdir(), GeoSwimmer::Instance(), it, Msg::kDebug, ConstFT::kdUdZ, ConstFT::kdVdZ, ConstFT::kQoverP, kU, kV, Msg::kVerbose, Msg::kWarning, MSG, MSGSTREAM, SwimParticle::SetCharge(), SetNPlanesUsed(), SwimSwimmer::SwimForward(), GeoSwimmer::SwimForward(), ConstFT::TinyNumber, GeometryHelper::uv2xy(), and GeometryHelper::xy2uv().

00818 {
00819     TracerSA trace("DataFT::SwimAsSwimmer");
00820     
00821     MSG("FitTrackSA",Msg::kVerbose) << "Request to swim " 
00822                                     << nplanesuse << " planes.\n"; 
00823 
00824     // Swim track starting from the first plane, initial values 
00825     // from fInitialTrack. Swim through nplanesuse planes.
00826     
00827     // Check if number of planes to swim is reasonable
00828     if ( nplanesuse<1 ) {
00829         MSG("FitTrackSA",Msg::kWarning) 
00830             << "Request to swim less than one plane. Doing Nothing\n";
00831         return 0;
00832     } else if ( nplanesuse > GetNPlanes() ) {
00833         MSG("FitTrackSA",Msg::kWarning) 
00834         << "Request to swim more planes than we have.\n";
00835         nplanesuse = GetNPlanes();
00836     }
00837 
00838     // Initialize the swim particle from initial values of parameters
00839     
00840     // need these to get return values from xy2uv, uv2xy functions
00841     double x=0.;
00842     double y=0.;
00843     double u=0.;
00844     double v=0.;
00845     
00846     // convert track position (u, v) -> (x, y)
00847     fGeo.uv2xy(fInitialTrack(kU), fInitialTrack(kV), x, y);
00848     TVector3 position(x, y, fZVtx);
00849     
00850     // convert track direction
00851     PlaneData::Data_t pz, invpz;
00852     invpz = sqrt(1. + pow(fInitialTrack(kdUdZ),2) +
00853                       pow(fInitialTrack(kdVdZ),2)) * 
00854             TMath::Abs(fInitialTrack(kQoverP));
00855             
00856     if ( invpz < TinyNumber ) {
00857         MSG("FitTrackSA",Msg::kDebug) 
00858             << "1./Pz=" <<invpz<<" too small => replace with TinyNumber\n" ;
00859         invpz = TinyNumber;
00860     }
00861     
00862     pz = GetZdir()/invpz;
00863     fGeo.uv2xy(fInitialTrack(kdUdZ), fInitialTrack(kdVdZ), x, y);
00864     TVector3 momentum(pz*x, pz*y, pz);
00865 
00866     // create the swim particle
00867     SwimParticle muon(position,momentum);
00868     muon.SetCharge(GetEMCharge());
00869 
00870     int nplanesused = 0; // reset to 0
00871     MsgStream *mftsa = &MSGSTREAM("FitTrackSA", Msg::kVerbose);
00872     (*mftsa) << "Swimming track:\n";
00873     MsgFormat ffmt("%7.3f");
00874     // Loop over planes
00875     for (PlaneDataItr it = fPlanes.begin(); 
00876                                         it != fPlanes.begin()+nplanesuse; ++it) {
00877         // Swim condition -> to the current plane
00878         SwimZCondition zc(it->z);
00879 
00880         Bool_t status; // Swimmer status
00881 
00882         if(fUseGeoSwimmer) {
00883           status = GeoSwimmer::Instance()->SwimForward(muon,it->z);
00884         } else {
00885           status = swimmer.SwimForward(muon,zc);
00886         }
00887 
00888         if ( status ) {
00889  
00890             fGeo.xy2uv(muon.GetPosition().X(), muon.GetPosition().Y(), u, v);
00891             it->uf = u;
00892             it->vf = v;
00893             
00894             fGeo.xy2uv(muon.GetDirection().X(), muon.GetDirection().Y(), u, v);
00895             it->dudz = u/muon.GetDirection().Z();
00896             it->dvdz = v/muon.GetDirection().Z();
00897             
00898             it->invp = muon.GetCharge()/muon.GetMomentumModulus();
00899             it->cos = pow(1.+pow(it->dudz,2)+pow(it->dvdz,2), -0.5);
00900             
00901             it->s = muon.GetS();
00902             it->r = muon.GetRange();
00903             
00904                 
00905             ++nplanesused;
00906             
00907             // swim succeded -> fill track parameters for the next plane
00908             (*mftsa) 
00909                 << it->plane << ": z = " << ffmt(it->z) 
00910                 << "; u = " << ffmt(it->uf) << "; v = " << ffmt(it->vf) 
00911                 << "; dudz = " << ffmt(it->dudz)<<"; dvdz = " << ffmt(it->dvdz)
00912                 << "; invp = " << ffmt(it->invp)<<"; cos = " << ffmt(it->cos)
00913                 << "; s = " << ffmt(it->s) << "; r = " << ffmt(it->r) << "\n";
00914         } else {
00915             // swim failed -> print info and break out of the loop
00916             MSG("FitTrackSA",Msg::kDebug) 
00917                 << "Swim failed at " << it->plane 
00918                 << ", z = " << it->z << "\n";
00919             DumpTrack();
00920             // SetNPlanesUsed(it - fPlanes.begin());
00921             SetNPlanesUsed(nplanesused);
00922             return nplanesused;
00923         }
00924     }
00925     
00926     SetNPlanesUsed(nplanesused);
00927     return nplanesused;
00928 }

DataFT::Count_t DataFT::SwimAsSwimmer ( SwimSwimmer swimmer  ) 

Definition at line 934 of file DataFT.cxx.

References GetNPlanes().

Referenced by SetInitial().

00935 {
00936     return SwimAsSwimmer(GetNPlanes(), swimmer);
00937 }

PlaneData::Data_t DataFT::T ( Count_t  i,
Count_t  n 
) const

Definition at line 956 of file DataFT.cxx.

References GetZ().

Referenced by MatrixCalculator::DiagonalElement(), and MatrixCalculator::NonDiagonalElement().

00957 {
00958     // Calculate T(i,n) - for the covarince matrix
00959     //   return ( (n-i)*dz + d )/fCos(i);
00960     return  TMath::Abs(GetZ(n)-GetZ(i)) ;
00961 }

PlaneData::Data_t DataFT::ThetaMCS ( Count_t  i  )  const

Definition at line 944 of file DataFT.cxx.

References GetCos(), GetInvP(), GetX0(), ConstFT::Theta0_P1, and ConstFT::Theta0_P2.

Referenced by MatrixCalculator::MakeCovarianceMatrix().

00945 {
00946     // Calculate MCS angle in the i-th plane
00947     return Theta0_P1*sqrt(GetX0(i)/GetCos(i))*
00948             (1.+Theta0_P2*log(GetX0(i)/GetCos(i)))*GetInvP(i);
00949 }

void DataFT::TwoStripPlane ( Count_t  planeIndex,
StripMapItr  lower,
StripMapItr  upper,
const CandTrackHandle cth 
)

set measured coord for a plane with two strips hit

Definition at line 309 of file DataFT.cxx.

References fGeo, fSetLPos, GeometryHelper::GetRotationCorrectedTPos(), it, ConstFT::kOneStripError, and SetHitCoords().

Referenced by Fill().

00312 {
00313     TracerSA trace("DataFT::TwoStripPlane");
00314 
00315   // running sums
00316   PlaneData::Data_t chargesum(0.);
00317   PlaneData::Data_t tpossum(0.);
00318   PlaneData::Data_t tposrmssum(0.);
00319   Int_t nstrip(0);
00320 
00321   // loop over strips
00322   for (StripMapItr it = lower; it != upper; ++it) {
00323     // cache strip charge, tpos
00324     PlaneData::Data_t charge = it->second->GetCharge();
00325     // make sure strips with negative charge have been
00326     // cleaned
00327     assert( charge > 0. && "Strip charge < 0.!!!!");
00328 
00329     PlaneData::Data_t tpos(0.);
00330     if ( fSetLPos ) {
00331         tpos = fGeo.GetRotationCorrectedTPos(it->second, cth);
00332     } else {
00333         tpos = it->second->GetTPos();
00334     }
00335 
00336     // increment running sums
00337     chargesum  += charge;
00338     tpossum    += tpos;
00339     tposrmssum += tpos*tpos;
00340     ++nstrip;
00341   }
00342 
00343   // calculate charge weighted position, rms
00344   // of the hit
00345   PlaneData::Data_t tpos = tpossum/nstrip;
00346 
00347   // initialize rms to that of a songle strip measurement
00348   PlaneData::Data_t tposrms = kOneStripError;
00349 
00350   PlaneData::Data_t tposrms2 = tposrmssum/nstrip - tpos*tpos;
00351   // ignore zero values, they only happen if the same strip is used twice
00352   // (this happens in cedar mc)
00353   if (tposrms2 > 0.) {
00354     tposrms = sqrt(tposrms2);
00355   }
00356 
00357   SetHitCoords(planeIndex, tpos, tposrms);
00358 }

Bool_t DataFT::UHitUse ( Count_t  i  )  const [inline]
void DataFT::UnsetUHit ( Count_t  i  )  [inline]

Definition at line 151 of file DataFT.h.

References at(), and PlaneData::uhit.

Referenced by SetHitCoords().

00151 { at(i).uhit = 0; };

void DataFT::UnsetUHitUse ( Count_t  i  )  [inline]

Definition at line 164 of file DataFT.h.

References fUHitUse.

Referenced by SetHitCoords().

00164 { fUHitUse[i] = kFALSE; };

void DataFT::UnsetVHit ( Count_t  i  )  [inline]

Definition at line 152 of file DataFT.h.

References at(), and PlaneData::vhit.

Referenced by SetHitCoords().

00152 { at(i).vhit = 0; };

void DataFT::UnsetVHitUse ( Count_t  i  )  [inline]

Definition at line 165 of file DataFT.h.

References fVHitUse.

Referenced by SetHitCoords().

00165 { fVHitUse[i] = kFALSE; };

Bool_t DataFT::VHitUse ( Count_t  i  )  const [inline]

Member Data Documentation

Short_t DataFT::fDir [private]

direction along Z axis possible values 1, -1

Definition at line 296 of file DataFT.h.

Referenced by Fill(), GetZdir(), Init(), and Reset().

GeometryHelper

Definition at line 326 of file DataFT.h.

Referenced by Init(), OneStripPlane(), SwimAsSwimmer(), and TwoStripPlane().

TVectorD DataFT::fInitialTrack [private]

0 - u0, 1 - dudz0, 2 - v0, 3 - dvdz0, 4 - 1/p0

Definition at line 301 of file DataFT.h.

Referenced by GetEMCharge(), GetTrack(), Init(), Reset(), SetInitial(), and SwimAsSwimmer().

minimum strip charge

Definition at line 333 of file DataFT.h.

Referenced by Config(), and Fill().

Int_t DataFT::fNHitsInViewMin [private]

min # of hit planes per view

Definition at line 344 of file DataFT.h.

Referenced by Config(), and DataFT().

Short_t DataFT::fNPlanesUsed [private]

number of planes used in the fit, starting from fBegPlane

Definition at line 291 of file DataFT.h.

Referenced by GetNPlanesPCut(), GetNPlanesUsed(), GetUMean(), GetVMean(), Init(), Reset(), and SetNPlanesUsed().

Bool_t DataFT::fSetLPos [private]

calculate tpos of a hit accounting for its longitudinal position along the strip if this flag set (otherwise - just stip->GetTPos())

Definition at line 339 of file DataFT.h.

Referenced by Config(), OneStripPlane(), and TwoStripPlane().

"mask" vector of what U hits should be used in the fit

Definition at line 316 of file DataFT.h.

Referenced by GetUHitUse(), SetUHitUse(), UHitUse(), and UnsetUHitUse().

bool DataFT::fUseGeoSwimmer [private]

Definition at line 346 of file DataFT.h.

Referenced by Config(), Init(), and SwimAsSwimmer().

"mask" vector of what U hits should be used in the fit

Definition at line 321 of file DataFT.h.

Referenced by GetVHitUse(), SetVHitUse(), UnsetVHitUse(), and VHitUse().

z position of the vertex (middle of a steel plane)

Definition at line 306 of file DataFT.h.

Referenced by GetZVtx(), Init(), Reset(), and SwimAsSwimmer().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1