Fork me on GitHub

Changeset 01f9722 in git


Ignore:
Timestamp:
Aug 13, 2018, 3:01:20 PM (6 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
1d9c62a, 9047a02
Parents:
cdbca0d
Message:

read xsec from LHE files produced with Wizard

Location:
classes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesClasses.h

    rcdbca0d r01f9722  
    7575
    7676  Float_t Weight; // weight for the event | hepup.XWGTUP
     77  Float_t CrossSection; // cross-section (read from init, implemented only for Wizard evgen)
    7778  Float_t ScalePDF; // scale in GeV used in the calculation of the PDFs in the event | hepup.SCALUP
    7879  Float_t AlphaQED; // value of the QED coupling used in the event | hepup.AQEDUP
  • classes/DelphesLHEFReader.cc

    rcdbca0d r01f9722  
    3131#include <iostream>
    3232#include <sstream>
     33#include <string>
    3334
    3435#include <stdio.h>
     
    5455DelphesLHEFReader::DelphesLHEFReader() :
    5556  fInputFile(0), fBuffer(0), fPDG(0),
    56   fEventReady(kFALSE), fEventCounter(-1), fParticleCounter(-1)
     57  fEventReady(kFALSE), fEventCounter(-1), fParticleCounter(-1),   fCrossSection(1)
     58
    5759{
    5860  fBuffer = new char[kBufferSize];
     
    105107  if(!fgets(fBuffer, kBufferSize, fInputFile)) return kFALSE;
    106108
     109  // read cross section string from LHE file header (meant to work on Wizard output only)
     110  if(strstr(fBuffer, "<xsecinfo ") && fEventCounter < 0)
     111  {
     112    DelphesStream bufferStream(fBuffer);
     113
     114    string buf = fBuffer;   
     115    string xsecstr="totxsec";
     116   
     117    if (buf.find(xsecstr) != string::npos)
     118    {
     119        buf = buf.substr(buf.find(xsecstr) + xsecstr.length()+1);
     120        unsigned first = buf.find_first_of("\"")+1;
     121        unsigned last = buf.find_last_of("\"");
     122        xsecstr = buf.substr(first,last-first);
     123        fCrossSection = stod(xsecstr);
     124    } 
     125  }
     126 
    107127  if(strstr(fBuffer, "<event>"))
    108128  {
     
    110130    fEventCounter = 1;
    111131  }
     132 
    112133  else if(fEventCounter > 0)
    113134  {
     
    206227  element->ProcessID = fProcessID;
    207228  element->Weight = fWeight;
     229  element->CrossSection = fCrossSection;
     230
    208231  element->ScalePDF = fScalePDF;
    209232  element->AlphaQED = fAlphaQED;
  • classes/DelphesLHEFReader.h

    rcdbca0d r01f9722  
    7979
    8080  int fParticleCounter, fProcessID;
    81   double fWeight, fScalePDF, fAlphaQCD, fAlphaQED;
     81  double fCrossSection, fWeight, fScalePDF, fAlphaQCD, fAlphaQED;
    8282
    8383  int fPID, fStatus, fM1, fM2, fC1, fC2;
Note: See TracChangeset for help on using the changeset viewer.