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

ANtpInfoObjectFiller Class Reference

#include <ANtpInfoObjectFiller.h>

Inheritance diagram for ANtpInfoObjectFiller:

ANtpInfoObjectFillerBeam ANtpInfoObjectFillerNC List of all members.

Public Member Functions

 ANtpInfoObjectFiller ()
 ANtpInfoObjectFiller (Detector::Detector_t detector)
 ANtpInfoObjectFiller (TClonesArray *strips)
virtual ~ANtpInfoObjectFiller ()
void FillHeaderInformation (ANtpRecoNtpManipulator *ntpManip, Detector::Detector_t det, SimFlag::SimFlag_t dataType, ANtpHeaderInfo *headerInfo)
void FillEventInformation (ANtpRecoNtpManipulator *ntpManip, NtpSREvent *ntpEvent, ANtpEventInfo *eventInfo)
void FillTrackInformation (NtpSRTrack *ntpTrack, ANtpTrackInfo *trackInfo)
void FillShowerInformation (NtpSRShower *ntpShower, ANtpShowerInfo *showerInfo)
void FillMCTruthInformation (NtpMCTruth *ntpMCTruth, ANtpTruthInfo *truthInfo)
void SetDetector (Detector::Detector_t detector)
void SetStripArray (TClonesArray *strips)
Float_t MetersToBeam (Detector::Detector_t det, Float_t x, Float_t y, Float_t z)
Float_t MetersToCoil (Detector::Detector_t det, Float_t x, Float_t y)
Float_t MetersToCloseEdge (Detector::Detector_t det, Float_t x, Float_t y, Bool_t NDUseFullPlane=0)

Protected Member Functions

void FillFiducialInformation (ANtpTrackInfo *trackInfo)
void FillFiducialInformation (ANtpEventInfo *eventInfo)

Protected Attributes

VldContext fVldc
TClonesArray * fStripArray
Detector::Detector_t fDetector

Private Member Functions

double Sqr (double x)
int Sqr (int x)
float Sqr (float x)
void GetTrackTrace (NtpSRTrack *ntpTrack, ANtpTrackInfo *trackInfo, Int_t direction)

Private Attributes

Long64_t fRowNum

Constructor & Destructor Documentation

ANtpInfoObjectFiller::ANtpInfoObjectFiller  ) 
 

Definition at line 60 of file ANtpInfoObjectFiller.cxx.

References MSG.

00060                                            :
00061   fStripArray(0),
00062   fDetector(Detector::kUnknown),
00063   fRowNum(0)
00064 {
00065     
00066   MSG("ANtpInfoObjectFiller", Msg::kDebug) 
00067     << "ANtpInfoObjectFiller::Constructor" << endl;
00068   
00069 }

ANtpInfoObjectFiller::ANtpInfoObjectFiller Detector::Detector_t  detector  ) 
 

Definition at line 72 of file ANtpInfoObjectFiller.cxx.

References MSG.

00072                                                                       :
00073   fStripArray(0),
00074   fDetector(detector),
00075   fRowNum(0)
00076 {
00077     
00078   MSG("ANtpInfoObjectFiller", Msg::kDebug) 
00079     << "ANtpInfoObjectFiller::Constructor" << endl;
00080   
00081 }

ANtpInfoObjectFiller::ANtpInfoObjectFiller TClonesArray *  strips  ) 
 

Definition at line 84 of file ANtpInfoObjectFiller.cxx.

References MSG.

00084                                                                :
00085   fStripArray(strips),
00086   fDetector(Detector::kUnknown),
00087   fRowNum(0)
00088 {
00089     
00090   MSG("ANtpInfoObjectFiller", Msg::kDebug) 
00091     << "ANtpInfoObjectFiller::Constructor" << endl;
00092   
00093 }

ANtpInfoObjectFiller::~ANtpInfoObjectFiller  )  [virtual]
 

Definition at line 96 of file ANtpInfoObjectFiller.cxx.

References MSG.

00097 {
00098   
00099   MSG("ANtpInfoObjectFiller", Msg::kDebug) 
00100     << "ANtpInfoObjectFiller::Destructor" << endl;
00101   
00102 }


Member Function Documentation

void ANtpInfoObjectFiller::FillEventInformation ANtpRecoNtpManipulator ntpManip,
NtpSREvent ntpEvent,
ANtpEventInfo eventInfo
 

Definition at line 339 of file ANtpInfoObjectFiller.cxx.

References NtpSRPlane::beg, ANtpEventInfo::begPlane, NtpSRPlane::end, ANtpEventInfo::endPlane, ANtpEventInfo::energyGeV, FillFiducialInformation(), fStripArray, ANtpRecoNtpManipulator::GetNtpStRecord(), ANtpRecoNtpManipulator::GetReleaseMCType(), NtpSRStripPulseHeight::gev, NtpSREvent::index, ANtpEventInfo::index, NtpSRPlane::n, NtpSREvent::nshower, NtpSREvent::nstrip, NtpSREvent::ntrack, ANtpEventInfo::passStrips, NtpSREvent::ph, NtpSRStrip::plane, NtpSREvent::plane, ANtpEventInfo::planes, ANtpEventInfo::pulseHeight, ANtpEventInfo::Reset(), ANtpEventInfo::showers, NtpSRPulseHeight::sigcor, NtpSREvent::stp, ANtpEventInfo::stripsPerPlane, NtpSRVertex::t, ANtpEventInfo::totalStrips, ANtpEventInfo::tracks, ANtpEventInfo::vertexTime, NtpSREvent::vtx, ANtpEventInfo::vtxX, ANtpEventInfo::vtxY, ANtpEventInfo::vtxZ, NtpSRVertex::x, NtpSRVertex::y, and NtpSRVertex::z.

Referenced by CondensedNtpModule::Ana(), ANtpEventInfoAna::Analyze(), MadAnalysis::CreateANtpPAN(), CondensedNtpModuleAtm::FillEventInformation(), ANtpInfoObjectFillerNC::FillEventInformation(), and ANtpAnalysisInfoAna::FillNueAnalysisInformation().

