25 printf(
"Starting scan\n");
26 TString name = TString::Format(
"BSpectrum_%c",mode);
27 TString title = TString::Format(
"b-spectrum from %c",mode);
28 TH1D * pH =
new TH1D(name.Data(),title.Data(),100,0,20);
30 TClonesArray * pArrayOfBmnZDCDigit =
new TClonesArray(
"BmnZDCDigit");
31 fInpChain.SetBranchAddress(
"ZDC",&pArrayOfBmnZDCDigit);
33 FairMCEventHeader * pHeader =
new FairMCEventHeader();
34 fInpChain.SetBranchAddress(
"MCEventHeader.",&pHeader);
36 UInt_t entries = fInpChain.GetEntries();
37 if (fMaxEntries && entries > fMaxEntries) entries = fMaxEntries;
39 printf(
"Started for %u entries\n", entries);
41 if (fIndex)
delete fIndex;
44 fIndex =
new Item[entries];
47 UInt_t percent = entries / 100;
48 for (UInt_t
i = 0;
i < entries;
i++) {
49 fInpChain.GetEntry(
i);
51 OnEvent(pArrayOfBmnZDCDigit,mode,pHeader->GetB());
53 if (fShowProgress && percent > 0 &&
i%percent == 0)
DrawBar(
i, entries);
56 std::sort(fIndex, fIndex + fIndexSize, BmnZdcBScanner::compareItem);
61 scanValue = fEventData.
GetA();
64 scanValue = fEventData.
GetE();
67 scanValue = fEventData.
GetHits();
70 scanValue = fEventData.
GetM();
73 printf(
"Unexpected mode '%c'\n",mode);
77 OnScan(fScanWidth,scanValue,pH);