vemcal C++ API Reference

union ChipPairID

Public Functions

inline ChipPairID()

Public Members

uint8_t hg_available
uint8_t hg_chip
uint8_t hg_channel
uint8_t lg_available
uint8_t lg_chip
uint8_t lg_channel
struct ChipPairID::[anonymous] fields
uint8_t bits
struct HGLGhit
#include <I3VEMCalData.h>

This structure stores the data to do the charge correlation between the high gain (HG) and low gain (LG) DOMs in the same IceTop tank.

Public Functions

inline HGLGhit()
virtual ~HGLGhit()
template<class Archive>
void serialize(Archive &ar, unsigned version)

Public Members

int8_t str

String/Station number.

int8_t hg_om

Number of the HIGH gain DOM.

int8_t hg_chip

Chip ID of the HIGH gain DOM.

int8_t hg_channel

Channel of the HIGH gain DOM.

uint16_t hg_charge_pe

Total charge of the HIGH gain hit.

int8_t lg_om

Number of the LOW gain DOM.

int8_t lg_chip

Chip ID of the LOW gain DOM.

int8_t lg_channel

Channel of the LOW gain DOM.

uint16_t lg_charge_pe

Total charge of the LOW gain hit.

int8_t deltat_2ns

Time difference between HG and LG signal in units of 2ns.

Friends

friend class icecube::serialization::access
class I3HGLGPairSelector : public I3ConditionalModule

Public Functions

I3HGLGPairSelector(const I3Context &context)
~I3HGLGPairSelector()
void Configure()

Re-implementation of Configure method.

void DAQ(I3FramePtr frame)

Re-implementation of DAQ method.

Private Functions

SET_LOGGER ("I3HGLGPairSelector")

Private Members

std::string inputName_
std::string outputName_
struct I3ITSLCCalData : public I3FrameObject
#include <I3ITSLCCalData.h>

Public Functions

inline I3ITSLCCalData()
virtual ~I3ITSLCCalData()
template<class Archive>
void serialize(Archive &ar, unsigned version)

Public Members

uint32_t runID

Run number.

This structure stores the information of an HLC IceTop hit which was also treated as an SLC

std::vector<ITSLCCalItem> HLC_vs_SLC_Hits

Collection of minimum bias hits.

Friends

friend class icecube::serialization::access
class I3ITSLCCalExtractor : public I3ConditionalModule

This module extracts all the information which is needed to perform the SLC calibration and writes the data in a condensed format to the frame.

Public Functions

I3ITSLCCalExtractor(const I3Context &context)
virtual ~I3ITSLCCalExtractor()
void Configure()

Re-implementation of the Configure method of the I3Module.

void DAQ(I3FramePtr frame)

Re-implementation of the Physics method of the I3Module.

Private Functions

void FillSLCData(const I3Frame &frame, I3ITSLCCalData &slcCalData)

Extracts the minimum bias his from the frame and stores the hit information in the I3ITSLCCalData container.

SET_LOGGER ("I3ITSLCCalExtractor")

Private Members

std::string regularHLCPulsesName_

Name of the IceTop HLC pulses in the frame.

std::string waveformName_

Name of the IceTop Raw Data &#8212; needed to harvest the chip/atwd numbers.

std::string downgradedPulsesName_

Name of the pulses that have been artificially “downgraded” to SLC pulses in the frame.

std::string slcCalDataName_

Output name of the I3ITSLCCalData container in the frame.

struct I3VEMCalData : public I3FrameObject
#include <I3VEMCalData.h>

Public Functions

inline I3VEMCalData()
virtual ~I3VEMCalData()
template<class Archive>
void serialize(Archive &ar, unsigned version)

Public Members

uint32_t runID

Run number.

std::vector<MinBiasHit> minBiasHits

Collection of minimum bias hits.

std::vector<HGLGhit> hglgHits

Collection of HG-LG correlation hits.

Friends

friend class icecube::serialization::access
class I3VEMCalExtractor : public I3ConditionalModule

This module extracts all the information which is needed to perform the muon calibration and writes the data in a condensed format to the frame.

Public Functions

I3VEMCalExtractor(const I3Context &context)
virtual ~I3VEMCalExtractor()
void Configure()

Re-implementation of the Configure method of the I3Module.

void DAQ(I3FramePtr frame)

Re-implementation of the Physics method of the I3Module.

Private Functions

