本文整理汇总了C++中TChain::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ TChain::Reset方法的具体用法?C++ TChain::Reset怎么用?C++ TChain::Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TChain
的用法示例。
在下文中一共展示了TChain::Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: splitStopSamples
//.........这里部分代码省略.........
// T2bw 50 R2
// mg.push_back(350); ml.push_back(0);
// mg.push_back(375); ml.push_back(50);
// mg.push_back(400); ml.push_back(100);
// T2bw 50 R3
// mg.push_back(450); ml.push_back(0);
// mg.push_back(500); ml.push_back(50);
// mg.push_back(550); ml.push_back(100);
// T2bw 25 R2
// mg.push_back(400); ml.push_back(0);
// mg.push_back(500); ml.push_back(100);
// mg.push_back(600); ml.push_back(200);
// T2bw 25 R3
mg.push_back(500); ml.push_back(0);
mg.push_back(550); ml.push_back(50);
mg.push_back(600); ml.push_back(100);
// cut-and-count T2tt
// mg.push_back(600); ml.push_back(25);
// mg.push_back(500); ml.push_back(200);
// mg.push_back(300); ml.push_back(100);
// R4
// mg.push_back(200); ml.push_back(100);
// mg.push_back(300); ml.push_back(200);
// mg.push_back(400); ml.push_back(300);
// R4
// mg.push_back(550); ml.push_back(25);
// mg.push_back(650); ml.push_back(50);
// mg.push_back(750); ml.push_back(100);
// R3
// mg.push_back(500); ml.push_back(100);
// mg.push_back(600); ml.push_back(200);
// mg.push_back(650); ml.push_back(250);
// R2
// mg.push_back(350); ml.push_back(75);
// mg.push_back(400); ml.push_back(125);
// mg.push_back(450); ml.push_back(175);
// R1
//mg.push_back(250); ml.push_back(25);
//mg.push_back(300); ml.push_back(25);
//mg.push_back(300); ml.push_back(75);
const unsigned int npoints = mg.size();
//-------------------------------------
// skim grid points
//-------------------------------------
TFile *file[npoints];
TTree *tree[npoints];
TChain* pretest = new TChain("t");
TChain* posttest = new TChain("t");
for( unsigned int i = 0 ; i < npoints ; ++i ){
//char* filename = Form("%s/T2ttPoint_%i_%i.root",path,mg.at(i),ml.at(i));
//char* filename = Form("%s/T2bw75Point_%i_%i.root",path,mg.at(i),ml.at(i));
//char* filename = Form("%s/T2bw50Point_%i_%i.root",path,mg.at(i),ml.at(i));
char* filename = Form("%s/T2bw25Point_%i_%i.root",path,mg.at(i),ml.at(i));
TCut cut(Form("mg==%i && ml==%i",mg.at(i),ml.at(i)));
cout << endl;
cout << "Skimming input file : " << infilename << endl;
cout << "Using selection : " << cut.GetTitle() << endl;
cout << "Skim filename : " << filename << endl;
file[i] = TFile::Open(filename, "RECREATE");
assert( file[i] != 0 );
tree[i] = chain->CopyTree( cut );
tree[i]->Write();
file[i]->Close();
pretest->Add(infilename);
posttest->Add(filename);
cout << "Pre total : " << pretest->GetEntries() << endl;
cout << "Pre skim : " << pretest->GetEntries(cut) << endl;
cout << "Post total : " << posttest->GetEntries() << endl;
cout << "Post skim : " << posttest->GetEntries(cut) << endl;
pretest->Reset();
posttest->Reset();
}
}
示例2: Trigger_TurnOn_data_MC_muon
void Trigger_TurnOn_data_MC_muon(){
gROOT->SetBatch();
gStyle->SetPadGridX(1);
gStyle->SetPadGridY(1);
gStyle->SetOptStat(0);
gStyle->SetLineWidth(2);
gROOT->ForceStyle();
TChain* tree = new TChain("tree");
TCanvas* c1 = new TCanvas("c1","c1",1280,768);
//const char* preselection = "HLT_BIT_HLT_IsoMu20_v && json && max(Max$(vLeptons_pt),Max$(aLeptons_pt))<60 && max(Max$(vLeptons_pt),Max$(aLeptons_pt))>30 && Flag_hbheFilterNew &&Flag_hbheIsoFilter && Flag_goodVertices &&Flag_eeBadScFilter &&Flag_CSCTightHaloFilter && MinIf$(abs(TVector2::Phi_mpi_pi(Jet_phi-met_phi)),Jet_pt>30 && Jet_eta<5.2)>0.5 ";
//const char* preselection_data = preselection;
const char* preselection = "HLT_BIT_HLT_IsoMu20_v && json && max(Max$(vLeptons_pt),Max$(aLeptons_pt))<60 && max(Max$(vLeptons_pt),Max$(aLeptons_pt))>30 && Flag_hbheFilterNew &&Flag_hbheIsoFilter && Flag_goodVertices &&Flag_eeBadScFilter &&Flag_CSCTightHaloFilter && MinIf$(abs(TVector2::Phi_mpi_pi(Jet_phi-met_phi)),Jet_pt>30 && Jet_eta<5.2)>0.5 ";
const char* preselection_data = "HLT_BIT_HLT_IsoMu20_v && json && max(Max$(vLeptons_pt),Max$(aLeptons_pt))<60 && max(Max$(vLeptons_pt),Max$(aLeptons_pt))>30 && Flag_hbheFilterNew &&Flag_hbheIsoFilter && Flag_goodVertices &&Flag_eeBadScFilter &&Flag_CSCTightHaloFilter && MinIf$(abs(TVector2::Phi_mpi_pi(Jet_phi-met_phi)),Jet_pt>30 && Jet_eta<5.2)>0.5 ";
tree->Reset();
//tree->Add("../../env/ZvvHighPt_V14_SingleElectron.root");
tree->Add("/gpfs/ddn/srm/cms/store/user/arizzi/VHBBHeppyV15/SingleMuon/VHBB_HEPPY_V15_SingleMuon__Run2015D-05Oct2015-v1/151027_145808/0000/tree_**.root");
//tree->Add("../../env/ZvvHighPt_V14_SingleMuon.root");
//tree->Add("/gpfs/ddn/srm/cms/store/user/arizzi/VHBBHeppyV15/SingleMuon/VHBB_HEPPY_V15_SingleMuon__Run2015D-05Oct2015-v1/151027_145808/0000/tree_99*");
tree->Draw("HLT_BIT_HLT_PFMET90_PFMHT90_IDTight_v :min(met_pt,mhtJet30) >> PFMET90_data(100,0,400)",preselection_data,"prof");
PFMET90_data = (TProfile*) gDirectory->Get("PFMET90_data");
tree->Reset();
//tree->Add("../../env/ZvvHighPt_V14_WJetsToLNu_HT-100To200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8.root");
tree->Add("/gpfs/ddn/srm/cms/store/user/arizzi/VHBBHeppyV14/WJetsToLNu_HT-100To200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/VHBB_HEPPY_V14_WJetsToLNu_HT-100To200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8__RunIISpring15MiniAODv2-74X_mcRun2_asymptotic_v2-v1/151024_220138/0000/tree_**.root");
//tree->Add("/gpfs/ddn/srm/cms/store/user/arizzi/VHBBHeppyV14/WJetsToLNu_HT-200To400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/VHBB_HEPPY_V14_WJetsToLNu_HT-200To400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8__RunIISpring15MiniAODv2-74X_mcRun2_asymptotic_v2-v1/151024_220559/0000/tree_1*");
tree->Draw("HLT_BIT_HLT_PFMET90_PFMHT90_IDLoose_v :min(met_pt,mhtJet30) >> PFMET90_WjetsHT100(100,0,400)",preselection,"prof");
PFMET90_WjetsHT100 = (TProfile*) gDirectory->Get("PFMET90_WjetsHT100");
tree->Reset();
tree->Add("/gpfs/ddn/srm/cms/store/user/arizzi/VHBBHeppyV14/WJetsToLNu_HT-200To400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/VHBB_HEPPY_V14_WJetsToLNu_HT-200To400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8__RunIISpring15MiniAODv2-74X_mcRun2_asymptotic_v2-v1/151024_220559/0000/tree_**.root");
//tree->Add("/gpfs/ddn/srm/cms/store/user/arizzi/VHBBHeppyV14/TT_TuneCUETP8M1_13TeV-powheg-pythia8/VHBB_HEPPY_V14_TT_TuneCUETP8M1_13TeV-powheg-pythia8__RunIISpring15MiniAODv2-74X_mcRun2_asymptotic_v2-v1/151024_212301/0000/tree_99*");
tree->Draw("HLT_BIT_HLT_PFMET90_PFMHT90_IDLoose_v :min(met_pt,mhtJet30) >> PFMET90_WjetsHT200(100,0,400)",preselection,"prof");
PFMET90_WjetsHT200 = (TProfile*) gDirectory->Get("PFMET90_WjetsHT200");
tree->Reset();
//tree->Add("../../env/ZvvHighPt_V14_WH_HToBB_WToLNu_M125_13TeV_amcatnloFXFX_madspin_pythia8.root");
tree->Add("/gpfs/ddn/srm/cms/store/user/arizzi/VHBBHeppyV14/WJetsToLNu_HT-400To600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/VHBB_HEPPY_V14_WJetsToLNu_HT-400To600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8__RunIISpring15MiniAODv2-74X_mcRun2_asymptotic_v2-v1/151025_084451/0000/tree_**.root");
//tree->Add("/gpfs/ddn/srm/cms/store/user/arizzi/VHBBHeppyV14/WH_HToBB_WToLNu_M125_13TeV_amcatnloFXFX_madspin_pythia8/VHBB_HEPPY_V14_WH_HToBB_WToLNu_M125_13TeV_amcatnloFXFX_madspin_pythia8__RunIISpring15MiniAODv2-74X_mcRun2_asymptotic_v2-v1/151024_220043/0000/tree_**");
tree->Draw("HLT_BIT_HLT_PFMET90_PFMHT90_IDLoose_v :min(met_pt,mhtJet30) >> PFMET90_WjetsHT400(100,0,400)",preselection,"prof");
PFMET90_WjetsHT400 = (TProfile*) gDirectory->Get("PFMET90_WjetsHT400");
PFMET90_data->SetLineWidth(2);
PFMET90_WjetsHT100->SetLineWidth(2);
PFMET90_WjetsHT200->SetLineWidth(2);
PFMET90_WjetsHT400->SetLineWidth(2);
PFMET90_data->SetLineColor(kBlack);
PFMET90_WjetsHT100->SetLineColor(kRed);
PFMET90_WjetsHT200->SetLineColor(kBlue);
PFMET90_WjetsHT400->SetLineColor(kGreen);
maxim = max(max(PFMET90_data->GetMaximum(),PFMET90_WjetsHT200->GetMaximum()),max(PFMET90_WjetsHT100->GetMaximum(),PFMET90_WjetsHT400->GetMaximum()));
PFMET90_data->SetMaximum(maxim*1.1);
PFMET90_data->SetTitle("Trigger efficiency");
PFMET90_data->GetXaxis()->SetTitle("min(MET,MHT) [GeV]");
PFMET90_data->GetYaxis()->SetTitle("Efficiency");
PFMET90_data->Draw("");
PFMET90_WjetsHT100->Draw("same");
PFMET90_WjetsHT200->Draw("same");
PFMET90_WjetsHT400->Draw("same");
TLegend* leg = new TLegend(0.45,0.1,0.9,0.3);
//leg->SetHeader("The Legend Title");
leg->AddEntry(PFMET90_data,"HLT_PFMET90_PFMHT90 in data","l");
leg->AddEntry(PFMET90_WjetsHT100,"HLT_PFMET90_PFMHT90 in WjetsHT100","l");
leg->AddEntry(PFMET90_WjetsHT200,"HLT_PFMET90_PFMHT90 in WjetsHT200","l");
leg->AddEntry(PFMET90_WjetsHT400,"HLT_PFMET90_PFMHT90 in WjetsHT400","l");
leg->Draw();
//const char* function = " [2]/(1+exp(-[1]*(x-[0]))) ";
const char* function_string = " (0.5+0.5*erf( (x-[0])*(x-[0]>[5])/[1] + (x-[0])*(x-[0]<[5])/[2] + [5]*(1/[1]-1/[2])*(x-[0]<[5]) ))*[4]+[3] ";
TF1* turnon1 = new TF1("turnon1",function_string);
turnon1->SetParameters(110,35,35,0,1,0);
TF1* turnon2 = (TF1*) turnon1->Clone("turnon1");
TF1* turnon3 = (TF1*) turnon1->Clone("turnon1");
TF1* turnon4 = (TF1*) turnon1->Clone("turnon1");
turnon1->SetLineColor(PFMET90_data->GetLineColor());
turnon2->SetLineColor(PFMET90_WjetsHT100->GetLineColor());
turnon3->SetLineColor(PFMET90_WjetsHT200->GetLineColor());
turnon4->SetLineColor(PFMET90_WjetsHT400->GetLineColor());
PFMET90_data->Fit(turnon1);
PFMET90_WjetsHT100->Fit(turnon2);
PFMET90_WjetsHT200->Fit(turnon3);
PFMET90_WjetsHT400->Fit(turnon4);
turnon1->SetRange(turnon1->GetParameter(1)-turnon1->GetParameter(2),turnon1->GetParameter(1)+turnon1->GetParameter(3));
//.........这里部分代码省略.........