BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
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
4////////////////////////////////////////////////////////////////////////////////
5// //
6// BmnLambdaMisc //
7// //
8// Useful instruments to work with mapping files (GEM, SILICON) //
9// (reading, sorting, correspondence e.t.c.) //
10// //
11////////////////////////////////////////////////////////////////////////////////
12
13#ifndef BMNLAMBDAMISC_H
14#define BMNLAMBDAMISC_H 1
15
16#include <BmnCSCDigit.h>
17#include <BmnCSCStationSet.h>
18#include <BmnGemStripDigit.h>
21#include <BmnSiliconDigit.h>
23#include <TClonesArray.h>
24#include <TNamed.h>
25#include <TSystem.h>
26#include <fstream>
27#include <iostream>
28#include <map>
29#include <vector>
30
31using namespace std;
32
33class MappingInfo : public TObject
34{
35 public:
37
38 MappingInfo(Int_t stat, TString map, pair<Int_t, Int_t> ch, pair<Int_t, Int_t> str)
39 : channel(-1)
40 , strip(-1)
41 {
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 {
52 station = stat;
53 mapFile = map;
54 channel = ch;
55 strip = str;
56 }
57
58 MappingInfo(Int_t stat, TString mapping, map<Int_t, Int_t> strGlobChan)
59 : channels(make_pair(-1, -1.))
60 , strips(make_pair(-1, -1))
61 , channel(-1)
62 , strip(-1)
63 {
64 station = stat;
65 mapFile = mapping;
66 stripChan = strGlobChan;
67 }
68
69 virtual ~MappingInfo() {};
70
73 pair<Int_t, Int_t> channels;
74 pair<Int_t, Int_t> strips;
75
76 // Additional data members ...
79
80 map<Int_t, Int_t> stripChan;
81};
82
83class BmnLambdaMisc : public TNamed
84{
85 public:
87
88 virtual ~BmnLambdaMisc();
89
90 /* GEM */
91 Int_t GemDigiToChannel(BmnStripDigit*, Long_t&); // GEM-digi ---> channel (serial)
92 TString GemDigiToMapping(BmnStripDigit*); // GEM-digi ---> corresponding <strip-channel> mapping
93 Long_t GemDigiChannelToSerial(pair<BmnStripDigit, Int_t>); // GEM-digi + channel ---> serial
94 Long_t GetGemSerial(Int_t, Int_t, Int_t, Int_t); // (st, mod, id, channel ---> serial)
95
96 /* CSC */
97 Int_t CscDigiToChannel(BmnStripDigit*, Long_t&); // CSC-digi ---> channel (serial)
98
99 /* SILICON */
101 Int_t&,
102 Int_t&,
103 Long_t&); // SILICON-digi ---> &channel, &sample, &serial
104
105 /* Supplementary methods to be used for testing */
106 void CheckStripOverlaps(); // To be used for checking whether strips from common serial are overlapped with those
107 // ones from other serials or not ...
108
109 private:
110 void GEM();
111 void SILICON();
112 void CSC();
113
114 private:
115 /* GEM */
116 vector<vector<Int_t>> fGemStatModId; // vector of (stat, module, id)
117 /* SILICON */
118 vector<vector<Int_t>> fSiliconStatModLayId; // vector of (stat, module, layer, id)
119 /* CSC */
120 vector<vector<Int_t>> fCscStatModLay; // vector of (stat, module, layer)
121
122 /* GEM */
123 // Map with commonSerial only ...
124 map<vector<Int_t>, vector<Long_t>> corrMapCommonSerial; // <st, mod, id> ---> <low, high, serial>
125
126 // Map with no commonSerial included ...
127 map<vector<Int_t>, vector<Long_t>> corrMapNoCommonSerial; // <st, mod, id> ---> <low, high, serial>
128
129 /* SILICON */
130 // Map with SILICON serials ...
131 map<vector<Int_t>, vector<Long_t>> serialsSilicon; // <st, mod, layer, id> ---> <low, high, serial>
132
133 /* CSC */
134 // Map with CSC serials ...
135 map<vector<Int_t>, vector<Long_t>> serialsCsc; // <st, mod, layer> ---> <low, high, serial>
136
137 // Geometry sets ...
141
143
144 void ParseStripChannelMapping(TString, Int_t, map<Int_t, Int_t>&);
145
147};
148
149#endif
int Int_t
long Long_t
#define ClassDef(name, id)
map< vector< Int_t >, vector< Long_t > > serialsCsc
vector< vector< Int_t > > fCscStatModLay
TString GemDigiToMapping(BmnStripDigit *)
Int_t GemDigiToChannel(BmnStripDigit *, Long_t &)
UInt_t FindChannelByStrip(TString, Int_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 >)
BmnSiliconStationSet * fDetectorSI
BmnCSCStationSet * fDetectorCSC
map< vector< Int_t >, vector< Long_t > > corrMapCommonSerial
map< vector< Int_t >, vector< Long_t > > corrMapNoCommonSerial
vector< vector< Int_t > > fSiliconStatModLayId
map< vector< Int_t >, vector< Long_t > > serialsSilicon
BmnGemStripStationSet * fDetectorGEM
virtual ~BmnLambdaMisc()
Long_t GetGemSerial(Int_t, Int_t, Int_t, Int_t)
void ParseStripChannelMapping(TString, Int_t, map< Int_t, Int_t > &)
vector< vector< Int_t > > fGemStatModId
Class BmnStripDigit Base class for strip detector digits.
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)