-
Notifications
You must be signed in to change notification settings - Fork 101
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
Help for beginners #703
Comments
Dear @saraheno,
The examples in the
However if you just want to showcase how things work you don't need to do this, simply take as a guide the
and a event display should open up (if you want good functionality of this you need to do this locally and not over
For this best use
to see all possible options do
If you want a custom stepping you can refer to this examples: https://github.com/iLCSoft/lcgeo/blob/master/plugins/TPCSDAction.cpp and this should be paired with proper configuration file like this one https://github.com/iLCSoft/lcgeo/blob/master/example/steeringFile.py#L19
There are several predefined actions in DD4hep to get users going so you don't necessarily need to write your own like ## set the default tracker action
SIM.action.tracker = "Geant4TrackerWeightedAction"
## set the default calorimeter action
SIM.action.calo = "Geant4ScintillatorCalorimeterAction" this should be a good starting point. If you use these you output file should have all the necessary information for further processing in most cases. Inspect the output file from the
not really, or maybe I don't get this question. As a bottom line, to get started firstly use the examples in |
Thanks, Unfortunately, I am still having problems with the build. that worked fine. As you can see, in these instructions, you make a "build" area in the DD4hep area. When I cd down into that build area, I see it did not pull over the "examples". So I copy this by hand I then try cd'ing down into this new examples area and doing the commands you list, including making a new build subdirectory in this new examples area. The full cmake command is I attach the dump showing the error during the compile below |
I think you need to first
before running cmake for the examples. Because at the moment the DD4hep from the LCG installation is found, which is quite a bit older.
For the examples the idea is to create a build folder in that directory. You can also build the examples along the rest of DD4hep by enabling in the main
|
Thanks. It did compile with these commands
But now I'm a bit confused about your example commands. You give two: but both of these look like I would run them from the DD4hep directory, not the DD4hep/examples/build area, because DDDetectors is only in DD4hep and not in DD4hep/examples/build. Also, I did look at SiD.xml with geodisplay and it is a pretty fancy detector. I was hoping "SimpleDetector" was something like the B4a example in GEANT? something truly simple? If I cd back into DD4hep/examples then I do see some xml files like ./SimpleDetector/compact/Simple_ILD.xml. But when I try to geodisplay this, it crashes with - No factory with name Create AirTube Is there a truly simple example I can study? |
For any of the commands it doesn't matter from which directory they are executed, as long as the relative path to the XML file is correct. The executables and libraries all have to be in the PATH or LD_LIBRARY_PATH. |
That's true, Andre. I guess this was a round about way of pointing out that the commands were not for the actual examples. Is there a simple example? If so, what is the corresponding xml file? |
also, when I look at the command to run a few particle gun events, it seems to be truncated? Should --part.userParticleHandler= have something after the equals sign? |
Just an empty string |
Thanks Andre. Will somebody else answer my question about the existence of a truly simple example? Not a full ILC detector? |
You have two options:
|
Thanks Mark and Andre. I hate to bother you with these beginning questions, but I cannot seem to find the right documentation. The geoDisplay is fun, and has lots of fun display options. But for some reason I cannot figure out how to zoom. When I put my mouse on the display screen, it is easy to rotate the detector. But ctrl-+ doesn't work for zooming and I cannot seem to find a zoom on the menu on the left. |
mouse scroll should work |
Thanks. This tool seems pretty good. When I do the run command:
I see hits in the siliconvertex detector when I look at testSid.root, but not in any of the other detector elements. Is this the expected behavior? |
Just wanted to check in again before I try to debug it. Should this example only produce hits (in testSid.root) for the barrel vertex detector? No hits in the barrel tracker and barrel calorimeter? Or am I still doing something wrong? |
The barrel calorimeters and trackers do not seem to work properly. The endcaps do record hits. |
Just for your information: I ran the standard SiD example:
for a couple of events and got hits in all subdetectors (endcaps and barrel). |
I shoot with uniform distribution. |
Using
I don't understand why this doesn't affect |
This limit kills the primary particle DD4hep/DDDetectors/compact/SiD.xml Line 47 in 0b8b89e
Still don't understand why this doesn't affect |
The difference is that in ddsim we activate the step limiters DD4hep/DDG4/python/DDSim/DD4hepSimulation.py Lines 478 to 481 in 0b8b89e
|
This means that somehow this region definition is incorrect... |
Yes, we should probably drop the |
…t to do See AIDASoft#703 The track length max kills particles with tracks longer than that
…t to do See AIDASoft#703 The track length max kills particles with tracks longer than that
…t to do See AIDASoft#703 The track length max kills particles with tracks longer than that
@saraheno DD4hep/DDDetectors/compact/SiD.xml Lines 47 to 48 in 0b8b89e
Are you still looking for a simple detector otherwise, or any other issue? |
…t to do See #703 The track length max kills particles with tracks longer than that
Sorry for not responding for some time. It was the first week of in person
classes here at U. Maryland, and I was swamped with teaching duties. I'll
try it with your suggested fix. My ultimate goal is to code in the
geometry from this paper: https://arxiv.org/abs/2008.00338 but obviously
since I am teaching faculty and my funding is only for CMS research, so I
have to personally do it instead of assigning it to a student or postdoc,
this will take many months and sometimes I'll drop it for a week or so as
teaching duties intervene.
…On Tue, Sep 15, 2020 at 11:51 AM Andre Sailer ***@***.***> wrote:
@saraheno <https://github.com/saraheno>
If you remove these lines you should get hits in all the sub-detectors
https://github.com/AIDASoft/DD4hep/blob/0b8b89eec2c2e7af8246047678c4e3e92d472654/DDDetectors/compact/SiD.xml#L47-L48
Are you still looking for a simple detector otherwise, or any other issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#703 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHZIOETWQXDRIL6SV2LTB3SF6EQ3ANCNFSM4RAM4WTQ>
.
|
nevermind. I have it figured out. |
I have been working to put some information I need for the dual readout into DDG4. In the "truth" "contrib, I wanted to add the particle beta, so I added and https://github.com/saraheno/DD4hep/blob/f08159b1e87239d4330e793cc82ddbca706d09de/DDG4/src/Geant4Data.cpp#L75 and I wanted to count scintillator photons so I added and (and some similar lines. I am having a hard time, though, figuring out how to get this into the root output file. I assume this is related to Geant4Output2root::fill. https://github.com/saraheno/DD4hep/blob/9d0302c83a6a5b3db112d8bf02f3616cde2d9658/DDG4/src/Geant4Output2ROOT.cpp#L90 But I do not see how/where the structure of the hit class is found by the code so it can store it properly... it seems to be storing the old information without the new data (because I guess somehow I need to tell root I added this data)? |
The minimum you need is a ROOT dictionary of your new class. This should be sufficient. However, I have one question: Why did you not consequently also add a new hit-class corresponding to the detector: |
Thanks Markus, I'll make the change you recommended for the hit class.
Where are the root dictionaries in the directory structure?
…On Wed, Oct 28, 2020 at 3:35 PM MarkusFrankATcernch < ***@***.***> wrote:
The minimum you need is a ROOT dictionary of your new class. This should
be sufficient.
ROOT knows the C++ typeid of the hit in the container from the type of the
first entry and looks for the
corresponding dictionary and uses the information of the dictionary to
save the data.
However, I have one question:
Why did you not consequently also add a new hit-class corresponding to the
detector:
typedef Geant4SensitiveAction Geant4DualCalorimeterAction;
like it was done for e.g. Geant4Calorimeter.
I am not a friend of "extending" existing classes for specialized
sensitive detector actions.
Sooner or later this kicks back.
If you add a merge request, please change this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#703 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHZIOA7OLVZXLFEYN4UFPDSNBXBLANCNFSM4RAM4WTQ>
.
|
You have to define the classes for which a dictionary is supposed to be generated in You can add your new class simply at line 103. Just copy the 4 lines of the Geant4Calorimeter, paste them below and change |
Hi Markus, I do not see more variables in the ntuple Any idea what I am doing wrong? |
Can you re-do the following commands:
|
try to first so that the dictionaries are present in the browser as well. |
Hi all, |
I first have to finish some stuff for CMS. I will afterwards have a look into the business into adding variables to hit classes. |
no rush. It is not like we will be building this detector soon.
…On Wed, Nov 4, 2020 at 8:24 AM MarkusFrankATcernch ***@***.***> wrote:
I first have to finish some stuff for CMS. I will afterwards have a look
into the business into adding variables to hit classes.
Sorry.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#703 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHZIOAUP4WFEZDAOUVOZZ3SOFIYXANCNFSM4RAM4WTQ>
.
|
We would be very happy if you would be willing to integrate the instructions for beginners into our webpage here https://dd4hep.web.cern.ch/dd4hep/page/beginners-guide/ To do this, you need to fork this repository https://gitlab.cern.ch/CLICdp/DetectorSoftware/DD4hep-website/ |
Hi Marko,
My tutorial contains many images. Do I create a folder in the "page" area
and put them in there? And I have to admit I'm not exactly sure what
language is used in the .md files... is it html? twiki? what kind of line
do I put in to point to an image?
…On Fri, Nov 6, 2020 at 5:17 AM Marko Petric ***@***.***> wrote:
We would be very happy if you would be willing to integrate the
instructions for beginners into our webpage here
https://dd4hep.web.cern.ch/dd4hep/page/beginners-guide/
To do this, you need to fork this repository
https://gitlab.cern.ch/CLICdp/DetectorSoftware/DD4hep-website/
and edit the file content/page/beginners-guide.md and then make a merge
request on gitlab.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#703 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHZIODXNICBQ4UQOPAFK2DSOPENLANCNFSM4RAM4WTQ>
.
|
You put the image under
and the location of this image in the repo is
The languge is called markdown, see here https://guides.github.com/features/mastering-markdown/ for examples. It's simpler then HTML and easier to type The only thing not mentioned in this is code highlighting
this is how to highligh And one more thing, markdown is the language that is used here on GitHub, any styling we have done in this issues thread is with markdown. |
when I look at existing files in this area, I see text like you described for including the figures, but that is the problem: I see this text, not the figures. for example in https://gitlab.cern.ch/eno/DD4hep-website/-/blob/master/content/page/showcases.md I see text for including figures, not figures? How do I get it to show correctly? |
The figures will only be visible once the webpage is converted to HTML with hugo, to do this:
|
I managed to install hugo, but when I run it, it does not seem to be correctly picking up the pictures. Can you see what is wrong with my .md file sytax? https://gitlab.cern.ch/eno/DD4hep-website/-/blob/master/content/page/beginners-guide.md |
so I wonder if the reason my extension to Geant4Calorimeter::Hit is ending up in the root output is due to this line DD4hep/DDG4/src/Geant4Output2ROOT.cpp Line 164 in 12b59d7
Here is it cast as a Geant4HitCollection DD4hep/DDG4/src/Geant4Output2ROOT.cpp Line 201 in 12b59d7
is the fill smart enough to do a cast to find out if it is a Geant4Tracker::Hit or a Geant4Calorimeter:Hit and store the appropriate data? Maybe I need different "saveCollections" for tracker and calorimeter if I want extended information in the calorimeter? |
The cast should be OK. Try this script (save a check_branch.C). Edit file- and branch names according to your data,
Then:
|
I don't think I can create a pull request for my fork of DD4hep-website at https://gitlab.cern.ch/eno/DD4hep-website because I do not have permission. However, people have already found my tutorial on this thread and are using it from my google doc version, so maybe it would be good if you guys somehow pulled it? |
@saraheno I just gave you the necessary permissions to create a PR in gitlab, I think |
Thanks. According to https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork I should see some icon to request the pull. but I do not see this (see screen shot below). I did restart my browser just in case that was the reason. Could this be because I made my fork before I had permissions? |
@saraheno Once merged, please have a look at
|
Hi all,
I am trying to use dd4hep to do some studies on a crystal dual readout calorimeter. I successfully followed the installation instructions at https://dd4hep.web.cern.ch/dd4hep/page/installation/ on my SLC6 machine, thanks to Andre's help. It compiled correctly.
I see that there is a folder called "examples" and in this an example called "SimpleDetector". This sounds great. I think I may have even copied all the examples over to the build area constructed in the previous step and maybe compiled them.
However, I now have no idea what to do. How can I
Also, when I look at DD4hepManual, I am a bit confused. When I run GEANT, I know how to add code in SteppingAction.cc etc to access the information created by GEANT. Do I use similar codes to access the information in this case? Are there specific names that should be used? When I look at the code in SimpleDetector, it looks mostly like geometry defining code.
I guess what I'm missing is exactly how to run this and get useful output. is run_sitracking_SimpleCLIC.xml related to this? If so, how do I use it?
Best
Sarah Eno
The text was updated successfully, but these errors were encountered: