[dsg-eic_dirc] EIC DIRC DAQ and analysis macros

Grzegorz Kalicy gkalicy at jlab.org
Mon May 8 12:01:56 EDT 2023


Hi Brian,

Here are the header files:


------Begin serial_line.cxx---------

// $Id: serial_line.cxx,v 1.3 2005/10/28 19:55:44 carsten Exp $
// Log at end of file


#include "serial_line.hxx"

//-------------------------------------------------------------------
SerialLine::SerialLine(std::string line, int verbosity, device dev)
{
  fverbosity = verbosity;
  fline      = line;

  // O_RDWR   read/write
  // O_NOCTTY don't be the controlling terminal
  // O_NDELAY don't care about DCD and wait until chars are present for read
  fd = open(line.c_str(), O_RDWR | O_NOCTTY | O_NDELAY);
  //fd = open(line.c_str(), O_RDWR | O_NOCTTY);


  if (fverbosity>0)
    {
      std::cout<<" SerialLine: opened serial line "<<line
       <<" with file handle "<<fd<<std::endl;
    }

  if (fd == -1)
    {
      std::cerr<<" *** open_port: Unable to open "<<line<<std::endl;
      exit(EXIT_FAILURE);
    }
  else
    {
      fcntl(fd, F_SETFL, 0);
    }

  struct termios options;


  tcgetattr(fd, &options);  // get current options
  foptionsOld = options;    // save them for later


  switch (dev)
    {
    case LSTEP:

      // 8N2 at 57600 in canonical mode

      cfsetispeed(&options, B57600);
      cfsetospeed(&options, B57600);
      // set parameters
      // see documentation in ./doc/serial/serial.html
      options.c_cflag &= ~PARENB; // do not enable parity bit
      options.c_cflag |= CSTOPB;  // two stop bits
      options.c_cflag &= ~CSIZE;  // no bit mask for data bits
      options.c_cflag |= CS8;     // 8 data bits
      options.c_cflag |= CRTSCTS; // rts/cts hand shake
      options.c_cflag     |= (CLOCAL | CREAD);
      options.c_lflag     |= (ICANON | ECHO |  ECHOE); // canonical input
      options.c_oflag     = 0;
      //options.c_cc[VMIN]  = 0;
      //options.c_cc[VTIME] = 2;
      options.c_cc[VMIN]  = 1;//GS
      options.c_cc[VTIME] = 0;//GS 21.04.2021

      break;

    case PEAKTECH:

      // 7E1 at 1200 in modem mode

      options.c_cflag=0;
      cfsetispeed(&options, B1200);
      cfsetospeed(&options, B1200);
      options.c_cflag |= CREAD;
      options.c_cflag |= PARENB;
      options.c_cflag |= CS7;
      options.c_cflag |= CRTSCTS;
      options.c_cc[VMIN]  = 0;
      options.c_cc[VTIME] = 2;
      options.c_lflag     &= ~(ICANON | ECHO |  ECHOE |  ISIG); // raw (modem)
      options.c_oflag     &= ~OPOST;                            // modem mode
      options.c_cc[VMIN]  = 0;
      options.c_cc[VTIME] = 1; //unit=1/10 seconds
      options.c_iflag = IGNBRK | IGNPAR;
      break;

    case CTLAB:

      // 8N1 at B38400 in canonical mode

      // options.c_cflag=0; // never initialize cflag
      cfsetispeed(&options, B38400);
      cfsetospeed(&options, B38400);
      options.c_cflag |= CREAD;  // should be always set
      options.c_cflag |= CLOCAL; // should be always set

      // parity 8N1
      options.c_cflag &= ~PARENB;
      options.c_cflag &= ~CSTOPB;
      options.c_cflag &= ~CSIZE;  // Mask the character size bits
      options.c_cflag |= CS8;     // 8 bit

      options.c_cflag &= ~CRTSCTS;                // disable hardware flow control

      //options.c_lflag |= (ICANON | ECHO | ECHOE); // canonical input (line oriented with CR | LF)
      options.c_lflag &= ~(ICANON | ECHO |  ECHOE |  ISIG); // raw (modem)

      options.c_iflag &= ~(IXON | IXOFF | IXANY); // without-> no return from read
      //options.c_iflag = IGNBRK | IGNPAR;

      options.c_oflag &= ~OPOST;  // raw mode, no processed output

      //options.c_cc[VMIN]  = 0;
      //options.c_cc[VTIME] = 1; //unit=1/10 seconds
      options.c_cc[VMIN]  = 1; //before 1 GS
      options.c_cc[VTIME] = 0; //unit=1/10 seconds
      break;

//    case HAMEG:


//      // 8N1 at 19200 in canonical mode
 //     // 8N1 at 115200 in canonical mode

//      options.c_cflag=0;
//      cfsetispeed(&options, B19200);
//      cfsetospeed(&options, B19200);
 //     options.c_cflag |= CREAD;
 //     options.c_cflag &= ~PARENB;
 //     options.c_cflag |= CS8;
 //     options.c_iflag &= ~(IXON | IXOFF | IXANY); // without-> no return from read
  //    options.c_cflag &= ~CRTSCTS;                //###
 //     options.c_cc[VMIN]  = 0;
 //     options.c_cflag     &= ~CLOCAL;
  //    options.c_cc[VTIME] = 2;
  //    options.c_lflag &= ~(ICANON | ECHO |  ECHOE |  ISIG); // raw (modem)
  //    options.c_oflag &= ~OPOST;                            // modem mode
  //    options.c_cc[VMIN]  = 0;
  //    options.c_cc[VTIME] = 1; //unit=1/10 seconds
  //    options.c_iflag = IGNBRK | IGNPAR;
  //    break;










    default:

      std::cerr<<" *** SerialLine: device not known.\n";
      // close interface
      if (fd!=-1)
{
  tcsetattr(fd, TCSANOW, &foptionsOld);
  close(fd);
}
      exit(EXIT_FAILURE);
      break;
    }


  /* set the options */
  tcsetattr(fd, TCSANOW, &options);

}

