CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
TEcnaWrite Class Reference

#include <TEcnaWrite.h>

Inheritance diagram for TEcnaWrite:

Public Member Functions

void fMakeResultsFileName ()
 
void fMakeResultsFileName (const Int_t &)
 
TString GetAnalysisName ()
 
TString GetAsciiFileName ()
 
Int_t GetFirstReqEvtNumber ()
 
Int_t GetNbOfSamples ()
 
Int_t GetReqNbOfEvts ()
 
TString GetRootFileName ()
 
TString GetRootFileNameShort ()
 
Int_t GetRunNumber ()
 
Int_t GetStexNumber ()
 
void Init ()
 
Int_t NumberOfEventsAnalysis (Int_t **, const Int_t &, const Int_t &, const Int_t &)
 
Int_t NumberOfEventsAnalysis (Int_t *, const Int_t &, const Int_t &, const Int_t &)
 
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)
 
void RegisterFileParameters (const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
 
void SetEcalSubDetector (const TString &)
 
void SetEcalSubDetector (const TString &, const TEcnaParEcal *, const TEcnaNumbering *)
 
 TEcnaWrite ()
 
 TEcnaWrite (TEcnaObject *, const TString &)
 
 TEcnaWrite (const TString &, const TEcnaParPaths *, const TEcnaParCout *, const TEcnaParEcal *, const TEcnaNumbering *)
 
void WriteAsciiCorrelationsBetweenSamples (const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
 
void WriteAsciiCovariancesBetweenSamples (const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
 
void WriteAsciiHisto (const TString &, const Int_t &, const TVectorD &)
 
virtual ~TEcnaWrite ()
 

Public Attributes

TString fAnaType
 
TString fAsciiFileName
 
TString fAsciiFileNameShort
 
Int_t fFirstReqEvtNumber
 
Int_t fLastReqEvtNumber
 
Int_t fNbOfSamples
 
TString fPathForAsciiFiles
 
Int_t fReqNbOfEvts
 
TString fRootFileName
 
TString fRootFileNameShort
 
Int_t fRunNumber
 
TString fStartDate
 
time_t fStartTime
 
TString fStexName
 
Int_t fStexNumber
 
TString fStinName
 
TString fStopDate
 
time_t fStopTime
 

Private Member Functions

void fAsciiFileWriteHeader (const Int_t &)
 
void fT2dWriteAscii (const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
 

Private Attributes

Int_t fCdelete
 
Int_t fCdeleteRoot
 
Int_t fCnaCommand
 
Int_t fCnaError
 
TEcnaParCoutfCnaParCout
 
TEcnaParPathsfCnaParPaths
 
Int_t fCnew
 
Int_t fCnewRoot
 
Int_t fCodeAdcEvt
 
Int_t fCodeAvMeanCorss
 
Int_t fCodeAvPed
 
Int_t fCodeAvSigCorss
 
Int_t fCodeAvTno
 
Int_t fCodeCorCss
 
Int_t fCodeCovCss
 
Int_t fCodeHeaderAscii
 
Int_t fCodeHFccMoStins
 
Int_t fCodeHfCor
 
Int_t fCodeHfCov
 
Int_t fCodeHfn
 
Int_t fCodeLFccMoStins
 
Int_t fCodeLfCor
 
Int_t fCodeLfCov
 
Int_t fCodeLfn
 
Int_t fCodeMeanCorss
 
Int_t fCodeMSp
 
Int_t fCodeNbOfEvts
 
Int_t fCodePed
 
Int_t fCodePrintAllComments
 
Int_t fCodePrintComments
 
Int_t fCodePrintNoComment
 
Int_t fCodePrintWarnings
 
Int_t fCodeRoot
 
Int_t fCodeSigCorss
 
Int_t fCodeSSp
 
Int_t fCodeTno
 
TEcnaParEcalfEcal
 
TEcnaNumberingfEcalNumbering
 
std::ofstream fFcout_f
 
Int_t fFlagPrint
 
TString fFlagSubDet
 
Int_t fgMaxCar
 
Double_t * fjustap_1d_cc
 
Double_t * fjustap_1d_ev
 
Double_t * fjustap_1d_ss
 
Double_t * fjustap_1d_var
 
Double_t ** fjustap_2d_cc
 
Double_t ** fjustap_2d_ev
 
Double_t ** fjustap_2d_ss
 
Double_t ** fjustap_2d_var
 
Int_t fNbChanByLine
 
Int_t fNbSampByLine
 
Int_t fSectChanSizeX
 
Int_t fSectChanSizeY
 
Int_t fSectSampSizeX
 
Int_t fSectSampSizeY
 
Int_t fStexStinUser
 
Int_t fStinEchaUser
 
TString fTTBELL
 
Int_t fUserSamp
 

Detailed Description


TEcnaWrite.h Update: 05/10/2012 Authors: B.Fabbro (berna.nosp@m.rd.f.nosp@m.abbro.nosp@m.@cea.nosp@m..fr), FX Gentit DSM/IRFU/SPP CEA-Saclay Copyright: Those valid for CEA sofware

ECNA web page: http://cms-fabbro.web.cern.ch/cms-fabbro/

cna_new/Correlated_Noise_Analysis/ECNA_main_page.htm

Definition at line 34 of file TEcnaWrite.h.

Constructor & Destructor Documentation

TEcnaWrite::TEcnaWrite ( )

Definition at line 34 of file TEcnaWrite.cc.

References Init().

35 {
36 
37  // std::cout << "[Info Management] CLASS: TEcnaWrite. CREATE OBJECT: this = " << this << std::endl;
38 
39  Init();
40 }
void Init()
Definition: TEcnaWrite.cc:135
TEcnaWrite::TEcnaWrite ( TEcnaObject pObjectManager,
const TString &  SubDet 
)

Definition at line 42 of file TEcnaWrite.cc.

References fCnaParCout, fCnaParPaths, fEcal, fEcalNumbering, TEcnaParPaths::GetPathForResultsAsciiFiles(), TEcnaParPaths::GetPathForResultsRootFiles(), TEcnaObject::GetPointerValue(), Init(), TEcnaObject::RegisterPointer(), and SetEcalSubDetector().

43 {
44  // std::cout << "[Info Management] CLASS: TEcnaWrite. CREATE OBJECT: this = " << this << std::endl;
45 
46  Init();
47  Long_t i_this = (Long_t)this;
48  pObjectManager->RegisterPointer("TEcnaWrite", i_this);
49 
50  //............................ fCnaParCout
51  fCnaParCout = 0;
52  Long_t iCnaParCout = pObjectManager->GetPointerValue("TEcnaParCout");
53  if( iCnaParCout == 0 )
54  {fCnaParCout = new TEcnaParCout(pObjectManager); /*fCnew++*/}
55  else
56  {fCnaParCout = (TEcnaParCout*)iCnaParCout;}
57 
58  //............................ fCnaParPaths
59  fCnaParPaths = 0;
60  Long_t iCnaParPaths = pObjectManager->GetPointerValue("TEcnaParPaths");
61  if( iCnaParPaths == 0 )
62  {fCnaParPaths = new TEcnaParPaths(pObjectManager); /*fCnew++*/}
63  else
64  {fCnaParPaths = (TEcnaParPaths*)iCnaParPaths;}
65 
66  //fCfgResultsRootFilePath = fCnaParPaths->ResultsRootFilePath();
67  //fCfgHistoryRunListFilePath = fCnaParPaths->HistoryRunListFilePath();
68 
71 
72  //............................ fEcal => should be changed in fParEcal
73  fEcal = 0;
74  Long_t iParEcal = pObjectManager->GetPointerValue("TEcnaParEcal");
75  if( iParEcal == 0 )
76  {fEcal = new TEcnaParEcal(pObjectManager, SubDet.Data()); /*fCnew++*/}
77  else
78  {fEcal = (TEcnaParEcal*)iParEcal;}
79 
80  //............................ fEcalNumbering
81  fEcalNumbering = 0;
82  Long_t iEcalNumbering = pObjectManager->GetPointerValue("TEcnaNumbering");
83  if( iEcalNumbering == 0 )
84  {fEcalNumbering = new TEcnaNumbering(pObjectManager, SubDet.Data()); /*fCnew++*/}
85  else
86  {fEcalNumbering = (TEcnaNumbering*)iEcalNumbering;}
87 
88  SetEcalSubDetector(SubDet.Data());
89 }
void Init()
Definition: TEcnaWrite.cc:135
TEcnaParPaths * fCnaParPaths
Definition: TEcnaWrite.h:58
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:54
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:105
Bool_t GetPathForResultsRootFiles()
void SetEcalSubDetector(const TString &)
Definition: TEcnaWrite.cc:204
TEcnaParCout * fCnaParCout
Definition: TEcnaWrite.h:59
Bool_t GetPathForResultsAsciiFiles()
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:232
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:57
TEcnaWrite::TEcnaWrite ( const TString &  SubDet,
const TEcnaParPaths pCnaParPaths,
const TEcnaParCout pCnaParCout,
const TEcnaParEcal pEcal,
const TEcnaNumbering pEcalNumbering 
)

Definition at line 91 of file TEcnaWrite.cc.

References fCnaParCout, fCnaParPaths, fEcal, fEcalNumbering, TEcnaParPaths::GetPathForResultsAsciiFiles(), TEcnaParPaths::GetPathForResultsRootFiles(), Init(), and SetEcalSubDetector().

96 {
97 
98  // std::cout << "[Info Management] CLASS: TEcnaWrite. CREATE OBJECT: this = " << this << std::endl;
99 
100  Init();
101 
102  //----------------------------- Object management
103  fCnaParPaths = 0;
104  if( pCnaParPaths == 0 )
105  {fCnaParPaths = new TEcnaParPaths(); /*fCnew++*/ ;}
106  else
107  {fCnaParPaths = (TEcnaParPaths*)pCnaParPaths;}
108 
109  //................. Get paths from ECNA directory
110 
113 
114  fCnaParCout = 0;
115  if( pCnaParCout == 0 )
116  {fCnaParCout = new TEcnaParCout(); /*fCnew++*/;}
117  else
118  {fCnaParCout = (TEcnaParCout*)pCnaParCout;}
119 
120  fEcal = 0;
121  if( pEcal == 0 )
122  {fEcal = new TEcnaParEcal(SubDet.Data()); /*fCnew++*/;}
123  else
124  {fEcal = (TEcnaParEcal*)pEcal;}
125 
126  fEcalNumbering = 0;
127  if( pEcalNumbering == 0 )
128  {fEcalNumbering = new TEcnaNumbering(SubDet.Data(), fEcal); /*fCnew++*/;}
129  else
130  {fEcalNumbering = (TEcnaNumbering*)pEcalNumbering;}
131 
132  SetEcalSubDetector(SubDet.Data(), fEcal, fEcalNumbering);
133 }
void Init()
Definition: TEcnaWrite.cc:135
TEcnaParPaths * fCnaParPaths
Definition: TEcnaWrite.h:58
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:54
Bool_t GetPathForResultsRootFiles()
void SetEcalSubDetector(const TString &)
Definition: TEcnaWrite.cc:204
TEcnaParCout * fCnaParCout
Definition: TEcnaWrite.h:59
Bool_t GetPathForResultsAsciiFiles()
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:57
virtual TEcnaWrite::~TEcnaWrite ( )
virtual

Member Function Documentation

void TEcnaWrite::fAsciiFileWriteHeader ( const Int_t &  i_code)
private

Definition at line 1051 of file TEcnaWrite.cc.

References fAnaType, fAsciiFileName, fCodeHeaderAscii, fFcout_f, fFirstReqEvtNumber, fFlagSubDet, fLastReqEvtNumber, fNbOfSamples, fReqNbOfEvts, fRunNumber, fStartDate, fStexNumber, and fStopDate.

Referenced by WriteAsciiCorrelationsBetweenSamples(), WriteAsciiCovariancesBetweenSamples(), and WriteAsciiHisto().

1052 {
1053 //Ascii results file header writing (private). Called by the WriteAscii...() methods
1054 
1055  //-----------------------------------------------
1056  //
1057  // opening of the ASCII results file
1058  // and writing of its header
1059  //
1060  //-----------------------------------------------
1061 
1062  if(fAsciiFileName.BeginsWith("$HOME"))
1063  {
1064  fAsciiFileName.Remove(0,5);
1065  TString EndOfAsciiFileName = fAsciiFileName;
1066  const Text_t *t_file_nohome = (const Text_t *)EndOfAsciiFileName.Data(); // const Text_t* -> EndOfAsciiFileName
1067  // ( /scratch0/cna/... )
1068  TString home_path = gSystem->Getenv("HOME");
1069  fAsciiFileName = home_path; // fAsciiFileName = absolute HOME path ( /afs/cern.ch/u/USER )
1070  fAsciiFileName.Append(t_file_nohome); // Append (const Text_t* -> EndOfAsciiFileName) to fAsciiFileName
1071  // ( /afs/cern.ch/u/USER/scratch0/cna/... )
1072  }
1073 
1074  fFcout_f.open(fAsciiFileName.Data());
1075 
1076  fFcout_f << "*** File: " << fAsciiFileName
1077  << " *** " << std::endl << std::endl;
1078  fFcout_f << "*Analysis name : " << fAnaType << std::endl;
1079  fFcout_f << "*First-Last samples : 1 - " << fNbOfSamples << std::endl;
1080  fFcout_f << "*Run number : " << fRunNumber << std::endl;
1081  fFcout_f << "*First requested event number : " << fFirstReqEvtNumber << std::endl;
1082  fFcout_f << "*Last requested event number : " << fLastReqEvtNumber << std::endl;
1083  fFcout_f << "*Requested number of events : " << fReqNbOfEvts << std::endl;
1084  if( fFlagSubDet == "EB" )
1085  {fFcout_f << "*SuperModule number : " << fStexNumber << std::endl;}
1086  if( fFlagSubDet == "EE" )
1087  {fFcout_f << "*Dee number : " << fStexNumber << std::endl;}
1088  fFcout_f << "*Date first requested event : " << fStartDate;
1089  fFcout_f << "*Date last requested event : " << fStopDate << std::endl;
1090  fFcout_f << std::endl;
1091 
1092  //=========================================================================
1093  // closing of the results file if i_code = fCodeHeaderAscii only.
1094  // closing is done in the fT1dWriteAscii() and fT2dWriteAscii() methods
1095  // except for i_code = fCodeHeaderAscii
1096  //=========================================================================
1097  if(i_code == fCodeHeaderAscii){fFcout_f.close();}
1098 }
TString fFlagSubDet
Definition: TEcnaWrite.h:55
TString fAnaType
Definition: TEcnaWrite.h:128
Int_t fStexNumber
Definition: TEcnaWrite.h:134
Int_t fRunNumber
Definition: TEcnaWrite.h:130
Int_t fNbOfSamples
Definition: TEcnaWrite.h:129
TString fStopDate
Definition: TEcnaWrite.h:139
Int_t fCodeHeaderAscii
Definition: TEcnaWrite.h:64
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:131
std::ofstream fFcout_f
Definition: TEcnaWrite.h:61
TString fAsciiFileName
Definition: TEcnaWrite.h:145
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:132
TString fStartDate
Definition: TEcnaWrite.h:139
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:133
void TEcnaWrite::fMakeResultsFileName ( )
void TEcnaWrite::fMakeResultsFileName ( const Int_t &  i_code)

Definition at line 641 of file TEcnaWrite.cc.

References TEcnaParPaths::AppendResultsAsciiFilePath(), TEcnaParPaths::AppendResultsRootFilePath(), TEcnaParPaths::BeginningOfResultsAsciiFilePath(), TEcnaParPaths::BeginningOfResultsRootFilePath(), gather_cfg::cout, fAnaType, fAsciiFileName, fAsciiFileNameShort, fCdelete, fCnaParPaths, fCnew, fCodeAvMeanCorss, fCodeAvPed, fCodeAvSigCorss, fCodeAvTno, fCodeCorCss, fCodeCovCss, fCodeHeaderAscii, fCodeHfn, fCodeLfCor, fCodeLfCov, fCodeLfn, fCodeMeanCorss, fCodeMSp, fCodeNbOfEvts, fCodePed, fCodeRoot, fCodeSigCorss, fCodeSSp, fCodeTno, fFirstReqEvtNumber, fFlagSubDet, fgMaxCar, fLastReqEvtNumber, fNbOfSamples, fReqNbOfEvts, fRootFileName, fRootFileNameShort, fRunNumber, fStexName, fStexNumber, fStexStinUser, fStinEchaUser, fStinName, fTTBELL, i, cuy::ii, TEcnaParPaths::ResultsAsciiFilePath(), TEcnaParPaths::ResultsRootFilePath(), TEcnaParPaths::SetResultsAsciiFilePath(), TEcnaParPaths::SetResultsRootFilePath(), TEcnaParPaths::TruncateResultsAsciiFilePath(), and TEcnaParPaths::TruncateResultsRootFilePath().

642 {
643 //Results filename making (private)
644 
645  //----------------------------------------------------------------------
646  //
647  // Making of the name of the result file from the parameters set
648  // by call to RegisterFileParameters(...)
649  //
650  // Put the names in the following class attributes:
651  //
652  // fRootFileName, fRootFileNameShort,
653  // fAsciiFileName, fAsciiFileNameShort
654  //
655  // (Short means: without the directory path)
656  //
657  // set indications (run number, type of quantity, ...)
658  // and add the extension ".ascii" or ".root"
659  //
660  // ROOT: only one ROOT file: i_code = fCodeRoot.
661  // All the types of quantities
662  //
663  // ASCII: several ASCII files: i_code = code for one type of quantity
664  // each i_code which is not equal to fCodeRoot is also implicitly
665  // a code "fCodeAscii" (this last attribute is not in the class)
666  //
667  //----------------------------------------------------------------------
668 
669  char* f_in = new char[fgMaxCar]; fCnew++;
670  char* f_in_short = new char[fgMaxCar]; fCnew++;
671 
672  Int_t MaxCar = fgMaxCar;
673  fStexName.Resize(MaxCar);
674  fStexName = "SM or Dee?";
675 
676  MaxCar = fgMaxCar;
677  fStinName.Resize(MaxCar);
678  fStinName = "tower or SC?";
679 
680  if( fFlagSubDet == "EB" ){fStexName = "SM"; fStinName = "tower";}
681  if( fFlagSubDet == "EE" ){fStexName = "Dee"; fStinName = "SC";}
682 
683  // switch (i_code){
684 
685  //=================================== R O O T ========================= (fMakeResultsFileName)
686  TString sPointInterrog = "?";
687  TString sDollarHome = "$HOME";
688 
689  if (i_code == fCodeRoot)
690  {
691  if( fCnaParPaths->ResultsRootFilePath().Data() == sPointInterrog.Data() )
692  {
693  std::cout << "!TEcnaWrite::fMakeResultsFileName> * * * W A R N I N G * * * " << std::endl << std::endl
694  << " Path for results .root file not defined. Default option will be used here:" << std::endl
695  << " your results files will be written in your HOME directory." << std::endl << std::endl
696  << " In order to write the .root results file in a specific directory," << std::endl
697  << " you have to create a file named path_results_root in a subdirectory named ECNA" << std::endl
698  << " previously created in your home directory." << std::endl
699  << " This file must have only one line containing the path of the directory" << std::endl
700  << " where must be the .root result files." << std::endl
701  << std::endl;
702 
703  TString home_path = gSystem->Getenv("HOME");
704  fCnaParPaths->SetResultsRootFilePath(home_path.Data());
705  }
706 
707  if( fCnaParPaths->BeginningOfResultsRootFilePath().Data() == sDollarHome.Data() )
708  {
710  const Text_t *t_file_nohome = (const Text_t *)fCnaParPaths->ResultsRootFilePath().Data(); // /scratch0/cna/...
711 
712  TString home_path = gSystem->Getenv("HOME");
713  fCnaParPaths->SetResultsRootFilePath(home_path.Data()); // /afs/cern.ch/u/USER
714  fCnaParPaths->AppendResultsRootFilePath(t_file_nohome); // /afs/cern.ch/u/USER/scratch0/cna/...
715  }
716 
717  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d",
720  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d",
721  fAnaType.Data(), fNbOfSamples,
723  }
724 
725  //=================================== A S C I I ==================== (fMakeResultsFileName)
726  //fCnaParPaths->GetPathForResultsAsciiFiles();
727  if (i_code != fCodeRoot)
728  {
729  if (i_code == fCodeHeaderAscii)
730  {
731  if( fCnaParPaths->ResultsAsciiFilePath().Data() == sPointInterrog.Data() )
732  {
733  std::cout << "!TEcnaWrite::fMakeResultsFileName> * * * W A R N I N G * * * " << std::endl << std::endl
734  << " Path for results .ascii file not defined. Default option will be used here:" << std::endl
735  << " your results files will be written in your HOME directory." << std::endl << std::endl
736  << " In order to write the .ascii results file in a specific directory," << std::endl
737  << " you have to create a file named path_results_ascii in a subdirectory named ECNA" << std::endl
738  << " previously created in your home directory." << std::endl
739  << " This file must have only one line containing the path of the directory" << std::endl
740  << " where must be the .ascii result files." << std::endl
741  << std::endl;
742 
743  TString home_path = gSystem->Getenv("HOME");
744  fCnaParPaths->SetResultsAsciiFilePath(home_path.Data());
745  }
746 
747  if( fCnaParPaths->BeginningOfResultsAsciiFilePath().Data() == sDollarHome.Data() )
748  {
750  const Text_t *t_file_nohome = (const Text_t *)fCnaParPaths->ResultsAsciiFilePath().Data(); // /scratch0/cna/...
751 
752  TString home_path = gSystem->Getenv("HOME");
753  fCnaParPaths->SetResultsAsciiFilePath(home_path.Data()); // /afs/cern.ch/u/USER
754  fCnaParPaths->AppendResultsAsciiFilePath(t_file_nohome); // /afs/cern.ch/u/USER/scratch0/cna/...
755  }
756  }
757 
758  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_header",
761  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_header",
764  }
765 
766  //-------------------------------------------------------------- (fMakeResultsFileName)
767  if (i_code == fCodeNbOfEvts)
768  {
769  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_NbOfEvents",
772  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_NbOfEvents",
775  }
776 
777  if (i_code == fCodePed)
778  {
779  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_Pedestals",
782  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_Pedestals",
785  }
786 
787  if (i_code == fCodeTno)
788  {
789  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_TotalNoise",
792  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_TotalNoise",
795  }
796 
797  if (i_code == fCodeLfn)
798  {
799  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_LFNoise",
802  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_LFNoise",
805  }
806 
807  if (i_code == fCodeHfn)
808  {
809  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_HFNoise",
812  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_HFNoise",
815  }
816 
817  if (i_code == fCodeMeanCorss)
818  {
819  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_MeanCorss",
822  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_MeanCorss",
825  }
826 
827  if (i_code == fCodeSigCorss)
828  {
829  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_SigmaCorss",
832  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_SigmaCorss",
835  }
836 
837  if (i_code == fCodeCovCss)
838  {
839  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_Covss_%s%d_Channel_%d",
843  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_Covss_%s%d_Channel_%d",
847  }
848 
849  if (i_code == fCodeCorCss)
850  {
851  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_Corss_%s%d_Channel_%d",
855  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_Corss_%s%d_Channel_%d",
859  }
860 
861  //------- (not used yet)
862 #define OCOD
863 #ifndef OCOD
864  if (i_code == fCodeMSp)
865  {
866  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleMeans",
869  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleMeans",
872  }
873 
874  if (i_code == fCodeSSp)
875  {
876  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleSigmas",
879  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleSigmas",
882  }
883 
884  if( i_code == fCodeAvTno)
885  {
886  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageTotalNoise_c%d",
889  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageTotalNoise_c%d",
892  }
893 
894  if( i_code == fCodeLfCov)
895  {
896  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cov",
899  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cov",
902  }
903 
904  if ( i_code == fCodeLfCor)
905  {
906  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cor",
909  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cor",
912  }
913 
914  if (i_code == fCodeAvPed)
915  {
916  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragePedestals",
919  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragePedestals",
922  }
923 
924  if (i_code == fCodeAvMeanCorss)
925  {
926  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageMeanCorss%d",
929  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageMeanCorss%d",
932  }
933 
934  if (i_code == fCodeAvSigCorss)
935  {
936  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageSigmaCorss%d",
939  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_AverageSigmaCorss%d",
942  }
943 #endif // OCOD
944 
945  //----------------------------------------------------------- (fMakeResultsFileName)
946 
947  // default:
948  // std::cout << "*TEcnaWrite::fMakeResultsFileName(const Int_t& i_code)> "
949  // << "wrong header code , i_code = " << i_code << std::endl;
950  // }
951 
952  //======================================= f_name
953 
954  char* f_name = new char[fgMaxCar]; fCnew++;
955 
956  for (Int_t i = 0 ; i < fgMaxCar ; i++){f_name[i] = '\0';}
957 
958  Int_t ii = 0;
959  for (Int_t i = 0 ; i < fgMaxCar ; i++)
960  {
961  if ( f_in[i] != '\0' ){f_name[i] = f_in[i]; ii++;}
962  else {break;} // va directement a if ( ii+5 < fgMaxCar ) puis... f_name[ii] = '.';
963  }
964 
965  if ( ii+5 < fgMaxCar )
966  {
967  //.......... writing of the file extension (.root or .ascii) (fMakeResultsFileName)
968 
969  //------------------------------------------- extension .ascii
970  if ( i_code != fCodeRoot || i_code == fCodeNbOfEvts )
971  {
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';
975 
976  fAsciiFileName = f_name;
977  }
978  //------------------------------------------- extension .root
979  if ( i_code == fCodeRoot )
980  {
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';
983 
984  fRootFileName = f_name;
985  }
986  }
987  else
988  {
989  std::cout << "*TEcnaWrite::fMakeResultsFileName(...)> Name too long (for f_name)."
990  << " No room enough for the extension. (ii = " << ii << ")"
991  << fTTBELL << std::endl;
992  }
993 
994 
995  //====================================== f_name_short (fMakeResultsFileName)
996 
997  char* f_name_short = new char[fgMaxCar]; fCnew++;
998 
999  for (Int_t i = 0 ; i < fgMaxCar ; i++){f_name_short[i] = '\0';}
1000 
1001  ii = 0;
1002  for (Int_t i = 0 ; i < fgMaxCar ; i++)
1003  {
1004  if ( f_in_short[i] != '\0' ){f_name_short[i] = f_in_short[i]; ii++;}
1005  else {break;} // va directement a f_name_short[ii] = '.';
1006  }
1007 
1008  if ( ii+5 < fgMaxCar )
1009  {
1010  //.......... writing of the file extension (.root or .ascii)
1011 
1012  //-------------------------------------------extension .ascii
1013  if ( i_code != fCodeRoot || i_code == fCodeNbOfEvts )
1014  {
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';
1018 
1019  fAsciiFileNameShort = f_name_short;
1020  }
1021 
1022  //-------------------------------------------- extension .root
1023  if ( i_code == fCodeRoot )
1024  {
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';
1027 
1028  fRootFileNameShort = f_name_short;
1029  }
1030  }
1031  else
1032  {
1033  std::cout << "*TEcnaWrite::fMakeResultsFileName(...)> Name too long (for f_name_short)."
1034  << " No room enough for the extension. (ii = " << ii << ")"
1035  << fTTBELL << std::endl;
1036  }
1037  delete [] f_name; f_name = 0; fCdelete++;
1038  delete [] f_name_short; f_name_short = 0; fCdelete++;
1039 
1040  delete [] f_in; f_in = 0; fCdelete++;
1041  delete [] f_in_short; f_in_short = 0; fCdelete++;
1042 
1043 } // end of fMakeResultsFileName
Int_t fCodeHfn
Definition: TEcnaWrite.h:71
int i
Definition: DBlmapReader.cc:9
Int_t fCodeAvPed
Definition: TEcnaWrite.h:82
Int_t fStinEchaUser
Definition: TEcnaWrite.h:103
Int_t fgMaxCar
Definition: TEcnaWrite.h:43
TString fFlagSubDet
Definition: TEcnaWrite.h:55
TString fStexName
Definition: TEcnaWrite.h:135
TString BeginningOfResultsRootFilePath()
TEcnaParPaths * fCnaParPaths
Definition: TEcnaWrite.h:58
TString fAnaType
Definition: TEcnaWrite.h:128
Int_t fStexNumber
Definition: TEcnaWrite.h:134
void AppendResultsAsciiFilePath(const Text_t *)
TString fAsciiFileNameShort
Definition: TEcnaWrite.h:146
Int_t fStexStinUser
Definition: TEcnaWrite.h:102
Int_t fRunNumber
Definition: TEcnaWrite.h:130
TString fRootFileNameShort
Definition: TEcnaWrite.h:142
Int_t fCdelete
Definition: TEcnaWrite.h:40
Int_t fCnew
Definition: TEcnaWrite.h:40
Int_t fCodePed
Definition: TEcnaWrite.h:68
Int_t fCodeAvTno
Definition: TEcnaWrite.h:83
TString fRootFileName
Definition: TEcnaWrite.h:143
Int_t fCodeAvMeanCorss
Definition: TEcnaWrite.h:84
TString fTTBELL
Definition: TEcnaWrite.h:45
void SetResultsRootFilePath(const TString &)
TString BeginningOfResultsAsciiFilePath()
Int_t fCodeSigCorss
Definition: TEcnaWrite.h:73
Int_t fCodeRoot
Definition: TEcnaWrite.h:65
Int_t fCodeMSp
Definition: TEcnaWrite.h:79
Int_t fNbOfSamples
Definition: TEcnaWrite.h:129
ii
Definition: cuy.py:588
Int_t fCodeHeaderAscii
Definition: TEcnaWrite.h:64
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:131
Int_t fCodeMeanCorss
Definition: TEcnaWrite.h:72
TString fStinName
Definition: TEcnaWrite.h:136
void TruncateResultsRootFilePath(const Int_t &, const Int_t &)
Int_t fCodeLfCov
Definition: TEcnaWrite.h:87
Int_t fCodeTno
Definition: TEcnaWrite.h:69
TString ResultsRootFilePath()
Int_t fCodeLfn
Definition: TEcnaWrite.h:70
Int_t fCodeAvSigCorss
Definition: TEcnaWrite.h:85
TString fAsciiFileName
Definition: TEcnaWrite.h:145
Int_t fCodeCovCss
Definition: TEcnaWrite.h:75
Int_t fCodeNbOfEvts
Definition: TEcnaWrite.h:67
Int_t fCodeCorCss
Definition: TEcnaWrite.h:76
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:132
Int_t fCodeLfCor
Definition: TEcnaWrite.h:88
void TruncateResultsAsciiFilePath(const Int_t &, const Int_t &)
void AppendResultsRootFilePath(const Text_t *)
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:133
Int_t fCodeSSp
Definition: TEcnaWrite.h:80
TString ResultsAsciiFilePath()
void SetResultsAsciiFilePath(const TString &)
void TEcnaWrite::fT2dWriteAscii ( const Int_t &  i_code,
const Int_t &  i_pasx_arg,
const Int_t &  i_pasy_arg,
const Int_t &  MatSize,
const TMatrixD &  read_matrix 
)
private

Definition at line 1469 of file TEcnaWrite.cc.

References gather_cfg::cout, TauDecayModes::dec, fAsciiFileName, fCnew, fCodeAvMeanCorss, fCodeAvSigCorss, fCodeCorCss, fCodeCovCss, fCodeHfCor, fCodeHfCov, fCodeLfCor, fCodeLfCov, fCodePrintNoComment, fEcal, fEcalNumbering, fFcout_f, fFlagPrint, fFlagSubDet, alignBH_cfg::fixed, fjustap_1d_cc, fjustap_1d_ss, fjustap_2d_cc, fjustap_2d_ss, fSectChanSizeX, fSectSampSizeX, fStexNumber, fStexStinUser, fStinEchaUser, fStinName, fUserSamp, TEcnaNumbering::Get0TowEchaFrom0SMEcha(), TEcnaNumbering::Get1SCEchaFrom0DeeEcha(), TEcnaNumbering::GetDeeDirViewedFromIP(), i, j, TEcnaParEcal::MaxCrysEcnaInStex(), and TEcnaParEcal::MaxSampADC().

Referenced by WriteAsciiCorrelationsBetweenSamples(), and WriteAsciiCovariancesBetweenSamples().

1474 {
1475 //Writing of a matrix by sectors (private)
1476 
1477  Int_t i_pasx = i_pasx_arg; // taille secteur en x
1478  Int_t i_pasy = i_pasy_arg; // taille secteur en y
1479 
1480  //------------ formatage des nombres en faisant appel a la classe ios
1481 
1482  fFcout_f << std::setiosflags(std::ios::showpoint | std::ios::uppercase);
1483  fFcout_f.setf(std::ios::dec, std::ios::basefield);
1484  fFcout_f.setf(std::ios::fixed, std::ios::floatfield);
1485  fFcout_f.setf(std::ios::left, std::ios::adjustfield);
1486  fFcout_f.setf(std::ios::right, std::ios::adjustfield);
1487  fFcout_f << std::setprecision(3) << std::setw(6);
1488 
1489  std::cout << std::setiosflags(std::ios::showpoint | std::ios::uppercase);
1490  std::cout.setf(std::ios::dec, std::ios::basefield);
1491  std::cout.setf(std::ios::fixed, std::ios::floatfield);
1492  std::cout.setf(std::ios::left, std::ios::adjustfield);
1493  std::cout.setf(std::ios::right, std::ios::adjustfield);
1494  std::cout << std::setprecision(3) << std::setw(6);
1495 
1496  //--------------------- fin du formatage standard C++ -------------------
1497 
1498  //-----------------------------------------------------------------------
1499  // Reservation dynamique d'un array Double_t** de dimensions
1500  // les multiples de 5 juste au-dessus des dimensions de l'array 2D
1501  // a ecrire ( array de dimensions
1502  // (fEcal->MaxSampADC(),fEcal->MaxSampADC())
1503  // (fEcal->MaxCrysEcnaInStex(),fEcal->MaxCrysEcnaInStex()) )
1504  //-----------------------------------------------------------------------
1505  // Determination des tailles multiples de fSectChanSizeX ou fSectSampSizeX
1506 
1507 #define NOUC
1508 #ifndef NOUC
1509 
1510  //*************** channels *************
1511  Int_t justap_chan = 0;
1512 
1513  if( fEcal->MaxCrysEcnaInStex()%fSectChanSizeX == 0 )
1514  {justap_chan = fEcal->MaxCrysEcnaInStex();}
1515  else
1516  {justap_chan=((fEcal->MaxCrysEcnaInStex()/fSectChanSizeX)+1)*fSectChanSizeX;}
1517 
1518  //....................... Allocation fjustap_2d_cc
1519 
1520  if ( i_code == fCodeHfCov || i_code == fCodeHfCor||
1521  i_code == fCodeLfCov || i_code == fCodeLfCor ){
1522  if(fjustap_2d_cc == 0)
1523  {
1524  //................... Allocation
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;}
1529  }
1530 
1531  //............................... Transfert des valeurs dans fjustap_2d_cc (=init)
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);}
1542  }
1543  }
1544 
1545  //.......................... mise a zero du reste de la matrice (=init)
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.;}}
1549  }
1550 
1551 #endif //NOUC
1552 
1553  //************************************ Samples ***************************
1554  Int_t justap_samp = 0;
1555 
1556  if ( fEcal->MaxSampADC()%fSectSampSizeX == 0 ){
1557  justap_samp = fEcal->MaxSampADC();}
1558  else{
1559  justap_samp=((fEcal->MaxSampADC()/fSectSampSizeX)+1)*fSectSampSizeX;}
1560 
1561  //....................... allocation fjustap_2d_ss
1562 
1563  if (i_code == fCodeCovCss || i_code == fCodeCorCss ||
1564  i_code == fCodeAvMeanCorss || i_code == fCodeAvSigCorss){
1565  if(fjustap_2d_ss == 0)
1566  {
1567  //................... Allocation
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;}
1572  }
1573 
1574  //.............................. Transfert des valeurs dans fjustap_2d_ss (=init)
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);}
1585  }
1586  }
1587 
1588  //.......................... mise a zero du reste de la matrice (=init)
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.;}}
1592  }
1593 
1594  //..................... impressions + initialisations selon i_code
1595 
1596  Int_t isx_max = 0;
1597  Int_t isy_max = 0;
1598 
1599 #define COCC
1600 #ifndef COCC
1601  if(i_code == fCodeHfCov)
1602  {
1603  fFcout_f << "Covariance matrix between channels "
1604  << "for sample number " << fUserSamp;
1605  isx_max = justap_chan;
1606  isy_max = justap_chan;
1607  }
1608  if(i_code == fCodeHfCor)
1609  {
1610  fFcout_f << "*Correlation matrix between channels "
1611  << "for sample number " << fUserSamp;
1612  isx_max = justap_chan;
1613  isy_max = justap_chan;
1614  }
1615 
1616  if(i_code == fCodeLfCov)
1617  {
1618  fFcout_f << "Covariance matrix between channels "
1619  << "averaged on the samples ";
1620  isx_max = justap_chan;
1621  isy_max = justap_chan;
1622  }
1623  if(i_code == fCodeLfCor)
1624  {
1625  fFcout_f << "Correlation matrix between channels "
1626  << "averaged on the samples ";
1627  isx_max = justap_chan;
1628  isy_max = justap_chan;
1629  }
1630 #endif // COCC
1631 
1632  Int_t n1StexStin = 0;
1633  Int_t i0StinEcha = 0;
1634  Int_t n1StinEcha = 0;
1635 
1636  if( fFlagSubDet == "EB")
1637  {
1638  n1StexStin = fStexStinUser;
1640  }
1641  if( fFlagSubDet == "EE")
1642  {
1643  n1StexStin = fStexStinUser;
1644  Int_t fStinEchaUser_m = fStinEchaUser-1;
1645  n1StinEcha = fEcalNumbering->Get1SCEchaFrom0DeeEcha(fStinEchaUser_m);
1646 
1647  TString sDeeDir = fEcalNumbering->GetDeeDirViewedFromIP(fStexNumber);
1648  }
1649 
1650  if(i_code == fCodeCovCss)
1651  {
1652  if( fFlagSubDet == "EB")
1653  {
1654  fFcout_f << "Covariance matrix between samples "
1655  << "for channel number " << fStinEchaUser
1656  << " (" << fStinName << ": " << n1StexStin
1657  << " , channel in " << fStinName << ": " << i0StinEcha << ")";
1658  }
1659  if( fFlagSubDet == "EE")
1660  {
1661  fFcout_f << "Covariance matrix between samples "
1662  << "for channel number " << fStinEchaUser
1663  << " (" << fStinName << ": " << n1StexStin
1664  << " , channel in " << fStinName << ": " << n1StinEcha << ")";
1665  }
1666  isx_max = justap_samp;
1667  isy_max = justap_samp;
1668  }
1669  if(i_code == fCodeCorCss)
1670  {
1671  if( fFlagSubDet == "EB")
1672  {
1673  fFcout_f << "Correlation matrix between samples "
1674  << "for channel number " << fStinEchaUser
1675  << " (" << fStinName << ": " << n1StexStin
1676  << " , channel in " << fStinName << ": " << i0StinEcha << ")";
1677  }
1678  if( fFlagSubDet == "EE")
1679  {
1680  fFcout_f << "Correlation matrix between samples "
1681  << "for channel number " << fStinEchaUser
1682  << " (" << fStinName << ": " << n1StexStin
1683  << " , channel in " << fStinName << ": " << n1StinEcha << ")";
1684  }
1685  isx_max = justap_samp;
1686  isy_max = justap_samp;
1687  }
1688 
1689  if(i_code == fCodeAvMeanCorss)
1690  {
1691  if( fFlagSubDet == "EB")
1692  {
1693  fFcout_f << "Correction factors to the covariances "
1694  << "between samples for channel number " << fStinEchaUser
1695  << " (" << fStinName << ": " << n1StexStin
1696  << " , channel in " << fStinName << ": " << i0StinEcha << ")";
1697  }
1698  if( fFlagSubDet == "EE")
1699  {
1700  fFcout_f << "Correction factors to the covariances "
1701  << "between samples for channel number " << fStinEchaUser
1702  << " (" << fStinName << ": " << n1StexStin
1703  << " , channel in " << fStinName << ": " << n1StinEcha << ")";
1704  }
1705  isx_max = justap_samp;
1706  isy_max = justap_samp;
1707  }
1708 
1709  if(i_code == fCodeAvSigCorss)
1710  {
1711  if( fFlagSubDet == "EB")
1712  {
1713  fFcout_f << "Correction factors to the correlations "
1714  << "between samples for channel number " << fStinEchaUser
1715  << " ( " << fStinName << ": " << n1StexStin
1716  << " , channel in " << fStinName << ": " << i0StinEcha << ")";
1717  }
1718  if( fFlagSubDet == "EE")
1719  {
1720  fFcout_f << "Correction factors to the correlations "
1721  << "between samples for channel number " << fStinEchaUser
1722  << " ( " << fStinName << ": " << n1StexStin
1723  << " , channel in " << fStinName << ": " << n1StinEcha << ")";
1724  }
1725  isx_max = justap_samp;
1726  isy_max = justap_samp;
1727  }
1728 
1729  fFcout_f << std::endl;
1730 
1731  //............... Calcul des nombres de secteurs selon x
1732  // i_pasx = taille secteur en x
1733  // isx_max = taille de la matrice en x
1734  // n_sctx = nombre de secteurs en x
1735  //
1736  if(i_pasx > isx_max){i_pasx = isx_max;}
1737  Int_t n_sctx;
1738  Int_t max_verix;
1739  n_sctx = isx_max/i_pasx;
1740  max_verix = n_sctx*i_pasx;
1741  if(max_verix < isx_max){ n_sctx++;}
1742 
1743  //............... Calcul des nombres de secteurs selon y
1744  // i_pasy = taille secteur en y
1745  // isy_max = taille de la matrice en y
1746  // n_scty = nombre de secteurs en x
1747  //
1748  if(i_pasy > isy_max){i_pasy = isy_max;}
1749  Int_t n_scty;
1750  Int_t max_veriy;
1751  n_scty = isy_max/i_pasy;
1752  max_veriy = n_scty*i_pasy;
1753  if(max_veriy < isy_max){ n_scty++;}
1754 
1755 #define NBSC
1756 #ifndef NBSC
1757  //................ Ecriture de la taille et du nombre des secteurs
1758  if( i_code == fCodeCovCss || i_code == fCodeCorCss ||
1759  i_code == fCodeAvMeanCorss || i_code == fCodeAvSigCorss)
1760  {
1761  fFcout_f << "sector size = " << fSectSampSizeX
1762  << " , number of sectors = " << n_sctx << " x " << n_scty
1763  <<endl;
1764  }
1765  if( i_code == fCodeHfCov || i_code == fCodeHfCor ||
1766  i_code == fCodeLfCov || i_code == fCodeLfCor )
1767  {
1768  fFcout_f << "sector size = " << fSectChanSizeX
1769  << " , number of sectors = " << n_sctx << " x " << n_scty
1770  << std::endl;
1771  }
1772 #endif // NBSC
1773 
1774  fFcout_f << std::endl;
1775 
1776  //............... impression matrice par secteurs i_pas x i_pas
1777  //........................... boucles pour display des secteurs
1778  Int_t ix_inf = -i_pasx;
1779 
1780  for(Int_t nsx = 0 ; nsx < n_sctx ; nsx++)
1781  {
1782  //......................... calcul limites secteur
1783  ix_inf = ix_inf + i_pasx;
1784  Int_t ix_sup = ix_inf + i_pasx;
1785 
1786  Int_t iy_inf = -i_pasy;
1787 
1788  for(Int_t nsy = 0 ; nsy < n_scty ; nsy++)
1789  {
1790  iy_inf = iy_inf + i_pasy;
1791  Int_t iy_sup = iy_inf + i_pasy;
1792 
1793  //......................... display du secteur (nsx,nsy)
1794 
1795  if(i_code == fCodeHfCov || i_code == fCodeCovCss ||
1796  i_code == fCodeAvMeanCorss || i_code == fCodeAvSigCorss )
1797  {fFcout_f << " ";}
1798  if(i_code == fCodeHfCor || i_code == fCodeCorCss)
1799  {fFcout_f << " ";}
1800 
1801  for (Int_t iy_c = iy_inf ; iy_c < iy_sup ; iy_c++)
1802  {
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 << " ";
1810  }
1811  fFcout_f << std::endl << std::endl;
1812 
1813  for (Int_t ix_c = ix_inf ; ix_c < ix_sup ; ix_c++)
1814  {
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 << " ";
1822 
1823  for (Int_t iy_c = iy_inf ; iy_c < iy_sup ; iy_c++)
1824  {
1825  if(i_code == fCodeHfCov ||
1826  i_code == fCodeLfCov ||
1827  i_code == fCodeCovCss ||
1828  i_code == fCodeAvMeanCorss ||
1829  i_code == fCodeAvSigCorss ){
1830  fFcout_f.width(8);}
1831 
1832  if(i_code == fCodeHfCor || i_code == fCodeLfCor || i_code == fCodeCorCss){
1833  fFcout_f.width(6);}
1834 
1835  if( i_code == fCodeHfCov || i_code == fCodeLfCov || i_code == fCodeHfCor){
1836  fFcout_f << fjustap_2d_cc[ix_c][iy_c] << " ";}
1837 
1838  if ( i_code == fCodeCovCss ||
1839  i_code == fCodeCorCss ||
1840  i_code == fCodeAvMeanCorss ||
1841  i_code == fCodeAvSigCorss )
1842  {
1843  fFcout_f << fjustap_2d_ss[ix_c][iy_c] << " ";
1844  }
1845  }
1846  fFcout_f << std::endl;
1847  }
1848  fFcout_f << std::endl;
1849  }
1850  }
1851 
1852  //........... closing of the results file
1853 
1854  fFcout_f.close();
1855 
1857  {
1858  std::cout << "*TEcnaWrite::fT2dWriteAscii(....)> INFO: "
1859  << "matrix has been written in file: " << std::endl
1860  << " " << fAsciiFileName.Data() << std::endl;
1861  }
1862 
1863 }// end of TEcnaWrite::fT2dWriteAscii
Double_t ** fjustap_2d_cc
Definition: TEcnaWrite.h:113
int i
Definition: DBlmapReader.cc:9
Int_t fStinEchaUser
Definition: TEcnaWrite.h:103
TString GetDeeDirViewedFromIP(const Int_t &)
Int_t fCodePrintNoComment
Definition: TEcnaWrite.h:52
TString fFlagSubDet
Definition: TEcnaWrite.h:55
Int_t fCodeHfCov
Definition: TEcnaWrite.h:89
Int_t Get1SCEchaFrom0DeeEcha(const Int_t &)
Double_t ** fjustap_2d_ss
Definition: TEcnaWrite.h:116
Int_t fStexNumber
Definition: TEcnaWrite.h:134
Int_t fStexStinUser
Definition: TEcnaWrite.h:102
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:54
Int_t Get0TowEchaFrom0SMEcha(const Int_t &)
Int_t fCnew
Definition: TEcnaWrite.h:40
Int_t fUserSamp
Definition: TEcnaWrite.h:101
Int_t fCodeAvMeanCorss
Definition: TEcnaWrite.h:84
int j
Definition: DBlmapReader.cc:9
Int_t fFlagPrint
Definition: TEcnaWrite.h:51
Double_t * fjustap_1d_cc
Definition: TEcnaWrite.h:114
Double_t * fjustap_1d_ss
Definition: TEcnaWrite.h:117
Int_t fSectChanSizeX
Definition: TEcnaWrite.h:96
std::ofstream fFcout_f
Definition: TEcnaWrite.h:61
TString fStinName
Definition: TEcnaWrite.h:136
Int_t fCodeLfCov
Definition: TEcnaWrite.h:87
Int_t MaxCrysEcnaInStex()
Int_t fCodeAvSigCorss
Definition: TEcnaWrite.h:85
Int_t MaxSampADC()
TString fAsciiFileName
Definition: TEcnaWrite.h:145
Int_t fCodeCovCss
Definition: TEcnaWrite.h:75
Int_t fCodeCorCss
Definition: TEcnaWrite.h:76
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:97
Int_t fCodeLfCor
Definition: TEcnaWrite.h:88
Int_t fCodeHfCor
Definition: TEcnaWrite.h:90
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:57
TString TEcnaWrite::GetAnalysisName ( )

