MiniballSort
Loading...
Searching...
No Matches
MiniballCDCalibrator Class Reference

#include <CDCalibrator.hh>

Public Member Functions

 MiniballCDCalibrator (std::shared_ptr< MiniballSettings > myset)
 
 ~MiniballCDCalibrator ()
 
void SetInputFile (std::vector< std::string > input_file_names)
 
void SetInputFile (std::string input_file_name)
 
void SetInputTree (TTree *user_tree)
 
void SetMBSInfoTree (TTree *user_tree)
 
void SetOutput (std::string output_file_name, bool cWrite=false)
 
void StartFile ()
 called for every file
 
void Initialise ()
 called for every event
 
void MakeHists ()
 
void ResetHists ()
 
void AddCalibration (std::shared_ptr< MiniballCalibration > mycal)
 
void AddProgressBar (std::shared_ptr< TGProgressBar > myprog)
 
void SetPsideTagId (unsigned char id)
 
void SetNsideTagId (unsigned char id)
 
void CalibratePsides ()
 
void CalibrateNsides ()
 
bool FindCDChannels (int det, int sec, int side, int strip, int &adc, int &ch)
 
bool FindCDChannels (int det, int sec, int side, int strip, int &sfp, int &board, int &ch)
 
unsigned long FillHists ()
 
void FillPixelHists ()
 
TFile * GetFile ()
 
void CloseOutput ()
 
void PurgeOutput ()
 Closes the output files from this class.
 

Private Attributes

TFile * input_file
 Input tree.
 
TChain * input_tree
 
TChain * mbsinfo_tree
 
MiniballDataPacketsin_data = nullptr
 
MBSInfoPacketsmbs_info = nullptr
 
std::shared_ptr< DgfDatadgf_data
 
std::shared_ptr< AdcDataadc_data
 
std::shared_ptr< FebexDatafebex_data
 
std::shared_ptr< InfoDatainfo_data
 
TFile * output_file
 Outputs.
 
std::ofstream output_cal
 
std::shared_ptr< MiniballCalibrationcal
 
bool overwrite_cal
 
std::shared_ptr< MiniballSettingsset
 
bool _prog_
 
std::shared_ptr< TGProgressBar > prog
 
bool hists_ready = false
 
TList * histlist
 
bool flag_input_file
 
long build_window
 
bool flag_close_event
 length of build window in ns
 
bool event_open
 
long time_diff
 
unsigned long long time_prev
 
unsigned long long time_min
 
unsigned long long time_max
 
unsigned long long time_first
 
unsigned char mysfp
 sfp number
 
unsigned char myboard
 febex board number
 
unsigned char myadc
 ADC module number.
 
unsigned char mych
 channel number
 
unsigned long long mytime
 absolute timestamp
 
long myhittime
 hit time with respect to event time
 
unsigned long long myeventid
 MBS event id.
 
unsigned long long preveventid
 previous MBS event id
 
unsigned long long myeventtime
 MBS event time.
 
float myenergy
 calibrated energy
 
bool mythres
 above threshold?
 
bool mypileup
 pileup flag?
 
bool myclipped
 clipped flag?
 
std::vector< float > cd_en_list
 list of CD energies for ParticleFinder
 
std::vector< unsigned int > cd_Q_list
 list of CD uncalibrated energies for ParticleFinder
 
std::vector< unsigned long long > cd_ts_list
 list of CD timestamps for ParticleFinder
 
std::vector< unsigned char > cd_det_list
 list of CD detector IDs
 
std::vector< unsigned char > cd_sec_list
 list of CD sector IDs
 
std::vector< unsigned char > cd_side_list
 list of CD side IDs; 0 = p, 1 = n
 
std::vector< unsigned char > cd_strip_list
 list of CD strip IDs
 
unsigned char ptag = 0
 
unsigned char ntag = 0
 
double noffset = 0.0
 
double ngain = 1.0
 
double poffset = 0.0
 
double pgain = 1.0
 
unsigned long hit_ctr
 
unsigned long n_entries
 
unsigned long n_mbs_entries
 
std::vector< std::vector< std::vector< TH2F * > > > cd_pen_nen
 
std::vector< std::vector< std::vector< TH2F * > > > cd_nen_pen
 
std::vector< std::vector< std::vector< TH2F * > > > cd_pen_nQ
 
