From c130bbd030368e3ac7569985c1188b3b00f85311 Mon Sep 17 00:00:00 2001 From: Gianluca Petrillo Date: Tue, 10 Sep 2019 13:32:35 -0500 Subject: [PATCH 01/13] Updated PMT dark current rate to measured value from CERN test stand. --- icaruscode/PMT/Algorithms/pmtsimulation_icarus.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icaruscode/PMT/Algorithms/pmtsimulation_icarus.fcl b/icaruscode/PMT/Algorithms/pmtsimulation_icarus.fcl index 0b411c7af..4d92ae353 100644 --- a/icaruscode/PMT/Algorithms/pmtsimulation_icarus.fcl +++ b/icaruscode/PMT/Algorithms/pmtsimulation_icarus.fcl @@ -40,7 +40,7 @@ icarus_pmtsimulationalg_standard: { RiseTime: 3.8 #ns MeanAmplitude: 0.9 #in pC AmpNoise: 1.0 #in ADC - DarkNoiseRate: 1000.0 #in Hz + DarkNoiseRate: 1600.0 # in Hz; from CERN test stand measurement ##This is the readout window size for each "trigger" on the electronics ReadoutWindowSize: 2000 #ticks (if 2ns each --> 4us) From 3683b4b87fac3c3f33088d2cc5f2a286ba753631 Mon Sep 17 00:00:00 2001 From: "Usher, Tracy L" Date: Mon, 16 Sep 2019 15:54:48 -0500 Subject: [PATCH 02/13] Chasing larsoft --- ups/product_deps | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ups/product_deps b/ups/product_deps index 50075c08f..ee05ea691 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -2,7 +2,7 @@ # The *parent* line must the first non-commented line and defines this product and version # The version must be of the form vxx_yy_zz (e.g. v01_02_03) -parent icaruscode v08_30_01 +parent icaruscode v08_30_02 defaultqual e17 # These optional lines define where headers, libraries, and executables go and should @@ -33,7 +33,7 @@ table_fragment_end # Add the dependent product and version product version -larsoft v08_30_01 +larsoft v08_30_02 icarusutil v08_30_00 icarus_data v08_28_00 genie_xsec v3_00_04a From 9a83c53534ea687953478344e480f4c2074e3c47 Mon Sep 17 00:00:00 2001 From: Filippo Varanini Date: Mon, 23 Sep 2019 14:23:30 -0500 Subject: [PATCH 03/13] plane-dependent SBN noise. Improvement to noise analysis module --- icaruscode/Analysis/ana_mods_icarus.fcl | 71 +++++++++++++++++++ .../tools/TrackHitEfficiencyAnalysis_tool.cc | 63 ++++++++++++---- .../DetSim/detsimmodules_ICARUS.fcl | 47 ++++++++++-- 3 files changed, 164 insertions(+), 17 deletions(-) create mode 100644 icaruscode/Analysis/ana_mods_icarus.fcl diff --git a/icaruscode/Analysis/ana_mods_icarus.fcl b/icaruscode/Analysis/ana_mods_icarus.fcl new file mode 100644 index 000000000..17d6d4bee --- /dev/null +++ b/icaruscode/Analysis/ana_mods_icarus.fcl @@ -0,0 +1,71 @@ +#include "analysis_icarus.fcl" +#include "reco_icarus_driver_common.fcl" + +process_name: HitEfficiency + +#Start each new event with an empty event. +source: +{ + module_type: RootInput + maxEvents: 10 # Number of events to create +} + +# Define and configure some modules to do work on each event. +# First modules are defined; they are scheduled later. +# Modules are grouped by type. +physics: +{ + analyzers: + { + hitEffAnalysisGauss: @local::icarus_HitEfficiencyAnalysis + hitEffAnalysisCluster3d: @local::icarus_HitEfficiencyAnalysis + hitEffAnalysisRaw: @local::icarus_HitEfficiencyAnalysis + } + + #define the producer and filter modules for this path, order matters, + #filters reject all following items. see lines starting physics.producers below + ana: [ hitEffAnalysisGauss, hitEffAnalysisCluster3d, hitEffAnalysisRaw ] + end_paths: [ana] +} + +#block to define where the output goes. if you defined a filter in the physics +#block and put it in the trigger_paths then you need to put a SelectEvents: {SelectEvents: [XXX]} +#entry in the output stream you want those to go to, where XXX is the label of the filter module(s) +outputs: +{ + out1: + { + module_type: RootOutput + fileName: "hitEfficiency_icarus.root" + dataTier: "reco-simulated" + compressionLevel: 1 + fastCloning: false + } +} + +physics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].OffsetVec: [9, 4, 2] +physics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].RawDigitLabel: "rawdigitfilter" +physics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].WireModuleLabel: "recowireraw" +physics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].HitModuleLabel: "icarushit" +physics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].MCParticleLabel: "largeant" +physics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].SimChannelLabel: "largeant" +phsyics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].UseBadChannelDB: false + +physics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].RawDigitLabel: "rawdigitfilter" +physics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].WireModuleLabel: "recowire" #"decon1droi" +physics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].HitModuleLabel: "gaushit" +physics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].MCParticleLabel: "largeant" +physics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].SimChannelLabel: "largeant" +phsyics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].UseBadChannelDB: false + +physics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].RawDigitLabelVec: ["rawDigitFilterTPC0","rawDigitFilterTPC1","rawDigitFilterTPC2","rawDigitFilterTPC3"] +physics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].WireModuleLabelVec: ["decon1DroiTPC0","decon1DroiTPC1","decon1DroiTPC2","decon1DroiTPC3"] +physics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].HitModuleLabelVec: ["gaushitTPC0","gaushitTPC1","gaushitTPC2","gaushitTPC3"] +phsyics.analyzers.hitEffAnalysisGauss.HitEfficiencyHistogramToolList[0].UseBadChannelDB: false +physics.analyzers.hitEffAnalysisCluster3d.HitEfficiencyHistogramToolList[0].RawDigitLabelVec: ["rawDigitFilterTPC0","rawDigitFilterTPC1","rawDigitFilterTPC2","rawDigitFilterTPC3"] +physics.analyzers.hitEffAnalysisCluster3d.HitEfficiencyHistogramToolList[0].WireModuleLabelVec: ["decon1DroiTPC0","decon1DroiTPC1","decon1DroiTPC2","decon1DroiTPC3"] +physics.analyzers.hitEffAnalysisCluster3d.HitEfficiencyHistogramToolList[0].HitModuleLabelVec: ["cluster3DCryo0","cluster3DCryo1"] +phsyics.analyzers.hitEffAnalysisCluster3d.HitEfficiencyHistogramToolList[0].UseBadChannelDB: false +physics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].RawDigitLabelVec: ["rawDigitFilterTPC0","rawDigitFilterTPC1","rawDigitFilterTPC2","rawDigitFilterTPC3"] +physics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].WireModuleLabelVec: ["recoWireRawTPC0","recoWireRawTPC1","recoWireRawTPC2","recoWireRawTPC3"] +physics.analyzers.hitEffAnalysisRaw.HitEfficiencyHistogramToolList[0].HitModuleLabelVec: ["icarusHitTPC0","icarusHitTPC1","icarusHitTPC2","icarusHitTPC3"] diff --git a/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc b/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc index 6957c4e28..e866df8e8 100755 --- a/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc +++ b/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc @@ -149,8 +149,11 @@ class TrackHitEfficiencyAnalysis : virtual public IHitEfficiencyHistogramTool std::vector fNSimChannelHitsVec; std::vector fNRecobHitVec; + //std::vector fNRejectedHitVec; std::vector fHitEfficiencyVec; + std::vector fNFakeHitVec; + // TTree variables mutable TTree* fTree; @@ -261,7 +264,9 @@ void TrackHitEfficiencyAnalysis::initializeHists(art::ServiceHandleNplanes()); fHitENEvXZVec.resize(fGeometry->Nplanes()); fNSimChannelHitsVec.resize(fGeometry->Nplanes()); - fNRecobHitVec.resize(fGeometry->Nplanes()); +fNRecobHitVec.resize(fGeometry->Nplanes()); +fNFakeHitVec.resize(fGeometry->Nplanes()); +//fNRejectedHitVec.resize(fGeometry->Nplanes()); fHitEfficiencyVec.resize(fGeometry->Nplanes()); fSimDivHitChgVec.resize(fGeometry->Nplanes()); fSimDivHitChg1Vec.resize(fGeometry->Nplanes()); @@ -290,6 +295,8 @@ void TrackHitEfficiencyAnalysis::initializeHists(art::ServiceHandle(("DeltaMid" + std::to_string(plane)).c_str(), ";# hits", 50, -25., 25.); fNSimChannelHitsVec.at(plane) = dir.make(("NSimChan" + std::to_string(plane)).c_str(), ";# hits", 100, 0., 1200.); fNRecobHitVec.at(plane) = dir.make(("NRecobHit" + std::to_string(plane)).c_str(), ";# hits", 100, 0., 1200.); +fNFakeHitVec.at(plane) = dir.make(("NFakeHit" + std::to_string(plane)).c_str(), ";# hits", 100, 0., 50.); + // fNRejectedHitVec.at(plane) = dir.make(("NRejectedHit" + std::to_string(plane)).c_str(), ";# hits", 100, 0., 1200.); fHitEfficiencyVec.at(plane) = dir.make(("PlnEffic" + std::to_string(plane)).c_str(), ";# hits", 101, 0., 1.01); fSimDivHitChgVec.at(plane) = dir.make(("SimDivHit" + std::to_string(plane)).c_str(), ";# e / SummedADC", 200, 0., 200.); fSimDivHitChg1Vec.at(plane) = dir.make(("SimDivHit1" + std::to_string(plane)).c_str(), ";# e / Integral", 200, 0., 200.); @@ -389,6 +396,7 @@ void TrackHitEfficiencyAnalysis::clear() const void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const { + // std::cout << " filling histos " << std::endl; // Basic assumption is that the producer label vecs for RawDigits and Wire data are // all the same length and in the same order. Here we just check for length if (fRawDigitProducerLabelVec.size() != fWireProducerLabelVec.size()) return; @@ -443,14 +451,18 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const // Now start a loop over the individual TPCs to build out the structures for RawDigits and Wires for(size_t tpcID = 0; tpcID < fRawDigitProducerLabelVec.size(); tpcID++) { +//std::cout << "TPC " << tpcID << " label " << fRawDigitProducerLabelVec[tpcID] << std::endl; +//std::cout << "TPC " << tpcID << " wire label " << fWireProducerLabelVec[tpcID] << std::endl; art::Handle< std::vector > rawDigitHandle; event.getByLabel(fRawDigitProducerLabelVec[tpcID], rawDigitHandle); +//std::cout << " rawDigitHandle? " << rawDigitHandle.isValid() << std::endl; art::Handle< std::vector > wireHandle; event.getByLabel(fWireProducerLabelVec[tpcID], wireHandle); - + // std::cout << " wireHandle? " << wireHandle.isValid() << std::endl; if (!rawDigitHandle.isValid() || !wireHandle.isValid()) return; +//std::cout << " valid labels " << std::endl; for(const auto& wire : *wireHandle) channelToWireMap[wire.Channel()] = &wire; for(const auto& rawDigit : *rawDigitHandle) chanToRawDigitMap[rawDigit.Channel()] = &rawDigit; @@ -475,12 +487,18 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const TrackIDToMCParticleMap trackIDToMCParticleMap; - for(const auto& mcParticle : *mcParticleHandle) trackIDToMCParticleMap[mcParticle.TrackId()] = &mcParticle; + for(const auto& mcParticle : *mcParticleHandle) { + trackIDToMCParticleMap[mcParticle.TrackId()] = &mcParticle; + // std::cout << " MCP process " << mcParticle.Process() << std::endl; + } const lariov::ChannelStatusProvider& chanFilt = art::ServiceHandle()->GetProvider(); std::vector nSimChannelHitVec = {0,0,0}; std::vector nRecobHitVec = {0,0,0}; + std::vector nFakeHitVec = {0,0,0}; + std::vector nSimulatedWiresVec = {0,0,0}; +unsigned int lastwire=-1; for(const auto& partToChanInfo : partToChanToTDCToIDEMap) { TrackIDToMCParticleMap::const_iterator trackIDToMCPartItr = trackIDToMCParticleMap.find(partToChanInfo.first); @@ -489,10 +507,11 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const int trackPDGCode = trackIDToMCPartItr->second->PdgCode(); std::string processName = trackIDToMCPartItr->second->Process(); - + //std::cout << " trackPDGcode " << trackPDGCode << std::endl; + //std::cout << " processName " << processName << std::endl; // Looking for primary muons (e.g. CR Tracks) if (fabs(trackPDGCode) != 13 || processName != "primary") continue; - + //if (fabs(trackPDGCode) != 13) continue; // Recover particle position and angle information Eigen::Vector3f partStartPos(trackIDToMCPartItr->second->Vx(),trackIDToMCPartItr->second->Vy(),trackIDToMCPartItr->second->Vz()); Eigen::Vector3f partStartDir(trackIDToMCPartItr->second->Px(),trackIDToMCPartItr->second->Py(),trackIDToMCPartItr->second->Pz()); @@ -515,8 +534,8 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const // This is the "correct" way to check and remove bad channels... if( chanFilt.Status(chanToTDCToIDEMap.first) < fMinAllowedChanStatus) { - //std::vector wids = fGeometry->ChannelToWire(chanToTDCToIDEMap.first); - //std::cout << "*** skipping bad channel with status: " << chanFilt.Status(chanToTDCToIDEMap.first) << " for channel: " << chanToTDCToIDEMap.first << ", plane: " << wids[0].Plane << ", wire: " << wids[0].Wire << std::endl; + std::vector wids = fGeometry->ChannelToWire(chanToTDCToIDEMap.first); + std::cout << "*** skipping bad channel with status: " << chanFilt.Status(chanToTDCToIDEMap.first) << " for channel: " << chanToTDCToIDEMap.first << ", plane: " << wids[0].Plane << ", wire: " << wids[0].Wire << std::endl; continue; } } @@ -562,8 +581,10 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const // Recover plane and wire in the plane unsigned int plane = wids[0].Plane; -// unsigned int wire = wids[0].Wire; - + unsigned int wire = wids[0].Wire; +//std::cout << " plane " << plane << " wire " << wire << std::endl; +if(wire!=lastwire) nSimulatedWiresVec[plane]++; +lastwire=wire; Eigen::Vector3f avePosition(0.,0.,0.); for(const auto& ideVal : tdcToIDEMap) @@ -605,7 +626,9 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const unsigned short startTDC = tdcToIDEMap.begin()->first; unsigned short stopTDC = tdcToIDEMap.rbegin()->first; - + +//std::cout << " startTDC " << startTDC << std::endl; +// std::cout << " stopTDC " << stopTDC << std::endl; // Convert to ticks to get in same units as hits unsigned short startTick = fClockService->TPCTDC2Tick(startTDC) + fOffsetVec[plane]; unsigned short stopTick = fClockService->TPCTDC2Tick(stopTDC) + fOffsetVec[plane]; @@ -680,12 +703,16 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const { unsigned short hitStartTick = hit->PeakTime() - fSigmaVec[plane] * hit->RMS(); unsigned short hitStopTick = hit->PeakTime() + fSigmaVec[plane] * hit->RMS(); + + // unsigned short midHitTick = (hitStopTick + hitStartTick) / 2; // If hit is out of range then skip, it is not related to this particle if (hitStartTick > stopTick || hitStopTick < startTick) { - if (plane == 2) rejectedHit = hit; + // std::cout << " fake hit: wire " << wire << " plane " << plane << std::endl; + nFakeHitVec[plane]++; + rejectedHit = hit; continue; } @@ -749,9 +776,12 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const fDeltaMidTDCVec[plane]->Fill(hitPeakTimeBest - maxETick, 1.); nRecobHitVec[plane]++; + } else if (rejectedHit) - { + { + //std::cout << " rejecting hit " << std::endl; + // nRejectedHitVec[plane]++; unsigned short hitStartTick = rejectedHit->PeakTime() - fSigmaVec[plane] * rejectedHit->RMS(); unsigned short hitStopTick = rejectedHit->PeakTime() + fSigmaVec[plane] * rejectedHit->RMS(); @@ -766,6 +796,9 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const } } + + + fWireEfficVec.at(plane)->Fill(totalElectrons, std::min(nMatchedWires,1), 1.); fWireEfficPHVec.at(plane)->Fill(maxElectrons, std::min(nMatchedWires,1), 1.); @@ -816,12 +849,18 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const for(size_t idx = 0; idx < fGeometry->Nplanes();idx++) { +std::cout << " plane " << idx << " simchannelhits " << nSimChannelHitVec[idx] << std::endl; if (nSimChannelHitVec[idx] > 10) { float hitEfficiency = float(nRecobHitVec[idx]) / float(nSimChannelHitVec[idx]); +std::cout << " hit efficiency " << hitEfficiency << std::endl; fNSimChannelHitsVec[idx]->Fill(std::min(nSimChannelHitVec[idx],1999),1.); fNRecobHitVec[idx]->Fill(std::min(nRecobHitVec[idx],1999), 1.); + fNFakeHitVec[idx]->Fill(nFakeHitVec[idx]/(float)nSimulatedWiresVec[idx],1.); +std::cout << " plane " << idx << " fakes " << nFakeHitVec[idx] << std::endl; +std::cout << " matched wires " << nSimulatedWiresVec[idx] << std::endl; +std::cout << " fake hit ratio " << nFakeHitVec[idx]/(float)nSimulatedWiresVec[idx] << std::endl; fHitEfficiencyVec[idx]->Fill(hitEfficiency, 1.); } } diff --git a/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl b/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl index 5769d7504..b4b8afd14 100644 --- a/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl +++ b/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl @@ -1,4 +1,4 @@ -BEGIN_PROLOG + BEGIN_PROLOG NoiseFromHistTool: @@ -26,7 +26,7 @@ CorrelatedNoiseTool: CorrAmpHistogramName: "hbrms" StoreHistograms: true } -SBNNoiseTool: +SBNNoiseToolInd1: { tool_type: SBNNoise Plane: 0 @@ -35,7 +35,43 @@ SBNNoiseTool: CorrelatedSeed: 1000 UncorrelatedSeed: 5000 StoreHistograms: false - NoiseHistFileName: "FFtsbnEE20M.root" + NoiseHistFileName: "FFTww01m.root" + + CorrelatedHistogramName: "fftBhisto" + UncorrelatedHistogramName: "fftUhisto" + TotalRMSHistoName: "RMShisto" + CorrelatedRMSHistoName: "RMSBhisto" + UncorrelatedRMSHistoName: "RMSUhisto" +} +SBNNoiseToolInd2: +{ + tool_type: SBNNoise + Plane: 1 + MedianNumBins: 25 + NoiseRand: 0. + CorrelatedSeed: 1000 + UncorrelatedSeed: 5000 + StoreHistograms: false + + NoiseHistFileName: "FFTwe10.root" + + CorrelatedHistogramName: "fftBhisto" + UncorrelatedHistogramName: "fftUhisto" + TotalRMSHistoName: "RMShisto" + CorrelatedRMSHistoName: "RMSBhisto" + UncorrelatedRMSHistoName: "RMSUhisto" +} +SBNNoiseToolColl: +{ + tool_type: SBNNoise + Plane: 2 + MedianNumBins: 25 + NoiseRand: 0. + CorrelatedSeed: 1000 + UncorrelatedSeed: 5000 + StoreHistograms: false + + NoiseHistFileName: "FFTwe10.root" CorrelatedHistogramName: "fftBhisto" UncorrelatedHistogramName: "fftUhisto" TotalRMSHistoName: "RMShisto" @@ -61,7 +97,7 @@ standard_simwire: TPC: 0 CompressionType: "none" SimDeadChannels: false - SuppressNoSignal: false + SuppressNoSignal: true SmearPedestals: true Test: false TestWire: 0 @@ -69,7 +105,8 @@ standard_simwire: TestCharge: [ 0. ] Sample: -1 MakeHistograms: "true" - NoiseGenToolVec: [@local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool] + #NoiseGenToolVec: [@local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool] +NoiseGenToolVec: [@local::SBNNoiseToolInd1, @local::SBNNoiseToolInd2, @local::SBNNoiseToolColl] } icarus_simwire: @local::standard_simwire From 5d70525ee05eb501271f5848daca1b8e1ab87314 Mon Sep 17 00:00:00 2001 From: "Usher, Tracy L" Date: Tue, 24 Sep 2019 13:53:25 -0700 Subject: [PATCH 04/13] Chasing LArSoft --- ups/product_deps | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ups/product_deps b/ups/product_deps index ee05ea691..f06aecb96 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -2,7 +2,7 @@ # The *parent* line must the first non-commented line and defines this product and version # The version must be of the form vxx_yy_zz (e.g. v01_02_03) -parent icaruscode v08_30_02 +parent icaruscode v08_31_00 defaultqual e17 # These optional lines define where headers, libraries, and executables go and should @@ -33,12 +33,12 @@ table_fragment_end # Add the dependent product and version product version -larsoft v08_30_02 -icarusutil v08_30_00 -icarus_data v08_28_00 +larsoft v08_31_00 +icarusutil v08_31_00 +icarus_data v08_31_00 genie_xsec v3_00_04a -cetbuildtools v7_13_02 - only_for_build +cetbuildtools v7_14_00 - only_for_build end_product_list # Restore this temporarily... From 997a5a292148fafd2738c25d22f101b313d1f7cc Mon Sep 17 00:00:00 2001 From: Filippo Varanini Date: Tue, 24 Sep 2019 16:33:48 -0500 Subject: [PATCH 05/13] set old(correlated) noise model as default. added SBNNoise subdirectory with override --- .../multitpc_detsim_icarus_sbnnoise.fcl | 90 +++++++++++++++++++ .../DetSim/detsimmodules_ICARUS.fcl | 4 +- 2 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 fcl/detsim/SBNNoise/multitpc_detsim_icarus_sbnnoise.fcl diff --git a/fcl/detsim/SBNNoise/multitpc_detsim_icarus_sbnnoise.fcl b/fcl/detsim/SBNNoise/multitpc_detsim_icarus_sbnnoise.fcl new file mode 100644 index 000000000..332c51aef --- /dev/null +++ b/fcl/detsim/SBNNoise/multitpc_detsim_icarus_sbnnoise.fcl @@ -0,0 +1,90 @@ +#include "services_icarus_simulation.fcl" +#include "detsimmodules_ICARUS.fcl" +#include "opdetsim_pmt_icarus.fcl" +#include "crtsimmodules_icarus.fcl" + +process_name: DetSim + +services: +{ + #FileCatalogMetadata: @local::art_file_catalog_mc + @table::icarus_detsim_services +} + +#source is now a root file +source: +{ + module_type: RootInput + saveMemoryObjectThreshold: 0 +} + +# Define and configure some modules to do work on each event. +# First modules are defined; they are scheduled later. +# Modules are grouped by type. +physics: +{ + + producers: + { + crtdaq: @local::icarus_crtsim + #opdaq: @local::icarus_simpmt + opdaq: @local::icarus_simpmt_nonoise #turn off the noise so it runs more quickly + daq0: @local::icarus_simwire + daq1: @local::icarus_simwire + daq2: @local::icarus_simwire + daq3: @local::icarus_simwire + rns: { module_type: "RandomNumberSaver" } + } + + #define the producer and filter modules for this path, order matters, + #filters reject all following items. see lines starting physics.producers below + simulate: [ rns, opdaq, daq0, daq1, daq2, daq3, crtdaq ] + + #define the output stream, there could be more than one if using filters + stream1: [ out1 ] + + #trigger_paths is a keyword and contains the paths that modify the art::event, + #ie filters and producers + trigger_paths: [ simulate ] + + #end_paths is a keyword and contains the paths that do not modify the art::Event, + #ie analyzers and output streams. these all run simultaneously + end_paths: [stream1] +} + +# +# For MCC1.1 we are still suppressing channels with no signal in the TPC +physics.producers.daq0.SuppressNoSignal: false +physics.producers.daq0.Cryostat: 0 +physics.producers.daq0.TPC: 0 +physics.producers.daq1.SuppressNoSignal: false +physics.producers.daq1.Cryostat: 0 +physics.producers.daq1.TPC: 1 +physics.producers.daq2.SuppressNoSignal: false +physics.producers.daq2.Cryostat: 1 +physics.producers.daq2.TPC: 0 +physics.producers.daq3.SuppressNoSignal: false +physics.producers.daq3.Cryostat: 1 +physics.producers.daq3.TPC: 1 + +physics.producers.daq0.NoiseGenToolVec: [@local::SBNNoiseToolInd1, @local::SBNNoiseToolInd2, @local::SBNNoiseToolColl] +physics.producers.daq1.NoiseGenToolVec: [@local::SBNNoiseToolInd1, @local::SBNNoiseToolInd2, @local::SBNNoiseToolColl] +physics.producers.daq2.NoiseGenToolVec: [@local::SBNNoiseToolInd1, @local::SBNNoiseToolInd2, @local::SBNNoiseToolColl] +physics.producers.daq3.NoiseGenToolVec: [@local::SBNNoiseToolInd1, @local::SBNNoiseToolInd2, @local::SBNNoiseToolColl] + +#block to define where the output goes. if you defined a filter in the physics +#block and put it in the trigger_paths then you need to put a SelectEvents: {SelectEvents: [XXX]} +#entry in the output stream you want those to go to, where XXX is the label of the filter module(s) +outputs: +{ + out1: + { + module_type: RootOutput + fileName: "%ifb_%tc-%p.root" + dataTier: "detector-simulated" + saveMemoryObjectThreshold: 0 + compressionLevel: 1 + fastCloning: false + } +} + diff --git a/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl b/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl index b4b8afd14..9dac84b92 100644 --- a/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl +++ b/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl @@ -105,8 +105,8 @@ standard_simwire: TestCharge: [ 0. ] Sample: -1 MakeHistograms: "true" - #NoiseGenToolVec: [@local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool] -NoiseGenToolVec: [@local::SBNNoiseToolInd1, @local::SBNNoiseToolInd2, @local::SBNNoiseToolColl] + NoiseGenToolVec: [@local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool] +#NoiseGenToolVec: [@local::SBNNoiseToolInd1, @local::SBNNoiseToolInd2, @local::SBNNoiseToolColl] } icarus_simwire: @local::standard_simwire From 448ab1ebbac8aa2b6406f1ce1587298ede1c869b Mon Sep 17 00:00:00 2001 From: Filippo Varanini Date: Wed, 25 Sep 2019 11:49:40 -0500 Subject: [PATCH 06/13] setting SuppressNoSignal to true --- fcl/detsim/SBNNoise/multitpc_detsim_icarus_sbnnoise.fcl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fcl/detsim/SBNNoise/multitpc_detsim_icarus_sbnnoise.fcl b/fcl/detsim/SBNNoise/multitpc_detsim_icarus_sbnnoise.fcl index 332c51aef..6898b3048 100644 --- a/fcl/detsim/SBNNoise/multitpc_detsim_icarus_sbnnoise.fcl +++ b/fcl/detsim/SBNNoise/multitpc_detsim_icarus_sbnnoise.fcl @@ -54,16 +54,16 @@ physics: # # For MCC1.1 we are still suppressing channels with no signal in the TPC -physics.producers.daq0.SuppressNoSignal: false +physics.producers.daq0.SuppressNoSignal: true physics.producers.daq0.Cryostat: 0 physics.producers.daq0.TPC: 0 -physics.producers.daq1.SuppressNoSignal: false +physics.producers.daq1.SuppressNoSignal: true physics.producers.daq1.Cryostat: 0 physics.producers.daq1.TPC: 1 -physics.producers.daq2.SuppressNoSignal: false +physics.producers.daq2.SuppressNoSignal: true physics.producers.daq2.Cryostat: 1 physics.producers.daq2.TPC: 0 -physics.producers.daq3.SuppressNoSignal: false +physics.producers.daq3.SuppressNoSignal: true physics.producers.daq3.Cryostat: 1 physics.producers.daq3.TPC: 1 From f26c0f2b11cc8ef4206b794b2bd363b32221267d Mon Sep 17 00:00:00 2001 From: "Usher, Tracy L" Date: Wed, 25 Sep 2019 10:57:54 -0700 Subject: [PATCH 07/13] Add new default event display fcl for the multi-TPC reconstruction and including the PMT display in the 3D viewer --- fcl/evd/evd_multitpc_icarus.fcl | 103 ++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 fcl/evd/evd_multitpc_icarus.fcl diff --git a/fcl/evd/evd_multitpc_icarus.fcl b/fcl/evd/evd_multitpc_icarus.fcl new file mode 100644 index 000000000..e04d74484 --- /dev/null +++ b/fcl/evd/evd_multitpc_icarus.fcl @@ -0,0 +1,103 @@ +#include "evdservices_icarus.fcl" +#include "services_icarus.fcl" + +process_name: EvdIcarus + +services: +{ + @table::icarus_disp +} + + +#Look at the input files +source: +{ + module_type: RootInput + fileNames: [ "data.root" ] + maxEvents: -1 # Number of events to create +} + +outputs:{} + +# Define and configure some modules to do work on each event. +# First modules are defined; they are scheduled later. +# Modules are grouped by type. +physics: +{ + + producers: {} + + filters:{} + + analyzers: + { + evdisp:{module_type: EVD} + } + + #list the modules for this path, order matters, filters reject all following items + evd: [ evdisp ] + + #end_path are things that do not modify art::Event, includes analyzers + #and output modules. all items here can be run simultaneously + end_paths: [evd] +} +services.RawDrawingOptions.TotalTicks: 4100 + +# Some basic overrides to set up basic drawing + +services.RawDrawingOptions.DrawRawDataOrCalibWires: 1 # set to zero for raw digits only +services.RawDrawingOptions.MinimumSignal: 10 # This sets the minimum ADC value to be displayed in 2D display +services.RecoDrawingOptions.DrawHits: 1 # This turns on the drawing of hits in the 2D display +services.RecoDrawingOptions.DrawPFParticles: 4 # Can be range of numbers, 4 is maximum options +services.RecoDrawingOptions.DrawClusters: 4 # draw with connecting lines & labels +services.RecoDrawingOptions.DrawTracks: 3 # Draws "tracks" +services.RecoDrawingOptions.DrawProngs: 3 # Draws "prongs" (which is really the same) +services.RecoDrawingOptions.DrawTrackTrajectoryPoints: 3 # Draws points associated to tracks +services.RecoDrawingOptions.Draw2DSlopeEndPoints: 1 # This draws cluster axis in 2D (but there is bug) +services.RecoDrawingOptions.DrawTrackSpacePoints: 3 # Draws space points +services.RecoDrawingOptions.DrawVertices: 3 +services.RecoDrawingOptions.DrawSpacePoints: 3 + + +# Set up the display of truth information +# For 2D display the information is not great +services.SimulationDrawingOptions.ShowMCTruthVectors: 0 +services.SimulationDrawingOptions.ShowMCTruthTrajectories: true +services.SimulationDrawingOptions.MinimumEnergyDeposition: 0.0001 # in GeV + +# The 3D display has better truth information +services.SimulationDrawingOptions.ShowSimChannelInfo: true +services.SimulationDrawingOptions.ShowSimEnergyInfo: false +services.SimulationDrawingOptions.ShowSimPhotonInfo: false + +# Below sets up the 2D viwer to see RawDigit, Wire and Hit data for the multi TPC reconstruction work flow +# To view the "signgle" reconstruction work flow, replace the multiple names in the braces below with a single name: +# For RawDigits --> "rawdigitfilter" +# For Wire --> "decon1droi" +# For hits --> "cluster3d" (or "gaushit") +services.RawDrawingOptions.RawDataLabels: ["rawDigitFilterTPC0","rawDigitFilterTPC1","rawDigitFilterTPC2","rawDigitFilterTPC3"] +services.RecoDrawingOptions.WireModuleLabels: ["decon1DroiTPC0", "decon1DroiTPC1", "decon1DroiTPC2", "decon1DroiTPC3"] +services.RecoDrawingOptions.HitModuleLabels: ["cluster3DCryo0", "cluster3DCryo1"] + +# Below sets up basic drawing of output from pandora (using gauss hits) +# +services.RecoDrawingOptions.ClusterModuleLabels: ["pandoraGausCryo0", "pandoraGausCryo1"] +services.RecoDrawingOptions.EndPoint2DModuleLabels: ["pandoraGausCryo0", "pandoraGausCryo1"] +services.RecoDrawingOptions.PFParticleModuleLabels: ["pandoraGausCryo0", "pandoraGausCryo1"] +services.RecoDrawingOptions.SpacePointModuleLabels: ["pandoraGausCryo0", "pandoraGausCryo1"] +services.RecoDrawingOptions.VertexModuleLabels: ["pandoraGausCryo0", "pandoraGausCryo1"] +services.RecoDrawingOptions.TrackModuleLabels: ["pandoraTrackGausCryo0", "pandoraTrackGausCryo1"] +services.RecoDrawingOptions.ProngModuleLabels: ["pandoraTrackGausCryo0", "pandoraTrackGausCryo1"] +services.RecoDrawingOptions.EdgeModuleLabels: [] + +# Set up the optical display for the 3D display +# +# Note there are both MC and reconstructed versions to look at, below includes names for switching +# +services.RecoDrawingOptions.DrawOpHits: 1 +services.RecoDrawingOptions.OpHitModuleLabels: ["mcophit"] #["ophit"] +services.RecoDrawingOptions.DrawOpFlashes: 0 +services.RecoDrawingOptions.OpFlashModuleLabels: ["opflashTPC0", "opflashTPC1", "opflashTPC2", "opflashTPC3"] +#services.RecoDrawingOptions.OpFlashModuleLabels: ["mcopflashTPC0", "mcopflashTPC1", "mcopflashTPC2", "mcopflashTPC3"] + + From 80fdcb4d303a1f95348d927b2d3e87763d231e62 Mon Sep 17 00:00:00 2001 From: "Usher, Tracy L" Date: Wed, 25 Sep 2019 10:58:43 -0700 Subject: [PATCH 08/13] Simplify with a single definition for the SBN noise model and overrides provided at end. --- .../DetSim/detsimmodules_ICARUS.fcl | 151 ++++++++---------- 1 file changed, 63 insertions(+), 88 deletions(-) diff --git a/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl b/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl index b4b8afd14..0d23a5995 100644 --- a/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl +++ b/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl @@ -3,116 +3,91 @@ NoiseFromHistTool: { - tool_type: NoiseFromHist - NoiseRand: 0. - NoiseHistFileName: "T600noise_corr.root" - HistogramName: "hnoiseI1" - HistNormFactor: 0.45 # --> Histogram rms noise = 1 + tool_type: NoiseFromHist + NoiseRand: 0. + NoiseHistFileName: "T600noise_corr.root" + HistogramName: "hnoiseI1" + HistNormFactor: 0.45 # --> Histogram rms noise = 1 } + CorrelatedNoiseTool: { - tool_type: CorrelatedNoise - Plane: 0 - MedianNumBins: 25 - NoiseRand: 0. - CorrelatedSeed: 1000 - UncorrelatedSeed: 5000 - IncoherentNoiseFraction: 0.95 - StoreHistograms: true - NoiseHistFileName: "T600noise_corr.root" - HistogramName: "hnoiseI1" + tool_type: CorrelatedNoise + Plane: 0 + MedianNumBins: 25 + NoiseRand: 0. + CorrelatedSeed: 1000 + UncorrelatedSeed: 5000 + IncoherentNoiseFraction: 0.95 + StoreHistograms: true + NoiseHistFileName: "T600noise_corr.root" + HistogramName: "hnoiseI1" - CorrAmpHistFileName: "CorrAmplitude.root" - CorrAmpHistogramName: "hbrms" - StoreHistograms: true + CorrAmpHistFileName: "CorrAmplitude.root" + CorrAmpHistogramName: "hbrms" + StoreHistograms: true } -SBNNoiseToolInd1: -{ - tool_type: SBNNoise - Plane: 0 - MedianNumBins: 25 - NoiseRand: 0. - CorrelatedSeed: 1000 - UncorrelatedSeed: 5000 - StoreHistograms: false - NoiseHistFileName: "FFTww01m.root" - CorrelatedHistogramName: "fftBhisto" - UncorrelatedHistogramName: "fftUhisto" - TotalRMSHistoName: "RMShisto" - CorrelatedRMSHistoName: "RMSBhisto" - UncorrelatedRMSHistoName: "RMSUhisto" -} -SBNNoiseToolInd2: +SBNNoiseTool: { - tool_type: SBNNoise - Plane: 1 - MedianNumBins: 25 - NoiseRand: 0. - CorrelatedSeed: 1000 - UncorrelatedSeed: 5000 - StoreHistograms: false - - NoiseHistFileName: "FFTwe10.root" - - CorrelatedHistogramName: "fftBhisto" - UncorrelatedHistogramName: "fftUhisto" - TotalRMSHistoName: "RMShisto" - CorrelatedRMSHistoName: "RMSBhisto" - UncorrelatedRMSHistoName: "RMSUhisto" + tool_type: SBNNoise + Plane: 0 # All default values are for induction 1 (first induction) + MedianNumBins: 25 + NoiseRand: 0. + CorrelatedSeed: 1000 + UncorrelatedSeed: 5000 + StoreHistograms: false + NoiseHistFileName: "FFTww01m.root" + CorrelatedHistogramName: "fftBhisto" + UncorrelatedHistogramName: "fftUhisto" + TotalRMSHistoName: "RMShisto" + CorrelatedRMSHistoName: "RMSBhisto" + UncorrelatedRMSHistoName: "RMSUhisto" } -SBNNoiseToolColl: -{ - tool_type: SBNNoise - Plane: 2 - MedianNumBins: 25 - NoiseRand: 0. - CorrelatedSeed: 1000 - UncorrelatedSeed: 5000 - StoreHistograms: false - NoiseHistFileName: "FFTwe10.root" - CorrelatedHistogramName: "fftBhisto" - UncorrelatedHistogramName: "fftUhisto" - TotalRMSHistoName: "RMShisto" - CorrelatedRMSHistoName: "RMSBhisto" - UncorrelatedRMSHistoName: "RMSUhisto" -} WhiteNoiseTool: { - tool_type: RandomNoise + tool_type: RandomNoise } NoNoiseTool: { - tool_type: NoNoise + tool_type: NoNoise } standard_simwire: { - module_type: "SimWireICARUS" - DriftEModuleLabel: "largeant" - ProcessAllTPCs: false - Cryostat: 0 - TPC: 0 - CompressionType: "none" - SimDeadChannels: false - SuppressNoSignal: true - SmearPedestals: true - Test: false - TestWire: 0 - TestIndex: [ 0. ] - TestCharge: [ 0. ] - Sample: -1 - MakeHistograms: "true" - #NoiseGenToolVec: [@local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool] -NoiseGenToolVec: [@local::SBNNoiseToolInd1, @local::SBNNoiseToolInd2, @local::SBNNoiseToolColl] + module_type: "SimWireICARUS" + DriftEModuleLabel: "largeant" + ProcessAllTPCs: false + Cryostat: 0 + TPC: 0 + CompressionType: "none" + SimDeadChannels: false + SuppressNoSignal: true + SmearPedestals: true + Test: false + TestWire: 0 + TestIndex: [ 0. ] + TestCharge: [ 0. ] + Sample: -1 + MakeHistograms: "true" + #NoiseGenToolVec: [@local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool] + NoiseGenToolVec: [@local::SBNNoiseTool, @local::SBNNoiseTool, @local::SBNNoiseTool] } icarus_simwire: @local::standard_simwire -icarus_simwire.NoiseGenToolVec[0].Plane: 0 -icarus_simwire.NoiseGenToolVec[1].Plane: 1 -icarus_simwire.NoiseGenToolVec[2].Plane: 2 +icarus_simwire.NoiseGenToolVec[0].Plane: 0 +# Below overrides for SBN Noise tool +icarus_simwire.NoiseGenToolVec[0].NoiseHistFileName: "FFTww01m.root" + +icarus_simwire.NoiseGenToolVec[1].Plane: 1 +# Below overrides for SBN Noise model +icarus_simwire.NoiseGenToolVec[1].NoiseHistFileName: "FFTwe10.root" + +icarus_simwire.NoiseGenToolVec[2].Plane: 2 +# Below overrides for SBN Noise model +icarus_simwire.NoiseGenToolVec[2].NoiseHistFileName: "FFTwe10.root" END_PROLOG From 475576f5a0baf6bc58db361efdb2dc8c6351d6da Mon Sep 17 00:00:00 2001 From: "Usher, Tracy L" Date: Wed, 25 Sep 2019 11:01:09 -0700 Subject: [PATCH 09/13] Make sure the default is still the "old" noise model --- .../TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl b/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl index 0d23a5995..a98cf6597 100644 --- a/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl +++ b/icaruscode/TPC/Simulation/DetSim/detsimmodules_ICARUS.fcl @@ -72,22 +72,24 @@ standard_simwire: TestCharge: [ 0. ] Sample: -1 MakeHistograms: "true" - #NoiseGenToolVec: [@local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool] - NoiseGenToolVec: [@local::SBNNoiseTool, @local::SBNNoiseTool, @local::SBNNoiseTool] + # current default (Sep 2019) is to run the noise model based on Gran Sasso experience + NoiseGenToolVec: [@local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool, @local::CorrelatedNoiseTool] + # This switches to an updated model, currently under development (Sep 2019), based on FNAL running + #NoiseGenToolVec: [@local::SBNNoiseTool, @local::SBNNoiseTool, @local::SBNNoiseTool] } icarus_simwire: @local::standard_simwire icarus_simwire.NoiseGenToolVec[0].Plane: 0 # Below overrides for SBN Noise tool -icarus_simwire.NoiseGenToolVec[0].NoiseHistFileName: "FFTww01m.root" +#icarus_simwire.NoiseGenToolVec[0].NoiseHistFileName: "FFTww01m.root" icarus_simwire.NoiseGenToolVec[1].Plane: 1 # Below overrides for SBN Noise model -icarus_simwire.NoiseGenToolVec[1].NoiseHistFileName: "FFTwe10.root" +#icarus_simwire.NoiseGenToolVec[1].NoiseHistFileName: "FFTwe10.root" icarus_simwire.NoiseGenToolVec[2].Plane: 2 # Below overrides for SBN Noise model -icarus_simwire.NoiseGenToolVec[2].NoiseHistFileName: "FFTwe10.root" +#icarus_simwire.NoiseGenToolVec[2].NoiseHistFileName: "FFTwe10.root" END_PROLOG From 341d7f381c54a7c60bf208f9782a1c7f7197b5f2 Mon Sep 17 00:00:00 2001 From: "Usher, Tracy L" Date: Wed, 25 Sep 2019 11:04:15 -0700 Subject: [PATCH 10/13] Formatting and remove std::cout statements --- .../tools/TrackHitEfficiencyAnalysis_tool.cc | 59 ++++++------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc b/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc index e866df8e8..d5ad39b5b 100755 --- a/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc +++ b/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc @@ -264,9 +264,8 @@ void TrackHitEfficiencyAnalysis::initializeHists(art::ServiceHandleNplanes()); fHitENEvXZVec.resize(fGeometry->Nplanes()); fNSimChannelHitsVec.resize(fGeometry->Nplanes()); -fNRecobHitVec.resize(fGeometry->Nplanes()); -fNFakeHitVec.resize(fGeometry->Nplanes()); -//fNRejectedHitVec.resize(fGeometry->Nplanes()); + fNRecobHitVec.resize(fGeometry->Nplanes()); + fNFakeHitVec.resize(fGeometry->Nplanes()); fHitEfficiencyVec.resize(fGeometry->Nplanes()); fSimDivHitChgVec.resize(fGeometry->Nplanes()); fSimDivHitChg1Vec.resize(fGeometry->Nplanes()); @@ -295,8 +294,7 @@ fNFakeHitVec.resize(fGeometry->Nplanes()); fDeltaMidTDCVec.at(plane) = dir.make(("DeltaMid" + std::to_string(plane)).c_str(), ";# hits", 50, -25., 25.); fNSimChannelHitsVec.at(plane) = dir.make(("NSimChan" + std::to_string(plane)).c_str(), ";# hits", 100, 0., 1200.); fNRecobHitVec.at(plane) = dir.make(("NRecobHit" + std::to_string(plane)).c_str(), ";# hits", 100, 0., 1200.); -fNFakeHitVec.at(plane) = dir.make(("NFakeHit" + std::to_string(plane)).c_str(), ";# hits", 100, 0., 50.); - // fNRejectedHitVec.at(plane) = dir.make(("NRejectedHit" + std::to_string(plane)).c_str(), ";# hits", 100, 0., 1200.); + fNFakeHitVec.at(plane) = dir.make(("NFakeHit" + std::to_string(plane)).c_str(), ";# hits", 100, 0., 50.); fHitEfficiencyVec.at(plane) = dir.make(("PlnEffic" + std::to_string(plane)).c_str(), ";# hits", 101, 0., 1.01); fSimDivHitChgVec.at(plane) = dir.make(("SimDivHit" + std::to_string(plane)).c_str(), ";# e / SummedADC", 200, 0., 200.); fSimDivHitChg1Vec.at(plane) = dir.make(("SimDivHit1" + std::to_string(plane)).c_str(), ";# e / Integral", 200, 0., 200.); @@ -451,18 +449,14 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const // Now start a loop over the individual TPCs to build out the structures for RawDigits and Wires for(size_t tpcID = 0; tpcID < fRawDigitProducerLabelVec.size(); tpcID++) { -//std::cout << "TPC " << tpcID << " label " << fRawDigitProducerLabelVec[tpcID] << std::endl; -//std::cout << "TPC " << tpcID << " wire label " << fWireProducerLabelVec[tpcID] << std::endl; art::Handle< std::vector > rawDigitHandle; event.getByLabel(fRawDigitProducerLabelVec[tpcID], rawDigitHandle); -//std::cout << " rawDigitHandle? " << rawDigitHandle.isValid() << std::endl; art::Handle< std::vector > wireHandle; event.getByLabel(fWireProducerLabelVec[tpcID], wireHandle); - // std::cout << " wireHandle? " << wireHandle.isValid() << std::endl; + if (!rawDigitHandle.isValid() || !wireHandle.isValid()) return; -//std::cout << " valid labels " << std::endl; for(const auto& wire : *wireHandle) channelToWireMap[wire.Channel()] = &wire; for(const auto& rawDigit : *rawDigitHandle) chanToRawDigitMap[rawDigit.Channel()] = &rawDigit; @@ -489,16 +483,17 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const for(const auto& mcParticle : *mcParticleHandle) { trackIDToMCParticleMap[mcParticle.TrackId()] = &mcParticle; - // std::cout << " MCP process " << mcParticle.Process() << std::endl; } const lariov::ChannelStatusProvider& chanFilt = art::ServiceHandle()->GetProvider(); - std::vector nSimChannelHitVec = {0,0,0}; - std::vector nRecobHitVec = {0,0,0}; - std::vector nFakeHitVec = {0,0,0}; - std::vector nSimulatedWiresVec = {0,0,0}; -unsigned int lastwire=-1; + std::vector nSimChannelHitVec = {0,0,0}; + std::vector nRecobHitVec = {0,0,0}; + std::vector nFakeHitVec = {0,0,0}; + std::vector nSimulatedWiresVec = {0,0,0}; + + unsigned int lastwire=-1; + for(const auto& partToChanInfo : partToChanToTDCToIDEMap) { TrackIDToMCParticleMap::const_iterator trackIDToMCPartItr = trackIDToMCParticleMap.find(partToChanInfo.first); @@ -507,11 +502,10 @@ unsigned int lastwire=-1; int trackPDGCode = trackIDToMCPartItr->second->PdgCode(); std::string processName = trackIDToMCPartItr->second->Process(); - //std::cout << " trackPDGcode " << trackPDGCode << std::endl; - //std::cout << " processName " << processName << std::endl; + // Looking for primary muons (e.g. CR Tracks) if (fabs(trackPDGCode) != 13 || processName != "primary") continue; - //if (fabs(trackPDGCode) != 13) continue; + // Recover particle position and angle information Eigen::Vector3f partStartPos(trackIDToMCPartItr->second->Vx(),trackIDToMCPartItr->second->Vy(),trackIDToMCPartItr->second->Vz()); Eigen::Vector3f partStartDir(trackIDToMCPartItr->second->Px(),trackIDToMCPartItr->second->Py(),trackIDToMCPartItr->second->Pz()); @@ -582,10 +576,11 @@ unsigned int lastwire=-1; // Recover plane and wire in the plane unsigned int plane = wids[0].Plane; unsigned int wire = wids[0].Wire; -//std::cout << " plane " << plane << " wire " << wire << std::endl; -if(wire!=lastwire) nSimulatedWiresVec[plane]++; -lastwire=wire; + Eigen::Vector3f avePosition(0.,0.,0.); + + if(wire!=lastwire) nSimulatedWiresVec[plane]++; + lastwire=wire; for(const auto& ideVal : tdcToIDEMap) { @@ -627,8 +622,6 @@ lastwire=wire; unsigned short startTDC = tdcToIDEMap.begin()->first; unsigned short stopTDC = tdcToIDEMap.rbegin()->first; -//std::cout << " startTDC " << startTDC << std::endl; -// std::cout << " stopTDC " << stopTDC << std::endl; // Convert to ticks to get in same units as hits unsigned short startTick = fClockService->TPCTDC2Tick(startTDC) + fOffsetVec[plane]; unsigned short stopTick = fClockService->TPCTDC2Tick(stopTDC) + fOffsetVec[plane]; @@ -651,7 +644,6 @@ lastwire=wire; float hitSnippetLenBest(0.); unsigned short hitStopTickBest(0); unsigned short hitStartTickBest(0); -// unsigned short midHitTickBest(0); // Start by recovering the Wire associated to this channel ChanToWireMap::const_iterator wireItr = channelToWireMap.find(chanToTDCToIDEMap.first); @@ -703,14 +695,10 @@ lastwire=wire; { unsigned short hitStartTick = hit->PeakTime() - fSigmaVec[plane] * hit->RMS(); unsigned short hitStopTick = hit->PeakTime() + fSigmaVec[plane] * hit->RMS(); - - -// unsigned short midHitTick = (hitStopTick + hitStartTick) / 2; // If hit is out of range then skip, it is not related to this particle if (hitStartTick > stopTick || hitStopTick < startTick) { - // std::cout << " fake hit: wire " << wire << " plane " << plane << std::endl; nFakeHitVec[plane]++; rejectedHit = hit; continue; @@ -725,7 +713,6 @@ lastwire=wire; bestHit = hit; hitStartTickBest = hitStartTick; hitStopTickBest = hitStopTick; -// midHitTickBest = midHitTick; } // Find a match? @@ -780,8 +767,6 @@ lastwire=wire; } else if (rejectedHit) { - //std::cout << " rejecting hit " << std::endl; - // nRejectedHitVec[plane]++; unsigned short hitStartTick = rejectedHit->PeakTime() - fSigmaVec[plane] * rejectedHit->RMS(); unsigned short hitStopTick = rejectedHit->PeakTime() + fSigmaVec[plane] * rejectedHit->RMS(); @@ -796,9 +781,6 @@ lastwire=wire; } } - - - fWireEfficVec.at(plane)->Fill(totalElectrons, std::min(nMatchedWires,1), 1.); fWireEfficPHVec.at(plane)->Fill(maxElectrons, std::min(nMatchedWires,1), 1.); @@ -849,18 +831,13 @@ lastwire=wire; for(size_t idx = 0; idx < fGeometry->Nplanes();idx++) { -std::cout << " plane " << idx << " simchannelhits " << nSimChannelHitVec[idx] << std::endl; if (nSimChannelHitVec[idx] > 10) { float hitEfficiency = float(nRecobHitVec[idx]) / float(nSimChannelHitVec[idx]); -std::cout << " hit efficiency " << hitEfficiency << std::endl; fNSimChannelHitsVec[idx]->Fill(std::min(nSimChannelHitVec[idx],1999),1.); fNRecobHitVec[idx]->Fill(std::min(nRecobHitVec[idx],1999), 1.); - fNFakeHitVec[idx]->Fill(nFakeHitVec[idx]/(float)nSimulatedWiresVec[idx],1.); -std::cout << " plane " << idx << " fakes " << nFakeHitVec[idx] << std::endl; -std::cout << " matched wires " << nSimulatedWiresVec[idx] << std::endl; -std::cout << " fake hit ratio " << nFakeHitVec[idx]/(float)nSimulatedWiresVec[idx] << std::endl; + fNFakeHitVec[idx]->Fill(nFakeHitVec[idx]/(float)nSimulatedWiresVec[idx],1.); fHitEfficiencyVec[idx]->Fill(hitEfficiency, 1.); } } From 1cc862c9b9f2af398ae353f2800a15cc7a05ea0e Mon Sep 17 00:00:00 2001 From: Filippo Varanini Date: Wed, 25 Sep 2019 14:27:27 -0500 Subject: [PATCH 11/13] fixed cmakelists for sbnnoise model --- fcl/detsim/CMakeLists.txt | 1 + fcl/detsim/SBNNoise/CMakeLists.txt | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 fcl/detsim/SBNNoise/CMakeLists.txt diff --git a/fcl/detsim/CMakeLists.txt b/fcl/detsim/CMakeLists.txt index 4c6c89df5..a64906003 100644 --- a/fcl/detsim/CMakeLists.txt +++ b/fcl/detsim/CMakeLists.txt @@ -1,6 +1,7 @@ # add underlying subfolders add_subdirectory(SBNNov17) add_subdirectory(SBNMar18) +add_subdirectory(SBNNoise) # Install fcl files in /job subdirectory. install_fhicl() diff --git a/fcl/detsim/SBNNoise/CMakeLists.txt b/fcl/detsim/SBNNoise/CMakeLists.txt new file mode 100644 index 000000000..520ed808b --- /dev/null +++ b/fcl/detsim/SBNNoise/CMakeLists.txt @@ -0,0 +1,8 @@ +# Install fcl files in /job subdirectory. + +install_fhicl() + +# Also put a copy in the source tree. + +FILE(GLOB fcl_files *.fcl) +install_source( EXTRAS ${fcl_files} ) From ef85b5a0926e2ff728fb5ca1454513ec20041237 Mon Sep 17 00:00:00 2001 From: "Usher, Tracy L" Date: Thu, 26 Sep 2019 11:36:18 -0700 Subject: [PATCH 12/13] Small code cleanup --- icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc b/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc index d5ad39b5b..62aa4d40e 100755 --- a/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc +++ b/icaruscode/Analysis/tools/TrackHitEfficiencyAnalysis_tool.cc @@ -481,9 +481,8 @@ void TrackHitEfficiencyAnalysis::fillHistograms(const art::Event& event) const TrackIDToMCParticleMap trackIDToMCParticleMap; - for(const auto& mcParticle : *mcParticleHandle) { + for(const auto& mcParticle : *mcParticleHandle) trackIDToMCParticleMap[mcParticle.TrackId()] = &mcParticle; - } const lariov::ChannelStatusProvider& chanFilt = art::ServiceHandle()->GetProvider(); From 0f3ade36a13f360d5676afd60834e070fa068806 Mon Sep 17 00:00:00 2001 From: "Usher, Tracy L" Date: Thu, 26 Sep 2019 14:57:14 -0700 Subject: [PATCH 13/13] LArSoft v08_31_01 --- ups/product_deps | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ups/product_deps b/ups/product_deps index f06aecb96..31ca80e94 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -2,7 +2,7 @@ # The *parent* line must the first non-commented line and defines this product and version # The version must be of the form vxx_yy_zz (e.g. v01_02_03) -parent icaruscode v08_31_00 +parent icaruscode v08_31_01 defaultqual e17 # These optional lines define where headers, libraries, and executables go and should @@ -33,9 +33,9 @@ table_fragment_end # Add the dependent product and version product version -larsoft v08_31_00 -icarusutil v08_31_00 -icarus_data v08_31_00 +larsoft v08_31_01 +icarusutil v08_31_01 +icarus_data v08_31_01 genie_xsec v3_00_04a cetbuildtools v7_14_00 - only_for_build