CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MaterialBudgetHcal Class Reference

#include <MaterialBudgetHcal.h>

Inheritance diagram for MaterialBudgetHcal:
SimWatcher Observer< const BeginOfJob * > Observer< const BeginOfTrack * > Observer< const G4Step * > Observer< const EndOfTrack * >

Public Member Functions

 MaterialBudgetHcal (const edm::ParameterSet &)
 
 MaterialBudgetHcal (const MaterialBudgetHcal &)=delete
 
const MaterialBudgetHcaloperator= (const MaterialBudgetHcal &)=delete
 
 ~MaterialBudgetHcal () override
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfJob * >
 Observer ()
 
void slotForUpdate (const BeginOfJob * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfTrack * >
 Observer ()
 
void slotForUpdate (const BeginOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const G4Step * >
 Observer ()
 
void slotForUpdate (const G4Step * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfTrack * >
 Observer ()
 
void slotForUpdate (const EndOfTrack * iT)
 
virtual ~Observer ()
 

Private Member Functions

bool stopAfter (const G4Step *)
 
void update (const BeginOfJob *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfTrack *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

double rMax
 
MaterialBudgetCastorHistostheHistoCastor
 
MaterialBudgetHcalHistostheHistoHcal
 
double zMax
 

Additional Inherited Members

Detailed Description

Definition at line 18 of file MaterialBudgetHcal.h.

Constructor & Destructor Documentation

◆ MaterialBudgetHcal() [1/2]

MaterialBudgetHcal::MaterialBudgetHcal ( const edm::ParameterSet p)

Definition at line 20 of file MaterialBudgetHcal.cc.

20  : theHistoHcal(nullptr), theHistoCastor(nullptr) {
21  edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("MaterialBudgetHcal");
22  rMax = m_p.getUntrackedParameter<double>("RMax", 4.5) * CLHEP::m;
23  zMax = m_p.getUntrackedParameter<double>("ZMax", 13.0) * CLHEP::m;
24  bool doHcal = m_p.getUntrackedParameter<bool>("DoHCAL", true);
25  edm::LogVerbatim("MaterialBudget") << "MaterialBudgetHcal initialized with rMax " << rMax << " mm and zMax " << zMax
26  << " mm doHcal is set to " << doHcal;
27  if (doHcal)
29  else
31 }

References edm::ParameterSet::getUntrackedParameter(), visualization-live-secondInstance_cfg::m, AlCaHLTBitMon_ParallelJobs::p, rMax, theHistoCastor, theHistoHcal, and zMax.

◆ MaterialBudgetHcal() [2/2]

MaterialBudgetHcal::MaterialBudgetHcal ( const MaterialBudgetHcal )
delete

◆ ~MaterialBudgetHcal()

MaterialBudgetHcal::~MaterialBudgetHcal ( )
override

Definition at line 33 of file MaterialBudgetHcal.cc.

33  {
34  if (theHistoHcal)
35  delete theHistoHcal;
36  if (theHistoCastor)
37  delete theHistoCastor;
38 }

References theHistoCastor, and theHistoHcal.

Member Function Documentation

◆ operator=()

const MaterialBudgetHcal& MaterialBudgetHcal::operator= ( const MaterialBudgetHcal )
delete

◆ stopAfter()

bool MaterialBudgetHcal::stopAfter ( const G4Step *  aStep)
private

Definition at line 78 of file MaterialBudgetHcal.cc.

78  {
79  G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
80  double rr = hitPoint.perp();
81  double zz = std::abs(hitPoint.z());
82 
83  if (rr > rMax || zz > zMax) {
84  edm::LogVerbatim("MaterialBudget") << " MaterialBudgetHcal::StopAfter R = " << rr << " and Z = " << zz;
85  return true;
86  } else {
87  return false;
88  }
89 }

References funct::abs(), rMax, findQualityFiles::rr, zMax, and geometryCSVtoXML::zz.

Referenced by update().

◆ update() [1/4]

void MaterialBudgetHcal::update ( const BeginOfJob )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 40 of file MaterialBudgetHcal.cc.

40  {
41  //----- Check that selected volumes are indeed part of the geometry
42  // Numbering From DDD
44  (*job)()->get<IdealGeometryRecord>().get(pDD);
45  if (theHistoHcal)
46  theHistoHcal->fillBeginJob((*pDD));
47 }

References MaterialBudgetHcalHistos::fillBeginJob(), and theHistoHcal.

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), and MatrixUtil.Steps::overwrite().

◆ update() [2/4]

void MaterialBudgetHcal::update ( const BeginOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 49 of file MaterialBudgetHcal.cc.

49  {
50  const G4Track* aTrack = (*trk)(); // recover G4 pointer if wanted
51  if (theHistoHcal)
53  if (theHistoCastor)
55 }

References MaterialBudgetCastorHistos::fillStartTrack(), MaterialBudgetHcalHistos::fillStartTrack(), theHistoCastor, and theHistoHcal.

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), and MatrixUtil.Steps::overwrite().

◆ update() [3/4]

void MaterialBudgetHcal::update ( const EndOfTrack )
overrideprivatevirtual

◆ update() [4/4]

void MaterialBudgetHcal::update ( const G4Step *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 57 of file MaterialBudgetHcal.cc.

57  {
58  //---------- each step
59  if (theHistoHcal)
60  theHistoHcal->fillPerStep(aStep);
61  if (theHistoCastor)
63 
64  //----- Stop tracking after selected position
65  if (stopAfter(aStep)) {
66  G4Track* track = aStep->GetTrack();
67  track->SetTrackStatus(fStopAndKill);
68  }
69 }

References MaterialBudgetCastorHistos::fillPerStep(), MaterialBudgetHcalHistos::fillPerStep(), stopAfter(), theHistoCastor, theHistoHcal, and HLT_2018_cff::track.

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), and MatrixUtil.Steps::overwrite().

Member Data Documentation

◆ rMax

double MaterialBudgetHcal::rMax
private

Definition at line 40 of file MaterialBudgetHcal.h.

Referenced by MaterialBudgetHcal(), and stopAfter().

◆ theHistoCastor

MaterialBudgetCastorHistos* MaterialBudgetHcal::theHistoCastor
private

Definition at line 39 of file MaterialBudgetHcal.h.

Referenced by MaterialBudgetHcal(), update(), and ~MaterialBudgetHcal().

◆ theHistoHcal

MaterialBudgetHcalHistos* MaterialBudgetHcal::theHistoHcal
private

Definition at line 38 of file MaterialBudgetHcal.h.

Referenced by MaterialBudgetHcal(), update(), and ~MaterialBudgetHcal().

◆ zMax

double MaterialBudgetHcal::zMax
private

Definition at line 40 of file MaterialBudgetHcal.h.

Referenced by MaterialBudgetHcal(), and stopAfter().

geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MaterialBudgetHcalHistos::fillPerStep
void fillPerStep(const G4Step *)
Definition: MaterialBudgetHcalHistos.cc:108
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
MaterialBudgetCastorHistos::fillPerStep
void fillPerStep(const G4Step *)
Definition: MaterialBudgetCastorHistos.cc:64
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
MaterialBudgetHcal::zMax
double zMax
Definition: MaterialBudgetHcal.h:40
MaterialBudgetHcal::theHistoCastor
MaterialBudgetCastorHistos * theHistoCastor
Definition: MaterialBudgetHcal.h:39
edm::ParameterSet
Definition: ParameterSet.h:36
MaterialBudgetCastorHistos::fillEndTrack
void fillEndTrack()
Definition: MaterialBudgetCastorHistos.cc:151
edm::LogVerbatim
Definition: MessageLogger.h:297
MaterialBudgetHcal::theHistoHcal
MaterialBudgetHcalHistos * theHistoHcal
Definition: MaterialBudgetHcal.h:38
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
MaterialBudgetCastorHistos::fillStartTrack
void fillStartTrack(const G4Track *)
Definition: MaterialBudgetCastorHistos.cc:38
MaterialBudgetHcal::rMax
double rMax
Definition: MaterialBudgetHcal.h:40
MaterialBudgetCastorHistos
Definition: MaterialBudgetCastorHistos.h:17
MaterialBudgetHcalHistos::fillEndTrack
void fillEndTrack()
Definition: MaterialBudgetHcalHistos.cc:231
MaterialBudgetHcalHistos::fillStartTrack
void fillStartTrack(const G4Track *)
Definition: MaterialBudgetHcalHistos.cc:81
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
MaterialBudgetHcal::stopAfter
bool stopAfter(const G4Step *)
Definition: MaterialBudgetHcal.cc:78
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MaterialBudgetHcalHistos
Definition: MaterialBudgetHcalHistos.h:19
MaterialBudgetHcalHistos::fillBeginJob
void fillBeginJob(const DDCompactView &)
Definition: MaterialBudgetHcalHistos.cc:35