ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/src/PixelHit.cc
Revision: 1.2
Committed: Mon Sep 28 14:15:34 2009 UTC (15 years, 7 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, HEAD
Branch point for: Mit_025c_branch
Changes since 1.1: +44 -1 lines
Log Message:
Added packing class

File Contents

# User Rev Content
1 loizides 1.2 // $Id: PixelHit.cc,v 1.1 2009/09/25 08:39:11 loizides Exp $
2 loizides 1.1
3     #include "MitAna/DataTree/interface/PixelHit.h"
4    
5     ClassImp(mithep::PixelHit)
6 loizides 1.2
7     using namespace mithep;
8    
9     // Initialize the packing format singleton
10     PixelHit::Packing PixelHit::fPacking;
11    
12     //--------------------------------------------------------------------------------------------------
13     PixelHit::Packing::Packing()
14     {
15     // Constructor: pre-computes masks and shifts from field widths
16     fProbX_width = 11;
17     fProbY_width = 11;
18     fQBin_width = 3;
19     fEdge_width = 1;
20     fBad_width = 1;
21     fTwoROC_width = 1;
22     fHasFilledProb_width = 1;
23     fSpare_width = 3;
24    
25     fProbX_units = 1.008;
26     fProbY_units = 1.008;
27     fProbX_1_over_log_units = 1.0 / TMath::Log(fProbX_units);
28     fProbY_1_over_log_units = 1.0 / TMath::Log(fProbY_units);
29    
30     // Fields are counted from right to left!
31     fProbX_shift = 0;
32     fProbY_shift = fProbX_shift + fProbX_width;
33     fQBin_shift = fProbY_shift + fProbY_width;
34     fEdge_shift = fQBin_shift + fQBin_width;
35     fBad_shift = fEdge_shift + fEdge_width;
36     fTwoROC_shift = fBad_shift + fBad_width;
37     fHasFilledProb_shift = fTwoROC_shift + fTwoROC_width;
38    
39     // Ensure the complement of the correct number of bits:
40     QualWordType zero32 = 0; // 32-bit wide set of 0's
41     fProbX_mask = ~(~zero32 << fProbX_width);
42     fProbY_mask = ~(~zero32 << fProbY_width);
43     fQBin_mask = ~(~zero32 << fQBin_width);
44     fEdge_mask = ~(~zero32 << fEdge_width);
45     fBad_mask = ~(~zero32 << fBad_width);
46     fTwoROC_mask = ~(~zero32 << fTwoROC_width);
47     fHasFilledProb_mask = ~(~zero32 << fHasFilledProb_width);
48     }