--- UserCode/MitPhysics/Utils/interface/VertexTools.h 2011/07/08 17:54:27 1.5 +++ UserCode/MitPhysics/Utils/interface/VertexTools.h 2012/06/10 21:22:09 1.9 @@ -25,13 +25,19 @@ #include "TMVA/Reader.h" +namespace TMVA {//MVA + class Reader; +} + namespace mithep { typedef std::vector VertexZarray; typedef std::vector TrackArray; class VertexTools { public: - + + VertexTools(); + static double NewMass(const Photon* ph1, const Photon* ph2, const BaseVertex* vert); static VertexZarray ExtractZarray(const VertexCol* vcol, float zmin=-30, float zmax = 30, @@ -55,32 +61,60 @@ namespace mithep { static VertexTools* instance(const char* str){ if(meobject == NULL){ - meobject = new VertexTools(str); + meobject = new VertexTools(); + meobject->InitM(str); } return meobject; } // ---------------------------------------------------------- // Methods (added by Fabian) on the EPS BaseLine Analysis - static const Vertex* findVtxBasicRanking(const Photon* ph1, + const Vertex* findVtxBasicRanking(const Photon* ph1, const Photon* ph2, const BaseVertex* bsp, const VertexCol* vtcs, - const DecayParticleCol* conv = NULL); + const DecayParticleCol* conv, Bool_t useMva, Double_t &vtxProb); // ---------------------------------------------------------- - Float_t tmvar1, tmvar2, tmvar3, tmvar4, tmvar5, tmvar6; - TMVA::Reader* reader; + + static std::pair VtxZFromConversion(const Photon *p, const DecayParticle *c, const BaseVertex *bsp); + + void InitM(const char* str); + void InitP(int version = 1); + + Bool_t IsInitMvaM() const { return fIsInitMvaM; } + Bool_t IsInitMvaP() const { return fIsInitMvaP; } + + static Double_t DeltaMassVtx(Double_t xp1, Double_t yp1, Double_t zp1, + Double_t xp2, Double_t yp2, Double_t zp2, + Double_t xv, Double_t yv, Double_t zv, + Double_t dz); private: + + double VtxMvaP(float ptbal, float ptasym, float logsumpt2, float limPullToConv, float nConv) const; + static VertexTools *meobject; - VertexTools(); - VertexTools(const char* str); + TString relname; TrackArray excluded; + Bool_t fIsInitMvaM; + Bool_t fIsInitMvaP; + + Float_t tmvar1, tmvar2, tmvar3, tmvar4, tmvar5, tmvar6; + TMVA::Reader* reader; + + + TMVA::Reader *readervtx; + TMVA::Reader *readerevt; + mutable Float_t fMvaPVars[5]; + mutable Float_t fMvaPEvtVars[8]; + + TString fVtxProbMvaName; + ClassDef(VertexTools, 0) // Muon tools }; }