44 : verbosity_(pSet.getUntrackedParameter(
"verbosity", 1
U)), nChannels_(0), iEvent_(0) {
56 std::cout <<
"*EcnaAnalyzer-constructor> Check path for resultsq Root files." << std::endl;
59 std::cout <<
"*EcnaAnalyzer-constructor> *** ERROR *** Path for result " 62 kill(getpid(), SIGUSR2);
69 std::cout <<
"*EcnaAnalyzer-constructor> *** ERROR *** Path for result " 72 kill(getpid(), SIGUSR2);
78 std::cout <<
"*EcnaAnalyzer-constructor> Parameter initialization." << std::endl;
243 for (Int_t nFedTcc = 1; nFedTcc <= MaxSMAndDS; nFedTcc++) {
247 for (Int_t nFedTcc = 1; nFedTcc <= 3; nFedTcc++) {
250 for (Int_t nFedTcc = 4; nFedTcc <= 9; nFedTcc++) {
254 for (Int_t nFedTcc = 10; nFedTcc <= 27; nFedTcc++) {
257 for (Int_t nFedTcc = 28; nFedTcc <= 45; nFedTcc++) {
261 for (Int_t nFedTcc = 46; nFedTcc <= 48; nFedTcc++) {
264 for (Int_t nFedTcc = 49; nFedTcc <= 54; nFedTcc++) {
499 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> fNbOfSamples = " <<
fNbOfSamples << std::endl;
502 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> fReqNbOfEvts = " <<
fReqNbOfEvts << std::endl;
503 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> fStexName = " <<
fStexName << std::endl;
504 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> fStexNumber = " <<
fStexNumber << std::endl;
509 std::cout <<
"*EcnaAnalyzer::EcnaAnalyzer-constructor> Init done. " << std::endl;
519 std::cout << std::setiosflags(std::ios::showpoint | std::ios::uppercase);
520 std::cout << std::setprecision(3) << std::setw(6);
523 cout.setf(std::ios::left, std::ios::adjustfield);
524 cout.setf(std::ios::right, std::ios::adjustfield);
526 std::cout <<
"EcnaAnalyzer::~EcnaAnalyzer()> destructor is going to be executed." << std::endl;
536 <<
"!EcnaAnalyzer-destructor> **** ERROR **** fMyCnaEBSM = " <<
fMyCnaEBSM 537 <<
". !===> ECNA HAS NOT BEEN INITIALIZED." << std::endl
540 <<
", last event fFedId(+601) = " <<
fFedId + 601 << std::endl
555 if (
fMyCnaEBSM[iSM]->WriteRootFile() == kFALSE) {
556 std::cout <<
"!EcnaAnalyzer-destructor> PROBLEM with write ROOT file for SM" << iSM + 1 <<
fTTBELL 560 std::cout <<
"*EcnaAnalyzer-destructor> Calculations and writing on " 561 "file already done for SM " 562 << iSM + 1 << std::endl;
571 <<
"!EcnaAnalyzer-destructor> **** ERROR **** fMyCnaEEDee = " <<
fMyCnaEEDee 572 <<
". !===> ECNA HAS NOT BEEN INITIALIZED." << std::endl
575 <<
", last event fFedId(+601) = " <<
fFedId + 601 << std::endl
590 if (
fMyCnaEEDee[iDee]->WriteRootFile() == kFALSE) {
591 std::cout <<
"!EcnaAnalyzer-destructor> PROBLEM with write ROOT file " 593 << iDee + 1 <<
fTTBELL << std::endl;
596 std::cout <<
"*EcnaAnalyzer-destructor> Calculations and writing on " 597 "file already done for Dee " 598 << iDee + 1 << std::endl;
607 std::cout <<
"*EcnaAnalyzer-destructor> Status of events returned by " 608 "GetSampleAdcValues(): " 620 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
622 std::cout <<
"*EcnaAnalyzer-destructor> Run types seen in event headers " 631 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
633 std::cout <<
"*EcnaAnalyzer-destructor> Mgpa gains seen in event headers " 642 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
644 std::cout <<
"*EcnaAnalyzer-destructor> Numbers of selected events for each FED:" << std::endl;
650 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
664 std::cout << std::endl <<
"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " << std::endl;
675 std::cout <<
"*EcnaAnalyzer-destructor> End of execution." << std::endl;
687 std::cout << std::setiosflags(std::ios::showpoint | std::ios::uppercase);
688 std::cout << std::setprecision(3) << std::setw(6);
691 cout.setf(std::ios::left, std::ios::adjustfield);
692 cout.setf(std::ios::right, std::ios::adjustfield);
711 myEventHeader = pEventHeader.
product();
720 fRunNumber = (Int_t)headerItr->getRunNumber();
726 fFedId = (Int_t)headerItr->fedId() - 601;
784 fFedTcc = (Int_t)headerItr->getDccInTCCCommand();
788 if (fFedTcc < 10 || fFedTcc > 45)
845 Int_t MaxNbOfStex = 0;
873 if (Int_t(digisEB->
end() - digisEB->
begin()) >= 0 &&
874 Int_t(digisEB->
end() - digisEB->
begin()) <= Int_t(digisEB->
size())) {
883 EBDetId id_crystal(digiItr->id());
886 Int_t i0SM = id_crystal.
ism() - 1;
896 std::cout <<
"*EcnaAnalyzer::analyze(...)> ********* INIT ECNA " 900 <<
" fRunNumber = " <<
fRunNumber << std::endl
904 <<
" SM = " << i0SM + 1 << std::endl
922 time_t i_current_ev_time = (time_t)(t_current_ev_time >> 32);
923 const time_t *p_current_ev_time = &i_current_ev_time;
924 char *astime = ctime(p_current_ev_time);
933 <<
". First analyzed event date : " << astime << std::endl;
946 if (i_current_ev_time >
fTimeLast[i0SM]) {
954 Int_t
iEta = id_crystal.ietaSM();
955 Int_t iPhi = id_crystal.iphiSM();
962 Int_t NbOfSamplesFromDigis = digiItr->size();
966 if (NbOfSamplesFromDigis > 0 && NbOfSamplesFromDigis <= fMyEBEcal->MaxSampADC()) {
967 Double_t adcDBLS = (Double_t)0;
971 for (Int_t i0Sample = 0; i0Sample < 3; i0Sample++) {
972 adcDBLS += (Double_t)(
df.sample(i0Sample).adc());
974 adcDBLS /= (Double_t)3;
977 for (Int_t i0Sample = 0; i0Sample <
fNbOfSamples; i0Sample++) {
978 Double_t
adc = (Double_t)(
df.sample(i0Sample).adc()) - adcDBLS;
989 std::cout <<
"EcnaAnalyzer::analyze(...)> " 990 "NbOfSamplesFromDigis out of bounds = " 991 << NbOfSamplesFromDigis << std::endl;
1030 if (Int_t(digisEE->
end() - digisEE->
begin()) >= 0 &&
1031 Int_t(digisEE->
end() - digisEE->
begin()) <= Int_t(digisEE->
size())) {
1039 EEDetId id_crystal(digiItr->id());
1041 Int_t iX_data = id_crystal.
ix();
1042 Int_t iY_data = id_crystal.iy();
1043 Int_t i_quad = id_crystal.iquadrant();
1044 Int_t i_sgnZ = id_crystal.zside();
1052 if (i_quad == 1 || i_quad == 4) {
1055 if (i_quad == 3 || i_quad == 2) {
1062 Int_t n1DeeNumber = 0;
1063 if (i_quad == 1 && i_sgnZ == 1) {
1066 if (i_quad == 1 && i_sgnZ == -1) {
1069 if (i_quad == 2 && i_sgnZ == 1) {
1072 if (i_quad == 2 && i_sgnZ == -1) {
1075 if (i_quad == 3 && i_sgnZ == 1) {
1078 if (i_quad == 3 && i_sgnZ == -1) {
1081 if (i_quad == 4 && i_sgnZ == 1) {
1084 if (i_quad == 4 && i_sgnZ == -1) {
1088 Int_t i0Dee = n1DeeNumber - 1;
1098 std::cout <<
"*EcnaAnalyzer::analyze(...)> ********* INIT ECNA " 1102 <<
" fRunNumber = " <<
fRunNumber << std::endl
1106 <<
" Dee = " << i0Dee + 1 << std::endl
1114 Bool_t cOKForTreatment = kFALSE;
1128 cOKForTreatment = kTRUE;
1147 cOKForTreatment = kTRUE;
1159 cOKForTreatment = kTRUE;
1163 if (cOKForTreatment == kTRUE) {
1168 time_t i_current_ev_time = (time_t)(t_current_ev_time >> 32);
1169 const time_t *p_current_ev_time = &i_current_ev_time;
1170 char *astime = ctime(p_current_ev_time);
1183 std::cout <<
"----- beginning of analysis for " <<
fStexName << i0Dee + 1 <<
"-------" 1191 <<
" First event date = " << astime << std::endl
1193 <<
"-----------------------------------------------" 1203 if (i_current_ev_time >
fTimeLast[i0Dee]) {
1215 Int_t NbOfSamplesFromDigis = digiItr->size();
1219 if (NbOfSamplesFromDigis > 0 && NbOfSamplesFromDigis <= fMyEEEcal->MaxSampADC()) {
1220 Double_t adcDBLS = (Double_t)0;
1224 for (Int_t i0Sample = 0; i0Sample < 3; i0Sample++) {
1225 adcDBLS += (Double_t)(
df.sample(i0Sample).adc());
1227 adcDBLS /= (Double_t)3;
1230 for (Int_t i0Sample = 0; i0Sample <
fNbOfSamples; i0Sample++) {
1231 Double_t
adc = (Double_t)(
df.sample(i0Sample).adc()) - adcDBLS;
1242 std::cout <<
"EcnaAnalyzer::analyze(...)> " 1243 "NbOfSamplesFromDigis out of bounds = " 1244 << NbOfSamplesFromDigis << std::endl;
1330 for (Int_t i0FedES = 0; i0FedES <= 3; i0FedES++) {
1348 for (Int_t i0FedES = 5; i0FedES <= 8; i0FedES++) {
1357 for (Int_t i0FedES = 9; i0FedES <= 12; i0FedES++) {
1375 for (Int_t i0FedES = 14; i0FedES <= 17; i0FedES++) {
1383 for (Int_t i0Dee = 0; i0Dee < 4; i0Dee++) {
1412 std::cout <<
"---------- End of analysis for " <<
fStexName << i0Stex + 1 <<
" -----------" << std::endl;
1425 <<
"---------------------------------------------------------" << std::endl;
1440 if (
fMyCnaEBSM[i0Stex]->WriteRootFile() == kFALSE) {
1441 std::cout <<
"!EcnaAnalyzer::analyze> PROBLEM with write ROOT file for SM" << i0Stex + 1 <<
fTTBELL 1449 std::cout <<
"!EcnaAnalyzer::analyze> Set memory free: delete done for SM " << i0Stex + 1 << std::endl;
1464 if (
fMyCnaEEDee[i0Stex]->WriteRootFile() == kFALSE) {
1465 std::cout <<
"!EcnaAnalyzer::analyze> PROBLEM with write ROOT file " 1467 << i0Stex + 1 <<
fTTBELL << std::endl;
1474 std::cout <<
"!EcnaAnalyzer::analyze> Set memory free: delete done for Dee " << i0Stex + 1 << std::endl;
1478 std::cout <<
"*----------------------------------------------------------" 1479 "------------------ " 1492 if (s_opt ==
"EVT") {
1493 Int_t MaxNbOfStex = 0;
1505 <<
"**************************** ANALYSIS REPORT > OK " 1506 "**************************************" 1508 <<
"*EcnaAnalyzer::AnalysisOutcome(...)> The maximum requested " 1509 "number of events and the maximum" 1511 <<
" number of treated " <<
fStexName <<
"'s have been reached." 1513 <<
" Analysis successfully " 1514 "ended from EcnaAnalyzer " 1517 "kill(getpid(),SIGUSR2)." 1519 <<
" Number of selected " 1522 <<
" Last requested event " 1525 <<
" Current event number " 1532 std::cout <<
"***********************************************************" 1533 "*****************************" 1538 kill(getpid(), SIGUSR2);
1544 <<
"**************************** ANALYSIS REPORT >>> *** " 1545 "WARNING *** WARNING *** WARNING ***" 1547 <<
"*EcnaAnalyzer::AnalysisOutcome(...)> Last event reached " 1548 "before completion of analysis." 1550 <<
" Analysis ended from " 1554 "kill(getpid(),SIGUSR2)." 1556 <<
" Number of selected " 1559 <<
" Last requested event " 1562 <<
" Current event number " 1569 std::cout <<
"***********************************************************" 1570 "*****************************" 1575 kill(getpid(), SIGUSR2);
1578 if (s_opt ==
"ERR_FNEG") {
1580 <<
"**************************** ANALYSIS REPORT >>> **** ERROR **** " 1581 "ERROR **** ERROR ******" 1583 <<
"*EcnaAnalyzer::AnalysisOutcome(...)> First event number = " <<
fFirstReqEvent 1584 <<
". Should be strictly potitive." << std::endl
1585 <<
" Analysis ended from EcnaAnalyzer " << std::endl
1586 <<
" by SIGNAL: kill(getpid(),SIGUSR2)." << std::endl;
1588 std::cout <<
"***********************************************************" 1589 "*****************************" 1594 kill(getpid(), SIGUSR2);
1596 if (s_opt ==
"ERR_LREQ") {
1598 <<
"**************************** ANALYSIS REPORT >>> **** ERROR **** " 1599 "ERROR **** ERROR ******" 1601 <<
"*EcnaAnalyzer::analyze(...)> Requested number of events = " <<
fReqNbOfEvts <<
"." << std::endl
1602 <<
" Too large compared to the event " 1605 <<
" Analysis ended from EcnaAnalyzer " << std::endl
1606 <<
" by SIGNAL: kill(getpid(),SIGUSR2)." << std::endl;
1608 std::cout <<
"***********************************************************" 1609 "*****************************" 1614 kill(getpid(), SIGUSR2);
1629 std::cout <<
"---------------- CROSS-CHECK A ------------------ " << std::endl
1630 <<
"**************** CURRENT EVENT ****************** " << std::endl;
1633 std::cout <<
"---------------- CROSS-CHECK B ------------------ " << std::endl
1634 <<
"**** FIRST EVENT PASSING USER'S ANALYSIS CUT **** " << std::endl;
1637 std::cout <<
"---------------- CROSS-CHECK C ------------------ " << std::endl
1638 <<
"*** CURRENT VALUES BEFORE RESULT FILE WRITING *** " << std::endl;
1640 if (MsgNum == 3 || MsgNum == 4) {
1642 <<
" fEvtNumber = " <<
fEvtNumber << std::endl;
1647 <<
" fRunNumber = " <<
fRunNumber << std::endl
1650 <<
" fFedTcc = " <<
fFedTcc << std::endl
1651 <<
" fFedId(+601) = " <<
fFedId + 601 << std::endl
1652 <<
" fStexName = " <<
fStexName << std::endl
1669 std::cout <<
fStexName << std::setw(3) << j0Stex + 1 <<
": " << std::setw(5) << nStexNbOfTreatedEvents
1671 if (j0Stex == i0Stex) {
1688 std::cout <<
"Fed (ES) " << std::setw(3) << i0FedES + 1 <<
": " << std::setw(5) << nFedNbOfTreatedEvents
1697 if (j0Stex == i0Stex) {
1708 if (MsgNum == 1 || MsgNum == 2) {
1709 std::cout <<
"*------------------------------------------------------------" 1714 std::cout <<
"*............................................................" 1722 TString cType =
"?";
1737 cType =
"LASER_STD";
1740 cType =
"LASER_POWER_SCAN";
1743 cType =
"LASER_DELAY_SCAN";
1746 cType =
"TESTPULSE_SCAN_MEM";
1749 cType =
"TESTPULSE_MGPA";
1752 cType =
"PEDESTAL_STD";
1754 if (numtype == 10) {
1755 cType =
"PEDESTAL_OFFSET_SCAN";
1757 if (numtype == 11) {
1758 cType =
"PEDESTAL_25NS_SCAN";
1760 if (numtype == 12) {
1764 if (numtype == 13) {
1765 cType =
"PHYSICS_GLOBAL";
1767 if (numtype == 14) {
1768 cType =
"COSMICS_GLOBAL";
1770 if (numtype == 15) {
1771 cType =
"HALO_GLOBAL";
1774 if (numtype == 16) {
1775 cType =
"LASER_GAP";
1777 if (numtype == 17) {
1778 cType =
"TESTPULSE_GAP";
1780 if (numtype == 18) {
1781 cType =
"PEDESTAL_GAP";
1783 if (numtype == 19) {
1787 if (numtype == 20) {
1788 cType =
"PHYSICS_LOCAL";
1790 if (numtype == 21) {
1791 cType =
"COSMICS_LOCAL";
1793 if (numtype == 22) {
1794 cType =
"HALO_LOCAL";
1796 if (numtype == 23) {
1797 cType =
"CALIB_LOCAL";
1801 if (numtype == 24) {
1804 if (numtype == 25) {
Int_t * fStexNbOfTreatedEvents
std::string digiProducer_
T getParameter(std::string const &) const
void GetReadyToReadData(const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Int_t * fBuildEventDistribBad
TString runtype(const Int_t &)
Int_t fChozenRunTypeNumber
EcnaAnalyzer(const edm::ParameterSet &)
Int_t fMaxMgpaGainCounter
TString GetDeeDirViewedFromIP(const Int_t &)
T const * product() const
std::vector< T >::const_iterator const_iterator
Int_t * fFedNbOfTreatedEvents
TEcnaNumbering * fMyEENumbering
Int_t Get0TowEchaFrom1SMCrys(const Int_t &)
Int_t gainvalue(const Int_t &)
Int_t Get1DeeSCEcnaFrom1DeeCrys(const Int_t &, const TString &)
Bool_t AnalysisOutcome(const TString &)
void CheckMsg(const Int_t &, const Int_t &)
Int_t fCurrentEventNumber
Int_t Get1SMTowFrom1SMCrys(const Int_t &)
std::string EBdigiCollection_
Int_t fMaxTreatedStexCounter
unsigned long long Time_t
Int_t Get1SCEchaFrom1DeeCrys(const Int_t &, const TString &)
Int_t fNbOfSelectedEvents
int ism() const
get the ECAL/SM id
TEcnaNumbering * fMyEBNumbering
const_iterator begin() const
Int_t * fBuildEventDistribGood
unsigned long long TimeValue_t
Int_t * fNbOfTreatedFedsInStex
Bool_t GetPathForResultsRootFiles()
const_iterator end() const
const_iterator end() const
std::string eventHeaderProducer_
const_iterator begin() const
The iterator returned can not safely be used across threads.
TString * fDeeNumberString
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
TString ResultsRootFilePath()
std::string eventHeaderCollection_
void analyze(const edm::Event &, const edm::EventSetup &) override
std::string EEdigiCollection_
Int_t * fMemoDateFirstEvent
void StartStopTime(time_t, time_t)
TEcnaObject * fMyEcnaEBObjectManager
TEcnaObject * fMyEcnaEEObjectManager
uint16_t *__restrict__ uint16_t const *__restrict__ adc
void StartStopDate(const TString &, const TString &)
Int_t * fNbOfTreatedFedsInDee