IB-0.2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IBMuonError.h
Go to the documentation of this file.
1 /*////////////////////////////////////////////////////////////////////////////
2  Copyright 2018 Istituto Nazionale di Fisica Nucleare
3 
4  Licensed under the EUPL, Version 1.2 or - as soon they will be approved by
5  the European Commission - subsequent versions of the EUPL (the "Licence").
6  You may not use this work except in compliance with the Licence.
7 
8  You may obtain a copy of the Licence at:
9 
10  https://joinup.ec.europa.eu/software/page/eupl
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
14  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  Licence for the specific language governing permissions and limitations under
16  the Licence.
18 
19 
20 
21 #ifndef IBMUONERROR_H
22 #define IBMUONERROR_H
23 
24 #include <Detectors/MuonError.h>
25 #include <Detectors/MuonScatter.h>
26 #include <Math/VoxImage.h>
27 #include <IBVoxRaytracer.h>
28 #include <IBVoxel.h>
29 
30 class IBPocaEvaluator;
31 class IBLineDistancePocaEvaluator;
32 
33 using namespace uLib;
34 
35 class IBMuonError
36 {
37  friend class IBMEShader;
38  friend class IBMESimpler;
39 public:
40 
41  IBMuonError(Scalarf xA, Scalarf zA, Scalarf xB = 0, Scalarf zB = 0, Scalarf ratio = 1);
42  ~IBMuonError();
43 
44  bool evaluate(MuonScatter &event, int i, int j);
45  void azimuthalMomentumCorrection(bool enable=true);
46  void crossChamberErrorCorrection(bool enable=true);
47  void averageMomentumCorrection(bool enable=true);
48  void setOutMomentum(bool enable=true);
49  void squareError(bool enable=true);
50 
51  void setScrapsImage(IBLightCollection &image);
52 
53 private:
54  class IBMEShader
55  {
56  friend class IBMuonError;
57  private:
58  IBMEShader(IBMuonError * ref) { d = ref; }
59  bool evaluate(MuonScatter &event, int i, int j);
60  private:
61  IBLightCollection *m_image;
62  IBVoxRaytracer *m_tracer;
63  IBLineDistancePocaEvaluator *m_pproc;
64  IBMuonError *d;
65 
66  };
67 
68  class IBMESimpler
69  {
70  friend class IBMuonError;
71  private:
72  IBMESimpler(IBMuonError * ref) { d = ref; }
73  bool evaluate(MuonScatter &event, int i, int j);
74  private:
75  IBMuonError *d;
76  };
77 
78  Scalarf mpdEval(Scalarf a, Scalarf p, Scalarf d);
79  Scalarf mpdSquareEval(Scalarf a, Scalarf b, Scalarf p, Scalarf d);
80  Scalarf m_Ax,m_Az;
81  Scalarf m_Bx,m_Bz;
82  Scalarf m_pratio;
83  bool m_azimPcorr;
84  bool m_averPcorr;
85  bool m_usePout;
86  bool m_chamberErcorr;
87  bool m_squareError;
88  IBMEShader * m_shader;
89  IBMESimpler* m_simpler;
90 
91 };
92 
93 
94 
95 #endif // IBMUONERROR_H