Difference between revisions of "Qweak R1 Software"

From New IAC Wiki
Jump to navigation Jump to search
Line 7: Line 7:
 
== Lab View ==
 
== Lab View ==
 
rotation control.
 
rotation control.
 +
 +
 +
=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 ([http://jlab.org/~tforest/VFAT2Manual.pdf  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.
 +
 +
 +
 +
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
 +
 +
<pre>
 +
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;
 +
 +
</pre>
 +
 +
Another simpler eaxample is in
 +
Tracking/src/QwMainDetector.cc
 +
<pre>
 +
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"){
 +
 +
</pre>
 +
 +
  
 
=Monitoring Histograms GUI=
 
=Monitoring Histograms GUI=
  
 
== Hit display ==
 
== Hit display ==
 +
=References=
 +
 +
[http://jlab.org/~tforest/VFAT2Manual.pdf  VFAT manual]

Revision as of 01:03, 20 May 2009

Slow Control GUI

MEDM

use EPICS se set HV channels and alarms

Lab View

rotation control.


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.


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"){


Monitoring Histograms GUI

Hit display

References

VFAT manual