ShowerVertexPerf Class Reference

#include <ShowerVertexPerf.h>

List of all members.

Public Member Functions

 ShowerVertexPerf ()
 ShowerVertexPerf (int iter)
bool FillEvent (const AtmosEvent *evt)
void MakeHistos ()
void Reset ()
void Finish ()
int Loud ()
void Loud (int i)

Private Attributes

int fIter
int fLoud
int NEvents
TH1F ** hTrueNuVtxU
TH1F ** hTrueNuVtxV
TH1F ** hTrueNuVtxX
TH1F ** hTrueNuVtxY
TH1F ** hTrueNuVtxZ
TH1F * hRecoShwVtxU [NShwRecoVtx]
TH1F * hRecoShwVtxV [NShwRecoVtx]
TH1F * hRecoShwVtxX [NShwRecoVtx]
TH1F * hRecoShwVtxY [NShwRecoVtx]
TH1F * hRecoShwVtxZ [NShwRecoVtx]
TH1F ** hDVtx [NShwRecoVtx]
TH1F ** hDVtxR [NShwRecoVtx]
TH1F ** hDVtxU [NShwRecoVtx]
TH1F ** hDVtxV [NShwRecoVtx]
TH1F ** hDVtxX [NShwRecoVtx]
TH1F ** hDVtxY [NShwRecoVtx]
TH1F ** hDVtxZ [NShwRecoVtx]
double MeanDVtx [NShwRecoVtx]
double RMSDVtx [NShwRecoVtx]
double MeanDVtxR [NShwRecoVtx]
double RMSDVtxR [NShwRecoVtx]
double MeanDVtxZ [NShwRecoVtx]
double RMSDVtxZ [NShwRecoVtx]

Detailed Description

Definition at line 10 of file ShowerVertexPerf.h.


Constructor & Destructor Documentation

ShowerVertexPerf::ShowerVertexPerf (  ) 

Definition at line 26 of file ShowerVertexPerf.cxx.

00027 {
00028   Reset();
00029 }

ShowerVertexPerf::ShowerVertexPerf ( int  iter  ) 

Definition at line 31 of file ShowerVertexPerf.cxx.

References fIter, and Reset().

00032 {
00033   Reset();
00034   fIter = iter;
00035 }


Member Function Documentation

bool ShowerVertexPerf::FillEvent ( const AtmosEvent evt  ) 

Definition at line 148 of file ShowerVertexPerf.cxx.

References AtNuAnaUtil::GetPrimaryShower(), hDVtx, hDVtxR, hDVtxU, hDVtxV, hDVtxX, hDVtxY, hDVtxZ, hRecoShwVtxU, hRecoShwVtxV, hRecoShwVtxX, hRecoShwVtxY, hRecoShwVtxZ, hTrueNuVtxU, hTrueNuVtxV, hTrueNuVtxX, hTrueNuVtxY, hTrueNuVtxZ, UtilMisc::IType(), Msg::kVerbose, MeanDVtx, MeanDVtxR, MeanDVtxZ, MSG, NEvents, NShwRecoVtx, RecoVtx, RMSDVtx, RMSDVtxR, RMSDVtxZ, AtmosShower::VtxDirCosU, AtmosShower::VtxDirCosV, AtmosShower::VtxDirCosX, AtmosShower::VtxDirCosY, AtmosShower::VtxDirCosZ, AtmosMC::VtxU, AtmosShower::VtxU, AtmosMC::VtxV, AtmosShower::VtxV, AtmosMC::VtxX, AtmosShower::VtxX, AtmosMC::VtxY, AtmosShower::VtxY, AtmosMC::VtxZ, and AtmosShower::VtxZ.

