CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/SimTracker/TrackerMaterialAnalysis/plugins/TrackingMaterialProducer.cc File Reference

#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <exception>
#include <boost/tuple/tuple.hpp>
#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 "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.

Functions

 DEFINE_SIMWATCHER (TrackingMaterialProducer)
boost::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)

Function Documentation

DEFINE_SIMWATCHER ( TrackingMaterialProducer  )
boost::tuple<const G4VPhysicalVolume*, int> GetSensitiveVolume ( const G4VTouchable *  touchable)

Definition at line 57 of file TrackingMaterialProducer.cc.

References testEve_cfg::level.

Referenced by TrackingMaterialProducer::update().

{
  int depth = touchable->GetHistoryDepth();
  for (int level = 0; level < depth; ++level) {      // 0 is self
    const G4VPhysicalVolume* volume = touchable->GetVolume(level);
    if (volume->GetLogicalVolume()->GetSensitiveDetector() != 0) {
      return boost::make_tuple(volume, level);
    }
  }
  return boost::tuple<const G4VPhysicalVolume*, int>(0, 0);
}
static const G4AffineTransform& GetTransform ( const G4TouchableHistory *  touchable,
int  depth 
) [inline, static]

Definition at line 46 of file TrackingMaterialProducer.cc.

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

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

Definition at line 33 of file TrackingMaterialProducer.cc.

References mergeVDriftHistosByStation::name.

Referenced by ZdcSD::getFromLibrary(), HCalSD::getFromLibrary(), CastorSD::getFromLibrary(), HFShowerParam::getHits(), SteppingAction::killTrack(), and TrackingMaterialProducer::update().

                                                        {
  const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();

  for (G4LogicalVolumeStore::const_iterator volume = lvs->begin(); volume != lvs->end(); ++volume) {
    if ((const std::string&) (*volume)->GetName() == name)
      return (*volume);
  }

  return 0;
}