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

cluster::HitCluster Class Reference

#include <HitCluster.h>

List of all members.

Public Member Functions

 HitCluster ()
 ~HitCluster ()
std::vector< ClusterMakeClusters (std::vector< const CellHit * > &cellhit)
bool Fit3HitClust (Cluster clust, std::vector< Cluster > &newclust)
bool FitClust (Cluster clust, std::vector< Cluster > &newclust)
bool SortClust (std::vector< Cluster > &newclust)
void MakeHit (Cluster &clust, CellHit &hit)


Constructor & Destructor Documentation

cluster::HitCluster::HitCluster  )  [inline]
 

Definition at line 17 of file HitCluster.h.

00017 {};

cluster::HitCluster::~HitCluster  )  [inline]
 

Definition at line 18 of file HitCluster.h.

00018 {};


Member Function Documentation

bool HitCluster::Fit3HitClust Cluster  clust,
std::vector< Cluster > &  newclust
 

Definition at line 132 of file HitCluster.cxx.

References recobase::Cluster::NCell().

00133 {
00134 
00135   //Quieting some warnings
00136   int dummy1=0; dummy1 = clust.NCell();
00137   size_t dummy2=0; dummy2 = newclust.size();
00138 /*
00139  // First, check if there is a gap. If yes, split the cluster there
00140   if (clust.fCellHit[1]->Cell()-clust.fCellHit[0]->Cell()>1) {
00141     clust.fStatus |= 0x0001;
00142     Cluster cl1;
00143     Cluster cl2;
00144     cl1.Add(clust.fCellHit[0]);
00145     cl2.Add(clust.fCellHit[1]);
00146     cl2.Add(clust.fCellHit[2]);
00147     newclust.push_back(cl1);
00148     newclust.push_back(cl2);
00149   }
00150   else if (clust.fCellHit[2]->Cell()-clust.fCellHit[1]->Cell()>1) {
00151     clust.fStatus |= 0x0001;
00152     Cluster cl1;
00153     Cluster cl2;
00154     cl1.Add(clust.fCellHit[0]);
00155     cl1.Add(clust.fCellHit[1]);
00156     cl2.Add(clust.fCellHit[2]);
00157     newclust.push_back(cl1);
00158     newclust.push_back(cl2);
00159   }
00160   else {
00161     if (clust.fCellHit[0]->Cell() > clust.fCellHit[1]->Cell() &&
00162         clust.fCellHit[2]->Cell() > clust.fCellHit[1]->Cell()) {
00163       clust.fStatus |= 0x0001;
00164       Cluster cl1;
00165       Cluster cl2;
00166       if (clust.fCellHit[0]->Cell() > clust.fCellHit[2]->Cell()) {
00167         cl1.Add(clust.fCellHit[0]);
00168         cl1.Add(clust.fCellHit[1]);
00169         cl2.Add(clust.fCellHit[2]);
00170       }
00171       else {
00172         cl1.Add(clust.fCellHit[0]);
00173         cl2.Add(clust.fCellHit[1]);
00174         cl2.Add(clust.fCellHit[2]);
00175       }
00176       newclust.push_back(cl1);
00177       newclust.push_back(cl2);
00178     }
00179   }
00180 */  return true;
00181 
00182 
00183 }

bool HitCluster::FitClust Cluster  clust,
std::vector< Cluster > &  newclust
 

Definition at line 185 of file HitCluster.cxx.

References recobase::Cluster::NCell().

00186 {
00187   //Quieting warnings
00188   int dummy1=0; dummy1 = clust.NCell();
00189   size_t dummy2=0; dummy2 = newclust.size();
00190 
00191 /*
00192 if (clust.fCellHit.size()<3)  return true;
00193   if (clust.fCellHit.size()==3) return HitCluster::Fit3HitClust(clust, newclust);  
00194 
00195   for (unsigned int i=0; i<clust.fCellHit.size(); ++i) {
00196     Cluster tmpclust;
00197     double adcl=0;
00198     double adcr=0;
00199     if (i==0) adcl = 0.0;
00200     else  
00201         {
00202                 float mips;
00203             if(clust.fCellHit[i-1]->MIP(mips))
00204             adcl = mips;
00205         }
00206     if (i==clust.fCellHit.size()-1) adcr = 0.0;
00207     else  
00208         {
00209                 float mips;
00210                 if(clust.fCellHit[i+1]->MIP(mips))
00211             adcr = mips;
00212         }
00213     tmpclust.Add(clust.fCellHit[i]);
00214     float mips;
00215         if(!clust.fCellHit[i]->MIP(mips))continue;else
00216      if (mips<adcl && mips<adcr) {
00217       if (mips/(adcl+adcr)<0.5) {
00218         newclust.push_back(tmpclust);
00219         tmpclust.fCellHit.clear();
00220       }
00221     }
00222   }
00223   */return true;
00224 
00225 }

std::vector< Cluster > HitCluster::MakeClusters std::vector< const CellHit * > &  cellhit  ) 
 

