-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLHEF.h
More file actions
881 lines (739 loc) · 22.7 KB
/
LHEF.h
File metadata and controls
881 lines (739 loc) · 22.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
// -*- C++ -*-
#ifndef THEPEG_LHEF_H
#define THEPEG_LHEF_H
//
// This is the declaration of the Les Houches Event File classes.
//
// docs here:
// http://home.thep.lu.se/~leif/LHEF/annotated.html
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <utility>
#include <stdexcept>
namespace LHEF {
/**
* The HEPRUP class is a simple container corresponding to the Les Houches
* accord (<A HREF="http://arxiv.org/abs/hep-ph/0109068">hep-ph/0109068</A>)
* common block with the same name. The members are named in the same
* way as in the common block. However, fortran arrays are represented
* by vectors, except for the arrays of length two which are
* represented by pair objects.
*/
class HEPRUP {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* Default constructor.
*/
HEPRUP()
: IDWTUP(0), NPRUP(0) {}
/**
* Copy-constructor.
*/
HEPRUP(const HEPRUP & x)
: IDBMUP(x.IDBMUP), EBMUP(x.EBMUP),
PDFGUP(x.PDFGUP), PDFSUP(x.PDFSUP), IDWTUP(x.IDWTUP),
NPRUP(x.NPRUP), XSECUP(x.XSECUP), XERRUP(x.XERRUP),
XMAXUP(x.XMAXUP), LPRUP(x.LPRUP) {}
/**
* Assignment operator.
*/
HEPRUP & operator=(const HEPRUP & x) {
IDBMUP = x.IDBMUP;
EBMUP = x.EBMUP;
PDFGUP = x.PDFGUP;
PDFSUP = x.PDFSUP;
IDWTUP = x.IDWTUP;
NPRUP = x.NPRUP;
XSECUP = x.XSECUP;
XERRUP = x.XERRUP;
XMAXUP = x.XMAXUP;
LPRUP = x.LPRUP;
return *this;
}
/**
* Destructor.
*/
~HEPRUP() {}
//@}
public:
/**
* Set the NPRUP variable, corresponding to the number of
* sub-processes, to \a nrup, and resize all relevant vectors
* accordingly.
*/
void resize(int nrup) {
NPRUP = nrup;
resize();
}
/**
* Assuming the NPRUP variable, corresponding to the number of
* sub-processes, is correctly set, resize the relevant vectors
* accordingly.
*/
void resize() {
XSECUP.resize(NPRUP);
XERRUP.resize(NPRUP);
XMAXUP.resize(NPRUP);
LPRUP.resize(NPRUP);
}
public:
/**
* PDG id's of beam particles. (first/second is in +/-z direction).
*/
std::pair<long,long> IDBMUP;
/**
* Energy of beam particles given in GeV.
*/
std::pair<double,double> EBMUP;
/**
* The author group for the PDF used for the beams according to the
* PDFLib specification.
*/
std::pair<int,int> PDFGUP;
/**
* The id number the PDF used for the beams according to the
* PDFLib specification.
*/
std::pair<int,int> PDFSUP;
/**
* Master switch indicating how the ME generator envisages the
* events weights should be interpreted according to the Les Houches
* accord.
*/
int IDWTUP;
/**
* The number of different subprocesses in this file.
*/
int NPRUP;
/**
* The cross sections for the different subprocesses in pb.
*/
std::vector<double> XSECUP;
/**
* The statistical error in the cross sections for the different
* subprocesses in pb.
*/
std::vector<double> XERRUP;
/**
* The maximum event weights (in HEPEUP::XWGTUP) for different
* subprocesses.
*/
std::vector<double> XMAXUP;
/**
* The subprocess code for the different subprocesses.
*/
std::vector<int> LPRUP;
};
/**
* The HEPEUP class is a simple container corresponding to the Les Houches accord
* (<A HREF="http://arxiv.org/abs/hep-ph/0109068">hep-ph/0109068</A>)
* common block with the same name. The members are named in the same
* way as in the common block. However, fortran arrays are represented
* by vectors, except for the arrays of length two which are
* represented by pair objects.
*/
class HEPEUP {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* Default constructor.
*/
HEPEUP()
: NUP(0), IDPRUP(0), XWGTUP(0.0), XPDWUP(0.0, 0.0),
SCALUP(0.0), AQEDUP(0.0), AQCDUP(0.0) {}
/**
* Copy-constructor.
*/
HEPEUP(const HEPEUP & x)
: NUP(x.NUP), IDPRUP(x.IDPRUP), XWGTUP(x.XWGTUP), XPDWUP(x.XPDWUP),
SCALUP(x.SCALUP), AQEDUP(x.AQEDUP), AQCDUP(x.AQCDUP), IDUP(x.IDUP),
ISTUP(x.ISTUP), MOTHUP(x.MOTHUP), ICOLUP(x.ICOLUP),
PUP(x.PUP), VTIMUP(x.VTIMUP), SPINUP(x.SPINUP) {}
/**
* Assignment operator.
*/
HEPEUP & operator=(const HEPEUP & x) {
NUP = x.NUP;
IDPRUP = x.IDPRUP;
XWGTUP = x.XWGTUP;
XPDWUP = x.XPDWUP;
SCALUP = x.SCALUP;
AQEDUP = x.AQEDUP;
AQCDUP = x.AQCDUP;
IDUP = x.IDUP;
ISTUP = x.ISTUP;
MOTHUP = x.MOTHUP;
ICOLUP = x.ICOLUP;
PUP = x.PUP;
VTIMUP = x.VTIMUP;
SPINUP = x.SPINUP;
return *this;
}
/**
* Destructor.
*/
~HEPEUP() {};
//@}
public:
/**
* Set the NUP variable, corresponding to the number of particles in
* the current event, to \a nup, and resize all relevant vectors
* accordingly.
*/
void resize(int nup) {
NUP = nup;
resize();
}
/**
* Assuming the NUP variable, corresponding to the number of
* particles in the current event, is correctly set, resize the
* relevant vectors accordingly.
*/
void resize() {
IDUP.resize(NUP);
ISTUP.resize(NUP);
MOTHUP.resize(NUP);
ICOLUP.resize(NUP);
PUP.resize(NUP, std::vector<double>(5));
VTIMUP.resize(NUP);
SPINUP.resize(NUP);
}
public:
/**
* The number of particle entries in the current event.
*/
int NUP;
/**
* The subprocess code for this event (as given in LPRUP).
*/
int IDPRUP;
/**
* The weight for this event.
*/
double XWGTUP;
/**
* The PDF weights for the two incoming partons. Note that this
* variable is not present in the current LesHouches accord
* (<A HREF="http://arxiv.org/abs/hep-ph/0109068">hep-ph/0109068</A>),
* hopefully it will be present in a future accord.
*/
std::pair<double,double> XPDWUP;
/**
* The scale in GeV used in the calculation of the PDF's in this
* event.
*/
double SCALUP;
/**
* The value of the QED coupling used in this event.
*/
double AQEDUP;
/**
* The value of the QCD coupling used in this event.
*/
double AQCDUP;
/**
* The PDG id's for the particle entries in this event.
*/
std::vector<long> IDUP;
/**
* The status codes for the particle entries in this event.
*/
std::vector<int> ISTUP;
/**
* Indices for the first and last mother for the particle entries in
* this event.
*/
std::vector< std::pair<int,int> > MOTHUP;
/**
* The colour-line indices (first(second) is (anti)colour) for the
* particle entries in this event.
*/
std::vector< std::pair<int,int> > ICOLUP;
/**
* Lab frame momentum (Px, Py, Pz, E and M in GeV) for the particle
* entries in this event.
*/
std::vector< std::vector<double> > PUP;
/**
* Invariant lifetime (c*tau, distance from production to decay in
* mm) for the particle entries in this event.
*/
std::vector<double> VTIMUP;
/**
* Spin info for the particle entries in this event given as the
* cosine of the angle between the spin vector of a particle and the
* 3-momentum of the decaying particle, specified in the lab frame.
*/
std::vector<double> SPINUP;
};
/**
* The Reader class is initialized with a stream from which to read a
* version 1.0 Les Houches Accord event file. In the constructor of
* the Reader object the optional header information is read and then
* the mandatory init is read. After this the whole header block
* including the enclosing lines with tags are available in the public
* headerBlock member variable. Also the information from the init
* block is available in the heprup member variable and any additional
* comment lines are available in initComments. After each successful
* call to the readEvent() function the standard Les Houches Accord
* information about the event is available in the hepeup member
* variable and any additional comments in the eventComments
* variable. A typical reading sequence would look as follows:
*
*
*/
class Reader {
public:
/**
* Initialize the Reader with a stream from which to read an event
* file. After the constructor is called the whole header block
* including the enclosing lines with tags are available in the
* public headerBlock member variable. Also the information from the
* init block is available in the heprup member variable and any
* additional comment lines are available in initComments.
*
* @param is the stream to read from.
*/
Reader(std::istream & is)
: file(is) {
init();
}
/**
* Initialize the Reader with a filename from which to read an event
* file. After the constructor is called the whole header block
* including the enclosing lines with tags are available in the
* public headerBlock member variable. Also the information from the
* init block is available in the heprup member variable and any
* additional comment lines are available in initComments.
*
* @param filename the name of the file to read from.
*/
Reader(std::string filename)
: intstream(filename.c_str()), file(intstream) {
init();
}
private:
/**
* Used internally in the constructors to read header and init
* blocks.
*/
void init() {
bool readingHeader = false;
bool readingInit = false;
// Make sure we are reading a LHEF file:
// getline(); ---> for MC@NLO
getline();
if ( currentLine.find("<LesHouchesEvents" ) == std::string::npos )
throw std::runtime_error
("Tried to read a file which does not start with the "
"LesHouchesEvents tag.");
if ( currentLine.find("version=\"1.0\"" ) == std::string::npos )
throw std::runtime_error
("Tried to read a LesHouchesEvents file which is not version 1.0.");
// Loop over all lines until we hit the </init> tag.
while ( getline() && currentLine.find("</init>") == std::string::npos ) {
if ( currentLine.find("<header") != std::string::npos ) {
// We have hit the header block, so we should dump this all
// following lines to headerBlock until we hit the end of it.
readingHeader = true;
headerBlock = currentLine + "\n";
}
else if ( currentLine.find("<init") != std::string::npos ) {
// We have hit the init block, so we should expect to find the
// standard information in the following.
readingInit = true;
// The first line tells us how many lines to read next.
getline();
std::istringstream iss(currentLine);
if ( !( iss >> heprup.IDBMUP.first >> heprup.IDBMUP.second
>> heprup.EBMUP.first >> heprup.EBMUP.second
>> heprup.PDFGUP.first >> heprup.PDFGUP.second
>> heprup.PDFSUP.first >> heprup.PDFSUP.second
>> heprup.IDWTUP >> heprup.NPRUP ) ) {
heprup.NPRUP = -42;
return;
}
heprup.resize();
for ( int i = 0; i < heprup.NPRUP; ++i ) {
getline();
std::istringstream iss(currentLine);
if ( !( iss >> heprup.XSECUP[i] >> heprup.XERRUP[i]
>> heprup.XMAXUP[i] >> heprup.LPRUP[i] ) ) {
heprup.NPRUP = -42;
return;
}
}
}
else if ( currentLine.find("</header>") != std::string::npos ) {
// The end of the header block. Dump this line as well to the
// headerBlock and we're done.
readingHeader = false;
headerBlock += currentLine + "\n";
}
else if ( readingHeader ) {
// We are in the process of reading the header block. Dump the
// line to haderBlock.
headerBlock += currentLine + "\n";
}
else if ( readingInit ) {
// Here we found a comment line. Dump it to initComments.
initComments += currentLine + "\n";
}
else {
// We found some other stuff outside the standard tags.
outsideBlock += currentLine + "\n";
}
}
if ( !file ) heprup.NPRUP = -42;
}
public:
/**
* Read an event from the file and store it in the hepeup
* object. Optional comment lines are stored i the eventComments
* member variable.
* @return true if the read sas successful.
*/
bool readEvent() {
// Check if the initialization was successful. Otherwise we will
// not read any events.
if ( heprup.NPRUP < 0 ) return false;
eventComments = "";
outsideBlock = "";
hepeup.NUP = 0;
// Keep reading lines until we hit the next event or the end of
// the event block. Save any inbetween lines. Exit if we didn't
// find an event.
while ( getline() && currentLine.find("<event") == std::string::npos )
outsideBlock += currentLine + "\n";
if ( !getline() ) return false;
// We found an event. The first line determines how many
// subsequent particle lines we have.
std::istringstream iss(currentLine);
if ( !( iss >> hepeup.NUP >> hepeup.IDPRUP >> hepeup.XWGTUP
>> hepeup.SCALUP >> hepeup.AQEDUP >> hepeup.AQCDUP ) )
return false;
hepeup.resize();
// Read all particle lines.
for ( int i = 0; i < hepeup.NUP; ++i ) {
if ( !getline() ) return false;
std::istringstream iss(currentLine);
if ( !( iss >> hepeup.IDUP[i] >> hepeup.ISTUP[i]
>> hepeup.MOTHUP[i].first >> hepeup.MOTHUP[i].second
>> hepeup.ICOLUP[i].first >> hepeup.ICOLUP[i].second
>> hepeup.PUP[i][0] >> hepeup.PUP[i][1] >> hepeup.PUP[i][2]
>> hepeup.PUP[i][3] >> hepeup.PUP[i][4]
>> hepeup.VTIMUP[i] >> hepeup.SPINUP[i] ) )
return false;
}
// Now read any additional comments.
while ( getline() && currentLine.find("</event>") == std::string::npos )
eventComments += currentLine + "\n";
if ( !file ) return false;
return true;
}
protected:
/**
* Used internally to read a single line from the stream.
*/
bool getline() {
return ( std::getline(file, currentLine) );
}
protected:
/**
* A local stream which is unused if a stream is supplied from the
* outside.
*/
std::ifstream intstream;
/**
* The stream we are reading from. This may be a reference to an
* external stream or the internal intstream.
*/
std::istream & file;
/**
* The last line read in from the stream in getline().
*/
std::string currentLine;
public:
/**
* All lines (since the last readEvent()) outside the header, init
* and event tags.
*/
std::string outsideBlock;
/**
* All lines from the header block.
*/
std::string headerBlock;
/**
* The standard init information.
*/
HEPRUP heprup;
/**
* Additional comments found in the init block.
*/
std::string initComments;
/**
* The standard information about the last read event.
*/
HEPEUP hepeup;
/**
* Additional comments found with the last read event.
*/
std::string eventComments;
private:
/**
* The default constructor should never be used.
*/
Reader();
/**
* The copy constructor should never be used.
*/
Reader(const Reader &);
/**
* The Reader cannot be assigned to.
*/
Reader & operator=(const Reader &);
};
/**
* The Writer class is initialized with a stream to which to write a
* version 1.0 Les Houches Accord event file. In the constructor of
* the Writer object the main XML tag is written out, with the
* corresponding end tag is written in the destructor. After a Writer
* object has been created, it is possible to assign standard init
* information in the heprup member variable. In addition any XML
* formatted information can be added to the headerBlock member
* variable (directly or via the addHeader() function). Further
* comment line (beginning with a <code>#</code> character) can be
* added to the initComments variable (directly or with the
* addInitComment() function). After this information is set, it
* should be written out to the file with the init() function.
*
* Before each event is written out with the writeEvent() function,
* the standard event information can then be assigned to the hepeup
* variable and optional comment lines (beginning with a
* <code>#</code> character) may be given to the eventComments
* variable (directly or with the addEventComment() function).
*
*/
class Writer {
public:
/**
* Create a Writer object giving a stream to write to.
* @param os the stream where the event file is written.
*/
Writer(std::ostream & os)
: file(os) {
// Write out the standard XML tag for the event file.
file << "<LesHouchesEvents version=\"1.0\">\n";
}
/**
* Create a Writer object giving a filename to write to.
* @param filename the name of the event file to be written.
*/
Writer(std::string filename)
: intstream(filename.c_str()), file(intstream) {
// Write out the standard XML tag for the event file.
file << "LesHouchesEvents version=\"1.0\">\n";
}
/**
* The destructor writes out the final XML end-tag.
*/
~Writer() {
file << "</LesHouchesEvents>" << std::endl;
}
/**
* Add header lines consisting of XML code with this stream.
*/
std::ostream & headerBlock() {
return headerStream;
}
/**
* Add comment lines to the init block with this stream.
*/
std::ostream & initComments() {
return initStream;
}
/**
* Add comment lines to the next event to be written out with this stream.
*/
std::ostream & eventComments() {
return eventStream;
}
/**
* Write out an optional header block followed by the standard init
* block information together with any comment lines.
*/
void init() {
file << std::setprecision(8);
using std::setw;
std::string headerBlock = headerStream.str();
if ( headerBlock.length() ) {
if ( headerBlock.find("<header>") == std::string::npos )
file << "<header>\n";
if ( headerBlock[headerBlock.length() - 1] != '\n' )
headerBlock += '\n';
file << headerBlock;
if ( headerBlock.find("</header>") == std::string::npos )
file << "</header>\n";
}
file << "<init>\n"
<< " " << setw(8) << heprup.IDBMUP.first
<< " " << setw(8) << heprup.IDBMUP.second
<< " " << setw(14) << heprup.EBMUP.first
<< " " << setw(14) << heprup.EBMUP.second
<< " " << setw(4) << heprup.PDFGUP.first
<< " " << setw(4) << heprup.PDFGUP.second
<< " " << setw(4) << heprup.PDFSUP.first
<< " " << setw(4) << heprup.PDFSUP.second
<< " " << setw(4) << heprup.IDWTUP
<< " " << setw(4) << heprup.NPRUP << std::endl;
heprup.resize();
for ( int i = 0; i < heprup.NPRUP; ++i )
file << " " << setw(14) << heprup.XSECUP[i]
<< " " << setw(14) << heprup.XERRUP[i]
<< " " << setw(14) << heprup.XMAXUP[i]
<< " " << setw(6) << heprup.LPRUP[i] << std::endl;
file << hashline(initStream.str()) << "</init>" << std::endl;
eventStream.str("");
}
/**
* Write out the event stored in hepeup, followed by optional
* comment lines.
*/
bool writeEvent() {
using std::setw;
file << "<event>\n";
file << " " << setw(4) << hepeup.NUP
<< " " << setw(6) << hepeup.IDPRUP
<< " " << setw(14) << hepeup.XWGTUP
<< " " << setw(14) << hepeup.SCALUP
<< " " << setw(14) << hepeup.AQEDUP
<< " " << setw(14) << hepeup.AQCDUP << "\n";
hepeup.resize();
for ( int i = 0; i < hepeup.NUP; ++i )
file << " " << setw(8) << hepeup.IDUP[i]
<< " " << setw(2) << hepeup.ISTUP[i]
<< " " << setw(4) << hepeup.MOTHUP[i].first
<< " " << setw(4) << hepeup.MOTHUP[i].second
<< " " << setw(4) << hepeup.ICOLUP[i].first
<< " " << setw(4) << hepeup.ICOLUP[i].second
<< " " << setw(14) << hepeup.PUP[i][0]
<< " " << setw(14) << hepeup.PUP[i][1]
<< " " << setw(14) << hepeup.PUP[i][2]
<< " " << setw(14) << hepeup.PUP[i][3]
<< " " << setw(14) << hepeup.PUP[i][4]
<< " " << setw(1) << hepeup.VTIMUP[i]
<< " " << setw(1) << hepeup.SPINUP[i] << std::endl;
file << hashline(eventStream.str()) << "</event>\n";
eventStream.str("");
if ( !file ) return false;
return true;
}
protected:
/**
* Make sure that each line in the string \a s starts with a
* #-character and that the string ends with a new-line.
*/
std::string hashline(std::string s) {
std::string ret;
std::istringstream is(s);
std::string ss;
while ( getline(is, ss) ) {
if ( ss.find('#') == std::string::npos ||
ss.find('#') != ss.find_first_not_of(" \t") ) ss = "# " + ss;
ret += ss + '\n';
}
return ret;
}
protected:
/**
* A local stream which is unused if a stream is supplied from the
* outside.
*/
std::ofstream intstream;
/**
* The stream we are writing to. This may be a reference to an
* external stream or the internal intstream.
*/
std::ostream & file;
public:
/**
* Stream to add all lines in the header block.
*/
std::ostringstream headerStream;
/**
* The standard init information.
*/
HEPRUP heprup;
/**
* Stream to add additional comments to be put in the init block.
*/
std::ostringstream initStream;
/**
* The standard information about the event we will write next.
*/
HEPEUP hepeup;
/**
* Stream to add additional comments to be written together the next event.
*/
std::ostringstream eventStream;
private:
/**
* The default constructor should never be used.
*/
Writer();
/**
* The copy constructor should never be used.
*/
Writer(const Writer &);
/**
* The Writer cannot be assigned to.
*/
Writer & operator=(const Writer &);
};
}
/** \example LHEFReadEx.cc An example function which reads from a Les
Huches Event File: */
/** \example LHEFWriteEx.cc An example function which writes out a Les
Huches Event File: */
/** \example LHEFCat.cc This is a main function which simply reads a
Les Houches Event File from the standard input and writes it again
to the standard output.
This file can be downloaded from
<A HREF="http://www.thep.lu.se/~leif/LHEF/LHEFCat.cc">here</A>.
There is also a sample
<A HREF="http://www.thep.lu.se/~leif/LHEF/ttbar.lhef">event file</A>
to try it on.
*/
/**\mainpage Les Houches Event File
Why isn't any doxygen output generated by this text?
Here are some example classes for reading and writing Les Houches
Event Files according to the
<A HREF="http://www.thep.lu.se/~torbjorn/lhef/lhafile2.pdf">proposal</A>
by Torbjörn Sjöstrand discussed at the
<A HREF="http://mc4lhc06.web.cern.ch/mc4lhc06/">MC4LHC</A>
workshop at CERN 2006.
In total there are four classes which are all available in a single
header file called
<A HREF="http://www.thep.lu.se/~leif/LHEF/LHEF.h">LHEF.h</A>.
The two classes LHEF::HEPRUP and LHEF::HEPEUP are simple container
classes which contain the same information as the Les Houches standard
Fortran common blocks with the same names. The other two classes are
called LHEF::Reader and LHEF::Writer and are used to read and write
Les Houches Event Files
Here are a few <A HREF="examples.html">examples</A> of how to use the
classes:
\namespace LHEF The LHEF namespace contains some example classes for reading and writing Les Houches
Event Files according to the
<A HREF="http://www.thep.lu.se/~torbjorn/lhef/lhafile2.pdf">proposal</A>
by Torbjörn Sjöstrand discussed at the
<A HREF="http://mc4lhc06.web.cern.ch/mc4lhc06/">MC4LHC</A>
workshop at CERN 2006.
*/
#endif /* THEPEG_LHEF_H */