#include <MyTools.h>
Public Member Functions | |
MyTools (void) | |
default constructor | |
~MyTools (void) | |
Destructor. | |
double | change_btag_weight (double current_btag_weight, double delta_weight=0) |
void | scale_b_tags (std::vector< MyParticle * > *jets, int flavour, double delta_bweight=0) |
double | tauRec_ETcorr (double et_in, double eta_in, int ntrk) |
std::vector< MyParticle * > | correct_tau_et (std::vector< MyParticle * > tau_vector) |
MyParticle * | find_matching_particle (MyParticle *particle, std::vector< MyParticle * > &particle_vector, double deltaR_cut=0.1, bool bool_matchingflag=true, bool bool_usematching=true) |
MyParticle * | find_matching_particle (TLorentzVector particle_tlv, std::vector< MyParticle * > &particle_vector, double deltaR_cut=0.1, bool bool_matchingflag=true, bool bool_usematching=true) |
Int_t | nb_multiple_matches (void) |
return nb of multiple matches | |
void | clear_nb_multiple_matches (void) |
clear nb of multiple matches | |
void | clear_vector (std::vector< MyParticle * > &particle_vector) |
set all flags zero | |
std::vector< MyParticle * > | remove_overlap (std::vector< MyParticle * > vec_part_tb_rm, std::vector< MyParticle * > vec_part_rm_with, double deltaR_cut) |
std::vector< MyParticle * > | delete_doubles (std::vector< MyParticle * > p_vector, double delta_r=0.1) |
std::vector< MyParticle * > | sort_particles (std::vector< MyParticle * > p_vector) |
void | check_order (std::vector< MyParticle * > p_vector) |
std::vector< MyParticle * > | append_vector (std::vector< MyParticle * > first_vector, std::vector< MyParticle * > second_vector) |
append one vector to another | |
std::vector< MyParticle * > | pt_eta_cut (const std::vector< MyParticle * > p_vector, const double pt_min, const double pt_max, const double eta_min, const double eta_max) |
std::vector< MyParticle * > | et_eta_cut (const std::vector< MyParticle * > p_vector, const double et_min, const double et_max, const double eta_min, const double eta_max) |
std::vector< MyParticle * > | particles_from_vertex (const std::vector< MyParticle * > &p_vector, const int vertex) |
Static Public Member Functions | |
static void | PrintVector (std::vector< MyParticle * > p_vector, std::string option="") |
loops over particle vector and calls Print method of each particle | |
Private Member Functions | |
void | init () |
void | destruct (void) |
Private Attributes | |
Int_t | m_nb_multiple_matches |
Definition at line 40 of file MyTools.h.
MyParticle * MyTools::find_matching_particle | ( | MyParticle * | particle, | |
std::vector< MyParticle * > & | particle_vector, | |||
double | deltaR_cut = 0.1 , |
|||
bool | bool_matchingflag = true , |
|||
bool | bool_usematching = true | |||
) |
find matching particle to 'particle' in 'particle_vector' with deltaR < deltaR_cut, if there are multiple matching particles return the one with smallest deltaR, if matching particle found return pointer, otherwise return NULL pointer. if (bool_matchingflag = true) set flag if particle is matched; if (bool_usematching = true) care about matchingflags
Definition at line 129 of file MyTools.cxx.
std::vector< MyParticle * > MyTools::remove_overlap | ( | std::vector< MyParticle * > | vec_part_tb_rm, | |
std::vector< MyParticle * > | vec_part_rm_with, | |||
double | deltaR_cut | |||
) |
returns a new vector of particles in the vector vec_part_tb_rm without the particles which have a distance smaller than deltaR_cut with a particle in the vector vec_part_rm_with
Definition at line 175 of file MyTools.cxx.
std::vector<MyParticle*> MyTools::delete_doubles | ( | std::vector< MyParticle * > | p_vector, | |
double | delta_r = 0.1 | |||
) |
check if there are two particles within dr (default: 0.1) if yes, remove the one with the lower pt value
std::vector< MyParticle * > MyTools::sort_particles | ( | std::vector< MyParticle * > | p_vector | ) |
return vector where the particles in p_vector are sorted according to the Pt in descending order
Definition at line 209 of file MyTools.cxx.
void MyTools::check_order | ( | std::vector< MyParticle * > | p_vector | ) |
check if the particles in p_vector are sorted in descending order in Pt
Definition at line 251 of file MyTools.cxx.
std::vector<MyParticle*> MyTools::pt_eta_cut | ( | const std::vector< MyParticle * > | p_vector, | |
const double | pt_min, | |||
const double | pt_max, | |||
const double | eta_min, | |||
const double | eta_max | |||
) |
apply pt and eta cuts on particles in p_vector, return vector of particles which pass the cuts, if cutvalue is set to -1 the cut will not be applied
std::vector<MyParticle*> MyTools::et_eta_cut | ( | const std::vector< MyParticle * > | p_vector, | |
const double | et_min, | |||
const double | et_max, | |||
const double | eta_min, | |||
const double | eta_max | |||
) |
apply et and eta cuts on particles in p_vector, return vector of particles which pass the cuts, if cutvalue is set to -1 the cut will not be applied
std::vector<MyParticle*> MyTools::particles_from_vertex | ( | const std::vector< MyParticle * > & | p_vector, | |
const int | vertex | |||
) |
return vector of particles with vertex_index 'vertex'