CMS 3D CMS Logo

Functions | Variables
fwrapper Namespace Reference

Functions

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)
 
void transfer_input_particles (const double *p, const int &npart)
 helper routine to transfer fortran input particles into More...
 
void transfer_jets (double *f77jets, int &njets)
 helper routine to help transfer jets -> f77jets[4*ijet+0..3] More...
 

Variables

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

Detailed Description

a namespace for the fortran-wrapper which contains commonly-used structures and means to transfer fortran <-> C++

Function Documentation

◆ transfer_cluster_transfer()

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 
)

helper routine packaging the transfers, the clustering and the extraction of the jets

Definition at line 81 of file fastjetfortran_madfks.cc.

90  {
91  // transfer p[4*ipart+0..3] -> input_particles[i]
93 
94  // perform the clustering
95  if (ghost_maxrap == 0.0) {
96  // cluster without areas
97  cs = std::make_unique<ClusterSequence>(input_particles, jet_def);
98  } else {
99  // cluster with areas
100  GhostedAreaSpec area_spec(ghost_maxrap, nrepeat, ghost_area);
101  AreaDefinition area_def(active_area, area_spec);
102  cs = std::make_unique<ClusterSequenceArea>(input_particles, jet_def, area_def);
103  }
104  // extract jets (pt-ordered)
105  jets = sorted_by_pt(cs->inclusive_jets(ptmin));
106 
107  // transfer jets -> f77jets[4*ijet+0..3]
108  transfer_jets(f77jets, njets);
109 
110  // Determine which parton/particle ended-up in which jet
111  // set all jet entrie to zero first
112  for (int ii = 0; ii < npart; ++ii)
113  whichjet[ii] = 0;
114 
115  // Loop over jets and find constituents
116  for (int kk = 0; kk < njets; ++kk) {
117  vector<PseudoJet> constit = cs->constituents(jets[kk]);
118  for (unsigned int ll = 0; ll < constit.size(); ++ll)
119  whichjet[constit[ll].user_index()] = kk + 1;
120  }
121  }

References cs, cuy::ii, input_particles, jet_def, jets, GetRecoTauVFromDQM_MC_cff::kk, BTaggingMonitoring_cff::njets, npart, AlCaHLTBitMon_ParallelJobs::p, ptmin, transfer_input_particles(), and transfer_jets().

Referenced by fastjetppgenkt_().

◆ transfer_input_particles()

void fwrapper::transfer_input_particles ( const double *  p,
const int &  npart 
)

helper routine to transfer fortran input particles into

Definition at line 50 of file fastjetfortran_madfks.cc.

50  {
51  input_particles.resize(0);
52  input_particles.reserve(npart);
53  for (int i = 0; i < npart; i++) {
54  valarray<double> mom(4); // mom[0..3]
55  for (int j = 0; j <= 3; j++) {
56  mom[j] = *(p++);
57  // RF-MZ: reorder the arguments because in madfks energy goes first; in fastjet last.
58  // mom[(j+3) % 4] = *(p++);
59  }
60  PseudoJet psjet(mom);
61  psjet.set_user_index(i);
62  input_particles.push_back(psjet);
63  }
64  }

References mps_fire::i, input_particles, dqmiolumiharvest::j, npart, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by transfer_cluster_transfer().

◆ transfer_jets()

void fwrapper::transfer_jets ( double *  f77jets,
int &  njets 
)

helper routine to help transfer jets -> f77jets[4*ijet+0..3]

Definition at line 67 of file fastjetfortran_madfks.cc.

67  {
68  njets = jets.size();
69  for (int i = 0; i < njets; i++) {
70  for (int j = 0; j <= 3; j++) {
71  *f77jets = jets[i][j];
72  // RF-MZ: reorder the arguments because in madfks energy goes first; in fastjet last.
73  //*f77jets = jets[i][(j+3) % 4];
74  f77jets++;
75  }
76  }
77  }

References mps_fire::i, dqmiolumiharvest::j, jets, and BTaggingMonitoring_cff::njets.

Referenced by transfer_cluster_transfer().

Variable Documentation

◆ cs

unique_ptr<ClusterSequence> fwrapper::cs

Definition at line 47 of file fastjetfortran_madfks.cc.

