11 TString confGem =
"GemRunSpring2018.xml";
12 TString gPathGemConfig = gPathConfig +
"/parameters/gem/XMLConfigs/";
15 TString confSi =
"SiliconRunSpring2018.xml";
16 TString gPathSiConfig = gPathConfig +
"/parameters/silicon/XMLConfigs/";
19 TString confCsc =
"CSCRunSpring2018.xml";
20 TString gPathCscConfig = gPathConfig +
"/parameters/csc/XMLConfigs/";
45 TString gPathFull = gPathConfig +
"/input/GEM_map_run7.txt";
47 Long_t commonSerial = 0x76D08B9;
50 ifstream g(gPathFull.
Data());
52 TString gemId =
"", station =
"",
module = "", low = "", high = "", serial = "";
53 Int_t linesOmitted = 4;
56 for (
string line; getline(g, line);) {
58 if (counter > linesOmitted) {
59 g >> serial >> low >> high >> gemId >> station >> module;
63 vector<Int_t> key{station.Atoi(),
module.Atoi(), gemId.Atoi()};
64 vector<Long_t> value{low.Atoll(), high.Atoll(), ser};
65 if (ser == commonSerial)
81 TString gPathFull = gPathConfig +
"/input/SILICON_map_run7.txt";
84 ifstream g(gPathFull.
Data());
86 TString layer =
"", station =
"", modAdc =
"", modGeo =
"", low =
"", high =
"", serial =
"";
87 Int_t linesOmitted = 3;
90 for (
string line; getline(g, line);) {
92 if (counter > linesOmitted) {
93 g >> serial >> low >> high >> modAdc >> modGeo >> layer >> station;
97 vector<Int_t> key{station.Atoi(), modGeo.Atoi(), layer.
Atoi(), modAdc.Atoi()};
98 vector<Long_t> value{low.Atoll(), high.Atoll(), ser};
113 TString gPathFull = gPathConfig +
"/input/CSC_map_period7.txt";
116 ifstream g(gPathFull.
Data());
118 TString zone =
"", layer =
"", station =
"",
module = "", low = "", high = "", serial = "";
119 Int_t linesOmitted = 1;
122 for (
string line; getline(g, line);) {
124 if (counter > linesOmitted) {
125 g >> serial >> low >> high >> zone >> station >> module >> layer;
129 vector<Int_t> key{station.Atoi(),
module.Atoi(), layer.Atoi()};
130 vector<Long_t> value{low.Atoll(), high.Atoll(), ser};
145 const Int_t nParts = 2;
146 TString parts[nParts] = {
"Left",
"Right"};
150 for (
Int_t iPart = 0; iPart < nParts; iPart++) {
154 map<Int_t, Int_t> stripGlobChan;
158 vector<Int_t> channels;
159 for (
auto it : stripGlobChan)
160 channels.push_back(it.second);
162 Int_t min = *min_element(channels.begin(), channels.end());
163 Int_t max = *max_element(channels.begin(), channels.end());
173 const Int_t nStripsLeft = 1080;
174 const Int_t nStripsRight = 1129;
175 const Int_t addChanStart = 2048;
183 for (
Int_t iPart = 0; iPart < nParts; iPart++) {
188 const Int_t nStrips = (filename.
Contains(
"Left")) ? nStripsLeft : nStripsRight;
190 for (
Int_t iStrip = 0; iStrip < nStrips; iStrip++) {
196 if (channel > addChanStart - 1)
207 qa->DrawHistos6(mapInfoMainPart, mapInfo);
210 delete mapInfoMainPart;
217 map<Int_t, Int_t> channelStrip;
220 TString gPathFull = gPathConfig +
"/input/" + filename;
221 ifstream f(gPathFull.
Data());
225 Int_t stripCounter = 0;
228 channelStrip[channelCur.Atoi()] = stripCounter;
241 if (it.first[0] != stat)
245 Int_t id = it.first[2];
246 if (filename.
Contains(
"Left") && (
id % 10 == 0))
247 chanShift += it.second[0];
249 else if (filename.
Contains(
"Right") && (
id % 10 != 0))
250 chanShift += it.second[0];
254 Int_t addChanStart = 2048;
256 for (
auto it : channelStrip) {
257 Int_t chan = it.first;
258 if (chan < addChanStart)
261 Int_t locChan = chan - addChanStart;
262 Int_t globChan = locChan + chanShift;
264 stripsGlobChannels[it.second] = globChan;
272 if (it.first[0] != stat || it.first[1] != mod || it.first[2] !=
id)
275 if (channel >= it.second[0] && channel <= it.second[1])
293 vector<Int_t> statModLay = it.first;
295 if (stat != statModLay[0] || mod != statModLay[1] || lay != statModLay[2])
307 TString gPathFull = gPathConfig +
"/input/" + filename;
309 ifstream f(gPathFull.
Data());
311 map<Int_t, Int_t> stripChannels;
314 Int_t stripCounter = 0;
317 stripChannels[stripCounter] = channel.
Atoi();
321 Int_t chan = stripChannels.find(strip)->second;
336 vector<Int_t> statModLay = it.first;
338 if (stat != statModLay[0] || mod != statModLay[1] || lay != statModLay[2])
342 chan = it.second[0] + chanShift;
343 sample =
Int_t(strip % 128);
344 serial = it.second[2];
357 TString layer = (lay == 0 || lay == 2) ?
"X" :
"Y";
365 vector<Int_t> vect = it;
371 LeftOrRight = (vect[2] % 10 == 0) ?
"Left" :
"Right";
374 hotOrBig = (lay == 2 || lay == 3) ? 0 : 1;
378 if (vect[1] == 2 || vect[1] == 3)
382 if (hotOrBig == 0 && vect[1] == 1)
384 else if (hotOrBig == 1 && vect[1] == 0)
387 if (vect[1] == 0 || vect[1] == 1)
391 if (hotOrBig == 0 && vect[1] == 3)
393 else if (hotOrBig == 1 && vect[1] == 2)
398 if ((stat == 0 || stat == 3 || stat == 5))
404 if ((stat == 0 || stat == 1))
430 TString layer = (lay == 0 || lay == 2) ?
"X" :
"Y";
438 vector<Int_t> vect = it;
444 LeftOrRight = (vect[2] % 10 == 0) ?
"Left" :
"Right";
447 hotOrBig = (lay == 2 || lay == 3) ? 0 : 1;
451 if (vect[1] == 2 || vect[1] == 3)
455 if (hotOrBig == 0 && vect[1] == 1)
457 else if (hotOrBig == 1 && vect[1] == 0)
460 if (vect[1] == 0 || vect[1] == 1)
464 if (hotOrBig == 0 && vect[1] == 3)
466 else if (hotOrBig == 1 && vect[1] == 2)
471 if ((stat == 0 || stat == 3 || stat == 5))
477 if ((stat == 0 || stat == 1))
489 TString gPathFull = gPathConfig +
"/input/" + filename;
491 ifstream f(gPathFull.
Data());
493 map<Int_t, Int_t> stripChannels;
496 Int_t stripCounter = 0;
499 stripChannels[stripCounter] = channel.
Atoi();
503 UInt_t chan = stripChannels.find(strip)->second;
506 UInt_t addChannelsStart = 2048;
507 if (chan >= addChannelsStart) {
509 Int_t station = it.first[0];
510 Int_t module = it.first[1];
512 if (station != stat || module != modMakan)
515 UInt_t low = it.second[0];
516 UInt_t high = it.second[1];
518 chan = chan - addChannelsStart + low;
526 serial = itSerial.second[2];
537 TString gPathFull = gPathConfig +
"/input/" + f;
539 ifstream file(gPathFull.
Data());
540 map<Int_t, Int_t> stripChannels;
543 Int_t stripCounter = 0;
544 while (file >> channel) {
545 stripChannels[stripCounter] = channel.
Atoi();
550 return stripChannels.find(strip)->second;
556 Int_t stat = digiChannel.first.GetStation();
557 Int_t mod = digiChannel.first.GetModule();
559 Int_t channel = digiChannel.second;
561 Int_t layer = digiChannel.first.GetStripLayer();
567 if (isBig && mod == 1)
569 else if (isBig && mod == 0)
571 else if (isHot && mod == 1)
573 else if (isHot && mod == 0)
579 if (it[0] != stat || it[1] != mod)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
R__EXTERN TSystem * gSystem
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
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.
pair< Int_t, Int_t > channels
Int_t GetEntriesFast() const
friend friend class TClonesArray
const char * Data() const
static TString Format(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const