Pedcalc_mod_auto and Gaincalc_mod_auto Instruction/descriptions

 

How to run pedcalc_mod_auto

  1. Ensure logged into online machine as shift
  2. Goto directory: /home/shift/pedgainmodcalc
  3. Type:
         phat <ENTER>
  4. At prompt , root [0] , type:
        .x pedcalc_mod_auto.C(<RunNumber>,<SequenceNumber>) <ENTER>
    eg: .x pedcalc_mod_auto.C(2230,0)
    The default name of the DAQ data directory is /mnt/data, so if the data  is mounted elsewhere there you can type:
        .x pedcalc_mod_auto.C(<RunNumber>,<SequenceNumber>,<DAQDataDirectory>)
  5. The progam then finds the disk number your data file is located on, and lets you know where it found it. If it does not find it, it stops. So then check the data is still on the DAQ.
  6. You will be asked questions about the defaults, see Pedcalc_mod Default Questions, if happy just keep hitting return, else follow directions and make changes as required
  7. You will see an output of directories (See Example of running pedcalc_mod.C)
  8. You should see output about connecting to data base:
    eg:
            initOracleDB: OracleDB phdb authenticated
            GetSensorMapDBFromOracle: SensorDB ver. 4.800000 found
            GetFECDetectorFromMapDB: FECDetector ver. 4.800000 created out of SensorDB map
  9. You should see output regading the pedestal calculation proceedure:
    In one of the following three forms:
            1) Success
    2) Failure
    3) Problems for X channels, but as within tolerances continuing.
  10. You should see output regading the noise calculation proceedure
    In one of the following three forms:
            1) Success
    2) Failure
    3) Problems for X channels, but as within tolerances continuing.
  11. You should see information about writing pedestal and noise  to data base
    eg:
            Writing FEC Detector Ped and noise to Oracle
            Successfully writen FEC Detector and Ped to Oracle
  12. Exit the phat by typing:
    .q <RETURN>
  13. When finished a file called "FailedNoisePed.txt" will be created. This files gives information on what channels failed and how. See Examining FailedNoisePedInfo.

 

Pedcalc_mod_auto Default Questions

  1. You will be asked if you want to use the default initialization file:
            Default initialization file name =./PedCalcModDefaults.dat
            If you want to use the default file hit <RETURN> else enter new
            (Yes = <RETURN> : No = any character)
    This is the file in which the initial default values to calculate the prepedestal are set. Just hit <RETURN>.
    You SHOULD NEVER change these values in the file without contacting Nigel first.
  2. You will then see a description of the values used in determining the prepedestal constants
    as well as their current(default) values. You will be asked :
            Do you want to use the current parameters for all runs?
            (Yes = <RETURN> : No = any character)
    Type: <RETURN> if want to use these values
    else if  Type : n<RETURN> then hit <RETURN> to the next question, and change values as instructed.
  3. Steps 1 and 2 will be repeated but now for the pedestal and noise calculation parameters.(See Example of running pedcalc_mod.C)

Examining FailedNoisePedInfo

When pedcalc_mod.C finished  a file called "FailedNoisePed.txt" will be created. This files gives information on what channels failed and how.

To examine the contents of this file, either more or emacs it.

The contents are arranged in the following way

