Belle II Software  release-08-01-10
ARICHDatabaseImporter Class Reference

ARICH database importer. More...

#include <ARICHDatabaseImporter.h>

Collaboration diagram for ARICHDatabaseImporter:

Public Member Functions

 ARICHDatabaseImporter ()
 Default constructor.
 
 ARICHDatabaseImporter (const std::vector< std::string > &inputFilesHapdQA, const std::vector< std::string > &inputFilesAsicRoot, const std::vector< std::string > &inputFilesAsicTxt, const std::vector< std::string > &inputFilesHapdQE, const std::vector< std::string > &inputFilesFebTest)
 Constructor.
 
 ARICHDatabaseImporter (int experiment, int run)
 
virtual ~ARICHDatabaseImporter ()
 Destructor.
 
void SetIOV (int experimentLow, int runLow, int experimentHigh, int runHigh)
 
void setExperimentAndRun (int experiment, int run)
 
void importSimulationParams ()
 Import simulation parameters from the xml file (QE curve, etc.)
 
void importReconstructionParams ()
 Import reconstruction parameters (for now only initializes "default" values and imports)
 
void printSimulationPar ()
 Print simulation parameters from the database (QE curve, etc.)
 
void importModulesInfo ()
 Import HAPD modules info from the xml file and database (2D QE maps) Goes through the list of installed modules in ARICH-InstalledModules.xml, finds corresponding 2D QE maps in the database and imports lightweight ARICHModulesInfo class (which is used in sim/rec) into database.
 
void printModulesInfo ()
 Print HAPD modules info from the database (lightweight class for sim/rec=)
 
void setHAPDQE (unsigned modID, double qe=0.27, bool import=false)
 Example function for importing HAPD QE to database class (ARICHModulesInfo)
 
void importGlobalAlignment ()
 Import global alignment parameters from ARICH-GlobalAlignment.xml.
 
void importMirrorAlignment ()
 Import mirror alignment parameters from ARICH-MirrorAlignment.xml.
 
void importAeroTilesAlignment ()
 Import aerogel tiles alignment parameters from ARICH-AeroTilesAlignment.xml.
 
void importMergerCoolingGeo ()
 Import Merger cooling bodies geometry.
 
tessellatedSolidStr readTessellatedSolidVerticesFromDATfile (const std::string &inDATfile)
 reads merger cooling bodies geometry from dat files
 
void importChannelMask ()
 Import channel mask for all HAPD modules from the database (list of dead channels) Goes through the list of installed modules in ARICH-InstalledModules.xml, finds corresponding lists of dead channels in the database and imports lightweight ARICHChannelMask class (which is used in sim/rec) into database.
 
void importChannelMask (TH1 *h)
 Import channel mask from the calibration histogram ( list of dead and hot channels ) to ARICHChannelMask class into database. More...
 
void printChannelMask (bool makeHist=false)
 Print channel mask of all HAPD modules from the database (lightweight class for sim/rec)
 
void importChannelMapping ()
 Imports HAPD (asic) channel mappings from the xml file.
 
void printChannelMapping ()
 Prints HAPD (asic) channel mapping from the database.
 
void importFEMappings ()
 Imports mappings of FE electronics from the xml file (ARICH-FrontEndMapping.xml) to the database Mapping of modules to mergers and mergers to coppers.
 
void printMergerMapping ()
 Prints merger to FEB mappings from the database.
 
void printCopperMapping ()
 Prints Copper to merger mappings from the database.
 
void printReconstructionPar ()
 Prints reconstruction parameters.
 
void printGeometryConfig ()
 Prints geometry configuration parameters from the database.
 
void dumpQEMap (bool simple=false)
 Dumps 2D QE map of full detector surface from the database into root file (from ARICHModulesInfo) More...
 
void dumpHvMappings ()
 Dumps detector map of HAPD modules to HV cable channels.
 
