Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ConvergenceMaster::MaskStep Class Reference

List of all members.

Public Member Functions

 MaskStep (const ViewMask_t &umask, const ViewMask_t &vmask, Int_t nhitsinviewmin)
 ~MaskStep ()
Bool_t IncrementPlaneCount ()
Bool_t DecrementPlaneCount ()
Count_t GetPlaneCountCur () const
void SetPlaneCountCur (Count_t n)
void SetPlaneCountLast (Count_t n)
Count_t GetPlaneCountMax () const
Count_t GetPlaneCountMin () const
Count_t GetPlaneCountLast () const
Bool_t GetConvergedCur () const
Count_t GetNPlanesToFit () const
void SetConverged ()
void SetDiverged ()
Count_t FindPlaneCountMin (const ViewMask_t &mask, Count_t nhitsmin)
Count_t FindPlaneCountMax (const ViewMask_t &mask)
const ViewMask_tGetMaskU () const
const ViewMask_tGetMaskV () const
void Print () const
void PrintMasks () const

Private Attributes

ViewMask_t fMaskU
ViewMask_t fMaskV
ViewMask_t fMaskUVSum
Count_t fPlaneCountMin
Count_t fPlaneCountMax
Count_t fPlaneCountCur
Bool_t fConvergedCur
Count_t fPlaneCountLast

Detailed Description

nested class MaskStep - holds U and V masks for one "level", minimum allowed plane count, maximum plane count, current plane count, last plane count

Definition at line 49 of file ConvergenceMaster.h.


Constructor & Destructor Documentation

ConvergenceMaster::MaskStep::MaskStep const ViewMask_t umask,
const ViewMask_t vmask,
Int_t  nhitsinviewmin
 

ConvergenceMaster::MaskStep ctor

Definition at line 374 of file ConvergenceMaster.cxx.

References fConvergedCur, FindPlaneCountMax(), FindPlaneCountMin(), fMaskU, fMaskUVSum, fMaskV, fPlaneCountCur, fPlaneCountLast, fPlaneCountMax, fPlaneCountMin, and max.

00376                                                                    :
00377     fMaskU(umask), fMaskV(vmask)
00378 {
00379     TracerSA trace("ConvergenceMaster::MaskStep::MaskStep(...,Int_t)");
00380     // make sum of U and V masks
00381     fMaskUVSum.resize(fMaskU.size());
00382     for (UInt_t i = 0; i < fMaskUVSum.size(); ++i) {
00383         fMaskUVSum[i] = fMaskU[i] + fMaskV[i];
00384     }
00385     
00386     Count_t uMin = FindPlaneCountMin(umask, nhitsinviewmin);
00387     Count_t vMin = FindPlaneCountMin(vmask, nhitsinviewmin);    
00388     fPlaneCountMin = max(uMin, vMin);
00389     
00390     Count_t uMax = FindPlaneCountMax(umask);
00391     Count_t vMax = FindPlaneCountMax(vmask);
00392     fPlaneCountMax = max(uMax, vMax);
00393     
00394     fPlaneCountCur  = fPlaneCountMax;
00395     fConvergedCur   = kTRUE;
00396     fPlaneCountLast = fPlaneCountCur;
00397 }

ConvergenceMaster::MaskStep::~MaskStep  ) 
 

ConvergenceMaster::MaskStep dtor

Definition at line 403 of file ConvergenceMaster.cxx.

00404 {}


Member Function Documentation

Bool_t ConvergenceMaster::MaskStep::DecrementPlaneCount  ) 
 

decrease length of the track segment to fit

Definition at line 523 of file ConvergenceMaster.cxx.

References find(), fMaskUVSum, fPlaneCountCur, fPlaneCountLast, fPlaneCountMin, and Print().

00524 {
00525     TracerSA trace("ConvergenceMaster::MaskStep::DecrementPlaneCount()");
00526     assert( fPlaneCountCur > fPlaneCountMin && 
00527             "Can't decrement plane count, already at min!" );
00528     
00529     Print();
00530         
00531     ViewMaskCRItr beg = fMaskUVSum.rbegin();
00532     ViewMaskCRItr end = fMaskUVSum.rend();
00533     
00534     ViewMaskCRItr it = end - fPlaneCountCur + 1;
00535     
00536     it = find(it, end, 1);
00537     
00538     fPlaneCountLast = fPlaneCountCur;
00539     fPlaneCountCur = end - it;
00540     
00541     Print();
00542         
00543     return kTRUE;
00544 }

