12 #include "G4Region.hh" 13 #include "G4RegionStore.hh" 14 #include "G4LogicalVolumeStore.hh" 15 #include "G4ProductionCuts.hh" 16 #include "G4ProcessTable.hh" 17 #include "G4ProcessManager.hh" 18 #include "G4MuonMinus.hh" 21 #include "G4PhysicalConstants.hh" 22 #include "G4SystemOfUnits.hh" 23 #include "G4VProcess.hh" 24 #include "G4VParticleChange.hh" 37 produces<float>(
"DBremEventWeight");
38 produces<float>(
"DBremLocationX");
39 produces<float>(
"DBremLocationY");
40 produces<float>(
"DBremLocationZ");
42 produces<float>(
"DBremAngle");
43 produces<float>(
"DBremInitialEnergy");
44 produces<float>(
"DBremFinalEnergy");
45 produces<float>(
"BiasFactor");
47 edm::LogInfo(
"DBremWatcher") <<
"DBremWatcher:: Save Sim Track if PDG code " 48 <<
"is one from the list of " << pdgs_.size() <<
" items";
49 for (
unsigned int k = 0;
k < pdgs_.size(); ++
k)
56 G4Track* theTrack = (G4Track*)((*trk)());
59 int pdg = theTrack->GetDefinition()->GetPDGEncoding();
60 G4ThreeVector Vpos = theTrack->GetVertexPosition();
61 const G4VProcess* TrPro = theTrack->GetCreatorProcess();
62 if (TrPro !=
nullptr) {
63 if ((theTrack->GetCreatorProcess()->GetProcessName()) ==
"muDBrem") {
67 if (!theTrack->IsGoodForTracking()) {
68 theTrack->SetGoodForTrackingFlag(
true);
70 f_energy = theTrack->GetTotalEnergy();
83 LogDebug(
"DBremWatcher") <<
"Save SimTrack the Track " << theTrack->GetTrackID() <<
" Type " 84 << theTrack->GetDefinition()->GetParticleName() <<
" Momentum " 85 << theTrack->GetMomentum() /
MeV <<
" MeV/c";
93 G4String
pname =
"muDBrem";
94 G4ProcessTable* ptable = G4ProcessTable::GetProcessTable();
96 ptable->SetProcessActivation(pname, state);
103 G4Track* theTrack = (G4Track*)((*trk)());
105 const G4VProcess* TrPro = theTrack->GetCreatorProcess();
106 if (trkInfo && TrPro !=
nullptr) {
107 int pdg = theTrack->GetDefinition()->GetPDGEncoding();
110 (theTrack->GetCreatorProcess()->GetProcessName()) ==
"muDBrem") {
118 std::unique_ptr<float>
weight = std::make_unique<float>(
m_weight);
120 std::unique_ptr<float> vtxposx = std::make_unique<float>(
VertexPos.x());
121 std::unique_ptr<float> vtxposy = std::make_unique<float>(
VertexPos.y());
122 std::unique_ptr<float> vtxposz = std::make_unique<float>(
VertexPos.z());
126 std::unique_ptr<float> finalE = std::make_unique<float>(
f_energy /
GeV);
128 float deflectionAngle = -1;
131 G4ThreeVector mother(
133 deflectionAngle = mother.angle(
finaltraj);
134 std::unique_ptr<float> dAngle = std::make_unique<float>(deflectionAngle);
135 std::unique_ptr<float> initialE = std::make_unique<float>(initialEnergy /
GeV);
138 std::unique_ptr<float> bias = std::make_unique<float>(
biasFactor);
141 std::unique_ptr<float>
weight = std::make_unique<float>(0.);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_SIMWATCHER(type)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
DBremWatcher(edm::ParameterSet const &p)
void produce(edm::Event &, const edm::EventSetup &) override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Class providing the Dark Bremsstrahlung process class.
void update(const BeginOfTrack *trk) override
This routine will be called when the appropriate signal arrives.
Power< A, B >::type pow(const A &a, const B &b)