Project
Loading...
Searching...
No Matches
ChamberResponse.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
16
25
27
28#include <cmath>
29
30namespace o2
31{
32namespace mid
33{
34//______________________________________________________________________________
36{
38}
39
40//______________________________________________________________________________
41double ChamberResponse::getFiredProbability(double distance, int cathode, int deId, double theta) const
42{
44
45 // Need to convert the distance from cm to mm
46 double distMM = distance * 10.;
47 double parA = mParams.getParA(mHV.getHV(deId));
48 double parB = mParams.getParB(cathode, deId);
49 double parC = mParams.getParC(mHV.getHV(deId));
50 double costheta = std::cos(theta);
51 return (parC + parA / (parA + costheta * std::pow(distMM, parB))) / (1 + parC);
52}
53
54//______________________________________________________________________________
55double ChamberResponse::firedProbabilityFunction(double* var, double* par)
56{
71
72 int cathode = (int)par[0];
73 int deId = (int)par[1];
74
75 mParams.setParB(cathode, deId, par[3]);
76 mParams.setParA(par[4], par[5]);
77 mParams.setParC(par[6], par[7]);
78
79 return getFiredProbability(var[0], cathode, deId, par[2]);
80}
81
82//______________________________________________________________________________
90
91} // namespace mid
92} // namespace o2
MID RPC response.
double getHV(int deId) const
Gets HV for detection element.
Definition ChamberHV.h:37
void setParB(int cathode, int deId, double val)
double getParB(int cathode, int deId) const
void setParA(double a0, double a1)
void setParC(double c0, double c1)
double getFiredProbability(double distance, int cathode, int deId, double theta=0.) const
Returns the fired probability.
double firedProbabilityFunction(double *var, double *par)
Fired probability distribution.
ChamberResponse(const ChamberResponseParams &params, const ChamberHV &hv)
Constructor.
GLsizei GLsizei GLfloat distance
Definition glcorearb.h:5506
GLenum const GLfloat * params
Definition glcorearb.h:272
ChamberResponseParams createDefaultChamberResponseParams()
ChamberHV createDefaultChamberHV()
Creates the default chamber voltages.
Definition ChamberHV.cxx:65
ChamberResponse createDefaultChamberResponse()
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...