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
void transfer_jets (double *f77jets, int &njets)
 helper routine to help transfer jets -> f77jets[4*ijet+0..3]

Variables

auto_ptr< ClusterSequence > cs
vector< PseudoJet > input_particles
JetDefinition jet_def
vector< PseudoJet > jets
auto_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

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 80 of file fastjetfortran_madfks.cc.

References cs, input_particles, jets, npart, transfer_input_particles(), and transfer_jets().

Referenced by fastjetppgenkt_().

                                                                                           {

    // transfer p[4*ipart+0..3] -> input_particles[i]
    transfer_input_particles(p, npart);

    // perform the clustering
    if ( ghost_maxrap == 0.0 ) {
         // cluster without areas
         cs.reset(new ClusterSequence(input_particles,jet_def));
    } else {
         // cluster with areas
         GhostedAreaSpec area_spec(ghost_maxrap,nrepeat,ghost_area);
         AreaDefinition area_def(active_area, area_spec);
         cs.reset(new ClusterSequenceArea(input_particles,jet_def,area_def));
    }
    // extract jets (pt-ordered)
    jets = sorted_by_pt(cs->inclusive_jets(ptmin));

    // transfer jets -> f77jets[4*ijet+0..3]
    transfer_jets(f77jets, njets);
 
    // Determine which parton/particle ended-up in which jet
    // set all jet entrie to zero first
    for(int ii=0; ii<npart; ++ii) whichjet[ii]=0;       

    // Loop over jets and find constituents
    for (int kk=0; kk<njets; ++kk) {   
      vector<PseudoJet> constit = cs->constituents(jets[kk]);
      for(unsigned int ll=0; ll<constit.size(); ++ll)
             whichjet[constit[ll].user_index()]=kk+1;
    }
    
  }
void fwrapper::transfer_input_particles ( const double *  p,
const int &  npart 
)

helper routine to transfer fortran input particles into

Definition at line 49 of file fastjetfortran_madfks.cc.

References i, input_particles, j, and npart.

Referenced by transfer_cluster_transfer().

                                                                     {
    input_particles.resize(0);
    input_particles.reserve(npart);
    for (int i=0; i<npart; i++) {
      valarray<double> mom(4); // mom[0..3]
      for (int j=0;j<=3; j++) {
         mom[j] = *(p++);
      // RF-MZ: reorder the arguments because in madfks energy goes first; in fastjet last.
        // mom[(j+3) % 4] = *(p++);
      }
      PseudoJet psjet(mom);
      psjet.set_user_index(i);
      input_particles.push_back(psjet);    
    }
  }
void fwrapper::transfer_jets ( double *  f77jets,
int &  njets 
)

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

Definition at line 66 of file fastjetfortran_madfks.cc.

References i, j, and jets.

Referenced by transfer_cluster_transfer().

                                                    {
    njets = jets.size();
    for (int i=0; i<njets; i++) {
      for (int j=0;j<=3; j++) {
        *f77jets = jets[i][j];
      // RF-MZ: reorder the arguments because in madfks energy goes first; in fastjet last.
        //*f77jets = jets[i][(j+3) % 4];
        f77jets++;
      } 
    }
  }

Variable Documentation

auto_ptr<ClusterSequence> fwrapper::cs
vector<PseudoJet> fwrapper::input_particles

Definition at line 43 of file fastjetfortran_madfks.cc.

Referenced by transfer_cluster_transfer(), and transfer_input_particles().

JetDefinition fwrapper::jet_def
vector<PseudoJet> fwrapper::jets

Definition at line 43 of file fastjetfortran_madfks.cc.

