Belle II Software development
CDCStateBasicVarSet.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/ckf/cdc/filters/states/CDCStateBasicVarSet.h>
9
10#include <tracking/ckf/cdc/entities/CDCCKFState.h>
11
12#include <tracking/dataobjects/RecoTrack.h>
13
14using namespace Belle2;
15
17{
18 const auto& path = pair->first;
19 const auto& state = pair->second;
20 const auto& lastState = path->back();
21
22 // check if hit belongs to same seed
23 const auto& seed = path->front();
24 const auto* seedRecoTrack = seed.getSeed();
25
26 // general stuff
27 var<named("eventNumber")>() = m_eventMetaData->getEvent();
28
29 // calculate the interesting quantities
30 var<named("firstHit")>() = lastState.isSeed();
31 var<named("i_hit")>() = path->size() - 1;
32
33 var<named("iCLayer_lastState")>() = lastState.isSeed() ? -1 : lastState.getWireHit()->getWire().getICLayer();
34 var<named("iCLayer")>() = state->getWireHit()->getWire().getICLayer();
35 var<named("arcLength")>() = state->getArcLength() - lastState.getArcLength();
36 var<named("hitDistance")>() = state->getHitDistance();
37
38 TrackFindingCDC::Vector3D wirePos = state->getWireHit()->getRefPos3D();
39 var<named("wire_r")>() = wirePos.cylindricalR();
40 var<named("wire_z")>() = wirePos.z();
41 var<named("wire_x")>() = wirePos.x();
42 var<named("wire_y")>() = wirePos.y();
43
44 ROOT::Math::XYZVector seedPos = seedRecoTrack->getPositionSeed();
45 ROOT::Math::XYZVector seedMom = seedRecoTrack->getMomentumSeed();
46 var<named("seed_theta")>() = seedMom.Theta() * 180. / M_PI;
47 var<named("seed_r")>() = seedPos.Rho();
48 var<named("seed_z")>() = seedPos.Z();
49 var<named("seed_x")>() = seedPos.X();
50 var<named("seed_y")>() = seedPos.Y();
51 var<named("seed_p")>() = seedMom.R();
52 var<named("seed_pt")>() = seedMom.Rho();
53 var<named("seed_pz")>() = seedMom.Z();
54 var<named("seed_px")>() = seedMom.X();
55 var<named("seed_py")>() = seedMom.Y();
56 var<named("seed_charge")>() = seedRecoTrack->getChargeSeed();
57
58 return true;
59}
virtual bool extract(const BaseCDCStateFilter::Object *result) override
Generate and assign the variables from the object.
StoreObjPtr< EventMetaData > m_eventMetaData
use this to get the eventNumber
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:35
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
A three dimensional vector.
Definition: Vector3D.h:33
double cylindricalR() const
Getter for the cylindrical radius ( xy projected norm )
Definition: Vector3D.h:534
double x() const
Getter for the x coordinate.
Definition: Vector3D.h:472
double y() const
Getter for the y coordinate.
Definition: Vector3D.h:484
double z() const
Getter for the z coordinate.
Definition: Vector3D.h:496
Abstract base class for different kinds of events.