Linear Collider Forum



Home » Analysis and Reconstruction » Tracking & Vertexing » MarlinTPC flagwords
MarlinTPC flagwords [message #2089] Thu, 21 October 2010 05:44 Go to previous message
rosemann
Messages: 41
Registered: March 2009
Location: hamburg.de
Hi everyone,

I implemented a header file, which currently resides in my branch under reconstruction/include/FlagwordDefinitions.h

Please comment on the layout and the completeness of the implemented flagwords.

Please note that I slighty changed Martins proposal and extended the basic static int definitions with functions that are global to that namespace; hopefully this will make it easier to use/read.

Here's the code:
#ifndef FLAGWORDDEFINITIONS_H
#define FLAGWORDDEFINITIONS_H

/** a collection of the quality flagwords that are stored in the respective LCIO classes:
   these are collected into three different namespaces (for pulses, hits and tracks),
   and equipped with "global" functions (within this namespace) to ease the usage

   the flags were discussed in the forum

  example usage:
  EVENT::TrackerPulse* aPulse;
  if(isUnderflow(aPulse->getQuality())
  {...}

  int quality = 0;
  quality = setMultiplePulseCandidate(quality);
  quality = setOverflow
**/

namespace marlintpc
{
  namespace pulseflag
  {
    static int const MULTIPLE_PULSE_CANDIDATE = 1;
    static int const ANOMALOUS_SHAPE          = 1 << 1;
    static int const OVERFLOW_BIN             = 1 << 2;
    static int const UNDERFLOW_BIN            = 1 << 3;
    static int const WAS_SPLIT                = 1 << 4;

    int setMultiplePulseCandidate(int i)
    {
      return i |= MULTIPLE_PULSE_CANDIDATE;
    }

    int setAnomalousShape(int j)
    {
      return j |= ANOMALOUS_SHAPE;
    }

    int setOverflow(int k)
    {
      return k |= OVERFLOW_BIN;
    }

    int setUnderflow(int m)
    {
      return m |= UNDERFLOW_BIN;
    }

    int setSplit(int n)
    {
      return n |= WAS_SPLIT;
    }

    bool isMultiplePulseCandidate(int i)
    {
      return i & MULTIPLE_PULSE_CANDIDATE;
    }

    bool isAnomalousShape(int j)
    {
      return j & ANOMALOUS_SHAPE;
    }

    bool isOverflow(int k)
    {
      return k & OVERFLOW_BIN;
    }

    bool isUnderflow(int m)
    {
      return m & UNDERFLOW_BIN;
    }

    bool isSplit(int n)
    {
      return n & WAS_SPLIT;
    }

  }

  namespace hitflag
  {
    static int const CONTAINS_BROKEN_CHANNEL  = 1;
    static int const CONTAINS_NOISY_CHANNEL   = 1 << 1;
    static int const HIT_AT_BORDER            = 1 << 2;
    static int const CONTAINS_OVERFLOW_PULSE  = 1 << 3;
    static int const CONTAINS_SPLIT_PULSE     = 1 << 4;
    static int const CONTAINS_ANOMALOUS_PULSE = 1 << 5;
    static int const CONTAINS_EMPTY_CHANNEL   = 1 << 6;
    static int const MULTIPLE_HIT_CANDIDATE   = 1 << 7;

    int setBrokenChannel(int i)
    {
      return i |= CONTAINS_BROKEN_CHANNEL;
    }

    int setNoisyChannel(int j)
    {
      return j |= CONTAINS_NOISY_CHANNEL;
    }

    int setAtBorder(int k)
    {
      return k |= HIT_AT_BORDER;
    }

    int setOverflowPulse(int m)
    {
      return m |= CONTAINS_OVERFLOW_PULSE;
    }

    int setSplitPulse(int n)
    {
      return n |= CONTAINS_SPLIT_PULSE;
    }

    int setAnomalousPulseShape(int p)
    {
      return p |= CONTAINS_ANOMALOUS_PULSE;
    }

    int setEmptyChannel(int q)
    {
      return q |= CONTAINS_EMPTY_CHANNEL;
    }

    int setMultipleHitCandidate(int r)
    {
      return r |= MULTIPLE_HIT_CANDIDATE;
    }

    bool isBrokenChannel(int i)
    {
      return i & CONTAINS_BROKEN_CHANNEL;
    }

    bool isNoisyChannel(int j)
    {
      return j & CONTAINS_NOISY_CHANNEL;
    }

    bool isAtBorder(int k)
    {
      return k & HIT_AT_BORDER;
    }

    bool isOverflowPulse(int m)
    {
      return m & CONTAINS_OVERFLOW_PULSE;
    }

    bool isSplitPulse(int n)
    {
      return n & CONTAINS_SPLIT_PULSE;
    }

    bool isAnomalousPulseShape(int p)
    {
      return p & CONTAINS_ANOMALOUS_PULSE;
    }

    bool isEmptyChannel(int q)
    {
      return q & CONTAINS_EMPTY_CHANNEL;
    }

    bool isMultipleHitCandidate(int r)
    {
      return r & MULTIPLE_HIT_CANDIDATE;
    }
  }

  namespace trackflag
  {
    static int const HELIX_TRACKMODEL         = 1;
    static int const STRAIGHT_LINE_TRACKMODEL = 1 << 1;
    static int const MULTIPLE_TRACK_CANDIDATE = 1 << 2;
    static int const CHISQUARE_FITTER         = 1 << 8;
    static int const KALMAN_FITTER            = 1 << 9;
    static int const LIKELIHOOD_FITTER        = 1 << 10;

    int setHelixTrackModel(int i)
    {
      return i |= HELIX_TRACKMODEL;
    }

    int setStraightLineTrackModel(int j)
    {
       return j |= STRAIGHT_LINE_TRACKMODEL;
    }

    int setMultipleTrackCandidate(int j)
    {
      return j |= MULTIPLE_TRACK_CANDIDATE;
    }

    int setChiSquareFitter(int j)
    {
      return j |= CHISQUARE_FITTER;
    }

    int setKalmanFitter(int j)
    {
      return j |= KALMAN_FITTER;
    }

    int setLikelihoodFitter(int j)
    {
      return j |= LIKELIHOOD_FITTER;
    }
  }
}
#endif //FLAGWORDDEFINITIONS_H


Sorry that the post is so long.

Cheers,
Christoph


When you have eliminated the impossible, whatever remains, however improbable, must be the truth. (Sir A.C. Doyle in Sign of Four)
 
Read Message
Read Message
Read Message
Previous Topic:Problem with PerEventIPFitterProcessor
Next Topic:Questions/remarks on pathfinder
Goto Forum:
  


Current Time: Tue Sep 25 08:14:39 Pacific Daylight Time 2018
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software