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


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

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


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

示例1: Init

void CalibTree::Init(TChain *tree, const char *dupFileName) {
  // The Init() function is called when the selector needs to initialize
  // a new tree or chain. Typically here the branch addresses and branch
  // pointers of the tree will be set.
  // It is normally not necessary to make changes to the generated
  // code, but the routine can be extended by the user if needed.
  // Init() will be called many times when running on PROOF
  // (once per file to be processed).

  // Set object pointer
  t_DetIds       = 0;
  t_HitEnergies  = 0;
  t_trgbits      = 0;
  t_DetIds1      = 0;
  t_DetIds3      = 0;
  t_HitEnergies1 = 0;
  t_HitEnergies3 = 0;
  // Set branch addresses and branch pointers
  fChain = tree;
  if (!tree) return;
  fCurrent = -1;
  fChain->SetMakeClass(1);

  fChain->SetBranchAddress("t_Run", &t_Run, &b_t_Run);
  fChain->SetBranchAddress("t_Event", &t_Event, &b_t_Event);
  fChain->SetBranchAddress("t_DataType", &t_DataType, &b_t_DataType);
  fChain->SetBranchAddress("t_ieta", &t_ieta, &b_t_ieta);
  fChain->SetBranchAddress("t_iphi", &t_iphi, &b_t_iphi);
  fChain->SetBranchAddress("t_EventWeight", &t_EventWeight, &b_t_EventWeight);
  fChain->SetBranchAddress("t_nVtx", &t_nVtx, &b_t_nVtx);
  fChain->SetBranchAddress("t_nTrk", &t_nTrk, &b_t_nTrk);
  fChain->SetBranchAddress("t_goodPV", &t_goodPV, &b_t_goodPV);
  fChain->SetBranchAddress("t_l1pt", &t_l1pt, &b_t_l1pt);
  fChain->SetBranchAddress("t_l1eta", &t_l1eta, &b_t_l1eta);
  fChain->SetBranchAddress("t_l1phi", &t_l1phi, &b_t_l1phi);
  fChain->SetBranchAddress("t_l3pt", &t_l3pt, &b_t_l3pt);
  fChain->SetBranchAddress("t_l3eta", &t_l3eta, &b_t_l3eta);
  fChain->SetBranchAddress("t_l3phi", &t_l3phi, &b_t_l3phi);
  fChain->SetBranchAddress("t_p", &t_p, &b_t_p);
  fChain->SetBranchAddress("t_pt", &t_pt, &b_t_pt);
  fChain->SetBranchAddress("t_phi", &t_phi, &b_t_phi);
  fChain->SetBranchAddress("t_mindR1", &t_mindR1, &b_t_mindR1);
  fChain->SetBranchAddress("t_mindR2", &t_mindR2, &b_t_mindR2);
  fChain->SetBranchAddress("t_eMipDR", &t_eMipDR, &b_t_eMipDR);
  fChain->SetBranchAddress("t_eHcal", &t_eHcal, &b_t_eHcal);
  fChain->SetBranchAddress("t_eHcal10", &t_eHcal10, &b_t_eHcal10);
  fChain->SetBranchAddress("t_eHcal30", &t_eHcal30, &b_t_eHcal30);
  fChain->SetBranchAddress("t_hmaxNearP", &t_hmaxNearP, &b_t_hmaxNearP);
  fChain->SetBranchAddress("t_rhoh", &t_rhoh, &b_t_rhoh);
  fChain->SetBranchAddress("t_selectTk", &t_selectTk, &b_t_selectTk);
  fChain->SetBranchAddress("t_qltyFlag", &t_qltyFlag, &b_t_qltyFlag);
  fChain->SetBranchAddress("t_qltyMissFlag", &t_qltyMissFlag, &b_t_qltyMissFlag);
  fChain->SetBranchAddress("t_qltyPVFlag", &t_qltyPVFlag, &b_t_qltyPVFlag);
  fChain->SetBranchAddress("t_gentrackP", &t_gentrackP, &b_t_gentrackP);
  fChain->SetBranchAddress("t_DetIds", &t_DetIds, &b_t_DetIds);
  fChain->SetBranchAddress("t_HitEnergies", &t_HitEnergies, &b_t_HitEnergies);
  fChain->SetBranchAddress("t_trgbits", &t_trgbits, &b_t_trgbits);
  fChain->SetBranchAddress("t_DetIds1", &t_DetIds1, &b_t_DetIds1);
  fChain->SetBranchAddress("t_DetIds3", &t_DetIds3, &b_t_DetIds3);
  fChain->SetBranchAddress("t_HitEnergies1", &t_HitEnergies1, &b_t_HitEnergies1);
  fChain->SetBranchAddress("t_HitEnergies3", &t_HitEnergies3, &b_t_HitEnergies3);
  Notify();

  ifstream infil1(dupFileName);
  if (!infil1.is_open()) {
    std::cout << "Cannot open " << dupFileName << std::endl;
  } else {
    while (1) {
      Long64_t jentry;
      infil1 >> jentry;
      if (!infil1.good()) break;
      entries.push_back(jentry);
    }
    infil1.close();
    std::cout << "Reads a list of " << entries.size() << " events from " 
	      << dupFileName << std::endl;
  }
}
开发者ID:mkiani,项目名称:cmssw,代码行数:78,代码来源:CalibTree.C

