From fd31df278df90d9aaf1769789da854e3d31857f5 Mon Sep 17 00:00:00 2001 From: Michelle Stancari Date: Tue, 31 Aug 2021 14:01:13 -0500 Subject: [PATCH 1/6] transfer code from old feature branch --- .../CRT/CRTAna/CRTT0MatchingAna_module.cc | 134 +++++-- sbndcode/CRT/CRTTools/CRTT0Matching_module.cc | 37 +- sbndcode/CRT/CRTUtils/CRTT0MatchAlg.cc | 329 ++++++++++++++---- sbndcode/CRT/CRTUtils/CRTT0MatchAlg.h | 133 +++++-- .../CRT/CRTUtils/crtt0matchingalg_sbnd.fcl | 22 +- 5 files changed, 521 insertions(+), 134 deletions(-) diff --git a/sbndcode/CRT/CRTAna/CRTT0MatchingAna_module.cc b/sbndcode/CRT/CRTAna/CRTT0MatchingAna_module.cc index ba2c29dc1..bd9d0b82b 100644 --- a/sbndcode/CRT/CRTAna/CRTT0MatchingAna_module.cc +++ b/sbndcode/CRT/CRTAna/CRTT0MatchingAna_module.cc @@ -1,3 +1,4 @@ + //////////////////////////////////////////////////////////////////////// // Class: CRTT0MatchingAnaAna // Module Type: analyzer @@ -134,13 +135,25 @@ namespace sbnd { std::map hMatchDCA; std::map hNoMatchDCA; + std::map hDoL; + std::map hMatchDoL; + std::map hNoMatchDoL; + + std::map hT0; + std::map hMatchT0; + std::map hNoMatchT0; + std::map hEffDCATotal; std::map hEffDCAReco; + std::map hEffDoLTotal; + std::map hEffDoLReco; std::map hEffLengthTotal; std::map hEffLengthReco; std::map hPurityDCATotal; std::map hPurityDCAReco; + std::map hPurityDoLTotal; + std::map hPurityDoLReco; std::map hPurityLengthTotal; std::map hPurityLengthReco; @@ -174,14 +187,26 @@ namespace sbnd { hDCA[tagger] = tfs->make(Form("DCA_%s", tagger.c_str()), "", 50, 0, 100); hMatchDCA[tagger] = tfs->make(Form("MatchDCA_%s", tagger.c_str()), "", 50, 0, 100); hNoMatchDCA[tagger] = tfs->make(Form("NoMatchDCA_%s", tagger.c_str()), "", 50, 0, 100); + + hDoL[tagger] = tfs->make(Form("DoL_%s", tagger.c_str()), "", 100, 0, 0.25); + hMatchDoL[tagger] = tfs->make(Form("MatchDoL_%s", tagger.c_str()), "", 100, 0, 0.25); + hNoMatchDoL[tagger] = tfs->make(Form("NoMatchDoL_%s", tagger.c_str()), "", 100, 0, 0.25); - hEffDCATotal[tagger] = tfs->make(Form("EffDCATotal_%s", tagger.c_str()), "", 20, 0, 80); - hEffDCAReco[tagger] = tfs->make(Form("EffDCAReco_%s", tagger.c_str()), "", 20, 0, 80); + hT0[tagger] = tfs->make(Form("T0_%s", tagger.c_str()), "", 600, -3000, 3000); + hMatchT0[tagger] = tfs->make(Form("MatchT0_%s", tagger.c_str()), "", 600, -3000, 3000); + hNoMatchT0[tagger] = tfs->make(Form("NoMatchT0_%s", tagger.c_str()), "", 600, -3000, 3000); + + hEffDCATotal[tagger] = tfs->make(Form("EffDCATotal_%s", tagger.c_str()), "", 50, 0, 100); + hEffDCAReco[tagger] = tfs->make(Form("EffDCAReco_%s", tagger.c_str()), "", 50, 0, 100); + hEffDoLTotal[tagger] = tfs->make(Form("EffDoLTotal_%s", tagger.c_str()), "", 100, 0, 0.25); + hEffDoLReco[tagger] = tfs->make(Form("EffDoLReco_%s", tagger.c_str()), "", 100, 0, 0.25); hEffLengthTotal[tagger] = tfs->make(Form("EffLengthTotal_%s", tagger.c_str()), "", 20, 0, 600); hEffLengthReco[tagger] = tfs->make(Form("EffLengthReco_%s", tagger.c_str()), "", 20, 0, 600); - hPurityDCATotal[tagger] = tfs->make(Form("PurityDCATotal_%s", tagger.c_str()), "", 20, 0, 80); - hPurityDCAReco[tagger] = tfs->make(Form("PurityDCAReco_%s", tagger.c_str()), "", 20, 0, 80); + hPurityDCATotal[tagger] = tfs->make(Form("PurityDCATotal_%s", tagger.c_str()), "", 50, 0, 100); + hPurityDCAReco[tagger] = tfs->make(Form("PurityDCAReco_%s", tagger.c_str()), "", 50, 0, 100); + hPurityDoLTotal[tagger] = tfs->make(Form("PurityDoLTotal_%s", tagger.c_str()), "", 100, 0, 0.25); + hPurityDoLReco[tagger] = tfs->make(Form("PurityDoLReco_%s", tagger.c_str()), "", 100, 0, 0.25); hPurityLengthTotal[tagger] = tfs->make(Form("PurityLengthTotal_%s", tagger.c_str()), "", 20, 0, 600); hPurityLengthReco[tagger] = tfs->make(Form("PurityLengthReco_%s", tagger.c_str()), "", 20, 0, 600); } @@ -259,6 +284,7 @@ namespace sbnd { } } + // std::cout << " New event" << std::endl; //---------------------------------------------------------------------------------------------------------- // DISTANCE OF CLOSEST APPROACH ANALYSIS //---------------------------------------------------------------------------------------------------------- @@ -279,23 +305,38 @@ namespace sbnd { double trueTime = particles[trackTrueID].T() * 1e-3; if(trueTime < minHitTime || trueTime > maxHitTime) continue; + // std::cout << "new track " << trueTime << std::endl; // Calculate t0 from CRT Hit matching - std::pair closest = t0Alg.ClosestCRTHit(detProp, tpcTrack, crtHits, event); - if(closest.second != -99999){ - hDCA[closest.first.tagger]->Fill(closest.second); - hDCA["All"]->Fill(closest.second); - } + matchCand closest = t0Alg.GetClosestCRTHit(detProp, tpcTrack, crtHits, event); + // std::cout << "closest match " << closest.t0 << std::endl; + double sin_angle = -99999; + if(closest.dca != -99999){ + hDCA[closest.thishit.tagger]->Fill(closest.dca); + hDCA["All"]->Fill(closest.dca); + sin_angle = closest.dca/closest.extrapLen; + hDoL[closest.thishit.tagger]->Fill(sin_angle); + hDoL["All"]->Fill(sin_angle); + hT0[closest.thishit.tagger]->Fill(closest.t0); + hT0["All"]->Fill(closest.t0); + // Is hit matched to that track - if(closest.second != -99999){ - int hitTrueID = fCrtBackTrack.TrueIdFromTotalEnergy(event, closest.first); + int hitTrueID = fCrtBackTrack.TrueIdFromTotalEnergy(event, closest.thishit); if(hitTrueID == trackTrueID && hitTrueID != -99999){ - hMatchDCA[closest.first.tagger]->Fill(closest.second); - hMatchDCA["All"]->Fill(closest.second); + hMatchDCA[closest.thishit.tagger]->Fill(closest.dca); + hMatchDCA["All"]->Fill(closest.dca); + hMatchDoL[closest.thishit.tagger]->Fill(sin_angle); + hMatchDoL["All"]->Fill(sin_angle); + hMatchT0[closest.thishit.tagger]->Fill(closest.t0); + hMatchT0["All"]->Fill(closest.t0); } else{ - hNoMatchDCA[closest.first.tagger]->Fill(closest.second); - hNoMatchDCA["All"]->Fill(closest.second); + hNoMatchDCA[closest.thishit.tagger]->Fill(closest.dca); + hNoMatchDCA["All"]->Fill(closest.dca); + hNoMatchDoL[closest.thishit.tagger]->Fill(sin_angle); + hNoMatchDoL["All"]->Fill(sin_angle); + hNoMatchT0[closest.thishit.tagger]->Fill(closest.t0); + hNoMatchT0["All"]->Fill(closest.t0); } } @@ -309,27 +350,27 @@ namespace sbnd { hEffDCATotal[tagger]->Fill(DCAcut); // If closest hit is below limit and track matches any hits then fill efficiency - if(closest.second < DCAcut && closest.second != -99999){ + if(closest.dca < DCAcut && closest.dca != -99999){ hEffDCAReco[tagger]->Fill(DCAcut); } } // Fill total efficiency histograms hEffDCATotal["All"]->Fill(DCAcut); - if(closest.second < DCAcut && closest.second != -99999){ + if(closest.dca < DCAcut && closest.dca != -99999){ hEffDCAReco["All"]->Fill(DCAcut); } } // Fill total purity histogram with each cut if closest hit is below limit - if(closest.second < DCAcut && closest.second != -99999){ - hPurityDCATotal[closest.first.tagger]->Fill(DCAcut); + if(closest.dca < DCAcut && closest.dca != -99999){ + hPurityDCATotal[closest.thishit.tagger]->Fill(DCAcut); hPurityDCATotal["All"]->Fill(DCAcut); // If closest hit is below limit and matched time is correct then fill purity - double hitTime = closest.first.ts1_ns * 1e-3; + double hitTime = closest.thishit.ts1_ns * 1e-3; if(particles.find(trackTrueID) != particles.end()){ if(std::abs(hitTime - trueTime) < 2.){ - hPurityDCAReco[closest.first.tagger]->Fill(DCAcut); + hPurityDCAReco[closest.thishit.tagger]->Fill(DCAcut); hPurityDCAReco["All"]->Fill(DCAcut); } } @@ -337,6 +378,45 @@ namespace sbnd { } } + nbins = hEffDoLTotal.begin()->second->GetNbinsX(); + + for(int i = 0; i < nbins; i++){ + double DCAcut = hEffDoLTotal.begin()->second->GetBinCenter(i); + + // Fill total efficiency histogram with each cut if track matches any hits + if(crtTaggerMap.find(trackTrueID) != crtTaggerMap.end()){ + for(auto const& tagger : crtTaggerMap[trackTrueID]){ + hEffDoLTotal[tagger]->Fill(DCAcut); + + // If closest hit is below limit and track matches any hits then fill efficiency + if(sin_angle < DCAcut && closest.dca != -99999){ + hEffDoLReco[tagger]->Fill(DCAcut); + } + } + // Fill total efficiency histograms + hEffDoLTotal["All"]->Fill(DCAcut); + if(sin_angle < DCAcut && closest.dca != -99999){ + hEffDoLReco["All"]->Fill(DCAcut); + } + } + + // Fill total purity histogram with each cut if closest hit is below limit + if(sin_angle < DCAcut && closest.dca != -99999){ + hPurityDoLTotal[closest.thishit.tagger]->Fill(DCAcut); + hPurityDoLTotal["All"]->Fill(DCAcut); + + // If closest hit is below limit and matched time is correct then fill purity + double hitTime = closest.thishit.ts1_ns * 1e-3; + if(particles.find(trackTrueID) != particles.end()){ + if(std::abs(hitTime - trueTime) < 2.){ + hPurityDoLReco[closest.thishit.tagger]->Fill(DCAcut); + hPurityDoLReco["All"]->Fill(DCAcut); + } + } + + } + } + double fixedCut = 30.; // Fill total efficiency histogram with each cut if track matches any hits @@ -345,28 +425,28 @@ namespace sbnd { hEffLengthTotal[tagger]->Fill(tpcTrack.Length()); // If closest hit is below limit and track matches any hits then fill efficiency - if(closest.second < fixedCut && closest.second != -99999){ + if(closest.dca < fixedCut && closest.dca >=0 ){ hEffLengthReco[tagger]->Fill(tpcTrack.Length()); } } // Fill total efficiency histograms hEffLengthTotal["All"]->Fill(tpcTrack.Length()); - if(closest.second < fixedCut && closest.second != -99999){ + if(closest.dca < fixedCut && closest.dca >=0){ hEffLengthReco["All"]->Fill(tpcTrack.Length()); } } // Fill total purity histogram with each cut if closest hit is below limit - if(closest.second < fixedCut && closest.second != -99999){ - hPurityLengthTotal[closest.first.tagger]->Fill(tpcTrack.Length()); + if(closest.dca < fixedCut && closest.dca >= 0){ + hPurityLengthTotal[closest.thishit.tagger]->Fill(tpcTrack.Length()); hPurityLengthTotal["All"]->Fill(tpcTrack.Length()); // If closest hit is below limit and matched time is correct then fill purity - double hitTime = closest.first.ts1_ns * 1e-3; + double hitTime = closest.thishit.ts1_ns * 1e-3; if(particles.find(trackTrueID) != particles.end()){ double trueTime = particles[trackTrueID].T() * 1e-3; if(std::abs(hitTime - trueTime) < 2.){ - hPurityLengthReco[closest.first.tagger]->Fill(tpcTrack.Length()); + hPurityLengthReco[closest.thishit.tagger]->Fill(tpcTrack.Length()); hPurityLengthReco["All"]->Fill(tpcTrack.Length()); } } diff --git a/sbndcode/CRT/CRTTools/CRTT0Matching_module.cc b/sbndcode/CRT/CRTTools/CRTT0Matching_module.cc index ea8fe0a3c..9da664c1e 100644 --- a/sbndcode/CRT/CRTTools/CRTT0Matching_module.cc +++ b/sbndcode/CRT/CRTTools/CRTT0Matching_module.cc @@ -99,8 +99,9 @@ namespace sbnd { { // Call appropriate produces<>() functions here. - produces< std::vector >(); - produces< art::Assns >(); + produces< std::vector >(); + produces< art::Assns >(); + produces< art::Assns >(); reconfigure(p); @@ -127,6 +128,7 @@ namespace sbnd { // Create anab::T0 objects and make association with recob::Track std::unique_ptr< std::vector > T0col( new std::vector); std::unique_ptr< art::Assns > Trackassn( new art::Assns); + std::unique_ptr< art::Assns > t0_crthit_assn( new art::Assns ); // Retrieve CRT hit list art::Handle> crtListHandle; @@ -150,27 +152,40 @@ namespace sbnd { <<"Number of CRT hits = "<()->DataFor(event); // Loop over all the reconstructed tracks for(size_t track_i = 0; track_i < trackList.size(); track_i++) { - // Get the closest matched time - std::pair matchedTime = t0Alg.T0AndDCAFromCRTHits(detProp, *trackList[track_i], crtHits, event); - if(matchedTime.first != -99999){ + // std::pair matchedTime = t0Alg.T0AndDCAFromCRTHits(detProp, *trackList[track_i], crtHits, event); + matchCand closest = t0Alg.GetClosestCRTHit(detProp, *trackList[track_i], crtHits, event); + + if(closest.dca >=0 ){ mf::LogInfo("CRTT0Matching") - <<"Matched time = "<ID()<<" with DCA = "<push_back(anab::T0(matchedTime.first * 1e3, 0, trackList[track_i]->ID(), (*T0col).size(), matchedTime.second)); + <<"Matched time = "<ID()<<" with DCA = "<push_back(anab::T0(closest.t0*1e3, trackList[track_i]->ID(), closest.thishit.plane, (int)closest.extrapLen, closest.dca)); util::CreateAssn(*this, event, *T0col, trackList[track_i], *Trackassn); - } + + //find this CRThit in the collection + // note this does not work (both the loop and the assoc !!) + unsigned CRThitIndex = std::numeric_limits::max(); + for (int ic=0; ic<(int)crtList.size(); ++ic){ + if (crtList[ic]->ts0_ns==closest.thishit.ts0_ns && crtList[ic]->z_pos==closest.thishit.z_pos && crtList[ic]->peshit==closest.thishit.peshit) + CRThitIndex=ic; + } + if (CRThitIndex != std::numeric_limits::max()) + util::CreateAssn(*this, event, *T0col, crtList[CRThitIndex], *t0_crthit_assn); + + } // DCA check } // Loop over tracks } // Validity check - + event.put(std::move(T0col)); event.put(std::move(Trackassn)); - + event.put(std::move(t0_crthit_assn)); + } // CRTT0Matching::produce() diff --git a/sbndcode/CRT/CRTUtils/CRTT0MatchAlg.cc b/sbndcode/CRT/CRTUtils/CRTT0MatchAlg.cc index bac7d7c64..3190ed293 100644 --- a/sbndcode/CRT/CRTUtils/CRTT0MatchAlg.cc +++ b/sbndcode/CRT/CRTUtils/CRTT0MatchAlg.cc @@ -2,30 +2,52 @@ namespace sbnd{ -CRTT0MatchAlg::CRTT0MatchAlg(const Config& config) : CRTT0MatchAlg(config, lar::providerFrom()) {} - -CRTT0MatchAlg::CRTT0MatchAlg(const Config& config, geo::GeometryCore const *GeometryService){ +CRTT0MatchAlg::CRTT0MatchAlg(const Config& config) : CRTT0MatchAlg(config, lar::providerFrom(), +lar::providerFrom()) {} +CRTT0MatchAlg::CRTT0MatchAlg(const Config& config, geo::GeometryCore const *GeometryService, spacecharge::SpaceCharge const *SCE){ + + this->reconfigure(config); fGeometryService = GeometryService; + fSCE = SCE; } - - CRTT0MatchAlg::CRTT0MatchAlg() = default; + - + + void CRTT0MatchAlg::reconfigure(const Config& config){ - + fMinTrackLength = config.MinTrackLength(); fTrackDirectionFrac = config.TrackDirectionFrac(); fDistanceLimit = config.DistanceLimit(); fTSMode = config.TSMode(); fTimeCorrection = config.TimeCorrection(); fTPCTrackLabel = config.TPCTrackLabel(); + fSCEposCorr = config.SCEposCorr(); + fDirMethod = config.DirMethod(); + fDCAuseBox = config.DCAuseBox(); + fDCAoverLength = config.DCAoverLength(); + fDoverLLimit = config.DoverLLimit(); + fPEcut = config.PEcut(); + fMaxUncert = config.MaxUncert(); + // fDistEndpointAVedge = config.DistEndpointAVedge(); return; } + +matchCand makeNULLmc (){ + sbn::crt::CRTHit hit; + matchCand null; + null.thishit = hit; + null.t0 = -99999; + null.dca = -99999; + null.extrapLen = -99999; + return null; +} + // Utility function that determines the possible t0 range of a track @@ -50,8 +72,10 @@ std::pair CRTT0MatchAlg::TrackT0Range(detinfo::DetectorPropertie double t0max = maxShift/Vd; double t0min = minShift/Vd; + // if (t0min>2500) std::cout << " t0 min " << t0min << " t0max " << t0max << std::endl; return std::make_pair(std::min(t0min, t0max), std::max(t0min, t0max)); + } // CRTT0MatchAlg::TrackT0Range() @@ -61,19 +85,35 @@ double CRTT0MatchAlg::DistOfClosestApproach(detinfo::DetectorPropertiesData cons //double minDist = 99999; // Convert the t0 into an x shift - double shift = t0 * detProp.DriftVelocity(); - // Apply the shift depending on which TPC the track is in - trackPos[0] += driftDirection * shift; + double xshift = driftDirection* t0 * detProp.DriftVelocity(); + trackPos[0] += xshift; + + if (fSCE->EnableCalSpatialSCE() && fSCEposCorr) { + geo::Point_t temppt = {trackPos.X(),trackPos.Y(),trackPos.Z()}; + geo::TPCID tpcid = fGeometryService->PositionToTPCID(temppt); + geo::Vector_t fPosOffsets = fSCE->GetCalPosOffsets(temppt,tpcid.TPC); + trackPos[0] += fPosOffsets.X(); + trackPos[1] += fPosOffsets.Y(); + trackPos[2] += fPosOffsets.Z(); + } TVector3 end = trackPos + trackDir; - return CRTCommonUtils::DistToCrtHit(crtHit, trackPos, end); + // calculate distance of closest approach (DCA) + // default is the distance to the point specified by the CRT hit (Simple DCA) + // useBox is the distance to the closest edge of the rectangle with the CRT hit at the center and the sides defined + // the position uncertainties on the CRT hits. + double thisdca; -} // CRTT0MatchAlg::DistToOfClosestApproach() + if (fDCAuseBox) thisdca = CRTCommonUtils::DistToCrtHit(crtHit, trackPos, end); + else thisdca = CRTCommonUtils::SimpleDCA(crtHit, trackPos, trackDir); + return thisdca; +} // CRTT0MatchAlg::DistToOfClosestApproach() -std::pair CRTT0MatchAlg::TrackDirectionAverage(recob::Track track, double frac){ +std::pair CRTT0MatchAlg::TrackDirectionAverage(recob::Track track, double frac) + { // Calculate direction as an average over directions size_t nTrackPoints = track.NumberTrajectoryPoints(); recob::TrackTrajectory trajectory = track.Trajectory(); @@ -105,6 +145,57 @@ std::pair CRTT0MatchAlg::TrackDirectionAverage(recob::Track } // CRTT0MatchAlg::TrackDirectionAverage() + std::pair CRTT0MatchAlg::TrackDirection(detinfo::DetectorPropertiesData const& detProp,recob::Track track, double frac, double CRTtime, int driftDirection){ + + size_t nTrackPoints = track.NPoints(); + int midPt = (int)floor(nTrackPoints*frac); + geo::Point_t startP = track.Start(); + geo::Point_t endP = track.End(); + geo::Point_t midP = track.LocationAtPoint(midPt); + + double xshift = driftDirection * CRTtime * detProp.DriftVelocity(); + TVector3 startPoint = {startP.X()+xshift,startP.Y(),startP.Z()}; + TVector3 endPoint = {endP.X()+xshift,endP.Y(),endP.Z()}; + TVector3 midPoint = {midP.X()+xshift,midP.Y(),midP.Z()}; + if (fSCE->EnableCalSpatialSCE() && fSCEposCorr) { + + // Apply the shift depending on which TPC the track is in + geo::Point_t fTrackPos = startP; + fTrackPos.SetX(startPoint.X()); + geo::TPCID tpcid = fGeometryService->PositionToTPCID(fTrackPos); + geo::Vector_t fPosOffsets = fSCE->GetCalPosOffsets(geo::Point_t{fTrackPos.X(),fTrackPos.Y(),fTrackPos.Z()},tpcid.TPC); + startPoint.SetX(fTrackPos.X() + fPosOffsets.X()); + startPoint.SetY(fTrackPos.Y() + fPosOffsets.Y()); + startPoint.SetZ(fTrackPos.Z() + fPosOffsets.Z()); + fTrackPos = endP; + fTrackPos.SetX(endPoint.X()); + tpcid = fGeometryService->PositionToTPCID(fTrackPos); + // fPosOffsets = fSCE->GetCalPosOffsets(fTrackPos,tpcid.TPC); + fPosOffsets = fSCE->GetCalPosOffsets(geo::Point_t{fTrackPos.X(),fTrackPos.Y(),fTrackPos.Z()},tpcid.TPC); + endPoint.SetX(fTrackPos.X() + fPosOffsets.X()); + endPoint.SetY(fTrackPos.Y() + fPosOffsets.Y()); + endPoint.SetZ(fTrackPos.Z() + fPosOffsets.Z()); + fTrackPos = midP; + fTrackPos.SetX(midPoint.X()); + tpcid = fGeometryService->PositionToTPCID(fTrackPos); + //fPosOffsets = fSCE->GetCalPosOffsets(fTrackPos,tpcid.TPC); + fPosOffsets = fSCE->GetCalPosOffsets(geo::Point_t{fTrackPos.X(),fTrackPos.Y(),fTrackPos.Z()},tpcid.TPC); + midPoint.SetX(fTrackPos.X() + fPosOffsets.X()); + midPoint.SetY(fTrackPos.Y() + fPosOffsets.Y()); + midPoint.SetZ(fTrackPos.Z() + fPosOffsets.Z()); + } + + TVector3 startDir = {midPoint.X()-startPoint.X(),midPoint.Y()-startPoint.Y(),midPoint.Z()-startPoint.Z()}; + float norm = startDir.Mag(); + if (norm>0) startDir *=(1.0/norm); + TVector3 endDir = {midPoint.X()-endPoint.X(),midPoint.Y()-endPoint.Y(),midPoint.Z()-endPoint.Z()}; + norm = endDir.Mag(); + if (norm>0) endDir *=(1.0/norm); + + return std::make_pair(startDir, endDir); + + } // CRTT0MatchAlg::TrackDirection() + std::pair CRTT0MatchAlg::TrackDirectionAverageFromPoints(recob::Track track, double frac){ // Calculate direction as an average over directions @@ -126,80 +217,187 @@ std::pair CRTT0MatchAlg::TrackDirectionAverageFromPoints(rec } // CRTT0MatchAlg::TrackDirectionAverageFromPoints() +// Keeping ClosestCRTHit function for backward compatibility only +// *** use GetClosestCRTHit instead + std::pair CRTT0MatchAlg::ClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, recob::Track tpcTrack, std::vector crtHits, const art::Event& event) { - auto tpcTrackHandle = event.getValidHandle>(fTPCTrackLabel); - art::FindManyP findManyHits(tpcTrackHandle, event, fTPCTrackLabel); - std::vector> hits = findManyHits.at(tpcTrack.ID()); - return ClosestCRTHit(detProp, tpcTrack, hits, crtHits); + auto tpcTrackHandle = event.getValidHandle>(fTPCTrackLabel); + art::FindManyP findManyHits(tpcTrackHandle, event, fTPCTrackLabel); + std::vector> hits = findManyHits.at(tpcTrack.ID()); + return ClosestCRTHit(detProp, tpcTrack, hits, crtHits); +} + + +std::pair CRTT0MatchAlg::ClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::vector> hits, std::vector crtHits) { + + auto start = tpcTrack.Vertex(); + auto end = tpcTrack.End(); + // Get the drift direction from the TPC + int driftDirection = TPCGeoUtil::DriftDirectionFromHits(fGeometryService, hits); + std::pair xLimits = TPCGeoUtil::XLimitsFromHits(fGeometryService, hits); + // Get the allowed t0 range + std::pair t0MinMax = TrackT0Range(detProp, start.X(), end.X(), driftDirection, xLimits); + + return ClosestCRTHit(detProp, tpcTrack, t0MinMax, crtHits, driftDirection); } std::pair CRTT0MatchAlg::ClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::pair t0MinMax, std::vector crtHits, int driftDirection) { + recob::Track tpcTrack, std::pair t0MinMax, std::vector crtHits, int driftDirection) { + matchCand bestmatch = GetClosestCRTHit(detProp, tpcTrack,t0MinMax,crtHits,driftDirection); + return std::make_pair(bestmatch.thishit,bestmatch.dca); + +} + + +matchCand CRTT0MatchAlg::GetClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::vector> hits, std::vector crtHits) { + + auto start = tpcTrack.Vertex(); + auto end = tpcTrack.End(); + // Get the drift direction from the TPC + int driftDirection = TPCGeoUtil::DriftDirectionFromHits(fGeometryService, hits); + std::pair xLimits = TPCGeoUtil::XLimitsFromHits(fGeometryService, hits); + // Get the allowed t0 range + std::pair t0MinMax = TrackT0Range(detProp, start.X(), end.X(), driftDirection, xLimits); + + return GetClosestCRTHit(detProp, tpcTrack, t0MinMax, crtHits, driftDirection); +} + +matchCand CRTT0MatchAlg::GetClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::vector crtHits, const art::Event& event) { + auto tpcTrackHandle = event.getValidHandle>(fTPCTrackLabel); + art::FindManyP findManyHits(tpcTrackHandle, event, fTPCTrackLabel); + std::vector> hits = findManyHits.at(tpcTrack.ID()); + return GetClosestCRTHit(detProp, tpcTrack, hits, crtHits); +} + + +matchCand CRTT0MatchAlg::GetClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::pair t0MinMax, std::vector crtHits, int driftDirection) { auto start = tpcTrack.Vertex(); auto end = tpcTrack.End(); - // Calculate direction as an average over directions - std::pair startEndDir = TrackDirectionAverage(tpcTrack, fTrackDirectionFrac); - TVector3 startDir = startEndDir.first; - TVector3 endDir = startEndDir.second; // ====================== Matching Algorithm ========================== // - std::vector> t0Candidates; + // std::vector> t0Candidates; + std::vector t0Candidates; + + // Loop over all the CRT hits for(auto &crtHit : crtHits){ // Check if hit is within the allowed t0 range - double crtTime = -99999.; + double crtTime = -99999.; // units are us if (fTSMode == 1) { crtTime = ((double)(int)crtHit.ts1_ns) * 1e-3 + fTimeCorrection; } else { crtTime = ((double)(int)crtHit.ts0_ns) * 1e-3 + fTimeCorrection; } + // if (crtTime>3000) std::cout << "crt hit times " << crtTime << std::endl; // If track is stitched then try all hits if (!((crtTime >= t0MinMax.first - 10. && crtTime <= t0MinMax.second + 10.) || t0MinMax.first == t0MinMax.second)) continue; + // cut on CRT hit PE value + if (crtHit.peshitfMaxUncert) continue; + if (crtHit.y_err>fMaxUncert) continue; + if (crtHit.z_err>fMaxUncert) continue; + TVector3 crtPoint(crtHit.x_pos, crtHit.y_pos, crtHit.z_pos); - // Calculate the distance between the crossing point and the CRT hit + //Calculate Track direction + std::pair startEndDir; + // dirmethod=2 is original algorithm, dirmethod=1 is simple algorithm for which SCE corrections are possible + if (fDirMethod==2) startEndDir = TrackDirectionAverage(tpcTrack, fTrackDirectionFrac); + else startEndDir = TrackDirection(detProp, tpcTrack, fTrackDirectionFrac, crtTime, driftDirection); + TVector3 startDir = startEndDir.first; + TVector3 endDir = startEndDir.second; + + // Calculate the distance between the crossing point and the CRT hit, SCE corrections are done inside but dropped double startDist = DistOfClosestApproach(detProp, start, startDir, crtHit, driftDirection, crtTime); double endDist = DistOfClosestApproach(detProp, end, endDir, crtHit, driftDirection, crtTime); - // If the distance is less than some limit record the time - if ((crtPoint-start).Mag() < (crtPoint-end).Mag()){ - t0Candidates.push_back(std::make_pair(crtHit, startDist)); + + + double xshift = driftDirection * crtTime * detProp.DriftVelocity(); + auto thisstart = start; + thisstart.SetX(start.X()+xshift); + auto thisend = end; + thisend.SetX(end.X()+xshift); + + // repeat SCE correction for endpoints + if (fSCE->EnableCalSpatialSCE() && fSCEposCorr) { + geo::Point_t temppt = {thisstart.X(),thisstart.Y(),thisstart.Z()}; + geo::TPCID tpcid = fGeometryService->PositionToTPCID(temppt); + geo::Vector_t fPosOffsets = fSCE->GetCalPosOffsets(temppt,tpcid.TPC); + thisstart[0] += fPosOffsets.X(); + thisstart[1] += fPosOffsets.Y(); + thisstart[2] += fPosOffsets.Z(); + temppt.SetX(thisend.X()); + temppt.SetY(thisend.Y()); + temppt.SetZ(thisend.Z()); + tpcid = fGeometryService->PositionToTPCID(temppt); + fPosOffsets = fSCE->GetCalPosOffsets(temppt,tpcid.TPC); + thisend[0] += fPosOffsets.X(); + thisend[1] += fPosOffsets.Y(); + thisend[2] += fPosOffsets.Z(); + } + + + matchCand newmc = makeNULLmc(); + if (startDist 0){ - return t0Candidates[0]; + // Find candidate with shortest DCA or DCA/L value + bestmatch=t0Candidates[0]; + double sin_angle = bestmatch.dca/bestmatch.extrapLen; + if (fDCAoverLength) { // Use dca/extrapLen to judge best + for(auto &thisCand : t0Candidates){ + double this_sin_angle = thisCand.dca/thisCand.extrapLen; + if (bestmatch.dca<0 ) bestmatch=thisCand; + else if (this_sin_angle=0) bestmatch=thisCand; + } + } + else { // use Dca to judge best + for(auto &thisCand : t0Candidates){ + if (bestmatch.dca<0 ) bestmatch=thisCand; + else if (thisCand.dca=0) bestmatch=thisCand; + } + } } - sbn::crt::CRTHit hit; - return std::make_pair(hit, -99999); + // std::cout << "best match has dca of " << bestmatch.dca << std::endl; + return bestmatch; } -std::pair CRTT0MatchAlg::ClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::vector> hits, std::vector crtHits) { - auto start = tpcTrack.Vertex(); - auto end = tpcTrack.End(); - // Get the drift direction from the TPC - int driftDirection = TPCGeoUtil::DriftDirectionFromHits(fGeometryService, hits); - std::pair xLimits = TPCGeoUtil::XLimitsFromHits(fGeometryService, hits); - // Get the allowed t0 range - std::pair t0MinMax = TrackT0Range(detProp, start.X(), end.X(), driftDirection, xLimits); - - return ClosestCRTHit(detProp, tpcTrack, t0MinMax, crtHits, driftDirection); -} double CRTT0MatchAlg::T0FromCRTHits(detinfo::DetectorPropertiesData const& detProp, recob::Track tpcTrack, std::vector crtHits, const art::Event& event){ @@ -214,24 +412,24 @@ double CRTT0MatchAlg::T0FromCRTHits(detinfo::DetectorPropertiesData const& detPr if (tpcTrack.Length() < fMinTrackLength) return -99999; - std::pair closestHit = ClosestCRTHit(detProp, tpcTrack, hits, crtHits); - if(closestHit.second == -99999) return -99999; + matchCand closestHit = GetClosestCRTHit(detProp, tpcTrack, hits, crtHits); + if(closestHit.dca <0) return -99999; double crtTime; if (fTSMode == 1) { - crtTime = ((double)(int)closestHit.first.ts1_ns) * 1e-3 + fTimeCorrection; + crtTime = ((double)(int)closestHit.thishit.ts1_ns) * 1e-3 + fTimeCorrection; } else { - crtTime = ((double)(int)closestHit.first.ts0_ns) * 1e-3 + fTimeCorrection; + crtTime = ((double)(int)closestHit.thishit.ts0_ns) * 1e-3 + fTimeCorrection; } - if(closestHit.second < fDistanceLimit) return crtTime; + if (closestHit.dca < fDistanceLimit && (closestHit.dca/closestHit.extrapLen) < fDoverLLimit) return crtTime; return -99999; } -std::pair CRTT0MatchAlg::T0AndDCAFromCRTHits(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::vector crtHits, const art::Event& event){ + std::pair CRTT0MatchAlg::T0AndDCAFromCRTHits(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::vector crtHits, const art::Event& event){ auto tpcTrackHandle = event.getValidHandle>(fTPCTrackLabel); art::FindManyP findManyHits(tpcTrackHandle, event, fTPCTrackLabel); std::vector> hits = findManyHits.at(tpcTrack.ID()); @@ -239,24 +437,17 @@ std::pair CRTT0MatchAlg::T0AndDCAFromCRTHits(detinfo::DetectorPr } std::pair CRTT0MatchAlg::T0AndDCAFromCRTHits(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::vector> hits, std::vector crtHits) { + recob::Track tpcTrack, std::vector> hits, std::vector crtHits) { - std::pair null = std::make_pair(-99999, -99999); - if (tpcTrack.Length() < fMinTrackLength) return null; + if (tpcTrack.Length() < fMinTrackLength) return std::make_pair(-9999., -9999.); - std::pair closestHit = ClosestCRTHit(detProp, tpcTrack, hits, crtHits); - if(closestHit.second == -99999) return null; + matchCand closestHit = GetClosestCRTHit(detProp, tpcTrack, hits, crtHits); - double crtTime; - if (fTSMode == 1) { - crtTime = ((double)(int)closestHit.first.ts1_ns) * 1e-3 + fTimeCorrection; - } - else { - crtTime = ((double)(int)closestHit.first.ts0_ns) * 1e-3 + fTimeCorrection; - } - if(closestHit.second < fDistanceLimit) return std::make_pair(crtTime, closestHit.second); + if(closestHit.dca < 0 ) return std::make_pair(-9999., -9999.); + if (closestHit.dca < fDistanceLimit && (closestHit.dca/closestHit.extrapLen) < fDoverLLimit) return std::make_pair(closestHit.t0, closestHit.dca); + + return std::make_pair(-9999., -9999.); - return null; } diff --git a/sbndcode/CRT/CRTUtils/CRTT0MatchAlg.h b/sbndcode/CRT/CRTUtils/CRTT0MatchAlg.h index c81f851b7..30f91ba35 100644 --- a/sbndcode/CRT/CRTUtils/CRTT0MatchAlg.h +++ b/sbndcode/CRT/CRTUtils/CRTT0MatchAlg.h @@ -30,6 +30,8 @@ #include "larcorealg/Geometry/GeometryCore.h" #include "lardataobj/Simulation/AuxDetSimChannel.h" #include "larcore/Geometry/AuxDetGeometry.h" +#include "larevt/SpaceCharge/SpaceCharge.h" +#include "larevt/SpaceChargeServices/SpaceChargeService.h" // Utility libraries #include "messagefacility/MessageLogger/MessageLogger.h" @@ -60,6 +62,15 @@ namespace sbnd{ + + struct matchCand { + sbn::crt::CRTHit thishit; + double t0; + double dca; + double extrapLen; + }; + + class CRTT0MatchAlg { public: @@ -69,12 +80,14 @@ namespace sbnd{ fhicl::Atom MinTrackLength { Name("MinTrackLength"), - Comment("") + Comment(""), + 20.0 }; fhicl::Atom TrackDirectionFrac { Name("TrackDirectionFrac"), - Comment("") + Comment(""), + 0.5 }; fhicl::Atom TSMode { @@ -91,7 +104,8 @@ namespace sbnd{ fhicl::Atom DistanceLimit { Name("DistanceLimit"), - Comment("") + Comment(""), + 100. }; fhicl::Atom TPCTrackLabel { @@ -99,20 +113,72 @@ namespace sbnd{ Comment("") }; + + fhicl::Atom DirMethod { + Name("DirMethod"), + Comment("1=endpoints (default), 2=average; must use endpoints if applying SCE position corrections"), + 1 + }; + + fhicl::Atom SCEposCorr { + Name("SCEposCorr"), + Comment("true=do correction before extrapolating track (default), false=skip correction"), + true + }; + + fhicl::Atom DCAuseBox { + Name("DCAuseBox"), + Comment("false = distance to point (default), true = distance to box edge"), + false + }; + + fhicl::Atom DCAoverLength { + Name("DCAoverLength"), + Comment("false = use DCA to select closest CRT hit (default), true = use DCA/extrapolation_length"), + false + }; + + fhicl::Atom DoverLLimit { + Name("DoverLLimit"), + Comment(""), + 1. + }; + + fhicl::Atom PEcut { + Name("PEcut"), + Comment("Only consider CRT hits with PE values larger than this"), + 0.0 + }; + + fhicl::Atom MaxUncert { + Name("MaxUncert"), + Comment("Only consider CRT hits with position uncertainties below this value (cm)"), + 1000.0 + }; + + /* fhicl::Atom DistEndpointAVedge { */ + /* Name("DistEndpointAVedge"), */ + /* Comment("Max distance allowed from track endpoint to edge of FV along track extrapolation to CRT hit (cm)"), */ + /* 200.0 */ + /* }; */ + }; + CRTT0MatchAlg(const Config& config); - CRTT0MatchAlg(const Config& config, geo::GeometryCore const *GeometryService); + CRTT0MatchAlg(const Config& config, geo::GeometryCore const *GeometryService, spacecharge::SpaceCharge const* SCE); CRTT0MatchAlg(const fhicl::ParameterSet& pset) : - CRTT0MatchAlg(fhicl::Table(pset, {})()) {} - - CRTT0MatchAlg(const fhicl::ParameterSet& pset, geo::GeometryCore const *GeometryService) : - CRTT0MatchAlg(fhicl::Table(pset, {})(), GeometryService) {} - + CRTT0MatchAlg(fhicl::Table(pset, {})()) {} + + CRTT0MatchAlg(const fhicl::ParameterSet& pset, geo::GeometryCore const *GeometryService, spacecharge::SpaceCharge const* SCE) : + CRTT0MatchAlg(fhicl::Table(pset, {})(), GeometryService, SCE) {} + CRTT0MatchAlg(); - + void reconfigure(const Config& config); + + // Utility function that determines the possible x range of a track std::pair TrackT0Range(detinfo::DetectorPropertiesData const& detProp, @@ -123,43 +189,64 @@ namespace sbnd{ TVector3 trackPos, TVector3 trackDir, sbn::crt::CRTHit crtHit, int driftDirection, double t0); std::pair TrackDirectionAverage(recob::Track track, double frac); + std::pair TrackDirection(detinfo::DetectorPropertiesData const& detProp,recob::Track track, double frac, double CRTtime, int driftDirection); std::pair TrackDirectionAverageFromPoints(recob::Track track, double frac); - // Return the closest CRT hit to a TPC track and the DCA + // Keeping ClosestCRTHit function for backwards compatibility + // *** use GetClosestCRTHit instead std::pair ClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::pair t0MinMax, std::vector crtHits, int driftDirection); + recob::Track tpcTrack, std::pair t0MinMax, std::vector crtHits, int driftDirection); std::pair ClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::vector crtHits, const art::Event& event); + recob::Track tpcTrack, std::vector crtHits, const art::Event& event); std::pair ClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::vector> hits, std::vector crtHits); + recob::Track tpcTrack, std::vector> hits, std::vector crtHits); + + // Return the closest CRT hit to a TPC track and the DCA + matchCand GetClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::pair t0MinMax, std::vector crtHits, int driftDirection); + + matchCand GetClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::vector crtHits, const art::Event& event); + + matchCand GetClosestCRTHit(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::vector> hits, std::vector crtHits); // Match track to T0 from CRT hits double T0FromCRTHits(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::vector crtHits, const art::Event& event); + recob::Track tpcTrack, std::vector crtHits, const art::Event& event); double T0FromCRTHits(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::vector> hits, std::vector crtHits); - + recob::Track tpcTrack, std::vector> hits, std::vector crtHits); + // Match track to T0 from CRT hits, also return the DCA - std::pair T0AndDCAFromCRTHits(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::vector crtHits, const art::Event& event); - std::pair T0AndDCAFromCRTHits(detinfo::DetectorPropertiesData const& detProp, - recob::Track tpcTrack, std::vector> hits, std::vector crtHits); - + std::pair T0AndDCAFromCRTHits(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::vector crtHits, const art::Event& event); + std::pair T0AndDCAFromCRTHits(detinfo::DetectorPropertiesData const& detProp, + recob::Track tpcTrack, std::vector> hits, std::vector crtHits); + private: geo::GeometryCore const* fGeometryService; + spacecharge::SpaceCharge const* fSCE; double fMinTrackLength; double fTrackDirectionFrac; double fDistanceLimit; int fTSMode; double fTimeCorrection; + int fDirMethod; + bool fSCEposCorr; + bool fDCAuseBox; + bool fDCAoverLength; + double fDoverLLimit; + double fPEcut; + double fMaxUncert; + // double fDistEndpointAVedge; art::InputTag fTPCTrackLabel; }; -} +} #endif diff --git a/sbndcode/CRT/CRTUtils/crtt0matchingalg_sbnd.fcl b/sbndcode/CRT/CRTUtils/crtt0matchingalg_sbnd.fcl index dcc78db68..7bd881ebe 100644 --- a/sbndcode/CRT/CRTUtils/crtt0matchingalg_sbnd.fcl +++ b/sbndcode/CRT/CRTUtils/crtt0matchingalg_sbnd.fcl @@ -2,17 +2,31 @@ BEGIN_PROLOG standard_crtt0matchingalg: { - DistanceLimit: 60. # Maximum distance between projected crossing point and CRT hit - MinTrackLength: 20. # Minimum track length to perform T0 matching on - TrackDirectionFrac: 0.5 # Minimum track length to perform T0 matching on + DistanceLimit: 30. # Maximum DCA between projected crossing point and CRT hit, default = 100 cm + MinTrackLength: 20. # Minimum track length to perform T0 matching on, default = 20 cm. + # No attempt is made to tag tracks shorter than this + TrackDirectionFrac: 0.5 # the fraction of track used to determine direction, don't mess with this TPCTrackLabel: "pandoraTrack" + DirMethod: 1 # method to determine track direction for extraploation + # 1=endpoints (default), 2=average; must use endpoints if applying SCE position corrections + SCEposCorr: true # apply SCE position corrections to track before extrapolating + # use false if the input tracks already have SCE corrections applied + DCAuseBox: false # false = distance to point (default), true = distance to box edge + DCAoverLength: false # false = use DCA to select closest CRT hit (default), true = use DCA/extrapolation_length + DoverLLimit: 1.0 # 1.0 default, this is the sin of the opening angle between the track extrapolation and the line connecting + # the track endpoint and the CRT hit + # note that both limits (distance and DoverL) are used independent of which one is used to select + # the closest hit. Matches with values less than either limit are not considered. + PEcut: 60 # Only consider CRT hits with PE values larger than this, default = 0.0 + MaxUncert: 20 # Only consider CRT hits with position uncertainties below this value (cm) default = 1000.0 cm + # a cut value of 20 is recommended if one wants to remove all single strip hits } sbnd_crtt0matchingalg_crID: { DistanceLimit: 35. # Maximum distance between projected crossing point and CRT hit MinTrackLength: 20. # Minimum track length to perform T0 matching on - TrackDirectionFrac: 0.5 # Minimum track length to perform T0 matching on + TrackDirectionFrac: 0.5 # the fraction of track used to determine direction, don't mess with this TPCTrackLabel: "pandoraTrack" } From 70bf6e6ba0ce901a12d30a8f170b9dbf87093535 Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Thu, 25 Nov 2021 07:36:52 -0600 Subject: [PATCH 2/6] Add g4 sce fcl file with no rollup --- .../standard/g4/g4_sce_no_shower_rollup.fcl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl diff --git a/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl new file mode 100644 index 000000000..acd579d99 --- /dev/null +++ b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl @@ -0,0 +1,9 @@ +# File: g4_no_shower_rollup.fcl +# Purpose: Same as standard_g4_sbnd.fcl, but saves all EM shower daughter particles. +# +# This runs the new, refactored, LArG4 simulation. + + +#include "g4_sce.fcl" + +services.ParticleListAction.keepEMShowerDaughters: true From aba79ffa243efa87f76bca72d29e32d0e914e2a6 Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Fri, 26 Nov 2021 03:54:48 -0600 Subject: [PATCH 3/6] Update description --- .../JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl index acd579d99..795d8e4d0 100644 --- a/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl +++ b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl @@ -1,5 +1,5 @@ # File: g4_no_shower_rollup.fcl -# Purpose: Same as standard_g4_sbnd.fcl, but saves all EM shower daughter particles. +# Purpose: Same as g4_sce.fcl, but saves all EM shower daughter particles. # # This runs the new, refactored, LArG4 simulation. From df756f772a7c3c3a07dde614791620840f5c9aeb Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Fri, 26 Nov 2021 03:55:13 -0600 Subject: [PATCH 4/6] Add fcl file to turn off mcreco --- .../g4/g4_sce_no_shower_rollup_no_mcreco.fcl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup_no_mcreco.fcl diff --git a/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup_no_mcreco.fcl b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup_no_mcreco.fcl new file mode 100644 index 000000000..328d30246 --- /dev/null +++ b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup_no_mcreco.fcl @@ -0,0 +1,16 @@ +# File: g4_no_shower_rollup.fcl +# Purpose: Same as g4_sce_no_shower_rollup.fcl, but removes mcreco from the simulate process +# +# This runs the new, refactored, LArG4 simulation. + + +#include "g4_sce_no_shower_rollup.fcl" + +physics.simulate: [ rns + , loader + , largeant + , ionandscint + , pdfastsim + , simdrift + , genericcrt + ] From 4306bdb49a704c8a77847676b6aa30efc3ddb69c Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Fri, 26 Nov 2021 04:18:15 -0600 Subject: [PATCH 5/6] Naming --- .../JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl | 2 +- .../standard/g4/g4_sce_no_shower_rollup_no_mcreco.fcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl index 795d8e4d0..b6569ed74 100644 --- a/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl +++ b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup.fcl @@ -1,4 +1,4 @@ -# File: g4_no_shower_rollup.fcl +# File: g4_sce_no_shower_rollup.fcl # Purpose: Same as g4_sce.fcl, but saves all EM shower daughter particles. # # This runs the new, refactored, LArG4 simulation. diff --git a/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup_no_mcreco.fcl b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup_no_mcreco.fcl index 328d30246..41f822708 100644 --- a/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup_no_mcreco.fcl +++ b/sbndcode/JobConfigurations/standard/g4/g4_sce_no_shower_rollup_no_mcreco.fcl @@ -1,4 +1,4 @@ -# File: g4_no_shower_rollup.fcl +# File: g4_sce_no_shower_rollup_no_mcreco.fcl # Purpose: Same as g4_sce_no_shower_rollup.fcl, but removes mcreco from the simulate process # # This runs the new, refactored, LArG4 simulation. From ed89f16abad4607afd4e6d72c246700597bfb292 Mon Sep 17 00:00:00 2001 From: Patrick Green Date: Fri, 26 Nov 2021 07:42:13 -0600 Subject: [PATCH 6/6] Update to v09_37_01_01 --- CMakeLists.txt | 2 +- ups/product_deps | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7968ba671..65e114fcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ cmake_minimum_required(VERSION 3.19 FATAL_ERROR) -project(sbndcode VERSION 09.37.01 LANGUAGES CXX) +project(sbndcode VERSION 09.37.01.01 LANGUAGES CXX) message(STATUS "\n") message(STATUS "================================= ${PROJECT_NAME} =================================") diff --git a/ups/product_deps b/ups/product_deps index 8a39e529d..d14f4bce6 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -34,9 +34,9 @@ fwdir product_dir scripts # Add the dependent product and version product version -sbncode v09_37_01 +sbncode v09_37_01_01 sbnd_data v01_10_00 - optional -sbndutil v09_37_01 - optional +sbndutil v09_37_01_01 - optional # list products required ONLY for the build # any products here must NOT have qualifiers