CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
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: 06/04/2011 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_cna_1.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  // cout << "[Info Management] CLASS: TEcnaWrite. CREATE OBJECT: this = " << this << endl;
38 
39  Init();
40 }
void Init()
Definition: TEcnaWrite.cc:134
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  // cout << "[Info Management] CLASS: TEcnaWrite. CREATE OBJECT: this = " << this << 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:134
TEcnaParPaths * fCnaParPaths
Definition: TEcnaWrite.h:57
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:53
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:102
Bool_t GetPathForResultsRootFiles()
void SetEcalSubDetector(const TString &)
Definition: TEcnaWrite.cc:203
TEcnaParCout * fCnaParCout
Definition: TEcnaWrite.h:58
Bool_t GetPathForResultsAsciiFiles()
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:229
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:56
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  // cout << "[Info Management] CLASS: TEcnaWrite. CREATE OBJECT: this = " << this << 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
112 
113  fCnaParCout = 0;
114  if( pCnaParCout == 0 )
115  {fCnaParCout = new TEcnaParCout(); /*fCnew++*/;}
116  else
117  {fCnaParCout = (TEcnaParCout*)pCnaParCout;}
118 
119  fEcal = 0;
120  if( pEcal == 0 )
121  {fEcal = new TEcnaParEcal(SubDet.Data()); /*fCnew++*/;}
122  else
123  {fEcal = (TEcnaParEcal*)pEcal;}
124 
125  fEcalNumbering = 0;
126  if( pEcalNumbering == 0 )
127  {fEcalNumbering = new TEcnaNumbering(SubDet.Data(), fEcal); /*fCnew++*/;}
128  else
129  {fEcalNumbering = (TEcnaNumbering*)pEcalNumbering;}
130 
131  SetEcalSubDetector(SubDet.Data(), fEcal, fEcalNumbering);
132 }
void Init()
Definition: TEcnaWrite.cc:134
TEcnaParPaths * fCnaParPaths
Definition: TEcnaWrite.h:57
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:53
Bool_t GetPathForResultsRootFiles()
void SetEcalSubDetector(const TString &)
Definition: TEcnaWrite.cc:203
TEcnaParCout * fCnaParCout
Definition: TEcnaWrite.h:58
Bool_t GetPathForResultsAsciiFiles()
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:56
TEcnaWrite::~TEcnaWrite ( )
virtual

Definition at line 17 of file TEcnaWrite.cc.

18 {
19  //destructor
20 
21  //if (fEcal != 0){delete fEcal; fCdelete++;}
22  //if (fEcalNumbering != 0){delete fEcalNumbering; fCdelete++;}
23  //if (fCnaParPaths != 0){delete fCnaParPaths; fCdelete++;}
24  //if (fCnaParCout != 0){delete fCnaParCout; fCdelete++;}
25 
26  // cout << "[Info Management] CLASS: TEcnaWrite. DESTROY OBJECT: this = " << this << endl;
27 }

Member Function Documentation

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

Definition at line 1050 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().

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

Definition at line 640 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().

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

References gather_cfg::cout, fAsciiFileName, fCnew, fCodeAvMeanCorss, fCodeAvSigCorss, fCodeCorCss, fCodeCovCss, fCodeHfCor, fCodeHfCov, fCodeLfCor, fCodeLfCov, fCodePrintNoComment, fEcal, fEcalNumbering, fFcout_f, fFlagPrint, fFlagSubDet, 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().

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

Definition at line 386 of file TEcnaWrite.cc.

References fAnaType.

386 {return fAnaType;}
TString fAnaType
Definition: TEcnaWrite.h:127
TString TEcnaWrite::GetAsciiFileName ( )

Definition at line 383 of file TEcnaWrite.cc.

References fAsciiFileName.

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

383 {return fAsciiFileName;}
TString fAsciiFileName
Definition: TEcnaWrite.h:144
Int_t TEcnaWrite::GetFirstReqEvtNumber ( )

Definition at line 389 of file TEcnaWrite.cc.

References fFirstReqEvtNumber.

389 {return fFirstReqEvtNumber;}
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:130
Int_t TEcnaWrite::GetNbOfSamples ( )

Definition at line 387 of file TEcnaWrite.cc.

References fNbOfSamples.

387 {return fNbOfSamples;}
Int_t fNbOfSamples
Definition: TEcnaWrite.h:128
Int_t TEcnaWrite::GetReqNbOfEvts ( )