FEC   String   Chip   Channel     Ped Status   CMN Failures   Signal Failures    Succeeded
                                                                         (# events)         (# events)            (# events)

1         3              1            64                  1                    0                       601                       0
........................

 

KEY:

Ped Status =1  calculated pedestal and RMS ok     
                   = 0  failed to calculate pedestal and RMS

CMN Failures = Number of events that failed to calculate a CMN properly for this channel

Signal Failures = Number of events that failed to calculate the noise for this channel

Succeeded = Number of events that calculated a noise correctly.

Troubleshooting pedcalc_mod_auto.C

How to run gaincalc_mod_auto.C

  1. Ensure logged into online machine as shift
  2. Goto directory: /home/shift/pedgainmodcalc
  3. Type:
         phat <ENTER>
  4. At prompt , root [0] , type:
        .x gaincalc_mod_auto.C(<RunNumber>,<SequenceNumber>) <ENTER>
    eg: .x gaincalc_mod_auto.C(2231,0)
    The default name of the DAQ data directory is /mnt/data, so if the data  is mounted elsewhere there you can type:
        .x gaincalc_mod_auto.C(<RunNumber>,<SequenceNumber>,<DAQDataDirectory>)
  5. The progam then finds the disk number your data file is located on, and lets you know where it found it. If it does not find it, it stops. So then check the data is still on the DAQ.
  6. You will be asked questions about the defaults, see Gaincalc_mod defaults questions, if happy just keep hitting return, else follow directions and make changes as required
  7. You will see an output of directories (See Example of running gaincalc_mod.C)
  8. You should see output about connecting to data base:
    eg:
            initOracleDB: OracleDB phdb authenticated
            GetSensorMapDBFromOracle: SensorDB ver. 4.800000 found
            GetFECDetectorFromMapDB: FECDetector ver. 4.800000 created out of SensorDB map
  9. You should see output regading the pedestal calculation proceedure:
    In one of the following three forms:
            1) Success
    2) Failure
    3) Problems for X channels, but as within tolerances continuing.
  10. You should see output regarding the gain determination proceedure
             How many channels had bad fits..
  11. You should see information about writing gain constants to data base
    eg:
            Writing FEC Detector Gain to Oracle
            Successfully writen FEC Detector and gain   to Oracle
  12. Exit the phat by typing:
    .q <RETURN>

Gaincalc_mod_auto Default Questions

  1. You will be asked if you want to use the default initialization file:
            Default initialization file name =./GainCalcModDefaults.dat
            If you want to use the default file hit <RETURN> else enter new
            (Yes = <RETURN> : No = any character)
    This is the file in which the initial default values to calculate the prepedestal are set. Just hit <RETURN>.
    You SHOULD NEVER change these values in the file without contacting Nigel first.
  2. You will then see a description of the values used in determining the prepedestal constants
    as well as their current(default) values. You will be asked :
            Do you want to use the current parameters for all runs?
            (Yes = <RETURN> : No = any character)
    Type: <RETURN> if want to use these values
    else if  Type : n<RETURN> then hit <RETURN> to the next question, and change values as instructed.
  3. Steps 1 and 2 will be repeated but now for the pedestal and gain calculation parameters.(See Example of running gaincalc_mod.C)

Troubleshooting gaincalc_mod_auto.C

Example of running pedcalc_mod_auto.C

root [0] .x pedcalc_mod_auto.C(1630,0)
ls :/mnt/data/0/PhoRaw001630s000.root: No such file or directory
ls :/mnt/data/1/PhoRaw001630s000.root: No such file or directory
ls :/mnt/data/2/PhoRaw001630s000.root: No such file or directory
/mnt/data/3/PhoRaw001630s000.root
GetDiskNumber: Found data file on disk 3
****************************************************************
Pre Ped Initialization
****************************************************************
Default initialization file name =./PedCalcModDefaults.dat
If you want to use the default file hit <RETURN> else enter new
(Yes = <RETURN> : No = any character)
n
Please enter full Defaults Filename
./PedCalcModDefaults.dat
Using ./PedCalcModDefaults.dat filename for Defaults

Description of constants used in evaluating Pre Pedestals

*MinPrePedEvents*
                                Min Number events used to calculate pre-pedestals
*MaxEventsFactor*
                                Stops trying to calculate pre ped after
                                MaxEventsFactorxMinPrePedEvents events
*MaxAllowFractionOfBadChan*
                                Module Returns failure if after
                                MaxEventsFactorxMinPrePedEvents events the fraction
                                of bad channels is greater than this
*MaxAllowNumOfBadChan*
                                Module Returns failure if after
                                MaxEventsFactorxMinPrePedEvents events the number
                                of bad channels is greater than this
*************************************************
***** Current Values *******
*************************************************
MinPrePedEvents = 250
MaxEventsFactor = 2
MaxAllowFractionOfBadChan = 0.010000
MaxAllowNumOfBadChan = 100
*************************************************


Do you want to use the current parameters for all runs?
(Yes = <RETURN> : No = any character)
****************************************************************
Pedestal Initialization
****************************************************************
Default initialization file name =./PedCalcModDefaults.dat
If you want to use the default file hit <RETURN> else enter new
(Yes = <RETURN> : No = any character)

Using default filename, ./PedCalcModDefaults.dat
Description of constants used in evaluating Pedestals

*MinPedEvents*
                        Min Number events used to calculate pedestals
