CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Static Private Attributes
JetMatchingAlpgen Class Reference

#include <JetMatchingPy8Internal.h>

Inheritance diagram for JetMatchingAlpgen:
JetMatching JetMatchingAlpgenInputAlpgen

Public Member Functions

bool initAfterBeams ()
 
 JetMatchingAlpgen ()
 
 ~JetMatchingAlpgen ()
 
- Public Member Functions inherited from JetMatching
bool canVetoPartonLevelEarly ()
 
bool canVetoProcessLevel ()
 
bool canVetoStep ()
 
bool doVetoPartonLevelEarly (const Pythia8::Event &event)
 
bool doVetoProcessLevel (Pythia8::Event &process)
 
bool doVetoStep (int, int, int, const Pythia8::Event &)
 
 JetMatching ()
 
int numberVetoStep ()
 
 ~JetMatching ()
 

Private Member Functions

void jetAlgorithmInput (const Pythia8::Event &, int)
 
bool matchPartonsToJets (int)
 
int matchPartonsToJetsHeavy ()
 
int matchPartonsToJetsLight ()
 
void runJetAlgorithm ()
 
void sortIncomingProcess (const Pythia8::Event &)
 
void sortTypeIdx (vector< int > &vecIn)
 

Static Private Attributes

static const double GHOSTENERGY = 1e-15
 
static const double ZEROTHRESHOLD = 1e-10
 

Additional Inherited Members

- Protected Types inherited from JetMatching
enum  partonTypes {
  ID_CHARM =4, ID_BOT =5, ID_TOP =6, ID_LEPMIN =11,
  ID_LEPMAX =16, ID_GLUON =21, ID_PHOTON =22
}
 
enum  vetoStatus {
  NONE, LESS_JETS, MORE_JETS, HARD_JET,
  UNMATCHED_PARTON
}
 
- Protected Attributes inherited from JetMatching
Pythia8::CellJet * cellJet
 
double coneMatchHeavy
 
double coneMatchLight
 
double coneRadius
 
double coneRadiusHeavy
 
bool doMerge
 
bool doShowerKt
 
double etaJetMax
 
double etaJetMaxAlgo
 
double eTjetMin
 
double eTpTlightMin
 
double eTseed
 
double eTthreshold
 
Pythia8::Event eventProcess
 
Pythia8::Event eventProcessOrig
 
bool exclusive
 
int exclusiveMode
 
int jetAlgorithm
 
int jetAllow
 
int jetMatch
 
vector< Pythia8::Vec4jetMomenta
 
int nEta
 
int nJet
 
int nJetMax
 
int nPhi
 
Pythia8::SlowJet * slowJet
 
Pythia8::SlowJet * slowJetHard
 
int slowJetPower
 
vector< int > typeIdx [3]
 
set< int > typeSet [3]
 
Pythia8::Event workEventJet
 
- Static Protected Attributes inherited from JetMatching
static const bool MATCHINGCHECK = false
 
static const bool MATCHINGDEBUG = false
 

Detailed Description

Definition at line 132 of file JetMatchingPy8Internal.h.

Constructor & Destructor Documentation

JetMatchingAlpgen::JetMatchingAlpgen ( )
inline

Definition at line 137 of file JetMatchingPy8Internal.h.

137 { }
JetMatchingAlpgen::~JetMatchingAlpgen ( )
inline

Definition at line 138 of file JetMatchingPy8Internal.h.

138 { }

Member Function Documentation

bool JetMatchingAlpgen::initAfterBeams ( )
virtual

Implements JetMatching.

Definition at line 155 of file JetMatchingPy8Internal.cc.

References gather_cfg::cout, and dtDQMClient_cfg::resolution.

Referenced by JetMatchingAlpgenInputAlpgen::initAfterBeams().

