Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-15 08:47:18

0001 void CosmicRateTool_PIXEL_HitRates(const char *fileName, unsigned int runLow = 0, unsigned int runUp = 0) {
0002   TString InputFile = Form("%s", fileName);
0003   TFile *file = new TFile(InputFile);
0004 
0005   bool IsFileExist;
0006   IsFileExist = file->IsZombie();
0007   if (IsFileExist) {
0008     cout << endl
0009          << "====================================================================================================="
0010          << endl;
0011     cout << fileName << " not found. Check the file!" << endl;
0012     cout << "====================================================================================================="
0013          << endl
0014          << endl;
0015     exit(EXIT_FAILURE);
0016   }
0017 
0018   TTree *tree = (TTree *)file->Get("cosmicRateAnalyzer/Run");
0019 
0020   double run_time;
0021   unsigned int runnum;
0022   int number_of_events;
0023   int number_of_tracks;
0024   int number_of_hits_Total;
0025   int number_of_hits_PIX;
0026   int number_of_hits_BPIX;
0027   int number_of_hits_BPIX_layer1;
0028   int number_of_hits_BPIX_layer2;
0029   int number_of_hits_BPIX_layer3;
0030   int number_of_hits_BPIX_layer4;
0031   int number_of_hits_FPIX;
0032   int number_of_hits_FPIX_disk1;
0033   int number_of_hits_FPIX_disk2;
0034   int number_of_hits_FPIX_disk3;
0035   int number_of_hits_FPIX_disk1_plus;
0036   int number_of_hits_FPIX_disk1_minus;
0037   int number_of_hits_FPIX_disk2_plus;
0038   int number_of_hits_FPIX_disk2_minus;
0039   int number_of_hits_FPIX_disk3_plus;
0040   int number_of_hits_FPIX_disk3_minus;
0041 
0042   tree->SetBranchAddress("run_time", &run_time);
0043   tree->SetBranchAddress("runnum", &runnum);
0044   tree->SetBranchAddress("number_of_events", &number_of_events);
0045   tree->SetBranchAddress("number_of_tracks", &number_of_tracks);
0046   tree->SetBranchAddress("number_of_hits_Total", &number_of_hits_Total);
0047   tree->SetBranchAddress("number_of_hits_PIX", &number_of_hits_PIX);
0048   tree->SetBranchAddress("number_of_hits_BPIX", &number_of_hits_BPIX);
0049   tree->SetBranchAddress("number_of_hits_BPIX_layer1", &number_of_hits_BPIX_layer1);
0050   tree->SetBranchAddress("number_of_hits_BPIX_layer2", &number_of_hits_BPIX_layer2);
0051   tree->SetBranchAddress("number_of_hits_BPIX_layer3", &number_of_hits_BPIX_layer3);
0052   tree->SetBranchAddress("number_of_hits_BPIX_layer4", &number_of_hits_BPIX_layer4);
0053   tree->SetBranchAddress("number_of_hits_FPIX", &number_of_hits_FPIX);
0054   tree->SetBranchAddress("number_of_hits_FPIX_disk1", &number_of_hits_FPIX_disk1);
0055   tree->SetBranchAddress("number_of_hits_FPIX_disk2", &number_of_hits_FPIX_disk2);
0056   tree->SetBranchAddress("number_of_hits_FPIX_disk3", &number_of_hits_FPIX_disk3);
0057   tree->SetBranchAddress("number_of_hits_FPIX_disk1_plus", &number_of_hits_FPIX_disk1_plus);
0058   tree->SetBranchAddress("number_of_hits_FPIX_disk1_minus", &number_of_hits_FPIX_disk1_minus);
0059   tree->SetBranchAddress("number_of_hits_FPIX_disk2_plus", &number_of_hits_FPIX_disk2_plus);
0060   tree->SetBranchAddress("number_of_hits_FPIX_disk2_minus", &number_of_hits_FPIX_disk2_minus);
0061   tree->SetBranchAddress("number_of_hits_FPIX_disk3_plus", &number_of_hits_FPIX_disk3_plus);
0062   tree->SetBranchAddress("number_of_hits_FPIX_disk3_minus", &number_of_hits_FPIX_disk3_minus);
0063 
0064   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

0065   //        Various Rates Declerations

0066   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

0067 
0068   vector<double> events;
0069   vector<double> event_rate;
0070   vector<double> event_rate_err;
0071   vector<double> track_rate;
0072   vector<double> track_rate_err;
0073   vector<double> runNumber;
0074   vector<double> runNumber_err;
0075   vector<double> tracks;
0076   vector<double> tracks_err;
0077   vector<double> weight;
0078 
0079   vector<double> hits;
0080   vector<double> hit_rate_Total;
0081   vector<double> hit_rate_Total_err;
0082   vector<double> hit_rate_PIX;
0083   vector<double> hit_rate_PIX_err;
0084   vector<double> hit_rate_BPIX;
0085   vector<double> hit_rate_BPIX_err;
0086   vector<double> hit_rate_BPIX_layer1;
0087   vector<double> hit_rate_BPIX_layer1_err;
0088   vector<double> hit_rate_BPIX_layer2;
0089   vector<double> hit_rate_BPIX_layer2_err;
0090   vector<double> hit_rate_BPIX_layer3;
0091   vector<double> hit_rate_BPIX_layer3_err;
0092   vector<double> hit_rate_BPIX_layer4;
0093   vector<double> hit_rate_BPIX_layer4_err;
0094   vector<double> hit_rate_FPIX;
0095   vector<double> hit_rate_FPIX_err;
0096   vector<double> hit_rate_FPIX_disk1;
0097   vector<double> hit_rate_FPIX_disk1_err;
0098   vector<double> hit_rate_FPIX_disk2;
0099   vector<double> hit_rate_FPIX_disk2_err;
0100   vector<double> hit_rate_FPIX_disk3;
0101   vector<double> hit_rate_FPIX_disk3_err;
0102   vector<double> hit_rate_FPIX_disk1_plus;
0103   vector<double> hit_rate_FPIX_disk1_plus_err;
0104   vector<double> hit_rate_FPIX_disk1_minus;
0105   vector<double> hit_rate_FPIX_disk1_minus_err;
0106   vector<double> hit_rate_FPIX_disk2_plus;
0107   vector<double> hit_rate_FPIX_disk2_plus_err;
0108   vector<double> hit_rate_FPIX_disk2_minus;
0109   vector<double> hit_rate_FPIX_disk2_minus_err;
0110   vector<double> hit_rate_FPIX_disk3_plus;
0111   vector<double> hit_rate_FPIX_disk3_plus_err;
0112   vector<double> hit_rate_FPIX_disk3_minus;
0113   vector<double> hit_rate_FPIX_disk3_minus_err;
0114 
0115   string Bar_Xtitle_BPIX[6] = {"PIXEL", "BPIX", "BPIX_1", "BPIX_2", "BPIX_3", "BPIX_4"};
0116   string Bar_Xtitle_FPIX[11] = {
0117       "PIXEL", "FPIX", "FPIX_1", "FPIX_1+", "FPIX_1-", "FPIX_2", "FPIX_2+", "FPIX_2-", "FPIX_3", "FPIX_3+", "FPIX_3-"};
0118   string Bar_Xtitle_PIXEL[10] = {
0119       "PIXEL", "BPIX", "BPIX_1", "BPIX_2", "BPIX_3", "BPIX_4", "FPIX", "FPIX_1", "FPIX_2", "FPIX_3"};
0120   double Bar_Ytitle_BPIX[6] = {0};
0121   double Bar_Ytitle_FPIX[11] = {0};
0122   double Bar_Ytitle_PIXEL[10] = {0};
0123 
0124   int j = 0;
0125   double total_tracks = 0, nTotalEvents = 0, nTotalTracks = 0, nTotalHits = 0, nZeroRunTimeRuns = 0;
0126 
0127   Long64_t n = tree->GetEntriesFast();
0128   for (Long64_t jentry = 0; jentry < n; jentry++) {
0129     tree->GetEntry(jentry);
0130     if (run_time == 0 || run_time < 0) {
0131       nZeroRunTimeRuns++;
0132       continue;
0133     }
0134 
0135     if (runLow != 0 && runUp != 0) {
0136       if (runnum < runLow)
0137         continue;
0138       if (runnum > runUp)
0139         break;
0140     }
0141 
0142     events.push_back(number_of_events);
0143     event_rate.push_back(number_of_events / run_time);
0144     runNumber.push_back(runnum);
0145     track_rate.push_back(number_of_tracks / run_time);
0146     tracks.push_back(number_of_tracks);
0147 
0148     nTotalEvents += number_of_events;
0149     nTotalTracks += number_of_tracks;
0150     nTotalHits += number_of_hits_Total;
0151 
0152     hits.push_back(number_of_hits_Total);
0153     hit_rate_Total.push_back(number_of_hits_Total / run_time);
0154     hit_rate_Total_err.push_back(sqrt(float(number_of_hits_Total)) / run_time);
0155     hit_rate_PIX.push_back(number_of_hits_PIX / run_time);
0156     hit_rate_PIX_err.push_back(sqrt(float(number_of_hits_PIX)) / run_time);
0157     hit_rate_BPIX.push_back(number_of_hits_BPIX / run_time);
0158     hit_rate_BPIX_err.push_back(sqrt(float(number_of_hits_BPIX)) / run_time);
0159     hit_rate_BPIX_layer1.push_back(number_of_hits_BPIX_layer1 / run_time);
0160     hit_rate_BPIX_layer1_err.push_back(sqrt(float(number_of_hits_BPIX_layer1)) / run_time);
0161     hit_rate_BPIX_layer2.push_back(number_of_hits_BPIX_layer2 / run_time);
0162     hit_rate_BPIX_layer2_err.push_back(sqrt(float(number_of_hits_BPIX_layer2)) / run_time);
0163     hit_rate_BPIX_layer3.push_back(number_of_hits_BPIX_layer3 / run_time);
0164     hit_rate_BPIX_layer3_err.push_back(sqrt(float(number_of_hits_BPIX_layer3)) / run_time);
0165     hit_rate_BPIX_layer4.push_back(number_of_hits_BPIX_layer4 / run_time);
0166     hit_rate_BPIX_layer4_err.push_back(sqrt(float(number_of_hits_BPIX_layer4)) / run_time);
0167     hit_rate_FPIX.push_back(number_of_hits_FPIX / run_time);
0168     hit_rate_FPIX_err.push_back(sqrt(float(number_of_hits_FPIX)) / run_time);
0169     hit_rate_FPIX_disk1.push_back(number_of_hits_FPIX_disk1 / run_time);
0170     hit_rate_FPIX_disk1_err.push_back(sqrt(float(number_of_hits_FPIX_disk1)) / run_time);
0171     hit_rate_FPIX_disk2.push_back(number_of_hits_FPIX_disk2 / run_time);
0172     hit_rate_FPIX_disk2_err.push_back(sqrt(float(number_of_hits_FPIX_disk2)) / run_time);
0173     hit_rate_FPIX_disk3.push_back(number_of_hits_FPIX_disk3 / run_time);
0174     hit_rate_FPIX_disk3_err.push_back(sqrt(float(number_of_hits_FPIX_disk3)) / run_time);
0175     hit_rate_FPIX_disk1_plus.push_back(number_of_hits_FPIX_disk1_plus / run_time);
0176     hit_rate_FPIX_disk1_plus_err.push_back(sqrt(float(number_of_hits_FPIX_disk1_plus)) / run_time);
0177     hit_rate_FPIX_disk1_minus.push_back(number_of_hits_FPIX_disk1_minus / run_time);
0178     hit_rate_FPIX_disk1_minus_err.push_back(sqrt(float(number_of_hits_FPIX_disk1_minus)) / run_time);
0179     hit_rate_FPIX_disk2_plus.push_back(number_of_hits_FPIX_disk2_plus / run_time);
0180     hit_rate_FPIX_disk2_plus_err.push_back(sqrt(float(number_of_hits_FPIX_disk2_plus)) / run_time);
0181     hit_rate_FPIX_disk2_minus.push_back(number_of_hits_FPIX_disk2_minus / run_time);
0182     hit_rate_FPIX_disk2_minus_err.push_back(sqrt(float(number_of_hits_FPIX_disk2_minus)) / run_time);
0183     hit_rate_FPIX_disk3_plus.push_back(number_of_hits_FPIX_disk3_plus / run_time);
0184     hit_rate_FPIX_disk3_plus_err.push_back(sqrt(float(number_of_hits_FPIX_disk3_plus)) / run_time);
0185     hit_rate_FPIX_disk3_minus.push_back(number_of_hits_FPIX_disk3_minus / run_time);
0186     hit_rate_FPIX_disk3_minus_err.push_back(sqrt(float(number_of_hits_FPIX_disk3_minus)) / run_time);
0187 
0188     track_rate_err.push_back(sqrt(float(number_of_tracks)) / run_time);
0189     event_rate_err.push_back(sqrt(float(number_of_events)) / run_time);
0190     runNumber_err.push_back(0);
0191 
0192     j++;
0193   }
0194   std::cout << "Total Runs in this files: " << n << endl;
0195   std::cout << "Runs with negative or 0 runtime: " << nZeroRunTimeRuns << endl;
0196   std::cout << "Total Events: " << nTotalEvents << std::endl;
0197   std::cout << "Total Tracks: " << nTotalTracks << std::endl;
0198   std::cout << "Total Hits: " << nTotalHits << std::endl;
0199   std::cout << "Runs without 0 or negative runtime actually used in plotting & evaluation(j value): " << j << std::endl;
0200 
0201   //+++++++++++++++++++++++++++++       Make Directory     +++++++++++++++++++++++++++++++++++++

0202   gSystem->Exec("mkdir -p Hit_Rate_Plots");
0203 
0204   //-----------------------------------    PLOTTING  -------------------------------------------

0205   TCanvas c("c1", "c1", 604, 82, 856, 836);  // Declare canvas

0206   gStyle->SetOptStat(0);
0207   c.Range(298434.4, -0.2989256, 299381.3, 2.010954);
0208   c.SetFillColor(0);
0209   c.SetBorderMode(0);
0210   c.SetBorderSize(2);
0211   c.SetTickx(1);
0212   c.SetTicky(1);
0213   c.SetGrid();
0214   c.SetLeftMargin(0.1883886);
0215   c.SetRightMargin(0.03909953);
0216   c.SetTopMargin(0.0875817);
0217   c.SetBottomMargin(0.1294118);
0218   c.SetFrameLineWidth(3);
0219   c.SetFrameBorderMode(0);
0220 
0221   //============  Text  =============//

0222   TLatex top_right_Title = TLatex();
0223   top_right_Title.SetTextFont(42);
0224   top_right_Title.SetTextSize(0.03717);
0225 
0226   TLatex detector = TLatex();
0227   detector.SetTextFont(62);
0228   detector.SetTextSize(0.047);
0229 
0230   //-------- TVectors to be taken as input in TGraphs for plotting ---------//

0231   TVectorD event_rate_VecD;
0232   TVectorD event_rate_err_VecD;
0233   TVectorD track_rate_VecD;
0234   TVectorD track_rate_err_VecD;
0235   TVectorD runNumber_VecD;
0236   TVectorD runNumber_err_VecD;
0237   TVectorD hit_rate_VecD;
0238   TVectorD hit_rate_err_VecD;
0239   TVectorD hit_rate_PIX_VecD;
0240   TVectorD hit_rate_PIX_err_VecD;
0241   TVectorD hit_rate_BPIX_VecD;
0242   TVectorD hit_rate_BPIX_err_VecD;
0243   TVectorD hit_rate_BPIX_layer1_VecD;
0244   TVectorD hit_rate_BPIX_layer1_err_VecD;
0245   TVectorD hit_rate_BPIX_layer2_VecD;
0246   TVectorD hit_rate_BPIX_layer2_err_VecD;
0247   TVectorD hit_rate_BPIX_layer3_VecD;
0248   TVectorD hit_rate_BPIX_layer3_err_VecD;
0249   TVectorD hit_rate_BPIX_layer4_VecD;
0250   TVectorD hit_rate_BPIX_layer4_err_VecD;
0251   TVectorD hit_rate_FPIX_VecD;
0252   TVectorD hit_rate_FPIX_err_VecD;
0253   TVectorD hit_rate_FPIX_disk1_VecD;
0254   TVectorD hit_rate_FPIX_disk1_err_VecD;
0255   TVectorD hit_rate_FPIX_disk2_VecD;
0256   TVectorD hit_rate_FPIX_disk2_err_VecD;
0257   TVectorD hit_rate_FPIX_disk3_VecD;
0258   TVectorD hit_rate_FPIX_disk3_err_VecD;
0259   TVectorD hit_rate_FPIX_disk1_plus_VecD;
0260   TVectorD hit_rate_FPIX_disk1_plus_err_VecD;
0261   TVectorD hit_rate_FPIX_disk1_minus_VecD;
0262   TVectorD hit_rate_FPIX_disk1_minus_err_VecD;
0263   TVectorD hit_rate_FPIX_disk2_plus_VecD;
0264   TVectorD hit_rate_FPIX_disk2_plus_err_VecD;
0265   TVectorD hit_rate_FPIX_disk2_minus_VecD;
0266   TVectorD hit_rate_FPIX_disk2_minus_err_VecD;
0267   TVectorD hit_rate_FPIX_disk3_plus_VecD;
0268   TVectorD hit_rate_FPIX_disk3_plus_err_VecD;
0269   TVectorD hit_rate_FPIX_disk3_minus_VecD;
0270   TVectorD hit_rate_FPIX_disk3_minus_err_VecD;
0271 
0272   runNumber_VecD.Use(runNumber.size(), &(runNumber[0]));
0273   runNumber_err_VecD.Use(runNumber_err.size(), &(runNumber_err[0]));
0274   event_rate_VecD.Use(event_rate.size(), &(event_rate[0]));
0275   event_rate_err_VecD.Use(event_rate_err.size(), &(event_rate_err[0]));
0276   track_rate_VecD.Use(track_rate.size(), &(track_rate[0]));
0277   track_rate_err_VecD.Use(track_rate_err.size(), &(track_rate_err[0]));
0278   hit_rate_VecD.Use(hit_rate_Total.size(), &(hit_rate_Total[0]));
0279   hit_rate_err_VecD.Use(hit_rate_Total_err.size(), &(hit_rate_Total_err[0]));
0280   hit_rate_PIX_VecD.Use(hit_rate_PIX.size(), &(hit_rate_PIX[0]));
0281   hit_rate_PIX_err_VecD.Use(hit_rate_PIX_err.size(), &(hit_rate_PIX_err[0]));
0282   hit_rate_BPIX_VecD.Use(hit_rate_BPIX.size(), &(hit_rate_BPIX[0]));
0283   hit_rate_BPIX_err_VecD.Use(hit_rate_BPIX_err.size(), &(hit_rate_BPIX_err[0]));
0284   hit_rate_BPIX_layer1_VecD.Use(hit_rate_BPIX_layer1.size(), &(hit_rate_BPIX_layer1[0]));
0285   hit_rate_BPIX_layer1_err_VecD.Use(hit_rate_BPIX_layer1_err.size(), &(hit_rate_BPIX_layer1_err[0]));
0286   hit_rate_BPIX_layer2_VecD.Use(hit_rate_BPIX_layer2.size(), &(hit_rate_BPIX_layer2[0]));
0287   hit_rate_BPIX_layer2_err_VecD.Use(hit_rate_BPIX_layer2_err.size(), &(hit_rate_BPIX_layer2_err[0]));
0288   hit_rate_BPIX_layer3_VecD.Use(hit_rate_BPIX_layer3.size(), &(hit_rate_BPIX_layer3[0]));
0289   hit_rate_BPIX_layer3_err_VecD.Use(hit_rate_BPIX_layer3_err.size(), &(hit_rate_BPIX_layer3_err[0]));
0290   hit_rate_BPIX_layer4_VecD.Use(hit_rate_BPIX_layer4.size(), &(hit_rate_BPIX_layer4[0]));
0291   hit_rate_BPIX_layer4_err_VecD.Use(hit_rate_BPIX_layer4_err.size(), &(hit_rate_BPIX_layer4_err[0]));
0292   hit_rate_FPIX_VecD.Use(hit_rate_FPIX.size(), &(hit_rate_FPIX[0]));
0293   hit_rate_FPIX_err_VecD.Use(hit_rate_FPIX_err.size(), &(hit_rate_FPIX_err[0]));
0294   hit_rate_FPIX_disk1_VecD.Use(hit_rate_FPIX_disk1.size(), &(hit_rate_FPIX_disk1[0]));
0295   hit_rate_FPIX_disk1_err_VecD.Use(hit_rate_FPIX_disk1_err.size(), &(hit_rate_FPIX_disk1_err[0]));
0296   hit_rate_FPIX_disk2_VecD.Use(hit_rate_FPIX_disk2.size(), &(hit_rate_FPIX_disk2[0]));
0297   hit_rate_FPIX_disk2_err_VecD.Use(hit_rate_FPIX_disk2_err.size(), &(hit_rate_FPIX_disk2_err[0]));
0298   hit_rate_FPIX_disk3_VecD.Use(hit_rate_FPIX_disk3.size(), &(hit_rate_FPIX_disk3[0]));
0299   hit_rate_FPIX_disk3_err_VecD.Use(hit_rate_FPIX_disk3_err.size(), &(hit_rate_FPIX_disk3_err[0]));
0300   hit_rate_FPIX_disk1_plus_VecD.Use(hit_rate_FPIX_disk1_plus.size(), &(hit_rate_FPIX_disk1_plus[0]));
0301   hit_rate_FPIX_disk1_plus_err_VecD.Use(hit_rate_FPIX_disk1_plus_err.size(), &(hit_rate_FPIX_disk1_plus_err[0]));
0302   hit_rate_FPIX_disk1_minus_VecD.Use(hit_rate_FPIX_disk1_minus.size(), &(hit_rate_FPIX_disk1_minus[0]));
0303   hit_rate_FPIX_disk1_minus_err_VecD.Use(hit_rate_FPIX_disk1_minus_err.size(), &(hit_rate_FPIX_disk1_minus_err[0]));
0304   hit_rate_FPIX_disk2_plus_VecD.Use(hit_rate_FPIX_disk2_plus.size(), &(hit_rate_FPIX_disk2_plus[0]));
0305   hit_rate_FPIX_disk2_plus_err_VecD.Use(hit_rate_FPIX_disk2_plus_err.size(), &(hit_rate_FPIX_disk2_plus_err[0]));
0306   hit_rate_FPIX_disk2_minus_VecD.Use(hit_rate_FPIX_disk2_minus.size(), &(hit_rate_FPIX_disk2_minus[0]));
0307   hit_rate_FPIX_disk2_minus_err_VecD.Use(hit_rate_FPIX_disk2_minus_err.size(), &(hit_rate_FPIX_disk2_minus_err[0]));
0308   hit_rate_FPIX_disk3_plus_VecD.Use(hit_rate_FPIX_disk3_plus.size(), &(hit_rate_FPIX_disk3_plus[0]));
0309   hit_rate_FPIX_disk3_plus_err_VecD.Use(hit_rate_FPIX_disk3_plus_err.size(), &(hit_rate_FPIX_disk3_plus_err[0]));
0310   hit_rate_FPIX_disk3_minus_VecD.Use(hit_rate_FPIX_disk3_minus.size(), &(hit_rate_FPIX_disk3_minus[0]));
0311   hit_rate_FPIX_disk3_minus_err_VecD.Use(hit_rate_FPIX_disk3_minus_err.size(), &(hit_rate_FPIX_disk3_minus_err[0]));
0312 
0313   //+++++++++++++++++++++++++++++  Overall event rate  +++++++++++++++++++++++++++++++++++++

0314 
0315   TGraphErrors gr_event_rate(runNumber_VecD, event_rate_VecD, runNumber_err_VecD, event_rate_err_VecD);
0316   gr_event_rate.GetXaxis()->SetTitle("Run Number");
0317   gr_event_rate.GetXaxis()->SetLabelSize(0.04);
0318   gr_event_rate.GetXaxis()->SetNoExponent();
0319   gr_event_rate.GetXaxis()->SetNdivisions(5);
0320   gr_event_rate.GetYaxis()->SetTitle("Event Rate (Hz)");
0321   gr_event_rate.GetXaxis()->SetTitleSize(0.05);
0322   gr_event_rate.GetYaxis()->SetLabelSize(0.05);
0323   gr_event_rate.GetYaxis()->SetTitleSize(0.05);
0324   gr_event_rate.SetMarkerStyle(20);
0325   gr_event_rate.SetMarkerSize(1.4);
0326   gr_event_rate.SetMarkerColor(kRed);
0327   gr_event_rate.SetTitle("");
0328   gr_event_rate.Draw("AP");
0329   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0330   detector.DrawLatexNDC(0.23, 0.83, "Event Rate");
0331   c.SetGrid();
0332   c.SaveAs("event_rate.png");
0333   c.SaveAs("event_rate.pdf");
0334   c.SaveAs("event_rate.C");
0335   c.Clear();
0336   gSystem->Exec("mv event_rate.png Hit_Rate_Plots");
0337   gSystem->Exec("mv event_rate.pdf Hit_Rate_Plots");
0338   gSystem->Exec("mv event_rate.C Hit_Rate_Plots");
0339   //-----------------------------------------------------------------------------------------------

0340 
0341   //++++++++++++++++++++++++++++++  Overall track rate  +++++++++++++++++++++++++++++++++++++++++++

0342 
0343   TGraphErrors gr_track_rate(runNumber_VecD, track_rate_VecD, runNumber_err_VecD, track_rate_err_VecD);
0344   gr_track_rate.GetXaxis()->SetTitle("Run Number");
0345   gr_track_rate.GetXaxis()->SetLabelSize(0.04);
0346   gr_track_rate.GetXaxis()->SetNoExponent();
0347   gr_track_rate.GetXaxis()->SetNdivisions(5);
0348   gr_track_rate.GetYaxis()->SetTitle("Track Rate (Hz)");
0349   gr_track_rate.GetXaxis()->SetTitleSize(0.05);
0350   gr_track_rate.GetYaxis()->SetLabelSize(0.05);
0351   gr_track_rate.GetYaxis()->SetTitleSize(0.05);
0352   gr_track_rate.SetMarkerStyle(20);
0353   gr_track_rate.SetMarkerSize(1.4);
0354   gr_track_rate.SetMarkerColor(kRed);
0355   gr_track_rate.SetTitle("");
0356   gr_track_rate.Draw("AP");
0357   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0358   detector.DrawLatexNDC(0.23, 0.83, "Track Rate");
0359   c.SetGrid();
0360   c.SaveAs("track_rate.png");
0361   c.SaveAs("track_rate.pdf");
0362   c.SaveAs("track_rate.C");
0363   c.Clear();
0364   gSystem->Exec("mv track_rate.png Hit_Rate_Plots");
0365   gSystem->Exec("mv track_rate.pdf Hit_Rate_Plots");
0366   gSystem->Exec("mv track_rate.C Hit_Rate_Plots");
0367 
0368   //-----------------------------------------------------------------------------------------------

0369 
0370   //++++++++++++++++++++++++++++++  Overall hit rate  +++++++++++++++++++++++++++++++++++++++++++

0371 
0372   TGraphErrors gr_hit_rate(runNumber_VecD, hit_rate_VecD, runNumber_err_VecD, hit_rate_err_VecD);
0373   gr_hit_rate.GetXaxis()->SetTitle("Run Number");
0374   gr_hit_rate.GetXaxis()->SetLabelSize(0.04);
0375   gr_hit_rate.GetXaxis()->SetNoExponent();
0376   gr_hit_rate.GetXaxis()->SetNdivisions(5);
0377   gr_hit_rate.GetYaxis()->SetTitle("Hit Rate (Hz)");
0378   gr_hit_rate.GetXaxis()->SetTitleSize(0.05);
0379   gr_hit_rate.GetYaxis()->SetLabelSize(0.05);
0380   gr_hit_rate.GetYaxis()->SetTitleSize(0.05);
0381   gr_hit_rate.SetMarkerStyle(20);
0382   gr_hit_rate.SetMarkerSize(1.4);
0383   gr_hit_rate.SetMarkerColor(kRed);
0384   gr_hit_rate.SetTitle("");
0385   gr_hit_rate.Draw("AP");
0386   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0387   detector.DrawLatexNDC(0.23, 0.83, "Hit Rate");
0388   c.SetGrid();
0389   c.SaveAs("hit_rate.png");
0390   c.SaveAs("hit_rate.pdf");
0391   c.SaveAs("hit_rate.C");
0392   c.Clear();
0393   gSystem->Exec("mv hit_rate.png Hit_Rate_Plots");
0394   gSystem->Exec("mv hit_rate.pdf Hit_Rate_Plots");
0395   gSystem->Exec("mv hit_rate.C Hit_Rate_Plots");
0396 
0397   //-----------------------------------------------------------------------------------------------

0398 
0399   //+++++++++++++++++++++++++++++++  Total Pixel hit rate +++++++++++++++++++++++++++++++++++++++

0400 
0401   TGraphErrors gr_hit_rate_PIX(runNumber_VecD, hit_rate_PIX_VecD, runNumber_err_VecD, hit_rate_PIX_err_VecD);
0402   gr_hit_rate_PIX.GetXaxis()->SetTitle("Run Number");
0403   gr_hit_rate_PIX.GetXaxis()->SetLabelSize(0.04);
0404   gr_hit_rate_PIX.GetXaxis()->SetNoExponent();
0405   gr_hit_rate_PIX.GetXaxis()->SetNdivisions(5);
0406   gr_hit_rate_PIX.GetYaxis()->SetTitle("Hit Rate (Hz)");
0407   gr_hit_rate_PIX.GetXaxis()->SetTitleSize(0.05);
0408   gr_hit_rate_PIX.GetYaxis()->SetLabelSize(0.05);
0409   gr_hit_rate_PIX.GetYaxis()->SetTitleSize(0.05);
0410   gr_hit_rate_PIX.SetMarkerStyle(20);
0411   gr_hit_rate_PIX.SetMarkerSize(1.4);
0412   gr_hit_rate_PIX.SetMarkerColor(2);
0413   gr_hit_rate_PIX.SetTitle("");
0414   gr_hit_rate_PIX.Draw("AP");
0415   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0416   detector.DrawLatexNDC(0.23, 0.83, "PIXEL");
0417   c.SetGrid();
0418   c.SaveAs("pixel_hit_rate.png");
0419   c.SaveAs("pixel_hit_rate.pdf");
0420   c.SaveAs("pixel_hit_rate.C");
0421   c.Clear();
0422   gSystem->Exec("mv pixel_hit_rate.png Hit_Rate_Plots");
0423   gSystem->Exec("mv pixel_hit_rate.pdf Hit_Rate_Plots");
0424   gSystem->Exec("mv pixel_hit_rate.C Hit_Rate_Plots");
0425 
0426   //-----------------------------------------------------------------------------------------------

0427 
0428   //++++++++++++++++++++++++++++++++  FPIX hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0429 
0430   TGraphErrors gr_hit_rate_FPIX(runNumber_VecD, hit_rate_FPIX_VecD, runNumber_err_VecD, hit_rate_FPIX_err_VecD);
0431   gr_hit_rate_FPIX.GetXaxis()->SetTitle("Run Number");
0432   gr_hit_rate_FPIX.GetXaxis()->SetLabelSize(0.04);
0433   gr_hit_rate_FPIX.GetXaxis()->SetNoExponent();
0434   gr_hit_rate_FPIX.GetXaxis()->SetNdivisions(5);
0435   gr_hit_rate_FPIX.GetYaxis()->SetTitle("Hit Rate (Hz)");
0436   gr_hit_rate_FPIX.GetXaxis()->SetTitleSize(0.05);
0437   gr_hit_rate_FPIX.GetYaxis()->SetLabelSize(0.05);
0438   gr_hit_rate_FPIX.GetYaxis()->SetTitleSize(0.05);
0439   gr_hit_rate_FPIX.SetMarkerStyle(20);
0440   gr_hit_rate_FPIX.SetMarkerSize(1.4);
0441   gr_hit_rate_FPIX.SetMarkerColor(kRed);
0442   gr_hit_rate_FPIX.SetTitle("");
0443   gr_hit_rate_FPIX.Draw("AP");
0444   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0445   detector.DrawLatexNDC(0.23, 0.83, "FPIX");
0446   c.SetGrid();
0447   c.SaveAs("fpix_hit_rate.png");
0448   c.SaveAs("fpix_hit_rate.pdf");
0449   c.SaveAs("fpix_hit_rate.C");
0450   c.Clear();
0451   gSystem->Exec("mv fpix_hit_rate.png Hit_Rate_Plots");
0452   gSystem->Exec("mv fpix_hit_rate.pdf Hit_Rate_Plots");
0453   gSystem->Exec("mv fpix_hit_rate.C Hit_Rate_Plots");
0454   //-----------------------------------------------------------------------------------------------

0455 
0456   //++++++++++++++++++++++++++++++++  FPIX Disk1 hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0457 
0458   TGraphErrors gr_hit_rate_FPIX_disk1(
0459       runNumber_VecD, hit_rate_FPIX_disk1_VecD, runNumber_err_VecD, hit_rate_FPIX_disk1_err_VecD);
0460   gr_hit_rate_FPIX_disk1.GetXaxis()->SetTitle("Run Number");
0461   gr_hit_rate_FPIX_disk1.GetXaxis()->SetLabelSize(0.04);
0462   gr_hit_rate_FPIX_disk1.GetXaxis()->SetNoExponent();
0463   gr_hit_rate_FPIX_disk1.GetXaxis()->SetNdivisions(5);
0464   gr_hit_rate_FPIX_disk1.GetYaxis()->SetTitle("Hit Rate (Hz)");
0465   gr_hit_rate_FPIX_disk1.GetXaxis()->SetTitleSize(0.05);
0466   gr_hit_rate_FPIX_disk1.GetYaxis()->SetLabelSize(0.05);
0467   gr_hit_rate_FPIX_disk1.GetYaxis()->SetTitleSize(0.05);
0468   gr_hit_rate_FPIX_disk1.SetMarkerStyle(20);
0469   gr_hit_rate_FPIX_disk1.SetMarkerSize(1.4);
0470   gr_hit_rate_FPIX_disk1.SetMarkerColor(kRed);
0471   gr_hit_rate_FPIX_disk1.SetTitle("");
0472   gr_hit_rate_FPIX_disk1.Draw("AP");
0473   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0474   detector.DrawLatexNDC(0.23, 0.83, "FPIX disk 1");
0475   c.SetGrid();
0476   c.SaveAs("fpix_hit_rate_disk1.png");
0477   c.SaveAs("fpix_hit_rate_disk1.pdf");
0478   c.SaveAs("fpix_hit_rate_disk1.C");
0479   c.Clear();
0480   gSystem->Exec("mv fpix_hit_rate_disk1.png Hit_Rate_Plots");
0481   gSystem->Exec("mv fpix_hit_rate_disk1.pdf Hit_Rate_Plots");
0482   gSystem->Exec("mv fpix_hit_rate_disk1.C Hit_Rate_Plots");
0483   //-----------------------------------------------------------------------------------------------

0484 
0485   //++++++++++++++++++++++++++++++++  FPIX Disk2 hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0486 
0487   TGraphErrors gr_hit_rate_FPIX_disk2(
0488       runNumber_VecD, hit_rate_FPIX_disk2_VecD, runNumber_err_VecD, hit_rate_FPIX_disk2_err_VecD);
0489   gr_hit_rate_FPIX_disk2.GetXaxis()->SetTitle("Run Number");
0490   gr_hit_rate_FPIX_disk2.GetXaxis()->SetLabelSize(0.04);
0491   gr_hit_rate_FPIX_disk2.GetXaxis()->SetNoExponent();
0492   gr_hit_rate_FPIX_disk2.GetXaxis()->SetNdivisions(5);
0493   gr_hit_rate_FPIX_disk2.GetYaxis()->SetTitle("Hit Rate (Hz)");
0494   gr_hit_rate_FPIX_disk2.GetXaxis()->SetTitleSize(0.05);
0495   gr_hit_rate_FPIX_disk2.GetYaxis()->SetLabelSize(0.05);
0496   gr_hit_rate_FPIX_disk2.GetYaxis()->SetTitleSize(0.05);
0497   gr_hit_rate_FPIX_disk2.SetMarkerStyle(20);
0498   gr_hit_rate_FPIX_disk2.SetMarkerSize(1.4);
0499   gr_hit_rate_FPIX_disk2.SetMarkerColor(kRed);
0500   gr_hit_rate_FPIX_disk2.SetTitle("");
0501   gr_hit_rate_FPIX_disk2.Draw("AP");
0502   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0503   detector.DrawLatexNDC(0.23, 0.83, "FPIX disk 2");
0504   c.SetGrid();
0505   c.SaveAs("fpix_hit_rate_disk2.png");
0506   c.SaveAs("fpix_hit_rate_disk2.pdf");
0507   c.SaveAs("fpix_hit_rate_disk2.C");
0508   c.Clear();
0509   gSystem->Exec("mv fpix_hit_rate_disk2.png Hit_Rate_Plots");
0510   gSystem->Exec("mv fpix_hit_rate_disk2.pdf Hit_Rate_Plots");
0511   gSystem->Exec("mv fpix_hit_rate_disk2.C Hit_Rate_Plots");
0512   //-----------------------------------------------------------------------------------------------

0513 
0514   //++++++++++++++++++++++++++++++++  FPIX Disk3 hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0515 
0516   TGraphErrors gr_hit_rate_FPIX_disk3(
0517       runNumber_VecD, hit_rate_FPIX_disk3_VecD, runNumber_err_VecD, hit_rate_FPIX_disk3_err_VecD);
0518   gr_hit_rate_FPIX_disk3.GetXaxis()->SetTitle("Run Number");
0519   gr_hit_rate_FPIX_disk3.GetXaxis()->SetLabelSize(0.04);
0520   gr_hit_rate_FPIX_disk3.GetXaxis()->SetNoExponent();
0521   gr_hit_rate_FPIX_disk3.GetXaxis()->SetNdivisions(5);
0522   gr_hit_rate_FPIX_disk3.GetYaxis()->SetTitle("Hit Rate (Hz)");
0523   gr_hit_rate_FPIX_disk3.GetXaxis()->SetTitleSize(0.05);
0524   gr_hit_rate_FPIX_disk3.GetYaxis()->SetLabelSize(0.05);
0525   gr_hit_rate_FPIX_disk3.GetYaxis()->SetTitleSize(0.05);
0526   gr_hit_rate_FPIX_disk3.SetMarkerStyle(20);
0527   gr_hit_rate_FPIX_disk3.SetMarkerSize(1.4);
0528   gr_hit_rate_FPIX_disk3.SetMarkerColor(kRed);
0529   gr_hit_rate_FPIX_disk3.SetTitle("");
0530   gr_hit_rate_FPIX_disk3.Draw("AP");
0531   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0532   detector.DrawLatexNDC(0.23, 0.83, "FPIX disk 3");
0533   c.SetGrid();
0534   c.SaveAs("fpix_hit_rate_disk3.png");
0535   c.SaveAs("fpix_hit_rate_disk3.pdf");
0536   c.SaveAs("fpix_hit_rate_disk3.C");
0537   c.Clear();
0538   gSystem->Exec("mv fpix_hit_rate_disk3.png Hit_Rate_Plots");
0539   gSystem->Exec("mv fpix_hit_rate_disk3.pdf Hit_Rate_Plots");
0540   gSystem->Exec("mv fpix_hit_rate_disk3.C Hit_Rate_Plots");
0541   //-----------------------------------------------------------------------------------------------

0542 
0543   //++++++++++++++++++++++++++++++++  FPIX Disk1+ hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0544 
0545   TGraphErrors gr_hit_rate_FPIX_disk1_plus(
0546       runNumber_VecD, hit_rate_FPIX_disk1_plus_VecD, runNumber_err_VecD, hit_rate_FPIX_disk1_plus_err_VecD);
0547   gr_hit_rate_FPIX_disk1_plus.GetXaxis()->SetTitle("Run Number");
0548   gr_hit_rate_FPIX_disk1_plus.GetXaxis()->SetLabelSize(0.04);
0549   gr_hit_rate_FPIX_disk1_plus.GetXaxis()->SetNoExponent();
0550   gr_hit_rate_FPIX_disk1_plus.GetXaxis()->SetNdivisions(5);
0551   gr_hit_rate_FPIX_disk1_plus.GetYaxis()->SetTitle("Hit Rate (Hz)");
0552   gr_hit_rate_FPIX_disk1_plus.GetXaxis()->SetTitleSize(0.05);
0553   gr_hit_rate_FPIX_disk1_plus.GetYaxis()->SetLabelSize(0.05);
0554   gr_hit_rate_FPIX_disk1_plus.GetYaxis()->SetTitleSize(0.05);
0555   gr_hit_rate_FPIX_disk1_plus.SetMarkerStyle(20);
0556   gr_hit_rate_FPIX_disk1_plus.SetMarkerSize(1.4);
0557   gr_hit_rate_FPIX_disk1_plus.SetMarkerColor(kRed);
0558   gr_hit_rate_FPIX_disk1_plus.SetTitle("");
0559   gr_hit_rate_FPIX_disk1_plus.Draw("AP");
0560   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0561   detector.DrawLatexNDC(0.23, 0.83, "FPIX disk 1+");
0562   c.SetGrid();
0563   c.SaveAs("fpix_hit_rate_disk1_plus.png");
0564   c.SaveAs("fpix_hit_rate_disk1_plus.C");
0565   c.SaveAs("fpix_hit_rate_disk1_plus.pdf");
0566   c.Clear();
0567   gSystem->Exec("mv fpix_hit_rate_disk1_plus.png Hit_Rate_Plots");
0568   gSystem->Exec("mv fpix_hit_rate_disk1_plus.pdf Hit_Rate_Plots");
0569   gSystem->Exec("mv fpix_hit_rate_disk1_plus.C Hit_Rate_Plots");
0570   //-----------------------------------------------------------------------------------------------

0571 
0572   //++++++++++++++++++++++++++++++++  FPIX Disk1- hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0573 
0574   TGraphErrors gr_hit_rate_FPIX_disk1_minus(
0575       runNumber_VecD, hit_rate_FPIX_disk1_minus_VecD, runNumber_err_VecD, hit_rate_FPIX_disk1_minus_err_VecD);
0576   gr_hit_rate_FPIX_disk1_minus.GetXaxis()->SetTitle("Run Number");
0577   gr_hit_rate_FPIX_disk1_minus.GetXaxis()->SetLabelSize(0.04);
0578   gr_hit_rate_FPIX_disk1_minus.GetXaxis()->SetNoExponent();
0579   gr_hit_rate_FPIX_disk1_minus.GetXaxis()->SetNdivisions(5);
0580   gr_hit_rate_FPIX_disk1_minus.GetYaxis()->SetTitle("Hit Rate (Hz)");
0581   gr_hit_rate_FPIX_disk1_minus.GetXaxis()->SetTitleSize(0.05);
0582   gr_hit_rate_FPIX_disk1_minus.GetYaxis()->SetLabelSize(0.05);
0583   gr_hit_rate_FPIX_disk1_minus.GetYaxis()->SetTitleSize(0.05);
0584   gr_hit_rate_FPIX_disk1_minus.SetMarkerStyle(20);
0585   gr_hit_rate_FPIX_disk1_minus.SetMarkerSize(1.4);
0586   gr_hit_rate_FPIX_disk1_minus.SetMarkerColor(kRed);
0587   gr_hit_rate_FPIX_disk1_minus.SetTitle("");
0588   gr_hit_rate_FPIX_disk1_minus.Draw("AP");
0589   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0590   detector.DrawLatexNDC(0.23, 0.83, "FPIX disk 1-");
0591   c.SetGrid();
0592   c.SaveAs("fpix_hit_rate_disk1_minus.png");
0593   c.SaveAs("fpix_hit_rate_disk1_minus.pdf");
0594   c.SaveAs("fpix_hit_rate_disk1_minus.C");
0595   c.Clear();
0596   gSystem->Exec("mv fpix_hit_rate_disk1_minus.png Hit_Rate_Plots");
0597   gSystem->Exec("mv fpix_hit_rate_disk1_minus.pdf Hit_Rate_Plots");
0598   gSystem->Exec("mv fpix_hit_rate_disk1_minus.C Hit_Rate_Plots");
0599   //-----------------------------------------------------------------------------------------------

0600 
0601   //++++++++++++++++++++++++++++++++  FPIX Disk2+ hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0602 
0603   TGraphErrors gr_hit_rate_FPIX_disk2_plus(
0604       runNumber_VecD, hit_rate_FPIX_disk2_plus_VecD, runNumber_err_VecD, hit_rate_FPIX_disk2_plus_err_VecD);
0605   gr_hit_rate_FPIX_disk2_plus.GetXaxis()->SetTitle("Run Number");
0606   gr_hit_rate_FPIX_disk2_plus.GetXaxis()->SetLabelSize(0.04);
0607   gr_hit_rate_FPIX_disk2_plus.GetXaxis()->SetNoExponent();
0608   gr_hit_rate_FPIX_disk2_plus.GetXaxis()->SetNdivisions(5);
0609   gr_hit_rate_FPIX_disk2_plus.GetYaxis()->SetTitle("Hit Rate (Hz)");
0610   gr_hit_rate_FPIX_disk2_plus.GetXaxis()->SetTitleSize(0.05);
0611   gr_hit_rate_FPIX_disk2_plus.GetYaxis()->SetLabelSize(0.05);
0612   gr_hit_rate_FPIX_disk2_plus.GetYaxis()->SetTitleSize(0.05);
0613   gr_hit_rate_FPIX_disk2_plus.SetMarkerStyle(20);
0614   gr_hit_rate_FPIX_disk2_plus.SetMarkerSize(1.4);
0615   gr_hit_rate_FPIX_disk2_plus.SetMarkerColor(kRed);
0616   gr_hit_rate_FPIX_disk2_plus.SetTitle("");
0617   gr_hit_rate_FPIX_disk2_plus.Draw("AP");
0618   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0619   detector.DrawLatexNDC(0.23, 0.83, "FPIX disk 2+");
0620   c.SetGrid();
0621   c.SaveAs("fpix_hit_rate_disk2_plus.png");
0622   c.SaveAs("fpix_hit_rate_disk2_plus.pdf");
0623   c.SaveAs("fpix_hit_rate_disk2_plus.C");
0624   c.Clear();
0625   gSystem->Exec("mv fpix_hit_rate_disk2_plus.png Hit_Rate_Plots");
0626   gSystem->Exec("mv fpix_hit_rate_disk2_plus.pdf Hit_Rate_Plots");
0627   gSystem->Exec("mv fpix_hit_rate_disk2_plus.C Hit_Rate_Plots");
0628   //-----------------------------------------------------------------------------------------------

0629 
0630   //++++++++++++++++++++++++++++++++  FPIX Disk2- hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0631 
0632   TGraphErrors gr_hit_rate_FPIX_disk2_minus(
0633       runNumber_VecD, hit_rate_FPIX_disk2_minus_VecD, runNumber_err_VecD, hit_rate_FPIX_disk2_minus_err_VecD);
0634   gr_hit_rate_FPIX_disk2_minus.GetXaxis()->SetTitle("Run Number");
0635   gr_hit_rate_FPIX_disk2_minus.GetXaxis()->SetLabelSize(0.04);
0636   gr_hit_rate_FPIX_disk2_minus.GetXaxis()->SetNoExponent();
0637   gr_hit_rate_FPIX_disk2_minus.GetXaxis()->SetNdivisions(5);
0638   gr_hit_rate_FPIX_disk2_minus.GetYaxis()->SetTitle("Hit Rate (Hz)");
0639   gr_hit_rate_FPIX_disk2_minus.GetXaxis()->SetTitleSize(0.05);
0640   gr_hit_rate_FPIX_disk2_minus.GetYaxis()->SetLabelSize(0.05);
0641   gr_hit_rate_FPIX_disk2_minus.GetYaxis()->SetTitleSize(0.05);
0642   gr_hit_rate_FPIX_disk2_minus.SetMarkerStyle(20);
0643   gr_hit_rate_FPIX_disk2_minus.SetMarkerSize(1.4);
0644   gr_hit_rate_FPIX_disk2_minus.SetMarkerColor(2);
0645   gr_hit_rate_FPIX_disk2_minus.SetTitle("");
0646   gr_hit_rate_FPIX_disk2_minus.Draw("AP");
0647   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0648   detector.DrawLatexNDC(0.23, 0.83, "FPIX disk 2-");
0649   c.SetGrid();
0650   c.SaveAs("fpix_hit_rate_disk2_minus.png");
0651   c.SaveAs("fpix_hit_rate_disk2_minus.pdf");
0652   c.SaveAs("fpix_hit_rate_disk2_minus.C");
0653   c.Clear();
0654   gSystem->Exec("mv fpix_hit_rate_disk2_minus.png Hit_Rate_Plots");
0655   gSystem->Exec("mv fpix_hit_rate_disk2_minus.pdf Hit_Rate_Plots");
0656   gSystem->Exec("mv fpix_hit_rate_disk2_minus.C Hit_Rate_Plots");
0657   //-----------------------------------------------------------------------------------------------

0658 
0659   //++++++++++++++++++++++++++++++++  FPIX Disk3+ hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0660 
0661   TGraphErrors gr_hit_rate_FPIX_disk3_plus(
0662       runNumber_VecD, hit_rate_FPIX_disk3_plus_VecD, runNumber_err_VecD, hit_rate_FPIX_disk3_plus_err_VecD);
0663   gr_hit_rate_FPIX_disk3_plus.GetXaxis()->SetTitle("Run Number");
0664   gr_hit_rate_FPIX_disk3_plus.GetXaxis()->SetLabelSize(0.04);
0665   gr_hit_rate_FPIX_disk3_plus.GetXaxis()->SetNoExponent();
0666   gr_hit_rate_FPIX_disk3_plus.GetXaxis()->SetNdivisions(5);
0667   gr_hit_rate_FPIX_disk3_plus.GetYaxis()->SetTitle("Hit Rate (Hz)");
0668   gr_hit_rate_FPIX_disk3_plus.GetXaxis()->SetTitleSize(0.05);
0669   gr_hit_rate_FPIX_disk3_plus.GetYaxis()->SetLabelSize(0.05);
0670   gr_hit_rate_FPIX_disk3_plus.GetYaxis()->SetTitleSize(0.05);
0671   gr_hit_rate_FPIX_disk3_plus.SetMarkerStyle(20);
0672   gr_hit_rate_FPIX_disk3_plus.SetMarkerSize(1.4);
0673   gr_hit_rate_FPIX_disk3_plus.SetMarkerColor(kRed);
0674   gr_hit_rate_FPIX_disk3_plus.SetTitle("");
0675   gr_hit_rate_FPIX_disk3_plus.Draw("AP");
0676   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0677   detector.DrawLatexNDC(0.23, 0.83, "FPIX disk 3+");
0678   c.SetGrid();
0679   c.SaveAs("fpix_hit_rate_disk3_plus.png");
0680   c.SaveAs("fpix_hit_rate_disk3_plus.pdf");
0681   c.SaveAs("fpix_hit_rate_disk3_plus.C");
0682   c.Clear();
0683   gSystem->Exec("mv fpix_hit_rate_disk3_plus.png Hit_Rate_Plots");
0684   gSystem->Exec("mv fpix_hit_rate_disk3_plus.pdf Hit_Rate_Plots");
0685   gSystem->Exec("mv fpix_hit_rate_disk3_plus.C Hit_Rate_Plots");
0686   //-----------------------------------------------------------------------------------------------

0687 
0688   //++++++++++++++++++++++++++++++++  FPIX Disk3- hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0689 
0690   TGraphErrors gr_hit_rate_FPIX_disk3_minus(
0691       runNumber_VecD, hit_rate_FPIX_disk3_minus_VecD, runNumber_err_VecD, hit_rate_FPIX_disk3_minus_err_VecD);
0692   gr_hit_rate_FPIX_disk3_minus.GetXaxis()->SetTitle("Run Number");
0693   gr_hit_rate_FPIX_disk3_minus.GetXaxis()->SetLabelSize(0.04);
0694   gr_hit_rate_FPIX_disk3_minus.GetXaxis()->SetNoExponent();
0695   gr_hit_rate_FPIX_disk3_minus.GetXaxis()->SetNdivisions(5);
0696   gr_hit_rate_FPIX_disk3_minus.GetYaxis()->SetTitle("Hit Rate (Hz)");
0697   gr_hit_rate_FPIX_disk3_minus.GetXaxis()->SetTitleSize(0.05);
0698   gr_hit_rate_FPIX_disk3_minus.GetYaxis()->SetLabelSize(0.05);
0699   gr_hit_rate_FPIX_disk3_minus.GetYaxis()->SetTitleSize(0.05);
0700   gr_hit_rate_FPIX_disk3_minus.SetMarkerStyle(20);
0701   gr_hit_rate_FPIX_disk3_minus.SetMarkerSize(1.4);
0702   gr_hit_rate_FPIX_disk3_minus.SetMarkerColor(2);
0703   gr_hit_rate_FPIX_disk3_minus.SetTitle("");
0704   gr_hit_rate_FPIX_disk3_minus.Draw("AP");
0705   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0706   detector.DrawLatexNDC(0.23, 0.83, "FPIX disk 3-");
0707   c.SetGrid();
0708   c.SaveAs("fpix_hit_rate_disk3_minus.png");
0709   c.SaveAs("fpix_hit_rate_disk3_minus.pdf");
0710   c.SaveAs("fpix_hit_rate_disk3_minus.C");
0711   c.Clear();
0712   gSystem->Exec("mv fpix_hit_rate_disk3_minus.png Hit_Rate_Plots");
0713   gSystem->Exec("mv fpix_hit_rate_disk3_minus.pdf Hit_Rate_Plots");
0714   gSystem->Exec("mv fpix_hit_rate_disk3_minus.C Hit_Rate_Plots");
0715   //-----------------------------------------------------------------------------------------------

0716 
0717   //++++++++++++++++++++++++++++++++  BPIX hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0718 
0719   TGraphErrors gr_hit_rate_BPIX(runNumber_VecD, hit_rate_BPIX_VecD, runNumber_err_VecD, hit_rate_BPIX_err_VecD);
0720   gr_hit_rate_BPIX.GetXaxis()->SetTitle("Run Number");
0721   gr_hit_rate_BPIX.GetXaxis()->SetLabelSize(0.04);
0722   gr_hit_rate_BPIX.GetXaxis()->SetNoExponent();
0723   gr_hit_rate_BPIX.GetXaxis()->SetNdivisions(5);
0724   gr_hit_rate_BPIX.GetYaxis()->SetTitle("Hit Rate (Hz)");
0725   gr_hit_rate_BPIX.GetXaxis()->SetTitleSize(0.05);
0726   gr_hit_rate_BPIX.GetYaxis()->SetLabelSize(0.05);
0727   gr_hit_rate_BPIX.GetYaxis()->SetTitleSize(0.05);
0728   gr_hit_rate_BPIX.SetMarkerStyle(20);
0729   gr_hit_rate_BPIX.SetMarkerSize(1.4);
0730   gr_hit_rate_BPIX.SetMarkerColor(2);
0731   gr_hit_rate_BPIX.SetTitle("");
0732   gr_hit_rate_BPIX.Draw("AP");
0733   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0734   detector.DrawLatexNDC(0.23, 0.83, "BPIX");
0735   c.SetGrid();
0736   c.SaveAs("bpix_hit_rate.png");
0737   c.SaveAs("bpix_hit_rate.pdf");
0738   c.SaveAs("bpix_hit_rate.C");
0739   c.Clear();
0740   gSystem->Exec("mv bpix_hit_rate.png Hit_Rate_Plots");
0741   gSystem->Exec("mv bpix_hit_rate.pdf Hit_Rate_Plots");
0742   gSystem->Exec("mv bpix_hit_rate.C Hit_Rate_Plots");
0743 
0744   //-----------------------------------------------------------------------------------------------

0745 
0746   //++++++++++++++++++++++++++++++++  BPIX layer 1 hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0747 
0748   TGraphErrors gr_hit_rate_BPIX_layer1(
0749       runNumber_VecD, hit_rate_BPIX_layer1_VecD, runNumber_err_VecD, hit_rate_BPIX_layer1_err_VecD);
0750   gr_hit_rate_BPIX_layer1.GetXaxis()->SetTitle("Run Number");
0751   gr_hit_rate_BPIX_layer1.GetXaxis()->SetLabelSize(0.04);
0752   gr_hit_rate_BPIX_layer1.GetXaxis()->SetNoExponent();
0753   gr_hit_rate_BPIX_layer1.GetXaxis()->SetNdivisions(5);
0754   gr_hit_rate_BPIX_layer1.GetYaxis()->SetTitle("Hit Rate (Hz)");
0755   gr_hit_rate_BPIX_layer1.GetXaxis()->SetTitleSize(0.05);
0756   gr_hit_rate_BPIX_layer1.GetYaxis()->SetLabelSize(0.05);
0757   gr_hit_rate_BPIX_layer1.GetYaxis()->SetTitleSize(0.05);
0758   gr_hit_rate_BPIX_layer1.SetMarkerStyle(20);
0759   gr_hit_rate_BPIX_layer1.SetMarkerSize(1.4);
0760   gr_hit_rate_BPIX_layer1.SetMarkerColor(2);
0761   gr_hit_rate_BPIX_layer1.SetTitle("");
0762   gr_hit_rate_BPIX_layer1.Draw("AP");
0763   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0764   detector.DrawLatexNDC(0.23, 0.83, "BPIX layer 1");
0765   c.SetGrid();
0766   c.SaveAs("bpix_layer1_hit_rate.png");
0767   c.SaveAs("bpix_layer1_hit_rate.pdf");
0768   c.SaveAs("bpix_layer1_hit_rate.C");
0769   c.Clear();
0770   gSystem->Exec("mv bpix_layer1_hit_rate.png Hit_Rate_Plots");
0771   gSystem->Exec("mv bpix_layer1_hit_rate.pdf Hit_Rate_Plots");
0772   gSystem->Exec("mv bpix_layer1_hit_rate.C Hit_Rate_Plots");
0773 
0774   //-----------------------------------------------------------------------------------------------

0775 
0776   //++++++++++++++++++++++++++++++++  BPIX layer 2 hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0777 
0778   TGraphErrors gr_hit_rate_BPIX_layer2(
0779       runNumber_VecD, hit_rate_BPIX_layer2_VecD, runNumber_err_VecD, hit_rate_BPIX_layer2_err_VecD);
0780   gr_hit_rate_BPIX_layer2.GetXaxis()->SetTitle("Run Number");
0781   gr_hit_rate_BPIX_layer2.GetXaxis()->SetLabelSize(0.04);
0782   gr_hit_rate_BPIX_layer2.GetXaxis()->SetNoExponent();
0783   gr_hit_rate_BPIX_layer2.GetXaxis()->SetNdivisions(5);
0784   gr_hit_rate_BPIX_layer2.GetYaxis()->SetTitle("Hit Rate (Hz)");
0785   gr_hit_rate_BPIX_layer2.GetXaxis()->SetTitleSize(0.05);
0786   gr_hit_rate_BPIX_layer2.GetYaxis()->SetLabelSize(0.05);
0787   gr_hit_rate_BPIX_layer2.GetYaxis()->SetTitleSize(0.05);
0788   gr_hit_rate_BPIX_layer2.SetMarkerStyle(20);
0789   gr_hit_rate_BPIX_layer2.SetMarkerSize(1.4);
0790   gr_hit_rate_BPIX_layer2.SetMarkerColor(2);
0791   gr_hit_rate_BPIX_layer2.SetTitle("");
0792   gr_hit_rate_BPIX_layer2.Draw("AP");
0793   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0794   detector.DrawLatexNDC(0.23, 0.83, "BPIX layer 2");
0795   c.SetGrid();
0796   c.SaveAs("bpix_layer2_hit_rate.png");
0797   c.SaveAs("bpix_layer2_hit_rate.pdf");
0798   c.SaveAs("bpix_layer2_hit_rate.C");
0799   c.Clear();
0800   gSystem->Exec("mv bpix_layer2_hit_rate.png Hit_Rate_Plots");
0801   gSystem->Exec("mv bpix_layer2_hit_rate.pdf Hit_Rate_Plots");
0802   gSystem->Exec("mv bpix_layer2_hit_rate.C Hit_Rate_Plots");
0803 
0804   //-----------------------------------------------------------------------------------------------

0805 
0806   //++++++++++++++++++++++++++++++++  BPIX layer 3 hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0807 
0808   TGraphErrors gr_hit_rate_BPIX_layer3(
0809       runNumber_VecD, hit_rate_BPIX_layer3_VecD, runNumber_err_VecD, hit_rate_BPIX_layer3_err_VecD);
0810   gr_hit_rate_BPIX_layer3.GetXaxis()->SetTitle("Run Number");
0811   gr_hit_rate_BPIX_layer3.GetXaxis()->SetLabelSize(0.04);
0812   gr_hit_rate_BPIX_layer3.GetXaxis()->SetNoExponent();
0813   gr_hit_rate_BPIX_layer3.GetXaxis()->SetNdivisions(5);
0814   gr_hit_rate_BPIX_layer3.GetYaxis()->SetTitle("Hit Rate (Hz)");
0815   gr_hit_rate_BPIX_layer3.GetXaxis()->SetTitleSize(0.05);
0816   gr_hit_rate_BPIX_layer3.GetYaxis()->SetLabelSize(0.05);
0817   gr_hit_rate_BPIX_layer3.GetYaxis()->SetTitleSize(0.05);
0818   gr_hit_rate_BPIX_layer3.SetMarkerStyle(20);
0819   gr_hit_rate_BPIX_layer3.SetMarkerSize(1.4);
0820   gr_hit_rate_BPIX_layer3.SetMarkerColor(2);
0821   gr_hit_rate_BPIX_layer3.SetTitle("");
0822   gr_hit_rate_BPIX_layer3.Draw("AP");
0823   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0824   detector.DrawLatexNDC(0.23, 0.83, "BPIX layer 3");
0825   c.SetGrid();
0826   c.SaveAs("bpix_layer3_hit_rate.png");
0827   c.SaveAs("bpix_layer3_hit_rate.pdf");
0828   c.SaveAs("bpix_layer3_hit_rate.C");
0829   c.Clear();
0830   gSystem->Exec("mv bpix_layer3_hit_rate.png Hit_Rate_Plots");
0831   gSystem->Exec("mv bpix_layer3_hit_rate.pdf Hit_Rate_Plots");
0832   gSystem->Exec("mv bpix_layer3_hit_rate.C Hit_Rate_Plots");
0833 
0834   //-----------------------------------------------------------------------------------------------

0835 
0836   //++++++++++++++++++++++++++++++++  BPIX layer 4 hit rate  ++++++++++++++++++++++++++++++++++++++++++++

0837 
0838   TGraphErrors gr_hit_rate_BPIX_layer4(
0839       runNumber_VecD, hit_rate_BPIX_layer4_VecD, runNumber_err_VecD, hit_rate_BPIX_layer4_err_VecD);
0840   gr_hit_rate_BPIX_layer4.GetXaxis()->SetTitle("Run Number");
0841   gr_hit_rate_BPIX_layer4.GetXaxis()->SetLabelSize(0.04);
0842   gr_hit_rate_BPIX_layer4.GetXaxis()->SetNoExponent();
0843   gr_hit_rate_BPIX_layer4.GetXaxis()->SetNdivisions(5);
0844   gr_hit_rate_BPIX_layer4.GetYaxis()->SetTitle("Hit Rate (Hz)");
0845   gr_hit_rate_BPIX_layer4.GetXaxis()->SetTitleSize(0.05);
0846   gr_hit_rate_BPIX_layer4.GetYaxis()->SetLabelSize(0.05);
0847   gr_hit_rate_BPIX_layer4.GetYaxis()->SetTitleSize(0.05);
0848   gr_hit_rate_BPIX_layer4.SetMarkerStyle(20);
0849   gr_hit_rate_BPIX_layer4.SetMarkerSize(1.4);
0850   gr_hit_rate_BPIX_layer4.SetMarkerColor(2);
0851   gr_hit_rate_BPIX_layer4.SetTitle("");
0852   gr_hit_rate_BPIX_layer4.Draw("AP");
0853   top_right_Title.DrawLatexNDC(0.79, 0.94, "cosmic rays");
0854   detector.DrawLatexNDC(0.23, 0.83, "BPIX layer 4");
0855   c.SetGrid();
0856   c.SaveAs("bpix_layer4_hit_rate.png");
0857   c.SaveAs("bpix_layer4_hit_rate.pdf");
0858   c.SaveAs("bpix_layer4_hit_rate.C");
0859   c.Clear();
0860   gSystem->Exec("mv bpix_layer4_hit_rate.png Hit_Rate_Plots");
0861   gSystem->Exec("mv bpix_layer4_hit_rate.pdf Hit_Rate_Plots");
0862   gSystem->Exec("mv bpix_layer4_hit_rate.C Hit_Rate_Plots");
0863 
0864   //-----------------------------------------------------------------------------------------------

0865 
0866   c.Close();
0867 
0868   //-----------------------------------------------------------------------------------------------

0869   //                    Weighted Mean calculation - Hit Rate

0870   //-----------------------------------------------------------------------------------------------

0871 
0872   double total_weight = 0;
0873   double weighted_mean_hit_rate;
0874   double weighted_mean_hit_rate_PIX;
0875   double weighted_mean_hit_rate_BPIX;
0876   double weighted_mean_hit_rate_BPIX_layer1;
0877   double weighted_mean_hit_rate_BPIX_layer2;
0878   double weighted_mean_hit_rate_BPIX_layer3;
0879   double weighted_mean_hit_rate_BPIX_layer4;
0880   double weighted_mean_hit_rate_FPIX;
0881   double weighted_mean_hit_rate_FPIX_disk1;
0882   double weighted_mean_hit_rate_FPIX_disk2;
0883   double weighted_mean_hit_rate_FPIX_disk3;
0884   double weighted_mean_hit_rate_FPIX_disk1_plus;
0885   double weighted_mean_hit_rate_FPIX_disk2_plus;
0886   double weighted_mean_hit_rate_FPIX_disk3_plus;
0887   double weighted_mean_hit_rate_FPIX_disk1_minus;
0888   double weighted_mean_hit_rate_FPIX_disk2_minus;
0889   double weighted_mean_hit_rate_FPIX_disk3_minus;
0890 
0891   // ---------- Weighted Hit Rate Calculation ------------//

0892   for (int k = 0; k < j; k++)  // Loop over all runs(without 0 or negative runtime) to get weight per run

0893   {
0894     weight.push_back(hits.at(k) / nTotalHits);
0895   }
0896 
0897   for (int a = 0; a < j;
0898        a++)  // Loop over runs(without 0 or negative runtime) to calculate the weighted mean hit rate per PIXEL Layer

0899   {
0900     weighted_mean_hit_rate_PIX += hit_rate_PIX.at(a) * weight.at(a);
0901     weighted_mean_hit_rate_BPIX += hit_rate_BPIX.at(a) * weight.at(a);
0902     weighted_mean_hit_rate_BPIX_layer1 += hit_rate_BPIX_layer1.at(a) * weight.at(a);
0903     weighted_mean_hit_rate_BPIX_layer2 += hit_rate_BPIX_layer2.at(a) * weight.at(a);
0904     weighted_mean_hit_rate_BPIX_layer3 += hit_rate_BPIX_layer3.at(a) * weight.at(a);
0905     weighted_mean_hit_rate_BPIX_layer4 += hit_rate_BPIX_layer4.at(a) * weight.at(a);
0906     weighted_mean_hit_rate_FPIX += hit_rate_FPIX.at(a) * weight.at(a);
0907     weighted_mean_hit_rate_FPIX_disk1 += hit_rate_FPIX_disk1.at(a) * weight.at(a);
0908     weighted_mean_hit_rate_FPIX_disk2 += hit_rate_FPIX_disk2.at(a) * weight.at(a);
0909     weighted_mean_hit_rate_FPIX_disk3 += hit_rate_FPIX_disk3.at(a) * weight.at(a);
0910     weighted_mean_hit_rate_FPIX_disk1_plus += hit_rate_FPIX_disk1_plus.at(a) * weight.at(a);
0911     weighted_mean_hit_rate_FPIX_disk2_plus += hit_rate_FPIX_disk2_plus.at(a) * weight.at(a);
0912     weighted_mean_hit_rate_FPIX_disk3_plus += hit_rate_FPIX_disk3_plus.at(a) * weight.at(a);
0913     weighted_mean_hit_rate_FPIX_disk1_minus += hit_rate_FPIX_disk1_minus.at(a) * weight.at(a);
0914     weighted_mean_hit_rate_FPIX_disk2_minus += hit_rate_FPIX_disk2_minus.at(a) * weight.at(a);
0915     weighted_mean_hit_rate_FPIX_disk3_minus += hit_rate_FPIX_disk3_minus.at(a) * weight.at(a);
0916   }
0917 
0918   //-----------------------------------------------------------------------------------------------

0919   //            Summary Plot for hit rate in BPIX

0920   //-----------------------------------------------------------------------------------------------

0921   TCanvas *canvas = new TCanvas("canvas", "canvas", 324, 57, 953, 866);
0922   canvas->SetFillColor(0);
0923   canvas->SetBorderMode(0);
0924   canvas->SetBorderSize(2);
0925   canvas->SetGridx();
0926   canvas->SetGridy();
0927   canvas->SetTickx(1);
0928   canvas->SetTicky(1);
0929   canvas->SetLeftMargin(0.1608833);
0930   canvas->SetRightMargin(0.05152471);
0931 
0932   canvas->SetFrameLineWidth(3);
0933   canvas->SetFrameBorderMode(0);
0934   canvas->SetFrameLineWidth(3);
0935   canvas->SetFrameBorderMode(0);
0936 
0937   TLatex tex;
0938   tex.DrawLatexNDC(0.4, 0.8, "Rate Summary");
0939   tex.SetLineWidth(2);
0940   tex.SetTextFont(62);
0941   tex.Draw();
0942 
0943   TH1F hb_BPIX("hb_BPIX", "Rate Summary BPIX", 6, 0, 6);
0944   hb_BPIX.SetFillColor(6);
0945   hb_BPIX.SetBarWidth(0.6);
0946   hb_BPIX.SetBarOffset(0.25);
0947   hb_BPIX.SetStats(0);
0948   hb_BPIX.GetXaxis()->SetLabelFont(42);
0949   hb_BPIX.GetXaxis()->SetLabelOffset(0.012);
0950   hb_BPIX.GetXaxis()->SetLabelSize(0.06);
0951   hb_BPIX.GetXaxis()->SetTitleSize(0.05);
0952   hb_BPIX.GetXaxis()->SetTitleFont(42);
0953   hb_BPIX.GetYaxis()->SetTitle("Average Hit Rate (Hz)");
0954   hb_BPIX.GetYaxis()->SetLabelFont(42);
0955   hb_BPIX.GetYaxis()->SetLabelSize(0.05);
0956   hb_BPIX.GetYaxis()->SetTitleSize(0.05);
0957   hb_BPIX.GetYaxis()->SetTitleOffset(0);
0958 
0959   gStyle->SetPaintTextFormat("1.3f");
0960 
0961   tex.DrawLatexNDC(0.4, 0.8, "Rate Summary BPIX");
0962   tex.SetLineWidth(2);
0963   tex.SetTextFont(62);
0964   tex.Draw();
0965 
0966   Bar_Ytitle_BPIX[0] = weighted_mean_hit_rate_PIX;
0967   Bar_Ytitle_BPIX[1] = weighted_mean_hit_rate_BPIX;
0968   Bar_Ytitle_BPIX[2] = weighted_mean_hit_rate_BPIX_layer1;
0969   Bar_Ytitle_BPIX[3] = weighted_mean_hit_rate_BPIX_layer2;
0970   Bar_Ytitle_BPIX[4] = weighted_mean_hit_rate_BPIX_layer3;
0971   Bar_Ytitle_BPIX[5] = weighted_mean_hit_rate_BPIX_layer4;
0972 
0973   for (int i = 1; i <= 6; i++) {
0974     hb_BPIX.SetBinContent(i, Bar_Ytitle_BPIX[i - 1]);
0975     hb_BPIX.GetXaxis()->SetBinLabel(i, Bar_Xtitle_BPIX[i - 1].c_str());
0976   }
0977 
0978   TString summary_chart_title;
0979   TString Format[3] = {"png", "pdf", "C"};
0980 
0981   hb_BPIX.Draw("bTEXT");
0982   summary_chart_title = "SummaryChart_HitRate_BPIX";
0983 
0984   for (int i = 0; i < 3; i++) {
0985     TString filename = summary_chart_title + "." + Format[i];
0986     canvas->SaveAs(filename.Data());
0987     TString mv_cmd = "mv " + filename + " Hit_Rate_Plots";
0988     gSystem->Exec(mv_cmd.Data());
0989   }
0990   canvas->Clear();
0991 
0992   //-----------------------------------------------------------------------------------------------

0993   //            Summary Plot for hit rate in FPIX

0994   //-----------------------------------------------------------------------------------------------

0995 
0996   TH1F hb_FPIX("hb_FPIX", "Rate Summary FPIX", 11, 0, 11);
0997   hb_FPIX.SetFillColor(6);
0998   hb_FPIX.SetBarWidth(0.6);
0999   hb_FPIX.SetBarOffset(0.25);
1000   hb_FPIX.SetStats(0);
1001   hb_FPIX.GetXaxis()->SetLabelFont(42);
1002   hb_FPIX.GetXaxis()->SetLabelOffset(0.012);
1003   hb_FPIX.GetXaxis()->SetLabelSize(0.04);
1004   hb_FPIX.GetXaxis()->SetTitleSize(0.05);
1005   hb_FPIX.GetXaxis()->SetTitleFont(42);
1006   hb_FPIX.GetYaxis()->SetTitle("Average Hit Rate (Hz)");
1007   hb_FPIX.GetYaxis()->SetLabelFont(42);
1008   hb_FPIX.GetYaxis()->SetLabelSize(0.05);
1009   hb_FPIX.GetYaxis()->SetTitleSize(0.05);
1010   hb_FPIX.GetYaxis()->SetTitleOffset(0);
1011 
1012   gStyle->SetPaintTextFormat("1.3f");
1013 
1014   Bar_Ytitle_FPIX[0] = weighted_mean_hit_rate_PIX;
1015   Bar_Ytitle_FPIX[1] = weighted_mean_hit_rate_FPIX;
1016   Bar_Ytitle_FPIX[2] = weighted_mean_hit_rate_FPIX_disk1;
1017   Bar_Ytitle_FPIX[3] = weighted_mean_hit_rate_FPIX_disk1_plus;
1018   Bar_Ytitle_FPIX[4] = weighted_mean_hit_rate_FPIX_disk1_minus;
1019   Bar_Ytitle_FPIX[5] = weighted_mean_hit_rate_FPIX_disk2;
1020   Bar_Ytitle_FPIX[6] = weighted_mean_hit_rate_FPIX_disk2_plus;
1021   Bar_Ytitle_FPIX[7] = weighted_mean_hit_rate_FPIX_disk2_minus;
1022   Bar_Ytitle_FPIX[8] = weighted_mean_hit_rate_FPIX_disk3;
1023   Bar_Ytitle_FPIX[9] = weighted_mean_hit_rate_FPIX_disk3_plus;
1024   Bar_Ytitle_FPIX[10] = weighted_mean_hit_rate_FPIX_disk3_minus;
1025 
1026   for (int i = 1; i <= 11; i++) {
1027     hb_FPIX.SetBinContent(i, Bar_Ytitle_FPIX[i - 1]);
1028     hb_FPIX.GetXaxis()->SetBinLabel(i, Bar_Xtitle_FPIX[i - 1].c_str());
1029   }
1030 
1031   hb_FPIX.Draw("bTEXT");
1032   summary_chart_title = "SummaryChart_HitRate_FPIX";
1033 
1034   for (int i = 0; i < 3; i++) {
1035     TString filename = summary_chart_title + "." + Format[i];
1036     canvas->SaveAs(filename.Data());
1037     TString mv_cmd = "mv " + filename + " Hit_Rate_Plots";
1038     gSystem->Exec(mv_cmd.Data());
1039   }
1040   canvas->Clear();
1041 
1042   //-----------------------------------------------------------------------------------------------

1043   //            Summary Plot for hit rate in PIXEL

1044   //-----------------------------------------------------------------------------------------------

1045 
1046   TH1F hb_PIXEL("hb_PIXEL", "Rate Summary PIXEL", 10, 0, 10);
1047   hb_PIXEL.SetFillColor(6);
1048   hb_PIXEL.SetBarWidth(0.6);
1049   hb_PIXEL.SetBarOffset(0.25);
1050   hb_PIXEL.SetStats(0);
1051   hb_PIXEL.GetXaxis()->SetLabelFont(42);
1052   hb_PIXEL.GetXaxis()->SetLabelOffset(0.012);
1053   hb_PIXEL.GetXaxis()->SetLabelSize(0.05);
1054   hb_PIXEL.GetXaxis()->SetTitleSize(0.05);
1055   hb_PIXEL.GetXaxis()->SetTitleFont(42);
1056   hb_PIXEL.GetYaxis()->SetTitle("Average Hit Rate (Hz)");
1057   hb_PIXEL.GetYaxis()->SetLabelFont(42);
1058   hb_PIXEL.GetYaxis()->SetLabelSize(0.05);
1059   hb_PIXEL.GetYaxis()->SetTitleSize(0.05);
1060   hb_PIXEL.GetYaxis()->SetTitleOffset(0);
1061 
1062   gStyle->SetPaintTextFormat("1.3f");
1063 
1064   Bar_Ytitle_PIXEL[0] = weighted_mean_hit_rate_PIX;
1065   Bar_Ytitle_PIXEL[1] = weighted_mean_hit_rate_BPIX;
1066   Bar_Ytitle_PIXEL[2] = weighted_mean_hit_rate_BPIX_layer1;
1067   Bar_Ytitle_PIXEL[3] = weighted_mean_hit_rate_BPIX_layer2;
1068   Bar_Ytitle_PIXEL[4] = weighted_mean_hit_rate_BPIX_layer3;
1069   Bar_Ytitle_PIXEL[5] = weighted_mean_hit_rate_BPIX_layer4;
1070   Bar_Ytitle_PIXEL[6] = weighted_mean_hit_rate_FPIX;
1071   Bar_Ytitle_PIXEL[7] = weighted_mean_hit_rate_FPIX_disk1;
1072   Bar_Ytitle_PIXEL[8] = weighted_mean_hit_rate_FPIX_disk2;
1073   Bar_Ytitle_PIXEL[9] = weighted_mean_hit_rate_FPIX_disk3;
1074 
1075   for (int i = 1; i <= 10; i++) {
1076     hb_PIXEL.SetBinContent(i, Bar_Ytitle_PIXEL[i - 1]);
1077     hb_PIXEL.GetXaxis()->SetBinLabel(i, Bar_Xtitle_PIXEL[i - 1].c_str());
1078   }
1079 
1080   hb_PIXEL.Draw("bTEXT");
1081   summary_chart_title = "SummaryChart_HitRate_PIXEL";
1082 
1083   for (int i = 0; i < 3; i++) {
1084     TString filename = summary_chart_title + "." + Format[i];
1085     canvas->SaveAs(filename.Data());
1086     TString mv_cmd = "mv " + filename + " Hit_Rate_Plots";
1087     gSystem->Exec(mv_cmd.Data());
1088   }
1089   canvas->Clear();
1090   canvas->Close();
1091 
1092   std::cout << " Weighted mean PIX: " << weighted_mean_hit_rate_PIX << std::endl;
1093   std::cout << " Weighted mean BPIX: " << weighted_mean_hit_rate_BPIX << std::endl;
1094   std::cout << " Weighted mean BPIX layer 1: " << weighted_mean_hit_rate_BPIX_layer1 << std::endl;
1095   std::cout << " Weighted mean BPIX layer 2 : " << weighted_mean_hit_rate_BPIX_layer2 << std::endl;
1096   std::cout << " Weighted mean BPIX layer 3: " << weighted_mean_hit_rate_BPIX_layer3 << std::endl;
1097   std::cout << " Weighted mean BPIX layer 4: " << weighted_mean_hit_rate_BPIX_layer4 << std::endl;
1098   std::cout << " Weighted mean FPIX : " << weighted_mean_hit_rate_FPIX << std::endl;
1099   std::cout << " Weighted mean FPIX disk 1: " << weighted_mean_hit_rate_FPIX_disk1 << std::endl;
1100   std::cout << " Weighted mean FPIX disk 2: " << weighted_mean_hit_rate_FPIX_disk2 << std::endl;
1101   std::cout << " Weighted mean FPIX disk 3: " << weighted_mean_hit_rate_FPIX_disk3 << std::endl;
1102   std::cout << " Weighted mean FPIX disk 1+: " << weighted_mean_hit_rate_FPIX_disk1_plus << std::endl;
1103   std::cout << " Weighted mean FPIX disk 2+: " << weighted_mean_hit_rate_FPIX_disk2_plus << std::endl;
1104   std::cout << " Weighted mean FPIX disk 3+: " << weighted_mean_hit_rate_FPIX_disk3_plus << std::endl;
1105   std::cout << " Weighted mean FPIX disk 1-: " << weighted_mean_hit_rate_FPIX_disk1_minus << std::endl;
1106   std::cout << " Weighted mean FPIX disk 2-: " << weighted_mean_hit_rate_FPIX_disk2_minus << std::endl;
1107   std::cout << " Weighted mean FPIX disk 3-: " << weighted_mean_hit_rate_FPIX_disk3_minus << std::endl;
1108 }