#include "mwdc_defs.h" #include "mwdc_funcs.h" class display { public: display(); // constructor void draw_chamber_outline(TCanvas* c1); private: const Double_t topy = 2.0; const Double_t botx = 1.0; const Double_t boty = 1.0; const Double_t topx = 2.0; }; // Constructor void display::display() { // } void display::draw_axis(Int_t chamber_number;) { if(chamber_number == 1) { x_axis = new TArrow(-20,-20,170,-20,.01,"|>"); y_axis = new TArrow( 20,-20, 20,600,.01,"|>"); x_axis->Draw(); y_axis->Draw(); for(Int_t i=0;i<20;i++) { small_hash_x = new TLine(i*8.0,-20,i*8.0,-15); small_hash_x->Draw(); } for(Int_t j=0;j<4;j++) { big_hash_x = new TLine(j*40.0,-20,j*40.0,-10); big_hash_x->Draw(); } for(Int_t i=0;i<73;i++) { small_hash_y = new TLine(-20.0,i*8.0,-15.0,i*8.0); small_hash_y->Draw(); } for(Int_t j=0;j<15;j++) { big_hash_y = new TLine(-20.0,j*40.0,-10.0,j*40.0); big_hash_y->Draw(); } } if( (chamber_number == 2) || (chamber_number == 3) ) { x_axis = new TArrow(-15,-15,215,-15,.01,"|>"); y_axis = new TArrow(-15,-15,-15,825,.01,"|>"); x_axis->Draw(); y_axis->Draw(); for(Int_t i=0;i<26;i++) { small_hash_x = new TLine(i*8.0,-15,i*8.0,-10.0); small_hash_x->Draw(); } for(Int_t j=0;j<5;j++) { big_hash_x = new TLine(j*40.0,-15,j*40.0,-5.0); big_hash_x->Draw(); } for(Int_t i=0;i<103;i++) { small_hash_y = new TLine(-15.0,i*8.0,-10.0,i*8.0); small_hash_y->Draw(); } for(Int_t j=0;j<28;j++) { big_hash_y = new TLine(-15.0,j*40.0,-5.0,j*40.0); big_hash_y->Draw(); } } if(chamber_number == 4) { x_axis = new TArrow(-15,-15,215,-15,.01,"|>"); y_axis = new TArrow(-15,-15,-15,825,.01,"|>"); x_axis->Draw(); y_axis->Draw(); for(Int_t i=0;i<26;i++) { small_hash_x = new TLine(i*8.0,-15,i*8.0,-10.0); small_hash_x->Draw(); } for(Int_t j=0;j<5;j++) { big_hash_x = new TLine(j*40.0,-15,j*40.0,-5.0); big_hash_x->Draw(); } for(Int_t i=0;i<103;i++) { small_hash_y = new TLine(-15.0,i*8.0,-10.0,i*8.0); small_hash_y->Draw(); } for(Int_t j=0;j<28;j++) { big_hash_y = new TLine(-15.0,j*40.0,-5.0,j*40.0); big_hash_y->Draw(); } } } void display::draw_chamber_outline(TCanvas* c1, Int_t chamber_number) { if(chamber_number == 1) { //chamber 1 is 35cm X 142cm chamber1 = new TBox(0.0,0.0,140.0,568.0); gPad->SetFillColor(10); chamber1->SetFillColor(38); chamber1->SetFillStyle(3001); chamber1->Draw(); } if(chamber_number == 2) { //chamber 2 is 50cm X 202cm chamber2 = new TBox(0.0,0.0,200.0,808.0); gPad->SetFillColor(10); chamber2->SetFillColor(38); chamber2->SetFillStyle(3001); chamber2->Draw(); } if(chamber_number == 3) { //chamber 3 is 50cm X 202cm chamber3 = new TBox(0.0,0.0,200.0,808.0); gPad->SetFillColor(10); chamber3->SetFillColor(38); chamber3->SetFillStyle(3001); chamber3->Draw(); } if(chamber_number == 4) { //shower counter 59.5 X 229.5 // chamber4= new TBox(0.0,0.0,240,920); // chamber4= new TBox(0.0,0.0,200,920); chamber4= new TBox(0.0,0.0,240,920); gPad->SetFillColor(10); chamber4->SetFillColor(38); chamber4->SetFillStyle(3001); chamber4->Draw(); for (int i=0; i<6; i++) { blck_line = new TLine((i+1)*8.5*4,0.0,(i+1)*8.5*4,920); blck_line->SetLineColor(1); blck_line->SetLineStyle(4); blck_line->Draw(); } for (int i=0; i<26; i++) { blck_line = new TLine(0,(i+1)*8.5*4,240,(i+1)*8.5*4); blck_line->SetLineColor(1); blck_line->SetLineStyle(4); blck_line->Draw(); } } } void display::draw_wire(TCanvas* c1, plane_type plane, Int_t number_of_hits[], Double_t hit_wires[][MAX_NUMBER_OF_HITS]) { const Double_t SCALE = 4.; Double_t y_space = 1.1547*SCALE, x_space = 1.94444*SCALE; if (chamber[plane] == 0) { const Double_t LEFT_EDGE = 0.; const Double_t RIGHT_EDGE = 140.; const Double_t BOT_EDGE = 0.0; const Double_t TOP_EDGE = 568.; const Int_t LOW_WIRE = 18.; const Int_t HIGH_WIRE = 123.; } if ( (chamber[plane] == 1) || (chamber[plane] == 2) ) { const Double_t LEFT_EDGE = 0.; const Double_t RIGHT_EDGE = 200.; const Double_t BOT_EDGE = 0.0; const Double_t TOP_EDGE = 808.; const Int_t LOW_WIRE = 26.; const Int_t HIGH_WIRE = 174.; } Int_t wire; Int_t hit_counter; cout << "number_of_hits[" <Draw(); } if ( (plane == x2) || (plane == x5) ) // X' Planes { xprime_hit = new TLine(LEFT_EDGE, (TOP_EDGE - (wire+0.5)*SCALE ), RIGHT_EDGE, (TOP_EDGE - (wire+0.5)*SCALE) ); xprime_hit->SetLineColor(2); //cout << "Drawing xprime_hit for wire " <Draw(); } if ( (plane == u1) || (plane == u3) || (plane == v5) ) // U Planes { if(wire <= LOW_WIRE) u_hit = new TLine(RIGHT_EDGE - (wire*x_space), TOP_EDGE, RIGHT_EDGE, TOP_EDGE - wire*y_space); if(wire > LOW_WIRE && wire <= HIGH_WIRE) u_hit = new TLine(LEFT_EDGE, TOP_EDGE - (wire-LOW_WIRE)*y_space, RIGHT_EDGE, TOP_EDGE - wire*y_space); if(wire > HIGH_WIRE && wire < plane_number_of_wires[plane]) u_hit = new TLine(LEFT_EDGE, TOP_EDGE - (wire-LOW_WIRE)*y_space, RIGHT_EDGE-(x_space*(wire-HIGH_WIRE)),BOT_EDGE); u_hit->SetLineColor(1); //cout << "Drawing u_hit for wire " <Draw(); } if ( (plane == u2) || (plane == v4) ) // U' Planes { if(wire <= LOW_WIRE) uprime_hit = new TLine(RIGHT_EDGE + (x_space/2)-(wire*x_space),TOP_EDGE,RIGHT_EDGE,TOP_EDGE - (-(y_space/2)+wire*y_space) ); if(wire > LOW_WIRE && wire <= HIGH_WIRE) uprime_hit = new TLine(LEFT_EDGE,TOP_EDGE - (-(y_space/2)+(wire-LOW_WIRE)*y_space),RIGHT_EDGE,TOP_EDGE - (-(y_space/2)+wire*y_space) ); if(wire > HIGH_WIRE && wire < plane_number_of_wires[plane]) uprime_hit = new TLine(LEFT_EDGE,TOP_EDGE - (-(y_space/2)+(wire-LOW_WIRE)*y_space),RIGHT_EDGE + (x_space/2)-(x_space*(wire-HIGH_WIRE)), BOT_EDGE); uprime_hit->SetLineColor(2); //cout << "Drawing uprime_hit for wire " <Draw(); } if ( (plane == v1) || (plane == v3) || (plane == u5) ) // V Planes { if(wire <= LOW_WIRE) { v_hit = new TLine(LEFT_EDGE,TOP_EDGE - wire*y_space,wire*x_space,TOP_EDGE); //cout << " - 1 - " < LOW_WIRE && wire <= HIGH_WIRE) { v_hit = new TLine(LEFT_EDGE,TOP_EDGE - wire*y_space,RIGHT_EDGE,TOP_EDGE - ((wire-LOW_WIRE)*y_space) ); //cout << " - 2 - " < HIGH_WIRE && wire < plane_number_of_wires[plane]) { v_hit = new TLine((wire-HIGH_WIRE)*x_space,BOT_EDGE,RIGHT_EDGE,TOP_EDGE - y_space*(wire-LOW_WIRE)); // cout << " - 3 - " <SetLineColor(1); //cout << "Drawing v_hit for wire " <Draw(); } if ( (plane == v2) || (plane == u4) ) // V' Planes { if(wire <= LOW_WIRE) vprime_hit = new TLine(LEFT_EDGE,TOP_EDGE - (-(y_space/2)+wire*y_space),-(x_space/2)+wire*x_space,TOP_EDGE); if(wire > LOW_WIRE && wire <= HIGH_WIRE) vprime_hit = new TLine(LEFT_EDGE, TOP_EDGE - (-(y_space/2)+wire*y_space),RIGHT_EDGE, TOP_EDGE - (-(y_space/2)+((wire-LOW_WIRE)*y_space)) ); if(wire > HIGH_WIRE && wire < plane_number_of_wires[plane]) vprime_hit = new TLine((-(x_space/2)+(wire-HIGH_WIRE)*x_space),BOT_EDGE,RIGHT_EDGE,TOP_EDGE - (-(y_space/2)+y_space*(wire-LOW_WIRE)) ); vprime_hit->SetLineColor(2); //cout << "Drawing vprime_hit for wire " <Draw(); } } } void display::draw_hit(TCanvas* c1, Double_t x[], Double_t y[], Double_t e[]) { cout << "x = " <SetTextSize(0.20); if (e[0] >= 300.) { txt->Draw(); } else { printf("Low energy cluster in shower ( < 300 )\n"); } }