CMS 3D CMS Logo

Namespaces | Functions | Variables
fastjetfortran_madfks.cc File Reference
#include <iostream>
#include "fastjet/ClusterSequence.hh"
#include "fastjet/ClusterSequenceArea.hh"
#include "fastjet/Selector.hh"
#include "fastjet/SISConePlugin.hh"

Go to the source code of this file.

Namespaces

 fwrapper
 

Functions

double fastjetarea_ (const int &ijet)
 
void fastjetconstituents_ (const int &ijet, int *constituent_indices, int &nconstituents)
 
double fastjetdmerge_ (const int &n)
 
double fastjetdmergemax_ (const int &n)
 
void fastjetglobalrhoandsigma_ (const double &rapmin, const double &rapmax, const double &phimin, const double &phimax, double &rho, double &sigma, double &meanarea)
 
void fastjetppgenkt_ (const double *p, const int &npart, const double &R, const double &ptjetmin, const double &palg, double *f77jets, int &njets, int *whichjet)
 
void fastjetppgenktwitharea_ (const double *p, const int &npart, const double &R, const double &palg, const double &ghost_rapmax, const int &nrepeat, const double &ghost_area, double *f77jets, int &njets, int *whichjet)
 
void fastjetsiscone_ (const double *p, const int &npart, const double &R, const double &f, double *f77jets, int &njets, int *whichjet)
 
void fastjetsisconewitharea_ (const double *p, const int &npart, const double &R, const double &f, const double &ghost_rapmax, const int &nrepeat, const double &ghost_area, double *f77jets, int &njets, int *whichjet)
 
void fwrapper::transfer_cluster_transfer (const double *p, const int &npart, const JetDefinition &jet_def, const double &ptmin, double *f77jets, int &njets, int *whichjet, const double &ghost_maxrap=0.0, const int &nrepeat=0, const double &ghost_area=0.0)
 
void fwrapper::transfer_input_particles (const double *p, const int &npart)
 helper routine to transfer fortran input particles into More...
 
void fwrapper::transfer_jets (double *f77jets, int &njets)
 helper routine to help transfer jets -> f77jets[4*ijet+0..3] More...
 

Variables

unique_ptr< ClusterSequence > fwrapper::cs
 
vector< PseudoJet > fwrapper::input_particles
 
JetDefinition fwrapper::jet_def
 
vector< PseudoJet > fwrapper::jets
 
unique_ptr< JetDefinition::Plugin > fwrapper::plugin
 

Function Documentation

◆ fastjetarea_()

double fastjetarea_ ( const int &  ijet)

f77 interface to provide access to the area of a jet found in the jet clustering with one of the above "...witharea" routines.

Given the index ijet of a jet (in the range 1...njets) obtained in the last call to jet clustering, return its area. If the jets have not been obtained with a "...witharea" soutine it returns 0.

Definition at line 386 of file fastjetfortran_madfks.cc.

386  {
387  assert(ijet > 0 && ijet <= int(jets.size()));
388  const ClusterSequenceAreaBase * csab =
389  dynamic_cast<const ClusterSequenceAreaBase *>(cs.get());
390  if (csab != nullptr) {
391  // we have areas and can use csab to access all the area-related info
392  return csab->area(jets[ijet-1]);
393  } else {
394  return 0.;
395 // Error("No area information associated to this jet.");
396  }
397 }

References cms::cuda::assert(), fwrapper::cs, and fwrapper::jets.

◆ fastjetconstituents_()

void fastjetconstituents_ ( const int &  ijet,
int *  constituent_indices,
int &  nconstituents 
)

f77 interface to provide access to the constituents of a jet found in the jet clustering with one of the above routines.

Given the index ijet of a jet (in the range 1...njets) obtained in the last call to jet clustering, fill the array constituent_indices, with nconstituents entries, with the indices of the constituents that belong to that jet (which will be in the range 1...npart)

Definition at line 358 of file fastjetfortran_madfks.cc.

359  {
360  assert(cs.get() != nullptr);
361  assert(ijet > 0 && ijet <= int(jets.size()));
362 
363  vector<PseudoJet> constituents = cs->constituents(jets[ijet-1]);
364 
365  nconstituents = constituents.size();
366  for (int i = 0; i < nconstituents; i++) {
367  constituent_indices[i] = constituents[i].cluster_hist_index()+1;
368  }
369 }

