Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesLHEFReader.cc

    r1e8afcc rcab38f6  
    8282  fEventCounter = -1;
    8383  fParticleCounter = -1;
    84   fWeightList.clear();
     84  fRwgtList.clear();
    8585}
    8686
     
    9999  TObjArray *partonOutputArray)
    100100{
    101   int rc, id;
     101  int rc;
    102102  char *pch;
    103103  double weight;
     
    158158  else if(strstr(fBuffer, "<wgt"))
    159159  {
    160     pch = strpbrk(fBuffer, "\"'");
     160    pch = strstr(fBuffer, ">");
    161161    if(!pch)
    162162    {
     
    165165    }
    166166
    167     DelphesStream idStream(pch + 1);
    168     rc = idStream.ReadInt(id);
    169 
    170     pch = strchr(fBuffer, '>');
    171     if(!pch)
     167    DelphesStream bufferStream(pch + 1);
     168    rc = bufferStream.ReadDbl(weight);
     169
     170    if(!rc)
    172171    {
    173172      cerr << "** ERROR: " << "invalid weight format" << endl;
     
    175174    }
    176175
    177     DelphesStream weightStream(pch + 1);
    178     rc = weightStream.ReadDbl(weight);
    179 
    180     if(!rc)
    181     {
    182       cerr << "** ERROR: " << "invalid weight format" << endl;
    183       return kFALSE;
    184     }
    185 
    186     fWeightList.push_back(make_pair(id, weight));
     176    fRwgtList.push_back(weight);
    187177  }
    188178  else if(strstr(fBuffer, "</event>"))
     
    216206//---------------------------------------------------------------------------
    217207
    218 void DelphesLHEFReader::AnalyzeWeight(ExRootTreeBranch *branch)
    219 {
    220   LHEFWeight *element;
    221   vector< pair< int, double > >::const_iterator itWeightList;
    222 
    223   for(itWeightList = fWeightList.begin(); itWeightList != fWeightList.end(); ++itWeightList)
    224   {
    225     element = static_cast<LHEFWeight *>(branch->NewEntry());
    226 
    227     element->ID = itWeightList->first;
    228     element->Weight = itWeightList->second;
     208void DelphesLHEFReader::AnalyzeRwgt(ExRootTreeBranch *branch)
     209{
     210  Weight *element;
     211  vector<double>::const_iterator itRwgtList;
     212
     213  for(itRwgtList = fRwgtList.begin(); itRwgtList != fRwgtList.end(); ++itRwgtList)
     214  {
     215    element = static_cast<Weight *>(branch->NewEntry());
     216
     217    element->Weight = *itRwgtList;
    229218  }
    230219}
Note: See TracChangeset for help on using the changeset viewer.