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


C++ TChain::GetTreeNumber方法代码示例

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


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

示例1: LoadTree

Long64_t CalibTree::LoadTree(Long64_t entry) {
  // Set the environment to read one entry
  if (!fChain) return -5;
  Long64_t centry = fChain->LoadTree(entry);
  if (centry < 0) return centry;
  if (fChain->GetTreeNumber() != fCurrent) {
    fCurrent = fChain->GetTreeNumber();
    Notify();
  }
  return centry;
}
开发者ID:mkiani,项目名称:cmssw,代码行数:11,代码来源:CalibTree.C

示例2: LoadTree

Long64_t BranchBase::LoadTree(Long64_t entry)
{
   if (!fChain) return -5;
   Long64_t centry = fChain->LoadTree(entry);
   if (centry < 0) return centry;
   if (!fChain->InheritsFrom(TChain::Class()))  return centry;
   TChain *chain = (TChain*)fChain;
   if (chain->GetTreeNumber() != fCurrent) {
      fCurrent = chain->GetTreeNumber();
      Notify();
   }
   return centry;
}
开发者ID:Feynman27,项目名称:HIMuonSkimming,代码行数:13,代码来源:BranchBase_2012.30.09.C

示例3: LoadTree

Long64_t CalibSort::LoadTree(Long64_t entry) {
  // Set the environment to read one entry
  if (!fChain) return -5;
  Long64_t centry = fChain->LoadTree(entry);
  if (centry < 0) return centry;
  if (!fChain->InheritsFrom(TChain::Class()))  return centry;
  TChain *chain = (TChain*)fChain;
  if (chain->GetTreeNumber() != fCurrent) {
    fCurrent = chain->GetTreeNumber();
    Notify();
  }
  return centry;
}
开发者ID:owen234,项目名称:cmssw,代码行数:13,代码来源:CalibSort.C

示例4: LoadTree

Long64_t TOFrPicoDst::LoadTree(Long64_t entry)
{
// Set the environment to read one entry
   if (!fChain) return -5;
   Long64_t centry = fChain->LoadTree(entry);
   if (centry < 0) return centry;
   if (fChain->IsA() != TChain::Class()) return centry;
   TChain *chain = (TChain*)fChain;
   if (chain->GetTreeNumber() != fCurrent) {
      fCurrent = chain->GetTreeNumber();
      Notify();
   }
   return centry;
}
开发者ID:jdbrice,项目名称:tofT0Calibration,代码行数:14,代码来源:TOFrPicoDst.cpp

示例5: LoadTree

Long64_t NtupleReaderNuclearInteractions::LoadTree(Long64_t entry)
{
// Set the environment to read one entry
   if (!fChain) return -5;
   Long64_t centry = fChain->LoadTree(entry);
   if (centry < 0) return centry;
   if (!fChain->InheritsFrom(TChain::Class()))  return centry;
   TChain *chain = (TChain*)fChain;
   if (chain->GetTreeNumber() != fCurrent) {
      fCurrent = chain->GetTreeNumber();
      //      Notify();
   }
   return centry;
}
开发者ID:GiacomoSguazzoni,项目名称:usercode,代码行数:14,代码来源:NtupleReaderNuclearInteractions.C

示例6: zmumuSelDraw

