/*************************************************************** * $Id: CbmRichAnalysisExample.C,v 1.1 2006/01/19 12:42:39 hoehne Exp $ * * This is a sample macro to access the Rich ring and * associated Rich hits from the reconstructed output. * * History of CVS commits: * * $Log: CbmRichAnalysisExample.C,v $ * Revision 1.1 2006/01/19 12:42:39 hoehne * initial version * * * */ * **************************************************************/ void CbmRichAnalysis() { gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); // Load this libraries gSystem->Load("libGeoBase"); gSystem->Load("libBase"); gSystem->Load("libPassive"); gSystem->Load("libSts"); gSystem->Load("libTof"); gSystem->Load("libRich"); gSystem->Load("libTrd"); gSystem->Load("libEcal"); gSystem->Load("libGen"); // Get the reconstructed output file TFile* recoFile = new TFile("rich.reco.root"); TTree* treco = (TTree*) recoFile->Get("cbmsim"); Long64_t RECOEventNum=treco->GetEntries(); printf("file contains %d RECO events\n",RECOEventNum); TClonesArray* richRing = new TClonesArray("CbmRichRing"); treco->SetBranchAddress("RichRing",&richRing); for(Int_t iEvt=0; iEvtGetEntry(iEvt); //! Reading RECO tree Int_t nRings = richRing->GetEntriesFast(); cout<<"Event, Rings : "<At(iRing); if( !pRing ){ cout<<" - Error - Could not get the ring pointer"<Reconstructed(); Int_t matchTrack = pRing->GetTrackID(); Double_t radius = pRing->GetRadius(); Double_t centerx = pRing->GetCenterX(); Double_t centery = pRing->GetCenterY(); Double_t uncertainty = pRing->GetUncertainty(); Int_t nHits = pRing->GetNoOfHits(); cout<<"ring,hits : "<GetHit(iHit); Int_t pmtId = pHit->GetPmtID(); Int_t trackId = pHit->GetTrackID(); Double_t x = pHit->X(); Double_t y = pHit->Y(); Double_t z = pHit->Z(); Double_t amp = pHit->GetAmplitude(); Int_t nphotons= pHit->GetNPhotons(); } //hit loop }// ring loop }// event loop }// macro ends here