void printFEMappings ()
 Prints electronics mappings for all modules (merger ID + SN, merger port, copper, finnese)
 
void dumpMergerMapping (bool sn=true)
 Dumps module - merger mapping into root file.
 
void dumpModuleNumbering ()
 Dumps module numbering scheme into root file (module position on the detector plane -> module number)
 
void dumpAerogelOpticalProperties (std::string outRootFileName="ARICH_AerogelOpticalProperties.root")
 Dumps aerogel tile properties (aerogel optical properties - AOP) into root file with arich/utility/ARICHAerogelHist histos. More...
 
void importCosmicTestGeometry ()
 Import parameters of the cosmic test geometry configuration.
 
void importGeometryConfig ()
 Import geometry configuration parameters to the database.
 
void importAeroTilesInfo ()
 Import optical information of aerogel tiles into database.
 
void importAeroRayleighScatteringFit (std::string commentSingleWord="")
 Import optical information of aerogel tiles into database.
 
int getAeroTileRing (int slot)
 Get aerogel ring number from global indetifier.
 
int getAeroTileColumn (int slot)
 Get aerogel ring number from global indetifier.
 
void printAeroTileInfo ()
 Prints mapping of aerogel tiles and their optical properties.
 
void printGlobalAlignment ()
 Prints global alignment constants.
 
void printMirrorAlignment ()
 Prints mirror alignment constants.
 
void printAeroTilesAlignment ()
 Prints aerogel tiles alignment constants.
 
void importBiasMappings ()
 Imports mappings of power supply to bias cables and cables to HAPDs and nominal values of bias voltages.
 
void importHvMappings ()
 Imports mappings of power supply to high voltage cables.
 
void importNominalBiasVoltages ()
 Imports mappings of nominal values of bias voltages.
 
void printBiasMappings ()
 Prints mappings of power supply to bias cables and cables to HAPDs and nominal values of bias voltages from the database.
 
void printHvMappings ()
 Prints mappings of power supply to HV cables and cables to HAPDs from the database.
 
void printNominalBiasVoltages ()
 Prints mappings of nominal values of bias voltages from the database.
 
void printNominalBiasVoltageForChannel (std::vector< int > channel)
 Prints nominal bias voltage for channel on power supply from the database. More...
 
void printHapdPositionFromCrateSlot (int crate, int slot, int channelID)
 Prints HAPD position (sector, ring, azimuth) and merger connection (merger, feb slot) from the database. More...
 
int getFebDaqSlot (unsigned febSlot)
 Returns feb daq position from feb slot. More...
 
void importAerogelInfo (TString coreNameSuffix="")
 Import ARICH aerogel data in the database.
 
void exportAerogelInfo (int verboseLevel=0)
 Export ARICH aerogel data from the database.
 
void importAerogelMap ()
 Import ARICH aerogel map in the database.
 
void exportAerogelMap ()
 Export ARICH aerogel map in the database.
 
void importAerogelInfoEventDep ()
 Import intrarun dependant ARICH aerogel data in the database. More...
 
void exportAerogelInfoEventDep ()
 Export intrarun dependant ARICH aerogel data from the database. More...
 
void importHapdQA ()
 Import ARICH HAPD QA data in the database.
 
void exportHapdQA ()
 Export ARICH HAPD QA data from the database.
 
void importAsicInfo ()
 Import ARICH ASICs data in the database.
 
void importAsicInfoRoot ()
 Import large histograms from ARICH ASICs data in the database.
 
void exportAsicInfo ()
 Export ARICH ASICs data from the database.
 
TTimeStamp timedate (std::string enddate)
 Convert date (ASICs) to TTimeStamp. More...
 
TTimeStamp getAsicDate (const std::string &asicSerial, const std::string &type)
 Get date for ASIC measurement. More...
 
std::vector< int > channelsList (std::string badCH)
 Get lists of problematic ASIC channels.
 