Definition at line 387 of file TEcnaWrite.cc.

References fAnaType.

387 {return fAnaType;}
TString fAnaType
Definition: TEcnaWrite.h:128
TString TEcnaWrite::GetAsciiFileName ( )

Definition at line 384 of file TEcnaWrite.cc.

References fAsciiFileName.

Referenced by TEcnaHistos::WriteHistoAscii(), and TEcnaHistos::WriteMatrixAscii().

384 {return fAsciiFileName;}
TString fAsciiFileName
Definition: TEcnaWrite.h:145
Int_t TEcnaWrite::GetFirstReqEvtNumber ( )

Definition at line 390 of file TEcnaWrite.cc.

References fFirstReqEvtNumber.

390 {return fFirstReqEvtNumber;}
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:131
Int_t TEcnaWrite::GetNbOfSamples ( )

Definition at line 388 of file TEcnaWrite.cc.

References fNbOfSamples.

388 {return fNbOfSamples;}
Int_t fNbOfSamples
Definition: TEcnaWrite.h:129
Int_t TEcnaWrite::GetReqNbOfEvts ( )

Definition at line 391 of file TEcnaWrite.cc.

References fReqNbOfEvts.

391 {return fReqNbOfEvts;}
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:133
TString TEcnaWrite::GetRootFileName ( )
TString TEcnaWrite::GetRootFileNameShort ( )
Int_t TEcnaWrite::GetRunNumber ( )

