本文整理汇总了C++中TClonesArray::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ TClonesArray::GetName方法的具体用法?C++ TClonesArray::GetName怎么用?C++ TClonesArray::GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TClonesArray
的用法示例。
在下文中一共展示了TClonesArray::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_radius_correction
void run_radius_correction ()
{
TStopwatch timer;
timer.Start();
gStyle->SetPalette(1,0);
gStyle->SetHistLineWidth(2);
// ---- Load libraries -------------------------------------------------
gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
basiclibs();
gROOT->LoadMacro("$VMCWORKDIR/macro/rich/cbmlibs.C");
cbmlibs();
// gROOT->LoadMacro("$VMCWORKDIR/macro/rich/setstyle.C");
// setphdStyle();
SetStyles();
char fileMC[200], fileRec[200];
sprintf(fileMC,"/d/cbm02/slebedev/rich/JUL09/correction/mc.00.root");
cout<<fileMC<<endl;
TFile *f1 = new TFile(fileMC,"R");
TTree* t1 = f1->Get("cbmsim");
TFolder *fd1 = f1->Get("cbmroot");
TClonesArray* fMCTracks = (TClonesArray*) fd1->FindObjectAny("MCTrack");
t1->SetBranchAddress(fMCTracks->GetName(),&fMCTracks);
sprintf(fileRec, "/d/cbm02/slebedev/rich/JUL09/correction/reco.00.root");
TFile *f = new TFile(fileRec,"R");
TTree* t = f->Get("cbmsim");
TFolder *fd = f->Get("cbmout");
TClonesArray *fRichRings = (TClonesArray*) fd->FindObjectAny("RichRing");
t->SetBranchAddress(fRichRings->GetName(),&fRichRings);
TClonesArray *fRichMatches = (TClonesArray*) fd->FindObjectAny("RichRingMatch");
t->SetBranchAddress(fRichMatches->GetName(),&fRichMatches);
//Int_t fNofBinsX = 40;
//Int_t fNofBinsY = 50;
Int_t fNofBinsX = 25;
Int_t fNofBinsY = 25;
///A axis
TH2D* fh_axisAXYCount;
TH2D* fh_axisAXYW;
TH2D* fh_axisAXY;
TH2D* fh_axisASigma;
TH2D* mapaxisAXY;
///B axis
TH2D* fh_axisBXYCount;
TH2D* fh_axisBXYW;
TH2D* fh_axisBXY;
TH2D* fh_axisBSigma;
TH2D* mapaxisBXY;
mapaxisAXY = new TH2D("fh_mapaxisAXY","dA distribution (x,y);X, [cm];Y, [cm]",fNofBinsX,-200,200,fNofBinsY,-250,250);
mapaxisBXY = new TH2D("fh_mapaxisBXY","dB distribution (x,y);X, [cm];Y, [cm]",fNofBinsX,-200,200,fNofBinsY,-250,250);
fh_axisAXYCount = new TH2D("fh_axisAXYCount","A Count",fNofBinsX,-200,200,fNofBinsY,-250,250);
fh_axisAXYW = new TH2D("fh_axisAXYW","",fNofBinsX,-200,200,fNofBinsY,-250,250);
fh_axisBXYCount = new TH2D("fh_axisBXYCount","B Count",fNofBinsX,-200,200,fNofBinsY,-250,250);
fh_axisBXYW = new TH2D("fh_axisBXYW","",fNofBinsX,-200,200,fNofBinsY,-250,250);
fh_axisAXY = new TH2D("fh_axisAXY","A distribution (x,y);X, [cm];Y, [cm]",fNofBinsX,-200,200,fNofBinsY,-250,250);
fh_axisBXY = new TH2D("fh_axisBXY","B distribution (x,y);X, [cm];Y, [cm]",fNofBinsX,-200,200,fNofBinsY,-250,250);
Double_t fMinAaxis = 4.5;
Double_t fMaxAaxis = 7.5;
///Set Mean value of A and B axeses, Compact RICH
//Double_t fMeanAaxis = 5.06;
//Double_t fMeanBaxis = 4.65;
///Set Mean value of A and B axeses, Large RICH
Double_t fMeanAaxis = 6.17;
Double_t fMeanBaxis = 5.6;
Int_t nEvents=t->GetEntries();
cout<<" nEvents ="<<nEvents<<endl;
for(Int_t ievent=0;ievent<nEvents; ievent++ ) {
cout<<"ievent = "<<ievent;
CbmRichRing *ring=NULL;
CbmRichRingMatch *match=NULL;
t->GetEntry(ievent);
t1->GetEntry(ievent);
Int_t nofRings = fRichRings->GetEntries();
cout<<" nofRings = "<<nofRings;
cout<<" nofMatches = "<< fRichMatches->GetEntries() ;
cout<<" nofMCTracks = "<<fMCTracks->GetEntries() << endl;
for(Int_t iRing=0; iRing < nofRings; iRing++){
ring = (CbmRichRing*)fRichRings->At(iRing);
if (!ring) continue;
match = (CbmRichRingMatch*)fRichMatches->At(iRing);
if (!match) continue;
Int_t trackId = match->GetMCTrackID();
if (trackId == -1) continue;
if (trackId > fMCTracks->GetEntries()) continue;
CbmMCTrack* mcTrack = (CbmMCTrack*)fMCTracks->At(trackId);
//.........这里部分代码省略.........