Project

General

Profile

Feature #12602

Add a compact representation for the plane ID, TPC ID and cryostat ID

Added by Gianluca Petrillo over 3 years ago. Updated almost 2 years ago.

Status:
Accepted
Priority:
Low
Assignee:
-
Category:
Geometry
Target version:
Start date:
05/11/2016
Due date:
% Done:

0%

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

Description

Given the regularity of the cryostat/TPC/plane (CTP) pattern, it makes sense to provide a compact representation of such, that can be used as a key for an array.
Wire ID is explicitly excluded because of the different number of wires in different planes.


Related issues

Related to LArSoft - Idea #12785: review typedef cryo_tpc_view_hitmapAccepted2016-05-26

History

#1 Updated by Gianluca Petrillo over 3 years ago

LArSoft geometry already provides sortable structures to represent these detector components: geo::CryostatID, geo::TPCID and geo::PlaneID. They are not compact and their representation is independent of the actual geometry.

In the following I'll refer to the new objects as CryostatIndex_t, TPCIndex_t and PlaneIndex_t, although if they are implemented as structures a less typedef-like name is better suited.
Suggested requirements for these new indices:

  • designed to be used as std::vector index:
    • compact: lowest value 0, ideally all values correspond to an actual detector component
    • convertible to size_t with no overhead: does not need actual conversion to be used with std::vector::operator[]
    • not needed to be human-readable
  • related to the corresponding geometry ID
    • conversions to and from geo::CryostatID, geo::TPCID and geo::PlaneID provided by geo::GeometryCore service provider
  • related to each other:
    • strongly typed: no implicit conversions from a index type to another
    • construction: each index can be constructed from another via geo::GeomertyCore methods
    • wrapping: each index can be directly constructed from a size_t value, with no boundary check required and no need of geo::GeometryCore
  • provides increment and decrement operators, again with no boundary check required and no need of geo::GeometryCore
Optional features:
  • transparent conversion to size_t
  • navigation via geo::Geometry to non-bottom level (e.g., increment a plane index by one TPC, or point to the first plane of the next TPC)

It's important to realize that each non-trivial use does require access to geometry information.

The implementation that I envision contains a size_t value as (public?) data member:

  • the value in CryostatIndex_t be simply the cryostat number
  • the value in TPCIndex_t be Cryostat * MaxTPCs + TPC
  • the value in PlaneIndex_t be TPCIndex * MaxPlanes + Plane

Note that it is in principle possible for different cryostats to have different number of TPCs.
If we want the index to be completely compact, the content should instead be:

  • the value in CryostatIndex_t be simply the cryostat number
  • the value in TPCIndex_t be Cryostat * NTPCsBefore(Cryostat) + TPC
  • the value in PlaneIndex_t be TPCIndex * NPlanesBefore(TPCIndex) + Plane

The translation is more complicate, and the NXxxBefore() functions need to be implemented (as opposed to the MaxXxx methods that are already present). There would be a small cost in performance, provided that for example NPlanesBefore() relies on a look-up table (in fact, it might be a std::vector<PlaneIndex_t> indiced via TPCIndex).

#2 Updated by Gianluca Petrillo over 3 years ago

  • Related to Idea #12785: review typedef cryo_tpc_view_hitmap added

#3 Updated by Katherine Lato almost 3 years ago

  • Status changed from New to Accepted
  • Priority changed from Normal to Low
  • Target version set to 2017-2-quarter

While this should be done, it's currently lower priority than other work scheduled.

#4 Updated by Katherine Lato over 2 years ago

  • Target version changed from 2017-2-quarter to 2017-4-quarter

#5 Updated by Katherine Lato almost 2 years ago

  • Target version changed from 2017-4-quarter to 2019-1-quarter


Also available in: Atom PDF