CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
gen::JetMatchingAlpgen Class Reference

#include <JetMatchingAlpgen.h>

Inheritance diagram for gen::JetMatchingAlpgen:
gen::JetMatching

Public Member Functions

 JetMatchingAlpgen (const edm::ParameterSet &params)
 
 ~JetMatchingAlpgen () override
 
- Public Member Functions inherited from gen::JetMatching
virtual void beforeHadronisationExec ()
 
virtual const std::vector< int > * getPartonList ()
 
virtual bool initAfterBeams ()
 
bool isMatchingDone ()
 
 JetMatching (const edm::ParameterSet &params)
 
void resetMatchingStatus ()
 
virtual ~JetMatching ()
 

Private Member Functions

void beforeHadronisation (const lhef::LHEEvent *event) override
 
std::set< std::string > capabilities () const override
 
double getJetEtaMax () const override
 
void init (const lhef::LHERunInfo *runInfo) override
 
int match (const lhef::LHEEvent *partonLevel, const std::vector< fastjet::PseudoJet > *jetInput) override
 

Private Attributes

bool applyMatching
 
bool eventInitialized
 
AlpgenHeader header
 
bool runInitialized
 

Additional Inherited Members

- Static Public Member Functions inherited from gen::JetMatching
static std::unique_ptr< JetMatchingcreate (const edm::ParameterSet &params)
 
- Protected Attributes inherited from gen::JetMatching
bool fMatchingStatus
 

Detailed Description

Definition at line 10 of file JetMatchingAlpgen.h.

Constructor & Destructor Documentation

◆ JetMatchingAlpgen()

gen::JetMatchingAlpgen::JetMatchingAlpgen ( const edm::ParameterSet params)

Definition at line 34 of file JetMatchingAlpgen.cc.

35  : JetMatching(params), applyMatching(params.getParameter<bool>("applyMatching")), runInitialized(false) {
36  ahopts_.etclus = params.getParameter<double>("etMin");
37  ahopts_.rclus = params.getParameter<double>("drMin");
38  ahopts_.iexc = params.getParameter<bool>("exclusive");
39  }

References ahopts_, AHOPTS::etclus, AHOPTS::iexc, CalibrationSummaryClient_cfi::params, and AHOPTS::rclus.

◆ ~JetMatchingAlpgen()

gen::JetMatchingAlpgen::~JetMatchingAlpgen ( )
override

Definition at line 42 of file JetMatchingAlpgen.cc.

42 {}

Member Function Documentation

◆ beforeHadronisation()

void gen::JetMatchingAlpgen::beforeHadronisation ( const lhef::LHEEvent event)
overrideprivatevirtual

Reimplemented from gen::JetMatching.

Definition at line 113 of file JetMatchingAlpgen.cc.

113  {
114  // We can't continue if the run has not been initialized.
115  if (!runInitialized)
116  throw cms::Exception("Generator|PartonShowerVeto") << "Run not initialized in JetMatchingAlpgen" << std::endl;
117 
118  // We are called just after LHEInterface has filled in
119  // the Fortran common block (and Pythia6 called UPEVNT).
120 
121  // Possibly not interesting for us.
122  // (except perhaps for debugging?)
123  // pyupre_();
124  // dbpart_();
125  eventInitialized = true;
126  }

References eventInitialized, Exception, and runInitialized.

◆ capabilities()

std::set< std::string > gen::JetMatchingAlpgen::capabilities ( ) const
overrideprivatevirtual

Reimplemented from gen::JetMatching.

Definition at line 44 of file JetMatchingAlpgen.cc.

44  {
45  std::set<std::string> result;
46  result.insert("psFinalState");
47  result.insert("hepevt");
48  result.insert("pythia6");
49  return result;
50  }

References mps_fire::result.

◆ getJetEtaMax()

double gen::JetMatchingAlpgen::getJetEtaMax ( ) const
inlineoverrideprivatevirtual

Implements gen::JetMatching.

Definition at line 20 of file JetMatchingAlpgen.h.

20 { return 0.; }

◆ init()

void gen::JetMatchingAlpgen::init ( const lhef::LHERunInfo runInfo)
overrideprivatevirtual