*MIPADCCut*
                        If (ADC-PrePed)<MIPADCCut channel considered empty
                        and used to evaluate pedestal
*MaxEventsFactor*
                        Stops trying to calculate ped after
                        MaxEventsFactorxMinPedEvents Events
*MaxAllowFractionOfBadChan*
                        Module Returns failure if after
                        MaxEventsFactorxMinPrePedEvents Events the fraction
                        of bad channels is greater than this
*MaxAllowNumOfBadChan*
                    Module Returns failure if after
                    MaxEventsFactorxMinPrePedEvents Events the number
                    of bad channels is greater than this

*************************************************
***** Current Values *******
*************************************************
MinPedEvents = 100
MIPADCCut = 10
MaxEventsFactor = 2
MaxAllowFractionOfBadChan = 0.010000
MaxAllowNumOfBadChan = 100
*************************************************


Do you want to use the current parameters for all runs?
(Yes = <RETURN> : No = any character)

*************************************************************
Noise Initialization
*************************************************************
Default initialization file name =./PedCalcModDefaults.dat
If you want to use the default file hit <RETURN> else enter new
(Yes = <RETURN> : No = any character)

Using default filename, ./PedCalcModDefaults.dat
Description of constants used in evaluating Noises

*ThresholdCMN*
                    If |ADC-Ped|<ThresholdCMNxRMSPed channel considered
                    empty and used to evaluate CMN
*MinChannelsCMN*
                    Min. No. of empty channels per chip for CMN
                    estimate to be valid
*MinNoiseEvents*
                    Min Number events used to calculate noise width
*MaxEventsFactor*
                    Stops trying to calculate noise after
                    MaxEventsFactorxMinNoiseEvents Events
*MaxAllowFractionOfBadChan*
                    Module Returns failure if after
                    MaxEventsFactorxMinPrePedEvents Events the fraction
                    of bad channels is greater than this
*MaxAllowNumOfBadChan*
                    Module Returns failure if after
                    MaxEventsFactorxMinPrePedEvents Events the number
                    of bad channels is greater than this
*************************************************
***** Current Values *******
*************************************************
ThresholdCMN = 5
MinChannelsCMN = 10
MinNoiseEvents = 100
MaxEventsFactor = 2
MaxAllowFractionOfBadChan = 0.010000
MaxAllowNumOfBadChan = 100
*************************************************

Do you want to use the current parameters for all runs?
(Yes = <RETURN> : No = any character)

RemoteRootFileDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/
DetectorDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/geodet/
SensorDBDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/sensdb/
FECDetectorDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/fecdet/
FECRawPropertiesDirectory: set to /disk20000/phobos/scratch/olszewsk/ped/
FECCalibrationDirectory: set to /disk20000/phobos/scratch/olszewsk/gain/
RemoteRootFileDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/
DetectorDirectory: set to /home/nigel/Phat/init/
DetectorFileName: set to Detector_PMC.root
DetectorKeyName: set to LatestGeometry
SensorDBDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/sensdb/
FECDetectorDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/fecdet/
FECRawPropertiesDirectory: set to /disk20000/phobos/scratch/olszewsk/ped/
FECCalibrationDirectory: set to /disk20000/phobos/scratch/olszewsk/gain/
GetDetectorFromFile: Detector LatestGeometry found in /home/nigel/Phat/init/Detector_PMC.root
InitOracleDB: OracleDB phdb authenticated
GetSensorMapDBFromOracle: SensorDB ver. 4.800000 found
GetFECDetectorFromMapDB: FECDetector ver. 4.800000 created out of SensorDB map
Warning in <TPhFECDetector::GetStringList>: Function deprecated, use GetStringIterator instead
Warning in <TPhFECDetector::GetStringList>: Function deprecated, use GetStringIterator instead
Warning in <TPhPedestalMod::Process>: Pedestals not calculated for 1 channels out of 12288, continuing as within preset allowable number and fraction of bad channels 100, 0.010000
Noise Process, number of events successfully processed 105
Writing FEC Detector Ped and noise to Oracle
Successfully writen FEC Detector and Ped to Oracle
(int)0

Example of running gaincalc_mod_auto.C

