Skip to content

Commit

Permalink
Merge pull request #273 from sophiemiddleton/RPC
Browse files Browse the repository at this point in the history
Rpc
  • Loading branch information
kutschke authored Nov 6, 2020
2 parents 1a2b184 + 2c63b04 commit ae7c2e4
Show file tree
Hide file tree
Showing 11 changed files with 775 additions and 4 deletions.
22 changes: 19 additions & 3 deletions EventGenerator/src/StoppedParticleReactionGun_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ namespace mu2e {
TH1F* _hGenId;
TH1F* _hTime;
TH1F* _hZ;

TTree* _Ntup;
Float_t _TMom;
Float_t _Tx;
Float_t _Ty;
Float_t _Tz;
Int_t _nEv = 0;
private:
static SpectrumVar parseSpectrumVar(const std::string& name);
double generateEnergy();
Expand Down Expand Up @@ -136,7 +141,12 @@ namespace mu2e {
_hPdgId = tfs->make<TH1F>("hPdgId" , "PDG ID" , 500, -250, 250);
_hTime = tfs->make<TH1F>("hTime" , "Time" , 400, 0.0, 2000.);
_hZ = tfs->make<TH1F>("hZ" , "Z" , 500, 5400, 6400);

_Ntup = tfs->make<TTree>("GenTree", "GenTree");
_Ntup->Branch("nEv", &_nEv , "_nEv/I");
_Ntup->Branch("TMom", &_TMom , "TMom/F");
_Ntup->Branch("Tx", &_Tx, "Tx/F");
_Ntup->Branch("Ty", &_Ty, "Ty/F");
_Ntup->Branch("Tz", &_Tz, "Tz/F");
}
}

