45 : verbosity_(pSet.getUntrackedParameter(
"verbosity", 1
U)), nChannels_(0), iEvent_(0) {
57 std::cout <<
"*EcnaAnalyzer-constructor> Check path for resultsq Root files." << std::endl;
60 std::cout <<
"*EcnaAnalyzer-constructor> *** ERROR *** Path for result "
63 kill(getpid(), SIGUSR2);
70 std::cout <<
"*EcnaAnalyzer-constructor> *** ERROR *** Path for result "
73 kill(getpid(), SIGUSR2);
79 std::cout <<
"*EcnaAnalyzer-constructor> Parameter initialization." << std::endl;
244 for (Int_t nFedTcc = 1; nFedTcc <= MaxSMAndDS; nFedTcc++) {
248 for (Int_t nFedTcc = 1; nFedTcc <= 3; nFedTcc++) {
251 for (Int_t nFedTcc = 4; nFedTcc <= 9; nFedTcc++) {
255 for (Int_t nFedTcc = 10; nFedTcc <= 27; nFedTcc++) {
258 for (Int_t nFedTcc = 28; nFedTcc <= 45; nFedTcc++) {
262 for (Int_t nFedTcc = 46; nFedTcc <= 48; nFedTcc++) {
265 for (Int_t nFedTcc = 49; nFedTcc <= 54; nFedTcc++) {
500 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> fNbOfSamples = " <<
fNbOfSamples << std::endl;
503 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> fReqNbOfEvts = " <<
fReqNbOfEvts << std::endl;
504 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> fStexName = " <<
fStexName << std::endl;
505 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> fStexNumber = " <<
fStexNumber << std::endl;
510 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> Init done. " << std::endl;
520 std::cout << std::setiosflags(std::ios::showpoint | std::ios::uppercase);
521 std::cout << std::setprecision(3) << std::setw(6);
524 cout.setf(std::ios::left, std::ios::adjustfield);
525 cout.setf(std::ios::right, std::ios::adjustfield);
527 std::cout <<
"EcnaAnalyzer::~EcnaAnalyzer()> destructor is going to be executed." << std::endl;
537 <<
"!EcnaAnalyzer-destructor> **** ERROR **** fMyCnaEBSM = " <<
fMyCnaEBSM
538 <<
". !===> ECNA HAS NOT BEEN INITIALIZED." << std::endl
541 <<
", last event fFedId(+601) = " <<
fFedId + 601 << std::endl
556 if (
fMyCnaEBSM[iSM]->WriteRootFile() == kFALSE) {
557 std::cout <<
"!EcnaAnalyzer-destructor> PROBLEM with write ROOT file for SM" << iSM + 1 <<
fTTBELL
561 std::cout <<
"*EcnaAnalyzer-destructor> Calculations and writing on "
562 "file already done for SM "
563 << iSM + 1 << std::endl;
572 <<
"!EcnaAnalyzer-destructor> **** ERROR **** fMyCnaEEDee = " <<
fMyCnaEEDee
573 <<
". !===> ECNA HAS NOT BEEN INITIALIZED." << std::endl
576 <<
", last event fFedId(+601) = " <<
fFedId + 601 << std::endl
591 if (
fMyCnaEEDee[iDee]->WriteRootFile() == kFALSE) {
592 std::cout <<
"!EcnaAnalyzer-destructor> PROBLEM with write ROOT file "
594 << iDee + 1 <<
fTTBELL << std::endl;
597 std::cout <<
"*EcnaAnalyzer-destructor> Calculations and writing on "
598 "file already done for Dee "
599 << iDee + 1 << std::endl;
608 std::cout <<
"*EcnaAnalyzer-destructor> Status of events returned by "
609 "GetSampleAdcValues(): "
621 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
623 std::cout <<
"*EcnaAnalyzer-destructor> Run types seen in event headers "
632 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
634 std::cout <<
"*EcnaAnalyzer-destructor> Mgpa gains seen in event headers "
643 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
645 std::cout <<
"*EcnaAnalyzer-destructor> Numbers of selected events for each FED:" << std::endl;
651 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
665 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
676 std::cout <<
"*EcnaAnalyzer-destructor> End of execution." << std::endl;
688 std::cout << std::setiosflags(std::ios::showpoint | std::ios::uppercase);
689 std::cout << std::setprecision(3) << std::setw(6);
692 cout.setf(std::ios::left, std::ios::adjustfield);
693 cout.setf(std::ios::right, std::ios::adjustfield);
712 myEventHeader = pEventHeader.
product();
721 fRunNumber = (Int_t)headerItr->getRunNumber();
727 fFedId = (Int_t)headerItr->fedId() - 601;
785 fFedTcc = (Int_t)headerItr->getDccInTCCCommand();
789 if (fFedTcc < 10 || fFedTcc > 45)
846 Int_t MaxNbOfStex = 0;
874 if (Int_t(digisEB->
end() - digisEB->
begin()) >= 0 &&
875 Int_t(digisEB->
end() - digisEB->
begin()) <= Int_t(digisEB->
size())) {
884 EBDetId id_crystal(digiItr->id());
887 Int_t i0SM = id_crystal.
ism() - 1;
897 std::cout <<
"*EcnaAnalyzer::analyze(...)> ********* INIT ECNA "
901 <<
" fRunNumber = " <<
fRunNumber << std::endl
905 <<
" SM = " << i0SM + 1 << std::endl
923 time_t i_current_ev_time = (time_t)(t_current_ev_time >> 32);
924 const time_t *p_current_ev_time = &i_current_ev_time;
925 char *astime = ctime(p_current_ev_time);
934 <<
". First analyzed event date : " << astime << std::endl;
947 if (i_current_ev_time >
fTimeLast[i0SM]) {
955 Int_t
iEta = id_crystal.ietaSM();
956 Int_t iPhi = id_crystal.iphiSM();
963 Int_t NbOfSamplesFromDigis = digiItr->size();
967 if (NbOfSamplesFromDigis > 0 && NbOfSamplesFromDigis <= fMyEBEcal->MaxSampADC()) {
968 Double_t adcDBLS = (Double_t)0;
972 for (Int_t i0Sample = 0; i0Sample < 3; i0Sample++) {
973 adcDBLS += (Double_t)(
df.sample(i0Sample).adc());
975 adcDBLS /= (Double_t)3;
978 for (Int_t i0Sample = 0; i0Sample <
fNbOfSamples; i0Sample++) {
979 Double_t
adc = (Double_t)(
df.sample(i0Sample).adc()) - adcDBLS;
990 std::cout <<
"EcnaAnalyzer::analyze(...)> "
991 "NbOfSamplesFromDigis out of bounds = "
992 << NbOfSamplesFromDigis << std::endl;
1031 if (Int_t(digisEE->
end() - digisEE->
begin()) >= 0 &&
1032 Int_t(digisEE->
end() - digisEE->
begin()) <= Int_t(digisEE->
size())) {
1040 EEDetId id_crystal(digiItr->id());
1042 Int_t iX_data = id_crystal.
ix();
1043 Int_t iY_data = id_crystal.iy();
1044 Int_t i_quad = id_crystal.iquadrant();
1045 Int_t i_sgnZ = id_crystal.zside();
1053 if (i_quad == 1 || i_quad == 4) {
1056 if (i_quad == 3 || i_quad == 2) {
1063 Int_t n1DeeNumber = 0;
1064 if (i_quad == 1 && i_sgnZ == 1) {
1067 if (i_quad == 1 && i_sgnZ == -1) {
1070 if (i_quad == 2 && i_sgnZ == 1) {
1073 if (i_quad == 2 && i_sgnZ == -1) {
1076 if (i_quad == 3 && i_sgnZ == 1) {
1079 if (i_quad == 3 && i_sgnZ == -1) {
1082 if (i_quad == 4 && i_sgnZ == 1) {
1085 if (i_quad == 4 && i_sgnZ == -1) {
1089 Int_t i0Dee = n1DeeNumber - 1;
1099 std::cout <<
"*EcnaAnalyzer::analyze(...)> ********* INIT ECNA "
1103 <<
" fRunNumber = " <<
fRunNumber << std::endl
1107 <<
" Dee = " << i0Dee + 1 << std::endl
1115 Bool_t cOKForTreatment = kFALSE;
1129 cOKForTreatment = kTRUE;
1148 cOKForTreatment = kTRUE;
1160 cOKForTreatment = kTRUE;
1164 if (cOKForTreatment == kTRUE) {
1169 time_t i_current_ev_time = (time_t)(t_current_ev_time >> 32);
1170 const time_t *p_current_ev_time = &i_current_ev_time;
1171 char *astime = ctime(p_current_ev_time);
1184 std::cout <<
"----- beginning of analysis for " <<
fStexName << i0Dee + 1 <<
"-------"
1192 <<
" First event date = " << astime << std::endl
1194 <<
"-----------------------------------------------"
1204 if (i_current_ev_time >
fTimeLast[i0Dee]) {
1216 Int_t NbOfSamplesFromDigis = digiItr->size();
1220 if (NbOfSamplesFromDigis > 0 && NbOfSamplesFromDigis <= fMyEEEcal->MaxSampADC()) {
1221 Double_t adcDBLS = (Double_t)0;
1225 for (Int_t i0Sample = 0; i0Sample < 3; i0Sample++) {
1226 adcDBLS += (Double_t)(
df.sample(i0Sample).adc());
1228 adcDBLS /= (Double_t)3;
1231 for (Int_t i0Sample = 0; i0Sample <
fNbOfSamples; i0Sample++) {
1232 Double_t
adc = (Double_t)(
df.sample(i0Sample).adc()) - adcDBLS;
1243 std::cout <<
"EcnaAnalyzer::analyze(...)> "
1244 "NbOfSamplesFromDigis out of bounds = "
1245 << NbOfSamplesFromDigis << std::endl;
1331 for (Int_t i0FedES = 0; i0FedES <= 3; i0FedES++) {
1349 for (Int_t i0FedES = 5; i0FedES <= 8; i0FedES++) {
1358 for (Int_t i0FedES = 9; i0FedES <= 12; i0FedES++) {
1376 for (Int_t i0FedES = 14; i0FedES <= 17; i0FedES++) {
1384 for (Int_t i0Dee = 0; i0Dee < 4; i0Dee++) {
1413 std::cout <<
"---------- End of analysis for " <<
fStexName << i0Stex + 1 <<
" -----------" << std::endl;
1426 <<
"---------------------------------------------------------" << std::endl;
1441 if (
fMyCnaEBSM[i0Stex]->WriteRootFile() == kFALSE) {
1442 std::cout <<
"!EcnaAnalyzer::analyze> PROBLEM with write ROOT file for SM" << i0Stex + 1 <<
fTTBELL
1450 std::cout <<
"!EcnaAnalyzer::analyze> Set memory free: delete done for SM " << i0Stex + 1 << std::endl;
1465 if (
fMyCnaEEDee[i0Stex]->WriteRootFile() == kFALSE) {
1466 std::cout <<
"!EcnaAnalyzer::analyze> PROBLEM with write ROOT file "
1468 << i0Stex + 1 <<
fTTBELL << std::endl;
1475 std::cout <<
"!EcnaAnalyzer::analyze> Set memory free: delete done for Dee " << i0Stex + 1 << std::endl;
1479 std::cout <<
"*----------------------------------------------------------"
1480 "------------------ "
1493 if (s_opt ==
"EVT") {
1494 Int_t MaxNbOfStex = 0;
1506 <<
"**************************** ANALYSIS REPORT > OK "
1507 "**************************************"
1509 <<
"*EcnaAnalyzer::AnalysisOutcome(...)> The maximum requested "
1510 "number of events and the maximum"
1512 <<
" number of treated " <<
fStexName <<
"'s have been reached."
1514 <<
" Analysis successfully "
1515 "ended from EcnaAnalyzer "
1518 "kill(getpid(),SIGUSR2)."
1520 <<
" Number of selected "
1523 <<
" Last requested event "
1526 <<
" Current event number "
1533 std::cout <<
"***********************************************************"
1534 "*****************************"
1539 kill(getpid(), SIGUSR2);
1545 <<
"**************************** ANALYSIS REPORT >>> *** "
1546 "WARNING *** WARNING *** WARNING ***"
1548 <<
"*EcnaAnalyzer::AnalysisOutcome(...)> Last event reached "
1549 "before completion of analysis."
1551 <<
" Analysis ended from "
1555 "kill(getpid(),SIGUSR2)."
1557 <<
" Number of selected "
1560 <<
" Last requested event "
1563 <<
" Current event number "
1570 std::cout <<
"***********************************************************"
1571 "*****************************"
1576 kill(getpid(), SIGUSR2);
1579 if (s_opt ==
"ERR_FNEG") {
1581 <<
"**************************** ANALYSIS REPORT >>> **** ERROR **** "
1582 "ERROR **** ERROR ******"
1584 <<
"*EcnaAnalyzer::AnalysisOutcome(...)> First event number = " <<
fFirstReqEvent
1585 <<
". Should be strictly potitive." << std::endl
1586 <<
" Analysis ended from EcnaAnalyzer " << std::endl
1587 <<
" by SIGNAL: kill(getpid(),SIGUSR2)." << std::endl;
1589 std::cout <<
"***********************************************************"
1590 "*****************************"
1595 kill(getpid(), SIGUSR2);
1597 if (s_opt ==
"ERR_LREQ") {
1599 <<
"**************************** ANALYSIS REPORT >>> **** ERROR **** "
1600 "ERROR **** ERROR ******"
1602 <<
"*EcnaAnalyzer::analyze(...)> Requested number of events = " <<
fReqNbOfEvts <<
"." << std::endl
1603 <<
" Too large compared to the event "
1606 <<
" Analysis ended from EcnaAnalyzer " << std::endl
1607 <<
" by SIGNAL: kill(getpid(),SIGUSR2)." << std::endl;
1609 std::cout <<
"***********************************************************"
1610 "*****************************"
1615 kill(getpid(), SIGUSR2);
1630 std::cout <<
"---------------- CROSS-CHECK A ------------------ " << std::endl
1631 <<
"**************** CURRENT EVENT ****************** " << std::endl;
1634 std::cout <<
"---------------- CROSS-CHECK B ------------------ " << std::endl
1635 <<
"**** FIRST EVENT PASSING USER'S ANALYSIS CUT **** " << std::endl;
1638 std::cout <<
"---------------- CROSS-CHECK C ------------------ " << std::endl
1639 <<
"*** CURRENT VALUES BEFORE RESULT FILE WRITING *** " << std::endl;
1641 if (MsgNum == 3 || MsgNum == 4) {
1643 <<
" fEvtNumber = " <<
fEvtNumber << std::endl;
1648 <<
" fRunNumber = " <<
fRunNumber << std::endl
1651 <<
" fFedTcc = " <<
fFedTcc << std::endl
1652 <<
" fFedId(+601) = " <<
fFedId + 601 << std::endl
1653 <<
" fStexName = " <<
fStexName << std::endl
1670 std::cout <<
fStexName << std::setw(3) << j0Stex + 1 <<
": " << std::setw(5) << nStexNbOfTreatedEvents
1672 if (j0Stex == i0Stex) {
1689 std::cout <<
"Fed (ES) " << std::setw(3) << i0FedES + 1 <<
": " << std::setw(5) << nFedNbOfTreatedEvents
1698 if (j0Stex == i0Stex) {
1709 if (MsgNum == 1 || MsgNum == 2) {
1710 std::cout <<
"*------------------------------------------------------------"
1715 std::cout <<
"*............................................................"
1723 TString cType =
"?";
1738 cType =
"LASER_STD";
1741 cType =
"LASER_POWER_SCAN";
1744 cType =
"LASER_DELAY_SCAN";
1747 cType =
"TESTPULSE_SCAN_MEM";
1750 cType =
"TESTPULSE_MGPA";
1753 cType =
"PEDESTAL_STD";
1755 if (numtype == 10) {
1756 cType =
"PEDESTAL_OFFSET_SCAN";
1758 if (numtype == 11) {
1759 cType =
"PEDESTAL_25NS_SCAN";
1761 if (numtype == 12) {
1765 if (numtype == 13) {
1766 cType =
"PHYSICS_GLOBAL";
1768 if (numtype == 14) {
1769 cType =
"COSMICS_GLOBAL";
1771 if (numtype == 15) {
1772 cType =
"HALO_GLOBAL";
1775 if (numtype == 16) {
1776 cType =
"LASER_GAP";
1778 if (numtype == 17) {
1779 cType =
"TESTPULSE_GAP";
1781 if (numtype == 18) {
1782 cType =
"PEDESTAL_GAP";
1784 if (numtype == 19) {
1788 if (numtype == 20) {
1789 cType =
"PHYSICS_LOCAL";
1791 if (numtype == 21) {
1792 cType =
"COSMICS_LOCAL";
1794 if (numtype == 22) {
1795 cType =
"HALO_LOCAL";
1797 if (numtype == 23) {
1798 cType =
"CALIB_LOCAL";
1802 if (numtype == 24) {
1805 if (numtype == 25) {