#include <ShwfitAna.h>
Inheritance diagram for ShwfitAna:

Public Member Functions | |
| ShwfitAna (Shwfit &sf) | |
| virtual | ~ShwfitAna () |
| void | Analyze (int evtn, RecRecordImp< RecCandHeader > *srobj) |
| void | doSlopes (NtpSREvent *event, RecRecordImp< RecCandHeader > *srobj) |
| void | FitLShower (Float_t pulseheight) |
| void | FitLShower_Dan (Float_t pulseheight) |
| void | TransVar (TH1F *h, PlaneView::EPlaneView pv) |
| void | Reset (int snarl, int event) |
| void | SetCutParams (int planes, float striphcut, float planephcut, float contplanephcut) |
| Bool_t | PassCuts (int PhNStrips, int PhNPlanes) |
| void | FitTShower (Float_t pulseheight) |
Public Attributes | |
| int | sfDPlaneCut |
| float | sfContPhPlaneCut |
| float | sfPhStripCut |
| float | sfPhPlaneCut |
Private Member Functions | |
| Double_t | GetMaximumX (TF1 *efit, Double_t xmin=0, Double_t xmax=0) |
| float | BuildUVVar (float u, float v) |
Private Attributes | |
| Shwfit & | fShwfit |
| float | asym_peak |
| float | asym_vert |
| float | molrad_peak |
| float | molrad_vert |
| float | mean |
| float | rms |
| float | skew |
| float | kurt |
|
|
Definition at line 77 of file ShwfitAna.cxx. 00077 : 00078 fShwfit(sf) 00079 {}
|
|
|
Definition at line 81 of file ShwfitAna.cxx. 00082 {}
|
|
||||||||||||
|
||||||||||||
|
Definition at line 584 of file ShwfitAna.cxx. References ANtpDefaultValue::IsDefault(). Referenced by Analyze(). 00585 {
00586 float uv = ANtpDefVal::kFloat;
00587 if(!ANtpDefVal::IsDefault(u)&& !ANtpDefVal::IsDefault(v)&&
00588 u<1.e15 && v<1.e15){
00589 uv=sqrt(u*u+v*v)/sqrt(2.0);
00590 }
00591
00592 return uv;
00593 }
|
|
||||||||||||
|
Definition at line 810 of file ShwfitAna.cxx. References Shwfit::complexity, fShwfit, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), SntpHelpers::GetStrip(), SntpHelpers::GetStripIndex(), RecHeader::GetVldContext(), Shwfit::LongE, MSG, NtpSREvent::nstrip, NtpSRStrip::plane, NtpSRStrip::planeview, Shwfit::slopefix, NtpSRStrip::tpos, NtpSRVertex::u, Shwfit::UBeamLike, Shwfit::UFitquality, Shwfit::ULongE, Shwfit::UOffset, Shwfit::USlope, Shwfit::USlopeMom, Shwfit::UVSlope, Shwfit::UWDiff, NtpSRVertex::v, Shwfit::VBeamLike, Shwfit::VFitquality, Shwfit::VLongE, Shwfit::VOffset, Shwfit::VSlope, Shwfit::VSlopeMom, NtpSREvent::vtx, Shwfit::VWDiff, Shwfit::wcomplexity, NtpSRVertex::z, and NtpSRStrip::z. Referenced by Analyze(). 00811 {
00812
00813
00814
00815 Float_t Uslope=0;
00816 Float_t Uuncer=0;
00817 Float_t UOffset=0;
00818 Float_t Ugoodfit=0;
00819
00820 Float_t Vslope=0;
00821 Float_t Vuncer=0;
00822 Float_t VOffset=0;
00823 Float_t Vgoodfit=0;
00824
00825 Float_t USlopeMom=0;
00826 Float_t VSlopeMom=0;
00827
00828 Float_t UBeamLike=0;
00829 Float_t VBeamLike=0;
00830
00831 Float_t UBeamLikeOffset=0;
00832 Float_t VBeamLikeOffset=0;
00833
00834 Float_t VWd=0;
00835
00836 Float_t UWd=0;
00837
00838
00839 Float_t num[1000];
00840 Float_t den[1000];
00841 Float_t zpos[1000];
00842 Float_t wcenter[1000];
00843
00844 Int_t stripcount[1000];
00845 Float_t stripe[1000];
00846
00847 Int_t umin=10000;
00848 Int_t umax=0;
00849 Int_t vmin=10000;
00850 Int_t vmax=0;
00851 Int_t curplane;
00852 Float_t curstrip;
00853
00854 Float_t ULongE=0;
00855 Float_t VLongE=0;
00856
00857 Float_t tote=0.0;
00858
00859 Float_t weight[1000];
00860 for(int i=0;i<1000;i++){
00861 num[i]=0;
00862 den[i]=0;
00863 wcenter[i]=0;
00864 weight[i]=0;
00865 zpos[i]=0.0;
00866 stripcount[i]=0;
00867 stripe[i]=0;
00868 }
00869
00870
00871
00872
00873 //the slope of the beam 3deg inc in Y for far and 3deg dec in Y for near
00874 Float_t beamslope=0;
00875 if(srobj->GetHeader().GetVldContext().GetDetector()== Detector::kFar)
00876 beamslope=0.037058;
00877 else if(srobj->GetHeader().GetVldContext().GetDetector()== Detector::kNear)
00878 beamslope=-0.037058;
00879
00880
00881 for(int i=0;i<event->nstrip;i++){
00882 Int_t index = SntpHelpers::GetStripIndex(i,event);
00883 NtpSRStrip *strip = SntpHelpers::GetStrip(index,srobj);
00884 if(!strip) continue;
00885 if(!evtstp0mip){
00886 MSG("ShwfitAna",Msg::kError)<<"No mip strip information"<<endl;
00887 continue;
00888 }
00889
00890 Float_t stripPh = evtstp0mip[index] + evtstp1mip[index];
00891
00892 curplane=strip->plane;
00893
00894 stripcount[curplane]++;
00895 stripe[curplane]+=stripPh;
00896
00897 curstrip=strip->tpos;
00898 zpos[curplane]=strip->z;
00899
00900 num[curplane]+=curstrip*stripPh;
00901 den[curplane]+=stripPh;
00902
00903 tote+=stripPh;
00904
00905 if(strip->planeview==PlaneView::kU)
00906 {
00907 if(umin>curplane)umin=curplane;
00908 if(umax<curplane)umax=curplane;
00909 USlopeMom+=stripPh;
00910 if((strip->z-event->vtx.z)>0.0)
00911 ULongE+=stripPh*TMath::Cos(TMath::ATan((strip->tpos-event->vtx.u)/(strip->z-event->vtx.z)));
00912 // else
00913 // ULongE+=stripPh;
00914 }
00915 else if(strip->planeview==PlaneView::kV)
00916 {
00917 if(vmin>curplane)vmin=curplane;
00918 if(vmax<curplane)vmax=curplane;
00919 VSlopeMom+=stripPh;
00920 if((strip->z-event->vtx.z)>0.0)//only want hits in front of vertex
00921 VLongE+=stripPh*TMath::Cos(TMath::ATan((strip->tpos-event->vtx.v)/(strip->z-event->vtx.z)));
00922 // else
00923 // VLongE+=stripPh;
00924 }
00925
00926 }
00927
00928
00929
00930 for(int i=umin;i<=umax;i+=2)
00931 {
00932 if(den[i]!=0){
00933 wcenter[i]=num[i]/den[i];
00934 UBeamLikeOffset+=den[i]*(wcenter[i]-beamslope*zpos[i]); //den is the energy in each plane
00935 }else{
00936 num[i]=0;
00937 wcenter[i]=0;
00938 }
00939
00940 }
00941
00942 UBeamLikeOffset=UBeamLikeOffset/USlopeMom; //USlopeMom currently contains total energy in UPlane
00943
00944
00945 for(int i=vmin;i<=vmax;i+=2)
00946 {
00947 if(den[i]!=0){
00948 wcenter[i]=num[i]/den[i];
00949 VBeamLikeOffset+=den[i]*(wcenter[i]-beamslope*zpos[i]); //den is the energy in each plane
00950 }else{
00951 num[i]=0;
00952 wcenter[i]=0;
00953 }
00954 }
00955
00956 VBeamLikeOffset=VBeamLikeOffset/VSlopeMom; //VSlopeMom currently contains total energy in UPlane
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966 Int_t stripmin=umin; if(vmin<umin)stripmin=vmin;
00967 Int_t stripmax=umax; if(vmax>umax)stripmax=vmax;
00968
00969 Float_t complex=0;
00970 Float_t wcomplex=0;
00971 Float_t ncomplex=0;
00972
00973 for (int i=stripmin;i<=stripmax;i++)
00974 {
00975 complex+=stripcount[i]*stripcount[i+1];
00976 wcomplex+=stripcount[i]*stripcount[i+1]*stripe[i]*stripe[i+1];
00977 ncomplex+=stripe[i]*stripe[i+1];
00978 }
00979
00980 if(ncomplex>0) wcomplex=wcomplex/ncomplex;
00981 else wcomplex=0;
00982
00983
00984
00985 Float_t VSw=0;
00986 Float_t VSwxy=0;
00987 Float_t VSwx=0;
00988 Float_t VSwy=0;
00989 Float_t VSwxx=0;
00990
00991 Float_t USw=0;
00992 Float_t USwxy=0;
00993 Float_t USwx=0;
00994 Float_t USwy=0;
00995 Float_t USwxx=0;
00996
00997
00998
00999
01000 Float_t pos;
01001
01002
01003
01004
01005 for(int i=umin;i<=umax;i+=2){
01006
01007 if (i>999)continue;
01008
01009 UBeamLike+=den[i]*den[i]*(wcenter[i]-UBeamLikeOffset-beamslope*zpos[i])*(wcenter[i]-UBeamLikeOffset-beamslope*zpos[i]);
01010
01011
01012 if(den[i]>0){
01013
01014 pos=num[i]/(den[i]);
01015 weight[i]=den[i]/tote;
01016
01017 USw=USw+weight[i];
01018 USwxy=USwxy+weight[i]*zpos[i]*pos;
01019 USwx=USwx+weight[i]*zpos[i];
01020 USwy=USwy+weight[i]*pos;
01021 USwxx=USwxx+weight[i]*zpos[i]*zpos[i];
01022
01023
01024 }
01025
01026
01027 }
01028
01029 UBeamLike=TMath::Sqrt(UBeamLike)/USlopeMom; //USlopeMom still contains total energy in U plane
01030
01031
01032 for(int i=vmin;i<=vmax;i+=2){
01033
01034
01035 if (i>999)continue;
01036
01037 VBeamLike+=den[i]*den[i]*(wcenter[i]-VBeamLikeOffset-beamslope*zpos[i])*(wcenter[i]-VBeamLikeOffset-beamslope*zpos[i]);
01038
01039
01040 if(den[i]>0){
01041
01042 pos=num[i]/(den[i]);
01043 weight[i]=den[i]/tote;
01044
01045 VSw=VSw+weight[i];
01046 VSwxy=VSwxy+weight[i]*zpos[i]*pos;
01047 VSwx=VSwx+weight[i]*zpos[i];
01048 VSwy=VSwy+weight[i]*pos;
01049 VSwxx=VSwxx+weight[i]*zpos[i]*zpos[i];
01050
01051
01052
01053 }
01054
01055
01056
01057 }
01058
01059 VBeamLike=TMath::Sqrt(VBeamLike)/VSlopeMom; //VSlopeMom still contains total energy in U plane
01060
01061 Float_t Udelta=(USw*USwxx-USwx*USwx);
01062
01063 if (Udelta>0){
01064 Uslope=(USw*USwxy-USwx*USwy)/Udelta;
01065 Uuncer=TMath::Sqrt(USw/Udelta);
01066
01067
01068
01069 UOffset=(USwxx*USwy-USwx*USwxy)/Udelta;
01070
01071
01072 Float_t Uvtx=event->vtx.u;
01073
01074
01075
01076 Ugoodfit=0;
01077 Float_t SumWeight=0;
01078
01079 for(int i=umin;i<=umax;i+=2){
01080 if (i>999)continue;
01081 if(den[i]>0){
01082 Ugoodfit=Ugoodfit+(UOffset+Uslope*zpos[i])*(UOffset+Uslope*zpos[i])/(weight[i]*weight[i]);
01083 SumWeight=SumWeight+1/weight[i];
01084
01085 UWd=UWd+(UOffset+Uslope*zpos[i]-Uvtx)*(UOffset+Uslope*zpos[i]-Uvtx)/(weight[i]*weight[i]);
01086
01087 }
01088 }
01089
01090 Ugoodfit=TMath::Sqrt(Ugoodfit)/SumWeight;
01091
01092 UWd=TMath::Sqrt(UWd)/SumWeight;
01093
01094
01095
01096
01097 }
01098
01099
01100
01101
01102 Float_t Vdelta=(VSw*VSwxx-VSwx*VSwx);
01103
01104 if (Vdelta>0){
01105 Vslope=(VSw*VSwxy-VSwx*VSwy)/Vdelta;
01106 Vuncer=TMath::Sqrt(VSw/Vdelta);
01107
01108
01109
01110 VOffset=(VSwxx*VSwy-VSwx*VSwxy)/Vdelta;
01111
01112
01113 Float_t Vvtx=event->vtx.v;
01114
01115 Vgoodfit=0;
01116 Float_t SumWeight=0;
01117 for(int i=vmin;i<=vmax;i+=2){
01118 if (i>999)continue;
01119 if(den[i]>0){
01120 Vgoodfit=Vgoodfit+(VOffset+Vslope*zpos[i])*(VOffset+Vslope*zpos[i])/(weight[i]*weight[i]);
01121 SumWeight=SumWeight+1/weight[i];
01122
01123 VWd=VWd+(VOffset+Vslope*zpos[i]-Vvtx)*(VOffset+Vslope*zpos[i]-Vvtx)/(weight[i]*weight[i]);
01124
01125 }
01126 }
01127
01128 Vgoodfit=TMath::Sqrt(Vgoodfit)/SumWeight;
01129
01130 VWd=TMath::Sqrt(VWd)/SumWeight;
01131 }
01132
01133
01134 if(USlopeMom>0){
01135 USlopeMom=1/USlopeMom;
01136 USlopeMom=USlopeMom*Uslope;
01137 }
01138
01139 if(VSlopeMom>0){
01140 VSlopeMom=1/VSlopeMom;
01141 VSlopeMom=VSlopeMom*Vslope;
01142 }
01143
01144
01145 fShwfit.UBeamLike=UBeamLike;
01146 fShwfit.VBeamLike=VBeamLike;
01147
01148 fShwfit.slopefix=beamslope;
01149 fShwfit.USlope=Uslope;
01150 fShwfit.VSlope=Vslope;
01151 fShwfit.UOffset=UOffset;
01152 fShwfit.VOffset=VOffset;
01153 fShwfit.UFitquality=Ugoodfit;
01154 fShwfit.VFitquality=Vgoodfit;
01155 fShwfit.UWDiff=UWd;
01156 fShwfit.VWDiff=VWd;
01157 fShwfit.USlopeMom=USlopeMom;
01158 fShwfit.VSlopeMom=VSlopeMom;
01159 fShwfit.UVSlope=Uslope*Uslope+Vslope*Vslope;
01160
01161 fShwfit.ULongE=ULongE;
01162 fShwfit.VLongE=VLongE;
01163 fShwfit.LongE = ULongE + VLongE;
01164
01165
01166 fShwfit.complexity=complex;
01167
01168 fShwfit.wcomplexity=wcomplex;
01169
01170 return;
01171 }
|
|
|
Definition at line 445 of file ShwfitAna.cxx. References Shwfit::caldet_comp, Shwfit::chisq, Shwfit::chisq_ndf, Shwfit::conv, Shwfit::e0_pe_ratio, Shwfit::efit, fShwfit, GetMaximumX(), Shwfit::lenepl, Shwfit::max_pe_plane, MSG, Shwfit::par_a, Shwfit::par_b, Shwfit::par_e0, Shwfit::shwmax, Shwfit::shwmaxplane, and Shwfit::shwmaxplane_diff. Referenced by Analyze(). 00446 {
00447 fShwfit.efit->SetParameters(3.,0.5,pulseheight);
00448 fShwfit.lenepl->Fit(fShwfit.efit,"RLLQ0+");
00449 // fShwfit.lenepl->Print("all");
00450 // fShwfit.efit->Print("all");
00451
00452 MSG("ShwfitAna",Msg::kDebug)<<" STATUS: "<<gMinuit->fCstatu
00453 <<" "<<fShwfit.efit->GetParameter(0)
00454 <<" "<<fShwfit.efit->GetNDF()<<" "<<pulseheight<<endl;
00455
00456 string fitstatus = (string)(gMinuit->fCstatu);
00457 MSG("ShwfitAna",Msg::kDebug)<<" STATUS: "<<fitstatus
00458 <<", "<<fShwfit.efit->GetParameter(0)
00459 <<", "<<fShwfit.efit->GetNDF()<<" "<<pulseheight<<endl;
00460
00461 if(fitstatus=="CONVERGED "&&fShwfit.efit->GetParameter(0)<29.9&&
00462 fShwfit.efit->GetNDF()>0&&pulseheight>0){
00463 MSG("ShwfitAna",Msg::kDebug)<<" filling vars"<<endl;
00464
00465 fShwfit.par_a=fShwfit.efit->GetParameter(0);
00466 fShwfit.par_b=fShwfit.efit->GetParameter(1);
00467 fShwfit.par_e0=fShwfit.efit->GetParameter(2);
00468 fShwfit.chisq=fShwfit.efit->GetChisquare();
00469 fShwfit.shwmax=1.*GetMaximumX(fShwfit.efit);
00470 // fShwfit.shwmax=1.*fShwfit.lenepl->GetFunction(fShwfit.efit->GetName())->GetMaximumX();
00471
00472
00473 fShwfit.shwmaxplane=(int)(fShwfit.lenepl->
00474 GetBinContent(fShwfit.lenepl->FindBin(fShwfit.shwmax)));
00475 fShwfit.conv=1;
00476 if(fShwfit.efit->GetNDF()>0){
00477 fShwfit.chisq_ndf=fShwfit.chisq/fShwfit.efit->GetNDF();
00478 }
00479 if(pulseheight!=0){
00480 fShwfit.e0_pe_ratio=fShwfit.par_e0/pulseheight;
00481 }
00482 fShwfit.caldet_comp=ANtpDefVal::kFloat;
00483 fShwfit.max_pe_plane=fShwfit.lenepl->GetMaximumBin();
00484 fShwfit.shwmaxplane_diff=fShwfit.shwmaxplane-fShwfit.max_pe_plane;
00485 }
00486
00487 return;
00488 }
|
|
|
Definition at line 490 of file ShwfitAna.cxx. References Shwfit::Beta_Maxwell, Shwfit::Beta_Maxwell3, Shwfit::chisq_Maxwell, Shwfit::chisq_Maxwell3, Shwfit::E_ratio_2, Shwfit::E_ratio_half, Shwfit::efit_maxwell, Shwfit::efit_maxwell3, Shwfit::Energy_Maxwell, Shwfit::Energy_Maxwell3, fShwfit, Shwfit::lenepl, Shwfit::n_ratio_2, Shwfit::n_ratio_half, Shwfit::ndf_Maxwell, Shwfit::ndf_Maxwell3, Shwfit::ph_hist, Shwfit::pos_E_split, and Shwfit::pos_n_split. Referenced by Analyze(). 00491 {
00492 //DDC Mawell fit Code
00493 fShwfit.efit_maxwell->SetParameters(1.0,pulseheight);
00494 fShwfit.lenepl->Fit(fShwfit.efit_maxwell,"RLQ0+");
00495 fShwfit.Beta_Maxwell = fShwfit.efit_maxwell->GetParameter(0);
00496 int np = 1000;
00497 double *x = new double[np];
00498 double *w = new double[np];
00499 fShwfit.efit_maxwell->CalcGaussLegendreSamplingPoints(np,x,w,1e-15);
00500 fShwfit.Energy_Maxwell = fShwfit.efit_maxwell->IntegralFast(np,x,w,0,1000);
00501 fShwfit.chisq_Maxwell=fShwfit.efit_maxwell->GetChisquare();
00502 fShwfit.ndf_Maxwell=fShwfit.efit_maxwell->GetNDF();
00503
00504 fShwfit.efit_maxwell3->SetParameters(1.0,pulseheight);
00505 fShwfit.lenepl->Fit(fShwfit.efit_maxwell3,"RLQ0+");
00506 fShwfit.Beta_Maxwell3 = fShwfit.efit_maxwell3->GetParameter(0);
00507 int np3 = 1000;
00508 double *x3 = new double[np3];
00509 double *w3 = new double[np3];
00510 fShwfit.efit_maxwell3->CalcGaussLegendreSamplingPoints(np3,x3,w3,1e-15);
00511 fShwfit.Energy_Maxwell3 = fShwfit.efit_maxwell3->IntegralFast(np3,x3,w3,0,1000);
00512 fShwfit.chisq_Maxwell3=fShwfit.efit_maxwell3->GetChisquare();
00513 fShwfit.ndf_Maxwell3=fShwfit.efit_maxwell3->GetNDF();
00514
00515
00516 float E_half_num = 0;
00517 float E_half_den = 0;
00518 float n_half_num = 0;
00519 float n_half_den = 0;
00520 float E_2_num = 0;
00521 float E_2_den = 0;
00522 float n_2_num = 0;
00523 float n_2_den = 0;
00524 float E_split_val = 0;
00525 float E_split_point = 0;
00526 float n_split_val = 0;
00527 float n_split_point = 0;
00528 float n_integral = 0;
00529 float E_integral = 0;
00530 float ph_hist_length = 0;
00531 float ph_hist_counter = 0;
00532 for (int q = 1; q<=fShwfit.ph_hist->GetNbinsX(); q++){
00533 n_integral += fShwfit.ph_hist->GetBinContent(q);
00534 E_integral += fShwfit.ph_hist->GetBinContent(q)*(fShwfit.ph_hist->GetBinLowEdge(q)+(1.0/2.0)*fShwfit.ph_hist->GetBinWidth(q));
00535 ph_hist_counter++;
00536 if(fShwfit.ph_hist->GetBinContent(q)>0){
00537 ph_hist_length += ph_hist_counter;
00538 ph_hist_counter = 0;
00539 }
00540 }
00541 for (int q = 1; q<=fShwfit.ph_hist->GetNbinsX(); q++){
00542 if (q<=2){
00543 n_2_num += fShwfit.ph_hist->GetBinContent(q);
00544 E_2_num += fShwfit.ph_hist->GetBinContent(q)*(fShwfit.ph_hist->GetBinLowEdge(q)+(1.0/2.0)*fShwfit.ph_hist->GetBinWidth(q));
00545 }else{
00546 n_2_den += fShwfit.ph_hist->GetBinContent(q);
00547 E_2_den += fShwfit.ph_hist->GetBinContent(q)*(fShwfit.ph_hist->GetBinLowEdge(q)+(1.0/2.0)*fShwfit.ph_hist->GetBinWidth(q));
00548 }
00549 if (q<=ph_hist_length/2){
00550 n_half_num += fShwfit.ph_hist->GetBinContent(q);
00551 E_half_num += fShwfit.ph_hist->GetBinContent(q)*(fShwfit.ph_hist->GetBinLowEdge(q)+(1.0/2.0)*fShwfit.ph_hist->GetBinWidth(q));
00552 }else{
00553 n_half_den += fShwfit.ph_hist->GetBinContent(q);
00554 E_half_den += fShwfit.ph_hist->GetBinContent(q)*(fShwfit.ph_hist->GetBinLowEdge(q)+(1.0/2.0)*fShwfit.ph_hist->GetBinWidth(q));
00555 }
00556 if(n_split_val<(1.0/2.0)*n_integral) n_split_val += fShwfit.ph_hist->GetBinContent(q);
00557 else if (n_split_point==0) n_split_point = (fShwfit.ph_hist->GetBinLowEdge(q)+fShwfit.ph_hist->GetBinWidth(q));
00558 if(E_split_val<(1.0/2.0)*E_integral) E_split_val += fShwfit.ph_hist->GetBinContent(q)*(fShwfit.ph_hist->GetBinLowEdge(q)+(1.0/2.0)*fShwfit.ph_hist->GetBinWidth(q));
00559 else if (E_split_point==0) E_split_point = (fShwfit.ph_hist->GetBinLowEdge(q)+fShwfit.ph_hist->GetBinWidth(q));
00560 //cout<<"n_split_point = "<<n_split_point<<" n_split_val = "<<n_split_val<<" 1/2 Integral = "<<n_integral<<endl;
00561 //cout<<"E_split_point = "<<E_split_point<<" E_split_val = "<<E_split_val<<" 1/2 Integral = "<<E_integral<<endl;
00562 }
00563 if(E_half_den!=0) fShwfit.E_ratio_half = E_half_num/E_half_den;
00564 else fShwfit.E_ratio_half = 0;
00565 if(n_half_den!=0) fShwfit.n_ratio_half = n_half_num/n_half_den;
00566 else fShwfit.n_ratio_half = 0;
00567 if(E_2_den!=0) fShwfit.E_ratio_2 = E_2_num/E_2_den;
00568 else fShwfit.E_ratio_2 = 0;
00569 if(n_2_den!=0) fShwfit.n_ratio_2 = n_2_num/n_2_den;
00570 else fShwfit.n_ratio_2 = 0;
00571 fShwfit.pos_E_split = E_split_point;
00572 fShwfit.pos_n_split = n_split_point;
00573
00574
00575 delete [] x;
00576 delete [] x3;
00577 delete [] w;
00578 delete [] w3;
00579
00580 return;
00581 }
|
|
|
Definition at line 597 of file ShwfitAna.cxx. References fShwfit, Shwfit::tenestu, Shwfit::tenestv, Shwfit::trans_u_chisq, Shwfit::trans_u_mean, Shwfit::trans_u_ndf, Shwfit::trans_u_sigma, Shwfit::trans_v_chisq, Shwfit::trans_v_mean, Shwfit::trans_v_ndf, Shwfit::trans_v_sigma, Shwfit::ufit, and Shwfit::vfit. Referenced by Analyze(). 00598 {
00599 fShwfit.tenestu->Fit(fShwfit.ufit,"RLQ0+");
00600 fShwfit.trans_u_mean = fShwfit.ufit->GetParameter(1);
00601 fShwfit.trans_u_sigma = fShwfit.ufit->GetParameter(2);
00602 fShwfit.trans_u_chisq = fShwfit.ufit->GetChisquare();
00603 fShwfit.trans_u_ndf = fShwfit.ufit->GetNDF();
00604
00605 fShwfit.tenestv->Fit(fShwfit.vfit,"RLQ0+");
00606 fShwfit.trans_v_mean = fShwfit.vfit->GetParameter(1);
00607 fShwfit.trans_v_sigma = fShwfit.vfit->GetParameter(2);
00608 fShwfit.trans_v_chisq = fShwfit.vfit->GetChisquare();
00609 fShwfit.trans_v_ndf = fShwfit.vfit->GetNDF();
00610
00611 }
|
|
||||||||||||||||
|
Definition at line 789 of file ShwfitAna.cxx. Referenced by FitLShower(). 00790 {
00791 Double_t fXmin = 0.001;
00792 Double_t fXmax = 30;
00793 Double_t fNpx = 30;
00794
00795 Double_t x,y;
00796 if (xmin >= xmax) {xmin = fXmin; xmax = fXmax;}
00797 Double_t dx = (xmax-xmin)/fNpx;
00798 Double_t xxmax = xmin;
00799 Double_t yymax = efit->Eval(xmin+dx);
00800 for (Int_t i=0;i<fNpx;i++) {
00801 x = xmin + (i+0.5)*dx;
00802 y = efit->Eval(x);
00803 if (y > yymax) {xxmax = x; yymax = y;}
00804 }
00805 if (dx < 1.e-9*(fXmax-fXmin)) return TMath::Min(xmax,xxmax);
00806 else return GetMaximumX(efit, TMath::Max(xmin,xxmax-dx), TMath::Min(xmax,xxmax+dx));
00807 }
|
|
||||||||||||
|
Definition at line 778 of file ShwfitAna.cxx. References fShwfit, Shwfit::hiPhPlaneCount, and Shwfit::hiPhStripCount. Referenced by NueDisplayModule::UpdateDisplay(). 00779 {
00780 bool passstrips=false;
00781 bool passplanes=false;
00782 if(PhNStrips>0&&fShwfit.hiPhStripCount>PhNStrips||PhNStrips<=0) passstrips=true;
00783 if(PhNPlanes>0&&fShwfit.hiPhPlaneCount>PhNPlanes||PhNPlanes<=0) passplanes=true;
00784 cout << "StripCount " << fShwfit.hiPhStripCount << " PlaneCount " << fShwfit.hiPhPlaneCount << endl;
00785 if(passstrips&&passplanes) return true;
00786 else return false;
00787 }
|
|
||||||||||||
|
Definition at line 683 of file ShwfitAna.cxx. References Shwfit::efit, Shwfit::efit_maxwell, Shwfit::efit_maxwell3, fShwfit, hadfunc(), Shwfit::hfit, Shwfit::lenepl, maxwell(), maxwell3(), Shwfit::ph_hist, Shwfit::Reset(), shwfunc(), Shwfit::tenestu, Shwfit::tenestu_9s_2pe, Shwfit::tenestu_9s_2pe_dw, Shwfit::tenestv, Shwfit::tenestv_9s_2pe, Shwfit::tenestv_9s_2pe_dw, Shwfit::ufit, and Shwfit::vfit. Referenced by Analyze(). 00684 {
00685
00686 //putting histogram creators here so we can name them according to
00687 //event and snarl number, and we won't get errors about replacing
00688 //existing histograms when we have multiple events in a snarl
00689 const Int_t LHISTBINS=30;
00690 const Int_t THISTBINS=41;
00691 fShwfit.Reset();
00692
00693 char ln[100];
00694 char tun[100];
00695 char tvn[100];
00696 sprintf(ln,"lenepl_%d_%d",snarl,event);
00697 sprintf(tun,"tenestu_%d_%d",snarl,event);
00698 sprintf(tvn,"tenestv_%d_%d",snarl,event);
00699 fShwfit.lenepl = new TH1F(ln,"longitudinal energy by plane",
00700 LHISTBINS,0.0,LHISTBINS);
00701
00702 fShwfit.tenestu = new TH1F(tun,"trasverse energy by strip (U view)",
00703 THISTBINS,-THISTBINS/2.,THISTBINS/2.);
00704 fShwfit.tenestv = new TH1F(tvn,"trasverse energy by strip (V view)",
00705 THISTBINS,-THISTBINS/2.,THISTBINS/2.);
00706
00707 char tun_9s_2pe[100];
00708 char tvn_9s_2pe[100];
00709 char tun_9s_2pe_dw[100];
00710 char tvn_9s_2pe_dw[100];
00711
00712 sprintf(tun_9s_2pe,"tenestu_9s_2pe_%d_%d",snarl,event);
00713 sprintf(tvn_9s_2pe,"tenestv_9s_2pe_%d_%d",snarl,event);
00714 sprintf(tun_9s_2pe_dw,"tenestu_9s_2pe_dw_%d_%d",snarl,event);
00715 sprintf(tvn_9s_2pe_dw,"tenestv_9s_2pe_dw_%d_%d",snarl,event);
00716
00717 fShwfit.tenestu_9s_2pe = new TH1F(tun_9s_2pe,"trasverse energy by strip (U view)",
00718 THISTBINS,-THISTBINS/2.,THISTBINS/2.);
00719 fShwfit.tenestv_9s_2pe = new TH1F(tvn_9s_2pe,"trasverse energy by strip (V view)",
00720 THISTBINS,-THISTBINS/2.,THISTBINS/2.);
00721 fShwfit.tenestu_9s_2pe_dw = new TH1F(tun_9s_2pe_dw,"trasverse energy by strip (U view)",
00722 THISTBINS,-THISTBINS/2.,THISTBINS/2.);
00723 fShwfit.tenestv_9s_2pe_dw = new TH1F(tvn_9s_2pe_dw,"trasverse energy by strip (V view)",
00724 THISTBINS,-THISTBINS/2.,THISTBINS/2.);
00725
00726
00727
00728 int hmin=0;
00729 int hmax=30;
00730 int npare=3;
00731 int nparh=6;
00732 char efn[100];
00733 char hfn[100];
00734 sprintf(efn,"efit_%d_%d",snarl,event);
00735 sprintf(hfn,"hfit_%d_%d",snarl,event);
00736 fShwfit.efit = new TF1(efn,shwfunc,hmin+0.001,hmax,npare);
00737 fShwfit.hfit = new TF1(hfn,hadfunc,hmin+0.001,hmax,nparh);
00738 fShwfit.efit->SetParNames("a","b","e0");
00739 fShwfit.efit->SetParLimits(0,hmin+0.001,hmax);
00740 fShwfit.efit->SetParLimits(1,0.001,20000);
00741 fShwfit.efit->SetParLimits(2,0+0.001,1000000);
00742
00743 fShwfit.hfit->SetParNames("a","b","e0");
00744 fShwfit.hfit->SetParLimits(0,hmin+0.001,hmax);
00745 fShwfit.hfit->SetParLimits(1,0.001,20000);
00746 fShwfit.hfit->SetParLimits(2,0.001,1000000);
00747
00748 //--------------------------------------------
00749 //DDC Mawell fit Code
00750 char phh[100];
00751
00752 sprintf(phh,"ph_hist_%d_%d",snarl,event);
00753 fShwfit.ph_hist = new TH1F(phh,"energy per srip", 100,0.5,10.5);
00754
00755 int npar_maxwell=2;
00756 char mfn[100];
00757 sprintf(mfn,"efit_maxwell_%d_%d",snarl,event);
00758 fShwfit.efit_maxwell = new TF1(mfn,maxwell,hmin+0.001,hmax,npar_maxwell);
00759 fShwfit.efit_maxwell->SetParNames("Beta","Energy");
00760 fShwfit.efit_maxwell->SetParLimits(0,hmin+0.001,hmax);
00761
00762 int npar_maxwell3=2;
00763 char mfn3[100];
00764 sprintf(mfn3,"efit_maxwell3_%d_%d",snarl,event);
00765 fShwfit.efit_maxwell3 = new TF1(mfn3,maxwell3,hmin+0.001,hmax,npar_maxwell3);
00766 fShwfit.efit_maxwell3->SetParNames("Beta","Energy");
00767 fShwfit.efit_maxwell3->SetParLimits(0,hmin+0.001,hmax);
00768
00769 char ufn[100];
00770 sprintf(ufn,"ufit_%d_%d",snarl,event);
00771 fShwfit.ufit = new TF1(ufn,"gaus",-20,20);
00772
00773 char vfn[100];
00774 sprintf(vfn,"vfit_%d_%d",snarl,event);
00775 fShwfit.vfit = new TF1(vfn,"gaus",-20,20);
00776
00777 }
|
|
||||||||||||||||||||
|
Definition at line 26 of file ShwfitAna.h. References sfContPhPlaneCut, sfDPlaneCut, sfPhPlaneCut, and sfPhStripCut. Referenced by NueDisplayModule::Ana(), and NueModule::Analyze(). 00026 {sfDPlaneCut=planes; sfPhStripCut=striphcut; sfPhPlaneCut=planephcut; sfContPhPlaneCut=contplanephcut; }
|
|
||||||||||||
|
Definition at line 614 of file ShwfitAna.cxx. References asym_peak, asym_vert, kurt, mean, molrad_peak, molrad_vert, MSG, rms, and skew. Referenced by Analyze(). 00615 {
00616 MSG("ShwfitAna",Msg::kDebug)<<"In ShwfitAna::TransVar"<<endl;
00617 MSG("ShwfitAna",Msg::kDebug)<<"plane view is "<<pv<<endl;
00618 MSG("ShwfitAna",Msg::kDebug)<<"Hist name is "<<histo->GetName()<<endl;
00619 MSG("ShwfitAna",Msg::kDebug)<<"Hist has "<<histo->GetEntries()<<" entries"<<endl;
00620
00621 Int_t THISTBINS = (Int_t)(histo->GetNbinsX());
00622
00623 Int_t binmax=histo->GetMaximumBin();
00624 Int_t binvert=Int_t(((THISTBINS-1)/2)+1);
00625 Float_t peak_bin=histo->Integral(binmax,binmax);
00626 Float_t vert_bin=histo->Integral(binvert,binvert);
00627 Float_t tot=histo->Integral(1,THISTBINS);
00628
00629 molrad_peak = molrad_vert = 0;
00630 mean = rms = skew = kurt = 0;
00631
00632 asym_peak= ANtpDefVal::kFloat;
00633 asym_vert= ANtpDefVal::kFloat;
00634
00635 if(tot-peak_bin){
00636 asym_peak=(TMath::Abs(histo->Integral(binmax+1,THISTBINS)-histo->Integral(1,binmax-1)))
00637 /(tot-peak_bin);
00638 }
00639
00640 if(tot-vert_bin){
00641 asym_vert=(TMath::Abs(histo->Integral(binvert+1,THISTBINS)-histo->Integral(1,binvert-1)))
00642 /(tot-vert_bin);
00643 }
00644
00645 Float_t ratio;
00646
00647 if(tot){
00648 for(Int_t i=0; i<=binvert-1;i++){
00649 ratio=histo->Integral(binmax-i>0?binmax-i:1,
00650 binmax+i<THISTBINS?binmax+i:THISTBINS)/tot;
00651 if(ratio>0.90){molrad_peak=i+1; break;}
00652 }
00653 for(Int_t i=0; i<=binvert-1;i++){
00654 ratio=histo->Integral(binvert-i,binvert+i)/tot;
00655 if(ratio>0.90){molrad_vert=i+1; break;}
00656 }
00657
00658 }
00659
00660 mean=histo->GetMean();
00661 rms=histo->GetRMS();
00662 Int_t n_count=0;
00663
00664 for(Int_t i=1;i<=THISTBINS;i++){
00665
00666 if(histo->GetBinContent(i)){
00667 skew=skew+(TMath::Power((histo->GetBinCenter(i)-mean),3)
00668 *histo->GetBinContent(i));
00669 kurt=kurt+(TMath::Power((histo->GetBinCenter(i)-mean),4)
00670 *histo->GetBinContent(i));
00671 n_count++;
00672 }
00673
00674 }
00675 if(rms>0 && n_count>1){
00676 skew=skew/((Float_t)(n_count-1)*TMath::Power((rms),3));
00677 kurt=(kurt/((Float_t)(n_count-1)*TMath::Power((rms),4)))-3;
00678 }
00679 else{skew= ANtpDefVal::kFloat; kurt= ANtpDefVal::kFloat;}
00680
00681 }
|
|
|
Definition at line 44 of file ShwfitAna.h. Referenced by TransVar(). |
|
|
Definition at line 45 of file ShwfitAna.h. Referenced by TransVar(). |
|
|
Definition at line 40 of file ShwfitAna.h. Referenced by Analyze(), doSlopes(), FitLShower(), FitLShower_Dan(), FitTShower(), PassCuts(), and Reset(). |
|
|
Definition at line 51 of file ShwfitAna.h. Referenced by TransVar(). |
|
|
Definition at line 48 of file ShwfitAna.h. Referenced by TransVar(). |
|
|
Definition at line 46 of file ShwfitAna.h. Referenced by TransVar(). |
|
|
Definition at line 47 of file ShwfitAna.h. Referenced by TransVar(). |
|
|
Definition at line 49 of file ShwfitAna.h. Referenced by TransVar(). |
|
|
Definition at line 35 of file ShwfitAna.h. Referenced by Analyze(), and SetCutParams(). |
|
|
Definition at line 28 of file ShwfitAna.h. Referenced by Analyze(), and SetCutParams(). |
|
|
Definition at line 38 of file ShwfitAna.h. Referenced by Analyze(), and SetCutParams(). |
|
|
Definition at line 37 of file ShwfitAna.h. Referenced by SetCutParams(). |
|
|
Definition at line 50 of file ShwfitAna.h. Referenced by TransVar(). |
1.3.9.1