155  {
156 
157  // Read in parameters
158  doMerge = settingsPtr->flag("JetMatching:merge");
159  jetAlgorithm = settingsPtr->mode("JetMatching:jetAlgorithm");
160  nJet = settingsPtr->mode("JetMatching:nJet");
161  nJetMax = settingsPtr->mode("JetMatching:nJetMax");
162  eTjetMin = settingsPtr->parm("JetMatching:eTjetMin");
163  coneRadius = settingsPtr->parm("JetMatching:coneRadius");
164  etaJetMax = settingsPtr->parm("JetMatching:etaJetMax");
165 
166  // Use etaJetMax + coneRadius in input to jet algorithms
168 
169  // CellJet specific
170  nEta = settingsPtr->mode("JetMatching:nEta");
171  nPhi = settingsPtr->mode("JetMatching:nPhi");
172  eTseed = settingsPtr->parm("JetMatching:eTseed");
173  eTthreshold = settingsPtr->parm("JetMatching:eTthreshold");
174 
175  // SlowJet specific
176  slowJetPower = settingsPtr->mode("JetMatching:slowJetPower");
177  coneMatchLight = settingsPtr->parm("JetMatching:coneMatchLight");
178  coneRadiusHeavy = settingsPtr->parm("JetMatching:coneRadiusHeavy");
180  coneMatchHeavy = settingsPtr->parm("JetMatching:coneMatchHeavy");
181 
182  // Matching procedure
183  jetAllow = settingsPtr->mode("JetMatching:jetAllow");
184  jetMatch = settingsPtr->mode("JetMatching:jetMatch");
185  exclusiveMode = settingsPtr->mode("JetMatching:exclusive");
186 
187  // If not merging, then done
188  if (!doMerge) return true;
189 
190  // Exclusive mode; if set to 2, then set based on nJet/nJetMax
191  if (exclusiveMode == 2) {
192 
193  // No nJet or nJetMax, so default to exclusive mode
194  if (nJet < 0 || nJetMax < 0) {
195  infoPtr->errorMsg("Warning in JetMatchingAlpgen:init: "
196  "missing jet multiplicity information; running in exclusive mode");
197  exclusive = true;
198 
199  // Inclusive if nJet == nJetMax, exclusive otherwise
200  } else {
201  exclusive = (nJet == nJetMax) ? false : true;
202  }
203 
204  // Otherwise, just set as given
205  } else {
206  exclusive = (exclusiveMode == 0) ? false : true;
207  }
208 
209  // Initialise chosen jet algorithm. CellJet.
210  if (jetAlgorithm == 1) {
211 
212  // Extra options for CellJet. nSel = 1 means that all final-state
213  // particles are taken and we retain control of what to select.
214  // smear/resolution/upperCut are not used and are set to default values.
215  int nSel = 2, smear = 0;
216  double resolution = 0.5, upperCut = 2.;
217  cellJet = new CellJet(etaJetMaxAlgo, nEta, nPhi, nSel,
218  smear, resolution, upperCut, eTthreshold);
219 
220  // SlowJet
221  } else if (jetAlgorithm == 2) {
222  slowJet = new SlowJet(slowJetPower, coneRadius, eTjetMin, etaJetMaxAlgo);
223  }
224 
225  // Check the jetMatch parameter; option 2 only works with SlowJet
226  if (jetAlgorithm == 1 && jetMatch == 2) {
227  infoPtr->errorMsg("Warning in JetMatchingAlpgen:init: "
228  "jetMatch = 2 only valid with SlowJet algorithm. "
229  "Reverting to jetMatch = 1");
230  jetMatch = 1;
231  }
232 
233  // Setup local event records
234  eventProcessOrig.init("(eventProcessOrig)", particleDataPtr);
235  eventProcess.init("(eventProcess)", particleDataPtr);
236  workEventJet.init("(workEventJet)", particleDataPtr);
237 
238  // Print information
239  string jetStr = (jetAlgorithm == 1) ? "CellJet" :
240  (slowJetPower == -1) ? "anti-kT" :
241  (slowJetPower == 0) ? "C/A" :
242  (slowJetPower == 1) ? "kT" : "unknown";
243  string modeStr = (exclusive) ? "exclusive" : "inclusive";
244  stringstream nJetStr, nJetMaxStr;
245  if (nJet >= 0) nJetStr << nJet; else nJetStr << "unknown";
246  if (nJetMax >= 0) nJetMaxStr << nJetMax; else nJetMaxStr << "unknown";
247  cout << endl
248  << " *------- MLM matching parameters -------*" << endl
249  << " | nJet | " << setw(14)
250  << nJetStr.str() << " |" << endl
251  << " | nJetMax | " << setw(14)
252  << nJetMaxStr.str() << " |" << endl
253  << " | Jet algorithm | " << setw(14)
254  << jetStr << " |" << endl
255  << " | eTjetMin | " << setw(14)
256  << eTjetMin << " |" << endl
257  << " | coneRadius | " << setw(14)
258  << coneRadius << " |" << endl
259  << " | etaJetMax | " << setw(14)
260  << etaJetMax << " |" << endl
261  << " | jetAllow | " << setw(14)
262  << jetAllow << " |" << endl
263  << " | jetMatch | " << setw(14)
264  << jetMatch << " |" << endl
265  << " | coneMatchLight | " << setw(14)
266  << coneMatchLight << " |" << endl
267  << " | coneRadiusHeavy | " << setw(14)
268  << coneRadiusHeavy << " |" << endl
269  << " | coneMatchHeavy | " << setw(14)
270  << coneMatchHeavy << " |" << endl
271  << " | Mode | " << setw(14)
272  << modeStr << " |" << endl
273  << " *-----------------------------------------*" << endl;
274 
275  return true;
276 }
Pythia8::Event eventProcess
Pythia8::Event workEventJet
Pythia8::SlowJet * slowJet
Pythia8::Event eventProcessOrig
Pythia8::CellJet * cellJet
tuple cout
Definition: gather_cfg.py:121
void JetMatchingAlpgen::jetAlgorithmInput ( const Pythia8::Event &  ,
int   
)
privatevirtual

