当前位置: 首页>>代码示例>>C++>>正文


C++ Jet::get_eta方法代码示例

本文整理汇总了C++中Jet::get_eta方法的典型用法代码示例。如果您正苦于以下问题:C++ Jet::get_eta方法的具体用法?C++ Jet::get_eta怎么用?C++ Jet::get_eta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Jet的用法示例。


在下文中一共展示了Jet::get_eta方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fillOutputNtuples

void JetEvaluator::fillOutputNtuples(PHCompositeNode *topNode) {
  
  if (Verbosity() > 2) cout << "JetEvaluator::fillOutputNtuples() entered" << endl;

  JetRecoEval*   recoeval = _jetevalstack->get_reco_eval();
  //JetTruthEval* trutheval = _jetevalstack->get_truth_eval();
 
  //-------------------------
  // fill the reco jet ntuple
  //-------------------------

  if (_do_recojet_eval) {
    if (Verbosity() > 1) cout << "JetEvaluator::filling recojet ntuple..." << endl;

    JetMap* recojets = findNode::getClass<JetMap>(topNode,_recojetname.c_str());
    if (!recojets) {
      cerr << PHWHERE << " ERROR: Can't find " << _recojetname << endl;
      exit(-1);
    }
  
    // for every recojet
    for (JetMap::Iter iter = recojets->begin();
	 iter != recojets->end();
	 ++iter) {
      Jet* recojet = iter->second;
      Jet* truthjet = recoeval->max_truth_jet_by_energy(recojet);

      float id    = recojet->get_id();
      float ncomp = recojet->size_comp();
      float eta   = recojet->get_eta();
      float phi   = recojet->get_phi();
      float e     = recojet->get_e();
      float pt    = recojet->get_pt();

      float gid        = NAN;
      float gncomp     = NAN;
      float geta       = NAN;
      float gphi       = NAN;
      float ge         = NAN;
      float gpt        = NAN;
      float efromtruth = NAN;

      if (truthjet) {
	gid    = truthjet->get_id();
	gncomp = truthjet->size_comp();
	geta   = truthjet->get_eta();
	gphi   = truthjet->get_phi();
	ge     = truthjet->get_e();
	gpt    = truthjet->get_pt();
	efromtruth = recoeval->get_energy_contribution(recojet,truthjet);
      }
      
      float recojet_data[14] = {(float) _ievent,
				id,
				ncomp,
				eta,
				phi,
				e,
				pt,
				gid,
				gncomp,
				geta,
				gphi,
				ge,
				gpt,
				efromtruth
      };

      _ntp_recojet->Fill(recojet_data);
    }
  }

  //-------------------------
  // fill the truth jet ntuple
  //-------------------------

  if (_do_truthjet_eval) {
    if (Verbosity() > 1) cout << "JetEvaluator::filling truthjet ntuple..." << endl;

    JetMap* truthjets = findNode::getClass<JetMap>(topNode,_truthjetname.c_str());
    if (!truthjets) {
      cerr << PHWHERE << " ERROR: Can't find " << _truthjetname << endl;
      exit(-1);
    }
  
    // for every truthjet
    for (JetMap::Iter iter = truthjets->begin();
	 iter != truthjets->end();
	 ++iter) {
      Jet* truthjet = iter->second;
      Jet* recojet = recoeval->best_jet_from(truthjet);

      float gid    = truthjet->get_id();
      float gncomp = truthjet->size_comp();
      float geta   = truthjet->get_eta();
      float gphi   = truthjet->get_phi();
      float ge     = truthjet->get_e();
      float gpt    = truthjet->get_pt();

      float id         = NAN;
//.........这里部分代码省略.........
开发者ID:HaiwangYu,项目名称:coresoftware,代码行数:101,代码来源:JetEvaluator.C

示例2: process_event

int PhotonJet::process_event(PHCompositeNode *topnode)
{
 
  cout<<"at event number "<<nevents<<endl;


  //get the nodes from the NodeTree
  JetMap* truth_jets = findNode::getClass<JetMap>(topnode,"AntiKt_Truth_r04");
  JetMap *reco_jets = findNode::getClass<JetMap>(topnode,"AntiKt_Tower_r04");
  PHG4TruthInfoContainer* truthinfo = findNode::getClass<PHG4TruthInfoContainer>(topnode,"G4TruthInfo");
  RawClusterContainer *clusters = findNode::getClass<RawClusterContainer>(topnode,"CLUSTER_CEMC");
  SvtxTrackMap *trackmap = findNode::getClass<SvtxTrackMap>(topnode,"SvtxTrackMap");
  JetEvalStack* _jetevalstack = new JetEvalStack(topnode,"AntiKt_Tower_r04","AntiKt_Truth_r04");
  PHG4TruthInfoContainer::Range range = truthinfo->GetPrimaryParticleRange();

  if(!truth_jets){
      cout<<"no truth jets"<<endl;
      return 0;
    }
  if(!reco_jets){
      cout<<"no reco jets"<<endl;
      return 0;
    }
  if(!truthinfo){
      cout<<"no truth track info"<<endl;
      return 0;
    }
  if(!clusters){
    cout<<"no cluster info"<<endl;
    return 0;
  }
  if(!trackmap){
    cout<<"no track map"<<endl;
    return 0;
  }
  if(!_jetevalstack){
    cout<<"no good truth jets"<<endl;
    return 0;
  }


  JetRecoEval* recoeval = _jetevalstack->get_reco_eval();


 /***********************************************

  GET THE TRUTH PARTICLES

  ************************************************/



  for( PHG4TruthInfoContainer::ConstIterator iter = range.first; iter!=range.second; ++iter){

    PHG4Particle *truth = iter->second;
    
    truthpx = truth->get_px();
    truthpy = truth->get_py();
    truthpz = truth->get_pz();
    truthp = sqrt(truthpx*truthpx+truthpy*truthpy+truthpz*truthpz);
    truthenergy = truth->get_e();
    
    TLorentzVector vec;
    vec.SetPxPyPzE(truthpx,truthpy,truthpz,truthenergy);
    
    truthpt = sqrt(truthpx*truthpx+truthpy*truthpy);
    if(truthpt<0.5)
      continue;
    
    truthphi = vec.Phi();
    trutheta = vec.Eta();
    truthpid = truth->get_pid();
    
    truth_g4particles->Fill();

  }


  /***********************************************

  GET THE EMCAL CLUSTERS

  ************************************************/


  RawClusterContainer::ConstRange begin_end = clusters->getClusters();
  RawClusterContainer::ConstIterator clusiter;
  
  for(clusiter = begin_end.first; clusiter!=begin_end.second; ++clusiter){

    RawCluster *cluster = clusiter->second;

    clus_energy = cluster->get_energy();
    clus_eta = cluster->get_eta();
    clus_theta = 2.*TMath::ATan((TMath::Exp(-1.*clus_eta)));
    clus_pt = clus_energy*TMath::Sin(clus_theta);
    clus_phi = cluster->get_phi();
    
    if(clus_pt<0.5)
      continue;
//.........这里部分代码省略.........
开发者ID:kurthill,项目名称:analysis,代码行数:101,代码来源:PhotonJet.C

示例3: 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;
}
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:74,代码来源:LeptoquarksReco.C

示例4: GetRecoHadronsAndJets

void PhotonJet::GetRecoHadronsAndJets(RawCluster *trig,
				      SvtxTrackMap *tracks,
				      JetMap *jets,
				      JetRecoEval *recoeval)
{

  float trig_phi = trig->get_phi();
  float trig_eta = trig->get_eta();

 
  for(SvtxTrackMap::Iter iter = tracks->begin(); iter!=tracks->end(); ++iter){

    SvtxTrack *track = iter->second;

    _tr_px = track->get_px();
    _tr_py = track->get_py();
    _tr_pz = track->get_pz();
    _tr_pt = sqrt(_tr_px*_tr_px+_tr_py*_tr_py);
    if(_tr_pt<0.5)
      continue;

    _tr_p = sqrt(_tr_px*_tr_px+_tr_py*_tr_py+_tr_pz*_tr_pz);
    _tr_phi = track->get_phi();
    _tr_eta = track->get_eta();
    _charge = track->get_charge();
    _chisq = track->get_chisq();
    _ndf = track->get_ndf();
    _dca = track->get_dca();
    _tr_x = track->get_x();
    _tr_y = track->get_y();
    _tr_z = track->get_z();

    haddphi = trig_phi-_tr_phi;
    if(haddphi<pi2)
      haddphi+=2.*pi;
    if(haddphi>threepi2)
      haddphi-=2.*pi;


    haddeta = trig_eta-_tr_eta;

    hadpout = _tr_p*TMath::Sin(haddphi);

    isophot_had_tree->Fill();
    

  }
  for(JetMap::Iter iter = jets->begin(); iter!=jets->end(); ++iter){
    Jet* jet = iter->second;
    Jet *truthjet = recoeval->max_truth_jet_by_energy(jet);

    _recojetpt = jet->get_pt();
    if(_recojetpt<4.0) 
      continue;
      
    _recojeteta = jet->get_eta();
    if(fabs(_recojeteta)>1.)
      continue;

    _recojetpx = jet->get_px();
    _recojetpy = jet->get_py();
    _recojetpz = jet->get_pz();
    _recojetphi = jet->get_phi();
    _recojetmass = jet->get_mass();
    _recojetp = jet->get_p();
    _recojetenergy = jet->get_e();
    _recojetid = jet->get_id();

    if(truthjet){
      _truthjetid = truthjet->get_id();
      _truthjetp = truthjet->get_p();
      _truthjetphi = truthjet->get_phi();
      _truthjeteta = truthjet->get_eta();
      _truthjetpt = truthjet->get_pt();
      _truthjetenergy = truthjet->get_e();
      _truthjetpx = truthjet->get_px();
      _truthjetpy = truthjet->get_py();
      _truthjetpz = truthjet->get_pz();
    }
    else{
      _truthjetid = 0;
      _truthjetp = 0;
      _truthjetphi = 0;
      _truthjeteta = 0;
      _truthjetpt = 0;
      _truthjetenergy = 0;
      _truthjetpx = 0;
      _truthjetpy = 0;
      _truthjetpz = 0;

    }
    
    jetdphi = trig_phi-_recojetphi;
    if(jetdphi<pi2)
      jetdphi+=2.*pi;
    if(jetdphi>threepi2)
      jetdphi-=2.*pi;
    
    jetdeta = trig_eta-_recojeteta;
    jetpout = _recojetpt*TMath::Sin(jetdphi);
//.........这里部分代码省略.........
开发者ID:kurthill,项目名称:analysis,代码行数:101,代码来源:PhotonJet.C


注:本文中的Jet::get_eta方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。