VtxClusterList Class Reference

#include <VtxClusterList.h>

List of all members.

Public Member Functions

 VtxClusterList (vector< Float_t > &lenepl, Int_t N_PLANES, Float_t kNoiseCut)
 ~VtxClusterList ()
void Report ()
Int_t RisingEdgeCandidate ()
Int_t Process ()
Float_t GetTotalEventEnergy ()
Int_t Size ()
Int_t Size (int i)
void Clear ()

Private Attributes

vector< VtxClusterlist

Detailed Description

Definition at line 23 of file VtxClusterList.h.


Constructor & Destructor Documentation

VtxClusterList::VtxClusterList ( vector< Float_t > &  lenepl,
Int_t  N_PLANES,
Float_t  kNoiseCut 
)

Definition at line 32 of file VtxClusterList.cxx.

References Msg::kError, list, MSG, and Size().

00033 {
00034   bool inGroup = false;
00035   Float_t binEnergy = 0;
00036   Float_t prevBinEnergy = -1;
00037 
00038   for(Int_t plane = 0; plane < N_PLANES; plane++)
00039   {
00040      binEnergy = lenepl[plane];
00041      if(binEnergy > kNoiseCut)
00042      {
00043         if(inGroup){
00044            list[TMath::Max(Size()-1, 0)].AddPlane(plane, binEnergy);
00045         }else{
00046             inGroup = true;
00047             VtxCluster newCluster(plane, binEnergy);
00048             list.push_back(newCluster);
00049         }
00050      }else{
00051         if(inGroup && prevBinEnergy < kNoiseCut) inGroup = false;
00052      }
00053        
00054      prevBinEnergy = binEnergy;
00055   }
00056 
00057   if(Size() == 0){
00058     MSG("VtxClusterList", Msg::kError)
00059           <<"No Clusters could be formed"<<endl;
00060   
00061     for(int i = 0; i < N_PLANES; i++)
00062     {
00063        MSG("VtxClusterList", Msg::kError)
00064            <<"Plane "<<i<<" of "<<N_PLANES<<": "<<lenepl[i]<<endl;
00065     }
00066   }
00067 
00068 }

VtxClusterList::~VtxClusterList (  ) 

Definition at line 70 of file VtxClusterList.cxx.

References Clear().

00071 {
00072   Clear();
00073 }


Member Function Documentation

void VtxClusterList::Clear ( void   )  [inline]

Definition at line 37 of file VtxClusterList.h.

Referenced by NtpVtxFinder::FindVtxPlane(), VertexFinder::FindVtxPlane(), and ~VtxClusterList().

00037 { list.clear(); };

Float_t VtxClusterList::GetTotalEventEnergy (  ) 

Definition at line 24 of file VtxClusterList.cxx.

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

Referenced by Process(), and RisingEdgeCandidate().

00025 {
00026   Float_t total = 0;
00027   for(Int_t i = 0; i < Size(); i++) total += list[i].GetTotalEnergy();
00028 
00029   return total;
00030 }

Int_t VtxClusterList::Process (  ) 

Definition at line 123 of file VtxClusterList.cxx.

References VHS::GetPlane(), GetTotalEventEnergy(), list, RisingEdgeCandidate(), and Size().

Referenced by NtpVtxFinder::FindVtxPlane(), and VertexFinder::FindVtxPlane().