Implements JetMatching.

Definition at line 330 of file JetMatchingPy8Internal.cc.

References funct::abs(), funct::cos(), alignCSCRings::e, end, create_public_lumi_plots::exp, spr::find(), i, customizeTrackingMonitorSeedNumber::idx, phi, RecoTauCleanerPlugins::pt, funct::sin(), findQualityFiles::size, mathSSE::sqrt(), and detailsBasic3DVector::y.

330  {
331 
332  // Take input from 'workEvent' and put output in 'workEventJet'
333  workEventJet = workEvent;
334 
335  // Loop over particles and decide what to pass to the jet algorithm
336  for (int i = 0; i < workEventJet.size(); ++i) {
337  if (!workEventJet[i].isFinal()) continue;
338 
339  // jetAllow option to disallow certain particle types
340  if (jetAllow == 1) {
341 
342  // Original AG+Py6 algorithm explicitly excludes tops,
343  // leptons and photons.
344  int id = workEventJet[i].idAbs();
345  if ( (id >= ID_LEPMIN && id <= ID_LEPMAX) || id == ID_TOP
346  || id == ID_PHOTON) {
347  workEventJet[i].statusNeg();
348  continue;
349  }
350  }
351 
352  // Get the index of this particle in original event
353  int idx = workEventJet[i].daughter1();
354 
355  // Start with particle idx, and afterwards track mothers
356  while (true) {
357 
358  // Light jets
359  if (iType == 0) {
360 
361  // Do not include if originates from heavy jet or 'other'
362  if (typeSet[1].find(idx) != typeSet[1].end() ||
363  typeSet[2].find(idx) != typeSet[2].end()) {
364  workEventJet[i].statusNeg();
365  break;
366  }
367 
368  // Made it to start of event record so done
369  if (idx == 0) break;
370  // Otherwise next mother and continue
371  idx = event[idx].mother1();
372 
373  // Heavy jets
374  } else if (iType == 1) {
375 
376  // Only include if originates from heavy jet
377  if (typeSet[1].find(idx) != typeSet[1].end()) break;
378 
379  // Made it to start of event record with no heavy jet mother,
380  // so DO NOT include particle
381  if (idx == 0) {
382  workEventJet[i].statusNeg();
383  break;
384  }
385 
386  // Otherwise next mother and continue
387  idx = event[idx].mother1();
388 
389  } // if (iType)
390  } // while (true)
391  } // for (i)
392 
393  // For jetMatch = 2, insert ghost particles corresponding to
394  // each hard parton in the original process
395  if (jetMatch == 2) {
396  for (int i = 0; i < int(typeIdx[iType].size()); i++) {
397  // Get y/phi of the parton
398  Vec4 pIn = eventProcess[typeIdx[iType][i]].p();
399  double y = pIn.rap();
400  double phi = pIn.phi();
401 
402  // Create a ghost particle and add to the workEventJet
403  double e = GHOSTENERGY;
404  double e2y = exp(2. * y);
405  double pz = e * (e2y - 1.) / (e2y + 1.);
406  double pt = sqrt(e*e - pz*pz);
407  double px = pt * cos(phi);
408  double py = pt * sin(phi);
409  workEventJet.append( ID_GLUON, 99, 0, 0, 0, 0, 0, 0, px, py, pz, e);
410 
411  // Extra check on reconstructed y/phi values. If many warnings
412  // of this type, GHOSTENERGY may be set too low.
413  if (MATCHINGCHECK) {
414  int lastIdx = workEventJet.size() - 1;
415  if (abs(y - workEventJet[lastIdx].y()) > ZEROTHRESHOLD ||
416  abs(phi - workEventJet[lastIdx].phi()) > ZEROTHRESHOLD)
417  infoPtr->errorMsg("Warning in JetMatchingAlpgen:jetAlgorithmInput: "
418  "ghost particle y/phi mismatch");
419  }
420 
421  } // for (i)
422  } // if (jetMatch == 2)
423 }
int i
Definition: DBlmapReader.cc:9
Pythia8::Event eventProcess
Pythia8::Event workEventJet
ExtVec< T, 4 > Vec4
Definition: ExtVec.h:23
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define end
Definition: vmac.h:37
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
static const double ZEROTHRESHOLD
static const bool MATCHINGCHECK
set< int > typeSet[3]
vector< int > typeIdx[3]
tuple size
Write out results.
static const double GHOSTENERGY
Definition: DDAxes.h:10
bool JetMatchingAlpgen::matchPartonsToJets ( int  iType)
privatevirtual

