CMS 3D CMS Logo

SiStripThreeThresholdAlgo Class Reference

Author:
M.Wingham, D.Giordano, R.Bainbridge
More...

#include <CommonTools/SiStripClusterization/interface/SiStripThreeThresholdAlgo.h>

Inheritance diagram for SiStripThreeThresholdAlgo:

SiStripClusterizerAlgo

List of all members.

Public Member Functions

virtual void clusterize (const edm::DetSet< SiStripDigi > &, edm::DetSetVector< SiStripCluster > &)
 SiStripThreeThresholdAlgo (const edm::ParameterSet &)
virtual ~SiStripThreeThresholdAlgo ()

Private Member Functions

virtual void add (std::vector< SiStripCluster > &data, const uint32_t &id, const uint16_t &strip, const uint16_t &adc)
 Building of clusters on strip-by-strip basis.
void endCluster (std::vector< SiStripCluster > &, const uint32_t &)
virtual void endDet (std::vector< SiStripCluster > &, const uint32_t &)
void pad (const uint16_t &, const uint16_t &)
bool proximity (const uint16_t &) const
void strip (const uint16_t &, const uint16_t &, const double &, const double &)
bool threshold (const uint16_t &, const double &, const bool) const

Private Attributes

std::vector< uint16_t > amps_
double charge_
double clustThr_
std::vector< uint16_t > digis_
uint16_t first_
uint32_t maxHoles_
bool seed_
double seedThr_
double sigmanoise2_
uint16_t strip_
double stripThr_


Detailed Description

Author:
M.Wingham, D.Giordano, R.Bainbridge

Clusterizer algorithm

Definition at line 11 of file SiStripThreeThresholdAlgo.h.


Constructor & Destructor Documentation

SiStripThreeThresholdAlgo::SiStripThreeThresholdAlgo ( const edm::ParameterSet pset  ) 

Definition at line 8 of file SiStripThreeThresholdAlgo.cc.

References amps_, digis_, and LogTrace.

00008                                                                                   :
00009 
00010   SiStripClusterizerAlgo(pset),
00011   stripThr_(pset.getUntrackedParameter<double>("ChannelThreshold",2.)),
00012   seedThr_(pset.getUntrackedParameter<double>("SeedThreshold",3.)),
00013   clustThr_(pset.getUntrackedParameter<double>("ClusterThreshold",5.)),
00014   maxHoles_(pset.getUntrackedParameter<uint32_t>("MaxHolesInCluster",0)),
00015   charge_(0),
00016   seed_(false),
00017   sigmanoise2_(0.),
00018   strip_(0),
00019   first_(0),
00020   amps_(),
00021   digis_()
00022 
00023 {
00024   LogTrace("UNDEFINED_CATEGORY")
00025     << "[SiStripThreeThresholdAlgo::" << __func__ << "]";
00026   
00027   amps_.reserve(768);
00028   digis_.reserve(768);
00029 }

SiStripThreeThresholdAlgo::~SiStripThreeThresholdAlgo (  )  [virtual]

Definition at line 33 of file SiStripThreeThresholdAlgo.cc.

References LogTrace.

00033                                                       {
00034 
00035   LogTrace("UNDEFINED_CATEGORY")
00036     << "[SiStripThreeThresholdAlgo::" << __func__ << "]";
00037 }


Member Function Documentation

void SiStripThreeThresholdAlgo::add ( std::vector< SiStripCluster > &  data,
const uint32_t &  id,
const uint16_t &  strip,
const uint16_t &  adc 
) [private, virtual]

Building of clusters on strip-by-strip basis.

Reimplemented from SiStripClusterizerAlgo.

Definition at line 55 of file SiStripThreeThresholdAlgo.cc.

References digis_, endCluster(), SiStripClusterizerAlgo::gain(), SiStripNoises::getNoise(), SiStripThreshold::getRange(), SiStripGain::getStripGain(), SiStripQuality::IsStripBad(), SiStripClusterizerAlgo::noise(), proximity(), SiStripClusterizerAlgo::quality(), strip(), and threshold().

