LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TrajectoryPointFlags.tcc
Go to the documentation of this file.
1 /**
2  * @file TrajectoryPointFlags.tcc
3  * @brief Set of flags pertaining a point of the track.
4  * @authors Giuseppe Cerati (cerati@fnal.gov),
5  * Gianluca Petrillo (petrillo@fnal.gov)
6  * @date January 18, 2017
7  * @see TrajectoryPointFlags.h
8  *
9  */
10 
11 #ifndef LARDATAOBJ_RECOBASE_TRAJECTORYPOINTFLAGS_TCC
12 #define LARDATAOBJ_RECOBASE_TRAJECTORYPOINTFLAGS_TCC
13 
14 #ifndef LARDATAOBJ_RECOBASE_TRAJECTORYPOINTFLAGS_H
15 #error "Do not include TrajectoryPointFlags.tcc. Include in TrajectoryPointFlags.h instead."
16 #endif // !LARDATAOBJ_RECOBASE_TRAJECTORYPOINTFLAGS_H
17 
18 //------------------------------------------------------------------------------
19 template <typename Stream>
20 void recob::TrajectoryPointFlags::dump(Stream&& out,
21  unsigned int verbosity,
22  std::string /* indent */,
23  std::string indentFirst) const
24 {
25  /*
26  * Information printed out (`verbosity` argument)
27  * -----------------------------------------------
28  *
29  * * level `0`: mask of the flags, and index
30  * * level `1`: name of the flags set, and index
31  *
32  */
33 
34  //----------------------------------------------------------------------------
35  out << indentFirst;
36  if (verbosity == 0) { fFlags.dump(std::forward<Stream>(out)); }
37  else { // verbosity >= 1
38  out << "{";
39  unsigned int count = 0;
40  for (FlagIndex_t index = 0; index < flag::maxFlags(); ++index) {
41  if (!isDefined(index)) continue;
42  if (count++) out << ',';
43  out << ' ';
44  if (isUnset(index)) out << '!';
45  switch (verbosity) {
46  case 0: out << index; break;
47  default: out << flag::name(index);
48  } // switch
49  } // for
50  out << " }";
51  }
52  if (hasOriginalHitIndex())
53  out << ", hit index: " << fromHit();
54  else
55  out << " (no hit index)";
56 
57 } // recob::TrajectoryPointFlags::dump()
58 
59 //------------------------------------------------------------------------------
60 
61 #endif // LARDATAOBJ_RECOBASE_TRAJECTORYPOINTFLAGS_TCC