Referenced by TtFullHadKinFitter::addKinFitInfo(), TtSemiLepKinFitter::addKinFitInfo(), LHEAnalyzer::analyze(), TtSemiLepSignalSelMVATrainer::analyze(), JetPlotsExample< Jet >::analyze(), SusyDQM< Mu, Ele, Jet, Met >::analyze(), Rivet::CMS_2011_I930319::analyze(), Rivet::CMS_EWK_11_021::analyze(), TtSemiLepJetCombMVATrainer::analyze(), ResolutionCreator::analyze(), JetAnaPythia< Jet >::analyze(), HLTInclusiveVBFSource::analyze(), JetCorrectorOnTheFly< Jet >::analyze(), PatBasicAnalyzer::analyze(), cms::DiJetAnalyzer::analyze(), TkAlCaRecoMonitor::analyze(), JetCorExample< Jet >::analyze(), Rivet::MC_LES_HOUCHES_SYSTEMATICS_CMS::analyze(), PatZjetsJetAnalyzer::analyze(), FlavorJetCorrectionExample::analyze(), cms::ProducerAnalyzer::analyze(), PartonJetCorrectionExample::analyze(), QcdHighPtDQM::analyze(), PatJetAnalyzer::analyze(), myFastSimVal::analyze(), cms::GammaJetAnalysis::analyze(), PatBTagAnalyzer::analyze(), PatTopSelectionAnalyzer::analyze(), TtFullHadSignalSelMVATrainer::analyze(), CaloMCTruthTreeProducer::analyze(), TopJetAnalyzer::analyze(), TTbar_GenJetAnalyzer::analyze(), IsolatedTracksNxN::analyze(), DQMHcalDiJetsAlCaReco::analyze(), HLTTauDQML1Plotter::analyze(), TopValidation::analyze(), PFMCTruthTreeProducer::analyze(), GctFormatTranslateV35::blockToGctJetCandsAndCounts(), GctFormatTranslateV38::blockToGctJetCandsAndCounts(), GctFormatTranslateMCLegacy::blockToGctJetCandsAndCounts(), TtSemiLepHypGenMatch::buildHypo(), TtSemiLepHypGeom::buildHypo(), TtFullLepHypKinSolution::buildHypo(), TtSemiLepHypWMassMaxSumPt::buildHypo(), TtSemiLepHypWMassDeltaTopMass::buildHypo(), TtFullLepHypGenMatch::buildHypo(), TtSemiLepHypMaxSumPtWMass::buildHypo(), TtSemiLepHypMVADisc::buildHypo(), TtSemiLepHypothesis::buildHypo(), TtFullHadHypGenMatch::buildHypo(), AlignmentGlobalTrackSelector::checkIsolation(), AlignmentGlobalTrackSelector::checkJetCount(), TtSemiLepKinFitProducer< LeptonCollection >::doBTagging(), HLTTauRefProducer::doJets(), fastjetarea_(), fastjetconstituents_(), TopSingleLepton::MonitorEnsemble::fill(), TopHLTSingleLepton::MonitorEnsemble::fill(), TopDiLeptonOffline::MonitorEnsemble::fill(), EgammaProbeSelector::filter(), TrackingFailureFilter::filter(), HeavyChHiggsToTauNuSkim::filter(), HLTRHemisphere::filter(), JetIDFailureFilter::filter(), myFilter::filter(), pat::PATMHTProducer::getJets(), HLTJetSortedVBFFilter< T >::hltFilter(), HLTFiltCand::hltFilter(), HLTJetPairDzMatchFilter< T >::hltFilter(), HLTAlphaTFilter< T >::hltFilter(), HLTTauRefProducer::HLTTauRefProducer(), TtSemiLepHypothesis::isValid(), TtFullLepHypothesis::isValid(), TtFullHadHypothesis::isValid(), TtSemiLepJetCombGeom::isValid(), FFTJetProducer::iterateJetReconstruction(), main(), lhef::JetMatchingMLM::match(), TtDilepLRSignalSelObservables::operator()(), TtSemiLRJetCombObservables::operator()(), egHLT::EgJetTagProbeCut< T >::pass(), egHLT::EgJetB2BCut< T >::pass(), TtFullHadronicEvent::print(), TtSemiLeptonicEvent::print(), TtFullLeptonicEvent::print(), pat::JetCorrFactorsProducer::produce(), JetCrystalsAssociator::produce(), AnyJetToCaloJetProducer::produce(), TtSemiLepSignalSelMVAComputer::produce(), TtSemiLepJetCombWMassMaxSumPt::produce(), pat::xxxEventHypothesisProducer::produce(), HLTHtMhtProducer::produce(), HLTJetL1MatchProducer< T >::produce(), TtSemiEvtSolutionMaker::produce(), TtSemiLepJetCombMVAComputer::produce(), JetIdSelector< T >::produce(), PFJetMETcorrInputProducerT< T, Textractor >::produce(), pat::PATJetProducer::produce(), TtDilepEvtSolutionMaker::produce(), TtHadEvtSolutionMaker::produce(), TtSemiLepHypothesis::produce(), AlCaGammaJetProducer::produce(), ShiftedPFCandidateProducerForNoPileUpPFMEt::produce(), TtFullHadSignalSelMVAComputer::produce(), TtFullLepKinSolutionProducer::produce(), SmearedJetProducerT< T, Textractor >::produce(), TtSemiLepHitFitProducer< LeptonCollection >::produce(), CaloJetMETcorrInputProducerT< T, Textractor >::produce(), TtSemiLepJetCombWMassDeltaTopMass::produce(), RecoTauProducer::produce(), cms::SubEventGenJetProducer::produce(), cms::JetVertexAssociation::produce(), cms::JetCorrectionProducer< T >::produce(), SoftLepton::produce(), RecoTauJetRegionProducer::produce(), HiGenCleaner< T2 >::produce(), cms::AlCaDiJetsProducer::produce(), BoostedTopProducer::produce(), FastPrimaryVertexProducer::produce(), StEvtSolutionMaker::produce(), TtSemiLepJetCombGeom::produce(), TtJetPartonMatch< C >::produce(), RecoTauPiZeroFlattener::produce(), HLTMhtProducer::produce(), cms::METProducer::produce(), TtSemiLepKinFitProducer< LeptonCollection >::produce(), TtFullHadHypothesis::produce(), L2TauPixelIsoTagProducer::produce(), HiL1Subtractor::produce(), TtFullLepHypothesis::produce(), JetEnergyShift::produce(), TtSemiLepJetCombMaxSumPtWMass::produce(), TtFullHadKinFitProducer::produce(), FastjetJetProducer::produceTrackJets(), HITRegionalPixelSeedGenerator::regions(), FastJetFWLiteWrapper::run(), PFSpecificAlgo::runSignificance(), transfer_cluster_transfer(), transfer_jets(), GctFormatTranslateMCLegacy::writeGctOutJetBlock(), FFTJetProducer::writeJets(), and VirtualJetProducer::writeJets().

auto_ptr<JetDefinition::Plugin> fwrapper::plugin

Definition at line 44 of file fastjetfortran_madfks.cc.