IB-0.2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IBMuonCollection.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 IBMUONCOLLECTION_H
22 #define IBMUONCOLLECTION_H
23 
24 #include <vector>
25 
26 #include <Math/Dense.h>
27 #include <Math/Utils.h>
28 
29 #include "Detectors/MuonScatter.h"
30 
31 using namespace uLib;
32 
33 class IBMuonCollection
34 {
35 public:
36 
37  IBMuonCollection();
38  ~IBMuonCollection();
39 
40  void AddMuon(MuonScatter &mu);
41  void AddMuonFullPath(std::vector<HPoint3f> fullPath);
42 
43  std::vector<MuonScatter> &Data();
44  std::vector<std::vector<HPoint3f> > &FullPath();
45 
46  const MuonScatter &At(int i) const;
47 
48  MuonScatter &operator[](int i);
49 
50  size_t size() const;
51 
52  void SetHiPassAngle(float angle);
53  void SetLowPassAngle(float angle);
54 
55  void SetHiPassMomentum(float momentum);
56  void SetLowPassMomentum(float momentum);
57 
58  void SetHiPassMomentumPrime(float momentum);
59  void SetLowPassMomentumPrime(float momentum);
60 
61 
62  void PrintSelf(std::ostream &o);
63  void DumpSimpleTree(const char *filename);
64 
65  void DumpTxt(const char *filename);
66  std::pair<HVector3f, HVector3f> GetAlignment();
67  void SetAlignment(std::pair<HVector3f, HVector3f> align);
68  void PerformMuonSelfAlignment();
69 
70  void dataRotoTranslation(Eigen::Matrix4f t);
71  void dataRotoTranslation(Vector3f rot, Vector3f trans);
72  Eigen::Matrix4f createAffineMatrix(float a, float b, float c, Vector3f trans);
73 
74  void AddCollection(IBMuonCollection &muonsColl);
75 
76 private:
77 
78  void splice(const float value,
79  std::function<bool(MuonScatter&, const float)> cmp);
80 
81  bool m_HiPass;
82  unsigned int m_SliceIndex;
83  std::vector<MuonScatter> m_Data;
84  std::vector<std::vector<HPoint3f> > m_FullPathData;
85 
86 };
87 
88 
89 #endif // IBMUONCOLLECTION_H