Using The DeMux Package


Introduction


This document explains how to set up a .jcm file to run demuxing on data from the MINOS far detector, as well as the various options one can use with the demuxing. An example .jcm file is also shown.

Setting up a .jcm File


To run the demuxing, one needs to include the libDeMux.so file at the top of the .jcm file. There are three modules that one can use for demuxing. The first is DeMuxModule, which demultiplexes beam events, the second, DeMuxCosmicsModule is for demuxing cosmic ray events, and the third, DeMuxFilterModule, filters events based on whether it can be demuxed and the quality of the solution. If you wish to look at MC beam data then include the line

DeMuxModule::Reco \

in your JobPath. If you wish to look at cosmic ray data or monte carlo cosmic ray files, include this line,

DeMuxCosmicsModule::Reco \

in the JobPath. Each module also has an analysis method which performs various tests of the demuxing efficiency. You can run these methods by including either

DeMuxModule::Ana \

or

DeMuxCosmicsModule::Ana \

in your JobPath. The tests available are described below in the options section.

Available Options for DeMux


The options and their possbile values are listed in the table below. The default values are in red.

Module NameOptionDescriptionPossible Values and Explanation
DeMuxModule
DataTypesets type of data used - mc or daqMonteCarlo - mc files
FarDetector - daq files from Soudan
TestToMaketype of test to make to evaluate the DeMux efficiency. No default test set. MCXTalkEvents - test efficiency based on mc files with cross talk
MCUpAndDownStream - test efficiency using mc files without cross talk
DontUseCandDigitMasksturn off the masking of possible xtalk digits when demuxingn/a - default turns this off
DeMuxCosmicsModule
DataTypesets type of data used - mc or daqMonteCarlo - mc files
FarDetector - daq files from Soudan
TestToMaketype of test to make to evaluate the DeMux efficiency SingleModuleDeMux - test efficiency from plane 12 with only modules 3 & 6 connected
DeMuxCheck - print demuxing solution to screen
UnsetDigitCheck - checks properties of unset digits.
XTalkFractionLimitupper limit for ratio of a digit to its 4 nondiagonal neighbors to mark it as xtalk0.0 - 1.0, 0.0
WindowSizesize of sliding window to use2 - 6, 6
StrayDeltaStripLimitnumber of strips the center of gravity of a hypothesis can vary from the fit before being considered stray0 - 192, 6
DontUseCandDigitMasksturn off the masking of possible xtalk digits when demuxingn/a, default is turned off
WriteHistoswrite out trees and histograms filled in testsn/a, default is turned off
MakeTreesmake trees from the various testsn/a, default is turned on
HistoFileNamename of the root file containing the histogramsdemux_cosmics.root

The DeMuxCosmicsModule::Ana method can be instructed to fill 3 diagnostic trees if the MakeTrees option is set. The trees are described in the following table

