Skip to content

Commit

Permalink
add upper bound for jf17.
Browse files Browse the repository at this point in the history
  • Loading branch information
Micael Verissimo de Araujo committed Jul 3, 2024
1 parent 04206bb commit 4dc7ee5
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 18 deletions.
26 changes: 15 additions & 11 deletions core/GaugiKernel/scripts/prun_evts.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

import sys,os
if len(sys.argv)==1:
parser.print_help()
sys.exit(1)
parser.print_help()
sys.exit(1)

args = parser.parse_args()

Expand All @@ -57,18 +57,22 @@
inputs = list(chunks(inputs, args.novPerJob))

def func(event_numbers, outputfile):
seed = str(args.seed+event_numbers[0])
nov = str(len(event_numbers))
offset = str(event_numbers[0])
command = args.command
command = command.replace('%OFFSET' , offset)
command+= f' -s {seed} -o {outputfile} --nov {nov}'
command = command.replace(' ', ' ') # remove double spaces
return command
seed = str(args.seed+event_numbers[0])
nov = str(len(event_numbers))
offset = str(event_numbers[0])
output = args.output
command = args.command
command = command.replace('%OFFSET' , offset)
command = command.replace('%SEED' , seed)
command = command.replace('%NOV' , nov)
command = command.replace('%OUT' , outputfile)
#command+= f' -s {seed} -o {outputfile} --nov {int(nov)}'
command = command.replace(' ', ' ') # remove double spaces
return command



prun = Pool( func, inputs, args.numberOfThreads, os.path.abspath(args.output), args.dry_run )
prun.run()
if args.merge:
prun.merge()
prun.merge()
2 changes: 2 additions & 0 deletions generator/filters/python/JF17.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def __init__( self, name, gen,
EtaMax : float=1.4,
EtaMin : float=0.0,
MinPt : float=0.0,
MaxPt : float=0.0,
Select : int=2,
OutputLevel : int=0,
EtaWindow : float=0.4,
Expand All @@ -21,6 +22,7 @@ def __init__( self, name, gen,
self.setProperty( "EtaMax" , EtaMax )
self.setProperty( "EtaMin" , EtaMin )
self.setProperty( "MinPt" , MinPt )
self.setProperty( "MaxPt" , MaxPt )
self.setProperty( "Select" , Select )
#self.setProperty( "OutputLevel" , OutputLevel )
self.setProperty( "EtaWindow" , EtaWindow )
Expand Down
7 changes: 4 additions & 3 deletions generator/filters/src/JF17.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ JF17::JF17(const std::string name , IGenerator *gen):
{
declareProperty( "EtaMax" , m_etaMax=1.4 );
declareProperty( "EtaMin" , m_etaMin=0 );
declareProperty( "MinPt" , m_minPt=0.0 );
declareProperty( "MinPt" , m_minPt=0.0 );
declareProperty( "MaxPt" , m_maxPt=0.0 );
declareProperty( "Select" , m_select=2 );
declareProperty( "EtaWindow" , m_etaWindow=0.4 );
declareProperty( "PhiWindow" , m_phiWindow=0.4 );
Expand Down Expand Up @@ -80,6 +81,7 @@ StatusCode JF17::execute( generator::Event &ctx )
auto inclusive_jets = sorted_by_pt( clust_seq.inclusive_jets() );

const float minPt=m_minPt/1.e3;
const float maxPt=m_maxPt/1.e3;
const float etaMax=m_etaMax;
const float etaMin=m_etaMin;
inclusive_jets.erase(std::remove_if(inclusive_jets.begin(),
Expand Down Expand Up @@ -124,10 +126,9 @@ StatusCode JF17::execute( generator::Event &ctx )
}
}


// If the total cluster energy is higher than the cut, than we
// can include these particles to the jet cluster vector
if (etot > minPt){
if ((etot > minPt) && (etot < maxPt)){


auto seed = generator::Seed( main_p->momentum().eta(), main_p->momentum().phi() );
Expand Down
1 change: 1 addition & 0 deletions generator/filters/src/JF17.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace generator{

int m_select;
float m_minPt;
float m_maxPt;
float m_etaMax;
float m_etaMin;
float m_etaWindow;
Expand Down
8 changes: 6 additions & 2 deletions generator/scripts/gen_jets.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@
help = "Maximum eta coordinate")

parser.add_argument('--minEta', action='store', dest='minEta', required = False, type=float, default=0,
help = "Maximum eta coordinate")
help = "Minimum eta coordinate")

parser.add_argument('--energy_min', action='store', dest='energy_min', required = False, type=float, default=17,
help = "Maximum eta coordinate")
help = "Minimum energy")

parser.add_argument('--energy_max', action='store', dest='energy_max', required = False, type=float, default=13000,
help = "Maximum energy")


if len(sys.argv)==1:
Expand Down Expand Up @@ -96,6 +99,7 @@
EtaMax = args.maxEta,
EtaMin = args.minEta,
MinPt = args.energy_min*GeV,
MaxPt = args.energy_max*GeV,
Select = 2,
EtaWindow = 0.4,
PhiWindow = 0.4,
Expand Down
7 changes: 5 additions & 2 deletions generator/scripts/gen_zee.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
parser.add_argument('-o','--outputFile', action='store', dest='outputFile', required = True,
help = "The event file generated by pythia.")

parser.add_argument('--eta_max', action='store', dest='eta_max', required = False, type=float, default=3.2,
help = "The eta max used in generator.")

#
# Pileup simulation arguments
#
Expand Down Expand Up @@ -93,7 +96,7 @@
File=main_file,
Seed=args.seed,
EventNumber = args.eventNumber),
EtaMax = 3.2,
EtaMax = args.eta_max,
MinPt = 15*GeV,
ZeroVertexParticles = args.zeroVertexParticles, #calibration use only.
ForceForwardElectron = args.forceForwardElectron,
Expand All @@ -108,7 +111,7 @@
from filters import Pileup
pileup = Pileup("Pileup",
Pythia8("MBGenerator", File=mb_file, Seed=args.seed),
EtaMax = 3.2,
EtaMax = args.eta_max,
Select = 2,
PileupAvg = args.pileupAvg,
PileupSigma = args.pileupSigma,
Expand Down

0 comments on commit 4dc7ee5

Please sign in to comment.