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


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

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


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

示例1: MVAOutput

//Creates rootFile with a TTree with the ouput of MVA in it.
void MVAOutput(string Cat = "NoEleMatch_woGwoGSF_Barrel"
	       )
{
//   TChain *inputTree = new TChain("TrainTree");
  TChain *inputTree = new TChain("TestTree");
  TString pathToFile = "tmva/tmvaRoot/";
//   inputTree->Add(pathToFile+Form("/TMVA_v14EleVeto_%s.root",Cat.data()));
  inputTree->Add(pathToFile+Form("/V18/TMVA_v18EleVeto_%s.root",Cat.data()));
  if(inputTree->IsZombie()){
    cout<<"ZOOOOMBIEEE"<<endl;
    return;
  }

  int nEntries = inputTree->GetEntries();

//   std::string outputFileName = Form("/data_CMS/cms/ivo/AntiEMVANewTraining/MVAOutput/V14/MvaOutput_Test_%s.root",Cat.data());
  std::string outputFileName = Form("/data_CMS/cms/ivo/AntiEMVANewTraining/MVAOutput/V18/MvaOutput_All-TestTree_%s.root",Cat.data());
  
  TFile* outputFile = new TFile (outputFileName.data(),"RECREATE");
  TTree* mytree = new TTree("tree", "tree");

  float t_NoEleMatch_woGwoGSF_Barrel;
  float t_NoEleMatch_woGwGSF_Barrel;
  float t_NoEleMatch_wGwoGSF_Barrel;
  float t_NoEleMatch_wGwGSF_Barrel;
  float t_woGwoGSF_Barrel;
  float t_woGwGSF_Barrel;
  float t_wGwoGSF_Barrel;
  float t_wGwGSF_Barrel;
  float t_NoEleMatch_woGwoGSF_Endcap;
  float t_NoEleMatch_woGwGSF_Endcap;
  float t_NoEleMatch_wGwoGSF_Endcap;
  float t_NoEleMatch_wGwGSF_Endcap;
  float t_woGwoGSF_Endcap;
  float t_woGwGSF_Endcap;
  float t_wGwoGSF_Endcap;
  float t_wGwGSF_Endcap;

  int t_classID;

  mytree->Branch("NoEleMatch_woGwoGSF_Barrel",&t_NoEleMatch_woGwoGSF_Barrel,"NoEleMatch_woGwoGSF_Barrel/F");
  mytree->Branch("NoEleMatch_woGwGSF_Barrel",&t_NoEleMatch_woGwGSF_Barrel,"NoEleMatch_woGwGSF_Barrel/F");
  mytree->Branch("NoEleMatch_wGwoGSF_Barrel",&t_NoEleMatch_wGwoGSF_Barrel,"NoEleMatch_wGwoGSF_Barrel/F");
  mytree->Branch("NoEleMatch_wGwGSF_Barrel",&t_NoEleMatch_wGwGSF_Barrel,"NoEleMatch_wGwGSF_Barrel/F");
  mytree->Branch("woGwoGSF_Barrel",&t_woGwoGSF_Barrel,"woGwoGSF_Barrel/F");
  mytree->Branch("woGwGSF_Barrel",&t_woGwGSF_Barrel,"woGwGSF_Barrel/F");
  mytree->Branch("wGwoGSF_Barrel",&t_wGwoGSF_Barrel,"wGwoGSF_Barrel/F");
  mytree->Branch("wGwGSF_Barrel",&t_wGwGSF_Barrel,"wGwGSF_Barrel/F");
  mytree->Branch("NoEleMatch_woGwoGSF_Endcap",&t_NoEleMatch_woGwoGSF_Endcap,"NoEleMatch_woGwoGSF_Endcap/F");
  mytree->Branch("NoEleMatch_woGwGSF_Endcap",&t_NoEleMatch_woGwGSF_Endcap,"NoEleMatch_woGwGSF_Endcap/F");
  mytree->Branch("NoEleMatch_wGwoGSF_Endcap",&t_NoEleMatch_wGwoGSF_Endcap,"NoEleMatch_wGwoGSF_Endcap/F");
  mytree->Branch("NoEleMatch_wGwGSF_Endcap",&t_NoEleMatch_wGwGSF_Endcap,"NoEleMatch_wGwGSF_Endcap/F");
  mytree->Branch("woGwoGSF_Endcap",&t_woGwoGSF_Endcap,"woGwoGSF_Endcap/F");
  mytree->Branch("woGwGSF_Endcap",&t_woGwGSF_Endcap,"woGwGSF_Endcap/F");
  mytree->Branch("wGwoGSF_Endcap",&t_wGwoGSF_Endcap,"wGwoGSF_Endcap/F");
  mytree->Branch("wGwGSF_Endcap",&t_wGwGSF_Endcap,"wGwGSF_Endcap/F");

  mytree->Branch("classID",&t_classID,"classID/I");

//   float Tau_EtaAtEcalEntrance;
//   float Tau_Pt;
//   float Tau_EmFraction; 
//   float Tau_HadrHoP; 
//   float Tau_HadrEoP; 
//   float Tau_VisMass; 
  float Tau_dCrackPhi;
  float Tau_dCrackEta;
//   float Tau_DecayMode; 
  float Tau_NumHitsVariable;

//   //PFTaus variables

  inputTree->SetBranchAddress("Tau_dCrackEta", &Tau_dCrackEta); 
  inputTree->SetBranchAddress("Tau_dCrackPhi", &Tau_dCrackPhi); 
  inputTree->SetBranchAddress("_Tau_GSFNumHits_M_Tau_KFNumHits__D__Tau_GSFNumHits_P_Tau_KFNumHits_", &Tau_NumHitsVariable); 


  int Tau_GsfEleMatch;
  int Tau_GenEleMatch;
  int Tau_GenEleFromZMatch;
  int Tau_GenEleFromZTauTauMatch;
  int Tau_GenHadMatch;
  int Tau_GenJetMatch;
//   float Tau_AbsEta;
  float Tau_Eta;
  float Tau_EtaAtEcalEntrance;
  float Tau_PhiAtEcalEntrance;
  float Tau_Pt;
  float Tau_KFNumHits; 
  float Tau_HasGsf; 
  float Tau_GSFChi2; 
  float Tau_GSFNumHits; 
  float Tau_GSFTrackResol; 
  float Tau_GSFTracklnPt; 
  float Tau_GSFTrackEta; 
  float Tau_EmFraction; 
  float Tau_NumChargedCands;
  float Tau_NumGammaCands; 
  float Tau_HadrHoP; 
//.........这里部分代码省略.........
开发者ID:inaranjo,项目名称:ElectronsStudies,代码行数:101,代码来源:AntiElectronMVAApplicationTest.C


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