Tree NameBranch NameDescriptionData Type
fDeMuxTreeEventevent numberInt_t
DeMuxedflag for if an event was demuxedInt_t
Vertexvertex plane numberInt_t
Directiondirection (N->S or S->N) of eventInt_t
Endend plane numberInt_t
NumberOfPlanesHitnumber of planes hit in eventInt_t
EventChargetotal adc counts in eventFloat_t
DigitsInEventtotal digits in eventInt_t
Multipleflag for if event has multiple muonsInt_t
NonPhysicalPlanesnumber of planes where the fit represents a non physical solution (ie strip <0 or strip>192Int_t
ValidPlanesFailureflag for if event had too few valid planes for demuxingInt_t
NoVertexFailureflag for if event had no vertexInt_t
NonPhysicalFailureflag for if event had too many non-physical planeInt_t
OneSidedUPlanesnumber of U planes with signal from only one sideInt_t
OneSidedVPlanesnumber of V planes with signal from only one sideInt_t
SignleModuleChargetotal adc counts from the plane with only one module connectedFloat_t
SingleModuleCorrectChargetotal correctly reconstructed adc counts from single module planeFloat_t
SingleModuleDigitstotal digits from plane with single module connectedFloat_t
SingleModuleCorrectDigitstotal correctly reconstructed digits from plane with single module connectedFloat_t
UStrayPlanesnumber of U planes where all 3 best hypotheses are more than n strips off from fitInt_t
VStrayPlanesnumber of V planes where all 3 best hypotheses are more than n strips off from fitInt_t
UValidPlanesnumber of valid U planesInt_t
VValidPlanesnumber of valid V planesInt_t
fDeMuxedDigitTreeBranch NameDescriptionData Type
Eventevent numberInt_t
Planeplane number of digitInt_t
Cratecrate number of digitInt_t
ADCadc counts from digitFloat_t
Timetdc of digitDouble_t
Strip0SEId 0Int_t
Stip1SEId 1Int_t
Strip2SEId 2Int_t
Strip3SEId 3Int_t
Strip4SEId 4Int_t
Strip5SEId 5Int_t
Strip6SEId 6Int_t
Strip7SEId 7Int_t
DeMuxedStripchosen SEIdInt_t
XTalkDigitflag for if digit is XTalk candidateInt_t
fDmxPlaneTreeEventevent numberInt_t
Planeplane numberInt_t
PlaneTypemuon (0) or shower (1) planeInt_t
PlaneCoGdemuxed center of gravityFloat_t
FitCoGstraight line fit center of gravityFloat_t
HypothesisCoGhypothesis center of gravityFloat_t
Hypothesishypothesis numberInt_t
MatedSignalfraction of mated signal in hypothesisFloat_t
Statisticgoodness of fit for hypothesisFloat_t
TieBreakertie breaker statistic for hypothesisFloat_t
Rankhypothesis rank 1, 2, 3, or -1Int_t
Validflag for if hypothesis is validInt_t

The SingleModule and UnsetDigitCheck test options fill TTrees containing information about the events. Those trees are written to a root file, demux_cosmics.root for example, if the WriteHistos option is set. The trees available are below.

Test NameTree NameBranch NameDescriptionData Type
SingleModuleDeMuxfSingleModuleTreeEventevent number in fileInt_t
DigitChargeadc counts from current digitFloat_t
XTalkSignalRatioratio of adc counts from current digit to sum of counts from 4 nearest non-diagonal neighbortsFloat_t
DigitDeMuxedCorrectlywas digit reconstructed to either module 3 or 6Int_t
UnsetDigitCheckfUnusedDigitsTreeEventevent number in fileInt_t
DigitChargeadc counts from current digitFloat_t
XTalkSignalRatioratio of adc counts from current digit to sum of counts from 4 nearest non-diagonal neighbortsFloat_t
DigitSideeast (0.) or west (1.)Float_t

Example .jcm Files


The first example .jcm file is for use with batch jobs (ie demojob executable) where no event display is desired. It uses the CandTrackSR class to fit tracks to the demuxed events. Comments are preceded by #.

#link in the demuxing library
/Root/LoadLibrary libRecoBase.so
/Root/LoadLibrary libCandStripSR.so
/Root/LoadLibrary libCandSliceSR.so
/Root/LoadLibrary libCandTrackSR.so
/Root/LoadLibrary /home/brebel/test/lib/Linux2-EGCS_1_1/libDeMux.so

#
# Create the path
#
/Path/Create DEMUX \
 Input::Get \
 DigitListModule::Get \
 DigitListModule::Reco \
 DeMuxCosmicsModule::Reco \
 StripSRListModule::Reco \ 
 SliceSRListModule::Reco \
 TrackSRListModule::Reco \
 DeMuxCosmicsModule::Ana 


/Input/Set Streams DaqSnarl

/DEMUX/Input/SetFormat raw

#
# Config the message service, eg
#

#Options to make Roy's track fitter work
/DigitListModule/Set ListsToMake 1 # Fill only canddigitlist not MC
/StripSRListModule/Set ListIn canddigitlist  # Run path on DAQ data

#DeMuxCosmicsModule Options
/DeMuxCosmicsModule/Set DataType FarDetector
/DeMuxCosmicsModule/Set TestToMake DigitsAlongTrack
/DeMuxCosmicsModule/Set TestToMake UnsetDigitCheck
/DeMuxCosmicsModule/Set TestToMake SingleModuleDeMux
/DeMuxCosmicsModule/Set TestToMake EventDistributions
/DeMuxCosmicsModule/Set TestToMake EventLength
#/DeMuxCosmicsModule/Set TestToMake MatedSignalFraction
#/DeMuxCosmicsModule/Set TestToMake DeMuxCheck
/DeMuxCosmicsModule/Set TrackFitter CandTrackSR
/DeMuxCosmicsModule/Set WriteHistos
#/DeMuxCosmicsModule/Set DontUseCandDigitMasks
/DeMuxCosmicsModule/Set XTalkFractionLimit 0.15
/DeMuxCosmicsModule/Set DeltaStripsFromTrack 12

#/Msg/SetLevel Exodus Error
#/Msg/SetLevel DmxX3 Info
#/Msg/SetLevel DmxX4 Info
#/Msg/SetLevel DmxX5 Info
/Msg/SetLevel Dmx1 Error
/Msg/SetLevel Dmx Error
/Msg/SetLevel DmxDigit Warning
/Msg/SetLevel DmxVertex Warning

#/Msg/Attach DmxDigit::Info /home/brebel/demux_results/no_valid_planes_sides_by_plane.txt
#/Msg/Attach DmxVertex::Info /home/brebel/demux_results/no_vertex_planes_by_event.txt


#
# Run all events through the DEMUX path
#
#/DEMUX/Run Nin 50  #run only 50 events through the path
/DEMUX/Run


The second example is for running the midad executable and viewing individual events

#link in the demuxing library
/Root/LoadLibrary libRecoBase.so
/Root/LoadLibrary libCandStripSR.so
/Root/LoadLibrary libCandSliceSR.so
/Root/LoadLibrary libCandTrackSR.so
/Root/LoadLibrary /home/brebel/test/lib/Linux2-EGCS_1_1/libDeMux.so

#
# Create the path
#
/Path/Create DEMUX \
 Input::Get \
 DigitListModule::Get \
 DigitListModule::Reco \
 DeMuxCosmicsModule::Reco \
 StripSRListModule::Reco \ 
 SliceSRListModule::Reco \
 TrackSRListModule::Reco \
 DeMuxCosmicsModule::Ana \
 MIDAD::Ana

/Input/Set Streams DaqSnarl

/DEMUX/Input/SetFormat raw

#
# Config the message service, eg
#

#Options to make Roy's track fitter work
/DigitListModule/Set ListsToMake 1 # Fill only canddigitlist not MC
/StripSRListModule/Set ListIn canddigitlist  # Run path on DAQ data

#DeMuxCosmicsModule Options
/DeMuxCosmicsModule/Set DataType FarDetector
/DeMuxCosmicsModule/Set TestToMake DigitsAlongTrack
/DeMuxCosmicsModule/Set TestToMake UnsetDigitCheck
/DeMuxCosmicsModule/Set TestToMake SingleModuleDeMux
/DeMuxCosmicsModule/Set TestToMake EventDistributions
/DeMuxCosmicsModule/Set TestToMake EventLength
#/DeMuxCosmicsModule/Set TestToMake DeMuxCheck
#/DeMuxCosmicsModule/Set TestToMake MatedSignalFraction
/DeMuxCosmicsModule/Set TrackFitter CandTrackSR
#/DeMuxCosmicsModule/Set WriteHistos
#/DeMuxCosmicsModule/Set DontUseCandDigitMasks
/DeMuxCosmicsModule/Set XTalkFractionLimit 0.15
/DeMuxCosmicsModule/Set DeltaStripsFromTrack 12

#DeMuxModule Options
#/DeMuxModule/Set DataType FarDetector
#/DeMuxModule/Set TestToMake UpAndDownStream

#/Msg/SetLevel Exodus Error
#/Msg/SetLevel DmxX3 Info
#/Msg/SetLevel DmxX4 Info
#/Msg/SetLevel DmxX5 Info
/Msg/SetLevel Dmx3 Info
/Msg/SetLevel Dmx Error


# MIDAD options
/DEMUX/MIDAD/Display UZVZDisplay
/DEMUX/MIDAD/Viewable DigitListViewable canddigitlist
/DEMUX/MIDAD/Viewable TrackListViewable CandTrackSRList
/DEMUX/MIDAD/Viewable GeomViewable Geometry
/DEMUX/MIDAD/UZVZDisplay ViewableStyle DigitListViewable ColorIs 0
/DEMUX/MIDAD/UZVZDisplay ViewableStyle DigitListViewable SizeIs 0
/DEMUX/MIDAD/UZVZDisplay ViewableStyle DigitListViewable StripEnd 0

#
# Run the DEMUX path
#
/DEMUX/Run Nin 1