void importFebTest ()
 Import ARICH FEB test data in the database.
 
void importFebTestRoot ()
 Import large histograms from ARICH FEB test data in the database.
 
std::tuple< std::string, float, float, float > getFebLVtestData (int serial, int lvRun)
 Returns data from low voltage test.
 
std::tuple< std::string, float > getFebHVtestData (int serial, int hvRun)
 Returns data from high voltage test.
 
std::vector< int > getDeadChFEB (const std::string &dna)
 Returns list of dead channels on FEB.
 
TTimeStamp timedate2 (std::string time)
 Convert date (FEB) to TTimeStamp. More...
 
std::pair< std::vector< float >, std::vector< float > > getSlopes (int serialNum, const std::string &runSCAN)
 Returns lists of slopes (fine & rough)
 
std::vector< std::pair< float, float > > getFwhm (int serialNum, const std::string &runSCAN)
 Returns lists of FWHM values&sigmas.
 
std::vector< TH3F * > getFebTestHistograms (const std::string &dna, const std::string &run, int febposition)
 Returns TH3F histograms - offset settings.
 
TH2F * getFebTestPulse (const std::string &dna, const std::string &run, int febposition)
 Returns TH2F histogram of pulse test.
 
void exportFebTest ()
 Export ARICH FEB test data from the database.
 
void importHapdChipInfo ()
 Import ARICH HAPD chip data in the database.
 
void exportHapdChipInfo ()
 Export ARICH HAPD chip data from the database.
 
void importHapdInfo ()
 Import ARICH HAPD data in the database.
 
std::vector< int > channelsListHapd (std::string chlist, std::string chipDelay)
 Get lists of problematic HAPD channels.
 
int getChannelPosition (const std::string &XY, const std::string &chip_2d, int chipnum)
 Get position of channel on HAPD. More...
 
TGraph * getGraphGainCurrent (const std::string &bomb_aval, const std::string &g_i, const std::string &chip_label, int i, float *HV, float *gain_current)
 Get graphs for bombardment and avalanche gain and current. More...
 
TH2F * getBiasGraph (const std::string &chip_2d, const std::string &voltage_current, int *chipnum, float *bias_v_i)
 Get histograms for bias voltage and current. More...
 
void exportHapdInfo ()
 Export ARICH HAPD info and chip info data from the database.
 
void importHapdQE ()
 Import HAPD quantum efficiency in the database.
 
void exportHapdQE ()
 Export HAPD quantum efficiency from the database.
 
void printBiasVoltagesForHapdChip (const std::string &serialNumber)
 Export ARICH HAPD chip info data from the database and calculate bias voltages for one HAPD. More...
 
void printMyParams (const std::string &aeroSerialNumber)
 Example that shows how to use data from the database. More...
 
std::map< std::string, float > getAerogelParams (const std::string &aeroSerialNumber)
 Function that returns refractive index, thickness and transmission length of aerogel. More...
 
void importFEBoardInfo ()
 Import module test results.
 
void exportFEBoardInfo ()
 Export module test results.
 
void importModuleTest (const std::string &mypath, const std::string &HVtest)
 Import module test results.
 
void exportModuleTest (const std::string &HVtest)
 Export module test results.
 
void importSensorModuleInfo ()
 Import module sensor info classes.
 
void importSensorModuleMap ()
 Import module sensor map classes.
 
void exportSensorModuleMap ()
 Export module sensor map and info classes from database.
 
void exportSensorModuleMapInfo (int number)
 
void importMagnetTest ()
 Import results of magnet test.
 
void exportMagnetTest ()
 Export results of magnet test.
 
void exportAll ()
 Export all the data.
 

Private Member Functions

template<typename Container_t >
auto printContainer (const Container_t &rContainer, std::ostream &rStream=std::cout) noexcept -> void
 printContainer used for debugging purposes... More...
 

Private Attributes