00342 {
00343 
00344   eventInfo->Reset();
00345   eventInfo->index = static_cast <int> (ntpEvent->index);
00346   eventInfo->pulseHeight = ntpEvent->ph.sigcor;
00347   eventInfo->energyGeV = ntpEvent->ph.gev;
00348   eventInfo->begPlane = ntpEvent->plane.beg;
00349   eventInfo->endPlane = ntpEvent->plane.end;
00350   eventInfo->planes = ntpEvent->plane.n;
00351   
00352   //add up the pulse height in each plane to find the maximum in the event
00353   eventInfo->totalStrips = ntpEvent->nstrip;
00354   
00355   //write your own criterea for whether a strip is good or not
00356   eventInfo->passStrips = ntpEvent->nstrip;
00357   
00358   eventInfo->showers = ntpEvent->nshower;
00359   eventInfo->tracks = ntpEvent->ntrack;
00360 
00361   //Correct cedar vertex bug 
00362   TString reco = ntpManip->GetReleaseMCType();
00363   if(reco.Contains((ReleaseType::AsString(ReleaseType::kCedarData)).c_str()) || 
00364      reco.Contains((ReleaseType::AsString(ReleaseType::kCedarCarrot)).c_str()) ||
00365      reco.Contains((ReleaseType::AsString(ReleaseType::kCedarDaikon)).c_str())){
00366     
00367     NtpVtxFinder::NtpVtxFinder vtxf;
00368     vtxf.SetTargetEvent(static_cast <int> (ntpEvent->index), 
00369                    ntpManip->GetNtpStRecord());
00370     if (vtxf.FindVertex()<0){ //Take existing vertex if fix cannot be used
00371       eventInfo->vtxX = ntpEvent->vtx.x;
00372       eventInfo->vtxY = ntpEvent->vtx.y;
00373       eventInfo->vtxZ = ntpEvent->vtx.z;
00374       eventInfo->vertexTime = ntpEvent->vtx.t;
00375     } else {
00376       eventInfo->vtxX = vtxf.VtxX();
00377       eventInfo->vtxY = vtxf.VtxY();
00378       eventInfo->vtxZ = vtxf.VtxZ();
00379       eventInfo->vertexTime = vtxf.VtxT();
00380     }//if(vtxf.FindVertex())
00381     
00382   } else {
00383     eventInfo->vtxX = ntpEvent->vtx.x;
00384     eventInfo->vtxY = ntpEvent->vtx.y;
00385     eventInfo->vtxZ = ntpEvent->vtx.z;
00386     eventInfo->vertexTime = ntpEvent->vtx.t;
00387   }//if(reco.Contains(...))
00388 
00389   FillFiducialInformation(eventInfo);
00390 
00391   if(!fStripArray) return;
00392 
00393   //loop over the strips in the shower and record which planes they are on
00394   NtpSRStrip *strip = 0;
00395   for(int i = 0; i < eventInfo->totalStrips; ++i){
00396     if (ntpEvent->stp[i] >= 0) strip = dynamic_cast<NtpSRStrip *>
00397                                   (fStripArray->At(ntpEvent->stp[i]));
00398     else continue;
00399     ++eventInfo->stripsPerPlane[strip->plane];
00400   }
00401   
00402   return;
00403 }

void ANtpInfoObjectFiller::FillFiducialInformation ANtpEventInfo eventInfo  )  [protected]
 

Definition at line 512 of file ANtpInfoObjectFiller.cxx.

References fDetector, MetersToBeam(), MetersToCloseEdge(), MetersToCoil(), ANtpEventInfo::vtxMetersToBeam, ANtpEventInfo::vtxMetersToCloseEdge, ANtpEventInfo::vtxMetersToCoil, ANtpEventInfo::vtxX, ANtpEventInfo::vtxY, and ANtpEventInfo::vtxZ.

00513 {
00514   double x = eventInfo->vtxX; 
00515   double y = eventInfo->vtxY;
00516   double z = eventInfo->vtxZ;
00517   
00518   eventInfo->vtxMetersToBeam = MetersToBeam(fDetector, x, y, z); 
00519   eventInfo->vtxMetersToCoil = MetersToCoil(fDetector, x, y); 
00520   eventInfo->vtxMetersToCloseEdge = MetersToCloseEdge(fDetector, x, y, 0);
00521 
00522   return;
00523 }

void ANtpInfoObjectFiller::FillFiducialInformation ANtpTrackInfo trackInfo  )  [protected]
 

Definition at line 491 of file ANtpInfoObjectFiller.cxx.

References ANtpTrackInfo::endMetersToBeam, ANtpTrackInfo::endMetersToCloseEdge, ANtpTrackInfo::endMetersToCoil, ANtpTrackInfo::endX, ANtpTrackInfo::endY, ANtpTrackInfo::endZ, fDetector, MetersToBeam(), MetersToCloseEdge(), MetersToCoil(), ANtpTrackInfo::vtxMetersToBeam, ANtpTrackInfo::vtxMetersToCloseEdge, ANtpTrackInfo::vtxMetersToCoil, ANtpTrackInfo::vtxX, ANtpTrackInfo::vtxY, and ANtpTrackInfo::vtxZ.

Referenced by FillEventInformation(), and FillTrackInformation().

00492 {
00493   double x = trackInfo->vtxX; 
00494   double y = trackInfo->vtxY;
00495   double z = trackInfo->vtxZ;
00496 
00497   trackInfo->vtxMetersToBeam = MetersToBeam(fDetector, x, y, z); 
00498   trackInfo->vtxMetersToCoil = MetersToCoil(fDetector, x, y); 
00499   trackInfo->vtxMetersToCloseEdge = MetersToCloseEdge(fDetector, x,y, 0);
00500   
00501   x = trackInfo->endX; 
00502   y = trackInfo->endY;
00503   z = trackInfo->endZ;
00504 
00505   trackInfo->endMetersToBeam = MetersToBeam(fDetector, x, y, z);
00506   trackInfo->endMetersToCoil = MetersToCoil(fDetector, x, y);
00507   trackInfo->endMetersToCloseEdge = MetersToCloseEdge(fDetector, x, y, 1);
00508   return;
00509 }

void ANtpInfoObjectFiller::FillHeaderInformation ANtpRecoNtpManipulator ntpManip,
Detector::Detector_t  det,
SimFlag::SimFlag_t  dataType,
ANtpHeaderInfo headerInfo
 

Definition at line 113 of file ANtpInfoObjectFiller.cxx.

References AstUtil::CalendarToJulian(), ANtpHeaderInfo::coilCurrent, ANtpHeaderInfo::coilStatus, NtpSRDataQuality::cratemask, ANtpHeaderInfo::crateMask, ANtpHeaderInfo::dataType, ANtpHeaderInfo::day, ANtpHeaderInfo::detector, ANtpHeaderInfo::events, fRowNum, fStripArray, fVldc, Dcs_Mag_Near::GetCurrent(), BfldDbiCoilState::GetCurrent(), ANtpRecoNtpManipulator::GetDataQuality(), ANtpRecoNtpManipulator::GetDmxStatusInfo(), HvStatusFinder::GetHvStatus(), ANtpRecoNtpManipulator::GetNtpStRecord(), DbiResultPtr< T >::GetNumRows(), ANtpRecoNtpManipulator::GetReleaseMCType(), DbiResultPtr< T >::GetRow(), ANtpRecoNtpManipulator::GetRun(), ANtpRecoNtpManipulator::GetSnarl(), ANtpRecoNtpManipulator::GetSnarlEventSummary(), ANtpRecoNtpManipulator::GetSpillType(), ANtpRecoNtpManipulator::GetSubRun(), ANtpRecoNtpManipulator::GetTriggerSource(), HvStatus::Good(), AstUtil::GSTToLST(), ANtpHeaderInfo::hour, ANtpHeaderInfo::hvStatus, HvStatusFinder::Instance(), DataUtil::IsGoodFDData(), ANtpHeaderInfo::isGoodFDData, LISieve::IsLI(), ANtpHeaderInfo::isLI, CoilTools::IsOK(), CoilTools::IsReverse(), ANtpHeaderInfo::julianDate, AstUtil::JulianToGMST(), ANtpHeaderInfo::localSiderealTime, ANtpHeaderInfo::minute, ANtpHeaderInfo::month, ANtpHeaderInfo::newSnarl, ANtpHeaderInfo::passedDeMux, NtpSRPulseHeight::pe, NtpSRStrip::ph0, NtpSRStrip::ph1, ANtpHeaderInfo::Reset(), ANtpHeaderInfo::run, ANtpHeaderInfo::second, NtpSRPulseHeight::sigcor, ANtpHeaderInfo::slices, ANtpHeaderInfo::snarl, ANtpHeaderInfo::snarlPE, ANtpHeaderInfo::snarlPulseHeight, ANtpHeaderInfo::snarlPulseHeight2PE, ANtpHeaderInfo::sntpRow, ANtpHeaderInfo::softVersion, ANtpHeaderInfo::spillType, ANtpHeaderInfo::subRun, ANtpHeaderInfo::triggerPMTTime, ANtpHeaderInfo::triggerSource, ANtpHeaderInfo::triggerTime, ANtpHeaderInfo::utc, and ANtpHeaderInfo::year.

