NtupleReader/NtupleReader/MyTools.h

00001 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002 // 13.12.2006, AUTHOR: all
00003 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00004 
00005 #ifndef MyToolsH
00006 #define MyToolsH
00007 
00008 //:::::::::::::::::::
00009 //:: CLASS MyTools ::
00010 //:::::::::::::::::::
00011 
00020 
00021 //::::::::::::::::::
00022 //:: HEADER FILES ::
00023 //::::::::::::::::::
00024 
00025 // STL //
00026 #include <iostream> 
00027 //#include <fstream> 
00028 
00029 //#include <string>
00030 #include <vector>
00031 
00032 // // ROOT //
00033 #include "TLorentzVector.h"
00034 
00035 // HiggsAnalysis //
00036 #include "MyParticle.h"
00037 #include "MyTauJet.h"
00038 #include "MyParticleJet.h"
00039 
00040 class MyTools {
00041     
00042 public:
00043     // Constructors //
00044     MyTools(void) {
00045         init();
00046     }
00048     
00049     ~MyTools(void) {
00050         destruct();
00051     }
00053     
00054   // Methods //
00055 
00056     // change weight of jet
00057     double change_btag_weight(double current_btag_weight, double delta_weight=0);
00058     //recalculated all btag-weight of jets with pdgID 'flavour' a particle vector 'jets'
00059     //    You have to do your weight cut on the changed vector!!!
00060     void scale_b_tags( std::vector<MyParticle*> * jets, int flavour, double delta_bweight=0);
00061     
00062     //recalib tau et Joern GK 15.5.2007//
00063     double tauRec_ETcorr(double et_in, double eta_in, int ntrk);
00064     //input: et_in =ethadcalib+etemcalib => Et of tau candidate
00065     //       eta_in                      => eta of tau candidate    
00066     //       ntrk                        => # of assosiated tracks
00067     //return = recalibrated et, llh,eta,phi not changing.
00068     //recalib ALL taus//
00069     std::vector<MyParticle*> correct_tau_et( std::vector<MyParticle*> tau_vector);
00070     
00071     // matching // 
00072 
00073     MyParticle* find_matching_particle( MyParticle* particle, 
00074                                         std::vector<MyParticle*> & particle_vector,
00075                                         double deltaR_cut = 0.1,
00076                                         bool bool_matchingflag = true,
00077                                         bool bool_usematching = true); 
00083     MyParticle* find_matching_particle( TLorentzVector particle_tlv, 
00084                                         std::vector<MyParticle*> & particle_vector,
00085                                         double deltaR_cut = 0.1,
00086                                         bool bool_matchingflag = true,
00087                                         bool bool_usematching = true); 
00088         
00089     Int_t nb_multiple_matches(void);
00091 
00092     void clear_nb_multiple_matches(void);
00094 
00095     void clear_vector(std::vector<MyParticle*> & particle_vector);
00097 
00098 
00099     // overlap removal //
00100 
00101     std::vector<MyParticle*> 
00102     remove_overlap( std::vector<MyParticle*> vec_part_tb_rm,
00103                     std::vector<MyParticle*> vec_part_rm_with,
00104                     double deltaR_cut);
00108 
00109 
00110     std::vector<MyParticle*>
00111     delete_doubles(std::vector<MyParticle*> p_vector, double delta_r = 0.1);
00114 
00115 
00116     //check if as particle is stored twice   .
00117     //std::vector<MyParticle*> remove_own_overlap(std::vector<MyParticle*> particle_vector, 
00118         //                                          double radius );
00119 
00120 
00121     // vector sorting //
00122 
00123     std::vector<MyParticle*>
00124     sort_particles(std::vector<MyParticle*> p_vector);
00127 
00128     void check_order(std::vector<MyParticle*> p_vector);
00132     //append one vector to another
00133     std::vector<MyParticle*> append_vector(std::vector<MyParticle*> first_vector, 
00134                                            std::vector<MyParticle*> second_vector);
00136 
00137 
00138     // pt and eta cut 
00139     
00140     std::vector<MyParticle*> 
00141     pt_eta_cut( const std::vector<MyParticle*> p_vector,
00142                 const double pt_min,  const double pt_max,
00143                 const double eta_min, const double eta_max);
00147 
00148     // et and eta cut 
00149     
00150     std::vector<MyParticle*> 
00151     et_eta_cut( const std::vector<MyParticle*> p_vector,
00152                 const double et_min,  const double et_max,
00153                 const double eta_min, const double eta_max);
00157 
00158     std::vector<MyParticle*> 
00159     particles_from_vertex( const std::vector<MyParticle*> & p_vector, 
00160                            const int vertex);
00163     
00164 
00165 
00166     static void PrintVector( std::vector<MyParticle*> p_vector, 
00167                              std::string option = "");
00169 
00170 private:
00171   // private variables and methods //
00172     
00173     // matching // 
00174     Int_t m_nb_multiple_matches; // nb of multiple matches
00175     
00176     void init();
00177          // initialization method (variables as defined
00178          // in the constructor of this class)
00179     void destruct(void);
00180          // destruction method
00181     
00182 };
00183 
00184 #endif

Generated on Tue Oct 21 11:50:45 2008 for NtupleAnalysis by  doxygen 1.5.1