void FillVEMData(const I3Frame &frame, I3VEMCalData &vemCalData)

Extracts the minimum bias his from the frame and stores the hit information in the I3VEMCalData container.

void FillHGLGData(const I3Frame &frame, I3VEMCalData &vemCalData)

Extracts the HG-LG correlation hits from the normal physics pulses and stores the information in the I3VEMCalData container.

bool HasLCHits(const I3Frame &frame)

Check if minbias hit is coincident with air shower hits

SET_LOGGER ("I3VEMCalExtractor")

Private Members

std::string minbiasPulsesName_

Name of the IceTop minimum bias pulses in the frame.

std::string minbiasPulseInfoName_

Name of the IceTop minimum bias pulse info in the frame.

std::string icetopPulsesName_

Name of the IceTop physics pulses in the frame.

std::string icetopPulseInfoName_

Name of the IceTop physics pulse info in the frame.

std::string showerVetoName_

Name of the IceTop veto source in the frame.

std::string vemCalDataName_

Output name of the I3VEMCalData container in the frame.

class I3VEMCalHistWriter : public I3ConditionalModule

This module reads the information from the I3VEMCalData containers and generates histohrams which are stored in one rootfile per run.

Public Functions

I3VEMCalHistWriter(const I3Context &context)
~I3VEMCalHistWriter()
void Configure()

Re-implementation of the Configure method of the I3Module.

void Physics(I3FramePtr frame)

Re-implementation of the Physics method of the I3Module.

inline void Finish()

Re-implementation of the Finish method of the I3Module.

Private Functions

void Clear()

Deletes all histograms, the root file and resets the run number.

void Write()

Writes the histograms to the root file.

void FillMuonHistos(const I3VEMCalData::MinBiasHit &minBiasHit)

Fills the minimum bias hits into 1D-histograms.

void FillHGLGHistos(const I3VEMCalData::HGLGhit &hglgHit)

Fills the HG-LG correlation hits into 2D-histograms.

SET_LOGGER ("I3VEMCalHistWriter")

Private Members

std::string vemCalDataName_

Name of the I3VEMCalData container in the frame.

std::string workDir_

Base directory where the ROOT files will be stored in separate folders for each day.

std::string fileBaseName_

Base name of the ROOT file e.g. “IceTop_VEMCalData”.

std::vector<double> muonBinning_

Parameters for histogram binning.

std::vector<double> hglgBinning_
double maxTimeDiff_

Upper limit for the time difference between HG and LG hits in the same tank.

std::string dbHost_

Parameters to configure database access.

std::string dbUserName_
std::string dbPassword_
std::string dbDatabase_
int currentRunNumber_

Run number of the current run.

TFile *outfile_

Pointer to the ROOT file.

MuonHistMap muonHistos_
HGLGHistMap hglgHistos_
class I3VEMCalTreeWriter : public I3ConditionalModule

This class collects the I3VEMCalData containers from the frame and stores their contents into individual ROOT files for each run. The rootfiles will contain two trees: The “muonTree” stores the information of the minimum bis hits, whereas the “hglgTree” contains the HG-LG correlation data.

Public Functions

I3VEMCalTreeWriter(const I3Context &context)
~I3VEMCalTreeWriter()
void Configure()

Re-implementation of the Configure method of the I3Module.

void Physics(I3FramePtr frame)

Re-implementation of the Physics method of the I3Module.

inline void Finish()

Re-implementation of the Finish method of the I3Module.

Private Functions

void Clear()

Deletes all trees and the ROOT file and resets the run number.

void Write()

Writes the trees to the ROOT file.

void FillVEMTree(const I3Time &startTime, const I3VEMCalData::MinBiasHit &minBiasHit)

Fills the minimum bias hits to the “muonTree”.

void FillHGLGTree(const I3VEMCalData::HGLGhit &hglgHit)

Fills the HG-LG correlation hits to the “hglgTree”.

SET_LOGGER ("I3VEMCalTreeWriter")

Private Members

std::string vemCalDataName_

Name of the I3VEMCalData container in the frame.

std::string workDir_

Base directory where the ROOT files will be stored in separate folders for each day

std::string fileBaseName_

Base name of the ROOT file e.g. “IceTop_VEMCal”.

int currentRunNumber_

Run number of the current run.

TFile *outfile_

Pointer to the ROOT file.

TTree *muonTree_

Pointer to the muon tree.

TTree *hglgTree_