Implements JetMatching.

Definition at line 463 of file JetMatchingPy8Internal.cc.

463  {
464 
465  // Use two different routines for light/heavy jets as
466  // different veto conditions and for clarity
467  if (iType == 0) return (matchPartonsToJetsLight() > 0);
468  else return (matchPartonsToJetsHeavy() > 0);
469 }
int JetMatchingAlpgen::matchPartonsToJetsHeavy ( )
privatevirtual

Implements JetMatching.

Definition at line 584 of file JetMatchingPy8Internal.cc.

References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, i, j, NONE, and p1.

584  {
585 
586  // If there are no extra jets, then accept
587  if (jetMomenta.empty()) return NONE;
588 
589  // Number of hard partons
590  int nParton = typeIdx[1].size();
591 
592  // Remove jets that are close to heavy quarks
593  set < int > removeJets;
594 
595  // Jet matching procedure: (1) deltaR between partons and jets
596  if (jetMatch == 1) {
597 
598  // Loop over heavy hard partons and get 4-momentum
599  for (int i = 0; i < nParton; i++) {
600  Vec4 p1 = eventProcess[typeIdx[1][i]].p();
601 
602  // Loop over all jets, find dR and mark for removal if match
603  for (int j = 0; j < int(jetMomenta.size()); j++) {
604  double dR = (jetAlgorithm == 1) ?
605  REtaPhi(p1, jetMomenta[j]) : RRapPhi(p1, jetMomenta[j]);
606  if (dR < coneRadiusHeavy * coneMatchHeavy)
607  removeJets.insert(j);
608 
609  } // for (j)
610  } // for (i)
611 
612  // Jet matching procedure: (2) ghost particles in SlowJet
613  } else {
614 
615  // Loop over added 'ghost' particles and if assigned to a jet
616  // then mark this jet for removal
617  for (int i = workEventJet.size() - nParton;
618  i < workEventJet.size(); i++) {
619  int jMin = slowJet->jetAssignment(i);
620  if (jMin >= 0) removeJets.insert(jMin);
621  }
622 
623  }
624 
625  // Remove jets (backwards order to not disturb indices)
626  for (set < int >::reverse_iterator it = removeJets.rbegin();
627  it != removeJets.rend(); it++)
628  jetMomenta.erase(jetMomenta.begin() + *it);
629 
630  // Handle case if there are still extra jets
631  if (!jetMomenta.empty()) {
632 
633  // Exclusive mode, so immediate veto
634  if (exclusive) return MORE_JETS;
635 
636  // Inclusive mode; extra jets must be softer than any matched light jet
637  else if (eTpTlightMin >= 0.)
638  for (size_t j = 0; j < jetMomenta.size(); j++) {
639  // CellJet uses eT, SlowJet uses pT
640  if ( (jetAlgorithm == 1 && jetMomenta[j].eT() > eTpTlightMin) ||
641  (jetAlgorithm == 2 && jetMomenta[j].pT() > eTpTlightMin) )
642  return HARD_JET;
643  }
644 
645  } // if (!jetMomenta.empty())
646 
647  // No extra jets were present so no veto
648  return NONE;
649 }
int i
Definition: DBlmapReader.cc:9
Pythia8::Event eventProcess
Pythia8::Event workEventJet
ExtVec< T, 4 > Vec4
Definition: ExtVec.h:23
Pythia8::SlowJet * slowJet
int j
Definition: DBlmapReader.cc:9
double p1[4]
Definition: TauolaWrapper.h:89
vector< int > typeIdx[3]
vector< Pythia8::Vec4 > jetMomenta
int JetMatchingAlpgen::matchPartonsToJetsLight ( )
privatevirtual

