Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better splitting and Tcrit definition for 4D vertexing #20709

Merged
merged 4 commits into from Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion RecoVertex/Configuration/python/RecoVertex_cff.py
Expand Up @@ -37,7 +37,7 @@
DA2D_vectParameters.TkDAClusParameters.verbose = cms.untracked.bool(False)
unsortedOfflinePrimaryVertices4D = unsortedOfflinePrimaryVertices.clone( verbose = cms.untracked.bool(False),
TkClusParameters = DA2D_vectParameters )
unsortedOfflinePrimaryVertices4D.TkFilterParameters.minPt = cms.double(0.7)
unsortedOfflinePrimaryVertices4D.TkFilterParameters.minPt = cms.double(0.0)
unsortedOfflinePrimaryVertices4D.TrackTimesLabel = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel")
unsortedOfflinePrimaryVertices4D.TrackTimeResosLabel = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution")
offlinePrimaryVertices4D=sortedPrimaryVertices.clone(vertices="unsortedOfflinePrimaryVertices4D", particles="trackRefsForJetsBeforeSorting4D", trackTimeTag=cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModel"),trackTimeResoTag=cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModelResolution"),assignment=dict(useTiming=True))
Expand Down
68 changes: 50 additions & 18 deletions RecoVertex/PrimaryVertexProducer/interface/DAClusterizerInZT_vect.h
Expand Up @@ -32,7 +32,6 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {
t.push_back( new_t );
dz2.push_back( new_dz2 );
dt2.push_back( new_dt2 );
errsum.push_back( 1./(1./new_dz2 + 1./new_dt2) );
tt.push_back( new_tt );

pi.push_back( new_pi ); // track weight
Expand All @@ -51,7 +50,6 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {
t_ = &t.front();
dz2_ = &dz2.front();
dt2_ = &dt2.front();
errsum_ = &errsum.front();
Z_sum_ = &Z_sum.front();
pi_ = &pi.front();
}
Expand All @@ -62,14 +60,12 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {

double * dz2_; // square of the error of z(pca)
double * dt2_; // square of the error of t(pca)
double * errsum_; // sum of squares of the pca errors
double * Z_sum_; // Z[i] for DA clustering

std::vector<double> z; // z-coordinate at point of closest approach to the beamline
std::vector<double> t; // t-coordinate at point of closest approach to the beamline
std::vector<double> dz2; // square of the error of z(pca)
std::vector<double> dt2; // square of the error of t(pca)
std::vector<double> errsum; // sum of squares of the pca errors
std::vector<double> Z_sum; // Z[i] for DA clustering
std::vector<double> pi; // track weight
std::vector< const reco::TransientTrack* > tt; // a pointer to the Transient Track
Expand All @@ -85,11 +81,14 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {

ei_cache.push_back( 0.0 );
ei.push_back( 0.0 );
sw.push_back( 0.0 );
swz.push_back( 0.0);
swt.push_back( 0.0);
se.push_back( 0.0);
swE.push_back( 0.0);
nuz.push_back(0.0);
nut.push_back(0.0);
szz.push_back(0.0);
stt.push_back(0.0);
szt.push_back(0.0);

extractRaw();
}
Expand All @@ -107,11 +106,15 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {
pk_ = &pk.front();

ei_ = &ei.front();
sw_ = &sw.front();
swz_ = &swz.front();
swt_ = &swt.front();
se_ = &se.front();
swE_ = &swE.front();
nuz_ = &nuz.front();
nut_ = &nut.front();
szz_ = &szz.front();
stt_ = &stt.front();
szt_ = &szt.front();

ei_cache_ = &ei_cache.front();

}
Expand All @@ -124,12 +127,15 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {

ei_cache.insert(ei_cache.begin() + i, 0.0 );
ei.insert( ei.begin() + i, 0.0 );
sw.insert( sw.begin() + i, 0.0 );
swz.insert(swz.begin() + i, 0.0 );
swt.insert(swt.begin() + i, 0.0 );
se.insert( se.begin() + i, 0.0 );
swE.insert(swE.begin() + i, 0.0 );


nuz.insert(nuz.begin() +i, 0.0 );
nut.insert(nut.begin() +i, 0.0 );
szz.insert(szz.begin() + i, 0.0 );
stt.insert(stt.begin() + i, 0.0 );
szt.insert(szt.begin() + i, 0.0 );
extractRaw();
}

Expand All @@ -141,16 +147,33 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {

ei_cache.erase( ei_cache.begin() + i);
ei.erase( ei.begin() + i);
sw.erase( sw.begin() + i);
swz.erase( swz.begin() + i);
swt.erase( swt.begin() + i);
se.erase(se.begin() + i);
swE.erase(swE.begin() + i);

nuz.erase(nuz.begin() + i);
nut.erase(nut.begin() + i);
szz.erase(szz.begin() + i);
stt.erase(stt.begin() + i);
szt.erase(szt.begin() + i);

extractRaw();
}

void debugOut()

unsigned int insertOrdered( double z, double t, double pk){
// insert a new cluster according to it's z-position, return the index at which it was inserted

unsigned int k = 0;
for( ; k < getSize(); k++){
if (z < z_[k]) break;
}
insertItem(k ,z, t, pk);
return k;
}


void debugOut()
{
std::cout << "vertex_t size: " << getSize() << std::endl;

Expand All @@ -170,20 +193,26 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {

double * ei_cache_;
double * ei_;
double * sw_;
double * swz_;
double * swt_;
double * se_;
double * swE_;
double * szz_;
double * stt_;
double * szt_;
double * nuz_;
double * nut_;

// --- temporary numbers, used during update
std::vector<double> ei_cache;
std::vector<double> ei;
std::vector<double> sw;
std::vector<double> swz;
std::vector<double> swt;
std::vector<double> se;
std::vector<double> swE;
std::vector<double> nuz;
std::vector<double> nut;
std::vector<double> szz;
std::vector<double> stt;
std::vector<double> szt;
};

DAClusterizerInZT_vect(const edm::ParameterSet& conf);
Expand All @@ -202,6 +231,8 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {

void dump(const double beta, const vertex_t & y,
const track_t & tks, const int verbosity = 0) const;
void zorder(vertex_t & y)const;
bool find_nearest(double z, double t, vertex_t & y, unsigned int & k_min, double dz, double dt)const;
bool merge(vertex_t & y, double & beta)const;
bool purge(vertex_t &, track_t &, double &,
const double) const;
Expand All @@ -210,6 +241,7 @@ class DAClusterizerInZT_vect final : public TrackClusterizerInZ {

double beta0(const double betamax, track_t const & tks, vertex_t const & y) const;

double get_Tc(const vertex_t & y, int k) const;

private:
bool verbose_;
Expand Down