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


C++ HiForest::GetName方法代码示例

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


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

示例1: writetree_pp

int writetree_pp(char *ksp = "ppJet40"){

  timer.Start();
  LoadLib();

 
  TString inname="";
  if(strcmp(ksp,"ppJet40")==0)inname = "/hadoop/store/user/belt/hiForest2/PP2013_HiForest_PromptReco_JSon_Jet40Jet60_ppTrack_forestv84.root";
  else if(strcmp(ksp,"ppJet80")==0)inname = "/hadoop/store/user/belt/hiForest2/PP2013_HiForest_PromptReco_JsonPP_Jet80_PPReco_forestv82.root";
    
  //! Load Lib
  //gSystem->Load("/afs/cern.ch/user/p/pawan/scratch0/CMSSW_6_2_0/src/work/pPb/HiForest/V3/hiForest_h.so");
    
  //! Define the input file and HiForest
  //! CMSSW_5_3_3
  HiForest *c = new HiForest(inname,Form("Forest%s",ksp),cPP);
  cout<<"Loaded the hiforest tree : "<<c->GetName()<<endl;
  ShutoffBranches(c);
    

  TFile *fout = new TFile(Form("ntuple_2013_%s_v2.root",ksp),"RECREATE");
    
  std::cout<<"\t"<<std::endl;
  std::cout<<"\t"<<std::endl;
  std::cout<<"**************************************************** "<<std::endl;
  std::cout<<Form("Running for %s ",ksp)<<std::endl;
  std::cout<<Form("pT  cut for %0.3f ",kptrecocut)<<std::endl;
  std::cout<<Form("eta cut for %0.3f ",ketacut)<<std::endl;
  std::cout<<"My hiForest Tree : " <<c->GetName()<<"\t Entries "<<c->GetEntries()<<std::endl;
  std::cout<<"Output file  "<<fout->GetName()<<std::endl;
  std::cout<<"**************************************************** "<<std::endl;
  std::cout<<"\t"<<std::endl;
  std::cout<<"\t"<<std::endl;
    
  //! shut off jet trees
  //c->hasAk2CaloJetTree=0;
  //c->hasAk4CaloJetTree=0;
  //c->hasAk3CaloJetTree=0;
  //c->hasAk5CaloJetTree=0;
    
  c->hasAkPu2CaloJetTree=0;
  c->hasAkPu4CaloJetTree=0;
  c->hasAkPu3CaloJetTree=0;
  //c->hasAkPu5CaloJetTree=0;
    
  //c->hasAk2PFJetTree=0;
  //c->hasAk4PFJetTree=0;
  //c->hasAk5PFJetTree=0;
    
  //c->hasAkPu2PFJetTree=0;
  //c->hasAkPu4PFJetTree=0;
  //c->hasAkPu5PFJetTree=0;
    
  c->hasTrackTree=0;
    
  //! For jets
  //Jets *mJets2 = 0;
  Jets *mJets3 = 0;
  Jets *mJets4 = 0;
  Long64_t nentries = c->GetEntries();
  std::cout<<Form("# of entries in TTree for %s : ",ksp)<<nentries<<std::endl;

  //TTree *jetR2Tree = new TTree("jetR2","ak2PF");
  TTree *jetR3Tree = new TTree("jetR3","ak3PF");
  TTree *jetR4Tree = new TTree("jetR4","ak4PF");
  TTree *evtTree = new TTree("evt","evt");

  // declare the event variables.
  int evt;
  int run;
  float vx;
  float vy;
  float vz;
  int jet40;
  int jet60;
  int jet80;
  int jet100;
  int ntrk;

  // declare the jet variables
  /*
  int nrefe2;
  float pt2[1000];
  float raw2[1000];
  float eta2[1000];
  float phi2[1000];
  float chMax2[1000];
  float trkMax2[1000];
  float chSum2[1000];
  float phSum2[1000];
  float neSum2[1000];
  float trkSum2[1000];
  float phMax2[1000];
  float neMax2[1000];
  */

  int nrefe3;
  float pt3[1000];
  float raw3[1000];
  float eta3[1000];
//.........这里部分代码省略.........
开发者ID:rkunnawa,项目名称:usercode,代码行数:101,代码来源:writetree_pp.C

示例2: IndResponse5TeVOnFlyForest


//.........这里部分代码省略.........
  c->hasAkPu3CaloJetTree=0;
  c->hasAkPu4CaloJetTree=0;
  c->hasHltTree=0;
  c->hasTrackTree=0;
  c->hasPixTrackTree=0;
  c->hasSkimTree=0;
  c->hasTowerTree=0;
  c->hasHbheTree=0;
  c->hasEbTree=0;
  c->hasGenpTree=0;
  c->hasGenParticleTree=0;
  c->hasPhotonTree=0;
  */


  //! To get the jet object from hiforest
  Jets *iJet=0;

  std::cout<<"Loaded all tree variables and # of jet algorithms : "<<knj<<std::endl;
  std::cout<<"\t"<<std::endl;


  //! Open a output file for histos
//  TFile *fout = new TFile(Form("Output/Response_%s_HP04_prod25_v85_pT%0.0fGeV_%d.root",ksp,kPt,ifile),"RECREATE");
  TFile *fout = new TFile(Form("Output/Response_%s_HP08_OnFlyForest_JECv17_pT%0.0fGeV.root",ksp,kPt),"RECREATE");


  std::cout<<"\t"<<std::endl;
  std::cout<<"\t"<<std::endl;
  std::cout<<"**************************************************** "<<std::endl;
  std::cout<<Form("Running for %s ",ksp)<<std::endl;
  std::cout<<Form("pT  cut for %0.3f ",kptrecocut)<<std::endl;
  std::cout<<Form("eta cut for %0.3f ",ketacut)<<std::endl;
  std::cout<<"My hiForest TTree : " <<c->GetName()<<std::endl;
  std::cout<<"Output file  "<<fout->GetName()<<std::endl;
  std::cout<<"**************************************************** "<<std::endl;
  std::cout<<"\t"<<std::endl;
  std::cout<<"\t"<<std::endl;


  //! 
  //! Define histograms here
  TH1::SetDefaultSumw2();
  TH2::SetDefaultSumw2();
  TProfile::SetDefaultSumw2();

  ////////////////////////////////////////////////////////////////////////////////////////////////////////
  TH1F *hEvt    = new TH1F("hEvt","# of events ",4,0,4);
  TH1F *hVz     = new TH1F("hVz","# of events ",80,-20,20);
  TH1F *hBin    = new TH1F("hBin","Centrality bin",100,-0.5,100-0.5);
  TH1F *hTotEve = new TH1F("hTotEve","# of events in the skimmed files",4,0,4);

  
  TH1F *hHF       = new TH1F("hHF","HF distribution",500,0,500);
  TH1F *hNTracks  = new TH1F("hNTracks","hiNTracks",500,0,500);
  TH2F *hNTracksHF = new TH2F("hNTracksHF","Ntrack vs HF ",500,0,500,500,0,500);
  TH2F *hBinHF      = new TH2F("hBinHF","HF vs hiBin",100,-0.5,100-0.5,500,0,500);
  TH2F *hBinNTracks = new TH2F("hBinNTracks","HF vs NTracks",100,-0.5,100-0.5,500,0,500);
    TH2F *hNTracksHFplusEta4 = new TH2F("hNTracksHFplusEta4","NTracks vs HFplusEta4",500,0,500, 500, 0., 500);
  
  TH1F *hgenpt_genm [knj][nmult], *hrecopt_genm[knj][nmult], *hrawpt_genm[knj][nmult];
  TH1F *hjeteta  [knj][nmult], *hjetphi[knj][nmult];
  TH2F *hjetpteta[knj][nmult], *hjetptphi[knj][nmult], *hjetetaphi[knj][nmult];

  //! Ratios of the pt distributions
  TProfile *hrecogen[knj][nmult], *hrecoraw[knj][nmult], *hrawgen[knj][nmult];
开发者ID:maoyx,项目名称:MITBackup2014July,代码行数:67,代码来源:IndResponse5TeVOnFlyForest.C

示例3: writentuple

int writentuple(char *ksp="ppJet40")
{

  timer.Start();

  LoadLib();

  TString inname="";
  if(strcmp(ksp,"ppJet40")==0)inname = "root://eoscms//eos/cms/store/group/phys_heavyions/yjlee/pp2013/promptReco/PP2013_HiForest_PromptReco_JSon_Jet40Jet60_ppTrack_forestv84.root";
  else if(strcmp(ksp,"ppJet80")==0)inname = "root://eoscms//eos/cms/store/caf/user/yjlee/pp2013/promptReco/PP2013_HiForest_PromptReco_JsonPP_Jet80_PPReco_forestv82.root";

  //! Load Lib
  //gSystem->Load("/afs/cern.ch/user/p/pawan/scratch0/CMSSW_6_2_0/src/work/pPb/HiForest/V3/hiForest_h.so");

  //! Define the input file and HiForest
  //! CMSSW_5_3_3
  HiForest *c = new HiForest(inname,Form("Forest%s",ksp),cPP);
  cout<<"Loaded the hiforest tree : "<<c->GetName()<<endl;
  ShutoffBranches(c);

  //! Output file
  //! HIHighPt
  TFile *fout = new TFile(Form("ntuple_2013_%s.root",ksp),"RECREATE");  

  std::cout<<"\t"<<std::endl;
  std::cout<<"\t"<<std::endl;
  std::cout<<"**************************************************** "<<std::endl;
  std::cout<<Form("Running for %s ",ksp)<<std::endl;
  std::cout<<Form("pT  cut for %0.3f ",kptrecocut)<<std::endl;
  std::cout<<Form("eta cut for %0.3f ",ketacut)<<std::endl;
  std::cout<<"My hiForest Tree : " <<c->GetName()<<"\t Entries "<<c->GetEntries()<<std::endl;
  std::cout<<"Output file  "<<fout->GetName()<<std::endl;
  std::cout<<"**************************************************** "<<std::endl;
  std::cout<<"\t"<<std::endl;
  std::cout<<"\t"<<std::endl;

  //! shut off jet trees
  c->hasAk2CaloJetTree=0;
  c->hasAk4CaloJetTree=0;
  c->hasAk3CaloJetTree=0;
  c->hasAk5CaloJetTree=0;

  c->hasAkPu2CaloJetTree=0;
  c->hasAkPu4CaloJetTree=0;
  c->hasAkPu3CaloJetTree=0;
  c->hasAkPu5CaloJetTree=0;

  c->hasAk2PFJetTree=0;
  c->hasAk4PFJetTree=0;
  c->hasAk5PFJetTree=0;

  c->hasAkPu2PFJetTree=0;
  c->hasAkPu4PFJetTree=0;
  c->hasAkPu5PFJetTree=0;

  c->hasTrackTree=0;

  //! For jets
  Jets *mJets=0;
  Long64_t nentries = c->GetEntries();
  std::cout<<Form("# of entries in TTree for %s : ",ksp)<<nentries<<std::endl;

  string jetVars = "";
  jetVars += "evt:run:vz:trig:jet40:jet60:jet80:jet100:ntrk:pt1:raw1:eta1:phi1:chMax1:chSum1:phSum1:neSum1:pt2:raw2:eta2:phi2:chMax2:chSum2:phSum2:neSum2:pt3:raw3:eta3:phi3:chMax3:chSum3:phSum3:neSum3";
  TNtuple *ntjet=0;
  ntjet = new TNtuple("ntjet","",jetVars.data());

  for (Long64_t ievt=0; ievt<nentries;ievt++) {//! event loop
  //for (Long64_t ievt=0; ievt<100;ievt++) {//! event loop
    //! load the hiForest event
    c->GetEntry(ievt);
    
    //! events with Single vertex
    bool evSel = false;
    float trig=-9;
    if(strcmp(ksp,"ppJet40")==0){
      evSel = fabs(c->evt.vz)<15. && c->skim.pHBHENoiseFilter  && c->skim.pPAcollisionEventSelectionPA && (c->hlt.HLT_PAJet40_NoJetID_v1 || c->hlt.HLT_PAJet60_NoJetID_v1); 
      trig=1;
    }
    else if(strcmp(ksp,"ppJet80")==0){
      evSel = fabs(c->evt.vz)<15. && c->skim.pHBHENoiseFilter  && c->skim.pPAcollisionEventSelectionPA && (c->hlt.HLT_PAJet80_NoJetID_v1 || c->hlt.HLT_PAJet100_NoJetID_v1); 
      trig=2;
    }
    if(!evSel)continue;

    float pt1 = -9, pt2    = -9, pt3    = -9,
      raw1    = -9, raw2   = -9, raw3   = -9,
      eta1    = -9, eta2   = -9, eta3   = -9,
      phi1    = -9, phi2   = -9, phi3   = -9,
      chMax1  = -9, chMax2 = -9, chMax3 = -9,
      chSum1  = -9, chSum2 = -9, chSum3 = -9,
      phSum1  = -9, phSum2 = -9, phSum3 = -9,
      neSum1  = -9, neSum2 = -9, neSum3 = -9;

    
    float run   = c->evt.run;
    float evt   = c->evt.evt;
    float vz    = c->evt.vz;
    
    float jet40  = c->hlt.HLT_PAJet40_NoJetID_v1;
//.........这里部分代码省略.........
开发者ID:pawannetrakanti,项目名称:pawan,代码行数:101,代码来源:writentuple.C

示例4: IndResponse


//.........这里部分代码省略.........

  //! jet Tree algorithms
  const char *jtlist[]={"nref","pthat","rawpt","jtpt","jteta","jtphi","jtpu","refpt","refeta","refphi","refdrjt","refparton_flavor",
			"ngen","gensubid","genmatchindex"
  };
  const int kjtbr = sizeof(jtlist)/sizeof(const char *);
  c->SelectBranches("JetTree",jtlist,kjtbr);

  std::cout<<"Selected the branches of need from evtTree and JetTrees : "<<std::endl;

  //! To get the jet object from hiforest
  Jets *iJet=0;
  const int knj = 7;//c->GetNAlgo(); //! # of jet algorithms in this hiforest 
  std::cout<<"Loaded all tree variables and # of jet algorithms : "<<knj<<std::endl;
  std::cout<<"\t"<<std::endl;

  //! Away-side jet definition
  const char *cdphi="2pi3";
  double kdphicut = 7.*pi/8.;
  if(strcmp(cdphi,"2pi3")==0)kdphicut=2.*pi/3.;
  else if(strcmp(cdphi,"1pi4")==0)kdphicut=1.*pi/4.;

  //! Open a output file for histos
  TFile *fout = new TFile(Form("Output/%s/Response_newHiForest_DJ_%0.0fGeV_%s_%d.root",ksp,kPt,ksp,iYear),"RECREATE");
  //TFile *fout = new TFile(Form("Output/%s/novtxcut/Response_newHiForest_DJ_%0.0fGeV_%s_%d.root",ksp,kPt,ksp,iYear),"RECREATE");
  //TFile *fout = new TFile(Form("test_newHiForest_DJ_%0.0fGeV_%s_%d.root",kPt,ksp,iYear),"RECREATE");

  std::cout<<"\t"<<std::endl;
  std::cout<<"\t"<<std::endl;
  std::cout<<"**************************************************** "<<std::endl;
  std::cout<<Form("Running for %s ",ksp)<<std::endl;
  std::cout<<Form("pT  cut for %0.3f ",kptrecocut)<<std::endl;
  std::cout<<Form("eta cut for %0.3f ",ketacut)<<std::endl;
  std::cout<<"My hiForest TTree : " <<c->GetName()<<std::endl;
  std::cout<<"Output file  "<<fout->GetName()<<std::endl;
  std::cout<<"**************************************************** "<<std::endl;
  std::cout<<"\t"<<std::endl;
  std::cout<<"\t"<<std::endl;


  //! 
  //! Define histograms here
  TH1::SetDefaultSumw2();
  TH2::SetDefaultSumw2();
  TProfile::SetDefaultSumw2();

  ////////////////////////////////////////////////////////////////////////////////////////////////////////
  TH1F *hEvt    = new TH1F("hEvt","# of events ",4,0,4);
  TH1F *hVz     = new TH1F("hVz","# of events ",80,-20,20);
  TH1F *hBin    = new TH1F("hBin","Centrality bin",40,0,40);
  TH1F *hHF     = new TH1F("hHF","Centrality variable from HF",600,0,6000);
  TH1F *hTotEve = new TH1F("hTotEve","# of events in the skimmed files",4,0,4);

  TH1F *hgenpt [knj][ncen], *hrecopt[knj][ncen], *hrawpt[knj][ncen];
  TH1F *hgenptC [knj][ncen], *hrecoptC[knj][ncen], *hrawptC[knj][ncen];
  TH1F *hgeneta[knj][ncen], *hrecoeta[knj][ncen];
  TH1F *hgenphi[knj][ncen], *hrecophi[knj][ncen];

  //! Ratios of the pt distributions
  TProfile *hrecogen[knj][ncen], *hrecoraw[knj][ncen], *hrawgen[knj][ncen], *hrecoraw_ref[knj][ncen];

  //! Resposnse
  TH2F *hcorrptrefpt[knj][ncen], *hrawptrefpt[knj][ncen], *hcorrptrawpt[knj][ncen];
  TH2F *hrescrpt[knj][ncen], *hresrrpt[knj][ncen], *hresrcrpt[knj][ncen];
  TH2F *hratiorawrefpt[knj][ncen], *hratiocorrrefpt[knj][ncen], *hratiocorrrawpt[knj][ncen];
  TH2F *hratiorawrefpt_eta[knj][ncen][2], *hratiocorrrefpt_eta[knj][ncen][2];
开发者ID:pawannetrakanti,项目名称:pawan,代码行数:67,代码来源:IndResponse.C


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