|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "CLHEP/Random/RandGauss.h"
16 #include "TFitResult.h"
73 std::string inputFileName;
88 }
else if (
m_pid == 2212) {
121 TFile *
file = TFile::Open(rootFileName.c_str(),
"read");
125 TH2D *h2 = &binsInLayers[
layer];
128 TH1D *
h1 = (TH1D *)
file->Get(histoName.c_str());
129 if (TMath::IsNaN(
h1->Integral())) {
131 h1 = (TH1D *)
file->Get(histoName.c_str());
134 TAxis *
x = (TAxis *)h2->GetXaxis();
135 for (
int ix = 1; ix <= h2->GetNbinsX(); ++ix) {
137 h1->GetXaxis()->SetRangeUser(
x->GetBinLowEdge(ix),
x->GetBinUpEdge(ix));
140 if (
h1->Integral() > 0 &&
h1->GetNbinsX() > 2) {
141 TFitResultPtr
res(0);
143 res =
h1->Fit(
"expo",
"SQ");
144 if (
res >= 0 && !std::isnan(
res->Parameter(0))) {
160 TFile *
file = TFile::Open(rootFileName.c_str(),
"read");
163 TH1D *
h =
new TH1D(
"h",
"h", 100, 0.01, 1);
164 TTree *
tree = (TTree *)
file->Get(
"rootTree");
165 std::string
command = branchName +
">>h";
177 double randUniformZ = 0.;
180 int maxExp = 0, minExp = 0;
191 }
else if (std::abs(
m_pid) == 211) {
194 }
else if (std::abs(
m_pid) == 2212) {
208 randUniformZ = CLHEP::RandGauss::shoot(simulstate.
randomEngine(), 0.5, 0.5);
209 inputs[
"Noise"].insert(std::pair<std::string, double>(
222 inputs[
"mycond"].insert(std::pair<std::string, double>(
223 "variable_0",
log(truth->
Ekin() / Ekin_min) /
log(Ekin_max / Ekin_min)));
229 inputs[
"mycond"].insert(std::pair<std::string, double>(
230 "variable_1", std::abs(
extrapol->IDCaloBoundary_eta())));
232 inputs[
"mycond"].insert(std::pair<std::string, double>(
"variable_1", 0));
std::map< std::string, double > NetworkOutputs
Format for network outputs.
FitResultsPerLayer m_allFitResults
std::unique_ptr< VNetworkBase > m_net_low
static std::string representNetworkOutputs(NetworkOutputs const &outputs, int maxValues=3)
String representation of network outputs.
std::unique_ptr< VNetworkBase > m_net_all
std::map< int, TH2D > Binning
const std::vector< int > & GetRelevantLayers() const
CLHEP::HepRandomEngine * randomEngine()
virtual NetworkOutputs compute(NetworkInputs const &inputs) const =0
Function to pass values to the network.
static std::unique_ptr< VNetworkBase > create(std::string input)
Given a string, make a network.
VNetworkBase * GetNetAll() const
VNetworkBase * GetNetHigh() const
TFCSGANXMLParameters m_param
std::pair< std::vector< unsigned int >, bool > res
void CalculateMeanPointFromDistributionOfR()
TFCSGANLWTNNHandler * m_gan_low
bool IsGanCorrectlyLoaded() const
VNetworkBase * GetNetLow() const
ExtrapolatorWeights m_extrapolatorWeights
std::map< std::string, std::map< std::string, double > > NetworkInputs
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
std::unique_ptr< VNetworkBase > m_net_high
std::string to_string(const DetectorType &type)
int GetLatentSpaceSize() const
static std::string representNetworkInputs(NetworkInputs const &inputs, int maxValues=3)
String representation of network inputs.
int GetGANVersion() const
void ExtractExtrapolatorMeansFromInputs()
NetworkOutputs GetNetworkOutputs(const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol, TFCSSimulationState simulstate) const
const std::string & GetInputFolder() const
virtual ~TFCSGANEtaSlice()
TFCSGANLWTNNHandler * m_gan_high
TFCSGANLWTNNHandler * m_gan_all
const Binning & GetBinning() const