VtxCluster Class Reference

#include <VtxCluster.h>

List of all members.

Public Member Functions

 VtxCluster ()
 VtxCluster (Int_t plane, Float_t energy_in_pe)
 VtxCluster (const VtxCluster &input)
 ~VtxCluster ()
Int_t Size () const
Int_t GetPlane (Int_t i) const
Int_t GetFirstPlane () const
Int_t GetLastPlane () const
Float_t GetTotalEnergy () const
Float_t GetEnergy (Int_t i) const
Int_t GetEdgeTrigger ()
Int_t GetNCTrigger ()
bool HasRisingEdge ()
Int_t DetermineNCTrigger ()
void AddPlane (Int_t plane, Float_t pes)

Private Attributes

vector< Int_t > fplanes
vector< Float_t > fenergy
Int_t fEdgeTrigger
Int_t fNCTrigger

Detailed Description

Definition at line 25 of file VtxCluster.h.


Constructor & Destructor Documentation

VtxCluster::VtxCluster (  ) 

Definition at line 20 of file VtxCluster.cxx.

References fEdgeTrigger, fenergy, fNCTrigger, and fplanes.

00021 {
00022   fEdgeTrigger = 0;
00023   fNCTrigger = 0;
00024   fplanes.clear();
00025   fenergy.clear();
00026 }

VtxCluster::VtxCluster ( Int_t  plane,
Float_t  energy_in_pe 
)

Definition at line 28 of file VtxCluster.cxx.

References AddPlane(), fEdgeTrigger, fenergy, fNCTrigger, and fplanes.

00029 {
00030   fEdgeTrigger = 0;
00031   fNCTrigger = 0;
00032   fplanes.clear();
00033   fenergy.clear();
00034   AddPlane(plane, energy_in_pe);
00035 }

VtxCluster::VtxCluster ( const VtxCluster input  ) 

Definition at line 37 of file VtxCluster.cxx.

References AddPlane(), fEdgeTrigger, fenergy, fNCTrigger, fplanes, GetEnergy(), GetPlane(), and Size().

00038 {
00039   fEdgeTrigger = input.fEdgeTrigger;
00040   fNCTrigger = input.fNCTrigger;
00041   fplanes.clear();
00042   fenergy.clear();
00043 
00044   Int_t tempPlane;
00045   Float_t tempE;  
00046 
00047   for(int i = 0; i < input.Size(); i++)
00048   { 
00049      tempPlane = input.GetPlane(i);
00050      tempE = input.GetEnergy(i);
00051 
00052      AddPlane(tempPlane,tempE);
00053   }
00054 
00055 }

VtxCluster::~VtxCluster (  ) 

Definition at line 59 of file VtxCluster.cxx.

References fenergy, and fplanes.

00060 {
00061   //Clear the member lists
00062   fplanes.clear();
00063   fenergy.clear();
00064 }


Member Function Documentation

void VtxCluster::AddPlane ( Int_t  plane,
Float_t  pes 
)

Definition at line 98 of file VtxCluster.cxx.

References fenergy, and fplanes.

Referenced by VtxCluster().

00099 {
00100   fplanes.push_back(plane);
00101   fenergy.push_back(pes);
00102 }

Int_t VtxCluster::DetermineNCTrigger (  ) 

Definition at line 205 of file VtxCluster.cxx.

References fenergy, fNCTrigger, fplanes, and Size().

Referenced by HasRisingEdge().

00206 {
00207   Int_t i = 0;
00208   while(i < Size() && fenergy[i] < 5) i++;
00209   fNCTrigger = TMath::Min(i, Size()-1);
00210 
00211 for(Int_t j = TMath::Max(i,1) ; j < Size() -1; j++){
00212     if(fplanes[j]-fplanes[j-1] != 1 && fenergy[j] > 4*fenergy[fNCTrigger])
00213      fNCTrigger = j;
00214   }
00215 
00216   return fNCTrigger;
00217 }

Int_t VtxCluster::GetEdgeTrigger (  )  [inline]

Definition at line 43 of file VtxCluster.h.

References fEdgeTrigger.

00043 {return fEdgeTrigger;};

Float_t VtxCluster::GetEnergy ( Int_t  i  )  const

Definition at line 66 of file VtxCluster.cxx.

References fenergy, and Size().

Referenced by VtxCluster().

00067 {
00068   if(i < 0 || i >= Size()){ cerr<<"Array out of bounds"<<endl; return 1;}
00069   return fenergy[i];
00070 }

Int_t VtxCluster::GetFirstPlane (  )  const

Definition at line 86 of file VtxCluster.cxx.

References fplanes, and Size().

00087 {
00088   if(Size() == 0) return -1;
00089   return fplanes[0];
00090 }

Int_t VtxCluster::GetLastPlane (  )  const

Definition at line 92 of file VtxCluster.cxx.

References fplanes, and Size().

00093 {
00094   if(Size() == 0) return -1;
00095   return fplanes[Size()-1];
00096 }

Int_t VtxCluster::GetNCTrigger (  )  [inline]

Definition at line 44 of file VtxCluster.h.

References fNCTrigger.

00044 {return fNCTrigger;};

Int_t VtxCluster::GetPlane ( Int_t  i  )  const

Definition at line 72 of file VtxCluster.cxx.

References fplanes, and Size().

Referenced by VtxCluster().

