6 #include "TFileCollection.h" 18 int main(
int argc,
char * argv[])
21 TH1::SetDefaultSumw2();
24 std::string inputList =
"rootFileList.txt";
28 analysis.
addTree<
RecoTrack> (
"Tracks",
"RecoNtuple/Events/ALCARECOTkAlCosmicsCTF0T");
31 TFile hout(
"histograms_tracks.root",
"recreate");
33 std::map<std::string, TH1F*> h1;
34 h1[
"n"] =
new TH1F(
"n" ,
"" , 30, 0, 30);
35 h1[
"pt"] =
new TH1F(
"pt" ,
"" , 100, 0, 770);
36 h1[
"eta"] =
new TH1F(
"eta" ,
"" , 100, -5.30, 3.30);
37 h1[
"phi"] =
new TH1F(
"phi" ,
"" , 100, -3.7, 3.7);
38 h1[
"q"] =
new TH1F(
"q",
"", 4, -2, 2);
39 h1[
"loose_qual"] =
new TH1F(
"loose_qual",
"", 2, 0, 2);
42 std::cout <<
"This analysis has " << analysis.
size() <<
" events" << std::endl;
43 int nevents = analysis.
size();
46 for (
int i = 0 ; i < nevents ; ++i )
48 if ( i > 0 && i%100000 == 0 ) std::cout << i <<
" events processed..." << std::endl;
55 for (
int t = 0 ; t < tracks->size() ; ++t )
58 h1[
"pt"] -> Fill(track.
pt());
59 h1[
"eta"] -> Fill(track.
eta());
60 h1[
"phi"] -> Fill(track.
phi());
61 h1[
"q"] -> Fill(track.
q());
66 h1[
"n"] -> Fill(ntracks);
72 ih1.second -> Write();
int main(int argc, char *argv[])