434 std::cout <<
"done filling histograms..." << std::endl;
438 <<
" entries" << std::endl;
441 std::cout <<
"hist vect is empty!" << std::endl;
448 uint8_t mac = macHist.first;
449 vector<TH1F*>* hvec = macHist.second;
451 std::cout <<
"construct instance of CrtCal for mac5 " << (short)mac << std::endl;
452 CrtCal* cal =
new CrtCal(hvec);
455 std::cout <<
"retreiving cal data..." << std::endl;
456 fMac5 = macHist.first;
457 bool* ptrActive = cal->GetActive();
458 float* ptrGain = cal->GetGain();
459 float* ptrGainErr = cal->GetGainErr();
460 float* ptrGainXsqr = cal->GetGainXsqr();
461 short* ptrGainNdf = cal->GetGainNdf();
462 float* ptrGainPed = cal->GetGainPed();
463 float* ptrGainPedErr = cal->GetGainPedErr();
464 short* ptrNpeak = cal->GetNpeak();
465 float** ptrPeakNorm = cal->GetPeakNorm();
466 float** ptrPeakNormErr = cal->GetPeakNormErr();
467 float** ptrPeakSigma = cal->GetPeakSigma();
468 float** ptrPeakSigmaErr = cal->GetPeakSigmaErr();
469 float** ptrPeakMean = cal->GetPeakMean();
470 float** ptrPeakMeanErr = cal->GetPeakMeanErr();
471 float** ptrPeakXsqr = cal->GetPeakXsqr();
472 short** ptrPeakNdf = cal->GetPeakNdf();
473 float* ptrPed = cal->GetPed();
474 float* ptrPedErr = cal->GetPedErr();
475 float* ptrPedXsqr = cal->GetPedXsqr();
476 short* ptrPedNdf = cal->GetPedNdf();
477 float* ptrPedSigma = cal->GetPedSigma();
478 float* ptrPedSigmaErr = cal->GetPedSigmaErr();
479 float* ptrPedNorm = cal->GetPedNorm();
480 float* ptrPedNormErr = cal->GetPedNormErr();
481 int* ptrThreshADC = cal->GetThreshADC();
482 float* ptrThreshPE = cal->GetThreshPE();
483 int* ptrNabove = cal->GetNabove();
486 for(
size_t i=0; i<32; i++){
487 if(ptrActive!=
nullptr)
fActive[i] = ptrActive[i];
488 if(ptrGain!=
nullptr)
fGain[i] = ptrGain[i];
489 if(ptrGainErr!=
nullptr)
fGainErr[i] = ptrGainErr[i];
490 if(ptrGainXsqr!=
nullptr)
fGainXsqr[i] = ptrGainXsqr[i];
491 if(ptrGainNdf!=
nullptr)
fGainNdf[i] = ptrGainNdf[i];
492 if(ptrGainPed!=
nullptr)
fGainPed[i] = ptrGainPed[i];
493 if(ptrGainPedErr!=
nullptr)
fGainPedErr[i] = ptrGainPedErr[i];
494 if(ptrNpeak!=
nullptr)
fNpeak[i] = ptrNpeak[i];
495 if(ptrPed!=
nullptr)
fPed[i] = ptrPed[i];
496 if(ptrPedErr!=
nullptr)
fPedErr[i] = ptrPedErr[i];
497 if(ptrPedXsqr!=
nullptr)
fPedXsqr[i] = ptrPedXsqr[i];
498 if(ptrPedNdf!=
nullptr)
fPedNdf[i] = ptrPedNdf[i];
499 if(ptrPedSigma!=
nullptr)
fPedSigma[i] = ptrPedSigma[i];
500 if(ptrPedSigmaErr!=
nullptr)
fPedSigmaErr[i] = ptrPedSigmaErr[i];
501 if(ptrPedNorm!=
nullptr)
fPedNorm[i] = ptrPedNorm[i];
502 if(ptrPedNormErr!=
nullptr)
fPedNormErr[i] = ptrPedNormErr[i];
503 if(ptrThreshADC!=
nullptr)
fThreshADC[i] = ptrThreshADC[i];
504 if(ptrThreshPE!=
nullptr)
fThreshPE[i] = ptrThreshPE[i];
505 if(ptrNabove!=
nullptr)
fNabove[i] = ptrNabove[i];
507 for(
size_t j=0; j<5; j++){
508 if(ptrPeakNorm!=
nullptr)
fPeakNorm[i][j] = ptrPeakNorm[i][j];
509 if(ptrPeakNormErr!=
nullptr)
fPeakNormErr[i][j] = ptrPeakNormErr[i][j];
510 if(ptrPeakSigma!=
nullptr)
fPeakSigma[i][j] = ptrPeakSigma[i][j];
511 if(ptrPeakSigmaErr!=
nullptr)
fPeakSigmaErr[i][j] = ptrPeakSigmaErr[i][j];
512 if(ptrPeakMean!=
nullptr)
fPeakMean[i][j] = ptrPeakMean[i][j];
513 if(ptrPeakMeanErr!=
nullptr)
fPeakMeanErr[i][j] = ptrPeakMeanErr[i][j];
514 if(ptrPeakXsqr!=
nullptr)
fPeakXsqr[i][j] = ptrPeakXsqr[i][j];
515 if(ptrPeakNdf!=
nullptr)
fPeakNdf[i][j] = ptrPeakNdf[i][j];
519 std::cout <<
"fill tree event" << std::endl;
528 else ccl =
new CrtCalTree(
pFile);
532 const size_t nRaw =
fRawTree->GetEntriesFast();
534 std::cout <<
"initiallizing time utility" << std::endl;
537 const map<size_t,size_t>* sortedToRaw = time.GetOrderedToRawMap();
538 std::cout <<
"done. sorted through " << sortedToRaw->size() <<
" entries" << std::endl;
539 if(sortedToRaw->size()!=nRaw)
540 std::cout <<
"WARNING: sort map and rawTree are of different size!" << std::endl;
545 std::cout <<
"filling AnaTree..." << std::endl;
546 for(
size_t iraw=0; iraw<nRaw; iraw++) {
550 if(iraw%10000==0)
std::cout << 100.0*iraw/nRaw <<
" %" << std::endl;
556 fMac5 = traw.GetMac(sortedToRaw->at(iraw));
557 fT0 = traw.GetAbsTime(sortedToRaw->at(iraw));
559 fPollRate = traw.GetPollRate(sortedToRaw->at(iraw));
560 if(iraw!=0 && iraw != nRaw-1)
561 fInstRate = traw.GetInstRate(sortedToRaw->at(iraw-1),sortedToRaw->at(iraw+1));
565 for(
size_t ch=0; ch<32; ch++) {
571 uint16_t adc = traw.GetADC(sortedToRaw->at(iraw),ch);
bool GetActive(uint8_t mac, uint8_t channel)
float GetPed(uint8_t mac, uint8_t channel)
map< uint8_t, vector< TH1F * > * > fMacToHistos
map< uint8_t, vector< TH1F * > * > fMacToPEHistos
float fPeakNormErr[32][5]
float fPeakSigmaErr[32][5]
float GetGain(uint8_t mac, uint8_t channel)
float fPeakMeanErr[32][5]
BEGIN_PROLOG could also be cout