Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ANtpInfoObjectFillerBeam Class Reference

#include <ANtpInfoObjectFillerBeam.h>

Inheritance diagram for ANtpInfoObjectFillerBeam:

ANtpInfoObjectFiller List of all members.

Public Member Functions

 ANtpInfoObjectFillerBeam ()
virtual ~ANtpInfoObjectFillerBeam ()
void FillBeamInformation (VldTimeStamp &timeStamp, DetectorType::Detector_t det, SimFlag::SimFlag_t dataType, ANtpBeamInfo *beamInfo)
void FillBeamMCTruthInformation (NtpMCTruth *ntpMCTruth, TClonesArray *stdArray, ANtpTruthInfoBeam *truthInfo)

Constructor & Destructor Documentation

ANtpInfoObjectFillerBeam::ANtpInfoObjectFillerBeam  ) 
 

Definition at line 36 of file ANtpInfoObjectFillerBeam.cxx.

References MSG.

00037 {
00038     
00039   MSG("ANtpInfoObjectFillerBeam", Msg::kDebug) << "ANtpInfoObjectFillerBeam::Constructor" << endl;
00040   
00041 }

ANtpInfoObjectFillerBeam::~ANtpInfoObjectFillerBeam  )  [virtual]
 

Definition at line 44 of file ANtpInfoObjectFillerBeam.cxx.

References MSG.

00045 {
00046   
00047   MSG("ANtpInfoObjectFillerBeam", Msg::kDebug) << "ANtpInfoObjectFillerBeam::Destructor" << endl;
00048   
00049 }


Member Function Documentation

void ANtpInfoObjectFillerBeam::FillBeamInformation VldTimeStamp timeStamp,
DetectorType::Detector_t  det,
SimFlag::SimFlag_t  dataType,
ANtpBeamInfo beamInfo
 

Definition at line 53 of file ANtpInfoObjectFillerBeam.cxx.

References BeamMonSpill::fHadInt, BeamMonSpill::fHornCur, BeamMonSpill::fMuInt1, BeamMonSpill::fMuInt2, BeamMonSpill::fMuInt3, BeamMonSpill::fProfWidX, BeamMonSpill::fProfWidY, BeamMonSpill::fTargBpmX, BeamMonSpill::fTargBpmY, BeamMonSpill::fTor101, BeamMonSpill::fTortgt, BeamMonSpill::fTrtgtd, BDSpillAccessor::Get(), VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), BeamMonSpill::GetStatusBits(), SpillTimeFinder::GetTimeOfNearestSpill(), SpillTimeFinder::GetTimeToNearestSpill(), ANtpBeamInfo::hadronIntensity, ANtpBeamInfo::hornCurrent, SpillTimeFinder::Instance(), BDSpillAccessor::LoadSpill(), ANtpBeamInfo::muonIntensity1, ANtpBeamInfo::muonIntensity2, ANtpBeamInfo::muonIntensity3, ANtpBeamInfo::nearestNSToSpill, ANtpBeamInfo::nearestSecToSpill, ANtpBeamInfo::profileWidthX, ANtpBeamInfo::profileWidthY, ANtpBeamInfo::protonIntensity, ANtpBeamInfo::Reset(), ANtpBeamInfo::targetBPMX, ANtpBeamInfo::targetBPMY, ANtpBeamInfo::targetPosition, ANtpBeamInfo::timeToNearestSpill, ANtpBeamInfo::tor101, ANtpBeamInfo::tortgt, and ANtpBeamInfo::trtgtd.