References cms::cuda::assert(), fwrapper::cs, mps_fire::i, and fwrapper::jets.

◆ fastjetdmerge_()

double fastjetdmerge_ ( const int &  n)

return the dmin corresponding to the recombination that went from n+1 to n jets (sometimes known as d_{n n+1}).

Definition at line 409 of file fastjetfortran_madfks.cc.

409  {
410  assert(cs.get() != nullptr);
411  return cs->exclusive_dmerge(n);
412 }

References cms::cuda::assert(), fwrapper::cs, and dqmiodumpmetadata::n.

◆ fastjetdmergemax_()

double fastjetdmergemax_ ( const int &  n)

return the maximum of the dmin encountered during all recombinations up to the one that led to an n-jet final state; identical to exclusive_dmerge, except in cases where the dmin do not increase monotonically.

Definition at line 426 of file fastjetfortran_madfks.cc.

426  {
427  assert(cs.get() != nullptr);
428  return cs->exclusive_dmerge_max(n);
429 }

References cms::cuda::assert(), fwrapper::cs, and dqmiodumpmetadata::n.

◆ fastjetglobalrhoandsigma_()

void fastjetglobalrhoandsigma_ ( const double &  rapmin,
const double &  rapmax,
const double &  phimin,
const double &  phimax,
double &  rho,
double &  sigma,
double &  meanarea 
)

return the background transverse momentum density per unit scalar area rho, its fluctuation sigma, and the mean area of the jets used for the background estimation in a given event, as evaluated in the range [rapmin,rapmax] in rapidity and [phimin,phimax] in azimuth

Definition at line 443 of file fastjetfortran_madfks.cc.

445  {
446  const ClusterSequenceAreaBase * csab =
447  dynamic_cast<const ClusterSequenceAreaBase *>(cs.get());
448  if (csab != nullptr) {
449  // we have areas and can use csab to access all the area-related info
450  Selector range = SelectorRapRange(rapmin,rapmax) && SelectorPhiRange(phimin,phimax);
451  bool use_area_4vector = false;
452  csab->get_median_rho_and_sigma(range,use_area_4vector,rho,sigma,meanarea);
453  } else {
454  Error("Clustering with area is necessary in order to be able to evaluate rho.");
455  }
456 }

References fwrapper::cs, phimax, phimin, and FastTimerService_cff::range.

◆ fastjetppgenkt_()

void fastjetppgenkt_ ( const double *  p,
const int &  npart,
const double &  R,
const double &  ptjetmin,
const double &  palg,
double *  f77jets,
int &  njets,
int *  whichjet 
)

f77 interface to the pp generalised-kt (sequential recombination) algorithms, as defined in arXiv.org:0802.1189, which includes kt, Cambridge/Aachen and anti-kt as special cases.

Definition at line 257 of file fastjetfortran_madfks.cc.

260  {
261 
262  // prepare jet def
263  if (palg == 1.0) {
264  jet_def = JetDefinition(kt_algorithm, R);
265  } else if (palg == 0.0) {
266  jet_def = JetDefinition(cambridge_algorithm, R);
267  } else if (palg == -1.0) {
268  jet_def = JetDefinition(antikt_algorithm, R);
269  } else {
270  jet_def = JetDefinition(genkt_algorithm, R, palg);
271  }
272 
273  // do everything
274  transfer_cluster_transfer(p,npart,jet_def,ptjetmin,f77jets,njets,whichjet);
275 }

References fwrapper::jet_def, BTaggingMonitoring_cff::njets, npart, AlCaHLTBitMon_ParallelJobs::p, dttmaxenums::R, and fwrapper::transfer_cluster_transfer().

◆ fastjetppgenktwitharea_()

void fastjetppgenktwitharea_ ( const double *  p,
const int &  npart,
const double &  R,
const double &  palg,
const double &  ghost_rapmax,
const int &  nrepeat,
const double &  ghost_area,
double *  f77jets,
int &  njets,
int *  whichjet 
)

