00001 #ifndef CAFUTIL_RESSELECTOR_HPP__
00002 #define CAFUTIL_RESSELECTOR_HPP__
00003 #include "cafe/Processor.hpp"
00004 #include "cafe/Collection.hpp"
00005 #include "cafe/Variables.hpp"
00006 #include "cafe/Event.hpp"
00007 #include <string>
00008
00009 class TH1D ;
00010
00011 namespace caf_util {
00012
00078 class ResSelector : public cafe::Processor
00079 {
00080 public:
00081 ResSelector(const char *name);
00082 bool processEvent(cafe::Event& event);
00083
00084 bool mass(double pt1, double eta1, double phi1, int charge1,
00085 double pt2, double eta2, double phi2, int charge2,
00086 double& mass) ;
00087
00088 void begin();
00089 ~ResSelector() { }
00090
00091 private :
00092 bool GetMuon(const TMBMuon& muon, const std::string& pt_method,
00093 double& pt, double& eta, double& phi, int& charge) ;
00094 bool GetElectron(const TMBEMCluster& electron, const std::string& pt_method,
00095 double& pt, double& eta, double& phi, int& charge) ;
00096
00097 private:
00098 enum Type {MUON, ELECTRON, JET, LORENTZVECTOR} ;
00099 Type _obj1, _obj2 ;
00100
00101 enum ChargeSignSelection {NOSELECTION, OPPOSITESIGN, SAMESIGN} ;
00102 ChargeSignSelection _charge_req;
00103
00104 std::string branch1;
00105 std::string branch2;
00106 std::string _pt1_method;
00107 std::string _pt2_method;
00108 double _low_window; double _high_window;
00109 double _target_mass;
00110 double _hist_lower;
00111 double _hist_upper;
00112 unsigned int _hist_bins;
00113 bool _useEOPetrack ;
00114
00115 cafe::Variables _vars1, _vars2 ;
00116
00117 TH1D* _masshist;
00118
00119 public:
00120 ClassDef(ResSelector, 0);
00121
00122 };
00123
00124 }
00125 #endif