48 Long_t i_this = (Long_t)
this;
54 if( iCnaParCout == 0 )
62 if( iCnaParPaths == 0 )
70 fCnaParPaths->GetPathForResultsRootFiles();
71 fCnaParPaths->GetPathForResultsAsciiFiles();
77 {fEcal =
new TEcnaParEcal(pObjectManager, SubDet.Data()); }
83 Long_t iEcalNumbering = pObjectManager->
GetPointerValue(
"TEcnaNumbering");
84 if( iEcalNumbering == 0 )
85 {fEcalNumbering =
new TEcnaNumbering(pObjectManager, SubDet.Data()); }
89 SetEcalSubDetector(SubDet.Data());
105 if( pCnaParPaths == 0 )
112 fCnaParPaths->GetPathForResultsAsciiFiles();
115 if( pCnaParCout == 0 )
127 if( pEcalNumbering == 0 )
132 SetEcalSubDetector(SubDet.Data(), fEcal, fEcalNumbering);
140 fgMaxCar = (Int_t)512;
141 fCodeHeaderAscii = 0;
151 fCodeMeanCorss = 106;
193 fCodePrintAllComments = fCnaParCout->GetCodePrint(
"AllComments");
208 Int_t MaxCar = fgMaxCar;
209 fFlagSubDet.Resize(MaxCar);
210 fFlagSubDet = fEcal->GetEcalSubDetector();
241 fSectChanSizeX = fEcal->MaxCrysHocoInStin();
242 fSectChanSizeY = fEcal->MaxCrysVecoInStin();
243 fSectSampSizeX = fEcal->MaxSampADC();
244 fSectSampSizeY = fEcal->MaxSampADC();
273 fNbChanByLine = fEcal->MaxCrysHocoInStin();
274 fNbSampByLine = fEcal->MaxSampADC();
291 Int_t MaxCar = fgMaxCar;
292 fFlagSubDet.Resize(MaxCar);
296 if( pEcalNumbering == 0 )
297 {fEcalNumbering =
new TEcnaNumbering(SubDet.Data(), fEcal); fCnew++;}
330 fSectChanSizeX = fEcal->MaxCrysHocoInStin();
331 fSectChanSizeY = fEcal->MaxCrysVecoInStin();
332 fSectSampSizeX = fEcal->MaxSampADC();
333 fSectSampSizeY = fEcal->MaxSampADC();
362 fNbChanByLine = fEcal->MaxCrysHocoInStin();
363 fNbSampByLine = fEcal->MaxSampADC();
409 const Int_t& NbOfReqEvts,
const Int_t& StexNumber)
416 Int_t rNumberOfEvents = 0;
417 Int_t PresentNumber = 0;
418 Int_t EmptyChannel = 0;
419 Int_t DifferentMinusValue = 0;
420 Int_t DifferentPlusValue = 0;
423 for(Int_t i_SSoSE=0; i_SSoSE<MaxArray; i_SSoSE++)
425 Int_t NbOfEvts = ArrayNbOfEvts[i_SSoSE];
429 if( PresentNumber == 0 )
431 PresentNumber = NbOfEvts;
435 if( NbOfEvts > PresentNumber )
437 PresentNumber = NbOfEvts;
438 DifferentPlusValue++;
440 if( NbOfEvts < PresentNumber )
442 DifferentMinusValue++;
452 rNumberOfEvents = PresentNumber;
454 if( EmptyChannel > 0 )
456 if( MaxArray == fEcal->MaxCrysInSM() )
458 cout <<
"!TEcnaWrite::NumberOfEventsAnalysis()> *** WARNING *** "
459 << EmptyChannel <<
" empty channels detected in SM " << StexNumber
460 <<
" (EB " << fEcalNumbering->PlusMinusSMNumber(StexNumber) <<
")" << endl;
462 if( MaxArray == fEcal->MaxCrysEcnaInDee() )
464 EmptyChannel -= fEcal->EmptyChannelsInDeeMatrixIncompleteSCIncluded();
465 if( EmptyChannel > 0 )
467 cout <<
"!TEcnaWrite::NumberOfEventsAnalysis()> *** WARNING *** "
468 << EmptyChannel <<
" empty channels detected in Dee " << StexNumber << endl;
473 if( DifferentMinusValue > 0 || DifferentPlusValue > 0 )
475 cout <<
"!TEcnaWrite::NumberOfEventsAnalysis()> " << endl;
477 if( MaxArray == fEcal->MaxCrysInSM() )
479 cout <<
"************** W A R N I N G : NUMBER OF EVENTS NOT CONSTANT FOR SM " << StexNumber
480 <<
" (EB " << fEcalNumbering->PlusMinusSMNumber(StexNumber) <<
") *********************";
483 if( MaxArray == fEcal->MaxCrysEcnaInDee() )
485 cout <<
"****************** W A R N I N G : NUMBER OF EVENTS NOT CONSTANT FOR Dee " << StexNumber
486 <<
" **************************";
490 <<
" Result ROOT file: " << fRootFileName << endl
491 <<
" The number of events is not the same for all the non-empty channels." << endl
492 <<
" The maximum number (" << rNumberOfEvents <<
") is considered as the number of events for calculations "
494 <<
" of pedestals, noises and correlations." << endl
495 <<
" Number of channels with 0 < nb of evts < " << rNumberOfEvents <<
" : " << DifferentMinusValue
498 <<
" Number of empty channels : " << EmptyChannel << endl
499 <<
" Some values of pedestals, noises and correlations may be wrong for channels" << endl
500 <<
" with number of events different from " << rNumberOfEvents <<
"." << endl
501 <<
" Please, check the histogram 'Numbers of events'." << endl
502 <<
"*******************************************************************************************************"
507 if(fFlagPrint == fCodePrintAllComments)
509 if( rNumberOfEvents < NbOfReqEvts )
511 cout <<
"*TEcnaWrite::NumberOfEventsAnalysis()> *** INFO *** Number of events found in data = "
512 << rNumberOfEvents <<
": less than number of requested events ( = " << NbOfReqEvts <<
")" << endl;
516 return rNumberOfEvents;
521 const Int_t& MaxNbOfSamples,
const Int_t& NbOfReqEvts)
528 Int_t rNumberOfEvents = 0;
529 Int_t PresentNumber = 0;
530 Int_t DifferentMinusValue = 0;
531 Int_t DifferentPlusValue = 0;
533 for(Int_t i0StexEcha = 0 ; i0StexEcha < MaxCrysEcnaInStex ; i0StexEcha++)
535 for(Int_t i_samp = 0 ; i_samp < MaxNbOfSamples ; i_samp++)
537 Int_t NbOfEvts = T2d_NbOfEvts[i0StexEcha][i_samp];
541 if( PresentNumber == 0 )
543 PresentNumber = NbOfEvts;
547 if( NbOfEvts > PresentNumber )
549 PresentNumber = NbOfEvts;
550 DifferentPlusValue++;
552 if( NbOfEvts < PresentNumber )
554 DifferentMinusValue++;
561 rNumberOfEvents = PresentNumber;
563 if( DifferentMinusValue > 0 || DifferentPlusValue > 0 )
565 cout <<
"!TEcnaWrite::NumberOfEventsAnalysis()> " << endl
566 <<
"****************** W A R N I N G : NUMBER OF EVENTS NOT CONSTANT ! *********************************"
568 <<
" Result ROOT file: " << fRootFileName << endl
569 <<
" The number of events is not the same for all the non-empty channels" << endl
570 <<
" The maximum number (" << rNumberOfEvents <<
") is considered as the number of events " << endl
571 <<
" for calculations of pedestals, noises and correlations." << endl
572 <<
" Number of channels with 0 < nb of evts < " << rNumberOfEvents <<
" : " << DifferentMinusValue << endl
575 <<
" Some values of pedestals, noises and correlations may be wrong for channels" << endl
576 <<
" with number of events different from " << rNumberOfEvents <<
"." << endl
577 <<
" Please, check the histogram 'Numbers of events'." << endl
578 <<
"*******************************************************************************************************"
583 if(fFlagPrint == fCodePrintAllComments)
585 if( rNumberOfEvents < NbOfReqEvts )
587 cout <<
"*TEcnaWrite::NumberOfEventsAnalysis()> *** INFO *** Number of events found in data = "
588 << rNumberOfEvents <<
": less than number of requested events ( = " << NbOfReqEvts <<
")" << endl;
592 return rNumberOfEvents;
597 const Int_t& ArgNbOfSamples,
const Int_t& ArgRunNumber,
598 const Int_t& ArgFirstReqEvtNumber,
const Int_t& ArgLastReqEvtNumber,
599 const Int_t& ArgReqNbOfEvts,
const Int_t& ArgStexNumber)
601 fAnaType = ArgAnaType;
602 fNbOfSamples = ArgNbOfSamples;
603 fRunNumber = ArgRunNumber;
604 fFirstReqEvtNumber = ArgFirstReqEvtNumber;
605 fLastReqEvtNumber = ArgLastReqEvtNumber;
606 fReqNbOfEvts = ArgReqNbOfEvts;
607 fStexNumber = ArgStexNumber;
611 const Int_t& ArgNbOfSamples,
const Int_t& ArgRunNumber,
612 const Int_t& ArgFirstReqEvtNumber,
const Int_t& ArgLastReqEvtNumber,
613 const Int_t& ArgReqNbOfEvts,
const Int_t& ArgStexNumber,
614 const TString& ArgStartDate,
const TString& ArgStopDate,
615 const time_t ArgStartTime,
const time_t ArgStopTime)
617 fAnaType = ArgAnaType;
618 fNbOfSamples = ArgNbOfSamples;
619 fRunNumber = ArgRunNumber;
620 fFirstReqEvtNumber = ArgFirstReqEvtNumber;
621 fLastReqEvtNumber = ArgLastReqEvtNumber;
622 fReqNbOfEvts = ArgReqNbOfEvts;
623 fStexNumber = ArgStexNumber;
624 fStartDate = ArgStartDate;
626 fStopDate = ArgStopDate;
627 fStartTime = ArgStartTime;
628 fStopTime = ArgStopTime;
669 char* f_in =
new char[fgMaxCar]; fCnew++;
670 char* f_in_short =
new char[fgMaxCar]; fCnew++;
672 Int_t MaxCar = fgMaxCar;
673 fStexName.Resize(MaxCar);
674 fStexName =
"SM or Dee?";
677 fStinName.Resize(MaxCar);
678 fStinName =
"tower or SC?";
680 if( fFlagSubDet ==
"EB" ){fStexName =
"SM"; fStinName =
"tower";}
681 if( fFlagSubDet ==
"EE" ){fStexName =
"Dee"; fStinName =
"SC";}
686 TString sPointInterrog =
"?";
687 TString sDollarHome =
"$HOME";
689 if (i_code == fCodeRoot)
691 if( fCnaParPaths->ResultsRootFilePath().Data() == sPointInterrog.Data() )
693 cout <<
"!TEcnaWrite::fMakeResultsFileName> * * * W A R N I N G * * * " << endl << endl
694 <<
" Path for results .root file not defined. Default option will be used here:" << endl
695 <<
" your results files will be written in your HOME directory." << endl << endl
696 <<
" In order to write the .root results file in a specific directory," << endl
697 <<
" you have to create a file named path_results_root in a subdirectory named ECNA" << endl
698 <<
" previously created in your home directory." << endl
699 <<
" This file must have only one line containing the path of the directory" << endl
700 <<
" where must be the .root result files." << endl
703 TString home_path = gSystem->Getenv(
"HOME");
704 fCnaParPaths->SetResultsRootFilePath(home_path.Data());
707 if( fCnaParPaths->BeginningOfResultsRootFilePath().Data() == sDollarHome.Data() )
709 fCnaParPaths->TruncateResultsRootFilePath(0,5);
710 const Text_t *t_file_nohome = (
const Text_t *)fCnaParPaths->ResultsRootFilePath().Data();
712 TString home_path = gSystem->Getenv(
"HOME");
713 fCnaParPaths->SetResultsRootFilePath(home_path.Data());
714 fCnaParPaths->AppendResultsRootFilePath(t_file_nohome);
717 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d",
718 fCnaParPaths->ResultsRootFilePath().Data(), fAnaType.Data(), fNbOfSamples,
719 fRunNumber, fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
720 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d",
721 fAnaType.Data(), fNbOfSamples,
722 fRunNumber, fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
727 if (i_code != fCodeRoot)
729 if (i_code == fCodeHeaderAscii)
731 if( fCnaParPaths->ResultsAsciiFilePath().Data() == sPointInterrog.Data() )
733 cout <<
"!TEcnaWrite::fMakeResultsFileName> * * * W A R N I N G * * * " << endl << endl
734 <<
" Path for results .ascii file not defined. Default option will be used here:" << endl
735 <<
" your results files will be written in your HOME directory." << endl << endl
736 <<
" In order to write the .ascii results file in a specific directory," << endl
737 <<
" you have to create a file named path_results_ascii in a subdirectory named ECNA" << endl
738 <<
" previously created in your home directory." << endl
739 <<
" This file must have only one line containing the path of the directory" << endl
740 <<
" where must be the .ascii result files." << endl
743 TString home_path = gSystem->Getenv(
"HOME");
744 fCnaParPaths->SetResultsAsciiFilePath(home_path.Data());
747 if( fCnaParPaths->BeginningOfResultsAsciiFilePath().Data() == sDollarHome.Data() )
749 fCnaParPaths->TruncateResultsAsciiFilePath(0,5);
750 const Text_t *t_file_nohome = (
const Text_t *)fCnaParPaths->ResultsAsciiFilePath().Data();
752 TString home_path = gSystem->Getenv(
"HOME");
753 fCnaParPaths->SetResultsAsciiFilePath(home_path.Data());
754 fCnaParPaths->AppendResultsAsciiFilePath(t_file_nohome);
758 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_header",
759 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
760 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
761 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_header",
762 fAnaType.Data(), fNbOfSamples, fRunNumber,
763 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
767 if (i_code == fCodeNbOfEvts)
769 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_NbOfEvents",
770 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
771 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
772 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_NbOfEvents",
773 fAnaType.Data(), fNbOfSamples, fRunNumber,
774 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
777 if (i_code == fCodePed)
779 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_Pedestals",
780 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
781 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
782 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_Pedestals",
783 fAnaType.Data(), fNbOfSamples, fRunNumber,
784 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
787 if (i_code == fCodeTno)
789 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_TotalNoise",
790 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
791 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
792 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_TotalNoise",
793 fAnaType.Data(), fNbOfSamples, fRunNumber,
794 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
797 if (i_code == fCodeLfn)
799 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_LFNoise",
800 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
801 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
802 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_LFNoise",
803 fAnaType.Data(), fNbOfSamples, fRunNumber,
804 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
807 if (i_code == fCodeHfn)
809 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_HFNoise",
810 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
811 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
812 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_HFNoise",
813 fAnaType.Data(), fNbOfSamples, fRunNumber,
814 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
817 if (i_code == fCodeMeanCorss)
819 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_MeanCorss",
820 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
821 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
822 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_MeanCorss",
823 fAnaType.Data(), fNbOfSamples, fRunNumber,
824 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
827 if (i_code == fCodeSigCorss)
829 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_SigmaCorss",
830 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
831 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
832 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_SigmaCorss",
833 fAnaType.Data(), fNbOfSamples, fRunNumber,
834 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
837 if (i_code == fCodeCovCss)
839 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_Covss_%s%d_Channel_%d",
840 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
841 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber,
842 fStinName.Data(), fStexStinUser, fStinEchaUser);
843 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_Covss_%s%d_Channel_%d",
844 fAnaType.Data(), fNbOfSamples, fRunNumber,
845 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber,
846 fStinName.Data(), fStexStinUser, fStinEchaUser);
849 if (i_code == fCodeCorCss)
851 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_Corss_%s%d_Channel_%d",
852 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
853 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber,
854 fStinName.Data(), fStexStinUser, fStinEchaUser);
855 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_Corss_%s%d_Channel_%d",
856 fAnaType.Data(), fNbOfSamples, fRunNumber,
857 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber,
858 fStinName.Data(), fStexStinUser, fStinEchaUser);
864 if (i_code == fCodeMSp)
866 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleMeans",
867 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
868 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
869 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleMeans",
870 fAnaType.Data(), fNbOfSamples, fRunNumber,
871 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
874 if (i_code == fCodeSSp)
876 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleSigmas",
877 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
878 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
879 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleSigmas",
880 fAnaType.Data(), fNbOfSamples, fRunNumber,
881 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
884 if( i_code == fCodeAvTno)
886 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageTotalNoise_c%d",
887 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
888 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber, fStinEchaUser);
889 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageTotalNoise_c%d",
890 fAnaType.Data(), fNbOfSamples, fRunNumber,
891 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber, fStinEchaUser);
894 if( i_code == fCodeLfCov)
896 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cov",
897 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
898 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
899 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cov",
900 fAnaType.Data(), fNbOfSamples, fRunNumber,
901 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
904 if ( i_code == fCodeLfCor)
906 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cor",
907 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
908 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
909 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cor",
910 fAnaType.Data(), fNbOfSamples, fRunNumber,
911 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
914 if (i_code == fCodeAvPed)
916 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragePedestals",
917 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
918 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
919 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragePedestals",
920 fAnaType.Data(), fNbOfSamples, fRunNumber,
921 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber);
924 if (i_code == fCodeAvMeanCorss)
926 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageMeanCorss%d",
927 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
928 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber, fStinEchaUser);
929 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageMeanCorss%d",
930 fAnaType.Data(), fNbOfSamples, fRunNumber,
931 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber, fStinEchaUser);
934 if (i_code == fCodeAvSigCorss)
936 sprintf(f_in,
"%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageSigmaCorss%d",
937 fCnaParPaths->ResultsAsciiFilePath().Data(), fAnaType.Data(), fNbOfSamples, fRunNumber,
938 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber, fStinEchaUser);
939 sprintf(f_in_short,
"%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageSigmaCorss%d",
940 fAnaType.Data(), fNbOfSamples, fRunNumber,
941 fFirstReqEvtNumber, fLastReqEvtNumber, fReqNbOfEvts, fStexName.Data(), fStexNumber, fStinEchaUser);
954 char* f_name =
new char[fgMaxCar]; fCnew++;
956 for (Int_t
i = 0 ;
i < fgMaxCar ;
i++){f_name[
i] =
'\0';}
959 for (Int_t
i = 0 ;
i < fgMaxCar ;
i++)
961 if ( f_in[
i] !=
'\0' ){f_name[
i] = f_in[
i]; ii++;}
965 if ( ii+5 < fgMaxCar )
970 if ( i_code != fCodeRoot || i_code == fCodeNbOfEvts )
972 f_name[
ii] =
'.'; f_name[ii+1] =
'a';
973 f_name[ii+2] =
's'; f_name[ii+3] =
'c';
974 f_name[ii+4] =
'i'; f_name[ii+5] =
'i';
976 fAsciiFileName = f_name;
979 if ( i_code == fCodeRoot )
981 f_name[
ii] =
'.'; f_name[ii+1] =
'r';
982 f_name[ii+2] =
'o'; f_name[ii+3] =
'o'; f_name[ii+4] =
't';
984 fRootFileName = f_name;
989 cout <<
"*TEcnaWrite::fMakeResultsFileName(...)> Name too long (for f_name)."
990 <<
" No room enough for the extension. (ii = " << ii <<
")"
997 char* f_name_short =
new char[fgMaxCar]; fCnew++;
999 for (Int_t
i = 0 ;
i < fgMaxCar ;
i++){f_name_short[
i] =
'\0';}
1002 for (Int_t
i = 0 ;
i < fgMaxCar ;
i++)
1004 if ( f_in_short[
i] !=
'\0' ){f_name_short[
i] = f_in_short[
i]; ii++;}
1008 if ( ii+5 < fgMaxCar )
1013 if ( i_code != fCodeRoot || i_code == fCodeNbOfEvts )
1015 f_name_short[
ii] =
'.'; f_name_short[ii+1] =
'a';
1016 f_name_short[ii+2] =
's'; f_name_short[ii+3] =
'c';
1017 f_name_short[ii+4] =
'i'; f_name_short[ii+5] =
'i';
1019 fAsciiFileNameShort = f_name_short;
1023 if ( i_code == fCodeRoot )
1025 f_name_short[
ii] =
'.'; f_name_short[ii+1] =
'r';
1026 f_name_short[ii+2] =
'o'; f_name_short[ii+3] =
'o'; f_name_short[ii+4] =
't';
1028 fRootFileNameShort = f_name_short;
1033 cout <<
"*TEcnaWrite::fMakeResultsFileName(...)> Name too long (for f_name_short)."
1034 <<
" No room enough for the extension. (ii = " << ii <<
")"
1037 delete [] f_name; f_name = 0; fCdelete++;
1038 delete [] f_name_short; f_name_short = 0; fCdelete++;
1040 delete [] f_in; f_in = 0; fCdelete++;
1041 delete [] f_in_short; f_in_short = 0; fCdelete++;
1062 if(fAsciiFileName.BeginsWith(
"$HOME"))
1064 fAsciiFileName.Remove(0,5);
1065 TString EndOfAsciiFileName = fAsciiFileName;
1066 const Text_t *t_file_nohome = (
const Text_t *)EndOfAsciiFileName.Data();
1068 TString home_path = gSystem->Getenv(
"HOME");
1069 fAsciiFileName = home_path;
1070 fAsciiFileName.Append(t_file_nohome);
1074 fFcout_f.open(fAsciiFileName.Data());
1076 fFcout_f <<
"*** File: " << fAsciiFileName
1077 <<
" *** " << endl << endl;
1078 fFcout_f <<
"*Analysis name : " << fAnaType << endl;
1079 fFcout_f <<
"*First-Last samples : 1 - " << fNbOfSamples << endl;
1080 fFcout_f <<
"*Run number : " << fRunNumber << endl;
1081 fFcout_f <<
"*First requested event number : " << fFirstReqEvtNumber << endl;
1082 fFcout_f <<
"*Last requested event number : " << fLastReqEvtNumber << endl;
1083 fFcout_f <<
"*Requested number of events : " << fReqNbOfEvts << endl;
1084 if( fFlagSubDet ==
"EB" )
1085 {fFcout_f <<
"*SuperModule number : " << fStexNumber << endl;}
1086 if( fFlagSubDet ==
"EE" )
1087 {fFcout_f <<
"*Dee number : " << fStexNumber << endl;}
1088 fFcout_f <<
"*Date first requested event : " << fStartDate;
1089 fFcout_f <<
"*Date last requested event : " << fStopDate << endl;
1097 if(i_code == fCodeHeaderAscii){fFcout_f.close();}
1189 const TVectorD& read_histo)
1195 Int_t i_code = fCodeNbOfEvts;
1198 if( HistoCode ==
"D_NOE_ChNb" ){i_code = fCodeNbOfEvts;}
1199 if( HistoCode ==
"D_Ped_ChNb" ){i_code = fCodePed;}
1200 if( HistoCode ==
"D_TNo_ChNb" ){i_code = fCodeTno;}
1201 if( HistoCode ==
"D_LFN_ChNb" ){i_code = fCodeLfn;}
1202 if( HistoCode ==
"D_HFN_ChNb" ){i_code = fCodeHfn;}
1203 if( HistoCode ==
"D_MCs_ChNb" ){i_code = fCodeMeanCorss;}
1204 if( HistoCode ==
"D_SCs_ChNb" ){i_code = fCodeSigCorss;}
1206 fMakeResultsFileName(i_code);
1207 fAsciiFileWriteHeader(i_code);
1210 fFcout_f << setiosflags(ios::showpoint | ios::uppercase);
1211 fFcout_f << setprecision(3) << setw(6);
1212 fFcout_f.setf(ios::dec, ios::basefield);
1213 fFcout_f.setf(ios::fixed, ios::floatfield);
1214 fFcout_f.setf(ios::left, ios::adjustfield);
1215 fFcout_f.setf(ios::right, ios::adjustfield);
1217 cout << setiosflags(ios::showpoint | ios::uppercase);
1218 cout << setprecision(3) << setw(6);
1219 cout.setf(ios::dec, ios::basefield);
1220 cout.setf(ios::fixed, ios::floatfield);
1221 cout.setf(ios::left, ios::adjustfield);
1222 cout.setf(ios::right, ios::adjustfield);
1226 Int_t MaxCar = fgMaxCar;
1227 aStexName.Resize(MaxCar);
1228 aStexName =
"SM or Dee?";
1232 aStinName.Resize(MaxCar);
1233 aStinName =
"Tower or SC?";
1237 aHoco.Resize(MaxCar);
1238 aHoco =
"Eta or IX?";
1242 aVeco.Resize(MaxCar);
1243 aVeco =
"Phi or IY?";
1247 aSpecifa.Resize(MaxCar);
1252 aSpecifc.Resize(MaxCar);
1257 aSpecifd.Resize(MaxCar);
1262 aSpecife.Resize(MaxCar);
1267 aSpecif1.Resize(MaxCar);
1272 aSpecif2.Resize(MaxCar);
1275 if( fFlagSubDet ==
"EB" )
1277 aStexName =
"SM " ; aStinName =
"tower" ; aSpecifa =
" channel# ";
1278 aHoco =
" Eta "; aVeco =
" Phi "; aSpecifc =
" channel# ";
1279 aSpecifd =
" crystal# "; aSpecife =
"SM ";
1281 if( fFlagSubDet ==
"EE" )
1283 aStexName =
"Dee " ; aStinName =
" SC " ; aSpecifa =
" Sector# ";
1284 aHoco =
" IX "; aVeco =
" IY "; aSpecifc =
" crystal# ";
1285 aSpecifd =
" SC # "; aSpecife =
"Sector";
1289 for (Int_t i0StexEcha=0; i0StexEcha<HisSize; i0StexEcha++)
1291 Int_t n1StexStin = 0;
1292 Int_t StexStinEcna = 0;
1293 Int_t i0StinEcha = 0;
1294 Int_t n1StinEcha = 0;
1295 Int_t n1StexCrys = 0;
1296 Int_t n1DataSector = 0;
1299 if( fFlagSubDet ==
"EB")
1301 n1StexStin = fEcalNumbering->Get1SMTowFrom0SMEcha(i0StexEcha);
1302 StexStinEcna = n1StexStin;
1303 i0StinEcha = fEcalNumbering->Get0TowEchaFrom0SMEcha(i0StexEcha);
1304 n1StexCrys = fEcalNumbering->Get1SMCrysFrom1SMTowAnd0TowEcha(n1StexStin, i0StinEcha);
1306 if( fFlagSubDet ==
"EE")
1308 StexStinEcna = fEcalNumbering->Get1DeeSCEcnaFrom0DeeEcha(i0StexEcha);
1309 n1DataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(fStexNumber, StexStinEcna);
1310 n1SCinDS = fEcalNumbering->GetDSSCFrom1DeeSCEcna(fStexNumber, StexStinEcna);
1311 n1StexStin = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fStexNumber, StexStinEcna);
1312 n1StinEcha = fEcalNumbering->Get1SCEchaFrom0DeeEcha(i0StexEcha);
1315 if( n1StexStin > 0 )
1317 if( (fFlagSubDet ==
"EB" && i0StinEcha == 0) || (fFlagSubDet ==
"EE" && n1StinEcha == 1) )
1319 if( HistoCode ==
"D_NOE_ChNb" ){aSpecif1 =
"Number of"; aSpecif2 =
" events (requested)";}
1320 if( HistoCode ==
"D_Ped_ChNb" ){aSpecif1 =
"Pedestals"; aSpecif2 =
" ";}
1321 if( HistoCode ==
"D_TNo_ChNb" ){aSpecif1 =
" Total "; aSpecif2 =
" noise ";}
1322 if( HistoCode ==
"D_MCs_ChNb" ){aSpecif1 =
" Mean "; aSpecif2 =
" cor(s,s) ";}
1323 if( HistoCode ==
"D_LFN_ChNb" ){aSpecif1 =
" Low Fq"; aSpecif2 =
" noise ";}
1324 if( HistoCode ==
"D_HFN_ChNb" ){aSpecif1 =
" High Fq"; aSpecif2 =
" noise ";}
1325 if( HistoCode ==
"D_SCs_ChNb" ){aSpecif1 =
" Sigma of"; aSpecif2 =
" cor(s,s) ";}
1329 fFcout_f << aSpecifa.Data()
1330 <<
" " << aStinName.Data() <<
"# "
1335 << aSpecif1.Data() << endl;
1337 fFcout_f <<
" in " << aStexName.Data()
1338 <<
" in " << aStexName.Data()
1339 <<
" in " << aStinName.Data()
1340 <<
" in " << aSpecife.Data()
1341 <<
" in " << aStexName.Data()
1342 <<
" in " << aStexName.Data()
1343 << aSpecif2.Data() << endl << endl;
1346 Double_t
value = read_histo(i0StexEcha);
1348 if( fFlagSubDet ==
"EB" )
1350 fFcout_f << setw(7) << i0StexEcha
1351 << setw(8) << n1StexStin
1352 << setw(11) << i0StinEcha
1353 << setw(10) << n1StexCrys
1354 << setw(10) << (Int_t)fEcalNumbering->GetEta(fStexNumber, StexStinEcna, i0StinEcha)
1355 << setw(10) << (Int_t)fEcalNumbering->GetPhiInSM(fStexNumber, StexStinEcna, i0StinEcha);
1357 if( fFlagSubDet ==
"EE" )
1359 Int_t n1StinEcha_m = n1StinEcha-1;
1360 fFcout_f << setw(7) << n1DataSector
1361 << setw(8) << n1StexStin
1362 << setw(11) << n1StinEcha
1363 << setw(10) << n1SCinDS
1364 << setw(10) << fEcalNumbering->GetIXCrysInDee(fStexNumber, StexStinEcna, n1StinEcha_m)
1365 << setw(10) << fEcalNumbering->GetJYCrysInDee(fStexNumber, StexStinEcna, n1StinEcha_m);
1368 if( HistoCode ==
"D_NOE_ChNb")
1370 Int_t ivalue = (Int_t)value;
1371 fFcout_f << setw(13) << ivalue;
1372 fFcout_f << setw(4) <<
"(" << setw(6) << fReqNbOfEvts <<
")";
1376 fFcout_f << setw(13) <<
value;
1387 cout <<
"*TEcnaWrite::WriteAsciiHisto(...)> INFO: "
1388 <<
"histo has been written in file: " << endl
1389 <<
" " << fAsciiFileName.Data() << endl;
1406 const Int_t& user_StinEcha,
1407 const Int_t& MatSize,
1408 const TMatrixD& read_matrix)
1412 if( fFlagSubDet ==
"EB" ){fStexStinUser = user_StexStin;}
1413 if( fFlagSubDet ==
"EE" ){fStexStinUser =
1414 fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fStexNumber, user_StexStin);}
1416 if( fFlagSubDet ==
"EB" ){fStinEchaUser = user_StinEcha;}
1417 if( fFlagSubDet ==
"EE" ){fStinEchaUser = user_StinEcha+1;}
1419 Int_t i_code = fCodeCovCss;
1420 fMakeResultsFileName(i_code);
1421 fAsciiFileWriteHeader(i_code);
1423 Int_t i_pasx = fSectSampSizeX;
1424 Int_t i_pasy = fSectSampSizeY;
1426 fT2dWriteAscii(i_code, i_pasx, i_pasy, MatSize, read_matrix);
1436 const Int_t& user_StinEcha,
1437 const Int_t& MatSize,
1438 const TMatrixD& read_matrix)
1443 if( fFlagSubDet ==
"EB" ){fStexStinUser = user_StexStin;}
1444 if( fFlagSubDet ==
"EE" ){fStexStinUser =
1445 fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fStexNumber, user_StexStin);}
1447 if( fFlagSubDet ==
"EB" ){fStinEchaUser = user_StinEcha;}
1448 if( fFlagSubDet ==
"EE" ){fStinEchaUser = user_StinEcha+1;}
1450 Int_t i_code = fCodeCorCss;
1451 fMakeResultsFileName(i_code);
1452 fAsciiFileWriteHeader(i_code);
1454 Int_t i_pasx = fSectSampSizeX;
1455 Int_t i_pasy = fSectSampSizeY;
1457 fT2dWriteAscii(i_code, i_pasx, i_pasy, MatSize, read_matrix);
1470 const Int_t& i_pasx_arg,
1471 const Int_t& i_pasy_arg,
1472 const Int_t& MatSize,
1473 const TMatrixD& read_matrix)
1477 Int_t i_pasx = i_pasx_arg;
1478 Int_t i_pasy = i_pasy_arg;
1482 fFcout_f << setiosflags(ios::showpoint | ios::uppercase);
1483 fFcout_f.setf(ios::dec, ios::basefield);
1484 fFcout_f.setf(ios::fixed, ios::floatfield);
1485 fFcout_f.setf(ios::left, ios::adjustfield);
1486 fFcout_f.setf(ios::right, ios::adjustfield);
1487 fFcout_f << setprecision(3) << setw(6);
1489 cout << setiosflags(ios::showpoint | ios::uppercase);
1490 cout.setf(ios::dec, ios::basefield);
1491 cout.setf(ios::fixed, ios::floatfield);
1492 cout.setf(ios::left, ios::adjustfield);
1493 cout.setf(ios::right, ios::adjustfield);
1494 cout << setprecision(3) << setw(6);
1511 Int_t justap_chan = 0;
1513 if( fEcal->MaxCrysEcnaInStex()%fSectChanSizeX == 0 )
1514 {justap_chan = fEcal->MaxCrysEcnaInStex();}
1516 {justap_chan=((fEcal->MaxCrysEcnaInStex()/fSectChanSizeX)+1)*fSectChanSizeX;}
1520 if ( i_code == fCodeHfCov || i_code == fCodeHfCor||
1521 i_code == fCodeLfCov || i_code == fCodeLfCor ){
1522 if(fjustap_2d_cc == 0)
1525 fjustap_2d_cc =
new Double_t*[justap_chan]; fCnew++;
1526 fjustap_1d_cc =
new Double_t[justap_chan*justap_chan]; fCnew++;
1527 for(Int_t
i = 0 ;
i < justap_chan ;
i++){
1528 fjustap_2d_cc[
i] = &fjustap_1d_cc[0] +
i*justap_chan;}
1532 for(Int_t
i = 0;
i < fEcal->MaxCrysEcnaInStex();
i++){
1533 for(Int_t
j = 0;
j < fEcal->MaxCrysEcnaInStex();
j++){
1534 if ( i_code == fCodeHfCov ){
1535 fjustap_2d_cc[
i][
j] = read_matrix(
i,
j);}
1536 if ( i_code == fCodeHfCor ){
1537 fjustap_2d_cc[
i][
j] = read_matrix(
i,
j);}
1538 if ( i_code == fCodeLfCov ){
1539 fjustap_2d_cc[
i][
j] = read_matrix(
i,
j);}
1540 if ( i_code == fCodeLfCor ){
1541 fjustap_2d_cc[
i][
j] = read_matrix(
i,
j);}
1546 for(Int_t
i = fEcal->MaxCrysEcnaInStex();
i < justap_chan;
i++){
1547 for(Int_t
j = fEcal->MaxCrysEcnaInStex();
j < justap_chan;
j++){
1548 fjustap_2d_cc[
i][
j] = (Double_t)0.;}}
1554 Int_t justap_samp = 0;
1556 if ( fEcal->MaxSampADC()%fSectSampSizeX == 0 ){
1557 justap_samp = fEcal->MaxSampADC();}
1559 justap_samp=((fEcal->MaxSampADC()/fSectSampSizeX)+1)*fSectSampSizeX;}
1563 if (i_code == fCodeCovCss || i_code == fCodeCorCss ||
1564 i_code == fCodeAvMeanCorss || i_code == fCodeAvSigCorss){
1565 if(fjustap_2d_ss == 0)
1568 fjustap_2d_ss =
new Double_t*[justap_samp]; fCnew++;
1569 fjustap_1d_ss =
new Double_t[justap_samp*justap_samp]; fCnew++;
1570 for(Int_t
i = 0 ;
i < justap_samp ;
i++){
1571 fjustap_2d_ss[
i] = &fjustap_1d_ss[0] +
i*justap_samp;}
1575 for(Int_t
i = 0;
i < fEcal->MaxSampADC();
i++){
1576 for(Int_t
j = 0;
j < fEcal->MaxSampADC();
j++){
1577 if( i_code == fCodeCovCss ){
1578 fjustap_2d_ss[
i][
j] = read_matrix(
i,
j);}
1579 if( i_code == fCodeCorCss ){
1580 fjustap_2d_ss[
i][
j] = read_matrix(
i,
j);}
1581 if( i_code == fCodeAvMeanCorss ){
1582 fjustap_2d_ss[
i][
j] = read_matrix(
i,
j);}
1583 if( i_code == fCodeAvSigCorss ){
1584 fjustap_2d_ss[
i][
j] = read_matrix(
i,
j);}
1589 for(Int_t
i = fEcal->MaxSampADC();
i < justap_samp;
i++){
1590 for(Int_t
j = fEcal->MaxSampADC();
j < justap_samp;
j++){
1591 fjustap_2d_ss[
i][
j] = (Double_t)0.;}}
1601 if(i_code == fCodeHfCov)
1603 fFcout_f <<
"Covariance matrix between channels "
1604 <<
"for sample number " << fUserSamp;
1605 isx_max = justap_chan;
1606 isy_max = justap_chan;
1608 if(i_code == fCodeHfCor)
1610 fFcout_f <<
"*Correlation matrix between channels "
1611 <<
"for sample number " << fUserSamp;
1612 isx_max = justap_chan;
1613 isy_max = justap_chan;
1616 if(i_code == fCodeLfCov)
1618 fFcout_f <<
"Covariance matrix between channels "
1619 <<
"averaged on the samples ";
1620 isx_max = justap_chan;
1621 isy_max = justap_chan;
1623 if(i_code == fCodeLfCor)
1625 fFcout_f <<
"Correlation matrix between channels "
1626 <<
"averaged on the samples ";
1627 isx_max = justap_chan;
1628 isy_max = justap_chan;
1632 Int_t n1StexStin = 0;
1633 Int_t i0StinEcha = 0;
1634 Int_t n1StinEcha = 0;
1636 if( fFlagSubDet ==
"EB")
1638 n1StexStin = fStexStinUser;
1639 i0StinEcha = fEcalNumbering->Get0TowEchaFrom0SMEcha(fStinEchaUser);
1641 if( fFlagSubDet ==
"EE")
1643 n1StexStin = fStexStinUser;
1644 Int_t fStinEchaUser_m = fStinEchaUser-1;
1645 n1StinEcha = fEcalNumbering->Get1SCEchaFrom0DeeEcha(fStinEchaUser_m);
1647 TString sDeeDir = fEcalNumbering->GetDeeDirViewedFromIP(fStexNumber);
1650 if(i_code == fCodeCovCss)
1652 if( fFlagSubDet ==
"EB")
1654 fFcout_f <<
"Covariance matrix between samples "
1655 <<
"for channel number " << fStinEchaUser
1656 <<
" (" << fStinName <<
": " << n1StexStin
1657 <<
" , channel in " << fStinName <<
": " << i0StinEcha <<
")";
1659 if( fFlagSubDet ==
"EE")
1661 fFcout_f <<
"Covariance matrix between samples "
1662 <<
"for channel number " << fStinEchaUser
1663 <<
" (" << fStinName <<
": " << n1StexStin
1664 <<
" , channel in " << fStinName <<
": " << n1StinEcha <<
")";
1666 isx_max = justap_samp;
1667 isy_max = justap_samp;
1669 if(i_code == fCodeCorCss)
1671 if( fFlagSubDet ==
"EB")
1673 fFcout_f <<
"Correlation matrix between samples "
1674 <<
"for channel number " << fStinEchaUser
1675 <<
" (" << fStinName <<
": " << n1StexStin
1676 <<
" , channel in " << fStinName <<
": " << i0StinEcha <<
")";
1678 if( fFlagSubDet ==
"EE")
1680 fFcout_f <<
"Correlation matrix between samples "
1681 <<
"for channel number " << fStinEchaUser
1682 <<
" (" << fStinName <<
": " << n1StexStin
1683 <<
" , channel in " << fStinName <<
": " << n1StinEcha <<
")";
1685 isx_max = justap_samp;
1686 isy_max = justap_samp;
1689 if(i_code == fCodeAvMeanCorss)
1691 if( fFlagSubDet ==
"EB")
1693 fFcout_f <<
"Correction factors to the covariances "
1694 <<
"between samples for channel number " << fStinEchaUser
1695 <<
" (" << fStinName <<
": " << n1StexStin
1696 <<
" , channel in " << fStinName <<
": " << i0StinEcha <<
")";
1698 if( fFlagSubDet ==
"EE")
1700 fFcout_f <<
"Correction factors to the covariances "
1701 <<
"between samples for channel number " << fStinEchaUser
1702 <<
" (" << fStinName <<
": " << n1StexStin
1703 <<
" , channel in " << fStinName <<
": " << n1StinEcha <<
")";
1705 isx_max = justap_samp;
1706 isy_max = justap_samp;
1709 if(i_code == fCodeAvSigCorss)
1711 if( fFlagSubDet ==
"EB")
1713 fFcout_f <<
"Correction factors to the correlations "
1714 <<
"between samples for channel number " << fStinEchaUser
1715 <<
" ( " << fStinName <<
": " << n1StexStin
1716 <<
" , channel in " << fStinName <<
": " << i0StinEcha <<
")";
1718 if( fFlagSubDet ==
"EE")
1720 fFcout_f <<
"Correction factors to the correlations "
1721 <<
"between samples for channel number " << fStinEchaUser
1722 <<
" ( " << fStinName <<
": " << n1StexStin
1723 <<
" , channel in " << fStinName <<
": " << n1StinEcha <<
")";
1725 isx_max = justap_samp;
1726 isy_max = justap_samp;
1736 if(i_pasx > isx_max){i_pasx = isx_max;}
1739 n_sctx = isx_max/i_pasx;
1740 max_verix = n_sctx*i_pasx;
1741 if(max_verix < isx_max){ n_sctx++;}
1748 if(i_pasy > isy_max){i_pasy = isy_max;}
1751 n_scty = isy_max/i_pasy;
1752 max_veriy = n_scty*i_pasy;
1753 if(max_veriy < isy_max){ n_scty++;}
1758 if( i_code == fCodeCovCss || i_code == fCodeCorCss ||
1759 i_code == fCodeAvMeanCorss || i_code == fCodeAvSigCorss)
1761 fFcout_f <<
"sector size = " << fSectSampSizeX
1762 <<
" , number of sectors = " << n_sctx <<
" x " << n_scty
1765 if( i_code == fCodeHfCov || i_code == fCodeHfCor ||
1766 i_code == fCodeLfCov || i_code == fCodeLfCor )
1768 fFcout_f <<
"sector size = " << fSectChanSizeX
1769 <<
" , number of sectors = " << n_sctx <<
" x " << n_scty
1778 Int_t ix_inf = -i_pasx;
1780 for(Int_t nsx = 0 ; nsx < n_sctx ; nsx++)
1783 ix_inf = ix_inf + i_pasx;
1784 Int_t ix_sup = ix_inf + i_pasx;
1786 Int_t iy_inf = -i_pasy;
1788 for(Int_t nsy = 0 ; nsy < n_scty ; nsy++)
1790 iy_inf = iy_inf + i_pasy;
1791 Int_t iy_sup = iy_inf + i_pasy;
1795 if(i_code == fCodeHfCov || i_code == fCodeCovCss ||
1796 i_code == fCodeAvMeanCorss || i_code == fCodeAvSigCorss )
1798 if(i_code == fCodeHfCor || i_code == fCodeCorCss)
1801 for (Int_t iy_c = iy_inf ; iy_c < iy_sup ; iy_c++)
1803 if(i_code == fCodeHfCov || i_code == fCodeLfCov || i_code == fCodeCovCss ||
1804 i_code == fCodeAvMeanCorss ||
1805 i_code == fCodeAvSigCorss)
1806 {fFcout_f.width(8);}
1807 if(i_code == fCodeHfCor || i_code == fCodeLfCor || i_code == fCodeCorCss)
1808 {fFcout_f.width(6);}
1809 fFcout_f << iy_c <<
" ";
1811 fFcout_f << endl << endl;
1813 for (Int_t ix_c = ix_inf ; ix_c < ix_sup ; ix_c++)
1815 if(i_code == fCodeHfCov|| i_code == fCodeLfCov || i_code == fCodeCovCss ||
1816 i_code == fCodeAvMeanCorss ||
1817 i_code == fCodeAvSigCorss)
1818 {fFcout_f.width(8);}
1819 if(i_code == fCodeHfCor || i_code == fCodeLfCor || i_code == fCodeCorCss)
1820 {fFcout_f.width(6);}
1821 fFcout_f << ix_c <<
" ";
1823 for (Int_t iy_c = iy_inf ; iy_c < iy_sup ; iy_c++)
1825 if(i_code == fCodeHfCov ||
1826 i_code == fCodeLfCov ||
1827 i_code == fCodeCovCss ||
1828 i_code == fCodeAvMeanCorss ||
1829 i_code == fCodeAvSigCorss ){
1832 if(i_code == fCodeHfCor || i_code == fCodeLfCor || i_code == fCodeCorCss){
1835 if( i_code == fCodeHfCov || i_code == fCodeLfCov || i_code == fCodeHfCor){
1836 fFcout_f << fjustap_2d_cc[ix_c][iy_c] <<
" ";}
1838 if ( i_code == fCodeCovCss ||
1839 i_code == fCodeCorCss ||
1840 i_code == fCodeAvMeanCorss ||
1841 i_code == fCodeAvSigCorss )
1843 fFcout_f << fjustap_2d_ss[ix_c][iy_c] <<
" ";
1856 if(fFlagPrint != fCodePrintNoComment)
1858 cout <<
"*TEcnaWrite::fT2dWriteAscii(....)> INFO: "
1859 <<
"matrix has been written in file: " << endl
1860 <<
" " << fAsciiFileName.Data() << endl;
1879 void TEcnaWrite::WriteAsciiSampleMeans()
1883 Int_t i_code = fCodeMSp;
1884 fMakeResultsFileName(i_code);
1885 fAsciiFileWriteHeader(i_code);
1887 Int_t i_lic1 = fNbChanByLine;
1888 Int_t i_lic2 = fNbSampByLine;
1890 fT1dWriteAscii(i_code, i_lic1, i_lic2);
1899 void TEcnaWrite::WriteAsciiSampleSigmas()
1903 Int_t i_code = fCodeVar;
1904 fMakeResultsFileName(i_code);
1905 fAsciiFileWriteHeader(i_code);
1907 Int_t i_lic1 = fNbChanByLine;
1908 Int_t i_lic2 = fNbSampByLine;
1910 fT1dWriteAscii(i_code, i_lic1, i_lic2);
void fAsciiFileWriteHeader(const Int_t &)
Int_t NumberOfEventsAnalysis(Int_t **, const Int_t &, const Int_t &, const Int_t &)
void WriteAsciiCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
void RegisterFileParameters(const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &, const TString &, const time_t, const time_t)
Bool_t RegisterPointer(const TString &, const Long_t &)
TString GetAsciiFileName()
Int_t GetFirstReqEvtNumber()
void fT2dWriteAscii(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Bool_t GetPathForResultsRootFiles()
void WriteAsciiHisto(const TString &, const Int_t &, const TVectorD &)
void SetEcalSubDetector(const TString &)
void WriteAsciiCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
TString GetRootFileNameShort()
TString GetEcalSubDetector()
void fMakeResultsFileName()
TString GetRootFileName()
TString GetAnalysisName()
Long_t GetPointerValue(const TString &)