8#ifndef ARICHDATABASEIMPORTER_H
9#define ARICHDATABASEIMPORTER_H
15#include <TTimeStamp.h>
21#include <framework/database/IntervalOfValidity.h>
22#include <arich/dbobjects/tessellatedSolidStr.h>
46 ARICHDatabaseImporter(
const std::vector<std::string>& inputFilesHapdQA,
const std::vector<std::string>& inputFilesAsicRoot,
47 const std::vector<std::string>& inputFilesAsicTxt,
const std::vector<std::string>& inputFilesHapdQE,
48 const std::vector<std::string>& inputFilesFebTest);
64 void SetIOV(
int experimentLow,
int runLow,
int experimentHigh,
int runHigh);
105 void setHAPDQE(
unsigned modID,
double qe = 0.27,
bool import =
false);
389 TTimeStamp
timedate(std::string enddate);
396 TTimeStamp
getAsicDate(
const std::string& asicSerial,
const std::string& type);
416 std::tuple<std::string, float, float, float>
getFebLVtestData(
int serial,
int lvRun);
437 std::pair<std::vector<float>, std::vector<float>>
getSlopes(
int serialNum,
const std::string& runSCAN);
442 std::vector<std::pair<float, float>>
getFwhm(
int serialNum,
const std::string& runSCAN);
447 std::vector<TH3F*>
getFebTestHistograms(
const std::string& dna,
const std::string& run,
int febposition);
452 TH2F*
getFebTestPulse(
const std::string& dna,
const std::string& run,
int febposition);
477 std::vector<int>
channelsListHapd(std::string chlist, std::string chipDelay);
496 TGraph*
getGraphGainCurrent(
const std::string& bomb_aval,
const std::string& g_i,
const std::string& chip_label,
int i,
float* HV,
497 float* gain_current);
506 TH2F*
getBiasGraph(
const std::string& chip_2d,
const std::string& voltage_current,
int* chipnum,
float* bias_v_i);
539 std::map<std::string, float>
getAerogelParams(
const std::string& aeroSerialNumber);
554 void importModuleTest(
const std::string& mypath,
const std::string& HVtest);
612 template <
typename Container_t>
613 inline auto printContainer(
const Container_t& rContainer, std::ostream& rStream = std::cout)
noexcept ->
void
615 if (rContainer.empty())
618 rStream << rContainer.front();
619 for (
auto i = 1ul; i < rContainer.size(); ++i)
620 rStream <<
" - " << rContainer[i];
void exportHapdQE()
Export HAPD quantum efficiency from the database.
void importModulesInfo()
Import HAPD modules info from the xml file and database (2D QE maps) Goes through the list of install...
std::vector< std::string > m_inputFilesHapdQA
Input root files for HAPD QA.
void exportModuleTest(const std::string &HVtest)
Export module test results.
int getAeroTileColumn(int slot)
Get aerogel ring number from global indetifier.
void importAeroTilesInfo()
Import optical information of aerogel tiles into database.
void importHvMappings()
Imports mappings of power supply to high voltage cables.
void importChannelMapping()
Imports HAPD (asic) channel mappings from the xml file.
void importAeroTilesAlignment()
Import aerogel tiles alignment parameters from ARICH-AeroTilesAlignment.xml.
void exportMagnetTest()
Export results of magnet test.
void printChannelMask(bool makeHist=false)
Print channel mask of all HAPD modules from the database (lightweight class for sim/rec)
void importSensorModuleInfo()
Import module sensor info classes.
int getChannelPosition(const std::string &XY, const std::string &chip_2d, int chipnum)
Get position of channel on HAPD.
std::vector< std::pair< float, float > > getFwhm(int serialNum, const std::string &runSCAN)
Returns lists of FWHM values&sigmas.
void printReconstructionPar()
Prints reconstruction parameters.
void dumpModuleNumbering()
Dumps module numbering scheme into root file (module position on the detector plane -> module number)
tessellatedSolidStr readTessellatedSolidVerticesFromDATfile(const std::string &inDATfile)
reads merger cooling bodies geometry from dat files
void importAeroRayleighScatteringFit(std::string commentSingleWord="")
Import optical information of aerogel tiles into database.
void printMirrorAlignment()
Prints mirror alignment constants.
void importAerogelInfoEventDep()
Import intrarun dependant ARICH aerogel data in the database.
void printGlobalAlignment()
Prints global alignment constants.
std::vector< std::string > m_inputFilesFebTest
Input root files from FEB test (coarse/fine offset settings, test pulse)
void dumpHvMappings()
Dumps detector map of HAPD modules to HV cable channels.
virtual ~ARICHDatabaseImporter()
Destructor.
void importReconstructionParams()
Import reconstruction parameters (for now only initializes "default" values and imports)
void setHAPDQE(unsigned modID, double qe=0.27, bool import=false)
Example function for importing HAPD QE to database class (ARICHModulesInfo)
void importFEBoardInfo()
Import module test results.
void exportFEBoardInfo()
Export module test results.
void exportSensorModuleMapInfo(int number)
Export module sensor map info classes from database.
void importMagnetTest()
Import results of magnet test.
IntervalOfValidity m_iov
interval of validity
std::vector< int > channelsList(std::string badCH)
Get lists of problematic ASIC channels.
void SetIOV(int experimentLow, int runLow, int experimentHigh, int runHigh)
Set Interval of Validity.
void setExperimentAndRun(int experiment, int run)
Set experiment and run number.
void printAeroTilesAlignment()
Prints aerogel tiles alignment constants.
void importSimulationParams()
Import simulation parameters from the xml file (QE curve, etc.)
TTimeStamp timedate2(std::string time)
Convert date (FEB) to TTimeStamp.
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.
std::tuple< std::string, float > getFebHVtestData(int serial, int hvRun)
Returns data from high voltage test.
void dumpQEMap(bool simple=false)
Dumps 2D QE map of full detector surface from the database into root file (from ARICHModulesInfo)
void dumpMergerMapping(bool sn=true)
Dumps module - merger mapping into root file.
void importHapdInfo()
Import ARICH HAPD data in the database.
void printSimulationPar()
Print simulation parameters from the database (QE curve, etc.)
std::vector< int > getDeadChFEB(const std::string &dna)
Returns list of dead channels on FEB.
auto printContainer(const Container_t &rContainer, std::ostream &rStream=std::cout) noexcept -> void
printContainer used for debugging purposes...
void exportHapdInfo()
Export ARICH HAPD info and chip info data from the database.
void exportAerogelInfoEventDep()
Export intrarun dependant ARICH aerogel data from the database.
void printNominalBiasVoltageForChannel(std::vector< int > channel)
Prints nominal bias voltage for channel on power supply from the database.
void importHapdQE()
Import HAPD quantum efficiency in the database.
void importFEMappings()
Imports mappings of FE electronics from the xml file (ARICH-FrontEndMapping.xml) to the database Mapp...
void importNominalBiasVoltages()
Imports mappings of nominal values of bias voltages.
void printBiasVoltagesForHapdChip(const std::string &serialNumber)
Export ARICH HAPD chip info data from the database and calculate bias voltages for one HAPD.
std::vector< TH3F * > getFebTestHistograms(const std::string &dna, const std::string &run, int febposition)
Returns TH3F histograms - offset settings.
void importFebTest()
Import ARICH FEB test data in the database.
void importAerogelMap()
Import ARICH aerogel map in the database.
void exportSensorModuleMap()
Export module sensor map classes from database.
void importBiasMappings()
Imports mappings of power supply to bias cables and cables to HAPDs and nominal values of bias voltag...
ARICHDatabaseImporter()
Default constructor.
std::vector< std::string > m_inputFilesHapdQE
Input root files for HAPD quantum efficiency.
void printModulesInfo()
Print HAPD modules info from the database (lightweight class for sim/rec=)
void printFEMappings()
Prints electronics mappings for all modules (merger ID + SN, merger port, copper, finnese)
void importAsicInfoRoot()
Import large histograms from ARICH ASICs data in the database.
void importGlobalAlignment()
Import global alignment parameters from ARICH-GlobalAlignment.xml.
std::map< std::string, float > getAerogelParams(const std::string &aeroSerialNumber)
Function that returns refractive index, thickness and transmission length of aerogel.
void printHvMappings()
Prints mappings of power supply to HV cables and cables to HAPDs from the database.
int getAeroTileRing(int slot)
Get aerogel ring number from global indetifier.
void printAeroTileInfo()
Prints mapping of aerogel tiles and their optical properties.
void exportFebTest()
Export ARICH FEB test data from the database.
void exportAsicInfo()
Export ARICH ASICs data from the database.
void exportAerogelMap()
Export ARICH aerogel map in the database.
void exportAerogelInfo(int verboseLevel=0)
Export ARICH aerogel data from the database.
TTimeStamp timedate(std::string enddate)
Convert date (ASICs) to TTimeStamp.
void importModuleTest(const std::string &mypath, const std::string &HVtest)
Import module test results.
std::pair< std::vector< float >, std::vector< float > > getSlopes(int serialNum, const std::string &runSCAN)
Returns lists of slopes (fine & rough)
std::vector< std::string > m_inputFilesAsicTxt
Input txt files for ASICs.
void importGeometryConfig()
Import geometry configuration parameters to the database.
void exportAll()
Export all the data.
void importAerogelInfo(TString coreNameSuffix="")
Import ARICH aerogel data in the database.
TTimeStamp getAsicDate(const std::string &asicSerial, const std::string &type)
Get date for ASIC measurement.
void printMergerMapping()
Prints merger to FEB mappings from the database.
void importChannelMask()
Import channel mask for all HAPD modules from the database (list of dead channels) Goes through the l...
void importCosmicTestGeometry()
Import parameters of the cosmic test geometry configuration.
void importSensorModuleMap()
Import module sensor map classes.
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.
void printGeometryConfig()
Prints geometry configuration parameters from the database.
void importAsicInfo()
Import ARICH ASICs data in the database.
void exportHapdQA()
Export ARICH HAPD QA data from the database.
void printNominalBiasVoltages()
Prints mappings of nominal values of bias voltages from the database.
std::vector< std::string > m_inputFilesAsicRoot
Input root files for ASICs.
void printChannelMapping()
Prints HAPD (asic) channel mapping from the database.
void importFebTestRoot()
Import large histograms from ARICH FEB test data in the database.
void printHapdPositionFromCrateSlot(int crate, int slot, int channelID)
Prints HAPD position (sector, ring, azimuth) and merger connection (merger, feb slot) from the databa...
void importMergerCoolingGeo()
Import Merger cooling bodies geometry.
void printBiasMappings()
Prints mappings of power supply to bias cables and cables to HAPDs and nominal values of bias voltage...
void printMyParams(const std::string &aeroSerialNumber)
Example that shows how to use data from the database.
TH2F * getFebTestPulse(const std::string &dna, const std::string &run, int febposition)
Returns TH2F histogram of pulse test.
void dumpAerogelOpticalProperties(std::string outRootFileName="ARICH_AerogelOpticalProperties.root")
Dumps aerogel tile properties (aerogel optical properties - AOP) into root file with arich/utility/AR...
int getFebDaqSlot(unsigned febSlot)
Returns feb daq position from feb slot.
void printCopperMapping()
Prints Copper to merger mappings from the database.
void importHapdChipInfo()
Import ARICH HAPD chip data in the database.
void exportHapdChipInfo()
Export ARICH HAPD chip data from the database.
std::vector< int > channelsListHapd(std::string chlist, std::string chipDelay)
Get lists of problematic HAPD channels.
std::tuple< std::string, float, float, float > getFebLVtestData(int serial, int lvRun)
Returns data from low voltage test.
void importHapdQA()
Import ARICH HAPD QA data in the database.
void importMirrorAlignment()
Import mirror alignment parameters from ARICH-MirrorAlignment.xml.
A class that describes the interval of experiments/runs for which an object in the database is valid.
Abstract base class for different kinds of events.
Structure which holds apexes of the tessellation volumes.