7 void SimplePicoDstAnalyzer(
const char* file =
"data/auau200.picoDst.root" ) {
10 TFile *f =
new TFile( file );
11 if ( !f ) { std::cout <<
"no file found" << std::endl;
return; }
13 TTree *T = f->Get(
"PicoDst");
14 if ( !T ) { std::cout <<
"no PicoDst tree found" << std::endl;
return; }
17 T->SetBranchStatus(
"*", 0);
18 T->SetBranchStatus(
"Event", 1);
19 T->SetBranchStatus(
"Event.*", 1);
20 T->SetBranchStatus(
"Track", 1);
21 T->SetBranchStatus(
"Track.*", 1);
25 Long64_t nentries = T->GetEntriesFast();
26 std::cout <<
"entries: " << nentries << std::endl;
29 Int_t Event_mRunId[1];
30 Int_t Event_mEventId[1];
31 UShort_t Event_mNumberOfGlobalTracks[1];
34 Float_t Track_mOrigin_mX1[10000];
35 Float_t Track_mOrigin_mX2[10000];
36 Float_t Track_mOrigin_mX3[10000];
39 T->SetBranchAddress(
"Event", &Event_ );
40 T->SetBranchAddress(
"Event.mRunId", Event_mRunId );
41 T->SetBranchAddress(
"Event.mEventId", Event_mEventId );
42 T->SetBranchAddress(
"Event.mNumberOfGlobalTracks", Event_mNumberOfGlobalTracks );
44 T->SetBranchAddress(
"Track", &Track_ );
45 T->SetBranchAddress(
"Track.mOrigin.mX1", Track_mOrigin_mX1 );
46 T->SetBranchAddress(
"Track.mOrigin.mX2", Track_mOrigin_mX2 );
47 T->SetBranchAddress(
"Track.mOrigin.mX3", Track_mOrigin_mX3 );
51 std::cout <<
"getting entry " << ientry << std::endl;
54 Long64_t nbytes = T->GetEntry( ientry );
56 std::cout <<
"entry received" << std::endl;
57 std::cout <<
"Run ID: " << Event_mRunId[0] << std::endl;
58 std::cout <<
"Event ID: " << Event_mEventId[0] << std::endl;
59 std::cout <<
"num tracks: " << Track_ << std::endl;
61 std::cout <<
"Track 0: "
62 << Track_mOrigin_mX1[0] <<
", "
63 << Track_mOrigin_mX2[0] <<
", "
64 << Track_mOrigin_mX3[0]
67 std::cout <<
"Track 1: "
68 << Track_mOrigin_mX1[1] <<
", "
69 << Track_mOrigin_mX2[1] <<
", "
70 << Track_mOrigin_mX3[1]