Implements JetMatching.

Definition at line 484 of file JetMatchingPy8Internal.cc.

References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, i, j, NONE, and p1.

484  {
485 
486  // Always veto if number of jets is less than original number of jets
487  if (jetMomenta.size() < typeIdx[0].size()) return LESS_JETS;
488  // Veto if in exclusive mode and number of jets bigger than original
489  if (exclusive && jetMomenta.size() > typeIdx[0].size()) return MORE_JETS;
490 
491  // Sort partons by eT/pT
492  sortTypeIdx(typeIdx[0]);
493 
494  // Number of hard partons
495  int nParton = typeIdx[0].size();
496 
497  // Keep track of which jets have been assigned a hard parton
498  vector < bool > jetAssigned;
499  jetAssigned.assign(jetMomenta.size(), false);
500 
501  // Jet matching procedure: (1) deltaR between partons and jets
502  if (jetMatch == 1) {
503 
504  // Loop over light hard partons and get 4-momentum
505  for (int i = 0; i < nParton; i++) {
506  Vec4 p1 = eventProcess[typeIdx[0][i]].p();
507 
508  // Track which jet has the minimal dR measure with this parton
509  int jMin = -1;
510  double dRmin = 0.;
511 
512  // Loop over all jets (skipping those already assigned).
513  for (int j = 0; j < int(jetMomenta.size()); j++) {
514  if (jetAssigned[j]) continue;
515 
516  // DeltaR between parton/jet and store if minimum
517  double dR = (jetAlgorithm == 1)
518  ? REtaPhi(p1, jetMomenta[j]) : RRapPhi(p1, jetMomenta[j]);
519  if (jMin < 0 || dR < dRmin) {
520  dRmin = dR;
521  jMin = j;
522  }
523  } // for (j)
524 
525  // Check for jet-parton match
526  if (jMin >= 0 && dRmin < coneRadius * coneMatchLight) {
527 
528  // If the matched jet is not one of the nParton hardest jets,
529  // the extra left over jet would be harder than some of the
530  // matched jets. This is disallowed, so veto.
531  if (jMin >= nParton) return HARD_JET;
532 
533  // Mark jet as assigned.
534  jetAssigned[jMin] = true;
535 
536  // If no match, then event will be vetoed in all cases
537  } else return UNMATCHED_PARTON;
538 
539  } // for (i)
540 
541  // Jet matching procedure: (2) ghost particles in SlowJet
542  } else {
543 
544  // Loop over added 'ghost' particles and find if assigned to a jet
545  for (int i = workEventJet.size() - nParton;
546  i < workEventJet.size(); i++) {
547  int jMin = slowJet->jetAssignment(i);
548 
549  // Veto if:
550  // 1) not one of nParton hardest jets
551  // 2) not assigned to a jet
552  // 3) jet has already been assigned
553  if (jMin >= nParton) return HARD_JET;
554  if (jMin < 0 || jetAssigned[jMin]) return UNMATCHED_PARTON;
555 
556  // Mark jet as assigned
557  jetAssigned[jMin] = true;
558 
559  } // for (i)
560  } // if (jetMatch)
561 
562  // Minimal eT/pT (CellJet/SlowJet) of matched light jets. Needed
563  // later for heavy jet vetos in inclusive mode.
564  if (nParton > 0)
565  eTpTlightMin = (jetAlgorithm == 1) ? jetMomenta[nParton - 1].eT()
566  : jetMomenta[nParton - 1].pT();
567  else
568  eTpTlightMin = -1.;
569 
570  // No veto
571  return NONE;
572 }
int i
Definition: DBlmapReader.cc:9
Pythia8::Event eventProcess
Pythia8::Event workEventJet
ExtVec< T, 4 > Vec4
Definition: ExtVec.h:23
Pythia8::SlowJet * slowJet
void sortTypeIdx(vector< int > &vecIn)
int j
Definition: DBlmapReader.cc:9
double p1[4]
Definition: TauolaWrapper.h:89
vector< int > typeIdx[3]
vector< Pythia8::Vec4 > jetMomenta
void JetMatchingAlpgen::runJetAlgorithm ( )
privatevirtual