00055                                                                                                                                     {
00056  
00057   bool disable = quality()->IsStripBad(quality()->getRange(id),istrip);
00058   double stripnoise = noise()->getNoise(istrip,noise()->getRange(id));
00059   double stripgain = gain()->getStripGain(istrip,gain()->getRange(id));
00060   bool thresh = threshold(adc,stripnoise,disable);
00061   bool prox = proximity(istrip);
00062 
00063   //if strip dead and non zero record for later padding.
00064   if (adc && disable) digis_.push_back(istrip); 
00065   //if strip above threshold (and not dead) and within range of cluster, add strip.
00066   if (thresh && prox) {strip(istrip,adc,stripnoise,stripgain);}
00067   //if strip above threshold (and not dead) and beyond range of cluster, end cluster and add strip to new cluster.
00068   else if (thresh && !prox) {endCluster(data,id);strip(istrip,adc,stripnoise,stripgain);}
00069   //if strip below threshold (or dead) and beyond range of cluster, end cluster.
00070   else if (!thresh && !prox) {endCluster(data,id);}
00071   //if strip below threshold (or dead) and within range of cluster, continue. 
00072   //else {;} 
00073 
00074 }

void SiStripThreeThresholdAlgo::clusterize ( const edm::DetSet< SiStripDigi > &  digis,
edm::DetSetVector< SiStripCluster > &  clusters 
) [virtual]

Implements SiStripClusterizerAlgo.

Definition at line 41 of file SiStripThreeThresholdAlgo.cc.

References edm::DetSet< T >::begin(), edm::DetSet< T >::data, edm::DetSet< T >::end(), endDet(), edm::DetSetVector< T >::find_or_insert(), edm::DetSet< T >::id, LogTrace, and out.

00041                                                                                                                            {
00042 
00043   LogTrace("UNDEFINED_CATEGORY")
00044     << "[SiStripThreeThresholdAlgo::" << __func__ << "]";
00045 
00046   edm::DetSet<SiStripCluster>& out = clusters.find_or_insert(digis.id);
00047   edm::DetSet<SiStripDigi>::const_iterator idigi = digis.begin();
00048   for (; idigi != digis.end(); idigi++) {
00049     add(out.data,out.id,idigi->strip(),idigi->adc());}
00050   endDet(out.data,out.id);
00051 }

void SiStripThreeThresholdAlgo::endCluster ( std::vector< SiStripCluster > &  data,
const uint32_t &  id 
) [private]

Definition at line 115 of file SiStripThreeThresholdAlgo.cc.

References amps_, charge_, clustThr_, digis_, find(), first_, pad(), seed_, sigmanoise2_, funct::sqrt(), and strip_.

Referenced by add(), and endDet().

00115                                                                                               {
00116   if (seed_ && (charge_ >= sqrt(sigmanoise2_) * clustThr_)) {
00117     if (find(digis_.begin(),digis_.end(),first_ -1) != digis_.end()) pad(1,0);
00118     if (find(digis_.begin(),digis_.end(),strip_+1) != digis_.end()) pad(0,1);
00119     data.push_back(SiStripCluster(id, first_, amps_.begin(),amps_.end()));
00120   }
00121   charge_ = 0.; sigmanoise2_ = 0.; seed_ = false; amps_.clear();
00122 }

void SiStripThreeThresholdAlgo::endDet ( std::vector< SiStripCluster > &  data,
const uint32_t &  id 
) [private, virtual]

Reimplemented from SiStripClusterizerAlgo.

Definition at line 76 of file SiStripThreeThresholdAlgo.cc.

References digis_, and endCluster().

Referenced by clusterize().

00076                                                                                           {
00077   endCluster(data,id); digis_.clear();
00078 }

void SiStripThreeThresholdAlgo::pad ( const uint16_t &  left,
const uint16_t &  right 
) [private]

Definition at line 89 of file SiStripThreeThresholdAlgo.cc.

References amps_, first_, i, and k.

Referenced by endCluster(), and strip().

00089                                                                                {
00090   for (uint16_t i=0;i<left;i++) {amps_.insert(amps_.begin(),0);first_--;}
00091   for (uint16_t k=0;k<right;k++) {amps_.push_back(0);}
00092 }

bool SiStripThreeThresholdAlgo::proximity ( const uint16_t &  istrip  )  const [private]

