Index: contrib/contribs/LundPlane/trunk/RecursiveLundEEGenerator.hh =================================================================== --- contrib/contribs/LundPlane/trunk/RecursiveLundEEGenerator.hh (revision 1326) +++ contrib/contribs/LundPlane/trunk/RecursiveLundEEGenerator.hh (revision 1327) @@ -1,296 +1,296 @@ // $Id$ // // Copyright (c) 2018-, Frederic A. Dreyer, Keith Hamilton, Alexander Karlberg, // Gavin P. Salam, Ludovic Scyboz, Gregory Soyez, Rob Verheyen // //---------------------------------------------------------------------- // 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 . //---------------------------------------------------------------------- #ifndef __FASTJET_CONTRIB_RECURSIVELUNDEEGENERATOR_HH__ #define __FASTJET_CONTRIB_RECURSIVELUNDEEGENERATOR_HH__ -#include "EEHelpers.hh" +#include "LundEEHelpers.hh" #include #include "fastjet/tools/Recluster.hh" #include "fastjet/JetDefinition.hh" #include "fastjet/PseudoJet.hh" #include #include #include #include using namespace std; FASTJET_BEGIN_NAMESPACE namespace contrib{ //---------------------------------------------------------------------- /// \class LundEEDeclustering /// Contains the declustering variables associated with a single qnode /// on the LundEE plane class LundEEDeclustering { public: /// return the pair PseudoJet, i.e. sum of the two subjets const PseudoJet & pair() const {return pair_;} /// returns the subjet with larger transverse momentum const PseudoJet & harder() const {return harder_;} /// returns the subjet with smaller transverse momentum const PseudoJet & softer() const {return softer_;} /// returns pair().m() [cached] double m() const {return m_;} /// returns the effective pseudorapidity of the emission [cached] double eta() const {return eta_;} /// returns sin(theta) of the branching [cached] double sin_theta() const {return sin_theta_;} /// returns softer().modp() / (softer().modp() + harder().modp()) [cached] double z() const {return z_;} /// returns softer().modp() * sin(theta()) [cached] double kt() const {return kt_;} /// returns ln(softer().modp() * sin(theta())) [cached] double lnkt() const {return lnkt_;} /// returns z() * Delta() [cached] double kappa() const {return kappa_;} /// returns the index of the plane to which this branching belongs int iplane() const {return iplane_;} /// returns the depth of the plane on which this declustering /// occurred. 0 is the primary plane, 1 is the first set of leaves, etc. int depth() const {return depth_;} /// returns iplane (plane index) of the leaf associated with the /// potential further declustering of the softer of the objects in /// this splitting int leaf_iplane() const {return leaf_iplane_;} /// Returns sign_s, indicating the initial parent jet index of this splitting int sign_s() const {return sign_s_;} /// (DEPRECATED) /// returns an azimuthal type angle between this declustering plane and the previous one /// Note: one should use psibar() instead, since we found that this definition of psi is /// not invariant under rotations of the event double psi() const {return psi_;} /// update the azimuthal angle (deprecated) void set_psi(double psi) {psi_ = psi;} /// returns the azimuthal angle psibar between this declustering plane and the previous one double psibar() const {return psibar_;} /// returns the coordinates in the Lund plane std::pair const lund_coordinates() const { return std::pair(eta_,lnkt_); } virtual ~LundEEDeclustering() {} private: int iplane_; double psi_, psibar_, lnkt_, eta_; double m_, z_, kt_, kappa_, sin_theta_; PseudoJet pair_, harder_, softer_; int depth_ = -1, leaf_iplane_ = -1; int sign_s_; protected: /// the constructor is private, because users will not generally be /// constructing a LundEEDeclustering element themselves. LundEEDeclustering(const PseudoJet& pair, const PseudoJet& j1, const PseudoJet& j2, int iplane = -1, double psi = 0.0, double psibar = 0.0, int depth = -1, int leaf_iplane = -1, int sign_s = 1); friend class RecursiveLundEEGenerator; }; /// Default comparison operator for LundEEDeclustering, using kt as the ordering. /// Useful when including declusterings in structures like priority queues inline bool operator<(const LundEEDeclustering& d1, const LundEEDeclustering& d2) { return d1.kt() < d2.kt(); } //---------------------------------------------------------------------- /// Class to carry out Lund declustering to get anything from the /// primary Lund plane declusterings to the full Lund diagram with all /// its leaves, etc. class RecursiveLundEEGenerator { public: /// constructs a RecursiveLundEEGenerator with the specified depth. /// - depth = 0 means only primary declusterings are registered /// - depth = 1 means the first set of leaves are declustered /// - ... /// - depth < 0 means no limit, i.e. recurse through all leaves RecursiveLundEEGenerator(int max_depth = 0, bool dynamical_psi_ref = false) : max_depth_(max_depth), nx_(1,0,0,0), ny_(0,1,0,0), dynamical_psi_ref_(dynamical_psi_ref) {} /// destructor virtual ~RecursiveLundEEGenerator() {} /// This takes a cluster sequence with an e+e- C/A style algorithm, e.g. /// EECambridgePlugin(ycut=1.0). /// /// The output is a vector of LundEEDeclustering objects, ordered /// according to kt virtual std::vector result(const ClusterSequence & cs) const { std::vector exclusive_jets = cs.exclusive_jets(2); assert(exclusive_jets.size() == 2); // order the two jets according to momentum along z axis if (exclusive_jets[0].pz() < exclusive_jets[1].pz()) { std::swap(exclusive_jets[0],exclusive_jets[1]); } PseudoJet d_ev = exclusive_jets[0] - exclusive_jets[1]; - Matrix3 rotmat = Matrix3::from_direction(d_ev); + lund_plane::Matrix3 rotmat = lund_plane::Matrix3::from_direction(d_ev); std::vector declusterings; int depth = 0; int max_iplane_sofar = 1; for (unsigned ijet = 0; ijet < exclusive_jets.size(); ijet++) { // reference direction for psibar calculation PseudoJet axis = d_ev/sqrt(d_ev.modp2()); PseudoJet ref_plane = axis; int sign_s = ijet == 0? +1 : -1; // We can pass a vector normal to a plane of reference for phi definitions append_to_vector(declusterings, exclusive_jets[ijet], depth, ijet, max_iplane_sofar, rotmat, sign_s, exclusive_jets[0], exclusive_jets[1], ref_plane, 0., true); } // a typedef to save typing below typedef LundEEDeclustering LD; // sort so that declusterings are returned in order of decreasing // kt (if result of the lambda is true, then first object appears // before the second one in the final sorted list) sort(declusterings.begin(), declusterings.end(), [](const LD & d1, LD & d2){return d1.kt() > d2.kt();}); return declusterings; } private: /// internal routine to recursively carry out the declusterings, /// adding each one to the declusterings vector; the primary /// ones are dealt with first (from large to small angle), /// and then secondary ones take place. void append_to_vector(std::vector & declusterings, const PseudoJet & jet, int depth, int iplane, int & max_iplane_sofar, - const Matrix3 & rotmat, int sign_s, + const lund_plane::Matrix3 & rotmat, int sign_s, const PseudoJet & harder, const PseudoJet & softer, const PseudoJet & psibar_ref_plane, const double & last_psibar, bool first_time) const { PseudoJet j1, j2; if (!jet.has_parents(j1, j2)) return; if (j1.modp2() < j2.modp2()) std::swap(j1,j2); // calculation of azimuth psi - Matrix3 new_rotmat; + lund_plane::Matrix3 new_rotmat; if (dynamical_psi_ref_) { - new_rotmat = Matrix3::from_direction(rotmat.transpose()*(sign_s*jet)) * rotmat; + new_rotmat = lund_plane::Matrix3::from_direction(rotmat.transpose()*(sign_s*jet)) * rotmat; } else { new_rotmat = rotmat; } PseudoJet rx = new_rotmat * nx_; PseudoJet ry = new_rotmat * ny_; PseudoJet u1 = j1/j1.modp(), u2 = j2/j2.modp(); PseudoJet du = u2 - u1; double x = du.px() * rx.px() + du.py() * rx.py() + du.pz() * rx.pz(); double y = du.px() * ry.px() + du.py() * ry.py() + du.pz() * ry.pz(); double psi = atan2(y,x); // calculation of psibar double psibar = 0.; PseudoJet n1, n2; // First psibar for this jet if (first_time) { // Compute the angle between the planes spanned by (some axis,j1) and by (j1,j2) - n1 = cross_product(psibar_ref_plane,j1); - n2 = cross_product(j1,j2); + n1 = lund_plane::cross_product(psibar_ref_plane,j1); + n2 = lund_plane::cross_product(j1,j2); double signed_angle = 0.; n2 /= n2.modp(); if (n1.modp() != 0) { n1 /= n1.modp(); - signed_angle = signed_angle_between_planes(n1,n2,j1); + signed_angle = lund_plane::signed_angle_between_planes(n1,n2,j1); } - psibar = map_to_pi(j1.phi() + signed_angle); + psibar = lund_plane::map_to_pi(j1.phi() + signed_angle); } // Else take the value of psibar_i and the plane from the last splitting to define psibar_{i+1} else { - n2 = cross_product(j1,j2); + n2 = lund_plane::cross_product(j1,j2); n2 /= n2.modp(); - psibar = map_to_pi(last_psibar + signed_angle_between_planes(psibar_ref_plane, n2, j1)); + psibar = lund_plane::map_to_pi(last_psibar + lund_plane::signed_angle_between_planes(psibar_ref_plane, n2, j1)); } int leaf_iplane = -1; // we will recurse into the softer "parent" only if the depth is // not yet at its limit or if there is no limit on the depth (max_depth<0) bool recurse_into_softer = (depth < max_depth_ || max_depth_ < 0); if (recurse_into_softer) { max_iplane_sofar += 1; leaf_iplane = max_iplane_sofar; } LundEEDeclustering declust(jet, j1, j2, iplane, psi, psibar, depth, leaf_iplane, sign_s); declusterings.push_back(declust); // now recurse // for the definition of psibar, we recursively pass the last splitting plane (normal to n2) and the last value // of psibar append_to_vector(declusterings, j1, depth, iplane, max_iplane_sofar, new_rotmat, sign_s, u1, u2, n2, psibar, false); if (recurse_into_softer) { append_to_vector(declusterings, j2, depth+1, leaf_iplane, max_iplane_sofar, new_rotmat, sign_s, u1, u2, n2, psibar, false); } } int max_depth_ = 0; /// vectors used to help define psi PseudoJet nx_; PseudoJet ny_; bool dynamical_psi_ref_; }; } // namespace contrib FASTJET_END_NAMESPACE /// for output of declustering information std::ostream & operator<<(std::ostream & ostr, const fastjet::contrib::LundEEDeclustering & d); #endif // __FASTJET_CONTRIB_RECURSIVELUNDEEGENERATOR_HH__ Index: contrib/contribs/LundPlane/trunk/example_dpsi_slice.cc =================================================================== --- contrib/contribs/LundPlane/trunk/example_dpsi_slice.cc (revision 1326) +++ contrib/contribs/LundPlane/trunk/example_dpsi_slice.cc (revision 1327) @@ -1,173 +1,173 @@ //---------------------------------------------------------------------- /// \file example_dpsi_slice.cc /// /// This example program is meant to illustrate how the /// fastjet::contrib::RecursiveLundEEGenerator class is used. /// /// Run this example with /// /// \verbatim /// ./example_dpsi_slice < ../data/single-ee-event.dat /// \endverbatim //---------------------------------------------------------------------- // $Id$ // // Copyright (c) 2018-, Frederic A. Dreyer, Keith Hamilton, Alexander Karlberg, // Gavin P. Salam, Ludovic Scyboz, Gregory Soyez, Rob Verheyen // //---------------------------------------------------------------------- // 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 "fastjet/PseudoJet.hh" #include "fastjet/EECambridgePlugin.hh" #include #include "RecursiveLundEEGenerator.hh" // In external code, this should be fastjet/contrib/RecursiveLundEEGenerator.hh using namespace std; using namespace fastjet; // Definitions for the slice observable (ymax = 1, zcut = 0.1) double abs_rap_slice = 1; double z2_cut = 0.1; // forward declaration to make things clearer void read_event(vector &event); // returns true if PseudoJet p is in the central slice of half-width abs_rap_slice // w.r.t. the event axis pref bool in_slice(const PseudoJet & p, const PseudoJet & pref) { // Rotate p, and use the rapidity to determine if p is in the slice - contrib::Matrix3 rotmat = contrib::Matrix3::from_direction(pref).transpose(); + contrib::lund_plane::Matrix3 rotmat = contrib::lund_plane::Matrix3::from_direction(pref).transpose(); const PseudoJet p_rot = rotmat*p; return fabs(p_rot.rap()) < abs_rap_slice; } //---------------------------------------------------------------------- int main(){ //---------------------------------------------------------- // read in input particles vector event; read_event(event); cout << "# read an event with " << event.size() << " particles" << endl; //---------------------------------------------------------- // create an instance of RecursiveLundEEGenerator, with default options int depth = -1; bool dynamic_psi_reference = true; fastjet::contrib::RecursiveLundEEGenerator lund(depth, dynamic_psi_reference); // first get some C/A jets double y3_cut = 1.0; JetDefinition::Plugin* ee_plugin = new EECambridgePlugin(y3_cut); JetDefinition jet_def(ee_plugin); ClusterSequence cs(event, jet_def); // Get the event axis (to be used for the slice) std::vector excl = cs.exclusive_jets(2); assert(excl.size() == 2); // order the two jets according to momentum along z axis if (excl[0].pz() < excl[1].pz()) { std::swap(excl[0],excl[1]); } const PseudoJet ev_axis = excl[0]-excl[1]; // Get the list of primary declusterings const vector declusts = lund.result(cs); // find the declustering that throws something into a fixed slice // (from a parent that was not in the slice) and that throws the // largest pt (relative to the z axis) into that slice int index_of_max_pt_in_slice = -1; double max_pt_in_slice = 0.0; double psi_1; for (unsigned i = 0; i < declusts.size(); i++) { const auto & decl = declusts[i]; if (!in_slice(decl.harder(), ev_axis) && in_slice(decl.softer(), ev_axis)) { if (decl.softer().pt() > max_pt_in_slice) { index_of_max_pt_in_slice = i; max_pt_in_slice = decl.softer().pt(); psi_1 = decl.psibar(); } } } if (index_of_max_pt_in_slice < 0) return 0; // establish what we need to follow and the reference psi_1 int iplane_to_follow = declusts[index_of_max_pt_in_slice].leaf_iplane(); vector secondaries; for (const auto & declust: declusts){ if (declust.iplane() == iplane_to_follow) secondaries.push_back(&declust); } int index_of_max_kt_secondary = -1; double dpsi; for (uint i_secondary=0; i_secondaryz() > z2_cut) { index_of_max_kt_secondary = i_secondary; double psi_2 = secondaries[i_secondary]->psibar(); - dpsi = contrib::map_to_pi(psi_2 - psi_1); + dpsi = contrib::lund_plane::map_to_pi(psi_2 - psi_1); break; } } if (index_of_max_kt_secondary < 0) return 0; cout << "Primary in the central slice, with Lund coordinates ( ln 1/Delta, ln kt, psibar ):" << endl; pair coords = declusts[index_of_max_pt_in_slice].lund_coordinates(); cout << "index [" << index_of_max_pt_in_slice << "](" << coords.first << ", " << coords.second << ", " << declusts[index_of_max_pt_in_slice].psibar() << ")" << endl; cout << endl << "with Lund coordinates for the (highest-kT) secondary plane that passes the zcut of " << z2_cut << endl; coords = secondaries[index_of_max_kt_secondary]->lund_coordinates(); cout << "index [" << index_of_max_kt_secondary << "](" << coords.first << ", " << coords.second << ", " << secondaries[index_of_max_kt_secondary]->psibar() << ")"; cout << " --> delta_psi,slice = " << dpsi << endl; // Delete the EECambridge plugin delete ee_plugin; return 0; } // read in input particles void read_event(vector &event){ string line; while (getline(cin, line)) { istringstream linestream(line); // take substrings to avoid problems when there is extra "pollution" // characters (e.g. line-feed). if (line.substr(0,4) == "#END") {return;} if (line.substr(0,1) == "#") {continue;} double px,py,pz,E; linestream >> px >> py >> pz >> E; PseudoJet particle(px,py,pz,E); // push event onto back of full_event vector event.push_back(particle); } } Index: contrib/contribs/LundPlane/trunk/Makefile =================================================================== --- contrib/contribs/LundPlane/trunk/Makefile (revision 1326) +++ contrib/contribs/LundPlane/trunk/Makefile (revision 1327) @@ -1,91 +1,91 @@ # 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 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=LundPlane SRCS=LundGenerator.cc LundWithSecondary.cc SecondaryLund.cc RecursiveLundEEGenerator.cc EXAMPLES=example example_secondary example_dpsi_collinear example_dpsi_slice -INSTALLED_HEADERS=LundGenerator.hh LundWithSecondary.hh SecondaryLund.hh RecursiveLundEEGenerator.hh LundJSON.hh +INSTALLED_HEADERS=LundGenerator.hh LundWithSecondary.hh SecondaryLund.hh RecursiveLundEEGenerator.hh LundJSON.hh LundEEHelpers.hh #------------------------------------------------------------------------ CXXFLAGS+= $(shell $(FASTJETCONFIG) --cxxflags) LDFLAGS += -lm $(shell $(FASTJETCONFIG) --libs) -lfastjetplugins 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\ if [ "$${prog}" = "example_dpsi_collinear" ] || [ "$${prog}" = "example_dpsi_slice" ]; then \ $(check_script) $${prog} ../data/single-ee-event.dat || exit 1; \ else \ $(check_script) $${prog} ../data/single-event.dat || exit 1; \ fi; \ 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) # DO NOT DELETE LundGenerator.o: LundGenerator.hh LundWithSecondary.o: LundWithSecondary.hh LundGenerator.hh SecondaryLund.hh SecondaryLund.o: SecondaryLund.hh LundGenerator.hh -RecursiveLundEEGenerator.o: RecursiveLundEEGenerator.hh EEHelpers.hh +RecursiveLundEEGenerator.o: RecursiveLundEEGenerator.hh LundEEHelpers.hh example.o: LundGenerator.hh LundJSON.hh example_secondary.o: LundWithSecondary.hh LundGenerator.hh SecondaryLund.hh -example_dpsi_collinear.o: RecursiveLundEEGenerator.hh EEHelpers.hh -example_dpsi_slice.o: RecursiveLundEEGenerator.hh EEHelpers.hh +example_dpsi_collinear.o: RecursiveLundEEGenerator.hh LundEEHelpers.hh +example_dpsi_slice.o: RecursiveLundEEGenerator.hh LundEEHelpers.hh Index: contrib/contribs/LundPlane/trunk/example_dpsi_collinear.cc =================================================================== --- contrib/contribs/LundPlane/trunk/example_dpsi_collinear.cc (revision 1326) +++ contrib/contribs/LundPlane/trunk/example_dpsi_collinear.cc (revision 1327) @@ -1,145 +1,145 @@ //---------------------------------------------------------------------- /// \file example_dpsi_collinear.cc /// /// This example program is meant to illustrate how the /// fastjet::contrib::RecursiveLundEEGenerator class is used. /// /// Run this example with /// /// \verbatim /// ./example_dpsi_collinear < ../data/single-ee-event.dat /// \endverbatim //---------------------------------------------------------------------- // $Id$ // // Copyright (c) 2018-, Frederic A. Dreyer, Keith Hamilton, Alexander Karlberg, // Gavin P. Salam, Ludovic Scyboz, Gregory Soyez, Rob Verheyen // //---------------------------------------------------------------------- // 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 "fastjet/PseudoJet.hh" #include "fastjet/EECambridgePlugin.hh" #include #include "RecursiveLundEEGenerator.hh" // In external code, this should be fastjet/contrib/RecursiveLundEEGenerator.hh using namespace std; using namespace fastjet; // Definitions for the collinear observable double z1_cut = 0.1; double z2_cut = 0.1; // forward declaration to make things clearer void read_event(vector &event); //---------------------------------------------------------------------- int main(){ //---------------------------------------------------------- // read in input particles vector event; read_event(event); cout << "# read an event with " << event.size() << " particles" << endl; //---------------------------------------------------------- // create an instance of RecursiveLundEEGenerator, with default options int depth = -1; bool dynamic_psi_reference = true; fastjet::contrib::RecursiveLundEEGenerator lund(depth, dynamic_psi_reference); // first get some C/A jets double y3_cut = 1.0; JetDefinition::Plugin* ee_plugin = new EECambridgePlugin(y3_cut); JetDefinition jet_def(ee_plugin); ClusterSequence cs(event, jet_def); // Get the list of primary declusterings const vector declusts = lund.result(cs); // Find the highest-kt primary declustering (ordered in kt by default) int i_primary = -1; double psi_1; for (int i=0; i z1_cut) { i_primary = i; psi_1 = declusts[i].psibar(); break; } } if (i_primary < 0) return 0; // Find the highest-kt secondary associated to that Lund leaf int iplane_to_follow = declusts[i_primary].leaf_iplane(); vector secondaries; for (const auto & declust: declusts){ if (declust.iplane() == iplane_to_follow) secondaries.push_back(&declust); } if(secondaries.size() < 1) return 0; int i_secondary = -1; double dpsi; for (int i=0; iz() > z2_cut) { i_secondary = i; double psi_2 = secondaries[i]->psibar(); - dpsi = contrib::map_to_pi(psi_2-psi_1); + dpsi = contrib::lund_plane::map_to_pi(psi_2-psi_1); break; } } if (i_secondary < 0) return 0; cout << "Primary that passes the zcut of " << z1_cut << ", with Lund coordinates ( ln 1/Delta, ln kt, psibar ):" << endl; pair coords = declusts[i_primary].lund_coordinates(); cout << "index [" << i_primary << "](" << coords.first << ", " << coords.second << ", " << declusts[i_primary].psibar() << ")" << endl; cout << endl << "with Lund coordinates for the secondary plane that passes the zcut of " << z2_cut << endl; coords = secondaries[i_secondary]->lund_coordinates(); cout << "index [" << i_secondary << "](" << coords.first << ", " << coords.second << ", " << secondaries[i_secondary]->psibar() << ")"; cout << " --> delta_psi = " << dpsi << endl; // Delete the EECambridge plugin delete ee_plugin; return 0; } // read in input particles void read_event(vector &event){ string line; while (getline(cin, line)) { istringstream linestream(line); // take substrings to avoid problems when there is extra "pollution" // characters (e.g. line-feed). if (line.substr(0,4) == "#END") {return;} if (line.substr(0,1) == "#") {continue;} double px,py,pz,E; linestream >> px >> py >> pz >> E; PseudoJet particle(px,py,pz,E); // push event onto back of full_event vector event.push_back(particle); } } Index: contrib/contribs/LundPlane/trunk/ChangeLog =================================================================== --- contrib/contribs/LundPlane/trunk/ChangeLog (revision 1326) +++ contrib/contribs/LundPlane/trunk/ChangeLog (revision 1327) @@ -1,87 +1,106 @@ +2022-10-04 Tue + Ludo Scyboz + + * EEHelpers.hh -> LundEEHelpers.hh: + EEHelpers.hh was not being installed; given that it's a potentially + common name, renamed it before including among the installation + targets. + + Also placed whole contents in a new contrib::lund_plane namespace, + because of certain potentially common names like cross_product + + * Makefile: + replaced EEHelpers.hh -> LundEEHelpers.hh and made sure that + LundEEHelpers.hh gets installed (without which RecursiveLundEEGenerator.hh + cannot be used) + + * example_dpsi_collinear.cc: + * example_dpsi_slice.cc: + use of things from LundEEHelpers.hh updated to use of new namespace + 2022-08-20 Gavin Salam * VERSION: * NEWS: prepared for release 2.0.2 * Makefile: updated some dependencies * EEHelpers.hh: added #include , as per request from Andy Buckley for compilation with g++-12 on some systems 2021-12-06 Gavin Salam * NEWS: * VERSION: prepared for release 2.0.1 * AUTHORS: fixed missing names and publication info 2021-12-06 Gregory Soyez * SecondaryLund.cc: fixed int v. unsigned int in loop over vector indices 2021-12-06 Gavin Salam * example.py: fixed name of executable in comments about how to execute this (thanks to Matteo Cacciari) 2021-11-09 Ludovic Scyboz * VERSION: preparing for release of 2.0.0 * RecursiveLundEEGenerator.hh: * RecursiveLundEEGenerator.cc: class for recursive Lund declustering in e+e- * example_dpsi_collinear.cc: spin-sensitive collinear observable from 2103.16526 * example_dpsi_slice.cc: spin-sensitive non-global observable from 2111.01161 2020-02-23 Gavin Salam * NEWS: * VERSION: preparing for release of 1.0.3 * example.cc: changed outfile open(filename) to outfile.open(filename.c_str()); to attempt to solve issue reported by Steven Schramm. 2018-10-26 Gavin Salam * read_lund_json.py: removed extraneous normalisation of zeroth bin in the LundImage class. Added documentation. 2018-08-30 Gavin Salam * VERSION: * NEWS: Release of version 1.0.1 2018-08-23 Gavin Salam * LundWithSecondary.hh: * LundWithSecondary.cc: added secondary_index(...), removed virtual qualifier from various functions * example_secondary.cc: * example_secondary.ref: example now prints out index of the primary declustering being used for the secondary. Referemce file updated accordingly. 2018-08-09 Frédéric Dreyer First version of LundPlane. Index: contrib/contribs/LundPlane/trunk/RecursiveLundEEGenerator.cc =================================================================== --- contrib/contribs/LundPlane/trunk/RecursiveLundEEGenerator.cc (revision 1326) +++ contrib/contribs/LundPlane/trunk/RecursiveLundEEGenerator.cc (revision 1327) @@ -1,86 +1,88 @@ // $Id$ // // Copyright (c) 2018-, Frederic A. Dreyer, Keith Hamilton, Alexander Karlberg, // Gavin P. Salam, Ludovic Scyboz, Gregory Soyez, Rob Verheyen // //---------------------------------------------------------------------- // 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 "RecursiveLundEEGenerator.hh" using namespace std; FASTJET_BEGIN_NAMESPACE namespace contrib{ + +using namespace lund_plane; LundEEDeclustering::LundEEDeclustering(const PseudoJet& pair, const PseudoJet& j1, const PseudoJet& j2, int iplane, double psi, double psibar, int depth, int leaf_iplane, int sign_s) : iplane_(iplane), psi_(psi), psibar_(psibar), m_(pair.m()), pair_(pair), depth_(depth), leaf_iplane_(leaf_iplane), sign_s_(sign_s) { double omc = one_minus_costheta(j1,j2); if (omc > sqrt(numeric_limits::epsilon())) { double cos_theta = 1.0 - omc; double theta = acos(cos_theta); sin_theta_ = sin(theta); eta_ = -log(tan(theta/2.0)); } else { // we are at small angles, so use small-angle formulas double theta = sqrt(2. * omc); sin_theta_ = theta; eta_ = -log(theta/2); } // establish which of j1 and j2 is softer if (j1.modp2() > j2.modp2()) { harder_ = j1; softer_ = j2; } else { harder_ = j2; softer_ = j1; } // now work out the various LundEE declustering variables double softer_modp = softer_.modp(); z_ = softer_modp / (softer_modp + harder_.modp()); kt_ = softer_modp * sin_theta_; lnkt_ = log(kt_); kappa_ = z_ * sin_theta_; } } // namespace contrib FASTJET_END_NAMESPACE std::ostream & operator<<(std::ostream & ostr, const fastjet::contrib::LundEEDeclustering & d) { ostr << "kt = " << d.kt() << " z = " << d.z() << " eta = " << d.eta() << " psi = " << d.psi() << " psibar = " << d.psibar() << " m = " << d.m() << " iplane = " << d.iplane() << " depth = " << d.depth() << " leaf_iplane = " << d.leaf_iplane(); return ostr; } Index: contrib/contribs/LundPlane/trunk =================================================================== --- contrib/contribs/LundPlane/trunk (revision 1326) +++ contrib/contribs/LundPlane/trunk (revision 1327) Property changes on: contrib/contribs/LundPlane/trunk ___________________________________________________________________ Modified: svn:ignore ## -1,3 +1,18 ## # Added by svn-ignore on 2018-08-23 example example_secondary + +# Added by svn-ignore on 2022-10-04 +example_dpsi_slice + +# Added by svn-ignore on 2022-10-04 +example_dpsi_collinear + +# Added by svn-ignore on 2022-10-04 +example_dpsi_slice.diff +example_secondary.diff +example_dpsi_collinear.diff +Makefile.bak + +# Added by svn-ignore on 2022-10-04 +example.diff