Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:34

0001 #ifndef RecoLuminosity_LumiProducer_NormDML_H
0002 #define RecoLuminosity_LumiProducer_NormDML_H
0003 // -*- C++ -*-
0004 //
0005 // Package:    LumiProducer
0006 // Class:      NormDML
0007 //
0008 /**\class NormDML NormDML.cc RecoLuminosity/LumiProducer/src/NormDML.cc
0009 
0010 Description: 
0011 
0012 Implementation:
0013 
0014 */
0015 //
0016 // Original Author: Zhen Xie
0017 //
0018 #include <string>
0019 #include <vector>
0020 #include <map>
0021 namespace coral {
0022   class ISchema;
0023 }
0024 namespace lumi {
0025   class NormDML {
0026   public:
0027     struct normData {
0028       std::string normtag;
0029       std::string corrfunc;
0030       std::map<unsigned int, float> afterglows;
0031       std::map<std::string, float> coefficientmap;
0032       std::string amodetag;
0033       unsigned int beamegev;
0034     };
0035     enum LumiType { HF, PIXEL };
0036     NormDML();
0037     ~NormDML() {}
0038     /*
0039       find the most recent id for the given norm tag 
0040     */
0041     unsigned long long normIdByName(const coral::ISchema& schema, const std::string& normtagname);
0042     /*
0043       find the most recent normid for the given norm type 
0044     */
0045     void normIdByType(const coral::ISchema& schema,
0046                       std::map<std::string, unsigned long long>& resultMap,
0047                       LumiType = HF,
0048                       bool defaultonly = true);
0049     /*
0050       retrieve norm data by normid
0051     */
0052     void normById(const coral::ISchema& schema, unsigned long long normid, std::map<unsigned int, normData>& result);
0053 
0054     /*
0055       parse corrector functions
0056     */
0057     void parseLumiCorrector(const std::string& correctorStr, std::vector<std::string>& correctorParams);
0058     void parseAfterglows(const std::string& afterglowStr, std::map<unsigned int, float>& afterglowmap);
0059   };
0060 }  // namespace lumi
0061 #endif