ConvergenceMaster::Count_t ConvergenceMaster::MaskStep::FindPlaneCountMax const ViewMask_t mask  ) 
 

calculate maximum (for this mask level) track segment length

Definition at line 432 of file ConvergenceMaster.cxx.

References find().

Referenced by MaskStep().

00433 {
00434     TracerSA trace("ConvergenceMaster::MaskStep::FindPlaneCountMax(ViewMask_t&)");
00435     ViewMaskCRItr beg = mask.rbegin();
00436     ViewMaskCRItr end = mask.rend();
00437     
00438     ViewMaskCRItr it  = find(beg, end, 1);
00439     Count_t size = mask.size();    
00440     
00441     return (size - (it - beg));
00442 }

ConvergenceMaster::Count_t ConvergenceMaster::MaskStep::FindPlaneCountMin const ViewMask_t mask,
Count_t  nhitsmin
 

calculate minimum (for this mask level) track segment length

Definition at line 411 of file ConvergenceMaster.cxx.

References find().

Referenced by MaskStep().

00413 {
00414     TracerSA trace("ConvergenceMaster::MaskStep::FindPlaneCountMin(ViewMask_t&, Count_t)");
00415     ViewMaskCItr beg = mask.begin();
00416     ViewMaskCItr end = mask.end();
00417     ViewMaskCItr it = beg;
00418     
00419     for ( Count_t i = 0; i < nhitsmin; ++i) {
00420         it = find(it, end, 1);
00421         ++it;
00422     }
00423     
00424     return it - beg;
00425 }

Bool_t ConvergenceMaster::MaskStep::GetConvergedCur  )  const [inline]
 

Definition at line 67 of file ConvergenceMaster.h.

00067 { return fConvergedCur; };

const ViewMask_t& ConvergenceMaster::MaskStep::GetMaskU  )  const [inline]
 

Definition at line 78 of file ConvergenceMaster.h.

00078 { return fMaskU; } ;

const ViewMask_t& ConvergenceMaster::MaskStep::GetMaskV  )  const [inline]
 

Definition at line 79 of file ConvergenceMaster.h.

00079 { return fMaskV; };

Count_t ConvergenceMaster::MaskStep::GetNPlanesToFit  )  const [inline]
 

Definition at line 69 of file ConvergenceMaster.h.

00069 { return GetPlaneCountCur(); };        

Count_t ConvergenceMaster::MaskStep::GetPlaneCountCur  )  const [inline]
 

Definition at line 60 of file ConvergenceMaster.h.

00060 { return fPlaneCountCur; };

Count_t ConvergenceMaster::MaskStep::GetPlaneCountLast  )  const [inline]
 

Definition at line 66 of file ConvergenceMaster.h.

00066 { return fPlaneCountLast; };

Count_t ConvergenceMaster::MaskStep::GetPlaneCountMax  )  const [inline]
 

Definition at line 64 of file ConvergenceMaster.h.

00064 { return fPlaneCountMax; };

Count_t ConvergenceMaster::MaskStep::GetPlaneCountMin  )  const [inline]
 

Definition at line 65 of file ConvergenceMaster.h.

00065 { return fPlaneCountMin; };

Bool_t ConvergenceMaster::MaskStep::IncrementPlaneCount  ) 
 

increase length of the track segment to fit

Definition at line 495 of file ConvergenceMaster.cxx.

References find(), fMaskUVSum, fPlaneCountCur, fPlaneCountLast, fPlaneCountMax, and Print().

00496 {
00497     TracerSA trace("ConvergenceMaster::MaskStep::IncrementPlaneCount()");
00498     assert( fPlaneCountCur < fPlaneCountMax && 
00499             "Can't increment plane count, already at max!" );
00500 
00501     Print();
00502         
00503     ViewMaskCItr beg = fMaskUVSum.begin();
00504     ViewMaskCItr end = fMaskUVSum.end();
00505     
00506     ViewMaskCItr it = beg + fPlaneCountCur;
00507     
00508     it = find(it, end, 1);
00509     ++it;
00510     
00511     fPlaneCountLast = fPlaneCountCur;
00512     fPlaneCountCur = it - beg;
00513     
00514     Print();
00515         
00516     return kTRUE;
00517 }

void ConvergenceMaster::MaskStep::Print  )  const
 

print MaskStep (excluding mask vectors)

Definition at line 448 of file ConvergenceMaster.cxx.

References fConvergedCur, fPlaneCountCur, fPlaneCountLast, fPlaneCountMax, fPlaneCountMin, and MSGSTREAM.

Referenced by DecrementPlaneCount(), and IncrementPlaneCount().

