ClusterCam Class Reference

#include <ClusterCam.h>

List of all members.

Public Member Functions

 ClusterCam (HitCam *hit)
virtual ~ClusterCam ()
void AddHit (HitCam *hit)
bool ContainsHit (HitCam *hit)
int IsHitAssoc (HitCam *hit) const
int IsShwAssoc (ClusterCam *clust) const
int IsTrkAssoc (ClusterCam *clustm, ClusterCam *clustp, int PlaneGap=0) const
unsigned int GetEntries () const
HitCamGetHit (unsigned int i) const
int GetDigits () const
int GetPlane () const
int GetBegStrip () const
int GetEndStrip () const
int GetPlaneView () const
double GetZPos ()
double GetTPos ()
double GetCharge ()
double GetBegTime () const
double GetEndTime () const
double GetBegTPos () const
double GetEndTPos () const
int GetTrkFlag () const
int GetShwFlag () const
int GetTrkPlnFlag () const
int GetShwPlnFlag () const
void SetTrkFlag (int flag)
void SetShwFlag (int flag)
void SetTrkPlnFlag (int flag)
void SetShwPlnFlag (int flag)
void SetNDFlag (int flag)
int GetNDFlag () const

Public Attributes

int fPlane
int fBegStrip
int fEndStrip
double fBegTime
double fEndTime
double fBegTPos
double fEndTPos
double fZPos
double fTPos
double fCharge
int fTrkFlag
int fShwFlag
int fTrkPlnFlag
int fShwPlnFlag
int fPlaneView
int fDigits
int fNDFlag

Private Attributes

vector< HitCam * > HitsInCluster
const double StripWidth

Detailed Description

Definition at line 17 of file ClusterCam.h.


Constructor & Destructor Documentation

ClusterCam::ClusterCam ( HitCam hit  ) 

Definition at line 19 of file ClusterCam.cxx.

00019                                   :
00020   fPlane(-1),fBegStrip(-1), fEndStrip(-1), 
00021   fBegTime(0.), fEndTime(0.),
00022   fBegTPos(0.), fEndTPos(0.),
00023   fZPos(0.), fTPos(0.), fCharge(0.),
00024   fTrkFlag(0),fShwFlag(0),
00025   fTrkPlnFlag(0), fShwPlnFlag(0),
00026   fPlaneView(-1),fDigits(0),fNDFlag(1), 
00027   StripWidth(4.108e-2)
00028 {
00029   this->AddHit(hit);
00030 }

ClusterCam::~ClusterCam (  )  [virtual]

Definition at line 35 of file ClusterCam.cxx.

References HitsInCluster.

00036 {
00037   HitsInCluster.clear();
00038 }


Member Function Documentation

void ClusterCam::AddHit ( HitCam hit  ) 

Definition at line 43 of file ClusterCam.cxx.

References ContainsHit(), fBegStrip, fBegTime, fBegTPos, fCharge, fDigits, fEndStrip, fEndTime, fEndTPos, fPlane, fPlaneView, fTPos, fZPos, HitCam::GetCandStripHandle(), HitCam::GetCharge(), CandHandle::GetNDaughters(), HitCam::GetPlane(), HitCam::GetPlaneView(), HitCam::GetStrip(), HitCam::GetTime(), HitCam::GetTPos(), HitCam::GetZPos(), and HitsInCluster.

Referenced by AlgTrackCamList::Form3DTracks(), and AlgTrackCamList::FormTheClusters().

00044 {
00045   if(HitsInCluster.size()==0) {
00046     HitsInCluster.push_back(hit);
00047 
00048     fPlane=hit->GetPlane();
00049     fBegStrip=hit->GetStrip();
00050     fEndStrip=hit->GetStrip();
00051     fBegTPos=hit->GetTPos();
00052     fEndTPos=hit->GetTPos();
00053     fBegTime=hit->GetTime();
00054     fEndTime=hit->GetTime();
00055     fZPos=hit->GetZPos();
00056     fPlaneView=hit->GetPlaneView();
00057   }
00058 
00059   else {
00060     if(this->ContainsHit(hit)==true) {return;}
00061     HitsInCluster.push_back(hit);   
00062 
00063     if(hit->GetStrip()<fBegStrip) fBegStrip=hit->GetStrip();
00064     if(hit->GetStrip()>fEndStrip) fEndStrip=hit->GetStrip();
00065     if(hit->GetTPos()<fBegTPos) fBegTPos=hit->GetTPos();
00066     if(hit->GetTPos()>fEndTPos) fEndTPos=hit->GetTPos();
00067     if(hit->GetTime()<fBegTime) fBegTime=hit->GetTime();
00068     if(hit->GetTime()>fEndTime) fEndTime=hit->GetTime();
00069   }
00070   fDigits += hit->GetCandStripHandle()->GetNDaughters();
00071   fTPos = (fTPos*fCharge+hit->GetTPos()*hit->GetCharge())/(fCharge+hit->GetCharge());
00072   fCharge += hit->GetCharge();
00073 
00074   return;
00075 
00076 }