Definition at line 389 of file TEcnaWrite.cc.

References fRunNumber.

389 {return fRunNumber;}
Int_t fRunNumber
Definition: TEcnaWrite.h:130
Int_t TEcnaWrite::GetStexNumber ( )

Definition at line 392 of file TEcnaWrite.cc.

References fStexNumber.

392 {return fStexNumber;}
Int_t fStexNumber
Definition: TEcnaWrite.h:134
void TEcnaWrite::Init ( void  )

Definition at line 135 of file TEcnaWrite.cc.

References fCnaParCout, fCodeCorCss, fCodeCovCss, fCodeHeaderAscii, fCodeHfn, fCodeLfn, fCodeMeanCorss, fCodeNbOfEvts, fCodePed, fCodePrintAllComments, fCodeRoot, fCodeSigCorss, fCodeTno, fgMaxCar, fjustap_1d_cc, fjustap_1d_ev, fjustap_1d_ss, fjustap_1d_var, fjustap_2d_cc, fjustap_2d_ev, fjustap_2d_ss, fjustap_2d_var, fStexStinUser, fStinEchaUser, fTTBELL, fUserSamp, and TEcnaParCout::GetCodePrint().

Referenced by TEcnaWrite().

136 {
137  //----------------------------- Parameters values
138  fTTBELL = '\007';
139 
140  fgMaxCar = (Int_t)512; // max number of characters in TStrings
141  fCodeHeaderAscii = 0;
142  fCodeRoot = 1;
143 
144  //------------------------------------------- Codes
145  //................. presently used codes
146  fCodeNbOfEvts = 101;
147  fCodePed = 102;
148  fCodeTno = 103;
149  fCodeLfn = 104;
150  fCodeHfn = 105;
151  fCodeMeanCorss = 106;
152  fCodeSigCorss = 107;
153 
154  fCodeCovCss = 201;
155  fCodeCorCss = 202;
156 
157  //................. not yet used codes
158  //fCodeAdcEvt = 3;
159  //fCodeMSp = 4;
160  //fCodeSSp = 5;
161 
162  //fCodeAvPed = 17;
163  //fCodeAvTno = 6;
164  //fCodeAvMeanCorss = 18;
165  //fCodeAvSigCorss = 19;
166 
167  //fCodeLfCov = 11;
168  //fCodeLfCor = 12;
169  //fCodeHfCov = 9;
170  //fCodeHfCor = 10;
171 
172  //fCodeLFccMoStins = 13;
173  //fCodeHFccMoStins = 14;
174 
175  //----------------------------------------
176 
177  fUserSamp = 0;
178  fStexStinUser = 0;
179  fStinEchaUser = 0;
180 
181  fjustap_2d_ev = 0;
182  fjustap_1d_ev = 0;
183 
184  fjustap_2d_var = 0;
185  fjustap_1d_var = 0;
186 
187  fjustap_2d_cc = 0;
188  fjustap_1d_cc = 0;
189 
190  fjustap_2d_ss = 0;
191  fjustap_1d_ss = 0;
192 
194 
195 }
Int_t fCodeHfn
Definition: TEcnaWrite.h:71
Double_t ** fjustap_2d_cc
Definition: TEcnaWrite.h:113
Int_t fStinEchaUser
Definition: TEcnaWrite.h:103
Int_t fgMaxCar
Definition: TEcnaWrite.h:43
Double_t * fjustap_1d_ev
Definition: TEcnaWrite.h:108
Double_t ** fjustap_2d_ev
Definition: TEcnaWrite.h:107
Double_t ** fjustap_2d_var
Definition: TEcnaWrite.h:110
Double_t ** fjustap_2d_ss
Definition: TEcnaWrite.h:116
Int_t fStexStinUser
Definition: TEcnaWrite.h:102
Int_t fUserSamp
Definition: TEcnaWrite.h:101
Int_t fCodePed
Definition: TEcnaWrite.h:68
TString fTTBELL
Definition: TEcnaWrite.h:45
Int_t fCodePrintAllComments
Definition: TEcnaWrite.h:52
Int_t fCodeSigCorss
Definition: TEcnaWrite.h:73
Double_t * fjustap_1d_cc
Definition: TEcnaWrite.h:114
Int_t fCodeRoot
Definition: TEcnaWrite.h:65
Double_t * fjustap_1d_ss
Definition: TEcnaWrite.h:117
Int_t fCodeHeaderAscii
Definition: TEcnaWrite.h:64
Int_t fCodeMeanCorss
Definition: TEcnaWrite.h:72
Int_t fCodeTno
Definition: TEcnaWrite.h:69
Double_t * fjustap_1d_var
Definition: TEcnaWrite.h:111
Int_t GetCodePrint(const TString &)
Definition: TEcnaParCout.cc:70
Int_t fCodeLfn
Definition: TEcnaWrite.h:70
TEcnaParCout * fCnaParCout
Definition: TEcnaWrite.h:59
Int_t fCodeCovCss
Definition: TEcnaWrite.h:75
Int_t fCodeNbOfEvts
Definition: TEcnaWrite.h:67
Int_t fCodeCorCss
Definition: TEcnaWrite.h:76
Int_t TEcnaWrite::NumberOfEventsAnalysis ( Int_t **  T2d_NbOfEvts,
const Int_t &  MaxCrysEcnaInStex,
const Int_t &  MaxNbOfSamples,
const Int_t &  NbOfReqEvts 
)

Definition at line 520 of file TEcnaWrite.cc.

References gather_cfg::cout, fCodePrintAllComments, fFlagPrint, and fRootFileName.

Referenced by TEcnaRead::GetNumberOfEvents(), and TEcnaRun::GetReadyToCompute().

522 {
523  // CHECK OF THE NUMBER OF FOUND EVENTS, return rNumberOfEvents (NumberOfEvents())
524  // (number used to compute the average values over the events)
525  //
526  // 2D array: called by TEcnaRun object
527 
528  Int_t rNumberOfEvents = 0;
529  Int_t PresentNumber = 0;
530  Int_t DifferentMinusValue = 0;
531  Int_t DifferentPlusValue = 0;
532 
533  for(Int_t i0StexEcha = 0 ; i0StexEcha < MaxCrysEcnaInStex ; i0StexEcha++)
534  {
535  for(Int_t i_samp = 0 ; i_samp < MaxNbOfSamples ; i_samp++)
536  {
537  Int_t NbOfEvts = T2d_NbOfEvts[i0StexEcha][i_samp];
538 
539  if( NbOfEvts > 0 )
540  {
541  if( PresentNumber == 0 )
542  {
543  PresentNumber = NbOfEvts;
544  }
545  else
546  {
547  if( NbOfEvts > PresentNumber )
548  {
549  PresentNumber = NbOfEvts;
550  DifferentPlusValue++;
551  }
552  if( NbOfEvts < PresentNumber )
553  {
554  DifferentMinusValue++;
555  }
556  }
557  }
558  }
559  }
560  //............................................................. (NumberOfEvents())
561  rNumberOfEvents = PresentNumber;
562 
563  if( DifferentMinusValue > 0 || DifferentPlusValue > 0 )
564  {
565  std::cout << "!TEcnaWrite::NumberOfEventsAnalysis()> " << std::endl
566  << "****************** W A R N I N G : NUMBER OF EVENTS NOT CONSTANT ! *********************************"
567  << std::endl
568  << " Result ROOT file: " << fRootFileName << std::endl
569  << " The number of events is not the same for all the non-empty channels" << std::endl
570  << " The maximum number (" << rNumberOfEvents << ") is considered as the number of events " << std::endl
571  << " for calculations of pedestals, noises and correlations." << std::endl
572  << " Number of channels with 0 < nb of evts < " << rNumberOfEvents << " : " << DifferentMinusValue << std::endl
573  // << " Number of channels with nb of evts > " << rNumberOfEvents << " : " << DifferentPlusValue << std::endl
574  // << " Number of empty channels : " << EmptyChannel << std::endl
575  << " Some values of pedestals, noises and correlations may be wrong for channels" << std::endl
576  << " with number of events different from " << rNumberOfEvents << "." << std::endl
577  << " Please, check the histogram 'Numbers of events'." << std::endl
578  << "*******************************************************************************************************"
579  << std::endl;
580  }
581  else
582  {
584  {
585  if( rNumberOfEvents < NbOfReqEvts )
586  {
587  std::cout << "*TEcnaWrite::NumberOfEventsAnalysis()> *** INFO *** Number of events found in data = "
588  << rNumberOfEvents << ": less than number of requested events ( = " << NbOfReqEvts << ")" << std::endl;
589  }
590  }
591  }
592  return rNumberOfEvents;
593 
594 }//----- ( end of NumberOfEvents(...) ) ----------------
TString fRootFileName
Definition: TEcnaWrite.h:143
Int_t fCodePrintAllComments
Definition: TEcnaWrite.h:52
Int_t fFlagPrint
Definition: TEcnaWrite.h:51
Int_t TEcnaWrite::NumberOfEventsAnalysis ( Int_t *  ArrayNbOfEvts,
const Int_t &  MaxArray,
const Int_t &  NbOfReqEvts,
const Int_t &  StexNumber 
)

