Belle II Software development
CDCRecoTrackFilterModule.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
9#include "cdc/modules/cdcRecoTrackFilter/CDCRecoTrackFilterModule.h"
10#include <tracking/dataobjects/RecoHitInformation.h>
11
12using namespace std;
13using namespace Belle2;
14using namespace CDC;
15
16REG_MODULE(CDCRecoTrackFilter);
17
19{
20 setPropertyFlags(c_ParallelProcessingCertified); // specify this flag if you need parallel processing
21 setDescription("use this module to exclude Layers in fitting, after TrackFinding");
22 addParam("RecoTracksColName", m_recoTrackArrayName, "Name of collection to hold Belle2::RecoTrack", std::string(""));
23 addParam("ExcludeSLayer", m_excludeSLayer, "Super layers (0-8) not used in the fitting", std::vector<unsigned short> {});
24 addParam("ExcludeICLayer", m_excludeICLayer, "layers (0-55) not used in the fitting", std::vector<unsigned short> {});
25}
26
30
35
37{
38 // Loop over Recotracks
39 int nTr = m_RecoTracks.getEntries();
40 for (int i = 0; i < nTr; ++i) {
41 const RecoTrack* track = m_RecoTracks[i];
42 for (const RecoHitInformation::UsedCDCHit* cdchit : track->getCDCHitList()) {
43 WireID wireid(cdchit->getID());
44 unsigned short slay = wireid.getISuperLayer();
45 unsigned short iclay = wireid.getICLayer();
46 for (unsigned short j = 0; j < m_excludeSLayer.size(); ++j) {
47 if (slay == m_excludeSLayer.at(j)) {
48 track->getRecoHitInformation(cdchit)->setUseInFit(false);
49 }
50 }
51
52 for (unsigned short j = 0; j < m_excludeICLayer.size(); ++j) {
53 if (iclay == m_excludeICLayer.at(j)) {
54 track->getRecoHitInformation(cdchit)->setUseInFit(false);
55 }
56 }
57
58 }//end of track
59 }//end RecoTrack array
60}//End Event
61
std::string m_recoTrackArrayName
Belle2::RecoTrack StoreArray name.
void initialize() override
Initializes the Module.
void event() override
Event action (main routine).
std::vector< unsigned short > m_excludeSLayer
Super layers (0-8) not used in the track fitting.
std::vector< unsigned short > m_excludeICLayer
IClayers (0-55) not used in the track fitting.
StoreArray< RecoTrack > m_RecoTracks
Tracks.
virtual ~CDCRecoTrackFilterModule() override
Destructor.
void setDescription(const std::string &description)
Sets the description of the module.
Definition Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition Module.cc:208
Module()
Constructor.
Definition Module.cc:30
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition Module.h:80
CDCHit UsedCDCHit
Define, use of CDC hits as CDC hits (for symmetry).
This is the Reconstruction Event-Data Model Track.
Definition RecoTrack.h:79
Class to identify a wire inside the CDC.
Definition WireID.h:34
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition Module.h:559
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition Module.h:649
Abstract base class for different kinds of events.
STL namespace.