Fork me on GitHub

Changeset 59abd43 in git


Ignore:
Timestamp:
May 1, 2013, 7:29:33 PM (12 years ago)
Author:
pavel <pavel@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
9f6c8c4
Parents:
52db26b
Message:

add weight for HepMCEvent

Location:
classes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesClasses.h

    r52db26b r59abd43  
    7777  Int_t MPI; // number of multi parton interactions | mpi ()
    7878
     79  Float_t Weight; // weight for the event
     80
    7981  Float_t Scale; // energy scale, see hep-ph/0109068 | event_scale()
    8082  Float_t AlphaQED; // QED coupling, see hep-ph/0109068 | alphaQED()
  • classes/DelphesHepMCReader.cc

    r52db26b r59abd43  
    2020
    2121#include <map>
     22#include <vector>
    2223
    2324#include <stdio.h>
     
    6970void DelphesHepMCReader::Clear()
    7071{
     72  fStateSize = 0;
     73  fState.clear();
     74  fWeightSize = 0;
     75  fWeight.clear();
    7176  fVertexCounter = -1;
    7277  fInCounter = -1;
     
    9499  map< int, pair< int, int > >::iterator itDaughterMap;
    95100  char key;
    96   int rc;
     101  int i, rc, state;
     102  double weight;
    97103
    98104  if(!fgets(fBuffer, kBufferSize, fInputFile)) return kFALSE;
     
    113119      && bufferStream.ReadInt(fProcessID)
    114120      && bufferStream.ReadInt(fSignalCode)
    115       && bufferStream.ReadInt(fVertexCounter);
     121      && bufferStream.ReadInt(fVertexCounter)
     122      && bufferStream.ReadInt(fBeamCode[0])
     123      && bufferStream.ReadInt(fBeamCode[1])
     124      && bufferStream.ReadInt(fStateSize);
     125
     126    if(!rc)
     127    {
     128      cerr << "** ERROR: " << "invalid event format" << endl;
     129      return kFALSE;
     130    }
     131
     132    for(i = 0; i < fStateSize; ++i)
     133    {
     134      rc = rc && bufferStream.ReadInt(state);
     135      fState.push_back(state);
     136    }
     137
     138    rc = rc && bufferStream.ReadInt(fWeightSize);
     139
     140    if(!rc)
     141    {
     142      cerr << "** ERROR: " << "invalid event format" << endl;
     143      return kFALSE;
     144    }
     145
     146    for(i = 0; i < fWeightSize; ++i)
     147    {
     148      rc = rc && bufferStream.ReadDbl(weight);
     149      fWeight.push_back(weight);
     150    }
    116151
    117152    if(!rc)
     
    236271  element->ProcessID = fProcessID;
    237272  element->MPI = fMPI;
     273  element->Weight = fWeight.size() > 0 ? fWeight[0] : 1.0;
    238274  element->Scale = fScale;
    239275  element->AlphaQED = fAlphaQED;
  • classes/DelphesHepMCReader.h

    r52db26b r59abd43  
    1616
    1717#include <map>
     18#include <vector>
    1819
    1920#include <stdio.h>
     
    6061  TDatabasePDG *fPDG;
    6162
    62   int fEventNumber, fMPI, fProcessID, fSignalCode, fVertexCounter;
     63  int fEventNumber, fMPI, fProcessID, fSignalCode, fVertexCounter, fBeamCode[2];
    6364  double fScale, fAlphaQCD, fAlphaQED;
     65
     66  int fStateSize;
     67  std::vector< int > fState;
     68
     69  int fWeightSize;
     70  std::vector< double > fWeight;
    6471
    6572  int fID1, fID2;
Note: See TracChangeset for help on using the changeset viewer.