void zmumuSelDraw(TTree* t0){

   zfriendtree=new TTree("friendextra","A friend tree for new branches");

   zfriendtree->SetDirectory(0);
   /*
     void SetDirectory(TDirectory *dir) 
     Remove reference to this tree from current directory and add
     reference to new directory dir. dir can be 0 in which case the tree
     does not belong to any directory.
     
     There is a bug in the Friend implementation. If the tree (to which you
     add friend to) is memory resident it's directory has to be zero. (See
     work-around below).  TTree* zfriendtree=new TTree("friendextra","A friend
     tree for new branches"); zfriendtree is meant to be in memory (right?)
     zfriendtree->SetDirectory(0);
   */


   Double_t neumomcmtot; 
   zfriendtree->Branch("neumomcmtot",&neumomcmtot,"neumomcmtot/D");

   TTree *zChain=t0;
   Int_t fCurrent=-1;
   zChain->SetMakeClass(1);
   Int_t nneu;
   Float_t neumomcm[40];//={0.0,};

   zChain->SetBranchAddress("nneu",&nneu);
   zChain->SetBranchAddress("neumomcm",neumomcm);


   TBranch *b_nneu=zChain->GetBranch("nneu");
   TBranch *b_neumomcm=zChain->GetBranch("neumomcm");
   
   Long64_t nentries = zChain->GetEntriesFast();
   
   for (Long64_t jentry=0; jentry<nentries;jentry++) {

      if(!zChain) break; 

      Long64_t centry = zChain->LoadTree(jentry);

      if(centry<0 || (zChain->IsA() != TChain::Class())) break;

      TChain *chain =(TChain*)zChain;

      if(chain->GetTreeNumber() !=fCurrent){
         fCurrent = chain->GetTreeNumber();
         b_nneu = zChain->GetBranch("nneu");
         b_neumomcm = zChain->GetBranch("neumomcm");
      }       
      
      double check = 0.0;
      neumomcmtot = 0.0;

      b_nneu->GetEntry(centry);
      b_neumomcm->GetEntry(centry);

      if(nneu>40){
         cout<<"Number of neutral track is over 40"<<endl;
         break;
      }
      for(int j=0;j<nneu;j++){
         check +=  neumomcm[j];
      }
      neumomcmtot = check;
      cout<< jentry << ": neumomcmtot: "<<neumomcmtot<<endl;
      zfriendtree->Fill();
   }


   
   zfriendtree->AddFriend(t0);
   zfriendtree->SetScanField(-1);
   //return;


   // this used to crash;
   zfriendtree->Scan("nneu:neumomcm[0]:neumomcm[1]:neumomcm[2]:neumomcm[3]:neumomcmtot");
   zfriendtree->Scan("nneu:neumomcm:neumomcmtot","","",8,0);
   zfriendtree->Scan("nneu:npi0:neumomcm:pi0thecm","","",8,0);
   zfriendtree->Scan("nneu:npi0:neumomcm:pi0thecm","neumomcm[0]>0","",8,0);
   zfriendtree->Scan("nneu:npi0:neumomcm:pi0thecm","neumomcm>0","",8,0);

   zfriendtree->Scan("nneu:neumomcmtot-(Alt$(neumomcm[0],0)+Alt$(neumomcm[1],0)+Alt$(neumomcm[2],0)+Alt$(neumomcm[3],0))");
   zfriendtree->Scan("nneu:neumomcmtot-(Alt$(neumomcm[0],0)+Alt$(neumomcm[1],0)+Alt$(neumomcm[2],0)+Alt$(neumomcm[3],0))","nneu==0");
   zfriendtree->Scan("nneu:neumomcmtot-(Alt$(neumomcm[0],0)+Alt$(neumomcm[1],0)+Alt$(neumomcm[2],0)+Alt$(neumomcm[3],0))","nneu==1");

   zfriendtree->Scan("nneu:neumomcm[0]:neumomcm[1]:neumomcm[2]:neumomcm[3]:neumomcmtot:neumomcmtot-(Alt$(neumomcm[0],0)+Alt$(neumomcm[1],0)+Alt$(neumomcm[2],0)+Alt$(neumomcm[3],0))","nneu>1&&nneu<=4");
   zfriendtree->Scan("nneu:neumomcmtot-(Alt$(neumomcm[0],0)+Alt$(neumomcm[1],0)+Alt$(neumomcm[2],0)+Alt$(neumomcm[3],0))","nneu>4");
   
   zfriendtree->RemoveFriend(t0);
    

   // Test a chain with a TTree as friend
   t0->AddFriend(zfriendtree);
//    cout << "(TTree*)" << (void*)zfriendtree << endl;

//    cout << "t0 has " << t0->GetEntries() << " entries\n";
//.........这里部分代码省略.........
开发者ID:asmagina1995,项目名称:roottest,代码行数:101,代码来源:zmumuSelDrawmail.cpp


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