#include <DAClusterizerInZ.h>
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_t > | fill (const std::vector< reco::TransientTrack > &tracks) const |
bool | merge (std::vector< vertex_t > &, int) const |
bool | purge (std::vector< vertex_t > &, std::vector< track_t > &, double &, const double) const |
void | splitAll (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 |
double | update (double beta, std::vector< track_t > &tks, std::vector< vertex_t > &y) const |
std::vector< TransientVertex > | vertices (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 | verbose_ |
float | vertexSize_ |
Description: separates event tracks into clusters along the beam line
Definition at line 21 of file DAClusterizerInZ.h.
DAClusterizerInZ::DAClusterizerInZ | ( | const edm::ParameterSet & | conf | ) |
Definition at line 348 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); 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; } }
double DAClusterizerInZ::beta0 | ( | const double | betamax, |
std::vector< track_t > & | tks, | ||
std::vector< vertex_t > & | y | ||
) | const |
Definition at line 269 of file DAClusterizerInZ.cc.
References a, b, i, gen::k, funct::log(), nt, and funct::pow().
{ 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 |
Definition at line 63 of file DAClusterizerInZ.cc.
References DAClusterizerInZ::track_t::dz2, funct::pow(), DAClusterizerInZ::vertex_t::z, and DAClusterizerInZ::track_t::z.
std::vector<track_t> DAClusterizerInZ::fill | ( | const std::vector< reco::TransientTrack > & | tracks | ) | const |
bool DAClusterizerInZ::merge | ( | std::vector< vertex_t > & | , |
int | |||
) | const |
bool DAClusterizerInZ::purge | ( | std::vector< vertex_t > & | , |
std::vector< track_t > & | , | ||
double & | , | ||
const double | |||
) | const |
Definition at line 314 of file DAClusterizerInZ.cc.
References 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 |
float DAClusterizerInZ::betamax_ [private] |
Definition at line 96 of file DAClusterizerInZ.h.
float DAClusterizerInZ::betastop_ [private] |
Definition at line 97 of file DAClusterizerInZ.h.
double DAClusterizerInZ::coolingFactor_ [private] |
Definition at line 95 of file DAClusterizerInZ.h.
double DAClusterizerInZ::d0CutOff_ [private] |
Definition at line 99 of file DAClusterizerInZ.h.
double DAClusterizerInZ::dzCutOff_ [private] |
Definition at line 98 of file DAClusterizerInZ.h.
int DAClusterizerInZ::maxIterations_ [private] |
Definition at line 94 of file DAClusterizerInZ.h.
bool DAClusterizerInZ::verbose_ [private] |
Definition at line 92 of file DAClusterizerInZ.h.
float DAClusterizerInZ::vertexSize_ [private] |
Definition at line 93 of file DAClusterizerInZ.h.