Project
Loading...
Searching...
No Matches
Millepede2Record.h
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
17#ifndef MILLEPEDE2RECORD_H
18#define MILLEPEDE2RECORD_H
19
20#include <Rtypes.h>
22
23namespace o2
24{
25namespace align
26{
27
28class AlignmentTrack;
29
31{
32 public:
33 enum { CosmicBit = 0x1 };
34 //
35 Millepede2Record() = default;
37 //
38 int getRun() const { return mRunNumber; }
39 void setRun(int r) { mRunNumber = r; }
40 uint32_t getFirstTFOrbit() const { return mFirstTFOrbit; }
41 void setFirstTFOrbit(uint32_t v) { mFirstTFOrbit = v; }
44 bool isCosmic() const { return testBit(CosmicBit); }
45 void setCosmic(bool v = true) { setBit(CosmicBit, v); }
46 //
47 int getNVarGlo() const { return mNVarGlo; }
48 void setNVarGlo(int n) { mNVarGlo = n; }
49 //
50 int getNResid() const { return mNResid; }
51 int getNVarLoc() const { return mNVarLoc; }
52 //
53 int getNDLoc(int id) const { return mNDLoc[id]; }
54 int getNDGlo(int id) const { return mNDGlo[id]; }
55 int getVolID(int id) const { return mVolID ? mVolID[id] - 1 : -1; }
56 float getResid(int id) const { return mResid[id]; }
57 float getResErr(int id) const { return mResErr[id]; }
58 //
59 float getChi2Ini() const { return mChi2Ini; }
60 float getQ2Pt() const { return mQ2Pt; }
61 float getTgl() const { return mTgl; }
62 int getNDLocTot() const { return mNDLocTot; }
63 int getNDGloTot() const { return mNDGloTot; }
64 const float* getArrGlo() const { return mDGlo; }
65 const float* getArrLoc() const { return mDLoc; }
66 const int16_t* getArrLabLoc() const { return mIDLoc; }
67 const int* getArrLabGlo() const { return mIDGlo; }
68 //
69 bool fillTrack(AlignmentTrack& trc, const std::vector<int>& id2Lab);
70 void dummyRecord(float res, float err, float dGlo, int labGlo);
71 //
72 void resize(int nresid, int nloc, int nglo);
73 //
74 void clear();
75 void print() const;
76 //
77 protected:
78 //
79 uint16_t mBits = 0;
80 int mRunNumber = 0;
81 uint32_t mFirstTFOrbit = 0; // event time stamp
83 int mNResid = 0; // number of residuals for the track (=2 npoints)
84 int mNVarLoc = 0; // number of local variables for the track
85 int mNVarGlo = 0; // number of global variables defined
86 int mNDLocTot = 0; // total number of non-zero local derivatives
87 int mNDGloTot = 0; // total number of non-zero global derivatives
88 int mNMeas = 0; // number of measured points
89 float mChi2Ini = 0; // chi2 of initial kalman fit
90 float mQ2Pt = 0; // q/pt at ref point
91 float mTgl = 0; // dip angle at ref point
92 //
93 int16_t* mMeasType = nullptr; //[mNResid] measurement type (0,1: Y, Z, 10+j : j-th material correction param)
94 int16_t* mNDLoc = nullptr; //[mNResid] number of non-0 local derivatives per residual
95 int* mNDGlo = nullptr; //[mNResid] number of non-0 global derivatives per residual
96 int* mVolID = nullptr; //[mNResid] volume id + 1 (0 - not a volume)
97 float* mResid = nullptr; //[mNResid] residuals
98 float* mResErr = nullptr; //[mNResid] error associated to residual
99 //
100 int16_t* mIDLoc = nullptr; //[mNDLocTot] ID of local variables for non-0 local derivatives
101 int* mIDGlo = nullptr; //[mNDGloTot] ID of global variables for non-0 global derivatives
102 float* mDLoc = nullptr; //[mNDLocTot] non-0 local derivatives
103 float* mDGlo = nullptr; //[mNDGloTot] non-0 global derivatives
104 //
105 // aux info
106 int mNResidBook = 0;
109 //
110 void setBit(uint16_t b, bool v)
111 {
112 if (v) {
113 mBits |= b;
114 } else {
115 mBits &= ~(b & 0xffff);
116 }
117 }
118 bool testBit(uint16_t b) const
119 {
120 return mBits & b;
121 }
122
124};
125} // namespace align
126} // namespace o2
127#endif
Global index for barrel track: provides provenance (detectors combination), index in respective array...
uint32_t res
Definition RawData.h:0
int mNDGloTotBook
number of slots booked for local derivatives
o2::dataformats::GlobalTrackID mTrackID
int mNDLocTotBook
number of slots booked for residuals
bool testBit(uint16_t b) const
void resize(int nresid, int nloc, int nglo)
bool fillTrack(AlignmentTrack &trc, const std::vector< int > &id2Lab)
o2::dataformats::GlobalTrackID getTrackID() const
float getResErr(int id) const
void setBit(uint16_t b, bool v)
number of slots booked for global derivatives
const int * getArrLabGlo() const
void setTrackID(o2::dataformats::GlobalTrackID t)
const float * getArrGlo() const
float getResid(int id) const
void dummyRecord(float res, float err, float dGlo, int labGlo)
const int16_t * getArrLabLoc() const
ClassDefNV(Millepede2Record, 2)
const float * getArrLoc() const
GLdouble n
Definition glcorearb.h:1982
const GLdouble * v
Definition glcorearb.h:832
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean r
Definition glcorearb.h:1233
GLuint id
Definition glcorearb.h:650
void align(gsl::span< ElinkEncoder< BareFormat, CHARGESUM > > elinks)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...