Project

General

Profile

CCInclusive

This wiki page describes how to run the numu CC inclusive event selection and how to use the output.

This selection only works on the production branch (it is not supported on develop)
and it has been tested and benchmarked with uboonecode version v06_26_01_22 (MCC8.17).
If you are running the selection, use uboonecode v06_26_01_22. If you are analysing the output,
then you can use the uboonecode version that you like.

Note that previous supported version was v06_26_01_13, but this version should not be used anymore
as we have improved the selection in MCC8.17.

For questions, you can ask in the Slack channel "cc_inclusive", or contact .

To run, just use the following fcl files, depending on the sample you want to run over:
  • run_ubxsec_mc_bnbcosmic.fcl to run over MC BNB+Cosmic files
  • run_ubxsec_data_bnbon.fcl to run over data BNBON files
  • run_ubxsec_data_extbnb.fcl to run over data EXTBNB files

FHiCL files are located in uboone/UBXSec/jobs/

Note that this module works with MCC8 reco2 art root files provided as input.

Example:

// Get the list of the latest MC files (produced with MCC8.7, 
// see https://microboone-exp.fnal.gov/at_work/AnalysisTools/index.html)

samweb list-files "defname:prodgenie_bnb_nu_cosmic_uboone_mcc8.7_reco2_dev" 
> File listing

// Taking one files as an example we can look at its path

samweb locate-file prodgenie_bnb_nu_cosmic_uboone_0_20170329T103646_gen2_674e0c86-3a1c-434b-a75e-56b1d8c72598_20171225T002527_reco1_20171225T010922_reco2_20180208T101035_cali.root
> enstore:/pnfs/uboone/mc/uboone/reconstructed/prod_v06_26_07/prodgenie_bnb_nu_cosmic_uboone_reco/reco(943@iau074)

// Now we can run the event selection over this file

lar -c run_ubxsec_mc_bnbcosmic.fcl -s /pnfs/uboone/mc/uboone/reconstructed/prod_v06_26_07/prodgenie_bnb_nu_cosmic_uboone_reco/reco/prodgenie_bnb_nu_cosmic_uboone_0_20170329T103646_gen2_674e0c86-3a1c-434b-a75e-56b1d8c72598_20171225T002527_reco1_20171225T010922_reco2_20180208T101035_cali.root -n 1

The output will be another art-root file, but now with extension _ubxsec.
This file only contains the selected events.

If you run lar -c eventdump.fcl -s thefile_ubxsec.root on the output file,
you will see that there are many new data products with name UBXSec.

The CCInclusive event selection will run a cosmic removal (similar but improved
w.r.t. to the standard removal already present in the MCC8 files) using
pandoraCosmic reconstruction, and will then run pandoraNu using
only the hits that survived the removal. The pandoraNu~ objects produced
are: @recob::PFParticle
, recob::Track and recob::Shower.
If you want to use those in the analysis, remember to specify pandoraNu::UBXSec
in the input tag, otherwise you may be taking the standard MCC8 objects.
You can always check what data products are available by running eventdump.fcl.

The UBXSec module will also produce other data products. It will create TPCObjects,
which basically represent one reconstructed object: a TPCObject can be one cosmic track
with its delta rays, or a neutrino-induced muon track together with other proton tracks
coming out from the neutrino interaction. UBXSec will also produce a FlashMatch data product
and will associate it to every TPCObject.

At the end, the event section is run and a data product called ubana::SelectionResult
is placed into the art::Event.

How to read the CCInclusive Results from an analysis module

Let's assume you have a file where the CCInclusive filter has already been run.
The file already contains selected events, but you still need to grab the selected
muon track, as well as the tracks that are part of the same interaction.

All in one go

Your analysis module will run over the CCInclusive filtered files.
In the analyze method of your analyser, add the following code to get
the muon candidate track and the candidate neutrino vertex.
This code is explained step by step in the next section.