Definition at line 80 of file SiStripThreeThresholdAlgo.cc.

References amps_, maxHoles_, and strip_.

Referenced by add().

00080                                                                       {
00081   if (amps_.empty()) return true;
00082   return (istrip <= maxHoles_+strip_+1); //loop to check they are dead?
00083 }

void SiStripThreeThresholdAlgo::strip ( const uint16_t &  istrip,
const uint16_t &  adc,
const double &  noise,
const double &  gain 
) [private]

Definition at line 94 of file SiStripThreeThresholdAlgo.cc.

References amps_, charge_, first_, pad(), seed_, seedThr_, sigmanoise2_, and strip_.

Referenced by add().

00094                                                                                                                           {
00095 
00096 
00097   if (adc >= noise*seedThr_) seed_ = true;
00098   if (amps_.empty()) first_ = istrip;
00099   else if (istrip - strip_ -1 > 0) {pad(0,istrip - strip_ -1);}
00100 
00101   //change by G. Bruno - 23/5/2008
00102   float stripCharge=(static_cast<float>(adc));
00103   if(stripCharge<254){
00104     stripCharge /= gain;              
00105     if(stripCharge>511.5){stripCharge=255;}
00106     else if(stripCharge>253.5){stripCharge=254;}
00107   }  
00108   amps_.push_back(static_cast<uint16_t>(stripCharge+0.5));
00109   strip_ = istrip;
00110   //  charge_+=static_cast<float>(adc)/gain; 
00111   charge_+=stripCharge; 
00112   sigmanoise2_+=noise*noise/(gain*gain);
00113 }

bool SiStripThreeThresholdAlgo::threshold ( const uint16_t &  adc,
const double &  noise,
const   bool 
) const [private]

Definition at line 85 of file SiStripThreeThresholdAlgo.cc.

References stripThr_.

Referenced by add().

00085                                                                                                             {  
00086   return (!disable && (adc >= static_cast<uint32_t>(noise * stripThr_)));
00087 }


Member Data Documentation

std::vector<uint16_t> SiStripThreeThresholdAlgo::amps_ [private]

Definition at line 55 of file SiStripThreeThresholdAlgo.h.

Referenced by endCluster(), pad(), proximity(), SiStripThreeThresholdAlgo(), and strip().

double SiStripThreeThresholdAlgo::charge_ [private]

Definition at line 46 of file SiStripThreeThresholdAlgo.h.

Referenced by endCluster(), and strip().

double SiStripThreeThresholdAlgo::clustThr_ [private]

Definition at line 42 of file SiStripThreeThresholdAlgo.h.

Referenced by endCluster().

std::vector<uint16_t> SiStripThreeThresholdAlgo::digis_ [private]

Definition at line 58 of file SiStripThreeThresholdAlgo.h.

Referenced by add(), endCluster(), endDet(), and SiStripThreeThresholdAlgo().

uint16_t SiStripThreeThresholdAlgo::first_ [private]

Definition at line 54 of file SiStripThreeThresholdAlgo.h.

Referenced by endCluster(), pad(), and strip().

uint32_t SiStripThreeThresholdAlgo::maxHoles_ [private]

Definition at line 43 of file SiStripThreeThresholdAlgo.h.

Referenced by proximity().

bool SiStripThreeThresholdAlgo::seed_ [private]

Definition at line 47 of file SiStripThreeThresholdAlgo.h.

Referenced by endCluster(), and strip().

double SiStripThreeThresholdAlgo::seedThr_ [private]

Definition at line 41 of file SiStripThreeThresholdAlgo.h.

Referenced by strip().

double SiStripThreeThresholdAlgo::sigmanoise2_ [private]

Definition at line 48 of file SiStripThreeThresholdAlgo.h.

Referenced by endCluster(), and strip().

uint16_t SiStripThreeThresholdAlgo::strip_ [private]

Definition at line 51 of file SiStripThreeThresholdAlgo.h.

Referenced by endCluster(), proximity(), and strip().

double SiStripThreeThresholdAlgo::stripThr_ [private]

Definition at line 40 of file SiStripThreeThresholdAlgo.h.

Referenced by threshold().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:34 2009 for CMSSW by  doxygen 1.5.4