-
Notifications
You must be signed in to change notification settings - Fork 27
Changes in run_simSND #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Will have to clean up the commited changes - most added files are not needed (used only in analysis and tests). |
|
@AnushkaDurg6 Could you explain what the purpose of this new option is? |
004a36b to
c282b7b
Compare
The purpose is to have the same muon profile in MC as we do in data. So we have to sample per muon entry in the input file. |
|
Thanks for the explanation! |
c282b7b to
362c680
Compare
shipLHC/run_simSND.py
Outdated
| parser.add_argument("--NagoyaEmu","--useNagoyaEmulsions",dest="useNagoyaEmulsions",help="use bricks of 57 Nagoya emulsion films instead of 60 Slavich", required=False,action="store_true") | ||
| parser.add_argument("-y", dest="year", help="specify the year to generate the respective TI18 detector setup", required=False, type=int, default=2024) | ||
|
|
||
| parser.add_argument("--dataProfile", dest="dataProfile", help="Path to the ROOT file with Ntuple data", required=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though of another name: "muonDataProfile"
and then help message like
"Path to the ROOT file with muon track data"
the uses dont need to be told in the help if it is ntuple inside that file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was about to comment on that as well. muonDataProfile is much more self-explanatory.
Additionally, required=False is redundant, as is dest, which defaults to the name of the long option.
shipLHC/run_simSND.py
Outdated
| print("The number of events is less than or equal to the number of enteries in the data profile") | ||
| for i in range(min(ntuple.GetEntries(),options.nEvents)): | ||
| ntuple.GetEntry(i) | ||
| # Extract x, y positions and slopes from the Ntuple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this comment be aligned to the rest?
shipLHC/run_simSND.py
Outdated
| primGen.AddGenerator(pgun) | ||
| else: | ||
| print("The number of events is more than the number of enteries in the data profile") | ||
| # Set the primary generator for the run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix the indentation of the this + the 2 lines below
these shall we executed one the loop over ntuple entries is done, but still inside the if dataProfile loop
shipLHC/run_simSND.py
Outdated
| z_plane = 250.0*u.cm | ||
| pgun = ROOT.FairBoxGenerator(13, 1) # Particle ID 13 for muons, charge is irrelevant | ||
| pgun.SetPRange(30,3500) # Set momentum | ||
| if(options.nEvents<=ntuple.GetEntries()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for such an if statement
we need a warning that `if (options.nEvents>ntuple.GetEntries() ): print("Number of events to simulate > number of sample muon tracks. ")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can talk in person about that if once other changes are done ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you! working on them now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe my confusion with the multiple particle guns is coming in again here, but if you just want the distribution to be the same, you should be able to keep sampling.
Also, per event, is every particle gun producing a muon every event?
362c680 to
3bb7925
Compare
|
Pro tip: force pushing makes it hard to review what changed between commits. If you use Thanks for the updates to to the CLI argument :) |
Test1 dataprofile
593dd56 to
ce2875d
Compare
Test1 dataprofile
Updated run_simSND to handle data profiles for muons as option for input