bool ClusterCam::ContainsHit ( HitCam hit  ) 

Definition at line 81 of file ClusterCam.cxx.

References HitsInCluster.

Referenced by AddHit().

00082 {
00083   for(unsigned int i=0; i<HitsInCluster.size(); ++i) {
00084     if(hit==HitsInCluster[i]) {return true;}
00085   }
00086 
00087   return false;
00088 }

int ClusterCam::GetBegStrip (  )  const [inline]

Definition at line 34 of file ClusterCam.h.

References fBegStrip.

00034 {return fBegStrip;};

double ClusterCam::GetBegTime (  )  const [inline]

Definition at line 41 of file ClusterCam.h.

References fBegTime.

Referenced by TrackSegmentCam::AddCluster(), IsShwAssoc(), and IsTrkAssoc().

00041 {return fBegTime;};

double ClusterCam::GetBegTPos (  )  const [inline]
double ClusterCam::GetCharge (  )  [inline]

Definition at line 40 of file ClusterCam.h.

References fCharge.

Referenced by AlgTrackCamList::Form3DTracks(), and AlgTrackCamList::IDTrkAndShwClusters().

00040 {return fCharge;};

int ClusterCam::GetDigits (  )  const [inline]

Definition at line 31 of file ClusterCam.h.

References fDigits.

00031 { return fDigits; };

int ClusterCam::GetEndStrip (  )  const [inline]

Definition at line 35 of file ClusterCam.h.

References fEndStrip.

00035 {return fEndStrip;};

double ClusterCam::GetEndTime (  )  const [inline]

Definition at line 42 of file ClusterCam.h.

References fEndTime.

Referenced by TrackSegmentCam::AddCluster(), IsShwAssoc(), and IsTrkAssoc().

00042 {return fEndTime;};

double ClusterCam::GetEndTPos (  )  const [inline]
unsigned int ClusterCam::GetEntries (  )  const [inline]
HitCam * ClusterCam::GetHit ( unsigned int  i  )  const

Definition at line 238 of file ClusterCam.cxx.

References HitsInCluster.

Referenced by AlgTrackCamList::Form3DTracks(), and TrackSegmentCam::GetScore().

00239 {
00240   if(i<HitsInCluster.size()) {return HitsInCluster[i];}
00241   else {return 0;}
00242 }

int ClusterCam::GetNDFlag (  )  const [inline]

Definition at line 57 of file ClusterCam.h.

References fNDFlag.

Referenced by AlgTrackCamList::FirstUVComparison(), AlgTrackCamList::Form3DTracks(), and IsTrkAssoc().

00057 {return fNDFlag;};

int ClusterCam::GetPlane (  )  const [inline]
int ClusterCam::GetPlaneView (  )  const [inline]

Definition at line 36 of file ClusterCam.h.

References fPlaneView.

Referenced by AlgTrackCamList::Form3DTracks().

00036 {return fPlaneView;};

int ClusterCam::GetShwFlag (  )  const [inline]

Definition at line 47 of file ClusterCam.h.

References fShwFlag.

Referenced by AlgTrackCamList::FirstUVComparison().

00047 {return fShwFlag;}; 

int ClusterCam::GetShwPlnFlag (  )  const [inline]

Definition at line 49 of file ClusterCam.h.

References fShwPlnFlag.

Referenced by AlgTrackCamList::Form3DTracks().

00049 {return fShwPlnFlag;};

double ClusterCam::GetTPos (  )  [inline]

Definition at line 39 of file ClusterCam.h.

References fTPos.

00039 {return fTPos;};

int ClusterCam::GetTrkFlag (  )  const [inline]