00148                                                         {
00149   MSG("ShwPerf",Msg::kVerbose) << "ShowerVertexPerf::FillEvent" << endl;
00150   assert(event);
00151 
00152   int itype = UtilMisc::IType(event);
00153 
00154   AtmosMC mcinfo = event->MCInfo;
00155 
00156   const AtmosShower* shower =
00157     AtNuAnaUtil::GetPrimaryShower(const_cast<AtmosEvent*>(event));
00158   if(!shower) return false;
00159 
00160   NEvents++;
00161 
00162   hTrueNuVtxU[itype]->Fill(mcinfo.VtxU);
00163   hTrueNuVtxV[itype]->Fill(mcinfo.VtxV);
00164   hTrueNuVtxX[itype]->Fill(mcinfo.VtxX);
00165   hTrueNuVtxY[itype]->Fill(mcinfo.VtxY);
00166   hTrueNuVtxZ[itype]->Fill(mcinfo.VtxZ);
00167 
00168   double RecoVtx[NShwRecoVtx][5] = {{0.0} };
00169 
00170   for (int ivtx=0; ivtx<NShwRecoVtx; ivtx++) {
00171     RecoVtx[ivtx][0] = shower->VtxU;
00172     RecoVtx[ivtx][1] = shower->VtxV;
00173     RecoVtx[ivtx][2] = shower->VtxX;
00174     RecoVtx[ivtx][3] = shower->VtxY;
00175     RecoVtx[ivtx][4] = shower->VtxZ;
00176   }
00177 
00178   //Trace back some distance in Z
00179   double DZTraceBack = 0.1;
00180   if (fabs(shower->VtxDirCosZ)>0.5) {
00181     RecoVtx[1][0] -= DZTraceBack * shower->VtxDirCosU / shower->VtxDirCosZ;
00182     RecoVtx[1][1] -= DZTraceBack * shower->VtxDirCosV / shower->VtxDirCosZ;
00183     RecoVtx[1][2] -= DZTraceBack * shower->VtxDirCosX / shower->VtxDirCosZ;
00184     RecoVtx[1][3] -= DZTraceBack * shower->VtxDirCosY / shower->VtxDirCosZ;
00185     RecoVtx[1][4] -= DZTraceBack;
00186   }
00187 
00188   for (int ivtx=0; ivtx<NShwRecoVtx; ivtx++) {
00189     hRecoShwVtxU[ivtx]->Fill(RecoVtx[ivtx][0]);
00190     hRecoShwVtxV[ivtx]->Fill(RecoVtx[ivtx][1]);
00191     hRecoShwVtxX[ivtx]->Fill(RecoVtx[ivtx][2]);
00192     hRecoShwVtxY[ivtx]->Fill(RecoVtx[ivtx][3]);
00193     hRecoShwVtxZ[ivtx]->Fill(RecoVtx[ivtx][4]);
00194 
00195     double DVtx = sqrt(((RecoVtx[ivtx][2] - mcinfo.VtxX) *
00196                         (RecoVtx[ivtx][2] - mcinfo.VtxX)) +
00197                        ((RecoVtx[ivtx][3] - mcinfo.VtxY) *
00198                         (RecoVtx[ivtx][3] - mcinfo.VtxY)) +
00199                        ((RecoVtx[ivtx][4] - mcinfo.VtxZ) *
00200                         (RecoVtx[ivtx][4] - mcinfo.VtxZ)));
00201     double RecoVtxR = 4.0 - TMath::Max(
00202       TMath::Max(fabs(RecoVtx[ivtx][0]), fabs(RecoVtx[ivtx][1])),
00203       TMath::Max(fabs(RecoVtx[ivtx][2]), fabs(RecoVtx[ivtx][3])));
00204     double TrueVtxR = 4.0 - TMath::Max(
00205       TMath::Max(fabs(mcinfo.VtxX), fabs(mcinfo.VtxY)),
00206       TMath::Max(fabs(mcinfo.VtxU), fabs(mcinfo.VtxV)));
00207 
00208     hDVtx[ivtx][itype]->Fill(DVtx);
00209     hDVtxR[ivtx][itype]->Fill(RecoVtxR - TrueVtxR);
00210     hDVtxU[ivtx][itype]->Fill(RecoVtx[ivtx][0] - mcinfo.VtxU);
00211     hDVtxV[ivtx][itype]->Fill(RecoVtx[ivtx][1] - mcinfo.VtxV);
00212     hDVtxX[ivtx][itype]->Fill(RecoVtx[ivtx][2] - mcinfo.VtxX);
00213     hDVtxY[ivtx][itype]->Fill(RecoVtx[ivtx][3] - mcinfo.VtxY);
00214     hDVtxZ[ivtx][itype]->Fill(RecoVtx[ivtx][4] - mcinfo.VtxZ);
00215 
00216     MeanDVtx[ivtx] += DVtx; RMSDVtx[ivtx] += DVtx*DVtx;
00217     MeanDVtxR[ivtx] += (RecoVtxR-TrueVtxR);
00218     RMSDVtxR[ivtx] += (RecoVtxR-TrueVtxR)*(RecoVtxR-TrueVtxR);
00219     MeanDVtxZ[ivtx] += (RecoVtx[ivtx][4]-mcinfo.VtxZ);
00220     RMSDVtxZ[ivtx] += (RecoVtx[ivtx][4]-mcinfo.VtxZ)*
00221                       (RecoVtx[ivtx][4]-mcinfo.VtxZ);
00222   }
00223 
00224   return(true);
00225 }

