Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:19:37

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 ///////////////////////////////////////////////////////////////////////////////
0027 // File: CCalG4Able.hh
0028 // Description: CCalG4Able will provide the basic functionallity of a CCal
0029 //              "detector" to become a Geant4 Detector.
0030 ///////////////////////////////////////////////////////////////////////////////
0031 #ifndef CCalG4Able_h
0032 #define CCalG4Able_h 1
0033 
0034 #include <vector>
0035 #include "G4VPhysicalVolume.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "globals.hh"
0038 
0039 #include "CCalVisualisable.hh"
0040 
0041 #include <iostream>
0042 
0043 //Forward declartion for the CCalG4AbleTable typedef
0044 class CCalG4Able;
0045 
0046 //A table to hold a list of pointers to CMS Detectors
0047 typedef  std::vector<CCalG4Able*> CCalG4AbleTable;
0048 
0049 ////////////////////
0050 //At last the class
0051 class CCalG4Able {
0052 
0053   friend std::ostream& operator<<(std::ostream&, const CCalG4Able&);
0054 
0055 public:
0056   //////////////////////////////////////////////////////////////////////////
0057   //Constructor with a name
0058   CCalG4Able(G4String name);
0059   //////////////////////////////////////////////////////////////////////////
0060   //Destructor
0061   virtual ~CCalG4Able();
0062 
0063   //////////////////////////////////////////////////////////////////////////
0064   //Get/Set methods
0065 
0066   //Method to retrieve the physical volume of the detector.
0067   G4VPhysicalVolume* PhysicalVolume(G4VPhysicalVolume*);
0068 
0069   //Set the type of a logical volume to select its vis parameters.
0070   void setVisType(CCalVisualisable::visType, G4LogicalVolume*);
0071 
0072   //Sensitivity related
0073   void sensitiveHandling();
0074   void setSensitivity(G4bool sens=true) {sensitivity=sens;}
0075   G4bool isSensitive() const {return sensitivity;}
0076 
0077   //Name
0078   G4String G4Name() const {return g4ableName;}
0079   void setName(const G4String& name) {g4ableName = name;}
0080 
0081   //Comparison operator needed for CCalG4AbleTable. Compares phys. volumes
0082   G4bool operator==(const CCalG4Able& right) const;
0083  
0084 protected:
0085   //A method that allows to add a new CCalG4Able inside this one.
0086   void AddCCalG4Able(CCalG4Able*);
0087 
0088   //This method actually constructs the volume. Pure virtual.
0089   virtual G4VPhysicalVolume* constructIn(G4VPhysicalVolume*) = 0;
0090 
0091   //Constructs the sensitive detectors and associates them to the corresponding
0092   //logical volumes
0093   virtual void constructSensitive() = 0;
0094 
0095 protected:
0096   //////////////////////////////////////////////////////////////////////////
0097   // Data Members
0098   G4VPhysicalVolume *detPhysicalVolume; //The G4PhysVolume or 0 if not created
0099   CCalG4AbleTable theG4DetectorsInside; //CCalG4Able* daughters of this det.
0100 
0101   G4String g4ableName;
0102 
0103   G4bool sensitivity;                   //true if sentive, false if not.
0104 
0105   //Visualisation in G4 related Variables
0106   CCalVisualisable visProperties;       //Visualisation properties.
0107   G4VisAttributes* g4VisAtt[CCalVisualisable::TotalVisTypes];
0108 
0109 };
0110 
0111 #endif