LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 //------------------------------------------------------------------------------
20 template <typename Stream>
21 void recob::TrajectoryPointFlags::dump(
22  Stream&& out,
23  unsigned int verbosity,
24  std::string /* indent */, std::string indentFirst
25  ) const
26 {
27  /*
28  * Information printed out (`verbosity` argument)
29  * -----------------------------------------------
30  *
31  * * level `0`: mask of the flags, and index
32  * * level `1`: name of the flags set, and index
33  *
34  */
35 
36  //----------------------------------------------------------------------------
37  out << indentFirst;
38  if (verbosity == 0) {
39  fFlags.dump(std::forward<Stream>(out));
40  }
41  else { // verbosity >= 1
42  out << "{";
43  unsigned int count = 0;
44  for (FlagIndex_t index = 0; index < flag::maxFlags(); ++index) {
45  if (!isDefined(index)) continue;
46  if (count++) out << ',';
47  out << ' ';
48  if (isUnset(index)) out << '!';
49  switch (verbosity) {
50  case 0:
51  out << index;
52  break;
53  default:
54  out << flag::name(index);
55  } // switch
56  } // for
57  out << " }";
58  }
59  if (hasOriginalHitIndex()) out << ", hit index: " << fromHit();
60  else out << " (no hit index)";
61 
62 } // recob::TrajectoryPointFlags::dump()
63 
64 
65 //------------------------------------------------------------------------------
66 
67 
68 #endif // LARDATAOBJ_RECOBASE_TRAJECTORYPOINTFLAGS_TCC