Skip to content

Introduction

CDMSBats is the standard reconstruction code for CDMS– i.e., it is used on real data. But we've been working on creating simulations that can be run through CDMSBats just as well.

Information about CDMSBats (installation, usage, etc) can be found here and information about sub-packages can be found here.

Tutorials for cdmsbats installation and usage at major computing facilities can be found here. The old tutorials can be found here.

CDMSBats includes BatNoise (creates noise files), BatRoot (creates RQ data), and BatCalib (creates RRQ data). See this page and this page for links and information regarding RQs and RRQs.

History

Last updated: Jun 18th, 2021

Contact: Joshua Winchell, Lei Zheng

Before running CDMSBats

The input files created in our simulation chain–i.e. coming out of DAQSim–will have to be (re)named in a way that CDMSBats (which was not built to read our simulated data) can recognize.

Your DAQSim output may have produced output that looks like this:

>$ ls combined_Binary_files
libinput_randomName_F0001.gz   libinput_randomName_F0002.gz

You will have to rename or move them (and their directory) into a form like this:

>$ ls 01130610_1007
01130610_1007_F0001.gz   01130610_1007_F0002.gz

This is because CDMSBats uses the directory/file names (i.e. the series name–this in addition to the detector number) to help determine what kind of detector it's looking at. In this case:

**01** (for Soudan) + 20"**13**" + **06/10** + **10:07**am

The time specified determines how the detectors were set up:

  • Specifying 2013 includes series that were only normal iZip detectors (we often use the run/series R133/01130610_1007)
  • Specifying 2014-2016 includes runs that have a cdmslite detector (e.g. R134/01140301_0038 for t5z2 at 70V, or R135/01150401_1725 for t2z1 at 75V)
  • Specifying other years... doesn't work

You could still specify one of the later series and choose a detector number corresponding to a normal iZip and CDMSBats will process it appropriately. But we stick with the run/series combinations above to avoid mixing up detector types accidentally.

(See the R133 Wiki page for some more details).

Running CDMSBats

Starting from nothing, you can git clone BatCommon, IOLibrary, and cdmsbats from Gitlab into your workspace (if you are not able to get the code with docker or cvmfs, as in the linked cluster-specific installation guide/ tutorial linked above, or some other centrally-installed copy).

I have an environment file like this (see cdmsbats documentation for some more information about the environment variables):

#**Locations of relevant code**
export CDMS_IOLIBRARY=/scratch/user/joswinreu/simulations/repositories/IOLibrary
export CDMS_BATCOMMON=/scratch/user/joswinreu/simulations/repositories/BatCommon
export CDMSBATSDIR=/scratch/user/joswinreu/simulations/repositories/cdmsbats
#(Alternatively, call whatever central install your site has that sets these venvvars)

#**Directories containing config files**
#**These paths must be set to specify non-standard config files.**
#**Otherwise, don't set them at all (do NOT leave blank!) and cdmsbats will use its own defaults.**
export BATNOISE_TEMPLATES=$ARBITRARY_DIR/my_batnoise_temps   #Defaults to $CDMSBATSDIR/PulseTemplates
export BATROOT_PROC=$ARBITRARY_DIR/my_batroot_proc           #Defaults to $CDMSBATSDIR/UserSettings/BatRootSettings/processing     
export BATROOT_CONST=$ARBITRARY_DIR/my_batroot_const         #Defaults to $CDMSBATSDIR/UserSettings/BatRootSettings/analysis      
export BATCALIB_PROC=$ARBITRARY_DIR/my_batcalib_proc         #Defaults to $CDMSBATSDIR/UserSettings/BatCalibSettings/processing   
export BATCALIB_CONST=$ARBITRARY_DIR/my_batcalib_calib       #Defaults to $CDMSBATSDIR/UserSettings/BatCalibSettings/calibration

#**Files found in the directories set above**
#**These must be set for simulations. The default files are not the ones used for simulations**
#**(You don't actually need these variables themselves, but they may be more convenient to type than filenames)**
export BATROOT_PROCCFG=processingSoudanData.SuperCDMS.DMC-draft
export BATROOT_ANACFG=configSoudanData.SuperCDMS.DMC-draft
export BATCALIB_PROCCFG=optionsSoudanData.SuperCDMS.DMC-draft
export BATCALIB_CONSTCFG=calibrationSoudanData.R133.DMC-draft

#**Data in/out locations. Mostly name as you will**
export CDMSBATS_DATA=/scratch/user/joswinreu/simulations/bats_test_area #an arbitrary location
export BATROOT_RAWDATA=$CDMSBATS_DATA/RawData/01130610_1007             #Location of input data from DAQSim
export BATROOT_GPIBFILES=$BATROOT_RAWDATA/BR_GPIB_AUX            #Only used for real Soudan data; otherwise just set a dummy path
export BATROOT_AUXFILES=$BATROOT_RAWDATA/BR_GPIB_AUX             #Only used for real Soudan data; otherwise just set a dummy path
export BATROOT_NOISEFILES=$CDMSBATS_DATA/NoiseFilterFiles        #Output of BatNoise
export BATROOT_RQDATA=$CDMSBATS_DATA/RQData                   #Output of BatRoot
export BATCALIB_RQDATA=$CDMSBATS_DATA/RQData                  #Input to BatCalib; can be same as BatRoot output
export BATCALIB_RRQDATA=$CDMSBATS_DATA                        #Output of BatCalib