Referenced by CondensedNtpModuleNC::Ana(), CondensedNtpModuleAtm::Ana(), and CondensedNtpModule::Ana().

00117 {
00118   const NtpSREventSummary& summary(ntpManip->GetSnarlEventSummary());
00119 
00120   headerInfo->Reset();
00121   
00122   headerInfo->detector = (int)det;
00123   headerInfo->dataType = (int)dataType;
00124   headerInfo->run = ntpManip->GetRun();
00125   headerInfo->subRun = ntpManip->GetSubRun();
00126   headerInfo->snarl = ntpManip->GetSnarl();
00127   //always call it a new snarl because this method is called once per record
00128   //reset the value in the loop over events in the module
00129   headerInfo->newSnarl = 1; 
00130   headerInfo->triggerSource = ntpManip->GetTriggerSource();
00131   headerInfo->spillType = ntpManip->GetSpillType();
00132   headerInfo->events = summary.nevent;
00133   headerInfo->slices = summary.nslice;
00134   headerInfo->year = (int)summary.date.year;
00135   headerInfo->month = (int)summary.date.month;
00136   headerInfo->day = (int)summary.date.day;
00137   headerInfo->hour = (int)summary.date.hour;
00138   headerInfo->minute = (int)summary.date.minute;
00139   headerInfo->second = summary.date.sec;
00140   headerInfo->utc = summary.date.utc;
00141 
00142   double longitude = AstUtil::kFarDetLongitude;
00143   if(det == Detector::kNear) longitude = AstUtil::kNearDetLongitude;
00144   double gmst = 0.;
00145   double hour = 1.*headerInfo->hour + 1.*headerInfo->minute/60. + headerInfo->second/3600.;
00146   AstUtil::CalendarToJulian(headerInfo->year, headerInfo->month, 
00147                             headerInfo->day, hour, headerInfo->julianDate);
00148   AstUtil::JulianToGMST(headerInfo->julianDate, gmst);
00149   AstUtil::GSTToLST(gmst, longitude, headerInfo->localSiderealTime);
00150 
00151   headerInfo->snarlPulseHeight = summary.ph.sigcor;     
00152   headerInfo->triggerPMTTime = summary.litime;
00153   headerInfo->triggerTime = summary.trigtime;
00154   headerInfo->passedDeMux = 1;
00155   headerInfo->crateMask = ntpManip->GetDataQuality().cratemask;
00156   headerInfo->isGoodFDData = (int)DataUtil::IsGoodFDData(ntpManip->GetNtpStRecord());
00157 
00158   //......................................................................
00159   //Now fill new data members
00160   headerInfo->snarlPE = summary.ph.pe;
00161   headerInfo->sntpRow = fRowNum++;
00162   headerInfo->isLI = LISieve::IsLI( *(ntpManip->GetNtpStRecord()) );
00163 
00164   //......................................................................
00165   //Fill Release type member
00166   headerInfo->softVersion = ntpManip->GetReleaseMCType();
00167   
00168   //Passed DeMux flag
00169   if(det == Detector::kFar) {
00170     const NtpSRDmxStatus& dmx( ntpManip->GetDmxStatusInfo());
00171     if (dmx.ismultimuon || dmx.validplanesfail) headerInfo->passedDeMux = 0;
00172   }
00173   
00174   //loop over the strips to figure out the 
00175   double ph2pe = 0.;
00176   double ph = 0.;
00177   NtpSRStrip *strip = 0;
00178   for(int i = 0; i < fStripArray->GetLast()+1; ++i){
00179     strip = dynamic_cast<NtpSRStrip *>(fStripArray->At(i));
00180     ph = strip->ph0.pe+strip->ph1.pe;
00181     if(ph > 2.) ph2pe += strip->ph0.sigcor + strip->ph1.sigcor;
00182   }
00183   headerInfo->snarlPulseHeight2PE = ph2pe;
00184     
00185   //figure out the coil status
00186   headerInfo->coilStatus = 0;
00187 
00188   //coil is always on in the MC
00189   if(dataType == SimFlag::kMC){
00190     headerInfo->coilStatus = 1;
00191     return;
00192   }
00193 
00194   //get the appropriate context
00195   VldTimeStamp timeStamp(summary.date.year, summary.date.month, 
00196                          summary.date.day, summary.date.hour, 
00197                          summary.date.minute, 
00198                          TMath::Nint(summary.date.sec));
00199   fVldc = VldContext(det, dataType, timeStamp);
00200 
00201   //check out the HV status of the detector - only works for 
00202   //far detector currently
00203   if(det == Detector::kFar){
00204     HvStatus::HvStatus_t hv = 
00205       HvStatusFinder::Instance().GetHvStatus(fVldc,60,1);
00206     headerInfo->hvStatus = (int)HvStatus::Good(hv);
00207     //   MSG("ANtpInfoObjectFiller", Msg::kInfo) << HvStatus::Good(hv)
00208     //                                    << " " 
00209     //                                    << headerInfo->hvStatus
00210     //                                    << endl;
00211   }
00212 
00213   //CoilTools allows for generic access of the database - no 
00214   //detector dependent stuff needed by user
00215   if( CoilTools::IsReverse(fVldc) ) headerInfo->coilStatus = -1;
00216   else headerInfo->coilStatus = 1;
00217   
00218   if( !CoilTools::IsOK(fVldc) ) headerInfo->coilStatus = 0;
00219 
00220   if(det == Detector::kFar){
00221     DbiResultPtr<BfldDbiCoilState> coilTable(fVldc);
00222 
00223     for(UInt_t i = 0; i < coilTable.GetNumRows(); ++i){
00224       const BfldDbiCoilState *coilState = coilTable.GetRow(i);
00225       if(i == 0)
00226         headerInfo->coilCurrent = coilState->GetCurrent();
00227     }
00228 
00229 
00230   }//end if far
00231   else if(det == Detector::kNear){
00232     DbiResultPtr<Dcs_Mag_Near> nearTable(fVldc);
00233 
00234     //get the status of the coils
00235     if(nearTable.GetNumRows() > 0){
00236       
00237       const Dcs_Mag_Near *coilCurrent = nearTable.GetRow(0);
00238       headerInfo->coilCurrent = coilCurrent->GetCurrent();
00239     }
00240 
00241   }
00242 
00243   return;
00244 }

void ANtpInfoObjectFiller::FillMCTruthInformation NtpMCTruth ntpMCTruth,
ANtpTruthInfo truthInfo
 

Definition at line 407 of file ANtpInfoObjectFiller.cxx.

References ANtpTruthInfo::hadronicY, NtpMCTruth::iaction, ANtpTruthInfo::interactionType, NtpMCTruth::inu, ANtpTruthInfo::leptonDCosX, ANtpTruthInfo::leptonDCosY, ANtpTruthInfo::leptonDCosZ, ANtpTruthInfo::leptonMomentum, ANtpTruthInfo::nuDCosX, ANtpTruthInfo::nuDCosY, ANtpTruthInfo::nuDCosZ, ANtpTruthInfo::nuEnergy, ANtpTruthInfo::nuFlavor, ANtpTruthInfo::nuVtxX, ANtpTruthInfo::nuVtxY, ANtpTruthInfo::nuVtxZ, NtpMCTruth::p4el1, NtpMCTruth::p4mu1, NtpMCTruth::p4neu, NtpMCTruth::p4shw, NtpMCTruth::p4tau, NtpMCTruth::p4tgt, ANtpTruthInfo::Reset(), ANtpTruthInfo::showerDCosX, ANtpTruthInfo::showerDCosY, ANtpTruthInfo::showerDCosZ, ANtpTruthInfo::showerEnergy, ANtpTruthInfo::targetEnergy, ANtpTruthInfo::targetPX, ANtpTruthInfo::targetPY, ANtpTruthInfo::targetPZ, NtpMCTruth::vtxx, NtpMCTruth::vtxy, NtpMCTruth::vtxz, and NtpMCTruth::y.

