Belle II Software  release-06-00-14
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 
13 using namespace std;
14 using namespace Belle2;
15 using namespace CDC;
16 
17 REG_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 
28 CDCRecoTrackFilterModule::~CDCRecoTrackFilterModule()
29 {
30 }
31 
32 void CDCRecoTrackFilterModule::initialize()
33 {
34  m_RecoTracks.isRequired(m_recoTrackArrayName);
35 }
36 
37 void CDCRecoTrackFilterModule::beginRun()
38 {
39 }
40 
41 void CDCRecoTrackFilterModule::event()
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
66 void CDCRecoTrackFilterModule::endRun()
67 {
68 }
69 
70 void CDCRecoTrackFilterModule::terminate()
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
The module excluding hits of specified Slayers in the RecoTracks.
Base class for Modules.
Definition: Module.h:72
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:76
Class to identify a wire inside the CDC.
Definition: WireID.h:34
#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.