Page MenuHomeHEPForge

No OneTemporary

Index: contrib/contribs/ConstituentSubtractor/trunk/ConstituentSubtractor.cc
===================================================================
--- contrib/contribs/ConstituentSubtractor/trunk/ConstituentSubtractor.cc (revision 1133)
+++ contrib/contribs/ConstituentSubtractor/trunk/ConstituentSubtractor.cc (revision 1134)
@@ -1,753 +1,787 @@
// $Id$
//
// ConstituentSubtractor package
// Questions/comments: berta@ipnp.troja.mff.cuni.cz, Martin.Spousta@cern.ch, David.W.Miller@uchicago.edu, Rupert.Leitner@mff.cuni.cz
//
// Copyright (c) 2014-, Peter Berta, Martin Spousta, David W. Miller, Rupert Leitner
//
//----------------------------------------------------------------------
// This file is part of FastJet contrib.
//
// It is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at
// your option) any later version.
//
// It is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this code. If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------
#include "ConstituentSubtractor.hh"
FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
namespace contrib{
LimitedWarning ConstituentSubtractor::_warning_unused_rhom;
///
/// default constructor
ConstituentSubtractor::ConstituentSubtractor(){
_bge_rho=0;
_bge_rhom=0;
_common_bge=false;
_rhom_from_bge_rhom=false;
_externally_supplied_rho_rhom=false;
_do_mass_subtraction=false;
_distance=deltaR;
_alpha=0;
_polarAngleExp=0;
_max_distance=-1;
- _max_distance_sequential=-1;
_remove_zero_pt_and_mtMinusPt_particles=true;
_remove_all_zero_pt_particles=false;
_use_max_distance=false;
+ _remove_remaining_proxies_sequential=true;
_ghost_area=0.01;
_grid_size_phi=-1;
_grid_size_rap=-1;
_ghosts_constructed=false;
_ghosts_rapidity_sorted=false;
_n_ghosts_phi=-1;
_max_eta=0;
_grid_size_background_estimator=0.5;
_selector=0;
}
/// Constructor that takes a pointer to a background estimator for
/// rho and optionally a pointer to a background estimator for
/// rho_m.
ConstituentSubtractor::ConstituentSubtractor(fastjet::BackgroundEstimatorBase *bge_rho, fastjet::BackgroundEstimatorBase *bge_rhom, double alpha, double max_distance, Distance distance) :
_bge_rho(bge_rho), _bge_rhom(bge_rhom), _common_bge(false), _rhom_from_bge_rhom(false), _externally_supplied_rho_rhom(false), _distance(distance), _alpha(alpha), _max_distance(max_distance){
if (_max_distance>0) _use_max_distance=true;
else _use_max_distance=false;
_polarAngleExp=0;
_ghost_area=0.01;
_remove_zero_pt_and_mtMinusPt_particles=true;
_remove_all_zero_pt_particles=false;
_max_eta=0;
_ghosts_constructed=false;
_ghosts_rapidity_sorted=false;
_n_ghosts_phi=-1;
_do_mass_subtraction=false;
if (_common_bge || bge_rhom) _do_mass_subtraction=true;
_selector=0;
}
///
/// Constructor that takes an externally supplied value for rho and, optionally, for rho_m.
ConstituentSubtractor::ConstituentSubtractor(double rho, double rhom, double alpha, double max_distance, Distance distance) :
_bge_rho(0), _bge_rhom(0), _common_bge(false), _rhom_from_bge_rhom(false), _rho(rho), _rhom(rhom), _externally_supplied_rho_rhom(true), _distance(distance), _alpha(alpha), _max_distance(max_distance) {
if (_max_distance>0) _use_max_distance=true;
else _use_max_distance=false;
assert(_rho >= 0);
assert(_rhom >= 0);
_polarAngleExp=0;
_ghost_area=0.01;
_remove_zero_pt_and_mtMinusPt_particles=true;
_remove_all_zero_pt_particles=false;
_ghosts_constructed=false;
_ghosts_rapidity_sorted=false;
_n_ghosts_phi=-1;
_do_mass_subtraction=true;
_max_eta=0;
_selector=0;
}
void ConstituentSubtractor::set_background_estimator(fastjet::BackgroundEstimatorBase *bge_rho, fastjet::BackgroundEstimatorBase *bge_rhom){
_bge_rho=bge_rho;
_bge_rhom=bge_rhom;
if (_common_bge || bge_rhom) _do_mass_subtraction=true;
}
void ConstituentSubtractor::set_scalar_background_density(double rho, double rhom){
_rho=rho;
_rhom=rhom;
assert(_rho >= 0);
assert(_rhom >= 0);
_externally_supplied_rho_rhom=true;
_common_bge=false;
_do_mass_subtraction=true;
}
///----------------------------------------------------------------------
/// the action on a given jet
fastjet::PseudoJet ConstituentSubtractor::result(const PseudoJet &jet) const{
// make sure we have a BGE or a rho value
if (!_bge_rho && !_externally_supplied_rho_rhom){
throw Error("ConstituentSubtractor::result() constituent subtraction needs a BackgroundEstimator or a value for rho.");
}
if (_ghosts_constructed) throw Error("ConstituentSubtractor::result() The ghosts are constructed, but they are not needed when using this function. When you want to perform jet-by-jet correction, initialize a new ConstituentSubtractor without construction of ghosts.");
///----------------------------------------------------------------------
/// sift ghosts and particles in the input jet
std::vector<fastjet::PseudoJet> particles, ghosts;
SelectorIsPureGhost().sift(jet.constituents(), ghosts, particles);
std::vector<double> ghosts_area;
unsigned long nGhosts=ghosts.size();
for (unsigned int j=0;j<nGhosts; ++j){
ghosts_area.push_back(ghosts[j].area());
}
std::vector<fastjet::PseudoJet> backgroundProxies=this->get_background_proxies_from_ghosts(ghosts,ghosts_area);
std::vector<fastjet::PseudoJet> subtracted_particles=this->do_subtraction(particles,backgroundProxies);
fastjet::PseudoJet subtracted_jet=join(subtracted_particles);
subtracted_jet.set_user_index(jet.user_index());
return subtracted_jet;
}
std::vector<fastjet::PseudoJet> ConstituentSubtractor::subtract_event(std::vector<fastjet::PseudoJet> const &particles, double max_eta){
if (fabs(_max_eta/max_eta-1)>1e-5) _ghosts_constructed=false;
if (!_ghosts_constructed) this->construct_ghosts_uniformly(max_eta);
- _ghosts_rapidity_sorted=true; // the ghosts are now sorted according to rapidity. This variable needs to be set to true to be able to use faster algorithm in "do_subtraction".
std::vector<fastjet::PseudoJet> backgroundProxies=this->get_background_proxies_from_ghosts(_ghosts,_ghosts_area);
std::vector<fastjet::PseudoJet> selected_particles;
for (unsigned int i=0;i<particles.size();++i){
if (fabs(particles[i].eta())<max_eta) selected_particles.push_back(particles[i]);
}
std::vector<fastjet::PseudoJet> subtracted_particles=this->do_subtraction(selected_particles,backgroundProxies);
- _ghosts_rapidity_sorted=false;
return subtracted_particles;
}
std::vector<fastjet::PseudoJet> ConstituentSubtractor::get_background_proxies_from_ghosts(std::vector<fastjet::PseudoJet> const &ghosts,std::vector<double> const &ghosts_area) const{
std::vector<fastjet::PseudoJet> proxies;
unsigned long nGhosts=ghosts.size();
std::vector<double> pt;
std::vector<double> mtMinusPt;
if (_externally_supplied_rho_rhom){
for (unsigned int j=0;j<nGhosts; ++j){
pt.push_back(_rho*ghosts_area[j]);
mtMinusPt.push_back(_rhom*ghosts_area[j]);
}
}
else{
for (unsigned int j=0;j<nGhosts; ++j) pt.push_back(_bge_rho->rho(ghosts[j])*ghosts_area[j]);
if (_bge_rhom){
if (_rhom_from_bge_rhom){
#if FASTJET_VERSION_NUMBER >= 30100
for (unsigned int j=0;j<nGhosts; ++j) mtMinusPt.push_back(_bge_rhom->rho_m(ghosts[j])*ghosts_area[j]);
#else
throw(Error("ConstituentSubtractor:: _rhom_from_bge_rhom not allowed for FJ<3.1"));
#endif // end of code specific to FJ >= 3.1
} else {
for (unsigned int j=0;j<nGhosts; ++j) mtMinusPt.push_back(_bge_rhom->rho(ghosts[j])*ghosts_area[j]);
}
}
else if (_common_bge){
// since FJ 3.1.0, some background estimators have an automatic internal calculation of rho_m
#if FASTJET_VERSION_NUMBER >= 30100
// check if the BGE has internal support for rho_m
if (_bge_rho->has_rho_m()){
for (unsigned int j=0;j<nGhosts; ++j) mtMinusPt.push_back(_bge_rho->rho_m(ghosts[j])*ghosts_area[j]);
} else {
#endif // end of code specific to FJ >= 3.1
BackgroundJetPtMDensity m_density;
JetMedianBackgroundEstimator *jmbge = dynamic_cast<JetMedianBackgroundEstimator*>(_bge_rho);
const FunctionOfPseudoJet<double> * orig_density = jmbge->jet_density_class();
jmbge->set_jet_density_class(&m_density);
for (unsigned int j=0;j<nGhosts; ++j) mtMinusPt.push_back(jmbge->rho(ghosts[j])*ghosts_area[j]);
jmbge->set_jet_density_class(orig_density);
#if FASTJET_VERSION_NUMBER >= 30100
}
#endif
}
else { // a single bge, only rho requested
for (unsigned int j=0;j<nGhosts; ++j) mtMinusPt.push_back(1e-200);
#if FASTJET_VERSION_NUMBER >= 30100
// In FJ3.1 and BGE with rho_m support, add a warning, similar to that in Subtractor
double const rho_m_warning_threshold = 1e-5;
if (_bge_rho->has_rho_m() && _bge_rho->rho_m()>rho_m_warning_threshold*_bge_rho->rho()){
_warning_unused_rhom.warn("ConstituentSubtractor:: Background estimator indicates non-zero rho_m, but the constituent subtractor does not use rho_m information; consider calling set_common_bge_for_rho_and_rhom(true) to include the rho_m information");
}
#endif
}
}
fastjet::PseudoJet proxy(0,0,0,1);
for (unsigned int j=0;j<nGhosts; ++j){
double mass_squared=pow(mtMinusPt[j]+pt[j],2)-pow(pt[j],2);
double mass=0;
if (mass_squared>0) mass=sqrt(mass_squared);
proxy.reset_momentum_PtYPhiM(pt[j],ghosts[j].rap(),ghosts[j].phi(),mass);
proxies.push_back(proxy);
}
return proxies;
}
std::vector<fastjet::PseudoJet> ConstituentSubtractor::do_subtraction(std::vector<fastjet::PseudoJet> const &particles, std::vector<fastjet::PseudoJet> const &backgroundProxies,std::vector<fastjet::PseudoJet> *remaining_backgroundProxies) const{
unsigned int nBackgroundProxies=backgroundProxies.size();
unsigned int nParticles=particles.size();
double max_distance_transformed=-1;
if (_distance==ConstituentSubtractor::deltaR) max_distance_transformed=pow(_max_distance,2);
if (_distance==ConstituentSubtractor::angle) max_distance_transformed=-cos(_max_distance);
///
/// sort particles according to rapidity to achieve faster performance for the whole event subtraction
std::vector<fastjet::PseudoJet> particles_sorted=particles;
std::sort(particles_sorted.begin(),particles_sorted.end(),ConstituentSubtractor::_rapidity_sorting);
///
/// get the kinematic variables for particles and background proxies in advance to achieve faster performance
std::vector<double> particles_phi,particles_rap,particles_pt,particles_mt,pt_factors,polarAngle_factors,particle_factors,particles_px_normalized,particles_py_normalized,particles_pz_normalized;
for (unsigned int i=0;i<nParticles; ++i){
particles_phi.push_back(particles_sorted[i].phi());
particles_rap.push_back(particles_sorted[i].rap());
particles_pt.push_back(particles_sorted[i].pt());
particles_mt.push_back(particles_sorted[i].mt());
if (fabs(_alpha)>1e-5) pt_factors.push_back(pow(particles_pt[i],_alpha));
else pt_factors.push_back(1);
double momentum=sqrt(particles_sorted[i].pt2()+particles_sorted[i].pz()*particles_sorted[i].pz());
if (fabs(_polarAngleExp)>1e-5) polarAngle_factors.push_back(pow(particles_pt[i]/momentum,_polarAngleExp));
else polarAngle_factors.push_back(1);
particle_factors.push_back(pt_factors[i]*polarAngle_factors[i]);
if (_distance==ConstituentSubtractor::angle){
particles_px_normalized.push_back(particles_sorted[i].px()/momentum);
particles_py_normalized.push_back(particles_sorted[i].py()/momentum);
particles_pz_normalized.push_back(particles_sorted[i].pz()/momentum);
}
}
std::vector<double> backgroundProxies_phi,backgroundProxies_rap,backgroundProxies_pt,backgroundProxies_mt,backgroundProxies_px_normalized,backgroundProxies_py_normalized,backgroundProxies_pz_normalized;
for (unsigned int j=0;j<nBackgroundProxies;++j){
backgroundProxies_phi.push_back(backgroundProxies[j].phi());
backgroundProxies_rap.push_back(backgroundProxies[j].rap());
backgroundProxies_pt.push_back(backgroundProxies[j].pt());
backgroundProxies_mt.push_back(backgroundProxies[j].mt());
if (_distance==ConstituentSubtractor::angle){
double momentum=sqrt(backgroundProxies[j].pt2()+backgroundProxies[j].pz()*backgroundProxies[j].pz());
backgroundProxies_px_normalized.push_back(backgroundProxies[j].px()/momentum);
backgroundProxies_py_normalized.push_back(backgroundProxies[j].py()/momentum);
backgroundProxies_pz_normalized.push_back(backgroundProxies[j].pz()/momentum);
}
}
///
/// finding the rapidity range of particles for each ghost to achieve faster performance in the double loop over particles and proxies below
double max_number_pairs=0;
std::vector<unsigned int> backgroundProxies_minParticleIndex,backgroundProxies_maxParticleIndex;
if (_use_max_distance && _distance==ConstituentSubtractor::deltaR && _ghosts_rapidity_sorted && !_selector){
for (unsigned int j=0;j<_ghosts_rapidities.size();++j){
unsigned int min=this->_find_index_after(_ghosts_rapidities[j]-_max_distance,particles_rap);
unsigned int max=this->_find_index_before(_ghosts_rapidities[j]+_max_distance,particles_rap);
for (int k=0;k<_n_ghosts_phi;++k){
backgroundProxies_minParticleIndex.push_back(min);
backgroundProxies_maxParticleIndex.push_back(max);
}
max_number_pairs+=max-min;
}
max_number_pairs=max_number_pairs*_n_ghosts_phi*_max_distance/3.1415;
}
else{
for (unsigned int j=0;j<nBackgroundProxies; ++j){
backgroundProxies_minParticleIndex.push_back(0);
backgroundProxies_maxParticleIndex.push_back(nParticles);
}
if (_use_max_distance && _ghosts_constructed && !_selector){
if (_distance==ConstituentSubtractor::deltaR) max_number_pairs=nParticles*nBackgroundProxies*_max_distance*_max_distance/4./_max_eta;
if (_distance==ConstituentSubtractor::angle) max_number_pairs=nParticles*nBackgroundProxies*_max_distance/3.141593;
}
else max_number_pairs=nParticles*nBackgroundProxies;
}
///
/// computation of the CS distances
std::vector<std::pair<double,std::pair<int,int> > > CS_distances; // storing three elements: the CS distance, and corresponding particle and proxy indexes
CS_distances.reserve(max_number_pairs);
bool skip_particles_outside_phi_range=false; // used for speed optimization
if (_distance==ConstituentSubtractor::deltaR && _use_max_distance && _max_distance<twopi/2.*0.9999 && _ghosts_constructed && !_selector) skip_particles_outside_phi_range=true;
double distance_transformed = 0;
bool switched=false;
double particle_phi_max=0;
double particle_phi_min=0;
for (unsigned int j=0;j<nBackgroundProxies; ++j){
if (skip_particles_outside_phi_range){
switched=false;
particle_phi_max=backgroundProxies_phi[j]+_max_distance;
particle_phi_min=backgroundProxies_phi[j]-_max_distance;
if (particle_phi_max>twopi){
particle_phi_min=particle_phi_max-twopi;
particle_phi_max=backgroundProxies_phi[j]-_max_distance;
switched=true;
}
if (particle_phi_min<0){
particle_phi_max=particle_phi_min+twopi;
particle_phi_min=backgroundProxies_phi[j]+_max_distance;
switched=true;
}
}
for (unsigned int i=backgroundProxies_minParticleIndex[j];i<backgroundProxies_maxParticleIndex[j];++i){
if (_distance==ConstituentSubtractor::deltaR){
if (skip_particles_outside_phi_range) if ((switched && particles_phi[i]>particle_phi_min && particles_phi[i]<particle_phi_max) || (!switched && (particles_phi[i]<particle_phi_min || particles_phi[i]>particle_phi_max))) continue; // speed optimization only, this line has no effect on the subtraction performance
double deltaPhi=fabs(backgroundProxies_phi[j]-particles_phi[i]);
if (deltaPhi>pi) deltaPhi=twopi-deltaPhi;
double deltaRap=backgroundProxies_rap[j]-particles_rap[i];
distance_transformed = deltaPhi*deltaPhi+deltaRap*deltaRap;
}
if (_distance==ConstituentSubtractor::angle){
distance_transformed=-(particles_px_normalized[i]*backgroundProxies_px_normalized[j]+particles_py_normalized[i]*backgroundProxies_py_normalized[j]+particles_pz_normalized[i]*backgroundProxies_pz_normalized[j]);
}
if (!_use_max_distance || distance_transformed<=max_distance_transformed){
double CS_distance = distance_transformed*particle_factors[i];
CS_distances.push_back(std::make_pair(CS_distance,std::make_pair(i,j))); // have tried to use emplace_back and tuple here - did not lead to any speed improvement
}
}
}
///
/// sorting of the CS distances
std::sort(CS_distances.begin(),CS_distances.end(),ConstituentSubtractor::_function_used_for_sorting);
///----------------------------------------------------------------------
/// the iterative process. Here, only finding the fractions of pt or delta_m=mt-pt to be corrected. The actual correction of particles is done later.
unsigned long nStoredPairs=CS_distances.size();
std::vector<double> backgroundProxies_fraction_of_pt(nBackgroundProxies,1.);
std::vector<double> particles_fraction_of_pt(nParticles,1.);
std::vector<double> backgroundProxies_fraction_of_mtMinusPt(nBackgroundProxies,1.);
std::vector<double> particles_fraction_of_mtMinusPt(nParticles,1.);
for (unsigned long iindices=0;iindices<nStoredPairs;++iindices){
int particle_index=CS_distances[iindices].second.first;
int proxy_index=CS_distances[iindices].second.second;
if (backgroundProxies_fraction_of_pt[proxy_index]>0 && particles_fraction_of_pt[particle_index]>0 && particles_pt[particle_index]>0 && backgroundProxies[proxy_index].pt()>0){
double ratio_pt=particles_pt[particle_index]*particles_fraction_of_pt[particle_index]/backgroundProxies_pt[proxy_index]/backgroundProxies_fraction_of_pt[proxy_index];
if (ratio_pt>1){
particles_fraction_of_pt[particle_index]*=1-1./ratio_pt;
backgroundProxies_fraction_of_pt[proxy_index]=-1;
}
else {
backgroundProxies_fraction_of_pt[proxy_index]*=1-ratio_pt;
particles_fraction_of_pt[particle_index]=-1;
}
}
if (_do_mass_subtraction && backgroundProxies_fraction_of_mtMinusPt[proxy_index]>0 && particles_fraction_of_mtMinusPt[particle_index]>0 && particles_mt[particle_index]>particles_pt[particle_index] && backgroundProxies_mt[proxy_index]>backgroundProxies_pt[proxy_index]){
double ratio_mtMinusPt=(particles_mt[particle_index]-particles_pt[particle_index])*particles_fraction_of_mtMinusPt[particle_index]/(backgroundProxies_mt[proxy_index]-backgroundProxies_pt[proxy_index])/backgroundProxies_fraction_of_mtMinusPt[proxy_index];
if (ratio_mtMinusPt>1){
particles_fraction_of_mtMinusPt[particle_index]*=1-1./ratio_mtMinusPt;
backgroundProxies_fraction_of_mtMinusPt[proxy_index]=-1;
}
else{
backgroundProxies_fraction_of_mtMinusPt[proxy_index]*=1-ratio_mtMinusPt;
particles_fraction_of_mtMinusPt[particle_index]=-1;
}
}
}
///----------------------------------------------------------------------
/// do the actual correction for particles:
std::vector<fastjet::PseudoJet> subtracted_particles;
for (unsigned int i=0;i<nParticles; ++i){
///
/// particles with zero pt and zero mtMinusPt are removed. Particles with zero pt and non-zero mtMinusPt (i.e. massive particles in rest) are kept with very small pt (1e-200 GeV) - the user can decide in his/her code if to remove or not to remove them.
bool particle_pt_larger_than_zero=(particles_fraction_of_pt[i]>0 && particles_pt[i]>0);
bool particle_mtMinusPt_larger_than_zero=(_do_mass_subtraction && particles_fraction_of_mtMinusPt[i]>0 && particles_mt[i]>particles_pt[i]);
if (!particle_pt_larger_than_zero && !particle_mtMinusPt_larger_than_zero && _remove_zero_pt_and_mtMinusPt_particles) continue;
if (!particle_pt_larger_than_zero && _remove_all_zero_pt_particles) continue;
double subtracted_pt=1e-50;
if (particle_pt_larger_than_zero) subtracted_pt=particles_pt[i]*particles_fraction_of_pt[i];
double subtracted_mtMinusPt=0;
if (particle_mtMinusPt_larger_than_zero) subtracted_mtMinusPt=(particles_mt[i]-particles_pt[i])*particles_fraction_of_mtMinusPt[i];
PseudoJet subtracted_const(0,0,0,1);
double mass_squared=pow(subtracted_pt+subtracted_mtMinusPt,2)-pow(subtracted_pt,2);
if (mass_squared<0) mass_squared=0;
subtracted_const.reset_momentum_PtYPhiM(subtracted_pt,particles_rap[i],particles_phi[i],sqrt(mass_squared));
subtracted_const.set_user_index(particles_sorted[i].user_index());
subtracted_particles.push_back(subtracted_const);
}
///
/// get the remaining background proxies if requested:
if (remaining_backgroundProxies){
+
for (unsigned int i=0;i<nBackgroundProxies; ++i){
/// keeping all background proxies
bool proxy_pt_larger_than_zero=(backgroundProxies_fraction_of_pt[i]>0 && backgroundProxies_pt[i]>0);
bool proxy_mtMinusPt_larger_than_zero=(_do_mass_subtraction && backgroundProxies_fraction_of_mtMinusPt[i]>0 && backgroundProxies_mt[i]>backgroundProxies_pt[i]);
- double subtracted_pt=1e-200;
+ double subtracted_pt=1e-50;
if (proxy_pt_larger_than_zero) subtracted_pt=backgroundProxies_pt[i]*backgroundProxies_fraction_of_pt[i];
double subtracted_mtMinusPt=0;
if (proxy_mtMinusPt_larger_than_zero) subtracted_mtMinusPt=(backgroundProxies_mt[i]-backgroundProxies_pt[i])*backgroundProxies_fraction_of_mtMinusPt[i];
- PseudoJet subtracted_const(0,0,0,1);
+ PseudoJet subtracted_proxy(0,0,0,1);
double mass_squared=pow(subtracted_pt+subtracted_mtMinusPt,2)-pow(subtracted_pt,2);
if (mass_squared<0) mass_squared=0;
- subtracted_const.reset_momentum_PtYPhiM(subtracted_pt,backgroundProxies_rap[i],backgroundProxies_phi[i],sqrt(mass_squared));
- remaining_backgroundProxies->push_back(subtracted_const);
+ subtracted_proxy.reset_momentum_PtYPhiM(subtracted_pt,backgroundProxies_rap[i],backgroundProxies_phi[i],sqrt(mass_squared));
+ remaining_backgroundProxies->push_back(subtracted_proxy);
}
}
return subtracted_particles;
}
- std::vector<fastjet::PseudoJet> ConstituentSubtractor::sequential_subtraction(std::vector<fastjet::PseudoJet> const &particles, double max_eta){
+
+
+ std::vector<fastjet::PseudoJet> ConstituentSubtractor::sequential_subtraction(std::vector<fastjet::PseudoJet> const &particles, double const &max_eta){
if (fabs(_max_eta/max_eta-1)>1e-5) _ghosts_constructed=false;
if (!_ghosts_constructed) this->construct_ghosts_uniformly(max_eta);
- _ghosts_rapidity_sorted=true; // the ghosts are now sorted according to rapidity. This variable needs to be set to true to be able to use faster algorithm in "do_subtraction".
+ bool original_value_of_ghosts_rapidity_sorted=_ghosts_rapidity_sorted;
std::vector<fastjet::PseudoJet> backgroundProxies=this->get_background_proxies_from_ghosts(_ghosts,_ghosts_area);
- std::vector<fastjet::PseudoJet> selected_particles;
- for (unsigned int i=0;i<particles.size();++i){
- if (fabs(particles[i].eta())<max_eta) selected_particles.push_back(particles[i]);
+ std::vector<fastjet::PseudoJet> subtracted_particles;
+ for (unsigned int iparticle=0;iparticle<particles.size();++iparticle){
+ if (fabs(particles[iparticle].eta())<max_eta) subtracted_particles.push_back(particles[iparticle]);
}
- double total_background_pt=0,total_background_mt=0;
- for (unsigned int i=0;i<backgroundProxies.size();++i){
- total_background_pt+=backgroundProxies[i].pt();
- total_background_mt+=backgroundProxies[i].mt();
- }
- this->set_max_distance(_max_distance_sequential);
- std::vector<fastjet::PseudoJet> *remaining_backgroundProxies=new std::vector<fastjet::PseudoJet>;
- std::vector<fastjet::PseudoJet> subtracted_particles=this->do_subtraction(selected_particles,backgroundProxies,remaining_backgroundProxies);
- double remaining_background_pt=0,remaining_background_mt=0;
- for (unsigned int i=0;i<remaining_backgroundProxies->size();++i){
- remaining_background_pt+=(remaining_backgroundProxies->at(i)).pt();
- remaining_background_mt+=(remaining_backgroundProxies->at(i)).mt();
- }
- std::vector<fastjet::PseudoJet> backgroundProxies2;
- for (unsigned int i=0;i<backgroundProxies.size();++i){
- double rapidity=backgroundProxies[i].rap();
- double azimuth=backgroundProxies[i].phi();
- double pt= backgroundProxies[i].pt()*remaining_background_pt/total_background_pt;
- double mtMinusPt= (backgroundProxies[i].mt()-backgroundProxies[i].pt())*(remaining_background_mt-remaining_background_pt)/(total_background_mt-total_background_pt);
- PseudoJet proxy(pt*cos(azimuth),pt*sin(azimuth),(pt+mtMinusPt)*sinh(rapidity),(pt+mtMinusPt)*cosh(rapidity));
- backgroundProxies2.push_back(proxy);
- }
- delete remaining_backgroundProxies;
- this->set_max_distance(_max_distance);
- std::vector<fastjet::PseudoJet> subtracted_particles2=this->do_subtraction(subtracted_particles,backgroundProxies2);
- _ghosts_rapidity_sorted=false;
- return subtracted_particles2;
+ for (unsigned int iteration=0;iteration<_max_distances_sequential.size();++iteration){
+ this->set_max_distance(_max_distances_sequential[iteration]);
+ this->set_alpha(_alphas_sequential[iteration]);
+ std::vector<fastjet::PseudoJet> *remaining_backgroundProxies=0;
+ if (iteration!=_max_distances_sequential.size()-1) remaining_backgroundProxies=new std::vector<fastjet::PseudoJet>; // do not need to estimate the remaining background for the last iteration
+ subtracted_particles=this->do_subtraction(subtracted_particles,backgroundProxies,remaining_backgroundProxies);
+
+ if (iteration==_max_distances_sequential.size()-1){
+ continue; // do not need to estimate the remaining background for the last iteration
+ }
+
+ double background_pt=0,background_mt=0, remaining_background_pt=0,remaining_background_mt=0;
+ int backgroundProxies_original_size=backgroundProxies.size();
+ for (int i=backgroundProxies_original_size-1;i>=0;--i){
+ remaining_background_pt+=(remaining_backgroundProxies->at(i)).pt();
+ remaining_background_mt+=(remaining_backgroundProxies->at(i)).mt();
+ if (_remove_remaining_proxies_sequential && (remaining_backgroundProxies->at(i)).pt()>1e-10){
+ backgroundProxies[i]=backgroundProxies[backgroundProxies.size()-1];
+ backgroundProxies.pop_back();
+ }
+ else{
+ background_pt+=backgroundProxies[i].pt();
+ background_mt+=backgroundProxies[i].mt();
+ }
+ }
+ delete remaining_backgroundProxies;
+ if (_remove_remaining_proxies_sequential) _ghosts_rapidity_sorted=false; // After erasing some elements from vector backgroundProxies, we cannot use the speed optimization in do_subtraction function, therefore setting _ghosts_rapidity_sorted to false.
+ for (unsigned int i=0;i<backgroundProxies.size();++i){
+ double pt= backgroundProxies[i].pt()*remaining_background_pt/background_pt;
+ double mtMinusPt=0;
+ if (background_mt>background_pt+1e-20) mtMinusPt=(backgroundProxies[i].mt()-backgroundProxies[i].pt())*(remaining_background_mt-remaining_background_pt)/(background_mt-background_pt);
+ double mass=0;
+ if (mtMinusPt>1e-20) mass=sqrt(pow(mtMinusPt+pt,2)-pow(pt,2));
+ backgroundProxies[i].reset_momentum_PtYPhiM(pt,backgroundProxies[i].rap(),backgroundProxies[i].phi(),mass);
+ }
+ }
+ _ghosts_rapidity_sorted=original_value_of_ghosts_rapidity_sorted; // Setting _ghosts_rapidity_sorted to its original value
+
+ return subtracted_particles;
}
- std::vector<fastjet::PseudoJet> ConstituentSubtractor::subtract_event_using_charged_info(std::vector<fastjet::PseudoJet> const &particles, double charged_background_scale, std::vector<fastjet::PseudoJet> const &charged_background, double charged_signal_scale, std::vector<fastjet::PseudoJet> const &charged_signal, double max_eta, fastjet::FunctionOfPseudoJet<double> *rescaling){
+
+ std::vector<fastjet::PseudoJet> ConstituentSubtractor::subtract_event_using_charged_info(std::vector<fastjet::PseudoJet> const &particles, double charged_background_scale, std::vector<fastjet::PseudoJet> const &charged_background, double charged_signal_scale, std::vector<fastjet::PseudoJet> const &charged_signal, double max_eta, fastjet::FunctionOfPseudoJet<double> *rescaling){
if (fabs(_max_eta/max_eta-1)>1e-5) _ghosts_constructed=false;
if (!_ghosts_constructed) this->construct_ghosts_uniformly(max_eta);
_ghosts_rapidity_sorted=false; // no speed optimization implemented for this function yet
std::vector<fastjet::PseudoJet> scaled_charged_all;
std::vector<fastjet::PseudoJet> scaled_charged_signal;
std::vector<fastjet::PseudoJet> scaled_charged_background;
for (unsigned int i=0;i<charged_background.size();++i){
if (fabs(charged_background[i].eta())>max_eta) continue;
scaled_charged_background.push_back(charged_background_scale*charged_background[i]);
scaled_charged_all.push_back(scaled_charged_background[scaled_charged_background.size()-1]);
}
for (unsigned int i=0;i<charged_signal.size();++i){
if (fabs(charged_signal[i].eta())>max_eta) continue;
scaled_charged_signal.push_back(charged_signal_scale*charged_signal[i]);
scaled_charged_all.push_back(scaled_charged_signal[scaled_charged_signal.size()-1]);
}
std::vector<fastjet::PseudoJet> selected_particles;
for (unsigned int i=0;i<particles.size();++i){
if (fabs(particles[i].eta())<max_eta) selected_particles.push_back(particles[i]);
}
std::vector<fastjet::PseudoJet> *remaining_charged_background= new std::vector<fastjet::PseudoJet>;
double maxDeltaR=this->get_max_distance();
if (maxDeltaR<=0) maxDeltaR=0.5;
this->set_max_distance(0.2);
std::vector<fastjet::PseudoJet> subtracted_particles_using_scaled_charged_signal=this->do_subtraction(selected_particles,scaled_charged_signal);
std::vector<fastjet::PseudoJet> subtracted_particles_using_scaled_charged_all=this->do_subtraction(subtracted_particles_using_scaled_charged_signal,scaled_charged_background,remaining_charged_background); // remaining neutral background particles
std::vector<fastjet::PseudoJet> scaled_charged_background_used_for_subtraction=this->do_subtraction(scaled_charged_background,*remaining_charged_background);
_bge_rho= new fastjet::GridMedianBackgroundEstimator(max_eta, _grid_size_background_estimator);
if (_do_mass_subtraction) this->set_common_bge_for_rho_and_rhom(true);
_bge_rho->set_rescaling_class(rescaling);
_bge_rho->set_particles(subtracted_particles_using_scaled_charged_all);
std::vector<fastjet::PseudoJet> backgroundProxies=this->get_background_proxies_from_ghosts(_ghosts,_ghosts_area);
backgroundProxies.insert(backgroundProxies.end(), scaled_charged_background_used_for_subtraction.begin(), scaled_charged_background_used_for_subtraction.end());
this->set_max_distance(maxDeltaR);
std::vector<fastjet::PseudoJet> subtracted_particles=this->do_subtraction(selected_particles,backgroundProxies);
delete remaining_charged_background;
delete _bge_rho;
return subtracted_particles;
}
void ConstituentSubtractor::set_grid_size_background_estimator(double const &grid_size_background_estimator){
_grid_size_background_estimator=grid_size_background_estimator;
}
void ConstituentSubtractor::set_common_bge_for_rho_and_rhom(bool value){
if (!_bge_rho) throw Error("ConstituentSubtractor::set_common_bge_for_rho_and_rhom() is not allowed when _bge_rho is not set!");
if (value){
if (_bge_rhom) throw Error("ConstituentSubtractor::set_common_bge_for_rho_and_rhom() is not allowed in the presence of an existing background estimator for rho_m.");
if (_externally_supplied_rho_rhom) throw Error("ConstituentSubtractor::set_common_bge_for_rho_and_rhom() is not allowed when supplying externally the values for rho and rho_m.");
}
#if FASTJET_VERSION_NUMBER >= 30100
if (!_bge_rho->has_rho_m()){
#endif
JetMedianBackgroundEstimator *jmbge = dynamic_cast<JetMedianBackgroundEstimator*>(_bge_rho);
if (!jmbge) throw Error("ConstituentSubtractor::set_common_bge_for_rho_and_rhom() is currently only allowed for background estimators of JetMedianBackgroundEstimator type.");
#if FASTJET_VERSION_NUMBER >= 30100
}
#endif
_common_bge=value;
_do_mass_subtraction=value;
}
// setting this to true will result in rho_m being estimated using bge_rhom->rho_m() instead of bge_rhom->rho()
void ConstituentSubtractor::set_use_bge_rhom_rhom(bool value){
if (!value){
_rhom_from_bge_rhom=false;
return;
}
#if FASTJET_VERSION_NUMBER < 30100
throw Error("ConnstituentSubtractor::use_rhom_from_bge_rhom() can only be used with FastJet >=3.1.");
#else
if (!_bge_rhom) throw Error("ConstituentSubtractor::use_rhom_from_bge_rhom() requires a background estimator for rho_m.");
if (!(_bge_rhom->has_rho_m())) throw Error("ConstituentSubtractor::use_rhom_from_bge_rhom() requires rho_m support for the background estimator for rho_m.");
#endif
_rhom_from_bge_rhom=true;
_do_mass_subtraction=true;
}
void ConstituentSubtractor::set_do_mass_subtraction(bool do_mass_subtraction){
_do_mass_subtraction=do_mass_subtraction;
}
std::string ConstituentSubtractor::description() const{
std::ostringstream descr;
if ( _externally_supplied_rho_rhom){
descr << "ConstituentSubtractor using externally supplied rho = " << _rho << " and rho_m = " << _rhom << " to describe the background";
} else {
if (_bge_rhom && _bge_rho) {
descr << "ConstituentSubtractor using [" << _bge_rho->description() << "] and [" << _bge_rhom->description() << "] to estimate the background";
} else {
if (_bge_rho) descr << "ConstituentSubtractor using [" << _bge_rho->description() << "] to estimate the background";
else descr << "ConstituentSubtractor: no externally supplied rho, nor background estimator";
}
}
descr << std::endl << "perform mass subtraction: " << _do_mass_subtraction << std::endl;
return descr.str();
}
void ConstituentSubtractor::set_distance_type(Distance distance){
_distance=distance;
}
void ConstituentSubtractor::set_max_distance(double max_distance){
if (max_distance>0){
_use_max_distance=true;
_max_distance=max_distance;
}
else _use_max_distance=false;
}
+ void ConstituentSubtractor::set_sequential_parameters(std::vector<double> const &max_distances_sequential, std::vector<double> const &alphas_sequential){
+ if (max_distances_sequential.size()!= alphas_sequential.size()) throw Error("ConstituentSubtractor::set_sequential_parameters(): the provided vectors have different size. They should have the same size.");
+ if (max_distances_sequential.size()==0 || alphas_sequential.size()==0) throw Error("ConstituentSubtractor::set_sequential_parameters(): One of the provided vectors is empty. They should be not empty.");
+ _max_distances_sequential=max_distances_sequential;
+ _alphas_sequential=alphas_sequential;
+ _use_max_distance=true;
+ }
+
+
void ConstituentSubtractor::set_max_standardDeltaR(double max_distance){
this->set_max_distance(max_distance);
}
- void ConstituentSubtractor::set_max_distance_sequential(double max_distance_sequential){
- _max_distance_sequential=max_distance_sequential;
- }
double ConstituentSubtractor::get_max_distance(){
return _max_distance;
}
void ConstituentSubtractor::set_alpha(double alpha){
_alpha=alpha;
}
+ void ConstituentSubtractor::set_remove_remaining_proxies_sequential(bool remove_remaining_proxies_sequential){
+ _remove_remaining_proxies_sequential=remove_remaining_proxies_sequential;
+ }
+
void ConstituentSubtractor::set_polarAngleExp(double polarAngleExp){
_polarAngleExp=polarAngleExp;
}
void ConstituentSubtractor::set_ghost_area(double ghost_area){
_ghost_area=ghost_area;
- _ghosts_constructed=false;
+ this->clear_ghosts();
}
void ConstituentSubtractor::set_remove_zero_pt_and_mtMinusPt_particles(bool value){
_remove_zero_pt_and_mtMinusPt_particles=value;
}
void ConstituentSubtractor::set_remove_all_zero_pt_particles(bool value){
_remove_all_zero_pt_particles=value;
}
bool ConstituentSubtractor::_function_used_for_sorting(std::pair<double,std::pair<int,int> > const &i,std::pair<double,std::pair<int,int> > const &j){
return (i.first < j.first);
}
bool ConstituentSubtractor::_rapidity_sorting(fastjet::PseudoJet const &i,fastjet::PseudoJet const &j){
return (i.rap() < j.rap());
}
unsigned int ConstituentSubtractor::_find_index_after(double const &value, std::vector<double> const &vec) const{
int size=vec.size();
if (size==0) return -1;
int nIterations=log(size)/log(2)+2;
unsigned int lowerBound=0;
unsigned int upperBound=size-1;
if (value<=vec[0]) return 0;
if (value>vec[size-1]) return size; // if the value is larger than the maximal possible rapidity, than setting min to size - then also max is set to size, and nothing will be run in the loop
for (int i=0;i<nIterations;++i){
unsigned int test=(upperBound+lowerBound)/2;
if (value>vec[test]){
if (value<=vec[test+1]) return test+1;
lowerBound=test;
}
else{
if (value>vec[test-1]) return test;
upperBound=test;
}
}
return lowerBound;
}
unsigned int ConstituentSubtractor::_find_index_before(double const &value, std::vector<double> const &vec) const{
int size=vec.size();
if (size==0) return -1;
int nIterations=log(size)/log(2)+1;
unsigned int lowerBound=0;
unsigned int upperBound=size-1;
if (value<vec[0]) return 0; // if the value is lower than the minimal possible rapidity, than setting max to 0 - then also min is set to 0, and nothing will be run in the loop
if (value>=vec[size-1]) return size; // it is higher by one to account for the "<" comparison in the for loop
for (int i=0;i<nIterations;++i){
unsigned int test=(upperBound+lowerBound)/2;
if (value>=vec[test]){
if (value<vec[test+1]) return test+1; // it is higher by one to account for the "<" comparison in the for loop
lowerBound=test;
}
else{
if (value>=vec[test-1]) return test; // it is higher by one to account for the "<" comparison in the for loop
upperBound=test;
}
}
return upperBound+1;
}
- void ConstituentSubtractor::construct_ghosts_uniformly(double max_eta){
+ void ConstituentSubtractor::clear_ghosts(){
_ghosts.clear();
_ghosts_rapidities.clear();
_ghosts_area.clear();
+ _ghosts_rapidity_sorted=false;
+ _ghosts_constructed=false;
+ }
+
+
+ void ConstituentSubtractor::construct_ghosts_uniformly(double max_eta){
+ this->clear_ghosts();
_max_eta=max_eta;
double a=sqrt(_ghost_area);
_n_ghosts_phi=(2*3.14159265/a+0.5); // rounding
- int nRap=(2*max_eta/a+0.5); // rounding
+ int n_ghosts_rap=(2*max_eta/a+0.5); // rounding
_grid_size_phi=2*3.14159265/(double)_n_ghosts_phi;
- _grid_size_rap=2*max_eta/(double)nRap;
+ _grid_size_rap=2*max_eta/(double)n_ghosts_rap;
double used_ghost_area=_grid_size_phi*_grid_size_rap;
fastjet::PseudoJet ghost(0,0,0,1);
- for (int iRap=0;iRap<nRap;++iRap){
+ for (int iRap=0;iRap<n_ghosts_rap;++iRap){
double rapidity=_grid_size_rap*(iRap+0.5)-max_eta;
_ghosts_rapidities.push_back(rapidity);
for (int iPhi=0;iPhi<_n_ghosts_phi;++iPhi){
ghost.reset_momentum_PtYPhiM(1,rapidity,_grid_size_phi*(iPhi+0.5),1e-200);
if (_selector){
if (!_selector->pass(ghost)) continue;
}
_ghosts.push_back(ghost);
_ghosts_area.push_back(used_ghost_area);
}
}
+ _ghosts_rapidity_sorted=true; // the ghosts are now sorted according to rapidity. This variable needs to be set to true to be able to use faster algorithm in "do_subtraction".
_ghosts_constructed=true;
}
std::vector<fastjet::PseudoJet> ConstituentSubtractor::get_ghosts(){
return _ghosts;
}
std::vector<double> ConstituentSubtractor::get_ghosts_area(){
return _ghosts_area;
}
+
void ConstituentSubtractor::set_selector(fastjet::Selector* selector){
_selector=selector;
+ this->clear_ghosts();
}
} // namespace contrib
FASTJET_END_NAMESPACE
Index: contrib/contribs/ConstituentSubtractor/trunk/NEWS
===================================================================
--- contrib/contribs/ConstituentSubtractor/trunk/NEWS (revision 1133)
+++ contrib/contribs/ConstituentSubtractor/trunk/NEWS (revision 1134)
@@ -1,61 +1,65 @@
+2018/06/12: release of version 1.2.8:
+ - Now removing all ghosts when setting new selector
+ - Updated sequential CS - possibility to do more iterations than 2 and possibility to remove ghosts which were not used.
+
2018/05/04: release of version 1.2.7:
- Added possibility to correct only certain phase space defined by an input fastjet::Selector
- Added possibility to change the grid size for background estimation when using function subtract_event_using_charged_info
- Update example for whole event correction.
2018/05/03: release of version 1.2.6:
- Updated examples to be more clear.
2018/04/11: release of version 1.2.5:
- Fixed bug causing seg fault in ATLAS.
2017/12/18: release of version 1.2.4:
- Added back the test example_whole_event_using_charged_info. The problem with this test was fixed by printing all the output particles (also with zero pt and zeo mtMinusPt values).
2017/09/08: release of version 1.2.3:
- Fixed warning for too low pt particles in case of active area computation
- Temporarily removed the test example_whole_event_using_charged_info
2017/08/21: release of version 1.2.2:
- Added function set_max_standardDeltaR for backward compatibility. It was replaced in version 1.1.3 by function set_max_distance. In this version, it does the same as the function set_max_distance.
- Further speed improvement for whole event subtraction (especially for small _max_distance parameters, such as 0.25)
2017/08/07: release of version 1.2.1:
- Fixed bug for distance enum ConstituentSubtractor::angle
- Added check for the jet-by-jet correction to not use the speed optimization
2017/07/20: release of version 1.2.0:
- Important change for the output corrected particles in case of correction of massive particles. The corrected zero pt particles with non-zero corrected delta_m (massive particles in rest) are now included in the output by default. This is the recommended usage. The user can change this behaviour by using function "set_remove_all_zero_pt_particles". By using argument true, all the zero pt corrected particles are removed.
- Significant change in the speed of the whole event CS procedure. For small values of the _max_distance parameter (~0.25), the speed is now ~10-times greater.
- Added new rescaling classes: rapidity vs azimuth dependence in TH2 Root histogram or in vector<vector<double> >, and rapidity vs azimuth dependence for heavy ions where the rapidity dependence is taken from a vector<double>.
2017/07/11: release of version 1.1.6:
- added new functions "get_ghosts" and "get_ghosts_area".
- now the user can modify the ghosts outside the CS after constructing them with function "construct_ghosts_uniformly" and getting them with "get_ghosts" and "get_ghosts_area"
- added new rescaling class useful for heavy ion events. Now the rapidity dependence can be taken from a Root TH1 object.
2017/01/20: release of version 1.1.4:
- fixed few bugs concerning the correction of masses
2016/11/14: release of version 1.1.3:
- updated rho rescaling functions
- new function for pileup subtraction: sequential_subtraction
- possibility to change the computation of distance between particles and background proxies
2016/03/11: release of version 1.1.2:
- added two FunctionOfPseudojet<object> classes for rho rescaling: one using root TH1 rapidity parametrization, and the other for heavy ions rapidity-azimuth parametrization
2016/02/09: release of version 1.1.1:
- faster algortihm for subtraction
- added new function for Constituent Subtraction using tracking information
2015/11/05: release of version 1.1.0:
- added FastJet v3.1 rho_m support
- simplified way for Constituent Subtraction of the whole event
- updated the meaning of parameter max_deltaR
- added new parameter to the definition of the distance
- added examples for the whole event subtraction
2014/04/06: release of version 1.0.0
Index: contrib/contribs/ConstituentSubtractor/trunk/Makefile
===================================================================
--- contrib/contribs/ConstituentSubtractor/trunk/Makefile (revision 1133)
+++ contrib/contribs/ConstituentSubtractor/trunk/Makefile (revision 1134)
@@ -1,79 +1,79 @@
# If you are using this Makefile standalone and fastjet-config is not
# in your path, edit this line to specify the full path
FASTJETCONFIG=fastjet-config
PREFIX=`$(FASTJETCONFIG) --prefix`
CXX=g++
CXXFLAGS= -O3 -Wall -g -fPIC
install_script = $(SHELL) ../utils/install-sh
check_script = ../utils/check.sh
# global contrib-wide Makefile include may override some of the above
# variables (leading "-" means don't give an error if you can't find
# the file)
-include ../.Makefile.inc
#------------------------------------------------------------------------
# things that are specific to this contrib
NAME=ConstituentSubtractor
SRCS=ConstituentSubtractor.cc RescalingClasses.cc
-EXAMPLES=example_whole_event example example_background_rescaling example_whole_event_using_charged_info
+EXAMPLES=example_whole_event example_whole_event_sequential example example_background_rescaling example_whole_event_using_charged_info
INSTALLED_HEADERS=ConstituentSubtractor.hh RescalingClasses.hh
#------------------------------------------------------------------------
CXXFLAGS+= $(shell $(FASTJETCONFIG) --cxxflags)
LDFLAGS += -lm $(shell $(FASTJETCONFIG) --libs)
#CXXFLAGS+= $(shell root-config --cflags)
#LDFLAGS+= -lm $(shell root-config --libs)
OBJS = $(SRCS:.cc=.o)
EXAMPLES_SRCS = $(EXAMPLES:=.cc)
install_HEADER = $(install_script) -c -m 644
install_LIB = $(install_script) -c -m 644
install_DIR = $(install_script) -d
install_DATA = $(install_script) -c -m 644
install_PROGRAM = $(install_script) -c -s
install_SCRIPT = $(install_script) -c
.PHONY: clean distclean examples check install
# compilation of the code (default target)
all: lib$(NAME).a
lib$(NAME).a: $(OBJS)
ar cru lib$(NAME).a $(OBJS)
ranlib lib$(NAME).a
# building the examples
examples: $(EXAMPLES)
# the following construct makes it possible to automatically build
# each of the examples listed in $EXAMPLES
$(EXAMPLES): % : %.o all
$(CXX) -o $@ $< -L. -l$(NAME) $(LDFLAGS)
# check that everything went fine
check: examples
@for prog in $(EXAMPLES); do\
$(check_script) $${prog} ../data/Pythia-Zp2jets-lhc-pileup-1ev.dat || exit 1; \
done
@echo "All tests successful"
# cleaning the directory
clean:
rm -f *~ *.o
distclean: clean
rm -f lib$(NAME).a $(EXAMPLES)
# install things in PREFIX/...
install: all
$(install_DIR) $(PREFIX)/include/fastjet/contrib
for header in $(INSTALLED_HEADERS); do\
$(install_HEADER) $$header $(PREFIX)/include/fastjet/contrib/;\
done
$(install_DIR) $(PREFIX)/lib
$(install_LIB) lib$(NAME).a $(PREFIX)/lib
depend:
makedepend -Y -- -- $(SRCS) $(EXAMPLES_SRCS)
Index: contrib/contribs/ConstituentSubtractor/trunk/VERSION
===================================================================
--- contrib/contribs/ConstituentSubtractor/trunk/VERSION (revision 1133)
+++ contrib/contribs/ConstituentSubtractor/trunk/VERSION (revision 1134)
@@ -1,2 +1,2 @@
-1.2.7
+1.2.8
Index: contrib/contribs/ConstituentSubtractor/trunk/ConstituentSubtractor.hh
===================================================================
--- contrib/contribs/ConstituentSubtractor/trunk/ConstituentSubtractor.hh (revision 1133)
+++ contrib/contribs/ConstituentSubtractor/trunk/ConstituentSubtractor.hh (revision 1134)
@@ -1,246 +1,251 @@
// $Id$
//
// ConstituentSubtractor package
// Questions/comments: berta@ipnp.troja.mff.cuni.cz, Martin.Spousta@cern.ch, David.W.Miller@uchicago.edu, Rupert.Leitner@mff.cuni.cz
//
// Copyright (c) 2014-, Peter Berta, Martin Spousta, David W. Miller, Rupert Leitner
//
//----------------------------------------------------------------------
// This file is part of FastJet contrib.
//
// It is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at
// your option) any later version.
//
// It is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this code. If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------
#ifndef __FASTJET_CONTRIB_CONSTITUENTSUBTRACTOR_HH__
#define __FASTJET_CONTRIB_CONSTITUENTSUBTRACTOR_HH__
#include <fastjet/internal/base.hh>
#include <fastjet/ClusterSequenceAreaBase.hh>
#include <fastjet/tools/JetMedianBackgroundEstimator.hh>
#include <fastjet/tools/GridMedianBackgroundEstimator.hh>
#include <fastjet/PseudoJet.hh>
#include <fastjet/Selector.hh>
#include <fastjet/tools/BackgroundEstimatorBase.hh>
#include "fastjet/tools/Transformer.hh" // to derive Subtractor from Transformer
#include "fastjet/LimitedWarning.hh"
#include <algorithm>
FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
namespace contrib{
//------------------------------------------------------------------------
/// \class ConstituentSubtractor
/// A class to perform subtraction of background, e.g. pileup, from a set of particles at particle-level. The output is a jet or the whole event with corrected constituents.
///
/// This class corrects the input particles for background contamination with the algorithm described in:
/// Peter Berta, Martin Spousta, David W. Miller, Rupert Leitner [arXiv:1403.3108]
///
/// For individual jet background subtraction, see example.cc
/// For whole event background subtraction before jet clustering, see example_whole_event.cc
///
/// The distance used for matching between particle i and ghost k is defined as:
/// deltaR_{i,k}=pT_i * sin(theta_i)^polarAngleExp * sqrt((y_i-y_k)^2 + (phi_i-phi_k)^2)
///
/// The class accounts for position-dependent (in rapidity-azimuth plane) background densities, rho and rho_m. The user is encouraged to use them.
///
class ConstituentSubtractor : public fastjet::Transformer{
public:
enum Distance {
deltaR, /// deltaR=sqrt((y_i-y_j)^2+(phi_i-phi_j)^2)), longitudinal Lorentz invariant
angle /// angle between two momenta in Euclidean space
};
///
/// default ctor
- // ConstituentSubtractor() :
- // _bge_rho(0), _bge_rhom(0), _common_bge(false), _rhom_from_bge_rhom(false), _externally_supplied_rho_rhom(false), _do_mass_subtraction(false), _distance(deltaR), _alpha(0), _polarAngleExp(0), _max_distance(-1), _max_distance_sequential(-1), _remove_zero_pt_and_mtMinusPt_particles(true), _remove_all_zero_pt_particles(false), _use_max_distance(false), _ghost_area(0.01), _grid_size_phi(-1), _grid_size_rap(-1), _ghosts_constructed(false), _ghosts_rapidity_sorted(false), _n_ghosts_phi(-1), _max_eta(0), _ghosts(0), _ghosts_area(0), _ghosts_rapidities(0), _grid_size_background_estimator(0.5), _selector(0){}
ConstituentSubtractor();
///
/// Constructor that takes a pointer to a background estimator for rho and optionally a pointer to a background estimator for rho_m. If the latter is not supplied, rho_m is assumed to always be zero (this behaviour can be changed by calling use_common_bge_for_rho_and_rhom).
ConstituentSubtractor(fastjet::BackgroundEstimatorBase *bge_rho, fastjet::BackgroundEstimatorBase *bge_rhom=0, double alpha=0, double max_distance=-1, Distance distance=deltaR);
///
/// Constructor that takes an externally supplied value for rho and rho_m.
ConstituentSubtractor(double rho, double rhom=0, double alpha=0, double max_distance=-1, Distance distance=deltaR);
///
/// default dtor
virtual ~ConstituentSubtractor(){}
///
/// a description of what this class does
virtual std::string description() const;
///
/// action of the correction on a given jet. The output is PseudoJet object with subtracted constituents
virtual fastjet::PseudoJet result(const fastjet::PseudoJet &jet) const;
///
/// do the constituent subtraction for the input particles using the provided background proxies. The output is a vector with corrected particles - particles with zero corrected pt are removed.
std::vector<fastjet::PseudoJet> do_subtraction(std::vector<fastjet::PseudoJet> const &particles, std::vector<fastjet::PseudoJet> const &backgroundProxies,std::vector<fastjet::PseudoJet> *remaining_backgroundProxies=0) const;
///
/// do the subtraction of the whole event - more user-friendly approach. The particles with |eta|>max_eta are discarded at the beginning, i.e. they are not used, nor returned. The ghosts are added automatically inside this function up to max_eta.
std::vector<fastjet::PseudoJet> subtract_event(std::vector<fastjet::PseudoJet> const &particles, double max_eta);
///
/// do the subtraction of the whole event using the tracking information for charged particles, i.e. the 4-momenta of charged particles from signal vertex, and 4-momenta of charged particles from background. The user can set the scaling of charged particles from background and signal using parameters charged_background_scale (CBS) and charged_signal_scale (CSS). These scales are useful if one assumes correlation between charged and neutral particles or in case the inputs from calorimeter are miscalibrated wrt tracks. In case CBS=CSS=0, the input charged particles are not used. In case CBS=CSS=1, the input charged particles are not scaled. Recommending to try several combinations for CBS and CSS from range [0.8, 1.5]. It is no more necessary to provide background estimator. The GridMedianBackgroundEstimator is used - probably more flexibility will be added in the future. The rescaling function for background estimator can be also provided - the rescaling function will be used for the event after subtracting charged scaled particles. The particles with |eta|>max_eta are discarded at the beginning, i.e. they are not used, nor returned.
std::vector<fastjet::PseudoJet> subtract_event_using_charged_info(std::vector<fastjet::PseudoJet> const &particles, double charged_background_scale, std::vector<fastjet::PseudoJet> const &charged_background, double charged_signal_scale, std::vector<fastjet::PseudoJet> const &charged_signal, double max_eta, fastjet::FunctionOfPseudoJet<double> *rescaling=0);
///
/// set the grid size (not area) for the background estimation with GridMedianBackgroundEstimator when using charged info
void set_grid_size_background_estimator(double const &grid_size_background_estimator);
-
+
///
- /// do the subtraction of the whole event in two steps: in the first step, arbitrary small max_distance is used (using function set_max_distance_sequential), and in the second step larger max_distance can be used (using function set_max_distance) to subtract the remaining background proxies. The particles with |eta|>max_eta are discarded at the beginning, i.e. they are not used, nor returned.
- std::vector<fastjet::PseudoJet> sequential_subtraction(std::vector<fastjet::PseudoJet> const &particles, double max_eta);
-
+ /// do the subtraction of the whole event in several steps: In each step, CS procedure is done using the CS parameters specified in set_iterative_parameters. After each CS procedure, the remaining background is estimated and used for the next step. The background proxies which were not used are dropped. The particles with |eta|>max_eta are discarded at the beginning, i.e. they are not used, nor returned.
+ std::vector<fastjet::PseudoJet> sequential_subtraction(std::vector<fastjet::PseudoJet> const &particles, double const &max_eta);
+
///
/// Set the pointer to a background estimator for rho and optionally a pointer to a background estimator for rho_m. If the latter is not supplied, rho_m is assumed to always be zero (this behaviour can be changed by calling use_common_bge_for_rho_and_rhom).
void set_background_estimator(fastjet::BackgroundEstimatorBase *bge_rho, fastjet::BackgroundEstimatorBase *bge_rhom=0);
///
/// Set the scalar background densities rho and rho_m.
void set_scalar_background_density(double rho, double rhom=0);
///
/// when only one background estimator, bge_rho, is specified, calling this function with argument true, causes rho_m to be calculated from the same background estimator as rho, instead of being set to zero. Currently this only works if the estimator is a JetMedianBackgroundEstimator or other estimator which has such function.
void set_common_bge_for_rho_and_rhom(bool value=true);
///
/// when two background estimators are used (one for rho, the second for rho_m), setting this to true will result in rho_m being estimated using bge_rhom->rho_m() instead of bge_rhom->rho().
void set_use_bge_rhom_rhom(bool value=true);
///
/// specify if also the mass term sqrt(pT^2+m^2)-pT should be corrected during the subtraction procedure. This is automatically set when calling functions set_common_bge_for_rho_and_rhom, set_scalar_background_density or set_use_bge_rhom_rhom
void set_do_mass_subtraction(bool value=true);
///
/// set to true, if you want to remove particles which have zero both, pt and mtMinusPt. By default, these particles are removed.
void set_remove_zero_pt_and_mtMinusPt_particles(bool value=true);
///
/// set to true, if you want to remove all zero pt particles - this means removing also particles with zero delta_m (massive particles with zero pt). By default, the zero pt particles with non-zero delta_m are not removed.
void set_remove_all_zero_pt_particles(bool value=true);
///
/// function to change the alpha-parameter figuring in the distance measure deltaR. The larger the alpha, the more are preferred to be corrected the low pt particles. The default value is 0, i.e. by default the standard deltaR definition is used: deltaR=sqrt(deltay^2 + deltaphi^2)
void set_alpha(double alpha);
///
/// function to change the parameter polarAngleExp
void set_polarAngleExp(double polarAngleExp);
///
+ /// function to set the _remove_remaining_proxies_sequential member. If set to true, then the proxies with non-zero remaining pt are discarded in the sequential CS
+ void set_remove_remaining_proxies_sequential(bool remove_remaining_proxies_sequential);
+
+
+ ///
/// function to change the parameter ghost_area
void set_ghost_area(double ghost_area);
///
/// function to change the distance type
void set_distance_type(Distance distance);
///
/// function to change the free parameter max_distance. The distance is defined by enum Distance. The particle-ghost pairs with distance>max_distance are not used. When max_distance<=0, the max_distance parameter is not used (no upper limit on distance). The default value is -1, i.e. by default there is no upper limit for possible distance values.
void set_max_distance(double max_distance);
///
/// function to change the free parameter max_distance. It is the same as the set_max_distance function. It is added back for backward-comptibility (since it was replaced in ConstituentSubtractor version 1.1.3 with function set_max_distance). It should be not used.
void set_max_standardDeltaR(double max_distance);
- ///
- /// function to change the free parameter max_distance_sequential for sequantial subtraction. This is the smaller maximal deltaR distance used in the first subtraction.
- void set_max_distance_sequential(double max_distance_sequential);
-
///
/// function to return the maximal deltaR distance used in the subtraction
double get_max_distance();
///
/// This function returns true if the first argument is smaller than the second argument, otherwise returns false. The comparison is done only on the first element in the two pairs. This function is used to sort in ascending order the deltaR values for each pair particle-ghost while keeping track of particles and ghosts
static bool _function_used_for_sorting(std::pair<double,std::pair<int,int> > const &i,std::pair<double,std::pair<int,int> > const &j);
///
/// function used for sorting of Pseudojets according to eta
static bool _rapidity_sorting(fastjet::PseudoJet const &i,fastjet::PseudoJet const &j);
///
/// Function to construct massless ghosts in the whole eta-phi space up to max_eta
void construct_ghosts_uniformly(double max_eta);
///
/// Function to return vector of ghosts
std::vector<fastjet::PseudoJet> get_ghosts();
///
/// Function to return vector of areas associated to ghosts
std::vector<double> get_ghosts_area();
///
/// Set selector - this allows to perform Constituent Subtraction in certain phase space when using the whole event correction. Only ghosts which pass the selector are used in the correction. No selection is done on particles (i.e. the user needs to perform the selection before applying ConstituentSubtractor if he/she wishes). The default behaviour is to not use any selector. The user should remember that the max_eta restriction is applied in any case, e.g. when using the function "subtract_event(particles,max_eta)", then ghosts are distributed to maximal eta max_eta and particles outside this region are discarded.
void set_selector(fastjet::Selector* selector);
+ ///
+ /// Set maximal distance and alpha parameters for the sequential CS
+ void set_sequential_parameters(std::vector<double> const &max_distances_sequential, std::vector<double> const &alphas_sequential);
protected:
std::vector<fastjet::PseudoJet> get_background_proxies_from_ghosts(std::vector<fastjet::PseudoJet> const &ghosts,std::vector<double> const &ghosts_area) const;
+ void clear_ghosts();
/// helper functions to find the minimal and maximal indeces for the vector of particles - useful to make the CS procedure faster
unsigned int _find_index_after(double const &value, std::vector<double> const &vec) const;
unsigned int _find_index_before(double const &value, std::vector<double> const &vec) const;
fastjet::BackgroundEstimatorBase *_bge_rho, *_bge_rhom;
bool _common_bge, _rhom_from_bge_rhom;
double _rho, _rhom;
bool _externally_supplied_rho_rhom, _do_mass_subtraction;
Distance _distance;
double _alpha;
double _polarAngleExp;
double _max_distance;
- double _max_distance_sequential;
+ std::vector<double> _max_distances_sequential;
+ std::vector<double> _alphas_sequential;
bool _remove_zero_pt_and_mtMinusPt_particles;
bool _remove_all_zero_pt_particles;
bool _use_max_distance;
double _ghost_area;
double _grid_size_phi;
double _grid_size_rap;
bool _ghosts_constructed;
bool _ghosts_rapidity_sorted;
+ bool _remove_remaining_proxies_sequential;
int _n_ghosts_phi;
double _max_eta;
std::vector<fastjet::PseudoJet> _ghosts;
std::vector<double> _ghosts_area;
std::vector<double> _ghosts_rapidities; // used for uniform grid
double _grid_size_background_estimator;
fastjet::Selector *_selector;
static LimitedWarning _warning_unused_rhom;
};
} // namespace contrib
FASTJET_END_NAMESPACE
#endif // __FASTJET_CONTRIB_CONSTITUENTSUBTRACTOR_HH__
Index: contrib/contribs/ConstituentSubtractor/trunk/ChangeLog
===================================================================
--- contrib/contribs/ConstituentSubtractor/trunk/ChangeLog (revision 1133)
+++ contrib/contribs/ConstituentSubtractor/trunk/ChangeLog (revision 1134)
@@ -1,321 +1,342 @@
+2018-06-12 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
+
+ * VERSION:
+ - Set version number to 1.2.8
+
+ * ConstituentSubtractor.cc
+ * ConstituentSubtractor.hh
+ - Added new function: clean_ghosts. Now when setting new selector, the current ghosts are removed - then when doing subtraction, new ghosts are constructed.
+ - Updated sequential CS:
+ - Added possibility to perform CS procedure any number of times (previously only twice). Now, the maximal distance and alphas should be specified as vectors using function "set_sequential_parameters"
+ - Added possibility to remove the unsubtracted ghosts (proxies) from the previous CS procedure for the next application of CS procedure
+
+
+ * example_whole_event_sequential.cc
+ * example_whole_event_sequential.ref
+ * Makefile
+ - Added example for the sequential CS
+
+
+
+
2018-05-04 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.2.7
* ConstituentSubtractor.cc
* ConstituentSubtractor.hh
- Added possibility to perform whole event correction in a certain phase space defined by input Selector
- Added possibity to change the grid size for GridMedianBackgroundEstimator when using charged info - the default value is now 0.5
- Faster correction in case the distance is ConstituentSubtractor::angle
* example_whole_event.cc
* example_whole_event_using_charged_info.cc
- Updated examples
* example_whole_event.ref
* example_whole_event_using_charged_info.ref
- Updated references to correspond to updated examples
2018-05-03 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.2.6
* example.cc
* example_whole_event.cc
* example_background_rescaling.cc
* example_whole_event_using_charged_info.cc
* functions.hh
- Updated examples and added more comments
* example.ref
* example_whole_event.ref
* example_background_rescaling.ref
* example_whole_event_using_charged_info.ref
- Updated references to correspond to updated examples
2018-04-11 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.2.5
* ConstituentSubtractor.cc
- Fixed bug causing seg fault in ATLAS. The seg fault happened very rarely for events in which the particle with minimal or maximal rapidity had had rapidity of special value (dependent on the parameters of ConstituentSubtractor).
* functions.hh
- In read_event added possibility to read event in format (pt, rap, phi, pid, charge) assuming zero masses.
2017-12-18 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.2.4
* ConstituentSubtractor.cc
* ConstituentSubtractor.hh
- Added function set_remove_zero_pt_and_mtMinusPt_particles. When set to true, all particles are kept in the output. If set to false (default), the particles with zero pt and zero mtMinusPt are removed.
* Makefile
- Added back the test example_whole_event_using_charged_info.
* example_whole_event_using_charged_info.cc
* example_whole_event_using_charged_info.ref
- using set_remove_zero_pt_and_mtMinusPt_particles(false), printing more digits for the output, and changed the reference. Now this test is successful also for Gavin Salam.
2017-09-08 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.2.3
* ConstituentSubtractor.cc
- In the previous version the zero pt massive corrected particles had pt set to 1e-200. This caused a warning when the active area was used during clustering. Now, the zero pt is set to 1e-50, which removed the warning.
* Makefile
- Temporarily removed the test example_whole_event_using_charged_info. The reason is that it gives different output particles when running on MacOS 10.12.6, Apple LLVM version 8.1.0 (clang-802.0.42) as Gavin Salam found. The difference is tiny: one zero pt and zero mass particle appears additionally when running on MAC, which has no impact on the performance of the correction.
2017-08-21 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.2.2
* ConstituentSubtractor.cc
* ConstituentSubtractor.hh
- Added function set_max_standardDeltaR for backward compatibility. It was replaced in version 1.1.3 by function set_max_distance. In this version, it does the same as the function set_max_distance.
- Further speed improvement for whole event subtraction (especially for small _max_distance parameters, such as 0.25)
2017-08-07 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.2.1
* ConstituentSubtractor.cc
- Fixed bug for the distance enum ConstituentSubtractor::angle. Previously, the optimized rapidity ranges were used also for this distance type which was wrong. Now, the whole rapidity range is used (without optimization).
- Checking if ghosts are constructed for the jet-by-jet subtraction. In case they are constructed, error is thrown since such ConstituentSubtractor should be used only for whole event subtraction, and not jet-by-jet.
2017-07-20 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.2.0
* ConstituentSubtractor.cc
* ConstituentSubtractor.hh
- Important change for the output corrected particles in case of correction of massive particles. The corrected zero pt particles with non-zero corrected delta_m (massive particles in rest) are now included in the output. Previously, all the zero pt corrected particles were discarded. Now, only the zero pt and zero delta_m corrected particles are discarded. The corrected particles with zero pt and non-zero delta_m are kept (their pt is set to very small value (1e-200 GeV)). This should have better performance for jet energy and jet mass. If the user wants, he/she can still discard those zero pt particles in his/her own code, e.g. by requiring particles with pt > 1e-100 GeV.
- Implemented changes to significantly increase the speed of the CS algorithm for the whole event subtraction. The performance is exactly the same. Only the speed is much higher. For small values of _max_distance parameter, the speed is now ~10-times higher. For larger values of the _max_distance parameter, the speed is ~2-times higher.
* RescalingClasses.cc
* RescalingClasses.hh:
- Added new rescaling classes:
- BackgroundRescalingYPhiFromRoot - rescaling of background using Root TH2 histogram binned in rapidity vs azimuth
- BackgroundRescalingYPhiUsingVectorForY - rescaling of background for heavy ions - using eliptic flow parameters and rapidity dependence recorded in a vector<double>
- BackgroundRescalingYPhiUsingVectors - rescaling of background using objcet vector<vector<double> > containing the rapidity vs azimuth dependence
* example_background_rescaling.cc
- Added more examples for usage of rescaling classes
* example_background_rescaling.ref
* example.ref
* example_whole_event.ref
* example_whole_event_using_charged_info.ref
- Updated example outputs due to the inclusion of massive zero pt corrected particles in the output.
2017-07-11 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.1.6
* ConstituentSubtractor.cc
* ConstituentSubtractor.hh
- Implemented suggestion from Marta Verweij:
- Added new functions: "get_ghosts" and "get_ghosts_area". They return the vector of ghosts and the corresponding ghost areas used for whole event subtraction.
- Changed the function "construct_ghosts_uniformly" to be public
- Now the user does not need to provide the BackgroundEstimator to CS, but he/she can do background estimation independently and then assign the estimated background to ghosts. The procedure is the following:
- construct the ghosts with function "construct_ghosts_uniformly"
- get them with functions "get_ghosts" and "get_ghosts_area"
- do background estimation independently and assign the corresponding background estimates to ghosts
- use the function "do_subtraction" to subtract the modified ghosts from real particles.
* RescalingClasses.cc
* RescalingClasses.hh:
- Added new rescaling class template BackgroundRescalingYFromRootPhi - useful mainly for heavy ion events. The rapidity dependance is taken from a Root TH1 object provided by the user. The next parameters are used to parametrize the eliptic flow.
* example_background_rescaling.cc
- Added example for usage of the new rescaling class BackgroundRescalingYFromRootPhi (commented at the beginning of the macro).
2017-01-25 Gavin Salam <gavin.salam@cern.ch>
* VERSION:
updated VERSION to 1.1.5
* Makefile:
- resolved issue with make fragile-shared, caused by repeated
SRCS lines in the Makefile. Also removed other duplicates.
2017-01-20 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.1.4
* ConstituentSubtractor.cc
- fixed rounding issues for zero masses, when doing the correction of term mtMinusPt
- more precise evaluation of corrected 4-momenta, which affected the mass of corrected particles with low masses
- added new function set_do_mass_subtraction
* ConstituentSubtractor.hh
- fixed initialization of member variable "_do_mass_subtraction"
- added new function set_do_mass_subtraction
* example_whole_event.ref, example_whole_event.cc:
- updated reference file. Added also all corrected particles.
* example_whole_event_using_charged_info.ref, example_whole_event_using_charged_info.cc:
- updated reference file. Added also all corrected particles.
2016-11-14 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
- Set version number to 1.1.3
* ConstituentSubtractor.cc
* ConstituentSubtractor.hh:
- Fixed bug in "do_subtraction" function for the unsubtracted background proxies.
- Added new function "sequential_subtraction" - for testing purposes so far, example will be added later. The ConstituentSubtraction is performed twice: first with small maximal allowed deltaR distance, then the background proxies are again uniformly redistributed and the ConstituentSubtraction runs second time with higher allowed maximal deltaR
- Added new function "set_distance_type". With this function, the user can change the definition of distance between particles and background proxies. There are two possibilities using enums Distance: deltaR (longitudinal Lorentz invariant distance in rapidity vs. phi) or angle (in Euclidean space). The default distance is deltaR, i.e. the same definition of distance as in previous versions.
* Makefile:
- Removed dependence on Root. Using template in RescalingClasses now.
* RescalingClasses.cc
* RescalingClasses.hh:
- Removed dependence on Root for the rescaling using TH1 histogram. Using template now. Also the name of the class changed. Old name: BackgroundRescalingYTH1. New name: BackgroundRescalingYFromRoot
- Changed the name of the rescaling class for heavy ion events. Old name: BackgroundRescalingYPhiHeavyIon. New name: BackgroundRescalingYPhi. Also the description of the rescaling function is updated.
* example_rescaling_using_TH1.cc
* example_rescaling_using_TH1.ref:
- Removed
* example_background_rescaling.cc
* example_background_rescaling.ref:
- Added new example for usage of Heavy Ion background rescaling function
- The file example_background_rescaling.cc contains also commented example for usage of rapidity rescaling according to root's TH1 distribution
* example_whole_event.cc:
- Updated this example with usage of the "set_distance_type" function.
2016-03-11 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
set version number to 1.1.2
* Makefile:
- added CXXFLAGS and LDFLAGS in case the "ROOTSYS" variable is defined from ROOT. In case it is not defined, the standard usage still works, just the RescalingClasses are not compiled.
* RescalingClasses.cc:
* RescalingClasses.hh:
- New files: contain classes for rho estimation rescaling. Two classes were added:
- BackgroundRescalingYTH1 - input is a TH1 object (stabdard histogram in ROOT) containg the actual rapidity dependence of backgound pt
- BackgroundRescalingYPhiHeavyIon - input are 8 parameters. The first four parameters parametrize the elliptic flow. The next four parameters parametrize the rapidity dependence using two Gaussian distributions
* example_rescaling_using_TH1.cc:
* example_rescaling_using_TH1.ref:
- New files: example in which the ConstituentSubtractor is used for the whole event subtraction using rapidity rescaling for the rho estimation. The input for rapidity rescaling is a TH1 object
2016-02-09 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
set version number to 1.1.1
* ConstituentSubtractor.hh:
* ConstituentSubtractor.cc:
- Faster algorithm for subtraction in the "do_subtraction" member function.
- New member function: subtract_event_using_charged_info
- whole event subtraction
- 4 additional inputs: two vectors of PseudoJets for charged background and charged signal, and two doubles, charged background scale (CBS) and charged signal scale (CSS)
- the scales CBS and CSS scale the input charged particles. Useful if one assumes correlation between charged and neutral particles or in case the inputs from calorimeter are miscalibrated wrt tracks. In case CBS=CSS=0, the input charged particles are not used. In case CBS=CSS=1, the input charged particles are not scaled. Recommending to try several combinations for CBS and CSS from range [0.8, 1.5].
- the background estimation is built in this function using GridMedianBackgroundEstimator with possibility to rescale
- see example file "example_whole_event_using_charged_info.cc" for usage
* example_whole_event_using_charged_info.cc:
* example_whole_event_using_charged_info.ref:
- New files: example in which the ConstituentSubtractor is used for the whole event subtraction using tracking information for charged particles
* functions.h:
- Updated function "read_event". Now, obtaining also the vectors of charged particles originating from signal and background.
2015-11-05 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION:
set version number to 1.1.0
* Makefile:
- added "-fPIC" CXX flag
* ConstituentSubtractor.hh:
* ConstituentSubtractor.cc:
- updated output for result(PseudoJet): copying the "user_index" from the input jet and its constituents to the output corrected jet and its constituents
- discarded the original max_deltaR parameter, and replaced it by parameter max_standardDeltaR defined as standardDeltaR=sqrt(deltay^2 + deltaphi^2). This new parameter restricts the usage of ghost-particle pairs which have too large distance standardDeltaR, i.e. not the distance deltaR which is the standardDeltaR multiplied by other factors as in the previous version.
- added a new multiplicative factor (sin(theta_i))^polarAngleExp into the definition of distance for a ghost-particle pair. Angle theta_i is the polar angle of partile i. The polarAngleExp is a free parameter with default value polarAngleExp=0, i.e. the default definition of deltaR has not changed wrt previous version. It can be changed using set_polarAngleExp member function
- changed the structure of the package and its member functions
- the standard usage with result(PseudoJet) is the same and it gives the same results as in previous version
- new member functions are available to simplify the whole event subtraction: subtract_event, set_background_estimator, set_scalar_background_density, see example file example_whole_event.cc
- similar changes as in GenericSubtractor due to FJ>=3.1:
- added set_common_bge_for_rho_and_rhom() and removed use_common_bge_for_rho_and_rhom()
- added set_use_bge_rhom_rhom() to tweak how rho_m is obtained when ConstituentSubtractor has been constructed with two estimators
- altered common_bge_for_rho_and_rhom() and added use_bge_rhom_rhom() to retrieve the behaviour
- added a warning when rhom is non-zero and unused
- Updated the terminology:
- ghosts - soft particles distributed with high density
- background proxies - particles used in the "do_subtraction" member function. They can be obtained from ghosts or in other way. Previously, these particles were also called "ghosts"
* example_whole_event.cc:
* example_whole_event.ref:
-new files: example in which the ConstituentSubtractor is used for the whole event
* functions.h:
-new file: contains useful functions for the example files
* example.hh:
-removed. Content moved to file functions.h
2014-04-06 Peter Berta <berta@ipnp.troja.mff.cuni.cz>
* VERSION
Release of version 1.0.0
Index: contrib/contribs/ConstituentSubtractor/trunk/example_whole_event_sequential.ref
===================================================================
--- contrib/contribs/ConstituentSubtractor/trunk/example_whole_event_sequential.ref (revision 0)
+++ contrib/contribs/ConstituentSubtractor/trunk/example_whole_event_sequential.ref (revision 1134)
@@ -0,0 +1,474 @@
+# 20 pileup events on top of the hard event
+# read an event with 203 signal particles and 1714 background particles with pseudo-rapidity |eta|<4
+#--------------------------------------------------------------------------
+# FastJet release 3.3.1
+# M. Cacciari, G.P. Salam and G. Soyez
+# A software package for jet finding and analysis at colliders
+# http://fastjet.fr
+#
+# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package
+# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210].
+#
+# FastJet is provided without warranty under the terms of the GNU GPLv2.
+# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code
+# and 3rd party plugin jet algorithms. See COPYING file for details.
+#--------------------------------------------------------------------------
+ConstituentSubtractor using [GridMedianBackgroundEstimator, with rectangular grid with rapidity extent -4 < rap < 4, tile size drap x dphi = 0.5 x 0.483322] to estimate the background
+perform mass subtraction: 1
+
+
+Corrected particles in the whole event:
+pt = 0.1481, phi = 0.9369, rap = -3.9811, |mass| = 0.0000
+pt = 0.9416, phi = 5.2599, rap = -3.6581, |mass| = 0.0000
+pt = 0.2613, phi = 4.9980, rap = -3.6347, |mass| = 0.0000
+pt = 0.0477, phi = 6.0961, rap = -3.6121, |mass| = 0.0000
+pt = 0.5278, phi = 5.6861, rap = -3.5493, |mass| = 0.0000
+pt = 0.1496, phi = 2.6409, rap = -3.4932, |mass| = 0.0000
+pt = 0.6026, phi = 5.5855, rap = -3.4828, |mass| = 0.0483
+pt = 2.0650, phi = 6.0415, rap = -3.4827, |mass| = 0.0000
+pt = 0.0000, phi = 3.8922, rap = -3.4649, |mass| = 0.1994
+pt = 0.4496, phi = 4.9418, rap = -3.4609, |mass| = 0.0000
+pt = 0.5233, phi = 5.4112, rap = -3.4232, |mass| = 0.4181
+pt = 0.3619, phi = 6.0661, rap = -3.4124, |mass| = 0.0000
+pt = 0.0296, phi = 3.2413, rap = -3.3861, |mass| = 0.0000
+pt = 0.3637, phi = 0.2742, rap = -3.3640, |mass| = 0.3874
+pt = 0.1199, phi = 2.2892, rap = -3.3465, |mass| = 0.0000
+pt = 1.2549, phi = 5.8966, rap = -3.3435, |mass| = 0.0000
+pt = 0.0000, phi = 5.2003, rap = -3.3432, |mass| = 0.0073
+pt = 1.1072, phi = 2.2916, rap = -3.3330, |mass| = 0.0000
+pt = 0.1593, phi = 0.2181, rap = -3.3282, |mass| = 0.0000
+pt = 0.0167, phi = 2.6996, rap = -3.3022, |mass| = 0.0000
+pt = 2.5965, phi = 3.0096, rap = -3.2831, |mass| = 0.0000
+pt = 0.0054, phi = 3.1885, rap = -3.2531, |mass| = 0.0000
+pt = 0.0000, phi = 2.6619, rap = -3.2396, |mass| = 0.0654
+pt = 0.0000, phi = 0.3627, rap = -3.2328, |mass| = 0.3361
+pt = 0.0610, phi = 5.4556, rap = -3.2297, |mass| = 0.0000
+pt = 0.6469, phi = 1.4148, rap = -3.2284, |mass| = 0.0000
+pt = 0.0448, phi = 4.5544, rap = -3.1881, |mass| = 0.0000
+pt = 0.0517, phi = 1.3714, rap = -3.1792, |mass| = 0.0000
+pt = 1.1636, phi = 5.9358, rap = -3.1711, |mass| = 0.0000
+pt = 0.0595, phi = 4.5317, rap = -3.1631, |mass| = 0.0000
+pt = 1.1888, phi = 5.7996, rap = -3.1614, |mass| = 0.0000
+pt = 1.8122, phi = 4.4399, rap = -3.1188, |mass| = 0.0000
+pt = 0.2107, phi = 3.0074, rap = -3.1125, |mass| = 0.0000
+pt = 2.9138, phi = 3.1301, rap = -3.0963, |mass| = 0.0000
+pt = 0.0000, phi = 5.5487, rap = -3.0883, |mass| = 0.3453
+pt = 0.6539, phi = 4.5479, rap = -3.0839, |mass| = 0.0000
+pt = 0.0000, phi = 1.5830, rap = -3.0695, |mass| = 0.3096
+pt = 0.4656, phi = 2.7204, rap = -3.0545, |mass| = 0.0000
+pt = 0.0286, phi = 3.1922, rap = -3.0462, |mass| = 0.2622
+pt = 1.0249, phi = 5.6871, rap = -3.0433, |mass| = 0.4178
+pt = 0.5015, phi = 4.5763, rap = -3.0201, |mass| = 0.0000
+pt = 0.0000, phi = 3.9943, rap = -3.0179, |mass| = 0.2219
+pt = 0.4770, phi = 5.6925, rap = -3.0015, |mass| = 0.0000
+pt = 0.3560, phi = 0.7339, rap = -2.9925, |mass| = 0.0000
+pt = 0.0000, phi = 2.2128, rap = -2.9837, |mass| = 0.2192
+pt = 0.3787, phi = 5.2605, rap = -2.9511, |mass| = 0.0000
+pt = 0.6698, phi = 5.4574, rap = -2.9496, |mass| = 0.0000
+pt = 0.1165, phi = 5.1677, rap = -2.9463, |mass| = 0.0000
+pt = 0.0000, phi = 0.5490, rap = -2.8994, |mass| = 0.4656
+pt = 0.0000, phi = 4.9348, rap = -2.8828, |mass| = 0.1582
+pt = 0.3678, phi = 5.7954, rap = -2.8763, |mass| = 0.0000
+pt = 0.1759, phi = 5.1832, rap = -2.8757, |mass| = 0.5317
+pt = 0.1289, phi = 4.9577, rap = -2.8737, |mass| = 0.0000
+pt = 2.3043, phi = 5.0940, rap = -2.8440, |mass| = 0.0000
+pt = 0.7218, phi = 5.1006, rap = -2.8366, |mass| = 0.0000
+pt = 0.0000, phi = 3.3478, rap = -2.8257, |mass| = 0.0635
+pt = 0.0165, phi = 0.2435, rap = -2.8043, |mass| = 0.0000
+pt = 0.4259, phi = 5.0895, rap = -2.7945, |mass| = 0.0000
+pt = 0.2245, phi = 5.7579, rap = -2.7939, |mass| = 0.0000
+pt = 0.0000, phi = 5.2141, rap = -2.7867, |mass| = 0.0578
+pt = 0.6973, phi = 3.2932, rap = -2.7708, |mass| = 0.0000
+pt = 0.0000, phi = 4.3799, rap = -2.7333, |mass| = 0.1967
+pt = 0.1328, phi = 5.0971, rap = -2.7245, |mass| = 0.0000
+pt = 1.0399, phi = 4.3266, rap = -2.7104, |mass| = 0.6268
+pt = 0.0000, phi = 4.2022, rap = -2.7075, |mass| = 0.2088
+pt = 0.0000, phi = 5.0719, rap = -2.7002, |mass| = 0.1672
+pt = 0.2625, phi = 4.9647, rap = -2.6730, |mass| = 0.1313
+pt = 0.0597, phi = 0.7724, rap = -2.6691, |mass| = 0.0000
+pt = 1.2778, phi = 3.7925, rap = -2.6181, |mass| = 0.0000
+pt = 0.0264, phi = 4.2586, rap = -2.6133, |mass| = 0.0000
+pt = 0.3784, phi = 5.2473, rap = -2.5999, |mass| = 0.0000
+pt = 0.3087, phi = 0.7727, rap = -2.5978, |mass| = 0.0000
+pt = 0.4846, phi = 0.8228, rap = -2.5632, |mass| = 0.5003
+pt = 0.2371, phi = 5.4743, rap = -2.5477, |mass| = 0.0000
+pt = 1.0253, phi = 3.7936, rap = -2.5437, |mass| = 0.5948
+pt = 0.7009, phi = 0.7076, rap = -2.5349, |mass| = 0.0000
+pt = 0.0000, phi = 0.2840, rap = -2.5265, |mass| = 0.2793
+pt = 0.0000, phi = 2.2234, rap = -2.5120, |mass| = 0.0620
+pt = 0.6466, phi = 3.8120, rap = -2.5092, |mass| = 0.0000
+pt = 0.0000, phi = 3.6720, rap = -2.5091, |mass| = 0.1487
+pt = 0.4371, phi = 5.7415, rap = -2.5082, |mass| = 0.0000
+pt = 0.0000, phi = 0.0331, rap = -2.4937, |mass| = 0.0786
+pt = 0.0095, phi = 5.5739, rap = -2.4928, |mass| = 0.0000
+pt = 0.4393, phi = 5.7067, rap = -2.4847, |mass| = 0.0000
+pt = 0.2766, phi = 2.2857, rap = -2.4781, |mass| = 0.0000
+pt = 0.0000, phi = 2.9924, rap = -2.4641, |mass| = 0.5779
+pt = 0.4238, phi = 2.3820, rap = -2.4577, |mass| = 0.0000
+pt = 0.4217, phi = 2.2732, rap = -2.3606, |mass| = 0.0000
+pt = 0.5825, phi = 5.6589, rap = -2.3513, |mass| = 0.0000
+pt = 0.0970, phi = 2.6826, rap = -2.3242, |mass| = 0.0000
+pt = 0.2949, phi = 4.2981, rap = -2.3130, |mass| = 0.0000
+pt = 0.0000, phi = 0.3706, rap = -2.2746, |mass| = 0.3145
+pt = 0.1110, phi = 4.0379, rap = -2.2709, |mass| = 0.0000
+pt = 0.5954, phi = 6.1109, rap = -2.2503, |mass| = 0.0000
+pt = 0.3484, phi = 2.0559, rap = -2.2459, |mass| = 0.0000
+pt = 0.0000, phi = 6.1442, rap = -2.2092, |mass| = 0.4588
+pt = 0.0000, phi = 4.5712, rap = -2.1491, |mass| = 0.0992
+pt = 0.2848, phi = 5.8451, rap = -2.1326, |mass| = 0.0000
+pt = 0.0000, phi = 4.1152, rap = -2.0535, |mass| = 0.5457
+pt = 0.1268, phi = 5.2157, rap = -2.0325, |mass| = 0.0000
+pt = 1.1831, phi = 1.7065, rap = -1.9364, |mass| = 0.5307
+pt = 0.0000, phi = 0.8735, rap = -1.8499, |mass| = 0.6432
+pt = 0.0000, phi = 3.4576, rap = -1.8215, |mass| = 0.1325
+pt = 0.1896, phi = 4.1310, rap = -1.7928, |mass| = 0.0000
+pt = 0.0000, phi = 1.3401, rap = -1.7845, |mass| = 0.1765
+pt = 0.0262, phi = 4.2501, rap = -1.7797, |mass| = 0.0000
+pt = 0.0000, phi = 1.7075, rap = -1.7557, |mass| = 0.6685
+pt = 0.0000, phi = 2.6678, rap = -1.7347, |mass| = 0.0316
+pt = 0.0000, phi = 3.2763, rap = -1.7060, |mass| = 0.2116
+pt = 0.3915, phi = 4.0208, rap = -1.6984, |mass| = 0.0000
+pt = 0.0000, phi = 5.1647, rap = -1.6698, |mass| = 0.2951
+pt = 0.0000, phi = 4.4350, rap = -1.6529, |mass| = 0.4573
+pt = 0.0000, phi = 1.6670, rap = -1.6500, |mass| = 0.4123
+pt = 0.0000, phi = 5.8112, rap = -1.5848, |mass| = 0.1305
+pt = 0.2021, phi = 4.3785, rap = -1.5446, |mass| = 0.0000
+pt = 0.0000, phi = 3.5581, rap = -1.5446, |mass| = 0.5643
+pt = 0.0000, phi = 1.6547, rap = -1.5117, |mass| = 0.0014
+pt = 0.0000, phi = 1.6392, rap = -1.5083, |mass| = 0.4679
+pt = 0.1144, phi = 4.4482, rap = -1.4965, |mass| = 0.0000
+pt = 0.0000, phi = 3.4063, rap = -1.4909, |mass| = 0.2133
+pt = 0.2924, phi = 4.4554, rap = -1.4610, |mass| = 0.0000
+pt = 0.0000, phi = 5.0209, rap = -1.3956, |mass| = 0.0192
+pt = 0.0000, phi = 4.7907, rap = -1.3715, |mass| = 0.2338
+pt = 0.5231, phi = 0.6859, rap = -1.3568, |mass| = 0.3190
+pt = 0.0513, phi = 0.7825, rap = -1.3533, |mass| = 0.0000
+pt = 0.0000, phi = 5.5697, rap = -1.3375, |mass| = 0.2706
+pt = 0.0000, phi = 5.3367, rap = -1.3101, |mass| = 0.5103
+pt = 0.0000, phi = 5.0510, rap = -1.2080, |mass| = 0.2029
+pt = 0.9268, phi = 0.0872, rap = -1.1921, |mass| = 0.0000
+pt = 24.3491, phi = 0.0579, rap = -1.0933, |mass| = 0.0000
+pt = 10.6629, phi = 0.0731, rap = -1.0859, |mass| = 0.0000
+pt = 22.7084, phi = 0.0773, rap = -1.0854, |mass| = 0.0000
+pt = 20.3171, phi = 0.0834, rap = -1.0851, |mass| = 0.0000
+pt = 0.0000, phi = 0.5309, rap = -1.0828, |mass| = 0.0307
+pt = 70.5496, phi = 0.0743, rap = -1.0811, |mass| = 0.0000
+pt = 12.6654, phi = 0.0757, rap = -1.0660, |mass| = 0.0000
+pt = 8.1149, phi = 0.0626, rap = -1.0644, |mass| = 0.0000
+pt = 4.2252, phi = 0.0345, rap = -1.0580, |mass| = 0.0000
+pt = 1.1773, phi = 0.0917, rap = -1.0549, |mass| = 0.0000
+pt = 1.2653, phi = 0.0712, rap = -1.0548, |mass| = 0.0000
+pt = 6.0000, phi = 0.0565, rap = -1.0434, |mass| = 0.0000
+pt = 4.5794, phi = 0.0586, rap = -1.0426, |mass| = 0.0000
+pt = 12.6514, phi = 0.1181, rap = -1.0377, |mass| = 0.0000
+pt = 3.7921, phi = 6.2190, rap = -1.0143, |mass| = 0.0000
+pt = 4.3788, phi = 0.0865, rap = -1.0003, |mass| = 0.0000
+pt = 1.9140, phi = 0.0711, rap = -0.9980, |mass| = 0.0000
+pt = 0.0000, phi = 0.4089, rap = -0.9806, |mass| = 0.5992
+pt = 0.0482, phi = 0.9472, rap = -0.9624, |mass| = 0.2833
+pt = 3.4867, phi = 6.2357, rap = -0.9621, |mass| = 0.0000
+pt = 0.0000, phi = 5.3264, rap = -0.9595, |mass| = 0.3538
+pt = 0.1118, phi = 4.0146, rap = -0.9112, |mass| = 0.0000
+pt = 0.3429, phi = 4.3827, rap = -0.8746, |mass| = 0.0000
+pt = 0.0000, phi = 1.2028, rap = -0.8444, |mass| = 0.0297
+pt = 0.3077, phi = 0.1357, rap = -0.8338, |mass| = 0.0000
+pt = 0.0000, phi = 0.7100, rap = -0.7680, |mass| = 0.0842
+pt = 0.1840, phi = 2.7181, rap = -0.7632, |mass| = 0.0000
+pt = 0.0000, phi = 5.9605, rap = -0.7429, |mass| = 0.5685
+pt = 0.0826, phi = 4.8779, rap = -0.7202, |mass| = 0.0000
+pt = 0.1945, phi = 1.5393, rap = -0.7199, |mass| = 0.0000
+pt = 0.0535, phi = 1.6905, rap = -0.6892, |mass| = 0.0000
+pt = 0.5726, phi = 2.7094, rap = -0.6874, |mass| = 0.0000
+pt = 0.2379, phi = 1.5224, rap = -0.6862, |mass| = 0.0000
+pt = 0.0000, phi = 2.8799, rap = -0.6792, |mass| = 0.6496
+pt = 0.1419, phi = 2.6770, rap = -0.6664, |mass| = 0.0000
+pt = 0.3622, phi = 5.5749, rap = -0.6292, |mass| = 0.0000
+pt = 0.0000, phi = 3.8088, rap = -0.6257, |mass| = 0.2242
+pt = 0.0000, phi = 3.1361, rap = -0.5968, |mass| = 0.0679
+pt = 0.3791, phi = 1.5600, rap = -0.5723, |mass| = 0.0000
+pt = 0.5184, phi = 0.7584, rap = -0.5473, |mass| = 0.3421
+pt = 1.6021, phi = 2.3648, rap = -0.4499, |mass| = 0.2127
+pt = 0.0000, phi = 5.2422, rap = -0.4268, |mass| = 0.0343
+pt = 0.0000, phi = 4.2295, rap = -0.3897, |mass| = 0.0752
+pt = 0.8288, phi = 0.4795, rap = -0.3768, |mass| = 0.3659
+pt = 0.0000, phi = 3.5751, rap = -0.3483, |mass| = 0.0929
+pt = 0.9985, phi = 0.3563, rap = -0.3342, |mass| = 0.0000
+pt = 0.4521, phi = 2.7340, rap = -0.2597, |mass| = 0.0000
+pt = 0.1101, phi = 1.7579, rap = -0.2434, |mass| = 0.0000
+pt = 0.7527, phi = 1.8261, rap = -0.2425, |mass| = 0.0000
+pt = 0.0000, phi = 5.1760, rap = -0.2405, |mass| = 0.5198
+pt = 0.1234, phi = 1.2481, rap = -0.2241, |mass| = 0.0000
+pt = 0.1324, phi = 0.5956, rap = -0.1828, |mass| = 0.3553
+pt = 0.0000, phi = 2.6657, rap = -0.1595, |mass| = 0.1479
+pt = 0.0000, phi = 5.2913, rap = -0.1464, |mass| = 0.0030
+pt = 0.0000, phi = 0.6866, rap = -0.1372, |mass| = 0.3908
+pt = 0.0000, phi = 5.4367, rap = -0.1372, |mass| = 0.7108
+pt = 0.0000, phi = 4.6803, rap = -0.1358, |mass| = 0.1648
+pt = 0.0000, phi = 2.7735, rap = -0.1180, |mass| = 0.5400
+pt = 0.4766, phi = 3.7742, rap = -0.1045, |mass| = 0.0000
+pt = 0.2162, phi = 2.9150, rap = -0.0938, |mass| = 0.0000
+pt = 0.1780, phi = 3.6537, rap = -0.0631, |mass| = 0.0000
+pt = 0.0000, phi = 6.0576, rap = -0.0599, |mass| = 0.0892
+pt = 0.1212, phi = 2.9689, rap = -0.0437, |mass| = 0.0000
+pt = 1.2434, phi = 2.9835, rap = -0.0366, |mass| = 0.0000
+pt = 0.2991, phi = 2.5866, rap = -0.0260, |mass| = 0.0000
+pt = 0.0956, phi = 3.0993, rap = -0.0100, |mass| = 0.0000
+pt = 0.0000, phi = 3.7945, rap = 0.0045, |mass| = 0.1542
+pt = 0.2461, phi = 2.3563, rap = 0.0151, |mass| = 0.0000
+pt = 0.4770, phi = 0.9729, rap = 0.0474, |mass| = 0.0000
+pt = 1.6026, phi = 2.9511, rap = 0.0737, |mass| = 0.0000
+pt = 1.0696, phi = 0.9594, rap = 0.0939, |mass| = 0.3371
+pt = 1.2856, phi = 2.9165, rap = 0.1176, |mass| = 0.0000
+pt = 1.3990, phi = 2.9748, rap = 0.1206, |mass| = 0.0000
+pt = 0.0234, phi = 5.7815, rap = 0.1729, |mass| = 0.0000
+pt = 0.0000, phi = 4.9526, rap = 0.1737, |mass| = 0.2368
+pt = 0.0000, phi = 1.9370, rap = 0.1820, |mass| = 0.0161
+pt = 0.4039, phi = 4.4850, rap = 0.1935, |mass| = 0.0000
+pt = 0.0876, phi = 0.2256, rap = 0.2082, |mass| = 0.0000
+pt = 0.0051, phi = 2.9645, rap = 0.2217, |mass| = 0.1976
+pt = 0.0000, phi = 1.7689, rap = 0.2374, |mass| = 0.0736
+pt = 0.1394, phi = 0.2089, rap = 0.2861, |mass| = 0.0000
+pt = 0.0000, phi = 0.4674, rap = 0.2967, |mass| = 0.3850
+pt = 0.4950, phi = 1.8427, rap = 0.2980, |mass| = 0.0951
+pt = 0.0000, phi = 5.7312, rap = 0.3047, |mass| = 0.0551
+pt = 0.2003, phi = 0.8566, rap = 0.3299, |mass| = 0.0000
+pt = 0.0000, phi = 6.1585, rap = 0.3474, |mass| = 0.0157
+pt = 0.2918, phi = 3.4631, rap = 0.3500, |mass| = 0.0000
+pt = 0.1228, phi = 0.8614, rap = 0.3626, |mass| = 0.0000
+pt = 0.1222, phi = 0.9692, rap = 0.4178, |mass| = 0.0000
+pt = 0.0000, phi = 3.7028, rap = 0.4222, |mass| = 0.3182
+pt = 1.4479, phi = 0.7335, rap = 0.4255, |mass| = 0.0000
+pt = 0.0000, phi = 2.8924, rap = 0.4392, |mass| = 0.5788
+pt = 0.0486, phi = 4.5484, rap = 0.4993, |mass| = 0.0000
+pt = 0.4948, phi = 2.9835, rap = 0.5077, |mass| = 0.0000
+pt = 0.0955, phi = 0.6706, rap = 0.5158, |mass| = 0.4439
+pt = 1.9973, phi = 0.8053, rap = 0.5295, |mass| = 0.0000
+pt = 0.0000, phi = 1.5136, rap = 0.5312, |mass| = 0.3876
+pt = 0.4916, phi = 2.2633, rap = 0.5336, |mass| = 0.0000
+pt = 3.8451, phi = 3.4258, rap = 0.5413, |mass| = 0.0000
+pt = 1.5010, phi = 3.3710, rap = 0.5773, |mass| = 0.0000
+pt = 4.4526, phi = 3.4551, rap = 0.5839, |mass| = 0.0000
+pt = 0.5629, phi = 1.2803, rap = 0.5848, |mass| = 0.0000
+pt = 3.4646, phi = 3.4360, rap = 0.5910, |mass| = 0.0000
+pt = 1.8793, phi = 3.5194, rap = 0.5915, |mass| = 0.0000
+pt = 0.5524, phi = 3.6197, rap = 0.5925, |mass| = 0.0000
+pt = 2.3278, phi = 3.5442, rap = 0.6111, |mass| = 0.0000
+pt = 5.1586, phi = 3.4756, rap = 0.6166, |mass| = 0.0000
+pt = 0.2212, phi = 5.4022, rap = 0.6202, |mass| = 0.3377
+pt = 4.3862, phi = 3.4572, rap = 0.6241, |mass| = 0.0000
+pt = 0.2256, phi = 0.6815, rap = 0.6313, |mass| = 0.0000
+pt = 0.4214, phi = 2.1577, rap = 0.6338, |mass| = 0.4728
+pt = 0.0000, phi = 1.5382, rap = 0.6353, |mass| = 0.0673
+pt = 8.3256, phi = 3.4533, rap = 0.6359, |mass| = 0.0000
+pt = 1.8902, phi = 3.4727, rap = 0.6368, |mass| = 0.0000
+pt = 10.1706, phi = 3.4104, rap = 0.6385, |mass| = 0.0000
+pt = 1.9006, phi = 3.4744, rap = 0.6420, |mass| = 0.0000
+pt = 1.8977, phi = 3.4329, rap = 0.6449, |mass| = 0.0000
+pt = 1.8801, phi = 3.3996, rap = 0.6533, |mass| = 0.0000
+pt = 0.0000, phi = 0.2411, rap = 0.6556, |mass| = 0.1351
+pt = 0.4464, phi = 3.5051, rap = 0.6559, |mass| = 0.0000
+pt = 0.2404, phi = 3.5005, rap = 0.6563, |mass| = 0.0000
+pt = 1.6145, phi = 3.4793, rap = 0.6577, |mass| = 0.0000
+pt = 6.7198, phi = 3.4263, rap = 0.6685, |mass| = 0.0000
+pt = 10.7029, phi = 3.4717, rap = 0.6706, |mass| = 0.0000
+pt = 1.0130, phi = 3.4751, rap = 0.6708, |mass| = 0.0000
+pt = 2.0006, phi = 3.3178, rap = 0.6756, |mass| = 0.0000
+pt = 5.6895, phi = 3.4260, rap = 0.6768, |mass| = 0.0000
+pt = 0.0525, phi = 6.0878, rap = 0.6805, |mass| = 0.0000
+pt = 1.8819, phi = 3.4712, rap = 0.6823, |mass| = 0.0000
+pt = 5.5091, phi = 3.4245, rap = 0.6858, |mass| = 0.0000
+pt = 1.9027, phi = 3.4087, rap = 0.6874, |mass| = 0.0000
+pt = 2.8740, phi = 3.4624, rap = 0.6911, |mass| = 0.0000
+pt = 13.7509, phi = 3.4120, rap = 0.7074, |mass| = 0.0000
+pt = 8.8154, phi = 3.4972, rap = 0.7090, |mass| = 0.0000
+pt = 5.3858, phi = 3.4490, rap = 0.7170, |mass| = 0.0000
+pt = 0.1988, phi = 6.0604, rap = 0.7172, |mass| = 0.0000
+pt = 0.0000, phi = 0.3084, rap = 0.7204, |mass| = 0.0714
+pt = 6.4560, phi = 3.4530, rap = 0.7207, |mass| = 0.0000
+pt = 0.5595, phi = 2.4215, rap = 0.7229, |mass| = 0.0000
+pt = 0.0000, phi = 3.5246, rap = 0.7350, |mass| = 0.1113
+pt = 8.9994, phi = 3.4142, rap = 0.7452, |mass| = 0.0000
+pt = 0.3223, phi = 1.9752, rap = 0.7563, |mass| = 0.0000
+pt = 0.9746, phi = 1.2971, rap = 0.7623, |mass| = 0.0000
+pt = 0.5721, phi = 3.7466, rap = 0.7690, |mass| = 0.2290
+pt = 0.3475, phi = 1.4775, rap = 0.8066, |mass| = 0.0000
+pt = 0.0627, phi = 3.0398, rap = 0.8188, |mass| = 0.0000
+pt = 1.1308, phi = 3.6233, rap = 0.8190, |mass| = 0.6560
+pt = 1.4533, phi = 2.4207, rap = 0.8200, |mass| = 0.0000
+pt = 0.0000, phi = 3.7783, rap = 0.8236, |mass| = 0.0499
+pt = 0.3871, phi = 5.9957, rap = 0.8491, |mass| = 0.0000
+pt = 0.5234, phi = 6.0737, rap = 0.8541, |mass| = 0.0000
+pt = 1.4700, phi = 5.8830, rap = 0.8746, |mass| = 0.0000
+pt = 0.3939, phi = 1.4696, rap = 0.8781, |mass| = 0.4137
+pt = 0.0000, phi = 0.4758, rap = 0.8829, |mass| = 0.4266
+pt = 3.9352, phi = 5.8902, rap = 0.8995, |mass| = 0.0000
+pt = 0.7974, phi = 5.9910, rap = 0.9133, |mass| = 0.6279
+pt = 0.1349, phi = 4.6516, rap = 0.9169, |mass| = 0.0000
+pt = 0.0000, phi = 3.1391, rap = 0.9173, |mass| = 0.5128
+pt = 1.5676, phi = 5.9042, rap = 0.9416, |mass| = 0.0000
+pt = 0.1095, phi = 3.0645, rap = 0.9518, |mass| = 0.0000
+pt = 0.0127, phi = 4.7522, rap = 0.9645, |mass| = 0.0000
+pt = 0.1051, phi = 2.6248, rap = 0.9718, |mass| = 0.0000
+pt = 0.0190, phi = 4.0506, rap = 0.9857, |mass| = 0.0000
+pt = 0.3416, phi = 1.8193, rap = 0.9987, |mass| = 0.0000
+pt = 1.4849, phi = 1.9405, rap = 1.0063, |mass| = 0.0000
+pt = 0.0235, phi = 3.2114, rap = 1.0078, |mass| = 0.3010
+pt = 0.2367, phi = 6.0103, rap = 1.0350, |mass| = 0.4222
+pt = 0.3803, phi = 2.4110, rap = 1.0565, |mass| = 0.0000
+pt = 0.0000, phi = 0.2182, rap = 1.0634, |mass| = 0.2363
+pt = 1.3068, phi = 2.1993, rap = 1.0685, |mass| = 0.6537
+pt = 0.0660, phi = 2.2157, rap = 1.0731, |mass| = 0.0819
+pt = 0.6637, phi = 2.4491, rap = 1.0845, |mass| = 0.5424
+pt = 0.0039, phi = 3.7599, rap = 1.1061, |mass| = 0.0000
+pt = 1.0608, phi = 3.7716, rap = 1.1266, |mass| = 0.0000
+pt = 0.4054, phi = 3.8805, rap = 1.1281, |mass| = 0.0000
+pt = 0.0000, phi = 3.9461, rap = 1.1289, |mass| = 0.2459
+pt = 1.1806, phi = 2.1470, rap = 1.1299, |mass| = 0.0000
+pt = 0.0000, phi = 3.0345, rap = 1.1380, |mass| = 0.6969
+pt = 0.1212, phi = 6.2627, rap = 1.1410, |mass| = 0.0000
+pt = 0.3702, phi = 3.6682, rap = 1.1423, |mass| = 0.0000
+pt = 0.0901, phi = 6.2192, rap = 1.1465, |mass| = 0.0000
+pt = 0.0000, phi = 0.0632, rap = 1.1606, |mass| = 0.2034
+pt = 1.2196, phi = 2.2491, rap = 1.1824, |mass| = 0.0000
+pt = 0.0000, phi = 5.1993, rap = 1.2196, |mass| = 0.7041
+pt = 0.2391, phi = 1.5378, rap = 1.2240, |mass| = 0.3483
+pt = 1.7914, phi = 2.0002, rap = 1.2478, |mass| = 0.0000
+pt = 1.1739, phi = 2.4614, rap = 1.2917, |mass| = 0.3284
+pt = 0.0025, phi = 2.0893, rap = 1.2999, |mass| = 0.0000
+pt = 0.8104, phi = 1.3460, rap = 1.3049, |mass| = 0.3674
+pt = 0.9605, phi = 2.1008, rap = 1.3221, |mass| = 0.0000
+pt = 0.2234, phi = 3.4732, rap = 1.3242, |mass| = 0.0000
+pt = 0.0000, phi = 6.0304, rap = 1.3552, |mass| = 0.0020
+pt = 0.4136, phi = 0.4431, rap = 1.3560, |mass| = 0.3067
+pt = 0.0000, phi = 3.8285, rap = 1.3878, |mass| = 0.4110
+pt = 0.0932, phi = 3.5671, rap = 1.3936, |mass| = 0.0000
+pt = 0.0000, phi = 5.9932, rap = 1.4169, |mass| = 0.0532
+pt = 0.1760, phi = 4.9412, rap = 1.4212, |mass| = 0.0000
+pt = 0.0000, phi = 3.8509, rap = 1.4223, |mass| = 0.1603
+pt = 0.0000, phi = 4.8650, rap = 1.4360, |mass| = 0.0231
+pt = 1.2942, phi = 2.6652, rap = 1.4574, |mass| = 0.0000
+pt = 0.3223, phi = 3.8357, rap = 1.4605, |mass| = 0.0000
+pt = 1.0916, phi = 4.7690, rap = 1.4731, |mass| = 0.3740
+pt = 0.3340, phi = 2.2565, rap = 1.5072, |mass| = 0.0000
+pt = 0.0000, phi = 2.8818, rap = 1.5173, |mass| = 0.2291
+pt = 0.8800, phi = 2.6610, rap = 1.5637, |mass| = 0.0000
+pt = 1.7082, phi = 5.5777, rap = 1.5689, |mass| = 0.7246
+pt = 0.2103, phi = 1.8101, rap = 1.6003, |mass| = 0.0000
+pt = 0.5232, phi = 0.9558, rap = 1.6013, |mass| = 0.1785
+pt = 0.0000, phi = 3.7564, rap = 1.6039, |mass| = 0.5850
+pt = 1.5471, phi = 2.7272, rap = 1.6053, |mass| = 0.0000
+pt = 1.4595, phi = 5.2340, rap = 1.6192, |mass| = 0.0000
+pt = 0.2789, phi = 4.9272, rap = 1.6319, |mass| = 0.0000
+pt = 0.0973, phi = 3.1377, rap = 1.6448, |mass| = 0.0000
+pt = 1.1963, phi = 5.7800, rap = 1.6586, |mass| = 0.0000
+pt = 0.0233, phi = 2.9014, rap = 1.6933, |mass| = 0.0000
+pt = 0.0819, phi = 4.8299, rap = 1.6987, |mass| = 0.0000
+pt = 0.6090, phi = 5.0883, rap = 1.7570, |mass| = 0.0000
+pt = 0.8089, phi = 2.4587, rap = 1.7761, |mass| = 0.0000
+pt = 5.3683, phi = 2.7960, rap = 1.8007, |mass| = 0.0000
+pt = 2.6487, phi = 0.9863, rap = 1.8074, |mass| = 0.0000
+pt = 0.0000, phi = 2.1390, rap = 1.8452, |mass| = 0.3359
+pt = 0.3936, phi = 3.2073, rap = 1.8452, |mass| = 0.3369
+pt = 2.1660, phi = 2.7201, rap = 1.8501, |mass| = 0.0000
+pt = 0.1068, phi = 2.6960, rap = 1.8562, |mass| = 0.0000
+pt = 5.6745, phi = 2.7803, rap = 1.8695, |mass| = 0.0000
+pt = 2.2874, phi = 2.6740, rap = 1.8754, |mass| = 0.0000
+pt = 0.0000, phi = 4.8838, rap = 1.9101, |mass| = 0.6003
+pt = 1.0031, phi = 1.8314, rap = 1.9129, |mass| = 0.2261
+pt = 0.0000, phi = 4.3408, rap = 1.9201, |mass| = 0.2848
+pt = 0.1079, phi = 2.7014, rap = 1.9332, |mass| = 0.0000
+pt = 0.4839, phi = 1.0835, rap = 1.9387, |mass| = 0.0000
+pt = 0.0183, phi = 1.1122, rap = 1.9516, |mass| = 0.0000
+pt = 0.0000, phi = 0.1115, rap = 1.9533, |mass| = 0.2428
+pt = 0.0000, phi = 1.3471, rap = 1.9767, |mass| = 0.0018
+pt = 0.0000, phi = 0.7475, rap = 1.9993, |mass| = 0.0061
+pt = 0.0000, phi = 2.0417, rap = 2.0056, |mass| = 0.3039
+pt = 0.3235, phi = 3.0374, rap = 2.0565, |mass| = 0.0000
+pt = 1.7327, phi = 3.0890, rap = 2.0668, |mass| = 0.0000
+pt = 1.1409, phi = 2.8476, rap = 2.0854, |mass| = 0.0000
+pt = 0.8537, phi = 2.8541, rap = 2.0864, |mass| = 0.0000
+pt = 3.1220, phi = 2.9009, rap = 2.0914, |mass| = 0.0000
+pt = 0.0000, phi = 5.6835, rap = 2.1183, |mass| = 0.2853
+pt = 8.0466, phi = 2.9158, rap = 2.1664, |mass| = 0.0000
+pt = 1.5371, phi = 2.6275, rap = 2.1787, |mass| = 0.0000
+pt = 14.0251, phi = 2.9648, rap = 2.1793, |mass| = 0.0000
+pt = 7.7212, phi = 2.8981, rap = 2.1901, |mass| = 0.0000
+pt = 8.3485, phi = 2.9077, rap = 2.1933, |mass| = 0.0000
+pt = 2.6100, phi = 2.8874, rap = 2.1989, |mass| = 0.0000
+pt = 5.8656, phi = 2.9472, rap = 2.2211, |mass| = 0.0000
+pt = 0.0000, phi = 3.0658, rap = 2.2278, |mass| = 0.0501
+pt = 0.3432, phi = 2.3070, rap = 2.2353, |mass| = 0.0000
+pt = 1.8815, phi = 2.9942, rap = 2.2515, |mass| = 0.0000
+pt = 0.3136, phi = 2.6010, rap = 2.2538, |mass| = 0.0000
+pt = 0.0000, phi = 5.1560, rap = 2.2964, |mass| = 0.4825
+pt = 6.6192, phi = 2.8741, rap = 2.2979, |mass| = 0.0000
+pt = 0.0000, phi = 6.0460, rap = 2.3143, |mass| = 0.2867
+pt = 0.0000, phi = 0.0765, rap = 2.3267, |mass| = 0.1699
+pt = 0.1660, phi = 4.2786, rap = 2.3323, |mass| = 0.0000
+pt = 0.0000, phi = 3.8866, rap = 2.3624, |mass| = 0.1044
+pt = 1.1877, phi = 2.4512, rap = 2.3893, |mass| = 0.0000
+pt = 0.6077, phi = 4.9860, rap = 2.4013, |mass| = 0.0000
+pt = 0.2750, phi = 3.2281, rap = 2.4204, |mass| = 0.0000
+pt = 0.0639, phi = 5.0863, rap = 2.4376, |mass| = 0.0000
+pt = 0.5944, phi = 5.6329, rap = 2.4704, |mass| = 0.0000
+pt = 0.2959, phi = 5.3862, rap = 2.4942, |mass| = 0.0000
+pt = 0.5005, phi = 0.2073, rap = 2.5013, |mass| = 0.0000
+pt = 0.0000, phi = 5.5875, rap = 2.5304, |mass| = 0.2654
+pt = 0.0770, phi = 5.9251, rap = 2.5418, |mass| = 0.0000
+pt = 0.1943, phi = 1.3474, rap = 2.5588, |mass| = 0.0000
+pt = 0.0000, phi = 6.1094, rap = 2.5989, |mass| = 0.2909
+pt = 0.0000, phi = 5.7227, rap = 2.6021, |mass| = 0.5232
+pt = 0.0000, phi = 3.8120, rap = 2.6416, |mass| = 0.1737
+pt = 0.1387, phi = 5.3477, rap = 2.6706, |mass| = 0.0000
+pt = 0.0282, phi = 5.2658, rap = 2.6781, |mass| = 0.0000
+pt = 0.0803, phi = 1.0035, rap = 2.7000, |mass| = 0.0000
+pt = 0.5413, phi = 5.2734, rap = 2.7487, |mass| = 0.0000
+pt = 0.0000, phi = 0.6350, rap = 2.7563, |mass| = 0.2267
+pt = 0.1582, phi = 1.3875, rap = 2.7583, |mass| = 0.4207
+pt = 0.0000, phi = 3.0759, rap = 2.7767, |mass| = 0.1441
+pt = 0.2320, phi = 5.2945, rap = 2.7975, |mass| = 0.0000
+pt = 0.1461, phi = 4.8803, rap = 2.8057, |mass| = 0.0000
+pt = 0.0000, phi = 1.7026, rap = 2.8144, |mass| = 0.3127
+pt = 0.0000, phi = 4.5915, rap = 2.8524, |mass| = 0.1178
+pt = 0.0000, phi = 4.6285, rap = 2.9342, |mass| = 0.4912
+pt = 0.0000, phi = 0.2897, rap = 2.9419, |mass| = 0.2545
+pt = 0.0000, phi = 4.5237, rap = 2.9486, |mass| = 0.1162
+pt = 0.9863, phi = 5.3496, rap = 2.9503, |mass| = 0.0000
+pt = 0.3097, phi = 4.5024, rap = 2.9632, |mass| = 0.0000
+pt = 0.0000, phi = 3.2030, rap = 3.0507, |mass| = 0.1245
+pt = 0.0000, phi = 1.6339, rap = 3.0626, |mass| = 0.1915
+pt = 0.0190, phi = 5.6998, rap = 3.1040, |mass| = 0.0000
+pt = 0.0000, phi = 2.8474, rap = 3.1114, |mass| = 0.2894
+pt = 0.2036, phi = 2.5911, rap = 3.1385, |mass| = 0.4337
+pt = 0.1574, phi = 0.8686, rap = 3.2117, |mass| = 0.0000
+pt = 0.1419, phi = 4.3488, rap = 3.2525, |mass| = 0.0000
+pt = 0.1659, phi = 3.8185, rap = 3.2569, |mass| = 0.0000
+pt = 0.1577, phi = 3.8074, rap = 3.3040, |mass| = 0.0000
+pt = 0.2096, phi = 0.0370, rap = 3.4874, |mass| = 0.3751
+pt = 0.0313, phi = 3.7510, rap = 3.5445, |mass| = 0.2250
+pt = 0.0000, phi = 5.8221, rap = 3.5533, |mass| = 0.0375
+pt = 0.2628, phi = 5.1156, rap = 3.6265, |mass| = 0.0000
+pt = 0.2911, phi = 3.5986, rap = 3.6873, |mass| = 0.0000
+pt = 0.0736, phi = 3.9443, rap = 3.7229, |mass| = 0.0000
+pt = 3.1227, phi = 5.8328, rap = 3.8261, |mass| = 0.0000
+pt = 1.1456, phi = 5.9007, rap = 3.8434, |mass| = 0.0000
+pt = 0.8388, phi = 3.7877, rap = 3.8660, |mass| = 0.0000
+pt = 0.4517, phi = 3.9673, rap = 3.9384, |mass| = 0.0000
+pt = 0.5153, phi = 3.4089, rap = 3.9813, |mass| = 0.0000
+pt = 0.0782, phi = 0.2902, rap = 3.9936, |mass| = 0.0000
+
+# original hard jets
+pt = 89.57, rap = 2.088, mass = 21.55, width = 0.1866
+pt = 144.5, rap = 0.6689, mass = 19.34, width = 0.06909
+pt = 220.1, rap = -1.068, mass = 18.09, width = 0.0337
+
+# unsubtracted full jets
+pt = 115.3, rap = 2.08, mass = 45.33, width = 0.2569
+pt = 167.3, rap = 0.6891, mass = 58.31, width = 0.1268
+pt = 230.5, rap = -1.065, mass = 46.2, width = 0.05647
+
+# subtracted full jets
+pt = 86.05, rap = 2.093, mass = 21.75, width = 0.187
+pt = 142.1, rap = 0.6768, mass = 34.59, width = 0.0667
+pt = 214.4, rap = -1.071, mass = 26.34, width = 0.02709
+
Index: contrib/contribs/ConstituentSubtractor/trunk/example_whole_event_sequential.cc
===================================================================
--- contrib/contribs/ConstituentSubtractor/trunk/example_whole_event_sequential.cc (revision 0)
+++ contrib/contribs/ConstituentSubtractor/trunk/example_whole_event_sequential.cc (revision 1134)
@@ -0,0 +1,153 @@
+// $Id: example_whole_event.cc 1118 2018-05-04 14:17:50Z berta $
+//
+//----------------------------------------------------------------------
+// Example on how to do pileup correction on the whole event
+//
+// run it with
+// ./example_whole_event < ../data/Pythia-Zp2jets-lhc-pileup-1ev.dat
+//----------------------------------------------------------------------
+//
+//----------------------------------------------------------------------
+// This file is part of FastJet contrib.
+//
+// It is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2 of the License, or (at
+// your option) any later version.
+//
+// It is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+// License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this code. If not, see <http://www.gnu.org/licenses/>.
+//----------------------------------------------------------------------
+
+
+#include "fastjet/ClusterSequence.hh"
+#include "fastjet/Selector.hh"
+#include "fastjet/tools/GridMedianBackgroundEstimator.hh"
+#include "ConstituentSubtractor.hh" // In external code, this should be fastjet/contrib/ConstituentSubtractor.hh
+
+#include "functions.hh"
+
+
+using namespace std;
+using namespace fastjet;
+
+//----------------------------------------------------------------------
+int main(){
+ // set up before event loop:
+ contrib::ConstituentSubtractor subtractor;
+ subtractor.set_distance_type(contrib::ConstituentSubtractor::deltaR); // free parameter for the type of distance between particle i and ghost k. There are two options: "deltaR" or "angle" which are defined as deltaR=sqrt((y_i-y_k)^2+(phi_i-phi_k)^2) or Euclidean angle between the momenta
+ vector<double> max_distances;
+ max_distances.push_back(0.1);
+ max_distances.push_back(0.15);
+ max_distances.push_back(0.15);
+ vector<double> alphas;
+ alphas.push_back(0);
+ alphas.push_back(0);
+ alphas.push_back(1);
+ subtractor.set_sequential_parameters(max_distances,alphas); // in this example, 3 CS corrections will be performed: 1. correction with max_distance of 0.1 and alpha of 0, 2. correction with max_distance of 0.15 and alpha of 0, and 3. correction with max_distance of 0.15 and alpha of 1.
+ subtractor.set_remove_remaining_proxies_sequential(true); // set to true if the ghosts (proxies) which were not used in the previous CS procedure should be removed for the next CS procedure
+ subtractor.set_ghost_area(0.004); // free parameter for the density of ghosts. The smaller, the better - but also the computation is slower.
+
+ // event loop
+ // read in input particles
+ vector<PseudoJet> hard_event, full_event;
+ read_event(hard_event, full_event);
+
+ double max_eta=4; // specify the maximal pseudorapidity for the particles used in the subtraction
+ double max_eta_jet=3; // the maximal pseudorapidity for selected jets
+ hard_event = SelectorAbsEtaMax(max_eta)(hard_event);
+ full_event = SelectorAbsEtaMax(max_eta)(full_event);
+
+ cout << "# read an event with " << hard_event.size() << " signal particles and " << full_event.size() - hard_event.size() << " background particles with pseudo-rapidity |eta|<4" << endl;
+
+
+ // jet definition and selector for jets
+ JetDefinition jet_def(antikt_algorithm, 0.7);
+ Selector sel_jets = SelectorNHardest(3) * SelectorAbsEtaMax(max_eta_jet);
+
+ // clustering of the hard-scatter event and uncorrected event
+ ClusterSequence clust_seq_hard(hard_event, jet_def);
+ ClusterSequence clust_seq_full(full_event, jet_def);
+ vector<PseudoJet> hard_jets = sel_jets(clust_seq_hard.inclusive_jets());
+ vector<PseudoJet> full_jets = sel_jets(clust_seq_full.inclusive_jets());
+
+ // background estimator
+ GridMedianBackgroundEstimator bge_rho(max_eta,0.5);
+ bge_rho.set_particles(full_event);
+ subtractor.set_background_estimator(&bge_rho);
+
+ // this sets the same background estimator to be used for deltaMass density, rho_m, as for pt density, rho:
+ subtractor.set_common_bge_for_rho_and_rhom(true); // it does not make any difference for massless input particles (rho_m is always zero)
+
+ // print info (optional)
+ cout << subtractor.description() << endl;
+
+ // the correction of the whole event with ConstituentSubtractor
+ vector<PseudoJet> corrected_event=subtractor.sequential_subtraction(full_event,max_eta);
+
+ // clustering of the corrected event
+ ClusterSequence clust_seq_corr(corrected_event, jet_def);
+ vector<PseudoJet> corrected_jets = sel_jets(clust_seq_corr.inclusive_jets());
+
+
+ ios::fmtflags f( cout.flags() );
+ cout << setprecision(4) << fixed;
+ cout << endl << "Corrected particles in the whole event:" << endl;
+ for (unsigned int i=0; i<corrected_event.size(); i++){
+ const PseudoJet &particle = corrected_event[i];
+ cout << "pt = " << particle.pt()
+ << ", phi = " << particle.phi()
+ << ", rap = " << particle.rap()
+ << ", |mass| = " << fabs(particle.m()) << endl;
+ }
+ cout << endl;
+
+ // shape variables:
+ //----------------------------------------------------------
+ JetWidth width;
+
+ // subtract and print the result
+ //----------------------------------------------------------
+ cout.flags( f );
+ cout << setprecision(4);
+ cout << "# original hard jets" << endl;
+ for (unsigned int i=0; i<hard_jets.size(); i++){
+ const PseudoJet &jet = hard_jets[i];
+ cout << "pt = " << jet.pt()
+ << ", rap = " << jet.rap()
+ << ", mass = " << jet.m()
+ << ", width = " << width(jet) << endl;
+ }
+ cout << endl;
+
+ cout << "# unsubtracted full jets" << endl;
+ for (unsigned int i=0; i<full_jets.size(); i++){
+ const PseudoJet &jet = full_jets[i];
+ cout << "pt = " << jet.pt()
+ << ", rap = " << jet.rap()
+ << ", mass = " << jet.m()
+ << ", width = " << width(jet) << endl;
+ }
+ cout << endl;
+
+ cout << "# subtracted full jets" << endl;
+ for (unsigned int i=0; i<corrected_jets.size(); i++){
+ const PseudoJet &jet = corrected_jets[i];
+
+ cout << "pt = " << jet.pt()
+ << ", rap = " << jet.rap()
+ << ", mass = " << jet.m()
+ << ", width = " << width(jet) << endl;
+ }
+ cout << endl;
+
+ return 0;
+}
+
+
+

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 5:25 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805380
Default Alt Text
(115 KB)

Event Timeline