Managed::ManagedCluster Class Reference

#include <ManagedCluster.h>

List of all members.

Public Member Functions

 ManagedCluster ()
virtual ~ManagedCluster ()
void Reset ()
void AdvanceID ()
void Insert (double z, double t, double energy, int plane, int strip, int hit_id)
void Finalize ()
void ResetIDCounter ()
int GetStatus ()
void SetStatus (int status)

Public Attributes

int id
double z
double dz
double t
double dt
int view
double tmin
double tmax
double zmin
double zmax
int inuse
double rms_t
double e
std::vector< int > hitplane
std::vector< int > hitstrip
std::vector< double > hite
std::vector< double > hitz
std::vector< double > hitt
std::vector< int > hit_id
std::map< double, int > tsortmap

Static Public Attributes

static int idcounter = 1

Private Attributes

int status

Detailed Description

Definition at line 13 of file ManagedCluster.h.


Constructor & Destructor Documentation

ManagedCluster::ManagedCluster (  ) 

Definition at line 10 of file ManagedCluster.cxx.

00010                                :z(0),dz(0),t(0),dt(0),view(0),inuse(0),rms_t(0),e(0)
00011 {
00012         id=idcounter++;
00013         Reset();
00014 }

ManagedCluster::~ManagedCluster (  )  [virtual]

Definition at line 17 of file ManagedCluster.cxx.

References hit_id, hite, hitplane, hitstrip, hitt, hitz, and tsortmap.

00018 {
00019         hitplane.clear();
00020         hitstrip.clear();
00021         hite.clear();
00022         hitz.clear();
00023         hitt.clear();
00024         hit_id.clear();
00025         tsortmap.clear();
00026 }


Member Function Documentation

void ManagedCluster::AdvanceID (  ) 

Definition at line 54 of file ManagedCluster.cxx.

References idcounter.

Referenced by Managed::ClusterManager::MakeClusters().

00055 {
00056         id=idcounter++;
00057 }

void ManagedCluster::Finalize (  ) 

Definition at line 76 of file ManagedCluster.cxx.

References dt, dz, e, hite, hitplane, hitt, hitz, rms_t, t, tmax, tmin, z, zmax, and zmin.

Referenced by Managed::ClusterManager::AdjustCluster(), Managed::ClusterManager::MakeClusters(), Managed::ClusterManager::MergeClusters(), Managed::ClusterSaver::SaveCluster(), and Managed::ClusterManager::SplitEnergy().

00077 {
00078         //printf("Finalizing cluster %d\n\thits (z,t,e)",id);
00079 
00080         double wz=0;
00081         double wt=0;
00082         e=0;
00083         for(unsigned int i=0;i<hitplane.size();i++)
00084         {
00085                 //printf("(%f %f %f)",hitz[i],hitt[i],hite[i]);
00086                 wz+=hitz[i]*hite[i];
00087                 wt+=hitt[i]*hite[i];
00088                 e+=hite[i];
00089         }
00090         if(e<0.001)return;
00091         wz/=e;
00092         wt/=e;
00093         
00094         
00095         t=wt;
00096         z=wz;
00097         
00098         double mdz=0;
00099         double mdt=0;
00100         for(unsigned int i=0;i<hitplane.size();i++)
00101         {
00102                 if(fabs(z-hitz[i])>mdz)mdz=fabs(z-hitz[i]);
00103                 if(fabs(t-hitt[i])>mdt)mdt=fabs(t-hitt[i]);
00104                 
00105         }       
00106         
00107         dt=mdt;
00108         dz=mdz;
00109         
00110         
00111         double rmt=0;
00112         for(unsigned int i=0;i<hitplane.size();i++)
00113         {
00114                 rmt+=(wt-hitt[i])*(wt-hitt[i])*hite[i]*hite[i];
00115         }
00116         rmt=sqrt(rmt);
00117         rms_t=rmt/e;
00118                 
00119                 
00120                 
00121         if(hitt.size()>0)
00122         {
00123                 tmin=hitt[0];
00124                 tmax=hitt[0];
00125                 zmin=hitz[0];
00126                 zmax=hitz[0];
00127                 for(unsigned int i=1;i<hitt.size();i++)
00128                 {
00129                         tmin=tmin<hitt[i]?tmin:hitt[i];
00130                         tmax=tmax>hitt[i]?tmax:hitt[i];         
00131                         zmin=zmin<hitz[i]?zmin:hitz[i];
00132                         zmax=zmax>hitz[i]?zmax:hitz[i];                 
00133                 
00134                 }
00135         
00136         
00137         }       
00138                 
00139         //("\n\ttrms: %f\n",rms_t);     
00140         
00141 }