Pointer to the HGLG tree.

struct ITSLCCalItem
#include <I3ITSLCCalData.h>

Public Functions

inline void SetSOCA(int s, int o, int c, int a)

Construction/Un-Construction of the “Str/OM/Chip/ATWD” combined integer Assumes Each string contains: 4 DOM’s each, 2 chips each, 3 ATWD’s each For 81 strings, that means 1944 possibilities total &#8212; retures 11 bits, and so int16_t I know this is a bit magic-number-ish, but I’m going to try this just to see if it works, and it can get fancier later.

inline int GetSOCA(int which) const
inline int GetString() const
inline int GetOM() const
inline int GetChip() const
inline int GetATWD() const
inline uint32_t GetChargeHLC() const
inline uint32_t GetChargeSLC() const
inline void SetChargeHLC(uint32_t c)
inline void SetChargeSLC(uint32_t c)
inline ITSLCCalItem()
inline ITSLCCalItem(int str, unsigned int om, int chip, int atwd)
inline ITSLCCalItem(int s, int hlc, int slc)
virtual ~ITSLCCalItem()
bool operator==(const ITSLCCalItem &rhs) const
inline bool operator!=(const ITSLCCalItem &rhs) const

Public Members

int16_t soca_

One integer representing str/om/chip/atwd, so this will be super-lightweight.

uint32_t hlc_charge_dpe_

Total charge of the hit in deci pe &#8212; unsigned so that the dynamic range goes to 65535.

uint32_t slc_charge_dpe_

Private Functions

template<class Archive>
void serialize(Archive &ar, unsigned version)

Friends

friend class icecube::serialization::access
struct MinBiasHit
#include <I3VEMCalData.h>

This structure stores the information of an IceTop minimum bias hit.

Public Functions

inline MinBiasHit()
virtual ~MinBiasHit()
template<class Archive>
void serialize(Archive &ar, unsigned version)

Public Members

int8_t str

String/Station number.

int8_t om

DOM number.

int8_t chip

Chip ID.

int8_t channel

Channel ID.

int16_t charge_dpe

Total charge of the hit in deci pe.

Friends

friend class icecube::serialization::access
union SingleChipID

Public Functions

inline SingleChipID()

Public Members

uint8_t available
uint8_t chip
uint8_t channel
uint8_t slop
struct SingleChipID::[anonymous] fields
uint8_t bits
class VEMCalAnalyzer
#include <VEMCalAnalyzer.h>

Public Functions

VEMCalAnalyzer()
~VEMCalAnalyzer()
void OpenFiles(const std::vector<std::string> &fileList)
void Analyze(const std::string &outDir = ".")

Private Functions

void AddMuonHist(const OMKey &hgKey, TH1F *hist)
void AddHGLGHist(const OMKey &hgKey, TH2F *hist)
int FitMuonSpectrum(TH1F *hist, double &peak, double &width, double &sbRatio, double &rChi2)
int FitHGLGCorrelation(TH2F *hist, double &lgCorr, double &hgCross, double &rChi2)
inline void Minimum(std::pair<OMKey, double> &min, const OMKey &omKey, double value)
inline void Maximum(std::pair<OMKey, double> &max, const OMKey &omKey, double value)
bool Summarize(TFile *rootfile, const VEMCalResultMap &results)
void WriteXML(const VEMCalResultMap &results, bool isGood = true)
TH1F *Smooth(TH1F *hist, int binRange = 4)
void ExpStartValues(TH1F *hist, double x1, double x2, double &norm, double &slope, double offset = 0)
int FindPeakBin(TH1F *hist, double xmin, double xmax, double minval = 0, int nsigma = 3)
TH1F *ProfileX(TH2F *hist)
void HGLGStartValues(TH1F *hist, double x1, double x2, double x0, double y0, double &p2, double &p3)
TH1F *FillVEMHistograms(const VEMCalResultMap &results, const std::pair<OMKey, double> &min_vem_hg, const std::pair<OMKey, double> &max_vem_hg, const std::pair<OMKey, double> &min_vem_lg, const std::pair<OMKey, double> &max_vem_lg)
TH1F *FillCrossOverHistogram(const VEMCalResultMap &results, const std::pair<OMKey, double> &min_crover, const std::pair<OMKey, double> &max_crover)
TH1F *FillRChi2Histograms(const VEMCalResultMap &results, const std::pair<OMKey, double> &min_rchi2_muon, const std::pair<OMKey, double> &max_rchi2_muon, const std::pair<OMKey, double> &min_rchi2_hglg, const std::pair<OMKey, double> &max_rchi2_hglg)