.x gaincalc_mod_auto.C(1591,0)
ls :/mnt/data/0/PhoRaw001591s000.root: No such file or directory
ls :/mnt/data/1/PhoRaw001591s000.root: No such file or directory
ls :/mnt/data/2/PhoRaw001591s000.root: No such file or directory
/mnt/data/3/PhoRaw001591s000.root
GetDiskNumber: Found data file on disk 3
****************************************************************
Pre Ped Initialization
****************************************************************
Default initialization file name =./GainCalcModDefaults.dat
If you want to use the default file hit <RETURN> else enter new
(Yes = <RETURN> : No = any character)

Using default filename, ./GainCalcModDefaults.dat

Description of constants used in evaluating Pre Pedestals

*MinPrePedEvents*
Min Number events used to calculate pre-pedestals
*MaxEventsFactor*
Stops trying to calculate pre ped after
MaxEventsFactorxMinPrePedEvents events
*MaxAllowFractionOfBadChan*
Module Returns failure if after
MaxEventsFactorxMinPrePedEvents events the fraction
of bad channels is greater than this
*MaxAllowNumOfBadChan*
Module Returns failure if after
MaxEventsFactorxMinPrePedEvents events the number
of bad channels is greater than this
*************************************************
***** Current Values *******
*************************************************
MinPrePedEvents = 250
MaxEventsFactor = 2
MaxAllowFractionOfBadChan = 0.010000
MaxAllowNumOfBadChan = 100
*************************************************


Do you want to use the current parameters for all runs?
(Yes = <RETURN> : No = any character)

****************************************************************
Pedestal Initialization
****************************************************************
Default initialization file name =./GainCalcModDefaults.dat
If you want to use the default file hit <RETURN> else enter new
(Yes = <RETURN> : No = any character)

Using default filename, ./GainCalcModDefaults.dat
Description of constants used in evaluating Pedestals

*MinPedEvents*
Min Number events used to calculate pedestals
*MIPADCCut*
If (ADC-PrePed)<MIPADCCut channel considered empty
and used to evaluate pedestal
*MaxEventsFactor*
Stops trying to calculate ped after
MaxEventsFactorxMinPedEvents Events
*MaxAllowFractionOfBadChan*
Module Returns failure if after
MaxEventsFactorxMinPrePedEvents Events the fraction
of bad channels is greater than this
*MaxAllowNumOfBadChan*
Module Returns failure if after
MaxEventsFactorxMinPrePedEvents Events the number
of bad channels is greater than this

*************************************************
***** Current Values *******
*************************************************
MinPedEvents = 130
MIPADCCut = 10
MaxEventsFactor = 2
MaxAllowFractionOfBadChan = 0.010000
MaxAllowNumOfBadChan = 100
*************************************************


Do you want to use the current parameters for all runs?
(Yes = <RETURN> : No = any character)

****************************************************************
Gain Initialization
****************************************************************
Type of Linear Fit is TPhChannelCalLinearCut

Do you want to use the current parameters for all runs?
(Yes = <RETURN> : No = any character)

RemoteRootFileDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/
DetectorDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/geodet/
SensorDBDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/sensdb/
FECDetectorDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/fecdet/
FECRawPropertiesDirectory: set to /disk20000/phobos/scratch/olszewsk/ped/
FECCalibrationDirectory: set to /disk20000/phobos/scratch/olszewsk/gain/
RemoteRootFileDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/
DetectorDirectory: set to /home/nigel/Phat/init/
DetectorFileName: set to Detector_PMC.root
DetectorKeyName: set to LatestGeometry
SensorDBDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/sensdb/
FECDetectorDirectory: set to /direct/phobos+u/olszewsk/phobosfiles/fecdet/
FECRawPropertiesDirectory: set to /disk20000/phobos/scratch/olszewsk/ped/
FECCalibrationDirectory: set to /disk20000/phobos/scratch/olszewsk/gain/
GetDetectorFromFile: Detector LatestGeometry found in /home/nigel/Phat/init/Detector_PMC.root
InitOracleDB: OracleDB phdb authenticated
GetSensorMapDBFromOracle: SensorDB ver. 4.800000 found
GetFECDetectorFromMapDB: FECDetector ver. 4.800000 created out of SensorDB map
Pedestal Process, number of events successfully processed 249
Calculating calibration parameters
BAD - fits for 1 calibration objects failed
Writing FEC Detector Gain to Oracle
Successfully writen FEC Detector and gain to Oracle
(int)0