CMS 3D CMS Logo

Classes | Public Member Functions | Private Attributes

DAClusterizerInZ Class Reference

#include <DAClusterizerInZ.h>

Inheritance diagram for DAClusterizerInZ:
TrackClusterizerInZ

List of all members.

Classes

struct  track_t
struct  vertex_t

Public Member Functions

double beta0 (const double betamax, std::vector< track_t > &tks, std::vector< vertex_t > &y) const
std::vector< std::vector
< reco::TransientTrack > > 
clusterize (const std::vector< reco::TransientTrack > &tracks) const
 DAClusterizerInZ (const edm::ParameterSet &conf)
void dump (const double beta, const std::vector< vertex_t > &y, const std::vector< track_t > &tks, const int verbosity=0) const
double Eik (const track_t &t, const vertex_t &k) const
std::vector< track_tfill (const std::vector< reco::TransientTrack > &tracks) const
bool merge (std::vector< vertex_t > &, int) const
bool merge (std::vector< vertex_t > &, double &) const
bool purge (std::vector< vertex_t > &, std::vector< track_t > &, double &, const double) const
bool split (double beta, std::vector< track_t > &tks, std::vector< vertex_t > &y, double threshold) const
void splitAll (std::vector< vertex_t > &y) const
double update (double beta, std::vector< track_t > &tks, std::vector< vertex_t > &y) const
double update (double beta, std::vector< track_t > &tks, std::vector< vertex_t > &y, double &) const
std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &tracks, const int verbosity=0) const

Private Attributes

float betamax_
float betastop_
double coolingFactor_
double d0CutOff_
double dzCutOff_
int maxIterations_
bool useTc_
bool verbose_
float vertexSize_

Detailed Description

Description: separates event tracks into clusters along the beam line

Definition at line 21 of file DAClusterizerInZ.h.


Constructor & Destructor Documentation

DAClusterizerInZ::DAClusterizerInZ ( const edm::ParameterSet conf)

Definition at line 455 of file DAClusterizerInZ.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and builder_last_value_cfg::Tmin.

{
  // some defaults to avoid uninitialized variables
  verbose_= conf.getUntrackedParameter<bool>("verbose", false);
  useTc_=true;
  betamax_=0.1;
  betastop_  =1.0;
  coolingFactor_=0.8;
  maxIterations_=100;
  vertexSize_=0.05;  // 0.5 mm
  dzCutOff_=4.0;   // Adaptive Fitter uses 3.0 but that appears to be a bit tight here sometimes

  // configure

  double Tmin = conf.getParameter<double>("Tmin");
  vertexSize_ = conf.getParameter<double>("vertexSize");
  coolingFactor_ = conf.getParameter<double>("coolingFactor");
  d0CutOff_  =  conf.getParameter<double>("d0CutOff");
  dzCutOff_  =  conf.getParameter<double>("dzCutOff");
  maxIterations_=100;
  if (Tmin==0){
    cout << "DAClusterizerInZ: invalid Tmin" << Tmin << "  reset do default " << 1./betamax_ << endl;
  }else{
    betamax_ = 1./Tmin;
  }

  // for testing, negative cooling factor: revert to old splitting scheme
  if(coolingFactor_<0){
    coolingFactor_=-coolingFactor_; useTc_=false;
  }

}

Member Function Documentation

double DAClusterizerInZ::beta0 ( const double  betamax,
std::vector< track_t > &  tks,
std::vector< vertex_t > &  y 
) const

Definition at line 301 of file DAClusterizerInZ.cc.

References a, b, i, gen::k, funct::log(), nt, funct::pow(), and w().

                                     {
  
  double T0=0;  // max Tc for beta=0
  // estimate critical temperature from beta=0 (T=inf)
  unsigned int nt=tks.size();

  for(vector<vertex_t>::iterator k=y.begin(); k!=y.end(); k++){

    // vertex fit at T=inf 
    double sumwz=0;
    double sumw=0;
    for(unsigned int i=0; i<nt; i++){
      double w=tks[i].pi/tks[i].dz2;
      sumwz+=w*tks[i].z;
      sumw +=w;
    }
    k->z=sumwz/sumw;

    // estimate Tcrit, eventually do this in the same loop
    double a=0, b=0;
    for(unsigned int i=0; i<nt; i++){
      double dx=tks[i].z-(k->z);
      double w=tks[i].pi/tks[i].dz2;
      a+=w*pow(dx,2)/tks[i].dz2;
      b+=w;
    }
    double Tc= 2.*a/b;  // the critical temperature of this vertex
    if(Tc>T0) T0=Tc;
  }// vertex loop (normally there should be only one vertex at beta=0)
  
  if (T0>1./betamax){
    return betamax/pow(coolingFactor_, int(log(T0*betamax)/log(coolingFactor_))-1 );
  }else{
    // ensure at least one annealing step
    return betamax/coolingFactor_;
  }
}
std::vector< std::vector<reco::TransientTrack> > DAClusterizerInZ::clusterize ( const std::vector< reco::TransientTrack > &  tracks) const [virtual]

