CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
gen::JetMatchingMGFastJet Class Reference

#include <JetMatchingMGFastJet.h>

Inheritance diagram for gen::JetMatchingMGFastJet:
gen::JetMatching

Public Member Functions

const std::vector< int > * getPartonList () override
 
 JetMatchingMGFastJet (const edm::ParameterSet &params)
 
template<>
std::string parseParameter (const std::string &value)
 
template<>
bool parseParameter (const std::string &value_)
 
 ~JetMatchingMGFastJet () override
 
- Public Member Functions inherited from gen::JetMatching
virtual std::set< std::string > capabilities () const
 
bool isMatchingDone ()
 
 JetMatching (const edm::ParameterSet &params)
 
void resetMatchingStatus ()
 
virtual ~JetMatching ()
 

Protected Member Functions

void beforeHadronisation (const lhef::LHEEvent *) override
 
void beforeHadronisationExec () override
 
double getJetEtaMax () const override
 
void init (const lhef::LHERunInfo *runInfo) override
 
bool initAfterBeams () override
 
int match (const lhef::LHEEvent *partonLevel, const std::vector< fastjet::PseudoJet > *jetInput) override
 

Private Types

enum  partonTypes { ID_TOP = 6, ID_GLUON = 21, ID_PHOTON = 22 }
 
enum  vetoStatus {
  NONE, LESS_JETS, MORE_JETS, HARD_JET,
  UNMATCHED_PARTON
}
 

Private Member Functions

template<typename T >
T getParameter (const std::string &var, const T &defValue=T()) const
 

Static Private Member Functions

template<typename T >
static T getParameter (const std::map< std::string, std::string > &params, const std::string &var, const T &defValue=T())
 
template<typename T >
static T parseParameter (const std::string &value)
 
template<typename T >
static void updateOrDie (const std::map< std::string, std::string > &params, T &param, const std::string &name)
 

Private Attributes

double clFact
 
double coneRadius
 
bool doMerge
 
double etaJetMax
 
bool exclusive
 
std::vector< fastjet::PseudoJet > fClusJets
 
int fDJROutFlag
 
std::ofstream fDJROutput
 
bool fExcLocal
 
bool fIsInit
 
fastjet::JetDefinition * fJetFinder
 
std::vector< fastjet::PseudoJet > fPtSortedJets
 
int jetAlgoPower
 
std::map< std::string, std::string > mgParams
 
int nJetMax
 
int nJetMin
 
int nQmatch
 
double qCut
 
double qCutSq
 
bool runInitialized
 
bool soup
 
std::vector< int > typeIdx [3]
 

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 31 of file JetMatchingMGFastJet.h.

Member Enumeration Documentation

◆ partonTypes

◆ vetoStatus

Constructor & Destructor Documentation

◆ JetMatchingMGFastJet()

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

Definition at line 129 of file JetMatchingMGFastJet.cc.

References gen::MEMAIN::clfact, gen::MEMAIN::etaclmax, gen::MEMAIN::etcjet, Exception, exclusive, gen::MEMAIN::excres, fDJROutFlag, gen::OUTTREE::flag, B2GTnPMonitor_cfi::item, gen::MEMAIN::ktsche, gen::MEMAIN::maxjets, gen::memain_, gen::MEMAIN::minjets, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, gen::MEMAIN::nexcres, gen::MEMAIN::nqmatch, gen::outtree_, submitPVValidationJobs::params, gen::MEMAIN::qcut, gen::MEMAIN::rclmax, gen::MEMAIN::showerkt, soup, contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