Definition at line 46 of file ClusterCam.h.

References fTrkFlag.

Referenced by AlgTrackCamList::FirstUVComparison(), and AlgTrackCamList::Form2DTracks().

00046 {return fTrkFlag;};

int ClusterCam::GetTrkPlnFlag (  )  const [inline]
double ClusterCam::GetZPos (  )  [inline]

Definition at line 38 of file ClusterCam.h.

References fZPos.

Referenced by TrackSegmentCam::AddCluster(), and AlgTrackCamList::Form3DTracks().

00038 {return fZPos;};

int ClusterCam::IsHitAssoc ( HitCam hit  )  const

Definition at line 93 of file ClusterCam.cxx.

References fBegTime, fBegTPos, fEndTime, fEndTPos, fPlane, HitCam::GetPlane(), HitCam::GetTime(), HitCam::GetTPos(), and StripWidth.

Referenced by AlgTrackCamList::FormTheClusters().

00094 {
00095   double TimeWindow = 9999.9;
00096   if( hit->GetPlane()==fPlane 
00097       && hit->GetTPos()>(fBegTPos-2*StripWidth) && hit->GetTPos()<(fEndTPos+2*StripWidth)
00098       && hit->GetTime()>(fBegTime-TimeWindow) && hit->GetTime()<(fEndTime+TimeWindow) ) {
00099     return 1; 
00100   }
00101   else {return 0;}
00102 }

int ClusterCam::IsShwAssoc ( ClusterCam clust  )  const

Definition at line 107 of file ClusterCam.cxx.

References fBegTime, fBegTPos, fEndTime, fEndTPos, fPlane, GetBegTime(), GetBegTPos(), GetEndTime(), GetEndTPos(), GetEntries(), GetPlane(), and StripWidth.

Referenced by AlgTrackCamList::IDTrkAndShwClusters().

00108 {
00109   double TimeWindow = 99.9; int ShwAssocNum = 0;
00110 
00111   if( (fEndTime-clust->GetBegTime())>-TimeWindow || (clust->GetEndTime()-fBegTime)>-TimeWindow ) {
00112 
00113     if( abs(clust->GetPlane()-fPlane)<5 
00114         && (clust->GetEndTPos()-fBegTPos)>-6*StripWidth && (fEndTPos-clust->GetBegTPos())>-6*StripWidth ) {
00115       
00116       if( ( abs(clust->GetPlane()-fPlane)<3 
00117             && (clust->GetEndTPos()-fBegTPos)>-StripWidth && (fEndTPos-clust->GetBegTPos())>-StripWidth )
00118 
00119           || ( clust->GetPlane()==fPlane
00120                && (clust->GetEndTPos()-fBegTPos)>-3*StripWidth && (fEndTPos-clust->GetBegTPos())>-3*StripWidth ) )
00121         
00122         {ShwAssocNum=2;}
00123       
00124       else {ShwAssocNum=1;}
00125     }
00126 
00127   }
00128 
00129   if(ShwAssocNum==2 && this->GetEntries()<3 && clust->GetEntries()<2) {ShwAssocNum=1;}
00130  
00131   return ShwAssocNum;
00132 }

int ClusterCam::IsTrkAssoc ( ClusterCam clustm,
ClusterCam clustp,
int  PlaneGap = 0 
) const

Definition at line 138 of file ClusterCam.cxx.

References fBegTime, fBegTPos, fEndTime, fEndTPos, fPlane, GetBegTime(), GetBegTPos(), GetEndTime(), GetEndTPos(), GetNDFlag(), GetPlane(), max, min, and StripWidth.

Referenced by AlgTrackCamList::Form3DTracks().

