~maddevelopers/mg5amcnlo/improved_scale_pdf_handling

« back to all changes in this revision

Viewing changes to Template/NLO/MCatNLO/include/LHEFRead.h

  • Committer: Rikkert Frederix
  • Date: 2016-02-23 11:25:37 UTC
  • Revision ID: frederix@physik.uzh.ch-20160223112537-x62cajy0v2g90yeo
some fixes in the previous push

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    // Read header of event file
22
22
    std::stringstream hss;
23
23
    std::string hs;
24
 
    cwgtinfo_nn=0;
25
 
    cwgtinfo_weights_info[0]="central value"
 
24
    sprintf(cwgtinfo_weights_info[0], "%50s","central value");
 
25
    cwgtinfo_nn=1;
26
26
    while (true){
27
27
      hss << reader.headerBlock;
28
28
      std::getline(hss,hs,'\n');
29
 
      if (hs.find("</initrwgt>") != std::string::npos) break;
 
29
      if (hs.find("</header>") != std::string::npos) break;
30
30
      // Read the wgt information
31
31
      if (hs.find("<initrwgt>") != std::string::npos) {
32
32
        while (true) {
33
33
          std::getline(hss,hs,'\n');
 
34
          if (hs.find("</initrwgt>") != std::string::npos) break;
34
35
          if (hs.find("<weightgroup") != std::string::npos) continue;
35
36
          if (hs.find("</weightgroup>") != std::string::npos) continue;
36
37
          if (hs.find("<weight id") != std::string::npos) {
 
38
            std::string sRWGT = hs.substr(hs.find("'>")+2,hs.find("</w")-3);
 
39
            sRWGT = sRWGT.substr(0,sRWGT.find("<"));
 
40
            sprintf(cwgtinfo_weights_info[cwgtinfo_nn],"%50s",sRWGT.c_str());
37
41
            ++cwgtinfo_nn;
38
 
            std::string cwgtinfo_weights_info[cwgtinfo_nn] = hs.substr(hs.find("'>")+2,hs.find("</weight>"));
39
42
          }
40
43
        }
41
44
      }
42
 
 
 
45
      
43
46
    }
44
47
  }
45
48