Definition at line 408 of file TEcnaWrite.cc.

References gather_cfg::cout, TEcnaParEcal::EmptyChannelsInDeeMatrixIncompleteSCIncluded(), fCodePrintAllComments, fEcal, fEcalNumbering, fFlagPrint, fRootFileName, TEcnaParEcal::MaxCrysEcnaInDee(), TEcnaParEcal::MaxCrysInSM(), and TEcnaNumbering::PlusMinusSMNumber().

410 {
411  // CHECK THE NUMBER OF FOUND EVENTS, return rNumberOfEvents (NumberOfEvents())
412  // (number used to compute the average values over the events)
413  //
414  // 1D array: called by TEcnaRead object
415 
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;
421 
422  //........................................................ i_SSoSE = StexStin or StinEcha
423  for(Int_t i_SSoSE=0; i_SSoSE<MaxArray; i_SSoSE++)
424  {
425  Int_t NbOfEvts = ArrayNbOfEvts[i_SSoSE];
426 
427  if( NbOfEvts > 0 )
428  {
429  if( PresentNumber == 0 ) // first channel
430  {
431  PresentNumber = NbOfEvts;
432  }
433  else // current channel
434  {
435  if( NbOfEvts > PresentNumber ) // warning
436  {
437  PresentNumber = NbOfEvts;
438  DifferentPlusValue++;
439  }
440  if( NbOfEvts < PresentNumber ) // warning
441  {
442  DifferentMinusValue++;
443  }
444  }
445  }
446  else
447  {
448  EmptyChannel++;
449  }
450  }
451 
452  rNumberOfEvents = PresentNumber;
453 
454  if( EmptyChannel > 0 )
455  {
456  if( MaxArray == fEcal->MaxCrysInSM() ) // (EB)
457  {
458  std::cout << "!TEcnaWrite::NumberOfEventsAnalysis()> *** WARNING *** "
459  << EmptyChannel << " empty channels detected in SM " << StexNumber
460  << " (EB " << fEcalNumbering->PlusMinusSMNumber(StexNumber) << ")" << std::endl;
461  }
462  if( MaxArray == fEcal->MaxCrysEcnaInDee() ) // (EE)
463  {
465  if( EmptyChannel > 0 )
466  {
467  std::cout << "!TEcnaWrite::NumberOfEventsAnalysis()> *** WARNING *** "
468  << EmptyChannel << " empty channels detected in Dee " << StexNumber << std::endl;
469  }
470  }
471  }
472 
473  if( DifferentMinusValue > 0 || DifferentPlusValue > 0 )
474  {
475  std::cout << "!TEcnaWrite::NumberOfEventsAnalysis()> " << std::endl;
476 
477  if( MaxArray == fEcal->MaxCrysInSM() ) // (EB)
478  {
479  std::cout << "************** W A R N I N G : NUMBER OF EVENTS NOT CONSTANT FOR SM " << StexNumber
480  << " (EB " << fEcalNumbering->PlusMinusSMNumber(StexNumber) << ") *********************";
481  }
482 
483  if( MaxArray == fEcal->MaxCrysEcnaInDee() ) // (EE)
484  {
485  std::cout << "****************** W A R N I N G : NUMBER OF EVENTS NOT CONSTANT FOR Dee " << StexNumber
486  << " **************************";
487  }
488 
489  std::cout << std::endl
490  << " Result ROOT file: " << fRootFileName << std::endl
491  << " The number of events is not the same for all the non-empty channels." << std::endl
492  << " The maximum number (" << rNumberOfEvents << ") is considered as the number of events for calculations "
493  << std::endl
494  << " of pedestals, noises and correlations." << std::endl
495  << " Number of channels with 0 < nb of evts < " << rNumberOfEvents << " : " << DifferentMinusValue
496  << std::endl
497  // << " Number of channels with nb of evts > " << rNumberOfEvents << " = " << DifferentPlusValue << std::endl
498  << " Number of empty channels : " << EmptyChannel << std::endl
499  << " Some values of pedestals, noises and correlations may be wrong for channels" << std::endl
500  << " with number of events different from " << rNumberOfEvents << "." << std::endl
501  << " Please, check the histogram 'Numbers of events'." << std::endl
502  << "*******************************************************************************************************"
503  << std::endl;
504  }
505  else
506  {
508  {
509  if( rNumberOfEvents < NbOfReqEvts )
510  {
511  std::cout << "*TEcnaWrite::NumberOfEventsAnalysis()> *** INFO *** Number of events found in data = "
512  << rNumberOfEvents << ": less than number of requested events ( = " << NbOfReqEvts << ")" << std::endl;
513  }
514  }
515  }
516  return rNumberOfEvents;
517 }
Int_t MaxCrysInSM()
Int_t MaxCrysEcnaInDee()
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:54
TString fRootFileName
Definition: TEcnaWrite.h:143
Int_t fCodePrintAllComments
Definition: TEcnaWrite.h:52
Int_t fFlagPrint
Definition: TEcnaWrite.h:51
Int_t PlusMinusSMNumber(const Int_t &)
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:57
Int_t EmptyChannelsInDeeMatrixIncompleteSCIncluded()
void TEcnaWrite::RegisterFileParameters ( const TString &  ArgAnaType,
const Int_t &  ArgNbOfSamples,
const Int_t &  ArgRunNumber,
const Int_t &  ArgFirstReqEvtNumber,
const Int_t &  ArgLastReqEvtNumber,
const Int_t &  ArgReqNbOfEvts,
const Int_t &  ArgStexNumber,
const TString &  ArgStartDate,
const TString &  ArgStopDate,
const time_t  ArgStartTime,
const time_t  ArgStopTime 
)