void ShowerVertexPerf::Finish (  ) 

Definition at line 227 of file ShowerVertexPerf.cxx.

References Msg::kVerbose, MeanDVtx, MeanDVtxR, MeanDVtxZ, MSG, NEvents, RMSDVtx, RMSDVtxR, and RMSDVtxZ.

00227                               {
00228   MSG("ShwPerf",Msg::kVerbose) << "ShowerVertexPerf::Finish" << endl;
00229 
00230   //Report mean vertex displacement
00231   for (int ireco=0; ireco<NShwRecoVtx && NEvents>0; ireco++) {
00232     MeanDVtx[ireco] /= (double)NEvents;
00233     RMSDVtx[ireco] = sqrt(RMSDVtx[ireco]/NEvents);
00234     cout << "DVtx RMS = " << RMSDVtx[ireco] << endl;
00235 
00236     MeanDVtxR[ireco] /= (double)NEvents;
00237     RMSDVtxR[ireco] = sqrt((RMSDVtxR[ireco]/NEvents) -
00238       (MeanDVtxR[ireco]*MeanDVtxR[ireco]));
00239     cout << "DVtxR = " << MeanDVtxR[ireco] << " +- " << RMSDVtxR[ireco] << endl;
00240 
00241     MeanDVtxZ[ireco] /= (double)NEvents;
00242     RMSDVtxZ[ireco] = sqrt((RMSDVtxZ[ireco]/NEvents) -
00243       (MeanDVtxZ[ireco]*MeanDVtxZ[ireco]));
00244     cout << "DVtxZ = " << MeanDVtxZ[ireco] << " +- " << RMSDVtxZ[ireco] << endl;
00245   }
00246 }

void ShowerVertexPerf::Loud ( int  i  )  [inline]

Definition at line 23 of file ShowerVertexPerf.h.

References fLoud.

00023 {fLoud=i;}

int ShowerVertexPerf::Loud (  )  [inline]

Definition at line 22 of file ShowerVertexPerf.h.

References fLoud.

00022 {return fLoud;}

void ShowerVertexPerf::MakeHistos (  ) 

Definition at line 46 of file ShowerVertexPerf.cxx.

References HistMan::Book(), Form(), Nav::GetName(), hDVtx, hDVtxR, hDVtxU, hDVtxV, hDVtxX, hDVtxY, hDVtxZ, hRecoShwVtxU, hRecoShwVtxV, hRecoShwVtxX, hRecoShwVtxY, hRecoShwVtxZ, hTrueNuVtxU, hTrueNuVtxV, hTrueNuVtxX, hTrueNuVtxY, hTrueNuVtxZ, Msg::kVerbose, MeanDVtx, MeanDVtxR, MeanDVtxZ, MSG, NShwRecoVtx, RMSDVtx, RMSDVtxR, and RMSDVtxZ.