130  : JetMatching(params), runInitialized(false), fJetFinder(nullptr), fIsInit(false) {
131  std::string mode = params.getParameter<std::string>("mode");
132  if (mode == "inclusive") {
133  soup = false;
134  exclusive = false;
135  } else if (mode == "exclusive") {
136  soup = false;
137  exclusive = true;
138  } else if (mode == "auto")
139  soup = true;
140  else
141  throw cms::Exception("Generator|LHEInterface") << "MGFastJet jet matching scheme requires \"mode\" "
142  "parameter to be set to either \"inclusive\", "
143  "\"exclusive\" or \"auto\"."
144  << std::endl;
145 
146  memain_.etcjet = 0.;
147  memain_.rclmax = 0.0;
148  memain_.clfact = 0.0;
149  memain_.ktsche = 0.0;
150  memain_.etaclmax = params.getParameter<double>("MEMAIN_etaclmax");
151  memain_.qcut = params.getParameter<double>("MEMAIN_qcut");
152  memain_.minjets = params.getParameter<int>("MEMAIN_minjets");
153  memain_.maxjets = params.getParameter<int>("MEMAIN_maxjets");
154  memain_.showerkt = params.getParameter<double>("MEMAIN_showerkt");
155  memain_.nqmatch = params.getParameter<int>("MEMAIN_nqmatch");
156  outtree_.flag = params.getParameter<int>("outTree_flag");
157  std::string list_excres = params.getParameter<std::string>("MEMAIN_excres");
158  std::vector<std::string> elems;
159  std::stringstream ss(list_excres);
161  int index = 0;
162  while (std::getline(ss, item, ',')) {
163  elems.push_back(item);
164  memain_.excres[index] = std::atoi(item.c_str());
165  index++;
166  }
168 
169  fDJROutFlag = params.getParameter<int>("outTree_flag");
170  }
struct gen::OUTTREE outtree_
struct gen::MEMAIN memain_
fastjet::JetDefinition * fJetFinder
JetMatching(const edm::ParameterSet &params)
Definition: JetMatching.cc:17

◆ ~JetMatchingMGFastJet()

gen::JetMatchingMGFastJet::~JetMatchingMGFastJet ( )
inlineoverride

Definition at line 35 of file JetMatchingMGFastJet.h.

References fJetFinder.

35  {
36  if (fJetFinder)
37  delete fJetFinder;
38  }
fastjet::JetDefinition * fJetFinder

Member Function Documentation

◆ beforeHadronisation()

void gen::JetMatchingMGFastJet::beforeHadronisation ( const lhef::LHEEvent lhee)
overrideprotectedvirtual

Reimplemented from gen::JetMatching.

Definition at line 215 of file JetMatchingMGFastJet.cc.

References funct::abs(), Exception, exclusive, fExcLocal, lhef::LHEEvent::getHEPEUP(), mps_fire::i, ID_GLUON, ID_TOP, lhef::HEPEUP::IDUP, heavyIonCSV_trainingSettings::idx, lhef::HEPEUP::ISTUP, lhef::HEPEUP::MOTHUP, nJetMax, nQmatch, lhef::HEPEUP::NUP, runInitialized, soup, and typeIdx.

