ClusterCamAtNu Class Reference

#include <ClusterCamAtNu.h>

List of all members.

Public Member Functions

 ClusterCamAtNu (HitCamAtNu *hit)
virtual ~ClusterCamAtNu ()
void AddHit (HitCamAtNu *hit)
bool ContainsHit (HitCamAtNu *hit)
int IsHitAssoc (HitCamAtNu *hit) const
int IsShwAssoc (ClusterCamAtNu *clust) const
int IsTrkAssoc (ClusterCamAtNu *clustm, ClusterCamAtNu *clustp, int PlaneGap=0) const
int IsDiffuseShwAssoc (ClusterCamAtNu *clr) const
unsigned int GetEntries () const
HitCamAtNuGetHit (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< HitCamAtNu * > HitsInCluster
const double StripWidth

Detailed Description

Definition at line 17 of file ClusterCamAtNu.h.


Constructor & Destructor Documentation

ClusterCamAtNu::ClusterCamAtNu ( HitCamAtNu hit  ) 

Definition at line 19 of file ClusterCamAtNu.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 }

ClusterCamAtNu::~ClusterCamAtNu (  )  [virtual]

Definition at line 35 of file ClusterCamAtNu.cxx.

References HitsInCluster.

00036 {
00037   HitsInCluster.clear();
00038 }


Member Function Documentation

void ClusterCamAtNu::AddHit ( HitCamAtNu hit  ) 

Definition at line 43 of file ClusterCamAtNu.cxx.

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

Referenced by AlgAtmosShowerList::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 ClusterCamAtNu::ContainsHit ( HitCamAtNu hit  ) 

Definition at line 81 of file ClusterCamAtNu.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 ClusterCamAtNu::GetBegStrip (  )  const [inline]

Definition at line 36 of file ClusterCamAtNu.h.

References fBegStrip.

Referenced by IsDiffuseShwAssoc().

00036 {return fBegStrip;}

double ClusterCamAtNu::GetBegTime (  )  const [inline]
double ClusterCamAtNu::GetBegTPos (  )  const [inline]

Definition at line 45 of file ClusterCamAtNu.h.

References fBegTPos.

Referenced by TrackSegmentCamAtNu::IsAssoc(), IsShwAssoc(), and IsTrkAssoc().

00045 {return fBegTPos;}

double ClusterCamAtNu::GetCharge (  )  [inline]

Definition at line 42 of file ClusterCamAtNu.h.

References fCharge.

Referenced by AlgAtmosShowerList::IDTrkAndShwClusters(), and AlgAtmosShowerList::MatchShowers().

00042 {return fCharge;}

int ClusterCamAtNu::GetDigits (  )  const [inline]

Definition at line 33 of file ClusterCamAtNu.h.

References fDigits.

00033 { return fDigits; }

int ClusterCamAtNu::GetEndStrip (  )  const [inline]

Definition at line 37 of file ClusterCamAtNu.h.

References fEndStrip.

Referenced by IsDiffuseShwAssoc().

00037 {return fEndStrip;}

double ClusterCamAtNu::GetEndTime (  )  const [inline]
double ClusterCamAtNu::GetEndTPos (  )  const [inline]

Definition at line 46 of file ClusterCamAtNu.h.

References fEndTPos.

Referenced by TrackSegmentCamAtNu::IsAssoc(), IsShwAssoc(), and IsTrkAssoc().

00046 {return fEndTPos;}

unsigned int ClusterCamAtNu::GetEntries (  )  const [inline]
HitCamAtNu * ClusterCamAtNu::GetHit ( unsigned int  i  )  const

Definition at line 238 of file ClusterCamAtNu.cxx.

References HitsInCluster.

Referenced by AlgAtmosShowerList::Form3DShowers(), and TrackSegmentCamAtNu::GetScore().

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

int ClusterCamAtNu::GetNDFlag (  )  const [inline]

Definition at line 59 of file ClusterCamAtNu.h.

References fNDFlag.

Referenced by IsTrkAssoc().

00059 {return fNDFlag;}

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

Definition at line 38 of file ClusterCamAtNu.h.

References fPlaneView.

Referenced by AlgAtmosShowerList::MatchShowers().

00038 {return fPlaneView;}

int ClusterCamAtNu::GetShwFlag (  )  const [inline]
int ClusterCamAtNu::GetShwPlnFlag (  )  const [inline]
double ClusterCamAtNu::GetTPos (  )  [inline]

Definition at line 41 of file ClusterCamAtNu.h.

References fTPos.

00041 {return fTPos;}

int ClusterCamAtNu::GetTrkFlag (  )  const [inline]

Definition at line 48 of file ClusterCamAtNu.h.

References fTrkFlag.

Referenced by AlgAtmosShowerList::DetermineShowerLikeShowerSegments(), and AlgAtmosShowerList::Form2DShowers().

00048 {return fTrkFlag;}

int ClusterCamAtNu::GetTrkPlnFlag (  )  const [inline]

Definition at line 50 of file ClusterCamAtNu.h.

References fTrkPlnFlag.

Referenced by AlgAtmosShowerList::FindShowerLikeSegments(), and AlgAtmosShowerList::Form2DShowers().