SerialLine::~SerialLine()
{
  // close interface
  if (fd!=-1)
    {
      tcsetattr(fd, TCSANOW, &foptionsOld);
      close(fd);
    }

  if (fverbosity>0)
    {
      std::cout<<" SerialLine: closed serial line "<<fline
       <<" with file handle "<<fd<<std::endl;
    }
}

// $Log: serial_line.cxx,v $
// Revision 1.3  2005/10/28 19:55:44  carsten
// added multimeter PeakTech 451 RS
//
// Revision 1.2  2005/10/28 14:59:44  carsten
// added Peaktech 451RS
//
// Revision 1.1.1.1  2005/09/01 20:19:13  carsten
// nitial import
//



------End serial_line.cxx ----------




--------Begin of serial_line.hxx ----------


// $Id: serial_line.hxx,v 1.5 2005/10/28 19:55:44 carsten Exp $
// Log at end of file

#ifndef __SERIAL_LINE_HXX__
#define __SERIAL_LINE_HXX__

#include <cstdlib>
//#include <cstdio>
//#include <cmath>
//#include <string>
#include <iostream> // cout cerr cin
//#include <fstream>
//#include <ctime>
//#include <list>

#include <unistd.h>  /* UNIX standard function definitions */
#include <fcntl.h>   /* File control definitions */
#include <errno.h>   /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */

#include <string>

/*!
  \class SerialLine serial_line.hxx
  \brief Serial line control.

  Administration of a serial line
*/



//! Enumeration of devices.
/*! This parameter determines the setting of the serial line
  and the way of reading the serial line. */
enum device {
  LSTEP,         /*!< LSTEP controller card. */
  PEAKTECH,      /*!< PeakTech451RS Multimeter (DMM). */
  CTLAB          /*!< C't Lab interfaces */
};

class SerialLine
{
public:
  /*! Non empty constructor
    Explanation of serial line parameters can be found
    <A HREF="../serial/serial.html">here.</A>
    \param line string with name eg. /dev/ttyS0 for controller
    \param verbosity verbosity 0=quite
    \param dev (LSTEP,PEAKTECH)
  */
  SerialLine(std::string line,
     int         verbosity=0,
     device      dev=LSTEP);