215  {
216  if (!runInitialized)
217  throw cms::Exception("Generator|PartonShowerVeto") << "Run not initialized in JetMatchingMGFastJet" << std::endl;
218 
219  for (int i = 0; i < 3; i++) {
220  typeIdx[i].clear();
221  }
222 
223  // Sort original process final state into light/heavy jets and 'other'.
224  // Criteria:
225  // 1 <= ID <= 5 and massless, or ID == 21 --> light jet (typeIdx[0])
226  // 4 <= ID <= 6 and massive --> heavy jet (typeIdx[1])
227  // All else --> other (typeIdx[2])
228  //
229  const lhef::HEPEUP &hepeup = *lhee->getHEPEUP();
230  int idx = 2;
231  for (int i = 0; i < hepeup.NUP; i++) {
232  if (hepeup.ISTUP[i] < 0)
233  continue;
234  if (hepeup.MOTHUP[i].first != 1 && hepeup.MOTHUP[i].second != 2)
235  continue; // this way we skip entries that come
236  // from resonance decays;
237  // we only take those that descent
238  // directly from "incoming partons"
239  idx = 2;
240  if (hepeup.IDUP[i] == ID_GLUON || (std::abs(hepeup.IDUP[i]) <= nQmatch)) // light jet
241  // light jet
242  idx = 0;
243  else if (std::abs(hepeup.IDUP[i]) > nQmatch && std::abs(hepeup.IDUP[i]) <= ID_TOP) // heavy jet
244  idx = 1;
245  // Store
246  typeIdx[idx].push_back(i);
247  }
248 
249  // NOTE: In principle, I should use exclusive, inclusive, or soup !!!
250  // should be like this:
251  if (soup) {
252  int NPartons = typeIdx[0].size();
253  fExcLocal = (NPartons < nJetMax);
254  } else
256 
257  return;
258  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< int > ISTUP
Definition: LesHouches.h:228
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:234
std::vector< int > IDUP
Definition: LesHouches.h:223
const HEPEUP * getHEPEUP() const
Definition: LHEEvent.h:38
std::vector< int > typeIdx[3]

◆ beforeHadronisationExec()

void gen::JetMatchingMGFastJet::beforeHadronisationExec ( )
inlineoverrideprotectedvirtual

Reimplemented from gen::JetMatching.

Definition at line 47 of file JetMatchingMGFastJet.h.

47 { return; }

◆ getJetEtaMax()

double gen::JetMatchingMGFastJet::getJetEtaMax ( ) const
overrideprotectedvirtual

Implements gen::JetMatching.

Definition at line 172 of file JetMatchingMGFastJet.cc.

References gen::MEMAIN::etaclmax, and gen::memain_.

172 { return memain_.etaclmax; }
struct gen::MEMAIN memain_

◆ getParameter() [1/2]

template<typename T >
T gen::JetMatchingMGFastJet::getParameter ( const std::map< std::string, std::string > &  params,
const std::string &  var,
const T defValue = T() 
)
staticprivate

Definition at line 74 of file JetMatchingMGFastJet.cc.

References submitPVValidationJobs::params, and trigObjTnPSource_cfi::var.

Referenced by getParameter(), and updateOrDie().

76  {
77  std::map<std::string, std::string>::const_iterator pos = params.find(var);
78  if (pos == params.end())
79  return defValue;
80  return parseParameter<T>(pos->second);
81  }

◆ getParameter() [2/2]

template<typename T >
T gen::JetMatchingMGFastJet::getParameter ( const std::string &  var,
const T defValue = T() 
) const
private

Definition at line 84 of file JetMatchingMGFastJet.cc.

References getParameter(), mgParams, and trigObjTnPSource_cfi::var.

84  {
85  return getParameter(mgParams, var, defValue);
86  }
static T getParameter(const std::map< std::string, std::string > &params, const std::string &var, const T &defValue=T())
std::map< std::string, std::string > mgParams

◆ getPartonList()

const std::vector<int>* gen::JetMatchingMGFastJet::getPartonList ( )
inlineoverridevirtual

Reimplemented from gen::JetMatching.

Definition at line 40 of file JetMatchingMGFastJet.h.

References typeIdx.

40 { return typeIdx; }
std::vector< int > typeIdx[3]

◆ init()

void gen::JetMatchingMGFastJet::init ( const lhef::LHERunInfo runInfo)
overrideprotectedvirtual

Reimplemented from gen::JetMatching.

Definition at line 260 of file JetMatchingMGFastJet.cc.

References gather_cfg::cout, gen::MEMAIN::etaclmax, fIsInit, RecoTauValidation_cfi::header, gen::UPPRIV::ickkw, initAfterBeams(), gen::MEMAIN::maxjets, gen::MEMAIN::mektsc, gen::memain_, mgParams, gen::MEMAIN::minjets, gen::MEMAIN::nqmatch, submitPVValidationJobs::params, gen::parseHeader(), gen::MEMAIN::qcut, submitPVValidationJobs::runInfo, runInitialized, gen::MEMAIN::showerkt, updateOrDie(), gen::uppriv_, and contentValuesCheck::values.

260  {
261  if (fIsInit)
262  return;
263 
264  // read MGFastJet run card
265 
266  std::map<std::string, std::string> parameters;
267 
268  std::vector<std::string> header = runInfo->findHeader("MGRunCard");
269  if (header.empty())
270  throw cms::Exception("Generator|PartonShowerVeto") << "In order to use MGFastJet jet matching, "
271  "the input file has to contain the corresponding "
272  "MadGraph headers."
273  << std::endl;
274 
276 
277  // set variables in common block
278 
279  std::vector<Param> params;
280  std::vector<Param> values;
281  for (std::map<std::string, std::string>::const_iterator iter = mgParams.begin(); iter != mgParams.end(); ++iter) {
282  params.push_back(" " + iter->first);
283  values.push_back(iter->second);
284  }
285 
286  // set MG matching parameters
287 
288  uppriv_.ickkw = getParameter<int>("ickkw", 0);
289  memain_.mektsc = getParameter<int>("ktscheme", 0);
290 
291  header = runInfo->findHeader("MGParamCMS");
292 
293  std::map<std::string, std::string> mgInfoCMS = parseHeader(header);
294 
295  for (std::map<std::string, std::string>::const_iterator iter = mgInfoCMS.begin(); iter != mgInfoCMS.end(); ++iter) {
296  std::cout << "mgInfoCMS: " << iter->first << " " << iter->second << std::endl;
297  }
298 
299  updateOrDie(mgInfoCMS, memain_.etaclmax, "etaclmax");
300  updateOrDie(mgInfoCMS, memain_.qcut, "qcut");
301  updateOrDie(mgInfoCMS, memain_.minjets, "minjets");
302  updateOrDie(mgInfoCMS, memain_.maxjets, "maxjets");
303  updateOrDie(mgInfoCMS, memain_.showerkt, "showerkt");
304  updateOrDie(mgInfoCMS, memain_.nqmatch, "nqmatch");
305 
306  runInitialized = true;
307 
308  initAfterBeams();
309 
310  fIsInit = true;
311 
312  return;
313  }
struct gen::MEMAIN memain_
static void updateOrDie(const std::map< std::string, std::string > &params, T &param, const std::string &name)
static std::map< std::string, std::string > parseHeader(const std::vector< std::string > &header)
std::map< std::string, std::string > mgParams
struct gen::UPPRIV uppriv_

◆ initAfterBeams()

bool gen::JetMatchingMGFastJet::initAfterBeams ( )
overrideprotectedvirtual

Reimplemented from gen::JetMatching.

Definition at line 174 of file JetMatchingMGFastJet.cc.

References clFact, coneRadius, doMerge, gen::MEMAIN::etaclmax, etaJetMax, fClusJets, fExcLocal, fIsInit, fJetFinder, fPtSortedJets, gen::UPPRIV::ickkw, jetAlgoPower, gen::MEMAIN::maxjets, gen::memain_, gen::MEMAIN::minjets, nJetMax, nJetMin, gen::MEMAIN::nqmatch, nQmatch, conifer::pow(), gen::MEMAIN::qcut, qCut, qCutSq, and gen::uppriv_.

Referenced by init().

174  {
175  if (fIsInit)
176  return true;
177 
178  //
180  // doMerge = true;
181  qCut = memain_.qcut; //
183  clFact = 1.; // Default value
184  // NOTE: ME2pythia seems to default to 1.5 - need to check !!!
185  // in general, needs to read key ALPSFACT from LHE file - fix CMSSW code !!!
188 
190 
191  coneRadius = 1.0;
192  jetAlgoPower = 1; // this is the kT algorithm !!!
193 
194  // Matching procedure
195  //
196  qCutSq = pow(qCut, 2);
197  // this should be something like memaev_.iexc
198  fExcLocal = true;
199 
200  // If not merging, then done (?????)
201  //
202  // if (!doMerge) return true;
203 
204  // Initialise chosen jet algorithm.
205  //
206  fJetFinder = new fastjet::JetDefinition(fastjet::kt_algorithm, coneRadius);
207  fClusJets.clear();
208  fPtSortedJets.clear();
209 
210  fIsInit = true;
211 
212  return true;
213  }
struct gen::MEMAIN memain_
fastjet::JetDefinition * fJetFinder
constexpr int pow(int x)
Definition: conifer.h:24
std::vector< fastjet::PseudoJet > fClusJets
std::vector< fastjet::PseudoJet > fPtSortedJets
struct gen::UPPRIV uppriv_

◆ match()

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

Implements gen::JetMatching.

Definition at line 315 of file JetMatchingMGFastJet.cc.

References clFact, counter, fClusJets, fDJROutFlag, fDJROutput, fExcLocal, fJetFinder, fPtSortedJets, lhef::LHEEvent::getHEPEUP(), mps_fire::i, heavyIonCSV_trainingSettings::idx, LESS_JETS, muonTagProbeFilters_cff::matched, SiStripPI::max, MORE_JETS, NONE, convertSQLitetoXML_cfg::output, conifer::pow(), HLT_2023v12_cff::pt2, lhef::HEPEUP::PUP, qCut, qCutSq, mathSSE::sqrt(), typeIdx, and UNMATCHED_PARTON.

315  {
316  // Number of hard partons
317  //
318  int NPartons = typeIdx[0].size();
319 
320  fClusJets.clear();
321  fPtSortedJets.clear();
322 
323  int ClusSeqNJets = 0;
324 
325  fastjet::ClusterSequence ClusSequence(*jetInput, *fJetFinder);
326 
327  if (fExcLocal) {
328  fClusJets = ClusSequence.exclusive_jets(qCutSq);
329  } else {
330  fClusJets = ClusSequence.inclusive_jets(qCut);
331  }
332 
333  ClusSeqNJets = fClusJets.size();
334 
335  if (ClusSeqNJets < NPartons)
336  return LESS_JETS;
337 
338  double localQcutSq = qCutSq;
339 
340  if (fExcLocal) // exclusive
341  {
342  if (ClusSeqNJets > NPartons)
343  return MORE_JETS;
344  } else // inclusive
345  {
346  fPtSortedJets = fastjet::sorted_by_pt(*jetInput);
347  localQcutSq = std::max(qCutSq, fPtSortedJets[0].pt2());
348  fClusJets = ClusSequence.exclusive_jets(NPartons); // override
349  ClusSeqNJets = NPartons;
350  }
351 
352  if (clFact != 0)
353  localQcutSq *= pow(clFact, 2);
354 
355  std::vector<fastjet::PseudoJet> MatchingInput;
356 
357  std::vector<bool> jetAssigned;
358  jetAssigned.assign(fClusJets.size(), false);
359 
360  int counter = 0;
361 
362  const lhef::HEPEUP &hepeup = *partonLevel->getHEPEUP();
363 
364  while (counter < NPartons) {
365  MatchingInput.clear();
366 
367  for (int i = 0; i < ClusSeqNJets; i++) {
368  if (jetAssigned[i])
369  continue;
370  if (i == NPartons)
371  break;
372  //
373  // this looks "awkward" but this way we do NOT pass in cluster_hist_index
374  // which would actually indicate position in "history" of the "master" ClusSeq
375  //
376  fastjet::PseudoJet exjet = fClusJets[i];
377  MatchingInput.push_back(fastjet::PseudoJet(exjet.px(), exjet.py(), exjet.pz(), exjet.e()));
378  MatchingInput.back().set_user_index(i);
379  }
380 
381  int idx = typeIdx[0][counter];
382  MatchingInput.push_back(
383  fastjet::PseudoJet(hepeup.PUP[idx][0], hepeup.PUP[idx][1], hepeup.PUP[idx][2], hepeup.PUP[idx][3]));
384 
385  //
386  // in principle, one can use ClusterSequence::n_particles()
387  //
388  int NBefore = MatchingInput.size();
389 
390  // Create new clustering object - which includes the 1st clustering run !!!
391  // NOTE-1: it better be a new object for each try, or history will be "too crowded".
392  // NOTE-2: when created, the it ALWAYS makes at least 1 clustering step, so in most
393  // cases at least 1 new jet object will be added; although in some cases
394  // no jet is added, if the system doesn't cluster to anything (for example,
395  // input jet(s) and parton(s) are going opposite directions)
396  //
397  fastjet::ClusterSequence ClusSeq(MatchingInput, *fJetFinder);
398 
399  const std::vector<fastjet::PseudoJet> &output = ClusSeq.jets();
400  int NClusJets = output.size() - NBefore;
401 
402  //
403  // JVY - I think this is the right idea:
404  // at least 1 (one) new jet needs to be added
405  // however, need to double check details and refine, especially for inclusive mode
406  //
407  //
408  if (NClusJets < 1) {
409  return UNMATCHED_PARTON;
410  }
411  //
412  // very unlikely case but let's do it just to be safe
413  //
414  if (NClusJets >= NBefore) {
415  return MORE_JETS;
416  }
417 
418  // Now browse history and see how close the clustering distance
419  //
420  // NOTE: Remember, there maybe more than one new jet in the list (for example,
421  // for process=2,3,...);
422  // in this case we take the ** first ** one that satisfies the distance/cut,
423  // which is ** typically ** also the best one
424  //
425  bool matched = false;
426  const std::vector<fastjet::ClusterSequence::history_element> &history = ClusSeq.history();
427 
428  // for ( unsigned int i=nBefore; i<history.size(); i++ )
429  for (unsigned int i = NBefore; i < output.size(); i++) {
430  int hidx = output[i].cluster_sequence_history_index();
431  double dNext = history[hidx].dij;
432  if (dNext < localQcutSq) {
433  //
434  // the way we form input, parent1 is always jet, and parent2 can be any,
435  // but if it's a good match/cluster, it should point at the parton
436  //
437  int parent1 = history[hidx].parent1;
438  int parent2 = history[hidx].parent2;
439  if (parent1 < 0 || parent2 < 0)
440  break; // bad cluster, no match
441  //
442  // pull up jet's "global" index
443  //
444  int pidx = MatchingInput[parent1].user_index();
445  jetAssigned[pidx] = true;
446  matched = true;
447  break;
448  }
449  }
450  if (!matched) {
451  return UNMATCHED_PARTON;
452  }
453 
454  counter++;
455  }
456 
457  // Now save some info for DJR analysis (if requested).
458  // This mimics what is done in ME2pythia.f
459  // Basically, NJets and matching scale for these 4 cases:
460  // 1->0, 2->1, 3->2, and 4->3
461  //
462  if (fDJROutFlag > 0) {
463  std::vector<double> MergingScale;
464  MergingScale.clear();
465  for (int nj = 0; nj < 4; nj++) {
466  double dmscale2 = ClusSequence.exclusive_dmerge(nj);
467  double dmscale = sqrt(dmscale2);
468  MergingScale.push_back(dmscale);
469  }
470  fDJROutput.open("events.tree", std::ios_base::app);
471  double dNJets = (double)NPartons;
472  fDJROutput << " " << dNJets << " " << MergingScale[0] << " " << MergingScale[1] << " " << MergingScale[2] << " "
473  << MergingScale[3] << std::endl;
474  fDJROutput.close();
475  }
476 
477  return NONE;
478  }
fastjet::JetDefinition * fJetFinder
constexpr int pow(int x)
Definition: conifer.h:24
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< FiveVector > PUP
Definition: LesHouches.h:246
std::vector< fastjet::PseudoJet > fClusJets
std::vector< fastjet::PseudoJet > fPtSortedJets
const HEPEUP * getHEPEUP() const
Definition: LHEEvent.h:38
static std::atomic< unsigned int > counter
std::vector< int > typeIdx[3]

◆ parseParameter() [1/3]

template<typename T >
T gen::JetMatchingMGFastJet::parseParameter ( const std::string &  value)
staticprivate

Definition at line 49 of file JetMatchingMGFastJet.cc.

References mps_fire::result, and contentValuesCheck::ss.

49  {
50  std::istringstream ss(value);
51  T result;
52  ss >> result;
53  return result;
54  }
Definition: value.py:1
long double T

◆ parseParameter() [2/3]

template<>
std::string gen::JetMatchingMGFastJet::parseParameter ( const std::string &  value)

Definition at line 57 of file JetMatchingMGFastJet.cc.

References mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

57  {
59  if (!result.empty() && result[0] == '\'')
60  result = result.substr(1);
61  if (!result.empty() && result[result.length() - 1] == '\'')
62  result.resize(result.length() - 1);
63  return result;
64  }

◆ parseParameter() [3/3]

template<>
bool gen::JetMatchingMGFastJet::parseParameter ( const std::string &  value_)

Definition at line 67 of file JetMatchingMGFastJet.cc.

References createfilelist::int, AlCaHLTBitMon_QueryRunRegistry::string, HcalDetIdTransform::transform(), and relativeConstraints::value.

67  {
68  std::string value(value_);
69  std::transform(value.begin(), value.end(), value.begin(), (int (*)(int))std::toupper);
70  return value == "T" || value == "Y" || value == "True" || value == "1" || value == ".TRUE.";
71  }
Definition: value.py:1
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ updateOrDie()

template<typename T >
void gen::JetMatchingMGFastJet::updateOrDie ( const std::map< std::string, std::string > &  params,
T param,
const std::string &  name 
)
staticprivate

Definition at line 114 of file JetMatchingMGFastJet.cc.

References Exception, getParameter(), Skims_PA_cff::name, and submitPVValidationJobs::params.

Referenced by init().

116  {
117  if (param < 0) {
118  param = getParameter(params, name, param);
119  }
120  if (param < 0)
121  throw cms::Exception("Generator|PartonShowerVeto") << "The MGParamCMS header does not specify the jet "
122  "matching parameter \""
123  << name
124  << "\", but it "
125  "is requested by the CMSSW configuration."
126  << std::endl;
127  }
static T getParameter(const std::map< std::string, std::string > &params, const std::string &var, const T &defValue=T())

Member Data Documentation

◆ clFact

double gen::JetMatchingMGFastJet::clFact
private

Definition at line 76 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams(), and match().

◆ coneRadius

double gen::JetMatchingMGFastJet::coneRadius
private

Definition at line 87 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams().

◆ doMerge

bool gen::JetMatchingMGFastJet::doMerge
private

Definition at line 80 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams().

◆ etaJetMax

double gen::JetMatchingMGFastJet::etaJetMax
private

Definition at line 87 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams().

◆ exclusive

bool gen::JetMatchingMGFastJet::exclusive
private

Definition at line 99 of file JetMatchingMGFastJet.h.

Referenced by beforeHadronisation(), and JetMatchingMGFastJet().

◆ fClusJets

std::vector<fastjet::PseudoJet> gen::JetMatchingMGFastJet::fClusJets
private

Definition at line 105 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams(), and match().

◆ fDJROutFlag

int gen::JetMatchingMGFastJet::fDJROutFlag
private

Definition at line 110 of file JetMatchingMGFastJet.h.

Referenced by JetMatchingMGFastJet(), and match().

◆ fDJROutput

std::ofstream gen::JetMatchingMGFastJet::fDJROutput
private

Definition at line 109 of file JetMatchingMGFastJet.h.

Referenced by match().

◆ fExcLocal

bool gen::JetMatchingMGFastJet::fExcLocal
private

Definition at line 92 of file JetMatchingMGFastJet.h.

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

◆ fIsInit

bool gen::JetMatchingMGFastJet::fIsInit
private

Definition at line 112 of file JetMatchingMGFastJet.h.

Referenced by init(), and initAfterBeams().

◆ fJetFinder

fastjet::JetDefinition* gen::JetMatchingMGFastJet::fJetFinder
private

Definition at line 104 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams(), match(), and ~JetMatchingMGFastJet().

◆ fPtSortedJets

std::vector<fastjet::PseudoJet> gen::JetMatchingMGFastJet::fPtSortedJets
private

Definition at line 105 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams(), and match().

◆ jetAlgoPower

int gen::JetMatchingMGFastJet::jetAlgoPower
private

Definition at line 86 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams().

◆ mgParams

std::map<std::string, std::string> gen::JetMatchingMGFastJet::mgParams
private

Definition at line 68 of file JetMatchingMGFastJet.h.

Referenced by getParameter(), and init().

◆ nJetMax

int gen::JetMatchingMGFastJet::nJetMax
private

Definition at line 83 of file JetMatchingMGFastJet.h.

Referenced by beforeHadronisation(), and initAfterBeams().

◆ nJetMin

int gen::JetMatchingMGFastJet::nJetMin
private

Definition at line 83 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams().

◆ nQmatch

int gen::JetMatchingMGFastJet::nQmatch
private

Definition at line 77 of file JetMatchingMGFastJet.h.

Referenced by beforeHadronisation(), and initAfterBeams().

◆ qCut

double gen::JetMatchingMGFastJet::qCut
private

Definition at line 75 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams(), and match().

◆ qCutSq

double gen::JetMatchingMGFastJet::qCutSq
private

Definition at line 75 of file JetMatchingMGFastJet.h.

Referenced by initAfterBeams(), and match().

◆ runInitialized

bool gen::JetMatchingMGFastJet::runInitialized
private

Definition at line 97 of file JetMatchingMGFastJet.h.

Referenced by beforeHadronisation(), and init().

◆ soup

bool gen::JetMatchingMGFastJet::soup
private

Definition at line 98 of file JetMatchingMGFastJet.h.

Referenced by beforeHadronisation(), and JetMatchingMGFastJet().

◆ typeIdx

std::vector<int> gen::JetMatchingMGFastJet::typeIdx[3]
private

Definition at line 95 of file JetMatchingMGFastJet.h.

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