CFEL - ASG Software Suite  2.5.0
CASS
detector_analyzer_backend.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 Lutz Foucar
2 
3 /**
4  * @file detector_analyzer_backend.cpp contains base class implementation
5  * for all detector analyzers.
6  *
7  * @author Lutz Foucar
8  */
9 
10 #include <sstream>
11 
14 #include "delayline_non_sorting.h"
15 #include "cass.h"
16 #ifdef ACHIMSRESORTER
17 #include "achimsorter_hex.h"
18 #endif
19 
20 using namespace cass::ACQIRIS;
21 using namespace std;
22 using namespace std::tr1;
23 
24 std::tr1::shared_ptr<DetectorAnalyzerBackend> DetectorAnalyzerBackend::instance(const DetectorAnalyzerType& type)
25 {
26  std::tr1::shared_ptr<DetectorAnalyzerBackend> detanal;
27  switch(type)
28  {
29  case DelaylineSimple:
31  break;
32  case NonSorting:
33  detanal = shared_pointer(new DelaylineNonSorting());
34  break;
35 #ifdef ACHIMSRESORTER
36  case AchimsRoutine:
37  detanal = shared_pointer(new HexSorter());
38  break;
39 #endif
40  default:
41  throw std::invalid_argument("DetectorAnalyzerBackend::instance(): the requested type '" +
42  toString(type) + "' is unknown");
43  break;
44  }
45  return detanal;
46 }
static shared_pointer instance(const DetectorAnalyzerType &type)
create an instance of the right analyzer type
STL namespace.
DetectorAnalyzerType
the available detector analyzers
Simple sorter of hits from a Quadanode delayline detector.
file contains base class for all detector analyzers.
file contains the declaration of classes that analyzses a delayline detector.
Achims resort routine wrapper.
file contains global definitions for project cass
file contains class that uses achims resort routine
std::string toString(const Type &t)
convert any type to a string
Definition: cass.h:63
std::tr1::shared_ptr< DetectorAnalyzerBackend > shared_pointer
typedef this as a shared pointer
Simple detectorhit creator.
file contains the class that finds detectorhits without sorting