Expand All @@ -161,7 +171,7 @@ namespace mu2e {

const double energy = generateEnergy();
const double p = energy * sqrt(1 - std::pow(mass_/energy,2));

CLHEP::Hep3Vector p3 = randomUnitSphere_.fire(p);
CLHEP::HepLorentzVector fourmom(p3, energy);
output->emplace_back(pdgId_,
Expand All @@ -180,7 +190,13 @@ namespace mu2e {
_hEnergy->Fill(energy);
_hTime->Fill(stop.t);
_hZ->Fill(pos.z());
_TMom = p;
_Tx = pos.x();
_Ty = pos.y();
_Tz = pos.z();
}
_Ntup->Fill();
_nEv++;
}

//-----------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions JobConfig/beam/DS.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,6 @@ physics.producers.g4run.physics.minRangeCut : 0.010 // mm
// Initialze seeding of random engines: do not put these lines in base .fcl files for grid jobs.
services.SeedService.baseSeed : 8
services.SeedService.maxUniqueEngines : 20
services.GeometryService.simulatedDetector.tool_type : "Mu2e"
services.scheduler.wantSummary: true
services.TimeTracker.printSummary: true
6 changes: 5 additions & 1 deletion JobConfig/beam/TS.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,8 @@ outputs: {
}

physics.producers.g4run.physics.minRangeCut : 1. // mm

services.SeedService.baseSeed : 8
services.SeedService.maxUniqueEngines : 20
services.GeometryService.simulatedDetector.tool_type : "Mu2e"
services.scheduler.wantSummary: true
services.TimeTracker.printSummary: true
146 changes: 146 additions & 0 deletions JobConfig/pions/PionsStage1_2020.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
// Andrei Gaponenko, 2013
// Jake Colston & Joseph Brock, 2015 (edit for cd3)

#include "fcl/minimalMessageService.fcl"
#include "fcl/standardProducers.fcl"
#include "fcl/standardServices.fcl"

BEGIN_PROLOG

// Energy cuts on electron, positron, photon, and neutron.
CutEPPhN : {
type : intersection
pars : [ { type: kineticEnergy cut: 100.0 },
{ type: pdgId pars: [ 11, -11, 22, 2112 ] } ]
}

END_PROLOG

# Give this job a name.
process_name : pionsg4s1

source : {
module_type : EmptyEvent
//maxEvents : 1000000
}

services : {
message : @local::default_message
TFileService : { fileName : "nts.owner.pions-g4s1.version.sequencer.root" }
RandomNumberGenerator : {defaultEngineKind: "MixMaxRng"}
GeometryService : { inputFile : "JobConfig/common/geom_baseline.txt" }

ConditionsService : { conditionsfile : "Mu2eG4/test/conditions_01.txt" }
GlobalConstantsService : { inputFile : "Mu2eG4/test/globalConstants_01.txt" }
G4Helper : {}
SeedService : @local::automaticSeeds
}

physics : {

producers : {

generate: @local::PrimaryProtonGun

genCounter : { module_type : GenEventCounter }

g4run : {

module_type : Mu2eG4
physics : @local::mu2eg4DefaultPhysics
ResourceLimits : @local::mu2eg4DefaultResourceLimits
TrajectoryControl : @local::mu2eg4NoTrajectories
debug : @local::mu2eg4DefaultDebug
visualization : @local::mu2eg4NoVisualization

generatorModuleLabel : generate

SDConfig : {
enableSD : [ virtualdetector ] // activate just the explicitly listed SDs
TimeVD : { times : [] }
}

// Mu2eG4 cuts are evaluated in the listed order.
// The first match wins. For the "intersection"
// type, the first false stops the evaluation.
// For the "union" type the first true stops the evaluation.
Mu2eG4StackingOnlyCut : @local::mu2eg4CutNeutrinos
Mu2eG4SteppingOnlyCut : @local::mu2eg4NoCut
Mu2eG4CommonCut : {
type : union
pars : [
@local::CutEPPhN,
{ type: inVolume pars: [ HallAir ] },
{
type : inVolume
pars : [ TS3Vacuum, TS4Vacuum, TS5Vacuum, DS1Vacuum, DS2Vacuum, DS3Vacuum ]
write : vacuuas1
}
]
}
} // g4run

compressPV : {
module_type : CompressPhysicalVolumes
volumesInput : "g4run"
hitInputs : []
particleInputs : [ "g4filter" ]
}
} // producers

analyzers : {

genCountLogger : { module_type : GenEventCountReader }

collectionSizes : {
module_type : CollectionSizeAnalyzer
userModuleLabel : true
useInstanceName : true
useProcessName : false
}
} // analyzers

filters : {
g4filter : {
module_type : FilterG4Out
mainHitInputs : [ "g4run:vacuuas1" ]
extraHitInputs : [ "g4run:virtualdetector" ]
vetoDaughters : []
}
} // filters

trigFilter : [ generate, genCounter, g4run, g4filter, compressPV ]
trigger_paths : [ trigFilter ]

e1 : [ filteredOutput ]
end_paths : [ e1 ]
} // physics

outputs : {
filteredOutput : {
module_type : RootOutput
SelectEvents : ["trigFilter"]
outputCommands : [ "drop *_*_*_*",
"keep mu2e::GenParticles_*_*_*",
"keep mu2e::GenEventCount_*_*_*",
"keep mu2e::StatusG4_*_*_*",
"keep *_g4filter_*_*",
"keep *_compressPV_*_*" ]
fileName : "sim.owner.pions-g4s1.version.sequencer.art"
}
}

physics.producers.g4run.physics.minRangeCut : 1.0 // mm
physics.producers.g4run.physics.noDecay : [ 211, -211 ]

// Limit the rate of "Begin processing the ... record" messages
services.message.destinations.log.categories.ArtReport.reportEvery : 1
services.message.destinations.log.categories.ArtReport.limit : 1
services.message.destinations.log.categories.ArtReport.timespan : 300

// Initialze seeding of random engines: do not put these lines in base .fcl files for grid jobs.
services.SeedService.baseSeed : 8
services.SeedService.maxUniqueEngines : 20
services.GeometryService.simulatedDetector.tool_type : "Mu2e"
services.scheduler.wantSummary: true
services.TimeTracker.printSummary: true
160 changes: 160 additions & 0 deletions JobConfig/pions/PionsStage2_2020.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
// Andrei Gaponenko, 2013
// Jake Colston & Joseph Brock, 2015 (edit for cd3)

#include "fcl/minimalMessageService.fcl"
#include "fcl/standardProducers.fcl"
#include "fcl/standardServices.fcl"

BEGIN_PROLOG

// Energy cuts on electron, positron, photon, and neutron.
CutEPPhN : {
type : intersection
pars : [ { type: kineticEnergy cut: 100.0 },
{ type: pdgId pars: [ 11, -11, 22, 2112 ] } ]
}

END_PROLOG

# Give this job a name.
process_name : pionsg4s2

source : {
module_type : RootInput
maxEvents : 1000000000
}

services : {
message : @local::default_message
TFileService : { fileName : "nts.owner.pions-g4s2.version.sequencer.root" }
RandomNumberGenerator : {defaultEngineKind: "MixMaxRng"}
GeometryService : { inputFile : "JobConfig/common/geom_baseline.txt" }

ConditionsService : { conditionsfile : "Mu2eG4/test/conditions_01.txt" }
GlobalConstantsService : { inputFile : "Mu2eG4/test/globalConstants_01.txt" }
G4Helper : {}
SeedService : @local::automaticSeeds
}

physics : {

producers : {

g4run : {

module_type : Mu2eG4
physics : @local::mu2eg4DefaultPhysics
ResourceLimits : @local::mu2eg4DefaultResourceLimits
TrajectoryControl : @local::mu2eg4NoTrajectories
debug : @local::mu2eg4DefaultDebug
visualization : @local::mu2eg4NoVisualization

MultiStageParameters : {
simParticleNumberOffset : 100000 // safe b/c of g4.particlesSizeLimit in stage1
genInputHits : [ "g4filter:vacuuas1" ]
inputSimParticles : "g4filter"
inputMCTrajectories : ""
inputPhysVolumeMultiInfo : "compressPV"
}

//doWriteLegacyPhysVolumeInfo : false

SDConfig : {
enableSD : [ virtualdetector ] // activate just the explicitly listed SDs
preSimulatedHits : ["g4filter:virtualdetector"]
TimeVD : { times : [] }
}

// Mu2eG4 cuts are evaluated in the listed order.
// The first match wins. For the "intersection"
// type, the first false stops the evaluation.
// For the "union" type the first true stops the evaluation.
Mu2eG4StackingOnlyCut : @local::mu2eg4CutNeutrinos
Mu2eG4SteppingOnlyCut : @local::mu2eg4NoCut
Mu2eG4CommonCut : {
type : union
pars : [
@local::CutEPPhN,
{ type: inVolume pars: [ HallAir ] },
{
type : inVolume
pars : [ DS1Vacuum, DS2Vacuum, DS3Vacuum ]
write : vacuuas2
}
]
}

SimParticlePrinter : {
enabled : false
primariesOnly : false
prefix : "SimParticle : "
}
} // g4run

vacuuas1: {
module_type: StepPointMCCollectionUpdater
remapping: g4run
inputs: [ "g4filter:vacuuas1:pionsg4s1" ]
outInstanceName: "vacuuas1"
}

compressPV : {
module_type : CompressPhysicalVolumes
volumesInput : "g4run"
hitInputs : []
particleInputs : [ "g4filter" ]
}
} // producers

analyzers : {
genCountLogger : {
module_type : GenEventCountReader
}
} // analyzers

filters : {
g4filter : {
module_type : FilterG4Out
mainHitInputs : [ "g4run:vacuuas2" ]
extraHitInputs : [ "g4run:virtualdetector", "vacuuas1:vacuuas1" ]
vetoDaughters : []
}
} // filters


trigFilter : [ g4run, vacuuas1, g4filter, compressPV ]
trigger_paths : [ trigFilter ]

e1 : [ filteredOutput, genCountLogger ]
end_paths : [ e1 ]
} // physics

outputs : {
filteredOutput : {
module_type : RootOutput
SelectEvents : ["trigFilter"]
outputCommands : [ "drop *_*_*_*",
"keep mu2e::GenParticles_*_*_*",
"keep mu2e::GenEventCount_*_*_*",
"keep mu2e::StatusG4_*_*_*",
"keep *_g4filter_*_pionsg4s2",
"keep *_compressPV_*_pionsg4s2" ]
fileName : "sim.owner.pions-g4s2.version.sequencer.art"
}
}



physics.producers.g4run.physics.minRangeCut : 1.0 // mm
physics.producers.g4run.physics.noDecay : [ 211, -211 ]

// Limit the rate of "Begin processing the ... record" messages
services.message.destinations.log.categories.ArtReport.reportEvery : 1
services.message.destinations.log.categories.ArtReport.limit : 1
services.message.destinations.log.categories.ArtReport.timespan : 300

// Initialze seeding of random engines: do not put these lines in base .fcl files for grid jobs.
services.SeedService.baseSeed : 8
services.SeedService.maxUniqueEngines : 20
services.GeometryService.simulatedDetector.tool_type : "Mu2e"
services.scheduler.wantSummary: true
Loading

0 comments on commit ae7c2e4

Please sign in to comment.