CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/PhysicsTools/PatAlgos/interface/HemisphereAlgo.h

Go to the documentation of this file.
00001 #ifndef HemisphereAlgo_h
00002 #define HemisphereAlgo_h
00003 
00004 
00005 /*  \class HemisphereAlgo
00006 *
00007 *  Class that, given the 4-momenta of the objects in the event, 
00008 *  allows to split up the event into two "hemispheres" according 
00009 *  to different criteria (see below)/
00010 *
00011 *  Authors: Luc Pape & Filip Moortgat      Date: July 2005
00012 *                                          Updated: July 2006
00013 *                                          Updated: 15 Sept 2006
00014 
00015 Transported to PAT by Wolfgang Adam and Tanja Rommerskirchen
00016 *
00017 */
00018 #include "DataFormats/Candidate/interface/Candidate.h"
00019 
00020 #include <vector>
00021 #include <iostream>
00022 #include <cmath>
00023 
00024 class HemisphereAlgo {
00025 
00026 public:
00027 
00028 // There are 2 constructors:
00029 // 1. Constructor taking as argument vectors of Px, Py, Pz and E of the objects in
00030 // the event that should be separated, the seeding method and the hemisphere
00031 // association method,
00032 // 2. Constructor taking as argument vectors of Px, Py, Pz and E of the objects in
00033 // the event that should be separated. The seeding method and the hemisphere
00034 // association method should then be defined by SetMethod(seeding_method, association_method).
00035 // 
00036 // Seeding method: choice of 2 inital axes
00037 //   1: 1st: max P ; 2nd: max P * delta R wrt first one 
00038 //   2: 2 objects who give maximal invariant mass (recommended)
00039 //
00040 // HemisphereAlgo association method:
00041 //   1: maximum pt longitudinal projected on the axes
00042 //   2: minimal mass squared sum of the hemispheres
00043 //   3: minimal Lund distance (recommended)
00044 //
00045 // Note that SetMethod also allows the seeding and/or association method to be
00046 // redefined for an existing hemisphere object. The GetAxis or GetGrouping is 
00047 // then recomputed using the newly defined methods.
00048 //
00049 
00050   HemisphereAlgo(const std::vector<reco::CandidatePtr>& componentRefs_, const int seed_method = 0, const int hemisphere_association_method = 0);
00051 
00052 // Destructor
00053 ~HemisphereAlgo(){};
00054 
00055 
00056 std::vector<float> getAxis1(); // returns Nx, Ny, Nz, P, E of the axis of group 1
00057 std::vector<float> getAxis2(); // returns Nx, Ny, Nz, P, E of the axis of group 2
00058 
00059 // where Nx, Ny, Nz are the direction cosines e.g. Nx = Px/P, 
00060 // P is the momentum, E is the energy
00061 
00062 std::vector<int> getGrouping(); // returns vector with "1" and "2"'s according to
00063                            // which group the object belongs 
00064                            // (order of objects in vector is same as input)
00065 
00066 void SetMethod(int seed_method, int hemisphere_association_method){
00067   seed_meth = seed_method;
00068   hemi_meth = hemisphere_association_method;
00069   status = 0;
00070 }                    // sets or overwrites the seed and association methods
00071 
00072 void SetNoSeed(int object_number)  {
00073   Object_Noseed[object_number] = 1; 
00074   status = 0;
00075 } 
00076                           // prevents an object from being used as a seed
00077                           // (method introduced on 15/09/06)
00078 
00079 private:
00080 
00081 
00082 int reconstruct(); // the hemisphere separation algorithm
00083  std::vector<reco::CandidatePtr> Object;
00084 
00085 std::vector<int> Object_Group;
00086 std::vector<int> Object_Noseed;
00087 
00088 std::vector<float> Axis1;
00089 std::vector<float> Axis2;
00090 
00091 //static const float hemivsn = 1.01;
00092 int seed_meth;
00093 int hemi_meth;
00094 int status;
00095 
00096 
00097 
00098 
00099 };
00100 
00101 #endif