Referenced by CondensedNtpModule::Ana(), ANtpTruthInfoBeamAna::Analyze(), MadAnalysis::CreateANtpPAN(), CondensedNtpModuleAtm::FillMCInformation(), ANtpInfoObjectFillerNC::FillMCInformation(), and CondensedNtpModule::FillUnRecoedMCInformation().

00409 {
00410   const Float_t muMass = 0.105658357; //mu mass in GeV/c
00411   const Float_t eMass = 0.000510999; //e mass in GeV/c
00412   const Float_t tauMass = 1.777;      //tau mass in GeV/c
00413 
00414   truthInfo->Reset();
00415   truthInfo->nuEnergy = ntpMCTruth->p4neu[3];
00416   truthInfo->nuVtxX = ntpMCTruth->vtxx;
00417   truthInfo->nuVtxY = ntpMCTruth->vtxy;
00418   truthInfo->nuVtxZ = ntpMCTruth->vtxz;
00419   if(TMath::Abs(truthInfo->nuEnergy) > 0.){
00420     truthInfo->nuDCosX = ntpMCTruth->p4neu[0]/TMath::Sqrt(truthInfo->nuEnergy*truthInfo->nuEnergy);
00421     truthInfo->nuDCosY = ntpMCTruth->p4neu[1]/TMath::Sqrt(truthInfo->nuEnergy*truthInfo->nuEnergy);
00422     truthInfo->nuDCosZ = ntpMCTruth->p4neu[2]/TMath::Sqrt(truthInfo->nuEnergy*truthInfo->nuEnergy);             
00423   }
00424   else{
00425     truthInfo->nuDCosX = -10000.;
00426     truthInfo->nuDCosY = -10000.;
00427     truthInfo->nuDCosZ = -10000.;
00428   }
00429   truthInfo->nuFlavor = ntpMCTruth->inu;
00430   truthInfo->interactionType = ntpMCTruth->iaction;
00431   
00432   truthInfo->targetEnergy = ntpMCTruth->p4tgt[3];
00433   truthInfo->targetPX = ntpMCTruth->p4tgt[0];
00434   truthInfo->targetPY = ntpMCTruth->p4tgt[1];
00435   truthInfo->targetPZ = ntpMCTruth->p4tgt[2];
00436   
00437   truthInfo->hadronicY = ntpMCTruth->y;
00438   
00439   truthInfo->showerEnergy = 0.;
00440   float showerMomentumSqr = 0.;
00441   if(ntpMCTruth->p4shw[3]>0. && TMath::Abs(ntpMCTruth->p4shw[0] + 
00442                                            ntpMCTruth->p4shw[1] + 
00443                                            ntpMCTruth->p4shw[2]) > 0.){
00444     truthInfo->showerEnergy = ntpMCTruth->p4shw[3];
00445     showerMomentumSqr = ntpMCTruth->p4shw[0]*ntpMCTruth->p4shw[0];
00446     showerMomentumSqr += ntpMCTruth->p4shw[1]*ntpMCTruth->p4shw[1];
00447     showerMomentumSqr += ntpMCTruth->p4shw[2]*ntpMCTruth->p4shw[2];
00448     truthInfo->showerDCosX = ntpMCTruth->p4shw[0]/TMath::Sqrt(showerMomentumSqr);
00449     truthInfo->showerDCosY = ntpMCTruth->p4shw[1]/TMath::Sqrt(showerMomentumSqr);
00450     truthInfo->showerDCosZ = ntpMCTruth->p4shw[2]/TMath::Sqrt(showerMomentumSqr);
00451   }
00452   else{
00453     truthInfo->showerDCosX = ANtpDefVal::kFloat;
00454     truthInfo->showerDCosY = ANtpDefVal::kFloat;
00455     truthInfo->showerDCosZ = ANtpDefVal::kFloat;
00456   }
00457   
00458   truthInfo->leptonMomentum = 0.;
00459   if(TMath::Abs(ntpMCTruth->p4mu1[3])>muMass){
00460     truthInfo->leptonMomentum = TMath::Sqrt(ntpMCTruth->p4mu1[3]*ntpMCTruth->p4mu1[3] - muMass*muMass);
00461     truthInfo->leptonDCosX = ntpMCTruth->p4mu1[0]/truthInfo->leptonMomentum;
00462     truthInfo->leptonDCosY = ntpMCTruth->p4mu1[1]/truthInfo->leptonMomentum;
00463     truthInfo->leptonDCosZ = ntpMCTruth->p4mu1[2]/truthInfo->leptonMomentum;            
00464     if(ntpMCTruth->p4mu1[3]<0.) truthInfo->leptonMomentum *= -1.;
00465   }
00466   else if(TMath::Abs(ntpMCTruth->p4el1[3])>eMass){
00467     truthInfo->leptonMomentum = TMath::Sqrt(ntpMCTruth->p4el1[3]*ntpMCTruth->p4el1[3] - eMass*eMass);
00468     truthInfo->leptonDCosX = ntpMCTruth->p4el1[0]/truthInfo->leptonMomentum;
00469     truthInfo->leptonDCosY = ntpMCTruth->p4el1[1]/truthInfo->leptonMomentum;
00470     truthInfo->leptonDCosZ = ntpMCTruth->p4el1[2]/truthInfo->leptonMomentum;            
00471     if(ntpMCTruth->p4el1[3]<0.) truthInfo->leptonMomentum *= -1.;
00472   }
00473   else if(TMath::Abs(ntpMCTruth->p4tau[3])>tauMass){
00474     truthInfo->leptonMomentum = TMath::Sqrt(ntpMCTruth->p4tau[3]*ntpMCTruth->p4tau[3] - tauMass*tauMass);
00475     truthInfo->leptonDCosX = ntpMCTruth->p4tau[0]/truthInfo->leptonMomentum;
00476     truthInfo->leptonDCosY = ntpMCTruth->p4tau[1]/truthInfo->leptonMomentum;
00477     truthInfo->leptonDCosZ = ntpMCTruth->p4tau[2]/truthInfo->leptonMomentum;            
00478     if(ntpMCTruth->p4tau[3]<0.) truthInfo->leptonMomentum *= -1.;
00479   }
00480   else{
00481     truthInfo->leptonDCosX = ANtpDefVal::kFloat;
00482     truthInfo->leptonDCosY = ANtpDefVal::kFloat;
00483     truthInfo->leptonDCosZ = ANtpDefVal::kFloat;                
00484   }
00485     
00486   
00487   return;
00488 }

void ANtpInfoObjectFiller::FillShowerInformation NtpSRShower ntpShower,
ANtpShowerInfo showerInfo
 

Definition at line 307 of file ANtpInfoObjectFiller.cxx.

