99#include <TStyle.h>
1010
1111// ### required input file: CheckClusters.root, which is the output of CheckClusters.C macro
12- void CheckClusterSizeVsEta (const std ::string & strFileInput = "CheckClusters.root" )
12+ void CheckClusterSizeVsEta (const std ::string & strFileInput = "CheckClusters.root" )
1313{
1414 gStyle -> SetOptStat (0 );
1515
16- TFile * fileInput = new TFile (strFileInput .c_str ());
17- TTree * tree = (TTree * )fileInput -> Get ("ntc" );
16+ TFile * fileInput = new TFile (strFileInput .c_str ());
17+ TTree * tree = (TTree * )fileInput -> Get ("ntc" );
1818
1919 std ::cout << "Opened tree: " << tree -> GetName ()
2020 << ", entries = " << tree -> GetEntries () << std ::endl ;
@@ -59,26 +59,24 @@ void CheckClusterSizeVsEta(const std::string &strFileInput = "CheckClusters.root
5959 tree -> SetBranchAddress ("pt" , & pt );
6060
6161 // Some QA histograms
62- TH1F * hPt = new TH1F ("hPt" , "p_{T};p_{T};Entries" , 100 , 0. , 10. );
63- TH1F * hClusSize = new TH1F ("hClusSize" , "Cluster size;clusSize;Entries" , 20 , 0. , 20. );
64- TH1F * hLayer = new TH1F ("hLayer" , "Layer;layer;Entries" , 20 , -0.5 , 19.5 );
65- TH1F * hDxGlob = new TH1F ("hDxGlob" , "clusGlobX - hitGlobX;#DeltaX [global];Entries" , 200 , -1. , 1. );
66- TH1F * hDzGlob = new TH1F ("hDzGlob" , "clusGlobZ - hitGlobZ;#DeltaZ [global];Entries" , 200 , -1. , 1. );
67- TH2F * hHitXY = new TH2F ("hHitXY" , "Hit global XY;hitGlobX;hitGlobY" , 200 , -20. , 20. , 200 , -20. , 20. );
68- TH2F * hClusVsHitX = new TH2F ("hClusVsHitX" , "clusGlobX vs hitGlobX;hitGlobX;clusGlobX" , 200 , -20. , 20. , 200 , -20. , 20. );
62+ TH1F * hPt = new TH1F ("hPt" , "p_{T};p_{T};Entries" , 100 , 0. , 10. );
63+ TH1F * hClusSize = new TH1F ("hClusSize" , "Cluster size;clusSize;Entries" , 20 , 0. , 20. );
64+ TH1F * hLayer = new TH1F ("hLayer" , "Layer;layer;Entries" , 20 , -0.5 , 19.5 );
65+ TH1F * hDxGlob = new TH1F ("hDxGlob" , "clusGlobX - hitGlobX;#DeltaX [global];Entries" , 200 , -1. , 1. );
66+ TH1F * hDzGlob = new TH1F ("hDzGlob" , "clusGlobZ - hitGlobZ;#DeltaZ [global];Entries" , 200 , -1. , 1. );
67+ TH2F * hHitXY = new TH2F ("hHitXY" , "Hit global XY;hitGlobX;hitGlobY" , 200 , -20. , 20. , 200 , -20. , 20. );
68+ TH2F * hClusVsHitX = new TH2F ("hClusVsHitX" , "clusGlobX vs hitGlobX;hitGlobX;clusGlobX" , 200 , -20. , 20. , 200 , -20. , 20. );
6969
7070 // histograms for cluster size vs eta for each layer (ML and OT barrel layers):
7171 const int nLayers = 8 ; // ML and OT barrel layers only
72- TH2F * hClustSizePerLayerVsEta [nLayers ];
73- for (int i = 0 ; i < nLayers ; i ++ )
74- {
72+ TH2F * hClustSizePerLayerVsEta [nLayers ];
73+ for (int i = 0 ; i < nLayers ; i ++ ) {
7574 hClustSizePerLayerVsEta [i ] = new TH2F (Form ("hClustSizePerLayerVsEta_Lay%d" , i ), Form ("Cluster size vs eta for layer %d;#eta;Cluster size" , i ), 160 , -4 , 4 , 101 , -0.5 , 100.5 );
7675 }
7776
7877 // Loop over entries
7978 const Long64_t nEntries = tree -> GetEntries ();
80- for (Long64_t i = 0 ; i < nEntries ; ++ i )
81- {
79+ for (Long64_t i = 0 ; i < nEntries ; ++ i ) {
8280 tree -> GetEntry (i );
8381
8482 // Fill QA histograms
@@ -103,14 +101,13 @@ void CheckClusterSizeVsEta(const std::string &strFileInput = "CheckClusters.root
103101 hClustSizePerLayerVsEta [(int )layer ]-> Fill (clustEta , clusSize );
104102
105103 // progress print
106- if ((i + 1 ) % 200000 == 0 )
107- {
104+ if ((i + 1 ) % 200000 == 0 ) {
108105 std ::cout << "Processed " << (i + 1 ) << " / " << nEntries << " entries" << std ::endl ;
109106 }
110107 }
111108
112109 // Save histograms to file
113- TFile * fout = TFile ::Open ("clusterSizes_vs_eta.root" , "RECREATE" );
110+ TFile * fout = TFile ::Open ("clusterSizes_vs_eta.root" , "RECREATE" );
114111 hPt -> Write ();
115112 hClusSize -> Write ();
116113 hLayer -> Write ();
@@ -120,7 +117,7 @@ void CheckClusterSizeVsEta(const std::string &strFileInput = "CheckClusters.root
120117 hClusVsHitX -> Write ();
121118
122119 // draw some QA histograms
123- TCanvas * c1 = new TCanvas ("canv_clusters_QA" , "Clusters QA" , 1200 , 800 );
120+ TCanvas * c1 = new TCanvas ("canv_clusters_QA" , "Clusters QA" , 1200 , 800 );
124121 c1 -> Divide (2 , 2 );
125122 c1 -> cd (1 );
126123 hPt -> Draw ();
@@ -131,10 +128,9 @@ void CheckClusterSizeVsEta(const std::string &strFileInput = "CheckClusters.root
131128 c1 -> cd (4 );
132129 hHitXY -> Draw ("COLZ" );
133130
134- TCanvas * canv_clsSize_vs_eta [nLayers ];
135- TProfile * profPerLayerVsEta [nLayers ];
136- for (int i = 0 ; i < nLayers ; i ++ )
137- {
131+ TCanvas * canv_clsSize_vs_eta [nLayers ];
132+ TProfile * profPerLayerVsEta [nLayers ];
133+ for (int i = 0 ; i < nLayers ; i ++ ) {
138134 canv_clsSize_vs_eta [i ] = new TCanvas (Form ("canv_clsSize_vs_eta_Lay%d" , i ), Form ("Cluster size vs eta for layer %d" , i ), 800 , 600 );
139135 hClustSizePerLayerVsEta [i ]-> Draw ("COLZ" );
140136 gPad -> SetLogz ();
@@ -146,11 +142,10 @@ void CheckClusterSizeVsEta(const std::string &strFileInput = "CheckClusters.root
146142 }
147143
148144 // canvas with profiles for all layers together
149- TCanvas * canv_av_clsSize_vs_eta_all_layers = new TCanvas ("canv_clsSize_vs_eta_all_layers" , "Cluster size vs eta for all layers" , 800 , 600 );
150- TLegend * legLayers = new TLegend (0.3 , 0.52 , 0.65 , 0.89 );
145+ TCanvas * canv_av_clsSize_vs_eta_all_layers = new TCanvas ("canv_clsSize_vs_eta_all_layers" , "Cluster size vs eta for all layers" , 800 , 600 );
146+ TLegend * legLayers = new TLegend (0.3 , 0.52 , 0.65 , 0.89 );
151147 int colors [] = {kRed , kBlue , kMagenta + 1 , kCyan + 1 , kGray + 2 , kRed , kBlue , kMagenta + 1 , kCyan , kAzure + 1 , kOrange - 9 , kRed + 2 , kBlue + 2 , kMagenta + 2 };
152- for (int i = 0 ; i < nLayers ; i ++ )
153- {
148+ for (int i = 0 ; i < nLayers ; i ++ ) {
154149 profPerLayerVsEta [i ]-> SetLineColor (colors [i ]);
155150 profPerLayerVsEta [i ]-> SetMarkerColor (colors [i ]);
156151 profPerLayerVsEta [i ]-> SetMarkerStyle (i < 5 ? 20 : 24 );
0 commit comments