Belle II Software  release-05-02-19
EKLMChannelDataImporter Class Reference

EKLM time calibration algorithm. More...

#include <EKLMChannelDataImporter.h>

Collaboration diagram for EKLMChannelDataImporter:

Public Member Functions

 EKLMChannelDataImporter ()
 Constructor.
 
 ~EKLMChannelDataImporter ()
 Destructor.
 
void setIOV (int experimentLow, int runLow, int experimentHigh, int runHigh)
 Set interval of validity.
 
void loadChannelData (EKLMChannelData *channelData)
 Load specific channel data to all channels. More...
 
void setChannelData (int section, int layer, int sector, int plane, int strip, EKLMChannelData *channelData)
 Set channel data. More...
 
void loadActiveChannels (const char *activeChannelsData)
 Load active channels from ROOT file. More...
 
void loadHighVoltage (const char *highVoltageData)
 Load high voltage from ROOT file. More...
 
void loadLookbackWindow (const char *lookbackWindowData)
 Load lookback window from ROOT file. More...
 
void loadThresholds (const char *thresholdsData)
 Load thresholds and adjustment voltages from ROOT file. More...
 
void importChannelData ()
 Import channel data.
 

Private Attributes

DBImportObjPtr< EKLMChannelsm_Channels
 Channel data.
 
int m_ExperimentLow = 0
 Low experiment.
 
int m_RunLow = 0
 Low run.
 
int m_ExperimentHigh = -1
 High experiment.
 
int m_RunHigh = -1
 High run.
 

Detailed Description

EKLM time calibration algorithm.

Definition at line 36 of file EKLMChannelDataImporter.h.

Member Function Documentation

◆ loadActiveChannels()

void loadActiveChannels ( const char *  activeChannelsData)

Load active channels from ROOT file.

Parameters
[in]activeChannelsDataROOT file with active channels data.

Definition at line 83 of file EKLMChannelDataImporter.cc.

84 {
85  int i, n;
86  int copper, dataConcentrator, lane, daughterCard, channel, active;
87  /* cppcheck-suppress variableScope */
88  int subdetector, section, layer, sector, plane, strip, stripGlobal;
89  /* cppcheck-suppress variableScope */
90  const uint16_t* detectorChannel;
91  const EKLMElementNumbers* elementNumbers = &(EKLMElementNumbers::Instance());
92  const KLMElementNumbers* klmElementNumbers = &(KLMElementNumbers::Instance());
93  DBObjPtr<KLMElectronicsMap> electronicsMap;
94  KLMElectronicsChannel electronicsChannel;
95  TFile* file;
96  TTree* tree;
97  file = new TFile(activeChannelsData, "");
98  tree = (TTree*)file->Get("tree");
99  n = tree->GetEntries();
100  tree->SetBranchAddress("copper", &copper);
101  tree->SetBranchAddress("data_concentrator", &dataConcentrator);
102  tree->SetBranchAddress("lane", &lane);
103  tree->SetBranchAddress("daughter_card", &daughterCard);
104  tree->SetBranchAddress("channel", &channel);
105  tree->SetBranchAddress("active", &active);
106  for (i = 0; i < n; i++) {
107  tree->GetEntry(i);
108  electronicsChannel.setCopper(copper);
109  electronicsChannel.setSlot(dataConcentrator);
110  electronicsChannel.setLane(lane);
111  electronicsChannel.setAxis(1);
112  electronicsChannel.setChannel(1);
113  detectorChannel = electronicsMap->getDetectorChannel(&electronicsChannel);
114  if (detectorChannel == nullptr) {
115  B2FATAL("Wrong DAQ channel in calibration data: copper = " << copper <<
116  ", data_concentrator = " << dataConcentrator << ", lane = " <<
117  lane);
118  }
119  klmElementNumbers->channelNumberToElementNumbers(
120  *detectorChannel, &subdetector, &section, &sector, &layer, &plane,
121  &strip);
122  stripGlobal = elementNumbers->stripNumber(section, layer, sector, plane,
123  strip);
124  EKLMChannelData* channelData = const_cast<EKLMChannelData*>(
125  m_Channels->getChannelData(stripGlobal));
126  if (channelData == nullptr)
127  B2FATAL("Channel data are not loaded. Use loadChannelData().");
128  }
129  delete tree;
130  delete file;
131 }