std::vector< std::string > m_inputFilesHapdQA
 Input root files for HAPD QA.
 
std::vector< std::string > m_inputFilesAsicRoot
 Input root files for ASICs.
 
std::vector< std::string > m_inputFilesAsicTxt
 Input txt files for ASICs.
 
std::vector< std::string > m_inputFilesHapdQE
 Input root files for HAPD quantum efficiency.
 
std::vector< std::string > m_inputFilesFebTest
 Input root files from FEB test (coarse/fine offset settings, test pulse)
 
IntervalOfValidity m_iov
 

Detailed Description

ARICH database importer.

This module writes data to database.

Definition at line 34 of file ARICHDatabaseImporter.h.

Member Function Documentation

◆ dumpAerogelOpticalProperties()

void dumpAerogelOpticalProperties ( std::string  outRootFileName = "ARICH_AerogelOpticalProperties.root")

Dumps aerogel tile properties (aerogel optical properties - AOP) into root file with arich/utility/ARICHAerogelHist histos.

Parameters
stringwith output name

Definition at line 1166 of file ARICHDatabaseImporter.cc.

1167 {
1168 
1169  ARICHAerogelHist* h2_aerogel_up_n = new ARICHAerogelHist("h2_aerogel_up_n", "aerogel up n");
1170  ARICHAerogelHist* h2_aerogel_up_transmL = new ARICHAerogelHist("h2_aerogel_up_transmL", "aerogel up transmL");
1171  ARICHAerogelHist* h2_aerogel_up_thick = new ARICHAerogelHist("h2_aerogel_up_thick", "aerogel up thick");
1172  ARICHAerogelHist* h2_aerogel_down_n = new ARICHAerogelHist("h2_aerogel_down_n", "aerogel down n");
1173  ARICHAerogelHist* h2_aerogel_down_transmL = new ARICHAerogelHist("h2_aerogel_down_transmL", "aerogel down transmL");
1174  ARICHAerogelHist* h2_aerogel_down_thick = new ARICHAerogelHist("h2_aerogel_down_thick", "aerogel down thick");
1175 
1176  std::string condDBname = "ARICHdata";
1177  // cppcheck-suppress knownConditionTrueFalse
1178  if (condDBname == "ARICHdata") {
1179 
1180  //
1181  DBArray<ARICHAerogelMap> elementsM("ARICHAerogelMap");
1182  elementsM.getEntries();
1183  DBArray<ARICHAerogelInfo> elementsI("ARICHAerogelInfo");
1184  elementsI.getEntries();
1185 
1186  //
1187  for (const auto& elementM : elementsM) {
1188  if (elementM.getAerogelLayer(0) == 1) {
1189  for (const auto& elementI : elementsI) {
1190  if (elementI.getAerogelSN() == elementM.getAerogelSN()) {
1191  //down
1192  h2_aerogel_down_n->SetBinContent(h2_aerogel_down_n->GetBinIDFromRingColumn(elementM.getAerogelRingID(),
1193  elementM.getAerogelColumnID()), elementI.getAerogelRefractiveIndex());
1194  h2_aerogel_down_transmL->SetBinContent(h2_aerogel_down_transmL->GetBinIDFromRingColumn(elementM.getAerogelRingID(),
1195  elementM.getAerogelColumnID()), elementI.getAerogelTransmissionLength());
1196  h2_aerogel_down_thick->SetBinContent(h2_aerogel_down_thick->GetBinIDFromRingColumn(elementM.getAerogelRingID(),
1197  elementM.getAerogelColumnID()), elementI.getAerogelThickness());
1198  }// if (elementI.getAerogelSN() == elementM.getAerogelSN()){
1199  }// for (const auto& elementI : elementsI) {
1200  }
1201  if (elementM.getAerogelLayer(1) == 1) {
1202  for (const auto& elementI : elementsI) {
1203  if (elementI.getAerogelSN() == elementM.getAerogelSN()) {
1204  //up
1205  h2_aerogel_up_n->SetBinContent(h2_aerogel_up_n->GetBinIDFromRingColumn(elementM.getAerogelRingID(), elementM.getAerogelColumnID()),
1206  elementI.getAerogelRefractiveIndex());
1207  h2_aerogel_up_transmL->SetBinContent(h2_aerogel_up_transmL->GetBinIDFromRingColumn(elementM.getAerogelRingID(),
1208  elementM.getAerogelColumnID()), elementI.getAerogelTransmissionLength());
1209  h2_aerogel_up_thick->SetBinContent(h2_aerogel_up_thick->GetBinIDFromRingColumn(elementM.getAerogelRingID(),
1210  elementM.getAerogelColumnID()), elementI.getAerogelThickness());
1211  }// if (elementI.getAerogelSN() == elementM.getAerogelSN()){
1212  }// for (const auto& elementI : elementsI) {
1213  }
1214  }// for (const auto& elementM : elementsM) {
1215 
1216  }// if (condDBname = "ARICHdata") {
1217  //else { // if (condDBname = "ARICHdata") {
1218  //To be added later when the information about aerogel optical properties
1219  //would be available not only in ARICHdata
1220  //}
1221 
1222  TFile* rootFile = new TFile(outRootFileName.c_str(), "RECREATE", " Histograms", 1);
1223  rootFile->cd();
1224  if (rootFile->IsZombie()) {
1225  B2ERROR(" ERROR ---> file : " << outRootFileName.c_str() << " is zombi");
1226  }
1227  h2_aerogel_up_n->Write();
1228  h2_aerogel_up_transmL->Write();
1229  h2_aerogel_up_thick->Write();
1230  h2_aerogel_down_n->Write();
1231  h2_aerogel_down_transmL->Write();
1232  h2_aerogel_down_thick->Write();
1233  rootFile->Close();
1234 }
Base class for geometry parameters.
Int_t GetBinIDFromRingColumn(Int_t ring, Int_t column)
Function which return histogram bin id from ring and column id's.
Class for accessing arrays of objects in the database.
Definition: DBArray.h:26