References NtpSRPlane::beg, ANtpShowerInfo::begPlane, NtpSRVertex::dcosx, ANtpShowerInfo::dcosX, NtpSRVertex::dcosy, ANtpShowerInfo::dcosY, NtpSRVertex::dcosz, ANtpShowerInfo::dcosZ, ANtpShowerInfo::deweightCCGeV, ANtpShowerInfo::deweightNCGeV, NtpSRPlane::end, ANtpShowerInfo::endPlane, fStripArray, NtpSRShowerPulseHeight::linCCgev, ANtpShowerInfo::linearCCGeV, ANtpShowerInfo::linearNCGeV, NtpSRShowerPulseHeight::linNCgev, NtpSRPlane::n, NtpSRShower::nstrip, NtpSRShower::ph, NtpSRStrip::plane, NtpSRShower::plane, ANtpShowerInfo::planes, ANtpShowerInfo::pulseHeight, ANtpShowerInfo::Reset(), NtpSRShower::shwph, NtpSRPulseHeight::sigcor, NtpSRShower::stp, ANtpShowerInfo::stripsPerPlane, ANtpShowerInfo::totalStrips, NtpSRShower::vtx, ANtpShowerInfo::vtxX, ANtpShowerInfo::vtxY, ANtpShowerInfo::vtxZ, NtpSRShowerPulseHeight::wtCCgev, NtpSRShowerPulseHeight::wtNCgev, NtpSRVertex::x, NtpSRVertex::y, and NtpSRVertex::z.

Referenced by CondensedNtpModule::Ana(), ANtpShowerInfoAna::Analyze(), MadAnalysis::CreateANtpPAN(), ANtpAnalysisInfoAna::FillNueAnalysisInformation(), and ANtpInfoObjectFillerNC::FillShowerInformation().

00309 {
00310   showerInfo->Reset();
00311   showerInfo->planes = ntpShower->plane.n;
00312   showerInfo->totalStrips = ntpShower->nstrip;
00313   showerInfo->begPlane = ntpShower->plane.beg;
00314   showerInfo->endPlane = ntpShower->plane.end;
00315   showerInfo->vtxX = ntpShower->vtx.x;
00316   showerInfo->vtxY = ntpShower->vtx.y;
00317   showerInfo->vtxZ = ntpShower->vtx.z;
00318   showerInfo->dcosX = ntpShower->vtx.dcosx;
00319   showerInfo->dcosY = ntpShower->vtx.dcosy;
00320   showerInfo->dcosZ = ntpShower->vtx.dcosz;
00321   showerInfo->pulseHeight = ntpShower->ph.sigcor;//used to be sigmap
00322   showerInfo->linearCCGeV = ntpShower->shwph.linCCgev;
00323   showerInfo->linearNCGeV = ntpShower->shwph.linNCgev;
00324   showerInfo->deweightCCGeV = ntpShower->shwph.wtCCgev;
00325   showerInfo->deweightNCGeV = ntpShower->shwph.wtNCgev;
00326 
00327   //loop over the strips in the shower and record which planes they are on
00328   NtpSRStrip *strip = 0;
00329   for(int i = 0; i < showerInfo->totalStrips; ++i){
00330     strip = dynamic_cast<NtpSRStrip *>(fStripArray->At(ntpShower->stp[i]));
00331     ++showerInfo->stripsPerPlane[strip->plane];
00332   }
00333   
00334   return;
00335 }

void ANtpInfoObjectFiller::FillTrackInformation NtpSRTrack ntpTrack,
ANtpTrackInfo trackInfo
 

Definition at line 248 of file ANtpInfoObjectFiller.cxx.

References NtpSRTrackTime::backwardRMS, ANtpTrackInfo::backwardRMS, NtpSRPlane::beg, ANtpTrackInfo::begPlane, ANtpTrackInfo::begPlaneU, ANtpTrackInfo::begPlaneV, NtpSRPlane::begu, NtpSRPlane::begv, NtpSRFitTrack::chi2, NtpSRVertex::dcosx, ANtpTrackInfo::dcosXEnd, ANtpTrackInfo::dcosXVtx, NtpSRVertex::dcosy, ANtpTrackInfo::dcosYEnd, ANtpTrackInfo::dcosYVtx, NtpSRVertex::dcosz, ANtpTrackInfo::dcosZEnd, ANtpTrackInfo::dcosZVtx, NtpSRTrack::ds, NtpSRTrack::end, NtpSRPlane::end, ANtpTrackInfo::endPlane, ANtpTrackInfo::endPlaneU, ANtpTrackInfo::endPlaneV, NtpSRPlane::endu, NtpSRPlane::endv, ANtpTrackInfo::endX, ANtpTrackInfo::endY, ANtpTrackInfo::endZ, NtpSRMomentum::eqp, FillFiducialInformation(), NtpSRTrack::fit, ANtpTrackInfo::fitMomentum, NtpSRTrackTime::forwardRMS, ANtpTrackInfo::forwardRMS, fStripArray, GetTrackTrace(), ANtpTrackInfo::length, NtpSRTrack::momentum, NtpSRPlane::n, NtpSRFitTrack::ndof, NtpSRTrack::nstrip, NtpSRFitTrack::pass, ANtpTrackInfo::passedFit, NtpSRTrack::ph, NtpSRStrip::plane, NtpSRTrack::plane, ANtpTrackInfo::planes, ANtpTrackInfo::pulseHeight, NtpSRMomentum::qp, NtpSRMomentum::range, ANtpTrackInfo::rangeMomentum, ANtpTrackInfo::reducedChi2, ANtpTrackInfo::Reset(), NtpSRPulseHeight::sigcor, ANtpTrackInfo::sigmaQoverP, NtpSRTrack::stp, ANtpTrackInfo::stripsPerPlane, NtpSRTrack::time, ANtpTrackInfo::totalStrips, NtpSRTrack::vtx, ANtpTrackInfo::vtxX, ANtpTrackInfo::vtxY, ANtpTrackInfo::vtxZ, NtpSRVertex::x, NtpSRVertex::y, and NtpSRVertex::z.

Referenced by CondensedNtpModule::Ana(), ANtpTrackInfoAna::Analyze(), MadAnalysis::CreateANtpPAN(), ANtpAnalysisInfoAna::FillNueAnalysisInformation(), CondensedNtpModuleAtm::FillTrackInformation(), and ANtpInfoObjectFillerNC::FillTrackInformation().

