Fork me on GitHub

source: git/classes/DelphesSTDHEPReader.h@ fbee3f4

ImprovedOutputFile Timing dual_readout llp
Last change on this file since fbee3f4 was 1716933, checked in by Pavel Demin <pavel-demin@…>, 7 years ago

add DelphesXDRReader and DelphesXDRWriter

  • Property mode set to 100644
File size: 2.5 KB
Line 
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 <stdint.h>
32
33#include "classes/DelphesXDRReader.h"
34
35class TObjArray;
36class TStopwatch;
37class TDatabasePDG;
38class ExRootTreeBranch;
39class DelphesFactory;
40class DelphesXDRReader;
41
42class DelphesSTDHEPReader
43{
44public:
45 enum STDHEPBlock
46 {
47 GENERIC = 0,
48 FILEHEADER = 1,
49 EVENTTABLE = 2,
50 EVENTHEADER = 4,
51 MCFIO_STDHEP = 101,
52 MCFIO_STDHEPBEG = 106,
53 MCFIO_STDHEPEND = 107,
54 MCFIO_STDHEP4 = 201
55 };
56
57 DelphesSTDHEPReader();
58 ~DelphesSTDHEPReader();
59
60 void SetInputFile(FILE *inputFile);
61
62 void Clear();
63 bool EventReady();
64
65 bool ReadBlock(DelphesFactory *factory,
66 TObjArray *allParticleOutputArray,
67 TObjArray *stableParticleOutputArray,
68 TObjArray *partonOutputArray);
69
70 void AnalyzeEvent(ExRootTreeBranch *branch, long long eventNumber,
71 TStopwatch *readStopWatch, TStopwatch *procStopWatch);
72
73private:
74
75 void AnalyzeParticles(DelphesFactory *factory,
76 TObjArray *allParticleOutputArray,
77 TObjArray *stableParticleOutputArray,
78 TObjArray *partonOutputArray);
79
80 void SkipBytes(int size);
81 void SkipArray(int elsize);
82
83 void ReadFileHeader();
84 void ReadEventTable();
85 void ReadEventHeader();
86 void ReadSTDCM1();
87 void ReadSTDHEP();
88 void ReadSTDHEP4();
89
90 FILE *fInputFile;
91
92 DelphesXDRReader fReader[7];
93
94 uint8_t *fBuffer;
95
96 TDatabasePDG *fPDG;
97
98 uint32_t fEntries;
99 int32_t fBlockType, fEventNumber, fEventSize;
100 double fWeight, fAlphaQCD, fAlphaQED;
101
102 uint32_t fScaleSize;
103 double fScale[10];
104};
105
106#endif // DelphesSTDHEPReader_h
Note: See TracBrowser for help on using the repository browser.