Difference between revisions of "NPS Software"

From Cuawiki
Jump to navigation Jump to search
 
(14 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
* [[Meetings#DAQ/ELECTRONICS/ANALYZER|DAQ/Software Meeting Notes]]
 
* [[Meetings#DAQ/ELECTRONICS/ANALYZER|DAQ/Software Meeting Notes]]
  
== Setting up HCANA Instructions ==
+
== NPS Software Meetings ==
 +
* [[NPS Tree variables]]
 +
 
 +
== Setting up HCANA and NPSlib, nps_replay Instructions ==
 +
=== Git repos  ===
 +
* Setup a github.com account
 
* Fork a git repo from https://github.com/JeffersonLab/hcana
 
* Fork a git repo from https://github.com/JeffersonLab/hcana
===Starting on the cdaql3 machines===
+
* Fork a git repo from https://github.com/JeffersonLab/NPSlib
** login into cdaql3 through the gateway
+
* Fork a git repo from https://github.com/JeffersonLab/nps_replay
** cd /data1/cdaq/eel108
+
===Starting on the cdaqll machine===
** mkdir "name" ( make a subdirectory with your "name")
+
* login into cdaql1 through the gateway
** cd "name"
+
* if you want to use the standard replay type "go_analysis_nps"
** git clone https://github.com/"githubUserName"/hcana
+
* if you do not have a directory and want to do independent analysis
 +
* Create a directory /home/cdaq/Dirname
 +
* Create a directory /home/cdaq/Dirname/nps-2023
 +
* cd /home/cdaq/Dirname/nps-2023
 +
* Setup cmake and ROOT
 +
** module use /apps/modulefiles/
 +
** module load cmake
 +
** source /apps/root/PRO/bin/thisroot.csh
 +
* Setup hcana
 +
** git clone https://github.com/GithubUserName/hcana
 
** cd hcana
 
** cd hcana
** git submodule init
 
** git submodule update
 
 
** git remote add --track develop upstream https://github.com/JeffersonLab/hcana
 
** git remote add --track develop upstream https://github.com/JeffersonLab/hcana
** source /apps/root/PRO/setroot_CUE.csh
 
** scons
 
===Starting on the ifarm machines===
 
** login into ifarm
 
** cd  /group/nps
 
** mkdir "name"  ( make a subdirectory with your "name")
 
** cd "name"
 
** git clone https://github.com/"githubUserName"/hcana
 
** cd hcana
 
 
** git submodule init
 
** git submodule init
 
** git submodule update
 
** git submodule update
** git remote add --track develop upstream https://github.com/JeffersonLab/hcana
+
** cd ..
** source /apps/root/PRO/setroot_CUE.csh
+
** cmake -B hcana-build -S hcana -DCMAKE_INSTALL_PREFIX=hcana-install
** scons
+
** cmake --build hcana-build -j12
* Now you have a working hcana binary.
+
** cmake --install hcana-build/
 
+
** setenv PATH /home/cdaq/Dirname/nps-2023/hcana-install/bin:$PATH
== Setting up NPS replay directory instructions ==
+
** If one needs to recompile after making changes in hcana/src
* Fork a git repo from https://github.com/JeffersonLab/nps_replay
+
*** cd  hcana-build
===Starting on the cdaql3 machines:===
+
*** make install
**login into cdaql3 through the gateway
+
* Setup NPSlib
** if you have not set up you own subdirectory:
+
** git clone https://github.com/GithubUserName/NPSlib
***cd /data1/cdaq/eel108
+
** cd NPSlib
***mkdir "name" ( make a subdirectory with your "name")
+
** git remote add --track main upstream https://github.com/JeffersonLab/NPSlib
***cd "name"
+
** cd ..
** if you have subdirectory
+
** cmake -B NPSlib-build -S NPSlib -DCMAKE_INSTALL_PREFIX=hcana-install
*** cd /data1/cdaq/eel108/"name"
+
** cmake --build NPSlib-build/
** git clone https://github.com/"githubUserName"/nps_replay
+
** cmake --install NPSlib-build/
 +
** If one needs to recompile after making changes in NPSlib/src
 +
*** cd NPSlib-build
 +
*** make install
 +
** setenv LD_LIBRARY_PATH /home/cdaq/Dirname/nps-2023/hcana-install/lib64:$LD_LIBRARY_PATH
 +
* Setup nps_replay
 +
** git clone https://github.com/GithubUserName/nps_replay
 
** cd nps_replay
 
** cd nps_replay
 
** git remote add --track main upstream https://github.com/JeffersonLab/nps_replay
 
** git remote add --track main upstream https://github.com/JeffersonLab/nps_replay
** mkdir /data1/cdaq/eel108/output/ROOTfiles/"name"
+
** mkdir /net/cdaq/cdaql1data/cdaq/"name"/ROOTfiles
** ln -sf /data1/cdaq/eel108/output/ROOTfiles/"name" ROOTfiles
+
** ln -sf /net/cdaq/cdaql1data/cdaq/"name"/ROOTfiles ROOTfiles
** mkdir /data1/cdaq/eel108/output/REPORT_OUTPUT/"name"
+
** mkdir /net/cdaq/cdaql1data/cdaq/"name"/REPORT_OUTPUT
** mkdir /data1/cdaq/eel108/output/REPORT_OUTPUT/"name"/NPS
+
** mkdir /net/cdaq/cdaql1data/cdaq/"name"/REPORT_OUTPUT/NPS
** mkdir /data1/cdaq/eel108/output/REPORT_OUTPUT/"name"/NPS/eel108
+
** mkdir /net/cdaq/cdaql1data/cdaq/"name"/REPORT_OUTPUT/NPS/eel108
** ln -sf /data1/cdaq/eel108/output/REPORT_OUTPUT/"name" REPORT_OUTPUT
+
** ln -sf /net/cdaq/cdaql1data/cdaq/"name"/REPORT_OUTPUT
** ln -sf /data1/cdaq/NPS/ cache ( do not have access to cache disk)
+
** ln -sf /cache/mss/hallc/c-nps/raw cache  
** ln -sf /data1/cdaq/NPS/ raw
+
** ln -sf /net/cdaq/cdaql1data/coda/data/raw raw
** if you are using you own hcana
+
** If not setup already and will have to done for every new login
*** ln -sf ../hcana/hcana
+
*** setenv PATH /home/cdaq/Dirname/nps-2023/hcana-install/bin:$PATH
** if you want to use the standard hcana
+
*** setenv LD_LIBRARY_PATH /home/cdaq/Dirname/nps-2023/hcana-install/lib64:$LD_LIBRARY_PATH
*** ln -sf /data1/cdaq/eel108/mkjones/hcana
+
*** source  /apps/root/PRO/bin/thisroot.csh
 +
** Replay scripts are under the SCRIPTS
 +
 
 
===Starting on the ifarm machines===
 
===Starting on the ifarm machines===
** if you are not in the c-nps group then email jones@jlab.org
+
* if you are not in the c-nps group then email jones@jlab.org
*** to see what groups you are in type:"groups" when on the CUE machines.
+
** to see what groups you are in type:"groups" when on the CUE machines.
** if you have not set up you own subdirectory:
+
* if you have not set up you own subdirectory:
***cd /group/nps
+
**cd /group/nps
***mkdir "name" ( make a subdirectory with your "name")
+
**mkdir "name" ( make a subdirectory with your "name")
***cd "name"
+
**cd "name"
** if you have subdirectory
+
* if you have subdirectory
*** cd /group/nps/"name"
+
** cd /group/nps/"name"
** git clone https://github.com/"githubUserName"/nps_replay
+
* Following above directions for the cdaq machines to install hcana,NPSlib and nps_replay
** cd nps_replay
+
* Setup ROOT, cmake
** git remote add --track main upstream https://github.com/JeffersonLab/nps_replay
+
** module use /group/halla/modulefiles
 +
** module load cmake
 +
** module load root
 +
* When setting up the nps_replay use volatile disk instead of /net/cdaq/cdaql1data/cdaq
 
** mkdir /volatile/hallc/nps/"name"
 
** mkdir /volatile/hallc/nps/"name"
 
** mkdir /volatile/hallc/nps/"name"/ROOTfiles
 
** mkdir /volatile/hallc/nps/"name"/ROOTfiles
Line 74: Line 88:
 
** mkdir /volatile/hallc/nps/"name"/REPORT_OUTPUT/NPS/eel108
 
** mkdir /volatile/hallc/nps/"name"/REPORT_OUTPUT/NPS/eel108
 
** ln -sf /volatile/hallc/nps/"name"/REPORT_OUTPUT REPORT_OUTPUT
 
** ln -sf /volatile/hallc/nps/"name"/REPORT_OUTPUT REPORT_OUTPUT
** ln -sf /cache/mss/hallc/c-nps/raw raw  
+
** ln -sf /cache/mss/hallc/c-nps/raw raw
** if using your own hcana binary
 
*** ln -sf ../hcana/hcana
 
  
 
== Analyzing data ==
 
== Analyzing data ==
*on cdaql3
+
*on cdaql1
** cd /data1/cdaq/eel108/"name"/nps_replay
+
** cd //"name"/nps_replay
 
* On ifarm
 
* On ifarm
** cd /group/nps/"name"/nps_replay
+
** cd /group/nps/"name"/nps-2023/nps_replay
* ./hcana
+
[[Offline Analysis]]
 +
* hcana
 
* At the analyzer prompt
 
* At the analyzer prompt
 
**  .x SCRIPTS/NPS/eel108_replay.C(nrun,nevents)
 
**  .x SCRIPTS/NPS/eel108_replay.C(nrun,nevents)
Line 89: Line 102:
 
** It is slow because we are reading sample data for all FADc channels for each event
 
** It is slow because we are reading sample data for all FADc channels for each event
 
* Root file is output to the ROOTfiles directory.
 
* Root file is output to the ROOTfiles directory.
 +
 +
== Notable Software Changes ==
 +
 +
Add a running list of major changes and when they were implemented on cdaq and the farm.
 +
NPSlib
 +
hcana
 +
Podd
 +
nps_replay
 +
 +
== Location of Replays ==
 +
Path to individual segment replays.
 +
Path to skim replays.
 +
location of report files.
 +
Archives of report files and how to put them on your work disk.
 +
History of updates for farm jobs with run ranges.
  
 
== Analysis info==
 
== Analysis info==
Line 95: Line 123:
  
 
== Git workflow ==
 
== Git workflow ==
* Encouraged to use this git workflow for both the hcana and nps_replay repos
+
* [https://hallcweb.jlab.org/doc-private/ShowDocument?docid=1212 Slides] on Git with the suggested workflow'
* Fork from the JeffersonLab to your personal github account
 
* For hcana:
 
** git clone https://github.com/"githubUserName"/hcana
 
** This creates a remote alias called "origin" that is link to https://github.com/"githubUserName"
 
** git remote add --track develop upstream https://github.com/JeffersonLab/hcana"
 
** It is an historical accident that for "hcana" repo we have been using  the branch "develop" as the main branch for the repo.
 
** When working in hcana, make a new branch
 
** git checkout -b "newbranch"
 
** If you make a change that you would like others to test or eventually become part of the Jefferson Lab repo
 
*** Commit your changes in the "newbranch"
 
*** Push your changes to your personal github account
 
*** Make a pull request to JeffersonLab repo
 
**Once your commit is accepted
 
** git checkout develop
 
** git pull upstream develop
 
** Check that hcana works as you expect
 
** If hcana works as expect then you can delete "newbranch" locally and on the remote repo
 
*** git branch -d newbranch
 
*** git push origin --delete newbranch
 
**Now you can create another new branch to make additional changes
 
  
 
== Miscellaneous Support Repos ==
 
== Miscellaneous Support Repos ==

Latest revision as of 09:16, 7 June 2024

NPS Software Meetings

NPS Software Meetings

Setting up HCANA and NPSlib, nps_replay Instructions

Git repos

Starting on the cdaqll machine

  • login into cdaql1 through the gateway
  • if you want to use the standard replay type "go_analysis_nps"
  • if you do not have a directory and want to do independent analysis
  • Create a directory /home/cdaq/Dirname
  • Create a directory /home/cdaq/Dirname/nps-2023
  • cd /home/cdaq/Dirname/nps-2023
  • Setup cmake and ROOT
    • module use /apps/modulefiles/
    • module load cmake
    • source /apps/root/PRO/bin/thisroot.csh
  • Setup hcana
    • git clone https://github.com/GithubUserName/hcana
    • cd hcana
    • git remote add --track develop upstream https://github.com/JeffersonLab/hcana
    • git submodule init
    • git submodule update
    • cd ..
    • cmake -B hcana-build -S hcana -DCMAKE_INSTALL_PREFIX=hcana-install
    • cmake --build hcana-build -j12
    • cmake --install hcana-build/
    • setenv PATH /home/cdaq/Dirname/nps-2023/hcana-install/bin:$PATH
    • If one needs to recompile after making changes in hcana/src
      • cd hcana-build
      • make install
  • Setup NPSlib
    • git clone https://github.com/GithubUserName/NPSlib
    • cd NPSlib
    • git remote add --track main upstream https://github.com/JeffersonLab/NPSlib
    • cd ..
    • cmake -B NPSlib-build -S NPSlib -DCMAKE_INSTALL_PREFIX=hcana-install
    • cmake --build NPSlib-build/
    • cmake --install NPSlib-build/
    • If one needs to recompile after making changes in NPSlib/src
      • cd NPSlib-build
      • make install
    • setenv LD_LIBRARY_PATH /home/cdaq/Dirname/nps-2023/hcana-install/lib64:$LD_LIBRARY_PATH
  • Setup nps_replay
    • git clone https://github.com/GithubUserName/nps_replay
    • cd nps_replay
    • git remote add --track main upstream https://github.com/JeffersonLab/nps_replay
    • mkdir /net/cdaq/cdaql1data/cdaq/"name"/ROOTfiles
    • ln -sf /net/cdaq/cdaql1data/cdaq/"name"/ROOTfiles ROOTfiles
    • mkdir /net/cdaq/cdaql1data/cdaq/"name"/REPORT_OUTPUT
    • mkdir /net/cdaq/cdaql1data/cdaq/"name"/REPORT_OUTPUT/NPS
    • mkdir /net/cdaq/cdaql1data/cdaq/"name"/REPORT_OUTPUT/NPS/eel108
    • ln -sf /net/cdaq/cdaql1data/cdaq/"name"/REPORT_OUTPUT
    • ln -sf /cache/mss/hallc/c-nps/raw cache
    • ln -sf /net/cdaq/cdaql1data/coda/data/raw raw
    • If not setup already and will have to done for every new login
      • setenv PATH /home/cdaq/Dirname/nps-2023/hcana-install/bin:$PATH
      • setenv LD_LIBRARY_PATH /home/cdaq/Dirname/nps-2023/hcana-install/lib64:$LD_LIBRARY_PATH
      • source /apps/root/PRO/bin/thisroot.csh
    • Replay scripts are under the SCRIPTS

Starting on the ifarm machines

  • if you are not in the c-nps group then email jones@jlab.org
    • to see what groups you are in type:"groups" when on the CUE machines.
  • if you have not set up you own subdirectory:
    • cd /group/nps
    • mkdir "name" ( make a subdirectory with your "name")
    • cd "name"
  • if you have subdirectory
    • cd /group/nps/"name"
  • Following above directions for the cdaq machines to install hcana,NPSlib and nps_replay
  • Setup ROOT, cmake
    • module use /group/halla/modulefiles
    • module load cmake
    • module load root
  • When setting up the nps_replay use volatile disk instead of /net/cdaq/cdaql1data/cdaq
    • mkdir /volatile/hallc/nps/"name"
    • mkdir /volatile/hallc/nps/"name"/ROOTfiles
    • ln -sf /volatile/hallc/nps/"name"/ROOTfiles ROOTfiles
    • mkdir /volatile/hallc/nps/"name"/REPORT_OUTPUT
    • mkdir /volatile/hallc/nps/"name"/REPORT_OUTPUT/NPS
    • mkdir /volatile/hallc/nps/"name"/REPORT_OUTPUT/NPS/eel108
    • ln -sf /volatile/hallc/nps/"name"/REPORT_OUTPUT REPORT_OUTPUT
    • ln -sf /cache/mss/hallc/c-nps/raw raw

Analyzing data

  • on cdaql1
    • cd //"name"/nps_replay
  • On ifarm
    • cd /group/nps/"name"/nps-2023/nps_replay

Offline Analysis

  • hcana
  • At the analyzer prompt
    • .x SCRIPTS/NPS/eel108_replay.C(nrun,nevents)
    • If events = -1 , then replay all events.
    • It is slow because we are reading sample data for all FADc channels for each event
  • Root file is output to the ROOTfiles directory.

Notable Software Changes

Add a running list of major changes and when they were implemented on cdaq and the farm. NPSlib hcana Podd nps_replay

Location of Replays

Path to individual segment replays. Path to skim replays. location of report files. Archives of report files and how to put them on your work disk. History of updates for farm jobs with run ranges.

Analysis info

Run spreadsheet EEL108

Git workflow

  • Slides on Git with the suggested workflow'

Miscellaneous Support Repos

Please post supporting scripts, online displays, debugging code, etc below.  (Github repo links please!)