Index: contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/SignalFreeBackgroundEstimator.cc =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/SignalFreeBackgroundEstimator.cc (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/SignalFreeBackgroundEstimator.cc (revision 1380) @@ -0,0 +1,286 @@ +// +// SignalFreeBackgroundEstimator package +// Questions/comments: peter.berta@cern.ch +// +// Copyright (c) 2024-, Peter Berta +// +//---------------------------------------------------------------------- +// 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 . +//---------------------------------------------------------------------- + +#include "SignalFreeBackgroundEstimator.hh" + +FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + +namespace contrib{ + + void SignalFreeBackgroundEstimator::set_particles(const std::vector& particles, const std::vector& signalParticles, const double& measureOfPileup, const std::vector& chargedSignalParticles){ + + assert(all_tiles_equal_area()); + + _cache_available = false; + _cached_estimate.reset(); + _cached_estimate.set_has_sigma(false); + _cached_estimate.set_mean_area(mean_tile_area()); + + // Cluster signal particles + fastjet::AreaDefinition areaDef(fastjet::active_area, fastjet::GhostedAreaSpec(_rapidity_max)); + fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, _signal_jets_R); + fastjet::ClusterSequenceArea clusSeq(signalParticles, jetDef, areaDef); + std::vector allSignalJets = sorted_by_pt(clusSeq.inclusive_jets()); + + double jet_rho_min=_jet_rho_min_intercept; + if (measureOfPileup>0) jet_rho_min=_jet_rho_min_intercept+sqrt(measureOfPileup)*_jet_rho_min_slope; + for (size_t i = 0; i < allSignalJets.size(); ++i) { + if (allSignalJets.at(i).pt()/allSignalJets.at(i).area() > jet_rho_min) _signal_seeds.emplace_back(allSignalJets.at(i)); + } + if (chargedSignalParticles.size()>0){ + fastjet::ClusterSequenceArea clusSeq_charged(chargedSignalParticles, jetDef, areaDef); + std::vector chargedJets = sorted_by_pt(clusSeq_charged.inclusive_jets()); + for (size_t i = 0; i < chargedJets.size(); ++i) { + if (chargedJets.at(i).pt()/chargedJets.at(i).area() > _jet_rho_min_charged) _signal_seeds.emplace_back(chargedJets.at(i)); + } + } + double scalarPtSumSignal=0; + for (size_t i = 0; i < signalParticles.size(); ++i) scalarPtSumSignal+=signalParticles[i].pt(); + _signal_fraction=scalarPtSumSignal/14000.; + + + + // Determine tile area outside the exclusion area + std::vector tileStates(n_tiles(),false); + std::vector tileAreas(n_tiles()); + int nGhosts_phi=dphi()/_ghost_size; + int nGhosts_rap=drap()/_ghost_size; + fastjet::PseudoJet ghost(0,0,0,1); + int nPhi = std::round(fastjet::twopi / dphi()); + for (int i = 0; i < n_tiles(); ++i) { + int tileIndexPhi = i % nPhi; + int tileIndexRap = i / nPhi; + int nGhostsCloseToHardScatter=0; + for (int iphi = 0; iphi < nGhosts_phi; ++iphi) { + double phi=(tileIndexPhi + (iphi+0.5)/(double)nGhosts_phi)*dphi(); + for (int irap = 0; irap < nGhosts_rap; ++irap) { + double rap=(tileIndexRap + (irap+0.5)/(double)nGhosts_rap)*drap() + rapmin(); + ghost.reset_momentum_PtYPhiM(1,rap,phi,1e-200); + for (size_t isignal = 0; isignal < _signal_seeds.size(); ++isignal) { + if (_signal_seeds.at(isignal).delta_R(ghost) < _exclusion_deltaR) { + nGhostsCloseToHardScatter++; + break; + } + } + } + } + + double areaFraction=1-nGhostsCloseToHardScatter/(double)(nGhosts_phi*nGhosts_rap); + tileAreas[i]=mean_tile_area()*areaFraction; + if (tileAreas[i]>_tile_area_min) tileStates[i]=true; + } + + std::vector tilePt(n_tiles(), 0.); + std::vector tileMtMinusPt(n_tiles(), 0.); + for (size_t i = 0; i < particles.size(); ++i) { + // Find index of the tile the particle belongs to + int tileIndex = tile_index(particles[i]); + if (tileIndex < 0) { + std::cout << "WARNING SignalFreeBackgroundEstimator::set_particles: Tile index is negative. Particle (pt,rap,phi,m): " << particles[i].pt() << " " << particles[i].rap() << " " << particles[i].phi() << " " << particles[i].m() << std::endl; + continue; + } + + bool closeToHardScatter = false; + for (size_t j = 0; j < _signal_seeds.size(); ++j) { + if (_signal_seeds.at(j).delta_R(particles[i]) < _exclusion_deltaR) { + closeToHardScatter = true; + break; + } + } + if (closeToHardScatter) continue; + + if (_rescaling_class) { + double r = (*_rescaling_class)(particles[i]); + tilePt[tileIndex] += particles[i].pt() / r; + if (_enable_rho_m) tileMtMinusPt[tileIndex] += (particles[i].mt()-particles[i].pt()) / r; + } + else{ + tilePt[tileIndex] += particles[i].pt(); + if (_enable_rho_m) tileMtMinusPt[tileIndex] += particles[i].mt()-particles[i].pt(); + } + } + + /// Compute rho and rho_m for each tile, and assign weights based on tile area + std::vector > tileRho, tileRhom; + _weights_sum=0; + for (int i = 0; i < n_tiles(); ++i) { + if (!tileStates[i]) continue; + tileRho.emplace_back(std::make_pair(tilePt[i]/tileAreas[i],tileAreas[i])); + _weights_sum+=tileAreas[i]; + if (_enable_rho_m) tileRhom.emplace_back(std::make_pair(tileMtMinusPt[i]/tileAreas[i],tileAreas[i])); + } + if (tileRho.size()==0){ + std::cout << "WARNING SignalFreeBackgroundEstimator::set_particles: All tiles are excluded in this event, and it is not possible to estimate rho with SignalFreeBackgroundEstimator! Estimating it with GridMedianBackgroundEstimator instead. Crosscheck whether it is expected that all tiles are excluded in this event and try to optimize the parameters of SignalFreeBackgroundEstimator, if needed." << std::endl; + std::unique_ptr gridMedian(new fastjet::GridMedianBackgroundEstimator(_rapidity_max,0.55)); + if (_rescaling_class) gridMedian->set_rescaling_class(_rescaling_class); + gridMedian->set_particles(particles); + _cached_estimate=gridMedian->estimate(); + _cache_available = true; + return; + } + + /// Compute and set the final rho and rho_m + double rho=_compute_weighted_median(tileRho); + _cached_estimate.set_rho(rho); + + if (_enable_rho_m){ + double rhom=_compute_weighted_median(tileRhom);; + _cached_estimate.set_has_rho_m(true); + _cached_estimate.set_rho_m(rhom); + } + + _cache_available = true; + } + + + /// Compute weighted median based on the weights corresponding to tile areas. + double SignalFreeBackgroundEstimator::_compute_weighted_median(std::vector > &tileRho) const{ + sort(tileRho.begin(),tileRho.end()); + + // Get the actual center in case the user requested to use floating center: + double shift=0; + if (_regulator_for_floating_center>=0) shift=(_signal_fraction-_signal_fraction_min)*_regulator_for_floating_center; + if (shift<0) shift=0; + if (shift>_shift_max) shift=_shift_max; + if (shift>_center-_half_window) shift=_center-_half_window; + double center_shifted=_center-shift; + + // Compute rho from the window specified by the user: + double rho_nominator=0; + double rho_denominator=0; + bool insideWindow=false; + double fractions_partialSum=0; + for (size_t i = 0; i < tileRho.size(); ++i) { + double fraction_i=tileRho[i].second/_weights_sum; + double remaining_to_start=center_shifted-_half_window-fractions_partialSum; + double remaining_to_stop=center_shifted+_half_window-fractions_partialSum; + if (remaining_to_start* rescaling_class_in) { + if (!_cache_available) { + _warning_rescaling.warn("SignalFreeBackgroundEstimator::set_rescaling_class: Found cached result. Set particles again to obtain correct calculation!"); + } + + BackgroundEstimatorBase::set_rescaling_class(rescaling_class_in); + } + + /// User can add his/her own signal seeds (either additional seeds to those obtained from jet clustering or only these user-defined seeds can be used) + void SignalFreeBackgroundEstimator::add_additional_seeds(const std::vector &additional_seeds){ + for (size_t iseed = 0; iseed < additional_seeds.size(); ++iseed) { + _signal_seeds.emplace_back(additional_seeds[iseed]); + } + } + +} // contrib namespace + + +FASTJET_END_NAMESPACE Index: contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/NEWS =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/NEWS (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/NEWS (revision 1380) @@ -0,0 +1 @@ +2024/02/01: release of version 1.0.0 Index: contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/Makefile =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/Makefile (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/Makefile (revision 1380) @@ -0,0 +1,78 @@ +# 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=SignalFreeBackgroundEstimator +SRCS=SignalFreeBackgroundEstimator.cc +EXAMPLES=example +INSTALLED_HEADERS=SignalFreeBackgroundEstimator.hh +#------------------------------------------------------------------------ + +CXXFLAGS+= $(shell $(FASTJETCONFIG) --cxxflags) +LDFLAGS += -lm $(shell $(FASTJETCONFIG) --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) $(CXXFLAGS) -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 || echo "failed"; \ + done +# @echo "All tests successful" +# $(check_script) $${prog} ../data/Pythia-Zp2jets-lhc-pileup-1ev.dat || exit 1; \ + +# 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/SignalFreeBackgroundEstimator/tags/1.0.0/README =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/README (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/README (revision 1380) @@ -0,0 +1,19 @@ +SignalFreeBackgroundEstimator is part of the fastjet-contrib project. + +The SignalFreeBackgroundEstimator class estimates pileup pT density (rho) with lower dependence on the signal particles, as described in + + Pileup density estimate independent on jet multiplicity + Peter Berta, Juraj Smiesko, Martin Spousta + arXiv:2304.08383 + +The code example.cc illustrates how to use the class on individual jets. +It can be built using + + make example + +example.cc makes use of an input datafile which is provided in the +/data directory, and it should be run with + + ./example < ../data/Pythia-Zp2jets-lhc-pileup-1ev.dat + +The expected output can be found in example.ref \ No newline at end of file Index: contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/example.cc =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/example.cc (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/example.cc (revision 1380) @@ -0,0 +1,212 @@ +// +//---------------------------------------------------------------------- +// Example on how to estimate background (rho) using the SignalFreeBackgroundEstimator. This background estimate is then used within the Iterative Constituent Subtraction. +// +// run it with +// ./example < ../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 . +//---------------------------------------------------------------------- + + +#include "fastjet/ClusterSequence.hh" +#include "fastjet/Selector.hh" +#include "SignalFreeBackgroundEstimator.hh" +//#include "fastjet/contrib/IterativeConstituentSubtractor.hh" + +#include "functions.hh" + + +using namespace std; +using namespace fastjet; + +//---------------------------------------------------------------------- +int main(){ + // This should be set up before event loop: + double max_eta=4; // specify the maximal pseudorapidity for the input particles. It is used for the subtraction. Particles with eta>|max_eta| are removed and not used during the subtraction (they are not returned). The same parameter should be used for the SignalFreeBackgroundEstimator as it is demonstrated in this example. + double max_eta_jet=3; // the maximal pseudorapidity for selected jets. Not important for the subtraction. + + // Signal-free background estimator + fastjet::contrib::SignalFreeBackgroundEstimator bge_rho(max_eta,0.55); // maximal pseudo-rapidity cut is used inside ConstituentSubtraction, but in SignalFreeBackgroundEstimator, the range is specified by maximal rapidity cut. Therefore, it is important to apply the same pseudo-rapidity cut also for particles used for background estimation (using function "set_particles") and also derive the rho dependence on rapidity using this max pseudo-rapidity cut to get the correct rescaling function! + bge_rho.set_signal_seed_parameters(0.3,0.4); // Set the parameters for signal seeds (the first is the distance parameter for anti-kt clustering of signal particles into jets, and the second is the deltaR distance around signal jets to exclude areas with signal). + bge_rho.set_jet_rho_min(5,8); // Set the parameters for the minimal jet rho when selecting jets from the signal jets (intercept and slope of the linear function as a function of some measure of pileup specified in the set_particles function) + bge_rho.set_jet_rho_min_charged(20); // If tracking info available, set the minimal jet rho when selecting jets obtained from charged signal particles + bge_rho.set_window_parameters(0.5,0.4,0.1); // Set parameters for the window to be used to compute the weighted median + + /* Commenting event-wide pileup corrector (ICS) in this example, because currently no other contribs can be used. + contrib::IterativeConstituentSubtractor subtractor; + subtractor.set_max_eta(max_eta); // parameter for maximal |eta| cut. It is specified above. + 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 max_distances; + max_distances.push_back(0.15); + max_distances.push_back(0.2); + vector alphas; + alphas.push_back(1); + alphas.push_back(1); + subtractor.set_parameters(max_distances,alphas); // in this example, 2 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. After the first correction, the scalar sum of pt from remaining ghosts is evaluated and redistributed uniformly accross the event. + subtractor.set_ghost_removal(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); // parameter for the density of ghosts. The smaller, the better - but also the computation is slower. + subtractor.set_background_estimator(&bge_rho); // specify the background estimator to estimate rho. You can use also specify background estimator for the mass term as an additional parameter + subtractor.initialize(); // this is new compared to previous usages of ConstituentSubtractor! It should be used after specifying all the parameters and before event loop. + // print info (optional) + cout << subtractor.description() << endl; + */ + + // Grid-median background estimator and alternative ICS method to obtain input to the signal-free background estimator + GridMedianBackgroundEstimator bge_rho_grid(max_eta,0.5); + /* contrib::IterativeConstituentSubtractor subtractor_to_get_signal_seeds; + subtractor_to_get_signal_seeds.set_parameters(max_distances,alphas); // can be arbitrary + subtractor_to_get_signal_seeds.set_ghost_removal(true); + subtractor_to_get_signal_seeds.set_max_eta(max_eta); + subtractor_to_get_signal_seeds.set_background_estimator(&bge_rho_grid);*/ + + + // in event loop + // read in input particles + vector hard_event, full_event; + vector *hard_event_charged=new vector; + vector *background_event_charged=new vector; + read_event(hard_event, full_event, hard_event_charged, background_event_charged); + + hard_event = SelectorAbsEtaMax(max_eta)(hard_event); + full_event = SelectorAbsEtaMax(max_eta)(full_event); + *hard_event_charged = SelectorAbsEtaMax(max_eta)(*hard_event_charged); + *background_event_charged = SelectorAbsEtaMax(max_eta)(*background_event_charged); + + 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 hard_jets = sel_jets(clust_seq_hard.inclusive_jets()); + vector full_jets = sel_jets(clust_seq_full.inclusive_jets()); + + + // There are several options how to define signal seeds for the signal-free background estimator: + // 1. Perform an event-wide pileup correction with your preferred method to get estimated signal particles. No tracking information is needed. For example, you can use ICS with grid-median background estimator: + //bge_rho_grid.set_particles(full_event); + //vector estimated_signal=subtractor_to_get_signal_seeds.subtract_event(full_event); + //fastjet::PseudoJet jet_zeroEta(5,0,0,10); // px,py,pz,E + //double estimated_rho=bge_rho_grid.rho(jet_zeroEta); + + //bge_rho.set_particles(full_event,estimated_signal,estimated_rho); + //vector corrected_event=subtractor.subtract_event(full_event); + + // 2. An additional improvement can be done by doing an additional iteration: The corrected event from option 1 can be used as input to the signal-free background estimator: + // bge_rho_grid.set_particles(full_event); + // vector estimated_signal=subtractor_to_get_signal_seeds.subtract_event(full_event); + // fastjet::PseudoJet jet_zeroEta(5,0,0,10); // px,py,pz,E + // double estimated_rho=bge_rho_grid.rho(jet_zeroEta); + // bge_rho.set_particles(full_event,estimated_signal,estimated_rho); // first iteration + // vector estimated_signal2=subtractor.subtract_event(full_event); + // double estimated_rho2=bge_rho.rho(jet_zeroEta); + + // bge_rho.set_particles(full_event,estimated_signal2,estimated_rho2); // second iteration + // vector corrected_event=subtractor.subtract_event(full_event); + + + // 3. If tracking information is available, then the charged signal particles can be used to find the signal seeds, without the need to do any event-wide pileup correction in advance. + vector estimated_signal; // empty vector should be provided in this case + bge_rho.set_particles(full_event,estimated_signal,-1,*hard_event_charged); + cout << "obtained rho with SignalFreeBackgroundEstimator: " << bge_rho.rho() << endl; + // vector corrected_event=subtractor.subtract_event(full_event); // use this to get the corrected event using ICS + + // 4. The startegy to find signal seeds described in the above steps 1, 2, and 3 can be arbitrarily combined. For example, the combination of steps 1 and 3 can be done as follows: + // bge_rho_grid.set_particles(full_event); // Alternatively, one can use only the neutral component, i.e. perform Charged Hadron Subtraction in adavnace, and then use the output here and on the next line. + // vector estimated_signal=subtractor_to_get_signal_seeds.subtract_event(full_event); + // fastjet::PseudoJet jet_zeroEta(5,0,0,10); // px,py,pz,E + // double estimated_rho=bge_rho_grid.rho(jet_zeroEta); + + //bge_rho.set_particles(full_event,estimated_signal,estimated_rho,*hard_event_charged); + //vector corrected_event=subtractor.subtract_event(full_event); + + // 5. The user can provide his/her own set of signal seeds: + // vector additional_seeds=....; // the user obtaines the signal seeds based on his/her preferred method + // bge_rho.add_additional_seeds(additional_seeds); + // bge_rho.set_particles(full_event); // no pileup-corrected particles or charged signal particles are provided here. Alternatively, the user can also provide them. + + // 6. It is also possible to not provide any input for signal seeds. Then no areas will be excluded, and the algortithm is similar to GridMedianBackgroundEstimator, except the fact that the size and the position of the window to compute rho can be specified using the function SignalFreeBackgroundEstimator::set_window_parameters. In this case use: + // bge_rho.set_particles(full_event); + // vector corrected_event=subtractor.subtract_event(full_event); + + + /* Clustering and jet variable printing (in case pileup correction is applied) + // clustering of the corrected event + ClusterSequence clust_seq_corr(corrected_event, jet_def); + vector 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& particles) override { + std::vector empty; + this->set_particles(particles,empty); + } + + /// Tell the background estimator that it has a new event, composed of the specified particles and also include estimated signal particles. If the variable measureOfPileup is set to -1, then the minimal jet rho threshold is constant and set to the parameter _jet_rho_min_intercept. If it is >0, then it is not constant and varies linearly with measureOfPileup. If signalChargedParticles are also provided, then the signal jets are obtained also from clustering of these particles (separate jet clustering is used). + void set_particles(const std::vector& particles, const std::vector& signalParticles, const double& measureOfPileup=-1 /* can be nPU, nPV, mu, rho*/, const std::vector& signalChargedParticles=std::vector()); + + /// Add additional signal seeds from the user + void add_additional_seeds(const std::vector &additional_seeds); + + /// Get the full set of background properties + fastjet::BackgroundEstimate estimate() const override; + + /// Get the full set of background properties for a given reference jet + fastjet::BackgroundEstimate estimate(const fastjet::PseudoJet& jet) const override; + + /// Returns rho, the average background density per unit area + double rho() const override; + + /// Returns rho, the average background density per unit area, locally at the position of a given jet + double rho(const fastjet::PseudoJet & jet) override; + + /// Returns rho_m, the purely longitudinal, particle-mass-induced component of the background density per unit area + double rho_m() const FASTJET_OVERRIDE; + + /// Returns rho_m locally at the jet position. As for rho(jet), it is non-const. + double rho_m(const PseudoJet & jet) FASTJET_OVERRIDE; + + /// determine whether the automatic calculation of rho_m (by default true) + void set_compute_rho_m(bool enable){ _enable_rho_m = enable; } + + /// Returns true if this background estimator has support for determination of rho_m. + bool has_rho_m() const FASTJET_OVERRIDE {return _enable_rho_m;} + + /// Returns a textual description of the background estimator. + std::string description() const override; + + /// Set a pointer to a rescaling function + virtual void set_rescaling_class(const fastjet::FunctionOfPseudoJet* rescaling_class) override; + + /// Set the parameters for signal seeds (distance parameter for clustering of signal particles into jets, and deltaR distance around signal jets to exclude areas with signal) + void set_signal_seed_parameters(const double &signal_jets_R, const double &exclusion_deltaR){ _signal_jets_R = signal_jets_R; _exclusion_deltaR = exclusion_deltaR; } + + /// Set the parameters for the minimal jet rho when selecting jets from the signal jets + void set_jet_rho_min(const double &jet_rho_min_intercept, const double &jet_rho_min_slope){ _jet_rho_min_intercept = jet_rho_min_intercept; _jet_rho_min_slope=jet_rho_min_slope;} + + /// Set the parameter for the minimal jet rho when selecting jets obtained from charged signal particles + void set_jet_rho_min_charged(const double &jet_rho_min_charged){ _jet_rho_min_charged = jet_rho_min_charged;} + + /// Set the parameter for the spacing of ghosts + void set_ghost_size(const double &ghost_size){ _ghost_size = ghost_size; } + + /// Set the parameter for the minimal tile area + void set_tile_area_min(const double &tile_area_min){ _tile_area_min = tile_area_min; } + + /// Set parameters for the window to be used to compute the weighted median + void set_window_parameters(const double ¢er, const double &half_window, const double ®ulator_for_floating_center=-1, const double &signal_fraction_min=0.005, const double &shift_max=0.15){ _center = center; _half_window = half_window; _regulator_for_floating_center=regulator_for_floating_center; _signal_fraction_min=signal_fraction_min; _shift_max=shift_max; } + + private: + // function to compute the weighted median + double _compute_weighted_median(std::vector > &tileRho) const; + + /// Store eta extend. + double _rapidity_max=-1; + + /// Distance parameter for jet clustering with anti-kt algorithm to obtain the signal seeds + double _signal_jets_R=0.3; + + /// Parameter for the exclusion delta R around the signal seeds + double _exclusion_deltaR=0.4; + + /// Parameters to compute the minimal jet rho threshold: intercept and slope of the linear function as a function of some measure of pileup specified in the set_particles function: + double _jet_rho_min_intercept=5; + double _jet_rho_min_slope=8; + + /// Parameter for the minimal jet rho threshold for the jets clustered from charged particles. The default value is 20 GeV/(unit area), if the input charged particles are provided in GeV. + double _jet_rho_min_charged=20; + + /// Parameter for the minimal tile area after excluding signal-contaminated areas. Tiles with smaller areas are excluded from the weighted median computation. Can be modified with function set_tile_area_min + double _tile_area_min=0.00001; + + /// Parameter for the spacing of ghosts to evaluate tile areas after excluding signal-contaminated areas. The smaller ghostSize, the more precise is the computation, but also slower. The default is 0.04. Can be modified with function set_ghost_size + double _ghost_size=0.04; + + /// Window parameters: + /// Parameters for the window center and the size of half window used to compute rho + double _center=0.5; + double _half_window=0.1; + /// Parameters for the floating center of the window to compute rho + double _regulator_for_floating_center=-1; + double _signal_fraction_min=0.005; + double _shift_max=0.15; + /// Fraction of scalar pT from signal particles used to move the window to get the median. It is computed based on the provided signal particles. + double _signal_fraction; + + /// Sum of all tile areas which are used as weights to compute the weighted median + double _weights_sum; + + /// verify that particles have been set and throw an error if not + void verify_particles_set() const; + + /// Rescaling warning + fastjet::LimitedWarning _warning_rescaling; + + bool _enable_rho_m=true; + std::vector _signal_seeds; + + }; + +} + +FASTJET_END_NAMESPACE + +#endif // __SIGNAL_FREE_BACKGROUND_ESTIMATOR_H__ + Index: contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/VERSION =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/VERSION (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/VERSION (revision 1380) @@ -0,0 +1,2 @@ +1.0.0 + Index: contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/example.ref =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/example.ref (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/example.ref (revision 1380) @@ -0,0 +1,16 @@ +# 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.4.2 +# 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 GNU GPL v2 or higher. +# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code +# and 3rd party plugin jet algorithms. See COPYING file for details. +#-------------------------------------------------------------------------- +obtained rho with SignalFreeBackgroundEstimator: 13.2552 Index: contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/functions.hh =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/functions.hh (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/functions.hh (revision 1380) @@ -0,0 +1,118 @@ +// $Id: functions.hh 1224 2019-06-19 14:43:54Z peter.berta $ +// +//---------------------------------------------------------------------- +// 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 . +//---------------------------------------------------------------------- + +#include +#include +#include +#include + +#include "fastjet/PseudoJet.hh" + +using namespace fastjet; +using namespace std; + +// \class JetWidth +// computes the jet width used as one shape in the example +class JetWidth : public fastjet::FunctionOfPseudoJet{ +public: + + // action of the function + double result(const fastjet::PseudoJet &jet) const{ + if (!jet.has_constituents()){ + return -0.1; + } + double width = 1e-6; + double ptSum = 0; + + if (jet.constituents().size() < 2) return width; + + std::vector constituents = jet.constituents(); + + for (unsigned int iconst=0; iconst &hard_event, vector &full_event, vector *hard_event_charged=0, vector *pileup_event_charged=0){ + string line; + int nsub = 0; // counter to keep track of which sub-event we're reading + bool format_ptRapPhi=false; + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + + if (line.substr(0,9) == "#PTRAPPHI") format_ptRapPhi=true; + + if (line.substr(0,4) == "#END") {break;} + if (line.substr(0,9) == "#SUBSTART") { + // if more sub events follow, make copy of first one (the hard one) here + if (nsub == 1) hard_event = full_event; + nsub += 1; + } + if (line.substr(0,1) == "#") {continue;} + PseudoJet particle(0,0,1,1); + double charge,pid; + + if (format_ptRapPhi){ + double pt,y,phi; + linestream >> pt >> y >> phi >> pid >> charge; + particle.reset_PtYPhiM(pt,y,phi); + } + else{ + double px,py,pz,E; + linestream >> px >> py >> pz >> E >> pid >> charge; + particle.reset(px,py,pz,E); + } + + // push event onto back of full_event vector + + if ( nsub <= 1 ) { + if (hard_event_charged && fabs(charge)>0.99) hard_event_charged->push_back(particle); + } + else { + if (pileup_event_charged && fabs(charge)>0.99) pileup_event_charged->push_back(particle); + } + + full_event.push_back(particle); + } + + // if we have read in only one event, copy it across here... + if (nsub == 1) hard_event = full_event; + + // if there was nothing in the event + if (nsub == 0) { + cerr << "Error: read empty event\n"; + exit(-1); + } + + cout << "# " << nsub-1 << " pileup events on top of the hard event" << endl; +} Index: contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/ChangeLog =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/ChangeLog (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/ChangeLog (revision 1380) @@ -0,0 +1,4 @@ +2024-02-01 Peter Berta + + * VERSION + Release of version 1.0.0 Index: contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/COPYING =================================================================== --- contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/COPYING (revision 0) +++ contrib/contribs/SignalFreeBackgroundEstimator/tags/1.0.0/COPYING (revision 1380) @@ -0,0 +1,359 @@ +The SignalFreeBackgroundEstimator contrib to FastJet is released under the terms +of the GNU General Public License v2 (GPLv2). + +A copy of the GPLv2 is to be found at the end of this file. + +While the GPL license grants you considerable freedom, please bear in +mind that this code's use falls under guidelines similar to those that +are standard for Monte Carlo event generators +(http://www.montecarlonet.org/GUIDELINES). In particular, if you use +this code as part of work towards a scientific publication, whether +directly or contained within another program you should include a +citation to + + arXiv:2304.08383 + + +====================================================================== +====================================================================== +====================================================================== + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program 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. + + This program 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 program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License.