//=================================================================== //== EXPERIMENT A-2 //== VERSION: 30.10.2018 //=================================================================== using namespace std; #include "TNeProc.h" #include #include #include #include #include "Riostream.h" #include "TH1.h" #include "TH2.h" #include "TROOT.h" #include "TCutG.h" #include "TGo4WinCond.h" #include "TGo4PolyCond.h" #include "TGo4CondArray.h" #include "TGo4Picture.h" #include "TGo4MbsEvent.h" #include "snprintf.h" #include "TNeEvent.h" #include "TNeDet16.h" #include "TNeAnalysis.h" #include "TRandom.h" #include "TNeMParms.h" //#include "TNeSel.h" long TNeProc::bit[32] = {0x00000001, 0x00000002, 0x00000004, 0x00000008 ,0x00000010, 0x00000020, 0x00000040, 0x00000080 ,0x00000100, 0x00000200, 0x00000400, 0x00000800 ,0x00001000, 0x00002000, 0x00004000, 0x00008000 ,0x00010000, 0x00020000, 0x00040000, 0x00080000 ,0x00100000, 0x00200000, 0x00400000, 0x00800000 ,0x01000000, 0x02000000, 0x04000000, 0x08000000 ,0x10000000, 0x20000000, 0x40000000, 0x80000000}; TNeProc::TNeProc() : TGo4EventProcessor() { int i; cout << "**** TNeProc: Create instance " << endl; fTrigger = NULL; fSubEvents = NULL; fEventsSizes = NULL; for(i = 0; i < 4; ++i) { d1F3[i] = NULL; d1tF3[i] = NULL; d1F5[i] = NULL; d1tF5[i] = NULL; d1F6[i] = NULL; d1tF6[i] = NULL; d1tMWPC[i] = NULL; d2sq_v[i] = NULL; } for(i = 0; i < 16; ++i) { //-----SQ----- d1sq1_x[i] = NULL; d1sq1_y[i] = NULL; d1sq2_x[i] = NULL; d1sq2_y[i] = NULL; d1sq3_x[i] = NULL; d1sq3_y[i] = NULL; d1sq4_x[i] = NULL; d1sq4_y[i] = NULL; d1sq1_v[i] = NULL; d1sq2_v[i] = NULL; d1sq3_v[i] = NULL; d1sq4_v[i] = NULL; //-----SQ time----- d1tsq1_x[i] = NULL; d1tsq1_y[i] = NULL; d1tsq2_x[i] = NULL; d1tsq2_y[i] = NULL; d1tsq3_x[i] = NULL; d1tsq3_y[i] = NULL; d1tsq4_x[i] = NULL; d1tsq4_y[i] = NULL; d1tsq1_v[i] = NULL; d1tsq2_v[i] = NULL; d1tsq3_v[i] = NULL; d1tsq4_v[i] = NULL; //-----Ntetra----- d1Ntetra_x[i] = NULL; d1Ntetra_y[i] = NULL; //-----Ntetra time----- d1tNtetra_x[i] = NULL; d1tNtetra_y[i] = NULL; } d2Ntetra = NULL; //_________________________________Neutrons for(i = 0; i < 48; ++i) { d1neutAmp[i] = NULL; d1neutTAC[i] = NULL; d1neutTDC[i] = NULL; d2Ngamma[i] = NULL; } // d2tF3aF3_L = NULL; d2tF3aF3_R = NULL; d2tF3aF3_U = NULL; d2tF3aF3_D = NULL; d2tF6aF6 = NULL; d1ToF = NULL; d1ToF = NULL; d1aF3 = NULL; d2ToFaF3 = NULL; d2ToFaF3_cut = NULL; d1X1 = NULL; d1Y1 = NULL; d1X2 = NULL; d1Y2 = NULL; d1NX1 = NULL; d1NY1 = NULL; d1NX2 = NULL; d1NY2 = NULL; d2XY1 = NULL; d2XY2 = NULL; d2XY1beam = NULL; d2XY2beam = NULL; d2XYbeamOnTar = NULL; d2XYbeamOnTar_trig2 = NULL; d2XYbeamOnTar_F6 = NULL; d1CX1 = NULL; d1CY1 = NULL; d1CX2 = NULL; d1CY2 = NULL; d2Alarm = NULL; mult1_x = NULL; mult2_x = NULL; mult3_x = NULL; mult4_x = NULL; mult1_v = NULL; mult2_v = NULL; mult3_v = NULL; mult4_v = NULL; } //------------------------------------------------------------------- TNeProc::~TNeProc() { cout << "**** TNeProc: Delete instance " << endl; } //------------------------------------------------------------------- TNeProc::TNeProc(const char* name) : TGo4EventProcessor(name) { qdc_tdc_corr=0; cout << "**** TNeProc: Create instance " << name << endl; fTrigger = MakeTH1('I', "Trigger", "Values of trigger", 16, 0., 15.); fSubEvents = MakeTH1('I', "SubEvents", "Number of subevents", 16, 0, 15); fEventsSizes = MakeTH1('I', "EventSizes", "Size of each event", 1024, 0, 1023); fQDC_TDC_corr = MakeTH2('I',"QDC-TOF","QDC-TOF correlation",16,0,16,16,0,16, "QDC", "TDC"); fQDC_TDC_corr->SetMarkerStyle(21); fQDC_TDC_corr->SetMarkerSize(17); fQDC_TDC_corr->SetMarkerColor(kGreen); for (int iii=1; iii<16; iii++) { for (int jjj=1; jjj<16; jjj++) { fQDC_TDC_corr->Fill(iii,jjj,1); } } int i; for (i = 0; i < 16; ++i) { //-----SQ telescope raw----- d1sq1_x[i] = MakeTH1('I', Form("sq1/x1/x1_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена , Form("Square X stripes CH %2.2d",i), 4096, 0., 4095.); d1sq1_y[i] = MakeTH1('I', Form("sq1/y1/y1_%2.2d",i) , Form("Square Y stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq1_x[i] = MakeTH1('I', Form("sq1/tx1/tx1_%2.2d",i) , Form("Square t_x stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq1_y[i] = MakeTH1('I', Form("sq1/ty1/ty1_%2.2d",i) , Form("Square t_y stripes CH %2.2d",i), 4096, 0., 4095.); d1sq2_x[i] = MakeTH1('I', Form("sq2/x2/x2_%2.2d",i) , Form("Square X stripes CH %2.2d",i), 4096, 0., 4095.); d1sq2_y[i] = MakeTH1('I', Form("sq2/y2/y2_%2.2d",i) , Form("Square Y stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq2_x[i] = MakeTH1('I', Form("sq2/tx2/tx2_%2.2d",i) , Form("Square t_x stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq2_y[i] = MakeTH1('I', Form("sq2/ty2/ty2_%2.2d",i) , Form("Square t_y stripes CH %2.2d",i), 4096, 0., 4095.); d1sq3_x[i] = MakeTH1('I', Form("sq3/x3/x3_%2.2d",i) , Form("Square X stripes CH %2.2d",i), 4096, 0., 4095.); d1sq3_y[i] = MakeTH1('I', Form("sq3/y3/y3_%2.2d",i) , Form("Square Y stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq3_x[i] = MakeTH1('I', Form("sq3/tx3/tx3_%2.2d",i) , Form("Square t_x stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq3_y[i] = MakeTH1('I', Form("sq3/ty3/ty3_%2.2d",i) , Form("Square t_y stripes CH %2.2d",i), 4096, 0., 4095.); d1sq4_x[i] = MakeTH1('I', Form("sq4/x4/x4_%2.2d",i) , Form("Square X stripes CH %2.2d",i), 4096, 0., 4095.); d1sq4_y[i] = MakeTH1('I', Form("sq4/y4/y4_%2.2d",i) , Form("Square Y stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq4_x[i] = MakeTH1('I', Form("sq4/tx4/tx4_%2.2d",i) , Form("Square t_x stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq4_y[i] = MakeTH1('I', Form("sq4/ty4/ty4_%2.2d",i) , Form("Square t_y stripes CH %2.2d",i), 4096, 0., 4095.); d1sq1_v[i] = MakeTH1('I', Form("sq1/v1/v1_%2.2d",i) , Form("Square stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq1_v[i] = MakeTH1('I', Form("sq1/tv1/tv1_%2.2d",i) , Form("Square stripes CH %2.2d",i), 4096, 0., 4095.); d1sq2_v[i] = MakeTH1('I', Form("sq2/v2/v2_%2.2d",i) , Form("Square stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq2_v[i] = MakeTH1('I', Form("sq2/tv2/tv2_%2.2d",i) , Form("Square stripes CH %2.2d",i), 4096, 0., 4095.); d1sq3_v[i] = MakeTH1('I', Form("sq3/v3/v3_%2.2d",i) , Form("Square stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq3_v[i] = MakeTH1('I', Form("sq3/tv3/tv3_%2.2d",i) , Form("Square stripes CH %2.2d",i), 4096, 0., 4095.); d1sq4_v[i] = MakeTH1('I', Form("sq4/v4/v4_%2.2d",i) , Form("Square stripes CH %2.2d",i), 4096, 0., 4095.); d1tsq4_v[i] = MakeTH1('I', Form("sq4/tv4/tv4_%2.2d",i) , Form("Square stripes CH %2.2d",i), 4096, 0., 4095.); //-----tetra Neutron telescope raw----- d1Ntetra_x[i] = MakeTH1('I', Form("Ntetra/x/x_%2.2d",i) , Form("Ntetra X stripes CH %2.2d",i), 4096, 0., 4095.); d1Ntetra_y[i] = MakeTH1('I', Form("Ntetra/y/y_%2.2d",i) , Form("Ntetra Y stripes CH %2.2d",i), 4096, 0., 4095.); d1tNtetra_x[i] = MakeTH1('I', Form("tNtetra/tx/tx_%2.2d",i) , Form("Ntetra tX stripes CH %2.2d",i), 8000, 0, 7999); d1tNtetra_y[i] = MakeTH1('I', Form("tNtetra/ty/ty_%2.2d",i) , Form("Ntetra tY stripes CH %2.2d",i), 20000, 0, 19999); //-----SQ telescope calibrated----- d1sq1_x_c[i] = MakeTH1('D', Form("sq1/cx1/cx1_%2.2d",i) , Form("Square X stripes MeV %2.2d",i), 2000, -2., 20.); d1sq1_y_c[i] = MakeTH1('D', Form("sq1/cy1/cy1_%2.2d",i) , Form("Square Y stripes MeV %2.2d",i), 2000, -2., 20.); d1sq2_x_c[i] = MakeTH1('D', Form("sq2/cx2/cx2_%2.2d",i) , Form("Square X stripes MeV %2.2d",i), 2000, -2., 20.); d1sq2_y_c[i] = MakeTH1('D', Form("sq2/cy2/cy2_%2.2d",i) , Form("Square Y stripes MeV %2.2d",i), 2000, -2., 20.); d1sq3_x_c[i] = MakeTH1('D', Form("sq3/cx3/cx3_%2.2d",i) , Form("Square X stripes MeV %2.2d",i), 2000, -2., 20.); d1sq3_y_c[i] = MakeTH1('D', Form("sq3/cy3/cy3_%2.2d",i) , Form("Square Y stripes MeV %2.2d",i), 2000, -2., 20.); d1sq4_x_c[i] = MakeTH1('D', Form("sq4/cx4/cx4_%2.2d",i) , Form("Square X stripes MeV %2.2d",i), 2000, -2., 20.); d1sq4_y_c[i] = MakeTH1('D', Form("sq4/cy4/cy4_%2.2d",i) , Form("Square Y stripes MeV %2.2d",i), 2000, -2., 20.); d1sq1_v_c[i] = MakeTH1('D', Form("sq1/cv1/cv1_%2.2d",i) , Form("Square stripes MeV %2.2d",i), 2000, -2., 20.); d1sq2_v_c[i] = MakeTH1('D', Form("sq2/cv2/cv2_%2.2d",i) , Form("Square stripes MeV %2.2d",i), 2000, -2., 20.); d1sq3_v_c[i] = MakeTH1('D', Form("sq3/cv3/cv3_%2.2d",i) , Form("Square stripes MeV %2.2d",i), 2000, -2., 20.); d1sq4_v_c[i] = MakeTH1('D', Form("sq4/cv4/cv4_%2.2d",i) , Form("Square stripes MeV %2.2d",i), 2000, -2., 20.); // //-----tetra Neutron telescope calirated----- // d1Ntetra_x_c[i] = MakeTH1('D', Form("Ntetra/cx/cx_%2.2d",i) , Form("Ntetra X stripes MeV %2.2d",i), 2000, -2., 20.); d1Ntetra_y_c[i] = MakeTH1('D', Form("Ntetra/cy/cy_%2.2d",i) , Form("Ntetra Y stripes MeV %2.2d",i), 2000, -2., 20.); } //-----neutrons----- for (i = 0; i < 48; ++i) { d1neutAmp[i] = MakeTH1('I', Form("Neutrons/Amp/Amp_%2.2d",i) , Form("Neutrons Amp CH %2.2d",i), 4096, 0., 4095.); d1neutTAC[i] = MakeTH1('I', Form("Neutrons/TAC/TAC_%2.2d",i) , Form("Neutrons TAC CH %2.2d",i), 4096, 0., 4095.); d1neutTDC[i] = MakeTH1('I', Form("Neutrons/time/time_%2.2d",i) , Form("Neutrons time CH %2.2d",i), 4999, 0., 5000.); d2Ngamma[i] = MakeTH2('I', Form("Neutrons/Ng/Ng_%2.2d",i) , Form("N gamma %2.2d",i), 400, 0., 4095., 400, 0., 4095.,"Amp","TAC"); } for (i = 0; i < 4; ++i) { d2sq_v[i] = MakeTH2('D', Form("2D/dExE/sq_v_%2.2d",i+1) // adc , Form("sq1_x vs v %2.2d",i+1), 400, 0., 20., 400, 0., 20., "sq_x", "veto"); } // d2Ntetra = MakeTH2('D', "2D/dExE/dExE_Ntetra" , "Ntetra_x vs v Ntetra_y", 400, 0., 20., 400, 0., 20., "1mm", "20um"); // d1F3[0] = MakeTH1('I',"F3/QDC/F3_QDC_L","F3 QDC left", 4096, 0., 4095.); d1F3[1] = MakeTH1('I',"F3/QDC/F3_QDC_R","F3 QDC right", 4096, 0., 4095.); d1F3[2] = MakeTH1('I',"F3/QDC/F3_QDC_U","F3 QDC up", 4096, 0., 4095.); d1F3[3] = MakeTH1('I',"F3/QDC/F3_QDC_D","F3 QDC down", 4096, 0., 4095.); d1tF3[0] = MakeTH1('I',"F3/TDC/tF3_TDC_L","F3 TDC left", 10000, 0, 9999); d1tF3[1] = MakeTH1('I',"F3/TDC/tF3_TDC_R","F3 TDC right", 10000, 0, 9999); d1tF3[2] = MakeTH1('I',"F3/TDC/tF3_TDC_U","F3 TDC up", 10000, 0, 9999); d1tF3[3] = MakeTH1('I',"F3/TDC/tF3_TDC_D","F3 TDC down", 10000, 0, 9999); // d1F5[0] = MakeTH1('I',"F5/QDC/F5_QDC_L","F5 QDC left", 4096, 0., 4095.); d1F5[1] = MakeTH1('I',"F5/QDC/F5_QDC_R","F5 QDC right", 4096, 0., 4095.); d1F5[2] = MakeTH1('I',"F5/QDC/F5_QDC_U","F5 QDC up", 4096, 0., 4095.); d1F5[3] = MakeTH1('I',"F5/QDC/F5_QDC_D","F5 QDC down", 4096, 0., 4095.); d1tF5[0] = MakeTH1('I',"F5/TDC/tF5_TDC_L","F5 TDC left", 10000, 0, 9999); d1tF5[1] = MakeTH1('I',"F5/TDC/tF5_TDC_R","F5 TDC right", 10000, 0, 9999); d1tF5[2] = MakeTH1('I',"F5/TDC/tF5_TDC_U","F5 TDC up", 10000, 0, 9999); d1tF5[3] = MakeTH1('I',"F5/TDC/tF5_TDC_D","F5 TDC down", 10000, 0, 9999); // d1F6[0] = MakeTH1('I',"F6/QDC/F6_QDC_L","F6 QDC left", 4096, 0., 4095.); d1F6[1] = MakeTH1('I',"F6/QDC/F6_QDC_R","F6 QDC right", 4096, 0., 4095.); d1F6[2] = MakeTH1('I',"F6/QDC/F6_QDC_U","F6 QDC up", 4096, 0., 4095.); d1F6[3] = MakeTH1('I',"F6/QDC/F6_QDC_D","F6 QDC down", 4096, 0., 4095.); d1tF6[0] = MakeTH1('I',"F6/TDC/tF6_TDC_L","F6 TDC left", 10000, 0, 9999); d1tF6[1] = MakeTH1('I',"F6/TDC/tF6_TDC_R","F6 TDC right", 10000, 0, 9999); d1tF6[2] = MakeTH1('I',"F6/TDC/tF6_TDC_U","F6 TDC up", 10000, 0, 9999); d1tF6[3] = MakeTH1('I',"F6/TDC/tF6_TDC_D","F6 TDC down", 10000, 0, 9999); //-----ToF----- d1ToF = MakeTH1('D', "ToF/ToF", "time of flight", 10000,-100.,400.,"ToF(ns)"); d1aF3 = MakeTH1('D', "ToF/aF3", "amplitude of plastic F3", 4000,0.,4000.,"amp F3"); d2ToFaF3 = MakeTH2('D', "ToF/ToFaF3", "ToF vs aF3", 400,50.,200.,400,0.,4000.,"ToF","aF3"); d2ToFaF3_cut = MakeTH2('D', "ToF/ToFaF3_cut", "ToF vs aF3 with only 8he", 50,165,190,200,600,1200,"ToF","aF3"); d1aF5 = MakeTH1('D', "ToF/aF5", "amplitude of plastic F5", 4000,0.,4000.,"amp F5"); d2ToFaF5 = MakeTH2('D', "ToF/ToFaF5", "ToF vs aF5", 400,50.,200.,400,0.,4000.,"ToF","aF5"); d2ToFaF5_beam = MakeTH2('D', "ToF/ToFaF5_beam", "ToF vs aF5 with beam trigger", 400,50.,200.,400,0.,4000.,"ToF","aF5"); d2tF3aF3_L = MakeTH2('I', "2D/tF3aF3_L", "tdcF3 left vs qdcF3 left", 200,0.,4000.,200,0.,4000.,"tdc","qdc"); d2tF3aF3_R = MakeTH2('I', "2D/tF3aF3_R", "tdcF3 right vs qdcF3 right", 200,0.,4000.,200,0.,4000.,"tdc","qdc"); d2tF3aF3_U = MakeTH2('I', "2D/tF3aF3_U", "tdcF3 up vs qdcF3 up", 200,0.,4000.,200,0.,4000.,"tdc","qdc"); d2tF3aF3_D = MakeTH2('I', "2D/tF3aF3_D", "tdcF3 down vs qdcF3 down", 200,0.,4000.,200,0.,4000.,"tdc","qdc"); d2tF6aF6 = MakeTH2('I', "2D/tF6aF6", "(tF6-tF5) vs qdcF6", 500,200.,700.,500,0.,3000.,"tdc","qdc"); //-----MWPC----- d2XY1 = MakeTH2('I', "MWPC/XY1", "WIRES 1 Y1 vs X1", 32,0.,32.,32,0.,32.,"X1","Y1"); d2XY2 = MakeTH2('I', "MWPC/XY2", "WIRES 2 Y2 vs X2", 32,0.,32.,32,0.,32.,"X2","Y2"); d2XY1beam = MakeTH2('I', "MWPC/XY1_beam", "WIRES 1 Y1 vs X1 beam trigger", 32,0.,32.,32,0.,32.,"X1","Y1"); d2XY2beam = MakeTH2('I', "MWPC/XY2_beam", "WIRES 2 Y2 vs X2 beam trigger", 32,0.,32.,32,0.,32.,"X2","Y2"); d2XYbeamOnTar = MakeTH2('f', "MWPC/XY_beamOnTar", "beam profile at target", 200,-50.0,50.0,200,-50,50,"X(Z=-70.0mm)","Y(Z=-70.0mm)"); d2XYbeamOnTar_trig2 = MakeTH2('f', "MWPC/XY_beamOnTar_trig2", "beam profile at target with trigg==2", 200,-50.0,50.0,200,-50,50,"X(Z=-70.0mm)","Y(Z=-70.0mm)"); d2XYbeamOnTar_F6 = MakeTH2('f', "MWPC/XY_beamOnTar_F6", "beam profile at target with trig=F6", 200,-50.0,50.0,200,-50,50,"X(Z=-70.0mm)","Y(Z=-70.0mm)"); d1X1 = MakeTH1('I', "MWPC/X1","WIRES X1",32,0.,32.); d1Y1 = MakeTH1('I', "MWPC/Y1","WIRES Y1",32,0.,32.); d1X2 = MakeTH1('I', "MWPC/X2","WIRES X2",32,0.,32.); d1Y2 = MakeTH1('I', "MWPC/Y2","WIRES Y2",32,0.,32.); d1tMWPC[0] = MakeTH1('I',"MWPC/tX1","MWPC TDC X1", 10000, 0, 9999); d1tMWPC[1] = MakeTH1('I',"MWPC/tY1","MWPC TDC Y1", 10000, 0, 9999); d1tMWPC[2] = MakeTH1('I',"MWPC/tX2","MWPC TDC X2", 10000, 0, 9999); d1tMWPC[3] = MakeTH1('I',"MWPC/tY2","MWPC TDC Y2", 10000, 0, 9999); d1NX1 = MakeTH1('I', "MWPC/NX1","WIRES X1",32,0.,32.); d1NY1 = MakeTH1('I', "MWPC/NY1","WIRES Y1",32,0.,32.); d1NX2 = MakeTH1('I', "MWPC/NX2","WIRES X2",32,0.,32.); d1NY2 = MakeTH1('I', "MWPC/NY2","WIRES Y2",32,0.,32.); d1CX1 = MakeTH1('I', "MWPC/CX1","clusters X1",32,0.,32.); d1CY1 = MakeTH1('I', "MWPC/CY1","clusters Y1",32,0.,32.); d1CX2 = MakeTH1('I', "MWPC/CX2","clusters X2",32,0.,32.); d1CY2 = MakeTH1('I', "MWPC/CY2","clusters Y2",32,0.,32.); //------ d2Alarm = MakeTH2('I', "2D/Alarm","Correlation loss",1,0.,1.,1,0,1); d2Alarm->SetDrawOption("scatter"); d2Alarm->SetMarkerStyle(20); d2Alarm->SetMarkerSize(50); d2Alarm->SetMarkerColor(kRed); mult1_x = MakeTH1('I', "MULTIPLICITIES/mult1_x","sq1_x multiplicity",16,0,16); mult2_x = MakeTH1('I', "MULTIPLICITIES/mult2_x","sq2_x multiplicity",16,0,16); mult3_x = MakeTH1('I', "MULTIPLICITIES/mult3_x","sq3_x multiplicity",16,0,16); mult4_x = MakeTH1('I', "MULTIPLICITIES/mult4_x","sq4_x multiplicity",16,0,16); mult1_v = MakeTH1('I', "MULTIPLICITIES/mult1_v","sq1_v multiplicity",16,0,16); mult2_v = MakeTH1('I', "MULTIPLICITIES/mult2_v","sq2_v multiplicity",16,0,16); mult3_v = MakeTH1('I', "MULTIPLICITIES/mult3_v","sq3_v multiplicity",16,0,16); mult4_v = MakeTH1('I', "MULTIPLICITIES/mult4_v","sq4_v multiplicity",16,0,16); //------------------------------------------------------------ cout << "**** TNeProc: Pictures" << endl; dx1=0.25; dx2=-0.05; dy1=-0.3; dy2=-0.15; dtx=0; dty=0; pxa0 = -95.; pxa1 = -90.; pxa2 = -30.; pxa3 = 0.; pxa4 = 5.; pya1 = 4.; pya2 = 4.; pya3 = 2.2; ntrackx = 100; ntracky = 100; fLWAX1 = new TLine(pxa1, -0.5*pya1+dx1, pxa1, 0.5*pya1+dx1); fLWAX2 = new TLine(pxa2, -0.5*pya2+dx2, pxa2, 0.5*pya2+dx2); fLWAX3 = new TLine(pxa3, -0.5*pya3+dtx, pxa3, 0.5*pya3+dtx); fLWAX1->SetLineWidth(5); fLWAX2->SetLineWidth(5); fLWAX3->SetLineWidth(5); fTracksX = new TGraph(ntrackx*3); fTracksX->SetName("Tracks X"); for(i = 0; i < fTracksX->GetN(); ++i) fTracksX->SetPoint(i,pxa1,0.); fTracksX->SetLineColor(3); AddObject(fTracksX); fPTrackX = new TGo4Picture("PTrackX","Tracking X wires"); fPTrackX->AddGraph(fTracksX,"AL"); fPTrackX->AddSpecialObject(fLWAX1,"SAME"); fPTrackX->AddSpecialObject(fLWAX2,"SAME"); fPTrackX->AddSpecialObject(fLWAX3,"SAME"); fPTrackX->SetAutoScale(false); fPTrackX->SetRangeX(pxa0,pxa4); fPTrackX->SetRangeY(-0.5*(pya1+1.),0.5*(pya1+1.)); fPTrackX->SetLegendDraw(false); fPTrackX->SetHisStats(false); AddPicture(fPTrackX); itrackAX = 0; pxb0 = -95.; pxb1 = -90.; pxb2 = -30.; pxb3 = 0.; pxb4 = 5.; pyb1 = 4.; pyb2 = 4.; pyb3 = 2.; fLWBX1 = new TLine(pxb1, -0.5*pyb1+dy1, pxb1, 0.5*pyb1+dy1); fLWBX2 = new TLine(pxb2, -0.5*pyb2+dy2, pxb2, 0.5*pyb2+dy2); fLWBX3 = new TLine(pxb3, -0.5*pyb3+dty, pxb3, 0.5*pyb3+dty); fLWBX1->SetLineWidth(5); fLWBX2->SetLineWidth(5); fLWBX3->SetLineWidth(5); fTracksY = new TGraph(ntracky*3); fTracksY->SetName("Tracks Y"); for(i = 0; i < fTracksY->GetN(); ++i) fTracksY->SetPoint(i,pxb1,0.); fTracksY->SetLineColor(3); AddObject(fTracksY); fPTrackY = new TGo4Picture("PTrackY","Tracking Y wires"); fPTrackY->AddGraph(fTracksY,"AL"); fPTrackY->AddSpecialObject(fLWBX1,"SAME"); fPTrackY->AddSpecialObject(fLWBX2,"SAME"); fPTrackY->AddSpecialObject(fLWBX3,"SAME"); fPTrackY->SetAutoScale(false); fPTrackY->SetRangeX(pxb0,pxb4); fPTrackY->SetRangeY(-0.5*(pyb1+1.),0.5*(pyb1+1.)); fPTrackY->SetLegendDraw(false); fPTrackY->SetHisStats(false); AddPicture(fPTrackY); itrackBX = 0; }//------------------------------------------------------------ Bool_t TNeProc::BuildEvent(TGo4EventElement* target) { // called by framework from TNeEvent to fill it TGo4Analysis *go4 = TGo4Analysis::Instance(); TNeEvent* NeEvent = (TNeEvent*) target; TGo4MbsSubEvent* psubevt; TGo4MbsEvent* fInput = (TGo4MbsEvent* ) GetInputEvent(); if(fInput == 0) { cout << "AnlProc: no input event !"<< endl; return kFALSE; } bool dooutput = false; double value1, value2; int msq1_x = 0, msq1_y =0; int msq2_x = 0, msq2_y =0; int msq3_x = 0, msq3_y =0; int msq4_x = 0, msq4_y =0; int msq1_v = 0, msq2_v =0, msq3_v = 0, msq4_v =0; // int mNtetra_x = 0, mNtetra_y =0; // double esq1_x = 0, esq1_y = 0; double esq2_x = 0, esq2_y = 0; double esq3_x = 0, esq3_y = 0; double esq4_x = 0, esq4_y = 0; double esq1_v = 0, esq2_v = 0, esq3_v = 0, esq4_v = 0; // double eNtetra_x = 0, eNtetra_y = 0; // int num = 0, sz = 0; int i, n, geo, typ, header,caen_header, module_id=0, crate=-1, cnt, chnl, evnt, ch; // int mDSD_X, mDSD_Y, mCsI; bool m_bool= false, c_bool = false; uint16_t MSB, LSB; uint32_t MSBLSB, adc; uint32_t *idata; double af3=0., af5=0., tf3=0., tf5=0., ToF=0., tf6=0.0, af6=0.0; fInput->ResetIterator(); while((psubevt = fInput->NextSubEvent()) != 0) { num++; sz += psubevt->GetIntLen(); idata = (uint32_t*) psubevt->GetDataField(); n = -1; while(++n < psubevt->GetIntLen()) { header = idata[n] >> 24; caen_header = header & 0x7; if (dooutput) printf("Raw data = %x\n", idata[n]); switch (psubevt->GetProcid()) { case 100: //VME_0, see setup.usf if (header==0x40) m_bool=true; //MESYTEC header flag else if (caen_header == 2) c_bool=true; //CAEN header flag else if ((idata[n]==0xaffeaffe) || (idata[n]== 0x06000000) || (idata[n]== 0x05000000)) { c_bool=false; m_bool=false; } if (m_bool) //in case of MESYTEC data { typ=idata[n] >> 30; switch(typ) { case 1: //MESYTEC header module_id = (idata[n] >> 16) & 0xff; if (dooutput) printf("Mesytec Module ID %d\n", module_id); break; case 0: //MESYTEC data if(idata[n] >> 24!=0x04) break; switch (module_id) { case 8: // mTDC: tSQ1_x && tSQ1_y chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->tsq1_x[chnl] = adc; } else { NeEvent->tsq1_y[chnl-16] = adc; } break; case 9: // mADC: SQ1_x && SQ1_y chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->sq1_x[chnl] = adc; } else { NeEvent->sq1_y[chnl-16] = adc; } break; case 10: // mTDC: tSQ2_x && tSQ2_y chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->tsq2_x[chnl] = adc; } else { NeEvent->tsq2_y[chnl-16] = adc; } break; case 11: // mADC: SQ2_x && SQ2_y chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->sq2_x[chnl] = adc; } else { NeEvent->sq2_y[chnl-16] = adc; } break; case 12: // mTDC: tSQ3_x & tSQ3_y chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->tsq3_x[chnl] = adc; } else { NeEvent->tsq3_y[chnl-16] = adc; } break; case 13: // mADC: SQ3_x && SQ3_y chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->sq3_x[chnl] = adc; } else { NeEvent->sq3_y[chnl-16] = adc; } break; case 14: // mTDC: tSQ4_x && tSQ4_y chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->tsq4_x[chnl] = adc; } else { NeEvent->tsq4_y[chnl-16] = adc; } break; case 15: // mADC: SQ4_x && SQ4_y chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->sq4_x[chnl] = adc; } else { NeEvent->sq4_y[chnl-16] = adc; } break; case 16: // mTDC: SQ1_v && SQ2_v chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->tsq1_v[chnl] = adc; } else { NeEvent->tsq2_v[chnl-16] = adc; } break; case 17: // mADC: SQ1_v && SQ2_v chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->sq1_v[chnl] = adc; } else { NeEvent->sq2_v[chnl-16] = adc; } break; case 18: // mTDC: SQ3_v && SQ4_v chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->tsq3_v[chnl] = adc; } else { NeEvent->tsq4_v[chnl-16] = adc; } break; case 19: // mADC: SQ3_v && SQ4_v chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->sq3_v[chnl] = adc; } else { NeEvent->sq4_v[chnl-16] = adc; } break; case 0: //mTDC: ToF if ((idata[n] >> 16) & 0x20) break; //T bit analysis chnl= (idata[n] >> 16) & 0x1f; adc = idata[n] & 0xffff; //only 16 bits if(chnl<4) NeEvent->tF3[chnl] = adc; else if(chnl<8) NeEvent->tF5[chnl-4] = adc; else if(chnl<12) NeEvent->tF6[chnl-8] = adc; else if(chnl<16) NeEvent->tMWPC[chnl-12] = adc; else NeEvent->tNtetra_y[chnl-16] = adc; break; case 1: //mQDC: chnl= (idata[n] >> 16) & 0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<4) NeEvent->F3[chnl] = adc; else if(chnl<8) NeEvent->F5[chnl-4] = adc; else if(chnl<12) NeEvent->F6[chnl-8] = adc; break; } break; case 3: //-----MESYTEC footer----- m_bool=false; break; default: printf("ERROR !!!!!! Unknown MESYTEC typ %d\n", typ); printf("Data = %x\n", idata[n]); break; } } else if (c_bool) //in case of CAEN data { typ = (idata[n] >> 24) & 0x7; geo = idata[n] >> 27; if (dooutput) printf("CAEN geo %d\n", geo); switch(typ) { case 2: //CAEN header crate = (idata[n] >> 16) & 0xff; cnt = (idata[n] >> 8) & 0x1f; if (geo==30) NeEvent->mtime=idata[n++];//machine time if (dooutput) printf("Header: geo:%d crate:%d cnt = %d\n", geo, crate, cnt); break; case 0: //CAEN data adc = idata[n] & 0xfff; chnl = (idata[n] >> 16) & 0x1f; //printf("DATA: geo:%d Channel = %d\n", geo, chnl); switch(geo) { case 6: //scaler v560 for(i = 0; i < 16; ++i) NeEvent->scaler[i]=idata[n++]; break; } // printf(" Data: geo:%d chnl:%d adc:%d\n", geo, chnl, adc); break; case 4: //CAEN footer c_bool = false; evnt = idata[n] & 0xffffff; if (dooutput) printf(" Event: geo:%d number:%d\n", geo, evnt); break; case 6: //CAEN no valid data c_bool = false; if (dooutput) printf("!!!No valid data from CAEN!!!"); break; default: printf("ERROR !!!!!! Uncknown CAEN typ %d\n", typ); printf("Data = %x\n", idata[n]); break; } } break; //end of VME_0 case 101: // CAMAC through VME_0, see setup.usf geo = idata[n] >> 27; switch(geo) { case 1: NeEvent->nx1 = 0; adc = idata[++n]; LSB=adc; //printf("First word from MWPC X1= %x\n", adc); for(i = 0; i < 16; ++i) if((adc & bit[i]) > 0) NeEvent->x1[NeEvent->nx1++] = i; adc = idata[++n]; MSB = adc; MSBLSB = (MSB << 16) | LSB; //printf("Second word from MWPC X1= %x\n", adc); for(i = 0; i < 16; ++i) if((adc & bit[i]) > 0) NeEvent->x1[NeEvent->nx1++] = i+16; adc = idata[++n];//pass throug footer //printf("Third word from MWPC X1= %x\n", adc); NeEvent->rx1=MSBLSB; break; case 2: NeEvent->ny1 = 0; adc = idata[++n]; LSB=adc; //printf("First word from MWPC Y1 = %x\n", adc); for(i = 0; i < 16; ++i) if((adc & bit[i]) > 0) NeEvent->y1[NeEvent->ny1++] = i; adc = idata[++n]; MSB = adc; MSBLSB= (MSB << 16) | LSB; //printf("Second word from MWPC Y1 = %x\n", adc); for(i = 0; i < 16; ++i) if((adc & bit[i]) > 0) NeEvent->y1[NeEvent->ny1++] = i+16; adc = idata[++n];//pass through footer //printf("Third word from MWPC Y1 = %x\n", adc); NeEvent->ry1=MSBLSB; break; case 3: NeEvent->nx2 = 0; adc = idata[++n]; LSB=adc; //printf("First word from MWPC X2 = %x\n", adc); for(i = 0; i < 16; ++i) if((adc & bit[i]) > 0) NeEvent->x2[NeEvent->nx2++] = i; adc = idata[++n]; MSB = adc; MSBLSB= (MSB << 16) | LSB; //printf("Second word from MWPC X2 = %x\n", adc); for(i = 0; i < 16; ++i) if((adc & bit[i]) > 0) NeEvent->x2[NeEvent->nx2++] = i+16; adc = idata[++n];//pass through footer //printf("Third word from MWPC X2 = %x\n", adc); NeEvent->rx2=MSBLSB; break; case 4: NeEvent->ny2 = 0; adc = idata[++n]; LSB=adc; //printf("First word from MWPC Y2 = %x\n", adc); for(i = 0; i < 16; ++i) if((adc & bit[i]) > 0) NeEvent->y2[NeEvent->ny2++] = i; adc = idata[++n]; MSB = adc; MSBLSB= (MSB << 16) | LSB; //printf("Second word from MWPC Y2 = %x\n", adc); for(i = 0; i < 16; ++i) if((adc & bit[i]) > 0) NeEvent->y2[NeEvent->ny2++] = i+16; adc = idata[++n];//pass throug footer //printf("Third word from MWPC Y2 = %x\n", adc); NeEvent->ry2=MSBLSB; break; } break; // end of CAMAC case 200: // VME_1, see setup.usf if (header==0x40) m_bool=true; //MESYTEC header flag else if (caen_header == 2) c_bool=true; //CAEN header flag else if ((idata[n]==0xaffeaffe) || (idata[n]== 0x06000000) || (idata[n]== 0x05000000)) { c_bool=false; m_bool=false; } if (m_bool) //in case of MESYTEC data { typ=idata[n] >> 30; switch(typ) { case 1: //MESYTEC header module_id = (idata[n] >> 16) & 0xff; break; case 0: //MESYTEC data if(idata[n] >> 24!=0x04) break; switch (module_id) { case 3: //mTDC: if ((idata[n] >> 16) & 0x20) break; //T bit analysis chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0x1fff; //only 13 bits NeEvent->neutTDC[chnl] = adc; break; case 4: //mTDC: if ((idata[n] >> 16) & 0x20) break; //T bit analysis chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0x1fff; //only 13 bits if(chnl<16) { NeEvent->neutTDC[chnl+32] = adc; } else //times tNtetra_x { NeEvent->tNtetra_x[chnl-16] = adc; } break; case 5: // mADC: Ntetra_x && Ntetra_x chnl= (idata[n] >> 16)&0x1f; adc = idata[n] & 0xfff; //only 12 bits if(chnl<16) { NeEvent->Ntetra_x[chnl] = adc; } else { NeEvent->Ntetra_y[chnl-16] = adc; } break; } break; case 3: //MESYTEC footer m_bool=false; break; default: printf("ERROR !!!!!! Uncknown MESYTEC typ %d\n", typ); printf("Data = %x\n", idata[n]); break; } } else if (c_bool) //in case of CAEN data { typ = (idata[n] >> 24) & 0x7; geo = idata[n] >> 27; switch(typ) { case 2: //CAEN header crate = (idata[n] >> 16) & 0xff; cnt = (idata[n] >> 8) & 0x1f; if (dooutput) printf("Header: geo:%d crate:%d cnt = %d\n", geo, crate, cnt); break; case 0: //CAEN data adc = idata[n] & 0xfff; chnl = (idata[n] >> 16) & 0x1f; switch(geo) { case 0: //ADC if (chnl%2==0){ ch = chnl/2; NeEvent->neutAmp[ch] = adc; } else { ch = chnl/2; NeEvent->neutTAC[ch] = adc; } break; case 1: //ADC if (chnl%2==0){ ch = chnl/2; NeEvent->neutAmp[ch+16] = adc; } else { ch = chnl/2; NeEvent->neutTAC[ch+16] = adc; } break; case 2: //ADC if (chnl%2==0){ ch = chnl/2; NeEvent->neutAmp[ch+32] = adc; } else { ch = chnl/2; NeEvent->neutTAC[ch+32] = adc; } break; } // printf(" Data: geo:%d chnl:%d adc:%d\n", geo, chnl, adc); break; case 4: //CAEN footer c_bool = false; evnt = idata[n] & 0xffffff; if (dooutput) printf(" Event: geo:%d number:%d\n", geo, evnt); break; case 6: //CAEN no valid data c_bool = false; if (dooutput) printf("!!!No valid data from CAEN!!!"); break; default: printf("ERROR !!!!!! Unknown CAEN typ %d\n", typ); printf("Data = %x\n", idata[n]); break; } } break; //end of VME_1 } //end of GetProcID } //end of GetIntLen } //end of NextSubEvent NeEvent->nevent = fInput->GetCount(); NeEvent->trigger = fInput->GetTrigger(); NeEvent->subevents = num; NeEvent->evsize = sz; fTrigger->Fill(NeEvent->trigger); fSubEvents->Fill(num); fEventsSizes->Fill(sz); // for (n=0; n<4; ++n) // if(NeEvent->trigger == 2) { if(NeEvent->F3[n] > 0 ) d1F3[n]->Fill(NeEvent->F3[n]); if(NeEvent->F5[n] > 0) d1F5[n]->Fill(NeEvent->F5[n]); if(NeEvent->F6[n] > 0) d1F6[n]->Fill(NeEvent->F6[n]); if(NeEvent->tF3[n] > 0) d1tF3[n]->Fill(NeEvent->tF3[n]); if(NeEvent->tF5[n] > 0) d1tF5[n]->Fill(NeEvent->tF5[n]); if(NeEvent->tF6[n] > 0) d1tF6[n]->Fill(NeEvent->tF6[n]); if(NeEvent->tMWPC[n] > 0) d1tMWPC[n]->Fill(NeEvent->tMWPC[n]); } //d2tF6aF6 if(NeEvent->tF3[0] > 0 && NeEvent->F3[0] > 0) d2tF3aF3_L->Fill(NeEvent->tF3[0],NeEvent->F3[0]); if(NeEvent->tF3[1] > 0 && NeEvent->F3[1] > 0) d2tF3aF3_R->Fill(NeEvent->tF3[1],NeEvent->F3[1]); if(NeEvent->tF3[2] > 0 && NeEvent->F3[2] > 0) d2tF3aF3_U->Fill(NeEvent->tF3[2],NeEvent->F3[2]); if(NeEvent->tF3[3] > 0 && NeEvent->F3[3] > 0) d2tF3aF3_D->Fill(NeEvent->tF3[3],NeEvent->F3[3]); // if(NeEvent->F3[0]>0&&NeEvent->F3[1]>0&&NeEvent->F3[2]>0&&NeEvent->F3[3]>0) af3 = (NeEvent->F3[0]+NeEvent->F3[1]+NeEvent->F3[2]+NeEvent->F3[3]+4.*gRandom->Uniform())/4.; if(NeEvent->F5[0]>0&&NeEvent->F5[1]>0&&NeEvent->F5[2]>0&&NeEvent->F5[3]>0) af5 = (NeEvent->F5[0]+NeEvent->F5[1]+NeEvent->F5[2]+NeEvent->F5[3]+4.*gRandom->Uniform())/4.; if(NeEvent->F6[0]>0&&NeEvent->F6[1]>0&&NeEvent->F6[2]>0&&NeEvent->F6[3]>0) af6 = (NeEvent->F6[0]+NeEvent->F6[1]+NeEvent->F6[2]+NeEvent->F6[3]+4.*gRandom->Uniform())/4.; if(NeEvent->tF3[0]>0&&NeEvent->tF3[1]>0&&NeEvent->tF3[2]>0&&NeEvent->tF3[3]>0) tf3 = (NeEvent->tF3[0]+NeEvent->tF3[1]+NeEvent->tF3[2]+NeEvent->tF3[3]+4.*gRandom->Uniform())/4.; if(NeEvent->tF5[0]>0&&NeEvent->tF5[1]>0&&NeEvent->tF5[2]>0&&NeEvent->tF5[3]>0) tf5 = (NeEvent->tF5[0]+NeEvent->tF5[1]+NeEvent->tF5[2]+NeEvent->tF5[3]+4.*gRandom->Uniform())/4.; if(NeEvent->tF6[0]>0&&NeEvent->tF6[1]>0&&NeEvent->tF6[2]>0&&NeEvent->tF6[3]>0) tf6 = (NeEvent->tF6[0]+NeEvent->tF6[1]+NeEvent->tF6[2]+NeEvent->tF6[3]+4.*gRandom->Uniform())/4.; // // ToF = (tf5 - tf3)*0.125+89.165; // ToF = (tf5 - tf3)*0.0625; // ToF = (tf5 - tf3)*0.0625 + 68.55; // ToF = (tf5 - tf3)*0.0625 + 68.475; daily quest if(af3*af5*tf3*tf5!=0) { // if(NeEvent->trigger == 1) { d1ToF->Fill(ToF); d1aF3->Fill(af3); d2ToFaF3->Fill(ToF,af3); // if (ToF>155 && ToF<170 && af3>400 && af3<1000) d2ToFaF3_cut->Fill(ToF,af3); //for 6he // if (ToF>163 && ToF<175 && af3>500 && af3<1000) d2ToFaF3_cut->Fill(ToF,af3); // for 9li if (ToF>165 && ToF<190 && af3>600 && af3<1200) d2ToFaF3_cut->Fill(ToF,af3); // for 8He if (d2ToFaF3_cut->GetEntries()>800) d2Alarm->Fill(0.5,0.5); d1aF5->Fill(af5); d2ToFaF5->Fill(ToF,af5); if(ToF<165 && ToF>168 && af5<500 && af5>700) { qdc_tdc_corr++; } if(NeEvent->trigger == 1) { d2ToFaF5_beam->Fill(ToF,af5); } } } if (tf6>0 && tf5>0 && af6>0) { d2tF6aF6->Fill(tf6-tf5, af6); } //-----SQ telescopes amp.----- for (n=0; n<16; ++n) { if(NeEvent->sq1_x[n] > 0) d1sq1_x[n]->Fill(NeEvent->sq1_x[n]); if(NeEvent->sq1_y[n] > 0) d1sq1_y[n]->Fill(NeEvent->sq1_y[n]); if(NeEvent->sq2_x[n] > 0) d1sq2_x[n]->Fill(NeEvent->sq2_x[n]); if(NeEvent->sq2_y[n] > 0) d1sq2_y[n]->Fill(NeEvent->sq2_y[n]); if(NeEvent->sq3_x[n] > 0) d1sq3_x[n]->Fill(NeEvent->sq3_x[n]); if(NeEvent->sq3_y[n] > 0) d1sq3_y[n]->Fill(NeEvent->sq3_y[n]); if(NeEvent->sq4_x[n] > 0) d1sq4_x[n]->Fill(NeEvent->sq4_x[n]); if(NeEvent->sq4_y[n] > 0) d1sq4_y[n]->Fill(NeEvent->sq4_y[n]); if(NeEvent->sq1_v[n] > 0) d1sq1_v[n]->Fill(NeEvent->sq1_v[n]); if(NeEvent->sq2_v[n] > 0) d1sq2_v[n]->Fill(NeEvent->sq2_v[n]); if(NeEvent->sq3_v[n] > 0) d1sq3_v[n]->Fill(NeEvent->sq3_v[n]); if(NeEvent->sq4_v[n] > 0) d1sq4_v[n]->Fill(NeEvent->sq4_v[n]); } //-----Ntetra telescopes amp.----- for (n=0; n<16; ++n) { if(NeEvent->Ntetra_x[n] > 0) d1Ntetra_x[n]->Fill(NeEvent->Ntetra_x[n]); if(NeEvent->Ntetra_y[n] > 0) d1Ntetra_y[n]->Fill(NeEvent->Ntetra_y[n]); } //-----SQ telescopes time--- for (n=0; n<16; ++n) { if(NeEvent->tsq1_x[n] > 0) d1tsq1_x[n]->Fill(NeEvent->tsq1_x[n]); if(NeEvent->tsq1_y[n] > 0) d1tsq1_y[n]->Fill(NeEvent->tsq1_y[n]); if(NeEvent->tsq2_x[n] > 0) d1tsq2_x[n]->Fill(NeEvent->tsq2_x[n]); if(NeEvent->tsq2_y[n] > 0) d1tsq2_y[n]->Fill(NeEvent->tsq2_y[n]); if(NeEvent->tsq3_x[n] > 0) d1tsq3_x[n]->Fill(NeEvent->tsq3_x[n]); if(NeEvent->tsq3_y[n] > 0) d1tsq3_y[n]->Fill(NeEvent->tsq3_y[n]); if(NeEvent->tsq4_x[n] > 0) d1tsq4_x[n]->Fill(NeEvent->tsq4_x[n]); if(NeEvent->tsq4_y[n] > 0) d1tsq4_y[n]->Fill(NeEvent->tsq4_y[n]); if(NeEvent->tsq1_v[n] > 0) d1tsq1_v[n]->Fill(NeEvent->tsq1_v[n]); if(NeEvent->tsq2_v[n] > 0) d1tsq2_v[n]->Fill(NeEvent->tsq2_v[n]); if(NeEvent->tsq3_v[n] > 0) d1tsq3_v[n]->Fill(NeEvent->tsq3_v[n]); if(NeEvent->tsq4_v[n] > 0) d1tsq4_v[n]->Fill(NeEvent->tsq4_v[n]); } //-----Ntetra telescopes time----- for (n=0; n<16; ++n) { if(NeEvent->tNtetra_x[n] > 0) d1tNtetra_x[n]->Fill(NeEvent->tNtetra_x[n]); if(NeEvent->tNtetra_y[n] > 0) d1tNtetra_y[n]->Fill(NeEvent->tNtetra_y[n]); } //-----SQ telescopes calibrated----- for (n=0; n<16; ++n) { if(NeEvent->tsq1_x[n] > 0) { value1 = (double)NeEvent->sq1_x[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ1_X_EC->Energy(value1, n); d1sq1_x_c[n]->Fill(value2); msq1_x++; esq1_x = value2; } if(NeEvent->tsq1_y[n] > 0) { value1 = (double)NeEvent->sq1_y[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ1_Y_EC->Energy(value1, n); d1sq1_y_c[n]->Fill(value2); msq1_y++; esq1_y = value2; } if(NeEvent->tsq2_x[n] > 0) { value1 = (double)NeEvent->sq2_x[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ2_X_EC->Energy(value1, n); d1sq2_x_c[n]->Fill(value2); msq2_x++; esq2_x = value2; } if(NeEvent->tsq2_y[n] > 0) { value1 = (double)NeEvent->sq2_y[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ2_Y_EC->Energy(value1, n); d1sq2_y_c[n]->Fill(value2); msq2_y++; esq2_y = value2; } if(NeEvent->tsq3_x[n] > 0) { value1 = (double)NeEvent->sq3_x[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ3_X_EC->Energy(value1, n); d1sq3_x_c[n]->Fill(value2); msq3_x++; esq3_x = value2; } if(NeEvent->tsq3_y[n] > 0) { value1 = (double)NeEvent->sq3_y[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ3_Y_EC->Energy(value1, n); d1sq3_y_c[n]->Fill(value2); msq3_y++; esq3_y = value2; } if(NeEvent->tsq4_x[n] > 0) { value1 = (double)NeEvent->sq4_x[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ4_X_EC->Energy(value1, n); d1sq4_x_c[n]->Fill(value2); msq4_x++; esq4_x = value2; } if(NeEvent->tsq4_y[n] > 0) { value1 = (double)NeEvent->sq4_y[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ4_Y_EC->Energy(value1, n); d1sq4_y_c[n]->Fill(value2); msq4_y++; esq4_y = value2; } if(NeEvent->tsq1_v[n] > 0) { value1 = (double)NeEvent->sq1_v[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ1_V_EC->Energy(value1, n); d1sq1_v_c[n]->Fill(value2); msq1_v++; esq1_v = value2; } if(NeEvent->tsq2_v[n] > 0) { value1 = (double)NeEvent->sq2_v[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ2_V_EC->Energy(value1, n); d1sq2_v_c[n]->Fill(value2); msq2_v++; esq2_v = value2; } if(NeEvent->tsq3_v[n] > 0) { value1 = (double)NeEvent->sq3_v[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ3_V_EC->Energy(value1, n); d1sq3_v_c[n]->Fill(value2); msq3_v++; esq3_v = value2; } if(NeEvent->tsq4_v[n] > 0) { value1 = (double)NeEvent->sq4_v[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ4_V_EC->Energy(value1, n); d1sq4_v_c[n]->Fill(value2); msq4_v++; esq4_v = value2; } } // //-----Ntetra telescopes calibrated----- for (n=0; n<16; ++n) { if(NeEvent->tNtetra_x[n] > 0) { value1 = (double)NeEvent->Ntetra_x[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pNTETRA_X_EC->Energy(value1, n); d1Ntetra_x_c[n]->Fill(value2); mNtetra_x++; eNtetra_x = value2; } if(NeEvent->tNtetra_y[n] > 0) { value1 = (double)NeEvent->Ntetra_y[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pNTETRA_Y_EC->Energy(value1, n); d1Ntetra_y_c[n]->Fill(value2); mNtetra_y++; eNtetra_y = value2; } } //----- MULTIPLICITIES 1D---- mult1_x->Fill(msq1_x); mult2_x->Fill(msq2_x); mult3_x->Fill(msq3_x); mult4_x->Fill(msq4_x); mult1_v->Fill(msq1_v); mult2_v->Fill(msq2_v); mult3_v->Fill(msq3_v); mult4_v->Fill(msq4_v); //-----SQ telescopes 2D----- if(msq1_x*msq1_v==1 && tf5>5000 && tf5<7000) d2sq_v[0]->Fill(esq1_x,esq1_v); if(msq2_x*msq2_v==1 && tf5>5000 && tf5<7000) d2sq_v[1]->Fill(esq2_x,esq2_v); if(msq3_x*msq3_v==1 && tf5>5000 && tf5<7000) d2sq_v[2]->Fill(esq3_x,esq3_v); if(msq4_x*msq4_v==1 && tf5>5000 && tf5<7000) d2sq_v[3]->Fill(esq4_x,esq4_v); //______dExE Ntetra // if(mNtetra_x*mNtetra_y==1 && tf5>5000 && tf5<7000) d2Ntetra->Fill(eNtetra_y,eNtetra_x); if(mNtetra_x*mNtetra_y==1) d2Ntetra->Fill(eNtetra_y,eNtetra_x); //-----neutrons----- for (n=0; n<48; ++n) { if(NeEvent->neutAmp[n] > 0) d1neutAmp[n]->Fill(NeEvent->neutAmp[n]); if(NeEvent->neutTAC[n] > 0) d1neutTAC[n]->Fill(NeEvent->neutTAC[n]); if(NeEvent->neutTDC[n] > 0) d1neutTDC[n]->Fill(NeEvent->neutTDC[n]); if(NeEvent->neutAmp[n] > 0 && NeEvent->neutTAC[n] > 0) d2Ngamma[n]->Fill(NeEvent->neutAmp[n],NeEvent->neutTAC[n]); } //-----CALIBRATED----- //-----SQ telescope----- /* for (n=0; n<16; ++n) { if(NeEvent->tsq1_x[n] > 0) { value1 = (double)NeEvent->sq1_x[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pSQ1_X_EC->Energy(value1, n); d1sq1_x_c[n]->Fill(value2); msq1_x++; // d1nDSD_X->Fill(n); // EDSD_X = value2; } if(NeEvent->tDSD_X[n] > 0) { value1 = (double)NeEvent->DSD_X[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pDSD_X_EC->Energy(value1, n); d1DSD_X_C[n]->Fill(value2); mDSD_X++; // d1nDSD_X->Fill(n); EDSD_X = value2; } if(NeEvent->tDSD_Y[n] > 0) { value1 = (double)NeEvent->DSD_Y[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pDSD_Y_EC->Energy(value1, n); d1DSD_Y_C[n]->Fill(value2); mDSD_Y++; // d1nDSD_Y->Fill(n); EDSD_Y = value2; } if(NeEvent->tCsI[n] > 0) // { value1 = (double)NeEvent->CsI[n] + gRandom->Uniform(); value2 = ((TNeAnalysis*)go4)->pCsI_EC->Energy(value1, n); d1CsI_C[n]->Fill(value2); mCsI++; // d1nDSD_Y->Fill(n); ECsI = value2; } } */ // Two dimensional spectra //---------------------start of MWPC---------------------------------------- // if(NeEvent->trigger == 1 && ToF > 165 && ToF <185) // { for(i = 0; i < NeEvent->nx1; ++i) d1X1->Fill(NeEvent->x1[i]); for(i = 0; i < NeEvent->ny1; ++i) d1Y1->Fill(NeEvent->y1[i]); for(i = 0; i < NeEvent->nx2; ++i) d1X2->Fill(NeEvent->x2[i]); for(i = 0; i < NeEvent->ny2; ++i) d1Y2->Fill(NeEvent->y2[i]); // } if(NeEvent->nx1 > 0) d1NX1->Fill(NeEvent->nx1); if(NeEvent->ny1 > 0) d1NY1->Fill(NeEvent->ny1); if(NeEvent->nx2 > 0) d1NX2->Fill(NeEvent->nx2); if(NeEvent->ny2 > 0) d1NY2->Fill(NeEvent->ny2); if(NeEvent->nx1 > 0) d1CX1->Fill(GetClasters(NeEvent->nx1, NeEvent->x1)); if(NeEvent->ny1 > 0) d1CY1->Fill(GetClasters(NeEvent->ny1, NeEvent->y1)); if(NeEvent->nx2 > 0) d1CX2->Fill(GetClasters(NeEvent->nx2, NeEvent->x2)); if(NeEvent->ny2 > 0) d1CY2->Fill(GetClasters(NeEvent->ny2, NeEvent->y2)); // Li9 // if (NeEvent->nx1*NeEvent->ny1*NeEvent->nx2*NeEvent->ny2 == 1 && 162nx1*NeEvent->ny1*NeEvent->nx2*NeEvent->ny2 == 1 && ToF>158 && ToF<168 && af3>500 && af3<1100) if (NeEvent->nx1*NeEvent->ny1*NeEvent->nx2*NeEvent->ny2 == 1) { mwz1 = -816; mwx1 = (16 - NeEvent->x1[0] + gRandom->Uniform())*1.25; mwy1 = (NeEvent->y1[0] - 16 + gRandom->Uniform())*1.25; mwz2 = -270; mwx2 = (16 - NeEvent->x2[0] + gRandom->Uniform())*1.25; mwy2 = (NeEvent->y2[0] - 16 + gRandom->Uniform())*1.25; zbt = -70; xbt = mwx2 + (mwx2 - mwx1)*(zbt-mwz2)/(mwz2-mwz1); ybt = mwy2 + (mwy2 - mwy1)*(zbt-mwz2)/(mwz2-mwz1); if (NeEvent->trigger == 1) { d2XYbeamOnTar->Fill(xbt, ybt); } if (NeEvent->trigger == 2, NeEvent->trigger == 3, NeEvent->trigger == 4, NeEvent->trigger == 5) { d2XYbeamOnTar_trig2->Fill(xbt, ybt); } if (NeEvent->tF6[0]*NeEvent->tF6[1]*NeEvent->tF6[2]*NeEvent->tF6[3]>0) { d2XYbeamOnTar_F6->Fill(xbt, ybt); } } // if(NeEvent->nx1 > 0 && NeEvent->ny1 > 0 && (GetClasters(NeEvent->nx1, NeEvent->x1)) == 1 && (GetClasters(NeEvent->ny1, NeEvent->y1)) == 1) { // d2XY1->Fill(NeEvent->x1[0],NeEvent->y1[0]); // if(NeEvent->tF6[2] >100) d2XY1beam->Fill(NeEvent->x1[0],NeEvent->y1[0]); if(NeEvent->trigger == 1) d2XY1beam->Fill(NeEvent->x1[0],NeEvent->y1[0]); else d2XY1->Fill(NeEvent->x1[0],NeEvent->y1[0]); } if(NeEvent->nx2 > 0 && NeEvent->ny2 > 0 && (GetClasters(NeEvent->nx2, NeEvent->x2)) == 1 && (GetClasters(NeEvent->ny2, NeEvent->y2)) == 1) { // d2XY2->Fill(NeEvent->x2[0],NeEvent->y2[0]); // if(NeEvent->tF6[2] >100) d2XY2beam->Fill(NeEvent->x2[0],NeEvent->y2[0]); if(NeEvent->trigger == 1) d2XY2beam->Fill(NeEvent->x2[0],NeEvent->y2[0]); else d2XY2->Fill(NeEvent->x2[0],NeEvent->y2[0]); } /* if(NeEvent->nx1 == 1 && NeEvent->ny1 == 1 && NeEvent->trigger == 1) { d2XY1->Fill(NeEvent->x1[0],NeEvent->y1[0]); } if(NeEvent->nx2 == 1 && NeEvent->ny2 == 1 && NeEvent->trigger == 1) { d2XY2->Fill(NeEvent->x2[0],NeEvent->y2[0]); } */ //---Pictures--- /* if(NeEvent->nx1 == 1 && NeEvent->nx2 == 1) { ya1 = -0.5*pya1 + dx1 + (pya1 / 32.)*NeEvent->x1[0]; ya2 = -0.5*pya2 + dx2 + (pya2 / 32.)*NeEvent->x2[0]; ya3 = ya1 + dtx + (ya2 - ya1) * (pxa3 - pxa1) / (pxa2 - pxa1); if(ya3 > -0.5*pya1 && ya3 < 0.5*pya1) { if(((TNeAnalysis*)go4)->pMTracks->mtracksx != ntrackx) { ntrackx = ((TNeAnalysis*)go4)->pMTracks->mtracksx; fTracksX->Set(3*ntrackx); itrackAX = 0; for(i = 0; i < fTracksX->GetN(); ++i) fTracksX->SetPoint(i,pxb1,0.); } if(itrackAX == fTracksX->GetN()) itrackAX = 0; fTracksX->SetPoint(itrackAX++,pxa1,ya1); fTracksX->SetPoint(itrackAX++,pxa3,ya3); fTracksX->SetPoint(itrackAX++,pxa1,ya1); } } if(NeEvent->ny1 == 1 && NeEvent->ny2 == 1) { yb1 = -0.5*pyb1 + dy1+ (pyb1 / 32.)*NeEvent->y1[0]; yb2 = -0.5*pyb2 + dy2+ (pyb2 / 32.)*NeEvent->y2[0]; yb3 = yb1 + dty + (yb2 - yb1) * (pxb3 - pxb1) / (pxb2 - pxb1); if(yb3 > -0.5*pyb1 && yb3 < 0.5*pyb1) { if(((TNeAnalysis*)go4)->pMTracks->mtracksy != ntracky) { ntracky = ((TNeAnalysis*)go4)->pMTracks->mtracksy; fTracksY->Set(3*ntracky); itrackBX = 0; for(i = 0; i < fTracksY->GetN(); ++i) fTracksY->SetPoint(i,pxb1,0.); } if(itrackBX == fTracksY->GetN()) itrackBX = 0; fTracksY->SetPoint(itrackBX++,pxb1,yb1); fTracksY->SetPoint(itrackBX++,pxb3,yb3); fTracksY->SetPoint(itrackBX++,pxb1,yb1); } } if(NeEvent->nx1 == 1 && NeEvent->nx2 == 1 && NeEvent->ny1 == 1 && NeEvent->ny2 == 1 ) { d2Target->Fill(ya3,yb3); }*/ if (qdc_tdc_corr<-1) { fQDC_TDC_corr->SetMarkerColor(kRed); } //--------------------end of MWPC---------------------------------------- NeEvent->SetValid(kTRUE); // to store return kTRUE; } //------------------------------------------------------------------- double TNeProc::GetClasters(unsigned short n, unsigned short *x) { int i; double clasters = 1; if(n == 0) clasters = 0.; else if(n > 1) { for(i = 1; i < n; ++i) { if(abs(x[i] - x[i-1]) > 1) clasters += 1.; } } return clasters; } //--------------------------------------------------------------------