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


C++ TObjArray::Remove方法代码示例

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


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

示例1: RemoveLegend

//_____________________________________________________
Bool_t GFHistManager::RemoveLegend(Int_t layer, Int_t nPad)
{
  // true if there was a legend
  if(!this->CheckHistNum("RemoveLegend", layer, nPad)) return kFALSE;

  TLegend* leg = this->GetLegendOf(layer, nPad);
  if(!leg) return kFALSE;

  TObjArray* legendsOfLayer = this->MakeLegends(layer);
  if(!legendsOfLayer->Remove(leg)) {
    this->Error("RemoveLegend", "inconsistent state for layer %d, nPad %d", layer, nPad);
    return kFALSE;
  }
  delete leg;

  if(layer < fCanArrays->GetEntriesFast()) {
    this->Update(layer); // if canvas already drawn
  }

  return kTRUE;
}
开发者ID:12345ieee,项目名称:cmg-cmssw,代码行数:22,代码来源:GFHistManager.C

示例2: CheckESD


//.........这里部分代码省略.........
	}
	break;
      }
      case kXiMinus:
      case kOmegaMinus: {
	if (particle->Pt() > cutPtCascade) {
	  nGenCascades++;
	  selCascades.Add(particle);
	}
	break;
      }
      default: break;
      }
    }

    // get the event summary data
    tree->GetEvent(iEvent);
    if (!esd) {
      Error("CheckESD", "no ESD object found for event %d", iEvent);
      return kFALSE;
    }

    // loop over tracks
    for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
      AliESDtrack* track = esd->GetTrack(iTrack);

      // select tracks of selected particles
      Int_t label = TMath::Abs(track->GetLabel());
      if (label > stack->GetNtrack()) continue;     // background
      TParticle* particle = stack->Particle(label);
      if (!selParticles.Contains(particle)) continue;
      if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) continue;
      if (track->GetConstrainedChi2() > 1e9) continue;
      selParticles.Remove(particle);   // don't count multiple tracks

      nRec++;
      hRec->Fill(particle->Pt());
      if (track->GetLabel() < 0) nFake++;

      // resolutions
      hResPtInv->Fill(100. * (TMath::Abs(track->GetSigned1Pt()) - 1./particle->Pt()) * 
		      particle->Pt());
      hResPhi->Fill(1000. * (track->Phi() - particle->Phi()));
      hResTheta->Fill(1000. * (track->Theta() - particle->Theta()));

      // PID
      if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) continue;
      Int_t iGen = 5;
      for (Int_t i = 0; i < AliPID::kSPECIES; i++) {
	if (TMath::Abs(particle->GetPdgCode()) == partCode[i]) iGen = i;
      }
      Double_t probability[AliPID::kSPECIES];
      track->GetESDpid(probability);
      Double_t pMax = 0;
      Int_t iRec = 0;
      for (Int_t i = 0; i < AliPID::kSPECIES; i++) {
	probability[i] *= partFrac[i];
	if (probability[i] > pMax) {
	  pMax = probability[i];
	  iRec = i;
	}
      }
      identified[iGen][iRec]++;
      if (iGen == iRec) nIdentified++;

      // dE/dx and TOF
开发者ID:catalinristea,项目名称:test,代码行数:67,代码来源:CheckESD.C


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