Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:44:04

0001 // -*- C++ -*-
0002 //
0003 // This file is part of LHAPDF
0004 // Copyright (C) 2012-2022 The LHAPDF collaboration (see AUTHORS for details)
0005 //
0006 #pragma once
0007 #ifndef LHAPDF_PDFIndex_H
0008 #define LHAPDF_PDFIndex_H
0009 
0010 #include "LHAPDF/Utils.h"
0011 
0012 namespace LHAPDF {
0013 
0014 
0015   /// @defgroup index PDF lookup in the LHAPDF ID index
0016   ///@{
0017 
0018   /// Get the singleton LHAPDF set ID -> PDF index map
0019   std::map<int, std::string>& getPDFIndex();
0020 
0021   /// Look up a PDF set name and member ID by the LHAPDF ID code
0022   ///
0023   /// The set name and member ID are returned as an std::pair.
0024   /// If lookup fails, a pair ("", -1) is returned.
0025   std::pair<std::string, int> lookupPDF(int lhaid);
0026 
0027   /// @brief Decode a single PDF member ID string into a setname,memid pair
0028   ///
0029   /// @note A trivial <SET,MEM> decoding rather than a "real lookup", for convenience & uniformity.
0030   std::pair<std::string, int> lookupPDF(const std::string& pdfstr);
0031 
0032   /// Look up the member's LHAPDF index from the set name and member ID.
0033   ///
0034   /// If lookup fails, -1 is returned, otherwise the LHAPDF ID code.
0035   /// NB. This function is relatively slow, since it requires std::map reverse lookup.
0036   int lookupLHAPDFID(const std::string& setname, int nmem);
0037 
0038   /// Look up the member's LHAPDF index from a setname/member string.
0039   inline int lookupLHAPDFID(const std::string& setname_nmem) {
0040     const std::pair<string,int> idpair = lookupPDF(setname_nmem);
0041     return lookupLHAPDFID(idpair.first, idpair.second);
0042   }
0043 
0044   ///@}
0045 
0046 
0047 }
0048 #endif