  //! Empty destructor
  ~SerialLine();

  /*! \brief File handle
    \return file handle for serial line
  */
  int fileHandle(){return fd;}

private:
  int            fd;                           //!< File descriptor for interface.
  struct termios foptionsOld;                  //!< Old status of interface.
  int            fverbosity;                   //!< Verbosity 0=quiet.
  std::string    fline;                        //!< Name of interface.
};
#endif
// $Log: serial_line.hxx,v $
// Revision 1.5  2005/10/28 19:55:44  carsten
// added multimeter PeakTech 451 RS
//
// Revision 1.4  2005/10/28 14:59:47  carsten
// added Peaktech 451RS
//
// Revision 1.3  2005/09/02 09:46:52  carsten
// inserted documentation link
//
// Revision 1.2  2005/09/01 20:23:44  carsten
// comments
//
// Revision 1.1.1.1  2005/09/01 20:19:13  carsten
// nitial import
//
--------end of file serial_line.hxx


------Begin of calib_ct_lab.cxx------

#include <cstdlib>
#include <cstdio>

#include <cmath>
#include <string>
using std::string;

#include <iostream>
using std::cout;
using std::cin;
using std::cerr;
using std::endl;

#include <fstream>
using std::fstream;

#include <ctime>

#include <vector>
using std::vector;

#include "calib_ct_lab.h"