00124 {
00125    if(Size() == 0) return -1;
00126 
00127    bool debug = false;
00128    Int_t maxGroupSize = 0;
00129    Int_t candidate = -1;
00130    Int_t candPlane = -1;
00131    Int_t startGuess = -1;
00132    for(Int_t i = 0; i < Size(); i++)
00133      maxGroupSize = TMath::Max(maxGroupSize, list[i].Size());
00134 
00135    candidate = RisingEdgeCandidate();
00136    
00137    if(debug) cout<<candidate<<endl;
00138      
00139    if(candidate != -1){
00140      startGuess = list[candidate].GetEdgeTrigger();
00141    }else {
00142      candidate = 0;
00143      for(Int_t i = 0; i < Size(); i++)
00144      {
00145         Float_t recent = list[i].GetEnergy(list[i].GetNCTrigger());
00146         Float_t old = list[candidate].GetEnergy(list[candidate].GetNCTrigger());
00147         if(debug) cout<<old<<"    "<<recent<<"    "<<endl;        
00148    
00149         Float_t subTotal = 0;
00150         for(Int_t j = 0; j < i; j++)
00151            subTotal += list[j].GetTotalEnergy();
00152 
00153         //We cant have  70% of the energy backscattered
00154         if(recent > 2*old && subTotal/GetTotalEventEnergy() < 0.5)
00155            candidate = i;
00156      }
00157      startGuess = list[candidate].GetNCTrigger();
00158    }
00159  
00160    if(debug) cout<<"start  "<<startGuess<<endl;
00161 
00162    if(startGuess > 0)
00163    {
00164      candPlane = list[candidate].GetPlane(startGuess);
00165     if(list[candidate].Size() > 3) {
00166      //If there is a blip then the rising edges, ignore that repeat as necessary
00167      //     rewinding
00168      Int_t i = startGuess;
00169      if(i > 0)
00170      {
00171         if(i > 0 && list[candidate].GetPlane(i)-list[candidate].GetPlane(i-1) == 1
00172                  && list[candidate].GetEnergy(i) > list[candidate].GetEnergy(i-1))
00173                 i--;
00174 
00175         candPlane = list[candidate].GetPlane(i);
00176      }
00177     }
00178    }else
00179       candPlane = list[candidate].GetFirstPlane();
00180  
00181    if(debug) cout<<candidate<<"  "<<candPlane<<endl;
00182    if(candPlane == -1) candPlane = list[candidate].GetFirstPlane();
00183    if(debug) cout<<candidate<<"  "<<candPlane<<endl;
00184    return candPlane;
00185 }

void VtxClusterList::Report (  ) 

Definition at line 75 of file VtxClusterList.cxx.

References VHS::GetPlane(), list, and Size().

00076 {
00077   for(Int_t i = 0; i < Size(); i++){
00078     cout<<i<<"   "<<list[i].Size()<<"  "<<list[i].GetFirstPlane()
00079         <<"    "<<list[i].GetLastPlane()<<endl;
00080     for(Int_t j = 0; j < list[i].Size(); j++)
00081         cout<<j<<"  "<<list[i].GetPlane(j)<<"  "<<list[i].GetEnergy(j)<<endl;
00082   }
00083 }

Int_t VtxClusterList::RisingEdgeCandidate (  ) 

Definition at line 85 of file VtxClusterList.cxx.

References GetTotalEventEnergy(), list, and Size().

Referenced by Process().

00086 {
00087    //First go and check for strong rising edges
00088    Int_t candidate = -1;
00089    bool found = false;
00090  
00091    for(Int_t i = 0; i < Size() && !found; i++)
00092    {
00093       if(list[i].HasRisingEdge())
00094       {
00095          if(list[i].Size() > 15 || list[i].GetTotalEnergy() > 200)//i0.5*GetTotalEventEnergy())
00096          {
00097            candidate = i;
00098            found = true;
00099          }
00100 
00101          Float_t subTotal = 0;
00102          for(Int_t j = 0; j < i; j++)
00103               subTotal += list[j].GetTotalEnergy();
00104  
00105          if(subTotal/GetTotalEventEnergy() > 0.5){
00106              candidate = -1;
00107              found = true;  //What i have found though is this isnt
00108                             //   meant to be a rising edge system
00109              continue;
00110          }
00111          if(candidate == -1) candidate = i;
00112          else{
00113            if(list[i].Size() > 4 && 
00114                list[i].GetTotalEnergy() > list[candidate].GetTotalEnergy())
00115               candidate = i;
00116          }
00117       }
00118    }
00119 
00120    return candidate;
00121 }

Int_t VtxClusterList::Size ( int  i  )  [inline]

Definition at line 36 of file VtxClusterList.h.

References list.

00036 {return list[i].Size();};

Int_t VtxClusterList::Size ( void   )  [inline]

Definition at line 35 of file VtxClusterList.h.

References list.

Referenced by GetTotalEventEnergy(), Process(), Report(), RisingEdgeCandidate(), and VtxClusterList().

00035 {return list.size();};


Member Data Documentation


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1