EventDisplayTutorial: Difference between revisions

From Mu2eWiki
Jump to navigation Jump to search
 
(33 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= REve/Mu2e Event Display =
= Mu2eEventDisplay =


== Introduction ==
== Introduction ==


The REve/Mu2e Event Display is useful for visualizing the data or MC you are analyzing.
The Mu2eEventDisplay is useful for visualizing the data or MC you are analyzing.


I have prepared two examples:
I have prepared two examples:
Line 12: Line 12:
== Before you start ==
== Before you start ==


You should have REve within the tutorial environment: muse backing Tutorial v01_00_00. If you are working on outside of the tutorial then you will need to clone and build the REve/Mu2e repo.
<!-- The first step of running the EventDisplay is to create a directory in which you will be working and setting it up correctly.  


The first step is to modify your .rootrc in the working directory to the commands listed in the REve/README.md. Choose a number that is not 1234 for the port number and set this in your .rootrc. This will be the port that you will use to access the display once it's running. If you want a unique number, use the last four or five digits of your FNAL badge.
=== Setting Up the Working Directory ===
To begin, ssh into the mu2egpvm in the standard way


When running REve you must be in the working directory.
ssh -AKX -Y username@mu2egpvm0Z.fnal.gov
 
where Z is the number of the gpvm (1, 2, 3,  ... etc). From here, navigate to the working app directory using
 
cd /exp/mu2e/app/users/<username> (if this does not exist, make it)
 
Then, we need to use the standard shell command to create your directory
 
mkdir workingDir
 
Following this command, move into the directory using
 
cd workingDir
 
Once inside the directory, initialize the mu2e working environment using
 
mu2einit
 
Now, we need to set up the .rootrc file inside the working directory so that we can run the EventDisplay correctly. The .rootrc file is typically in the home directory and holds the run commands for root. Creating it in this directory will allow us to have a specific setup when we start root in this directory. A quick way to edit the .rootrc file (or create, if it is not already created) is to run the command
 
vim .rootrc
 
Once this opens, enter insert mode by pressing the 'i' key and paste the following into the .rootrc
 
WebEve.DisableShow: 1
WebGui.HttpPort: 05678
WebEve.GLViewer: Three
 
and exit by hitting 'esc' followed by :wq to write and quit. If you want to work interactively on the mu2e machines (if you have a VNC, for instance) then change the '1' to a '0' in the first line. Change the port number by changing the 05678 to a 5 digit number of your choosing. If you wish it to be truly unique, you can use the last five digits of your badge.
 
Now that we have our .rootrc file, we need the repository for EventDisplay from Github. To clone this, use the command
 
git clone https://github.com/Mu2e/EventDisplay.git
 
so that we have access to all of the examples and structure already constructed. A quick ls -a command should show both the EventDisplay directory and the .rootrc file.
 
Now that we have these two components, we can begin accessing the EventDisplay.
Note: previous editions of
 
=== Remote Setup and Viewing of EventDisplay ===
 
If you are looking to access the event display remotely, i.e. using a browser rather than interactively in the terminal, you need to set up an ssh tunnel. To do so, open a new terminal window and input the following command
 
ssh -AKXY -L 05678:localhost:05678 <USER>@mu2egpvm0Z.fnal.gov
 
where the port number 05678 is replaced by your chosen port number, the <USER> is replaced with your username, and again Z is the number of gpvm that you are choosing to use. Another option is to write this command as
 
ssh -AKXY -L 05678:localhost:05678 -l <USER> mu2egpvm0Z.fnal.gov
 
which is simply a different setting for ssh-ing. Further, replacing 'localhost' with the ip 127.0.0.1 (the home ip) also yields the same results. From here, we navigate to our working directory again using the command


=== Making the Working Directory ===
cd /exp/mu2e/app/users/<USER>/workingDir
 
Once we have returned to the working directory, we can setup our environment using the following commands
 
mu2einit
muse setup Analysis
 
Note: other musings may be viable during this step, however, Analysis contains EventNtuple (v06_04_00), EventDisplay (v07_00_02), and Tutorial (v01_00_00) so it covers all the needed bases.  Now, to run the event display we need to use the command
 
mu2e -c controlFile.fcl dataFile.art
 
The specific .art files will depend on the data to be looked at. The example fcl file that will be used throughout this tutorial is
 
EventDisplay/examples/nominal_example.fcl
 
There are a variety of example fcl files that are in EventDisplay/examples/ which you should test out on your own. Alterations can be made to these fcl files to produce different results, however, for this tutorial, no alterations or knowledge of fcl is required.
 
Now that this command has been run, your EventDisplay will be created, with the tracks, events, and data presented depending on what dataset you are looking at. To access this EventDisplay remotely, open a clean browser window and input the following into the url box
 
localhost:05678/win1/
 
or,
 
127.0.0.1:05678/win1/
 
(where 05678 is again replaced by your port number of choice) and you should see in your browser the interactive EventDisplay window populate with a wide variety of options and images.
-->
 
You should have  Mu2eEventDisplay within the tutorial environment: muse backing Tutorial v03_00_00. If you are working on outside of the tutorial then you will need to clone and build the  Mu2eEventDisplay/Mu2e repo.
 
The first step is to modify your .rootrc in the working directory to the commands listed in the  Mu2eEventDisplay/README.md. Choose a number that is not 1234 for the port number and set this in your .rootrc. This will be the port that you will use to access the display once it's running. If you want a unique number, use the last four or five digits of your FNAL badge.
 
When running Mu2eEventDisplay you must be in the working directory. 
 
===Making the Working Directory ===


  ssh -AKX -Y username@mu2egpvm0Z.fnal.gov
  ssh -AKX -Y username@mu2egpvm0Z.fnal.gov
Line 24: Line 108:
Z = 1,2,3, etc.
Z = 1,2,3, etc.


cd /mu2e/app/users/<username> (if it doesn’t exist make it)
* cd /exp/mu2e/app/users/<username> (if it doesn’t exist make it)
mkdir Tutorial
* mkdir workingdir
cd Tutorial
* cd workingdir
source /cvmfs/fermilab.opensciencegrid.org/products/common/etc/setups
* mu2einit
setup mu2e
* muse backing SimJob (here you can choose which SimJob)
setup muse
* git clone git@github.com:Mu2e/EventDisplay.git
muse backing TutorialBacking v01_00_00
* muse setup
muse setup
* muse build -j4
ln -s backing/REve Reve
edit .rootrc


add these to your .rootrc


add these to your .rootrc
WebEve.DisableShow: 1
WebGui.HttpPort: 05678
WebEve.GLViewer: Three
 
 
If you want to work interactively on the mu2e machines (if you have a VNC for example) then change the "1" to "0" in the first line.
 
=== ssh tunnel for remote use ===
 
To access the view remotely, set up an ssh tunnel:
 
ssh -KXY -L 05678:localhost:05678 <USER>@mu2egpvm0Z.fnal.gov


WebEve.DisableShow:  1
replacing your username and the machine number you launched the display on.
WebGui.HttpPort:  1234
WebEve.GLViewer:  Three


== CeEndpoint ==
== CeEndpoint ==
Firstly you should start with a simple example of a mixed CeEndpoint signal.
Firstly you should start with a simple example of a mixed CeEndpoint signal.


Look at the helix_example.fcl. If you are familiar with Mu2e data products you will recognize the options you can display. Pretty much any RecoDataProduct from Mu2e/Offline can be visualized including:
Look at the nominal_example.fcl. If you are familiar with Mu2e data products you will recognize the options you can display. Pretty much any RecoDataProduct from Mu2e/Offline can be visualized including:


* ComboHits (panel hits)
* ComboHits (panel hits)
Line 59: Line 151:
* MCTrajectory
* MCTrajectory


Before deciding what to visualize you should familiarize yourself with whats in your .art file (using something like Offline/Print/fcl/dumpdataProducts.fcl). By default REve uses the "get Many" functionality in art which means it displays all of the above products if they are in the .art file.
Before deciding what to visualize you should familiarize yourself with whats in your .art file (using something like Offline/Print/fcl/dumpdataProducts.fcl). By default Mu2eEventDisplay uses the "get Many" functionality in art which means it displays all of the above products if they are in the .art file.


If you wish to only look at one product you can use the "specifyTag : true" option in your .fcl to select which specific tags you want to visualize e.g. for a downstream kinkal electron fit you may only want to look at "KalSeedCollection : ["KKDeM"]".
If you wish to only look at one product you can use the "specifyTag : true" option in your .fcl to select which specific tags you want to visualize e.g. for a downstream kinkal electron fit you may only want to look at "KalSeedCollection : ["KKDeM"]".
Line 86: Line 178:
Without altering the fcl run the following command:
Without altering the fcl run the following command:


  mu2e -c helix_example.fcl /pnfs/mu2e/tape/phy-sim/mcs/mu2e/CeEndpointMix1BBSignal/MDC2020z_best_v1_1/art/01/94/mcs.mu2e.CeEndpointMix1BBSignal.MDC2020z_best_v1_1.001210_00000787.art
  mu2e -c EventDisplay/examples/nominal_example.fcl /pnfs/mu2e/tape/phy-sim/mcs/mu2e/CeMLeadingLogOnSpillTriggered/MDC2020au_perfect_v1_3/art/00/38/mcs.mu2e.CeMLeadingLogOnSpillTriggered.MDC2020au_perfect_v1_3.001202_00001447.art


If you see and input/output error this might mean that the file needs to be prestaged: https://mu2ewiki.fnal.gov/wiki/Prestage
If you see and input/output error this might mean that the file needs to be prestaged: https://mu2ewiki.fnal.gov/wiki/Prestage


If run successfully you should see a series of print statements and a pause. There will be a list of geometry options with "1" indicating that option is set to "true."


If you are on the FNAL site, open a browser on your local machine and copy the URL (something like http://localhost:1234/win1/) change this to something like (http://mu2egpvm02.fnal.gov:1234/win1/).
You should see an image of the Conversion Signal. By default the MC trajectory, KalSeed and CaloClusters and CaloCrystals are shown).
 
If you are off-site you will need to set a ssh tunnel using a local browser on your laptop, something like:
 
ssh -KXY -L 1234:mu2egpvm01.fnal.gov:1234 user@mu2egpvm01.fnal.gov
 
change "1234" to the number you are given by ROOT, or that you chose in your .rootrc. Then something like http://localhost:1234/win1/ in the local browser should now display the event.
 
You should see an image of the CEEndpoint with pileup. By default the MC trajectory, KalSeed and CaloClusters and CaloCrystals are shown).