00073 {
00074   if(i < 0 || i >= Size()){ cerr<<"Array out of bounds"<<endl; return 1;}
00075   return fplanes[i];
00076 }

Float_t VtxCluster::GetTotalEnergy (  )  const

Definition at line 78 of file VtxCluster.cxx.

References fenergy, Size(), and total().

Referenced by HasRisingEdge().

00079 {
00080   Float_t total = 0;
00081   for(Int_t i = 0; i < Size(); i++) total += fenergy[i];
00082  
00083   return total;
00084 }

bool VtxCluster::HasRisingEdge (  ) 

Definition at line 111 of file VtxCluster.cxx.

References DetermineNCTrigger(), done(), fEdgeTrigger, fenergy, fNCTrigger, fplanes, GetTotalEnergy(), Msg::kDebug, MSG, and Size().

00112 {
00113 //Look for two cases -> starting rising edge 
00114 // some initial activity at < 5 pe and then a rising edge
00115   
00116   if(Size() < 2) return false;
00117 
00118   bool done = false;
00119   bool rising = false;
00120   Int_t candidate = -1;
00121   Float_t subTotal = 0;
00122   Float_t runningTotal = 0;
00123   bool rescind = false;
00124 
00125   Float_t energyCutOne = 4.0;
00126 
00127 
00128 
00129   for(Int_t i = 0; i < Size()-1 && !done; i++)
00130   {
00131     rising = false;
00132     rescind = false;
00133     if(fenergy[i] > energyCutOne)
00134     {
00135       runningTotal += fenergy[i];
00136 
00137       if(runningTotal > GetTotalEnergy()/3){
00138          MSG("VtxCluster",Msg::kDebug)<<"(HRE): More than 1/3 of energy "
00139               <<"passed, stopping"<<endl;
00140          i = Size();
00141          continue;
00142       }
00143 
00144       if(fenergy[i+1] > TMath::Max(fenergy[i]*1.05, fenergy[i] + 2.0)
00145               && fplanes[i+1] == fplanes[i]+1){
00146          //Then we have two rising planes
00147          rising = true;
00148 
00149          if(i < Size()-3)
00150          if(fenergy[i]+fenergy[i+1]+fenergy[i+2] < 0.5*runningTotal)
00151          {
00152             rescind = true;
00153          }
00154 
00155         if(Size() >= 12 && i > static_cast<Float_t>(Size())/2.2 
00156                         && runningTotal > GetTotalEnergy()/3){
00157            done = false;
00158            i = Size();
00159            continue;
00160         }
00161 
00162        if(!rescind){
00163         if(candidate != -1){ //what is the proper rising edge?
00164            Float_t oldTotal = 0;
00165            for(Int_t j = candidate; j < TMath::Min(candidate+4, Size()-1); j++)
00166               oldTotal += fenergy[j];
00167            Float_t newTotal = 0;
00168            for(Int_t j = i; j < TMath::Min(i+4, Size()-1); j++)
00169               newTotal += fenergy[j];
00170            if(newTotal > oldTotal) candidate = i;
00171          }else
00172             candidate = i;
00173          
00174          if(Size()-i > 4){
00175            subTotal = 0;
00176            for(Int_t j = i; j < i+4; j++) subTotal += fenergy[j];
00177            if(subTotal/4 > 1.5*GetTotalEnergy()/Size()){
00178            //Then I am satisfied that this is the beginning of
00179            //    something at least locally
00180               done = true;
00181               fEdgeTrigger = candidate = i;
00182            }
00183          }
00184         }
00185       }
00186       Int_t temp = i;
00187       if((rising))
00188       while(i < Size()-1 && fplanes[i+1] == fplanes[i]+1 && fenergy[i] > 10)
00189          { i++; runningTotal += fenergy[i]; }
00190       i = TMath::Max(temp, i--);
00191       if( i != temp) runningTotal -= fenergy[TMath::Min(i++, Size()-1)];
00192     } 
00193   }
00194  
00195   if(candidate != -1 && done == false) {
00196           fEdgeTrigger = candidate; 
00197           done = true;
00198   }
00199 
00200   fNCTrigger = DetermineNCTrigger();
00201 
00202   return done;
00203 }

Int_t VtxCluster::Size ( void   )  const

Definition at line 104 of file VtxCluster.cxx.

References fenergy, and fplanes.

Referenced by DetermineNCTrigger(), GetEnergy(), GetFirstPlane(), GetLastPlane(), GetPlane(), GetTotalEnergy(), HasRisingEdge(), and VtxCluster().

00105 {
00106    if(fplanes.size() != fenergy.size()) 
00107         cerr<<"Size: list length mismatch "<<fplanes.size()<<"  "<<fenergy.size()<<endl;
00108    return fplanes.size();
00109 }


Member Data Documentation

Int_t VtxCluster::fEdgeTrigger [private]

Definition at line 54 of file VtxCluster.h.

Referenced by GetEdgeTrigger(), HasRisingEdge(), and VtxCluster().

vector<Float_t> VtxCluster::fenergy [private]
Int_t VtxCluster::fNCTrigger [private]

Definition at line 55 of file VtxCluster.h.

Referenced by DetermineNCTrigger(), GetNCTrigger(), HasRisingEdge(), and VtxCluster().

vector<Int_t> VtxCluster::fplanes [private]

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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1