00139 {
00140   double TimeWindow = 99.9; int TrkAssocNum = 0;
00141   double min=0.2; double max=0.8;
00142   double NDScale=1;
00143 
00144 
00145   // Configure for correct detector instrumentation
00146   if(PlaneGap==0) {
00147     if(this->GetNDFlag()==2) {PlaneGap=10;}
00148     else {PlaneGap=2;}
00149   }
00150 
00151   if(PlaneGap==10) {NDScale=2;}
00152 
00153 
00154 
00155   // Check timing proximity
00156   if(( (fEndTime-clustm->GetBegTime())>-TimeWindow && (clustm->GetEndTime()-fBegTime)>-TimeWindow)
00157      && ( (fEndTime-clustp->GetBegTime())>-TimeWindow && (clustp->GetEndTime()-fBegTime)>-TimeWindow) ) {
00158 
00159 
00160     // If more than two planes away, scale back width of cluster
00161     // and then treat as if only two planes away
00163     double mBegTPos=clustm->GetBegTPos();
00164     double mEndTPos=clustm->GetEndTPos();
00165     
00166     if((fPlane-clustm->GetPlane())>PlaneGap) {
00167       double mScale = double(PlaneGap)/double(fPlane-clustm->GetPlane());
00168     
00169       mBegTPos=fBegTPos+mScale*(mBegTPos-fBegTPos);
00170       mEndTPos=fEndTPos+mScale*(mEndTPos-fEndTPos);
00171     }
00172     
00173     double pBegTPos=clustp->GetBegTPos();
00174     double pEndTPos=clustp->GetEndTPos();
00175     
00176     if((clustp->GetPlane()-fPlane)>PlaneGap) {
00177       double pScale = double(PlaneGap)/double(clustp->GetPlane()-fPlane);
00178       
00179       pBegTPos=fBegTPos+pScale*(pBegTPos-fBegTPos);
00180       pEndTPos=fEndTPos+pScale*(pEndTPos-fEndTPos);
00181     } 
00183     
00184     
00185     // Scale tolerance for matching clusters for cases where there are gaps
00186     double k0 = 0.5*(clustp->GetPlane()-clustm->GetPlane()-(2*PlaneGap));
00187     // Make sure we do the same thing for the ND +/- 10 plane sections
00188     if(PlaneGap==10) {k0/=5;}
00189 
00190     min = min + 0.1*k0; 
00191     max = max - 0.1*k0; 
00192         
00193 
00194     // Determine associations
00196     // For tracks with +ve dtpos/dz
00197     if( (fEndTPos-clustm->GetBegTPos())>-(NDScale*1.1*StripWidth) && (clustp->GetEndTPos()-fBegTPos)>-(NDScale*1.1*StripWidth) ) {
00198 
00199       // Clusters don't overlap
00200       if( (fBegTPos-clustm->GetEndTPos())>-(NDScale*0.1*StripWidth) || (clustp->GetBegTPos()-fEndTPos)>-(NDScale*0.1*StripWidth) ) {
00201         if( abs( (clustp->GetBegTPos()-fEndTPos)-(fBegTPos-clustm->GetEndTPos()) )<(NDScale*2.1*StripWidth)
00202             || ( ((min*mEndTPos)+(max*pEndTPos))>(fBegTPos-(NDScale*0.5*StripWidth)) && ((max*mBegTPos)+(min*pBegTPos))<(fEndTPos+(NDScale*0.5*StripWidth)) ) )
00203           {TrkAssocNum=2;} 
00204       }
00205       
00206       // Overlapping clusters
00207       if( (clustm->GetEndTPos()-fBegTPos)>-(NDScale*1.1*StripWidth) && (fEndTPos-clustp->GetBegTPos())>-(NDScale*1.1*StripWidth) ) {
00208         if(TrkAssocNum<1) TrkAssocNum=1;
00209       }
00210     }
00211     
00212     
00213     // For tracks with -ve dtpos/dz
00214     if( (fBegTPos-clustm->GetEndTPos())<(NDScale*1.1*StripWidth) && (clustp->GetBegTPos()-fEndTPos)<(NDScale*1.1*StripWidth) ) {
00215       
00216       // Clusters don't overlap
00217       if( (fEndTPos-clustm->GetBegTPos())<(NDScale*0.1*StripWidth) || (clustp->GetEndTPos()-fBegTPos)<(NDScale*0.1*StripWidth) ) {
00218         if( abs( (clustp->GetEndTPos()-fBegTPos)-(fEndTPos-clustm->GetBegTPos()) )<(NDScale*2.1*StripWidth)
00219             || ( ((min*pEndTPos)+(max*mEndTPos))>(fBegTPos-(NDScale*0.5*StripWidth)) && ((max*pBegTPos)+(min*mBegTPos))<(fEndTPos+(NDScale*0.5*StripWidth)) ) )
00220           {TrkAssocNum=2;}
00221       }
00222       
00223       // Overlapping clusters
00224       if( (clustm->GetBegTPos()-fEndTPos)<(NDScale*1.1*StripWidth) && (fBegTPos-clustp->GetEndTPos())<(NDScale*1.1*StripWidth) ) {
00225         if(TrkAssocNum<1) TrkAssocNum=1;
00226       }
00227     }
00229     
00230   }
00231   
00232   return TrkAssocNum;
00233 }

