本文整理汇总了C++中TCut::Print方法的典型用法代码示例。如果您正苦于以下问题:C++ TCut::Print方法的具体用法?C++ TCut::Print怎么用?C++ TCut::Print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCut
的用法示例。
在下文中一共展示了TCut::Print方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawPlots
//.........这里部分代码省略.........
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
if (DoProtonsTrackLength) {
tracks -> H2("StartMomentum.P()","TrackLength","PdgCode==2212","colz",401,1,1000,401,-1,1000
,"proton momentum","p [MeV/c]","track length [cm]");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
if (DoSRCEvents){
// identify v (np) -> µ p p events, and ask reconstruct BNL measurement
// the angle between the two protons in the inital state vs. the recoil momentum
TCanvas * c = plot -> CreateCanvas("c" , "DivideSquare");
c -> cd(1);
TH1F * Prec = events -> H1("Prec.Mag()",SRCcut&& "Prec.Mag()>0","colz",50,0,1000,"","recoil momentum [GeV/c]","",38,38);
plot -> Line(pThresholdArgoNeuT,0,pThresholdArgoNeuT,Prec->GetMaximum(),2,2);
c -> cd(2);
events -> H1(plot->CosTheta("Pmiss","Prec"),SRCcut&& "Prec.Mag()>0","colz",50,-1.1,1.1,"","cos( #theta )","",38,38);
c -> cd(3);
events -> H2("Prec.Mag()",plot->CosTheta("Pmiss","Prec"),SRCcut&& "Prec.Mag()>0","colz"
,50,1,1000,50,-1.01,1.01,"","recoil momentum [MeV/c]","#theta (p(miss) , p(recoil))");
plot -> Line(pThresholdArgoNeuT,-1.01,pThresholdArgoNeuT,1.01,2,2);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
if (DoAngles){
// plot -> CreateCanvas("Theta_pn_i_Prec");
// events -> H2("Prec.Mag()",plot->CosTheta("Pmiss","Prec"),cutCC2p,"colz"
// ,50,0,1000,50,-1.05,1.05,"","recoil momentum [MeV/c]","cos( #theta_{np}^{i} )");
// plot -> CreateCanvas("Theta_pn_i_Theta_munu");
// events -> H2(plot->CosTheta("neutrino.Vect()","muon.Vect()"),plot->CosTheta("Pmiss","Prec"),cutCC2p&&"Prec.Mag()>1","colz"
// ,50,-1.01,1.01,50,-1.01,1.01,"","cos( #theta_{#nu#mu} )","cos( #theta_{np}^{i} )");
plot -> CreateCanvas("Theta_pp_f_Prec");
events -> H2("Prec.Mag()",plot->CosTheta("protons[0].Vect()","protons[1].Vect()"),cutCC2p,"colz"
,50,1,1000,50,-1.01,1.01,"","recoil momentum [MeV/c]","cos( #theta_{pp}^{f} )");
// plot -> CreateCanvas("Theta_pp_Theta_numu");
// events -> H2(plot->CosTheta("neutrino.Vect()","muon.Vect()"),plot->CosTheta("protons[0].Vect()","protons[1].Vect()"),cutCC2p,"colz"
// ,50,-1.01,1.01,50,-1.01,1.01,"","cos( #theta_{#nu#mu} )","cos( #theta_{pp}^{f} )");
// plot -> CreateCanvas("Theta_numu_Prec");
// events -> H2("Prec.Mag()",plot->CosTheta("neutrino.Vect()","muon.Vect()"),cutCC2p&&"Prec.Mag()>200","colz"
// ,50,1,1000,50,-1.01,1.01,"","recoil momentum [MeV/c]","cos( #theta_{#nu#mu} )");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
if (DoHighMomentumTail){
plot -> CreateCanvas("DoHighMomentumTail");
float Max = 1300;
TH1F * Prec = events -> H1("Prec.Mag()",cutCC2p,"",75,0,Max,"","recoil momentum [MeV/c]","",38,38);
events -> H1("Prec.Mag()",cutCC2p&&"Prec.Mag()>270","same",75,0,Max,"","recoil momentum [MeV/c]","",48,48,3001);
float Tail = Prec -> Integral(Prec->GetXaxis()->FindBin(270),Prec->GetXaxis()->FindBin(Max));
float TailErr = sqrt(Tail);
float Tot = Prec -> Integral(Prec->GetXaxis()->FindBin(0),Prec->GetXaxis()->FindBin(Max));
float TotErr = sqrt(Tot);
float fTail = Tail / Tot;
float fTailErr = fTail * ( 1./Tail + 1./Tot );
SHOW(Tail);
SHOW(Tot);
SHOW(fTail);
SHOW(fTailErr);
TString TailPercentage = plot->PercentStr(fTail);
TString TailPercenErr = plot->PercentStr(fTailErr);
plot -> Text(300,Prec->GetMaximum(),Form("high momentum tail (>270 MeV/c) %.2f(%.0f)%%",100*fTail,100*100*fTailErr));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
if (DothetaPPFinalInitial){
plot -> CreateCanvas("Theta_numu_Prec");
// TString var = plot->CosTheta("Pmiss","Prec") , XTitle = "cos( #theta_{pn}^{i} )";
TString var = plot->CosTheta("protons[0].Vect()","protons[1].Vect()") , XTitle = "cos( #theta_{pp}^{f} )";
const int N = 5;
TH1F * h[N];
TString Labels[N];
float PmissMin[N] = {0 , 100 , 200 , 400 , 600 } , PmissMax[N] = {100 , 200 , 400 , 600 , 1000 } ;
for (int i = 0; i < N ; i++) {
TCut cut = cutCC2p && Form("%f > Prec.Mag() && Prec.Mag() > %f",PmissMax[i],PmissMin[i]) ;
Labels[i] = Form("%.0f > p(rec) > %.0f MeV/c",PmissMax[i],PmissMin[i]);
cut.Print();
h[i] = events -> H1(var,cut,"goff",50,-1.05,1.05,"",XTitle,"",(i!=4)?i+1:i+2,(i!=4)?i+1:i+2);
analysis -> NormalizeHistogram(h[i]);
}
for (int i = N-1; i >= 0 ; i--){
h[i] -> Draw((i==N-1)?"":"same");
}
plot -> AddLegend("recoil momentum cut",N,h,Labels,1,"f");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
if(DoDrawQ){
plot -> CreateCanvas("q");
TString var = "TMath::RadToDeg()*q.Theta()";
// TString var = plot->Theta("neutrino.Vect()","Pmiss"); //"TMath::RadToDeg()*q.Theta()"
events -> H2("q.Vect().Mag()",var,cutCC2p,"colz"
,50,1,1400,50,0,180,"","momentum transfer [MeV/c]","#theta_{q}");
// events -> H2("Prec.Mag()",var,cutCC2p,"colz"
// ,50,1,1400,50,0,180,"","recoil momentum [MeV/c]","#theta_{q}");
}
}
示例2: main
int main(int argc, char* argv[]) {
TH1::SetDefaultSumw2();
ProgramOptions options(argc, argv);
double lumi = options.lumi;
std::cout << "Integrated luminosity : " << lumi << " pb-1" << std::endl;
Datasets datasets(options.iDir);
datasets.readFile(options.datasetFile);
LeptonWeights lw;
// cuts
Cuts cuts;
TCut puWeight("puWeight");
TCut trigCorr( "(trigCorrWeight>0) ? trigCorrWeight : 1." );
// For lepton weights
TCut elTightWeight = cuts.elTightWeight(options.leptCorr);
TCut muTightWeight = cuts.muTightWeight(options.leptCorr);
TCut leptonTightWeight = elTightWeight * muTightWeight;
TCut elVetoWeight = cuts.elVetoWeight(options.leptCorr);
TCut muVetoWeight = cuts.muVetoWeight(options.leptCorr);
TCut leptonVetoWeight = elVetoWeight * muVetoWeight;
TCut otherCutsTight = puWeight * trigCorr * leptonTightWeight;
TCut otherCutsVeto = puWeight * trigCorr * leptonVetoWeight;
TCut cutSignalNoMETNoDPhi = cuts.HLTandMETFilters() + cuts.leptonVeto() + cuts.vbf();
// Tau cuts
// Get puWeight etc added below if necessary
// standard TightMjj selection - essentially signal selection but no DPhiJJ and no cjv
TCut cutTightMjj_basic = cuts.HLTandMETFilters() + cuts.cutWTau("lVeto") + cuts.cutWTau("dijet") + cuts.cutWTau("dEtaJJ") + cuts.cutWTau("MET") + cuts.cutWTau("Mjj");
TCut cutwMunoMjj = cuts.cutWMu("trigger")+ cuts.cutWMu("wMu")+cuts.cutWMu("lVeto")+cuts.cutWMu("dijet")+cuts.cutWMu("dEtaJJ")+cuts.cutWMu("MET") + cuts.cutWMu("dPhiJJ") + cuts.cutWMu("CJV"); //for W->mu regions
cutwMunoMjj.Print();
TCut cutTightMjj(""); // used to add in PU, trig corr, wWeight etc
TCut cutWMuVBFNoCJV = cuts.cutWMu("trigger") + cuts.cutWMu("wMu") + cuts.cutWMu("lVeto") + cuts.cutWMu("dijet") + cuts.cutWMu("dEtaJJ") + cuts.cutWMu("Mjj");
// double dphiEdges[4] = { 0., 1.0, 2.6, TMath::Pi() };
double dphiEdges[5] = { 0., 1.0, 1.8, 2.6, TMath::Pi() };
double MjjEdges[5] = { 800., 1000., 1200., 1800., 3000. };
// double MjjEdges[5] = { 800., 1100., 1400., 1800., 3000. };
double METEdges[5] = { 100., 150., 200., 250., 300. };
//double CenJetEtEdges[5] = { 10., 40., 70., 120. ,200};
double CenJetEtEdges[5] = { 10., 30., 60., 100., 150.};
TH1D* hWMu_MCGen_DPhi = new TH1D("hWMu_MCGen_DPhi", "", 1, 0,1); // W+jets MC gen level mu
TH1D* hWTau_MCGen_DPhi = new TH1D("hWTau_MCGen_DPhi", "", 1, 0,1); // W+jets MC gen level Tau - for ID
// DPhiJJ histograms
// WMu histograms
TH1D* hWMu_MCC_DPhi = new TH1D("hWMu_MCC_DPhi", "", 4, dphiEdges); // W+jets MC mu ctrl region
TH1D* hWMu_BGC_DPhi = new TH1D("hWMu_BGC_DPhi", "", 4, dphiEdges); // background MC ctrl region
TH1D* hWMu_DataC_DPhi = new TH1D("hWMu_DataC_DPhi", "", 4, dphiEdges); // Data ctrl region
// WTau histograms
TH1D* hWTau_MCC_DPhi = new TH1D("hWTau_MCC_DPhi", "", 4, dphiEdges); // W+jets MC tau ctrl region - for CJV ratio
TH1D* hWTau_BGC_DPhi = new TH1D("hWTau_BGC_DPhi", "", 4, dphiEdges); // background MC ctrl region
TH1D* hWTau_DataC_DPhi = new TH1D("hWTau_DataC_DPhi", "", 4, dphiEdges); // Data ctrl region
// Mjj histograms
// WMu histograms
TH1D* hWMu_MCC_Mjj = new TH1D("hWMu_MCC_Mjj", "", 4, MjjEdges); // W+jets MC mu ctrl region
TH1D* hWMu_BGC_Mjj = new TH1D("hWMu_BGC_Mjj", "", 4, MjjEdges); // background MC ctrl region
TH1D* hWMu_DataC_Mjj = new TH1D("hWMu_DataC_Mjj", "", 4, MjjEdges); // Data ctrl region
// WTau histograms
TH1D* hWTau_MCC_Mjj = new TH1D("hWTau_MCC_Mjj", "", 4, MjjEdges); // W+jets MC tau ctrl region - for CJV ratio
TH1D* hWTau_BGC_Mjj = new TH1D("hWTau_BGC_Mjj", "", 4, MjjEdges); // background MC ctrl region
TH1D* hWTau_DataC_Mjj = new TH1D("hWTau_DataC_Mjj", "", 4, MjjEdges); // Data ctrl region // Mjj histograms
// MET histograms
// WMu histograms
TH1D* hWMu_MCC_MET = new TH1D("hWMu_MCC_MET", "", 4, METEdges); // W+jets MC mu ctrl region
TH1D* hWMu_BGC_MET = new TH1D("hWMu_BGC_MET", "", 4, METEdges); // background MC ctrl region
TH1D* hWMu_DataC_MET = new TH1D("hWMu_DataC_MET", "", 4, METEdges); // Data ctrl region
// WTau histograms
TH1D* hWTau_MCC_MET = new TH1D("hWTau_MCC_MET", "", 4, METEdges); // W+jets MC tau ctrl region - for CJV ratio
TH1D* hWTau_BGC_MET = new TH1D("hWTau_BGC_MET", "", 4, METEdges); // background MC ctrl region
TH1D* hWTau_DataC_MET = new TH1D("hWTau_DataC_MET", "", 4, METEdges); // Data ctrl region // MET histograms
// Central Jet Et histograms
// WMu histograms
TH1D* hWMu_MCC_CenJetEt = new TH1D("hWMu_MCC_CenJetEt", "", 4, CenJetEtEdges); // W+jets MC mu ctrl region
TH1D* hWMu_BGC_CenJetEt = new TH1D("hWMu_BGC_CenJetEt", "", 4, CenJetEtEdges); // background MC ctrl region
TH1D* hWMu_DataC_CenJetEt = new TH1D("hWMu_DataC_CenJetEt", "", 4, CenJetEtEdges); // Data ctrl region
// WTau histograms
TH1D* hWTau_MCC_CenJetEt = new TH1D("hWTau_MCC_CenJetEt", "", 4, CenJetEtEdges); // W+jets MC tau ctrl region - for CJV ratio
TH1D* hWTau_BGC_CenJetEt = new TH1D("hWTau_BGC_CenJetEt", "", 4, CenJetEtEdges); // background MC ctrl region
TH1D* hWTau_DataC_CenJetEt = new TH1D("hWTau_DataC_CenJetEt", "", 4, CenJetEtEdges); // Data ctrl region
//.........这里部分代码省略.........