#include "BTJuly2006.h" using namespace std; ClassImp(BTJuly2006) //============================================================================// BTJuly2006::BTJuly2006() { NCH=4; NF=0; datfile=NULL; datobj=NULL; } //============================================================================// BTJuly2006::BTJuly2006(string config,string rootfileRW) { NCH=4; CONFIG=config; ROOTFILE=rootfileRW; //sprintf(path,"/media/usbdisk/data/bcm/CERNbt_July2006/"); sprintf(path,"/afs/f9.ijs.si/home/irena/Delo/phd_analiza/Beam-Tests/CERNbt_july2006/2deff/"); Int_t read_tracks=1; Char_t pedestal[300]="calib_250806_1420.txt"; Int_t Polarity[4]; Float_t low[4],up[4],width_thr[4]; Float_t noise_time[4],sig_dt[4]; /************** JULY 2006 ***************************************/ if(CONFIG=="config1-T11"){ RUN.push_back(43); NINOthr.push_back(75); RUN.push_back(44); NINOthr.push_back(101.8); RUN.push_back(45); NINOthr.push_back(64.9); RUN.push_back(46); NINOthr.push_back(54.6); RUN.push_back(47); NINOthr.push_back(85.3); RUN.push_back(48); NINOthr.push_back(85.3); RUN.push_back(83); NINOthr.push_back(50.3); RUN.push_back(84); NINOthr.push_back(39.9); RUN.push_back(85); NINOthr.push_back(29.9); RUN.push_back(88); NINOthr.push_back(29.9); ADC_ChInput[0]="NINO chA, F402 at -1000V"; ADC_ChInput[1]="NINO chB, F403 at -1000V"; ADC_ChInput[2]="F404 at +1000V"; ADC_ChInput[3]="F405 at +1000V"; for(Int_t ich=0;ich()); Pos_y1.push_back(std::vector()); if(RUN[ii]<83){ Pos_x1.at(ii).push_back(0), Pos_y1.at(ii).push_back(0); Pos_x1.at(ii).push_back(0), Pos_y1.at(ii).push_back(0); Pos_x1.at(ii).push_back(7.2), Pos_y1.at(ii).push_back(-20.8); Pos_x1.at(ii).push_back(8), Pos_y1.at(ii).push_back(-21.2);} else{ Pos_x1.at(ii).push_back(10), Pos_y1.at(ii).push_back(-22.1); Pos_x1.at(ii).push_back(8.1), Pos_y1.at(ii).push_back(-22.4); Pos_x1.at(ii).push_back(7.2), Pos_y1.at(ii).push_back(-20.8); Pos_x1.at(ii).push_back(8), Pos_y1.at(ii).push_back(-21.2);} } } else if(CONFIG=="config2-T11"){ RUN.push_back(49); NINOthr.push_back(59.9); RUN.push_back(50); NINOthr.push_back(59.9); RUN.push_back(51); NINOthr.push_back(100.2); RUN.push_back(52); NINOthr.push_back(100.2); RUN.push_back(54); NINOthr.push_back(100.2); RUN.push_back(55); NINOthr.push_back(100.2); RUN.push_back(57); NINOthr.push_back(100.2); RUN.push_back(59); NINOthr.push_back(150.3); RUN.push_back(61); NINOthr.push_back(128.5); RUN.push_back(62); NINOthr.push_back(128.5); RUN.push_back(68); NINOthr.push_back(50.6); RUN.push_back(76); NINOthr.push_back(63.6); RUN.push_back(77); NINOthr.push_back(63.6); RUN.push_back(78); NINOthr.push_back(63.6); ADC_ChInput[0]="F402 at -1000V"; ADC_ChInput[1]="F403 at -1000V"; ADC_ChInput[2]="NINO chA, F404 at +1000V"; ADC_ChInput[3]="NINO chB, F405 at +1000V"; for(Int_t ich=0;ich()); Pos_y1.push_back(std::vector()); Pos_x1.at(ii).push_back(9.9), Pos_y1.at(ii).push_back(-22.2); Pos_x1.at(ii).push_back(8.2), Pos_y1.at(ii).push_back(-22.3); Pos_x1.at(ii).push_back(7.25), Pos_y1.at(ii).push_back(-21.); Pos_x1.at(ii).push_back(8.25), Pos_y1.at(ii).push_back(-21.); } for(Int_t ii=0;ii()); Pos_y1.push_back(std::vector()); if(RUN[ii]==105){ Pos_x1.at(ii).push_back(0), Pos_y1.at(ii).push_back(0); Pos_x1.at(ii).push_back(0), Pos_y1.at(ii).push_back(0); Pos_x1.at(ii).push_back(0), Pos_y1.at(ii).push_back(0); Pos_x1.at(ii).push_back(8.25), Pos_y1.at(ii).push_back(-21.);} else{ Pos_x1.at(ii).push_back(20.), Pos_y1.at(ii).push_back(-19.5); Pos_x1.at(ii).push_back(18.25), Pos_y1.at(ii).push_back(-20.25); Pos_x1.at(ii).push_back(0), Pos_y1.at(ii).push_back(0); Pos_x1.at(ii).push_back(18), Pos_y1.at(ii).push_back(-19.1);} } } else if(CONFIG=="config2-T9"){ RUN.push_back(184); NINOthr.push_back(30); // RUN.push_back(187); // NINOthr.push_back(20.0); // RUN.push_back(188); // NINOthr.push_back(20.0); //manjka RUN.push_back(189); NINOthr.push_back(10.2); RUN.push_back(190); NINOthr.push_back(40); RUN.push_back(191); NINOthr.push_back(50); RUN.push_back(192); NINOthr.push_back(60); ADC_ChInput[0]="F402 at -1000V"; ADC_ChInput[1]="F403 at -1000V"; ADC_ChInput[2]="NINO chA, F404 at +1000V"; ADC_ChInput[3]="NINO chB, F405 at +1000V"; for(Int_t ich=0;ich()); Pos_y1.push_back(std::vector()); Pos_x1.at(ii).push_back(20.), Pos_y1.at(ii).push_back(-19.5); Pos_x1.at(ii).push_back(18.1), Pos_y1.at(ii).push_back(-20.1); Pos_x1.at(ii).push_back(17.2), Pos_y1.at(ii).push_back(-18.5); Pos_x1.at(ii).push_back(18), Pos_y1.at(ii).push_back(-18.9); } } else if(CONFIG=="config3-T9"){ // RUN.push_back(194); manjka // NINOthr.push_back(40); RUN.push_back(195); NINOthr.push_back(59.8); RUN.push_back(196); NINOthr.push_back(59.8); RUN.push_back(197); NINOthr.push_back(59.8); RUN.push_back(198); NINOthr.push_back(50); RUN.push_back(199); NINOthr.push_back(50); RUN.push_back(200); NINOthr.push_back(50); // RUN.push_back(201); manjka // NINOthr.push_back(60); // RUN.push_back(202); // NINOthr.push_back(60); RUN.push_back(204); NINOthr.push_back(70); //na html pise 60??????????? RUN.push_back(205); NINOthr.push_back(29.9); RUN.push_back(206); NINOthr.push_back(19.9); // RUN.push_back(210); manjka // NINOthr.push_back(19.9); ADC_ChInput[0]="F406 at +1000V"; ADC_ChInput[1]="F407 at -1000V"; ADC_ChInput[2]="NINO chA, F409 at -1000V"; ADC_ChInput[3]="NINO chB, F413 at +1000V"; for(Int_t ich=0;ich()); Pos_y1.push_back(std::vector()); if(RUN[ii]==195){ Pos_x1.at(ii).push_back(18.65), Pos_y1.at(ii).push_back(-18.3); Pos_x1.at(ii).push_back(18.25), Pos_y1.at(ii).push_back(-18.3); Pos_x1.at(ii).push_back(18.9), Pos_y1.at(ii).push_back(-18.5); Pos_x1.at(ii).push_back(19.2), Pos_y1.at(ii).push_back(-18.);} else if((RUN[ii]==196) || (RUN[ii]==197)|| (RUN[ii]==198)){ Pos_x1.at(ii).push_back(18.25), Pos_y1.at(ii).push_back(-22); //-21.5); Pos_x1.at(ii).push_back(18.25), Pos_y1.at(ii).push_back(-22);//-21.5); Pos_x1.at(ii).push_back(18.75), Pos_y1.at(ii).push_back(-22); //Pos_x1.at(ii).push_back(19), Pos_y1.at(ii).push_back(-21.5); Pos_x1.at(ii).push_back(18.75), Pos_y1.at(ii).push_back(-21.6);} //Pos_x1.at(ii).push_back(19), Pos_y1.at(ii).push_back(-21.5);} else{ Pos_x1.at(ii).push_back(18.25), Pos_y1.at(ii).push_back(-16.5); Pos_x1.at(ii).push_back(18.25), Pos_y1.at(ii).push_back(-16.5); Pos_x1.at(ii).push_back(19), Pos_y1.at(ii).push_back(-16.7); Pos_x1.at(ii).push_back(19), Pos_y1.at(ii).push_back(-16.5);} } } else if(CONFIG=="config4-T9"){ RUN.push_back(213); NINOthr.push_back(19.9); RUN.push_back(214); NINOthr.push_back(29.9); RUN.push_back(215); NINOthr.push_back(40); RUN.push_back(216); NINOthr.push_back(50); RUN.push_back(219); NINOthr.push_back(60.2); RUN.push_back(220); NINOthr.push_back(80); RUN.push_back(221); NINOthr.push_back(80); RUN.push_back(222); NINOthr.push_back(109.8); RUN.push_back(223); NINOthr.push_back(150); RUN.push_back(224); NINOthr.push_back(200); ADC_ChInput[0]="NINO chA, F406 at +1000V"; ADC_ChInput[1]="NINO chB, F407 at -1000V"; ADC_ChInput[2]="F409 at -1000V"; ADC_ChInput[3]="F413 at +1000V"; for(Int_t ich=0;ich()); Pos_y1.push_back(std::vector()); if(RUN[ii]==213){ Pos_x1.at(ii).push_back(18.4), Pos_y1.at(ii).push_back(-16.7); Pos_x1.at(ii).push_back(18.4), Pos_y1.at(ii).push_back(-16.7); Pos_x1.at(ii).push_back(19), Pos_y1.at(ii).push_back(-16.75); Pos_x1.at(ii).push_back(0), Pos_y1.at(ii).push_back(0);} else{ Pos_x1.at(ii).push_back(18.4), Pos_y1.at(ii).push_back(-16.6); Pos_x1.at(ii).push_back(18.4), Pos_y1.at(ii).push_back(-16.6); Pos_x1.at(ii).push_back(19), Pos_y1.at(ii).push_back(-16.75); Pos_x1.at(ii).push_back(19), Pos_y1.at(ii).push_back(-16.3);} } } else if(CONFIG=="config5-T9"){ // RUN.push_back(225); prazen.. // NINOthr.push_back(20.0); RUN.push_back(233); NINOthr.push_back(20.9); RUN.push_back(234); NINOthr.push_back(30.4); RUN.push_back(235); NINOthr.push_back(60); ADC_ChInput[0]="NINO chA, F408 at +1000V"; ADC_ChInput[1]="NINO chB, F403 at -1000V"; ADC_ChInput[2]="F404 at -1000V"; ADC_ChInput[3]="F405 at +1000V"; for(Int_t ich=0;ich()); Pos_y1.push_back(std::vector()); Pos_x1.at(ii).push_back(16.25), Pos_y1.at(ii).push_back(-17.3); Pos_x1.at(ii).push_back(17), Pos_y1.at(ii).push_back(-17.5); Pos_x1.at(ii).push_back(17.3), Pos_y1.at(ii).push_back(-16.5); Pos_x1.at(ii).push_back(18.7), Pos_y1.at(ii).push_back(-16.6); } } else if(CONFIG=="config6-T9"){ RUN.push_back(236); NINOthr.push_back(80.0); ADC_ChInput[0]="F408 at +1000V"; ADC_ChInput[1]="F403 at -1000V"; ADC_ChInput[2]="NINO chA, F404 at -1000V"; ADC_ChInput[3]="NINO chB, F405 at +1000V"; for(Int_t ich=0;ich()); Pos_y1.push_back(std::vector()); Pos_x1.at(ii).push_back(16.2), Pos_y1.at(ii).push_back(-17.1); Pos_x1.at(ii).push_back(17), Pos_y1.at(ii).push_back(-17.6); Pos_x1.at(ii).push_back(17.2), Pos_y1.at(ii).push_back(-16.5); Pos_x1.at(ii).push_back(18.8), Pos_y1.at(ii).push_back(-16.5); } } NF=RUN.size(); Pos_dx=2.25; Pos_dy=5.25; for(Int_t ii=0;iiBLcorr[ich]=1; } for(Int_t kk=0;kkBLcorr[ich]=0; } for(Int_t ich=0;ichpol[ich]=Polarity[ich]; datobj[ifl]->BLup[ich]=up[ich]; datobj[ifl]->BLdown[ich]=low[ich]; cout<<"ich="<Get(rtxt); delete []rtxt;} } else{ cout<<"kaj z obj???"<BLdown[ich]<<","; cout<BLup[ich]<<"]"<=%f)",DistZ[ich],Pos_y1[ii][ich]); //y1 sprintf(CUT,"%s && ((XY2+XYslope2*%f)<=%f)",CUT,DistZ[ich],Pos_y1[ii][ich]+Pos_dy); //y2 sprintf(CUT,"%s && ((XY1+XYslope1*%f)>=%f)",CUT,DistZ[ich],Pos_x1[ii][ich]); //x1 sprintf(CUT,"%s && ((XY1+XYslope1*%f)<=%f)",CUT,DistZ[ich],Pos_x1[ii][ich]+Pos_dx); //x2 //sprintf(CUT,"%s && (Event>%d)",CUT,StartEvent[ii]); datobj[ii]->WFdat->Project(htmp->GetName(),proj,CUT); cout<<"run="<%d)",StartEvent[ii]); datobj[ii]->WFdat->Project(htmp->GetName(),proj,CUT); delete []CUT; } else{ cout<<"do cut="<Add(htmp); htmp->Reset(); } } delete htmp; return hst; } //============================================================================// TH1F **BTJuly2006::Get_FotecSignalSpectra(string cut_on_tracks) //cut_on_tracks= "YES" or "NO" { Float_t xmax=1900.0,xmin=-200.0; Int_t nbins=211;//96; //191; Float_t dx=(xmax-xmin)/(nbins-1.0); TH1F *htmp=new TH1F("htmp","htmp",nbins,xmin,xmax); TH1F **hst=new TH1F*[FOTECch.size()]; Char_t *proj,*CUT; for(Int_t ich=0;ichpol[jj]>0) sprintf(proj,"Ampl%d",jj+1); else if(datobj[ii]->pol[jj]<0) sprintf(proj,"-Ampl%d",jj+1); else{ cout<<"polarity="<pol[jj]<<" ch="<=%f)",DistZ[ich],Pos_y1[ii][jj]); //y1 sprintf(CUT,"%s && ((XY2+XYslope2*%f)<=%f)",CUT,DistZ[ich],Pos_y1[ii][jj]+Pos_dy); //y2 sprintf(CUT,"%s && ((XY1+XYslope1*%f)>=%f)",CUT,DistZ[jj],Pos_x1[ii][jj]); //x1 sprintf(CUT,"%s && ((XY1+XYslope1*%f)<=%f)",CUT,DistZ[jj],Pos_x1[ii][jj]+Pos_dx); //x2 //sprintf(CUT,"%s && (Event>%d)",CUT,StartEvent[ii]); datobj[ii]->WFdat->Project(htmp->GetName(),proj,CUT); cout<<"run="<%d)",StartEvent[ii]); datobj[ii]->WFdat->Project(htmp->GetName(),proj,CUT); delete []CUT; } else{ cout<<"do cut="<Add(htmp); htmp->Reset(); } } delete htmp; return hst; } //============================================================================// TH1F **BTJuly2006::Get_NINOSignalSpectra(string cut_on_tracks) //cut_on_tracks= "YES" or "NO" { Float_t xmax=1700.0,xmin=-200.0; Int_t nbins=110;//95; Float_t dx=(xmax-xmin)/(nbins-1.0); TH1F *htmp=new TH1F("htmp","htmp",nbins,xmin,xmax); TH1F **hst=new TH1F*[NINOch.size()]; Char_t *proj,*CUT; for(Int_t ich=0;ichpol[jj]>0) sprintf(proj,"Ampl%d",jj+1); else if(datobj[ii]->pol[jj]<0) sprintf(proj,"-Ampl%d",jj+1); else{ cout<<"polarity="<pol[jj]<<" ch="<=%f)",DistZ[jj],Pos_y1[ii][jj]); //y1 sprintf(CUT,"%s && ((XY2+XYslope2*%f)<=%f)",CUT,DistZ[jj],Pos_y1[ii][jj]+Pos_dy); //y2 sprintf(CUT,"%s && ((XY1+XYslope1*%f)>=%f)",CUT,DistZ[jj],Pos_x1[ii][jj]); //x1 sprintf(CUT,"%s && ((XY1+XYslope1*%f)<=%f)",CUT,DistZ[jj],Pos_x1[ii][jj]+Pos_dx); //x2 sprintf(CUT,"%s && (Event>%d)",CUT,StartEvent[ii]); datobj[ii]->WFdat->Project(htmp->GetName(),proj,CUT); cout<<"run="<%d)",StartEvent[ii]); datobj[ii]->WFdat->Project(htmp->GetName(),proj,CUT); delete []CUT; } else{ cout<<"do cut="<Add(htmp); htmp->Reset(); } } delete htmp; return hst; } //============================================================================// TGraphErrors **BTJuly2006::Get_NINOefficiency(string cut_on_tracks,Int_t drw) //cut_on_tracks= "YES" or "NO" { TGraphErrors **gtmp=new TGraphErrors*[NINOch.size()]; for(Int_t ii=0;iiGetHistogram()->SetTitle(ADC_ChInput[NINOch[ii]].c_str()); gtmp[ii]->GetHistogram()->SetXTitle("NINO threshold [mV]"); gtmp[ii]->GetHistogram()->SetYTitle("Efficiency"); gtmp[ii]->GetHistogram()->SetBins(100,0,200); } Float_t NINOcut1=900,NINOcut2=90; Float_t AMPLcut[4]={0,0,0,0}; for(Int_t ich=0;ichpol[jj]>0) sprintf(proj,"Ampl%d",jj+1); else if(datobj[ii]->pol[jj]<0) sprintf(proj,"-Ampl%d",jj+1); else{ cout<<"polarity="<pol[jj]<<" ch="<=%f)",DistZ[jj],Pos_y1[ii][jj]); //y1 sprintf(CUT,"%s && ((XY2+XYslope2*%f)<=%f)",CUT,DistZ[jj],Pos_y1[ii][jj]+Pos_dy); //y2 sprintf(CUT,"%s && ((XY1+XYslope1*%f)>=%f)",CUT,DistZ[jj],Pos_x1[ii][jj]); //x1 sprintf(CUT,"%s && ((XY1+XYslope1*%f)<=%f)",CUT,DistZ[jj],Pos_x1[ii][jj]+Pos_dx); //x2 sprintf(CUT,"%s && (Event>%d) && (BLrms%d<10)",CUT,StartEvent[ii],jj+1); datobj[ii]->WFdat->Project(hst->GetName(),proj,CUT); if(drw==1){ cout<<"run="<%d)",StartEvent[ii]); datobj[ii]->WFdat->Project(hst->GetName(),proj,CUT); delete []CUT; } else{ cout<<"do cut="<GetEntries(); hst->SetAxisRange(AMPLcut[ich],2000); Double_t yes=hst->Integral(); if(drw) cout<<"\tyes="<SetPoint(ipt,NINOthr[ii],(yes/all)); Float_t err=TMath::Sqrt(yes*(1.0-yes/all))/all; gtmp[ich]->SetPointError(ipt,0,err); if(drw) cout<<" eff="<SetXTitle("X [mm]"); hmap[ii][ich]->SetYTitle("Y [mm]"); delete []htit; htit=new Char_t[500]; if(datobj[ii]->pol[ich]>0) sprintf(htit,"(Ampl%d>%.1f)",ich+1,amplcut); else if(datobj[ii]->pol[ich]<0) sprintf(htit,"((-Ampl%d)>%.1f)",ich+1,amplcut); proj=new Char_t[1000]; sprintf(proj,"(XY2+XYslope2*%f):(XY1+XYslope1*%f)",DistZ[ich],DistZ[ich]); cout<<"proj="<WFdat->Project(hmap[ii][4]->GetName(),proj); delete []proj; } return hmap; } //============================================================================// TH2F **BTJuly2006::Get_FotecHitMap(Float_t *amplcut) { Float_t xx1=-5,xx2=35; Float_t yy1=-35,yy2=5; Int_t nbx=100,nby=100; TH2F *htm=new TH2F("htit","htit",nbx,xx1,xx2,nby,yy1,yy2); Char_t *htit,*proj; TH2F **hmap=new TH2F*[FOTECch.size()]; for(Int_t jj=0;jjSetXTitle("X [mm]"); hmap[jj]->SetYTitle("Y [mm]"); delete []htit; for(Int_t ii=0;iipol[ich]>0) sprintf(htit,"(Ampl%d>%.1f)",ich+1,amplcut[jj]); else if(datobj[ii]->pol[ich]<0) sprintf(htit,"((-Ampl%d)>%.1f)",ich+1,amplcut[jj]); proj=new Char_t[1000]; sprintf(proj,"(XY2+XYslope2*%f):(XY1+XYslope1*%f)",DistZ[ich],DistZ[ich]); datobj[ii]->WFdat->Project(htm->GetName(),proj,htit); delete []htit; delete []proj; hmap[jj]->Add(htm); htm->Reset(); } } delete htm; return hmap; } //============================================================================// TH2F **BTJuly2006::Get_NINOHitMap(Float_t *amplcut) { Float_t xx1=-5,xx2=35; Float_t yy1=-35,yy2=5; Int_t nbx=100,nby=100; TH2F *htm=new TH2F("htit","htit",nbx,xx1,xx2,nby,yy1,yy2); Char_t *htit,*proj; TH2F **hmap=new TH2F*[NINOch.size()]; for(Int_t jj=0;jjSetXTitle("X [mm]"); hmap[jj]->SetYTitle("Y [mm]"); delete []htit; for(Int_t ii=0;iipol[ich]>0) sprintf(htit,"(Ampl%d>%.1f) && (Event>%d)",ich+1,amplcut[jj],StartEvent[ii]); else if(datobj[ii]->pol[ich]<0) sprintf(htit,"((-Ampl%d)>%.1f) && (Event>%d)",ich+1,amplcut[jj],StartEvent[ii]); proj=new Char_t[1000]; sprintf(proj,"(XY2+XYslope2*%f):(XY1+XYslope1*%f)",DistZ[ich],DistZ[ich]); datobj[ii]->WFdat->Project(htm->GetName(),proj,htit); delete []htit; delete []proj; hmap[jj]->Add(htm); htm->Reset(); } } delete htm; return hmap; } //============================================================================// TH2F **BTJuly2006::ScanZ_HitMap() { TCanvas *ca=new TCanvas("ca","ca",800,800); ca->Divide(2,2); Float_t MinRMSx[4],MinRMSy[4]; Int_t MinRMSxINDX[4],MinRMSyINDX[4]; for(Int_t ich=0;ichSetXTitle("X [mm]"); hmap[ich]->SetYTitle("Y [mm]"); delete []htit;} hmap[ich]->Reset(); for(Int_t ifl=0;iflpol[ich]>0) sprintf(htit,"Ampl%d>%.1f",ich+1,amplcut); else if(datobj[ifl]->pol[ich]<0) sprintf(htit,"(-Ampl%d)>%.1f",ich+1,amplcut); proj=new Char_t[1000]; sprintf(proj,"(XY2+XYslope2*%f):(XY1+XYslope1*%f)",DistZ[ich],DistZ[ich]); datobj[ifl]->WFdat->Project(htmp->GetName(),proj,htit); hmap[ich]->Add(htmp); htmp->Reset(); delete []htit; delete []proj; } cout<<"ch="<Update(); cout<0) eff=yes/all; Double_t xx=xx1+ix*dxx; Double_t yy=yy1+iy*dyy; hmap[kc]->SetBinContent(ix+1,iy+1,eff); //(xx,yy,eff); cout<<"CUT="<Update(); // cin.get(); // } } } } return hmap; } //============================================================================// TH2F ***BTJuly2006::Get_Fotec3Defficiency_v2(Float_t *amplcut,Float_t BoxWidth, Int_t &ngraphs) { //number of output histos Int_t NGR=1; Int_t *RUN_start; Int_t *RUN_end; //dimensions of the histograms Float_t dxx=0.1,dyy=0.1; Float_t xx1=0,xx2=28; Float_t yy1=-30,yy2=-2; if(CONFIG=="config2-T11"){ xx1=2.0,xx2=16.0; yy1=-27.5;13.5;} if(CONFIG=="config2-T9"){ yy1=-25,yy2=-11; xx1=12,xx2=26;} if(CONFIG=="config4-T9"){ yy1=-21,yy2=-7; xx1=13,xx2=27;} if(CONFIG=="config5-T9"){ yy1=-21,yy2=-7; xx1=13,xx2=27;} if(CONFIG=="config6-T9"){ yy1=-22,yy2=-8; xx1=12,xx2=26;} // which runs to collect if(CONFIG=="config1-T11"){ NGR=2; RUN_start=new Int_t[NGR]; RUN_end=new Int_t[NGR]; RUN_start[0]=RUN[0]; RUN_end[0]=46; //,47 mal premaknen...48?? RUN_start[1]=48; RUN_end[1]=RUN[NF-1]; xx1=2.0,xx2=16.0; yy1=-25.5;11.5; } else if(CONFIG=="config1-T9"){ NGR=1; RUN_start=new Int_t[NGR]; RUN_end=new Int_t[NGR]; RUN_start[0]=117; RUN_end[0]=RUN[NF-1]; xx1=12.0,xx2=26.0; yy1=-24.0,yy2=-10.0; } else if(CONFIG=="config3-T9"){ NGR=2; RUN_start=new Int_t[NGR]; RUN_end=new Int_t[NGR]; RUN_start[0]=196; RUN_end[0]=198; RUN_start[1]=199; RUN_end[1]=206; xx1=8.0,xx2=27.0; yy1=-26.0,yy2=-7.0; } else{ RUN_start=new Int_t[NGR]; RUN_end=new Int_t[NGR]; RUN_start[0]=RUN[0]; RUN_end[0]=RUN[NF-1];} Char_t *txt; Int_t nbx=TMath::Nint((xx2-xx1)/dxx)+1; Int_t nby=TMath::Nint((yy2-yy1)/dyy)+1; TH2F ***hmap=new TH2F**[NGR]; for(Int_t ii=0;ii0) eff=yes/all; Double_t xx=xx1+ix*dxx; Double_t yy=yy1+iy*dyy; hmap[jgr][kc]->SetBinContent(ix+1,iy+1,eff); cout<<"CUT="<Branch("2deff",&effdat.RunIndx,txt); delete []txt; Pos_dx=BoxWidth; Pos_dy=BoxWidth; Float_t startX=xx1-Pos_dx/2.0; Float_t startY=yy1-Pos_dy/2.0; for(Int_t kk=0;kkpol[ich]>0) sprintf(proj,"Ampl%d",ich+1); else if(datobj[irun]->pol[ich]<0) sprintf(proj,"-Ampl%d",ich+1); else{ cout<<"polarity="<pol[ich]<<" ch="<=%f)",DistZ[ich],Pos_y1[irun][ich]); //y1 sprintf(CUT,"%s && ((XY2+XYslope2*%f)<=%f)",CUT,DistZ[ich],Pos_y1[irun][ich]+Pos_dy); //y2 sprintf(CUT,"%s && ((XY1+XYslope1*%f)>=%f)",CUT,DistZ[ich],Pos_x1[irun][ich]); //x1 sprintf(CUT,"%s && ((XY1+XYslope1*%f)<=%f)",CUT,DistZ[ich],Pos_x1[irun][ich]+Pos_dx); //x2 sprintf(CUT,"%s && (Event>%d) && (%s)>%f",CUT,StartEvent[irun],proj,amplcut); datobj[irun]->WFdat->Project(hamp->GetName(),proj,CUT); if(drw==1) cout<GetEntries(); if(drw==1){ cout<<"ich="<pol[ich]>0) sprintf(proj,"Ampl%d",ich+1); else if(datobj[ii]->pol[ich]<0) sprintf(proj,"-Ampl%d",ich+1); else{ cout<<"polarity="<pol[ich]<<" ch="<=%f)",DistZ[ich],Pos_y1[ii][ich]); //y1 sprintf(CUT,"%s && ((XY2+XYslope2*%f)<=%f)",CUT,DistZ[ich],Pos_y1[ii][ich]+Pos_dy); //y2 sprintf(CUT,"%s && ((XY1+XYslope1*%f)>=%f)",CUT,DistZ[ich],Pos_x1[ii][ich]); //x1 sprintf(CUT,"%s && ((XY1+XYslope1*%f)<=%f)",CUT,DistZ[ich],Pos_x1[ii][ich]+Pos_dx); //x2 sprintf(CUT,"%s && (Event>%d) && (%s)>%f",CUT,StartEvent[ii],proj,amplcut); //if((RUN[ii]!=213) && (ich!=3)) if((RUN[ii]==213) && (ich==3)){ Int_t bla=0; } else datobj[ii]->WFdat->Project(htmp->GetName(),proj,CUT); delete []CUT; delete []proj; hamp->Add(htmp); htmp->Reset(); } Double_t fe=hamp->GetEntries(); delete htmp; delete hamp; return fe; } //============================================================================// Double_t BTJuly2006::Project_Ampl_v2(Int_t ich,Float_t amplcut,Int_t start_run,Int_t end_run) { Float_t xmax=2000.0,xmin=-200.0; Int_t nbins=221; Float_t dx=(xmax-xmin)/(nbins-1.0); TH1F *hamp=new TH1F("htmp1","htmp1",nbins,xmin-dx/2.0,xmax+dx/2.0); TH1F *htmp=new TH1F("htmp","htmp",nbins,xmin-dx/2.0,xmax+dx/2.0); Char_t *proj,*CUT; for(Int_t ii=0;ii=start_run) && (RUN[ii]<=end_run)){ proj=new Char_t[10]; //projection if(datobj[ii]->pol[ich]>0) sprintf(proj,"Ampl%d",ich+1); else if(datobj[ii]->pol[ich]<0) sprintf(proj,"-Ampl%d",ich+1); else{ cout<<"polarity="<pol[ich]<<" ch="<=%f)",DistZ[ich],Pos_y1[ii][ich]); //y1 sprintf(CUT,"%s && ((XY2+XYslope2*%f)<=%f)",CUT,DistZ[ich],Pos_y1[ii][ich]+Pos_dy); //y2 sprintf(CUT,"%s && ((XY1+XYslope1*%f)>=%f)",CUT,DistZ[ich],Pos_x1[ii][ich]); //x1 sprintf(CUT,"%s && ((XY1+XYslope1*%f)<=%f)",CUT,DistZ[ich],Pos_x1[ii][ich]+Pos_dx); //x2 sprintf(CUT,"%s && (Event>%d) && (%s)>%f",CUT,StartEvent[ii],proj,amplcut); //if((RUN[ii]!=213) && (ich!=3)) if((RUN[ii]==213) && (ich==3)){ Int_t bla=0; } else datobj[ii]->WFdat->Project(htmp->GetName(),proj,CUT); delete []CUT; delete []proj; hamp->Add(htmp); htmp->Reset(); } } Double_t fe=hamp->GetEntries(); delete htmp; delete hamp; return fe; } //============================================================================// TGraph **BTJuly2006::Draw_Box(Float_t x1, Float_t dx,Float_t y1,Float_t dy, Int_t col,Int_t draw=1) { Float_t x2=x1+dx; Float_t y2=y1+dy; TGraph **box=new TGraph*[4]; Int_t nnpt=11; for(int ii=0;ii<4;ii++) box[ii]=new TGraph(nnpt); Double_t xx,yy; for(int ii=0;iiSetPoint(ii,xx,yy); yy=y2; box[1]->SetPoint(ii,xx,yy); yy=y1+ii*(y2-y1)/(nnpt-1.0); xx=x1; box[2]->SetPoint(ii,xx,yy); xx=x2; box[3]->SetPoint(ii,xx,yy); } for(int ii=0;ii<4;ii++){ box[ii]->SetLineColor(col); box[ii]->SetLineWidth(1); if(draw==1) box[ii]->Draw("l"); } return box; } /*============================================================================*/ /* PRIVATE FUNCTIONS */ /*============================================================================*/ //======================= END of CLASS =======================================//