Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:24

0001 // To be used in compiled mode
0002 
0003 #include "../CylCowWLids.cc"
0004 
0005 #include "TCanvas.h"
0006 #include "TLine.h"
0007 
0008 TrackerInfo g_tracker_info;
0009 
0010 //------------------------------------------------------------------------------
0011 
0012 void print_etas(LayerInfo &li, float dz) {
0013   float r, z;
0014   if (li.is_barrel()) {
0015     r = li.r_mean();
0016     z = li.zmax();
0017   } else {
0018     r = li.rout();
0019     z = li.z_mean();
0020   }
0021 
0022   printf("%2d %6.4f %6.4f %6.4f", li.layer_id(), getEta(r, z - dz), getEta(r, z), getEta(r, z + dz));
0023 
0024   if (!li.is_barrel()) {
0025     r = li.rin();
0026 
0027     printf("  -  %6.4f %6.4f %6.4f", getEta(r, z - dz), getEta(r, z), getEta(r, z + dz));
0028   }
0029 
0030   printf("\n");
0031 }
0032 
0033 //------------------------------------------------------------------------------
0034 
0035 void CylCowWLids() {
0036   Create_TrackerInfo(g_tracker_info, true);
0037 
0038   float zM = 120;
0039   float rM = 100;
0040 
0041   float cScale = 6;
0042   TCanvas *c = new TCanvas("cvs", "", cScale * zM, cScale * rM);
0043   TPad *p = new TPad("pad", "", 0, 0, 1, 1);
0044   p->Draw();
0045   p->Update();
0046   p->cd();
0047 
0048   p->DrawFrame(0, 0, zM, rM);
0049 
0050   printf("Eta coordinates of edges for z0 (-3, 0, +3) cm\n");
0051   printf("----------------------------------------------\n");
0052 
0053   for (auto i : g_tracker_info.m_barrel) {
0054     const LayerInfo &li = g_tracker_info.layer(i);
0055 
0056     TLine *l = new TLine(0, li.r_mean(), li.zmax(), li.r_mean());
0057     l->SetLineColor(kBlue);
0058     l->SetLineWidth(2);
0059     l->Draw();
0060 
0061     print_etas(li, 3);
0062   }
0063 
0064   for (auto i : g_tracker_info.m_ecap_pos) {
0065     LayerInfo &li = g_tracker_info.layer(i);
0066 
0067     TLine *l = new TLine(li.z_mean(), li.rin(), li.z_mean(), li.rout());
0068     l->SetLineColor(kMagenta + 3);
0069     l->SetLineWidth(2);
0070     l->Draw();
0071 
0072     print_etas(li, 3);
0073   }
0074 
0075   p->Modified();
0076   p->Update();
0077 }