本文整理汇总了C++中Jet::end_comp方法的典型用法代码示例。如果您正苦于以下问题:C++ Jet::end_comp方法的具体用法?C++ Jet::end_comp怎么用?C++ Jet::end_comp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jet
的用法示例。
在下文中一共展示了Jet::end_comp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_truth_jet
Jet* JetTruthEval::get_truth_jet(PHG4Particle* particle) {
if (_strict) {assert(particle);}
else if (!particle) {++_errors; return NULL;}
if (_do_cache) {
std::map<PHG4Particle*,Jet*>::iterator iter =
_cache_get_truth_jet.find(particle);
if (iter != _cache_get_truth_jet.end()) {
return iter->second;
}
}
Jet* truth_jet = NULL;
// loop over all jets and look for this particle...
for (JetMap::Iter iter = _truthjets->begin();
iter != _truthjets->end();
++iter) {
Jet* candidate = iter->second;
// loop over all consituents and look for this particle
for (Jet::ConstIter jter = candidate->begin_comp();
jter != candidate->end_comp();
++jter) {
unsigned int index = jter->second;
PHG4Particle* constituent = _truthinfo->GetParticle( index );
if (_strict) {assert(constituent);}
else if (!constituent) {++_errors; continue;}
if (get_svtx_eval_stack()->get_truth_eval()->are_same_particle(constituent,particle)) {
truth_jet = candidate;
break;
}
}
if (truth_jet) break;
}
if (_do_cache) _cache_get_truth_jet.insert(make_pair(particle,truth_jet));
return truth_jet;
}
示例2: sqrt
int
LeptoquarksReco::AddJetInformation( type_map_tcan& tauCandidateMap, JetMap* recojets, type_map_cdata* map_calotower )
{
/* Loop over tau candidates */
for (type_map_tcan::iterator iter = tauCandidateMap.begin();
iter != tauCandidateMap.end();
++iter)
{
Jet* jetx = recojets->get( (iter->second)->get_property_uint( PidCandidate::jet_id ) );
/* calculate transverse mass of jet */
float jet_mtrans = sqrt( pow( jetx->get_mass(), 2 ) +
pow( jetx->get_pt(), 2 ) );
/* count jet ncomp above thresholds */
unsigned int jet_ncomp_above_0p1 = 0;
unsigned int jet_ncomp_above_1 = 0;
unsigned int jet_ncomp_above_10 = 0;
for (Jet::ConstIter jcompiter = jetx->begin_comp(); jcompiter != jetx->end_comp(); ++jcompiter)
{
RawTowerDefs::CalorimeterId calo_id = RawTowerDefs::NONE;
switch ( jcompiter->first )
{
case Jet::CEMC_TOWER:
calo_id = RawTowerDefs::CEMC;
break;
case Jet::HCALIN_TOWER:
calo_id = RawTowerDefs::HCALIN;
break;
case Jet::HCALOUT_TOWER:
calo_id = RawTowerDefs::HCALOUT;
break;
default:
break;
}
/* continue if no calorimeter id found */
if ( calo_id == RawTowerDefs::NONE )
continue;
/* get tower container from map, find tower in tower container, get tower energy */
float e_component = 0;
if ( map_calotower->find( calo_id ) != map_calotower->end() )
e_component = ( ( ( map_calotower->find( calo_id ) )->second ).first )->getTower( jcompiter->second )->get_energy();
/* check if energy is above threshold and count up matching counters accordingly */
if ( e_component > 0.1 )
jet_ncomp_above_0p1++;
if ( e_component > 1 )
jet_ncomp_above_1++;
if ( e_component > 10 )
jet_ncomp_above_10++;
}
/* set tau candidate jet properties */
(iter->second)->set_property( PidCandidate::jet_eta , jetx->get_eta() );
(iter->second)->set_property( PidCandidate::jet_phi , jetx->get_phi() );
(iter->second)->set_property( PidCandidate::jet_etotal , jetx->get_e() );
(iter->second)->set_property( PidCandidate::jet_etrans , jetx->get_et() );
(iter->second)->set_property( PidCandidate::jet_ptotal , jetx->get_p() );
(iter->second)->set_property( PidCandidate::jet_ptrans , jetx->get_pt() );
(iter->second)->set_property( PidCandidate::jet_minv , jetx->get_mass() );
(iter->second)->set_property( PidCandidate::jet_mtrans , jet_mtrans );
(iter->second)->set_property( PidCandidate::jet_ncomp , (uint)jetx->size_comp() );
(iter->second)->set_property( PidCandidate::jet_ncomp_above_0p1 , jet_ncomp_above_0p1 );
(iter->second)->set_property( PidCandidate::jet_ncomp_above_1 , jet_ncomp_above_1 );
(iter->second)->set_property( PidCandidate::jet_ncomp_above_10 , jet_ncomp_above_10 );
(iter->second)->set_property( PidCandidate::jet_ncomp_emcal , (uint)jetx->count_comp( Jet::CEMC_TOWER ) );
}
return 0;
}