00250 {
00251   
00252   trackInfo->Reset();
00253   trackInfo->planes = ntpTrack->plane.n;
00254   trackInfo->totalStrips = ntpTrack->nstrip;
00255   trackInfo->pulseHeight = ntpTrack->ph.sigcor;
00256   if(TMath::Abs(ntpTrack->momentum.qp) > 0.) 
00257     trackInfo->fitMomentum = (1./ntpTrack->momentum.qp);
00258   trackInfo->sigmaQoverP = ntpTrack->momentum.eqp;
00259   trackInfo->rangeMomentum = ntpTrack->momentum.range;                            
00260   trackInfo->begPlane = ntpTrack->plane.beg;
00261   trackInfo->endPlane = ntpTrack->plane.end;
00262   trackInfo->begPlaneU = ntpTrack->plane.begu;
00263   trackInfo->endPlaneU = ntpTrack->plane.endu;
00264   trackInfo->begPlaneV = ntpTrack->plane.begv;
00265   trackInfo->endPlaneV = ntpTrack->plane.endv;
00266   trackInfo->length = ntpTrack->ds;
00267   trackInfo->vtxX = ntpTrack->vtx.x; 
00268   trackInfo->vtxY = ntpTrack->vtx.y; 
00269   trackInfo->vtxZ = ntpTrack->vtx.z; 
00270   trackInfo->dcosXVtx = ntpTrack->vtx.dcosx;
00271   trackInfo->dcosYVtx = ntpTrack->vtx.dcosy;
00272   trackInfo->dcosZVtx = ntpTrack->vtx.dcosz;
00273   trackInfo->endX = ntpTrack->end.x; 
00274   trackInfo->endY = ntpTrack->end.y; 
00275   trackInfo->endZ = ntpTrack->end.z; 
00276   trackInfo->dcosXEnd = ntpTrack->end.dcosx;
00277   trackInfo->dcosYEnd = ntpTrack->end.dcosy;
00278   trackInfo->dcosZEnd = ntpTrack->end.dcosz;
00279   trackInfo->passedFit = 0;
00280   if(ntpTrack->fit.pass) trackInfo->passedFit = 1;
00281   trackInfo->reducedChi2 = ntpTrack->fit.chi2;
00282   if(ntpTrack->fit.ndof>0.) 
00283     trackInfo->reducedChi2 /= 1.*ntpTrack->fit.ndof;
00284 
00285   trackInfo->forwardRMS = ntpTrack->time.forwardRMS;
00286   trackInfo->backwardRMS = ntpTrack->time.backwardRMS;
00287 
00288     GetTrackTrace(ntpTrack, trackInfo, -1);
00289   GetTrackTrace(ntpTrack, trackInfo, 1);
00290 
00291   FillFiducialInformation(trackInfo);
00292 
00293   //loop over the strips in the track and record which planes they are on
00294   NtpSRStrip *strip = 0;
00295   for(int i = 0; i < trackInfo->totalStrips; ++i){
00296     if (ntpTrack->stp[i] >=0) strip = dynamic_cast<NtpSRStrip *>
00297                                 (fStripArray->At(ntpTrack->stp[i]));
00298     else continue;
00299     ++trackInfo->stripsPerPlane[strip->plane];
00300   }
00301     
00302   return;
00303 }

void ANtpInfoObjectFiller::GetTrackTrace NtpSRTrack ntpTrack,
ANtpTrackInfo trackInfo,
Int_t  direction
[private]
 

Definition at line 551 of file ANtpInfoObjectFiller.cxx.

References NtpSRVertex::dcosu, NtpSRVertex::dcosv, NtpSRVertex::dcosx, NtpSRVertex::dcosy, NtpSRVertex::dcosz, NtpSRTrack::end, kInverseSqrt2, Sqr(), ANtpTrackInfo::traceEnd, ANtpTrackInfo::traceEndZ, ANtpTrackInfo::traceVtx, ANtpTrackInfo::traceVtxZ, NtpSRVertex::u, NtpSRVertex::v, NtpSRTrack::vtx, NtpSRVertex::x, NtpSRVertex::y, and NtpSRVertex::z.

Referenced by FillTrackInformation().

