59 char* inFlnm = getenv(
"TOF1inFlnm");
60 char* outFlnm = getenv(
"TOF1outFlnm");
61 assert(inFlnm !=
nullptr);
63 TString outFile, inFile(inFlnm);
64 if (
nullptr != outFlnm)
67 outFile =
"tof1digit_";
87 BmnTof1TDC tdc1(0xFFE9DA91, 0x12, 72, 25., 1024);
88 BmnTof1TDC tdc2(0x076CCF62, 0x12, 72, 25., 1024);
89 BmnTof1TDC tdc3(0x076CAD53, 0x12, 72, 25., 1024);
90 BmnTof1TDC tdc4(0xFFE9F5CB, 0x12, 72, 25., 1024);
93 tdc2.SetNameTitle(
"TDC_N2",
"blablabla2222");
94 tdc1.SetNameTitle(
"TDC_N1",
"blablabla2222");
95 tdc3.SetNameTitle(
"TDC_N3",
"blablabla2222");
96 tdc4.SetNameTitle(
"TDC_N4",
"blablabla2222");
105 BmnTof1Configure config(3);
123 config.AddConnection(0, slote_D1,
"TDC_N1", slote_T3);
124 config.AddConnection(0, slote_D2,
"TDC_N1", slote_T2);
125 config.AddConnection(0, slote_D3,
"TDC_N1", slote_T1);
126 config.AddConnection(0, slote_D4,
"TDC_N2", slote_T3);
129 config.AddConnection(1, slote_D2,
"TDC_N2", slote_T2);
130 config.AddConnection(1, slote_D1,
"TDC_N2", slote_T1);
131 config.AddConnection(1, slote_D4,
"TDC_N3", slote_T3);
132 config.AddConnection(1, slote_D3,
"TDC_N3", slote_T2);
135 config.AddConnection(2, slote_D1,
"TDC_N3", slote_T1);
136 config.AddConnection(2, slote_D2,
"TDC_N4", slote_T3);
137 config.AddConnection(2, slote_D3,
"TDC_N4", slote_T2);
138 config.AddConnection(2, slote_D4,
"TDC_N4", slote_T1);
146 config.InstallTDC(0xFFE9DA91, 0x1690454, 4);
147 config.InstallTDC(0x076CCF62, 0x1690454, 5);
148 config.InstallTDC(0x076CAD53, 0x1690454, 6);
149 config.InstallTDC(0xFFE9F5CB, 0x1690454, 7);
158 BmnTof1TDCMapping tofMapping(&config);
164 cerr <<
"\n\t --->ERROR: opening output file:\"" << outFile.
Data() <<
"\"" << endl;
169 TTree* treeOut =
new TTree(
"cbmsim",
"only Tof1Digits now");
170 treeOut->
Branch(
"bmn_tof400", &aTofDigits);
177 cout <<
"\n input file entries: " << nEntries;
182 assert(
nullptr != aTofTDCdigit);
186 BmnTof1DigitConvertor convertor;
188 size_t tdcSerial, NtofDigits = 0;
189 int detID, stripID, stripSideID;
190 int crateSerial, crateSlote, tdcChannel, tdcType, tdcLeading, tdcValue;
194 for (
Int_t event = 0;
event < nEntries;
event++) {
200 for (
int digit = 0; digit < Ndigits; digit++)
205 crateSlote = pTDCdigit->
GetSlot();
208 tdcType = pTDCdigit->
GetType();
214 if (config.GetTDCserial(crateSerial, crateSlote, tdcSerial))
216 tdcChannel = BmnTof1TDC::GetChannel(tChannel, tHpId);
222 convertor.AddSample(tdcSerial, tdcChannel);
224 if (BmnTof1TDC::CheckTdcType(tdcSerial, tdcType))
225 if (tofMapping.Convert(tdcSerial, tdcChannel, &pTofDigit))
227 convertor.AddDigit(pTDCdigit, BmnTof1TDC::GetTDCChannel(tdcSerial, tdcChannel), pTofDigit);
233 convertor.CalcCorrelationMatrix();
235 size_t entries = convertor.Convert(aTofDigits);
236 NtofDigits += entries;
237 cout <<
"\n event# " <<
event <<
", TDC digits: " << Ndigits <<
" Tof1 digits = " << entries;
247 cout <<
"\n$TOF1inFlnm = " << inFile.
Data() <<
", $TOF1outFlnm = " << outFile.
Data()
248 <<
", NtofDigits = " << NtofDigits <<
", nEntries=" << nEntries << endl;
249 cout <<
"\nTask finished OK." << endl;