CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
AlpgenHeader Struct Reference

#include <AlpgenHeader.h>

Public Types

enum  Masses {
  mc = 0, mb, mt, mw,
  mz, mh, MASS_MAX
}
 
enum  Parameter {
  ih2 = 2, ebeam = 3, ndns = 4, iqopt = 5,
  qfac = 6, ickkw = 7, ktfac = 8, njets = 10,
  ihvy = 11, ihvy2 = 12, nw = 13, nz = 14,
  nh = 15, nph = 16, ptjmin = 30, ptbmin = 31,
  ptcmin = 32, ptlmin = 33, metmin = 34, ptphmin = 35,
  etajmax = 40, etabmax = 41, etacmax = 42, etalmax = 43,
  etaphmax = 44, drjmin = 50, drbmin = 51, drcmin = 52,
  drlmin = 55, drphjmin = 56, drphlmin = 57, drphmin = 58,
  mllmin = 61, mllmax = 62, iseed1 = 90, iseed2 = 91,
  itopprc = 102, cluopt = 160, iseed3 = 190, iseed4 = 191
}
 

Public Member Functions

bool parse (const std::vector< std::string >::const_iterator &begin, const std::vector< std::string >::const_iterator &end)
 

Static Public Member Functions

static std::string parameterName (Parameter index)
 

Public Attributes

unsigned int ihrd
 
double lumi
 
double masses [MASS_MAX]
 
double nEvents
 
std::map< Parameter, double > params
 
double xsec
 
double xsecErr
 

Detailed Description

A structure that can parse and represent the contents of an ALPGEN _unw.par run information file.

Definition at line 10 of file AlpgenHeader.h.

Member Enumeration Documentation

◆ Masses

Enumerator
mc 
mb 
mt 
mw 
mz 
mh 
MASS_MAX 

Definition at line 58 of file AlpgenHeader.h.

58 { mc = 0, mb, mt, mw, mz, mh, MASS_MAX };

◆ Parameter

Enumerator
ih2 
ebeam 
ndns 
iqopt 
qfac 
ickkw 
ktfac 
njets 
ihvy 
ihvy2 
nw 
nz 
nh 
nph 
ptjmin 
ptbmin 
ptcmin 
ptlmin 
metmin 
ptphmin 
etajmax 
etabmax 
etacmax 
etalmax 
etaphmax 
drjmin 
drbmin 
drcmin 
drlmin 
drphjmin 
drphlmin 
drphmin 
mllmin 
mllmax 
iseed1 
iseed2 
itopprc 
cluopt 
iseed3 
iseed4 

Definition at line 11 of file AlpgenHeader.h.

11  {
12  ih2 = 2,
13  ebeam = 3,
14  ndns = 4,
15  iqopt = 5,
16  qfac = 6,
17  ickkw = 7,
18  ktfac = 8,
19  njets = 10,
20  ihvy = 11,
21  ihvy2 = 12,
22  nw = 13,
23  nz = 14,
24  nh = 15,
25  nph = 16,
26  ptjmin = 30,
27  ptbmin = 31,
28  ptcmin = 32,
29  ptlmin = 33,
30  metmin = 34,
31  ptphmin = 35,
32  etajmax = 40,
33  etabmax = 41,
34  etacmax = 42,
35  etalmax = 43,
36  etaphmax = 44,
37  drjmin = 50,
38  drbmin = 51,
39  drcmin = 52,
40  drlmin = 55,
41  drphjmin = 56,
42  drphlmin = 57,
43  drphmin = 58,
44  mllmin = 61,
45  mllmax = 62,
46  iseed1 = 90,
47  iseed2 = 91,
48  itopprc = 102,
49  cluopt = 160,
50  iseed3 = 190,
51  iseed4 = 191
52  };

Member Function Documentation

◆ parameterName()

std::string AlpgenHeader::parameterName ( Parameter  index)
static

Function to return the human-readable names of ALPGEN parameters.

Definition at line 143 of file AlpgenHeader.cc.