Hover over objects to find information about them. Use the "Next Event" to skip (do this slowly).
Hover over objects to find information about them. Use the "Next Event" to skip (do this slowly).
Line 109: Line 192:
You will have noticed that as well as the 3D view there are also a set of possible 2D views.
You will have noticed that as well as the 3D view there are also a set of possible 2D views.


The tracker XY and YZ are there first two.
The tracker XY and YZ are the first two.


Try going to these views by selecting "view" and "TrackerXY" and then "single".
Try going to these views by selecting "view" and "TrackerXY" and then "single".
Line 119: Line 202:
Kill the display as before
Kill the display as before


=== Task 1c: Go to a given event ===
=== Task 1c: Adding and Removing Geometry objects ===
 
Using the menu on the left, select Geometry Scenes, under here you will see a number of options, try unchecking and rechecking things and see how the geometry objects can be removed to aid visibility.
 


If could be that when doing an analysis you want to specifically view a given event e.g. Event : 8 Sub Run :787 Run :1210.
=== Task 1d: Go to a given event ===


To do this run the command line arguement again but add "-e 1210:787:8" meaning "-e run:subrun:event."
It could be that when doing an analysis you want to specifically view a given event e.g. Event : 8 Sub Run :787 Run :1210.
 
To do this run the command line argument again but add "-e 1210:787:8" meaning "-e run:subrun:event."


