141 TString brName =
"EventHeader";
144 if (!in[0].IsNull()) {
145 fIn1->Add(in[0].Data());
155 if (!in[1].IsNull()) {
156 fIn2->Add(in[1].Data());
167 if (!in[2].IsNull()) {
168 fIn3->Add(in[2].Data());
282 if (!files[0].IsNull()) {
283 fIn1->Add(files[0].Data());
289 if (!files[1].IsNull()) {
290 fIn2->Add(files[1].Data());
325 if (!files[2].IsNull()) {
326 fIn3->Add(files[2].Data());
383 nDets = files.size();
447 TString detsRun6[] = {
"GEM",
"SILICON",
"ZDC",
"T0",
"BC1",
"BC2",
"VETO",
448 "FD",
"BD",
"MWPC",
"DCH",
"TOF400",
"TOF700",
"ECAL"};
449 TString detsRun7[] = {
"BC1",
"BC2",
"BC3",
"VC",
"Si",
"BD",
"ZDC",
"GEM",
450 "SILICON",
"MWPC",
"DCH",
"TOF400",
"ECAL",
"CSC",
"TOF700"};
451 TString detsRun7Src[] = {
"GEM",
"SILICON",
"CSC",
"BC1",
"BC2",
"BC3",
"BC4",
452 "TQDC_BC1",
"TQDC_BC2",
"TQDC_BC3",
"TQDC_BC4",
"X1L",
"X2L",
"Y1L",
453 "Y2L",
"X1R",
"X2R",
"Y1R",
"Y2R",
"TQDC_X1L",
"TQDC_X2L",
454 "TQDC_Y1L",
"TQDC_Y2L",
"TQDC_X1R",
"TQDC_X2R",
"TQDC_Y1R",
"TQDC_Y2R",
"VETO",
455 "TQDC_VETO",
"TOF700",
"ZDC",
"MWPC",
"DCH",
"TOF400",
"ECAL"};
479 fInArrs[iDet] = (
isRun6) ? inArrsRun6[iDet] : inArrsRun7[iDet];
481 fInArrs[iDet] = inArrsRun7Src[iDet];
483 fInFiles[iDet]->Add(files[iDet].Data());
487 fInFiles[iDet]->SetBranchAddress(detsRun7Src[iDet].Data(), &
fInArrs[iDet]);
498 UInt_t runId = evHead->GetRunId();
505 TString detsRun6[] = {
"GEM",
"SILICON",
"ZDC",
"T0",
"BC1",
"BC2",
"VETO",
506 "FD",
"BD",
"MWPC",
"DCH",
"TOF400",
"TOF700",
"ECAL"};
507 TString detsRun7[] = {
"BC1",
"BC2",
"BC3",
"VC",
"Si",
"BD",
"ZDC",
"GEM",
508 "SILICON",
"MWPC",
"DCH",
"TOF400",
"ECAL",
"CSC",
"TOF700"};
509 TString detsRun7Src[] = {
"GEM",
"SILICON",
"CSC",
"BC1",
"BC2",
"BC3",
"BC4",
510 "TQDC_BC1",
"TQDC_BC2",
"TQDC_BC3",
"TQDC_BC4",
"X1L",
"X2L",
"Y1L",
511 "Y2L",
"X1R",
"X2R",
"Y1R",
"Y2R",
"TQDC_X1L",
"TQDC_X2L",
512 "TQDC_Y1L",
"TQDC_Y2L",
"TQDC_X1R",
"TQDC_X2R",
"TQDC_Y1R",
"TQDC_Y2R",
"VETO",
513 "TQDC_VETO",
"TOF700",
"ZDC",
"MWPC",
"DCH",
"TOF400",
"ECAL"};
585 fGem,
fSil,
fCsc,
fBC1,
fBC2,
fBC3,
fBC4,
fBC1TQDC,
fBC2TQDC,
fBC3TQDC,
fBC4TQDC,
fX1L,
586 fX2L,
fY1L,
fY2L,
fX1R,
fX2R,
fY1R,
fY2R,
fX1LTQDC,
fX2LTQDC,
fY1LTQDC,
fY2LTQDC,
fX1RTQDC,
587 fX2RTQDC,
fY1RTQDC,
fY2RTQDC,
fVeto,
fVetoTQDC,
fTof700,
fZdc,
fMwpc,
fDch,
fTof400,
fEcal};
732 fGem,
fSil,
fCsc,
fBC1,
fBC2,
fBC3,
fBC4,
fBC1TQDC,
fBC2TQDC,
fBC3TQDC,
fBC4TQDC,
fX1L,
733 fX2L,
fY1L,
fY2L,
fX1R,
fX2R,
fY1R,
fY2R,
fX1LTQDC,
fX2LTQDC,
fY1LTQDC,
fY2LTQDC,
fX1RTQDC,
734 fX2RTQDC,
fY1RTQDC,
fY2RTQDC,
fVeto,
fVetoTQDC,
fTof700,
fZdc,
fMwpc,
fDch,
fTof400,
fEcal};
747 map<Int_t, TClonesArray*> detsAndOutTrees1;
748 map<Int_t, TClonesArray*> detsAndOutTrees2;
749 map<Int_t, TClonesArray*> detsAndOutTrees3;
751 for (
Int_t iDet = 0; iDet < 3; iDet++)
752 detsAndOutTrees1[iDet] =
fOutArrs[iDet];
754 for (
Int_t iDet = 3; iDet < 31; iDet++)
755 detsAndOutTrees2[iDet] =
fOutArrs[iDet];
758 detsAndOutTrees3[iDet] =
fOutArrs[iDet];
760 for (
Int_t iEntry = 0; iEntry <
fIn1->GetEntries(); iEntry++) {
761 fIn1->GetEntry(iEntry);
763 if (iEntry % 10000 == 0)
764 cout <<
"Event# " << iEntry << endl;
766 for (
auto it : detsAndOutTrees1)
781 statsGem[iStat] = -1;
782 statsGemPermut[iStat] = -1;
786 statsSil[iStat] = -1;
787 statsSilPermut[iStat] = -1;
790 Run7(statsGem, statsSil, statsGemPermut, statsSilPermut);
793 fGemStats[statsGem[iStat]] = statsGemPermut[iStat];
796 fSilStats[statsSil[iStat]] = statsSilPermut[iStat];
799 for (UInt_t iDigi = 0; iDigi <
fGemDigits->GetEntriesFast(); iDigi++) {
809 if (stat == 5 || stat == 7 || stat == 9) {
815 cout <<
"Something went wrong!" << endl;
819 new ((*fGem)[
fGem->GetEntriesFast()])
842 cout <<
"Something went wrong!" << endl;
849 cout <<
"Something went wrong!" << endl;
852 new ((*fCsc)[
fCsc->GetEntriesFast()])
858 for (UInt_t iDigi = 0; iDigi <
fSilDigits->GetEntriesFast(); iDigi++) {
873 for (
auto it : detsAndOutTrees1)
877 for (
Int_t iEntry = 0; iEntry <
fIn2->GetEntries(); iEntry++) {
878 fIn2->GetEntry(iEntry);
880 if (iEntry % 10000 == 0)
881 cout <<
"Event# " << iEntry << endl;
883 for (
auto it : detsAndOutTrees2)
897 const Int_t nTrigs = 13;
898 const Int_t nTqdcTrigs = 13;
912 for (
Int_t iTrig = 0; iTrig < nTrigs; iTrig++)
916 for (
Int_t iTqdcTrig = 0; iTqdcTrig < nTqdcTrigs; iTqdcTrig++)
917 if (tqdcTrigsIn[iTqdcTrig])
920 for (
auto it : detsAndOutTrees2)
924 for (
Int_t iEntry = 0; iEntry <
fIn3->GetEntries(); iEntry++) {
925 fIn3->GetEntry(iEntry);
927 if (iEntry % 10000 == 0)
928 cout <<
"Event# " << iEntry << endl;
930 for (
auto it : detsAndOutTrees3)
949 for (
auto it : detsAndOutTrees3)
956 map<Int_t, TClonesArray*> detsAndOutTrees1;
957 map<Int_t, TClonesArray*> detsAndOutTrees2;
958 map<Int_t, TClonesArray*> detsAndOutTrees3;
960 for (
Int_t iDet = 0; iDet < 2; iDet++)
961 detsAndOutTrees1[iDet] =
fOutArrs[iDet];
963 for (
Int_t iDet = 2; iDet < 3; iDet++)
964 detsAndOutTrees2[iDet] =
fOutArrs[iDet];
967 detsAndOutTrees3[iDet] =
fOutArrs[iDet];
969 for (
Int_t iEntry = 0; iEntry <
fIn1->GetEntries(); iEntry++) {
970 fIn1->GetEntry(iEntry);
972 if (iEntry % 10000 == 0)
973 cout <<
"Event# " << iEntry << endl;
975 for (
auto it : detsAndOutTrees1)
990 for (
auto it : detsAndOutTrees1)
994 for (
Int_t iEntry = 0; iEntry <
fIn2->GetEntries(); iEntry++) {
995 fIn2->GetEntry(iEntry);
997 if (iEntry % 10000 == 0)
998 cout <<
"Event# " << iEntry << endl;
1000 for (
auto it : detsAndOutTrees2)
1001 it.second->Delete();
1010 for (
auto it : detsAndOutTrees2)
1014 for (
Int_t iEntry = 0; iEntry <
fIn3->GetEntries(); iEntry++) {
1015 fIn3->GetEntry(iEntry);
1017 if (iEntry % 10000 == 0)
1018 cout <<
"Event# " << iEntry << endl;
1020 for (
auto it : detsAndOutTrees3)
1021 it.second->Delete();
1028 const Int_t nTrigs = 6;
1032 for (
Int_t iTrig = 0; iTrig < nTrigs; iTrig++)
1051 for (
auto it : detsAndOutTrees3)
1059 map<Int_t, TClonesArray*> detsAndOutTrees1;
1060 map<Int_t, TClonesArray*> detsAndOutTrees2;
1061 map<Int_t, TClonesArray*> detsAndOutTrees3;
1063 for (
Int_t iDet = 7; iDet < 14; iDet++)
1064 detsAndOutTrees1[iDet] =
fOutArrs[iDet];
1066 for (
Int_t iDet = 0; iDet < 7; iDet++)
1067 detsAndOutTrees2[iDet] =
fOutArrs[iDet];
1070 detsAndOutTrees3[iDet] =
fOutArrs[iDet];
1072 for (
Int_t iEntry = 0; iEntry <
fIn1->GetEntries(); iEntry++) {
1073 fIn1->GetEntry(iEntry);
1075 if (iEntry % 10000 == 0)
1076 cout <<
"Event# " << iEntry << endl;
1078 for (
auto it : detsAndOutTrees1)
1079 it.second->Delete();
1093 statsGem[iStat] = -1;
1094 statsGemPermut[iStat] = -1;
1098 statsSil[iStat] = -1;
1099 statsSilPermut[iStat] = -1;
1102 Run7(statsGem, statsSil, statsGemPermut, statsSilPermut);
1105 fGemStats[statsGem[iStat]] = statsGemPermut[iStat];
1108 fSilStats[statsSil[iStat]] = statsSilPermut[iStat];
1111 for (UInt_t iDigi = 0; iDigi <
fGemDigits->GetEntriesFast(); iDigi++) {
1124 if (stat == 0 || stat == 3 || stat == 5) {
1130 cout <<
"Something went wrong!" << endl;
1134 new ((*fGem)[
fGem->GetEntriesFast()])
1157 cout <<
"Something went wrong!" << endl;
1164 cout <<
"Something went wrong!" << endl;
1167 new ((*fCsc)[
fCsc->GetEntriesFast()])
1173 for (UInt_t iDigi = 0; iDigi <
fSilDigits->GetEntriesFast(); iDigi++) {
1202 for (
auto it : detsAndOutTrees1)
1206 for (
Int_t iEntry = 0; iEntry <
fIn2->GetEntries(); iEntry++) {
1207 fIn2->GetEntry(iEntry);
1208 if (iEntry % 10000 == 0)
1209 cout <<
"Event# " << iEntry << endl;
1211 for (
auto it : detsAndOutTrees2)
1212 it.second->Delete();
1219 const Int_t nTrigs = 6;
1223 for (
Int_t iTrig = 0; iTrig < nTrigs; iTrig++)
1230 for (
auto it : detsAndOutTrees2)
1234 for (
Int_t iEntry = 0; iEntry <
fIn3->GetEntries(); iEntry++) {
1235 fIn3->GetEntry(iEntry);
1237 if (iEntry % 10000 == 0)
1238 cout <<
"Event# " << iEntry << endl;
1240 for (
auto it : detsAndOutTrees3)
1241 it.second->Delete();
1249 for (
auto it : detsAndOutTrees3)
1256 vector<UInt_t> nums;
1258 nums.push_back(
fInFiles[iDet]->GetEntries());
1260 maxEvId = *max_element(nums.begin(), nums.end()) + 100;
1263 for (UInt_t iEle = 0; iEle <
maxEvId; iEle++)
1272 for (
Int_t iEntry = 0; iEntry <
fInFiles[iDet]->GetEntries(); iEntry++) {
1283 for (UInt_t iEvId = 0; iEvId <
maxEvId; iEvId++) {
1344 cout <<
"Det# " << iDet <<
" Event# " <<
evId_evNum[iEvId][iDet] << endl;
1367 statsGemPermut[0] = 0;
1368 statsGemPermut[1] = 1;
1369 statsGemPermut[2] = 2;
1370 statsGemPermut[3] = 3;
1371 statsGemPermut[4] = 4;
1372 statsGemPermut[5] = 5;
1378 statsSilPermut[0] = 0;
1379 statsSilPermut[1] = 1;
1380 statsSilPermut[2] = 2;
1394 statsGemPermut[0] = 0;
1395 statsGemPermut[1] = 1;
1396 statsGemPermut[2] = 2;
1397 statsGemPermut[3] = 3;
1398 statsGemPermut[4] = 4;
1399 statsGemPermut[5] = 5;
1400 statsGemPermut[6] = 6;
1401 statsGemPermut[7] = 7;
1402 statsGemPermut[8] = 8;
1403 statsGemPermut[9] = 9;
1409 statsSilPermut[0] = 0;
1410 statsSilPermut[1] = 1;
1411 statsSilPermut[2] = 2;
1413 cout <<
"Configuration not defined!" << endl;
1422 TString confSi = (!
isSrc) ?
"SiliconRunSpring2018.xml" :
isSrc ?
"SiliconRunSRCSpring2018.xml" :
"";
1423 TString confGem = (!
isSrc) ?
"GemRunSpring2018.xml" :
isSrc ?
"GemRunSRCSpring2018.xml" :
"";
1424 TString confCsc =
"CSCRunSpring2018.xml";
1427 TString gPathSiliconConfig = gPathConfig +
"/parameters/silicon/XMLConfigs/";
1431 TString gPathGemConfig = gPathConfig +
"/parameters/gem/XMLConfigs/";
1435 TString gPathCscConfig = gPathConfig +
"/parameters/csc/XMLConfigs/";
R__EXTERN TSystem * gSystem
TClonesArray * fBC4TQDCDigits
TClonesArray * fGemDigits
BmnCSCStationSet * fDetectorCSC
TClonesArray * fZdcDigits
void GlueEventsFromInputFiles()
map< Int_t, Int_t > fGemStats
TClonesArray * fVetoTQDCDigits
TClonesArray * fY1RDigits
TClonesArray * fBC3Digits
Int_t GemStatPermutation(Int_t stat)
BmnEventHeader ** fHeaders
TClonesArray * fY2RTQDCDigits
TClonesArray * fX1RDigits
TClonesArray * fY1LTQDCDigits
TClonesArray * fBC2Digits
BmnEventHeader * fHeader2Obj
TClonesArray * fTof700Digits
TClonesArray * fBC1Digits
void SplitToDetectorsRun7()
TClonesArray * fTof400Digits
TClonesArray * fY1LDigits
void FillDetDigi(TClonesArray *inDigiArr, TClonesArray *outDigiArr)
TClonesArray * fX1RTQDCDigits
BmnEventHeader * fHeaderOut
void SplitToDetectorsSrc()
TClonesArray * fBC1TQDCDigits
TClonesArray * fX2RDigits
TClonesArray * fY1RTQDCDigits
BmnSiliconStationSet * fDetectorSI
TClonesArray * fBC3TQDCDigits
TClonesArray * fBC2TQDCDigits
TClonesArray * fBC4Digits
BmnGemStripStationSet * fDetectorGEM
TClonesArray * fEcalDigits
TClonesArray * fSilDigits
TClonesArray * fCscDigits
TClonesArray * fMwpcDigits
void Run7(Int_t *, Int_t *, Int_t *, Int_t *)
void CreateOutputFile(TString)
TClonesArray * fY2LDigits
map< Int_t, Int_t > fSilStats
BmnEventHeader * fHeader3Obj
TClonesArray * fX2LTQDCDigits
BmnDigiMergeTask()
Default constructor.
TClonesArray * fY2LTQDCDigits
TClonesArray * fY2RDigits
TClonesArray * fVetoDigits
TClonesArray * fX2RTQDCDigits
TClonesArray * fX1LTQDCDigits
TClonesArray * fDchDigits
TClonesArray * fX1LDigits
void SplitToDetectorsRun6()
TClonesArray * fX2LDigits
Int_t SiliconStatPermutation(Int_t stat)
void SetIsGoodDigit(Bool_t tmp)
void SetStation(Int_t station)
void SetStripLayer(Int_t layer)
Double_t GetStripSignal()
void SetModule(Int_t module)
friend friend class TClonesArray
const char * Data() const
static TString Format(const char *fmt,...)