CMS 3D CMS Logo

LateralityBasicProvider.cc
Go to the documentation of this file.
2 #include <cmath>
3 #include <memory>
4 
5 using namespace edm;
6 using namespace std;
7 using namespace cmsdt;
8 // ============================================================================
9 // Constructors and destructor
10 // ============================================================================
12  : LateralityProvider(pset, iC), debug_(pset.getUntrackedParameter<bool>("debug")) {
13  if (debug_)
14  LogDebug("LateralityBasicProvider") << "LateralityBasicProvider: constructor";
15 
17 }
18 
20  if (debug_)
21  LogDebug("LateralityBasicProvider") << "LateralityBasicProvider: destructor";
22 }
23 
24 // ============================================================================
25 // Main methods (initialise, run, finish)
26 // ============================================================================
28  if (debug_)
29  LogDebug("LateralityBasicProvider") << "LateralityBasicProvider::initialiase";
30 }
31 
33  const edm::EventSetup &iEventSetup,
34  MuonPathPtrs &muonpaths,
35  std::vector<lat_vector> &lateralities) {
36  if (debug_)
37  LogDebug("LateralityBasicProvider") << "LateralityBasicProvider: run";
38 
39  // fit per SL (need to allow for multiple outputs for a single mpath)
40  for (auto &muonpath : muonpaths) {
41  analyze(muonpath, lateralities);
42  }
43 }
44 
46  if (debug_)
47  LogDebug("LateralityBasicProvider") << "LateralityBasicProvider: finish";
48 };
49 
50 //------------------------------------------------------------------
51 //--- Metodos privados
52 //------------------------------------------------------------------
53 
54 void LateralityBasicProvider::analyze(MuonPathPtr &inMPath, std::vector<lat_vector> &lateralities) {
55  if (debug_)
56  LogDebug("LateralityBasicProvider") << "DTp2:analyze \t\t\t\t starts";
57  for (auto &lat_combination : lat_combinations) {
58  if (inMPath->missingLayer() == lat_combination.missing_layer &&
59  inMPath->cellLayout()[0] == lat_combination.cellLayout[0] &&
60  inMPath->cellLayout()[1] == lat_combination.cellLayout[1] &&
61  inMPath->cellLayout()[2] == lat_combination.cellLayout[2] &&
62  inMPath->cellLayout()[3] == lat_combination.cellLayout[3]) {
63  lateralities.push_back(lat_combination.latcombs);
64  return;
65  }
66  }
67  lateralities.push_back(LAT_VECTOR_NULL);
68  return;
69 }
70 
72  lat_combinations.push_back({-1, {0, 0, 0, -1}, {{0, 0, 0, 1}, {0, 0, 1, 1}, {0, 1, 1, 1}, {0, 0, 0, 0}}});
73  lat_combinations.push_back({-1, {0, 0, 1, -1}, {{0, 0, 1, 0}, {0, 1, 1, 0}, {1, 1, 1, 0}, {0, 0, 0, 0}}});
74  lat_combinations.push_back({-1, {0, 1, 0, -1}, {{0, 1, 0, 0}, {0, 1, 0, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}}});
75  lat_combinations.push_back({-1, {0, 1, 1, -1}, {{0, 1, 0, 0}, {0, 1, 1, 0}, {0, 1, 1, 1}, {0, 0, 0, 0}}});
76  lat_combinations.push_back({-1, {1, 0, 0, -1}, {{1, 0, 0, 0}, {1, 0, 0, 1}, {1, 0, 1, 1}, {0, 0, 0, 0}}});
77  lat_combinations.push_back({-1, {1, 0, 1, -1}, {{0, 0, 1, 0}, {0, 0, 1, 1}, {1, 0, 1, 0}, {1, 0, 1, 1}}});
78  lat_combinations.push_back({-1, {1, 1, 0, -1}, {{0, 0, 0, 1}, {1, 0, 0, 1}, {1, 1, 0, 1}, {0, 0, 0, 0}}});
79  lat_combinations.push_back({-1, {1, 1, 1, -1}, {{1, 0, 0, 0}, {1, 1, 0, 0}, {1, 1, 1, 0}, {0, 0, 0, 0}}});
80  lat_combinations.push_back({0, {0, 0, 0, -1}, {{0, 0, 0, 1}, {0, 0, 1, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
81  lat_combinations.push_back({0, {0, 0, 1, -1}, {{0, 0, 1, 0}, {0, 0, 1, 1}, {0, 1, 1, 0}, {0, 0, 0, 0}}});
82  lat_combinations.push_back({0, {0, 1, 0, -1}, {{0, 0, 0, 1}, {0, 1, 0, 0}, {0, 1, 0, 1}, {0, 0, 0, 0}}});
83  lat_combinations.push_back({0, {0, 1, 1, -1}, {{0, 1, 0, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
84  lat_combinations.push_back({1, {0, 0, 0, -1}, {{0, 0, 0, 1}, {0, 0, 1, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
85  lat_combinations.push_back({1, {0, 0, 1, -1}, {{0, 0, 1, 0}, {1, 0, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
86  lat_combinations.push_back({1, {0, 1, 0, -1}, {{0, 0, 0, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 0, 0}}});
87  lat_combinations.push_back({1, {0, 1, 1, -1}, {{0, 0, 1, 0}, {0, 0, 1, 1}, {1, 0, 1, 0}, {0, 0, 0, 0}}});
88  lat_combinations.push_back({1, {1, 1, 0, -1}, {{0, 0, 0, 1}, {1, 0, 0, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
89  lat_combinations.push_back({1, {1, 1, 1, -1}, {{1, 0, 0, 0}, {1, 0, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
90  lat_combinations.push_back({2, {0, 0, 0, -1}, {{0, 0, 0, 1}, {0, 1, 0, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
91  lat_combinations.push_back({2, {0, 0, 1, -1}, {{0, 1, 0, 0}, {0, 1, 0, 1}, {1, 1, 0, 0}, {0, 0, 0, 0}}});
92  lat_combinations.push_back({2, {0, 1, 1, -1}, {{0, 1, 0, 0}, {0, 1, 0, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
93  lat_combinations.push_back({2, {1, 0, 0, -1}, {{1, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
94  lat_combinations.push_back({2, {1, 0, 1, -1}, {{0, 0, 0, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 0, 0}}});
95  lat_combinations.push_back({2, {1, 1, 1, -1}, {{1, 0, 0, 0}, {1, 1, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
96  lat_combinations.push_back({3, {0, 0, 0, -1}, {{0, 0, 1, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
97  lat_combinations.push_back({3, {0, 1, 0, -1}, {{0, 1, 0, 0}, {0, 1, 1, 0}, {1, 1, 0, 0}, {0, 0, 0, 0}}});
98  lat_combinations.push_back({3, {1, 0, 0, -1}, {{0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}, {0, 0, 0, 0}}});
99  lat_combinations.push_back({3, {1, 1, 0, -1}, {{1, 0, 0, 0}, {1, 1, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}});
100 };
std::vector< lat_combination > lat_combinations
std::vector< MuonPathPtr > MuonPathPtrs
Definition: MuonPath.h:132
void analyze(MuonPathPtr &inMPath, std::vector< lat_vector > &lateralities)
int iEvent
Definition: GenABIO.cc:224
void run(edm::Event &iEvent, const edm::EventSetup &iEventSetup, MuonPathPtrs &inMpath, std::vector< lat_vector > &lateralities) override
LateralityBasicProvider(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
void initialise(const edm::EventSetup &iEventSetup) override
HLT enums.
std::shared_ptr< MuonPath > MuonPathPtr
Definition: MuonPath.h:131
#define LogDebug(id)
short cellLayout[cmsdt::NUM_LAYERS]