AlgCluster3DList Class Reference

#include <AlgCluster3DList.h>

Inheritance diagram for AlgCluster3DList:

AlgBase List of all members.

Public Member Functions

 AlgCluster3DList ()
virtual ~AlgCluster3DList ()
virtual void RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx)
virtual void Trace (const char *c) const

Private Attributes

Int_t fParmSMPlaneLast
Int_t fParmSMPlaneFirst

Detailed Description

Definition at line 17 of file AlgCluster3DList.h.


Constructor & Destructor Documentation

AlgCluster3DList::AlgCluster3DList (  )  [inline]

Definition at line 21 of file AlgCluster3DList.h.

00021 {};

virtual AlgCluster3DList::~AlgCluster3DList (  )  [inline, virtual]

Definition at line 22 of file AlgCluster3DList.h.

00022 {};


Member Function Documentation

void AlgCluster3DList::RunAlg ( AlgConfig ac,
CandHandle ch,
CandContext cx 
) [virtual]

Implements AlgBase.

Definition at line 46 of file AlgCluster3DList.cxx.

References CellListKG::CreateCells(), ClusterListKG::CreateClusters(), StripListKG::CreateStrips(), CellListKG::GetCells(), ClusterListKG::GetClusters(), CandHandle::GetDaughterIterator(), AlgFactory::GetInstance(), StripListKG::GetStripHandle(), StripListKG::GetStrips(), RecMinos::GetVldContext(), Msg::kDebug, Msg::kError, CandCluster3D::MakeCandidate(), and MSG.

00048            :  From here, the methods which are the heart of the algorithm,
00049 //            are called 
00050 //
00051 //  Arguments: 
00052 //              
00053 //  Return:  n/a
00054 //
00055 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00056 //
00057 //
00058 //  Program Notes:-
00059 //  =============
00060 //
00061 {
00062    MSG("Cluster3D", Msg::kDebug)
00063                            << "Starting AlgCluster3DList::RunAlg()" << endl;
00064 
00065   assert(cx.GetDataIn());
00066 
00067 // Check for CandSliceListHandle input
00068   if (!(cx.GetDataIn()->InheritsFrom("CandSliceListHandle"))) {
00069     MSG("Cluster3D", Msg::kError)
00070         << "AlgCluster3DList::RunAlg() No CandSliceListHandle input" << endl;
00071     return;
00072   }
00073 
00074   const CandSliceListHandle *cslh =
00075         dynamic_cast<const CandSliceListHandle*>(cx.GetDataIn());
00076 
00077 // Create Candcontext
00078   CandContext cxx(this,cx.GetMom());
00079 
00080   // Algorithm parameters
00081 
00082 // Get singleton instance of AlgFactory
00083   AlgFactory &af = AlgFactory::GetInstance();
00084 
00085 // Get an AlgHandle to AlgCluster3D with default AlgConfig
00086   AlgHandle ah = af.GetAlgHandle("AlgCluster3D","default");
00087 
00088   const CandRecord *candrec = cx.GetCandRecord();
00089   assert(candrec);
00090   const VldContext *vldcptr = candrec->GetVldContext();
00091   assert(vldcptr);
00092   VldContext vldc = *vldcptr;
00093 
00094   UgliGeomHandle ugh0(vldc);
00095   UgliGeomHandle *ugh = &ugh0;
00096 
00097   Int_t islice=0;
00098 
00099   CandSliceHandleItr sliceItr(cslh->GetDaughterIterator());
00100   // Different way to iterate over the structure
00101   //while (CandSliceHandle *slice = sliceItr()) {
00102   while ( sliceItr.IsValid() ) {
00103 
00104       MSG("Cluster3D", Msg::kDebug)
00105         << "Slice number = " << islice++ << endl;
00106 
00107       CandSliceHandle *slice = sliceItr.Ptr();    
00108 
00109       StripListKG stripList;
00110       stripList.CreateStrips(ac,slice,ugh);
00111 
00112       vector<StripKG> stps;   
00113       stripList.GetStrips(stps);
00114 
00115       MSG("Cluster3D", Msg::kDebug)
00116         << "Number of strips =  " << stps.size() << endl;
00117  
00118       CellListKG cellList;
00119 
00120       cellList.CreateCells(ac,stripList);        
00121 
00122       vector<CellKG> cells;   
00123       cellList.GetCells(cells);
00124 
00125       MSG("Cluster3D", Msg::kDebug)
00126         << "Number of cells = " << cells.size() << endl;
00127 
00128       ClusterListKG clusterList;
00129 
00130       clusterList.CreateClusters(ac,stripList,cellList);
00131 
00132       vector<ClusterKG> clsts;   
00133       clusterList.GetClusters(clsts);
00134 
00135       MSG("Cluster3D", Msg::kDebug)
00136         << "Number of clusters = " << clsts.size() << endl;
00137 
00138       for(UInt_t i=0;i<clsts.size();++i){
00139         TObjArray striparray;
00140         MSG("Cluster3D", Msg::kDebug)
00141           << "Number of strips in " << i << " cluster= " 
00142           << clsts[i].stpindexes.size() << endl;
00143         for(UInt_t j=0;j<clsts[i].stpindexes.size();++j){
00144           CandStripHandle *strip = 
00145               stripList.GetStripHandle(clsts[i].stpindexes[j]);
00146           striparray.Add(strip);
00147         }
00148         cxx.SetDataIn(&striparray);
00149         CandCluster3DHandle clusterhandle = 
00150                  CandCluster3D::MakeCandidate(ah,cxx);
00151         ch.AddDaughterLink(clusterhandle);         
00152       }
00153 
00154       // something that inherits from TObject and is used 
00155       // to create clusters - in this case we should use strips
00156       // as an argument to SetDataIn
00157 
00158       sliceItr.Next();
00159   }
00160 
00161         /*
00162 // don't cluster in muon spectrometer
00163         if (strip->GetPlaneView()==view &&
00164             (vldc.GetDetector()!=Detector::kNear ||
00165             strip->GetPlane()<=121)) {
00166         }
00167         */
00168 
00169 }

void AlgCluster3DList::Trace ( const char *  c  )  const [virtual]

Reimplemented from AlgBase.

Definition at line 172 of file AlgCluster3DList.cxx.

00173 {
00174 }


Member Data Documentation

Int_t AlgCluster3DList::fParmSMPlaneFirst [private]

Definition at line 28 of file AlgCluster3DList.h.

Int_t AlgCluster3DList::fParmSMPlaneLast [private]

Definition at line 27 of file AlgCluster3DList.h.


The documentation for this class was generated from the following files:
Generated on Mon Aug 11 01:05:20 2014 for loon by  doxygen 1.4.7