Difference between revisions of "ROOT Analyzer/Running"

From HallCWiki
Jump to: navigation, search
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[category:12GeV Software]]
 
[[category:12GeV Software]]
As of the tag "HodoscopeHits" in the master branch, the Hall C++ analyzer will read Hall C style CTP parameter files, and read a Hall C data file and sort HMS hodoscope data into Hall C style hit lists.
+
As of the tag "HitMaps" in the master branch, the Hall C++ analyzer will read Hall C style CTP parameter files, and read a Hall C data file and sort HMS hodoscope data and HMS drift chamber data into Hall C style hit lists.  It will also fill global variables from which hodoscope hit maps can be created.
 +
 
 +
== Code analysis software ==
 +
*[http://cppcheck.sourceforge.net/ Cppcheck] is a static code analysis tool.
 +
*[http://valgrind.org/ Valgrind] is a an instrumentation framework for building dynamic analysis tools.
  
 
== Updating software ==
 
== Updating software ==
Line 10: Line 14:
 
   git pull
 
   git pull
  
in both the top hcana directory and the "podd" sub directory and make sure you are on the "master" branch for bothThe hcana code should be at tag "DCandHodoscopeHits" or later and the podd tag snould be "1.5.22_HC02" or later.
+
in the top hcana directory.  After doing this type:
 +
 
 +
  git status
 +
 
 +
If it complains that podd is modified or not up to date, then type
 +
 
 +
  git submodule update
  
 
== Decoding hodoscope and drift chamber hits ==
 
== Decoding hodoscope and drift chamber hits ==
  
To demonstrate the analyzer decoding hits, retrieve the file [https://userweb.jlab.org/~saw/software/hcana_testing_work.tar.gz hcana_testing_work.tar.gz].  Unpack it into your hcana directory which will make a subdirectory "work".  After making sure the analyzer is cleanly compiled, from "work" do:
+
To demonstrate the analyzer decoding hits, retrieve the file [https://userweb.jlab.org/~saw/software/daq04_50017.log.0.gz daq04_50017.log.0.gz] into the "examples" subdirectory and run "gunzip daq04_50017.log.0.gz" to uncompress the data file(If you want to use a different data file, edit the "THaRun" line in hodtest.C to point to the run file name).  After making sure the analyzer is cleanly compiled, from "examples" do:
  
 
   ../hcana
 
   ../hcana
 
   .x hodtest.C
 
   .x hodtest.C
  
hodtest.C is a script that sets up an analysis.  Look in podd/examples for Hall A analyzer script examples.
+
hodtest.C is a script that sets up an analysis.  [[Annoted hodtest.C]] explains the current version of this script.
  
The analyzer does nothing Hall C specific beyond printing hits.  But it does serve as an example of how to decode hits for other detectors and as a starting point for writing detector analysis code.
+
Look in podd/examples for Hall A analyzer script examples.
 +
 
 +
To see hits printed out by the analyzer, edit hodtest.C and comment out the line
 +
 
 +
  HMS->AddDetector( new THcDriftChamber("dc", "Drift Chambers" ));
 +
 
 +
before running the script.  To see hodoscope hits, uncomment some code at the end of the THcHodoscope::Decode method.
 +
 
 +
Running this script will create a root file, "hodtest.root."  The contents of this file are controled by "output.def".  (See hcana/podd/examples/output_example.def for examples of how to make an output definition file.)
 +
 
 +
To see the histograms that were created, do:
 +
 
 +
  ../hcana
 +
  .x hitmaps_hms.C
 +
 
 +
which should make this plot:
 +
 
 +
[[Image:AnalyzerHitMap.png]]
 +
 
 +
The analyzer does nothing Hall C specific beyond printing hits and filling the hitmap histograms.  But it does serve as an example of how to decode hits for other detectors and as a starting point for writing detector analysis code.
  
 
== Parameters ==
 
== Parameters ==
Line 45: Line 74:
 
   analyzer [6] integerarray[3]
 
   analyzer [6] integerarray[3]
 
   (Int_t)4
 
   (Int_t)4
 +
 +
= SHMS and HMS Angle Cam Images in CODA files =
 +
The angle camera images are stored at the start of every CODA run.  See [[Extract Angle Cam Image from CODA files]] for details on how to extract them.

Latest revision as of 20:40, 26 April 2022

As of the tag "HitMaps" in the master branch, the Hall C++ analyzer will read Hall C style CTP parameter files, and read a Hall C data file and sort HMS hodoscope data and HMS drift chamber data into Hall C style hit lists. It will also fill global variables from which hodoscope hit maps can be created.

Code analysis software

  • Cppcheck is a static code analysis tool.
  • Valgrind is a an instrumentation framework for building dynamic analysis tools.

Updating software

If you don't already have a copy of the Hall C Analyzer git repository, go to Analyzer/Git to set it up.

To make sure your git repository is up to date, do

 git pull

in the top hcana directory. After doing this type:

 git status

If it complains that podd is modified or not up to date, then type

 git submodule update

Decoding hodoscope and drift chamber hits

To demonstrate the analyzer decoding hits, retrieve the file daq04_50017.log.0.gz into the "examples" subdirectory and run "gunzip daq04_50017.log.0.gz" to uncompress the data file. (If you want to use a different data file, edit the "THaRun" line in hodtest.C to point to the run file name). After making sure the analyzer is cleanly compiled, from "examples" do:

 ../hcana
 .x hodtest.C

hodtest.C is a script that sets up an analysis. Annoted hodtest.C explains the current version of this script.

Look in podd/examples for Hall A analyzer script examples.

To see hits printed out by the analyzer, edit hodtest.C and comment out the line

 HMS->AddDetector( new THcDriftChamber("dc", "Drift Chambers" ));

before running the script. To see hodoscope hits, uncomment some code at the end of the THcHodoscope::Decode method.

Running this script will create a root file, "hodtest.root." The contents of this file are controled by "output.def". (See hcana/podd/examples/output_example.def for examples of how to make an output definition file.)

To see the histograms that were created, do:

 ../hcana
 .x hitmaps_hms.C

which should make this plot:

AnalyzerHitMap.png

The analyzer does nothing Hall C specific beyond printing hits and filling the hitmap histograms. But it does serve as an example of how to decode hits for other detectors and as a starting point for writing detector analysis code.

Parameters

To try just reading parameters, run the analyzer from the top directory.

 ./hcana

Once it starts up, type

 gHcParms->Load("hctest.input")

To dump the parameters read

 gHcParms->PrintFull()

Some examples of accessing individual variables

 analyzer [3]  Double_t ProtonMass = *(Double_t *)gHcParms->Find("proton")->GetValuePointer();
 analyzer [4] ProtonMass
 (Double_t)9.38272000000000048e+02
 analyzer [5] Int_t *integerarray = (Int_t *)gHcParms->Find("integerarray")->GetValuePointer();
 analyzer [6] integerarray[3]
 (Int_t)4

SHMS and HMS Angle Cam Images in CODA files

The angle camera images are stored at the start of every CODA run. See Extract Angle Cam Image from CODA files for details on how to extract them.