The file you give to BatNoise at the start should be named something like '01130610_1007_F0001.gz' where the first two fields are the series number and the number after F is the dump number.

You'd then run each stage like this (depending on where your executables are, of course):

>$ BatNoise -s 01130610_1007 -d 1 --max_events 1000 --analysis_config configSoudanData.SuperCDMS.DMC-draft --processing_config processingSoudanData.SuperCDMS.DMC-draft
...
>$ BatRoot -s 01130610_1007 -d 1 --max_events 1000 --analysis_config configSoudanData.SuperCDMS.DMC-draft --processing_config processingSoudanData.SuperCDMS.DMC-draft
...
>$ BatCalib -s 01130610_1007 -d 1 --max_events 1000 --processing_config optionsSoudanData.SuperCDMS.DMC-draft --calibration_config calibrationSoudanData.R133.DMC-draft

Notes:

  • The '-s' tag specifies the series number and the '-d' flag specifies the dump number.
  • Dump numbers: With BatNoise you can do something like '-d 1-30' or '-d 1,2,6,20-30' to read multiple files at once, if you have noise data across multiple files that you want to combine into one filter file.
    • If you only have noise in dump 1, you should do 'BatNoise ... -d 1' even if you're going to do files 1-100 with BatRoot/BatCalib.
    • BatRoot and BatCalib only process one dump/event at a time, so they only take single numbers with the '-d' flag. To process multiple dumps at once, you should write a loop to iterate over them all and call the executables for each one.
  • Config files: If you don't specify config files to each stage, they look for defaults-- which are not the simulation-specific files, so you should not leave off these arguments. Normally the files are looked-for under $CDMSBATSDIR/UserSettings, but you can point BATROOT_PROC, BATROOT_CONST, BATCALIB_PROC, and BATCALIB_CONST to other directories to search there instead. Then you pass the name of the config file you want from those directories (just the filename) to the executable as shown above. Note that BatNoise and BatRoot use the same config files.
  • Run each stage with no arguments to see some help information.

Notes on CDMSBats Configuration file for running with Simulations:

  • Lots of config files for BatRoot and BatCalib are stored in cdmsbats itself (as shown in the environment file above; they are all under cdmsbats/UserSettings). For simulations, we currently only use the files ending in .DMC-draft.
  • Other configs will likely not work for simulated data because DAQSim doesn't create everything that would be in real data–e.g. there is no cryo chamber temperature, since that is not simulated. These DMC-draft files specifically tell cdmsbats to avoid such missing data and so avoid crashing.
  • In BatRootSettings/processing/*.DMC-draft, for example, we have turned off reading from the DataBase that would have provided the temperature:

    # =============================
    # READ AUXILLIARY FILES
    # =============================
    
    READ    ISR_FILE          =     0       # ISR file - deprecated starting w/ R132
    READ    INFO_FILE         =     0       # Info file - deprecated starting w/ R132
    READ    GPIB_FILE         =     0       # GPIB
    READ    DMM_FILE          =     0       # DMM file - deprecated starting w/ R132
    READ    FILTER_FILE       =     1       # FILTER file - mandatory for optimal filter processing!
    READ    DET_STATUS_FILE   =     0       # Detector status file
    READ    DATABASE          =     0       # mySQL database (see settings end of this file)
    
  • ...And only in BatCalibSettings/calibration/*.DMC-draft do we have it set to use default temperatures:

    # min/max base temperature for the overall calibration
    
    PARAMETER_DOUBLE        CALIB_DEFAULT_BASETEMP  DETECTOR 1-15   =   0.052
    PARAMETER_DOUBLE        CALIB_MIN_BASETEMP      DETECTOR 1-15   =   0.052
    PARAMETER_DOUBLE        CALIB_MAX_BASETEMP      DETECTOR 1-15   =   0.064
    PARAMETER_INTEGER       USE_DEFAULT_BASETEMP             =              1
    
  • Note that these files may refer to parameters and options to be used with 'the pulse simulation'; these refer specifically to the old PulseSim, which we don't use anymore, so those options are not needed.

Non-RawData Content

Since not all information needed to make RQ's and RRQ's come directly from the RawData we need to tell CDMSBats where to get the rest of it for two reasons:

  • We want the RQ's and RRQ's to exist
  • We want them to be filled with sensible enough information that things don't crash, and don't mess up analysis code (the analyst doesn't need to use them, but they shouldn't get tripped up by them either)

Stuff from older pages

Link to Binary Writer.

Old, probably obsolete instructions that might be useful for reference, but don't count on it.

  • There are old cdmsbats processing instructions on this page.
  • CDMSBats for processing the DMC Events (with PulseSim).