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

CandSubShowerSR.cxx

Go to the documentation of this file.
00001 
00002 // $Id: CandSubShowerSR.cxx,v 1.4 2009/11/20 03:06:11 gmieg Exp $
00003 //
00004 // CandSubShowerSR
00005 //
00007 
00008 #include "TClass.h"
00009 
00010 #include "Algorithm/AlgHandle.h"
00011 #include "CandSubShowerSR/CandSubShowerSR.h"
00012 #include "CandSubShowerSR/CandSubShowerSRHandle.h"
00013 #include "MessageService/MsgService.h"
00014 
00015 ClassImp(CandSubShowerSR)
00016 
00017 //______________________________________________________________________
00018 CVSID("$Id: CandSubShowerSR.cxx,v 1.4 2009/11/20 03:06:11 gmieg Exp $");
00019 
00020 #include "Candidate/CandBase.tpl"
00021 
00022 //______________________________________________________________________
00023 CandSubShowerSR::CandSubShowerSR() 
00024   : Energy(0), planeView(PlaneView::kUnknown), Slope(0),
00025     AvgDev(0), ClusterID(ClusterType::kUnknown), ProbEM(0),
00026     MinStripPE(0)
00027 {
00028   MSG("Cand", Msg::kDebug)
00029     << "Begin CandSubShowerSR::CandSubShowerSR() ctor: " << endl
00030     << "UidInt = " << GetUidInt()
00031     << ", ArchUidInt " << GetArchUidInt() << endl
00032     << "No. of links = " << GetNLinks() << endl
00033     << "End CandSubShowerSR::CandSubShowerSR() ctor." << endl;
00034 
00035 }
00036 
00037 //______________________________________________________________________
00038 CandSubShowerSR::CandSubShowerSR(AlgHandle &ah) :
00039   CandReco(ah)     // Should be the next class up on inheritance chain
00040   ,Energy(0), planeView(PlaneView::kUnknown), Slope(0), 
00041   AvgDev(0), ClusterID(ClusterType::kUnknown), ProbEM(0),
00042   MinStripPE(0)
00043 {
00044 
00045 // The sole purpose of this constructor is to transmit the AlgHandle
00046 // up the inheritance chain to CandBase without having to invoke the
00047 // full constructor of an intermediate Candidate type which the highest
00048 // level Candidate might inherit from.  One only wants to create the
00049 // LocalHandle and invoke the RunAlg() method in the lowest level class.
00050 }
00051 
00052 //______________________________________________________________________
00053 CandSubShowerSR::CandSubShowerSR(AlgHandle &ah, CandHandle &ch,
00054                                  CandContext &cx) :
00055   CandReco(ah)     // Should be the next class up on inheritance chain
00056   ,Energy(0), planeView(PlaneView::kUnknown), Slope(0), 
00057   AvgDev(0), ClusterID(ClusterType::kUnknown), ProbEM(0),
00058   MinStripPE(0)
00059 {
00060   CreateLocalHandle();
00061   MSG("Cand", Msg::kDebug)
00062     << "Begin CandSubShowerSR::CandSubShowerSR(AlgHandle &, CandHandle &, "
00063     << "CandContext &) ctor: " << endl
00064     << "UidInt = " << GetUidInt()
00065     << ", ArchUidInt " << GetArchUidInt() << endl
00066     << "No. of links = " << GetNLinks() << endl
00067     << "End CandSubShowerSR::CandSubShowerSR(AlgHandle &, CandHandle &, "
00068     << "CandContext &) ctor." << endl;
00069 
00070    // Run Algorithm to construct Candidate
00071   {                                                    // Start of scope
00072     CandSubShowerSRHandle csh(this);            // csh will go out of scope
00073     ch = csh;                                       // after setting ch.
00074   }                                                      // End of scope
00075   ah.RunAlg(ch, cx);
00076 }
00077 
00078 //______________________________________________________________________
00079 CandSubShowerSR::CandSubShowerSR(const CandSubShowerSR &rhs) :
00080   CandReco(rhs)    // Should be the next class up on inheritance chain
00081   ,Energy(0), planeView(PlaneView::kUnknown), Slope(0), 
00082   AvgDev(0), ClusterID(ClusterType::kUnknown), ProbEM(0),
00083   MinStripPE(0)
00084 {
00085 
00086   MSG("Cand", Msg::kDebug)
00087     << "Begin CandSubShowerSR::CandSubShowerSR(const CandSubShowerSR &rhs) ctor:"
00088     << endl << "UidInt = " << GetUidInt()
00089     << ", ArchUidInt " << GetArchUidInt() << endl
00090     << "No. of links = " << GetNLinks() << endl
00091     << "End CandSubShowerSR::CandSubShowerSR(const CandSubShowerSR &rhs) ctor."
00092     << endl;
00093 
00094   Energy      = rhs.Energy;
00095   planeView   = rhs.planeView;
00096   Slope       = rhs.Slope;
00097   AvgDev      = rhs.AvgDev;
00098   ClusterID   = rhs.ClusterID;
00099   ProbEM      = rhs.ProbEM;
00100   MinStripPE  = rhs.MinStripPE;
00101 
00102 }
00103 
00104 //______________________________________________________________________
00105 CandSubShowerSR::~CandSubShowerSR()
00106 {
00107   MSG("Cand", Msg::kDebug)
00108     << "Begin CandSubShowerSR::~CandSubShowerSR() dtor: " << endl
00109     << "UidInt = " << GetUidInt()
00110     << ", ArchUidInt " << GetArchUidInt() << endl
00111     << "No. of links = " << GetNLinks() << endl
00112     << "End CandSubShowerSR::~CandSubShowerSR() dtor." << endl;
00113   
00114 }
00115 
00116 //______________________________________________________________________
00117 void CandSubShowerSR::CreateLocalHandle()
00118 {
00119   SetLocalHandle(new CandSubShowerSRHandle(this));
00120 }
00121 
00122 //______________________________________________________________________
00123 CandSubShowerSR *CandSubShowerSR::Dup() const
00124 {
00125   
00126   // Base copy ctor dups owned pointers, but defers copying Daughter List.
00127   // Daughter List copy is made in the derived class Dup() function.
00128   // This is because base class copy constructor hasn't yet created
00129   // fLocalHandle with a CandHandle* of the full derived type.
00130   CandSubShowerSR *cb = new CandSubShowerSR(*this);     // Copy-ctor dups ptrs
00131   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00132   TIter iterdau = GetDaughterIterator();
00133   CandHandle *dau;
00134   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00135   return cb;
00136 }
00137 
00138 //______________________________________________________________________
00139 Bool_t CandSubShowerSR::IsEquivalent(const TObject *rhs) const
00140 {
00141   Bool_t result = true;
00142   if (!CandReco::IsEquivalent(rhs)) result = false;   // superclass test  
00143   TestDisplayCandBanner("CandSubShowerSR");
00144   const CandSubShowerSR* rCnd = dynamic_cast<const CandSubShowerSR*>(rhs);
00145   if (rCnd == NULL) return false;
00146   
00147   if(dynamic_cast<const CandSubShowerSR*>(rhs)->Energy!=Energy) 
00148     return false;
00149 
00150   if(dynamic_cast<const CandSubShowerSR*>(rhs)->planeView!=planeView) 
00151     return false;
00152 
00153   if(dynamic_cast<const CandSubShowerSR*>(rhs)->Slope!=Slope) 
00154     return false;
00155 
00156   if(dynamic_cast<const CandSubShowerSR*>(rhs)->AvgDev!=AvgDev) 
00157     return false;
00158   
00159   if(dynamic_cast<const CandSubShowerSR*>(rhs)->ClusterID!=ClusterID) 
00160     return false;
00161 
00162   if(dynamic_cast<const CandSubShowerSR*>(rhs)->ProbEM!=ProbEM) 
00163     return false;
00164 
00165   if(dynamic_cast<const CandSubShowerSR*>(rhs)->MinStripPE!=MinStripPE) 
00166     return false;
00167 
00168   return result;
00169 }
00170 
00171 //______________________________________________________________________
00172 CandSubShowerSRHandle CandSubShowerSR::MakeCandidate(AlgHandle &ah,
00173                                                      CandContext &cx)
00174 {
00175   CandSubShowerSRHandle csh;
00176   new CandSubShowerSR(ah, csh, cx);        // csh owns the new CandSubShowerSR
00177   return csh;
00178 }
00179 

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