ATLAS Offline Software
Loading...
Searching...
No Matches
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}
Scalar eta() const
pseudorapidity method