◆ loadChannelData()

void loadChannelData ( EKLMChannelData channelData)

Load specific channel data to all channels.

Parameters
[in]channelDataChannel data.

Definition at line 50 of file EKLMChannelDataImporter.cc.

◆ loadHighVoltage()

void loadHighVoltage ( const char *  highVoltageData)

Load high voltage from ROOT file.

Parameters
[in]highVoltageDataROOT file with high voltage data.

Definition at line 133 of file EKLMChannelDataImporter.cc.

◆ loadLookbackWindow()

void loadLookbackWindow ( const char *  lookbackWindowData)

Load lookback window from ROOT file.

Parameters
[in]lookbackWindowDataROOT file with lookback window data.

Definition at line 185 of file EKLMChannelDataImporter.cc.

◆ loadThresholds()

void loadThresholds ( const char *  thresholdsData)

Load thresholds and adjustment voltages from ROOT file.

Parameters
[in]thresholdsDataROOT file with threshold and adjustment voltage data.

Definition at line 239 of file EKLMChannelDataImporter.cc.

◆ setChannelData()

void setChannelData ( int  section,
int  layer,
int  sector,
int  plane,
int  strip,
EKLMChannelData channelData 
)

Set channel data.

Parameters
[in]sectionSection number.
[in]layerLayer number.
[in]sectorSector number.
[in]planePlane number.
[in]stripStrip number.
[in]channelDataChannel data.

Definition at line 72 of file EKLMChannelDataImporter.cc.


The documentation for this class was generated from the following files:
Belle2::EKLMChannelData
EKLM channel data.
Definition: EKLMChannelData.h:33
Belle2::EKLMElementNumbers
EKLM element numbers.
Definition: EKLMElementNumbers.h:34
Belle2::KLMElectronicsChannel::setCopper
void setCopper(int copper)
Set copper.
Definition: KLMElectronicsChannel.h:86
Belle2::KLMElementNumbers::Instance
static const KLMElementNumbers & Instance()
Instantiation.
Definition: KLMElementNumbers.cc:31
Belle2::KLMElectronicsChannel::setChannel
void setChannel(int channel)
Set channel.
Definition: KLMElectronicsChannel.h:154
Belle2::KLMElectronicsChannel::setAxis
void setAxis(int axis)
Set axis.
Definition: KLMElectronicsChannel.h:137
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::EKLMElementNumbers::Instance
static const EKLMElementNumbers & Instance()
Instantiation.
Definition: EKLMElementNumbers.cc:20
Belle2::EKLMElementNumbers::stripNumber
int stripNumber(int section, int layer, int sector, int plane, int strip) const
Get strip number.
Definition: EKLMElementNumbers.cc:212
Belle2::EKLMChannelDataImporter::m_Channels
DBImportObjPtr< EKLMChannels > m_Channels
Channel data.
Definition: EKLMChannelDataImporter.h:106
Belle2::KLMElectronicsChannel
BKLM electronics channel.
Definition: KLMElectronicsChannel.h:33
Belle2::KLMElectronicsChannel::setLane
void setLane(int lane)
Set lane.
Definition: KLMElectronicsChannel.h:120
Belle2::KLMElementNumbers
KLM element numbers.
Definition: KLMElementNumbers.h:37
Belle2::KLMElectronicsChannel::setSlot
void setSlot(int slot)
Set slot.
Definition: KLMElectronicsChannel.h:103
Belle2::KLMElementNumbers::channelNumberToElementNumbers
void channelNumberToElementNumbers(uint16_t channel, int *subdetector, int *section, int *sector, int *layer, int *plane, int *strip) const
Get element numbers by channel number.
Definition: KLMElementNumbers.cc:106