/
CastorNumberingScheme.h
68 lines (48 loc) · 1.78 KB
/
CastorNumberingScheme.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef Forward_CastorNumberingScheme_h
#define Forward_CastorNumberingScheme_h
// -*- C++ -*-
//
// Package: Forward
// Class : CastorNumberingScheme
//
/**\class CastorNumberingScheme CastorNumberingScheme.h SimG4CMS/Forward/interface/CastorNumberingScheme.h
Description: This class manages the UnitID that labels Castor sensitive
volumes
Usage: Used in CastorSD to get unique ID of sensitive detector element
*/
//
// Original Author:
// Created: Tue May 16 10:14:34 CEST 2006
// $Id: CastorNumberingScheme.h,v 1.5 2009/09/02 20:41:25 sunanda Exp $
//
// system include files
// user include files
#include "G4Step.hh"
#include "G4LogicalVolume.hh"
#include <boost/cstdint.hpp>
class CastorNumberingScheme {
public:
CastorNumberingScheme();
virtual ~CastorNumberingScheme();
virtual uint32_t getUnitID(const G4Step* aStep) const;
/** pack the Unit ID for Castor <br>
Bits 0- 5: zmodule index <br>
Bits 6- 9: sector index <br>
Bits 10-19: unused <br>
Bit 20: +/- z side <br>
Bits 22-27: unused <br>
Bits 28-31: subdetector <br>
* (+z=1,-z=2); sector=1..16, zmodule=1..18;
*/
// static uint32_t packIndex(int det, int z, int sector, int zmodule);
// static void unpackIndex(const uint32_t& idx, int& det, int& z, int& sector, int& zmodule);
static uint32_t packIndex(int z, int sector, int zmodule);
static void unpackIndex(const uint32_t& idx, int& z, int& sector, int& zmodule);
private:
typedef G4LogicalVolume* lvp;
// Utilities to get detector levels during a step
void detectorLevel(const G4Step*, int&, int*, lvp*) const;
lvp lvCASTFar, lvCASTNear, lvCAST, lvCAES, lvCEDS, lvCAHS, lvCHDS, lvCAER, lvCEDR;
lvp lvCAHR, lvCHDR, lvC3EF, lvC3HF, lvC4EF, lvC4HF;
};
#endif