== Cosmics in the CRV ==
== Cosmics in the CRV ==


=== Task 2: events in the CRV ===
=== Task 2: events in the CRV ===
Now try again, this time edit the helix_example.fcl so CaloCluster : false (since the files we will use dont have crystals stored). Set addCRV : true
Now try again, this time edit the nominal_example.fcl so CaloCluster : false (since the files we will use dont have crystals stored). Set addCRV : true


Now run:
Now run:


mu2e -c helix_example.fcl /pnfs//mu2e/persistent/datasets/phy-sim/mcs/mu2e/CosmicCRYhiOnSpillSignal/MDC2020r_perfect_v1_0/art/a4/23/mcs.mu2e.CosmicCRYhiOnSpillSignal.MDC2020r_perfect_v1_0.001205_00000179.art  
  mu2e -c EventDisplay/examples/nominal_example.fcl /pnfs/mu2e/tape/phy-sim/mcs/mu2e/CosmicCORSIKAOnSpillSignal/MDC2020z2_best_v1_1/art/53/7b/mcs.mu2e.CosmicCORSIKAOnSpillSignal.MDC2020z2_best_v1_1.001202_00000300.art  
 


You should see straight cosmics coming into the CRV and producing tracks in the tracker.
You should see straight cosmics coming into the CRV and producing tracks in the tracker.
Line 150: Line 239:
Now try
Now try


