CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PTrajectoryStateOnDet.h
Go to the documentation of this file.
1 #ifndef PTrajectoryStateOnDet_H
2 #define PTrajectoryStateOnDet_H
3 
5 #include<cassert>
11 public:
12  // little endian...
13  struct Packing {
14  unsigned int rest : 30;
15  unsigned char ss : 2;
16  };
17  struct DetPack {
18  unsigned int loc : 25;
19  unsigned char sub : 3;
20  unsigned char det : 4;
21  };
22 private:
23  // we assume that id cannot be calo! (i.e. det<4)
24  static const unsigned int idMask = 0x3fffffff;
25  union Pack {
26  Pack(){}
27  Pack(unsigned int pack) : packed(pack){}
28  Pack(unsigned int id, int surfaceSide) : packed(id) {
30  assert(surfaceSide<3);
31  assert((id>>28)<4);
32  }
33  int side() const { return bytes.ss;}
34  unsigned int id() const { return packed&idMask;}
35  unsigned int packed;
38  };
39 
40 
41 public:
42 
44 
46  unsigned int id,
47  int surfaceSide) :
48  theLocalParameters(param) , thePt(ipt)
49  {
50  Pack p(id, surfaceSide);
51  thePack = p.packed;
52  theLocalErrors[0]=-99999.e10;
53  }
54 
56  float errmatrix[15], unsigned int id,
57  int surfaceSide) :
58  theLocalParameters( param), thePt(ipt)
59  {
60  Pack p(id, surfaceSide);
61  thePack = p.packed;
62  for (int i=0; i<15; i++) theLocalErrors[i] = errmatrix[i];
63  }
64 
65 
67  float pt() const { return thePt; }
68  bool hasError() const { return theLocalErrors[0] > -1.e10; }
69  float & error(int i) {return theLocalErrors[i];}
70  float error(int i) const {return theLocalErrors[i];}
71  unsigned int detId() const {
72  return thePack&idMask;
73  }
74  int surfaceSide() const {
75  Pack p(thePack);
76  return p.side();
77  }
78 
79 private:
80 
82  float theLocalErrors[15];
83  float thePt;
84  unsigned int thePack;
85 
86 };
87 
88 #endif
int i
Definition: DBlmapReader.cc:9
float error(int i) const
assert(m_qm.get())
Pack(unsigned int id, int surfaceSide)
PTrajectoryStateOnDet(const LocalTrajectoryParameters &param, float ipt, unsigned int id, int surfaceSide)
PTrajectoryStateOnDet(const LocalTrajectoryParameters &param, float ipt, float errmatrix[15], unsigned int id, int surfaceSide)
unsigned int detId() const
const LocalTrajectoryParameters & parameters() const
static const unsigned int idMask
LocalTrajectoryParameters theLocalParameters