143  {
144  static const unsigned int size = sizeof alpgenParameterNames / sizeof alpgenParameterNames[0];
145 
146  const AlpgenParameterName *pos = std::find(alpgenParameterNames, alpgenParameterNames + size, index);
147 
148  if (pos != alpgenParameterNames + size)
149  return pos->name;
150 
151  std::ostringstream ss;
152  ss << "unknown " << (int)index;
153  return ss.str();
154 }

References spr::find(), createfilelist::int, findQualityFiles::size, and contentValuesCheck::ss.

Referenced by AlpgenSource::getParameter().

◆ parse()

bool AlpgenHeader::parse ( const std::vector< std::string >::const_iterator &  begin,
const std::vector< std::string >::const_iterator &  end 
)

A function to parse a std::<vector<std::string> containing a _unw.par ALPGEN file, and store it in the internal structure.

Definition at line 62 of file AlpgenHeader.cc.

63  {
64  std::vector<std::string>::const_iterator line = begin;
65 
66  // Mimicking Alpgen - read the _unw.par file until you find the "****".
67  while (line != end)
68  if ((line++)->find("****") != std::string::npos)
69  break;
70 
71  AlpgenParTokens tokens;
72 
73  // hard process code
74  if (line == end || !tokens.parse(*line++, true) || !tokens.values.empty())
75  return false;
76  ihrd = tokens.index;
77 
78  // mc,mb,mt,mw,mz,mh
79  if (line == end || !tokens.parse(*line++, false) || tokens.values.size() < 6)
80  return false;
81 
82  std::copy(tokens.values.begin(), tokens.values.begin() + 6, masses);
83 
84  // key - value pairs
85  params.clear();
86  while (line != end && line->find("****") == std::string::npos) {
87  if (!tokens.parse(*line++, true) || tokens.values.size() != 1)
88  return false;
89  params[(Parameter)tokens.index] = tokens.values[0];
90  }
91  if (line == end)
92  return false;
93  else
94  line++;
95 
96  // cross-section
97  if (line == end || !tokens.parse(*line++, false) || tokens.values.size() != 2)
98  return false;
99 
100  xsec = tokens.values[0];
101  xsecErr = tokens.values[1];
102 
103  // unweighted events, luminosity
104  if (line == end || !tokens.parse(*line++, true) || tokens.values.size() != 1)
105  return false;
106 
107  nEvents = tokens.index;
108  lumi = tokens.values[0];
109 
110  return true;
111 }

References filterCSVwithJSON::copy, mps_fire::end, spr::find(), ihrd, mps_splice::line, masses, nEvents, params, xsec, and xsecErr.

Referenced by AlpgenSource::AlpgenSource(), and gen::JetMatchingAlpgen::init().

Member Data Documentation

◆ ihrd

unsigned int AlpgenHeader::ihrd

◆ lumi

double AlpgenHeader::lumi

Definition at line 70 of file AlpgenHeader.h.

◆ masses

double AlpgenHeader::masses[MASS_MAX]

◆ nEvents

double AlpgenHeader::nEvents

Definition at line 69 of file AlpgenHeader.h.

Referenced by looper.Looper::loop(), and parse().

◆ params

std::map<Parameter, double> AlpgenHeader::params

◆ xsec

double AlpgenHeader::xsec

Definition at line 67 of file AlpgenHeader.h.

Referenced by AlpgenSource::beginRun(), and parse().

◆ xsecErr

double AlpgenHeader::xsecErr

Definition at line 68 of file AlpgenHeader.h.

Referenced by AlpgenSource::beginRun(), and parse().