Referenced by PedestalTask::_dump(), RawTask::_process(), DigiTask::_process(), cond::DataProxyWrapperBase::addInfo(), ESElectronicsSim::analogToDigital(), ESElectronicsSimFast::analogToDigital(), HcalAmplifier::applyQIEdelay(), BeamSpotToCUDA::beginStream(), DigiTask::bookHistograms(), CSCGeometryBuilder::build(), CAHitNtupletGeneratorOnGPU::CAHitNtupletGeneratorOnGPU(), CmsShowCommonPopup::changeGeomColor(), CmsShowCommonPopup::changeSelectionColorSet(), CmsShowModelPopup::clicked(), Qjets::Cluster(), Qjets::computeDCut(), Qjets::ComputeNewDistanceMeasures(), XrdAdaptor::XrdStatisticsService::condorUpdate(), edmNew::copyDetSetRange(), PFClusterEMEnergyCorrector::correctEnergies(), HcalTimeSlewSim::delay(), ESElectronicsSim::digitalToAnalog(), edm::CosMuoGenProducer::endRunProduce(), CSCStripTopology::equationOfStrip(), fastjetarea_(), fastjetconstituents_(), fastjetdmerge_(), fastjetdmergemax_(), fastjetglobalrhoandsigma_(), FFTJetPatRecoProducer::FFTJetPatRecoProducer(), LHEJetFilter::filter(), EcalDeadCellBoundaryEnergyFilter::filter(), gen::Pythia6Hadronizer::finalizeEvent(), LagrangeParentParticleFitter::fit(), KinematicParticleFitter::fit(), KinematicConstrainedVertexFitter::fit(), KinematicConstrainedVertexFitterT< nTrk, nConstraint >::fit(), AnomalousECALVariables::isDeadEcalCluster(), DataProxyWrapper< ExDwarfListRcd, cond::persistency::KeyList >::lateInit(), GEMStripTopology::localError(), TkRadialStripTopology::localError(), CSCRadialStripTopology::localError(), GEMStripTopology::measurementError(), CSCRadialStripTopology::measurementError(), TkRadialStripTopology::measurementError(), cms::cuda::numberOfDevices(), combinedConstraintHelpers::PlaceValue< DIM >::operator()(), combinedConstraintHelpers::PlaceParDer< DIM, NTRK >::operator()(), combinedConstraintHelpers::PlacePosDer< DIM >::operator()(), l1t::ClusterShapes::operator+(), Model::printCocoaStatus(), HBHEPhase1Reconstructor::processData(), Qjets::Prune(), edm::DataFrameContainer::push_back(), HFPreRecAlgo::reconstruct(), HcalSimpleRecAlgoImpl::removePileup(), SubjetFilterAlgorithm::run(), QjetsPlugin::run_clustering(), edm::DataFrameContainer::set_back(), cscdqm::Configuration::setChamberCounterValue(), Model::setCocoaStatus(), HBHENegativeFlagSetter::setPulseShapeFlags(), gen::ExhumeHadronizer::statistics(), gen::Pythia6Hadronizer::statistics(), TestCUDAAnalyzerGPU::TestCUDAAnalyzerGPU(), transfer_cluster_transfer(), KinematicConstrainedVertexUpdator::update(), KinematicConstrainedVertexUpdatorT< nTrk, nConstraint >::update(), L1RCTProducer::updateFedVector(), and CAHitNtupletGeneratorOnGPU::~CAHitNtupletGeneratorOnGPU().

◆ input_particles

vector<PseudoJet> fwrapper::input_particles

Definition at line 44 of file fastjetfortran_madfks.cc.

Referenced by transfer_cluster_transfer(), and transfer_input_particles().

◆ jet_def

JetDefinition fwrapper::jet_def

◆ jets

vector<PseudoJet> fwrapper::jets

◆ plugin

unique_ptr<JetDefinition::Plugin> fwrapper::plugin
mps_fire.i
i
Definition: mps_fire.py:428
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:47
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
fwrapper::input_particles
vector< PseudoJet > input_particles
Definition: fastjetfortran_madfks.cc:44
npart
double npart
Definition: HydjetWrapper.h:46
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
fwrapper::transfer_jets
void transfer_jets(double *f77jets, int &njets)
helper routine to help transfer jets -> f77jets[4*ijet+0..3]
Definition: fastjetfortran_madfks.cc:67
fwrapper::jet_def
JetDefinition jet_def
Definition: fastjetfortran_madfks.cc:46
fwrapper::transfer_input_particles
void transfer_input_particles(const double *p, const int &npart)
helper routine to transfer fortran input particles into
Definition: fastjetfortran_madfks.cc:50
BTaggingMonitoring_cff.njets
njets
Definition: BTaggingMonitoring_cff.py:10
ptmin
double ptmin
Definition: HydjetWrapper.h:84
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
cuy.ii
ii
Definition: cuy.py:590
fwrapper::jets
vector< PseudoJet > jets
Definition: fastjetfortran_madfks.cc:44