00047 {
00048   MSG("ShwPerf",Msg::kVerbose) << "ShowerVertexPerf::MakeHistos" << endl;
00049 
00050   const char* hsuf[] = {"NueCC", "NumuCC", "NutauCC", "NuNC"};
00051   const unsigned int NTypes = 4;
00052 
00053   /* Truth Quantities */
00054   HistMan HMTrue(Form("%s/True", GetName()));
00055 
00056   //True Neutrino Quantities
00057   hTrueNuVtxU = new TH1F*[NTypes];
00058   hTrueNuVtxV = new TH1F*[NTypes];
00059   hTrueNuVtxX = new TH1F*[NTypes];
00060   hTrueNuVtxY = new TH1F*[NTypes];
00061   hTrueNuVtxZ = new TH1F*[NTypes];
00062   for (unsigned int itype=0; itype<NTypes; itype++) {
00063     hTrueNuVtxX[itype] = HMTrue.Book<TH1F>
00064       (Form("TrueNuVtxX%s",hsuf[itype]),"", 50,-5.0,5.0);
00065     hTrueNuVtxX[itype]->GetXaxis()->SetTitle("#nu vtx_{x} (m)");
00066     hTrueNuVtxX[itype]->GetYaxis()->SetTitle("Events / 0.2 m");
00067     hTrueNuVtxY[itype] = HMTrue.Book<TH1F>
00068       (Form("TrueNuVtxY%s",hsuf[itype]),"", 50,-5.0,5.0);
00069     hTrueNuVtxY[itype]->GetXaxis()->SetTitle("#nu vtx_{y} (m)");
00070     hTrueNuVtxY[itype]->GetYaxis()->SetTitle("Events / 0.2 m");
00071     hTrueNuVtxU[itype] = HMTrue.Book<TH1F>
00072       (Form("TrueNuVtxU%s",hsuf[itype]),"", 50,-5.0,5.0);
00073     hTrueNuVtxU[itype]->GetXaxis()->SetTitle("#nu vtx_{u} (m)");
00074     hTrueNuVtxU[itype]->GetYaxis()->SetTitle("Events / 0.2 m");
00075     hTrueNuVtxV[itype] = HMTrue.Book<TH1F>
00076       (Form("TrueNuVtxV%s",hsuf[itype]),"", 50,-5.0,5.0);
00077     hTrueNuVtxV[itype]->GetXaxis()->SetTitle("#nu vtx_{v} (m)");
00078     hTrueNuVtxV[itype]->GetYaxis()->SetTitle("Events / 0.2 m");
00079     hTrueNuVtxZ[itype] = HMTrue.Book<TH1F>
00080       (Form("TrueNuVtxZ%s",hsuf[itype]),"", 34,-2.0,32.0);
00081     hTrueNuVtxZ[itype]->GetXaxis()->SetTitle("#nu vtx_{z} (m)");
00082     hTrueNuVtxZ[itype]->GetYaxis()->SetTitle("Events / 1.0 m");
00083   }
00084 
00085   const char *cRecoVtxs[] = {"CamReco", "TimeCorr"};
00086   for (int ireco=0; ireco<NShwRecoVtx; ireco++) {
00087     HistMan HMReco(Form("%s/Reco/%s", GetName(), cRecoVtxs[ireco]));
00088     hRecoShwVtxX[ireco] = HMReco.Book<TH1F>("RecoShwVtxX","", 50,-5.0,5.0);
00089     hRecoShwVtxX[ireco]->GetXaxis()->SetTitle("Shower vtx_{x} (m)");
00090     hRecoShwVtxX[ireco]->GetYaxis()->SetTitle("Events / 0.2 m");
00091     hRecoShwVtxY[ireco] = HMReco.Book<TH1F>("RecoShwVtxY","", 50,-5.0,5.0);
00092     hRecoShwVtxY[ireco]->GetXaxis()->SetTitle("Shower vtx_{y} (m)");
00093     hRecoShwVtxY[ireco]->GetYaxis()->SetTitle("Events / 0.2 m");
00094     hRecoShwVtxU[ireco] = HMReco.Book<TH1F>("RecoShwVtxU","", 50,-5.0,5.0);
00095     hRecoShwVtxU[ireco]->GetXaxis()->SetTitle("Shower vtx_{u} (m)");
00096     hRecoShwVtxU[ireco]->GetYaxis()->SetTitle("Events / 0.2 m");
00097     hRecoShwVtxV[ireco] = HMReco.Book<TH1F>("RecoShwVtxV","", 50,-5.0,5.0);
00098     hRecoShwVtxV[ireco]->GetXaxis()->SetTitle("Shower vtx_{v} (m)");
00099     hRecoShwVtxV[ireco]->GetYaxis()->SetTitle("Events / 0.2 m");
00100     hRecoShwVtxZ[ireco] = HMReco.Book<TH1F>("RecoShwVtxZ","", 34,-2.0,32.0);
00101     hRecoShwVtxZ[ireco]->GetXaxis()->SetTitle("Shower vtx_{z} (m)");
00102     hRecoShwVtxZ[ireco]->GetYaxis()->SetTitle("Events / 1.0 m");
00103 
00104     HistMan HMVtxPerf(Form("%s/VtxPerf/%s", GetName(), cRecoVtxs[ireco]));
00105     hDVtx[ireco] = new TH1F*[NTypes];
00106     hDVtxR[ireco] = new TH1F*[NTypes];
00107     hDVtxU[ireco] = new TH1F*[NTypes];
00108     hDVtxV[ireco] = new TH1F*[NTypes];
00109     hDVtxX[ireco] = new TH1F*[NTypes];
00110     hDVtxY[ireco] = new TH1F*[NTypes];
00111     hDVtxZ[ireco] = new TH1F*[NTypes];
00112     for (unsigned int itype=0; itype<NTypes; itype++) {
00113       hDVtx[ireco][itype] = HMVtxPerf.Book<TH1F>
00114         (Form("DVtx%s",hsuf[itype]),"", 40,0.0,2.0);
00115       hDVtx[ireco][itype]->GetXaxis()->SetTitle("#Delta vtx (m)");
00116       hDVtx[ireco][itype]->GetYaxis()->SetTitle("Events / 0.1 m");
00117       hDVtxR[ireco][itype] = HMVtxPerf.Book<TH1F>
00118         (Form("DVtxR%s",hsuf[itype]),"", 40,-1.0,1.0);
00119       hDVtxR[ireco][itype]->GetXaxis()->SetTitle("#Delta vtx_{depth} (m)");
00120       hDVtxR[ireco][itype]->GetYaxis()->SetTitle("Events / 0.1 m");
00121       hDVtxX[ireco][itype] = HMVtxPerf.Book<TH1F>
00122         (Form("DVtxX%s",hsuf[itype]),"", 40,-1.0,1.0);
00123       hDVtxX[ireco][itype]->GetXaxis()->SetTitle("#Delta vtx_{x} (m)");
00124       hDVtxX[ireco][itype]->GetYaxis()->SetTitle("Events / 0.1 m");
00125       hDVtxY[ireco][itype] = HMVtxPerf.Book<TH1F>
00126         (Form("DVtxY%s",hsuf[itype]),"", 40,-1.0,1.0);
00127       hDVtxY[ireco][itype]->GetXaxis()->SetTitle("#Delta vtx_{y} (m)");
00128       hDVtxY[ireco][itype]->GetYaxis()->SetTitle("Events / 0.2 m");
00129       hDVtxU[ireco][itype] = HMVtxPerf.Book<TH1F>
00130         (Form("DVtxU%s",hsuf[itype]),"", 40,-1.0,1.0);
00131       hDVtxU[ireco][itype]->GetXaxis()->SetTitle("#Delta vtx_{u} (m)");
00132       hDVtxU[ireco][itype]->GetYaxis()->SetTitle("Events / 0.2 m");
00133       hDVtxV[ireco][itype] = HMVtxPerf.Book<TH1F>
00134         (Form("DVtxV%s",hsuf[itype]),"", 40,-1.0,1.0);
00135       hDVtxV[ireco][itype]->GetXaxis()->SetTitle("#Delta vtx_{v} (m)");
00136       hDVtxV[ireco][itype]->GetYaxis()->SetTitle("Events / 0.2 m");
00137       hDVtxZ[ireco][itype] = HMVtxPerf.Book<TH1F>
00138         (Form("DVtxZ%s",hsuf[itype]),"", 40,-1.0,1.0);
00139       hDVtxZ[ireco][itype]->GetXaxis()->SetTitle("#Delta vtx_{z} (m)");
00140       hDVtxZ[ireco][itype]->GetYaxis()->SetTitle("Events / 1.0 m");
00141     }
00142     MeanDVtx[ireco] = 0.; RMSDVtx[ireco] = 0.;
00143     MeanDVtxR[ireco] = 0.; RMSDVtxR[ireco] = 0.;
00144     MeanDVtxZ[ireco] = 0.; RMSDVtxZ[ireco] = 0.;
00145   }
00146 }

