ATLAS Offline Software
Functions
TFCSHitCellMappingWiggle.cxx File Reference
#include "ISF_FastCaloSimEvent/TFCSHitCellMappingWiggle.h"
#include <TClass.h>
#include "CLHEP/Random/RandFlat.h"
#include "ISF_FastCaloSimEvent/TFCS1DFunctionInt32Histogram.h"
#include "ISF_FastCaloSimEvent/TFCSExtrapolationState.h"
#include "ISF_FastCaloSimEvent/TFCSSimulationState.h"
#include "ISF_FastCaloSimEvent/TFCSTruthState.h"
#include "TH1.h"
#include "TMath.h"
#include "TVector2.h"

Go to the source code of this file.

Functions

void TFCSHitCellMappingWiggle::unit_test ATLAS_NOT_THREAD_SAFE (TFCSSimulationState *simulstate, TFCSTruthState *truth, TFCSExtrapolationState *extrapol)
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

void TFCSHitCellMappingWiggle::unit_test ATLAS_NOT_THREAD_SAFE ( TFCSSimulationState simulstate,
TFCSTruthState truth,
TFCSExtrapolationState extrapol 
)

Definition at line 226 of file TFCSHitCellMappingWiggle.cxx.

228  {
229  if (!simulstate)
230  simulstate = new TFCSSimulationState();
231  if (!truth)
232  truth = new TFCSTruthState();
233  if (!extrapol)
235 
236  int nbin = 10;
237  float maxeta = 5.0;
238  std::vector<const TFCS1DFunction *> functions;
239  std::vector<float> bin_low_edges;
240 
241  TFCSHitCellMappingWiggle wiggle_test("WiggleTest", "WiggleTest");
242 
243  for (float eta = 0; eta < maxeta; eta += maxeta / nbin) {
244  TH1 *hist = TFCS1DFunction::generate_histogram_random_gauss(
245  16, 100000, -0.0125, 0.0125, 0, 0.005);
246  bin_low_edges.push_back(eta);
247  functions.push_back(new TFCS1DFunctionInt32Histogram(hist));
248  delete hist;
249  }
250  bin_low_edges.push_back(100);
251  wiggle_test.initialize(functions, bin_low_edges);
252  wiggle_test.set_calosample(2);
253  wiggle_test.setLevel(MSG::DEBUG);
254  wiggle_test.Print();
255 
256 #if 0 // defined(__FastCaloSimStandAlone__)
258 
259 // * load geometry files
260  geo->LoadGeometryFromFile("/afs/cern.ch/atlas/groups/Simulation/FastCaloSimV2/Geometry-ATLAS-R2-2016-01-00-01.root", "ATLAS-R2-2016-01-00-01");
261  TString path_to_fcal_geo_files = "/afs/cern.ch/atlas/groups/Simulation/FastCaloSimV2/";
262  geo->LoadFCalGeometryFromFiles(path_to_fcal_geo_files + "FCal1-electrodes.sorted.HV.09Nov2007.dat", path_to_fcal_geo_files + "FCal2-electrodes.sorted.HV.April2011.dat", path_to_fcal_geo_files + "FCal3-electrodes.sorted.HV.09Nov2007.dat");
263 
264  wiggle_test.set_geometry(geo);
265  for(float eta=-maxeta+0.01;eta<maxeta;eta+=maxeta/nbin) {
266  Hit hit;
267  hit.eta()=eta;
268  hit.phi()=0;
269  hit.E()=1;
270  wiggle_test.simulate_hit(hit,*simulstate,truth,extrapol);
271  }
272 #endif
273 }
TFCSHitCellMappingWiggle
Definition: TFCSHitCellMappingWiggle.h:19
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
plotmaker.hist
hist
Definition: plotmaker.py:148
TFCSExtrapolationState
Definition: TFCSExtrapolationState.h:13
RunActsMaterialValidation.extrapol
extrapol
Definition: RunActsMaterialValidation.py:91
Hit
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:16
CaloGeometryFromFile
Definition: CaloGeometryFromFile.h:11
TFCS1DFunctionInt32Histogram
Definition: TFCS1DFunctionInt32Histogram.h:15
Hit::phi
CUDA_HOSTDEV float & phi()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:72
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
DEBUG
#define DEBUG
Definition: page_access.h:11
Hit::E
CUDA_HOSTDEV float & E()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:75
Hit::eta
CUDA_HOSTDEV float & eta()
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:71
TFCSTruthState
Definition: TFCSTruthState.h:13
TFCSSimulationState
Definition: TFCSSimulationState.h:32