Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Forward_TotemT1Organization_h
0002 #define Forward_TotemT1Organization_h 1
0003 // -*- C++ -*-
0004 //
0005 // Package:     Forward
0006 // Class  :     TotemT1Organization
0007 //
0008 /**\class TotemT1Organization TotemT1Organization.h SimG4CMS/Forward/interface/TotemT1Organization.h
0009  
0010  Description: This class manages the UnitID that labels TotemT1 sensitive
0011               volumes
0012  
0013  Usage:
0014     Used in TotemSD to get unique ID of sensitive detector element
0015  
0016 */
0017 //
0018 // Original Author:  R. Capra
0019 //         Created:  Tue May 16 10:14:34 CEST 2006
0020 //
0021 
0022 // system include files
0023 
0024 // user include files
0025 
0026 #include "SimG4CMS/Forward/interface/TotemVDetectorOrganization.h"
0027 
0028 class TotemT1Organization : public TotemVDetectorOrganization {
0029 public:
0030   // ---------- public enums -------------------------------
0031 
0032   enum ObjectType {
0033     Undefined = 0,
0034     Upper = 1,
0035     Lower = 2,
0036     InternalUpper = 3,
0037     InternalLower = 4,
0038     Frame1 = 5,
0039     Frame2Left = 6,
0040     Frame2Right = 7,
0041     Frame3Left = 8,
0042     Frame3Right = 9,
0043     Frame4Left = 10,
0044     Frame4Right = 11,
0045     Frame5 = 12,
0046     Triangle6Left = 13,
0047     Triangle6Right = 14,
0048     MaxObjectTypes = 15
0049   };
0050 
0051 public:
0052   // ---------- Constructor and destructor -----------------
0053   TotemT1Organization();
0054   ~TotemT1Organization() override;
0055 
0056   // ---------- member functions ---------------------------
0057   uint32_t getUnitID(const G4Step* aStep) const override;
0058 
0059   int getCurrentUnitID(void) const;
0060   void setCurrentUnitID(int currentUnitID);
0061 
0062   // ---------- Detector position --------------------------
0063 
0064   int getCurrentDetectorPosition(void) const;
0065   void setCurrentDetectorPosition(int currentDetectorPosition);
0066 
0067   // ---------- Plane: between 0 and (nPlanes-1) (or -1 for Undefined)
0068   int getCurrentPlane(void) const;
0069   void setCurrentPlane(int currentPlane);
0070 
0071   // ---------- CSC: between 0 and 5 (or -1 for Undefined)
0072   int getCurrentCSC(void) const;
0073   void setCurrentCSC(int currentCSC);
0074 
0075   // ---------- Layer: between 0 and (nLayers-1) (or -1 for Undefined)
0076   int getCurrentLayer(void) const;
0077   void setCurrentLayer(int currentLayer);
0078 
0079   // ---------- Object Type --------------------------------
0080 
0081   ObjectType getCurrentObjectType(void) const;
0082   void setCurrentObjectType(ObjectType currentObjectType);
0083 
0084   int fromObjectTypeToInt(ObjectType objectType);
0085   int fromObjectTypeToInt(ObjectType objectType, int layer);
0086 
0087   // ---------- Private methods ----------------------------
0088 
0089 private:
0090   uint32_t getUnitID(const G4Step* aStep);
0091 
0092   void _checkUnitIDUpdate(void) const;
0093   void _checkDataUpdate(void) const;
0094 
0095   void _FromUnitIDToData(void);
0096   void _FromDataToUnitID(void);
0097 
0098   // ---------- Private data members -----------------------
0099   bool _needUpdateUnitID;
0100   bool _needUpdateData;
0101   int _currentUnitID;
0102   int _currentDetectorPosition;
0103   int _currentPlane;
0104   int _currentCSC;
0105   int _currentLayer;
0106   ObjectType _currentObjectType;
0107 };
0108 #endif