//----------------------------------------------------------------------
CalibCtLab::CalibCtLab()
{
  m_filename_dac.resize(8);
  m_filename_dac_exist.resize(8);
  m_filename_adc.resize(8);
  m_filename_adc_exist.resize(8);

  for (int icard=0; icard<8; icard++)
    {
      m_filename_dac[icard] = "none";
      m_filename_dac_exist[icard] = false;
      m_filename_adc[icard] = "none";
      m_filename_adc_exist[icard] = false;
    }

  for (int icard=0; icard<8; icard++)
    {
      for (int n=0; n<391; n++)
{
  m_voltSetAdc[icard][n] = -9.5 + 0.05*n;
  for (int ich=0; ich<8; ich++)
    {
      m_voltReadAdc[icard][ich][n]=999;
    }
}
    }
}
//----------------------------------------------------------------------
int CalibCtLab::readDacFile(int icard, string filename)
{
  fstream in;
  in.open(filename.c_str(),std::ios::in);

  if (!in)
    {
      return 1; // file doesn't exist
    }
  else
    {
      int n=0;
      while(in)
{
  in>>m_voltSetDac[icard][n];
  for (int ich=0; ich<8; ich++)
    {
      in>>m_voltReadDac[icard][ich][n];
    }
  n++;

}
      m_filename_dac_exist[icard]=true;

    }
  in.close();
  return 0;


}
//----------------------------------------------------------------------
void CalibCtLab::writeAdcFile(int icard, string filename)
{
  fstream out;
  out.open(filename.c_str(),std::ios::out | std::ios::trunc);

  if (!out)
    {
      cerr<<" *** CalibCtLab::writeAdcFile: cannot open file, exit."<<endl;
      exit(EXIT_FAILURE);
    }
  else
    {
      for (int n=0; n<391; n++)
{
  out<<m_voltSetAdc[icard][n]<<" ";
  for (int ich=0; ich<8; ich++)
    {
      out<<m_voltReadAdc[icard][ich][n]<<" ";
    }
  out<<endl;
}
    }
  out.close();

}
//----------------------------------------------------------------------
void CalibCtLab::readAdcFile(int icard, string filename)
{
  fstream in;
  in.open(filename.c_str(),std::ios::in);

  if (!in)
    {
      cerr<<" *** CalibCtLab::readAdcFile: cannot open file, exit."<<endl;
      exit(EXIT_FAILURE);
    }
  else
    {
      for (int n=0; n<391; n++)
{
  in>>m_voltSetAdc[icard][n];
  for (int ich=0; ich<8; ich++)
    {
      in>>m_voltReadAdc[icard][ich][n];
    }
}
      m_filename_adc[icard]=filename;
      m_filename_adc_exist[icard]=true;
    }
  in.close();
}
//----------------------------------------------------------------------
double CalibCtLab::dacSetValue(int icard, int ichannel, double value)
{
  double frac,volt_diff,volt_diff1,volt_diff2;


  if (m_filename_dac_exist[icard])
    {
        if (value<-9.5)
{
  cout<<" CalibCtLab::dacSetValue: value<-9.6 Volt. "
      <<" Return hardware calibration"<<endl;
  return value;
}
        if (value>10.0)
{
  cout<<" CalibCtLab::dacSetValue: value>10 Volt. "
      <<" Return hardware calibration"<<endl;
  return value;
}
      if (m_voltReadDac[icard][ichannel][0]>900)
{
  cout<<" CalibCtLab::dacSetValue: channel not calibrated "
      <<" Return hardware calibration"<<endl;
  return value;
}
      for (int n=0; n<1000; n++)
{

  //cout<<m_voltSet[icard][n]<<" "<<value<<endl;

  if (value >= m_voltSetDac[icard][n] && value <= m_voltSetDac[icard][n+1])
    {
      //cout<<" found"<<endl;

      frac = (m_voltSetDac[icard][n+1]-value)
/ (m_voltSetDac[icard][n+1]-m_voltSetDac[icard][n]);
      volt_diff1 =
m_voltReadDac[icard][ichannel][n  ]-m_voltSetDac[icard][n  ];
      volt_diff2 =
m_voltReadDac[icard][ichannel][n+1]-m_voltSetDac[icard][n+1];
      volt_diff = volt_diff1 + frac * (volt_diff2-volt_diff1);

      return value-volt_diff;
    }
}
      cerr<<" *** CalibCtLab::dacSetValue: value not fond. Exit."<<endl;
      exit(EXIT_FAILURE);
    }
  else
    {
      cerr<<" *** CalibCtLab::dacSetValue: no calib data for card. Exit."<<endl;
      exit(EXIT_FAILURE);
    }
}
//----------------------------------------------------------------------
double CalibCtLab::adcValue(int icard, int ichannel, double value)
{
  double frac;
  if (m_filename_adc_exist[icard])
    {
        if (value<-9.5)
{
  cout<<" CalibCtLab::adcValue: value<-9.5 Volt. "
      <<" Return hardware calibration"<<endl;
      return -9.5; // old: value
}
    if (value>9.5) // old: 10
{
  cout<<" CalibCtLab::adcValue: value>9.5 Volt. "
      <<" Return hardware calibration"<<endl;
      return 9.5; // old: value
}
      if (m_voltReadAdc[icard][ichannel][0]>900)
{
  cout<<" CalibCtLab::adcValue: channel not calibrated "
      <<" Return hardware calibration"<<endl;
  return value;
}
      for (int n=0; n<391; n++)
{
  if (value >= m_voltReadAdc[icard][ichannel][n] &&
      value <= m_voltReadAdc[icard][ichannel][n+1])
    {
      frac = (value-m_voltReadAdc[icard][ichannel][n])
/ (m_voltReadAdc[icard][ichannel][n+1]-
   m_voltReadAdc[icard][ichannel][n]);

      //cout<<" n  ,read="<<n<<" "<<m_voltReadAdc[icard][ichannel][n]<<endl;
      //cout<<" n+1,read="<<n<<" "<<m_voltReadAdc[icard][ichannel][n+1]<<endl;
      //cout<<" n  , set="<<n<<" "<<m_voltSetAdc[icard][n]<<endl;
      //cout<<" n+1,read="<<n<<" "<<m_voltSetAdc[icard][n+1]<<endl;
      //cout<<"     frac="<<frac<<endl;

      return m_voltSetAdc[icard][n]+
frac*(m_voltSetAdc[icard][n+1]-m_voltSetAdc[icard][n]);
    }
}
      cerr<<" *** CalibCtLab::adcValue: value not fond. Exit."<<endl;
      exit(EXIT_FAILURE);
    }
  else
    {
      cerr<<" *** CalibCtLab::valueToSet: no calib data for card. Exit."<<endl;
      exit(EXIT_FAILURE);
    }
  return 999;
}
//----------------------------------------------------------------------
void CalibCtLab::setAdcCalibPara(int    icard,
int    ichannel,
double volt_set,
double volt_read)
{
  for (int n=0; n<391; n++)
    {
      if (fabs(volt_set - m_voltSetAdc[icard][n])<0.01)
{
  m_voltReadAdc[icard][ichannel][n]=volt_read;
  return;
}
    }


}

