本文整理汇总了C++中TH2I::GetBinContent方法的典型用法代码示例。如果您正苦于以下问题:C++ TH2I::GetBinContent方法的具体用法?C++ TH2I::GetBinContent怎么用?C++ TH2I::GetBinContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TH2I
的用法示例。
在下文中一共展示了TH2I::GetBinContent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadTree_normDet
//.........这里部分代码省略.........
for(int ievent = 0; ievent < N; ievent++) {
if((ievent+1)% 500000 == 0) cout<<"Processing Event "<<ievent+1<<"\t"<<100.*(ievent+1)/(double)N<<"% Completed"<<endl;
tree->GetEntry(ievent);
//-- Vertex Cut
if(TMath::Abs(vtx) < 3.0 || TMath::Abs(vtx) > 15.0) continue;
//-- Calculate centbin
if( centval > cent_max[NCENT-1]) continue;
int icent = hCentBins.FindBin(centval)-1;
//-- Reset raw and sumw values
VnRaw_x_0 = 0;
VnRaw_y_0 = 0;
VnRaw_x_1 = 0;
VnRaw_y_1 = 0;
VnRaw_x_full = 0;
VnRaw_y_full = 0;
sumw_0 = 0;
sumw_1 = 0;
sumw_full = 0;
evtMult_0 = 0;
evtMult_1 = 0;
evtMult_full = 0;
//-- Begin analyzer histogram loops
for(int ipt = ptBinMin; ipt <= ptBinMax; ipt++){
for(int ieta = etaBinMin; ieta <= etaBinMax; ieta++){
if(sumw->GetBinContent(ipt+1,ieta+1) !=0){
//-- Subevent 0 (eta >= 0)
if(etabinsDefault[ieta] >= 0){
VnRaw_x_0 += sumwqx->GetBinContent(ipt+1,ieta+1);
VnRaw_y_0 += sumwqy->GetBinContent(ipt+1,ieta+1);
sumw_0 += sumw->GetBinContent(ipt+1,ieta+1);
evtMult_0 += hMult->GetBinContent(ipt+1,ieta+1);
}
//-- Subevent 1 (eta < 0)
else{
VnRaw_x_1 += sumwqx->GetBinContent(ipt+1,ieta+1);
VnRaw_y_1 += sumwqy->GetBinContent(ipt+1,ieta+1);
sumw_1 += sumw->GetBinContent(ipt+1,ieta+1);
evtMult_1 += hMult->GetBinContent(ipt+1,ieta+1);
}
//-- Full Event
VnRaw_x_full += sumwqx->GetBinContent(ipt+1,ieta+1);
VnRaw_y_full += sumwqy->GetBinContent(ipt+1,ieta+1);
sumw_full += sumw->GetBinContent(ipt+1,ieta+1);
evtMult_full += hMult->GetBinContent(ipt+1,ieta+1);
}
} //-- End eta loop
} //-- End pt loop
//-- Fill Histograms, only use events that have at least two tracks in each SE
if(sumw_0 == 0 || sumw_1 == 0 || evtMult_1 < 2 || evtMult_full < 2) continue;
VnRaw_x_full /= sumw_full;
VnRaw_y_full /= sumw_full;
示例2: makeVNDet
//.........这里部分代码省略.........
// Calculate Vn_det
//
cout<<"Begin DETECTOR loop, contains "<<tree->GetEntries()<<" Events"<<endl;
int N;
if(testrun) N = 10000;
else N = tree->GetEntries();
//-- Begin event loop
for(int ievent = 0; ievent < N; ievent++) {
if((ievent+1)% 500000 == 0) cout << "Processing Event " << ievent+1 << "\t" << (100.*(ievent+1)/N) << "% Completed" << endl;
tree->GetEntry(ievent);
//-- Vertex Cut
if(TMath::Abs(vtx) < 3. || TMath::Abs(vtx) > 15.) continue;
//-- Calculate centbin
if( centval > cent_max[NCENT-1]) continue;
int icent = hCentBins.FindBin(centval)-1;
//-- begin EP loop
for(int iEP = 0; iEP < NEP; iEP++){
int EPbin = EPSymmPartnerBin[iEP];
if( EPbin != EPSymmBin ) continue;
//-- Calculate qbin
double qx = qnHFx_EP[iEP];
double qy = qnHFy_EP[iEP];
double qxDet = hqnHFDet_x[iEP]->GetBinContent(icent+1);
double qyDet = hqnHFDet_y[iEP]->GetBinContent(icent+1);
double sumET = sumET_EP[iEP];
if(sumET == 0) continue;
qx -= qxDet;
qy -= qyDet;
qx /= sumET;
qy /= sumET;
double qn = TMath::Sqrt( qx*qx + qy*qy );
int iqn = hqbins[icent][EPbin]->FindBin( qn ) - 1;
if(iqn >= NQN) continue;
//-- Reset Raw and sumw values
VNRawX_0[icent][EPbin][iqn] = 0.;
VNRawY_0[icent][EPbin][iqn] = 0.;
VNRawX_1[icent][EPbin][iqn] = 0.;
VNRawY_1[icent][EPbin][iqn] = 0.;
VNRawX_full[icent][EPbin][iqn] = 0.;
VNRawY_full[icent][EPbin][iqn] = 0.;
sumw_0[icent][EPbin][iqn] = 0.;
sumw_1[icent][EPbin][iqn] = 0.;
sumw_full[icent][EPbin][iqn] = 0.;
evtMult_0[icent][EPbin][iqn] = 0;
evtMult_1[icent][EPbin][iqn] = 0;
evtMult_full[icent][EPbin][iqn] = 0;
Nevents[icent][EPbin][iqn]++;
//-- Begin analyzer histogram loops
for(int ipt = ptBinMin; ipt <= ptBinMax; ipt++){
for(int ieta = etaBinMin; ieta <= etaBinMax; ieta++){
示例3: makeVNDet
//.........这里部分代码省略.........
if(TMath::Abs(vtx) > vtxCut) continue;
//-- Calculate centbin
if( centval > cent_max[NCENT-1]) continue;
int icent = hCentBins.FindBin(centval)-1;
//-- Reset Raw and sumw values
VNRawX_0[icent] = 0.;
VNRawY_0[icent] = 0.;
VNRawX_1[icent] = 0.;
VNRawY_1[icent] = 0.;
VNRawX_full[icent] = 0.;
VNRawY_full[icent] = 0.;
sumw_0[icent] = 0.;
sumw_1[icent] = 0.;
sumw_full[icent] = 0.;
evtMult_0[icent] = 0;
evtMult_1[icent] = 0;
evtMult_full[icent] = 0;
Nevents[icent]++;
//-- Begin analyzer histogram loops
for(int ipt = ptBinMin; ipt <= ptBinMax; ipt++){
for(int ieta = etaBinMin; ieta <= etaBinMax; ieta++){
double pt = sumw->GetXaxis()->GetBinCenter(ipt+1);
double eta = sumw->GetYaxis()->GetBinCenter(ieta+1);
if( pt < ptMin || pt > ptMax ) continue;
if( fabs( eta ) > etaMax ) continue;
if(sumw->GetBinContent(ipt+1,ieta+1) !=0){
//-- Subevent 0 (eta >= 0)
if(etabinsDefault[ieta] >= 0){
VNRawX_0[icent] += sumwqx->GetBinContent(ipt+1,ieta+1);
VNRawY_0[icent] += sumwqy->GetBinContent(ipt+1,ieta+1);
sumw_0[icent] += sumw->GetBinContent(ipt+1,ieta+1);
evtMult_0[icent] += hMult->GetBinContent(ipt+1,ieta+1);
}
//-- Subevent 1 (eta < 0)
else{
VNRawX_1[icent] += sumwqx->GetBinContent(ipt+1,ieta+1);
VNRawY_1[icent] += sumwqy->GetBinContent(ipt+1,ieta+1);
sumw_1[icent] += sumw->GetBinContent(ipt+1,ieta+1);
evtMult_1[icent] += hMult->GetBinContent(ipt+1,ieta+1);
}
//-- Full Event
VNRawX_full[icent] += sumwqx->GetBinContent(ipt+1,ieta+1);
VNRawY_full[icent] += sumwqy->GetBinContent(ipt+1,ieta+1);
sumw_full[icent] += sumw->GetBinContent(ipt+1,ieta+1);
evtMult_full[icent] += hMult->GetBinContent(ipt+1,ieta+1);
}
} //-- End eta loop
} //-- End pt loop
//-- Only use events that have tracks in all subevents AND subevents that have at least two tracks to determine VN
if( sumw_0[icent] == 0 || sumw_1[icent] == 0 || evtMult_0[icent] < 2 || evtMult_1[icent] < 2 ){
NFails[icent]++;
示例4: ReadTree_normDet
//.........这里部分代码省略.........
//
// Tree Loop
//
cout<<"Begin FINAL loop, contains "<<tree->GetEntries()<<" Events"<<endl;
int N;
if( testrun ) N = 10000;
else N = tree->GetEntries();
for(int ievent = 0; ievent < N; ievent++) {
if((ievent+1)% 500000 == 0) cout<<"Processing Event "<<ievent+1<<"\t"<<100.*(ievent+1)/(double)N<<"% Completed"<<endl;
tree->GetEntry(ievent);
//-- Vertex Cut
if(TMath::Abs(vtx) > vtxCut) continue;
//-- Calculate centbin
if( centval > cent_max[NCENT-1]) continue;
int icent = hCentBins.FindBin(centval)-1;
//-- begin EP loop
for(int iEP = 0; iEP < NEP; iEP++){
int EPbin = EPSymmPartnerBin[iEP];
if( EPbin != EPSymmBin ) continue;
//-- Calculate qbin
double qx = qnHFx_EP[iEP];
double qy = qnHFy_EP[iEP];
double qxDet = hqnHFDet_x[iEP]->GetBinContent(icent+1);
double qyDet = hqnHFDet_y[iEP]->GetBinContent(icent+1);
double sumET = sumET_EP[iEP];
if(sumET == 0) continue;
qx -= qxDet;
qy -= qyDet;
qx /= sumET;
qy /= sumET;
double qn = TMath::Sqrt( qx*qx + qy*qy );
int iqn = hqbins[icent][EPbin]->FindBin( qn ) - 1;
if(iqn >= NQN) continue;
//-- Reset raw and sumw values
VnRaw_x_0 = 0;
VnRaw_y_0 = 0;
VnRaw_x_1 = 0;
VnRaw_y_1 = 0;
VnRaw_x_full = 0;
VnRaw_y_full = 0;
sumw_0 = 0;
sumw_1 = 0;
sumw_full = 0;
evtMult_0 = 0;
evtMult_1 = 0;
evtMult_full = 0;
//-- Begin analyzer histogram loops
for(int ipt = ptBinMin; ipt <= ptBinMax; ipt++){
for(int ieta = etaBinMin; ieta <= etaBinMax; ieta++){
if(sumw->GetBinContent(ipt+1,ieta+1) !=0){
示例5: makeVNDet
//.........这里部分代码省略.........
}
treeSplit->GetEntry(ievent);
//-- Vertex Cut
if(TMath::Abs(vtx) > vtxCut) continue;
//-- Calculate centbin
if( centval > cent_max[NCENT-1]) continue;
int icent = (centval - cent_min[0]) / centBinWidth;
//-- Reset Raw and sumw values
double VNRawX_0 = 0.;
double VNRawY_0 = 0.;
double VNRawX_1 = 0.;
double VNRawY_1 = 0.;
double VNRawX_full = 0.;
double VNRawY_full = 0.;
double sumw_0 = 0.;
double sumw_1 = 0.;
double sumw_full = 0.;
double evtMult_0 = 0;
double evtMult_1 = 0;
double evtMult_full = 0;
Nevents[icent][iSplit]++;
//-- Begin analyzer histogram loops
for(int ipt = ptBinMin; ipt <= ptBinMax; ipt++){
for(int ieta = etaBinMin; ieta <= etaBinMax; ieta++){
if(sumw->GetBinContent(ipt+1,ieta+1) !=0){
//-- Subevent 0 (eta >= 0)
if(etabinsDefault[ieta] >= 0){
VNRawX_0 += sumwqx->GetBinContent(ipt+1,ieta+1);
VNRawY_0 += sumwqy->GetBinContent(ipt+1,ieta+1);
sumw_0 += sumw->GetBinContent(ipt+1,ieta+1);
evtMult_0 += hMult->GetBinContent(ipt+1,ieta+1);
}
//-- Subevent 1 (eta < 0)
else{
VNRawX_1 += sumwqx->GetBinContent(ipt+1,ieta+1);
VNRawY_1 += sumwqy->GetBinContent(ipt+1,ieta+1);
sumw_1 += sumw->GetBinContent(ipt+1,ieta+1);
evtMult_1 += hMult->GetBinContent(ipt+1,ieta+1);
}
//-- Full Event
VNRawX_full += sumwqx->GetBinContent(ipt+1,ieta+1);
VNRawY_full += sumwqy->GetBinContent(ipt+1,ieta+1);
sumw_full += sumw->GetBinContent(ipt+1,ieta+1);
evtMult_full += hMult->GetBinContent(ipt+1,ieta+1);
}
} //-- End eta loop
} //-- End pt loop
//-- Only use events that have tracks in all subevents AND subevents that have at least two tracks to determine VN
if( sumw_0 == 0 || sumw_1 == 0 || evtMult_0 < 2 || evtMult_1 < 2 ){
NFails[icent][iSplit]++;