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


C++ EventInfo::run方法代码示例

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


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

示例1: process

bool TauAnalysisSelector::process(Long64_t entry) {
  double weight = 1.0;
  if(!fPuWeightName.empty()) {
    weight *= fPuWeight->value();
  }
  fEventCounter.setWeight(weight);

  cAll.increment();

  if(fIsEmbedded) {
    weight *= fGeneratorWeight->value();
    fEventCounter.setWeight(weight);
  }
  cGeneratorWeight.increment();

  /*
  std::cout << "FOO Event " << fEventInfo.event() << ":" << fEventInfo.lumi() << ":" << fEventInfo.run()
            << " electronVeto passed? " << fElectronVetoPassed->value()
            << std::endl;

  if( (fEventInfo.event() == 10069461 && fEventInfo.lumi() == 33572) ||
      (fEventInfo.event() == 10086951 && fEventInfo.lumi() == 33630) ||
      (fEventInfo.event() == 101065527 && fEventInfo.lumi() == 336953) ||
      (fEventInfo.event() == 101450418 && fEventInfo.lumi() == 338236) ||
      (fEventInfo.event() == 101460111 && fEventInfo.lumi() == 338268) ) {
    std::cout << "BAR Event " << fEventInfo.event() << ":" << fEventInfo.lumi() << ":" << fEventInfo.run()
              << " electronVeto passed? " << fElectronVetoPassed->value()
              << " Nelectrons " << fElectrons.size()
              << std::endl;
    for(size_t i=0; i<fElectrons.size(); ++i) {
      ElectronCollection::Electron electron = fElectrons.get(i);
      std::cout << "  Electron " << i
                << " pt " << electron.p4().Pt()
                << " eta " << electron.p4().Eta()
                << " hasGsfTrack " << electron.hasGsfTrack()
                << " hasSuperCluster " << electron.hasSuperCluster()
                << " supercluster eta " << electron.superClusterEta()
                << " passIdVeto " << electron.cutBasedIdVeto()
                << std::endl;
    }
  }

  if(!fElectronVetoPassed->value()) return false;
  cElectronVeto.increment();
  */

  // Tau BR
  if(fIsEmbedded && fEmbeddingNormalizationMode == kIDTriggerEfficiencyTauBR) {
    weight *= (1-0.357); // from my thesis, which took the numbers from PDG
    fEventCounter.setWeight(weight);
  }
  cTauBRWeight.increment();

  // MC status
  std::vector<GenParticleCollection::GenParticle> genTaus;
  GenParticleCollection::GenParticle theGenTau;
  if(isMC()) {
    bool canContinue = true;
    if(fIsEmbedded) {
      canContinue = findGenTaus(fGenTausEmbedded, 2212, &genTaus);
      canContinue = canContinue && genTaus.size() != 0;
    }
    else
      canContinue = findGenTaus(fGenTaus, 6, &genTaus);
    if(!canContinue)
      return false;
  }
  cGenTauFound.increment();
  if(isMC() && fMCTauMultiplicity != kMCTauNone) {
    size_t ntaus = genTaus.size();
    if(fIsEmbedded) {
      std::vector<GenParticleCollection::GenParticle> genTausOrig;
      findGenTaus(fGenTaus, 6, &genTausOrig);
      ntaus = genTausOrig.size();
    }

    if(fIsEmbedded) {
      // For embedded the embedded tau is counted as one
      if(fMCTauMultiplicity == kMCTauZeroTaus) return true;
      if(fMCTauMultiplicity == kMCTauOneTau && ntaus != 0) return true;
      if(fMCTauMultiplicity == kMCTauTwoTaus && ntaus != 1) return true;
      if(fMCTauMultiplicity == kMCTauMoreThanTwoTaus && ntaus < 2) return true;
    }
    else {
      if(fMCTauMultiplicity == kMCTauZeroTaus && ntaus != 0) return true;
      if(fMCTauMultiplicity == kMCTauOneTau && ntaus != 1) return true;
      if(fMCTauMultiplicity == kMCTauTwoTaus && ntaus != 2) return true;
      if(fMCTauMultiplicity == kMCTauMoreThanTwoTaus && ntaus < 3) return true;
    }
   
    if(genTaus.size() > 0)
      theGenTau = genTaus[0];
  }
  cTauMCSelection.increment();

  bool originalMuonIsWMu = false;
  EmbeddingMuonCollection::Muon embeddingMuon;
  if(fIsEmbedded) {
    if(fMuons.size() != 1)
      throw std::runtime_error("Embedding muon collection size is not 1");
//.........这里部分代码省略.........
开发者ID:heitorPB,项目名称:HiggsAnalysis,代码行数:101,代码来源:TauAnalysisSelector.C


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