-----------End of calib_ct_lab.cxx-------------


-----------Begin of calib_ct_lab.h--------------

#ifndef CALIBCTLAB_H
#define CALIBCTLAB_H 1

/*!
  \class CalibCtLab calib_ct_lab.h
  \brief Calibration of max. 8 DAC and ADC within the c't lab project.

*/


class CalibCtLab
{
 private:

  vector<string> m_filename_dac;       //!< The filename of calibration data
  vector<bool>   m_filename_dac_exist; //!< Flag for read
  vector<string> m_filename_adc;       //!< The filename of calibration data
  vector<bool>   m_filename_adc_exist; //!< Flag for read

  double m_voltSetDac[8][1000];            /*!< volt set array for max 8 cards
and max 1000 values. */
  double m_voltReadDac[8][8][1000];        /*!< volt set array for max 8 cards,
8 channels, and max 1000 values. */
  double m_voltSetAdc[8][1000];            /*!< volt set array for max 8 cards
and max 1000 values. */
  double m_voltReadAdc[8][8][1000];        /*!< volt set array for max 8 cards,
8 channels, and max 1000 values. */

 public:

  CalibCtLab();                   //!< Empty constructor.

  /*! \brief Read calibration data file for DAC

  The file is expected to have a column of set voltage values and
  8 columns of read out values covering the range between -10 to 10 Volts.
  Columns which are not calibrated consist of 999 values.

    \param icard The card for which the file is read.
    \param filename The filename to read.
    \return Error code: 0=success, 1=file not found.
  */
  int readDacFile(int icard, string filename);

  /*! \brief Write ADC calibration to file
    \param icard The card for which the file is written.
    \param filename The filename to write.
  */
  void writeAdcFile(int icard, string filename);

  /*! \brief Read ADC calibration from file
    \param icard The card for which the file is read.
    \param filename The filename to read.
  */
  void readAdcFile(int icard, string filename);

  /*! \brief Value to set for wanted voltage.
    \param icard The card number [0-7].
    \param ichannel The channel number [0-7].
    \param value The wanted voltage in Volts.
    \return The voltage to set in the DAC to get back the wanted voltage.
  */
  double dacSetValue(int icard, int ichannel, double value);

  /*! \brief Calibrated ADC value.
    \param icard The card number [0-7].
    \param ichannel The channel number [0-7].
    \param value The uncalibrated value.
    \return Calibrated value.
  */
  double adcValue(int icard, int ichannel, double value);

  /*! \brief Value to set for wanted voltage.
    \param icard The card number [0-7].
    \param ichannel The channel number [0-7].
    \param volt_set Voltage applied to input.
    \param volt_read Raw voltage read out.
  */
  void setAdcCalibPara(int icard, int ichannel, double volt_set, double volt_read);

};


#endif

---------End of calib_ct_lab.h-----------

________________________________
From: Brian Eng <beng at jlab.org>
Sent: Thursday, May 4, 2023 10:26 AM
To: Tyler Lemon <tlemon at jlab.org>; Grzegorz Kalicy <gkalicy at jlab.org>
Cc: dsg-eic_dirc at jlab.org <dsg-eic_dirc at jlab.org>
Subject: Re: EIC DIRC DAQ and analysis macros

Hi Greg,