f77 interface to the pp generalised-kt (sequential recombination) algorithms, as defined in arXiv.org:0802.1189, which includes kt, Cambridge/Aachen and anti-kt as special cases. Also calculates the active area of the jets, as defined in
arXiv.org:0802.1188

Definition at line 320 of file fastjetfortran_madfks.cc.

323  {
324 
325  // prepare jet def
326  if (palg == 1.0) {
327  jet_def = JetDefinition(kt_algorithm, R);
328  } else if (palg == 0.0) {
329  jet_def = JetDefinition(cambridge_algorithm, R);
330  } else if (palg == -1.0) {
331  jet_def = JetDefinition(antikt_algorithm, R);
332  } else {
333  jet_def = JetDefinition(genkt_algorithm, R, palg);
334  }
335 
336  // do everything
337 // transfer_cluster_transfer(p,npart,jet_def,f77jets,njets,whichjet,ghost_rapmax,nrepeat,ghost_area);
338 }

References fwrapper::jet_def, and dttmaxenums::R.

◆ fastjetsiscone_()

void fastjetsiscone_ ( const double *  p,
const int &  npart,
const double &  R,
const double &  f,
double *  f77jets,
int &  njets,
int *  whichjet 
)

f77 interface to SISCone (via fastjet), as defined in arXiv:0704.0292 [see below for the interface to kt, Cam/Aachen & kt]

Definition at line 156 of file fastjetfortran_madfks.cc.

158  {
159 
160  // prepare jet def
161  plugin.reset(new SISConePlugin(R,f));
162  jet_def = plugin.get();
163 
164  // do everything
165 // transfer_cluster_transfer(p,npart,jet_def,f77jets,njets,whichjet);
166 }

References f, fwrapper::jet_def, fwrapper::plugin, and dttmaxenums::R.

◆ fastjetsisconewitharea_()

void fastjetsisconewitharea_ ( const double *  p,
const int &  npart,
const double &  R,
const double &  f,
const double &  ghost_rapmax,
const int &  nrepeat,
const double &  ghost_area,
double *  f77jets,
int &  njets,
int *  whichjet 
)

f77 interface to SISCone (via fastjet), as defined in arXiv:0704.0292 [see below for the interface to kt, Cam/Aachen & kt] Also calculates the active area of the jets, as defined in
arXiv.org:0802.1188

Definition at line 205 of file fastjetfortran_madfks.cc.

208  {
209 
210  // prepare jet def
211  plugin.reset(new SISConePlugin(R,f));
212  jet_def = plugin.get();
213 
214  // do everything
215 // transfer_cluster_transfer(p,npart,jet_def,f77jets,njets,whichjet,ghost_rapmax,nrepeat,ghost_area);
216 }

References f, fwrapper::jet_def, fwrapper::plugin, and dttmaxenums::R.

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
Selector
Functor that operates on <T>
Definition: Selector.h:22
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:45
phimin
float phimin
Definition: ReggeGribovPartonMCHadronizer.h:107
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ZElectronSkim_cff.rho
rho
Definition: ZElectronSkim_cff.py:38
cms::cuda::assert
assert(be >=bs)
npart
double npart
Definition: HydjetWrapper.h:46
leef::Error
edm::ErrorSummaryEntry Error
Definition: LogErrorEventFilter.cc:29
fwrapper::jet_def
JetDefinition jet_def
Definition: fastjetfortran_madfks.cc:44
fwrapper::plugin
unique_ptr< JetDefinition::Plugin > plugin
Definition: fastjetfortran_madfks.cc:43
phimax
float phimax
Definition: ReggeGribovPartonMCHadronizer.h:106
BTaggingMonitoring_cff.njets
njets
Definition: BTaggingMonitoring_cff.py:10
fwrapper::transfer_cluster_transfer
void transfer_cluster_transfer(const double *p, const int &npart, const JetDefinition &jet_def, const double &ptmin, double *f77jets, int &njets, int *whichjet, const double &ghost_maxrap=0.0, const int &nrepeat=0, const double &ghost_area=0.0)
Definition: fastjetfortran_madfks.cc:79
dttmaxenums::R
Definition: DTTMax.h:29
fwrapper::jets
vector< PseudoJet > jets
Definition: fastjetfortran_madfks.cc:42