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

CandFitTrackMS.cxx

Go to the documentation of this file.
00001 
00002 // $Id: CandFitTrackMS.cxx,v 1.3 2002/08/08 20:51:00 bringley Exp $
00003 //
00004 // This is a concrete Event Candidate (Reconstruction) object.
00005 // CandFitTrackMS is descended from CandFitTrack.
00006 //
00007 // Each concrete CandBase must define a Dup function.
00008 // CandBase must grant friendship to class CandRefer.
00009 //
00010 // Tom Bringley
00011 // ttb2@duke.edu
00012 // 6/13/2001
00014 
00015 #include "Algorithm/AlgHandle.h"
00016 #include "Algorithm/AlgConfig.h"
00017 #include "CandFitTrackMS/CandFitTrackMS.h"
00018 #include "CandFitTrackMS/CandFitTrackMSHandle.h"
00019 #include "MessageService/MsgService.h"
00020 
00021 ClassImp(CandFitTrackMS)
00022 
00023 //______________________________________________________________________
00024 CVSID("$Id: CandFitTrackMS.cxx,v 1.3 2002/08/08 20:51:00 bringley Exp $");
00025 
00026 //______________________________________________________________________
00027 CandFitTrackMS::CandFitTrackMS()
00028 {
00029   MSG("Cand", Msg::kDebug)
00030                         << "Begin CandFitTrackMS::CandFitTrackMS() ctor: " << endl
00031                                            << "UidInt = " << GetUidInt()
00032                            << ", ArchUidInt " << GetArchUidInt() << endl
00033                              << "No. of links = " << GetNLinks() << endl
00034                           << "End CandFitTrackMS::CandFitTrackMS() ctor." << endl;
00035   Init();
00036 }
00037 
00038 //______________________________________________________________________
00039 CandFitTrackMS::CandFitTrackMS(AlgHandle &ah) :
00040   CandFitTrack(ah)      // Should be the next class up on inheritance chain
00041 {
00042 
00043 // The sole purpose of this constructor is to transmit the AlgHandle
00044 // up the inheritance chain to CandBase without having to invoke the
00045 // full constructor of an intermediate Candidate type which the highest
00046 // level Candidate might inherit from.  One only wants to create the
00047 // LocalHandle and invoke the RunAlg() method in the lowest level class.
00048 
00049   Init();
00050 
00051 }
00052 
00053 //______________________________________________________________________
00054 CandFitTrackMS::CandFitTrackMS(AlgHandle &ah, CandHandle &ch, CandContext &cx) :
00055   CandFitTrack(ah)      // Should be the next class up on inheritance chain
00056 {
00057   CreateLocalHandle();
00058   MSG("Cand", Msg::kDebug)
00059              << "Begin CandFitTrackMS::CandFitTrackMS(AlgHandle &, CandHandle &, "
00060                                       << "CandContext &) ctor: " << endl
00061                                            << "UidInt = " << GetUidInt()
00062                            << ", ArchUidInt " << GetArchUidInt() << endl
00063                              << "No. of links = " << GetNLinks() << endl
00064                << "End CandFitTrackMS::CandFitTrackMS(AlgHandle &, CandHandle &, "
00065                                       << "CandContext &) ctor." << endl;
00066 
00067   Init();
00068 
00069   {                                         // Start of scope.
00070     CandFitTrackMSHandle csh(this);              // csh will go out of scope
00071     ch = csh;                               // after setting ch.
00072   }
00073   ah.RunAlg(ch, cx);
00074 }
00075 
00076 //______________________________________________________________________
00077 CandFitTrackMS::CandFitTrackMS(const CandFitTrackMS &rhs) :
00078   CandFitTrack(rhs)     // Should be the next class up on inheritance chain
00079 {
00080   Init();
00081   MSG("Cand", Msg::kDebug)
00082     << "Begin CandFitTrackMS::CandFitTrackMS(const CandFitTrackMS &rhs) ctor: " << endl
00083                                            << "UidInt = " << GetUidInt()
00084                            << ", ArchUidInt " << GetArchUidInt() << endl
00085                              << "No. of links = " << GetNLinks() << endl
00086       << "End CandFitTrackMS::CandFitTrackMS(const CandFitTrackMS &rhs) ctor." << endl;
00087 }
00088 
00089 //______________________________________________________________________
00090 CandFitTrackMS::~CandFitTrackMS()
00091 {
00092   MSG("Cand", Msg::kDebug)
00093                        << "Begin CandFitTrackMS::~CandFitTrackMS() dtor: " << endl
00094                                            << "UidInt = " << GetUidInt()
00095                            << ", ArchUidInt " << GetArchUidInt() << endl
00096                              << "No. of links = " << GetNLinks() << endl
00097                          << "End CandFitTrackMS::~CandFitTrackMS() dtor." << endl;
00098 
00099 }
00100 
00101 //______________________________________________________________________
00102 void CandFitTrackMS::CreateLocalHandle()
00103 {
00104   SetLocalHandle(new CandFitTrackMSHandle(this));
00105 }
00106 
00107 //______________________________________________________________________
00108 CandFitTrackMS *CandFitTrackMS::Dup() const
00109 {
00110 
00111 // Base copy ctor dups owned pointers, but defers copying Daughter List.
00112 // Daughter List copy is made in the derived class Dup() function.
00113 // This is because base class copy constructor hasn't yet created
00114 // fLocalHandle with a CandHandle* of the full derived type.
00115   CandFitTrackMS *cb = new CandFitTrackMS(*this);       // Copy-ctor dups ptrs
00116   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00117   TIter iterdau = GetDaughterIterator();
00118   CandHandle *dau;
00119   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00120   return cb;
00121 }
00122 
00123 //______________________________________________________________________
00124 CandFitTrackMSHandle CandFitTrackMS::MakeCandidate(AlgHandle &ah, CandContext &cx)
00125 {
00126   CandFitTrackMSHandle csh;
00127   new CandFitTrackMS(ah, csh, cx);          // csh owns the new CandFitTrackMS
00128   return csh;
00129 }
00130 
00131 //______________________________________________________________________
00132 void CandFitTrackMS::Init()
00133 {
00134   fMomentumL = 0;
00135   fMomentumBF = 0;
00136   fMomentumMS = 0;
00137   fMomentumBoth = 0;
00138   fMomentumAlt = 0;
00139 
00140   fChi2L = 0;
00141   fChi2BF = 0;
00142   fChi2MS = 0;
00143   fChi2Both = 0;
00144   fChi2Alt = 0;
00145   
00146   fFlag = 0;
00147   fIter = 0;
00148 
00149   fEMChargeD = 0;
00150 }

Generated on Mon Feb 15 11:06:28 2010 for loon by  doxygen 1.3.9.1