ShieldRejVarAna Class Reference

#include <ShieldRejVarAna.h>

Inheritance diagram for ShieldRejVarAna:
NueAnaBase

List of all members.

Public Member Functions

 ShieldRejVarAna (ShieldRejVar &sv)
virtual ~ShieldRejVarAna ()
void Analyze (int evtn, RecRecordImp< RecCandHeader > *srobj)

Private Attributes

ShieldRejVarfShieldRejVar

Detailed Description

Definition at line 12 of file ShieldRejVarAna.h.


Constructor & Destructor Documentation

ShieldRejVarAna::ShieldRejVarAna ( ShieldRejVar sv  ) 

Definition at line 27 of file ShieldRejVarAna.cxx.

00027                                                 :
00028   fShieldRejVar(sv)
00029 {
00030 }

ShieldRejVarAna::~ShieldRejVarAna (  )  [virtual]

Definition at line 32 of file ShieldRejVarAna.cxx.

00033 {}


Member Function Documentation

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

Implements NueAnaBase.

Definition at line 35 of file ShieldRejVarAna.cxx.

References ShieldGeom::ClosestTwoSections(), det, NtpVtxFinder::FindVertex(), fShieldRejVar, VldContext::GetDetector(), SntpHelpers::GetEvent(), RecRecordImp< T >::GetHeader(), SntpHelpers::GetShieldStrip(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), GetVldContext(), ReleaseType::IsCedar(), Detector::kFar, SimFlag::kMC, NtpSRShieldStrip::plank, NtpSRShieldStrip::pln, NueAnaBase::release, ShieldRejVar::Reset(), ShieldRejVar::ShieldHit, NtpSRShieldStrip::time, NtpStRecord::vetostp, NtpVtxFinder::VtxT(), NtpVtxFinder::VtxZ(), and ShieldGeom::WhatSection().

Referenced by NueRecordAna::Analyze().

00036 {
00037   if(srobj==0){
00038     return;
00039   }
00040   if(((dynamic_cast<NtpStRecord *>(srobj))==0)&&
00041      ((dynamic_cast<NtpSRRecord *>(srobj))==0)){
00042     return;
00043   }
00044 
00045   fShieldRejVar.Reset();
00046 
00047   Detector::Detector_t det = srobj->GetHeader().GetVldContext().GetDetector();
00048   if(det != Detector::kFar) return;
00049 
00050   if(srobj->GetHeader().GetVldContext().GetSimFlag()==SimFlag::kMC) return;
00051 
00052 
00053   const NtpStRecord* record = dynamic_cast<const NtpStRecord *>(srobj);
00054 
00055   ShieldGeom *shge = new ShieldGeom((srobj->GetHeader()).GetVldContext());
00056 
00057   NtpSREvent *event = SntpHelpers::GetEvent(evtn,srobj);
00058 
00059   Double_t vtxTime=0;
00060   //Shield 
00061   Int_t vetoHitPlane=0;
00062   Int_t vetoHitStrip0=0;
00063   Double_t vetoTime[2]={0};
00064   Int_t vetoHitSec=-1;
00065   Int_t contFound=0;
00066   
00067   Float_t vtxZ = event->vtx.z;
00068   Float_t vtxT = event->vtx.t;
00069                                                                                 
00070   if(ReleaseType::IsCedar(release)){
00071     NtpStRecord* st = dynamic_cast<NtpStRecord *>(srobj);
00072     NtpVtxFinder vtxf(evtn, st);
00073     if(vtxf.FindVertex() > 0){
00074        vtxZ = vtxf.VtxZ();
00075        vtxT = vtxf.VtxT();
00076     }
00077   }
00078 
00079   //Checking if hits in shield are found
00080   //------------------------------------
00081   //  NtpSRShieldSummary *shieldSummary = SntpHelpers::shieldSummary(srobj);
00082   const long veto_stp = record->vetostp->GetEntries(); 
00083   vtxTime = 1.e9*vtxT;  
00084   contFound=0;
00085 
00086   Int_t secabove0 = shge->ClosestTwoSections(vtxZ,0);
00087   Int_t secabove1 = shge->ClosestTwoSections(vtxZ,1);
00088 
00089   for(int idig = 0; idig<veto_stp; ++idig){
00090     NtpSRShieldStrip* ntpShieldStrip = SntpHelpers::GetShieldStrip(idig,srobj);
00091     if(ntpShieldStrip == NULL) {
00092       continue;
00093     }    
00094     vetoHitPlane = ntpShieldStrip->pln;
00095     vetoHitStrip0 = ntpShieldStrip->plank;
00096     vetoTime[0]=1.e9*(ntpShieldStrip->time[0]);
00097     vetoTime[1]=1.e9*(ntpShieldStrip->time[1]);
00098     vetoHitSec = shge->WhatSection(vetoHitPlane);
00099 
00100     if(((vetoHitSec==secabove0&&secabove0>0)||(vetoHitSec==secabove1&&secabove1>0))&& (fabs(vetoTime[0]-vtxTime)<100||fabs(vetoTime[1]-vtxTime)<100)){//same section && in time
00101       contFound+=1;
00102     }
00103   }
00104   fShieldRejVar.ShieldHit = contFound;
00105 
00106   if(shge){
00107    delete shge;
00108   }
00109 }


Member Data Documentation

Definition at line 23 of file ShieldRejVarAna.h.

Referenced by Analyze().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1