MCFluxInfoAna Class Reference

#include <MCFluxInfoAna.h>

Inheritance diagram for MCFluxInfoAna:
NueAnaBase

List of all members.

Public Member Functions

 MCFluxInfoAna (NtpMCFluxInfo &fluxinfo)
virtual ~MCFluxInfoAna ()
void Analyze (int evtn, RecRecordImp< RecCandHeader > *srobj)
void Analyze (NtpMCTruth *mcrec)
void ResetMuParentInfo ()
NtpMCFluxInfoGetMCFluxInfo ()
void SetMuParentHelper (MuParentHelper *mp)
void FixMuParents (bool debugger)

Private Attributes

NtpMCFluxInfofMCFluxInfo
bool fluxfileneedsdebuggering
MuParentHelpermupar

Detailed Description

Definition at line 11 of file MCFluxInfoAna.h.


Constructor & Destructor Documentation

MCFluxInfoAna::MCFluxInfoAna ( NtpMCFluxInfo fluxinfo  ) 

Definition at line 11 of file MCFluxInfoAna.cxx.

00011                                                    :
00012   fMCFluxInfo(fluxinfo),
00013   fluxfileneedsdebuggering(true),
00014   mupar(0)
00015 {}

MCFluxInfoAna::~MCFluxInfoAna (  )  [virtual]

Definition at line 17 of file MCFluxInfoAna.cxx.

References Msg::kDebug, and MSG.

00018 {
00019   MSG("MCFluxInfoAna",Msg::kDebug)<<"Destructing MCFluxInfoAna"<<endl;
00020   
00021   MSG("MCFluxInfoAna",Msg::kDebug)<<"Leaving ~MCFluxInfoAna"<<endl;
00022 }


Member Function Documentation

void MCFluxInfoAna::Analyze ( NtpMCTruth mcrec  ) 

Definition at line 46 of file MCFluxInfoAna.cxx.

References NtpMCTruth::flux, fluxfileneedsdebuggering, fMCFluxInfo, Msg::kDebug, MSG, ResetMuParentInfo(), NtpMCFluxInfo::tpx, NtpMCFluxInfo::tpy, and NtpMCFluxInfo::tpz.

00047 {
00048 
00049   if(mcrec==0){
00050     return;
00051   }
00052 
00053   MSG("MCFluxInfoAna",Msg::kDebug)<<"in analyze(NtpMCTruth *)"<<endl;
00054   MSG("MCFluxInfoAna",Msg::kDebug)<<"flux info before copying: "
00055                                   <<" tpx: "<<mcrec->flux.tpx<<" "
00056                                   <<" tpy: "<<mcrec->flux.tpy<<" "
00057                                   <<" tpz: "<<mcrec->flux.tpz<<endl;
00058   
00059   fMCFluxInfo=mcrec->flux;
00060   MSG("MCFluxInfoAna",Msg::kDebug)<<"copying flux info: "
00061                                   <<" tpx: "<<fMCFluxInfo.tpx<<" "
00062                                   <<" tpy: "<<fMCFluxInfo.tpy<<" "
00063                                   <<" tpz: "<<fMCFluxInfo.tpz<<endl;
00064 
00065   if(fluxfileneedsdebuggering){
00066     ResetMuParentInfo();
00067   }
00068 
00069 }

void MCFluxInfoAna::Analyze ( int  evtn,
RecRecordImp< RecCandHeader > *  srobj 
) [virtual]

Implements NueAnaBase.

Definition at line 24 of file MCFluxInfoAna.cxx.

References SntpHelpers::GetEvent2MCIndex(), SntpHelpers::GetMCTruth(), Msg::kDebug, Msg::kError, and MSG.

Referenced by NueRecordAna::FillTrue().

