test
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)
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)
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  bool hasError() const { return theLocalErrors[0] > -1.e10; }
68  float & error(int i) {return theLocalErrors[i];}
69  float error(int i) const {return theLocalErrors[i];}
70  unsigned int detId() const {
71  return thePack&idMask;
72  }
73  int surfaceSide() const {
74  Pack p(thePack);
75  return p.side();
76  }
77 
78 private:
79 
81  float theLocalErrors[15];
82  unsigned int thePack;
83  //unsigned int theDetId;
84  //int theSurfaceSide;
85 
86 };
87 
88 #endif
int i
Definition: DBlmapReader.cc:9
float error(int i) const
PTrajectoryStateOnDet(const LocalTrajectoryParameters &param, unsigned int id, int surfaceSide)
PTrajectoryStateOnDet(const LocalTrajectoryParameters &param, float errmatrix[15], unsigned int id, int surfaceSide)
Pack(unsigned int id, int surfaceSide)
unsigned int detId() const
const LocalTrajectoryParameters & parameters() const
static const unsigned int idMask
LocalTrajectoryParameters theLocalParameters