Project
Loading...
Searching...
No Matches
ChamberEfficiencyResponse.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
18
19namespace o2
20{
21namespace mid
22{
23//______________________________________________________________________________
24ChamberEfficiencyResponse::ChamberEfficiencyResponse(const ChamberEfficiency& efficiencyMap) : mEfficiency(efficiencyMap)
25{
27}
28
29//______________________________________________________________________________
30bool ChamberEfficiencyResponse::isEfficient(int deId, int columnId, int line, bool& isEfficientBP, bool& isEfficientNBP)
31{
38
39 // P(B) : probability to fire bending plane
40 double effBP = mEfficiency.getEfficiency(deId, columnId, line, ChamberEfficiency::EffType::BendPlane);
41
42 // P(BN) : probability to fire bending and non-bending plane
43 double effBoth = mEfficiency.getEfficiency(deId, columnId, line, ChamberEfficiency::EffType::BothPlanes);
44
45 isEfficientBP = (mRandom(mGenerator) <= effBP);
46
47 // P(N) : probability to fire non-bending plane
48 double effNBP = 0.;
49 if (isEfficientBP) {
50 // P(N|B) = P(BN) / P(B)
51 effNBP = effBoth / effBP;
52 } else {
53 // P(N|!B) = ( P(N) - P(BN) ) / ( 1 - P(B) )
54 effNBP = (mEfficiency.getEfficiency(deId, columnId, line, ChamberEfficiency::EffType::NonBendPlane) - effBoth) / (1. - effBP);
55 }
56
57 isEfficientNBP = (mRandom(mGenerator) <= effNBP);
58
59 return (isEfficientBP || isEfficientNBP);
60}
61
66
67} // namespace mid
68} // namespace o2
MID RPC effciency response.
bool isEfficient(int deId, int columnId, int line, bool &isEfficientBP, bool &isEfficientNBP)
ChamberEfficiencyResponse(const ChamberEfficiency &efficiencyMap)
@ BendPlane
Bending plane efficiency.
@ BothPlanes
Both plane efficiency.
@ NonBendPlane
Non-bending plane efficiency.
double getEfficiency(int deId, int columnId, int lineId, EffType type) const
ChamberEfficiencyResponse createDefaultChamberEfficiencyResponse()
ChamberEfficiency createDefaultChamberEfficiency()
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...