std::vector< std::vector< std::vector< TH2F * > > > cd_nQ_pQ
 

Detailed Description

Definition at line 44 of file CDCalibrator.hh.

Constructor & Destructor Documentation

◆ MiniballCDCalibrator()

MiniballCDCalibrator::MiniballCDCalibrator ( std::shared_ptr< MiniballSettings > myset)

Definition at line 3 of file CDCalibrator.cc.

◆ ~MiniballCDCalibrator()

MiniballCDCalibrator::~MiniballCDCalibrator ( )
inline

Definition at line 49 of file CDCalibrator.hh.

Member Function Documentation

◆ AddCalibration()

void MiniballCDCalibrator::AddCalibration ( std::shared_ptr< MiniballCalibration > mycal)
inline

Definition at line 61 of file CDCalibrator.hh.

Referenced by do_cdcal().

◆ AddProgressBar()

void MiniballCDCalibrator::AddProgressBar ( std::shared_ptr< TGProgressBar > myprog)
inline

Definition at line 65 of file CDCalibrator.hh.

◆ CalibrateNsides()

void MiniballCDCalibrator::CalibrateNsides ( )

Definition at line 453 of file CDCalibrator.cc.

Referenced by FillHists().

◆ CalibratePsides()

void MiniballCDCalibrator::CalibratePsides ( )

Definition at line 355 of file CDCalibrator.cc.

Referenced by FillHists().

◆ CloseOutput()

void MiniballCDCalibrator::CloseOutput ( )
inline

Definition at line 82 of file CDCalibrator.hh.

Referenced by do_cdcal().

◆ FillHists()

unsigned long MiniballCDCalibrator::FillHists ( )

Function to loop over the sort tree and build array and recoil events

Definition at line 623 of file CDCalibrator.cc.

Referenced by do_cdcal().

◆ FillPixelHists()

void MiniballCDCalibrator::FillPixelHists ( )

Definition at line 552 of file CDCalibrator.cc.

Referenced by FillHists().

◆ FindCDChannels() [1/2]

bool MiniballCDCalibrator::FindCDChannels ( int det,
int sec,
int side,
int strip,
int & adc,
int & ch )

Definition at line 273 of file CDCalibrator.cc.

Referenced by CalibrateNsides(), and CalibratePsides().

◆ FindCDChannels() [2/2]

bool MiniballCDCalibrator::FindCDChannels ( int det,
int sec,
int side,
int strip,
int & sfp,
int & board,
int & ch )

Definition at line 311 of file CDCalibrator.cc.

◆ GetFile()

TFile * MiniballCDCalibrator::GetFile ( )
inline

Definition at line 81 of file CDCalibrator.hh.

◆ Initialise()

void MiniballCDCalibrator::Initialise ( )

called for every event

This is called at the end of every execution/loop

Definition at line 128 of file CDCalibrator.cc.

Referenced by FillHists().

◆ MakeHists()

void MiniballCDCalibrator::MakeHists ( )

Definition at line 150 of file CDCalibrator.cc.

Referenced by SetOutput().

◆ PurgeOutput()

void MiniballCDCalibrator::PurgeOutput ( )
inline

Closes the output files from this class.

Definition at line 91 of file CDCalibrator.hh.

Referenced by CloseOutput().

◆ ResetHists()

void MiniballCDCalibrator::ResetHists ( )

Definition at line 256 of file CDCalibrator.cc.

◆ SetInputFile() [1/2]

void MiniballCDCalibrator::SetInputFile ( std::string input_file_name)

Definition at line 64 of file CDCalibrator.cc.

◆ SetInputFile() [2/2]

void MiniballCDCalibrator::SetInputFile ( std::vector< std::string > input_file_names)

Overloaded function for a single file or multiple files

Definition at line 42 of file CDCalibrator.cc.

Referenced by do_cdcal().

◆ SetInputTree()

void MiniballCDCalibrator::SetInputTree ( TTree * user_tree)

Definition at line 86 of file CDCalibrator.cc.

Referenced by SetInputFile().

◆ SetMBSInfoTree()

void MiniballCDCalibrator::SetMBSInfoTree ( TTree * user_tree)

Definition at line 97 of file CDCalibrator.cc.

Referenced by SetInputFile().

◆ SetNsideTagId()

void MiniballCDCalibrator::SetNsideTagId ( unsigned char id)
inline

Definition at line 71 of file CDCalibrator.hh.