Definition at line 390 of file TEcnaWrite.cc.

References fReqNbOfEvts.

390 {return fReqNbOfEvts;}
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:132
TString TEcnaWrite::GetRootFileName ( )
TString TEcnaWrite::GetRootFileNameShort ( )

Definition at line 385 of file TEcnaWrite.cc.

References fRootFileNameShort.

Referenced by TEcnaRead::GetRootFileNameShort(), TEcnaRun::WriteNewRootFile(), and TEcnaRun::WriteRootFile().

385 {return fRootFileNameShort;}
TString fRootFileNameShort
Definition: TEcnaWrite.h:141
Int_t TEcnaWrite::GetRunNumber ( )

Definition at line 388 of file TEcnaWrite.cc.

References fRunNumber.

388 {return fRunNumber;}
Int_t fRunNumber
Definition: TEcnaWrite.h:129
Int_t TEcnaWrite::GetStexNumber ( )

Definition at line 391 of file TEcnaWrite.cc.

References fStexNumber.

391 {return fStexNumber;}
Int_t fStexNumber
Definition: TEcnaWrite.h:133
void TEcnaWrite::Init ( void  )

Definition at line 134 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().

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

Definition at line 519 of file TEcnaWrite.cc.

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

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

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

Definition at line 407 of file TEcnaWrite.cc.

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

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

615 {
616  fAnaType = ArgAnaType;
617  fNbOfSamples = ArgNbOfSamples;
618  fRunNumber = ArgRunNumber;
619  fFirstReqEvtNumber = ArgFirstReqEvtNumber;
620  fLastReqEvtNumber = ArgLastReqEvtNumber;
621  fReqNbOfEvts = ArgReqNbOfEvts;
622  fStexNumber = ArgStexNumber;
623  fStartDate = ArgStartDate;
624 
625  fStopDate = ArgStopDate;
626  fStartTime = ArgStartTime;
627  fStopTime = ArgStopTime;
628 }
TString fAnaType
Definition: TEcnaWrite.h:127
Int_t fStexNumber
Definition: TEcnaWrite.h:133
Int_t fRunNumber
Definition: TEcnaWrite.h:129
Int_t fNbOfSamples
Definition: TEcnaWrite.h:128
TString fStopDate
Definition: TEcnaWrite.h:138
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:130
time_t fStopTime
Definition: TEcnaWrite.h:139
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:131
TString fStartDate
Definition: TEcnaWrite.h:138
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:132
time_t fStartTime
Definition: TEcnaWrite.h:139
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 595 of file TEcnaWrite.cc.

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

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

Definition at line 203 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().

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

Definition at line 277 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().

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

Definition at line 1434 of file TEcnaWrite.cc.

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

Referenced by TEcnaHistos::WriteMatrixAscii().