Definition at line 13 of file HitCluster.cxx.

References recobase::Cluster::Add(), and recobase::CellHit::PE().

Referenced by cluster::Clusterer::Reco().

00014 {
00015 
00016 std::vector<Cluster> planecluster(0);
00017 
00018 
00019   int ipl;
00020   int ist;
00021   unsigned int icl;
00022   int stmax;
00023   int nzeros;
00024   int stlo;
00025   int sthi;
00026   int gapsz = 2;
00027   float adcmax;
00028   std::vector<int> istlo;
00029   std::vector<int> isthi;
00030 // --// for (ipl = view.PlaneMin(); ipl<=view.PlaneMax(); ++ipl) {
00031 
00032 
00033   for(ipl=0;ipl<0;ipl++){
00034 
00035     istlo.clear();
00036     isthi.clear();
00037     while (1) {
00038       // Scan along the strips looking for the highest peak, not already
00039       // associate with a cluster
00040       stmax  = -1;
00041       adcmax = -1.0;
00042 //--  //    for (ist = view.StripMin(); ist<=view.StripMax(); ++ist) {
00043  
00044         for(ist=0;ist<0;ist++)
00045 {
00046        // Check if the strip is already inside a range assigned to a
00047         // cluster
00048         bool skipit = false;
00049         for (icl=0; icl<istlo.size(); ++icl) {
00050          
00051 
00052          if (ist>istlo[icl] && ist<isthi[icl]) skipit = true;
00053           if (ist==istlo[icl]) skipit = true;
00054           if (ist==isthi[icl]) skipit = true;
00055           if (skipit) {
00056             //      MsgError("MDMReco","Skipping %d lies inside cluster %d\n",
00057             //               ist, icl);
00058             break;
00059           }
00060         }
00061         if (skipit==true) continue;
00062 
00063 
00064 
00065  //---     //  const NOVACellHit* cell = view.FindHit(ipl, ist);
00066          CellHit *cell=new CellHit();
00067 
00068         if (cell==0) continue;
00069   
00070         float mips=0.0;
00071         if(cell->PE() > 0.) mips = cell->PE();else continue;
00072         
00073         if( mips > 0 ){
00074           if(mips > adcmax) {
00075             stmax  = ist;
00076             adcmax = mips;
00077           }
00078         } else continue;
00079       } // End search for peak strip
00080       if (adcmax<0.0) break;
00081       
00082       // Now that we have our peak strip, expand out until we encouter a
00083       // gap of at least two strips
00084       nzeros = 0;
00085 //--//
00086 
00087 
00088 //      for (ist=stmax+1; ist<=view.StripMax(); ++ist) {
00089 //        if (view.FindHit(ipl, ist)==0) ++nzeros;
00090 //        else                             nzeros = 0;
00091 //        if (nzeros==gapsz) break;
00092 //      }
00093 
00094 
00095       sthi = ist-gapsz+1;
00096       isthi.push_back(sthi);
00097       
00098       nzeros = 0;
00099  
00100 //--//
00101 
00102 //     for (ist=stmax-1; ist>=view.StripMin(); --ist) {
00103 //        if (view.FindHit(ipl, ist)==0) ++nzeros;
00104 //        else                             nzeros = 0;
00105 //        if (nzeros==gapsz) break;
00106 //      }
00107 
00108 
00109 
00110       stlo = ist+gapsz-1;
00111       istlo.push_back(stlo);
00112       
00113       // Build the cluster
00114       Cluster clust;
00115       for (ist=stlo; ist<=sthi; ++ist) {
00116   
00117 //--//      const NOVACellHit* cell = view.FindHit(ipl, ist);
00118 
00119          CellHit * cell = new CellHit();
00120 
00121         if (cell!=0) clust.Add(cell);
00122       }
00123      
00124       planecluster.push_back(clust);
00125     } // While there are still unassociated hits in the plane
00126   } // End loop on planes
00127 
00128 return planecluster;
00129 
00130 }

void HitCluster::MakeHit Cluster clust,
CellHit hit
 

Definition at line 247 of file HitCluster.cxx.

00248 {
00249 }

bool HitCluster::SortClust std::vector< Cluster > &  newclust  ) 
 

Definition at line 227 of file HitCluster.cxx.

00228 {
00229   // Sort Cluster by plane number.
00230   std::multimap<float,Cluster> tmpclustmap;
00231 
00232   for (unsigned int i=0; i<clust.size(); ++i) {
00233    
00234     tmpclustmap.insert(std::multimap<float,Cluster>::value_type(clust[i].Z(),clust[i]));
00235   }
00236   clust.clear();
00237 
00238   std::multimap<float,Cluster>::iterator itr = tmpclustmap.begin();
00239   while( itr != tmpclustmap.end() )
00240   {
00241     clust.push_back((*itr).second);
00242     ++itr;
00243   }
00244   return true;
00245 }


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 04:45:30 2009 for NOvA Offline by  doxygen 1.3.9.1