Definition at line 610 of file TEcnaWrite.cc.

References fAnaType, fFirstReqEvtNumber, fLastReqEvtNumber, fNbOfSamples, fReqNbOfEvts, fRunNumber, fStartDate, fStartTime, fStexNumber, fStopDate, and fStopTime.

Referenced by TEcnaRead::FileParameters(), TEcnaRun::GetReadyToCompute(), TEcnaHistos::WriteHistoAscii(), TEcnaHistos::WriteMatrixAscii(), and TEcnaRun::WriteNewRootFile().

616 {
617  fAnaType = ArgAnaType;
618  fNbOfSamples = ArgNbOfSamples;
619  fRunNumber = ArgRunNumber;
620  fFirstReqEvtNumber = ArgFirstReqEvtNumber;
621  fLastReqEvtNumber = ArgLastReqEvtNumber;
622  fReqNbOfEvts = ArgReqNbOfEvts;
623  fStexNumber = ArgStexNumber;
624  fStartDate = ArgStartDate;
625 
626  fStopDate = ArgStopDate;
627  fStartTime = ArgStartTime;
628  fStopTime = ArgStopTime;
629 }
TString fAnaType
Definition: TEcnaWrite.h:128
Int_t fStexNumber
Definition: TEcnaWrite.h:134
Int_t fRunNumber
Definition: TEcnaWrite.h:130
Int_t fNbOfSamples
Definition: TEcnaWrite.h:129
TString fStopDate
Definition: TEcnaWrite.h:139
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:131
time_t fStopTime
Definition: TEcnaWrite.h:140
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:132
TString fStartDate
Definition: TEcnaWrite.h:139
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:133
time_t fStartTime
Definition: TEcnaWrite.h:140
void TEcnaWrite::RegisterFileParameters ( const TString &  ArgAnaType,
const Int_t &  ArgNbOfSamples,
const Int_t &  ArgRunNumber,
const Int_t &  ArgFirstReqEvtNumber,
const Int_t &  ArgLastReqEvtNumber,
const Int_t &  ArgReqNbOfEvts,
const Int_t &  ArgStexNumber 
)

Definition at line 596 of file TEcnaWrite.cc.

References fAnaType, fFirstReqEvtNumber, fLastReqEvtNumber, fNbOfSamples, fReqNbOfEvts, fRunNumber, and fStexNumber.

600 {
601  fAnaType = ArgAnaType;
602  fNbOfSamples = ArgNbOfSamples;
603  fRunNumber = ArgRunNumber;
604  fFirstReqEvtNumber = ArgFirstReqEvtNumber;
605  fLastReqEvtNumber = ArgLastReqEvtNumber;
606  fReqNbOfEvts = ArgReqNbOfEvts;
607  fStexNumber = ArgStexNumber;
608 }
TString fAnaType
Definition: TEcnaWrite.h:128
Int_t fStexNumber
Definition: TEcnaWrite.h:134
Int_t fRunNumber
Definition: TEcnaWrite.h:130
Int_t fNbOfSamples
Definition: TEcnaWrite.h:129
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:131
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:132
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:133
void TEcnaWrite::SetEcalSubDetector ( const TString &  SubDet)

Definition at line 204 of file TEcnaWrite.cc.

References fEcal, fFlagSubDet, fgMaxCar, fNbChanByLine, fNbSampByLine, fSectChanSizeX, fSectChanSizeY, fSectSampSizeX, fSectSampSizeY, TEcnaParEcal::GetEcalSubDetector(), TEcnaParEcal::MaxCrysHocoInStin(), TEcnaParEcal::MaxCrysVecoInStin(), and TEcnaParEcal::MaxSampADC().

Referenced by TEcnaWrite().

205 {
206  // Set Subdetector (EB or EE)
207 
208  Int_t MaxCar = fgMaxCar;
209  fFlagSubDet.Resize(MaxCar);
211 
212  //........................................................................
213  //
214  // (for ASCII files writing methods only) ...
215  //
216  // DEFINITION OF THE SECTOR SIZES
217  // FOR THE CORRELATION AND COVARIANCE MATRICES DISPLAY
218  //
219  // MUST BE A DIVISOR OF THE TOTAL NUMBER.
220  // ======================================
221  //
222  // Examples:
223  //
224  // (1) 25 channels => size = 25 or 5 (divisors of 25)
225  //
226  // 25 => matrix = 1 x 1 sector of size (25 x 25)
227  // = (1 x 1) x (25 x 25) = 1 x 625 = 625
228  // 5 => matrix = 5 x 5 sectors of size (5 x 5)
229  // = (5 x 5) x ( 5 x 5) = 25 x 25 = 625
230  //
231  // (2) 10 samples => size = 10, 5 or 2 (divisors of 10)
232  //
233  // 10 => matrix = 1 X 1 sectors of size (10 x 10)
234  // = (1 x 1) x (10 x 10) = 1 x 100 = 100
235  // 5 => matrix = 2 x 2 sectors of size (5 x 5)
236  // = (2 x 2) x ( 5 x 5) = 4 x 25 = 100
237  // 2 => matrix = 5 x 5 sectors of size (2 x 2)
238  // = (5 x 5) x ( 2 x 2) = 25 x 4 = 100
239  //
240  //........................................................................
245 
246  //........................................................................
247  //
248  // DEFINITION OF THE NUMBER OF VALUES BY LINE
249  // for the Expectation Values, Variances and.
250  // Event distributions by (channel,sample)
251  //
252  // MUST BE A DIVISOR OF THE TOTAL NUMBER.
253  // ======================================
254  //
255  // Examples:
256  // 1) For expectation values and variances:
257  //
258  // 25 channels => size = 5
259  // => sample sector = 5 lines of 5 values
260  // = 5 x 5 = 25 values
261  //
262  // 10 samples => size = 10
263  // => channel sector = 1 lines of 10 values
264  // = 1 x 10 = 10 values
265  //
266  // 2) For event distributions:
267  //
268  // 100 bins => size = 10
269  // => sample sector = 10 lines of 10 values
270  // = 10 x 10 = 100 values
271  //
272  //........................................................................
275 }//---------- (end of SetEcalSubDetector) ------------------
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:97
Int_t fgMaxCar
Definition: TEcnaWrite.h:43
Int_t MaxCrysVecoInStin()
Int_t fNbSampByLine
Definition: TEcnaWrite.h:100
TString fFlagSubDet
Definition: TEcnaWrite.h:55
Int_t fNbChanByLine
Definition: TEcnaWrite.h:99
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:54
Int_t fSectChanSizeX
Definition: TEcnaWrite.h:96
Int_t MaxCrysHocoInStin()
Int_t MaxSampADC()
Int_t fSectChanSizeY
Definition: TEcnaWrite.h:96
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:97
TString GetEcalSubDetector()
void TEcnaWrite::SetEcalSubDetector ( const TString &  SubDet,
const TEcnaParEcal pEcal,
const TEcnaNumbering pEcalNumbering 
)

Definition at line 278 of file TEcnaWrite.cc.

References fCnew, fEcal, fEcalNumbering, fFlagSubDet, fgMaxCar, fNbChanByLine, fNbSampByLine, fSectChanSizeX, fSectChanSizeY, fSectSampSizeX, fSectSampSizeY, TEcnaParEcal::GetEcalSubDetector(), TEcnaParEcal::MaxCrysHocoInStin(), TEcnaParEcal::MaxCrysVecoInStin(), and TEcnaParEcal::MaxSampADC().

