src
SimG4Core
HelpfulWatchers
src
SimTracer.h
Go to the documentation of this file.
1
#ifndef HelpfulWatchers_SimTracer_h
2
#define HelpfulWatchers_SimTracer_h
3
// -*- C++ -*-
4
//
5
// Package: HelpfulWatchers
6
// Class : SimTracer
7
//
16
//
17
// Original Author:
18
// Created: Tue Nov 22 16:41:33 EST 2005
19
//
20
21
// system include files
22
#include <iostream>
23
24
// user include files
25
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
26
#include "G4Step.hh"
27
#include "
SimG4Core/Notification/interface/Observer.h
"
28
#include "
SimG4Core/Watcher/interface/SimWatcher.h
"
29
30
// forward declarations
31
class
DDDWorld
;
32
class
BeginOfJob
;
33
class
BeginOfRun
;
34
class
BeginOfEvent
;
35
class
BeginOfTrack
;
36
class
G4Step;
37
38
class
EndOfRun
;
39
class
EndOfEvent
;
40
class
EndOfTrack
;
41
42
#define OBSERVES(type) \
43
public \
44
Observer<const type *>
45
#define UPDATE(type) \
46
void update(const type *) override { std::cout << "++ signal " #type << std::endl; }
47
class
SimTracer
:
public
SimWatcher
,
48
OBSERVES
(DDDWorld),
49
OBSERVES
(BeginOfJob),
50
OBSERVES
(BeginOfRun),
51
OBSERVES
(BeginOfEvent),
52
OBSERVES
(BeginOfTrack),
53
OBSERVES
(G4Step),
54
OBSERVES
(EndOfRun),
55
OBSERVES
(EndOfEvent),
56
OBSERVES
(EndOfTrack) {
57
public
:
58
SimTracer
(
const
edm::ParameterSet
&pSet) :
m_verbose
(pSet.getUntrackedParameter<
bool
>(
"verbose"
,
false
)) {}
59
// virtual ~SimTracer();
60
61
// ---------- const member functions ---------------------
62
63
// ---------- static member functions --------------------
64
65
// ---------- member functions ---------------------------
66
UPDATE
(
DDDWorld
)
67
UPDATE
(
BeginOfJob
)
68
UPDATE
(
BeginOfRun
)
69
UPDATE
(
BeginOfEvent
)
70
UPDATE
(
BeginOfTrack
)
71
void
update
(
const
G4Step *iStep)
override
{
72
std::cout
<<
"++ signal G4Step "
;
73
if
(
m_verbose
) {
74
const
G4StepPoint *
post
= iStep->GetPostStepPoint();
75
const
G4ThreeVector &
pos
=
post
->GetPosition();
76
std::cout
<<
"( "
<<
pos
.x() <<
","
<<
pos
.y() <<
","
<<
pos
.z() <<
") "
;
77
if
(
post
->GetPhysicalVolume()) {
78
std::cout
<<
post
->GetPhysicalVolume()->GetName();
79
}
80
}
81
std::cout
<< std::endl;
82
}
83
// UPDATE(G4Step)
84
UPDATE
(
EndOfRun
)
85
UPDATE
(
EndOfEvent
)
86
UPDATE
(
EndOfTrack
)
87
88
private:
89
// SimTracer(const SimTracer&); // stop default
90
91
// const SimTracer& operator=(const SimTracer&); // stop default
92
93
// ---------- member data --------------------------------
94
bool
m_verbose
;
95
};
96
97
#endif
EndOfRun
Definition:
EndOfRun.h:6
funct::false
false
Definition:
Factorize.h:29
EndOfEvent
Definition:
EndOfEvent.h:6
OBSERVES
#define OBSERVES(type)
Definition:
SimTracer.h:42
Observer.h
BeginOfTrack
Definition:
BeginOfTrack.h:6
BeginOfJob
Definition:
BeginOfJob.h:8
SimTracer::update
void update(const DDDWorld *) override
This routine will be called when the appropriate signal arrives.
Definition:
SimTracer.h:66
ParameterSet.h
EndOfTrack
Definition:
EndOfTrack.h:6
SimWatcher
Definition:
SimWatcher.h:27
SimTracer::SimTracer
SimTracer(const edm::ParameterSet &pSet)
Definition:
SimTracer.h:58
BeginOfRun
Definition:
BeginOfRun.h:6
findAndChange.post
post
Definition:
findAndChange.py:75
SimTracer
Definition:
SimTracer.h:47
DDDWorld
Definition:
DDDWorld.h:14
SimTracer::m_verbose
bool m_verbose
Definition:
SimTracer.h:94
UPDATE
#define UPDATE(type)
Definition:
SimTracer.h:45
pos
Definition:
PixelCalibBase.h:13
BeginOfEvent
Definition:
BeginOfEvent.h:6
nano_mu_local_reco_cff.bool
bool
Definition:
nano_mu_local_reco_cff.py:14
Options.const
const
Definition:
Options.py:396
SimWatcher.h
edm::ParameterSet
Definition:
ParameterSet.h:48
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
Generated for CMSSW Reference Manual by
1.8.14