Belle II Software  release-05-02-19
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 46 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 1168 of file ARICHDatabaseImporter.cc.

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

◆ 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 1135 of file ARICHDatabaseImporter.cc.

◆ exportAerogelInfoEventDep()

void exportAerogelInfoEventDep ( )

Export intrarun dependant ARICH aerogel data from the database.

-> Example for intrarun dependat data!

Definition at line 1500 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 2743 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 1750 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 2583 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 2544 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 996 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 2531 of file ARICHDatabaseImporter.cc.

◆ importAerogelInfoEventDep()

void importAerogelInfoEventDep ( )

Import intrarun dependant ARICH aerogel data in the database.

-> Example for intrarun dependat data!

Definition at line 1438 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 423 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 2687 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 613 of file ARICHDatabaseImporter.h.

◆ 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 961 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 2734 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 923 of file ARICHDatabaseImporter.cc.

◆ timedate()

TTimeStamp timedate ( std::string  enddate)

Convert date (ASICs) to TTimeStamp.

Parameters
enddate- time as string

Definition at line 1779 of file ARICHDatabaseImporter.cc.

◆ timedate2()

TTimeStamp timedate2 ( std::string  time)

Convert date (FEB) to TTimeStamp.

Parameters
time- time as string

Definition at line 2096 of file ARICHDatabaseImporter.cc.


The documentation for this class was generated from the following files:
Belle2::DBArray
Class for accessing arrays of objects in the database.
Definition: DBArray.h:36
Belle2::ARICHAerogelHist::GetBinIDFromRingColumn
Int_t GetBinIDFromRingColumn(Int_t ring, Int_t column)
Function which return histogram bin id from ring and column id's.
Definition: ARICHAerogelHist.cc:85
Belle2::ARICHAerogelHist
Base class for geometry parameters.
Definition: ARICHAerogelHist.h:38