~christopher-hunt08/maus/maus_integrated_kalman

« back to all changes in this revision

Viewing changes to src/common_cpp/Recon/Global/ImportCkovRecon.cc

  • Committer: Durga Rajaram
  • Date: 2014-07-16 15:13:05 UTC
  • mfrom: (659.1.92 cand)
  • Revision ID: durga@fnal.gov-20140716151305-q27rv1y9p03v9lks
Tags: MAUS-v0.9, MAUS-v0.9.0
MAUS-v0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
 
2
 *
 
3
 * MAUS is free software: you can redistribute it and/or modify
 
4
 * it under the terms of the GNU General Public License as published by
 
5
 * the Free Software Foundation, either version 3 of the License, or
 
6
 * (at your option) any later version.
 
7
 *
 
8
 * MAUS is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with MAUS.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 */
 
17
 
 
18
#include <algorithm>
 
19
 
 
20
#include "Interface/Squeak.hh"
 
21
 
 
22
#include "Recon/Global/ImportCkovRecon.hh"
 
23
 
 
24
namespace MAUS {
 
25
namespace recon {
 
26
namespace global {
 
27
 
 
28
  void ImportCkovRecon::process(const MAUS::CkovEvent &ckov_event,
 
29
                               MAUS::GlobalEvent* global_event,
 
30
                               std::string mapper_name) {
 
31
 
 
32
    for (size_t i = 0; i < ckov_event.GetCkovDigitArraySize(); ++i) {
 
33
      CkovDigit ckov_digit = ckov_event.GetCkovDigitArrayElement(i);
 
34
      CkovA ckovA = ckov_digit.GetCkovA();
 
35
      MAUS::DataStructure::Global::SpacePoint* GlobalCkovASpacePoint =
 
36
        new MAUS::DataStructure::Global::SpacePoint();
 
37
      GlobalCkovASpacePoint->
 
38
        set_detector(MAUS::DataStructure::Global::kCherenkovA);
 
39
      GlobalCkovASpacePoint->set_num_photoelectrons(ckovA.GetNumberOfPes());
 
40
      CkovB ckovB = ckov_digit.GetCkovB();
 
41
      MAUS::DataStructure::Global::SpacePoint* GlobalCkovBSpacePoint =
 
42
        new MAUS::DataStructure::Global::SpacePoint();
 
43
      GlobalCkovBSpacePoint->
 
44
        set_detector(MAUS::DataStructure::Global::kCherenkovB);
 
45
      GlobalCkovBSpacePoint->set_num_photoelectrons(ckovB.GetNumberOfPes());
 
46
 
 
47
      global_event->add_space_point(GlobalCkovASpacePoint);
 
48
      global_event->add_space_point(GlobalCkovBSpacePoint);
 
49
    }
 
50
  }
 
51
 
 
52
} // ~namespace global
 
53
} // ~namespace recon
 
54
} // ~namespace MAUS