Reimplemented from gen::JetMatching.

Definition at line 54 of file JetMatchingAlpgen.cc.

54  {
55  // Read Alpgen run card stored in the LHERunInfo object.
56  std::vector<std::string> headerLines = runInfo->findHeader("AlpgenUnwParFile");
57  if (headerLines.empty())
58  throw cms::Exception("Generator|PartonShowerVeto") << "In order to use Alpgen jet matching, "
59  "the input file has to contain the corresponding "
60  "Alpgen headers."
61  << std::endl;
62 
63  // Parse the header using its bultin function.
64  header.parse(headerLines.begin(), headerLines.end());
65 
66  // I don't want to print this right now.
67  // std::cout << "Alpgen header" << std::endl;
68  // std::cout << "========================" << std::endl;
69  // std::cout << "\tihrd = " << header.ihrd << std::endl;
70  // std::cout << "\tmc = " << header.masses[AlpgenHeader::mc]
71  // << ", mb = " << header.masses[AlpgenHeader::mb]
72  // << ", mt = " << header.masses[AlpgenHeader::mt]
73  // << ", mw = " << header.masses[AlpgenHeader::mw]
74  // << ", mz = " << header.masses[AlpgenHeader::mz]
75  // << ", mh = " << header.masses[AlpgenHeader::mh]
76  // << std::endl;
77  // for(std::map<AlpgenHeader::Parameter, double>::const_iterator iter =
78  // header.params.begin(); iter != header.params.end(); ++iter)
79  // std::cout << "\t" << AlpgenHeader::parameterName(iter->first)
80  // << " = " << iter->second << std::endl;
81  // std::cout << "\txsec = " << header.xsec
82  // << " +-" << header.xsecErr << std::endl;
83  // std::cout << "========================" << std::endl;
84 
85  // Here we pass a few header variables to common block and
86  // call Alpgen init routine to do the rest.
87  // The variables passed first are the ones directly that
88  // need to be set up "manually": IHRD and the masses.
89  // (ebeam is set just to mimic the original code)
90  // Afterwards, we pass the full spectrum of Alpgen
91  // parameters directly into the AHPARS structure, to be
92  // treated by AHSPAR which is called inside alsetp_().
93 
97 
98  for (std::map<AlpgenHeader::Parameter, double>::const_iterator iter = header.params.begin();
99  iter != header.params.end();
100  ++iter) {
101  if (iter->first <= 0 || iter->first >= (int)AHPARS::nparam - 1)
102  continue;
103  ahpars_.parval[(int)iter->first - 1] = iter->second;
104  }
105 
106  // Run the rest of the setup.
107  alsetp_();
108 
109  // When we reach this point, the run is fully initialized.
110  runInitialized = true;
111  }

References ahpars_, ahppara_, gen::alsetp_(), filterCSVwithJSON::copy, AlpgenHeader::ebeam, AHPPARA::ebeam, header, AHPPARA::ihrd, AlpgenHeader::ihrd, createfilelist::int, AlpgenHeader::MASS_MAX, AHPPARA::masses, AlpgenHeader::masses, AHPARS::nparam, AlpgenHeader::params, AlpgenHeader::parse(), AHPARS::parval, submitPVValidationJobs::runInfo, and runInitialized.

◆ match()

int gen::JetMatchingAlpgen::match ( const lhef::LHEEvent partonLevel,
const std::vector< fastjet::PseudoJet > *  jetInput 
)
overrideprivatevirtual

Implements gen::JetMatching.

Definition at line 133 of file JetMatchingAlpgen.cc.

133  {
134  /*
135  if (!showeredFinalState)
136  throw cms::Exception("Generator|PartonShowerVeto")
137  << "Alpgen matching expected parton shower "
138  "final state." << std::endl;
139 */
140 
141  if (!runInitialized)
142  throw cms::Exception("Generator|PartonShowerVeto") << "Run not initialized in JetMatchingAlpgen" << std::endl;
143 
144  if (!eventInitialized)
145  throw cms::Exception("Generator|PartonShowerVeto") << "Event not initialized in JetMatchingAlpgen" << std::endl;
146 
147  // If matching not required (e.g., icckw = 0), don't run the
148  // FORTRAN veto code.
149  if (!applyMatching)
150  return 0;
151 
152  // Call the Fortran veto code.
153  int veto = 0;
154  alveto_(&veto);
155 
156  eventInitialized = false;
157 
158  // If event was vetoed, the variable veto will contain the number 1.
159  // In this case, we must return 1 - that will be used as the return value from UPVETO.
160  // If event was accepted, the variable veto will contain the number 0.
161  // In this case, we must return 0 - that will be used as the return value from UPVETO.
162  return veto ? 1 : 0;
163  }