◆ dumpQEMap()

void dumpQEMap ( bool  simple = false)

Dumps 2D QE map of full detector surface from the database into root file (from ARICHModulesInfo)

Parameters
simplefalse for proper histogram with bin for each channel, true for simpler plot with point for each channel (smaller file, faster) for simple option, draw TGraph2D with "pcolz" option and set view to "top"

Definition at line 1133 of file ARICHDatabaseImporter.cc.

◆ exportAerogelInfoEventDep()

void exportAerogelInfoEventDep ( )

Export intrarun dependant ARICH aerogel data from the database.

-> Example for intrarun dependat data!

Definition at line 1498 of file ARICHDatabaseImporter.cc.

◆ getAerogelParams()

std::map< std::string, float > getAerogelParams ( const std::string &  aeroSerialNumber)

Function that returns refractive index, thickness and transmission length of aerogel.

Parameters
aerogelserial number

Definition at line 2741 of file ARICHDatabaseImporter.cc.

◆ getAsicDate()

TTimeStamp getAsicDate ( const std::string &  asicSerial,
const std::string &  type 
)

Get date for ASIC measurement.

Parameters
asicSerial- serial number of asic
type- gain or offset

Definition at line 1748 of file ARICHDatabaseImporter.cc.

◆ getBiasGraph()

TH2F * getBiasGraph ( const std::string &  chip_2d,
const std::string &  voltage_current,
int *  chipnum,
float *  bias_v_i 
)

Get histograms for bias voltage and current.

Parameters
chip_2d- chip label
voltage_current- voltage or current
chipnum- channel number
bias_v_i- bias voltage/current

Definition at line 2581 of file ARICHDatabaseImporter.cc.

◆ getChannelPosition()

