本文整理汇总了C++中KVDetector::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ KVDetector::Clear方法的具体用法?C++ KVDetector::Clear怎么用?C++ KVDetector::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KVDetector
的用法示例。
在下文中一共展示了KVDetector::Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillHistograms
void KVElasticCountRates::FillHistograms(KVNameValueList* dets)
{
// parse the list dets
// fill histograms with energy loss for all detectors
// clear the detector energy losses
// delete the list
if (!dets) return;
Int_t ndets = dets->GetNpar();
for (int i = 0; i < ndets; i++) {
TString detname = dets->GetNameAt(i);
KVDetector* det = gMultiDetArray->GetDetector(detname);
if (!det) continue;
TH1F* histo = (TH1F*)fHistos.FindObject(detname);
if (!histo) {
histo = new TH1F(detname, Form("Eloss in %s", detname.Data()), fBinE, 0, 0);
fHistos.Add(histo);
}
double de = dets->GetDoubleValue(i);
histo->Fill(de, xsec * sin(theta * TMath::DegToRad()));
histo = (TH1F*)fHistos.FindObject(detname + "_dW");
if (!histo) {
histo = new TH1F(detname + "_dW", Form("Solid angle of %s", detname.Data()), fBinE, 0, 0);
fHistos.Add(histo);
}
histo->Fill(de, sin(theta * TMath::DegToRad()));
TH2F* histo2 = (TH2F*)fHistos.FindObject(detname + "_map");
if (!histo2) {
histo2 = new TH2F(detname + "_map", Form("Map of %s", detname.Data()), 100, 0, 0, 100, 0, 0);
fHistos.Add(histo2);
}
histo2->Fill(theta, phi, xsec);
det->Clear();
}
delete dets;
}