Belle II Software release-09-00-14
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/trackFindingCDC/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;
16
17CDCWireHitVarSet::CDCWireHitVarSet() : Super()
18{
19}
20
22{
24}
25
27{
28 const auto* cdcHit = wireHit->getHit();
29 var<named("tdc")>() = cdcHit->getTDCCount();
30 var<named("slayer")>() = cdcHit->getISuperLayer() == 0 ? 0 : 1;
31
32 if ((*wireHit)->hasBoardWithBadADCFlag())
33 var<named("adc")>() = 100; //reasonable value
34 else
35 var<named("adc")>() = cdcHit->getADCCount();
36
37 if ((*wireHit)->hasBoardWithBadTOTFlag())
38 var<named("tot")>() = 3; //reasonable value
39 else
40 var<named("tot")>() = cdcHit->getTOT();
41 return true;
42}
void initialize() override
Receive signal before the start of the event processing.
bool extract(const CDCWireHit *object) final
Generate and assign the variables from the object.
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
void initialize() override
Receive and dispatch signal before the start of the event processing.
static constexpr int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:78
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Definition: VarSet.h:93
Abstract base class for different kinds of events.