1438 {
1439 //Writing of the correlations between samples for a given StexEcha in an ASCII file
1440 
1441 
1442  if( fFlagSubDet == "EB" ){fStexStinUser = user_StexStin;}
1443  if( fFlagSubDet == "EE" ){fStexStinUser =
1445 
1446  if( fFlagSubDet == "EB" ){fStinEchaUser = user_StinEcha;}
1447  if( fFlagSubDet == "EE" ){fStinEchaUser = user_StinEcha+1;}
1448 
1449  Int_t i_code = fCodeCorCss; // code for correlations between samples
1450  fMakeResultsFileName(i_code);
1451  fAsciiFileWriteHeader(i_code);
1452 
1453  Int_t i_pasx = fSectSampSizeX;
1454  Int_t i_pasy = fSectSampSizeY;
1455 
1456  fT2dWriteAscii(i_code, i_pasx, i_pasy, MatSize, read_matrix);
1457 }
void fAsciiFileWriteHeader(const Int_t &)
Definition: TEcnaWrite.cc:1050
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:96
Int_t fStinEchaUser
Definition: TEcnaWrite.h:102
TString fFlagSubDet
Definition: TEcnaWrite.h:54
Int_t fStexNumber
Definition: TEcnaWrite.h:133
Int_t fStexStinUser
Definition: TEcnaWrite.h:101
void fT2dWriteAscii(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1468
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t fCodeCorCss
Definition: TEcnaWrite.h:75
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:96
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:639
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:56
void TEcnaWrite::WriteAsciiCovariancesBetweenSamples ( const Int_t &  user_StexStin,
const Int_t &  user_StinEcha,
const Int_t &  MatSize,
const TMatrixD &  read_matrix 
)

Definition at line 1404 of file TEcnaWrite.cc.

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

Referenced by TEcnaHistos::WriteMatrixAscii().

1408 {
1409 //Writing of the covariances between samples for a given StexEcha in an ASCII file
1410 
1411  if( fFlagSubDet == "EB" ){fStexStinUser = user_StexStin;}
1412  if( fFlagSubDet == "EE" ){fStexStinUser =
1414 
1415  if( fFlagSubDet == "EB" ){fStinEchaUser = user_StinEcha;}
1416  if( fFlagSubDet == "EE" ){fStinEchaUser = user_StinEcha+1;}
1417 
1418  Int_t i_code = fCodeCovCss; // code for covariances between samples
1419  fMakeResultsFileName(i_code);
1420  fAsciiFileWriteHeader(i_code);
1421 
1422  Int_t i_pasx = fSectSampSizeX;
1423  Int_t i_pasy = fSectSampSizeY;
1424 
1425  fT2dWriteAscii(i_code, i_pasx, i_pasy, MatSize, read_matrix);
1426 }
void fAsciiFileWriteHeader(const Int_t &)
Definition: TEcnaWrite.cc:1050
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:96
Int_t fStinEchaUser
Definition: TEcnaWrite.h:102
TString fFlagSubDet
Definition: TEcnaWrite.h:54
Int_t fStexNumber
Definition: TEcnaWrite.h:133
Int_t fStexStinUser
Definition: TEcnaWrite.h:101
void fT2dWriteAscii(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1468
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t fCodeCovCss
Definition: TEcnaWrite.h:74
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:96
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:639
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:56
void TEcnaWrite::WriteAsciiHisto ( const TString &  HistoCode,
const Int_t &  HisSize,
const TVectorD &  read_histo 
)

Definition at line 1187 of file TEcnaWrite.cc.

References gather_cfg::cout, fAsciiFileName, fAsciiFileWriteHeader(), fCodeHfn, fCodeLfn, fCodeMeanCorss, fCodeNbOfEvts, fCodePed, fCodeSigCorss, fCodeTno, fEcalNumbering, fFcout_f, fFlagSubDet, fgMaxCar, 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().

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

Member Data Documentation

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

Definition at line 145 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCdelete
private

Definition at line 41 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCdeleteRoot
private

Definition at line 42 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCnaCommand
private

Definition at line 46 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCnaError
private

Definition at line 46 of file TEcnaWrite.h.

TEcnaParCout* TEcnaWrite::fCnaParCout
private

Definition at line 58 of file TEcnaWrite.h.

Referenced by Init(), and TEcnaWrite().

TEcnaParPaths* TEcnaWrite::fCnaParPaths
private

Definition at line 57 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and TEcnaWrite().

Int_t TEcnaWrite::fCnew
private

Definition at line 41 of file TEcnaWrite.h.

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

Int_t TEcnaWrite::fCnewRoot
private

Definition at line 42 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeAdcEvt
private

Definition at line 77 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeAvMeanCorss
private

Definition at line 83 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

Int_t TEcnaWrite::fCodeAvPed
private

Definition at line 81 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCodeAvSigCorss
private

Definition at line 84 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

Int_t TEcnaWrite::fCodeAvTno
private

Definition at line 82 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 63 of file TEcnaWrite.h.

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

Int_t TEcnaWrite::fCodeHFccMoStins
private

Definition at line 92 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeHfCor
private

Definition at line 89 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii().

Int_t TEcnaWrite::fCodeHfCov
private

Definition at line 88 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii().

Int_t TEcnaWrite::fCodeHfn
private

Definition at line 70 of file TEcnaWrite.h.

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

Int_t TEcnaWrite::fCodeLFccMoStins
private

Definition at line 91 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeLfCor
private

Definition at line 87 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

Int_t TEcnaWrite::fCodeLfCov
private

Definition at line 86 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

Int_t TEcnaWrite::fCodeLfn
private

Definition at line 69 of file TEcnaWrite.h.

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

Int_t TEcnaWrite::fCodeMeanCorss
private

Definition at line 71 of file TEcnaWrite.h.

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

Int_t TEcnaWrite::fCodeMSp
private

Definition at line 78 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCodeNbOfEvts
private

Definition at line 66 of file TEcnaWrite.h.

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

Int_t TEcnaWrite::fCodePed
private

Definition at line 67 of file TEcnaWrite.h.

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

Int_t TEcnaWrite::fCodePrintAllComments
private

Definition at line 51 of file TEcnaWrite.h.

Referenced by Init(), and NumberOfEventsAnalysis().

Int_t TEcnaWrite::fCodePrintComments
private

Definition at line 51 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodePrintNoComment
private

Definition at line 51 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii().

Int_t TEcnaWrite::fCodePrintWarnings
private

Definition at line 51 of file TEcnaWrite.h.

Int_t TEcnaWrite::fCodeRoot
private

Definition at line 64 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and Init().

Int_t TEcnaWrite::fCodeSigCorss
private

Definition at line 72 of file TEcnaWrite.h.

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

Int_t TEcnaWrite::fCodeSSp
private

Definition at line 79 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName().

Int_t TEcnaWrite::fCodeTno
private

Definition at line 68 of file TEcnaWrite.h.

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

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

Definition at line 60 of file TEcnaWrite.h.

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

Int_t TEcnaWrite::fFirstReqEvtNumber
Int_t TEcnaWrite::fFlagPrint
private

Definition at line 50 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and NumberOfEventsAnalysis().

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

Definition at line 40 of file TEcnaWrite.h.

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

Double_t* TEcnaWrite::fjustap_1d_cc
private

Definition at line 113 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().

Double_t* TEcnaWrite::fjustap_1d_ev
private

Definition at line 107 of file TEcnaWrite.h.

Referenced by Init().

Double_t* TEcnaWrite::fjustap_1d_ss
private

Definition at line 116 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().

Double_t* TEcnaWrite::fjustap_1d_var
private

Definition at line 110 of file TEcnaWrite.h.

Referenced by Init().

Double_t** TEcnaWrite::fjustap_2d_cc
private

Definition at line 112 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().

Double_t** TEcnaWrite::fjustap_2d_ev
private

Definition at line 106 of file TEcnaWrite.h.

Referenced by Init().

Double_t** TEcnaWrite::fjustap_2d_ss
private

Definition at line 115 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().

Double_t** TEcnaWrite::fjustap_2d_var
private

Definition at line 109 of file TEcnaWrite.h.

Referenced by Init().

Int_t TEcnaWrite::fLastReqEvtNumber
Int_t TEcnaWrite::fNbChanByLine
private

Definition at line 98 of file TEcnaWrite.h.

Referenced by SetEcalSubDetector().

Int_t TEcnaWrite::fNbOfSamples
Int_t TEcnaWrite::fNbSampByLine
private

Definition at line 99 of file TEcnaWrite.h.

Referenced by SetEcalSubDetector().

TString TEcnaWrite::fPathForAsciiFiles

Definition at line 137 of file TEcnaWrite.h.

Int_t TEcnaWrite::fReqNbOfEvts
TString TEcnaWrite::fRootFileName

Definition at line 142 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 95 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and SetEcalSubDetector().

Int_t TEcnaWrite::fSectChanSizeY
private

Definition at line 95 of file TEcnaWrite.h.

Referenced by SetEcalSubDetector().

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

Definition at line 138 of file TEcnaWrite.h.

Referenced by fAsciiFileWriteHeader(), and RegisterFileParameters().

time_t TEcnaWrite::fStartTime

Definition at line 139 of file TEcnaWrite.h.

Referenced by RegisterFileParameters().

TString TEcnaWrite::fStexName

Definition at line 134 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 135 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and fT2dWriteAscii().

TString TEcnaWrite::fStopDate

Definition at line 138 of file TEcnaWrite.h.

Referenced by fAsciiFileWriteHeader(), and RegisterFileParameters().

time_t TEcnaWrite::fStopTime

Definition at line 139 of file TEcnaWrite.h.

Referenced by RegisterFileParameters().

TString TEcnaWrite::fTTBELL
private

Definition at line 44 of file TEcnaWrite.h.

Referenced by fMakeResultsFileName(), and Init().

Int_t TEcnaWrite::fUserSamp
private

Definition at line 100 of file TEcnaWrite.h.

Referenced by fT2dWriteAscii(), and Init().