00001 #ifndef CAFUTIL_VERTEXSELECTOR_HPP__ 00002 #define CAFUTIL_VERTEXSELECTOR_HPP__ 00003 00004 #include "cafe/Stat.hpp" 00005 #include "caf_util/TRefFinder.hpp" 00006 #include "cafe/Event.hpp" 00007 #include "cafe/SelectUserObjects.hpp" 00008 #include "tmb_tree/TMBPrimaryVertex.hpp" 00009 00010 namespace caf_util { 00011 00056 class VertexSelector : public cafe::SelectUserObjects<TMBPrimaryVertex> 00057 { 00058 public: 00059 VertexSelector(const char *name); 00060 ~VertexSelector() {}; 00061 bool processEvent(cafe::Event &event); 00062 bool selectObject(const TMBPrimaryVertex &vertex); 00063 void begin(); 00064 private: 00065 void before(cafe::Collection<TMBPrimaryVertex>& from); 00066 private: 00067 cafe::StatPointer _stat ; //< pointer to the statistics collector class 00068 00069 int _nvsmax ; //< maximal number of vertices to be selected 00070 00071 float _zmax ; //< maximal absolute value for PV z in cm 00072 unsigned int _ntracks ; //< minimal number of tracks associated with PV 00073 00074 float _dz_muon ; //< maximal absolute distance in Z between muon and PV. 00075 std::string _muonBranch ; //< muon branch name to be used for the previous selection. 00076 float _dz_electron ; //< maximal absolute distance in Z between electron and PV. 00077 std::string _electronBranch ; //< electron branch name to be used for the previous selection. 00078 bool _useEOPetrack ; //< use track matched to electron with EOP 00079 bool _sort; 00080 00081 cafe::Event* _event ; //< pointer to the current event 00082 int _nselected ; //< number of the selected PV 00083 00084 00085 cafe::Variables _muvars, _emvars ; 00086 TRefFinder _finder ; //< workaround for the TRef problem 00087 00088 ClassDef(VertexSelector, 0) ; 00089 }; 00090 00091 } 00092 #endif // CAFUTIL_VERTEXSELECTOR_HPP__
1.3.4