Project

General

Profile

Feature #15119

Allow configuration of the method used to calculate eve IDs in the BackTracker service

Added by Steven Gardiner over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
01/12/2017
Due date:
% Done:

0%

Estimated time:
Experiment:
LArSoft
Co-Assignees:
Duration:

Description

Currently, the BackTracker service unconditionally uses a sim::EmEveIdCalculator to determine the track IDs of the primary particles. The sim::EmEveIdCalculator returns the track ID of the first particle in the family tree that was not created by a list of hard-coded EM process names:

int EmEveIdCalculator::DoCalculateEveId( const int trackID )
{
  // Almost any eve ID calculation will use this: Get the entire
  // history of the particle and its ancestors in the simulated
  // event. (m_particleList is defined in EveIdCalculator.h)
  const sim::ParticleHistory particleHistory( m_particleList, trackID );

  ... // (comments)

  for(auto i = particleHistory.rbegin(); i != particleHistory.rend(); ++i){
    // Get the text string that describes the process that created
    // the particle.
    std::string process = (*i)->Process();

    // Skip it if it was created by pair production, compton
    // scattering, photoelectric effect, bremstrahlung,
    // annihilation, or any ionization. (The ultimate source of
    // the process names are the physics lists used in Geant4.)

    if ( process.find("conv")              != std::string::npos ||
         process.find("LowEnConversion")   != std::string::npos ||
         process.find("Pair")              != std::string::npos ||
         process.find("compt")             != std::string::npos ||
         process.find("Compt")             != std::string::npos ||
         process.find("Brem")              != std::string::npos ||
         process.find("phot")              != std::string::npos ||
         process.find("Photo")             != std::string::npos ||
         process.find("Ion")               != std::string::npos ||
         process.find("annihil")           != std::string::npos) continue;

    // If we get here, the particle wasn't created by any of the
    // above processes. Return its ID.
    return (*i)->TrackId();
  }

  // If we get here, we've skipped every particle in the
  // chain. Perhaps it was empty.
  return 0;
}

On the other hand, the base class sim::EveIdCalculator returns the earliest ancestor available, which presumably was created by the event generator:

int EveIdCalculator::DoCalculateEveId( const int trackID )
{
  // This is the default eve ID calculation method. It gets called
  // if the user doesn't override it with their own method.

  // Almost any eve ID calculation will use this: Get the entire
  // history of the particle and its ancestors in the simulated
  // event.
  ParticleHistory particleHistory( m_particleList, trackID );

  if ( particleHistory.empty() ){
    // Something went wrong; most likely the track ID isn't
    // present in the event.
    return 0;
  }

  // Return the primary particle from the event generator associated
  // with this track ID.
  const simb::MCParticle* particle = particleHistory[0];
  return particle->TrackId();
}

It would be useful if there were a FHiCL parameter for the BackTracker service that would allow the user to choose which of these methods should be used. Depending on the analysis task for which the BackTracker is being used, one or the other may be more appropriate.


Related issues

Related to LArSoft - Feature #15120: Allow configuration of the method used to calculate eve IDs in the PhotonBackTracker serviceClosed01/12/2017

History

#1 Updated by Steven Gardiner over 3 years ago

  • Related to Feature #15120: Allow configuration of the method used to calculate eve IDs in the PhotonBackTracker service added

#2 Updated by Lynn Garren over 3 years ago

  • Status changed from New to Feedback

Steve, do you propose to do this work yourself? Also, would you present this at the next coordination meeting?

#3 Updated by Jason Stock over 3 years ago

  • Assignee set to Jason Stock

#4 Updated by Jason Stock over 3 years ago

Steven and I have been in contact about this issue, but it hasn't really presented itself as urgent yet so it keeps getting put on the back burner for more immediate fires. I would like to address the issue by making a configurable flag in the fcl file to determine which eveid calculator is used. This would be especially useful for users looking to backtrack to specific physics instead of trying to backtrack to the ultimate mother particle. The solution implimented for backtracker should be the same as the solution implemented for photonbacktracker.

#5 Updated by Jason Stock over 3 years ago

  • Assignee deleted (Jason Stock)

#6 Updated by Jason Stock over 3 years ago

I set the assignee on the wrong issue. I meant to assign myself for this issue to the PhotonBackTracker ticket. Once we have a solution for PhotonBackTracker I will run it by the developers to see if we can implement it for both.

#7 Updated by Katherine Lato over 2 years ago

  • Status changed from Feedback to Assigned
  • Assignee set to Jason Stock

#8 Updated by Jason Stock over 2 years ago

  • Status changed from Assigned to Closed

The use of the EveID calculator has been removed from the BackTracker with the adition of the ParticleInventoryService. I am marking this issue as closed since the ParticleInventoryService does allow the user to determine which EveID calculator they wish to use. The PhotonBackTracker still needs to be re factored to depend on the ParticleInventorySerivice, but the ability to set an EveIDCalculator is no longer a PhotonBackTracker/BackTracker problem.



Also available in: Atom PDF