void midplane(void) { TCanvas *c1 = new TCanvas("c1","",800,800); c1->SetTickx(); c1->SetTicky(); TH2D *axes = new TH2D("axes","CDC mid-plane", 100, -60.0, 60.0, 100, -60.0, 60.0); axes->SetStats(0); axes->SetXTitle("X"); axes->SetYTitle("Y"); axes->Draw(); double tubeRadius = 0.8; // Loop over configurations for(int config=1; config<=4; config++){ axes->Draw(); int Nstraws_total = 0; for(int layer=1; layer<=30; layer++){ int Nstraws; double radius, stereo, shift; switch(config){ case 1: GetLayerInfoPhaseShifted(layer, Nstraws, radius, stereo, shift); break; case 2: GetLayerInfoOption2(layer, Nstraws, radius, stereo, shift); break; case 3: GetLayerInfoClosePacked(layer, Nstraws, radius, stereo, shift); break; case 4: GetLayerInfoClosePackedLessStereo(layer, Nstraws, radius, stereo, shift); break; } if(Nstraws==0)break; Nstraws_total+=Nstraws; for(int i=0; iSetLineWidth(stereo==0.0 ? 1:2); e->SetLineColor(stereo==0.0 ? kBlack:kBlue); e->Draw(); } } const char *title=""; const char *cname="none"; switch(config){ case 1: title = "Baseline design with #phi shifts"; cname = "phase_shifted"; break; case 2: title = "CDC Option-2 (3 stereo superlayers)"; cname = "option2"; break; case 3: title = "Close Packed"; cname = "close_packed"; break; case 4: title = "Close Packed with outer 3 axial"; cname = "close_packed_less_stereo"; break; } TLatex *lab = new TLatex(0.0, 60.0, title); lab->SetTextAlign(21); lab->SetTextSize(0.05); lab->Draw(); char str[256]; sprintf(str, "Total number of straws:%d", Nstraws_total); lab = new TLatex(20.0, 70.0, str); lab->SetTextAlign(21); lab->SetTextSize(0.035); lab->Draw(); char fname[256]; sprintf(fname,"midplane_%s.gif", cname); c1->SaveAs(fname); sprintf(fname,"midplane_%s.pdf", cname); c1->SaveAs(fname); } } //------------------------ // GetLayerInfoPhaseShifted //------------------------ void GetLayerInfoPhaseShifted(int layer, int &Nstraws, double &radius, double &stereo, double &shift) { double degrees0 = 0.0; double degrees6 = 6.0*TMath::TwoPi()/180.0; double phi_shift; int myNstraws; switch(layer){ case 1: myNstraws= 43; radius= 10.984; stereo= degrees0; phi_shift= 0.000; break; case 2: myNstraws= 50; radius= 12.769; stereo= degrees0; phi_shift=+3.600; break; case 3: myNstraws= 57; radius= 14.555; stereo= degrees0; phi_shift=-2.105; break; case 4: myNstraws= 63; radius= 16.174; stereo= -degrees6; phi_shift= 0.000; break; case 5: myNstraws= 70; radius= 17.969; stereo= -degrees6; phi_shift= 0.000; break; case 6: myNstraws= 77; radius= 19.765; stereo= +degrees6; phi_shift= 0.000; break; case 7: myNstraws= 84; radius= 21.561; stereo= +degrees6; phi_shift= 0.000; break; case 8: myNstraws= 98; radius= 25.015; stereo= degrees0; phi_shift=+0.216; break; case 9: myNstraws= 105; radius= 26.801; stereo= degrees0; phi_shift= 0.000; break; case 10: myNstraws= 112; radius= 28.588; stereo= degrees0; phi_shift=+1.607; break; case 11: myNstraws= 119; radius= 30.374; stereo= degrees0; phi_shift=-1.008; break; case 12: myNstraws= 126; radius= 32.160; stereo= degrees0; phi_shift=+0.571; break; case 13: myNstraws= 132; radius= 33.877; stereo= -degrees6; phi_shift= 0.000; break; case 14: myNstraws= 139; radius= 35.673; stereo= -degrees6; phi_shift= 0.000; break; case 15: myNstraws= 146; radius= 37.469; stereo= +degrees6; phi_shift= 0.000; break; case 16: myNstraws= 153; radius= 39.265; stereo= +degrees6; phi_shift= 0.000; break; case 17: myNstraws= 165; radius= 42.113; stereo= degrees0; phi_shift= 0.000; break; case 18: myNstraws= 172; radius= 43.899; stereo= degrees0; phi_shift=+1.047; break; case 19: myNstraws= 179; radius= 45.686; stereo= degrees0; phi_shift=-0.670; break; case 20: myNstraws= 186; radius= 47.472; stereo= degrees0; phi_shift=+0.387; break; case 21: myNstraws= 193; radius= 49.258; stereo= degrees0; phi_shift=-0.266; break; case 22: myNstraws= 200; radius= 51.045; stereo= degrees0; phi_shift=+0.164; break; case 23: myNstraws= 207; radius= 52.831; stereo= degrees0; phi_shift=-0.134; break; case 24: myNstraws= 214; radius= 54.618; stereo= degrees0; phi_shift=+0.099; break; default: myNstraws= 0; radius= 0.0; stereo= degrees0; phi_shift= 0.000; break; //default: // cerr<<__FILE__<<":"<<__LINE__<<" Invalid value for CDC ring ("<