int getChannelPosition ( const std::string &  XY,
const std::string &  chip_2d,
int  chipnum 
)

Get position of channel on HAPD.

Parameters
XY- choose X/Y coordinate
chip_2d- chip label
chipnum- channel number

Definition at line 2542 of file ARICHDatabaseImporter.cc.

◆ getFebDaqSlot()

int getFebDaqSlot ( unsigned  febSlot)

Returns feb daq position from feb slot.

Parameters
febSlotfeb slot number on merger
Returns
feb daq number

Definition at line 994 of file ARICHDatabaseImporter.cc.

◆ getGraphGainCurrent()

TGraph * getGraphGainCurrent ( const std::string &  bomb_aval,
const std::string &  g_i,
const std::string &  chip_label,
int  i,
float *  HV,
float *  gain_current 
)

Get graphs for bombardment and avalanche gain and current.

Parameters
bomb_val- bombardment or avalanche
g_i- gain or current
chip_label- chip label
i- number of entries
HV- voltage
gain_current- gain/current

Definition at line 2529 of file ARICHDatabaseImporter.cc.

◆ importAerogelInfoEventDep()

void importAerogelInfoEventDep ( )

Import intrarun dependant ARICH aerogel data in the database.

-> Example for intrarun dependat data!

Definition at line 1436 of file ARICHDatabaseImporter.cc.

◆ importChannelMask()

void importChannelMask ( TH1 *  h)

Import channel mask from the calibration histogram ( list of dead and hot channels ) to ARICHChannelMask class into database.

Parameters
hTH1F root histogram with 420*144 bins

Definition at line 421 of file ARICHDatabaseImporter.cc.

◆ printBiasVoltagesForHapdChip()

void printBiasVoltagesForHapdChip ( const std::string &  serialNumber)

Export ARICH HAPD chip info data from the database and calculate bias voltages for one HAPD.

Parameters
HAPDserial number

Definition at line 2685 of file ARICHDatabaseImporter.cc.

◆ printContainer()

auto printContainer ( const Container_t &  rContainer,
std::ostream &  rStream = std::cout 
) -> void
inlineprivatenoexcept

printContainer used for debugging purposes...

Parameters
rContainer
rStream

Definition at line 601 of file ARICHDatabaseImporter.h.

602  {
603  if (rContainer.empty())
604  return void();
605 
606  rStream << rContainer.front();
607  for (auto i = 1ul; i < rContainer.size(); ++i)
608  rStream << " - " << rContainer[i];
609  rStream << '\n';
610  }

◆ printHapdPositionFromCrateSlot()

void printHapdPositionFromCrateSlot ( int  crate,
int  slot,
int  channelID 
)

Prints HAPD position (sector, ring, azimuth) and merger connection (merger, feb slot) from the database.

Parameters
cratecrate on power supply
slotslot on power supply
channelIDchannel number on power supply

Definition at line 959 of file ARICHDatabaseImporter.cc.

◆ printMyParams()

void printMyParams ( const std::string &  aeroSerialNumber)

Example that shows how to use data from the database.

Parameters
aerogelserial number

Definition at line 2732 of file ARICHDatabaseImporter.cc.

◆ printNominalBiasVoltageForChannel()

void printNominalBiasVoltageForChannel ( std::vector< int >  channel)

Prints nominal bias voltage for channel on power supply from the database.

Parameters
channelvector of values crate, slot and channel on power supply

Definition at line 921 of file ARICHDatabaseImporter.cc.

◆ timedate()

TTimeStamp timedate ( std::string  enddate)

Convert date (ASICs) to TTimeStamp.

Parameters
enddate- time as string

Definition at line 1777 of file ARICHDatabaseImporter.cc.

◆ timedate2()

TTimeStamp timedate2 ( std::string  time)

Convert date (FEB) to TTimeStamp.

Parameters
time- time as string

Definition at line 2094 of file ARICHDatabaseImporter.cc.


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