Project
Loading...
Searching...
No Matches
testAlpideSimResponse.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#define BOOST_TEST_MODULE Test AlpideSimResponse
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
16#include <iostream>
18#include "FairLogger.h"
19#include <TFile.h>
20
21using namespace o2::itsmft;
22
23BOOST_AUTO_TEST_CASE(AlpideSimResponse_test)
24{
25 // test for the templated Descriptor struct
26 std::string responseFile = "$(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root";
27 auto file = TFile::Open(responseFile.data());
28 AlpideSimResponse resp = *(o2::itsmft::AlpideSimResponse*)file->Get("response1");
29
30 float vCol = 1.e-4, vRow = 1.e-4, vDepth = 10.e-4;
31 LOG(info) << "Checking response from vRow:" << vCol << " vCol:" << vCol
32 << " Depth:" << vDepth;
33 bool flipCol, flipRow;
34 auto respMat = resp.getResponse(vRow, vCol, resp.getDepthMax() - vDepth, flipRow, flipCol);
35 BOOST_CHECK(respMat != nullptr);
36 respMat->print(flipRow, flipCol);
37 // repsonse at central pixel for electron close to the surface should be >>0
38 int pixCen = respMat->getNPix() / 2;
39 LOG(info) << "Response at central pixel " << pixCen << ":" << pixCen
40 << " is " << respMat->getValue(pixCen, pixCen, flipRow, flipCol);
41 BOOST_CHECK(respMat->getValue(pixCen, pixCen, flipRow, flipCol) > 1e-6);
42 //
43 // check normalization
44 float norm = 0.f;
45 for (int ir = respMat->getNPix(); ir--;) {
46 for (int ic = respMat->getNPix(); ic--;) {
47 norm += respMat->getValue(ir, ic, flipRow, flipCol);
48 }
49 }
50 LOG(info) << "Total response to 1 electron: " << norm;
51 BOOST_CHECK(norm > 0.1);
52}
Definition of the ITSMFT Alpide simulated response parametrization.
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h configStandalone Internal display display_internal Number of updates the Qt GUI may send ahead of the last one the display has before it waits for the display Opacity of the console background Number of console lines the history is shortened to this when it reaches twice the size Time in seconds an info message fades out after setInfoTime h OpenGL display display Font size Do not use Freetype for font Renderer for event Frontend to use for event ROOT macros used as track filter Console script file
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
bool getResponse(float vRow, float vCol, float cDepth, AlpideRespSimMat &dest) const
BOOST_AUTO_TEST_CASE(Cluster_messageable)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
BOOST_CHECK(tree)
o2::InteractionRecord ir(0, 0)