1 | /*
|
---|
2 | * Delphes: a framework for fast simulation of a generic collider experiment
|
---|
3 | * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
|
---|
4 | *
|
---|
5 | * This program is free software: you can redistribute it and/or modify
|
---|
6 | * it under the terms of the GNU General Public License as published by
|
---|
7 | * the Free Software Foundation, either version 3 of the License, or
|
---|
8 | * (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This program is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef DelphesSTDHEPReader_h
|
---|
20 | #define DelphesSTDHEPReader_h
|
---|
21 |
|
---|
22 | /** \class DelphesSTDHEPReader
|
---|
23 | *
|
---|
24 | * Reads STDHEP file
|
---|
25 | *
|
---|
26 | * \author P. Demin - UCL, Louvain-la-Neuve
|
---|
27 | *
|
---|
28 | */
|
---|
29 |
|
---|
30 | #include <stdio.h>
|
---|
31 | #include <rpc/types.h>
|
---|
32 | #include <rpc/xdr.h>
|
---|
33 |
|
---|
34 | class TObjArray;
|
---|
35 | class TStopwatch;
|
---|
36 | class TDatabasePDG;
|
---|
37 | class ExRootTreeBranch;
|
---|
38 | class DelphesFactory;
|
---|
39 |
|
---|
40 | class DelphesSTDHEPReader
|
---|
41 | {
|
---|
42 | public:
|
---|
43 | enum STDHEPBlock
|
---|
44 | {
|
---|
45 | GENERIC = 0,
|
---|
46 | FILEHEADER = 1,
|
---|
47 | EVENTTABLE = 2,
|
---|
48 | EVENTHEADER = 4,
|
---|
49 | MCFIO_STDHEP = 101,
|
---|
50 | MCFIO_STDHEPBEG = 106,
|
---|
51 | MCFIO_STDHEPEND = 107,
|
---|
52 | MCFIO_STDHEP4 = 201
|
---|
53 | };
|
---|
54 |
|
---|
55 | DelphesSTDHEPReader();
|
---|
56 | ~DelphesSTDHEPReader();
|
---|
57 |
|
---|
58 | void SetInputFile(FILE *inputFile);
|
---|
59 |
|
---|
60 | void Clear();
|
---|
61 | bool EventReady();
|
---|
62 |
|
---|
63 | bool ReadBlock(DelphesFactory *factory,
|
---|
64 | TObjArray *allParticleOutputArray,
|
---|
65 | TObjArray *stableParticleOutputArray,
|
---|
66 | TObjArray *partonOutputArray);
|
---|
67 |
|
---|
68 | void AnalyzeEvent(ExRootTreeBranch *branch, long long eventNumber,
|
---|
69 | TStopwatch *readStopWatch, TStopwatch *procStopWatch);
|
---|
70 |
|
---|
71 | private:
|
---|
72 |
|
---|
73 | void AnalyzeParticles(DelphesFactory *factory,
|
---|
74 | TObjArray *allParticleOutputArray,
|
---|
75 | TObjArray *stableParticleOutputArray,
|
---|
76 | TObjArray *partonOutputArray);
|
---|
77 |
|
---|
78 | void SkipBytes(u_int size);
|
---|
79 | void SkipArray(u_int elsize);
|
---|
80 |
|
---|
81 | void ReadFileHeader();
|
---|
82 | void ReadEventTable();
|
---|
83 | void ReadEventHeader();
|
---|
84 | void ReadSTDCM1();
|
---|
85 | void ReadSTDHEP();
|
---|
86 | void ReadSTDHEP4();
|
---|
87 |
|
---|
88 | FILE *fInputFile;
|
---|
89 |
|
---|
90 | XDR *fInputXDR;
|
---|
91 |
|
---|
92 | char *fBuffer;
|
---|
93 |
|
---|
94 | TDatabasePDG *fPDG;
|
---|
95 |
|
---|
96 | u_int fEntries;
|
---|
97 | int fBlockType, fEventNumber, fEventSize;
|
---|
98 | double fWeight, fAlphaQCD, fAlphaQED;
|
---|
99 |
|
---|
100 | u_int fScaleSize;
|
---|
101 | double fScale[10];
|
---|
102 | };
|
---|
103 |
|
---|
104 | #endif // DelphesSTDHEPReader_h
|
---|
105 |
|
---|
106 |
|
---|