Types.cxx 2.64 KB
Newer Older
1
/*
Anil Sonay's avatar
Anil Sonay committed
2
  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
4
5
6
7
8
9
10
11
12
*/

#include "L1TopoCommon/Types.h"
#include "L1TopoCommon/Exception.h"

// Configuration
std::string
TCS::inputTypeAsString(TCS::inputTOBType_t type) {
  if(type == TCS::CLUSTER) return "Clusters";
  else if(type == TCS::TAU) return "Taus";
13
  else if(type == TCS::EEM) return "eEms";
14
  else if(type == TCS::JET) return "Jets";
Anil Sonay's avatar
Anil Sonay committed
15
16
  else if(type == TCS::JTAU) return "jTaus";
  else if(type == TCS::JLARGERJET) return "jLargeRJets";
Anil Sonay's avatar
Anil Sonay committed
17
  else if(type == TCS::JJET) return "jJets";
18
19
  else if(type == TCS::MET) return "MET";
  else if(type == TCS::MUON) return "Muons";
20
21
  else if(type == TCS::MUONNEXTBC) return "MuonsNextBC";
  else if(type == TCS::LATEMUON) return "LateMuons";
22
23
24
25
26
27
28
  else return "None";
}


TCS::inputTOBType_t
TCS::inputType(const std::string& input) {

Anil Sonay's avatar
Anil Sonay committed
29
   if ( input == "Clusters" || input == "ClusterTobArray" || input == "EmTobArray" )
30
31
      return TCS::CLUSTER;

32
   if ( input == "eEM" || input == "eEMTobArray" || input == "eEmTobs" )
33
      return TCS::EEM;
Anil Sonay's avatar
Anil Sonay committed
34

35
   if ( input == "jEM" || input == "jEMTobArray" || input == "jEmTobs" )
Anil Sonay's avatar
Anil Sonay committed
36
37
      return TCS::CLUSTER;

38
   if ( input == "eTAU" || input == "eTauTobArray" || input == "eTauTobs" )
39
      return TCS::ETAU;
Anil Sonay's avatar
Anil Sonay committed
40

41
   if ( input == "jTau" || input == "jTauTobArray" || input == "jTauTobs" )
Anil Sonay's avatar
Anil Sonay committed
42
      return TCS::JTAU;
Anil Sonay's avatar
Anil Sonay committed
43

44
   if ( input == "Jets" || input == "JetTobArray" )
45
46
      return TCS::JET;

47
   if ( input == "jJ" || input == "jJetTobArray" || input == "jJetTobs" )
Anil Sonay's avatar
Anil Sonay committed
48
49
      return TCS::JJET;

50
   if ( input == "jLargeRJet" || input == "jLargeRJetTobArray" || input == "jLargeRJetTobs" )
Anil Sonay's avatar
Anil Sonay committed
51
      return TCS::JLARGERJET;
Anil Sonay's avatar
Anil Sonay committed
52

53
   if ( input == "gJet" || input == "gJetTobArray" || input == "gJetTobs" )
Anil Sonay's avatar
Anil Sonay committed
54
55
      return TCS::JET;

56
   if ( input == "gLargeRJet" || input == "gLargeRJetTobArray" || input == "gLargeRJetTobs" )
Anil Sonay's avatar
Anil Sonay committed
57
58
      return TCS::JET;

59
   if ( input == "Muons" || input == "MuonTobArray" || input == "MuonTobs")
60
      return TCS::MUON;
61
62
63
64

   if ( input == "MuonsNextBC" || input == "MuonNextBCTobArray" )
      return TCS::MUONNEXTBC;
          
65
   if ( input == "LateMuons" || input == "LateMuonTobArray" || input == "LateMuonTobs")
66
67
68
69
      return TCS::LATEMUON;

   if ( input == "MuonsNextBC" || input == "MuonNextBCTobArray" )
      return TCS::MUONNEXTBC;
70
          
71
   if ( input == "Taus" || input == "TauTobArray" )
72
73
      return TCS::TAU;
          
74
   if ( input == "MET" || input == "MetTobArray" || input == "MetTobs" )
75
76
      return TCS::MET;
          
77
   if ( input == "SumEt" || input == "SumEtTobArray" || input == "SumEtTobs" )
Anil Sonay's avatar
Anil Sonay committed
78
79
      return TCS::MET;
          
80
81
82
83
84

   TCS_EXCEPTION("L1TopoCommon: unknown input type " + input);
   
   return TCS::NONE;
}