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


C++ TLeaf::GetValuePointer方法代码示例

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


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

示例1: CacheTestMCProductions

/// \brief Cache  MC production trees, store summary information in formated text files -> root trees
/// \param dataType  -
/// \param fileList
void CacheTestMCProductions(TString dataType, const char *fileList=NULL){
  AliExternalInfo info;
  info.fLoadMetadata=kFALSE;
  TObjArray* periodList = NULL;
  TArrayI nRuns;
  if (fileList!=NULL) {
    periodList=(gSystem->GetFromPipe(TString::Format("cat %s", fileList).Data())).Tokenize("\n");
    nRuns.Set(periodList->GetEntries());

  }else{
    TTree * tree = info.GetTree("MonALISA.ProductionMC","","");
    Int_t nProd=tree->GetEntries();
    periodList = new TObjArray(nProd);
    nRuns.Set(nProd);
    TLeaf *leaf = tree->GetLeaf("Tag");
    TLeaf *leafRuns = tree->GetLeaf("Number_of_runs");
    for (Int_t iProd=0; iProd<nProd; iProd++){
      tree->GetEntry(iProd);
      TString prodName=((char*)leaf->GetValuePointer());
      if (prodName.Contains("LHC")==0) continue;
      periodList->AddAt(new TObjString(((char*)leaf->GetValuePointer())),iProd);
      nRuns[iProd]=leafRuns->GetValue();
    }
    delete tree;
  }
  for (Int_t iPeriod=0; iPeriod<periodList->GetEntriesFast(); iPeriod++){
    TObjString * pName= (TObjString*)periodList->At(iPeriod);
    if (pName==NULL) continue;
    TTree* tree = info.GetTree(dataType.Data(),periodList->At(iPeriod)->GetName(),"passMC");
    if (tree){
      Int_t entries=tree->Draw("run","1","goff");
      TString sInfo=periodList->At(iPeriod)->GetName();
      sInfo+="\t";
      sInfo+=dataType;
      sInfo+="\t";
      sInfo+=TString::Format("%d\t",entries);
      sInfo+=TString::Format("%d\t",nRuns[iPeriod]);
      for (Int_t j=0; j<entries; j++) {
        sInfo+=TString::Format("%2.0f,",tree->GetV1()[j]);
        ::Info("CacheTestMCProductionsRun:","%s\t%s\t%d\t%d\t%d\t%2.0f",periodList->At(iPeriod)->GetName(),dataType.Data(),entries,nRuns[iPeriod],j, tree->GetV1()[j]);
      }
      sInfo+="0";
      ::Info("CacheTestMCProductionsPeriod:","%s\n",sInfo.Data());
      delete tree;
    }else{
      ::Error("CacheTestMCProductionsPeriod:","%s\t%s\t-1\t%d\t0",periodList->At(iPeriod)->GetName(), dataType.Data(),nRuns[iPeriod]);
    }
  }
}
开发者ID:alisw,项目名称:AliRoot,代码行数:52,代码来源:aliExternalInfo.C

示例2: CacheTrendingProductions

/// Cache MC production information
void CacheTrendingProductions(TString dataType){
  AliExternalInfo info;
  info.fLoadMetadata=kFALSE;
  TObjArray* periodList = NULL, *idList=NULL;
  //
  TTree * tree = info.GetTree("MonALISA.ProductionCycle","","");
  Int_t nProd=tree->GetEntries();
  periodList = new TObjArray(nProd);
  idList= new TObjArray(nProd);
  TLeaf *leafTag = tree->GetLeaf("Tag");
  TLeaf *leafID   =  tree->GetLeaf("ID");
  for (Int_t iProd=0; iProd<nProd; iProd++){
    tree->GetEntry(iProd);
    TString prodName=((char*)leafTag->GetValuePointer());
    TString  idName =TString::Format("%d",TMath::Nint(leafID->GetValue()));
    if (prodName.Contains("LHC")==0) continue;
    periodList->AddAt(new TObjString(prodName),iProd);
    idList->AddAt(new TObjString(idName),iProd);
  }
  delete tree;
  //
  for (Int_t iPeriod=0; iPeriod<periodList->GetEntriesFast(); iPeriod++) {
    TObjString * pName= (TObjString*)idList->At(iPeriod);
    if (pName==NULL) continue;
    TTree* treeP = info.GetTreeProdCycleByID(idList->At(iPeriod)->GetName());
    if (treeP==NULL) continue;
    TLeaf *leafOutput = treeP->GetLeaf("outputdir");
    Int_t nRuns= treeP->GetEntries();
    treeP->GetEntry(0);
    TString path=((char*)leafOutput->GetValuePointer());
    TObjArray *pArray = path.Tokenize("/");
    if (pArray==NULL) continue;
    Int_t nElems=pArray->GetEntries();
    if (nElems<4) continue;
    TString aperiod=pArray->At(3)->GetName();
    TString apass =pArray->At(nElems-1)->GetName();
    delete pArray;
    ::Info("CacheTrendingProductions","%s\t%s\t%s\t%s\t%d",idList->At(iPeriod)->GetName(),path.Data(), aperiod.Data(),apass.Data(),nRuns);
    delete treeP;
    TTree* treeQA = info.GetTree(dataType.Data(),aperiod.Data(),apass.Data());
    if (treeQA){
      Int_t entries=treeQA->Draw("run","1","goff");
      TString sInfo=aperiod;
      sInfo+="\t";
      sInfo+=apass;
      sInfo+="\t";
      sInfo+=dataType;
      sInfo+="\t";
      sInfo+=TString::Format("%d\t",entries);
      sInfo+=TString::Format("%d\t",nRuns);
      for (Int_t j=0; j<entries; j++) {
        sInfo+=TString::Format("%2.0f,",treeQA->GetV1()[j]);
        ::Info("CacheTrendingProductionsRun:","%s\t%s\t%s\t%d\t%d\t%2.0f",aperiod.Data(),apass.Data(),dataType.Data(),entries,nRuns,treeQA->GetV1()[j]);
      }
      sInfo+="0";
      ::Info("CacheTrendingProductionsPeriod:","%s\n",sInfo.Data());
      delete treeQA;
    }else{
      ::Error("CacheTrendingProductionsPeriod:","%s\t%s\t%s\t-1\t%d\t0",aperiod.Data(),apass.Data(), dataType.Data(),nRuns);
    }
  }
}
开发者ID:alisw,项目名称:AliRoot,代码行数:63,代码来源:aliExternalInfo.C


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