Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:19:02

0001 #include "PHG4SectorDetector.h"
0002 #include "PHG4SectorDisplayAction.h"
0003 
0004 #include <g4main/PHG4Detector.h>       // for PHG4Detector
0005 #include <g4main/PHG4DisplayAction.h>  // for PHG4DisplayAction
0006 #include <g4main/PHG4Subsystem.h>      // for PHG4Subsystem
0007 
0008 #include <Geant4/G4PVPlacement.hh>
0009 #include <Geant4/G4String.hh>  // for G4String
0010 
0011 #include <map>  // for _Rb_tree_iterator, _Rb_tree_co...
0012 #include <sstream>
0013 #include <utility>  // for pair
0014 
0015 class G4VPhysicalVolume;
0016 class PHCompositeNode;
0017 
0018 //_______________________________________________________________
0019 // note this inactive thickness is ~1.5% of a radiation length
0020 PHG4SectorDetector::PHG4SectorDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, const std::string &dnam)
0021   : PHG4Detector(subsys, Node, dnam)
0022   , PHG4SectorConstructor(dnam, subsys)
0023   , m_DisplayAction(dynamic_cast<PHG4SectorDisplayAction *>(subsys->GetDisplayAction()))
0024 {
0025 }
0026 
0027 //_______________________________________________________________
0028 //_______________________________________________________________
0029 bool PHG4SectorDetector::IsInSectorActive(G4VPhysicalVolume *physvol)
0030 {
0031   for (map_phy_vol_t::const_iterator it = map_active_phy_vol.begin();
0032        it != map_active_phy_vol.end(); ++it)
0033   {
0034     if (physvol == (*it).second)
0035     {
0036       return true;
0037     }
0038   }
0039 
0040   return false;
0041 }
0042 
0043 //_______________________________________________________________
0044 void PHG4SectorDetector::ConstructMe(G4LogicalVolume *logicWorld)
0045 {
0046   Construct_Sectors(logicWorld);
0047 
0048   for (auto &it : map_log_vol)
0049   {
0050     if (it.first != G4String(name_base + "_Log"))
0051     {
0052       // sub layers
0053       m_DisplayAction->AddVolume(it.second, "SectorDetector");
0054     }
0055   }
0056 }