00554 {
00555   
00556   //get the trace for the track - this is very far detector centric for now,
00557   //adapted from C. Howcroft's code
00558   
00559   //direction tells you whether to trace back from vertex (-1) or forward from end (1)
00560   
00561   //side is as labeled below
00562   /*
00563              0
00564           --------
00565        7 /        \ 1
00566         /   y|     \
00567      6 |     |      | 2
00568        |     ----   |
00569       5 \      x   / 3
00570          \        /
00571           --------
00572               4
00573   */  
00574   double dcos[3] = {direction*ntpTrack->vtx.dcosx,
00575                     direction*ntpTrack->vtx.dcosy,
00576                     direction*ntpTrack->vtx.dcosz}; 
00577   double dcosUV[3] = {direction*ntpTrack->vtx.dcosu,
00578                       direction*ntpTrack->vtx.dcosv,
00579                       direction*ntpTrack->vtx.dcosz}; 
00580   double endPointXY[3] = {ntpTrack->vtx.x, ntpTrack->vtx.y, ntpTrack->vtx.z};
00581   double endPointUV[3] = {ntpTrack->vtx.u, ntpTrack->vtx.v, ntpTrack->vtx.z};
00582   
00583   if(direction > 0){
00584     endPointXY[0] = ntpTrack->end.x;
00585     endPointXY[1] = ntpTrack->end.y;
00586     endPointXY[2] = ntpTrack->end.z;
00587     endPointUV[0] = ntpTrack->end.u;
00588     endPointUV[1] = ntpTrack->end.v;
00589     endPointUV[2] = ntpTrack->end.z;
00590     dcos[0] = ntpTrack->end.dcosx;
00591     dcos[1] = ntpTrack->end.dcosy;
00592     dcos[2] = ntpTrack->end.dcosz;
00593     dcosUV[0] = ntpTrack->end.dcosu;
00594     dcosUV[1] = ntpTrack->end.dcosv;
00595     dcosUV[2] = ntpTrack->end.dcosz;
00596   }
00597   
00598   int side = -1;
00599   double xzproj[2]={-999., -999.};   
00600   double entry[3] = {0.};
00601   double minpath = 99e99;
00602   double tmppath = 0.;
00603   double maxDetectorY = 4.;
00604   double sidelength = kFarSideLength;
00605   
00606   if(TMath::IsNaN(endPointUV[0]) || TMath::IsNaN(endPointUV[1]) 
00607      || TMath::IsNaN(dcosUV[0]) || TMath::IsNaN(dcosUV[1]) 
00608      || TMath::IsNaN(dcos[2])) return;
00609   
00610   if(TMath::Abs(dcos[1])>1.e-6){ 
00611     // Y - SIDES
00612     //SIDE 0 
00613     xzproj[0] = endPointXY[0] + (dcos[0]/dcos[1])*(maxDetectorY - endPointXY[1]);
00614     xzproj[1] = endPointXY[2] + (dcos[2]/dcos[1])*(maxDetectorY - endPointXY[1]);
00615     if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] -  endPointXY[2])*dcos[2]) > 0.0){
00616       tmppath = Sqr(endPointXY[0] - xzproj[0]) 
00617               + Sqr(endPointXY[1] - maxDetectorY) 
00618               + Sqr(endPointXY[2] - xzproj[1]);
00619       if(TMath::Finite(tmppath)){
00620         tmppath = TMath::Sqrt(tmppath);
00621         if(tmppath < minpath){
00622           minpath  = tmppath;
00623           entry[0] = xzproj[0];
00624           entry[2] = xzproj[1];
00625           entry[1] = maxDetectorY;
00626           side     = 0;
00627         }                       
00628       }      
00629     }//end side 0
00630     //SIDE 4 
00631     xzproj[0] = endPointXY[0] + (dcos[0]/dcos[1])*(-maxDetectorY - endPointXY[1]);
00632     xzproj[1] = endPointXY[2] + (dcos[2]/dcos[1])*(-maxDetectorY - endPointXY[1]);
00633     if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] -  endPointXY[2])*dcos[2]) > 0.0){
00634       tmppath = Sqr(endPointXY[0] - xzproj[0]) 
00635               + Sqr(endPointXY[1] + maxDetectorY) 
00636               + Sqr(endPointXY[2] - xzproj[1]);
00637       if(TMath::Finite(tmppath)){
00638         tmppath = TMath::Sqrt(tmppath);
00639         if(tmppath<minpath){
00640           minpath  = tmppath;
00641           entry[0] = xzproj[0];
00642           entry[2] = xzproj[1];
00643           entry[1] = -maxDetectorY;
00644           side     = 4;
00645         }                       
00646       }      
00647     }//end side 4
00648   }//end Y sides
00649   if(TMath::Abs(dcos[0])>1e-6){  // X - SIDES
00650     //SIDE 2 
00651     xzproj[0] = endPointXY[1] + (dcos[1]/dcos[0])*(maxDetectorY - endPointXY[0]);
00652     xzproj[1] = endPointXY[2] + (dcos[2]/dcos[0])*(maxDetectorY - endPointXY[0]);
00653     if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] -  endPointXY[2])*dcos[2]) > 0.0){
00654       tmppath = (endPointXY[1] - xzproj[0])    * (endPointXY[1] - xzproj[0]) 
00655               + (endPointXY[0] - maxDetectorY) * (endPointXY[0] - maxDetectorY) 
00656               + (endPointXY[2] - xzproj[1])    * (endPointXY[2] - xzproj[1]);
00657       if(TMath::Finite(tmppath)){
00658         tmppath = TMath::Sqrt(tmppath);
00659         if(tmppath<minpath){
00660           minpath  = tmppath;
00661           entry[1] = xzproj[0];
00662           entry[2] = xzproj[1];
00663           entry[0] = maxDetectorY;
00664           side     = 2;
00665         }               
00666       }       
00667     }//end side 2      
00668     //SIDE 6 
00669     xzproj[0] = endPointXY[1] + (dcos[1]/dcos[0])*(-maxDetectorY - endPointXY[0]);
00670     xzproj[1] = endPointXY[2] + (dcos[2]/dcos[0])*(-maxDetectorY - endPointXY[0]);
00671     if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] -  endPointXY[2])*dcos[2]) > 0.0){
00672       tmppath = Sqr(endPointXY[1] - xzproj[0]) 
00673               + Sqr(endPointXY[0] + maxDetectorY) 
00674               + Sqr(endPointXY[2] - xzproj[1]);
00675       if(TMath::Finite(tmppath)){
00676         tmppath = TMath::Sqrt(tmppath);
00677         if(tmppath<minpath){
00678           minpath  = tmppath;
00679           entry[1] = xzproj[0];
00680           entry[2] = xzproj[1];
00681           entry[0] = -maxDetectorY;
00682           side     = 6;
00683         }
00684       }                       
00685     }//end if side 6      
00686   }//end x sides
00687   if(TMath::Abs(dcosUV[0])>1.e-6){  // U - SIDES
00688     //SIDE 1 
00689     xzproj[0] = endPointUV[1] + (dcosUV[1]/dcosUV[0])*(maxDetectorY - endPointUV[0]);
00690     xzproj[1] = endPointXY[2] + (dcos[2]/dcosUV[0])*(maxDetectorY - endPointUV[0]);
00691     if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] -  endPointXY[2])*dcos[2]) > 0.0){
00692       tmppath = Sqr(ntpTrack->vtx.v - xzproj[0]) 
00693               + Sqr(ntpTrack->vtx.u - maxDetectorY) 
00694               + Sqr(endPointXY[2] - xzproj[1]);
00695       if(TMath::Finite(tmppath)){
00696         tmppath = TMath::Sqrt(tmppath);
00697         if(tmppath<minpath){
00698           minpath  = tmppath;
00699           entry[0] = kInverseSqrt2*(maxDetectorY - xzproj[0]) ;
00700           entry[2] = xzproj[1];
00701           entry[1] = kInverseSqrt2*(maxDetectorY + xzproj[0]) ;
00702           side     = 1;
00703         }                       
00704       }      
00705     }//end if side1 
00706     //SIDE 5 
00707     xzproj[0] = endPointUV[1] + (dcosUV[1]/dcosUV[0])*(-maxDetectorY - endPointUV[0]);
00708     xzproj[1] = endPointXY[2] + (dcos[2]/dcosUV[0])*(-maxDetectorY - endPointUV[0]);
00709     if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] -  endPointXY[2])*dcos[2]) > 0.0){
00710       tmppath = Sqr(ntpTrack->vtx.v - xzproj[0]) 
00711               + Sqr(ntpTrack->vtx.u + maxDetectorY) 
00712               + Sqr(endPointXY[2] - xzproj[1]);
00713       if(TMath::Finite(tmppath)){
00714         tmppath = TMath::Sqrt(tmppath);
00715         if(tmppath<minpath){
00716           minpath  = tmppath;
00717           entry[0] = kInverseSqrt2*(-maxDetectorY - xzproj[0]) ;
00718           entry[2] = xzproj[1];
00719           entry[1] = kInverseSqrt2*(-maxDetectorY + xzproj[0]) ;
00720           side     = 5;
00721         }                             
00722       }
00723     }//end if side 5 
00724   }//end u sides
00725   if(TMath::Abs(dcosUV[1])>1.e-6){  // V - SIDES
00726     //SIDE 7
00727     xzproj[0] = endPointUV[0] + (dcosUV[0]/dcosUV[1])*(maxDetectorY - endPointUV[1]);
00728     xzproj[1] = endPointXY[2] + (dcos[2]/dcosUV[1])*(maxDetectorY - endPointUV[1]);
00729     if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] -  endPointXY[2])*dcos[2]) > 0.0){
00730       tmppath =  Sqr(ntpTrack->vtx.u - xzproj[0]) 
00731               + Sqr(ntpTrack->vtx.v - maxDetectorY) 
00732               + Sqr(endPointXY[2] - xzproj[1]);
00733       if(TMath::Finite(tmppath)){
00734         tmppath = TMath::Sqrt ( tmppath);
00735         if(tmppath<minpath){
00736           minpath  = tmppath;
00737           entry[0] = kInverseSqrt2*(xzproj[0]-maxDetectorY) ;
00738           entry[2] = xzproj[1];
00739           entry[1] = kInverseSqrt2*(xzproj[0]+maxDetectorY) ;
00740           side     = 7;
00741         }                       
00742       }      
00743     }//end if side7
00744     //SIDE 3
00745     xzproj[0] = endPointUV[0] + (dcosUV[0]/dcosUV[1])*(-maxDetectorY - endPointUV[1]);
00746     xzproj[1] = endPointXY[2] + (dcos[2]/dcosUV[1])*(-maxDetectorY - endPointUV[1]);
00747     if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] -  endPointXY[2])*dcos[2]) > 0.0){
00748       tmppath = Sqr(ntpTrack->vtx.u - xzproj[0]) 
00749               + Sqr(ntpTrack->vtx.v + maxDetectorY) 
00750               + Sqr(endPointXY[2] - xzproj[1]);
00751       if(TMath::Finite(tmppath)){
00752         tmppath = TMath::Sqrt(tmppath);
00753         if(tmppath<minpath){
00754           minpath  = tmppath;
00755           entry[0] = kInverseSqrt2*(xzproj[0]+maxDetectorY) ;
00756           entry[2] = xzproj[1];
00757           entry[1] = kInverseSqrt2*(xzproj[0]-maxDetectorY) ;
00758           side     = 3;
00759         }                         
00760       }    
00761     }//end if side 3    
00762   }//end v sides
00763   
00764   if(direction < 0){
00765     trackInfo->traceVtx = TMath::Sqrt(Sqr(endPointXY[0]-entry[0]) + Sqr(endPointXY[1]-entry[1])
00766                                       + Sqr(endPointXY[2]-entry[2]));
00767     trackInfo->traceVtxZ = entry[2] - endPointXY[2];
00768     
00769   } 
00770   else if(direction > 0){
00771     trackInfo->traceEnd = TMath::Sqrt(Sqr(ntpTrack->end.x-entry[0]) + Sqr(ntpTrack->end.y-entry[1])
00772                                       + Sqr(ntpTrack->end.z-entry[2]));
00773     trackInfo->traceEndZ = entry[2] - ntpTrack->end.z;
00774     
00775   } 
00776   
00777   return;
00778 }

Float_t ANtpInfoObjectFiller::MetersToBeam Detector::Detector_t  det,
Float_t  x,
Float_t  y,
Float_t  z
 

