Skip to content

Commit

Permalink
Minimal Toolchain for MuonFitter (#316)
Browse files Browse the repository at this point in the history
* minimal Toolchain for MuonFitter

* Update FindMrdTracksConfig

don't write FindMrdTracks results to debug ROOT file

---------

Co-authored-by: James Minock <[email protected]>
Co-authored-by: marc1uk <[email protected]>
  • Loading branch information
3 people authored Nov 25, 2024
1 parent de2db55 commit f1cfada
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configfiles/MuonFitter/ClusterClassifiersConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#ClusterClassifiers Config file
verbosity 0
IsData 0
11 changes: 11 additions & 0 deletions configfiles/MuonFitter/ClusterFinderConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ClusterFinder Config File

HitStore MCHits #Either MCHits or Hits (accessed in ANNIEEvent store)
OutputFile mc_clusters.root
ClusterFindingWindow 50 # in ns, size of the window used to "clusterize"
AcqTimeWindow 70000 # in ns, size of the acquisition window
ClusterIntegrationWindow 50 # in ns, all hits with +/- 1/2 of this window are considered in the cluster
MinHitsPerCluster 5 # group of hits are considered clusters above this amount of hits
end_of_window_time_cut 0.95 # from o to 1, length of the window you want to loop over with respect to acq. window (1 for full window, 0.95 for 95% from the start)
Plots2D 0 #Draw 2D charge-vs-time plots?
verbosity 0
8 changes: 8 additions & 0 deletions configfiles/MuonFitter/DigitBuilderConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# DigitBuilder config file

verbosity 0
isMC 1
ParametricModel 1
PhotoDetectorConfiguration All
LAPPDIDFile ./configfiles/VertexReco/PhaseIIRecoTruth/LAPPDIDs.txt
DigitChargeThr 10
25 changes: 25 additions & 0 deletions configfiles/MuonFitter/EventSelectorConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EventSelector config file

verbosity 0
MRDRecoCut 0
MCFVCut 0
MCPMTVolCut 0
MCMRDCut 0
MCPiKCut 0
MCIsMuonCut 1
MCIsElectronCut 0
MCIsSingleRingCut 0
MCIsMultiRingCut 0
MCProjectedMRDHit 0
MCEnergyCut 0
Emin 0
Emax 5000
NHitCut 0
NHitmin 4
PromptTrigOnly 0
RecoFVCut 0
RecoPMTVolCut 0
PMTMRDCoincCut 0
PMTMRDOffset 10
SaveStatusToStore 1
IsMC 1
12 changes: 12 additions & 0 deletions configfiles/MuonFitter/FindMrdTracksConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# FindMrdTracks Config File
# all variables retrieved with m_variables.Get() must be defined here!

verbosity 0
IsData 0
OutputDirectory .
OutputFile mrdtrackfile # the output file built will be '<OutputDirectory>/<OutputFile>.<Run>.<Subrun>.root'
DrawTruthTracks 0 # whether to add MC Truth track info for drawing in MrdPaddlePlot Tool
## note you need to run that tool to actually view the tracks!
WriteTracksToFile 0 # should the track information be written to a ROOT-file?
SelectTriggerType 0 # should the loaded data be filtered by trigger type?
TriggerType Beam # options: Cosmic, Beam, No Loopback
22 changes: 22 additions & 0 deletions configfiles/MuonFitter/LoadWCSimConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#LoadWCSim Config File
# all variables retrieved with m_variables.Get() must be defined here!
verbose 1

#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/lappd/tankonly/wcsim_lappd_tankonly_24-09-17_BNB_Water_10k_22-05-17/wcsim_0.49......19.root
#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/lappd/tankonly/wcsim_lappd_tankonly_03-05-17_rhatcher/wcsim_0.49......00.root ## first of the DOE proposal files
#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/multipmt/tankonly/wcsim_3-12-18_ANNIEp2v6_BNB_Water_10k_22-05-17/wcsim_0.49......19.root
#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/multipmt/tankonly/wcsim_25_04_19_ANNIEp2v6_nodigit_BNB_Water_10k_22-05-17/wcsim_0.49......19.root
#InputFile ./25_04_19_wcsim_0.49......19.root

#InputFile /annie/app/users/jminock/ToolAnalysis/wcsim_0.root
#InputFile /pnfs/annie/persistent/users/mnieslon/wcsim/output/tankonly/wcsim_ANNIEp2v7_beamlike/wcsim_beamlike_muon_0.100.root
InputFile /pnfs/annie/persistent/simulations/wcsim/G1810a0211a/standard/tank/pmt/wcsim_0.0.0.root
#InputFile ./wcsim_0.*.root
#InputFile /pnfs/annie/persistent/users/mnieslon/wcsim/output/tankonly/wcsim_ANNIEp2v7_beam/pmt-files/wcsim_beam_gst_1060_91_0.7091.root

WCSimVersion 3 ## should reflect the WCSim version of the files being loaded
HistoricTriggeroffset 0 ## time offset of digits relative to the trigger
UseDigitSmearedTime 1 ## whether to use smeared digit time (T), or true time of first photon (F)
LappdNumStrips 56 ## num channels to construct from each LAPPD
LappdStripLength 100 ## relative x position of each LAPPD strip, for dual-sided readout [mm]
LappdStripSeparation 10 ## stripline separation, for calculating relative y position of each LAPPD strip [mm]
14 changes: 14 additions & 0 deletions configfiles/MuonFitter/LoadWCSimLAPPDConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#LoadWCSimLAPPD Config File
# all variables retrieved with m_variables.Get() must be defined here!
verbose 0

#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/lappd/tankonly/wcsim_lappd_tankonly_24-09-17_BNB_Water_10k_22-05-17/wcsim_lappd_0.49......19.root
#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/lappd/tankonly/wcsim_lappd_tankonly_03-05-17_rhatcher/wcsim_lappd_0.49......00.root ## first of the DOE proposal files
#InputFile /pnfs/annie/persistent/users/mnieslon/wcsim/output/tankonly/wcsim_ANNIEp2v7_beamlike/wcsim_beamlike_muon_lappd_0.100.root
InputFile /pnfs/annie/persistent/simulations/wcsim/G1810a0211a/standard/tank/lappd/wcsim_lappd_0.0.0.root
#InputFile ./wcsim_lappd_0.*.root
#InputFile /annie/app/users/jminock/ToolAnalysis/wcsim_lappd_0.root

WCSimVersion 3 ## should reflect the WCSim version of the files being loaded
InnerStructureRadius 1.3545 ## octagonal inner structure radius in m (from drawings 106.64")
DrawDebugGraphs 0 ## whether to draw TPolyMarker3D's of hits
3 changes: 3 additions & 0 deletions configfiles/MuonFitter/MCParticlePropertiesConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MCParticleProperties configuration file

verbosity 0
10 changes: 10 additions & 0 deletions configfiles/MuonFitter/MCRecoEventLoaderConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MCRecoEventLoader config file

verbosity 1
GetPionKaonInfo 1
GetNRings 1
ParticleID 13
DoParticleSelection 1
xshift 0.0
yshift 14.46469
zshift -168.1
33 changes: 33 additions & 0 deletions configfiles/MuonFitter/MuonFitterConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
verbosity 0

OutputFile MC_MuonFitter_Reco_2998.root
IsData 0 # 1:is data, not MC; 0:not data, is MC
LuxArea 506.7 # 10-inch R7081 Hamamatsu
EtelArea 613.1 # 11-inch D784UKFLB ETEL
HamamatsuArea 324.3 # 8-inch R5912-100 Hamamatsu
WatchboyArea 506.7 # 10-inch R7081 Hamamatsu
WatchmanArea 506.7 # 10-inch R7081-100 Hamamatsu
PMTMRDOffset 0 # delay btwn tank and MRD PMTs
StepSizeAi 15 # some distance muon travels [cm]
InsideAngle 1. # degrees added to Cherenkov angle for hits to be considered inside cone
OutsideAngle 9. # degrees added to Cherenkov angle for hits to be considered outside cone
PMTChargeThreshold 2 # minimum amount of charge seen by PMT
EtaThreshold 500 # threshold to find best vertex
DisplayTruth 0 # display truth information in graphs (only in MC)
RecoMode 0 # run tool after fitting tank track
AiEtaFile ev_ai_eta_R0.0.txt
#TankTrackFitFile /exp/annie/app/users/jhe/MyToolAnalysis_MFer/fitbyeye_wcsim_2000-2999_RNN_240525v1.txt
#TankTrackFitFile fitbyeye_wcsim_2000-2999_RNN_240525v1.txt
TankTrackFitFile tanktrackfitfile_r0.0_RNN.txt

UseNumLayers 1 # Updates reco track length in MRD using number of layers
UsePCA 0 # Updates reco track length in MRD using number of layers and PCA-reconstructed track angle (set UseNumLayers 1)
UseConnDots 0 # Updates reco track length in MRD by connecting the MRD hits
UseELoss 0 # Use official ANNIE MRD energyLoss as starting MRD energy
UseSimpleEReco 0 # Just add ANNIE MRD energyLoss (set UseELoss 1); no updating dEdx
RecoEnergyShift 0 # Shift reco muon energy

Plot3D 0 # 0:no plot; 1:yes plot
Draw3DFMV 0
Draw3DMRD 0
SaveHistograms 0 # 0:no; 1:yes
3 changes: 3 additions & 0 deletions configfiles/MuonFitter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**********************

Date created: 2024-10-02
Date last updated: 2024-11-22
The MuonFitter toolchain makes an attempt to fit muons using hit information.

The Tool has 2 modes. The first mode is pre-reconstruction. It takes input information from the ANNIEEvent and generates a text file containing hit information for the RNN. It is advisable to include minimal tools in this ToolChain, as the same data must be re-analysed with ToolAnalysis later.
Expand All @@ -13,6 +14,8 @@ This text file produced in this step is then processed by a standalone python sc

The second mode is reconstruction. In this mode the Tool reads information from the ANNIEEvent, along with both text files from the previous two steps (the first mode and the python script) and reconstructs the vertex based on the fitted paths. The resulting muon fit information is passed into the DataModel.

The Toolchain included in this directory is the minimal working Toolchain for MuonFitter to function. All Tools in the ToolChain MUST be included in order for MuonFitter to function. It is recommended to include PhaseIITreeMaker after MuonFitter in RecoMode 1 to generate an ntuple with reconstructed variables from MuonFitter.

More detailed instructions are below.

************************
Expand Down
12 changes: 12 additions & 0 deletions configfiles/MuonFitter/TimeClusteringConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#TimeClustering Config File

verbosity 0
IsData 0
MinDigitsForTrack 4
MaxMrdSubEventDuration 30 # [ns] if all hits are within this period, just make one subevent
MinSubeventTimeSep 30 # [ns] gaps of at leas this long delimit subevents
MakeMrdDigitTimePlot 0 # draw a 1D histogram of times to check subevent splitting is suitble
MakeSingleEventPlots 0
LaunchTApplication 0
MapChankey_WCSimID ./configfiles/CC_MC_RECO_ntuple/MRD_Chankey_WCSimID.dat
OutputROOTFile test.root
26 changes: 26 additions & 0 deletions configfiles/MuonFitter/ToolChainConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ToolChain dynamic setup file

##### Runtime Parameters #####
verbose 1 ## Verbosity level of ToolChain
error_level 0 # 0= do not exit, 1= exit on unhandled errors only, 2= exit on unhandled errors and handled errors
attempt_recover 1 ## 1= will attempt to finalise if an execute fails
remote_port 24002
IO_Threads 1 ## Number of threads for network traffic (~ 1/Gbps)

###### Logging #####
log_mode Interactive # Interactive=cout , Remote= remote logging system "serservice_name Remote_Logging" , Local = local file log;
log_local_path ./log
log_service LogStore


###### Service discovery ##### Ignore these settings for local analysis
service_publish_sec -1
service_kick_sec -1

##### Tools To Add #####
Tools_File configfiles/MuonFitter/ToolsConfig ## list of tools to run and their config files

##### Run Type #####
Inline -1 ## number of Execute steps in program, -1 infinite loop that is ended by user
Interactive 0 ## set to 1 if you want to run the code interactively

12 changes: 12 additions & 0 deletions configfiles/MuonFitter/ToolsConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
myLoadGeometry LoadGeometry configfiles/LoadGeometry/LoadGeometryConfig
myLoadWCSim LoadWCSim configfiles/MuonFitter/LoadWCSimConfig
myLoadWCSimLAPPD LoadWCSimLAPPD configfiles/MuonFitter/LoadWCSimLAPPDConfig
myMCParticleProperties MCParticleProperties configfiles/MuonFitter/MCParticlePropertiesConfig
myMCRecoEventLoader MCRecoEventLoader configfiles/MuonFitter/MCRecoEventLoaderConfig
myTimeClustering TimeClustering configfiles/MuonFitter/TimeClusteringConfig
myFindMrdTracks FindMrdTracks configfiles/MuonFitter/FindMrdTracksConfig
myClusterFinder ClusterFinder configfiles/MuonFitter/ClusterFinderConfig
myClusterClassifiers ClusterClassifiers configfiles/MuonFitter/ClusterClassifiersConfig
myDigitBuilder DigitBuilder configfiles/MuonFitter/DigitBuilderConfig
myEventSelector EventSelector configfiles/MuonFitter/EventSelectorConfig
myMuonFitter MuonFitter configfiles/MuonFitter/MuonFitterConfig

0 comments on commit f1cfada

Please sign in to comment.