Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:52

0001 #include "DataFormats/BTauReco/interface/VertexTypes.h"
0002 #include <cstdlib>
0003 
0004 using namespace std;
0005 
0006 namespace reco {
0007 
0008   std::string btag::Vertices::name(VertexType v) {
0009     switch (v) {
0010       case NoVertex:
0011         return "NoVertex";
0012       case PseudoVertex:
0013         return "PseudoVertex";
0014       case RecoVertex:
0015         return "RecoVertex";
0016       default:
0017         return "???";
0018     }
0019   }
0020 
0021   btag::Vertices::VertexType btag::Vertices::type(const std::string& s) {
0022     if (s == "NoVertex" || s == "No")
0023       return NoVertex;
0024     if (s == "PseudoVertex" || s == "Pseudo")
0025       return PseudoVertex;
0026     if (s == "RecoVertex" || s == "Reco")
0027       return RecoVertex;
0028 
0029     int i = atoi(s.c_str());
0030     if (i > 0)
0031       return (VertexType)(i);
0032     if ((i == 0) && s == "0")
0033       return (VertexType)(i);
0034 
0035     return UndefVertex;
0036   }
0037 
0038 }  // namespace reco