mu2e -c extracted_example.fcl /pnfs/mu2e/scratch/users/brownd/workflow/default/outstage/3553474/00/00000/mcs.brownd.CosmicCRYExtractedCatDigiTrk.MDC2020z.001205_00000012.art -e 1205:12:1172
  mu2e -c EventDisplay/examples/nominal_example.fcl /pnfs/mu2e/tape/phy-sim/mcs/mu2e/CosmicCRYExtractedCatDigiTrk/MDC2020z/art/00/34/mcs.mu2e.CosmicCRYExtractedCatDigiTrk.MDC2020z.001205_00003665.art -e 1205:3665:163 


You are going directly to an interesting event.
You are going directly to an interesting event.

Latest revision as of 15:32, 2 June 2025

Mu2eEventDisplay

Introduction

The Mu2eEventDisplay is useful for visualizing the data or MC you are analyzing.

I have prepared two examples:

1) Visualize a CeEndpoint Mix sample 2) Visualize a Cosmic sample in Extracted mode

Before you start

You should have Mu2eEventDisplay within the tutorial environment: muse backing Tutorial v03_00_00. If you are working on outside of the tutorial then you will need to clone and build the Mu2eEventDisplay/Mu2e repo.

The first step is to modify your .rootrc in the working directory to the commands listed in the Mu2eEventDisplay/README.md. Choose a number that is not 1234 for the port number and set this in your .rootrc. This will be the port that you will use to access the display once it's running. If you want a unique number, use the last four or five digits of your FNAL badge.

When running Mu2eEventDisplay you must be in the working directory.

Making the Working Directory

ssh -AKX -Y username@mu2egpvm0Z.fnal.gov

Z = 1,2,3, etc.

  • cd /exp/mu2e/app/users/<username> (if it doesn’t exist make it)
  • mkdir workingdir
  • cd workingdir
  • mu2einit
  • muse backing SimJob (here you can choose which SimJob)
  • git clone git@github.com:Mu2e/EventDisplay.git
  • muse setup
  • muse build -j4

add these to your .rootrc

WebEve.DisableShow: 1
WebGui.HttpPort: 05678
WebEve.GLViewer: Three


If you want to work interactively on the mu2e machines (if you have a VNC for example) then change the "1" to "0" in the first line.

ssh tunnel for remote use

To access the view remotely, set up an ssh tunnel:
ssh -KXY -L 05678:localhost:05678 <USER>@mu2egpvm0Z.fnal.gov

replacing your username and the machine number you launched the display on.

CeEndpoint

Firstly you should start with a simple example of a mixed CeEndpoint signal.

Look at the nominal_example.fcl. If you are familiar with Mu2e data products you will recognize the options you can display. Pretty much any RecoDataProduct from Mu2e/Offline can be visualized including:

  • ComboHits (panel hits)
  • TrkStrawSeedHits (the hits used to make the track)
  • TimeCluster
  • Helix Seed (pattern recognition output for helix)
  • KalSeed (Kalman track)
  • CRVClusters and CRVRecoPulses
  • CaloClusters and CaloHits

We also include one MC truth option:

  • MCTrajectory

Before deciding what to visualize you should familiarize yourself with whats in your .art file (using something like Offline/Print/fcl/dumpdataProducts.fcl). By default Mu2eEventDisplay uses the "get Many" functionality in art which means it displays all of the above products if they are in the .art file.

If you wish to only look at one product you can use the "specifyTag : true" option in your .fcl to select which specific tags you want to visualize e.g. for a downstream kinkal electron fit you may only want to look at "KalSeedCollection : ["KKDeM"]".

For the purpose of the tutorial, we will use the default configuration.

