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.");
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".
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");
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
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
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
/// 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.
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];
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".
+ 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
+ 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){
+ 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));
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 (!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()
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.");
+ 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.");
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
+ _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".
+ - 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
/// 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:
/// 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).
/// 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.
/// 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.
/// 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.
- /// 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.
+ /// 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.
/// 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).
/// 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.
/// 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.
/// 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.
/// 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
/// 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.
/// 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
/// 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
+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"
- 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>
+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
+ 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