8 const Float_t rootS = 200.0;
10 void readGammaTree(
const Char_t *fname =
"gamma_tree.root" )
12 gROOT->LoadMacro(
"StRoot/StGammaMaker/macros/loadGammaLibs.C");
15 file =
new TFile(fname);
16 tree = (TTree*)file->Get(
"gammas");
18 tree->SetBranchAddress(
"GammaEvent",&event);
21 for ( Long64_t i=0;i<tree->GetEntries();i++ )
25 Int_t run =
event->runNumber();
26 Int_t eventid =
event->eventNumber();
27 Int_t nc =
event->numberOfCandidates();
28 UShort_t
flags =
event->flags();
29 Float_t sumPt =
event->sumPt(-2.5,2.5);
30 Float_t
sumTrackPt =
event->sumTrackPt(-2.5,2.5);
31 Float_t
sumTowerPt =
event->sumTowerPt(-2.5,2.5);
33 std::cout <<
"-------------------------------------------------------------" << std::endl;
34 std::cout <<
"run = " << run << std::endl;
35 std::cout <<
"event = " << eventid << std::endl;
36 std::cout <<
"flags = " << Form(
"0x%X",flags) << std::endl;
37 std::cout <<
"pt sum = " << sumPt << std::endl;
38 std::cout <<
" + tracks = " << sumTrackPt << std::endl;
39 std::cout <<
" + towers = " << sumTowerPt << std::endl;
41 std::cout <<
"printing n candidates = " << nc << std::endl;
42 for ( Int_t ic = 0; ic < nc; ic++ )
45 if ( !candidate )
continue;
48 Int_t gammaId = candidate->id();
49 Int_t caloId = candidate->detectorId();
52 Float_t pt = candidate->momentum().Perp();
53 Float_t eta = candidate->momentum().Eta();
54 Float_t phi = candidate->momentum().Phi();
55 Float_t xf = candidate->momentum().Z() / rootS;
58 Float_t iso4 = candidate->sumPt(0.4);
59 Float_t iso5 = candidate->sumPt(0.5);
60 Float_t iso7 = candidate->sumPt(0.7);
62 Int_t ntracks4 = candidate->numberOfTracks(0.4);
63 Int_t ntowers4 = candidate->numberOfTowers(0.4);
64 Int_t ntracks5 = candidate->numberOfTracks(0.5);
65 Int_t ntowers5 = candidate->numberOfTowers(0.5);
66 Int_t ntracks7 = candidate->numberOfTracks(0.7);
67 Int_t ntowers7 = candidate->numberOfTowers(0.7);
69 Int_t ntracks = candidate->numberOfMyTracks();
70 Int_t ntowers = candidate->numberOfMyTowers();
72 std::cout <<
" ++++++++++++++++++++++++++++++++";
73 std::cout <<
" id=" << gammaId <<std::endl;
74 std::cout <<
" calo=" << caloId << std::endl;
75 std::cout <<
" pt="<<pt <<
" eta="<<eta<<
" phi="<<phi << std::endl;
76 std::cout <<
" ntowers=" << ntowers <<
" ntracks="<<ntracks<<std::endl;
78 std::cout <<
" iso4="<<iso4<<
" iso5="<<iso5<<
" iso7="<<iso7<<std::endl;
79 std::cout <<
" ntr4="<<ntracks4<<
" ntr5="<<ntracks5<<
" ntr7="<<ntracks7<<std::endl;
80 std::cout <<
" ntw4="<<ntowers4<<
" ntw5="<<ntowers5<<
" ntw7="<<ntowers7<<std::endl;
82 Int_t nu = candidate->numberOfSmdu();
83 Int_t nv = candidate->numberOfSmdv();
84 std::cout <<
"nu="<<nu<<
" nv="<<nv<<std::endl;
Float_t sumTrackPt(Float_t eta_min=-2.5, Float_t eta_max=+2.5) const
Returns track+tower pT in eta range.
Float_t sumTowerPt(Float_t eta_min=-2.5, Float_t eta_max=+2.5) const
Returns track pT in eta range.
UShort_t flags() const
Event flags (see above)
StGammaCandidate * candidate(Int_t i) const
Return ith strip.