Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:59

0001 #ifndef Forward_CastorNumberingScheme_h
0002 #define Forward_CastorNumberingScheme_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Forward
0006 // Class  :     CastorNumberingScheme
0007 //
0008 /**\class CastorNumberingScheme CastorNumberingScheme.h SimG4CMS/Forward/interface/CastorNumberingScheme.h
0009  
0010  Description: This class manages the UnitID that labels Castor sensitive
0011               volumes
0012  
0013  Usage: Used in CastorSD to get unique ID of sensitive detector element
0014  
0015 */
0016 //
0017 // Original Author:
0018 //         Created:  Tue May 16 10:14:34 CEST 2006
0019 // $Id: CastorNumberingScheme.h,v 1.5 2009/09/02 20:41:25 sunanda Exp $
0020 //
0021 
0022 // system include files
0023 
0024 // user include files
0025 
0026 #include "G4Step.hh"
0027 #include "G4LogicalVolume.hh"
0028 #include <cstdint>
0029 
0030 class CastorNumberingScheme {
0031 public:
0032   CastorNumberingScheme();
0033   virtual ~CastorNumberingScheme();
0034 
0035   virtual uint32_t getUnitID(const G4Step* aStep) const;
0036 
0037   /** pack the Unit ID for  Castor <br>
0038    Bits  0- 5: zmodule index <br>
0039    Bits  6- 9: sector  index <br>
0040    Bits 10-19: unused        <br>
0041    Bit     20: +/- z side    <br>
0042    Bits 22-27: unused        <br>
0043    Bits 28-31: subdetector   <br>
0044    *  (+z=1,-z=2);  sector=1..16, zmodule=1..18;
0045    */
0046   //  static uint32_t packIndex(int det, int z, int sector, int zmodule);
0047   //  static void   unpackIndex(const uint32_t& idx, int& det, int& z, int& sector, int& zmodule);
0048 
0049   static uint32_t packIndex(int z, int sector, int zmodule);
0050   static void unpackIndex(const uint32_t& idx, int& z, int& sector, int& zmodule);
0051 
0052 private:
0053   typedef G4LogicalVolume* lvp;
0054 
0055   // Utilities to get detector levels during a step
0056   void detectorLevel(const G4Step*, int&, int*, lvp*) const;
0057 
0058   lvp lvCASTFar, lvCASTNear, lvCAST, lvCAES, lvCEDS, lvCAHS, lvCHDS, lvCAER, lvCEDR;
0059   lvp lvCAHR, lvCHDR, lvC3EF, lvC3HF, lvC4EF, lvC4HF;
0060 };
0061 
0062 #endif