Implements JetMatching.

Definition at line 429 of file JetMatchingPy8Internal.cc.

References funct::abs(), eta(), and i.

429  {
430 
431  // Run the jet clustering algorithm
432  if (jetAlgorithm == 1)
434  else
435  slowJet->analyze(workEventJet);
436 
437  // Extract four-momenta of jets with |eta| < etaJetMax and
438  // put into jetMomenta. Note that this is done backwards as
439  // jets are removed with SlowJet.
440  jetMomenta.clear();
441  int iJet = (jetAlgorithm == 1) ? cellJet->size() - 1:
442  slowJet->sizeJet() - 1;
443  for (int i = iJet; i > -1; i--) {
444  Vec4 jetMom = (jetAlgorithm == 1) ? cellJet->pMassive(i) :
445  slowJet->p(i);
446  double eta = jetMom.eta();
447 
448  if (abs(eta) > etaJetMax) {
449  if (jetAlgorithm == 2) slowJet->removeJet(i);
450  continue;
451  }
452  jetMomenta.push_back(jetMom);
453  }
454 
455  // Reverse jetMomenta to restore eT/pT ordering
456  reverse(jetMomenta.begin(), jetMomenta.end());
457 }
int i
Definition: DBlmapReader.cc:9
Pythia8::Event workEventJet
ExtVec< T, 4 > Vec4
Definition: ExtVec.h:23
Pythia8::SlowJet * slowJet
T eta() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Pythia8::CellJet * cellJet
vector< Pythia8::Vec4 > jetMomenta
void JetMatchingAlpgen::sortIncomingProcess ( const Pythia8::Event &  )
privatevirtual