There is also a set of "geom options" that decide what parts of the Mu2e geometry are shown. By default you will see the following:

  • IPA and OPA (inner and outer proton absorbers) - the most interesting feature is the conical shape of the OPA
  • Stopping target - you will notice the foil structure and can zoom in close to see a given foil. The target is not visible in extracted mode.
  • Tracker planes - individual straws can be displayed using the "strawdisplay : true" option
  • Calorimeter disk and crystals

There are then several optional geometry objects:

  • CRV - the cosmic ray veto system
  • PS and TS and DS - the magnets
  • Production Target
  • STM

The latter two need further development.


Task 1a: View all products

Without altering the fcl run the following command:

mu2e -c EventDisplay/examples/nominal_example.fcl /pnfs/mu2e/tape/phy-sim/mcs/mu2e/CeMLeadingLogOnSpillTriggered/MDC2020au_perfect_v1_3/art/00/38/mcs.mu2e.CeMLeadingLogOnSpillTriggered.MDC2020au_perfect_v1_3.001202_00001447.art

If you see and input/output error this might mean that the file needs to be prestaged: https://mu2ewiki.fnal.gov/wiki/Prestage


You should see an image of the Conversion Signal. By default the MC trajectory, KalSeed and CaloClusters and CaloCrystals are shown).

Hover over objects to find information about them. Use the "Next Event" to skip (do this slowly).

Once finished select the "Quit" button to exit and close out the browser and kill the job on the mu2e machines.

Task 1b: Try a different view

You will have noticed that as well as the 3D view there are also a set of possible 2D views.

The tracker XY and YZ are the first two.

Try going to these views by selecting "view" and "TrackerXY" and then "single".

You should now see an enlarged view of the Tracker XY plane.

To go back to 3D use the back arrows.

Kill the display as before

Task 1c: Adding and Removing Geometry objects

Using the menu on the left, select Geometry Scenes, under here you will see a number of options, try unchecking and rechecking things and see how the geometry objects can be removed to aid visibility.


Task 1d: Go to a given event

It could be that when doing an analysis you want to specifically view a given event e.g. Event : 8 Sub Run :787 Run :1210.

To do this run the command line argument again but add "-e 1210:787:8" meaning "-e run:subrun:event."

Cosmics in the CRV

Task 2: events in the CRV

Now try again, this time edit the nominal_example.fcl so CaloCluster : false (since the files we will use dont have crystals stored). Set addCRV : true

Now run:

 mu2e -c EventDisplay/examples/nominal_example.fcl /pnfs/mu2e/tape/phy-sim/mcs/mu2e/CosmicCORSIKAOnSpillSignal/MDC2020z2_best_v1_1/art/53/7b/mcs.mu2e.CosmicCORSIKAOnSpillSignal.MDC2020z2_best_v1_1.001202_00000300.art 


You should see straight cosmics coming into the CRV and producing tracks in the tracker.

Move slowly through the events, zoom in and "go inside" the CRV for a clearer look.

When you are ready "Quit." You can try setting addCRV : false and re-running, this gives a clearer view of the tracker.

Extracted Cosmics

During the first commissioning we will view cosmic muons in an extracted positon. Here the Calo and Tracker are outside the solenoids and a few sections of the CRV are placed above.

Task 3: Viewing extracted cosmics

Extracted mode means the tracker and calorimeter are outside the solenoid. We want to visualize straight cosmics in this mode. Look at extracted_example.fcl you will notice that the "addCRV" option is now "true" thats because you will want to see cosmic bar hits in this event.

Now try

 mu2e -c EventDisplay/examples/nominal_example.fcl /pnfs/mu2e/tape/phy-sim/mcs/mu2e/CosmicCRYExtractedCatDigiTrk/MDC2020z/art/00/34/mcs.mu2e.CosmicCRYExtractedCatDigiTrk.MDC2020z.001205_00003665.art -e 1205:3665:163  

You are going directly to an interesting event.

You will notice a few things:

  • MCTrjectory line for straight mu + or mu -
  • Magenta "dots" - these are KalInteresections
  • KalSeed based on Kinematic Line (underneath the MCTraj)

Once you see an event with bars highlighted these are CRV bars which have received CRVClusters.

You can try "Quitting" once you see that event.

Try setting MCTraj : false in the extracted_example.fcl and rerun. You are now looking more clearly at a reconstructed Kalman track known as a Kinematic Line fit in KinKal. These types of through going cosmics are excellent tools for alignment and calibration.