Referenced by do_cdcal().

◆ SetOutput()

void MiniballCDCalibrator::SetOutput ( std::string output_file_name,
bool cWrite = false )

Definition at line 108 of file CDCalibrator.cc.

Referenced by do_cdcal().

◆ SetPsideTagId()

void MiniballCDCalibrator::SetPsideTagId ( unsigned char id)
inline

Definition at line 70 of file CDCalibrator.hh.

Referenced by do_cdcal().

◆ StartFile()

void MiniballCDCalibrator::StartFile ( )

called for every file

Definition at line 30 of file CDCalibrator.cc.

Referenced by SetInputFile().

Member Data Documentation

◆ _prog_

bool MiniballCDCalibrator::_prog_
private

Definition at line 123 of file CDCalibrator.hh.

Referenced by AddProgressBar(), FillHists(), and MiniballCDCalibrator().

◆ adc_data

std::shared_ptr<AdcData> MiniballCDCalibrator::adc_data
private

Definition at line 107 of file CDCalibrator.hh.

Referenced by FillHists().

◆ build_window

long MiniballCDCalibrator::build_window
private

Definition at line 136 of file CDCalibrator.hh.

Referenced by FillHists(), and MiniballCDCalibrator().

◆ cal

std::shared_ptr<MiniballCalibration> MiniballCDCalibrator::cal
private

Definition at line 116 of file CDCalibrator.hh.

Referenced by AddCalibration(), FillHists(), and MakeHists().

◆ cd_det_list

std::vector<unsigned char> MiniballCDCalibrator::cd_det_list
private

list of CD detector IDs

Definition at line 167 of file CDCalibrator.hh.

Referenced by FillHists(), FillPixelHists(), and Initialise().

◆ cd_en_list

std::vector<float> MiniballCDCalibrator::cd_en_list
private

list of CD energies for ParticleFinder

Definition at line 164 of file CDCalibrator.hh.

Referenced by FillHists(), FillPixelHists(), and Initialise().

◆ cd_nen_pen

std::vector<std::vector<std::vector<TH2F*> > > MiniballCDCalibrator::cd_nen_pen
private

Definition at line 189 of file CDCalibrator.hh.

Referenced by FillPixelHists(), and MakeHists().

◆ cd_nQ_pQ

std::vector<std::vector<std::vector<TH2F*> > > MiniballCDCalibrator::cd_nQ_pQ
private

Definition at line 191 of file CDCalibrator.hh.

Referenced by CalibratePsides(), FillPixelHists(), and MakeHists().

◆ cd_pen_nen

std::vector<std::vector<std::vector<TH2F*> > > MiniballCDCalibrator::cd_pen_nen
private

Definition at line 188 of file CDCalibrator.hh.

Referenced by FillPixelHists(), and MakeHists().

◆ cd_pen_nQ

std::vector<std::vector<std::vector<TH2F*> > > MiniballCDCalibrator::cd_pen_nQ
private

Definition at line 190 of file CDCalibrator.hh.

Referenced by CalibrateNsides(), FillPixelHists(), and MakeHists().

◆ cd_Q_list

std::vector<unsigned int> MiniballCDCalibrator::cd_Q_list
private

list of CD uncalibrated energies for ParticleFinder

Definition at line 165 of file CDCalibrator.hh.

Referenced by FillHists(), FillPixelHists(), and Initialise().

◆ cd_sec_list

std::vector<unsigned char> MiniballCDCalibrator::cd_sec_list
private

list of CD sector IDs

Definition at line 168 of file CDCalibrator.hh.

Referenced by FillHists(), FillPixelHists(), and Initialise().

◆ cd_side_list

std::vector<unsigned char> MiniballCDCalibrator::cd_side_list
private

list of CD side IDs; 0 = p, 1 = n

Definition at line 169 of file CDCalibrator.hh.

Referenced by FillHists(), FillPixelHists(), and Initialise().

◆ cd_strip_list

std::vector<unsigned char> MiniballCDCalibrator::cd_strip_list
private

list of CD strip IDs

Definition at line 170 of file CDCalibrator.hh.

Referenced by FillHists(), FillPixelHists(), and Initialise().

◆ cd_ts_list

std::vector<unsigned long long> MiniballCDCalibrator::cd_ts_list
private

list of CD timestamps for ParticleFinder