示例2: SFT_Fiber_Efficiency


//.........这里部分代码省略.........
sprintf(Name_h_layer4or,"Layer 4"); 
h_layer4or = new TH1D(Name_h_layer4or,Title_h_layer4or,19,0,19);

sprintf(Title_h_layer4and,"SFT Fiber Efficiencies Layer 4 - Run %d: ADC > %d , %d < TDC < %d", run_number, 0, TDC_min_SFT, TDC_max_SFT); 
sprintf(Name_h_layer4and,"Layer 4"); 
h_layer4and = new TH1D(Name_h_layer4and,Title_h_layer4and,19,0,19);

///////////////////////

//TChain *fChain_TARGET = new TChain("Tree_TARGET");
//TChain *fChain_SFT = new TChain("Tree_SFT");

//fChain_TARGET->Add(Name_finput);      
//fChain_SFT->Add(Name_finput);      

cout << "   " << endl;
cout << "Mapping File:   " << par_finput << endl;
cout << "" << endl;

//cout << "    " << endl;
//cout << "I'm in the File !" << endl;
//cout << Name_finput << endl;
//cout << "    " << endl;

TChain *fChain = new TChain("Tree");

fChain->Add(Name_finput);      

cout << "    " << endl;
cout << "I'm in the File !" << endl;
cout << Name_finput << endl;
cout << "    " << endl;

fChain->SetMakeClass(1);
fChain->SetBranchAddress("ADC_High_TARGET",ADC_High_target);
fChain->SetBranchAddress("ADC_Low_TARGET",ADC_Low_target);
fChain->SetBranchAddress("TDC_LE_TARGET",TDC_LE_target);
fChain->SetBranchAddress("TDC_TE_TARGET",TDC_TE_target);

fChain->SetBranchAddress("ADC_High_SFT",ADC_High_sft);
fChain->SetBranchAddress("ADC_Low_SFT",ADC_Low_sft);
fChain->SetBranchAddress("TDC_LE_SFT",TDC_LE_sft);
fChain->SetBranchAddress("TDC_TE_SFT",TDC_TE_sft);

fChain->SetBranchAddress("ADC_TOF1",ADC_tof1);

fChain->SetBranchAddress("ADC_TOF2",ADC_tof2);

//fChain_TARGET->SetMakeClass(1);
//fChain_TARGET->SetBranchAddress("ADC_High_TARGET",ADC_High_target);
//fChain_TARGET->SetBranchAddress("ADC_Low_TARGET",ADC_Low_target);
//fChain_TARGET->SetBranchAddress("TDC_LE_TARGET",TDC_LE_target);
//fChain_TARGET->SetBranchAddress("TDC_TE_TARGET",TDC_TE_target);

//fChain_SFT->SetMakeClass(1);
//fChain_SFT->SetBranchAddress("ADC_High_SFT",ADC_High_sft);
//fChain_SFT->SetBranchAddress("ADC_Low_SFT",ADC_Low_sft);
//fChain_SFT->SetBranchAddress("TDC_LE_SFT",TDC_LE_sft);
//fChain_SFT->SetBranchAddress("TDC_TE_SFT",TDC_TE_sft);

Int_t nentries = (Int_t)fChain->GetEntries();
cout <<  "DEBUG :     " <<  nentries << endl;

if(flag!=0) nentries=flag;
for (Int_t j=0; j<nentries; j++) {
开发者ID:sbianchin,项目名称:TREK_Offline,代码行数:66,代码来源:SFT_Fiber_Efficiency.C


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