AlpgenHeader::etacmax
Definition: AlpgenHeader.h:34
AlpgenHeader::drbmin
Definition: AlpgenHeader.h:38
AlpgenHeader::xsec
double xsec
Definition: AlpgenHeader.h:67
AlpgenHeader::etabmax
Definition: AlpgenHeader.h:33
AlpgenHeader::ptcmin
Definition: AlpgenHeader.h:28
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
AlpgenHeader::drphjmin
Definition: AlpgenHeader.h:41
AlpgenHeader::nph
Definition: AlpgenHeader.h:25
AlpgenHeader::nh
Definition: AlpgenHeader.h:24
pos
Definition: PixelAliasList.h:18
AlpgenHeader::etalmax
Definition: AlpgenHeader.h:35
AlpgenHeader::xsecErr
double xsecErr
Definition: AlpgenHeader.h:68
AlpgenHeader::ptphmin
Definition: AlpgenHeader.h:31
AlpgenHeader::mc
Definition: AlpgenHeader.h:58
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
AlpgenHeader::drphlmin
Definition: AlpgenHeader.h:42
AlpgenHeader::ebeam
Definition: AlpgenHeader.h:13
AlpgenHeader::params
std::map< Parameter, double > params
Definition: AlpgenHeader.h:65
AlpgenHeader::iseed1
Definition: AlpgenHeader.h:46
AlpgenHeader::ihrd
unsigned int ihrd
Definition: AlpgenHeader.h:66
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
AlpgenHeader::nz
Definition: AlpgenHeader.h:23
AlpgenHeader::metmin
Definition: AlpgenHeader.h:30
AlpgenHeader::etaphmax
Definition: AlpgenHeader.h:36
AlpgenHeader::ndns
Definition: AlpgenHeader.h:14
AlpgenHeader::mz
Definition: AlpgenHeader.h:58
mps_fire.end
end
Definition: mps_fire.py:242
AlpgenHeader::mllmax
Definition: AlpgenHeader.h:45
AlpgenHeader::drcmin
Definition: AlpgenHeader.h:39
AlpgenHeader::iqopt
Definition: AlpgenHeader.h:15
AlpgenHeader::mb
Definition: AlpgenHeader.h:58
AlpgenHeader::njets
Definition: AlpgenHeader.h:19
AlpgenHeader::iseed4
Definition: AlpgenHeader.h:51
AlpgenHeader::ptjmin
Definition: AlpgenHeader.h:26
AlpgenHeader::ihvy
Definition: AlpgenHeader.h:20
AlpgenHeader::etajmax
Definition: AlpgenHeader.h:32
AlpgenHeader::drphmin
Definition: AlpgenHeader.h:43
createfilelist.int
int
Definition: createfilelist.py:10
AlpgenHeader::mllmin
Definition: AlpgenHeader.h:44
AlpgenHeader::qfac
Definition: AlpgenHeader.h:16
AlpgenHeader::ickkw
Definition: AlpgenHeader.h:17
AlpgenHeader::nEvents
double nEvents
Definition: AlpgenHeader.h:69
AlpgenHeader::ptbmin
Definition: AlpgenHeader.h:27
AlpgenHeader::mw
Definition: AlpgenHeader.h:58
AlpgenHeader::nw
Definition: AlpgenHeader.h:22
AlpgenHeader::Parameter
Parameter
Definition: AlpgenHeader.h:11
AlpgenHeader::mt
Definition: AlpgenHeader.h:58
AlpgenHeader::cluopt
Definition: AlpgenHeader.h:49
AlpgenHeader::itopprc
Definition: AlpgenHeader.h:48
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
AlpgenHeader::ih2
Definition: AlpgenHeader.h:12
AlpgenHeader::masses
double masses[MASS_MAX]
Definition: AlpgenHeader.h:71
mps_splice.line
line
Definition: mps_splice.py:76
lumi
Definition: LumiSectionData.h:20
AlpgenHeader::ihvy2
Definition: AlpgenHeader.h:21
AlpgenHeader::ptlmin
Definition: AlpgenHeader.h:29
AlpgenHeader::iseed2
Definition: AlpgenHeader.h:47
AlpgenHeader::iseed3
Definition: AlpgenHeader.h:50
AlpgenHeader::drlmin
Definition: AlpgenHeader.h:40
AlpgenHeader::drjmin
Definition: AlpgenHeader.h:37
AlpgenHeader::ktfac
Definition: AlpgenHeader.h:18
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
AlpgenHeader::mh
Definition: AlpgenHeader.h:58
AlpgenHeader::MASS_MAX
Definition: AlpgenHeader.h:58