Definition at line 166 of file CDCalibrator.hh.

Referenced by FillHists(), and Initialise().

◆ dgf_data

std::shared_ptr<DgfData> MiniballCDCalibrator::dgf_data
private

Definition at line 106 of file CDCalibrator.hh.

◆ event_open

bool MiniballCDCalibrator::event_open
private

Definition at line 140 of file CDCalibrator.hh.

Referenced by FillHists(), and Initialise().

◆ febex_data

std::shared_ptr<FebexData> MiniballCDCalibrator::febex_data
private

Definition at line 108 of file CDCalibrator.hh.

Referenced by FillHists().

◆ flag_close_event

bool MiniballCDCalibrator::flag_close_event
private

length of build window in ns

Definition at line 139 of file CDCalibrator.hh.

Referenced by FillHists(), and Initialise().

◆ flag_input_file

bool MiniballCDCalibrator::flag_input_file
private

Definition at line 133 of file CDCalibrator.hh.

Referenced by MiniballCDCalibrator(), SetInputFile(), and SetInputFile().

◆ histlist

TList* MiniballCDCalibrator::histlist
private

Definition at line 130 of file CDCalibrator.hh.

Referenced by MakeHists(), MiniballCDCalibrator(), and ResetHists().

◆ hists_ready

bool MiniballCDCalibrator::hists_ready = false
private

Definition at line 127 of file CDCalibrator.hh.

Referenced by MakeHists().

◆ hit_ctr

unsigned long MiniballCDCalibrator::hit_ctr
private

Definition at line 183 of file CDCalibrator.hh.

Referenced by FillHists(), and Initialise().

◆ in_data

MiniballDataPackets* MiniballCDCalibrator::in_data = nullptr
private

Definition at line 104 of file CDCalibrator.hh.

Referenced by FillHists(), SetInputFile(), and SetInputTree().

◆ info_data

std::shared_ptr<InfoData> MiniballCDCalibrator::info_data
private

Definition at line 109 of file CDCalibrator.hh.

◆ input_file

TFile* MiniballCDCalibrator::input_file
private

Input tree.

Definition at line 101 of file CDCalibrator.hh.

Referenced by SetInputFile().

◆ input_tree

TChain* MiniballCDCalibrator::input_tree
private

Definition at line 102 of file CDCalibrator.hh.

Referenced by FillHists(), PurgeOutput(), SetInputFile(), and SetInputTree().

◆ mbs_info

MBSInfoPackets* MiniballCDCalibrator::mbs_info = nullptr
private

Definition at line 105 of file CDCalibrator.hh.

Referenced by FillHists(), SetInputFile(), and SetMBSInfoTree().

◆ mbsinfo_tree

TChain* MiniballCDCalibrator::mbsinfo_tree
private

Definition at line 103 of file CDCalibrator.hh.

Referenced by FillHists(), PurgeOutput(), SetInputFile(), and SetMBSInfoTree().

◆ myadc

unsigned char MiniballCDCalibrator::myadc
private

ADC module number.

Definition at line 150 of file CDCalibrator.hh.

Referenced by FillHists().

◆ myboard

unsigned char MiniballCDCalibrator::myboard
private

febex board number

Definition at line 148 of file CDCalibrator.hh.

Referenced by FillHists().

◆ mych

unsigned char MiniballCDCalibrator::mych
private

channel number

Definition at line 151 of file CDCalibrator.hh.

Referenced by FillHists().

◆ myclipped

bool MiniballCDCalibrator::myclipped
private

clipped flag?

Definition at line 160 of file CDCalibrator.hh.

Referenced by FillHists().

◆ myenergy

float MiniballCDCalibrator::myenergy
private

calibrated energy

Definition at line 157 of file CDCalibrator.hh.

Referenced by FillHists().

◆ myeventid

unsigned long long MiniballCDCalibrator::myeventid
private

MBS event id.

Definition at line 154 of file CDCalibrator.hh.

Referenced by FillHists().

◆ myeventtime

unsigned long long MiniballCDCalibrator::myeventtime
private

MBS event time.

Definition at line 156 of file CDCalibrator.hh.

Referenced by FillHists().

◆ myhittime

long MiniballCDCalibrator::myhittime
private

hit time with respect to event time

Definition at line 153 of file CDCalibrator.hh.

Referenced by FillHists().

◆ mypileup

bool MiniballCDCalibrator::mypileup
private

