本文整理汇总了C++中HiForest::InitTree方法的典型用法代码示例。如果您正苦于以下问题:C++ HiForest::InitTree方法的具体用法?C++ HiForest::InitTree怎么用?C++ HiForest::InitTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HiForest
的用法示例。
在下文中一共展示了HiForest::InitTree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: anaAsyJetTrig
//.........这里部分代码省略.........
else
// intputFile="PP2013_HiForest_PromptReco_JsonPP_Jet80_HIReco_forestv84_v2.root"; //! 2013 pp data with HI tracking
intputFile="PP2013_HiForest_PromptReco_JsonPP_Jet80_PPReco_forestv82.root"; //! 2013 pp data with pp tracking
}
else { //MC sample
if(coll=="HI"){
if(pthat==50||pthat==80||pthat==100||pthat==170)
intputFile=Form("Dijet%d_HydjetDrum_v27_mergedV1.root", pthat);
else
intputFile=Form("Dijet%d_HydjetDrum_v28_mergedV1.root", pthat);
}
else if(coll=="PPb")
intputFile=Form("pt%d_HP04_prod16_v77_merged_forest_0.root", pthat);
// intputFile=Form("pt%d_HP04_hiforest77_hiSignal.root", pthat);
else if(coll=="PbP")
intputFile=Form("pt%d_HP05_prod24_v84_merged_forest_0.root", pthat);
else if(coll=="PP2011")
intputFile=Form("mergedFile.root"); // 2011 pp MC
else
intputFile=Form("pt%d_HP04_hiforest77_hiSignal.root", pthat); // ! 2013 pp 5.02TeV MC with pp tracking
}
TString inname=Form("%s/%s", dataPath.Data(),intputFile.Data());
// Define the input file and HiForest
HiForest * c ;
if(coll=="PP" || coll=="PP2011")
c = new HiForest(inname,"forest",cPP);
else if(coll=="PPb" || coll=="PbP")
c = new HiForest(inname,"forest",cPPb);
else
c = new HiForest(inname,"forest",cPbPb);
c->doTrackCorrections = false;
c->doTrackingSeparateLeadingSubleading = false;
c->InitTree();
// cout << "start working222222\n";
// TFile *my_file=TFile::Open(Form("%s/%s", dataPath.Data(),intputFile.Data()));
cout <<"Input file" << inname<<endl ;
TrackCorrector corr("trackCorrections_HIN12017v4_HijingCombined.root");
if(doTrackCorrections){
corr.load("trkCorr_HIN12017");
corr.setOption1(true);
corr.setOption2(true);
}
Evts * offSel = &(c->evt);
Skims * my_skim = &(c->skim);
Hlts * trigSel = &(c->hlt);
//jet tree
// if(coll=="HI")
// Jets * my_ct = &(c->akPu4Calo);
Jets * my_ct = &(c->akPu3PF);
// else
// Jets * my_ct = &(c->ak3PF);
// Jets * jetthres = &(c->icPu5);
//track tree
Tracks * my_tr = &(c->track);
//GenParticle tree
GenParticles * my_GenPart = &(c->genparticle);
int curr_bin = nbin-1 ;
int Nevents[nbin] = {0} ;
Int_t Nevt_40_60[nbin] = {0} ;
示例2: gammaJetRapidity_energyClosure
void gammaJetRapidity_energyClosure()
{
TH1::SetDefaultSumw2();
TString file;
file = "/mnt/hadoop/cms/store/user/luck/pA2013_MC/HiForest2_QCDPhoton30_5020GeV_100k.root";
HiForest *c = new HiForest(file, "Forest", cPPb, true);
c->InitTree();
TProfile *mcClosure = new TProfile("mcClosure",";p_{T}^{gen};<p_{T}^{reco}/p_{T}^{gen}>",40,0,300);
Int_t notMatched = 0;
//loop over events in each file
int nentries = c->GetEntries();
for(int jentry = 0; jentry<nentries; jentry++)
{
if (jentry% 1000 == 0) {
printf("%d / %d\n",jentry,nentries);
}
c->GetEntry(jentry);
//event selection (mc only)
if( !( c->skim.phfPosFilter1 && c->skim.phfNegFilter1 && c->skim.phltPixelClusterShapeFilter && c->skim.pprimaryvertexFilter) )
continue;
if(c->photon.nPhotons == 0)
continue;
//loop over photons in the event
Float_t leadingPt = 0;
Int_t leadingIndex = -1;
for(int i = 0; i<c->photon.nPhotons; i++)
{
if(c->photon.pt[i] > leadingPt)
{
leadingPt = c->photon.pt[i];
leadingIndex = i;
}
}
if(leadingIndex == -1)
continue;
if(c->photon.isGenMatched[leadingIndex])
{
Double_t genPt = c->photon.genMatchedPt[leadingIndex];
Double_t ratio = leadingPt/genPt;
mcClosure->Fill(genPt,ratio);
}
else
{
notMatched++;
}
}
mcClosure->Draw();
mcClosure->GetYaxis()->SetRangeUser(0.,2.);
TLine *line = new TLine(0, 1, 300, 1);
line->Draw();
drawText("Leading Photons",0.75,0.75);
printf("Number of not matched leading photons: %d\n",notMatched);
}