Private Members

int firstRunID_
int lastRunID_
I3Time startTime_
bool storeHistos_
MuonHistMap muonHistos_
HGLGHistMap hglgHistos_
struct VEMCalResult
#include <VEMCalAnalyzer.h>

Public Functions

inline VEMCalResult()

Public Members

int gainType
double pePerVEM
double muonWidth
double sbRatio
double hglgCrossOver
int muonFitStatus
double muonFitRchi2
int hglgFitStatus
double hglgFitRchi2
namespace std

STL namespace.

file analyze.cxx
#include <iostream>
#include <vector>
#include <string>

Functions

int main(int argc, char *argv[])
file I3HGLGPairSelector.cxx
#include <dataclasses/physics/I3RecoPulse.h>
#include <dataclasses/I3MapOMKeyMask.h>

Copyright (C) 2009 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Functions

I3_MODULE(I3HGLGPairSelector)
file I3HGLGPairSelector.h
#include <icetray/I3ConditionalModule.h>
#include <string>

Copyright (C) 2009 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

file I3ITSLCCalData.cxx
#include <icetray/serialization.h>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Functions

I3_SERIALIZABLE(ITSLCCalItem)
I3_SERIALIZABLE(I3ITSLCCalData)
file I3ITSLCCalData.h
#include <vector>
#include <stdint.h>
#include <icetray/I3FrameObject.h>
#include <icetray/I3DefaultName.h>
#include <dataclasses/I3Time.h>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Functions

I3_CLASS_VERSION(ITSLCCalItem, i3itslccaldata_version_)
I3_POINTER_TYPEDEFS(ITSLCCalItem)
I3_DEFAULT_NAME(ITSLCCalItem)
I3_CLASS_VERSION(I3ITSLCCalData, i3itslccaldata_version_)
I3_POINTER_TYPEDEFS(I3ITSLCCalData)
I3_DEFAULT_NAME(I3ITSLCCalData)

Variables

static const unsigned i3itslccaldata_version_ = 0

Similar to I3VEMCalData, this class is a lightweight container to be written to the frame, which contains what will be necessary to perform SLC calibration of the IceTop DOMs.

file I3ITSLCCalExtractor.cxx
#include <icetray/I3Frame.h>
#include <icetray/I3Units.h>
#include <icetray/OMKey.h>
#include <dataclasses/I3Constants.h>
#include <dataclasses/physics/I3RecoPulse.h>
#include <dataclasses/physics/I3EventHeader.h>
#include <dataclasses/status/I3DetectorStatus.h>
#include <dataclasses/physics/I3Waveform.h>
#include <tpx/I3TopPulseInfo.h>

Functions

I3_MODULE(I3ITSLCCalExtractor)
file I3ITSLCCalExtractor.h
#include <icetray/I3ConditionalModule.h>
#include <string>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

file I3VEMCalData.cxx
#include <icetray/serialization.h>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Functions

union SingleChipID __attribute ((packed))
SingleChipID()
ChipPairID()
I3_SERIALIZABLE(I3VEMCalData::MinBiasHit)
I3_SERIALIZABLE(I3VEMCalData::HGLGhit)
I3_SERIALIZABLE(I3VEMCalData)

Variables

uint8_t available
uint8_t chip
uint8_t channel
uint8_t slop
struct [anonymous] fields
uint8_t bits
uint8_t hg_available
uint8_t hg_chip
uint8_t hg_channel
uint8_t lg_available
uint8_t lg_chip
uint8_t lg_channel
file I3VEMCalData.h
#include <vector>
#include <stdint.h>
#include <icetray/I3FrameObject.h>
#include <icetray/I3DefaultName.h>
#include <dataclasses/I3Time.h>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Functions

I3_CLASS_VERSION(I3VEMCalData::MinBiasHit, i3vemcaldata_version_)
I3_CLASS_VERSION(I3VEMCalData::HGLGhit, i3vemcaldata_version_)
I3_CLASS_VERSION(I3VEMCalData, i3vemcaldata_version_)
I3_POINTER_TYPEDEFS(I3VEMCalData)
I3_DEFAULT_NAME(I3VEMCalData)

Variables