00057 {
00058   //get the appropriate context
00059   VldContext vldc(det, dataType, timeStamp);
00060 
00061   beamInfo->Reset();
00062 
00063   //make the thing to access the beam information from the db
00064   BDSpillAccessor& spillAccess = BDSpillAccessor::Get();
00065 
00066   //load the spill for the validity context
00067   const BeamMonSpill *spillInfo = spillAccess.LoadSpill(timeStamp);
00068 
00069   if(spillInfo && dataType == SimFlag::kData){
00070     beamInfo->tor101 = spillInfo->fTor101;
00071     beamInfo->tortgt = spillInfo->fTortgt;
00072     beamInfo->trtgtd = spillInfo->fTrtgtd;
00073     beamInfo->hornCurrent = spillInfo->fHornCur;
00074     beamInfo->targetBPMX = spillInfo->fTargBpmX[0];
00075     beamInfo->targetBPMY = spillInfo->fTargBpmY[0];
00076     beamInfo->profileWidthX = spillInfo->fProfWidX;
00077     beamInfo->profileWidthY = spillInfo->fProfWidY;
00078     beamInfo->hadronIntensity = spillInfo->fHadInt;
00079     beamInfo->muonIntensity1 = spillInfo->fMuInt1;
00080     beamInfo->muonIntensity2 = spillInfo->fMuInt2;
00081     beamInfo->muonIntensity3 = spillInfo->fMuInt3;
00082     beamInfo->targetPosition = (int)spillInfo->GetStatusBits().beam_type;
00083     beamInfo->protonIntensity = beamInfo->tortgt;
00084 
00085     SpillTimeFinder &stf = SpillTimeFinder::Instance();
00086     beamInfo->timeToNearestSpill = stf.GetTimeToNearestSpill(vldc);
00087     VldTimeStamp tons = stf.GetTimeOfNearestSpill(vldc);
00088     beamInfo->nearestSecToSpill = tons.GetSec();
00089     beamInfo->nearestNSToSpill = tons.GetNanoSec();
00090 
00091   }
00092   else if(spillInfo && dataType == SimFlag::kMC){
00093     beamInfo->tor101 = spillInfo->fTor101;
00094     beamInfo->tortgt = spillInfo->fTortgt;
00095     beamInfo->trtgtd = spillInfo->fTrtgtd;
00096     beamInfo->hornCurrent = spillInfo->fHornCur;
00097     beamInfo->targetBPMX = spillInfo->fTargBpmX[0];
00098     beamInfo->targetBPMY = spillInfo->fTargBpmY[0];
00099     beamInfo->profileWidthX = spillInfo->fProfWidX;
00100     beamInfo->profileWidthY = spillInfo->fProfWidY;
00101     beamInfo->hadronIntensity = spillInfo->fHadInt;
00102     beamInfo->muonIntensity1 = spillInfo->fMuInt1;
00103     beamInfo->muonIntensity2 = spillInfo->fMuInt2;
00104     beamInfo->muonIntensity3 = spillInfo->fMuInt3;
00105     beamInfo->targetPosition = (int)spillInfo->GetStatusBits().beam_type;
00106     beamInfo->protonIntensity = beamInfo->tortgt;
00107   }
00108   
00109   return;
00110 }

void ANtpInfoObjectFillerBeam::FillBeamMCTruthInformation NtpMCTruth ntpMCTruth,
TClonesArray *  stdArray,
ANtpTruthInfoBeam truthInfo
 

Definition at line 114 of file ANtpInfoObjectFillerBeam.cxx.

References NtpMCTruth::a, abs(), ANtpTruthInfoBeam::atomicNumber, ANtpTruthInfoBeam::atomicWeight, ANtpTruthInfoBeam::bjorkenX, NtpMCTruth::emfrac, ANtpTruthInfoBeam::emShowerFraction, ANtpTruthInfoBeam::hadronicFinalState, NtpMCStdHep::IdHEP, ANtpTruthInfoBeam::initialState, NtpMCTruth::inu, NtpMCTruth::inunoosc, NtpMCTruth::iresonance, NtpMCStdHep::IstHEP, ANtpTruthInfoBeam::nonOscNuDCosX, ANtpTruthInfoBeam::nonOscNuDCosY, ANtpTruthInfoBeam::nonOscNuDCosZ, ANtpTruthInfoBeam::nonOscNuEnergy, ANtpTruthInfoBeam::nonOscNuFlavor, ANtpTruthInfo::nuFlavor, NtpMCTruth::p4neunoosc, NtpMCTruth::q2, ANtpTruthInfoBeam::q2, ANtpTruthInfoBeam::resonanceCode, NtpMCTruth::sigma, ANtpTruthInfoBeam::sigma, NtpMCTruth::stdhep, NtpMCTruth::w2, ANtpTruthInfoBeam::w2, NtpMCTruth::x, and NtpMCTruth::z.

Referenced by ANtpTruthInfoBeamAna::Analyze(), and MadAnalysis::CreateANtpPAN().

