#include <ANtpInfoObjectFiller.h>
Inheritance diagram for ANtpInfoObjectFiller:

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 |
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
Definition at line 96 of file ANtpInfoObjectFiller.cxx. References MSG. 00097 {
00098
00099 MSG("ANtpInfoObjectFiller", Msg::kDebug)
00100 << "ANtpInfoObjectFiller::Destructor" << endl;
00101
00102 }
|
|
||||||||||||||||
|
Definition at line 321 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(). 00324 {
00325
00326 eventInfo->Reset();
00327 eventInfo->index = static_cast <int> (ntpEvent->index);
00328 eventInfo->pulseHeight = ntpEvent->ph.sigcor;
00329 eventInfo->energyGeV = ntpEvent->ph.gev;
00330 eventInfo->begPlane = ntpEvent->plane.beg;
00331 eventInfo->endPlane = ntpEvent->plane.end;
00332 eventInfo->planes = ntpEvent->plane.n;
00333
00334 //add up the pulse height in each plane to find the maximum in the event
00335 eventInfo->totalStrips = ntpEvent->nstrip;
00336
00337 //write your own criterea for whether a strip is good or not
00338 eventInfo->passStrips = ntpEvent->nstrip;
00339
00340 eventInfo->showers = ntpEvent->nshower;
00341 eventInfo->tracks = ntpEvent->ntrack;
00342
00343 //Correct cedar vertex bug
00344 TString reco = ntpManip->GetReleaseMCType();
00345 if(reco.Contains((ReleaseType::AsString(ReleaseType::kCedarData)).c_str()) ||
00346 reco.Contains((ReleaseType::AsString(ReleaseType::kCedarCarrot)).c_str()) ||
00347 reco.Contains((ReleaseType::AsString(ReleaseType::kCedarDaikon)).c_str())){
00348
00349 NtpVtxFinder::NtpVtxFinder vtxf;
00350 vtxf.SetTargetEvent(static_cast <int> (ntpEvent->index),
00351 ntpManip->GetNtpStRecord());
00352 if (vtxf.FindVertex()<0){ //Take existing vertex if fix cannot be used
00353 eventInfo->vtxX = ntpEvent->vtx.x;
00354 eventInfo->vtxY = ntpEvent->vtx.y;
00355 eventInfo->vtxZ = ntpEvent->vtx.z;
00356 eventInfo->vertexTime = ntpEvent->vtx.t;
00357 } else {
00358 eventInfo->vtxX = vtxf.VtxX();
00359 eventInfo->vtxY = vtxf.VtxY();
00360 eventInfo->vtxZ = vtxf.VtxZ();
00361 eventInfo->vertexTime = vtxf.VtxT();
00362 }//if(vtxf.FindVertex())
00363
00364 } else {
00365 eventInfo->vtxX = ntpEvent->vtx.x;
00366 eventInfo->vtxY = ntpEvent->vtx.y;
00367 eventInfo->vtxZ = ntpEvent->vtx.z;
00368 eventInfo->vertexTime = ntpEvent->vtx.t;
00369 }//if(reco.Contains(...))
00370
00371 FillFiducialInformation(eventInfo);
00372
00373 if(!fStripArray) return;
00374
00375 //loop over the strips in the shower and record which planes they are on
00376 NtpSRStrip *strip = 0;
00377 for(int i = 0; i < eventInfo->totalStrips; ++i){
00378 if (ntpEvent->stp[i] >= 0) strip = dynamic_cast<NtpSRStrip *>
00379 (fStripArray->At(ntpEvent->stp[i]));
00380 else continue;
00381 ++eventInfo->stripsPerPlane[strip->plane];
00382 }
00383
00384 return;
00385 }
|
|
|
Definition at line 494 of file ANtpInfoObjectFiller.cxx. References fDetector, MetersToBeam(), MetersToCloseEdge(), MetersToCoil(), ANtpEventInfo::vtxMetersToBeam, ANtpEventInfo::vtxMetersToCloseEdge, ANtpEventInfo::vtxMetersToCoil, ANtpEventInfo::vtxX, ANtpEventInfo::vtxY, and ANtpEventInfo::vtxZ. 00495 {
00496 double x = eventInfo->vtxX;
00497 double y = eventInfo->vtxY;
00498 double z = eventInfo->vtxZ;
00499
00500 eventInfo->vtxMetersToBeam = MetersToBeam(fDetector, x, y, z);
00501 eventInfo->vtxMetersToCoil = MetersToCoil(fDetector, x, y);
00502 eventInfo->vtxMetersToCloseEdge = MetersToCloseEdge(fDetector, x, y, 0);
00503
00504 return;
00505 }
|
|
|
||||||||||||||||||||
|
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, CoilTools::GetCoilState(), Dcs_Mag_Near::GetCurrent(), BfldDbiCoilState::GetCurrent(), ANtpRecoNtpManipulator::GetDataQuality(), ANtpRecoNtpManipulator::GetDmxStatusInfo(), HvStatusFinder::GetHvStatus(), CoilTools::GetMagNear(), ANtpRecoNtpManipulator::GetNtpStRecord(), ANtpRecoNtpManipulator::GetReleaseMCType(), ANtpRecoNtpManipulator::GetRun(), ANtpRecoNtpManipulator::GetSnarl(), ANtpRecoNtpManipulator::GetSnarlEventSummary(), ANtpRecoNtpManipulator::GetSpillType(), ANtpRecoNtpManipulator::GetSubRun(), ANtpRecoNtpManipulator::GetTriggerSource(), HvStatus::Good(), AstUtil::GSTToLST(), ANtpHeaderInfo::hour, ANtpHeaderInfo::hvStatus, CoilTools::Instance(), 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 = HvStatusFinder::Instance().GetHvStatus(fVldc,60,1);
00205 headerInfo->hvStatus = (int)HvStatus::Good(hv);
00206 // MSG("ANtpInfoObjectFiller", Msg::kInfo) << HvStatus::Good(hv)
00207 // << " "
00208 // << headerInfo->hvStatus
00209 // << endl;
00210 const BfldDbiCoilState *farstate = CoilTools::Instance().GetCoilState(fVldc);
00211 if(farstate) headerInfo->coilCurrent = farstate->GetCurrent();
00212 }
00213 else if(det == Detector::kNear){
00214 const Dcs_Mag_Near *nearstate = CoilTools::Instance().GetMagNear(fVldc);
00215 if(nearstate) headerInfo->coilCurrent = nearstate->GetCurrent();
00216 }
00217
00218 //CoilTools allows for generic access of the database - no
00219 //detector dependent stuff needed by user
00220 if( CoilTools::IsReverse(fVldc) ) headerInfo->coilStatus = -1;
00221 else headerInfo->coilStatus = 1;
00222
00223 if( !CoilTools::IsOK(fVldc) ) headerInfo->coilStatus = 0;
00224
00225 return;
00226 }
|
|
||||||||||||
|
Definition at line 389 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(). 00391 {
00392 const Float_t muMass = 0.105658357; //mu mass in GeV/c
00393 const Float_t eMass = 0.000510999; //e mass in GeV/c
00394 const Float_t tauMass = 1.777; //tau mass in GeV/c
00395
00396 truthInfo->Reset();
00397 truthInfo->nuEnergy = ntpMCTruth->p4neu[3];
00398 truthInfo->nuVtxX = ntpMCTruth->vtxx;
00399 truthInfo->nuVtxY = ntpMCTruth->vtxy;
00400 truthInfo->nuVtxZ = ntpMCTruth->vtxz;
00401 if(TMath::Abs(truthInfo->nuEnergy) > 0.){
00402 truthInfo->nuDCosX = ntpMCTruth->p4neu[0]/TMath::Sqrt(truthInfo->nuEnergy*truthInfo->nuEnergy);
00403 truthInfo->nuDCosY = ntpMCTruth->p4neu[1]/TMath::Sqrt(truthInfo->nuEnergy*truthInfo->nuEnergy);
00404 truthInfo->nuDCosZ = ntpMCTruth->p4neu[2]/TMath::Sqrt(truthInfo->nuEnergy*truthInfo->nuEnergy);
00405 }
00406 else{
00407 truthInfo->nuDCosX = -10000.;
00408 truthInfo->nuDCosY = -10000.;
00409 truthInfo->nuDCosZ = -10000.;
00410 }
00411 truthInfo->nuFlavor = ntpMCTruth->inu;
00412 truthInfo->interactionType = ntpMCTruth->iaction;
00413
00414 truthInfo->targetEnergy = ntpMCTruth->p4tgt[3];
00415 truthInfo->targetPX = ntpMCTruth->p4tgt[0];
00416 truthInfo->targetPY = ntpMCTruth->p4tgt[1];
00417 truthInfo->targetPZ = ntpMCTruth->p4tgt[2];
00418
00419 truthInfo->hadronicY = ntpMCTruth->y;
00420
00421 truthInfo->showerEnergy = 0.;
00422 float showerMomentumSqr = 0.;
00423 if(ntpMCTruth->p4shw[3]>0. && TMath::Abs(ntpMCTruth->p4shw[0] +
00424 ntpMCTruth->p4shw[1] +
00425 ntpMCTruth->p4shw[2]) > 0.){
00426 truthInfo->showerEnergy = ntpMCTruth->p4shw[3];
00427 showerMomentumSqr = ntpMCTruth->p4shw[0]*ntpMCTruth->p4shw[0];
00428 showerMomentumSqr += ntpMCTruth->p4shw[1]*ntpMCTruth->p4shw[1];
00429 showerMomentumSqr += ntpMCTruth->p4shw[2]*ntpMCTruth->p4shw[2];
00430 truthInfo->showerDCosX = ntpMCTruth->p4shw[0]/TMath::Sqrt(showerMomentumSqr);
00431 truthInfo->showerDCosY = ntpMCTruth->p4shw[1]/TMath::Sqrt(showerMomentumSqr);
00432 truthInfo->showerDCosZ = ntpMCTruth->p4shw[2]/TMath::Sqrt(showerMomentumSqr);
00433 }
00434 else{
00435 truthInfo->showerDCosX = ANtpDefVal::kFloat;
00436 truthInfo->showerDCosY = ANtpDefVal::kFloat;
00437 truthInfo->showerDCosZ = ANtpDefVal::kFloat;
00438 }
00439
00440 truthInfo->leptonMomentum = 0.;
00441 if(TMath::Abs(ntpMCTruth->p4mu1[3])>muMass){
00442 truthInfo->leptonMomentum = TMath::Sqrt(ntpMCTruth->p4mu1[3]*ntpMCTruth->p4mu1[3] - muMass*muMass);
00443 truthInfo->leptonDCosX = ntpMCTruth->p4mu1[0]/truthInfo->leptonMomentum;
00444 truthInfo->leptonDCosY = ntpMCTruth->p4mu1[1]/truthInfo->leptonMomentum;
00445 truthInfo->leptonDCosZ = ntpMCTruth->p4mu1[2]/truthInfo->leptonMomentum;
00446 if(ntpMCTruth->p4mu1[3]<0.) truthInfo->leptonMomentum *= -1.;
00447 }
00448 else if(TMath::Abs(ntpMCTruth->p4el1[3])>eMass){
00449 truthInfo->leptonMomentum = TMath::Sqrt(ntpMCTruth->p4el1[3]*ntpMCTruth->p4el1[3] - eMass*eMass);
00450 truthInfo->leptonDCosX = ntpMCTruth->p4el1[0]/truthInfo->leptonMomentum;
00451 truthInfo->leptonDCosY = ntpMCTruth->p4el1[1]/truthInfo->leptonMomentum;
00452 truthInfo->leptonDCosZ = ntpMCTruth->p4el1[2]/truthInfo->leptonMomentum;
00453 if(ntpMCTruth->p4el1[3]<0.) truthInfo->leptonMomentum *= -1.;
00454 }
00455 else if(TMath::Abs(ntpMCTruth->p4tau[3])>tauMass){
00456 truthInfo->leptonMomentum = TMath::Sqrt(ntpMCTruth->p4tau[3]*ntpMCTruth->p4tau[3] - tauMass*tauMass);
00457 truthInfo->leptonDCosX = ntpMCTruth->p4tau[0]/truthInfo->leptonMomentum;
00458 truthInfo->leptonDCosY = ntpMCTruth->p4tau[1]/truthInfo->leptonMomentum;
00459 truthInfo->leptonDCosZ = ntpMCTruth->p4tau[2]/truthInfo->leptonMomentum;
00460 if(ntpMCTruth->p4tau[3]<0.) truthInfo->leptonMomentum *= -1.;
00461 }
00462 else{
00463 truthInfo->leptonDCosX = ANtpDefVal::kFloat;
00464 truthInfo->leptonDCosY = ANtpDefVal::kFloat;
00465 truthInfo->leptonDCosZ = ANtpDefVal::kFloat;
00466 }
00467
00468
00469 return;
00470 }
|
|
||||||||||||
|
||||||||||||
|
||||||||||||||||
|
Definition at line 533 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(). 00536 {
00537
00538 //get the trace for the track - this is very far detector centric for now,
00539 //adapted from C. Howcroft's code
00540
00541 //direction tells you whether to trace back from vertex (-1) or forward from end (1)
00542
00543 //side is as labeled below
00544 /*
00545 0
00546 --------
00547 7 / \ 1
00548 / y| \
00549 6 | | | 2
00550 | ---- |
00551 5 \ x / 3
00552 \ /
00553 --------
00554 4
00555 */
00556 double dcos[3] = {direction*ntpTrack->vtx.dcosx,
00557 direction*ntpTrack->vtx.dcosy,
00558 direction*ntpTrack->vtx.dcosz};
00559 double dcosUV[3] = {direction*ntpTrack->vtx.dcosu,
00560 direction*ntpTrack->vtx.dcosv,
00561 direction*ntpTrack->vtx.dcosz};
00562 double endPointXY[3] = {ntpTrack->vtx.x, ntpTrack->vtx.y, ntpTrack->vtx.z};
00563 double endPointUV[3] = {ntpTrack->vtx.u, ntpTrack->vtx.v, ntpTrack->vtx.z};
00564
00565 if(direction > 0){
00566 endPointXY[0] = ntpTrack->end.x;
00567 endPointXY[1] = ntpTrack->end.y;
00568 endPointXY[2] = ntpTrack->end.z;
00569 endPointUV[0] = ntpTrack->end.u;
00570 endPointUV[1] = ntpTrack->end.v;
00571 endPointUV[2] = ntpTrack->end.z;
00572 dcos[0] = ntpTrack->end.dcosx;
00573 dcos[1] = ntpTrack->end.dcosy;
00574 dcos[2] = ntpTrack->end.dcosz;
00575 dcosUV[0] = ntpTrack->end.dcosu;
00576 dcosUV[1] = ntpTrack->end.dcosv;
00577 dcosUV[2] = ntpTrack->end.dcosz;
00578 }
00579
00580 int side = -1;
00581 double xzproj[2]={-999., -999.};
00582 double entry[3] = {0.};
00583 double minpath = 99e99;
00584 double tmppath = 0.;
00585 double maxDetectorY = 4.;
00586 double sidelength = kFarSideLength;
00587
00588 if(TMath::IsNaN(endPointUV[0]) || TMath::IsNaN(endPointUV[1])
00589 || TMath::IsNaN(dcosUV[0]) || TMath::IsNaN(dcosUV[1])
00590 || TMath::IsNaN(dcos[2])) return;
00591
00592 if(TMath::Abs(dcos[1])>1.e-6){
00593 // Y - SIDES
00594 //SIDE 0
00595 xzproj[0] = endPointXY[0] + (dcos[0]/dcos[1])*(maxDetectorY - endPointXY[1]);
00596 xzproj[1] = endPointXY[2] + (dcos[2]/dcos[1])*(maxDetectorY - endPointXY[1]);
00597 if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] - endPointXY[2])*dcos[2]) > 0.0){
00598 tmppath = Sqr(endPointXY[0] - xzproj[0])
00599 + Sqr(endPointXY[1] - maxDetectorY)
00600 + Sqr(endPointXY[2] - xzproj[1]);
00601 if(TMath::Finite(tmppath)){
00602 tmppath = TMath::Sqrt(tmppath);
00603 if(tmppath < minpath){
00604 minpath = tmppath;
00605 entry[0] = xzproj[0];
00606 entry[2] = xzproj[1];
00607 entry[1] = maxDetectorY;
00608 side = 0;
00609 }
00610 }
00611 }//end side 0
00612 //SIDE 4
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 = 4;
00627 }
00628 }
00629 }//end side 4
00630 }//end Y sides
00631 if(TMath::Abs(dcos[0])>1e-6){ // X - SIDES
00632 //SIDE 2
00633 xzproj[0] = endPointXY[1] + (dcos[1]/dcos[0])*(maxDetectorY - endPointXY[0]);
00634 xzproj[1] = endPointXY[2] + (dcos[2]/dcos[0])*(maxDetectorY - endPointXY[0]);
00635 if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] - endPointXY[2])*dcos[2]) > 0.0){
00636 tmppath = (endPointXY[1] - xzproj[0]) * (endPointXY[1] - xzproj[0])
00637 + (endPointXY[0] - maxDetectorY) * (endPointXY[0] - maxDetectorY)
00638 + (endPointXY[2] - xzproj[1]) * (endPointXY[2] - xzproj[1]);
00639 if(TMath::Finite(tmppath)){
00640 tmppath = TMath::Sqrt(tmppath);
00641 if(tmppath<minpath){
00642 minpath = tmppath;
00643 entry[1] = xzproj[0];
00644 entry[2] = xzproj[1];
00645 entry[0] = maxDetectorY;
00646 side = 2;
00647 }
00648 }
00649 }//end side 2
00650 //SIDE 6
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 = Sqr(endPointXY[1] - xzproj[0])
00655 + Sqr(endPointXY[0] + maxDetectorY)
00656 + Sqr(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 = 6;
00665 }
00666 }
00667 }//end if side 6
00668 }//end x sides
00669 if(TMath::Abs(dcosUV[0])>1.e-6){ // U - SIDES
00670 //SIDE 1
00671 xzproj[0] = endPointUV[1] + (dcosUV[1]/dcosUV[0])*(maxDetectorY - endPointUV[0]);
00672 xzproj[1] = endPointXY[2] + (dcos[2]/dcosUV[0])*(maxDetectorY - endPointUV[0]);
00673 if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] - endPointXY[2])*dcos[2]) > 0.0){
00674 tmppath = Sqr(ntpTrack->vtx.v - xzproj[0])
00675 + Sqr(ntpTrack->vtx.u - maxDetectorY)
00676 + Sqr(endPointXY[2] - xzproj[1]);
00677 if(TMath::Finite(tmppath)){
00678 tmppath = TMath::Sqrt(tmppath);
00679 if(tmppath<minpath){
00680 minpath = tmppath;
00681 entry[0] = kInverseSqrt2*(maxDetectorY - xzproj[0]) ;
00682 entry[2] = xzproj[1];
00683 entry[1] = kInverseSqrt2*(maxDetectorY + xzproj[0]) ;
00684 side = 1;
00685 }
00686 }
00687 }//end if side1
00688 //SIDE 5
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 = 5;
00703 }
00704 }
00705 }//end if side 5
00706 }//end u sides
00707 if(TMath::Abs(dcosUV[1])>1.e-6){ // V - SIDES
00708 //SIDE 7
00709 xzproj[0] = endPointUV[0] + (dcosUV[0]/dcosUV[1])*(maxDetectorY - endPointUV[1]);
00710 xzproj[1] = endPointXY[2] + (dcos[2]/dcosUV[1])*(maxDetectorY - endPointUV[1]);
00711 if(TMath::Abs(xzproj[0]) < sidelength && ((xzproj[1] - endPointXY[2])*dcos[2]) > 0.0){
00712 tmppath = Sqr(ntpTrack->vtx.u - xzproj[0])
00713 + Sqr(ntpTrack->vtx.v - maxDetectorY)
00714 + Sqr(endPointXY[2] - xzproj[1]);
00715 if(TMath::Finite(tmppath)){
00716 tmppath = TMath::Sqrt ( tmppath);
00717 if(tmppath<minpath){
00718 minpath = tmppath;
00719 entry[0] = kInverseSqrt2*(xzproj[0]-maxDetectorY) ;
00720 entry[2] = xzproj[1];
00721 entry[1] = kInverseSqrt2*(xzproj[0]+maxDetectorY) ;
00722 side = 7;
00723 }
00724 }
00725 }//end if side7
00726 //SIDE 3
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 = 3;
00741 }
00742 }
00743 }//end if side 3
00744 }//end v sides
00745
00746 if(direction < 0){
00747 trackInfo->traceVtx = TMath::Sqrt(Sqr(endPointXY[0]-entry[0]) + Sqr(endPointXY[1]-entry[1])
00748 + Sqr(endPointXY[2]-entry[2]));
00749 trackInfo->traceVtxZ = entry[2] - endPointXY[2];
00750
00751 }
00752 else if(direction > 0){
00753 trackInfo->traceEnd = TMath::Sqrt(Sqr(ntpTrack->end.x-entry[0]) + Sqr(ntpTrack->end.y-entry[1])
00754 + Sqr(ntpTrack->end.z-entry[2]));
00755 trackInfo->traceEndZ = entry[2] - ntpTrack->end.z;
00756
00757 }
00758
00759 return;
00760 }
|
|
||||||||||||||||||||
|
Definition at line 763 of file ANtpInfoObjectFiller.cxx. Referenced by ANtpEventInfoAna::Analyze(), and FillFiducialInformation(). 00768 : 00769 // Beam is at x = 1.4485m 00770 // Beam dy/dz = -0.0578 (angle = -3.31deg) to the z-axis 00771 // Beam passes through y = 0 at back of golden region (plane 90) 00772 // \-> Beam passes through y = 0.3087 @ z = 0 00773 // Still looking for hard evidence about this. 00774 { 00775 if (det == Detector::kNear) { 00776 const Float_t dydz(-0.0578); 00777 const Float_t beamCenterX(1.4885 * Munits::m); 00778 const Float_t beamCenterY0(0.3087 * Munits::m); 00779 00780 x -= beamCenterX; 00781 y -= beamCenterY0 + dydz * z; 00782 return TMath::Sqrt(x*x + y*y); 00783 } 00784 00785 else if (det == Detector::kFar){ 00786 //Beam center is faintly meaningless for FD cut 00787 return ANtpDefVal::kFloat; 00788 } 00789 00790 else return ANtpDefVal::kFloat; 00791 } //----------------------------------------------------------------------
|
|
||||||||||||||||||||
|
Definition at line 809 of file ANtpInfoObjectFiller.cxx. References PlaneOutline::DistanceToOuterEdge(), and PlaneOutline::IsInside(). Referenced by ANtpEventInfoAna::Analyze(), and FillFiducialInformation(). 00812 {
00813 // Calculate the distance to the nearest (outside) plane edge
00814 // using the PlaneOutline class.
00815 // Currently takes distance to nearest edges seperatly for U and V
00816 // views, then takes the average of the two distances.
00817 // It would be better to take a single distance to an average plane
00818 // but this is not yet possible.
00819
00820 if (det == Detector::kNear || det == Detector::kFar ){
00821
00822 // Pick a plane coverage
00823 PlaneCoverage::PlaneCoverage_t outline(PlaneCoverage::kComplete);
00824 if (det == Detector::kNear){
00825 if (NDUseFullPlane) outline = PlaneCoverage::kNearFull;
00826 else outline = PlaneCoverage::kNearPartial;
00827 }
00828
00829 PlaneOutline po;
00830
00831 // Calculate distance (to nearest outside edge) in U.
00832 Float_t distU(0.);
00833 Float_t xedge; Float_t yedge;
00834 po.DistanceToOuterEdge(x, y, PlaneView::kU, outline,
00835 distU, xedge, yedge);
00836
00837 // Calculate distance in V.
00838 Float_t distV(0.);
00839 po.DistanceToOuterEdge(x, y, PlaneView::kV, outline,
00840 distV, xedge, yedge);
00841
00842 // Now work out if the point is inside or outside each outline
00843 // Firstly deal with the coil hole. We consider it inside,
00844 // but the PlaneOutline class calls it outside.
00845
00846 Bool_t insideU(0.);
00847 if ( outline != PlaneCoverage::kNearPartial ) {
00848 // circle of radius 1/sqrt(2) will enclose the coilHole,
00849 // but is itself enclosed by the outer edges
00850 insideU = ( (x*x + y*y) < 0.5 * Munits::m2 );
00851 //cout << "X: " << x << "; Y: "
00852 // << y << "; inside:" << insideU << endl;
00853 }
00854
00855 Bool_t insideV(insideU);
00856 if ( !insideU ){
00857 insideU = po.IsInside(x, y, PlaneView::kU, outline);
00858 insideV = po.IsInside(x, y, PlaneView::kV, outline);
00859 }
00860 distU *= ( insideU ? 1. : -1. );
00861 distV *= ( insideV ? 1. : -1. );
00862
00863 // cout << ">U<: " << insideU << " " << distU << "\n";
00864 //cout << ">V<: " << insideV << " " << distV;
00865
00866 return ( distU + distV ) / 2.;
00867 } // if ( @ near or far detectors )
00868
00869 else return ANtpDefVal::kFloat;
00870 }
|
|
||||||||||||||||
|
Definition at line 793 of file ANtpInfoObjectFiller.cxx. Referenced by ANtpEventInfoAna::Analyze(), and FillFiducialInformation(). 00795 {
00796 if (det == Detector::kNear){
00797 // Take coil to be at (0,0) Looks about right... (?)
00798 return TMath::Sqrt(x*x + y*y);
00799 }
00800
00801 else if (det == Detector::kFar){
00802 return TMath::Sqrt(x*x + y*y);
00803 }
00804
00805 else return ANtpDefVal::kFloat;
00806 }
|
|
|
Reimplemented in ANtpInfoObjectFillerNC. Definition at line 105 of file ANtpInfoObjectFiller.cxx. References fDetector. Referenced by CondensedNtpModule::BeginJob(). 00106 {
00107 fDetector = detector;
00108 return;
00109 }
|
|
|
Definition at line 508 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(). 00509 {
00510 fStripArray = strips;
00511 return;
00512 }
|
|
|
Definition at line 527 of file ANtpInfoObjectFiller.cxx. 00528 {
00529 return x*x;
00530 }
|
|
|
Definition at line 521 of file ANtpInfoObjectFiller.cxx. 00522 {
00523 return x*x;
00524 }
|
|
|
Definition at line 515 of file ANtpInfoObjectFiller.cxx. Referenced by GetTrackTrace(). 00516 {
00517 return x*x;
00518 }
|
|
|
Definition at line 79 of file ANtpInfoObjectFiller.h. Referenced by FillFiducialInformation(), and SetDetector(). |
|
|
Definition at line 90 of file ANtpInfoObjectFiller.h. Referenced by FillHeaderInformation(). |
|
|
Definition at line 78 of file ANtpInfoObjectFiller.h. Referenced by FillEventInformation(), FillHeaderInformation(), FillShowerInformation(), FillTrackInformation(), and SetStripArray(). |
|
|
Definition at line 77 of file ANtpInfoObjectFiller.h. Referenced by FillHeaderInformation(). |
1.3.9.1