Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
// $Id: SimTracer.h,v 1.2 2005/12/08 21:37:49 chrjones Exp $
20
//
21
22
// system include files
23
#include <iostream>
24
25
// user include files
26
#include "
SimG4Core/Notification/interface/Observer.h
"
27
#include "
SimG4Core/Watcher/interface/SimWatcher.h
"
28
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
29
#include "G4Step.hh"
30
31
// forward declarations
32
class
DDDWorld
;
33
class
BeginOfJob
;
34
class
BeginOfRun
;
35
class
BeginOfEvent
;
36
class
BeginOfTrack
;
37
class
G4Step;
38
39
class
EndOfRun
;
40
class
EndOfEvent
;
41
class
EndOfTrack
;
42
43
#define OBSERVES(type) public Observer<const type*>
44
#define UPDATE(type) void update(const type*) { std::cout <<"++ signal " #type<<std::endl; }
45
class
SimTracer
:
public
SimWatcher
,
46
OBSERVES
(DDDWorld),
47
OBSERVES
(BeginOfJob),
48
OBSERVES
(BeginOfRun),
49
OBSERVES
(BeginOfEvent),
50
OBSERVES
(BeginOfTrack),
51
OBSERVES
(G4Step),
52
OBSERVES
(EndOfRun),
53
OBSERVES
(EndOfEvent),
54
OBSERVES
(EndOfTrack)
55
{
56
57
public
:
58
SimTracer
(
const
edm::ParameterSet
& pSet) :
59
m_verbose
(pSet.getUntrackedParameter<bool>(
"verbose"
,
false
)) {
60
}
61
//virtual ~SimTracer();
62
63
// ---------- const member functions ---------------------
64
65
// ---------- static member functions --------------------
66
67
// ---------- member functions ---------------------------
68
UPDATE
(
DDDWorld
)
69
UPDATE
(
BeginOfJob
)
70
UPDATE
(
BeginOfRun
)
71
UPDATE
(
BeginOfEvent
)
72
UPDATE
(
BeginOfTrack
)
73
void
update
(
const
G4Step* iStep) {
74
std::cout
<<
"++ signal G4Step "
;
75
if
(
m_verbose
) {
76
const
G4StepPoint* post = iStep->GetPostStepPoint();
77
const
G4ThreeVector
pos
= post->GetPosition();
78
std::cout
<<
"( "
<<pos.x()<<
","
<<pos.y()<<
","
<<pos.z()<<
") "
;
79
if
(post->GetPhysicalVolume()) {
80
std::cout
<< post->GetPhysicalVolume()->GetName();
81
}
82
}
83
std::cout
<<std::endl;
84
}
85
//UPDATE(G4Step)
86
UPDATE
(
EndOfRun
)
87
UPDATE
(
EndOfEvent
)
88
UPDATE
(
EndOfTrack
)
89
90
private
:
91
//SimTracer(const SimTracer&); // stop default
92
93
//const SimTracer& operator=(const SimTracer&); // stop default
94
95
// ---------- member data --------------------------------
96
bool
m_verbose
;
97
};
98
99
100
#endif
pos
Definition:
Histograms.cc:18
EndOfRun
Definition:
EndOfRun.h:6
funct::false
false
Definition:
Factorize.h:34
EndOfEvent
Definition:
EndOfEvent.h:6
OBSERVES
#define OBSERVES(type)
Definition:
SimTracer.h:43
Observer.h
BeginOfTrack
Definition:
BeginOfTrack.h:6
BeginOfJob
Definition:
BeginOfJob.h:8
ParameterSet.h
EndOfTrack
Definition:
EndOfTrack.h:6
SimWatcher
Definition:
SimWatcher.h:33
SimTracer::SimTracer
SimTracer(const edm::ParameterSet &pSet)
Definition:
SimTracer.h:58
BeginOfRun
Definition:
BeginOfRun.h:6
SimTracer
Definition:
SimTracer.h:45
DDDWorld
Definition:
DDDWorld.h:10
SimTracer::m_verbose
bool m_verbose
Definition:
SimTracer.h:96
UPDATE
#define UPDATE(type)
Definition:
SimTracer.h:44
BeginOfEvent
Definition:
BeginOfEvent.h:6
compareJSON.const
string const
Definition:
compareJSON.py:14
SimTracer::update
void update(const G4Step *iStep)
Definition:
SimTracer.h:73
private
#define private
Definition:
FWFileEntry.h:18
SimWatcher.h
edm::ParameterSet
Definition:
ParameterSet.h:35
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
Generated for CMSSW Reference Manual by
1.8.5