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


C++ Event::put方法代码示例

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


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

示例1: produce

void IsoMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){
  auto mu_pt = make_auto(new std::vector<float>);
  auto mu_phi = make_auto(new std::vector<float>);
  auto mu_eta = make_auto(new std::vector<float>);
  auto mu_iso = make_auto(new std::vector<float>);
  
  edm::Handle<edm::ValueMap<double> > iso_handle;
  edm::Handle<std::vector<reco::RecoChargedCandidate> > muon_handle;
  iEvent.getByToken(iso_token_, iso_handle);
  iEvent.getByToken(cand_token_, muon_handle);
  
  for(auto it = iso_handle->begin(); it != iso_handle->end(); ++it){
    for(auto ite = it.begin(); ite != it.end(); ++ite){
      mu_iso->push_back(*ite);
    }
  }
  
  for(auto it = muon_handle->begin(); it != muon_handle->end(); ++it){
    mu_pt->push_back(it->pt());
    mu_phi->push_back(it->phi());
    mu_eta->push_back(it->eta());
  }

  iEvent.put(mu_pt, "mupt");
  iEvent.put(mu_phi, "muphi");
  iEvent.put(mu_eta, "mueta");
  iEvent.put(mu_iso, "muiso");
}
开发者ID:manuelfs,项目名称:hltstudy,代码行数:28,代码来源:IsoMuonProducer.cpp

示例2: wait

 void 
 SleepingProducer::produce(edm::Event& iEvent) {
   //printf("Producer %s\n",label().c_str());
   int sum=0;
   for(std::vector<const Getter*>::iterator it = m_getters.begin(), itEnd=m_getters.end();
       it != itEnd;
       ++it) {
     sum +=iEvent.get(*it);
     //printf("%s got %s with value %i\n",label().c_str(), (*it)->label().c_str(), iEvent.get((*it)));
   }
   wait(iEvent);
   iEvent.put(this,"",static_cast<int>(sum));
 }
开发者ID:amundson,项目名称:toy-mt-framework,代码行数:13,代码来源:SleepingProducer.cpp


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