--- UserCode/MitPhysics/Utils/interface/VertexTools.h 2011/07/01 13:49:01 1.3 +++ UserCode/MitPhysics/Utils/interface/VertexTools.h 2012/10/26 19:23:05 1.10 @@ -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, @@ -40,8 +46,11 @@ namespace mithep { static const Vertex* BestVtx(const PFCandidateCol *fPFJets, const VertexCol *c, const BaseVertex *fBeamSpot, FourVector diboso); + + static double BestVtx(const PFCandidateCol *fPFJets, VertexZarray zcol, const BaseVertex *fBeamSpot, FourVector diboso); + static double Prob(const PFCandidateCol *fPFJets, double zpos, const BaseVertex *fBeamSpot, FourVector diboso); @@ -52,23 +61,63 @@ namespace mithep { static VertexTools* instance(const char* str){ if(meobject == NULL){ - meobject = new VertexTools(str); + meobject = new VertexTools(); + meobject->InitM(str); } return meobject; - } + } - Float_t tmvar1, tmvar2, tmvar3, tmvar4, tmvar5, tmvar6; - TMVA::Reader* reader; + // ---------------------------------------------------------- + // Methods (added by Fabian) on the EPS BaseLine Analysis + const Vertex* findVtxBasicRanking(const Photon* ph1, + const Photon* ph2, + const BaseVertex* bsp, + const VertexCol* vtcs, + const DecayParticleCol* conv, Bool_t useMva, Double_t &vtxProb, + std::vector * debugInds = NULL , + std::vector* debugVals = NULL , + std::vector * debugConv = NULL ); + // ---------------------------------------------------------- + + + 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 }; }