pileup flag?

Definition at line 159 of file CDCalibrator.hh.

Referenced by FillHists().

◆ mysfp

unsigned char MiniballCDCalibrator::mysfp
private

sfp number

Definition at line 147 of file CDCalibrator.hh.

Referenced by FillHists().

◆ mythres

bool MiniballCDCalibrator::mythres
private

above threshold?

Definition at line 158 of file CDCalibrator.hh.

Referenced by FillHists().

◆ mytime

unsigned long long MiniballCDCalibrator::mytime
private

absolute timestamp

Definition at line 152 of file CDCalibrator.hh.

Referenced by FillHists().

◆ n_entries

unsigned long MiniballCDCalibrator::n_entries
private

Definition at line 184 of file CDCalibrator.hh.

Referenced by FillHists().

◆ n_mbs_entries

unsigned long MiniballCDCalibrator::n_mbs_entries
private

Definition at line 185 of file CDCalibrator.hh.

Referenced by FillHists().

◆ ngain

double MiniballCDCalibrator::ngain = 1.0
private

Definition at line 178 of file CDCalibrator.hh.

Referenced by CalibrateNsides(), and CalibratePsides().

◆ noffset

double MiniballCDCalibrator::noffset = 0.0
private

Definition at line 177 of file CDCalibrator.hh.

Referenced by CalibrateNsides(), and CalibratePsides().

◆ ntag

unsigned char MiniballCDCalibrator::ntag = 0
private

Definition at line 174 of file CDCalibrator.hh.

Referenced by CalibrateNsides(), FillHists(), FillPixelHists(), MakeHists(), and SetNsideTagId().

◆ output_cal

std::ofstream MiniballCDCalibrator::output_cal
private

Definition at line 113 of file CDCalibrator.hh.

Referenced by CalibrateNsides(), CalibratePsides(), CloseOutput(), and SetOutput().

◆ output_file

TFile* MiniballCDCalibrator::output_file
private

Outputs.

Definition at line 112 of file CDCalibrator.hh.

Referenced by CloseOutput(), GetFile(), PurgeOutput(), and SetOutput().

◆ overwrite_cal

bool MiniballCDCalibrator::overwrite_cal
private

Definition at line 117 of file CDCalibrator.hh.

Referenced by AddCalibration(), and MiniballCDCalibrator().

◆ pgain

double MiniballCDCalibrator::pgain = 1.0
private

Definition at line 180 of file CDCalibrator.hh.

Referenced by CalibratePsides().

◆ poffset

double MiniballCDCalibrator::poffset = 0.0
private

Definition at line 179 of file CDCalibrator.hh.

Referenced by CalibratePsides().

◆ preveventid

unsigned long long MiniballCDCalibrator::preveventid
private

previous MBS event id

Definition at line 155 of file CDCalibrator.hh.

Referenced by FillHists(), and MiniballCDCalibrator().

◆ prog

std::shared_ptr<TGProgressBar> MiniballCDCalibrator::prog
private

Definition at line 124 of file CDCalibrator.hh.

Referenced by AddProgressBar(), and FillHists().

◆ ptag

unsigned char MiniballCDCalibrator::ptag = 0
private

Definition at line 173 of file CDCalibrator.hh.

Referenced by CalibratePsides(), FillHists(), FillPixelHists(), MakeHists(), and SetPsideTagId().

◆ set

std::shared_ptr<MiniballSettings> MiniballCDCalibrator::set
private

◆ time_diff

long MiniballCDCalibrator::time_diff
private

Definition at line 143 of file CDCalibrator.hh.

Referenced by FillHists().

◆ time_first

unsigned long long MiniballCDCalibrator::time_first
private

Definition at line 144 of file CDCalibrator.hh.

Referenced by FillHists(), and StartFile().

◆ time_max

unsigned long long MiniballCDCalibrator::time_max
private

Definition at line 144 of file CDCalibrator.hh.

Referenced by FillHists(), and StartFile().

◆ time_min

unsigned long long MiniballCDCalibrator::time_min
private

Definition at line 144 of file CDCalibrator.hh.

Referenced by FillHists(), and StartFile().

◆ time_prev

unsigned long long MiniballCDCalibrator::time_prev
private

Definition at line 144 of file CDCalibrator.hh.

Referenced by FillHists(), and StartFile().


The documentation for this class was generated from the following files: