Qweak R1 Software

From New IAC Wiki
Jump to navigation Jump to search

Slow Control GUI

MEDM

use EPICS se set HV channels and alarms

Lab View

rotation control.

VFAT setup

The VFAT setup is done through a web interface.

GEM data processing

The GEM detector contains 6 VFAT cards which are used to digitize the charge from an ionization event. Each channel of the VFAT is associated with a charge collection strip within the GEM ionization chamber. Once triggered the VFAT card will transfer 192 bits (Defined in Figure 8 of the VFAT manual V2.0) from each VFAT card to separate I/O channels on a CAEN V1495 module.

VFAT to V1495

V1495 to CODA data file

CODA file to Tracking data structure

A ROC will transfer GEM data from a CAEN V1495 to the host DAQ computer. At the local institution there will only be one element of the Qweak tracking software. Once the ROC is writeing data to a CODA file from the V1495 we will need to write software which will take the raw data and create a data structure for tracking. The data structure for tracking, in the case of R1, will contain the distance of the elastic scattering event from the beam pipe center ([math]R[/math]) and [math]\phi[/math] representing the local polar angle in which [math]\phi=0[/math] at the center of the detector.

The SVN repository for the Qweak Analysis and tracking software is at

https://qweaksvn.jlab.org/repos/QwAnalysis/trunk/Analysis

Qweak wiki describing the software is at

https://qweak.jlab.org/wiki/index.php/Installation_and_compilation

GEM data header file is located in

QwAnalysis/ Tracking/include/QwGasElectronMultiplier.h

The above defines the processed data structure, it includes a ProcessEventBuffer function to strip data out of the raw CODA data buffer, defines the function to create a QwHit for each r and phi strip hit

Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t* buffer, UInt_t num_words){return 0;};  /* contains IPreamp info if needed occurs during Prestart*/
 Int_t ProcessEvBuffer(UInt_t roc_id, UInt_t bank_id, UInt_t* buffer, UInt_t num_words){return 0;};/* filters out VFAT data from CODA bank*/
 void  ProcessEvent() /* fills hit list */
QwGasElectronMultiplier->fHits

create a tracking source file in the subdirectory which contains the actual code to do the above

QwAnalysis/Tracking/src/QwGasElectronMultiplier.cc



The above *.cc file also needs a LoadMap function to read a prminput file (located in Tracking/prminput/)

an example of which is shown in

Tracking/src/QwDriftChamber.cc
Int_t QwDriftChamber::LoadChannelMap(TString mapfile){
  TString varname, varvalue;
  UInt_t  chan, package, plane, wire, direction, DIRMODE;
  DIRMODE=0;
  

  fDirectionData.resize(2);//currently we have 2  package - Rakitha (10/23/2008)
  fDirectionData.at(0).resize(12); //currently we have 12 wire planes in each package - Rakitha (10/23/2008)
  fDirectionData.at(1).resize(12); //currently we have 12 wire planes in each package - Rakitha (10/23/2008)

  QwParameterFile mapstr(mapfile.Data());  //Open the file

  while (mapstr.ReadNextLine()){
    mapstr.TrimComment('!');   // Remove everything after a '!' character.
    mapstr.TrimWhitespace();   // Get rid of leading and trailing spaces.
    if (mapstr.LineIsEmpty())  continue;

Another simpler eaxample is in

Tracking/src/QwMainDetector.cc
Int_t QwMainDetector::LoadChannelMap(TString mapfile){
  TString varname, varvalue;
  TString modtype, dettype, name;
  Int_t modnum, channum;

  QwParameterFile mapstr(mapfile.Data());  //Open the file
  while (mapstr.ReadNextLine()){
    mapstr.TrimComment('!');   // Remove everything after a '!' character.
    mapstr.TrimWhitespace();   // Get rid of leading and trailing spaces.
    if (mapstr.LineIsEmpty())  continue;

    if (mapstr.HasVariablePair("=",varname,varvalue)){
      //  This is a declaration line.  Decode it.
      varname.ToLower();
      UInt_t value = atol(varvalue.Data());
      if (varname=="roc"){
        RegisterROCNumber(value);
      } else if (varname=="bank"){
        RegisterSubbank(value);
      } else if (varname=="slot"){

DataBase info

The following run-by-run information should be included in a database table

Two tables:

   R1G1  = Region 1 GEM Detector 1
   R1G2  = Region 1 GEM Detector 1

Monitoring Histograms GUI

Hit display

References

VFAT manual


Go Back Qweak