int Managed::ManagedCluster::GetStatus (  )  [inline]

Definition at line 57 of file ManagedCluster.h.

References status.

Referenced by ChainView::DrawClusters(), HoughView::DrawClusters(), and PrimaryShowerFinder::MakeChains().

00057 {return status;};

void ManagedCluster::Insert ( double  z,
double  t,
double  energy,
int  plane,
int  strip,
int  hit_id 
)

Definition at line 59 of file ManagedCluster.cxx.

References hit_id, hite, hitplane, hitstrip, hitt, hitz, and tsortmap.

Referenced by Managed::ClusterManager::MakeClusters(), and Managed::ClusterManager::MergeClusters().

00060 {
00061         hitplane.push_back(plane);
00062         hitstrip.push_back(strip);
00063         hite.push_back(energy);
00064         hitz.push_back(z);
00065         hitt.push_back(t);
00066         hit_id.push_back(my_hit_id);
00067         tsortmap.insert(std::make_pair(t,hitt.size()-1));
00068 }

void ManagedCluster::Reset (  ) 

Definition at line 29 of file ManagedCluster.cxx.

References dt, dz, e, hit_id, hite, hitplane, hitstrip, hitt, hitz, inuse, rms_t, status, t, tmax, tmin, tsortmap, view, z, zmax, and zmin.

Referenced by Managed::ClusterManager::MakeClusters(), and PrimaryShowerFinder::MakeHoughMap().

00030 {
00031         z=0;
00032         dz=0;
00033         t=0;
00034         dt=0;
00035         view=0;
00036         inuse=0;
00037         rms_t=0;
00038         e=0;
00039         hitplane.clear();
00040         hitstrip.clear();
00041         hite.clear();
00042         hitz.clear();
00043         hitt.clear();
00044         hit_id.clear();
00045         tsortmap.clear();
00046         
00047         status=0;
00048         tmin=0;
00049         tmax=0;
00050         zmin=0;
00051         zmax=0;
00052 }

void ManagedCluster::ResetIDCounter (  ) 

Definition at line 70 of file ManagedCluster.cxx.

References idcounter.

Referenced by Managed::ClusterManager::MakeClusters().

00071 {
00072         idcounter=1;
00073 }

void Managed::ManagedCluster::SetStatus ( int  status  )  [inline]

Definition at line 58 of file ManagedCluster.h.

Referenced by Managed::ClusterManager::SaveCluster(), and Finder::SetStatus().

00058 {this->status=status;};


Member Data Documentation

std::vector<double> Managed::ManagedCluster::hite
std::vector<double> Managed::ManagedCluster::hitt
std::vector<double> Managed::ManagedCluster::hitz
int ManagedCluster::idcounter = 1 [static]

Definition at line 22 of file ManagedCluster.h.

Referenced by AdvanceID(), and ResetIDCounter().

Definition at line 36 of file ManagedCluster.h.

Referenced by Finder::FindNeutrons(), Finder::RecordLostHits(), and Reset().

Definition at line 58 of file ManagedCluster.h.

Referenced by GetStatus(), and Reset().

Definition at line 32 of file ManagedCluster.h.

Referenced by Finalize(), and Reset().

Definition at line 31 of file ManagedCluster.h.

Referenced by Finalize(), and Reset().

std::map<double,int> Managed::ManagedCluster::tsortmap

Definition at line 55 of file ManagedCluster.h.

Referenced by Insert(), Reset(), and ~ManagedCluster().

Definition at line 34 of file ManagedCluster.h.

Referenced by Finalize(), and Reset().

Definition at line 33 of file ManagedCluster.h.

Referenced by Finalize(), and Reset().


The documentation for this class was generated from the following files:

Generated on 19 Jan 2018 for loon by  doxygen 1.6.1