CMS 3D CMS Logo

Macros | Functions
TrackingMaterialProducer.cc File Reference
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <exception>
#include <tuple>
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "SimG4Core/Notification/interface/BeginOfJob.h"
#include "SimG4Core/Notification/interface/BeginOfEvent.h"
#include "SimG4Core/Notification/interface/BeginOfTrack.h"
#include "SimG4Core/Notification/interface/EndOfTrack.h"
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4VSolid.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4TouchableHistory.hh"
#include "G4VPhysicalVolume.hh"
#include "G4AffineTransform.hh"
#include "TrackingMaterialProducer.h"
#include "SimG4Core/Watcher/interface/SimWatcherFactory.h"
#include "FWCore/Framework/interface/MakerMacros.h"

Go to the source code of this file.

Macros

#define DEBUG_G4_VOLUMES
 

Functions

std::tuple< const G4VPhysicalVolume *, int > GetSensitiveVolume (const G4VTouchable *touchable)
 
static const G4AffineTransform & GetTransform (const G4TouchableHistory *touchable, int depth)
 
static const G4LogicalVolume * GetVolume (const std::string &name)
 
static const SimWatcherFactory::PMaker< SimWatcherMaker< TrackingMaterialProducer > > s_maker__LINE__ ("TrackingMaterialProducer")
 

Macro Definition Documentation

#define DEBUG_G4_VOLUMES

Definition at line 35 of file TrackingMaterialProducer.cc.

Function Documentation

std::tuple<const G4VPhysicalVolume*, int> GetSensitiveVolume ( const G4VTouchable *  touchable)

Definition at line 68 of file TrackingMaterialProducer.cc.

References egammaForCoreTracking_cff::depth, and hcalDigis_cfi::level.

Referenced by TrackingMaterialProducer::update().

68  {
69  int depth = touchable->GetHistoryDepth();
70  for (int level = 0; level < depth; ++level) { // 0 is self
71  const G4VPhysicalVolume* volume = touchable->GetVolume(level);
72  if (volume->GetLogicalVolume()->GetSensitiveDetector() != nullptr) {
73  return std::make_tuple(volume, level);
74  }
75  }
76  return std::tuple<const G4VPhysicalVolume*, int>(nullptr, 0);
77 }
static const G4AffineTransform& GetTransform ( const G4TouchableHistory *  touchable,
int  depth 
)
inlinestatic

Definition at line 58 of file TrackingMaterialProducer.cc.

References egammaForCoreTracking_cff::depth.

Referenced by FWGeoTopNode::paintShape(), and TrackingMaterialProducer::update().

58  {
59  return touchable->GetHistory()->GetTransform(touchable->GetHistory()->GetDepth() - depth);
60 }
static const G4LogicalVolume* GetVolume ( const std::string &  name)
static

Definition at line 41 of file TrackingMaterialProducer.cc.

References dataset::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GflashEMShowerModel::ModelTrigger(), and TrackingMaterialProducer::update().

41  {
42  const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
43 
44 #ifdef DEBUG_G4_VOLUMES
45  for (G4LogicalVolumeStore::const_iterator volume = lvs->begin(); volume != lvs->end(); ++volume)
46  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: G4 registered volumes " << (*volume)->GetName()
47  << std::endl;
48 #endif
49 
50  for (G4LogicalVolumeStore::const_iterator volume = lvs->begin(); volume != lvs->end(); ++volume) {
51  if ((const std::string&)(*volume)->GetName() == name)
52  return (*volume);
53  }
54  return nullptr;
55 }
static const SimWatcherFactory ::PMaker< SimWatcherMaker< TrackingMaterialProducer > > s_maker__LINE__ ( "TrackingMaterialProducer"  )
static