References gen::alveto_(), applyMatching, eventInitialized, Exception, runInitialized, and PbPb_ZMuSkimMuonDPG_cff::veto.

Member Data Documentation

◆ applyMatching

bool gen::JetMatchingAlpgen::applyMatching
private

Definition at line 28 of file JetMatchingAlpgen.h.

Referenced by match().

◆ eventInitialized

bool gen::JetMatchingAlpgen::eventInitialized
private

Definition at line 30 of file JetMatchingAlpgen.h.

Referenced by beforeHadronisation(), and match().

◆ header

AlpgenHeader gen::JetMatchingAlpgen::header
private

Definition at line 32 of file JetMatchingAlpgen.h.

Referenced by init().

◆ runInitialized

bool gen::JetMatchingAlpgen::runInitialized
private

Definition at line 29 of file JetMatchingAlpgen.h.

Referenced by beforeHadronisation(), init(), and match().

AHOPTS::etclus
double etclus
Definition: AlpgenCommonBlocks.h:8
AHPARS::nparam
static const unsigned int nparam
Definition: AlpgenCommonBlocks.h:31
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
ahppara_
struct AHPPARA ahppara_
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
ahpars_
struct AHPARS ahpars_
AHPPARA::ihrd
int ihrd
Definition: AlpgenCommonBlocks.h:23
AlpgenHeader::ebeam
Definition: AlpgenHeader.h:13
AlpgenHeader::params
std::map< Parameter, double > params
Definition: AlpgenHeader.h:65
AlpgenHeader::ihrd
unsigned int ihrd
Definition: AlpgenHeader.h:66
gen::JetMatchingAlpgen::runInitialized
bool runInitialized
Definition: JetMatchingAlpgen.h:29
gen::JetMatchingAlpgen::applyMatching
bool applyMatching
Definition: JetMatchingAlpgen.h:28
gen::JetMatchingAlpgen::header
AlpgenHeader header
Definition: JetMatchingAlpgen.h:32
AHOPTS::iexc
int iexc
Definition: AlpgenCommonBlocks.h:11
AHPPARA::masses
double masses[6]
Definition: AlpgenCommonBlocks.h:21
AHPPARA::ebeam
double ebeam
Definition: AlpgenCommonBlocks.h:22
gen::alveto_
void alveto_(int *ipveto)
createfilelist.int
int
Definition: createfilelist.py:10
gen::alsetp_
void alsetp_()
Exception
Definition: hltDiff.cc:245
AHPARS::parval
double parval[nparam]
Definition: AlpgenCommonBlocks.h:33
submitPVValidationJobs.runInfo
dictionary runInfo
Definition: submitPVValidationJobs.py:1013
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
AHOPTS::rclus
double rclus
Definition: AlpgenCommonBlocks.h:9
AlpgenHeader::masses
double masses[MASS_MAX]
Definition: AlpgenHeader.h:71
gen::JetMatchingAlpgen::eventInitialized
bool eventInitialized
Definition: JetMatchingAlpgen.h:30
PbPb_ZMuSkimMuonDPG_cff.veto
veto
Definition: PbPb_ZMuSkimMuonDPG_cff.py:61
ahopts_
struct AHOPTS ahopts_
gen::JetMatching::JetMatching
JetMatching(const edm::ParameterSet &params)
Definition: JetMatching.cc:17
AlpgenHeader::parse
bool parse(const std::vector< std::string >::const_iterator &begin, const std::vector< std::string >::const_iterator &end)
Definition: AlpgenHeader.cc:62
AlpgenHeader::MASS_MAX
Definition: AlpgenHeader.h:58