Definition at line 781 of file ANtpInfoObjectFiller.cxx.

Referenced by ANtpEventInfoAna::Analyze(), and FillFiducialInformation().

00786                      :
00787   // Beam is at x = 1.4485m
00788   // Beam dy/dz = -0.0578 (angle = -3.31deg) to the z-axis 
00789   // Beam passes through y = 0 at back of golden region (plane 90)
00790   //  \-> Beam passes through y = 0.3087 @ z = 0  
00791   // Still looking for hard evidence about this.
00792 {
00793   if (det == Detector::kNear) {
00794     const Float_t dydz(-0.0578); 
00795     const Float_t beamCenterX(1.4885 * Munits::m);
00796     const Float_t beamCenterY0(0.3087 * Munits::m);
00797 
00798     x -= beamCenterX;
00799     y -= beamCenterY0 + dydz * z; 
00800     return TMath::Sqrt(x*x + y*y);
00801   }
00802 
00803   else if (det == Detector::kFar){
00804     //Beam center is faintly meaningless for FD cut
00805     return ANtpDefVal::kFloat;
00806   }
00807 
00808   else return ANtpDefVal::kFloat;
00809 }
//----------------------------------------------------------------------

Float_t ANtpInfoObjectFiller::MetersToCloseEdge Detector::Detector_t  det,
Float_t  x,
Float_t  y,
Bool_t  NDUseFullPlane = 0
 

Definition at line 827 of file ANtpInfoObjectFiller.cxx.

References PlaneOutline::DistanceToOuterEdge(), and PlaneOutline::IsInside().

Referenced by ANtpEventInfoAna::Analyze(), and FillFiducialInformation().

00830 {
00831   // Calculate the distance to the nearest (outside) plane edge
00832   // using the PlaneOutline class. 
00833   // Currently takes distance to nearest edges seperatly for U and V
00834   // views, then takes the average of the two distances.
00835   // It would be better to take a single distance to an average plane
00836   // but this is not yet possible.
00837 
00838   if (det == Detector::kNear || det == Detector::kFar ){
00839     
00840     // Pick a plane coverage
00841     PlaneCoverage::PlaneCoverage_t outline(PlaneCoverage::kComplete);
00842     if (det == Detector::kNear){
00843       if (NDUseFullPlane) outline = PlaneCoverage::kNearFull;
00844       else outline = PlaneCoverage::kNearPartial;
00845     }
00846 
00847     PlaneOutline po;  
00848     
00849     // Calculate distance (to nearest outside edge) in U. 
00850     Float_t distU(0.);
00851     Float_t xedge; Float_t yedge; 
00852     po.DistanceToOuterEdge(x, y, PlaneView::kU, outline,
00853                            distU, xedge, yedge);
00854 
00855     // Calculate distance in V.
00856     Float_t distV(0.);
00857     po.DistanceToOuterEdge(x, y, PlaneView::kV, outline,
00858                            distV, xedge, yedge); 
00859 
00860     // Now work out if the point is inside or outside each outline
00861     // Firstly deal with the coil hole. We consider it inside,
00862     // but the PlaneOutline class calls it outside.
00863     
00864     Bool_t insideU(0.); 
00865     if ( outline != PlaneCoverage::kNearPartial ) {
00866       // circle of radius 1/sqrt(2) will enclose the coilHole, 
00867       // but is itself enclosed by the outer edges
00868       insideU = ( (x*x + y*y) < 0.5 * Munits::m2 );
00869       //cout << "X: " << x << ";   Y: " 
00870       //           << y << ";   inside:" << insideU << endl;
00871     }
00872     
00873     Bool_t insideV(insideU);
00874     if ( !insideU ){ 
00875       insideU = po.IsInside(x, y, PlaneView::kU, outline);
00876       insideV = po.IsInside(x, y, PlaneView::kV, outline);
00877     }
00878     distU *= ( insideU ? 1. : -1. );
00879     distV *= ( insideV ? 1. : -1. );
00880 
00881     //    cout << ">U<: " << insideU << "   " << distU << "\n";
00882     //cout << ">V<: " << insideV << "   " << distV;
00883     
00884     return ( distU + distV ) / 2.;
00885   }  // if ( @ near or far detectors )
00886 
00887   else return ANtpDefVal::kFloat;    
00888 }

Float_t ANtpInfoObjectFiller::MetersToCoil Detector::Detector_t  det,
Float_t  x,
Float_t  y
 

Definition at line 811 of file ANtpInfoObjectFiller.cxx.

Referenced by ANtpEventInfoAna::Analyze(), and FillFiducialInformation().

00813 {
00814   if (det == Detector::kNear){
00815    // Take coil to be at (0,0) Looks about right...  (?) 
00816     return TMath::Sqrt(x*x + y*y);
00817   }
00818 
00819   else if (det == Detector::kFar){
00820     return TMath::Sqrt(x*x + y*y);    
00821   }
00822 
00823   else return ANtpDefVal::kFloat;
00824 }       

void ANtpInfoObjectFiller::SetDetector Detector::Detector_t  detector  ) 
 

Reimplemented in ANtpInfoObjectFillerNC.

Definition at line 105 of file ANtpInfoObjectFiller.cxx.

References fDetector.

Referenced by CondensedNtpModule::BeginJob().

00106 {
00107   fDetector = detector;
00108   return;
00109 }

void ANtpInfoObjectFiller::SetStripArray TClonesArray *  strips  ) 
 

Definition at line 526 of file ANtpInfoObjectFiller.cxx.

References fStripArray.

Referenced by CondensedNtpModuleNC::Ana(), CondensedNtpModuleAtm::Ana(), CondensedNtpModule::Ana(), ANtpTruthInfoBeamAna::Analyze(), ANtpTrackInfoAna::Analyze(), ANtpShowerInfoAna::Analyze(), ANtpEventInfoAna::Analyze(), and ANtpAnalysisInfoAna::Analyze().

00527 {
00528   fStripArray = strips;
00529   return;
00530 }

float ANtpInfoObjectFiller::Sqr float  x  )  [private]
 

Definition at line 545 of file ANtpInfoObjectFiller.cxx.

00546 {
00547   return x*x;
00548 }

int ANtpInfoObjectFiller::Sqr int  x  )  [private]
 

Definition at line 539 of file ANtpInfoObjectFiller.cxx.

00540 {
00541   return x*x;
00542 }

double ANtpInfoObjectFiller::Sqr double  x  )  [private]
 

Definition at line 533 of file ANtpInfoObjectFiller.cxx.

Referenced by GetTrackTrace().

00534 {
00535   return x*x;
00536 }


Member Data Documentation

Detector::Detector_t ANtpInfoObjectFiller::fDetector [protected]
 

Definition at line 79 of file ANtpInfoObjectFiller.h.

Referenced by FillFiducialInformation(), and SetDetector().

Long64_t ANtpInfoObjectFiller::fRowNum [private]
 

Definition at line 90 of file ANtpInfoObjectFiller.h.

Referenced by FillHeaderInformation().

TClonesArray* ANtpInfoObjectFiller::fStripArray [protected]
 

Definition at line 78 of file ANtpInfoObjectFiller.h.

Referenced by FillEventInformation(), FillHeaderInformation(), FillShowerInformation(), FillTrackInformation(), and SetStripArray().

VldContext ANtpInfoObjectFiller::fVldc [protected]
 

Definition at line 77 of file ANtpInfoObjectFiller.h.

Referenced by FillHeaderInformation().


The documentation for this class was generated from the following files:
Generated on Thu Nov 1 11:56:46 2007 for loon by  doxygen 1.3.9.1