void ShowerVertexPerf::Reset (  ) 

Definition at line 37 of file ShowerVertexPerf.cxx.

References fIter, fLoud, and NEvents.

Referenced by ShowerVertexPerf().

00038 {
00039   fIter = 1;
00040 
00041   fLoud = 0;
00042 
00043   NEvents = 0;
00044 }


Member Data Documentation

int ShowerVertexPerf::fIter [private]

Definition at line 26 of file ShowerVertexPerf.h.

Referenced by Reset(), and ShowerVertexPerf().

int ShowerVertexPerf::fLoud [private]

Definition at line 28 of file ShowerVertexPerf.h.

Referenced by Loud(), and Reset().

Definition at line 49 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 50 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 51 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 52 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 53 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 54 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 55 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 40 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 41 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 42 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 43 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 44 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 33 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 34 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 35 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 36 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 37 of file ShowerVertexPerf.h.

Referenced by FillEvent(), and MakeHistos().

Definition at line 57 of file ShowerVertexPerf.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

Definition at line 58 of file ShowerVertexPerf.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

Definition at line 59 of file ShowerVertexPerf.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

Definition at line 30 of file ShowerVertexPerf.h.

Referenced by FillEvent(), Finish(), and Reset().

Definition at line 57 of file ShowerVertexPerf.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

Definition at line 58 of file ShowerVertexPerf.h.

Referenced by FillEvent(), Finish(), and MakeHistos().

Definition at line 59 of file ShowerVertexPerf.h.

Referenced by FillEvent(), Finish(), and MakeHistos().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1