281 {
282  // Set Subdetector (EB or EE)
283 
284 
285  fEcal = 0;
286  if( pEcal == 0 )
287  {fEcal = new TEcnaParEcal(SubDet.Data()); fCnew++;}
288  else
289  {fEcal = (TEcnaParEcal*)pEcal;}
290 
291  Int_t MaxCar = fgMaxCar;
292  fFlagSubDet.Resize(MaxCar);
294 
295  fEcalNumbering = 0;
296  if( pEcalNumbering == 0 )
297  {fEcalNumbering = new TEcnaNumbering(SubDet.Data(), fEcal); fCnew++;}
298  else
299  {fEcalNumbering = (TEcnaNumbering*)pEcalNumbering;}
300 
301  //........................................................................
302  //
303  // (for ASCII files writing methods only) ...
304  //
305  // DEFINITION OF THE SECTOR SIZES
306  // FOR THE CORRELATION AND COVARIANCE MATRICES DISPLAY
307  //
308  // MUST BE A DIVISOR OF THE TOTAL NUMBER.
309  // ======================================
310  //
311  // Examples:
312  //
313  // (1) 25 channels => size = 25 or 5 (divisors of 25)
314  //
315  // 25 => matrix = 1 x 1 sector of size (25 x 25)
316  // = (1 x 1) x (25 x 25) = 1 x 625 = 625
317  // 5 => matrix = 5 x 5 sectors of size (5 x 5)
318  // = (5 x 5) x ( 5 x 5) = 25 x 25 = 625
319  //
320  // (2) 10 samples => size = 10, 5 or 2 (divisors of 10)
321  //
322  // 10 => matrix = 1 X 1 sectors of size (10 x 10)
323  // = (1 x 1) x (10 x 10) = 1 x 100 = 100
324  // 5 => matrix = 2 x 2 sectors of size (5 x 5)
325  // = (2 x 2) x ( 5 x 5) = 4 x 25 = 100
326  // 2 => matrix = 5 x 5 sectors of size (2 x 2)
327  // = (5 x 5) x ( 2 x 2) = 25 x 4 = 100
328  //
329  //........................................................................
334 
335  //........................................................................
336  //
337  // DEFINITION OF THE NUMBER OF VALUES BY LINE
338  // for the Expectation Values, Variances and.
339  // Event distributions by (channel,sample)
340  //
341  // MUST BE A DIVISOR OF THE TOTAL NUMBER.
342  // ======================================
343  //
344  // Examples:
345  // 1) For expectation values and variances:
346  //
347  // 25 channels => size = 5
348  // => sample sector = 5 lines of 5 values
349  // = 5 x 5 = 25 values
350  //
351  // 10 samples => size = 10
352  // => channel sector = 1 lines of 10 values
353  // = 1 x 10 = 10 values
354  //
355  // 2) For event distributions:
356  //
357  // 100 bins => size = 10
358  // => sample sector = 10 lines of 10 values
359  // = 10 x 10 = 100 values
360  //
361  //........................................................................
364 }//---------- (end of SetEcalSubDetector) ------------------
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:97
Int_t fgMaxCar
Definition: TEcnaWrite.h:43
Int_t MaxCrysVecoInStin()
Int_t fNbSampByLine
Definition: TEcnaWrite.h:100
TString fFlagSubDet
Definition: TEcnaWrite.h:55
Int_t fNbChanByLine
Definition: TEcnaWrite.h:99
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:54
Int_t fCnew
Definition: TEcnaWrite.h:40
Int_t fSectChanSizeX
Definition: TEcnaWrite.h:96
Int_t MaxCrysHocoInStin()
Int_t MaxSampADC()
Int_t fSectChanSizeY
Definition: TEcnaWrite.h:96
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:97
TString GetEcalSubDetector()
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:57
void TEcnaWrite::WriteAsciiCorrelationsBetweenSamples ( const Int_t &  user_StexStin,
const Int_t &  user_StinEcha,
const Int_t &  MatSize,
const TMatrixD &  read_matrix 
)

Definition at line 1435 of file TEcnaWrite.cc.

References fAsciiFileWriteHeader(), fCodeCorCss, fEcalNumbering, fFlagSubDet, fMakeResultsFileName(), fSectSampSizeX, fSectSampSizeY, fStexNumber, fStexStinUser, fStinEchaUser, fT2dWriteAscii(), and TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna().

Referenced by TEcnaHistos::WriteMatrixAscii().

1439 {
1440 //Writing of the correlations between samples for a given StexEcha in an ASCII file
1441 
1442 
1443  if( fFlagSubDet == "EB" ){fStexStinUser = user_StexStin;}
1444  if( fFlagSubDet == "EE" ){fStexStinUser =
1446 
1447  if( fFlagSubDet == "EB" ){fStinEchaUser = user_StinEcha;}
1448  if( fFlagSubDet == "EE" ){fStinEchaUser = user_StinEcha+1;}
1449 
1450  Int_t i_code = fCodeCorCss; // code for correlations between samples
1451  fMakeResultsFileName(i_code);
1452  fAsciiFileWriteHeader(i_code);
1453 
1454  Int_t i_pasx = fSectSampSizeX;
1455  Int_t i_pasy = fSectSampSizeY;
1456 
1457  fT2dWriteAscii(i_code, i_pasx, i_pasy, MatSize, read_matrix);
1458 }
void fAsciiFileWriteHeader(const Int_t &)
Definition: TEcnaWrite.cc:1051
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:97
Int_t fStinEchaUser
Definition: TEcnaWrite.h:103
TString fFlagSubDet
Definition: TEcnaWrite.h:55
Int_t fStexNumber
Definition: TEcnaWrite.h:134
Int_t fStexStinUser
Definition: TEcnaWrite.h:102
void fT2dWriteAscii(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1469
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t fCodeCorCss
Definition: TEcnaWrite.h:76
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:97
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:640
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:57
void TEcnaWrite::WriteAsciiCovariancesBetweenSamples ( const Int_t &  user_StexStin,
const Int_t &  user_StinEcha,
const Int_t &  MatSize,
const TMatrixD &  read_matrix 
)

Definition at line 1405 of file TEcnaWrite.cc.

References fAsciiFileWriteHeader(), fCodeCovCss, fEcalNumbering, fFlagSubDet, fMakeResultsFileName(), fSectSampSizeX, fSectSampSizeY, fStexNumber, fStexStinUser, fStinEchaUser, fT2dWriteAscii(), and TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna().

Referenced by TEcnaHistos::WriteMatrixAscii().

1409 {
1410 //Writing of the covariances between samples for a given StexEcha in an ASCII file
1411 
1412  if( fFlagSubDet == "EB" ){fStexStinUser = user_StexStin;}
1413  if( fFlagSubDet == "EE" ){fStexStinUser =
1415 
1416  if( fFlagSubDet == "EB" ){fStinEchaUser = user_StinEcha;}
1417  if( fFlagSubDet == "EE" ){fStinEchaUser = user_StinEcha+1;}
1418 
1419  Int_t i_code = fCodeCovCss; // code for covariances between samples
1420  fMakeResultsFileName(i_code);
1421  fAsciiFileWriteHeader(i_code);
1422 
1423  Int_t i_pasx = fSectSampSizeX;
1424  Int_t i_pasy = fSectSampSizeY;
1425 
1426  fT2dWriteAscii(i_code, i_pasx, i_pasy, MatSize, read_matrix);
1427 }
void fAsciiFileWriteHeader(const Int_t &)
Definition: TEcnaWrite.cc:1051
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:97
Int_t fStinEchaUser
Definition: TEcnaWrite.h:103
TString fFlagSubDet
Definition: TEcnaWrite.h:55
Int_t fStexNumber
Definition: TEcnaWrite.h:134
Int_t fStexStinUser
Definition: TEcnaWrite.h:102
void fT2dWriteAscii(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1469
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t fCodeCovCss
Definition: TEcnaWrite.h:75
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:97
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:640
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:57
void TEcnaWrite::WriteAsciiHisto ( const TString &  HistoCode,
const Int_t &  HisSize,
const TVectorD &  read_histo 
)

Definition at line 1188 of file TEcnaWrite.cc.

References gather_cfg::cout, TauDecayModes::dec, fAsciiFileName, fAsciiFileWriteHeader(), fCodeHfn, fCodeLfn, fCodeMeanCorss, fCodeNbOfEvts, fCodePed, fCodeSigCorss, fCodeTno, fEcalNumbering, fFcout_f, fFlagSubDet, fgMaxCar, alignBH_cfg::fixed, fMakeResultsFileName(), fReqNbOfEvts, fStexNumber, TEcnaNumbering::Get0TowEchaFrom0SMEcha(), TEcnaNumbering::Get1DeeSCEcnaFrom0DeeEcha(), TEcnaNumbering::Get1SCEchaFrom0DeeEcha(), TEcnaNumbering::Get1SMCrysFrom1SMTowAnd0TowEcha(), TEcnaNumbering::Get1SMTowFrom0SMEcha(), TEcnaNumbering::GetDeeSCConsFrom1DeeSCEcna(), TEcnaNumbering::GetDSFrom1DeeSCEcna(), TEcnaNumbering::GetDSSCFrom1DeeSCEcna(), TEcnaNumbering::GetEta(), TEcnaNumbering::GetIXCrysInDee(), TEcnaNumbering::GetJYCrysInDee(), TEcnaNumbering::GetPhiInSM(), and relativeConstraints::value.

Referenced by TEcnaHistos::WriteHistoAscii().

1190 {
1191 //Write histo with correspondance CNA-channel <-> xtal number in SM or Dee
1192 
1193  // BuildCrysTable() is called in the method Init() which is called by the constructor
1194 
1195  Int_t i_code = fCodeNbOfEvts;
1196 
1197  //--------------------------------------------------------------------------------
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;}
1205 
1206  fMakeResultsFileName(i_code); // => Making of the results .ascii file name
1207  fAsciiFileWriteHeader(i_code); // => Open of the file associated with stream fFcout_f
1208 
1209  //..................................... format numerical values
1210  fFcout_f << std::setiosflags(std::ios::showpoint | std::ios::uppercase);
1211  fFcout_f << std::setprecision(3) << std::setw(6);
1212  fFcout_f.setf(std::ios::dec, std::ios::basefield);
1213  fFcout_f.setf(std::ios::fixed, std::ios::floatfield);
1214  fFcout_f.setf(std::ios::left, std::ios::adjustfield);
1215  fFcout_f.setf(std::ios::right, std::ios::adjustfield);
1216 
1217  std::cout << std::setiosflags(std::ios::showpoint | std::ios::uppercase);
1218  std::cout << std::setprecision(3) << std::setw(6);
1219  std::cout.setf(std::ios::dec, std::ios::basefield);
1220  std::cout.setf(std::ios::fixed, std::ios::floatfield);
1221  std::cout.setf(std::ios::left, std::ios::adjustfield);
1222  std::cout.setf(std::ios::right, std::ios::adjustfield);
1223 
1224  //........................................................ WriteAsciiHisto
1225  TString aStexName;
1226  Int_t MaxCar = fgMaxCar;
1227  aStexName.Resize(MaxCar);
1228  aStexName = "SM or Dee?";
1229 
1230  TString aStinName;
1231  MaxCar = fgMaxCar;
1232  aStinName.Resize(MaxCar);
1233  aStinName = "Tower or SC?";
1234 
1235  TString aHoco;
1236  MaxCar = fgMaxCar;
1237  aHoco.Resize(MaxCar);
1238  aHoco = "Eta or IX?";
1239 
1240  TString aVeco;
1241  MaxCar = fgMaxCar;
1242  aVeco.Resize(MaxCar);
1243  aVeco = "Phi or IY?";
1244 
1245  TString aSpecifa;
1246  MaxCar = fgMaxCar;
1247  aSpecifa.Resize(MaxCar);
1248  aSpecifa = " ";
1249 
1250  TString aSpecifc;
1251  MaxCar = fgMaxCar;
1252  aSpecifc.Resize(MaxCar);
1253  aSpecifc = " ";
1254 
1255  TString aSpecifd;
1256  MaxCar = fgMaxCar;
1257  aSpecifd.Resize(MaxCar);
1258  aSpecifd = " ";
1259 
1260  TString aSpecife;
1261  MaxCar = fgMaxCar;
1262  aSpecife.Resize(MaxCar);
1263  aSpecife = " ";
1264 
1265  TString aSpecif1;
1266  MaxCar = fgMaxCar;
1267  aSpecif1.Resize(MaxCar);
1268  aSpecif1 = " ";
1269 
1270  TString aSpecif2;
1271  MaxCar = fgMaxCar;
1272  aSpecif2.Resize(MaxCar);
1273  aSpecif2 = " ";
1274 
1275  if( fFlagSubDet == "EB" )
1276  {
1277  aStexName = "SM " ; aStinName = "tower" ; aSpecifa = " channel# ";
1278  aHoco = " Eta "; aVeco = " Phi "; aSpecifc = " channel# ";
1279  aSpecifd = " crystal# "; aSpecife = "SM ";
1280  }
1281  if( fFlagSubDet == "EE" )
1282  {
1283  aStexName = "Dee " ; aStinName = " SC " ; aSpecifa = " Sector# ";
1284  aHoco = " IX "; aVeco = " IY "; aSpecifc = " crystal# ";
1285  aSpecifd = " SC # "; aSpecife = "Sector";
1286  }
1287 
1288  //.............................................................. WriteAsciiHisto
1289  for (Int_t i0StexEcha=0; i0StexEcha<HisSize; i0StexEcha++)
1290  {
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;
1297  Int_t n1SCinDS = 0;
1298 
1299  if( fFlagSubDet == "EB")
1300  {
1301  n1StexStin = fEcalNumbering->Get1SMTowFrom0SMEcha(i0StexEcha);
1302  StexStinEcna = n1StexStin;
1303  i0StinEcha = fEcalNumbering->Get0TowEchaFrom0SMEcha(i0StexEcha);
1304  n1StexCrys = fEcalNumbering->Get1SMCrysFrom1SMTowAnd0TowEcha(n1StexStin, i0StinEcha);
1305  }
1306  if( fFlagSubDet == "EE")
1307  {
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);
1313  }
1314 
1315  if( n1StexStin > 0 )
1316  {
1317  if( (fFlagSubDet == "EB" && i0StinEcha == 0) || (fFlagSubDet == "EE" && n1StinEcha == 1) )
1318  {
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) ";}
1326 
1327  fFcout_f << std::endl;
1328 
1329  fFcout_f << aSpecifa.Data()
1330  << " " << aStinName.Data() << "# "
1331  << aSpecifc.Data()
1332  << aSpecifd.Data()
1333  << aHoco.Data()
1334  << aVeco.Data()
1335  << aSpecif1.Data() << std::endl;
1336 
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() << std::endl << std::endl;
1344  }
1345 
1346  Double_t value = read_histo(i0StexEcha);
1347 
1348  if( fFlagSubDet == "EB" )
1349  {
1350  fFcout_f << std::setw(7) << i0StexEcha
1351  << std::setw(8) << n1StexStin
1352  << std::setw(11) << i0StinEcha // (Electronic channel number in tower)
1353  << std::setw(10) << n1StexCrys
1354  << std::setw(10) << (Int_t)fEcalNumbering->GetEta(fStexNumber, StexStinEcna, i0StinEcha)
1355  << std::setw(10) << (Int_t)fEcalNumbering->GetPhiInSM(fStexNumber, StexStinEcna, i0StinEcha);
1356  }
1357  if( fFlagSubDet == "EE" )
1358  {
1359  Int_t n1StinEcha_m = n1StinEcha-1;
1360  fFcout_f << std::setw(7) << n1DataSector
1361  << std::setw(8) << n1StexStin
1362  << std::setw(11) << n1StinEcha // (Xtal number for construction in SC)
1363  << std::setw(10) << n1SCinDS
1364  << std::setw(10) << fEcalNumbering->GetIXCrysInDee(fStexNumber, StexStinEcna, n1StinEcha_m)
1365  << std::setw(10) << fEcalNumbering->GetJYCrysInDee(fStexNumber, StexStinEcna, n1StinEcha_m);
1366  }
1367 
1368  if( HistoCode == "D_NOE_ChNb")
1369  {
1370  Int_t ivalue = (Int_t)value;
1371  fFcout_f << std::setw(13) << ivalue;
1372  fFcout_f << std::setw(4) << "(" << std::setw(6) << fReqNbOfEvts << ")";
1373  }
1374  else
1375  {
1376  fFcout_f << std::setw(13) << value;
1377  }
1378 
1379  fFcout_f << std::endl;
1380  }
1381  } // end of loop: for (Int_t i0StexEcha=0; i0StexEcha<HisSize; i0StexEcha++)
1382 
1383  fFcout_f.close();
1384 
1385  // if(fFlagPrint != fCodePrintNoComment)
1386  // {
1387  std::cout << "*TEcnaWrite::WriteAsciiHisto(...)> INFO: "
1388  << "histo has been written in file: " << std::endl
1389  << " " << fAsciiFileName.Data() << std::endl;
1390  // }
1391 } // end of TEcnaWrite::WriteAsciiHisto
void fAsciiFileWriteHeader(const Int_t &)
Definition: TEcnaWrite.cc:1051
Int_t fCodeHfn
Definition: TEcnaWrite.h:71
Int_t fgMaxCar
Definition: TEcnaWrite.h:43
Int_t Get1DeeSCEcnaFrom0DeeEcha(const Int_t &)
TString fFlagSubDet
Definition: TEcnaWrite.h:55
Int_t Get1SCEchaFrom0DeeEcha(const Int_t &)
Int_t fStexNumber
Definition: TEcnaWrite.h:134
Int_t Get0TowEchaFrom0SMEcha(const Int_t &)
Int_t GetJYCrysInDee(const Int_t &, const Int_t &, const Int_t &)
Int_t fCodePed
Definition: TEcnaWrite.h:68
Int_t fCodeSigCorss
Definition: TEcnaWrite.h:73
Int_t Get1SMTowFrom0SMEcha(const Int_t &)
Int_t GetDSSCFrom1DeeSCEcna(const Int_t &, const Int_t &, const Int_t &)
Definition: value.py:1
Int_t GetDSFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Double_t GetEta(const Int_t &, const Int_t &, const Int_t &)
Int_t Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
std::ofstream fFcout_f
Definition: TEcnaWrite.h:61
Int_t fCodeMeanCorss
Definition: TEcnaWrite.h:72
Double_t GetPhiInSM(const Int_t &, const Int_t &, const Int_t &)
Int_t fCodeTno
Definition: TEcnaWrite.h:69
Int_t fCodeLfn
Definition: TEcnaWrite.h:70
Int_t GetIXCrysInDee(const Int_t &, const Int_t &, const Int_t &)
TString fAsciiFileName
Definition: TEcnaWrite.h:145
Int_t fCodeNbOfEvts
Definition: TEcnaWrite.h:67
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:640
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:133
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:57

Member Data Documentation

TString TEcnaWrite::fAnaType
TString TEcnaWrite::fAsciiFileName
TString TEcnaWrite::fAsciiFileNameShort

Definition at line 146 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCdelete
private

Definition at line 40 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCdeleteRoot
private

Definition at line 41 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCnaCommand
private

Definition at line 47 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCnaError
private

Definition at line 47 of file TEcnaWrite.h.

TEcnaParCout* TEcnaWrite::fCnaParCout
private

Definition at line 59 of file TEcnaWrite.h.

Referenced by Init(), and TEcnaWrite().

TEcnaParPaths* TEcnaWrite::fCnaParPaths
private

Definition at line 58 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and TEcnaWrite().

Int_t TEcnaWrite::fCnew
private

Definition at line 40 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), fT2dWriteAscii(), and SetEcalSubDetector().