Implements TrackClusterizerInZ.

void DAClusterizerInZ::dump ( const double  beta,
const std::vector< vertex_t > &  y,
const std::vector< track_t > &  tks,
const int  verbosity = 0 
) const
double DAClusterizerInZ::Eik ( const track_t t,
const vertex_t k 
) const
std::vector<track_t> DAClusterizerInZ::fill ( const std::vector< reco::TransientTrack > &  tracks) const
bool DAClusterizerInZ::merge ( std::vector< vertex_t > &  ,
int   
) const
bool DAClusterizerInZ::merge ( std::vector< vertex_t > &  ,
double &   
) const
bool DAClusterizerInZ::purge ( std::vector< vertex_t > &  ,
std::vector< track_t > &  ,
double &  ,
const double   
) const
bool DAClusterizerInZ::split ( double  beta,
std::vector< track_t > &  tks,
std::vector< vertex_t > &  y,
double  threshold 
) const
void DAClusterizerInZ::splitAll ( std::vector< vertex_t > &  y) const

Definition at line 422 of file DAClusterizerInZ.cc.

References alignCSCRings::e, epsilon, gen::k, DAClusterizerInZ::vertex_t::pk, and DAClusterizerInZ::vertex_t::z.

                               {


  double epsilon=1e-3;      // split all single vertices by 10 um 
  double zsep=2*epsilon;    // split vertices that are isolated by at least zsep (vertices that haven't collapsed)
  vector<vertex_t> y1;

  for(vector<vertex_t>::iterator k=y.begin(); k!=y.end(); k++){
    if ( ( (k==y.begin())|| (k-1)->z < k->z - zsep) && (((k+1)==y.end()  )|| (k+1)->z > k->z + zsep)) { 
      // isolated prototype, split
      vertex_t vnew;
      vnew.z  = k->z -epsilon;
      (*k).z  = k->z+epsilon;
      vnew.pk= 0.5* (*k).pk;
      (*k).pk= 0.5* (*k).pk;
      y1.push_back(vnew);
      y1.push_back(*k);

    }else if( y1.empty() || (y1.back().z < k->z -zsep)){
      y1.push_back(*k);
    }else{
      y1.back().z -=epsilon;
      k->z+=epsilon;
      y1.push_back(*k);
    }
  }// vertex loop
  
  y=y1;
}
double DAClusterizerInZ::update ( double  beta,
std::vector< track_t > &  tks,
std::vector< vertex_t > &  y 
) const
double DAClusterizerInZ::update ( double  beta,
std::vector< track_t > &  tks,
std::vector< vertex_t > &  y,
double &   
) const
std::vector< TransientVertex > DAClusterizerInZ::vertices ( const std::vector< reco::TransientTrack > &  tracks,
const int  verbosity = 0 
) const

Member Data Documentation

float DAClusterizerInZ::betamax_ [private]

Definition at line 107 of file DAClusterizerInZ.h.

float DAClusterizerInZ::betastop_ [private]

Definition at line 108 of file DAClusterizerInZ.h.

Definition at line 106 of file DAClusterizerInZ.h.

double DAClusterizerInZ::d0CutOff_ [private]

Definition at line 110 of file DAClusterizerInZ.h.

double DAClusterizerInZ::dzCutOff_ [private]

Definition at line 109 of file DAClusterizerInZ.h.

Definition at line 105 of file DAClusterizerInZ.h.

bool DAClusterizerInZ::useTc_ [private]

Definition at line 103 of file DAClusterizerInZ.h.

Definition at line 102 of file DAClusterizerInZ.h.

Definition at line 104 of file DAClusterizerInZ.h.