1 #include <det/Detector.h>
3 #include <sdet/SDetector.h>
7 #include <fwk/CentralConfig.h>
9 #include <sevt/SEvent.h>
10 #include <sevt/Station.h>
11 #include <sevt/StationSimData.h>
12 #include <sevt/StationCalibData.h>
13 #include <sevt/PMTCalibData.h>
14 #include <sevt/PMTSimData.h>
18 #include <sdet/PMTConstants.h>
20 #include <utl/Reader.h>
30 using namespace SdSimulationCalibrationFillerASCII;
37 CentralConfig::GetInstance()->
GetTopBranch(
"SdSimulationCalibrationFillerASCII");
42 CentralConfig::GetInstance()->
GetTopBranch(
"SdCalibrator");
44 calibBranch.
GetChild(
"peakVEMConversionFactor").
45 GetData(fPeakVEMConversionFactor);
46 calibBranch.
GetChild(
"chargeVEMConversionFactor").
47 GetData(fChargeVEMConversionFactor);
48 calibBranch.
GetChild(
"onlineChargeVEMFactor").
49 GetData(fOnlineChargeVEMFactor);
51 cout <<
"got magic numbers " << fPeakVEMConversionFactor <<
' ' <<
52 fChargeVEMConversionFactor <<
' ' << fOnlineChargeVEMFactor << endl;
59 SdSimulationCalibrationFiller::Run(
Event& event)
64 SEvent& sevent =
event.GetSEvent();
70 if (seIt->HasSimData()) {
71 signature = seIt->
GetSimData().GetSimulatorSignature();
74 if (signature ==
"G4TankSimulatorFullASCII")
75 signature=
"G4TankSimulatorFullOG";
76 else if (signature ==
"G4TankSimulatorASCII")
77 signature=
"G4TankSimulatorOG";
79 ERROR(
"No SimData found, though it should exist at this point");
81 if (!seIt->HasCalibData())
82 seIt->MakeCalibData();
96 if (!pmtIt->HasCalibData())
97 pmtIt->MakeCalibData();
109 pmtCal.SetVEMPeak(detPMT.
GetVEMPeak(signature) * fPeakVEMConversionFactor);
110 pmtCal.SetVEMCharge(detPMT.
GetVEMCharge(signature) * fChargeVEMConversionFactor/fOnlineChargeVEMFactor);
121 pmtCal.SetDynodeAnodeRatio(detPMT.GetDA(), detPMT.GetDARMS());
125 pmtCal.SetDynodeAnodeDelay(0, 0);
126 pmtCal.SetDynodeAnodeDelayChi2(0);
129 msg <<
"Skipping station " << seIt->GetId() <<
", pmt " << pmtIt->GetId();
141 SdSimulationCalibrationFiller::Finish()
Branch GetTopBranch() const
double GetBaseline(const sdet::PMTConstants::PMTGain gain) const
Get baseline level for the PMT (for simulations)
void SetNTot(const unsigned int ntot)
total number of triggers recevied during calibration
Detector description interface for PMT-related data.
Interface class to access to the SD part of an event.
void SetNumberTDA(const int num)
#define INFO(message)
Macro for logging informational messages.
boost::filter_iterator< CandidateStationFilter, StationIterator > CandidateStationIterator
Iterator over candidate stations.
void Init()
Initialise the registry.
Base class for exceptions trying to access non-existing components.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
boost::filter_iterator< PMTFilter, InternalPMTIterator > PMTIterator
Iterator over station for read/write.
CandidateStationIterator CandidateStationsBegin()
Class representing a document branch.
void SetVersion(const int version)
version of the onboard calibration
double GetVEMPeak(const std::string &simulationIdentifier) const
Get VEM peak for the PMT (for simulations)
SEventSimData & GetSimData()
Get the object with simulated data, throw if n.a.
void GetData(bool &b) const
Overloads of the GetData member template function.
void SetNT1(const unsigned int nt1)
number of T1 received during calibration
void SetRate(const double rate)
ResultFlag
Flag returned by module methods to the RunController.
void SetNT2(const unsigned int nt2)
number of T2 received during calibration
void SetStartSecond(const unsigned int ss)
GPS second of start of calibration.
void SetEndSecond(const unsigned int es)
GPS second of end of calibration.
CandidateStationIterator CandidateStationsEnd()
void SetEvolution(const int ev)
double GetVEMCharge(const std::string &simulationIdentifier) const
Get VEM charge for the PMT (for simulations)
#define ERROR(message)
Macro for logging error messages.
void SetIsTubeOk(const bool ok)
double GetBaselineRMS(const sdet::PMTConstants::PMTGain gain) const
Get baseline noise for the PMT (for simulations)
void SetBaseline(const double base, const double rms, const sdet::PMTConstants::PMTGain gain=sdet::PMTConstants::eHighGain)
Set baseline and baseline RMS for a particular channel (defaults to high gain channel) ...