Int_t TEcnaWrite::fCnewRoot
private

Definition at line 41 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeAdcEvt
private

Definition at line 78 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeAvMeanCorss
private

Definition at line 84 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

Int_t TEcnaWrite::fCodeAvPed
private

Definition at line 82 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCodeAvSigCorss
private

Definition at line 85 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

Int_t TEcnaWrite::fCodeAvTno
private

Definition at line 83 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCodeCorCss
private
Int_t TEcnaWrite::fCodeCovCss
private
Int_t TEcnaWrite::fCodeHeaderAscii
private

Definition at line 64 of file TEcnaWrite.h.

Referenced by fAsciiFileWriteHeader(), fMakeResultsFileName(), and Init().

Int_t TEcnaWrite::fCodeHFccMoStins
private

Definition at line 93 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeHfCor
private

Definition at line 90 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii().

Int_t TEcnaWrite::fCodeHfCov
private

Definition at line 89 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii().

Int_t TEcnaWrite::fCodeHfn
private

Definition at line 71 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), Init(), and WriteAsciiHisto().

Int_t TEcnaWrite::fCodeLFccMoStins
private

Definition at line 92 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeLfCor
private

Definition at line 88 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

Int_t TEcnaWrite::fCodeLfCov
private

Definition at line 87 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

Int_t TEcnaWrite::fCodeLfn
private

Definition at line 70 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), Init(), and WriteAsciiHisto().

Int_t TEcnaWrite::fCodeMeanCorss
private

Definition at line 72 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), Init(), and WriteAsciiHisto().

Int_t TEcnaWrite::fCodeMSp
private

Definition at line 79 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCodeNbOfEvts
private

Definition at line 67 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), Init(), and WriteAsciiHisto().

Int_t TEcnaWrite::fCodePed
private

Definition at line 68 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), Init(), and WriteAsciiHisto().

Int_t TEcnaWrite::fCodePrintAllComments
private

Definition at line 52 of file TEcnaWrite.h.

Referenced by Init(), and NumberOfEventsAnalysis().

Int_t TEcnaWrite::fCodePrintComments
private

Definition at line 52 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodePrintNoComment
private

Definition at line 52 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii().

Int_t TEcnaWrite::fCodePrintWarnings
private

Definition at line 52 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeRoot
private

Definition at line 65 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and Init().

Int_t TEcnaWrite::fCodeSigCorss
private

Definition at line 73 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), Init(), and WriteAsciiHisto().

Int_t TEcnaWrite::fCodeSSp
private

Definition at line 80 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCodeTno
private

Definition at line 69 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), Init(), and WriteAsciiHisto().

TEcnaParEcal* TEcnaWrite::fEcal
private
TEcnaNumbering* TEcnaWrite::fEcalNumbering
private
std::ofstream TEcnaWrite::fFcout_f
private

Definition at line 61 of file TEcnaWrite.h.

Referenced by fAsciiFileWriteHeader(), fT2dWriteAscii(), and WriteAsciiHisto().

Int_t TEcnaWrite::fFirstReqEvtNumber
Int_t TEcnaWrite::fFlagPrint
private

Definition at line 51 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and NumberOfEventsAnalysis().

TString TEcnaWrite::fFlagSubDet
private
Int_t TEcnaWrite::fgMaxCar
private

Definition at line 43 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), Init(), SetEcalSubDetector(), and WriteAsciiHisto().

Double_t* TEcnaWrite::fjustap_1d_cc
private

Definition at line 114 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().

Double_t* TEcnaWrite::fjustap_1d_ev
private

Definition at line 108 of file TEcnaWrite.h.

Referenced by Init().

Double_t* TEcnaWrite::fjustap_1d_ss
private

Definition at line 117 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().

Double_t* TEcnaWrite::fjustap_1d_var
private

Definition at line 111 of file TEcnaWrite.h.

Referenced by Init().

Double_t** TEcnaWrite::fjustap_2d_cc
private

Definition at line 113 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().

Double_t** TEcnaWrite::fjustap_2d_ev
private

Definition at line 107 of file TEcnaWrite.h.

Referenced by Init().

Double_t** TEcnaWrite::fjustap_2d_ss
private

Definition at line 116 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().

Double_t** TEcnaWrite::fjustap_2d_var
private

Definition at line 110 of file TEcnaWrite.h.

Referenced by Init().

Int_t TEcnaWrite::fLastReqEvtNumber
Int_t TEcnaWrite::fNbChanByLine
private

Definition at line 99 of file TEcnaWrite.h.

Referenced by SetEcalSubDetector().

Int_t TEcnaWrite::fNbOfSamples
Int_t TEcnaWrite::fNbSampByLine
private

Definition at line 100 of file TEcnaWrite.h.

Referenced by SetEcalSubDetector().

TString TEcnaWrite::fPathForAsciiFiles

Definition at line 138 of file TEcnaWrite.h.

Int_t TEcnaWrite::fReqNbOfEvts
TString TEcnaWrite::fRootFileName

Definition at line 143 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), GetRootFileName(), and NumberOfEventsAnalysis().

TString TEcnaWrite::fRootFileNameShort
Int_t TEcnaWrite::fRunNumber
Int_t TEcnaWrite::fSectChanSizeX
private

Definition at line 96 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and SetEcalSubDetector().

Int_t TEcnaWrite::fSectChanSizeY
private

Definition at line 96 of file TEcnaWrite.h.

Referenced by SetEcalSubDetector().

Int_t TEcnaWrite::fSectSampSizeX
private
Int_t TEcnaWrite::fSectSampSizeY
private
TString TEcnaWrite::fStartDate

Definition at line 139 of file TEcnaWrite.h.

Referenced by fAsciiFileWriteHeader(), and RegisterFileParameters().

time_t TEcnaWrite::fStartTime

Definition at line 140 of file TEcnaWrite.h.

Referenced by RegisterFileParameters().

TString TEcnaWrite::fStexName

Definition at line 135 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fStexNumber
Int_t TEcnaWrite::fStexStinUser
private
Int_t TEcnaWrite::fStinEchaUser
private
TString TEcnaWrite::fStinName

Definition at line 136 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

TString TEcnaWrite::fStopDate

Definition at line 139 of file TEcnaWrite.h.

Referenced by fAsciiFileWriteHeader(), and RegisterFileParameters().

time_t TEcnaWrite::fStopTime

Definition at line 140 of file TEcnaWrite.h.

Referenced by RegisterFileParameters().

TString TEcnaWrite::fTTBELL
private

Definition at line 45 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and Init().

Int_t TEcnaWrite::fUserSamp
private

Definition at line 101 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().