BmnRoot
Loading...
Searching...
No Matches
BmnLambdaMisc.h
Go to the documentation of this file.
1// @(#)bmnroot/embedding:$Id$
2// Author: Pavel Batyuk <pavel.batyuk@jinr.ru> 2019-12-07
3
5// //
6// BmnLambdaMisc //
7// //
8// Useful instruments to work with mapping files (GEM, SILICON) //
9// (reading, sorting, correspondence e.t.c.) //
10// //
12
13#ifndef BMNLAMBDAMISC_H
14#define BMNLAMBDAMISC_H 1
15
16#include <iostream>
17#include <fstream>
18#include <vector>
19#include <map>
20#include <TNamed.h>
21#include <TSystem.h>
22#include <TClonesArray.h>
23
24#include <BmnGemStripDigit.h>
25#include <BmnSiliconDigit.h>
26#include <BmnCSCDigit.h>
27#include <BmnGemStripStationSet.h>
28#include <BmnSiliconStationSet.h>
29#include <BmnCSCStationSet.h>
30
32
33using namespace std;
34
35class MappingInfo : public TObject {
36public:
38
39 MappingInfo(Int_t stat, TString map, pair <Int_t, Int_t> ch, pair <Int_t, Int_t> str) :
40 channel(-1),
41 strip(-1) {
42 station = stat;
43 mapFile = map;
44 channels = ch;
45 strips = str;
46 }
47
48 MappingInfo(Int_t stat, TString map, Int_t ch, Int_t str) :
49 channels(make_pair(-1, -1.)),
50 strips(make_pair(-1, -1)) {
51 station = stat;
52 mapFile = map;
53 channel = ch;
54 strip = str;
55 }
56
57 MappingInfo(Int_t stat, TString mapping, map <Int_t, Int_t> strGlobChan) :
58 channels(make_pair(-1, -1.)),
59 strips(make_pair(-1, -1)),
60 channel(-1),
61 strip(-1) {
62 station = stat;
63 mapFile = mapping;
64 stripChan = strGlobChan;
65 }
66
67 virtual ~MappingInfo() {
68 };
69
70 Int_t station;
71 TString mapFile;
72 pair <Int_t, Int_t> channels;
73 pair <Int_t, Int_t> strips;
74
75 // Additional data members ...
76 Int_t channel;
77 Int_t strip;
78
79 map <Int_t, Int_t> stripChan;
80};
81
82class BmnLambdaMisc : public TNamed {
83public:
85
86 virtual ~BmnLambdaMisc();
87
88 /* GEM */
89 Int_t GemDigiToChannel(BmnStripDigit*, Long_t&); // GEM-digi ---> channel (serial)
90 TString GemDigiToMapping(BmnStripDigit*); // GEM-digi ---> corresponding <strip-channel> mapping
91 Long_t GemDigiChannelToSerial(pair <BmnStripDigit, Int_t>); // GEM-digi + channel ---> serial
92 Long_t GetGemSerial(Int_t, Int_t, Int_t, Int_t); // (st, mod, id, channel ---> serial)
93
94 /* CSC */
95 Int_t CscDigiToChannel(BmnStripDigit*, Long_t&); // CSC-digi ---> channel (serial)
96
97 /* SILICON */
98 void SiliconDigiToChannelSampleSerial(BmnStripDigit*, Int_t&, Int_t&, Long_t&); // SILICON-digi ---> &channel, &sample, &serial
99
100 /* Supplementary methods to be used for testing */
101 void CheckStripOverlaps(); // To be used for checking whether strips from common serial are overlapped with those ones from other serials or not ...
102
103private:
104 void GEM();
105 void SILICON();
106 void CSC();
107
108private:
109 /* GEM */
110 vector <vector <Int_t>> fGemStatModId; // vector of (stat, module, id)
111 /* SILICON */
112 vector <vector <Int_t>> fSiliconStatModLayId; // vector of (stat, module, layer, id)
113 /* CSC */
114 vector <vector <Int_t>> fCscStatModLay; // vector of (stat, module, layer)
115
116 /* GEM */
117 // Map with commonSerial only ...
118 map <vector <Int_t>, vector < Long_t>> corrMapCommonSerial; // <st, mod, id> ---> <low, high, serial>
119
120 // Map with no commonSerial included ...
121 map <vector <Int_t>, vector < Long_t>> corrMapNoCommonSerial; // <st, mod, id> ---> <low, high, serial>
122
123 /* SILICON */
124 // Map with SILICON serials ...
125 map <vector <Int_t>, vector < Long_t>> serialsSilicon; // <st, mod, layer, id> ---> <low, high, serial>
126
127 /* CSC */
128 // Map with CSC serials ...
129 map <vector <Int_t>, vector < Long_t>> serialsCsc; // <st, mod, layer> ---> <low, high, serial>
130
131 // Geometry sets ...
132 BmnGemStripStationSet* fDetectorGEM;
133 BmnSiliconStationSet* fDetectorSI;
134 BmnCSCStationSet* fDetectorCSC;
135
136 UInt_t FindChannelByStrip(TString, Int_t);
137
138 void ParseStripChannelMapping(TString, Int_t, map <Int_t, Int_t>&);
139
140 ClassDef(BmnLambdaMisc, 1)
141};
142
143#endif
TString GemDigiToMapping(BmnStripDigit *)
Int_t GemDigiToChannel(BmnStripDigit *, Long_t &)
void SiliconDigiToChannelSampleSerial(BmnStripDigit *, Int_t &, Int_t &, Long_t &)
void CheckStripOverlaps()
Int_t CscDigiToChannel(BmnStripDigit *, Long_t &)
Long_t GemDigiChannelToSerial(pair< BmnStripDigit, Int_t >)
virtual ~BmnLambdaMisc()
Long_t GetGemSerial(Int_t, Int_t, Int_t, Int_t)
MappingInfo(Int_t stat, TString mapping, map< Int_t, Int_t > strGlobChan)
TString mapFile
pair< Int_t, Int_t > channels
map< Int_t, Int_t > stripChan
pair< Int_t, Int_t > strips
MappingInfo(Int_t stat, TString map, pair< Int_t, Int_t > ch, pair< Int_t, Int_t > str)
virtual ~MappingInfo()
MappingInfo(Int_t stat, TString map, Int_t ch, Int_t str)
STL namespace.