Linear Collider Forum

Home » Analysis and Reconstruction » Tracking & Vertexing » Pulse (and Hit) quailty
Pulse (and Hit) quailty [message #1965] Thu, 06 May 2010 06:28 Go to previous message
Messages: 125
Registered: July 2005
Location: CERN

I am looking for a place where to define the constants used to store the pulse quality. An example which comes with LCIO proposes to store a vector with names and bit positions as collection parameters. I think this is a little bit cumbersome to use, especially as quality can not be queried bitwise.

I would prefer to have it in a header file.

Currently the pulse finder uses 1, 10 and 100 as constants, which is better to read in a data dump than setting bits. But I find it difficult to retrieve the flags in a programme. Here setting individual bits is better.
If we have less than 8 flags one could use multiples of 16 as flags and use hex output as dump, which is also easy to read.

So here is my proposal:

Header file:
namespace marlintpc{

  struct PulseQuality{
    static int const MULTI_HIT_CANDIDATE = 1;
    static int const ANOMALOUS_SHAPE     = 1<<4;
    static int const OVERFLOW            = 1<<8;
    static int const WAS_SPLIT           = 1<<12; 

Example code:
#include "PulseQuality.h"

int quality=0:

// set the overflow bit
quality |= PulseQuality.OVERFLOW;

// delete the anomalous shape bit
quality &= ~PulseQuality.ANOMALOUS_SHAPE;

// check whether "was split" is set
if (quality & PulseQuality.WAS_SPLIT) cout << "Pulse was split!<< endl;

// dump the quality word
cout << "Quality word is 0x" << hex << quality << dec<< endl;
// as overflow is set this prints 0x100

What do you think about it? One could also use a namespace instead of a struct and use pulsequality::OVERLOW, or just OVERFLOW and 'using namespace'.



P.S. We also don't have a place for the hit quality names. One bit is defined in the TrackFitterBase, but this probably is not a good place.

Martin Killenberg

Read Message
Read Message
Read Message
Previous Topic:LCIO::EVENT::TrackerPulse additions
Next Topic:Questions about fitting in MarlinTPC
Goto Forum:

Current Time: Sun Jan 20 09:17:53 Pacific Standard Time 2019
.:: Contact :: Home ::.

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