void ClusterCam::SetNDFlag ( int  flag  )  [inline]

Definition at line 56 of file ClusterCam.h.

References fNDFlag.

Referenced by AlgTrackCamList::FirstUVComparison(), and AlgTrackCamList::NearDetectorTriplets().

00056 {fNDFlag=flag;};

void ClusterCam::SetShwFlag ( int  flag  )  [inline]

Definition at line 52 of file ClusterCam.h.

References fShwFlag.

00052 {fShwFlag=flag;};

void ClusterCam::SetShwPlnFlag ( int  flag  )  [inline]

Definition at line 54 of file ClusterCam.h.

References fShwPlnFlag.

Referenced by AlgTrackCamList::IDTrkAndShwClusters().

00054 {fShwPlnFlag=flag;};

void ClusterCam::SetTrkFlag ( int  flag  )  [inline]

Definition at line 51 of file ClusterCam.h.

References fTrkFlag.

Referenced by AlgTrackCamList::Form2DTracks(), and AlgTrackCamList::SecondUVComparison().

00051 {fTrkFlag=flag;};

void ClusterCam::SetTrkPlnFlag ( int  flag  )  [inline]

Definition at line 53 of file ClusterCam.h.

References fTrkPlnFlag.

Referenced by AlgTrackCamList::IDTrkAndShwClusters().

00053 {fTrkPlnFlag=flag;};


Member Data Documentation

Definition at line 60 of file ClusterCam.h.

Referenced by AddHit(), and GetBegStrip().

Definition at line 62 of file ClusterCam.h.

Referenced by AddHit(), GetBegTime(), IsHitAssoc(), IsShwAssoc(), and IsTrkAssoc().

Definition at line 64 of file ClusterCam.h.

Referenced by AddHit(), GetBegTPos(), IsHitAssoc(), IsShwAssoc(), and IsTrkAssoc().

Definition at line 68 of file ClusterCam.h.

Referenced by AddHit(), and GetCharge().

Definition at line 74 of file ClusterCam.h.

Referenced by AddHit(), and GetDigits().

Definition at line 61 of file ClusterCam.h.

Referenced by AddHit(), and GetEndStrip().

Definition at line 63 of file ClusterCam.h.

Referenced by AddHit(), GetEndTime(), IsHitAssoc(), IsShwAssoc(), and IsTrkAssoc().

Definition at line 65 of file ClusterCam.h.

Referenced by AddHit(), GetEndTPos(), IsHitAssoc(), IsShwAssoc(), and IsTrkAssoc().

Definition at line 75 of file ClusterCam.h.

Referenced by GetNDFlag(), and SetNDFlag().

Definition at line 57 of file ClusterCam.h.

Referenced by AddHit(), GetPlane(), IsHitAssoc(), IsShwAssoc(), and IsTrkAssoc().

Definition at line 73 of file ClusterCam.h.

Referenced by AddHit(), and GetPlaneView().

Definition at line 70 of file ClusterCam.h.

Referenced by GetShwFlag(), and SetShwFlag().

Definition at line 72 of file ClusterCam.h.

Referenced by GetShwPlnFlag(), and SetShwPlnFlag().

Definition at line 67 of file ClusterCam.h.

Referenced by AddHit(), and GetTPos().

Definition at line 69 of file ClusterCam.h.

Referenced by GetTrkFlag(), and SetTrkFlag().

Definition at line 71 of file ClusterCam.h.

Referenced by GetTrkPlnFlag(), and SetTrkPlnFlag().

Definition at line 66 of file ClusterCam.h.

Referenced by AddHit(), and GetZPos().

vector<HitCam*> ClusterCam::HitsInCluster [private]

Definition at line 78 of file ClusterCam.h.

Referenced by AddHit(), ContainsHit(), GetEntries(), GetHit(), and ~ClusterCam().

const double ClusterCam::StripWidth [private]

Definition at line 80 of file ClusterCam.h.

Referenced by IsHitAssoc(), IsShwAssoc(), and IsTrkAssoc().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1