static const unsigned i3vemcaldata_version_ = 2

This class is the main data container which will be written to the frame. It stores all the information which is needed to perform the muon calibration of the IceTop DOMs.

file I3VEMCalExtractor.cxx
#include <icetray/I3Frame.h>
#include <icetray/I3Units.h>
#include <icetray/OMKey.h>
#include <dataclasses/I3Constants.h>
#include <dataclasses/geometry/I3Geometry.h>
#include <dataclasses/physics/I3DOMLaunch.h>
#include <dataclasses/physics/I3RecoPulse.h>
#include <dataclasses/physics/I3EventHeader.h>
#include <dataclasses/status/I3DetectorStatus.h>
#include <tpx/I3TopPulseInfo.h>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Functions

I3_MODULE(I3VEMCalExtractor)
file I3VEMCalExtractor.h
#include <icetray/I3ConditionalModule.h>
#include <string>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

file I3VEMCalHistWriter.cxx
#include <icetray/I3Frame.h>
#include <icetray/I3Units.h>
#include <dataclasses/I3Time.h>
#include <dataclasses/TankKey.h>
#include <TFile.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TSystem.h>
#include <sstream>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Functions

I3_MODULE(I3VEMCalHistWriter)
file I3VEMCalHistWriter.h
#include <icetray/I3ConditionalModule.h>
#include <icetray/OMKey.h>
#include <string>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Typedefs

typedef std::map<OMKey, TH1F*> MuonHistMap
typedef std::map<OMKey, TH2F*> HGLGHistMap
file I3VEMCalTreeWriter.cxx
#include <icetray/I3Frame.h>
#include <dataclasses/I3Time.h>
#include <icetray/I3Units.h>
#include <TFile.h>
#include <TTree.h>
#include <TSystem.h>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Functions

I3_MODULE(I3VEMCalTreeWriter)
file I3VEMCalTreeWriter.h
#include <icetray/I3ConditionalModule.h>
#include <string>

Copyright (C) 2008 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

file plot.cxx
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <sstream>
#include <iomanip>
#include <TFile.h>
#include <TCanvas.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TF1.h>
#include <TProfile.h>
#include <TLegend.h>
#include <TText.h>
#include <TPaveText.h>
#include <TPaveStats.h>
#include <TLine.h>
#include <TStyle.h>
#include <TROOT.h>
#include <TKey.h>
#include <TSystem.h>
#include <TClass.h>

Functions

void plot_muon_spec(TH1F *muonSpec, const std::string &outFormat = "png", int size = 800)
void plot_hglg_diff(TH2F *hglgHist, const std::string &outFormat = "png", int size = 800)
void plot_summary_vem(TH1F *sumVEM, const std::string &outFormat = "png", int size = 800)
void plot_summary_crossover(TH1F *sumCO, const std::string &outFormat = "png", int size = 800)
void plot_summary_rchi2(TH1F *sumRChi2, const std::string &outFormat = "png", int size = 800)
void plot(const std::string &filename, const std::string &outFormat = "png", const std::string &outDir = ".")
int main(int argc, char *argv[])
file VEMCalAnalyzer.cxx
#include <TFile.h>
#include <TClass.h>
#include <TKey.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TF1.h>
#include <TMath.h>
#include <TLine.h>
#include <TArrow.h>
#include <TText.h>
#include <TPaveText.h>
#include <TROOT.h>
#include <iostream>
#include <ostream>
#include <fstream>
#include <cstring>
#include <algorithm>

Copyright (C) 2009 The IceCube collaboration ID:

Rcs

Removed I3Db dependency &#8212;S. Tilav 24/Sep/2019

Version

Rcs
Date

Rcs
Author

tilo

Functions

double hglgDiff(double *x, double *p)
double muonSpec(double *x, double *p)
file VEMCalAnalyzer.h
#include <icetray/OMKey.h>
#include <dataclasses/I3Time.h>
#include <vector>
#include <string>
#include <utility>

Copyright (C) 2009 The IceCube collaboration ID:

Rcs

Version

Rcs
Date

Rcs
Author

tilo

Typedefs

typedef std::map<OMKey, TH1F*> MuonHistMap
typedef std::map<OMKey, TH2F*> HGLGHistMap
typedef std::map<OMKey, VEMCalResult> VEMCalResultMap
dir analyze
dir icetray
dir plot
dir private
dir public
dir vemcal
dir vemcal
dir vemcal