Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:02

0001 #ifndef CANDCOMBINER_DECAYPARSER_H
0002 #define CANDCOMBINER_DECAYPARSER_H
0003 // -*- C++ -*-
0004 //
0005 // Package:     CandCombiner
0006 // Class  :     decayParser
0007 //
0008 /**\class decayParser decayParser.h CommonTools/CandCombiner/interface/decayParser.h
0009 
0010  Description: <one line class summary>
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:
0018 //         Created:  Sun Aug  7 20:26:36 EDT 2005
0019 // $Id: decayParser.h,v 1.2 2009/05/08 12:54:34 llista Exp $
0020 //
0021 
0022 // system include files
0023 
0024 // user include files
0025 #include <vector>
0026 #include <iostream>
0027 #include <string>
0028 #include "FWCore/Utilities/interface/InputTag.h"
0029 
0030 // forward declarations
0031 
0032 namespace cand {
0033   namespace parser {
0034     struct ConjInfo {
0035       enum Mode { kPrimary, kBar, kPlus, kMinus } mode_;
0036       edm::InputTag tag_;
0037       ConjInfo(const std::string& tag) : mode_(kPrimary), tag_(tag) {}
0038       ConjInfo(const char* begin, const char* end) : mode_(kPrimary), tag_(std::string(begin, end)) {}
0039     };
0040 
0041     inline std::ostream& operator<<(std::ostream& out, const ConjInfo& info) {
0042       return out << info.tag_.encode() << " "
0043                  << (0 == info.mode_
0044                          ? "p"
0045                          : (info.mode_ == ConjInfo::kBar ? "b" : (info.mode_ == ConjInfo::kPlus ? "+" : "-")));
0046     }
0047 
0048     bool decayParser(const std::string& iValue, std::vector<ConjInfo>& oStrings);
0049   }  // namespace parser
0050 }  // namespace cand
0051 
0052 #endif /* CANDCOMBINER_DECAYPARSER_H */