00449 {
00450     TracerSA trace("ConvergenceMaster::MaskStep::Print()");
00451 
00452     MsgStream *mftsa = &MSGSTREAM("FitTrackSA", Msg::kDebug);
00453     (*mftsa) << "min = " << fPlaneCountMin 
00454              << "; max = " << fPlaneCountMax 
00455              << "; cur = " << fPlaneCountCur 
00456              << "; last = " << fPlaneCountLast 
00457              << "; conv = " << fConvergedCur << "\n";
00458 }

void ConvergenceMaster::MaskStep::PrintMasks  )  const
 

print MaskStep mask vectors

Definition at line 464 of file ConvergenceMaster.cxx.

References fMaskU, fMaskV, fPlaneCountMax, fPlaneCountMin, and MSGSTREAM.

00465 {
00466     TracerSA trace("ConvergenceMaster::MaskStep::PrintMask()");
00467 
00468     MsgStream *mftsa = &MSGSTREAM("FitTrackSA", Msg::kDebug);
00469     (*mftsa) << "min = " << fPlaneCountMin 
00470              << "; max = " << fPlaneCountMax << "\n";
00471 
00472     (*mftsa) << "U: ";
00473     ViewMaskCItr beg = fMaskU.begin();
00474     ViewMaskCItr end = fMaskU.end();      
00475     for (ViewMaskCItr it = beg; it!=end; ++it) {
00476         (*mftsa) << *it << " ";
00477     }
00478     (*mftsa) << "\n";       
00479     
00480     (*mftsa) << "V: ";
00481     beg = fMaskV.begin();
00482     end = fMaskV.end();      
00483     for (ViewMaskCItr it = beg; it!=end; ++it) {
00484         (*mftsa) << *it << " ";
00485     }
00486     (*mftsa) << "\n";       
00487     
00488     return;
00489 }

void ConvergenceMaster::MaskStep::SetConverged  )  [inline]
 

Definition at line 71 of file ConvergenceMaster.h.

00071 { fConvergedCur = kTRUE; };

void ConvergenceMaster::MaskStep::SetDiverged  )  [inline]
 

Definition at line 72 of file ConvergenceMaster.h.

00072 { fConvergedCur = kFALSE; };

void ConvergenceMaster::MaskStep::SetPlaneCountCur Count_t  n  )  [inline]
 

Definition at line 61 of file ConvergenceMaster.h.

00061 { fPlaneCountCur = n; };

void ConvergenceMaster::MaskStep::SetPlaneCountLast Count_t  n  )  [inline]
 

Definition at line 62 of file ConvergenceMaster.h.

00062 { fPlaneCountLast = n; };


Member Data Documentation

Bool_t ConvergenceMaster::MaskStep::fConvergedCur [private]
 

Definition at line 94 of file ConvergenceMaster.h.

Referenced by MaskStep(), and Print().

ViewMask_t ConvergenceMaster::MaskStep::fMaskU [private]
 

Definition at line 85 of file ConvergenceMaster.h.

Referenced by MaskStep(), and PrintMasks().

ViewMask_t ConvergenceMaster::MaskStep::fMaskUVSum [private]
 

Definition at line 88 of file ConvergenceMaster.h.

Referenced by DecrementPlaneCount(), IncrementPlaneCount(), and MaskStep().

ViewMask_t ConvergenceMaster::MaskStep::fMaskV [private]
 

Definition at line 86 of file ConvergenceMaster.h.

Referenced by MaskStep(), and PrintMasks().

Count_t ConvergenceMaster::MaskStep::fPlaneCountCur [private]
 

Definition at line 93 of file ConvergenceMaster.h.

Referenced by DecrementPlaneCount(), IncrementPlaneCount(), MaskStep(), and Print().

Count_t ConvergenceMaster::MaskStep::fPlaneCountLast [private]
 

Definition at line 96 of file ConvergenceMaster.h.

Referenced by DecrementPlaneCount(), IncrementPlaneCount(), MaskStep(), and Print().

Count_t ConvergenceMaster::MaskStep::fPlaneCountMax [private]
 

Definition at line 91 of file ConvergenceMaster.h.

Referenced by IncrementPlaneCount(), MaskStep(), Print(), and PrintMasks().

Count_t ConvergenceMaster::MaskStep::fPlaneCountMin [private]
 

Definition at line 90 of file ConvergenceMaster.h.

Referenced by DecrementPlaneCount(), MaskStep(), Print(), and PrintMasks().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:01 2010 for loon by  doxygen 1.3.9.1