00050 {return fTrkPlnFlag;}

double ClusterCamAtNu::GetZPos (  )  [inline]

Definition at line 40 of file ClusterCamAtNu.h.

References fZPos.

Referenced by TrackSegmentCamAtNu::AddCluster(), and ShowerSegmentCamAtNu::AddCluster().

00040 {return fZPos;}

int ClusterCamAtNu::IsDiffuseShwAssoc ( ClusterCamAtNu clr  )  const

Definition at line 247 of file ClusterCamAtNu.cxx.

References fBegStrip, fBegTime, fEndStrip, fEndTime, fPlane, GetBegStrip(), GetBegTime(), GetEndStrip(), GetEndTime(), GetPlane(), and win.

00248 {
00249   double win = 99.9;
00250   int assoc = 0;
00251   if(fEndTime-clr->GetBegTime()>-win || clr->GetEndTime()-fBegTime>-win){
00252     if( clr->GetPlane()-fPlane<9 && clr->GetPlane()-fPlane>-9 && clr->GetEndStrip()-fBegStrip>-21 && fEndStrip-clr->GetBegStrip()>-21 )
00253       {
00254         if( ( clr->GetPlane()-fPlane<5 && clr->GetPlane()-fPlane>-5 && clr->GetEndStrip()-fBegStrip>-11 && fEndStrip-clr->GetBegStrip()>-11 ) ) assoc=2;
00255         else assoc=1;
00256       }
00257   }
00258   return assoc;
00259 }

int ClusterCamAtNu::IsHitAssoc ( HitCamAtNu hit  )  const

Definition at line 93 of file ClusterCamAtNu.cxx.

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

Referenced by AlgAtmosShowerList::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 ClusterCamAtNu::IsShwAssoc ( ClusterCamAtNu clust  )  const

Definition at line 107 of file ClusterCamAtNu.cxx.

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

Referenced by AlgAtmosShowerList::IDTrkAndShwClusters(), and ShowerSegmentCamAtNu::IsShwLikeAssoc().

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 ClusterCamAtNu::IsTrkAssoc ( ClusterCamAtNu clustm,
ClusterCamAtNu clustp,
int  PlaneGap = 0 
) const

Definition at line 138 of file ClusterCamAtNu.cxx.

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

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( TMath::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( TMath::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 ClusterCamAtNu::SetNDFlag ( int  flag  )  [inline]

Definition at line 58 of file ClusterCamAtNu.h.

References fNDFlag.

00058 {fNDFlag=flag;}

void ClusterCamAtNu::SetShwFlag ( int  flag  )  [inline]
void ClusterCamAtNu::SetShwPlnFlag ( int  flag  )  [inline]

Definition at line 56 of file ClusterCamAtNu.h.

References fShwPlnFlag.

Referenced by AlgAtmosShowerList::IDTrkAndShwClusters().

00056 {fShwPlnFlag=flag;}

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

Definition at line 53 of file ClusterCamAtNu.h.

References fTrkFlag.

00053 {fTrkFlag=flag;}

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

Definition at line 55 of file ClusterCamAtNu.h.

References fTrkPlnFlag.

Referenced by AlgAtmosShowerList::IDTrkAndShwClusters().

00055 {fTrkPlnFlag=flag;}


Member Data Documentation

Definition at line 62 of file ClusterCamAtNu.h.

Referenced by AddHit(), GetBegStrip(), and IsDiffuseShwAssoc().

Definition at line 66 of file ClusterCamAtNu.h.

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

Definition at line 70 of file ClusterCamAtNu.h.

Referenced by AddHit(), and GetCharge().

Definition at line 76 of file ClusterCamAtNu.h.

Referenced by AddHit(), and GetDigits().

Definition at line 63 of file ClusterCamAtNu.h.

Referenced by AddHit(), GetEndStrip(), and IsDiffuseShwAssoc().

Definition at line 67 of file ClusterCamAtNu.h.

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

Definition at line 77 of file ClusterCamAtNu.h.

Referenced by GetNDFlag(), and SetNDFlag().

Definition at line 61 of file ClusterCamAtNu.h.

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

Definition at line 75 of file ClusterCamAtNu.h.

Referenced by AddHit(), and GetPlaneView().

Definition at line 72 of file ClusterCamAtNu.h.

Referenced by GetShwFlag(), and SetShwFlag().

Definition at line 74 of file ClusterCamAtNu.h.

Referenced by GetShwPlnFlag(), and SetShwPlnFlag().

Definition at line 69 of file ClusterCamAtNu.h.

Referenced by AddHit(), and GetTPos().

Definition at line 71 of file ClusterCamAtNu.h.

Referenced by GetTrkFlag(), and SetTrkFlag().

Definition at line 73 of file ClusterCamAtNu.h.

Referenced by GetTrkPlnFlag(), and SetTrkPlnFlag().

Definition at line 68 of file ClusterCamAtNu.h.

Referenced by AddHit(), and GetZPos().

Definition at line 80 of file ClusterCamAtNu.h.

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

const double ClusterCamAtNu::StripWidth [private]

Definition at line 82 of file ClusterCamAtNu.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