00025 {
00026   //only NtpStRecords have the flux info
00027   NtpStRecord *st = dynamic_cast<NtpStRecord *>(srobj);
00028   if(!st){
00029     MSG("MCFluxInfoAna",Msg::kError)<<"Trying to get flux info from a non NtpStRecord"<<endl
00030                         <<"That's not a good idea"<<endl;
00031     return;
00032   }
00033   int thn = SntpHelpers::GetEvent2MCIndex(evtn,st);
00034   if(thn<0){
00035     return;
00036   }
00037   NtpMCTruth *mcrec = SntpHelpers::GetMCTruth(thn,st);
00038   MSG("MCFluxInfoAna",Msg::kDebug)<<"in MCFluxInfoAna::Analyze mcrec: "<<mcrec<<endl;
00039   if(mcrec==0){
00040       MSG("MCFluxInfoAna",Msg::kError)<<"No mcrec! cannot fill flux info: "<<mcrec<<endl;
00041       return;
00042   }
00043   Analyze(mcrec);
00044 }

void MCFluxInfoAna::FixMuParents ( bool  debugger  )  [inline]

Definition at line 26 of file MCFluxInfoAna.h.

References fluxfileneedsdebuggering.

Referenced by NueModule::Analyze().

00026 {fluxfileneedsdebuggering=debugger;}

NtpMCFluxInfo* MCFluxInfoAna::GetMCFluxInfo (  )  [inline]

Definition at line 23 of file MCFluxInfoAna.h.

References fMCFluxInfo.

Referenced by NueRecordAna::FillTrue().

00023 {return &fMCFluxInfo;}

void MCFluxInfoAna::ResetMuParentInfo (  ) 

Definition at line 71 of file MCFluxInfoAna.cxx.

References NtpMCFluxInfo::fluxevtno, NtpMCFluxInfo::fluxrun, fMCFluxInfo, NuParent::GetGen(), MuParentHelper::GetMuParent(), NuParent::GetPID(), NuParent::GetPx(), NuParent::GetPy(), NuParent::GetPz(), NuParent::GetX(), NuParent::GetY(), NuParent::GetZ(), Msg::kError, MSG, mupar, NtpMCFluxInfo::tgen, NtpMCFluxInfo::tptype, NtpMCFluxInfo::tpx, NtpMCFluxInfo::tpy, NtpMCFluxInfo::tpz, NtpMCFluxInfo::tvx, NtpMCFluxInfo::tvy, and NtpMCFluxInfo::tvz.

Referenced by Analyze().

00072 {
00073   if(!mupar){
00074     MSG("MCFluxInfoAna",Msg::kError)<<"If you want to reset the muparent info, you must provide a mu parent helper"<<endl;
00075     return;
00076   }
00077   NuParent par;
00078   if(fMCFluxInfo.tptype==-13 || fMCFluxInfo.tptype==13) {
00079     mupar->GetMuParent(fMCFluxInfo.fluxrun,fMCFluxInfo.fluxevtno,
00080                       fMCFluxInfo.tpx,fMCFluxInfo.tpy,fMCFluxInfo.tpz,par);
00081   
00082 
00083     fMCFluxInfo.tvx = par.GetX();
00084     fMCFluxInfo.tvy = par.GetY();
00085     fMCFluxInfo.tvz = par.GetZ();
00086     fMCFluxInfo.tpx = par.GetPx();
00087     fMCFluxInfo.tpy = par.GetPy();
00088     fMCFluxInfo.tpz = par.GetPz();
00089     fMCFluxInfo.tptype = par.GetPID();
00090     
00091     fMCFluxInfo.tgen = par.GetGen();
00092   }
00093 }

void MCFluxInfoAna::SetMuParentHelper ( MuParentHelper mp  )  [inline]

Definition at line 25 of file MCFluxInfoAna.h.

References mupar.

Referenced by NueModule::Analyze().

00025 {mupar=mp;}


Member Data Documentation

Definition at line 29 of file MCFluxInfoAna.h.

Referenced by Analyze(), and FixMuParents().

Definition at line 28 of file MCFluxInfoAna.h.

Referenced by Analyze(), GetMCFluxInfo(), and ResetMuParentInfo().

Definition at line 30 of file MCFluxInfoAna.h.

Referenced by ResetMuParentInfo(), and SetMuParentHelper().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1