art::Handle<std::vector<ubana::SelectionResult> > selection_h;
e.getByLabel("UBXSec", selection_h);
if(!selection_h.isValid()){
  mf::LogError(__PRETTY_FUNCTION__) << "SelectionResult product not found." << std::endl;
  throw cet::exception();
}
std::vector<art::Ptr<ubana::SelectionResult>> selection_v;
art::fill_ptr_vector(selection_v, selection_h);
// The selection result vector will always only contain one entry (at least 1 neutrino per event)
if (selection_v.at(0)->GetSelectionStatus()) {

  // Get the selected TPCObject
  art::FindManyP<ubana::TPCObject> tpcobject_from_selection(selection_h, e, "UBXSec"); 
  art::Ptr<ubana::TPCObject> tpcobj_candidate = tpcobject_from_selection.at(0).at(0);

  // Get the TPCObject handler
  art::Handle<std::vector<ubana::TPCObject>> tpcobj_h;
  e.getByLabel("TPCObjectMaker", tpcobj_h);

  // Get the tracks associated to the selected TPCObject
  art::FindManyP<recob::Track> tracks_from_tpcobject(tpcobj_h, e, "TPCObjectMaker");
  std::vector<art::Ptr<recob::Track>> tracks = tracks_from_tpcobject.at(tpcobj_candidate.key());

  // Get the vertex associated with the TPCObject
  art::FindManyP<recob::Vertex> vertices_from_tpcobject(tpcobj_h, e, "TPCObjectMaker");
  std::vector<art::Ptr<recob::Vertex>> vertices = vertices_from_tpcobject.at(tpcobj_candidate.key());
  art::Ptr<recob::Vertex> neutrino_candidate_vertex = vertices.at(0);

  // The longest track in "tracks" is the muon candidate
  // "neutrino_candidate_vertex" is the candidate neutrino vertex

} else { 

  // Event is not selected, return
  return;
}

Explained

In your analysis module, you want to grab the ubana::SelectionResult data product.
You can check is the event is selected or not (should always been selected if the CCInclusive
module was run as a filter). You can do:

art::Handle<std::vector<ubana::SelectionResult> > selection_h;
e.getByLabel("UBXSec", selection_h);
if(!selection_h.isValid()){
  mf::LogError(__PRETTY_FUNCTION__) << "SelectionResult product not found." << std::endl;
  throw cet::exception();
}
std::vector<art::Ptr<ubana::SelectionResult>> selection_v;
art::fill_ptr_vector(selection_v, selection_h);
// The selection result vector will always only contain one entry (at least 1 neutrino per event)
if (selection_v.at(0)->GetSelectionStatus()) {

  // Event is selected, do stuff

} else {

  // Event is not selected, return
  return;
}

If the event is not selected, you can get the reason why the selection failed by doing

std::string failure_reason = selection_v.at(0)->GetFailureReason();
std::cout << "This event did not pass the " << failure_reason << " cut." << std::endl;

If the event is selected, you can then get the associated TPCObject, that represent the candidate neutrino interaction, by doing:

art::FindManyP<ubana::TPCObject> tpcobject_from_selection(selection_h, e, "UBXSec");
art::Ptr<ubana::TPCObject> tpcobj_candidate = tpcobject_from_selection.at(0).at(0);

from which you can get things like the neutrino reconstructed vertex, the PFParticle multiplicity, the true origin (if MC file), and others (see [here](https://marcodeltutto.github.io/UBXSec/documentation/html/classubana_1_1TPCObject.html)).

If you then want the reconstructed objects, you can easily get them by using their association with the TPCObject.
First get the TPCObject handler:

art::Handle<std::vector<ubana::TPCObject>> tpcobj_h;
e.getByLabel("TPCObjectMaker", tpcobj_h);

Then you can get the tracks:

art::FindManyP<recob::Track> tracks_from_tpcobject(tpcobj_h, e, "TPCObjectMaker");
std::vector<art::Ptr<recob::Track>> tracks = tracks_from_tpcobject.at(tpcobj_candidate.key());

and the vertex:

art::FindManyP<recob::Vertex> vertices_from_tpcobject(tpcobj_h, e, "TPCObjectMaker");
std::vector<art::Ptr<recob::Vertex>> vertices = vertices_from_tpcobject(tpcobj_candidate.key());
art::Ptr<recob::Vertex> neutrino_candidate_vertex = vertices.at(0);

and the PFParticles:

art::FindManyP<recob::PFParticle> pfps_from_tpcobject(tpcobj_h, e, "TPCObjectMaker");
std::vector<art::Ptr<recob::PFParticle>> pfps = pfps_from_tpcobject.at(tpcobj_candidate.key());

What are the files to use

For data, both beam-on and beam-off, cc-inclusive filter files are already available,
and they correspond to Run1 data (approximately 1.6e20 POT).
The SAM definitions for these files are listed on this AnalysisTools webpage.
Look for the definitions that have "ccinclusive" and "v15" in the name.
In particular, you probably want to use the two definitions that end with goodruns2_v4s, and goodruns2_v5s.
goodruns2 means these definition only contain files in the official good run list, v4 or v5 means that
the files were produces with swizzler version 4 or 5, and "s" means that that is a snapshot, so the files
in the definition will not change.

For MC, unfortunately no files have been produced, and will have to produce your own.
You can refer to the instructions at the top of this page. An example of xml file
is also available in uboonecode
This xml file is just an example, make sure to write the right uboonecode version and input definition before running.