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#include <boost/foreach.hpp>
12
13using namespace std;
14using namespace Belle2;
15using namespace CDC;
16
17REG_MODULE(CDCRecoTrackFilter);
18
20{
21 setPropertyFlags(c_ParallelProcessingCertified); // specify this flag if you need parallel processing
22 setDescription("use this module to exclude Layers in fitting, after TrackFinding");
23 addParam("RecoTracksColName", m_recoTrackArrayName, "Name of collection to hold Belle2::RecoTrack", std::string(""));
24 addParam("ExcludeSLayer", m_excludeSLayer, "Super layers (0-8) not used in the fitting", std::vector<unsigned short> {});
25 addParam("ExcludeICLayer", m_excludeICLayer, "layers (0-55) not used in the fitting", std::vector<unsigned short> {});
26}
27
29{
30}
31
33{
35}
36
38{
39}
40
42{
43 // Loop over Recotracks
44 int nTr = m_RecoTracks.getEntries();
45 for (int i = 0; i < nTr; ++i) {
46 const RecoTrack* track = m_RecoTracks[i];
47 BOOST_FOREACH(const RecoHitInformation::UsedCDCHit * cdchit, track->getCDCHitList()) {
48 WireID wireid(cdchit->getID());
49 unsigned short slay = wireid.getISuperLayer();
50 unsigned short iclay = wireid.getICLayer();
51 for (unsigned short j = 0; j < m_excludeSLayer.size(); ++j) {
52 if (slay == m_excludeSLayer.at(j)) {
53 track->getRecoHitInformation(cdchit)->setUseInFit(false);
54 }
55 }
56
57 for (unsigned short j = 0; j < m_excludeICLayer.size(); ++j) {
58 if (iclay == m_excludeICLayer.at(j)) {
59 track->getRecoHitInformation(cdchit)->setUseInFit(false);
60 }
61 }
62
63 }//end of track (Boost_foreach)
64 }//end RecoTrack array
65}//End Event
67{
68}
69
71{
72}
73
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40
unsigned short getID() const
Getter for encoded wire number.
Definition: CDCHit.h:193
std::string m_recoTrackArrayName
Belle2::RecoTrack StoreArray name.
void initialize() override
Initializes the Module.
void event() override
Event action (main routine).
void terminate() override
Termination action.
std::vector< unsigned short > m_excludeSLayer
Super layers (0-8) not used in the track fitting.
void beginRun() override
Begin run action.
std::vector< unsigned short > m_excludeICLayer
IClayers (0-55) not used in the track fitting.
StoreArray< RecoTrack > m_RecoTracks
Tracks.
Base class for Modules.
Definition: Module.h:72
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
@ 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
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
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:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.
STL namespace.