BeamMonAna Class Reference

#include <BeamMonAna.h>

Inheritance diagram for BeamMonAna:

NueAnaBase List of all members.

Public Member Functions

 BeamMonAna (BeamMon &bmon)
virtual ~BeamMonAna ()
void SetBeamSummary (BeamSummary *b)
void Analyze (int evtn, RecRecordImp< RecCandHeader > *srobj)

Private Attributes

BeamMonfBmon
BeamSummarybs

Detailed Description

Definition at line 14 of file BeamMonAna.h.


Constructor & Destructor Documentation

BeamMonAna::BeamMonAna ( BeamMon bmon  ) 

Definition at line 20 of file BeamMonAna.cxx.

00020                                    :
00021   fBmon(bmon),
00022   bs(0)
00023 {}

BeamMonAna::~BeamMonAna (  )  [virtual]

Definition at line 25 of file BeamMonAna.cxx.

00026 {}


Member Function Documentation

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

Implements NueAnaBase.

Definition at line 38 of file BeamMonAna.cxx.

References BeamSummary::beamIntensity, BeamMon::bI, BeamMonSpill::BpmAtTarget(), bs, BeamMon::dt_bmst, BeamMon::dt_stnd, fBmon, BeamMonSpill::fHornCur, BeamMonSpill::fProfWidX, BeamMonSpill::fProfWidY, BeamMonSpill::fTargProfX, BeamMonSpill::fTargProfY, BeamMonSpill::fTor101, BeamMonSpill::fTortgt, BeamMonSpill::fTr101d, BeamMonSpill::fTrtgtd, BDSpillAccessor::Get(), VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), BeamMonSpill::GetStatusBits(), SpillTimeFinder::GetTimeOfNearestSpill(), VldContext::GetTimeStamp(), BeamSummary::hBeamWidth, BeamMon::hbw, BeamMon::hornI, BeamSummary::hornPeakCurrent, BeamMon::hpos1, BeamMon::hpos2, BeamSummary::hPosatTargetBPM, BeamSummary::hPosatTargetPM, BeamMon::htan, SpillTimeFinder::Instance(), SimFlag::kData, Msg::kDebug, Msg::kError, BDSpillAccessor::LoadSpill(), BeamSummary::MatchSpillWithTime(), Munits::meter, MSG, BeamSummary::nuTarZ, BeamMon::nuTarZ, BeamMonSpill::SpillTime(), BeamSummary::tanHoriz, BeamSummary::tanVert, BeamMon::time, BeamSummary::timeStampD, BeamSummary::vBeamWidth, BeamMon::vbw, BeamMon::vpos1, BeamMon::vpos2, BeamSummary::vPosatTargetBPM, BeamSummary::vPosatTargetPM, and BeamMon::vtan.

00039 {
00040   if(srobj==0){
00041     return;
00042   }
00043   if(((dynamic_cast<NtpStRecord *>(srobj))==0)&&
00044      ((dynamic_cast<NtpSRRecord *>(srobj))==0)){
00045     return;
00046   }
00047 
00048   
00049   VldContext vc=srobj->GetHeader().GetVldContext();
00050   if(vc.GetSimFlag()!=SimFlag::kData){
00051     return;
00052   }
00053 
00054 
00055   VldTimeStamp vts = vc.GetTimeStamp();
00056   Int_t tsec = vts.GetSec();
00057   Int_t tnsec = vts.GetNanoSec();
00058 
00059   VldTimeStamp stnd = SpillTimeFinder::Instance().GetTimeOfNearestSpill(vc);
00060 
00061   if (bs) {
00062       bs->MatchSpillWithTime(tsec,tnsec);
00063       
00064       fBmon.bI=bs->beamIntensity;
00065       fBmon.hbw=bs->hBeamWidth;
00066       fBmon.vbw=bs->vBeamWidth;
00067       fBmon.hpos1=bs->hPosatTargetPM;
00068       fBmon.vpos1=bs->vPosatTargetPM;
00069       fBmon.hpos2=bs->hPosatTargetBPM;
00070       fBmon.vpos2=bs->vPosatTargetBPM;
00071       fBmon.htan=bs->tanHoriz;
00072       fBmon.vtan=bs->tanVert;
00073       fBmon.hornI=bs->hornPeakCurrent;
00074       fBmon.nuTarZ=bs->nuTarZ;
00075       fBmon.time=bs->timeStampD;
00076       fBmon.dt_bmst = ((double)(vts)) - fBmon.time;
00077       fBmon.dt_stnd = (double)(vts-stnd);
00078       return;
00079   }
00080 
00081   const BeamMonSpill* spill = BDSpillAccessor::Get().LoadSpill(vts);
00082 
00083       
00084   if (!spill) {
00085     MSG("BeamMonAna",Msg::kError)
00086         << "No BeamMonSpill for " << vts << endl;
00087     return;
00088   }
00089 
00090   double tor = spill->fTortgt;
00091   if (tor == 0) tor = spill->fTrtgtd;
00092   if (tor == 0) tor = spill->fTr101d;
00093   if (tor == 0) tor = spill->fTor101;
00094   fBmon.bI = tor;
00095 
00096   fBmon.hbw = spill->fProfWidX;
00097   fBmon.vbw = spill->fProfWidY;
00098 
00099   fBmon.hpos1 = spill->fTargProfX;
00100   fBmon.vpos1 = spill->fTargProfY;
00101 
00102   double xbpm,ybpm,xrms,yrms;
00103   spill->BpmAtTarget(xbpm,ybpm,xrms,yrms);
00104   fBmon.hpos2 = xbpm;
00105   fBmon.vpos2 = ybpm;
00106 
00107   fBmon.htan = 0;
00108   fBmon.vtan = 0;
00109 
00110   fBmon.hornI = spill->fHornCur;
00111 
00112   fBmon.nuTarZ = 0;
00113   int beam_type = spill->GetStatusBits().beam_type;
00114   if (beam_type==4)
00115       fBmon.nuTarZ = 1.50 * Munits::meter;
00116   if (beam_type==5)
00117       fBmon.nuTarZ = 2.50 * Munits::meter;
00118 
00119   VldTimeStamp st = spill->SpillTime();
00120   fBmon.time = (double)st;
00121   fBmon.dt_stnd = (double)(vts-stnd);
00122   fBmon.dt_bmst = (double)(vts-st);
00123   
00124   MSG("BeamMonAna",Msg::kDebug)
00125       << vts << " - " << st << " = " << (double)(vts-st)
00126       << " : " << tor << " (" << fBmon.hpos1 << " x " << fBmon.vpos1 << ") "
00127       << "(" << xbpm << " x " << ybpm << ") " << fBmon.hornI << " " << beam_type << endl;
00128 
00129 }

void BeamMonAna::SetBeamSummary ( BeamSummary b  ) 

Definition at line 28 of file BeamMonAna.cxx.

References bs.

00029 {
00030     if (b) {
00031         bs=b;
00032         return;
00033     }
00034 }


Member Data Documentation

BeamSummary* BeamMonAna::bs [private]

Definition at line 27 of file BeamMonAna.h.

Referenced by Analyze(), and SetBeamSummary().

BeamMon& BeamMonAna::fBmon [private]

Definition at line 26 of file BeamMonAna.h.

Referenced by Analyze().


The documentation for this class was generated from the following files:
Generated on Mon Sep 1 00:51:09 2014 for loon by  doxygen 1.4.7