Do you have access to the header files (or know what libraries/programs they're from) that are included from the moni_max_fast_info_Hang.cc file?

Also do you have any input and output files we can use as reference? So that way if we change anything we can make sure the results are consistent?

Thanks
________________________________
From: dsg-eic_dirc <dsg-eic_dirc-bounces at jlab.org> on behalf of Grzegorz Kalicy via dsg-eic_dirc <dsg-eic_dirc at jlab.org>
Sent: Wednesday, May 3, 2023 8:49 AM
To: Tyler Lemon <tlemon at jlab.org>
Cc: dsg-eic_dirc at jlab.org <dsg-eic_dirc at jlab.org>
Subject: Re: [dsg-eic_dirc] EIC DIRC DAQ and analysis macros

Hi Tyler,

I’m fighting my laptop crash since 7am and it isn’t looking good, we might have to reschedule our meeting on the macros :/

Greg

On May 2, 2023, at 09:26, Tyler Lemon <tlemon at jlab.org> wrote:


Hi Greg and Beni,

We'll plan to meet at 9:30 AM on Wednesday over Zoom, then.
I'll set up a Zoom meeting soon for tomorrow.

-Tyler
________________________________
From: Grzegorz Kalicy <gkalicy at jlab.org>
Sent: Monday, May 1, 2023 4:38 PM
To: dsg-eic_dirc at jlab.org <dsg-eic_dirc at jlab.org>; Tyler Lemon <tlemon at jlab.org>
Subject: Re: EIC DIRC DAQ and analysis macros

Hi Tyler,

I have a meeting 8-9am, so I could meet at 9am on ZOOM or 9:15 in person.

Cheers,

Greg
________________________________
From: dsg-eic_dirc <dsg-eic_dirc-bounces at jlab.org> on behalf of Tyler Lemon via dsg-eic_dirc <dsg-eic_dirc at jlab.org>
Sent: Monday, May 1, 2023 2:09 PM
To: dsg-eic_dirc at jlab.org <dsg-eic_dirc at jlab.org>
Subject: [dsg-eic_dirc] EIC DIRC DAQ and analysis macros

Hi Greg,

Would you be available Wednesday morning to go over the EIC DIRC macros?

Anytime from 8:30 AM to 10:30 AM would be good for me.

Once we settle on a time, I can set up either a place to meet in person or a Zoom link.

Also, as an aside, I've attached the zipped file you sent me to this email in case anyone else in DSG wants to take a look at the macros.

-Tyler

________________________________
From: Grzegorz Kalicy <gkalicy at jlab.org>
Sent: Friday, April 28, 2023 8:41 AM
To: Tyler Lemon <tlemon at jlab.org>
Subject: Data taking and analysis macros

Hi Tyler,

I finally got the macros that we used to take data and analyze it in GSI.

Unfortunately, as for now it still requires Root 5, since Root 6 demands “proper C++”. We could update the code in this sense, yet it was not done, since it works 😉

Greg


Data taking:



-       You call filter_input_220918.sh to initialize the measurement and give the proper name (built out of the parameters written)
-       This starts data taking with the shell script
filter_work_220918.sh that gives the positions and step sizes for the motor movement and calls the program
“moni.cc” or now “moni_max_fast_info_test_Hang_Georg_Test”
§  and starts the same time the shell script filter_220918.sh that moves the motors
-       New is, that the program “moni” searches for a maximum position and gives this back to the motor steering script.

The file for the data taking “moni_max_fast_info_Hang.cc” has to be compiled as follows:
g++ moni_max_fast_info_Hang.cc calib_ct_lab.cxx serial_line.cxx -o moni_max_fast_info_test_Hang_Georg_Test








--- filter_input_220918.sh---

-       #!/bin/sh
-       #source /u/pandadrc/.bashrc
-       #. /home/greg/.bashr
-       d=`date +%y%m%d`
-       echo $d
-
-       echo ""
-       echo ">>>>>>>>>>>>>>>>>>>>>>>> Start at:   `date +%Y.%m.%d-%H:%M:%S`"
-       echo ""
-       filter_work_220918.sh IR Nikon 3 faces 442 $d 117.15

---End of filter_input_220918.sh ----



--filter_work_220918.sh ------------

#!/bin/sh
#source /u/pandadrc/.bashrc
#. /home/greg/.bashrc
echo DATE $6
skill moni_max_fast_i
skill moni_max_fast
echo -1 -666 -666  > /tmp/filter.dat
sleep 60

/u/pandadrc/georg/ctlab_gs/moni_max_fast_info_test_Hang_Georg_Test matrix &


#(all x,y values has to be multiplied by 10)

#               diode scan                              diode Brewster position     "Bar scan" (only for itterations)  "Bar position"        diode pure position (-half scan width) mirror-brewsterangle-mot5
#filter.sh   x_width  y_width  xy_step      x_ref y_ref                           xb_width yb_width xyb_step                xb_ref yb_ref           x_pure_once y_pure_once



       #442nm
#====================
filter_220918.sh    50 50 5 110 2090 60 200 20 650 1380 1980 2100 $7                  # Nikon 3         faces IR            new for series shorter


echo -666 > /tmp/filter.dat # end moni_ct
sleep 2
echo -1 > /tmp/filter.dat

mv -v $HOMEGREG/ctlab/moni_ct.dat $HOMEGREG/data/$1_$2-$3_$4_$5nm_$6_1.dat
mv -v $HOMEGREG/ctlab/moni_ct2.dat $HOMEGREG/data/$1_$2-$3_$4_$5nm_$6_2.dat
mv -v $HOMEGREG/ctlab/moni_ct3.dat $HOMEGREG/data/$1_$2-$3_$4_$5nm_$6_3.dat
mv -v $HOMEGREG/ctlab/moni_ct4.dat $HOMEGREG/data/$1_$2-$3_$4_$5nm_$6_4.dat

echo ""
echo ">>>>>>>>>>>>>>>>>>>>>>>> Stop at:    `date +%Y.%m.%d-%H:%M:%S`"
echo ""

---------------End of filter_work_220918.sh --------------------


The output files are as follows (after the run they are renamed from moni_ct.dat to the specific name you gave in filter_input_220918.sh):

Example: IR_Nikon-11_faces_442nm_230322_1.dat
13.9236 1.84149 1.50045 0 0 65 138
13.9236 1.84432 1.49195 0 0 65 138
13.9236 1.81853 1.50557 0 0 65 138
13.9236 1.83111 1.51421 0 0 65 138
13.9236 1.84778 1.491 0 0 65 138
13.9236 1.80721 1.48943 0 0 65 138
13.9236 1.81067 1.49069 0 0 65 138
13.9236 1.82451 1.48408 0 0 65 138
13.9236 1.81853 1.50941 0 0 65 138
13.9236 1.8135 1.51165 0 0 65 138
13.9572 1.84778 1.52606 2 2 65 138
13.9572 1.86074 1.51742 2 2 65 138

With time, value-diode, reference-diode, temperature (not measured, thus placeholder 0 or 2), filter (0 for “bar out” and 2 for “bar in”), bar-x position, bar y-position. The values are measured 10 times each.

These values represent the Maximum value on the diode after it was scanned over the laser-spot.

The data files “Name”_2.dat, “Name”_3.dat“,  and Name”_4.dat are used only to analyze the correctness of the diode scan.

Using Root 5:
This file IR_Nikon-11_faces_442nm_230322_1.dat is than converted to a root file via the program “glasstest.cc

root glasstest.cc'("IR_Nikon11_faces_442nm_230322_1.dat")'

and gives the out put file IR_Nikon11_faces_442nm_230322_1.root

This again is analyzed in Root5 with matrix.cc

.x matrix.cc("IR_Nikon-11_faces_442nm_230322_1",442,0,0,0,0,true)

and gives the out put file IR_Nikon11_faces_442nm_230322_1_plot3D.root

The parameter given to “matrix.cc” are the wavelength, that changes the mirror correction and the boundaries x_min, x_max, y_min, and y_max of the matrix that are used for the determination of the transmission. With the value “true” and “false” choose between internal reflection and bulk absorption.

The output of matrix.cc is also a plot of the voltage values of the diodes and the transmission values of the matrix.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/dsg-eic_dirc/attachments/20230508/fa4d6656/attachment-0001.html>


More information about the dsg-eic_dirc mailing list