00117 {  
00118   //the NtpMCTruth object stdhep array tells you which entries in the stdhep array 
00119   //are the first and last for the event
00120   Int_t lowIndex = (Int_t)ntpMCTruth->stdhep[0];
00121   Int_t highIndex = (Int_t)ntpMCTruth->stdhep[1];
00122   
00123   //already fill this variable in the FillMCTruthInformation() method
00124   //but leave it in to quiet the compiler
00125   truthInfo->nuFlavor = ntpMCTruth->inu;
00126   truthInfo->nonOscNuEnergy = ntpMCTruth->p4neunoosc[3];
00127   truthInfo->nonOscNuDCosX = ntpMCTruth->p4neunoosc[0];
00128   truthInfo->nonOscNuDCosY = ntpMCTruth->p4neunoosc[1];
00129   truthInfo->nonOscNuDCosZ = ntpMCTruth->p4neunoosc[2];
00130   truthInfo->nonOscNuFlavor = ntpMCTruth->inunoosc;
00131   truthInfo->resonanceCode = ntpMCTruth->iresonance;
00132   
00133   truthInfo->atomicWeight = ntpMCTruth->a;
00134   truthInfo->atomicNumber = ntpMCTruth->z;
00135   truthInfo->bjorkenX = ntpMCTruth->x;
00136   truthInfo->q2 = ntpMCTruth->q2;
00137   truthInfo->w2 = ntpMCTruth->w2;
00138   truthInfo->sigma = ntpMCTruth->sigma;
00139   truthInfo->emShowerFraction = ntpMCTruth->emfrac;
00140 
00141   NtpMCStdHep *ntpMCStdHep = 0;
00142   
00143   //loop over the entries to figure out the targert nucleon
00144   Int_t nucleon = 0;
00145   Int_t nuFlavor = ntpMCTruth->inu;
00146   bool gotOneAlreadyMate = false;
00147 
00148   for(Int_t i = lowIndex; i < highIndex+1; ++i){
00149     
00150     ntpMCStdHep = dynamic_cast<NtpMCStdHep *>(stdArray->At(i));
00151     
00152     if(ntpMCStdHep->IstHEP == 11){
00153       if(ntpMCStdHep->IdHEP == 2212) nucleon = 1;
00154       else if(ntpMCStdHep->IdHEP == 2112) nucleon = 0;
00155       else if(abs(ntpMCStdHep->IdHEP) > 1000000000)  nucleon = 2;
00156       else nucleon = 3;
00157     }
00158     
00159     if(nucleon == 1 && nuFlavor > 0) truthInfo->initialState = 1;       //p + v
00160     else if(nucleon == 0 && nuFlavor > 0) truthInfo->initialState = 2;  //n + v
00161     else if(nucleon == 1 && nuFlavor < 0) truthInfo->initialState = 3;  //p + vbar
00162     else if(nucleon == 0 && nuFlavor < 0) truthInfo->initialState = 4;  //n + vbar
00163     else if(nucleon == 2 && nuFlavor > 0) truthInfo->initialState = 5;  //N + v
00164     else if(nucleon == 3 && nuFlavor > 0) truthInfo->initialState = 6;  //A + v
00165     else if(nucleon == 2 && nuFlavor < 0) truthInfo->initialState = 7;  //N + vbar
00166     else if(nucleon == 3 && nuFlavor < 0) truthInfo->initialState = 8;  //A + vbar              
00167     
00168     //figure out the hadronic final state too
00169     if(ntpMCTruth->iresonance == 1002){
00170       if(ntpMCStdHep->IstHEP == 3 && !(TMath::Abs(ntpMCStdHep->IdHEP)==15) && !gotOneAlreadyMate) 
00171         //not a tau lepton and we dont have an IstHEP==3 yet
00172         {
00173           truthInfo->hadronicFinalState = ntpMCStdHep->IdHEP%1000;
00174           gotOneAlreadyMate = true;
00175         }
00176     }
00177     else if(ntpMCStdHep->IstHEP==3 && !gotOneAlreadyMate){
00178       truthInfo->hadronicFinalState = ntpMCStdHep->IdHEP%1000;
00179       gotOneAlreadyMate = true;
00180     }           
00181     
00182   }//end loop over stdhep array for this event
00183   
00184   return;
00185 }


The documentation for this class was generated from the following files:
Generated on Thu Nov 1 15:55:35 2007 for loon by  doxygen 1.3.9.1