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 private:
12  // we assume that id cannot be calo! (i.e. det<4)
13  static const unsigned int idMask = 0x3fffffff;
14  // little endian...
15  struct Packing {
16  unsigned int rest : 30;
17  unsigned char ss : 2;
18  };
19  struct DetPack {
20  unsigned int loc : 25;
21  unsigned char sub : 3;
22  unsigned char det : 4;
23  };
24  union Pack {
25  Pack(){}
26  Pack(unsigned int pack) : packed(pack){}
27  Pack(unsigned int id, int surfaceSide) : packed(id) {
29  assert(surfaceSide<3);
30  assert((id>>28)<4);
31  }
32  int side() const { return bytes.ss;}
33  unsigned int id() const { return packed&idMask;}
34  unsigned int packed;
37  };
38 
39 
40 public:
41 
43 
45  unsigned int id,
46  int surfaceSide) :
47  theLocalParameters(param)
48  {
49  Pack p(id, surfaceSide);
50  thePack = p.packed;
51  theLocalErrors[0]=-99999.e10;
52  }
53 
55  float errmatrix[15], unsigned int id,
56  int surfaceSide) :
57  theLocalParameters( param)
58  {
59  Pack p(id, surfaceSide);
60  thePack = p.packed;
61  for (int i=0; i<15; i++) theLocalErrors[i] = errmatrix[i];
62  }
63 
64 
66  bool hasError() const { return theLocalErrors[0] > -1.e10; }
67  float & error(int i) {return theLocalErrors[i];}
68  float error(int i) const {return theLocalErrors[i];}
69  unsigned int detId() const {
70  return thePack&idMask;
71  }
72  int surfaceSide() const {
73  Pack p(thePack);
74  return p.side();
75  }
76 
77 private:
78 
80  float theLocalErrors[15];
81  unsigned int thePack;
82  //unsigned int theDetId;
83  //int theSurfaceSide;
84 
85 };
86 
87 #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