CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CommonTools/CandAlgos/interface/decayParser.h

Go to the documentation of this file.
00001 #ifndef CANDCOMBINER_DECAYPARSER_H
00002 #define CANDCOMBINER_DECAYPARSER_H
00003 // -*- C++ -*-
00004 //
00005 // Package:     CandCombiner
00006 // Class  :     decayParser
00007 // 
00016 //
00017 // Original Author:  
00018 //         Created:  Sun Aug  7 20:26:36 EDT 2005
00019 // $Id: decayParser.h,v 1.3 2010/02/11 00:10:46 wmtan Exp $
00020 //
00021 
00022 // system include files
00023 
00024 // user include files
00025 #include <vector>
00026 #include <iostream>
00027 #include <string>
00028 #include <boost/spirit/include/classic_core.hpp>
00029 #include <boost/spirit/include/classic_push_back_actor.hpp>
00030 #include "FWCore/Utilities/interface/InputTag.h"
00031 
00032 // forward declarations
00033 
00034 namespace cand {
00035   namespace parser {
00036     struct ConjInfo {
00037       enum Mode { kPrimary, kBar, kPlus, kMinus } mode_;
00038       edm::InputTag tag_;
00039       ConjInfo( const std::string& tag ) : mode_( kPrimary ), tag_( tag ) { }
00040       ConjInfo( const char* begin, const char* end ) : mode_( kPrimary ), tag_( std::string( begin, end ) ) { }
00041     };
00042     
00043     inline
00044     std::ostream& operator<<(std::ostream& out, const ConjInfo& info ) {
00045       return out << info.tag_ .encode() << " " 
00046                  << ( 0 == info.mode_ ? "p" : ( info.mode_ == ConjInfo::kBar ? "b" : (info.mode_ == ConjInfo::kPlus ? "+" : "-" ) ) );
00047     }
00048     
00049     bool decayParser( const std::string& iValue, std::vector<ConjInfo>& oStrings );
00050   }
00051 }
00052 
00053 #endif /* CANDCOMBINER_DECAYPARSER_H */