Implements JetMatching.

Definition at line 282 of file JetMatchingPy8Internal.cc.

References funct::abs(), i, customizeTrackingMonitorSeedNumber::idx, and m.

282  {
283 
284  // Remove resonance decays from original process and keep only final
285  // state. Resonances will have positive status code after this step.
286  omitResonanceDecays(eventProcessOrig, true);
287  eventProcess = workEvent;
288 
289  // Sort original process final state into light/heavy jets and 'other'.
290  // Criteria:
291  // 1 <= ID <= 5 and massless, or ID == 21 --> light jet (typeIdx[0])
292  // 4 <= ID <= 6 and massive --> heavy jet (typeIdx[1])
293  // All else --> other (typeIdx[2])
294  // Note that 'typeIdx' stores indices into 'eventProcess' (after resonance
295  // decays are omitted), while 'typeSet' stores indices into the original
296  // process record, 'eventProcessOrig', but these indices are also valid
297  // in 'event'.
298  for (int i = 0; i < 3; i++) {
299  typeIdx[i].clear();
300  typeSet[i].clear();
301  }
302  for (int i = 0; i < eventProcess.size(); i++) {
303  // Ignore nonfinal and default to 'other'
304  if (!eventProcess[i].isFinal()) continue;
305  int idx = 2;
306 
307  // Light jets
308  if (eventProcess[i].id() == ID_GLUON
309  || (eventProcess[i].idAbs() <= ID_BOT
310  && abs(eventProcess[i].m()) < ZEROTHRESHOLD)) idx = 0;
311 
312  // Heavy jets
313  else if (eventProcess[i].idAbs() >= ID_CHARM
314  && eventProcess[i].idAbs() <= ID_TOP) idx = 1;
315 
316  // Store
317  typeIdx[idx].push_back(i);
318  typeSet[idx].insert(eventProcess[i].daughter1());
319  }
320 
321  // Extract partons from hardest subsystem + ISR + FSR only into
322  // workEvent. Note no resonance showers or MPIs.
323  subEvent(event);
324 }
int i
Definition: DBlmapReader.cc:9
Pythia8::Event eventProcess
Pythia8::Event eventProcessOrig
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
static const double ZEROTHRESHOLD
set< int > typeSet[3]
vector< int > typeIdx[3]
void JetMatchingAlpgen::sortTypeIdx ( vector< int > &  vecIn)
private

Definition at line 132 of file JetMatchingPy8Internal.cc.

References i, j, and swap().

132  {
133  for (size_t i = 0; i < vecIn.size(); i++) {
134  size_t jMax = i;
135  double vMax = (jetAlgorithm == 1) ?
136  eventProcess[vecIn[i]].eT() :
137  eventProcess[vecIn[i]].pT();
138  for (size_t j = i + 1; j < vecIn.size(); j++) {
139  double vNow = (jetAlgorithm == 1)
140  ? eventProcess[vecIn[j]].eT() : eventProcess[vecIn[j]].pT();
141  if (vNow > vMax) {
142  vMax = vNow;
143  jMax = j;
144  }
145  }
146  if (jMax != i) swap(vecIn[i], vecIn[jMax]);
147  }
148 }
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
int i
Definition: DBlmapReader.cc:9
Pythia8::Event eventProcess
int j
Definition: DBlmapReader.cc:9

Member Data Documentation

const double JetMatchingAlpgen::GHOSTENERGY = 1e-15
staticprivate

Definition at line 157 of file JetMatchingPy8Internal.h.

const double JetMatchingAlpgen::ZEROTHRESHOLD = 1e-10
staticprivate

Definition at line 157 of file JetMatchingPy8Internal.h.