Belle II Software development
CDCWireHitVarSet.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#include <tracking/trackFindingCDC/filters/wireHit/CDCWireHitVarSet.h>
9#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
10#include <cdc/dataobjects/CDCHit.h>
11
12#include <framework/core/ModuleParamList.templateDetails.h>
13
14using namespace Belle2;
15using namespace TrackFindingCDC;
16using namespace TrackingUtilities;
17
18CDCWireHitVarSet::CDCWireHitVarSet() : Super()
19{
20}
21
26
28{
29 const auto* cdcHit = wireHit->getHit();
30 var<named("tdc")>() = cdcHit->getTDCCount();
31 var<named("slayer")>() = cdcHit->getISuperLayer() == 0 ? 0 : 1;
32
33 if ((*wireHit)->hasBoardWithBadADCFlag())
34 var<named("adc")>() = 100; //reasonable value
35 else
36 var<named("adc")>() = cdcHit->getADCCount();
37
38 if ((*wireHit)->hasBoardWithBadTOTFlag())
39 var<named("tot")>() = 3; //reasonable value
40 else
41 var<named("tot")>() = cdcHit->getTOT();
42 return true;
43}
void initialize() override
Receive signal before the start of the event processing.
bool extract(const TrackingUtilities::CDCWireHit *object) final
Generate and assign the variables from the object.
Class representing a hit wire in the central drift chamber.
Definition CDCWireHit.h:58
static constexpr int named(const char *name)
Definition VarSet.h:78
Abstract base class for different kinds of events.