CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TEcnaRun Class Reference

#include <TEcnaRun.h>

Inheritance diagram for TEcnaRun:

Public Member Functions

void AverageHighFrequencyNoise ()
 
void AverageLowFrequencyNoise ()
 
void AverageMeanCorrelationsBetweenSamples ()
 
void AveragePedestals ()
 
void AverageSigmaOfCorrelationsBetweenSamples ()
 
void AverageTotalNoise ()
 
Bool_t CloseRootFile (const Text_t *)
 
void CorrelationsBetweenSamples ()
 
void CovariancesBetweenSamples ()
 
void Expert1Calculations ()
 
void Expert2Calculations ()
 
TString GetNewRootFileName ()
 
TString GetNewRootFileNameShort ()
 
Bool_t GetPathForResults ()
 
void GetReadyToCompute ()
 
void GetReadyToReadData (TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
 
void GetReadyToReadData (TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
 
TString GetRootFileName ()
 
TString GetRootFileNameShort ()
 
Bool_t GetSampleAdcValues (const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Double_t &)
 
void HighFrequencyCorrelationsBetweenChannels ()
 
void HighFrequencyCovariancesBetweenChannels ()
 
void HighFrequencyMeanCorrelationsBetweenSCs ()
 
void HighFrequencyMeanCorrelationsBetweenStins ()
 
void HighFrequencyMeanCorrelationsBetweenTowers ()
 
void HighFrequencyNoise ()
 
void Init ()
 
void LowFrequencyCorrelationsBetweenChannels ()
 
void LowFrequencyCovariancesBetweenChannels ()
 
void LowFrequencyMeanCorrelationsBetweenSCs ()
 
void LowFrequencyMeanCorrelationsBetweenStins ()
 
void LowFrequencyMeanCorrelationsBetweenTowers ()
 
void LowFrequencyNoise ()
 
void MeanCorrelationsBetweenSamples ()
 
Bool_t OpenRootFile (const Text_t *, TString)
 
void Pedestals ()
 
void PrintAllComments ()
 
void PrintComments ()
 
void PrintNoComment ()
 
void PrintWarnings ()
 
Bool_t ReadSampleAdcValues ()
 
Bool_t ReadSampleAdcValues (const Int_t &)
 
void SampleMeans ()
 
void SampleSigmas ()
 
void SampleValues ()
 
void SetEcalSubDetector (const TString)
 
void SigmaOfCorrelationsBetweenSamples ()
 
void StandardCalculations ()
 
void StartStopDate (TString, TString)
 
void StartStopTime (time_t, time_t)
 
 TEcnaRun ()
 
 TEcnaRun (TEcnaObject *, const TString)
 
 TEcnaRun (TEcnaObject *, const TString, const Int_t &)
 
 TEcnaRun (const TEcnaRun &)
 
void TotalNoise ()
 
void TRootAdcEvt (const Int_t &, const Int_t &)
 
void TRootAvEvCorss ()
 
void TRootAvHfn ()
 
void TRootAvLfn ()
 
void TRootAvPed ()
 
void TRootAvSigCorss ()
 
void TRootAvTno ()
 
void TRootCorCss (const Int_t &, const Int_t &)
 
void TRootCovCss (const Int_t &, const Int_t &)
 
void TRootHFccMoStins ()
 
void TRootHfCor ()
 
void TRootHfCov ()
 
void TRootHfn ()
 
void TRootLFccMoStins ()
 
void TRootLfCor ()
 
void TRootLfCov ()
 
void TRootLfn ()
 
void TRootMeanCorss ()
 
void TRootMSp (const Int_t &)
 
void TRootNbOfEvts (const Int_t &)
 
void TRootPed ()
 
void TRootSigCorss ()
 
void TRootSSp (const Int_t &)
 
void TRootStinNumbers ()
 
void TRootTno ()
 
Bool_t WriteNewRootFile (const TString)
 
Bool_t WriteRootFile ()
 
Bool_t WriteRootFile (const Text_t *, Int_t &)
 
virtual ~TEcnaRun ()
 

Private Attributes

Int_t fBuildEvtNotSkipped
 
Int_t fCdelete
 
Int_t fCnaCommand
 
Int_t fCnaError
 
TEcnaParCoutfCnaParCout
 
TEcnaParPathsfCnaParPaths
 
TEcnaWritefCnaWrite
 
Int_t fCnew
 
Int_t fCodePrintAllComments
 
Int_t fCodePrintComments
 
Int_t fCodePrintNoComment
 
Int_t fCodePrintWarnings
 
TEcnaParEcalfEcal
 
TEcnaNumberingfEcalNumbering
 
ofstream fFcout_f
 
TEcnaHeaderfFileHeader
 
Int_t fFlagPrint
 
TString fFlagSubDet
 
Int_t fgMaxCar
 
Int_t fMaxMsgIndexForMiscDiag
 
Int_t fMemoReadNumberOfEventsforSamples
 
Int_t * fMiscDiag
 
Int_t fNbOfMiscDiagCounters
 
Int_t fNbSampForCalc
 
Int_t fNbSampForFic
 
TString fNewRootFileName
 
TString fNewRootFileNameShort
 
Int_t fNumberOfEvents
 
TEcnaObjectfObjectManager
 
Bool_t fOpenRootFile
 
Int_t fReadyToReadData
 
TString fRootFileName
 
TString fRootFileNameShort
 
Int_t fSpecialStexStinNotIndexed
 
TString fStexName
 
Int_t fStinIndexBuilt
 
TString fStinName
 
Double_t * fT1d_av_ev_corss
 
Double_t * fT1d_av_hifn
 
Double_t * fT1d_av_lofn
 
Double_t * fT1d_av_mped
 
Double_t * fT1d_av_sig_corss
 
Double_t * fT1d_av_totn
 
Double_t * fT1d_ev
 
Double_t * fT1d_ev_cor_ss
 
Double_t * fT1d_ev_ev
 
Double_t * fT1d_evevt_of_sigsamp
 
Double_t * fT1d_evsamp_of_sigevt
 
Int_t * fT1d_NbOfEvts
 
Double_t * fT1d_sig
 
Double_t * fT1d_sig_cor_ss
 
Double_t * fT1d_sigevt_of_evsamp
 
Int_t * fT1d_StexStinFromIndex
 
Int_t * fT1dCrysNumbersTable
 
Double_t * fT2d1_hf_cor
 
Double_t * fT2d1_hf_cov
 
Double_t * fT2d1_hfcc_mostins
 
Double_t * fT2d1_lf_cor
 
Double_t * fT2d1_lf_cov
 
Double_t * fT2d1_lfcc_mostins
 
Double_t ** fT2d_ev
 
Double_t ** fT2d_hf_cor
 
Double_t ** fT2d_hf_cov
 
Double_t ** fT2d_hfcc_mostins
 
Double_t ** fT2d_lf_cor
 
Double_t ** fT2d_lf_cov
 
Double_t ** fT2d_lfcc_mostins
 
Int_t ** fT2d_NbOfEvts
 
Double_t ** fT2d_sig
 
Int_t ** fT2dCrysNumbersTable
 
Double_t * fT3d1_AdcValues
 
Double_t * fT3d1_cor_ss
 
Double_t * fT3d1_cov_ss
 
Double_t ** fT3d2_AdcValues
 
Double_t ** fT3d2_cor_ss
 
Double_t ** fT3d2_cov_ss
 
Double_t *** fT3d_AdcValues
 
Double_t *** fT3d_cor_ss
 
Double_t *** fT3d_cov_ss
 
Int_t * fTagAdcEvt
 
Int_t * fTagAvHfn
 
Int_t * fTagAvLfn
 
Int_t * fTagAvMeanCorss
 
Int_t * fTagAvPed
 
Int_t * fTagAvSigCorss
 
Int_t * fTagAvTno
 
Int_t * fTagCorCss
 
Int_t * fTagCovCss
 
Int_t * fTagHFccMoStins
 
Int_t * fTagHfCor
 
Int_t * fTagHfCov
 
Int_t * fTagHfn
 
Int_t * fTagLFccMoStins
 
Int_t * fTagLfCor
 
Int_t * fTagLfCov
 
Int_t * fTagLfn
 
Int_t * fTagMeanCorss
 
Int_t * fTagMSp
 
Int_t * fTagNbOfEvts
 
Int_t * fTagPed
 
Int_t * fTagSigCorss
 
Int_t * fTagSSp
 
Int_t * fTagStinNumbers
 
Int_t * fTagTno
 
TString fTTBELL
 

Detailed Description


TEcnaRun.h Update: 16/02/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

TEcnaRun + ECNA (Ecal Correlated Noise Analysis) instructions for use in the framework of CMSSW.

==============> INTRODUCTION

The present documentation contains:

[1] a brief description of the ECNA package with instructions for use
    in the framework of the CMS Software

[2] the documentation for the class TEcnaRun

==[1]=====================================================================================

     DOCUMENTATION FOR THE INTERFACE: ECNA package / CMSSW / SCRAM

==========================================================================================

ECNA consists in 2 packages named: EcalCorrelatedNoiseAnalysisModules and EcalCorrelatedNoiseAnalysisAlgos.

The directory tree is the following:

<local path>/CMSSW_a_b_c/src/----CalibCalorimetry/---EcalCorrelatedNoiseAnalysisModules/BuildFile
                        |   |                    |                                     |---interface/
                        |   |                    |                                     |---src/
                            |                    |                                     |---data/
                            |                    |
                            |                    |---EcalCorrelatedNoiseAnalysisAlgos/BuildFile
                            |                    |                                   |---interface/
                            |                    |                                   |---src/
                            |                    |                                   |---test/
                            |                    |
                            |                    |
                            |                    \--- <other packages of CalibCalorimetry> 
                            |
                            \----<other subsystems...>

The package EcalCorrelatedNoiseAnalysisModules contains one standard analyzer (EcnaAnalyzer). The user can edit its own analyzer. A detailed description is given here after in the class TEcnaRun documentation. The package EcalCorrelatedNoiseAnalysisAlgos contains the basic ECNA classes (in src and interface) and standalone executables (in directory test).

==[2]======================================================================================

                     CLASS TEcnaRun DOCUMENTATION

=========================================================================================== TEcnaRun.

Brief and general description

This class allows the user to calculate pedestals, noises, correlations and other quantities of interest for correlated noise studies on the CMS/ECAL (EB and EE).

Three main operations are performed by the class TEcnaRun. Each of them is associated with a specific method of the analyzer EcnaAnalyzer:

(1) Initialization and calls to "preparation methods". This task is done in the constructor of the analyzer: EcnaAnalyzer::EcnaAnalyzer(const edm::ParameterSet& pSet)

(2) Building of the event distributions (distributions of the sample ADC values for each sample, each channel, etc...) This task is done in the method "analyze" of the analyzer: EcnaAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)

(3) Calculation of the different quantities (correlations, pedestals, noises, etc...) from the distributions obtained in (2) and writing of these quantities in results ROOT files and also in ASCII files. This task is done in the destructor of the analyzer: EcnaAnalyzer::~EcnaAnalyzer()

Use of the class TEcnaRun by the analyzer EcnaAnalyzer

      see files EcnaAnalyzer.h and EcnaAnalyzer.cc
      in package EcalCorrelatedNoiseAnalysisModules

More detailled description of the class TEcnaRun

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

                 Declaration and Print Methods

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

 Just after the declaration with the constructor,
 you can set a "Print Flag" by means of the following "Print Methods":

 TEcnaRun* MyCnaRun = new TEcnaRun(...); // declaration of the object MyCnaRun

// Print Methods:

MyCnaRun->PrintNoComment(); // Set flag to forbid printing of all the comments // except ERRORS.

MyCnaRun->PrintWarnings(); // (DEFAULT) // Set flag to authorize printing of some warnings. // WARNING/INFO: information on something unusual // in the data. // WARNING/CORRECTION: something wrong (but not too serious) // in the value of some argument. // Automatically modified to a correct value.

MyCnaRun->PrintComments(); // Set flag to authorize printing of infos // and some comments concerning initialisations

MyCnaRun->PrintAllComments(); // Set flag to authorize printing of all the comments

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

       Method GetReadyToReadData(...) and associated methods

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

  MyCnaRun->GetReadyToReadData(AnalysisName,      NbOfSamples,       RunNumber,
                          FirstReqEvtNumber, LastReqEvtNumber,  ReqNbOfEvts,
                               StexNumber,        [RunType]);

Explanations for the arguments (all of them are input arguments):

TString AnalysisName: code for the analysis. According to this code, the analyzer EcnaAnalyser selects the event type (PEDESTAL_STD, PEDESTAL_GAP, LASER_STD, etc...) and some other event characteristics (example: the gain in pedestal runs: AnalysisName = "Ped1" or "Ped6" or "Ped12") See EcnaAnalyser.h for a list of available codes. The string AnalysisName is automatically included in the name of the results files (see below: results files paragraph).

Int_t NbOfSamples number of samples (=10 maximum) Int_t RunNumber: run number Int_t FirstReqEvtNumber: first requested event number (numbering starting from 1) Int_t LastReqEvtNumber: last requested event number Int_t ReqNbOfEvts: requested number of events Int_t StexNumber: Stex number (Stex = SM if EB, Dee if EE)

The different quantities (correlations, etc...) will be calculated for ReqNbOfEvts events between event# FirstReqEvtNumber and event# LastReqEvtNumber. If LastReqEvtNumber = 0, the calculations will be performed from event# FirstReqEvtNumber until EOF if necessary (i.e. if the number of treated events is < ReqNbOfEvts)

Int_t RunType [optional]: run type

                PEDESTAL_STD =  9
                LASER_STD    =  4
                PEDESTAL_GAP = 18, etc...

(see CMSSSW/DataFormats/EcalRawData/interface/EcalDCCHeaderBlock.h)

if RunType is specified, the run type will be displayed on the plots

==============> Method to set the start and stop times of the analysis (optional)

A method can be used to set the fStartDate and fStopDate attributes of the class TEcnaHeader from start and stop time given by the user provided these values have been recovered from the event reading:

void  MyCnaRun->StartStopDate(TString StartDate, TString StopDate);

// TString StartDate, StopDate: start and stop time of the run // in "date" format. Example: // Wed Oct 8 04:14:23 2003

If the method is not called, the values of the attributes fStartDate and fStopDate are set to: "!Start date> no info" and "!Stop date> no info" at the level of Init() method of the class TEcnaHeader. The values of StartDate and StopDate are written in the header of the .root result file.

PS: another similar method exists, with time_t type arguments:

void MyCnaRun->StartStopTime(time_t StartTime, time_t StopTime);

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

                   Calculation methods

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

The "calculation methods" are methods which compute the different
quantities of interest. They use the ADC sample values which can be
recovered by the method void SampleValues():

void SampleValues(); // 3D histo of the sample ADC value // for each triple (channel,sample,event)

List of the calculation methods with associated formulae:

.......... Calculation methods ( need previous call to GetReadyToReadData(...) )

// A(t,c,s,e) : ADC value for Stin t channel c, sample s, event e (Stin = tower if EB, SC if EE)

// E_e , Cov_e : average, covariance over the events // E_s , Cov_s : average, covariance over the samples // E_s,s' : average over couples of samples (half correlation matrix)

// e* : random variable associated to events // s* : random variable associated to samples

void SampleMeans(); // Expectation values for each couple (channel,sample) // SMean(t,c,s) = E_e[A(t,c,s,e*)]

void SampleSigmas(); // Sigmas for each couple (channel,sample) // SSigma(t,c,s) = sqrt{ Cov_e[A(t,c,s,e*),A(t,c,s,e*)] }

//........................................... void CovariancesBetweenSamples(); // (s,s') covariances for each channel // Cov(t,c;s,s') = Cov_e[ A(t,c,s,e*) , A(t,c,s',e*) ] // = E_e[ ( A(t,c,s,e*) - E_e[A(t,c,s,e*)] )*( A(t,c,s',e*) - E_e[A(t,c,s',e*)] ) ]

void CorrelationsBetweenSamples(); // (s,s') correlations for each channel // Cor(t,c;s,s') = Cov(t,c;s,s')/sqrt{ Cov(t,c;s,s)*Cov(t,c;s',s') }

//.............................................. *==> Stin = tower if EB, SuperCrystal if EE void LowFrequencyCovariancesBetweenChannels(); // LF (t;c,c') covariances for each Stin void HighFrequencyCovariancesBetweenChannels(); // HF (t;c,c') covariances for each Stin void LowFrequencyCorrelationsBetweenChannels(); // LF (t;c,c') correlations for each Stin void HighFrequencyCorrelationsBetweenChannels(); // HF (t;c,c') correlations for each Stin

// LFCov(t;c,c') = Cov_e[ E_s[A(t,c,s*,e*)] , E_s[A(t,c',s*,e*) ] // // = E_e[ ( E_s[A(t,c ,s*,e*)] - E_e[ E_s[A(t,c ,s*,e*)] ] )* // ( E_s[A(t,c',s*,e*)] - E_e[ E_s[A(t,c',s*,e*)] ] ) ] // // HFCov(t;c,c') = E_e[ Cov_s[ A(t,c,s*,e*) , A(t,c',s*,e*) ] ] // // = E_e[ E_s[ ( A(t,c ,s*,e*) - E_s[A(t,c ,s*,e*)] )* // ( A(t,c',s*,e*) - E_s[A(t,c',s*,e*)] ) ] ] // // LFCor(t;c,c') = LFCov(t;c,c')/sqrt{ LFCov(t;c,c)*LFCov(t;c',c') } // // HFCor(t;c,c') = HFCov(t;c,c')/sqrt{ HFCov(t;c,c)*HFCov(t;c',c') }

//.............................................. . *==> Stex = SM if EB, Dee if EE void LowFrequencyMeanCorrelationsBetweenTowers(); // LF (tow,tow') correlations for each SM void HighFrequencyMeanCorrelationsBetweenTowers(); // HF (tow,tow') correlations for each SM

void LowFrequencyMeanCorrelationsBetweenSCs(); // LF (sc,sc') correlations for each Dee void HighFrequencyMeanCorrelationsBetweenSCs(); // HF (sc,sc') correlations for each Dee

//.................................................... Quantities as a function of Xtal# void Pedestals(); void TotalNoise(); void LowFrequencyNoise(); void HighFrequencyNoise(); void MeanCorrelationsBetweenSamples(); void SigmaOfCorrelationsBetweenSamples();

// Pedestal(t,c) = E_e[ E_s[A(t,c,s*,e*)] ] // TotalNoise(t,c) = E_s[ sqrt{ E_e[ ( A(t,c,s*,e*) - E_e[A(t,c,s*,e*)] )^2 ] } ] // LowFqNoise(t,c) = sqrt{ E_e[ ( E_s[A(t,c,s*,e*)] - E_e[ E_s[A(t,c,s*,e*)] ] )^2 ] } // HighFqNoise(t,c) = E_e[ sqrt{ E_s[ (A(t,c,s*,e*) - E_s[A(t,c,s*,e*)] )^2 ] } ] // MeanCorss(t,c) = E_s,s'[ Cor(t,c;s,s') ] // SigmaCorss(t,c) = E_s,s'[ Cor(t,c;s,s') - E_s,s'[ Cor(t,c;s,s') ] ]

//............ Quantities as a function of tower# (EB) or SC# (EE), average over the Xtals void AveragePedestals(); void AverageTotalNoise(); void AverageLowFrequencyNoise(); void AverageHighFrequencyNoise(); void AverageMeanCorrelationsBetweenSamples(); void AverageSigmaOfCorrelationsBetweenSamples();

// t = tower if EB , SC if EE , c = channel (Xtal) // AveragePedestal(t) = E_c[Pedestal(t,c*)] // TotalNoise(t) = E_c[TotalNoise(t,c*)] // LowFqNoise(t) = E_c[LowFqNoise(t,c*)] // HighFqNoise(t) = E_c[HighFqNoise(t,c*)] // MeanCorss(t) = E_c[MeanCorss(t,c*)] // SigmaCorss(t) = E_c[SigmaCorss(t,c*)]

==============> RESULTS FILES

The calculation methods above provide results which can be used directly in the user's code. However, these results can also be written in results files by appropriate methods. The names of the results files are automaticaly generated.

It is also possible to write results in ASCII files => See TEcnaWrite and TEcnaGui It is also possible to plot results in ROOT canvases => See TEcnaHistos and TEcnaGui

*--------—> Codification for the name of the ROOT file:

The name of the ROOT file is the following:

 aaa_S1_sss_Rrrr_fff_lll_SMnnn.root     for EB
 aaa_S1_sss_Rrrr_fff_lll_Deennn.root    for EE

with: aaa = Analysis name sss = number of samples rrr = Run number fff = First requested event number lll = Last requested events mmm = Requested number of events nnn = SM number or Dee number

This name is automatically generated from the values of the arguments of the method "GetReadyToReadData".

*--------—> Method which writes the results in the ROOT file:

  Bool_t  MyCnaRun->WriteRootFile();

===================================================================================================

Definition at line 363 of file TEcnaRun.h.

Constructor & Destructor Documentation

TEcnaRun::TEcnaRun ( )

Definition at line 19 of file TEcnaRun.cc.

20 {
21 //Constructor without argument: nothing special done
22 
23  // cout << "[Info Management] CLASS: TEcnaRun. CREATE OBJECT: this = " << this << endl;
24 }
TEcnaRun::TEcnaRun ( TEcnaObject pObjectManager,
const TString  SubDet 
)

Definition at line 26 of file TEcnaRun.cc.

References fCnaParCout, fCnaParPaths, fEcal, fFileHeader, fNbSampForFic, fObjectManager, TEcnaObject::GetPointerValue(), Init(), TEcnaParEcal::MaxSampADC(), TEcnaObject::RegisterPointer(), and SetEcalSubDetector().

27 {
28 //Constructor with argument: call to Init() and declare fEcal according to SubDet value ("EB" or "EE")
29 
30  // cout << "[Info Management] CLASS: TEcnaRun. CREATE OBJECT: this = " << this << endl;
31 
32  Init();
33  fObjectManager = (TEcnaObject*)pObjectManager;
34  Long_t i_this = (Long_t)this;
35  pObjectManager->RegisterPointer("TEcnaRun", i_this);
36 
37  //............................ fCnaParCout
38  fCnaParCout = 0;
39  Long_t iCnaParCout = pObjectManager->GetPointerValue("TEcnaParCout");
40  if( iCnaParCout == 0 )
41  {fCnaParCout = new TEcnaParCout(pObjectManager); /*fCnew++*/}
42  else
43  {fCnaParCout = (TEcnaParCout*)iCnaParCout;}
44 
45  //............................ fCnaParPaths
46  fCnaParPaths = 0;
47  Long_t iCnaParPaths = pObjectManager->GetPointerValue("TEcnaParPaths");
48  if( iCnaParPaths == 0 )
49  {fCnaParPaths = new TEcnaParPaths(pObjectManager); /*fCnew++*/}
50  else
51  {fCnaParPaths = (TEcnaParPaths*)iCnaParPaths;}
52 
53  //fCfgResultsRootFilePath = fCnaParPaths->ResultsRootFilePath();
54  //fCfgHistoryRunListFilePath = fCnaParPaths->HistoryRunListFilePath();
55 
56  //ffFileHeader = 0;
57  //fconst Text_t *h_name = "CnaHeader"; //==> voir cette question avec FXG
58  //fconst Text_t *h_title = "CnaHeader"; //==> voir cette question avec FXG
59  //ffFileHeader = new TEcnaHeader(h_name, h_title); //fCnew++;
60 
61  //............................ fFileHeader
62  const Text_t *h_name = "CnaHeader"; //==> voir cette question avec FXG
63  const Text_t *h_title = "CnaHeader"; //==> voir cette question avec FXG
64 
65  fFileHeader = 0;
66  //Int_t iFileHeader = pObjectManager->GetPointerValue("TEcnaHeader");
67  Long_t iFileHeader = 0; // one TEcnaHeader object for each file since they can be open simultaneously
68  if( iFileHeader == 0 )
69  {fFileHeader = new TEcnaHeader(pObjectManager, h_name, h_title); /*fCnew++*/}
70  else
71  {fFileHeader = (TEcnaHeader*)iFileHeader;}
72 
73  SetEcalSubDetector(SubDet.Data());
74  fNbSampForFic = fEcal->MaxSampADC(); // DEFAULT Number of samples for ROOT file
75 }
TEcnaObject * fObjectManager
Definition: TEcnaRun.h:382
TEcnaParCout * fCnaParCout
Definition: TEcnaRun.h:386
void SetEcalSubDetector(const TString)
Definition: TEcnaRun.cc:274
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fNbSampForFic
Definition: TEcnaRun.h:407
Long_t GetPointerValue(const TString)
Definition: TEcnaObject.cc:229
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
void Init()
Definition: TEcnaRun.cc:135
Bool_t RegisterPointer(const TString, const Long_t &)
Definition: TEcnaObject.cc:102
Int_t MaxSampADC()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
TEcnaRun::TEcnaRun ( TEcnaObject pObjectManager,
const TString  SubDet,
const Int_t &  NbOfSamples 
)

Definition at line 77 of file TEcnaRun.cc.

References gather_cfg::cout, fCnaParCout, fCnaParPaths, fEcal, fFileHeader, fNbSampForFic, fObjectManager, fTTBELL, TEcnaObject::GetPointerValue(), Init(), TEcnaParEcal::MaxSampADC(), TEcnaObject::RegisterPointer(), and SetEcalSubDetector().

78 {
79  //fCnaParPaths = 0; fCnaParPaths = new TEcnaParPaths(); //fCnew++;
80  //fCnaParCout = 0; fCnaParCout = new TEcnaParCout(); //fCnew++;
81 
82  Init();
83  fObjectManager = (TEcnaObject*)pObjectManager;
84  Long_t i_this = (Long_t)this;
85  pObjectManager->RegisterPointer("TEcnaRun", i_this);
86 
87  //............................ fCnaParCout
88  fCnaParCout = 0;
89  Long_t iCnaParCout = pObjectManager->GetPointerValue("TEcnaParCout");
90  if( iCnaParCout == 0 )
91  {fCnaParCout = new TEcnaParCout(pObjectManager); /*fCnew++*/}
92  else
93  {fCnaParCout = (TEcnaParCout*)iCnaParCout;}
94 
95  //............................ fCnaParPaths
96  fCnaParPaths = 0;
97  Long_t iCnaParPaths = pObjectManager->GetPointerValue("TEcnaParPaths");
98  if( iCnaParPaths == 0 )
99  {fCnaParPaths = new TEcnaParPaths(pObjectManager); /*fCnew++*/}
100  else
101  {fCnaParPaths = (TEcnaParPaths*)iCnaParPaths;}
102 
103  //fCfgResultsRootFilePath = fCnaParPaths->ResultsRootFilePath();
104  //fCfgHistoryRunListFilePath = fCnaParPaths->HistoryRunListFilePath();
105 
106  //............................ fFileHeader
107  const Text_t *h_name = "CnaHeader"; //==> voir cette question avec FXG
108  const Text_t *h_title = "CnaHeader"; //==> voir cette question avec FXG
109 
110  fFileHeader = 0;
111  //Long_t iFileHeader = pObjectManager->GetPointerValue("TEcnaHeader");
112  Long_t iFileHeader = 0; // one TEcnaHeader object for each file since they can be open simultaneously
113  if( iFileHeader == 0 )
114  {fFileHeader = new TEcnaHeader(pObjectManager, h_name, h_title); /*fCnew++*/}
115  else
116  {fFileHeader = (TEcnaHeader*)iFileHeader;}
117 
118  SetEcalSubDetector(SubDet.Data());
119  if( NbOfSamples>0 && NbOfSamples<=fEcal->MaxSampADC() )
120  {
121  fNbSampForFic = NbOfSamples;
122  }
123  else
124  {
125  cout << "TEcnaRun/CONSTRUCTOR> Number of required samples = " << NbOfSamples
126  << ": OUT OF RANGE. Set to the default value (= " << fEcal->MaxSampADC() << ")."
127  << fTTBELL << endl;
128  fNbSampForFic = fEcal->MaxSampADC(); // DEFAULT Number of samples for file reading
129  }
130 }
TEcnaObject * fObjectManager
Definition: TEcnaRun.h:382
TEcnaParCout * fCnaParCout
Definition: TEcnaRun.h:386
void SetEcalSubDetector(const TString)
Definition: TEcnaRun.cc:274
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fNbSampForFic
Definition: TEcnaRun.h:407
Long_t GetPointerValue(const TString)
Definition: TEcnaObject.cc:229
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
void Init()
Definition: TEcnaRun.cc:135
Bool_t RegisterPointer(const TString, const Long_t &)
Definition: TEcnaObject.cc:102
Int_t MaxSampADC()
tuple cout
Definition: gather_cfg.py:121
TString fTTBELL
Definition: TEcnaRun.h:376
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
TEcnaRun::TEcnaRun ( const TEcnaRun dcop)

Definition at line 297 of file TEcnaRun.cc.

References gather_cfg::cout.

298 {
299  cout << "*TEcnaRun::TEcnaRun(const TEcnaRun& dcop)> "
300  << " Now is the time to write a copy constructor"
301  << endl;
302 
303  //{ Int_t cintoto; cin >> cintoto; }
304 
305 }
tuple cout
Definition: gather_cfg.py:121
TEcnaRun::~TEcnaRun ( )
virtual

Definition at line 326 of file TEcnaRun.cc.

References gather_cfg::cout, fBuildEvtNotSkipped, fCdelete, fCnew, fCodePrintAllComments, fCodePrintNoComment, fCodePrintWarnings, fFlagPrint, fMiscDiag, fNbOfMiscDiagCounters, fT1d_av_ev_corss, fT1d_av_hifn, fT1d_av_lofn, fT1d_av_mped, fT1d_av_sig_corss, fT1d_av_totn, fT1d_ev, fT1d_ev_cor_ss, fT1d_ev_ev, fT1d_evevt_of_sigsamp, fT1d_evsamp_of_sigevt, fT1d_NbOfEvts, fT1d_sig, fT1d_sig_cor_ss, fT1d_sigevt_of_evsamp, fT1d_StexStinFromIndex, fT1dCrysNumbersTable, fT2d1_hf_cor, fT2d1_hf_cov, fT2d1_hfcc_mostins, fT2d1_lf_cor, fT2d1_lf_cov, fT2d1_lfcc_mostins, fT2d_ev, fT2d_hf_cor, fT2d_hf_cov, fT2d_hfcc_mostins, fT2d_lf_cor, fT2d_lf_cov, fT2d_lfcc_mostins, fT2d_NbOfEvts, fT2d_sig, fT2dCrysNumbersTable, fT3d1_AdcValues, fT3d1_cor_ss, fT3d1_cov_ss, fT3d2_AdcValues, fT3d2_cor_ss, fT3d2_cov_ss, fT3d_AdcValues, fT3d_cor_ss, fT3d_cov_ss, fTagAdcEvt, fTagAvHfn, fTagAvLfn, fTagAvMeanCorss, fTagAvPed, fTagAvSigCorss, fTagAvTno, fTagCorCss, fTagCovCss, fTagHFccMoStins, fTagHfCor, fTagHfCov, fTagHfn, fTagLFccMoStins, fTagLfCor, fTagLfCov, fTagLfn, fTagMeanCorss, fTagMSp, fTagNbOfEvts, fTagPed, fTagSigCorss, fTagSSp, fTagStinNumbers, fTagTno, fTTBELL, and i.

327 {
328  //Destructor
329 
331  {
332  cout << "*TEcnaRun::~TEcnaRun()> Entering destructor." << endl;
333  }
334 
336  {
337  if( fBuildEvtNotSkipped > 0 )
338  {
339  cout << "************************************************************************************* "
340  << endl;
341  cout << "*TEcnaRun::~TEcnaRun()> Nb of calls to GetSampleAdcValues by cmsRun: "
342  << fBuildEvtNotSkipped << endl;
343  cout << "************************************************************************************* "
344  << endl;
345  }
346  }
347 
349  {
350  Int_t misc_czero = 0;
351  for(Int_t i = 0; i < fNbOfMiscDiagCounters; i++)
352  {
353  if( fMiscDiag[i] != 0 )
354  {
355  cout << " fMiscDiag Counter "
356  << setw(3) << i << " = " << setw(9) << fMiscDiag[i]
357  << " (INFO: alloc on non zero freed zone) " << endl;
358  }
359  else
360  {
361  misc_czero++;
362  }
363  }
364  cout << " Nb of fMiscDiag counters at zero: "
365  << misc_czero << " (total nb of counters: "
366  << fNbOfMiscDiagCounters << ")" << endl;
367  }
368 
369  if (fMiscDiag != 0){delete [] fMiscDiag; fCdelete++;}
370 
371  //if (fFileHeader != 0){delete fFileHeader; fCdelete++;}
372  //if (fEcal != 0){delete fEcal; fCdelete++;}
373  //if (fEcalNumbering != 0){delete fEcalNumbering; fCdelete++;}
374  //if (fCnaParCout != 0){delete fCnaParCout; fCdelete++;}
375  //if (fCnaParPaths != 0){delete fCnaParPaths; fCdelete++;}
376  //if (fCnaWrite != 0){delete fCnaWrite; fCdelete++;}
377 
379 
380  if (fT2d_NbOfEvts != 0){delete [] fT2d_NbOfEvts; fCdelete++;}
381  if (fT1d_NbOfEvts != 0){delete [] fT1d_NbOfEvts; fCdelete++;}
382 
383  if (fT3d_AdcValues != 0){delete [] fT3d_AdcValues; fCdelete++;}
384  if (fT3d2_AdcValues != 0){delete [] fT3d2_AdcValues; fCdelete++;}
385  if (fT3d1_AdcValues != 0){delete [] fT3d1_AdcValues; fCdelete++;}
386 
387  if (fT2d_ev != 0){delete [] fT2d_ev; fCdelete++;}
388  if (fT1d_ev != 0){delete [] fT1d_ev; fCdelete++;}
389 
390  if (fT2d_sig != 0){delete [] fT2d_sig; fCdelete++;}
391  if (fT1d_sig != 0){delete [] fT1d_sig; fCdelete++;}
392 
393  if (fT3d_cov_ss != 0){delete [] fT3d_cov_ss; fCdelete++;}
394  if (fT3d2_cov_ss != 0){delete [] fT3d2_cov_ss; fCdelete++;}
395  if (fT3d1_cov_ss != 0){delete [] fT3d1_cov_ss; fCdelete++;}
396 
397  if (fT3d_cor_ss != 0){delete [] fT3d_cor_ss; fCdelete++;}
398  if (fT3d2_cor_ss != 0){delete [] fT3d2_cor_ss; fCdelete++;}
399  if (fT3d1_cor_ss != 0){delete [] fT3d1_cor_ss; fCdelete++;}
400 
401  if (fT2d_lf_cov != 0){delete [] fT2d_lf_cov; fCdelete++;}
402  if (fT2d1_lf_cov != 0){delete [] fT2d1_lf_cov; fCdelete++;}
403 
404  if (fT2d_lf_cor != 0){delete [] fT2d_lf_cor; fCdelete++;}
405  if (fT2d1_lf_cor != 0){delete [] fT2d1_lf_cor; fCdelete++;}
406 
407  if (fT2d_hf_cov != 0){delete [] fT2d_hf_cov; fCdelete++;}
408  if (fT2d1_hf_cov != 0){delete [] fT2d1_hf_cov; fCdelete++;}
409 
410  if (fT2d_hf_cor != 0){delete [] fT2d_hf_cor; fCdelete++;}
411  if (fT2d1_hf_cor != 0){delete [] fT2d1_hf_cor; fCdelete++;}
412 
413  if (fT2d_lfcc_mostins != 0){delete [] fT2d_lfcc_mostins; fCdelete++;}
414  if (fT2d1_lfcc_mostins != 0){delete [] fT2d1_lfcc_mostins ; fCdelete++;}
415 
416  if (fT2d_hfcc_mostins != 0){delete [] fT2d_hfcc_mostins ; fCdelete++;}
417  if (fT2d1_hfcc_mostins != 0){delete [] fT2d1_hfcc_mostins; fCdelete++;}
418 
419  if (fT1d_ev_ev != 0){delete [] fT1d_ev_ev; fCdelete++;}
420  if (fT1d_evsamp_of_sigevt != 0){delete [] fT1d_evsamp_of_sigevt; fCdelete++;}
421  if (fT1d_ev_cor_ss != 0){delete [] fT1d_ev_cor_ss; fCdelete++;}
422  if (fT1d_av_mped != 0){delete [] fT1d_av_mped; fCdelete++;}
423  if (fT1d_av_totn != 0){delete [] fT1d_av_totn; fCdelete++;}
424  if (fT1d_av_lofn != 0){delete [] fT1d_av_lofn; fCdelete++;}
425  if (fT1d_av_hifn != 0){delete [] fT1d_av_hifn; fCdelete++;}
426  if (fT1d_av_ev_corss != 0){delete [] fT1d_av_ev_corss; fCdelete++;}
427  if (fT1d_av_sig_corss != 0){delete [] fT1d_av_sig_corss; fCdelete++;}
428 
429  if (fT1d_sigevt_of_evsamp != 0){delete [] fT1d_sigevt_of_evsamp; fCdelete++;}
430  if (fT1d_evevt_of_sigsamp != 0){delete [] fT1d_evevt_of_sigsamp; fCdelete++;}
431  if (fT1d_sig_cor_ss != 0){delete [] fT1d_sig_cor_ss; fCdelete++;}
432 
433  if (fT2dCrysNumbersTable != 0){delete [] fT2dCrysNumbersTable; fCdelete++;}
434  if (fT1dCrysNumbersTable != 0){delete [] fT1dCrysNumbersTable; fCdelete++;}
435 
436  if (fTagStinNumbers != 0){delete [] fTagStinNumbers; fCdelete++;}
437  if (fTagNbOfEvts != 0){delete [] fTagNbOfEvts; fCdelete++;}
438  if (fTagAdcEvt != 0){delete [] fTagAdcEvt; fCdelete++;}
439  if (fTagMSp != 0){delete [] fTagMSp; fCdelete++;}
440  if (fTagSSp != 0){delete [] fTagSSp; fCdelete++;}
441 
442  if (fTagCovCss != 0){delete [] fTagCovCss; fCdelete++;}
443  if (fTagCorCss != 0){delete [] fTagCorCss; fCdelete++;}
444 
445  if (fTagHfCov != 0){delete [] fTagHfCov; fCdelete++;}
446  if (fTagHfCor != 0){delete [] fTagHfCor; fCdelete++;}
447  if (fTagLfCov != 0){delete [] fTagLfCov; fCdelete++;}
448  if (fTagLfCor != 0){delete [] fTagLfCor; fCdelete++;}
449 
450  if (fTagLFccMoStins != 0){delete [] fTagLFccMoStins; fCdelete++;}
451  if (fTagHFccMoStins != 0){delete [] fTagHFccMoStins; fCdelete++;}
452 
453  if (fTagPed != 0){delete [] fTagPed; fCdelete++;}
454  if (fTagTno != 0){delete [] fTagTno; fCdelete++;}
455  if (fTagMeanCorss != 0){delete [] fTagMeanCorss; fCdelete++;}
456 
457  if (fTagLfn != 0){delete [] fTagLfn; fCdelete++;}
458  if (fTagHfn != 0){delete [] fTagHfn; fCdelete++;}
459  if (fTagSigCorss != 0){delete [] fTagSigCorss; fCdelete++;}
460 
461  if (fTagAvPed != 0){delete [] fTagAvPed; fCdelete++;}
462  if (fTagAvTno != 0){delete [] fTagAvTno; fCdelete++;}
463  if (fTagAvLfn != 0){delete [] fTagAvLfn; fCdelete++;}
464  if (fTagAvHfn != 0){delete [] fTagAvHfn; fCdelete++;}
465  if (fTagAvMeanCorss != 0){delete [] fTagAvMeanCorss; fCdelete++;}
466  if (fTagAvSigCorss != 0){delete [] fTagAvSigCorss; fCdelete++;}
467 
468  if ( fCnew != fCdelete )
469  {
470  cout << "!TEcnaRun::~TEcnaRun()> WRONG MANAGEMENT OF MEMORY ALLOCATIONS: fCnew = "
471  << fCnew << ", fCdelete = " << fCdelete << fTTBELL << endl;
472  }
473  else
474  {
475  // cout << "*TEcnaRun::~TEcnaRun()> Management of memory allocations: OK. fCnew = "
476  // << fCnew << ", fCdelete = " << fCdelete << endl;
477  }
478 
480  {
481  cout << "*TEcnaRun::~TEcnaRun()> Exiting destructor (this = " << this << ")." << endl
482  << "~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#"
483  << endl;
484  }
485 
486  // cout << "[Info Management] CLASS: TEcnaRun. DESTROY OBJECT: this = " << this << endl;
487 }
Double_t * fT1d_av_sig_corss
Definition: TEcnaRun.h:472
int i
Definition: DBlmapReader.cc:9
Double_t * fT1d_av_mped
Definition: TEcnaRun.h:447
Double_t * fT3d1_cor_ss
Definition: TEcnaRun.h:441
Int_t * fTagCorCss
Definition: TEcnaRun.h:442
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t * fTagLFccMoStins
Definition: TEcnaRun.h:496
Double_t * fT1d_sigevt_of_evsamp
Definition: TEcnaRun.h:460
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fBuildEvtNotSkipped
Definition: TEcnaRun.h:405
Int_t * fTagStinNumbers
Definition: TEcnaRun.h:424
Int_t fCdelete
Definition: TEcnaRun.h:374
Int_t * fTagLfCor
Definition: TEcnaRun.h:482
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
Double_t * fT1d_sig_cor_ss
Definition: TEcnaRun.h:470
Int_t * fTagCovCss
Definition: TEcnaRun.h:437
Double_t * fT2d1_lf_cov
Definition: TEcnaRun.h:477
Int_t * fTagPed
Definition: TEcnaRun.h:446
Int_t * fT1dCrysNumbersTable
Definition: TEcnaRun.h:505
Double_t * fT1d_av_ev_corss
Definition: TEcnaRun.h:457
Double_t ** fT2d_hfcc_mostins
Definition: TEcnaRun.h:498
Int_t * fTagAvTno
Definition: TEcnaRun.h:453
Double_t * fT3d1_AdcValues
Definition: TEcnaRun.h:416
Int_t * fTagHfn
Definition: TEcnaRun.h:466
Double_t *** fT3d_cor_ss
Definition: TEcnaRun.h:439
Double_t * fT1d_av_totn
Definition: TEcnaRun.h:452
Double_t * fT2d1_lf_cor
Definition: TEcnaRun.h:481
Double_t ** fT2d_sig
Definition: TEcnaRun.h:430
Int_t * fTagSSp
Definition: TEcnaRun.h:432
Double_t ** fT2d_ev
Definition: TEcnaRun.h:426
Double_t ** fT2d_hf_cor
Definition: TEcnaRun.h:489
Double_t * fT1d_ev_ev
Definition: TEcnaRun.h:445
Double_t ** fT3d2_cov_ss
Definition: TEcnaRun.h:435
Int_t * fTagTno
Definition: TEcnaRun.h:451
Double_t ** fT3d2_cor_ss
Definition: TEcnaRun.h:440
Double_t * fT1d_av_hifn
Definition: TEcnaRun.h:467
Double_t ** fT2d_hf_cov
Definition: TEcnaRun.h:485
Double_t * fT3d1_cov_ss
Definition: TEcnaRun.h:436
Int_t * fTagAvLfn
Definition: TEcnaRun.h:463
Int_t * fT1d_NbOfEvts
Definition: TEcnaRun.h:420
Int_t * fTagLfn
Definition: TEcnaRun.h:461
Double_t * fT2d1_hf_cov
Definition: TEcnaRun.h:486
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Double_t *** fT3d_cov_ss
Definition: TEcnaRun.h:434
Int_t * fTagAvSigCorss
Definition: TEcnaRun.h:473
Int_t * fTagHfCor
Definition: TEcnaRun.h:491
Int_t * fTagNbOfEvts
Definition: TEcnaRun.h:421
Int_t * fTagAvPed
Definition: TEcnaRun.h:448
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t * fTagHFccMoStins
Definition: TEcnaRun.h:500
Double_t * fT2d1_hfcc_mostins
Definition: TEcnaRun.h:499
Int_t * fTagAvMeanCorss
Definition: TEcnaRun.h:458
Double_t ** fT2d_lf_cor
Definition: TEcnaRun.h:480
Int_t * fTagLfCov
Definition: TEcnaRun.h:478
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t fCodePrintWarnings
Definition: TEcnaRun.h:510
Double_t * fT2d1_hf_cor
Definition: TEcnaRun.h:490
Double_t * fT1d_evsamp_of_sigevt
Definition: TEcnaRun.h:450
Int_t * fTagHfCov
Definition: TEcnaRun.h:487
Int_t * fTagAvHfn
Definition: TEcnaRun.h:468
Int_t * fTagSigCorss
Definition: TEcnaRun.h:471
Double_t * fT2d1_lfcc_mostins
Definition: TEcnaRun.h:495
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Double_t * fT1d_ev
Definition: TEcnaRun.h:427
Int_t * fTagAdcEvt
Definition: TEcnaRun.h:417
Double_t ** fT3d2_AdcValues
Definition: TEcnaRun.h:415
tuple cout
Definition: gather_cfg.py:121
Double_t ** fT2d_lf_cov
Definition: TEcnaRun.h:476
Int_t ** fT2d_NbOfEvts
Definition: TEcnaRun.h:419
Double_t * fT1d_av_lofn
Definition: TEcnaRun.h:462
Int_t ** fT2dCrysNumbersTable
Definition: TEcnaRun.h:504
Int_t fNbOfMiscDiagCounters
Definition: TEcnaRun.h:379
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRun.h:423
TString fTTBELL
Definition: TEcnaRun.h:376
Double_t * fT1d_evevt_of_sigsamp
Definition: TEcnaRun.h:465
Int_t * fTagMeanCorss
Definition: TEcnaRun.h:456
Double_t * fT1d_sig
Definition: TEcnaRun.h:431
Double_t * fT1d_ev_cor_ss
Definition: TEcnaRun.h:455
Double_t ** fT2d_lfcc_mostins
Definition: TEcnaRun.h:494

Member Function Documentation

void TEcnaRun::AverageHighFrequencyNoise ( )

Definition at line 2132 of file TEcnaRun.cc.

References gather_cfg::cout, TEcnaHeader::fAvHfnCalc, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fMiscDiag, TEcnaHeader::fStex, fStexName, fStinName, fT1d_av_hifn, fT1d_evevt_of_sigsamp, fTagAvHfn, fTagHfn, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), HighFrequencyNoise(), TEcnaParEcal::MaxCrysInStin(), TEcnaNumbering::MaxCrysInStinEcna(), and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by StandardCalculations().

2133 {
2134 // Calculation of the average
2135 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the High Frequency Noise
2136 
2137  //... preliminary calculation of the High Frequency Noise if not done yet
2138  if ( fTagHfn[0] != 1 ){HighFrequencyNoise(); fTagHfn[0]=0;}
2139  //................... Allocation av_hifn + init to zero (mandatory)
2140  if( fT1d_av_hifn == 0 ){fT1d_av_hifn = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2141  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2142  {if( fT1d_av_hifn[i0StexStinEcna] != (Double_t)0 )
2143  {fMiscDiag[44]++; fT1d_av_hifn[i0StexStinEcna] = (Double_t)0;}}
2144 
2145  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::AverageHighFrequencyNoise()" << endl;}
2147  cout << " Calculation, for all the "
2148  << fStinName.Data() << "s, of the average High Frequency Noise" << endl;}
2149 
2150  //................... Calculation
2151  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2152  {
2153  Int_t n1StexStinEcna = i0StexStinEcna+1;
2154  fT1d_av_hifn[i0StexStinEcna] = (Double_t)0;
2155  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2156  {
2157  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2158 
2159  if( fStexName == "SM " )
2160  {fT1d_av_hifn[i0StexStinEcna] += fT1d_evevt_of_sigsamp[i0StexEcha];}
2161 
2162  if( fStexName == "Dee" )
2163  {
2164  //---------------- Special translation for mixed SCEcna (29 and 32)
2165  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2166  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2167  Int_t n1StinEcha = i0StinEcha+1;
2168  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2169  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2170  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2171  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2172  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2173  {fT1d_av_hifn[i0StexStinEcna] += fT1d_evevt_of_sigsamp[i0StexEcha];}
2174  }
2175  }
2176  Double_t xdivis = (Double_t)0.;
2177  if( fStexName == "SM " )
2178  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2179  if( fStexName == "Dee" )
2180  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2181 
2182  fT1d_av_hifn[i0StexStinEcna] = fT1d_av_hifn[i0StexStinEcna]/xdivis;
2183  }
2184  fTagAvHfn[0] = 1; fFileHeader->fAvHfnCalc++;
2185 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString fStexName
Definition: TEcnaRun.h:393
Int_t * fTagHfn
Definition: TEcnaRun.h:466
Double_t * fT1d_av_hifn
Definition: TEcnaRun.h:467
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fAvHfnCalc
Definition: TEcnaHeader.h:74
Int_t MaxCrysInStin()
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString)
Int_t * fTagAvHfn
Definition: TEcnaRun.h:468
void HighFrequencyNoise()
Definition: TEcnaRun.cc:1748
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
TString fStinName
Definition: TEcnaRun.h:393
Double_t * fT1d_evevt_of_sigsamp
Definition: TEcnaRun.h:465
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::AverageLowFrequencyNoise ( )

Definition at line 2072 of file TEcnaRun.cc.

References gather_cfg::cout, TEcnaHeader::fAvLfnCalc, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fMiscDiag, TEcnaHeader::fStex, fStexName, fStinName, fT1d_av_lofn, fT1d_sigevt_of_evsamp, fTagAvLfn, fTagLfn, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), LowFrequencyNoise(), TEcnaParEcal::MaxCrysInStin(), TEcnaNumbering::MaxCrysInStinEcna(), and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by StandardCalculations().

2073 {
2074 // Calculation of the average
2075 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the Low Frequency Noise
2076 
2077  //... preliminary calculation of the Low Frequency Noise if not done yet
2078  if ( fTagLfn[0] != 1 ){LowFrequencyNoise(); fTagLfn[0]=0;}
2079  //................... Allocation av_lofn + init to zero (mandatory)
2080  if( fT1d_av_lofn == 0 ){fT1d_av_lofn = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2081  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2082  {if( fT1d_av_lofn[i0StexStinEcna] != (Double_t)0 )
2083  {fMiscDiag[43]++; fT1d_av_lofn[i0StexStinEcna] = (Double_t)0;}}
2084 
2085  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::AverageLowFrequencyNoise()" << endl;}
2087  cout << " Calculation, for all the "
2088  << fStinName.Data() << "s, of the average Low Frequency Noise" << endl;}
2089 
2090  //................... Calculation
2091  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2092  {
2093  Int_t n1StexStinEcna = i0StexStinEcna+1;
2094  fT1d_av_lofn[i0StexStinEcna] = (Double_t)0;
2095  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2096  {
2097  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2098 
2099  if( fStexName == "SM " )
2100  {fT1d_av_lofn[i0StexStinEcna] += fT1d_sigevt_of_evsamp[i0StexEcha];}
2101 
2102  if( fStexName == "Dee" )
2103  {
2104  //---------------- Special translation for mixed SCEcna (29 and 32)
2105  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2106  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2107  Int_t n1StinEcha = i0StinEcha+1;
2108  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2109  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2110  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2111  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2112  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2113  {fT1d_av_lofn[i0StexStinEcna] += fT1d_sigevt_of_evsamp[i0StexEcha];}
2114  }
2115  }
2116  Double_t xdivis = (Double_t)0.;
2117  if( fStexName == "SM " )
2118  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2119  if( fStexName == "Dee" )
2120  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2121 
2122  fT1d_av_lofn[i0StexStinEcna] = fT1d_av_lofn[i0StexStinEcna]/xdivis;
2123  }
2124  fTagAvLfn[0] = 1; fFileHeader->fAvLfnCalc++;
2125 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t fAvLfnCalc
Definition: TEcnaHeader.h:73
Double_t * fT1d_sigevt_of_evsamp
Definition: TEcnaRun.h:460
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString fStexName
Definition: TEcnaRun.h:393
Int_t * fTagAvLfn
Definition: TEcnaRun.h:463
Int_t * fTagLfn
Definition: TEcnaRun.h:461
Int_t fFlagPrint
Definition: TEcnaRun.h:509
void LowFrequencyNoise()
Definition: TEcnaRun.cc:1678
Int_t MaxCrysInStin()
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString)
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
Double_t * fT1d_av_lofn
Definition: TEcnaRun.h:462
TString fStinName
Definition: TEcnaRun.h:393
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::AverageMeanCorrelationsBetweenSamples ( )

Definition at line 2192 of file TEcnaRun.cc.

References gather_cfg::cout, TEcnaHeader::fAvMeanCorssCalc, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fMiscDiag, TEcnaHeader::fStex, fStexName, fStinName, fT1d_av_ev_corss, fT1d_ev_cor_ss, fTagAvMeanCorss, fTagMeanCorss, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), TEcnaParEcal::MaxCrysInStin(), TEcnaNumbering::MaxCrysInStinEcna(), TEcnaParEcal::MaxStinEcnaInStex(), and MeanCorrelationsBetweenSamples().

Referenced by StandardCalculations().

2193 {
2194 // Calculation of the average
2195 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the mean cor(s,s)
2196 
2197  //... preliminary calculation of the mean cor(s,s) if not done yet
2199  //................... Allocation av_ev_corss + init to zero (mandatory)
2200  if( fT1d_av_ev_corss == 0 ){fT1d_av_ev_corss = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2201  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2202  {if( fT1d_av_ev_corss[i0StexStinEcna] != (Double_t)0 )
2203  {fMiscDiag[45]++; fT1d_av_ev_corss[i0StexStinEcna] = (Double_t)0;}}
2204 
2205  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::AverageMeanCorrelationsBetweenSamples()" << endl;}
2207  cout << " Calculation, for all the "
2208  << fStinName.Data() << "s, of the average mean cor(s,s)" << endl;}
2209 
2210  //................... Calculation
2211  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2212  {
2213  Int_t n1StexStinEcna = i0StexStinEcna+1;
2214  fT1d_av_ev_corss[i0StexStinEcna] = (Double_t)0;
2215  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2216  {
2217  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2218 
2219  if( fStexName == "SM " )
2220  {fT1d_av_ev_corss[i0StexStinEcna] += fT1d_ev_cor_ss[i0StexEcha];}
2221 
2222  if( fStexName == "Dee" )
2223  {
2224  //---------------- Special translation for mixed SCEcna (29 and 32)
2225  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2226  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2227  Int_t n1StinEcha = i0StinEcha+1;
2228  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2229  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2230  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2231  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2232  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2233  {fT1d_av_ev_corss[i0StexStinEcna] += fT1d_ev_cor_ss[i0StexEcha];}
2234  }
2235  }
2236  Double_t xdivis = (Double_t)0.;
2237  if( fStexName == "SM " )
2238  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2239  if( fStexName == "Dee" )
2240  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2241 
2242  fT1d_av_ev_corss[i0StexStinEcna] = fT1d_av_ev_corss[i0StexStinEcna]/xdivis;
2243  }
2245 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString fStexName
Definition: TEcnaRun.h:393
Int_t fAvMeanCorssCalc
Definition: TEcnaHeader.h:92
Double_t * fT1d_av_ev_corss
Definition: TEcnaRun.h:457
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t * fTagAvMeanCorss
Definition: TEcnaRun.h:458
Int_t MaxCrysInStin()
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString)
void MeanCorrelationsBetweenSamples()
Definition: TEcnaRun.cc:1820
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
TString fStinName
Definition: TEcnaRun.h:393
Int_t * fTagMeanCorss
Definition: TEcnaRun.h:456
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
Double_t * fT1d_ev_cor_ss
Definition: TEcnaRun.h:455
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::AveragePedestals ( )

Definition at line 1951 of file TEcnaRun.cc.

References gather_cfg::cout, TEcnaHeader::fAvPedCalc, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fMiscDiag, TEcnaHeader::fStex, fStexName, fStinName, fT1d_av_mped, fT1d_ev_ev, fTagAvPed, fTagPed, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), TEcnaParEcal::MaxCrysInStin(), TEcnaNumbering::MaxCrysInStinEcna(), TEcnaParEcal::MaxStinEcnaInStex(), and Pedestals().

Referenced by StandardCalculations().

1952 {
1953 // Calculation of the average
1954 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the Pedestals
1955 
1956  //... preliminary calculation of the Pedestals if not done yet
1957  if ( fTagPed[0] != 1 ){Pedestals(); fTagPed[0]=0;}
1958  //................... Allocation av_mped + init to zero (mandatory)
1959  if( fT1d_av_mped == 0 ){fT1d_av_mped = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
1960  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
1961  {if( fT1d_av_mped[i0StexStinEcna] != (Double_t)0 )
1962  {fMiscDiag[41]++; fT1d_av_mped[i0StexStinEcna] = (Double_t)0;}}
1963 
1964  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::AveragePedestals()" << endl;}
1966  cout << " Calculation, for all the "
1967  << fStinName.Data() << "s, of the average Pedestals" << endl;}
1968 
1969  //................... Calculation
1970  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
1971  {
1972  Int_t n1StexStinEcna = i0StexStinEcna+1;
1973  fT1d_av_mped[i0StexStinEcna] = (Double_t)0;
1974  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
1975  {
1976  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
1977 
1978  if( fStexName == "SM " )
1979  {fT1d_av_mped[i0StexStinEcna] += fT1d_ev_ev[i0StexEcha];}
1980 
1981  if( fStexName == "Dee" )
1982  {
1983  //---------------- Special translation for mixed SCEcna (29 and 32)
1984  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
1985  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
1986  Int_t n1StinEcha = i0StinEcha+1;
1987  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
1988  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
1989  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
1990  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
1991  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
1992  {fT1d_av_mped[i0StexStinEcna] += fT1d_ev_ev[i0StexEcha];}
1993  }
1994  }
1995  Double_t xdivis = (Double_t)0.;
1996  if( fStexName == "SM " )
1997  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
1998  if( fStexName == "Dee" )
1999  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2000 
2001  fT1d_av_mped[i0StexStinEcna] = fT1d_av_mped[i0StexStinEcna]/xdivis;
2002  }
2003 
2004  fTagAvPed[0] = 1; fFileHeader->fAvPedCalc++;
2005 }
Double_t * fT1d_av_mped
Definition: TEcnaRun.h:447
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString fStexName
Definition: TEcnaRun.h:393
Int_t * fTagPed
Definition: TEcnaRun.h:446
Double_t * fT1d_ev_ev
Definition: TEcnaRun.h:445
Int_t * fTagAvPed
Definition: TEcnaRun.h:448
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t MaxCrysInStin()
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString)
Int_t fAvPedCalc
Definition: TEcnaHeader.h:91
void Pedestals()
Definition: TEcnaRun.cc:1580
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
TString fStinName
Definition: TEcnaRun.h:393
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::AverageSigmaOfCorrelationsBetweenSamples ( )

Definition at line 2252 of file TEcnaRun.cc.

References gather_cfg::cout, TEcnaHeader::fAvSigCorssCalc, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fMiscDiag, TEcnaHeader::fStex, fStexName, fStinName, fT1d_av_sig_corss, fT1d_sig_cor_ss, fTagAvSigCorss, fTagSigCorss, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), TEcnaParEcal::MaxCrysInStin(), TEcnaNumbering::MaxCrysInStinEcna(), TEcnaParEcal::MaxStinEcnaInStex(), and SigmaOfCorrelationsBetweenSamples().

Referenced by StandardCalculations().

2253 {
2254 // Calculation of the average
2255 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the sigma of cor(s,s)
2256 
2257  //... preliminary calculation of the sigma of cor(s,s) if not done yet
2259  //................... Allocation av_sig_corss + init to zero (mandatory)
2260  if( fT1d_av_sig_corss == 0 ){fT1d_av_sig_corss = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2261  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2262  {if( fT1d_av_sig_corss[i0StexStinEcna] != (Double_t)0 )
2263  {fMiscDiag[46]++; fT1d_av_sig_corss[i0StexStinEcna] = (Double_t)0;}}
2264 
2265  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::AverageSigmaOfCorrelationsBetweenSamples()" << endl;}
2267  cout << " Calculation, for all the "
2268  << fStinName.Data() << "s, of the average sigma of cor(s,s)" << endl;}
2269 
2270  //................... Calculation
2271  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2272  {
2273  Int_t n1StexStinEcna = i0StexStinEcna+1;
2274  fT1d_av_sig_corss[i0StexStinEcna] = (Double_t)0;
2275  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2276  {
2277  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2278 
2279  if( fStexName == "SM " )
2280  {fT1d_av_sig_corss[i0StexStinEcna] += fT1d_sig_cor_ss[i0StexEcha];}
2281 
2282  if( fStexName == "Dee" )
2283  {
2284  //---------------- Special translation for mixed SCEcna (29 and 32)
2285  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2286  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2287  Int_t n1StinEcha = i0StinEcha+1;
2288  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2289  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2290  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2291  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2292  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2293  {fT1d_av_sig_corss[i0StexStinEcna] += fT1d_sig_cor_ss[i0StexEcha];}
2294  }
2295  }
2296  Double_t xdivis = (Double_t)0.;
2297  if( fStexName == "SM " )
2298  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2299  if( fStexName == "Dee" )
2300  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2301 
2302  fT1d_av_sig_corss[i0StexStinEcna] = fT1d_av_sig_corss[i0StexStinEcna]/xdivis;
2303  }
2305 }
Double_t * fT1d_av_sig_corss
Definition: TEcnaRun.h:472
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
Double_t * fT1d_sig_cor_ss
Definition: TEcnaRun.h:470
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString fStexName
Definition: TEcnaRun.h:393
void SigmaOfCorrelationsBetweenSamples()
Definition: TEcnaRun.cc:1886
Int_t * fTagAvSigCorss
Definition: TEcnaRun.h:473
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t MaxCrysInStin()
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString)
Int_t * fTagSigCorss
Definition: TEcnaRun.h:471
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
TString fStinName
Definition: TEcnaRun.h:393
Int_t fAvSigCorssCalc
Definition: TEcnaHeader.h:93
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::AverageTotalNoise ( )

Definition at line 2012 of file TEcnaRun.cc.

References gather_cfg::cout, TEcnaHeader::fAvTnoCalc, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fMiscDiag, TEcnaHeader::fStex, fStexName, fStinName, fT1d_av_totn, fT1d_evsamp_of_sigevt, fTagAvTno, fTagTno, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), TEcnaParEcal::MaxCrysInStin(), TEcnaNumbering::MaxCrysInStinEcna(), TEcnaParEcal::MaxStinEcnaInStex(), and TotalNoise().

Referenced by StandardCalculations().

2013 {
2014 // Calculation of the average
2015 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the Total Noise
2016 
2017  //... preliminary calculation of the averaged Total Noise if not done yet
2018  if ( fTagTno[0] != 1 ){TotalNoise(); fTagTno[0]=0;}
2019  //................... Allocation av_totn + init to zero (mandatory)
2020  if( fT1d_av_totn == 0 ){fT1d_av_totn = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2021  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2022  {if( fT1d_av_totn[i0StexStinEcna] != (Double_t)0 )
2023  {fMiscDiag[42]++; fT1d_av_totn[i0StexStinEcna] = (Double_t)0;}}
2024 
2025  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::AverageTotalNoise()" << endl;}
2027  cout << " Calculation, for all the "
2028  << fStinName.Data() << "s, of the average total Noise" << endl;}
2029 
2030  //................... Calculation
2031  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2032  {
2033  Int_t n1StexStinEcna = i0StexStinEcna+1;
2034  fT1d_av_totn[i0StexStinEcna] = (Double_t)0;
2035  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2036  {
2037  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2038 
2039  if( fStexName == "SM " )
2040  {fT1d_av_totn[i0StexStinEcna] += fT1d_evsamp_of_sigevt[i0StexEcha];}
2041 
2042  if( fStexName == "Dee" )
2043  {
2044  //---------------- Special translation for mixed SCEcna (29 and 32)
2045  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2046  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2047  Int_t n1StinEcha = i0StinEcha+1;
2048  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2049  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2050  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2051  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2052  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2053  {fT1d_av_totn[i0StexStinEcna] += fT1d_evsamp_of_sigevt[i0StexEcha];}
2054  }
2055  }
2056  Double_t xdivis = (Double_t)0.;
2057  if( fStexName == "SM " )
2058  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2059  if( fStexName == "Dee" )
2060  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2061 
2062  fT1d_av_totn[i0StexStinEcna] = fT1d_av_totn[i0StexStinEcna]/xdivis;
2063  }
2064  fTagAvTno[0] = 1; fFileHeader->fAvTnoCalc++;
2065 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString fStexName
Definition: TEcnaRun.h:393
Int_t * fTagAvTno
Definition: TEcnaRun.h:453
void TotalNoise()
Definition: TEcnaRun.cc:1625
Double_t * fT1d_av_totn
Definition: TEcnaRun.h:452
Int_t * fTagTno
Definition: TEcnaRun.h:451
Int_t fAvTnoCalc
Definition: TEcnaHeader.h:72
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t MaxCrysInStin()
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString)
Double_t * fT1d_evsamp_of_sigevt
Definition: TEcnaRun.h:450
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
TString fStinName
Definition: TEcnaRun.h:393
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
Bool_t TEcnaRun::CloseRootFile ( const Text_t *  name)

Definition at line 2969 of file TEcnaRun.cc.

References TEcnaRootFile::CloseFile(), gather_cfg::cout, fCnaParPaths, fCodePrintAllComments, fFlagPrint, fOpenRootFile, fTTBELL, gCnaRootFile, and TEcnaParPaths::ResultsRootFilePath().

Referenced by WriteRootFile().

2969  {
2970 //Close the Root file
2971 
2972  TString s_name;
2973  s_name = fCnaParPaths->ResultsRootFilePath();
2974  s_name.Append('/');
2975  s_name.Append(name);
2976 
2977  Bool_t ok_close = kFALSE;
2978 
2979  if (fOpenRootFile == kTRUE )
2980  {
2982 
2984  cout << "*TEcnaRun::CloseRootFile> ROOT file " << s_name.Data() << " closed." << endl;}
2985 
2986  // delete gCnaRootFile; gCnaRootFile = 0; fCdelete++;
2987 
2988  fOpenRootFile = kFALSE;
2989  ok_close = kTRUE;
2990  }
2991  else
2992  {
2993  cout << "*TEcnaRun::CloseRootFile(...)> No close since no file is open."
2994  << fTTBELL << endl;
2995  }
2996  return ok_close;
2997 }
Bool_t fOpenRootFile
Definition: TEcnaRun.h:395
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
Int_t fFlagPrint
Definition: TEcnaRun.h:509
TString ResultsRootFilePath()
tuple cout
Definition: gather_cfg.py:121
TString fTTBELL
Definition: TEcnaRun.h:376
void TEcnaRun::CorrelationsBetweenSamples ( )

Definition at line 1506 of file TEcnaRun.cc.

References gather_cfg::cout, CovariancesBetweenSamples(), fCnew, fCodePrintAllComments, fCodePrintNoComment, TEcnaHeader::fCorCssCalc, fEcal, fFileHeader, fFlagPrint, fNbSampForCalc, fT3d1_cor_ss, fT3d2_cor_ss, fT3d_cor_ss, fT3d_cov_ss, fTagCorCss, fTagCovCss, i, j, TEcnaParEcal::MaxCrysEcnaInStex(), and mathSSE::sqrt().

Referenced by MeanCorrelationsBetweenSamples(), and StandardCalculations().

1507 {
1508 //Calculation of the correlations between samples for all the StexEchas
1509 
1510  //... preliminary calculation of the covariances if not done yet.
1511  // Test only the first tag since the cov are computed globaly
1512  // but set all the tags to 0 because we don't want to write
1513  // the covariances in the result ROOT file
1514  if ( fTagCovCss[0] != 1 ){CovariancesBetweenSamples();
1515  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
1516  {fTagCovCss[j0StexEcha] = 0;}}
1517 
1518  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::CorrelationsBetweenSamples()" << endl;}
1520  cout << " Calculation: correlations between samples"
1521  << " for each channel." << endl;}
1522 
1523  //................... Allocations cor_ss
1524  if( fT3d_cor_ss == 0){
1525  const Int_t n_samp = fNbSampForCalc;
1526  const Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
1527  fT3d_cor_ss = new Double_t**[n_StexEcha]; fCnew++;
1528  fT3d2_cor_ss = new Double_t*[n_StexEcha*n_samp]; fCnew++;
1529  fT3d1_cor_ss = new Double_t[n_StexEcha*n_samp*n_samp]; fCnew++;
1530  for(Int_t i = 0 ; i < n_StexEcha ; i++){
1531  fT3d_cor_ss[i] = &fT3d2_cor_ss[0] + i*n_samp;
1532  for(Int_t j = 0 ; j < n_samp ; j++){
1533  fT3d2_cor_ss[n_samp*i+j] = &fT3d1_cor_ss[0]+n_samp*(n_samp*i+j);}}
1534  }
1535 
1536  //..................... calculation of the correlations (=init)
1537  //......................computation of half of the matrix, diagonal included (verif = 1)
1538 
1539  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
1540  {
1541  for (Int_t i0Sample = 0 ; i0Sample < fNbSampForCalc ; i0Sample++)
1542  {
1543  for (Int_t j0Sample = 0 ; j0Sample <= i0Sample ; j0Sample++)
1544  {
1545  if( (fT3d_cov_ss[j0StexEcha][i0Sample][i0Sample] > 0) &&
1546  (fT3d_cov_ss[j0StexEcha][j0Sample][j0Sample] > 0) )
1547  {
1548  fT3d_cor_ss[j0StexEcha][i0Sample][j0Sample] = fT3d_cov_ss[j0StexEcha][i0Sample][j0Sample]/
1549  ( sqrt(fT3d_cov_ss[j0StexEcha][i0Sample][i0Sample])*sqrt(fT3d_cov_ss[j0StexEcha][j0Sample][j0Sample]) );
1550  }
1551  else
1552  {
1553  (fT3d_cor_ss)[j0StexEcha][i0Sample][j0Sample] = (Double_t)0; // prevoir compteur + fTTBELL
1554  }
1555  fT3d_cor_ss[j0StexEcha][j0Sample][i0Sample] = fT3d_cor_ss[j0StexEcha][i0Sample][j0Sample];
1556  }
1557  }
1558  fTagCorCss[j0StexEcha] = 1; fFileHeader->fCorCssCalc++;
1559  }
1560 }
int i
Definition: DBlmapReader.cc:9
Double_t * fT3d1_cor_ss
Definition: TEcnaRun.h:441
Int_t * fTagCorCss
Definition: TEcnaRun.h:442
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
void CovariancesBetweenSamples()
Definition: TEcnaRun.cc:1446
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t * fTagCovCss
Definition: TEcnaRun.h:437
Double_t *** fT3d_cor_ss
Definition: TEcnaRun.h:439
Double_t ** fT3d2_cor_ss
Definition: TEcnaRun.h:440
Int_t fCorCssCalc
Definition: TEcnaHeader.h:77
T sqrt(T t)
Definition: SSEVec.h:46
Double_t *** fT3d_cov_ss
Definition: TEcnaRun.h:434
int j
Definition: DBlmapReader.cc:9
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::CovariancesBetweenSamples ( )

Definition at line 1446 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, TEcnaHeader::fCovCssCalc, fEcal, fFileHeader, fFlagPrint, fNbSampForCalc, fNumberOfEvents, fT2d_ev, fT3d1_cov_ss, fT3d2_cov_ss, fT3d_AdcValues, fT3d_cov_ss, fTagCovCss, fTagMSp, i, j, TEcnaParEcal::MaxCrysEcnaInStex(), and SampleMeans().

Referenced by CorrelationsBetweenSamples().

1447 {
1448  //Calculation of the covariances between samples for all the StexEchas
1449 
1450  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::CovariancesBetweenSamples()" << endl;}
1452  cout << " Calculation: covariances between samples"
1453  << " for each channel." << endl;}
1454 
1455  //................... Allocations cov_ss
1456  if( fT3d_cov_ss == 0 ){
1457  const Int_t n_samp = fNbSampForCalc;
1458  const Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
1459  fT3d_cov_ss = new Double_t**[n_StexEcha]; fCnew++;
1460  fT3d2_cov_ss = new Double_t*[n_StexEcha*n_samp]; fCnew++;
1461  fT3d1_cov_ss = new Double_t[n_StexEcha*n_samp*n_samp]; fCnew++;
1462  for(Int_t i = 0 ; i < n_StexEcha ; i++){
1463  fT3d_cov_ss[i] = &fT3d2_cov_ss[0] + i*n_samp;
1464  for(Int_t j = 0 ; j < n_samp ; j++){
1465  fT3d2_cov_ss[n_samp*i+j] = &fT3d1_cov_ss[0]+n_samp*(n_samp*i+j);}}
1466  }
1467 
1468  //.................. Calculation (= init)
1469  //.................. computation of half of the matrix, diagonal included)
1470 
1471  //... preliminary calculation of the expectation values if not done yet.
1472  // The tag is set to 1 after call to the method. It is reset to 0
1473  // because the expectation values must not be written in the result ROOT file
1474  // (since the tag was equal to 0)
1475  // Results in array fT2d_ev[j0StexEcha][i0Sample]
1476  if(fTagMSp[0] != 1){SampleMeans(); fTagMSp[0] = 0;}
1477 
1478 
1479  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
1480  {
1481  for (Int_t i0Sample = 0 ; i0Sample < fNbSampForCalc ; i0Sample++)
1482  {
1483  for (Int_t j0Sample = 0 ; j0Sample <= i0Sample; j0Sample++)
1484  {
1485  fT3d_cov_ss[j0StexEcha][i0Sample][j0Sample] = (Double_t)0;
1486  for( Int_t i_event = 0; i_event < fNumberOfEvents; i_event++ )
1487  {
1488  fT3d_cov_ss[j0StexEcha][i0Sample][j0Sample] +=
1489  (fT3d_AdcValues[j0StexEcha][i0Sample][i_event] - fT2d_ev[j0StexEcha][i0Sample])
1490  *(fT3d_AdcValues[j0StexEcha][j0Sample][i_event] - fT2d_ev[j0StexEcha][j0Sample]);
1491  }
1492  fT3d_cov_ss[j0StexEcha][i0Sample][j0Sample] /= (Double_t)fNumberOfEvents;
1493  fT3d_cov_ss[j0StexEcha][j0Sample][i0Sample] = fT3d_cov_ss[j0StexEcha][i0Sample][j0Sample];
1494  }
1495  }
1496  fTagCovCss[j0StexEcha] = 1; fFileHeader->fCovCssCalc++;
1497  }
1498 }
int i
Definition: DBlmapReader.cc:9
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t * fTagCovCss
Definition: TEcnaRun.h:437
Double_t ** fT2d_ev
Definition: TEcnaRun.h:426
Double_t ** fT3d2_cov_ss
Definition: TEcnaRun.h:435
Double_t * fT3d1_cov_ss
Definition: TEcnaRun.h:436
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Double_t *** fT3d_cov_ss
Definition: TEcnaRun.h:434
int j
Definition: DBlmapReader.cc:9
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fNumberOfEvents
Definition: TEcnaRun.h:410
void SampleMeans()
Definition: TEcnaRun.cc:1326
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
Int_t fCovCssCalc
Definition: TEcnaHeader.h:76
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::Expert1Calculations ( )

Definition at line 1296 of file TEcnaRun.cc.

References HighFrequencyCorrelationsBetweenChannels(), and LowFrequencyCorrelationsBetweenChannels().

Referenced by TEcnaGui::Calculations().

1297 {
1298  // long time, big file
1299 
1302 }
void HighFrequencyCorrelationsBetweenChannels()
Definition: TEcnaRun.cc:2637
void LowFrequencyCorrelationsBetweenChannels()
Definition: TEcnaRun.cc:2437
void TEcnaRun::Expert2Calculations ( )

Definition at line 1304 of file TEcnaRun.cc.

References HighFrequencyMeanCorrelationsBetweenStins(), and LowFrequencyMeanCorrelationsBetweenStins().

Referenced by TEcnaGui::Calculations().

1305 {
1306  // long time, no big file
1307  // expert 1 is called (if not called before) without writing in file.
1308  // Results are used only in memory to compute expert2 calculations
1309 
1312 }
void HighFrequencyMeanCorrelationsBetweenStins()
Definition: TEcnaRun.cc:2821
void LowFrequencyMeanCorrelationsBetweenStins()
Definition: TEcnaRun.cc:2723
TString TEcnaRun::GetNewRootFileName ( )

Definition at line 3100 of file TEcnaRun.cc.

References fNewRootFileName.

3100 {return fNewRootFileName;}
TString fNewRootFileName
Definition: TEcnaRun.h:400
TString TEcnaRun::GetNewRootFileNameShort ( )

Definition at line 3101 of file TEcnaRun.cc.

References fNewRootFileNameShort.

Referenced by TEcnaGui::Calculations().

3101 {return fNewRootFileNameShort;}
TString fNewRootFileNameShort
Definition: TEcnaRun.h:401
Bool_t TEcnaRun::GetPathForResults ( )

Definition at line 133 of file TEcnaRun.cc.

References fCnaParPaths, and TEcnaParPaths::GetPathForResultsRootFiles().

TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
Bool_t GetPathForResultsRootFiles()
void TEcnaRun::GetReadyToCompute ( )

Definition at line 1216 of file TEcnaRun.cc.

References gather_cfg::cout, fCnaWrite, fEcal, fFileHeader, TEcnaHeader::fFirstReqEvtNumber, TEcnaHeader::fLastReqEvtNumber, TEcnaWrite::fMakeResultsFileName(), TEcnaHeader::fNbOfSamples, fNbSampForFic, fNumberOfEvents, TEcnaHeader::fReqNbOfEvts, TEcnaHeader::fRunNumber, TEcnaHeader::fStex, fT2d_NbOfEvts, TEcnaHeader::fTypAna, TEcnaParEcal::MaxCrysEcnaInStex(), TEcnaWrite::NumberOfEventsAnalysis(), and TEcnaWrite::RegisterFileParameters().

Referenced by EcnaAnalyzer::analyze(), TEcnaGui::Calculations(), and EcnaAnalyzer::~EcnaAnalyzer().

1217 {
1218 //
1219  // MAKE THE RESULTS FILE NAME and
1220  // CHECK OF THE NUMBER OF FOUND EVENTS AND init fNumberOfEvents
1221  // (number used to compute the average values over the events)
1222  // The number of events fNumberOfEvents is extracted from the array fT2d_NbOfEvts[]
1223  // which has been filled by the GetSampleAdcValues(...) method
1224 
1225  //..................... Making of the Root File name that will be written
1230 
1231  fCnaWrite->fMakeResultsFileName(); // set fRootFileName, fRootFileNameShort
1232 
1233  //..................... Checking numbers of found events channel by channel
1234  if( fT2d_NbOfEvts != 0 )
1235  {
1238  }
1239  else
1240  {
1241  cout << "*TEcnaRun::GetReadyToCompute()> no data? fT2d_NbOfEvts = " << fT2d_NbOfEvts << endl;
1242  }
1243 }
Int_t NumberOfEventsAnalysis(Int_t **, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaWrite.cc:519
Int_t fStex
Definition: TEcnaHeader.h:56
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:55
Int_t fNbOfSamples
Definition: TEcnaHeader.h:51
Int_t fNbSampForFic
Definition: TEcnaRun.h:407
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)
Definition: TEcnaWrite.cc:609
Int_t fNumberOfEvents
Definition: TEcnaRun.h:410
TString fTypAna
Definition: TEcnaHeader.h:50
Int_t fFirstReqEvtNumber
Definition: TEcnaHeader.h:53
Int_t MaxCrysEcnaInStex()
Int_t fLastReqEvtNumber
Definition: TEcnaHeader.h:54
tuple cout
Definition: gather_cfg.py:121
Int_t fRunNumber
Definition: TEcnaHeader.h:52
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:639
Int_t ** fT2d_NbOfEvts
Definition: TEcnaRun.h:419
TEcnaWrite * fCnaWrite
Definition: TEcnaRun.h:388
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::GetReadyToReadData ( TString  typ_ana,
const Int_t &  run_number,
const Int_t &  nfirst,
const Int_t &  nlast,
const Int_t &  nbevts,
const Int_t &  Stex 
)

Definition at line 504 of file TEcnaRun.cc.

Referenced by EcnaAnalyzer::analyze(), and TEcnaGui::Calculations().

507 {
508 //Preparation of the data reading. Set part of the header. No RunType as argument.
509 //Use default value = 99999999 and call method with all the arguments (see below)
510 
511  Int_t RunType = 99999999;
512  GetReadyToReadData(typ_ana, run_number, nfirst, nlast, nbevts, Stex, RunType);
513 }
void GetReadyToReadData(TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRun.cc:504
int nlast
Definition: AMPTWrapper.h:47
void TEcnaRun::GetReadyToReadData ( TString  typ_ana,
const Int_t &  run_number,
const Int_t &  nfirst,
const Int_t &  nlast,
const Int_t &  nbevts,
const Int_t &  Stex,
const Int_t &  run_type 
)

Definition at line 515 of file TEcnaRun.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, TEcnaHeader::fFirstReqEvtNumber, fFlagPrint, TEcnaHeader::fLastReqEvtNumber, fMiscDiag, fNbOfMiscDiagCounters, fNbSampForFic, fObjectManager, fReadyToReadData, TEcnaHeader::fReqNbOfEvts, TEcnaHeader::fRunNumber, TEcnaHeader::fRunType, fSpecialStexStinNotIndexed, TEcnaHeader::fStex, fStexName, fStinName, fT1d_NbOfEvts, fT1d_StexStinFromIndex, fT2d_NbOfEvts, fT3d1_AdcValues, fT3d2_AdcValues, fT3d_AdcValues, fTagAdcEvt, fTagAvHfn, fTagAvLfn, fTagAvMeanCorss, fTagAvPed, fTagAvSigCorss, fTagAvTno, fTagCorCss, fTagCovCss, fTagHFccMoStins, fTagHfCor, fTagHfCov, fTagHfn, fTagLFccMoStins, fTagLfCor, fTagLfCov, fTagLfn, fTagMeanCorss, fTagMSp, fTagNbOfEvts, fTagPed, fTagSigCorss, fTagSSp, fTagStinNumbers, fTagTno, fTTBELL, TEcnaHeader::fTypAna, TEcnaHeader::HeaderParameters(), TEcnaParEcal::MaxCrysEcnaInStex(), TEcnaParEcal::MaxCrysInStin(), and TEcnaParEcal::MaxStinEcnaInStex().

518 {
519 //Preparation of the data reading. Set part of the header
520 //
521 // [nfirst, nlast] = [1,50] (50 events) or [151,300] (150 events) or etc...
522 
523  Int_t nrangeevts = nlast - nfirst + 1; // number of events in range
524 
525  if( nrangeevts < nbevts )
526  {
527  if( nlast >= nfirst )
528  {
529  cout << "*TEcnaRun::GetReadyToReadData(...)> --- WARNING ---> number of events = " << nbevts
530  << ", out of range (range = " << nfirst << "," << nlast << ")" << endl
531  << " The number of found events will be less " << endl
532  << " than the number of requested events." << endl;
533  }
534  if( nlast < nfirst )
535  {
536  cout << "*TEcnaRun::GetReadyToReadData(...)> --- INFO ---> last requested event number = " << nlast
537  << ", less than first requested event number (= " << nfirst << ")" << endl
538  << " File will be read until EOF if the number of found events" << endl
539  << " remains less than the number of requested events." << endl;
540  }
541 
542  }
543 
544  //............. allocation for counters
545  fMiscDiag = new Int_t[fNbOfMiscDiagCounters]; fCnew++;
546  for (Int_t iz=0; iz<fNbOfMiscDiagCounters; iz++){fMiscDiag[iz] = (Int_t)0;}
547 
548  //************** CHECK OF ARGUMENTS: nfirst_arg and nbevts_arg
549  Int_t nentries = 99999999; // => to be reintroduced as argument (like run_type) (?)
550  if ( nfirst <= nentries )
551  {
552  //--------------------- test positivity of nfirst_arg (GetReadyToReadData)
553  if ( nfirst > 0 )
554  {
555  //-------- test compatibility between the last requested event number
556  // and the number of entries
557  if( nlast <= nentries )
558  {
559  const Text_t *h_name = "CnaHeader"; //==> voir cette question avec FXG
560  const Text_t *h_title = "CnaHeader"; //==> voir cette question avec FXG
561  //fFileHeader->HeaderParameters(h_name, h_title ,
562  // typ_ana, fNbSampForFic,
563  // run_number, nfirst, nlast, nbevts,
564  // Stex, nentries); fCnew++;
565 
566  if ( fEcal->MaxStinEcnaInStex() > 0 && fEcal->MaxCrysInStin() > 0 && fNbSampForFic > 0 )
567  {
568  if( fFileHeader == 0 ){fFileHeader = new TEcnaHeader(fObjectManager, h_name, h_title);} // fCnew++;
569 
571  run_number, nfirst, nlast, nbevts,
572  Stex, run_type);
573 
574  // After this call to TEcnaHeader, we have: (GetReadyToReadData)
575  // fFileHeader->fTypAna = typ_ana
576  // fFileHeader->fNbOfSamples = fNbSampForFic
577  // fFileHeader->fRunNumber = run_number
578  // fFileHeader->fFirstReqEvtNumber = nfirst
579  // fFileHeader->fLastReqEvtNumber = nlast
580  // fFileHeader->fReqNbOfEvts = nbevts
581  // fFileHeader->fStex = Stex number
582  // fFileHeader->fRunType = run_type
583 
584  // fFileHeader->Print();
585 
586  // {Int_t cintoto; cout << "taper 0 pour continuer" << endl; cin >> cintoto;}
587 
588  // fFileHeader->SetName("CnaHeader"); *======> voir FXG
589  // fFileHeader->SetTitle("CnaHeader");
590 
591  //......................................... allocation tags + init of them (GetReadyToReadData)
592 
593  fTagStinNumbers = new Int_t[1]; fCnew++; fTagStinNumbers[0] = (Int_t)0;
594  fTagNbOfEvts = new Int_t[1]; fCnew++; fTagNbOfEvts[0] = (Int_t)0;
595 
596  fTagAdcEvt = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
597  for (Int_t iz=0; iz<fEcal->MaxCrysEcnaInStex(); iz++){fTagAdcEvt[iz] = (Int_t)0;}
598 
599  fTagMSp = new Int_t[1]; fCnew++; fTagMSp[0] = (Int_t)0;
600  fTagSSp = new Int_t[1]; fCnew++; fTagSSp[0] = (Int_t)0;
601 
602  fTagCovCss = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
603  for (Int_t iz=0; iz<fEcal->MaxCrysEcnaInStex(); iz++){fTagCovCss[iz] = (Int_t)0;}
604 
605  fTagCorCss = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
606  for (Int_t iz=0; iz<fEcal->MaxCrysEcnaInStex(); iz++){fTagCorCss[iz] = (Int_t)0;}
607 
608  fTagLfCov = new Int_t[1]; fCnew++; fTagLfCov[0] = (Int_t)0;
609  fTagLfCor = new Int_t[1]; fCnew++; fTagLfCor[0] = (Int_t)0;
610 
611  fTagHfCov = new Int_t[1]; fCnew++; fTagHfCov[0] = (Int_t)0;
612  fTagHfCor = new Int_t[1]; fCnew++; fTagHfCor[0] = (Int_t)0;
613 
614  fTagLFccMoStins = new Int_t[1]; fCnew++; fTagLFccMoStins[0] = (Int_t)0;
615  fTagHFccMoStins = new Int_t[1]; fCnew++; fTagHFccMoStins[0] = (Int_t)0;
616 
617  fTagPed = new Int_t[1]; fCnew++; fTagPed[0] = (Int_t)0;
618  fTagTno = new Int_t[1]; fCnew++; fTagTno[0] = (Int_t)0;
619  fTagMeanCorss = new Int_t[1]; fCnew++; fTagMeanCorss[0] = (Int_t)0;
620 
621  fTagLfn = new Int_t[1]; fCnew++; fTagLfn[0] = (Int_t)0;
622  fTagHfn = new Int_t[1]; fCnew++; fTagHfn[0] = (Int_t)0;
623  fTagSigCorss = new Int_t[1]; fCnew++; fTagSigCorss[0] = (Int_t)0;
624 
625  fTagAvPed = new Int_t[1]; fCnew++; fTagAvPed[0] = (Int_t)0;
626  fTagAvTno = new Int_t[1]; fCnew++; fTagAvTno[0] = (Int_t)0;
627  fTagAvLfn = new Int_t[1]; fCnew++; fTagAvLfn[0] = (Int_t)0;
628  fTagAvHfn = new Int_t[1]; fCnew++; fTagAvHfn[0] = (Int_t)0;
629  fTagAvMeanCorss = new Int_t[1]; fCnew++; fTagAvMeanCorss[0] = (Int_t)0;
630  fTagAvSigCorss = new Int_t[1]; fCnew++; fTagAvSigCorss[0] = (Int_t)0;
631 
632  //====================================================================================
633  //
634  // allocation for fT1d_StexStinFromIndex[] and init to fSpecialStexStinNotIndexed
635  //
636  //====================================================================================
637 
638  if(fT1d_StexStinFromIndex == 0)
639  {
641  }
642  for ( Int_t i0_Stin = 0; i0_Stin < fEcal->MaxStinEcnaInStex(); i0_Stin++ )
643  {
645  }
646 
647  //------------------------------------------------------------- (GetReadyToReadData)
648 
649  //====================================================================================
650  //
651  // allocation of the 3D array fT3d_AdcValues[channel][sample][events] (ADC values)
652  //
653  // This array is filled in the GetSampleAdcValues(...) method
654  //
655  //====================================================================================
656 
657  if(fT3d_AdcValues == 0)
658  {
659  //............ Allocation for the 3d array
660  cout << "*TEcnaRun::GetReadyToReadData(...)> Allocation of 3D array for ADC distributions."
661  << " Nb of requested evts = " << fFileHeader->fReqNbOfEvts << endl
662  << " This number must not be too large"
663  << " (no failure after this message means alloc OK)." << endl;
664 
665  fT3d_AdcValues = new Double_t**[fEcal->MaxCrysEcnaInStex()]; fCnew++;
666 
668  new Double_t*[fEcal->MaxCrysEcnaInStex()*
669  fNbSampForFic]; fCnew++;
670 
672  new Double_t[fEcal->MaxCrysEcnaInStex()*
675 
676  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++){
677  fT3d_AdcValues[i0StexEcha] = &fT3d2_AdcValues[0] + i0StexEcha*fNbSampForFic;
678  for(Int_t j0Sample=0; j0Sample<fNbSampForFic; j0Sample++){
679  fT3d2_AdcValues[fNbSampForFic*i0StexEcha + j0Sample] = &fT3d1_AdcValues[0]+
680  fFileHeader->fReqNbOfEvts*(fNbSampForFic*i0StexEcha+j0Sample);}}
681  }
682  //................................. Init to zero
683  for (Int_t iza=0; iza<fEcal->MaxCrysEcnaInStex(); iza++)
684  {
685  for (Int_t izb=0; izb<fNbSampForFic; izb++)
686  {
687  for (Int_t izc=0; izc<fFileHeader->fReqNbOfEvts; izc++)
688  {
689  if( fT3d_AdcValues[iza][izb][izc] != (Double_t)0 )
690  {
691  fMiscDiag[0]++;
692  fT3d_AdcValues[iza][izb][izc] = (Double_t)0;
693  }
694  }
695  }
696  }
697 
698  //--------------------------------------------------------- (GetReadyToReadData)
699  //====================================================================================
700  //
701  // allocation of the 2D array fT2d_NbOfEvts[channel][sample] (Max nb of evts)
702  //
703  //====================================================================================
704 
705  if (fT2d_NbOfEvts == 0)
706  {
707  fT2d_NbOfEvts = new Int_t*[fEcal->MaxCrysEcnaInStex()]; fCnew++;
708  fT1d_NbOfEvts = new Int_t[fEcal->MaxCrysEcnaInStex()*
709  fNbSampForFic]; fCnew++;
710 
711  for(Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
712  {
713  fT2d_NbOfEvts[i0StexEcha] =
714  &fT1d_NbOfEvts[0] + i0StexEcha*fNbSampForFic;
715  }
716 
717  //................ Init the array to 0
718  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
719  {
720  for(Int_t i0Sample=0; i0Sample<fNbSampForFic; i0Sample++)
721  {
722  fT2d_NbOfEvts[i0StexEcha][i0Sample] = 0;
723  }
724  }
725  }
726  else
727  {
728  cerr << "!TEcnaRun::GetReadyToReadData(...)> *** ERROR *** No allocation for fT2d_NbOfEvts!"
729  << " Pointer already not NULL " << fTTBELL << endl;
730  // {Int_t cintoto; cout << "Enter: 0 and RETURN to continue or: CTRL C to exit"
731  // << endl; cin >> cintoto;}
732  }
733  }
734  else
735  {
736  cerr << endl
737  << "!TEcnaRun::GetReadyToReadData(...)> "
738  << " *** ERROR *** " << endl
739  << " --------------------------------------------------"
740  << endl
741  << " NULL or NEGATIVE values for arguments" << endl
742  << " with expected positive values:" << endl
743  << " Number of Stins in Stex = " << fEcal->MaxStinEcnaInStex() << endl
744  << " Number of crystals in Stin = " << fEcal->MaxCrysInStin() << endl
745  << " Number of samples by channel = " << fNbSampForFic << endl
746  << endl
747  << endl
748  << " hence, no memory allocation for array member has been performed." << endl;
749 
750  cout << "Enter: 0 and RETURN to continue or: CTRL C to exit";
751  Int_t toto;
752  cin >> toto;
753  }
754  //----------------------------------------------------------- (GetReadyToReadData)
756  cout << endl;
757  cout << "*TEcnaRun::GetReadyToReadData(...)>" << endl
758  << " The method has been called with the following argument values:" << endl
759  << " Analysis name = "
760  << fFileHeader->fTypAna << endl
761  << " Run number = "
762  << fFileHeader->fRunNumber << endl
763  << " Run type = "
764  << fFileHeader->fRunType << endl
765  << " First requested event number = "
766  << fFileHeader->fFirstReqEvtNumber << endl
767  << " Last requested event number = "
768  << fFileHeader->fLastReqEvtNumber << endl
769  << " " << fStexName.Data() << " number = "
770  << fFileHeader->fStex << endl
771  << " Number of " << fStinName.Data()
772  << " in " << fStexName.Data() << " = "
773  << fEcal->MaxStinEcnaInStex() << endl
774  << " Number of crystals in " << fStinName.Data() << " = "
775  << fEcal->MaxCrysInStin() << endl
776  << " Number of samples by channel = "
777  << fNbSampForFic << endl
778  << endl;}
779 
780  fReadyToReadData = 1; // set flag
781  }
782  else
783  {
785  cout << "!TEcnaRun::GetReadyToReadData(...) > WARNING/CORRECTION:" << endl
786  << "! The fisrt requested event number is not positive (nfirst = " << nfirst << ") "
787  << fTTBELL << endl;}
788  }
789  }
790  else
791  {
793  cout << endl << "!TEcnaRun::GetReadyToReadData(...)> WARNING/CORRECTION:" << endl
794  << "! The number of requested events (nbevts = " << nbevts << ") is too large." << endl
795  << "! Last event number = " << nlast << " > number of entries = " << nentries << ". "
796  << fTTBELL << endl << endl;}
797  }
798  }
799  else
800  {
801  cout << "!TEcnaRun::GetReadyToReadData(...) *** ERROR ***> "
802  << " The first requested event number is greater than the number of entries."
803  << fTTBELL << endl;
804  }
806  cout << "*TEcnaRun::GetReadyToReadData(...)> Leaving the method. fReadyToReadData = "
807  << fReadyToReadData << endl; }
808 
809 } // end of GetReadyToReadData
Int_t * fTagCorCss
Definition: TEcnaRun.h:442
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fTagLFccMoStins
Definition: TEcnaRun.h:496
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t * fTagStinNumbers
Definition: TEcnaRun.h:424
Int_t * fTagLfCor
Definition: TEcnaRun.h:482
TEcnaObject * fObjectManager
Definition: TEcnaRun.h:382
Int_t fReadyToReadData
Definition: TEcnaRun.h:396
Int_t fRunType
Definition: TEcnaHeader.h:63
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString fStexName
Definition: TEcnaRun.h:393
Int_t * fTagCovCss
Definition: TEcnaRun.h:437
Int_t * fTagPed
Definition: TEcnaRun.h:446
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:55
Int_t * fTagAvTno
Definition: TEcnaRun.h:453
Double_t * fT3d1_AdcValues
Definition: TEcnaRun.h:416
Int_t * fTagHfn
Definition: TEcnaRun.h:466
Int_t * fTagSSp
Definition: TEcnaRun.h:432
Int_t fNbSampForFic
Definition: TEcnaRun.h:407
Int_t * fTagTno
Definition: TEcnaRun.h:451
Int_t * fTagAvLfn
Definition: TEcnaRun.h:463
Int_t * fT1d_NbOfEvts
Definition: TEcnaRun.h:420
Int_t * fTagLfn
Definition: TEcnaRun.h:461
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Int_t * fTagAvSigCorss
Definition: TEcnaRun.h:473
Int_t * fTagHfCor
Definition: TEcnaRun.h:491
Int_t * fTagNbOfEvts
Definition: TEcnaRun.h:421
Int_t * fTagAvPed
Definition: TEcnaRun.h:448
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t * fTagHFccMoStins
Definition: TEcnaRun.h:500
Int_t fSpecialStexStinNotIndexed
Definition: TEcnaRun.h:403
Int_t * fTagAvMeanCorss
Definition: TEcnaRun.h:458
Int_t MaxCrysInStin()
Int_t * fTagLfCov
Definition: TEcnaRun.h:478
Int_t fCnew
Definition: TEcnaRun.h:373
TString fTypAna
Definition: TEcnaHeader.h:50
Int_t fFirstReqEvtNumber
Definition: TEcnaHeader.h:53
Int_t * fTagHfCov
Definition: TEcnaRun.h:487
Int_t * fTagAvHfn
Definition: TEcnaRun.h:468
Int_t * fTagSigCorss
Definition: TEcnaRun.h:471
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Int_t MaxCrysEcnaInStex()
Int_t fLastReqEvtNumber
Definition: TEcnaHeader.h:54
int nlast
Definition: AMPTWrapper.h:47
Int_t * fTagAdcEvt
Definition: TEcnaRun.h:417
void HeaderParameters(TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaHeader.cc:126
Double_t ** fT3d2_AdcValues
Definition: TEcnaRun.h:415
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
Int_t fRunNumber
Definition: TEcnaHeader.h:52
Int_t ** fT2d_NbOfEvts
Definition: TEcnaRun.h:419
TString fStinName
Definition: TEcnaRun.h:393
Int_t fNbOfMiscDiagCounters
Definition: TEcnaRun.h:379
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRun.h:423
TString fTTBELL
Definition: TEcnaRun.h:376
Int_t * fTagMeanCorss
Definition: TEcnaRun.h:456
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
TString TEcnaRun::GetRootFileName ( )

Definition at line 1182 of file TEcnaRun.cc.

References fRootFileName.

1182 {return fRootFileName;}
TString fRootFileName
Definition: TEcnaRun.h:398
TString TEcnaRun::GetRootFileNameShort ( )

Definition at line 1183 of file TEcnaRun.cc.

References fRootFileNameShort.

Referenced by TEcnaGui::Calculations().

1183 {return fRootFileNameShort;}
TString fRootFileNameShort
Definition: TEcnaRun.h:399
Bool_t TEcnaRun::GetSampleAdcValues ( const Int_t &  n1EventNumber,
const Int_t &  n1StexStin,
const Int_t &  i0StinEcha,
const Int_t &  i0Sample,
const Double_t &  adcvalue 
)

Definition at line 835 of file TEcnaRun.cc.

References gather_cfg::cout, fBuildEvtNotSkipped, fCodePrintAllComments, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fFlagSubDet, TEcnaHeader::fNbOfEvtsCalc, fNbSampForFic, fReadyToReadData, TEcnaHeader::fReqNbOfEvts, fSpecialStexStinNotIndexed, TEcnaHeader::fStex, fStexName, fStinIndexBuilt, fStinName, TEcnaHeader::fStinNumbersCalc, fT1d_StexStinFromIndex, fT2d_NbOfEvts, fT3d_AdcValues, fTagNbOfEvts, fTagStinNumbers, fTTBELL, TEcnaParEcal::MaxCrysEcnaInStex(), TEcnaParEcal::MaxCrysInStin(), TEcnaParEcal::MaxSampADC(), and TEcnaParEcal::MaxStinEcnaInStex().

838 {
839  //Building of the arrays fT1d_StexStinFromIndex[] and fT3d_AdcValues[][][]
840 
841  fBuildEvtNotSkipped++; // event not skipped by cmsRun
842 
843  Bool_t ret_code = kFALSE;
844 
845  Int_t i0EventIndex = n1EventNumber - 1; // INDEX FOR Event number
846  Int_t i0StexStinEcna = n1StexStin - 1; // INDEX FOR StexStin = Number_of_the_Stin_in_Stex - 1
847 
848  Int_t i_trouve = 0;
849  //.................................................................. (GetSampleAdcValues)
850  if(fReadyToReadData == 1)
851  {
852  if( n1StexStin>= 1 && n1StexStin <= fEcal->MaxStinEcnaInStex() )
853  {
854  if( i0StinEcha >= 0 && i0StinEcha < fEcal->MaxCrysInStin() )
855  {
856  if( i0Sample >= 0 && i0Sample < fEcal->MaxSampADC() )
857  {
858  //..... Put the StexStin number in 1D array fT1d_StexStinFromIndex[] = Stin index + 1
859  if( fT1d_StexStinFromIndex != 0 ) // table fT1d_StexStinFromIndex[index] already allocated
860  {
861  ret_code = kTRUE;
862 
863  // StexStin already indexed
864  if( n1StexStin == fT1d_StexStinFromIndex[i0StexStinEcna] ){i_trouve = 1;}
865 
866  // StexStin index not found: set index for new StexStin
867  if (i_trouve != 1 )
868  {
869  if( fT1d_StexStinFromIndex[i0StexStinEcna] == fSpecialStexStinNotIndexed )
870  {
871  fT1d_StexStinFromIndex[i0StexStinEcna] = n1StexStin;
873  fTagStinNumbers[0] = 1;
874  fStinIndexBuilt++; // number of found Stins
875 
877  {
878  if( fStinIndexBuilt == 1 )
879  {
880  cout << endl << "*TEcnaRun::GetSampleAdcValues(...)> event " << n1EventNumber
881  << " : first event for " << fStexName.Data() << " " << fFileHeader->fStex
882  << "; " << fStinName.Data() << "s : ";
883  }
884  if( fFlagSubDet == "EB" )
885  {cout << fT1d_StexStinFromIndex[i0StexStinEcna] << ", ";}
886  if( fFlagSubDet == "EE" )
887  {cout << fEcalNumbering->
888  GetDeeSCConsFrom1DeeSCEcna(fFileHeader->fStex, fT1d_StexStinFromIndex[i0StexStinEcna])
889  << ", ";}
890  }
891  //.................................................... (GetSampleAdcValues)
893  {
894  cout << " (" << fStinIndexBuilt << " " << fStinName.Data()
895  << " found), channel " << i0StinEcha << ", i0Sample " << i0Sample << endl;
896  }
897  ret_code = kTRUE;
898  } // if ( fT1d_StexStinFromIndex[i0StexStinEcna] == fSpecialStexStinNotIndexed )
899  else
900  {
901  cout << "!TEcnaRun::GetSampleAdcValues(...)> *** ERROR ***> NOT ALLOWED if RESULT. "
902  << " n1StexStin = " << n1StexStin << ", fT1d_StexStinFromIndex["
903  << i0StexStinEcna << "] = "
904  << fT1d_StexStinFromIndex[i0StexStinEcna]
905  << ", fStinIndexBuilt = " << fStinIndexBuilt
906  << fTTBELL << endl;
907  ret_code = kFALSE;
908  }
909  } // if (i_trouve != 1 )
910 
911  } // if( fT1d_StexStinFromIndex != 0 )
912  else
913  {
914  cout << "!TEcnaRun, GetSampleAdcValues *** ERROR ***> "
915  << " fT1d_StexStinFromIndex = " << fT1d_StexStinFromIndex
916  << " fT1d_StexStinFromIndex[] ALLOCATION NOT DONE" << fTTBELL << endl;
917  ret_code = kFALSE;
918  } //.................................................................. (GetSampleAdcValues)
919  } // end of if( i0Sample >= 0 && i0Sample < fNbSampForFic )
920  else
921  {
922  //.......Reading data => Message and error only if sample >= fEcal->MaxSampADC()
923  // (not fNbSampForFic, the later is used only for calculations)
924  if( i0Sample >= fEcal->MaxSampADC() )
925  {
926  cout << "!TEcnaRun::GetSampleAdcValues(...) *** ERROR ***> "
927  << " sample number = " << i0Sample << ". OUT OF BOUNDS"
928  << " (max = " << fNbSampForFic << ")"
929  << fTTBELL << endl;
930  ret_code = kFALSE;
931  }
932  else
933  {
934  ret_code = kTRUE;
935  }
936  }// else of if( i0Sample >= 0 && i0Sample < fNbSampForFic )
937  } // end of if( i0StinEcha >= 0 && i0StinEcha < fEcal->MaxCrysInStin() )
938  else
939  {
940  cout << "!TEcnaRun::GetSampleAdcValues(...) *** ERROR ***> "
941  << " channel number in " << fStinName.Data() << " = " << i0StinEcha << ". OUT OF BOUNDS"
942  << " (max = " << fEcal->MaxCrysInStin() << ")"
943  << fTTBELL << endl;
944  ret_code = kFALSE;
945  } // else of if( i0StinEcha >= 0 && i0StinEcha < fEcal->MaxCrysInStin() )
946  }
947  else
948  {
949  cout << "!TEcnaRun::GetSampleAdcValues(...) *** ERROR ***> "
950  << fStinName.Data() << " number in " << fStexName.Data() << " = " << n1StexStin << ". OUT OF BOUNDS"
951  << " (max = " << fEcal->MaxStinEcnaInStex() << ")"
952  << fTTBELL << endl;
953  ret_code = kFALSE;
954  }
955 
956  //.................................................................. (GetSampleAdcValues)
957  //........ Filling of the 2D array of the event numbers in the data reading loop and
958  // filling of the 3D array of the ADC sample values
959  //
960  // ONLY if ret_code == kTRUE
961 
962  if( ret_code == kTRUE )
963  {
964  //............ 1) Conversion (Stin,i0StinEcha) -> i0StexEcha (same numbering for EB and EE)
965  //==========================================================================================
966  // n1StexStin (Tower or SC): 1 2 3
967  // iStexStin 0 1 2
968  //
969  // i0StinEcha: 0......24 0......24 0......24
970  //
971  // i0StexEcha : 0......24 25......49 50......74 grouped by StexStin's
972  // i0StexEcha+1 (Xtal): 1......25 26......50 51......75
973  //
974  //==========================================================================================
975 
976  Int_t i0StexEcha = i0StexStinEcna*fEcal->MaxCrysInStin() + i0StinEcha;
977 
978  //--------------------------------------------------------- (GetSampleAdcValues)
979  if( i0StexEcha >= 0 && i0StexEcha < fEcal->MaxCrysEcnaInStex() )
980  {
981  //............ 2) Increase of the nb of evts for (StexEcha,sample) (events found in the data)
982  (fT2d_NbOfEvts[i0StexEcha][i0Sample])++; // value after first incrementation = 1
983  fTagNbOfEvts[0] = 1;
985 
986  //............ 3) Filling of the 3D array of the ADC values
987  if ( i0EventIndex >= 0 && i0EventIndex < fFileHeader->fReqNbOfEvts )
988  {
989  if( i0Sample >= 0 && i0Sample < fNbSampForFic )
990  {
991  fT3d_AdcValues[i0StexEcha][i0Sample][i0EventIndex] = adcvalue;
992  }
993  else
994  {
995  cout << "!TEcnaRun::GetSampleAdcValues(...) *** ERROR ***> "
996  << " sample index = " << i0Sample << ". OUT OF BOUNDS"
997  << " (max = " << fNbSampForFic << ")"
998  << fTTBELL << endl;
999  }
1000  }
1001  else
1002  {
1003  cout << "!TEcnaRun::GetSampleAdcValues(...) *** ERROR ***> "
1004  << " event number = " << n1EventNumber << ". OUT OF BOUNDS"
1005  << " (max = " << fFileHeader->fReqNbOfEvts << ")"
1006  << fTTBELL << endl;
1007  ret_code = kFALSE;
1008  }
1009  }
1010  else
1011  {
1012  cout << "!TEcnaRun::GetSampleAdcValues(...) *** ERROR ***> "
1013  << " CHANNEL NUMBER OUT OF BOUNDS" << endl
1014  << " i0StexEcha number = " << i0StexEcha
1015  << " , n1StexStin = " << n1StexStin
1016  << " , i0StinEcha = " << i0StinEcha
1017  << " , fEcal->MaxCrysEcnaInStex() = " << fEcal->MaxCrysEcnaInStex()
1018  << fTTBELL << endl;
1019  ret_code = kFALSE;
1020  // {Int_t cintoto; cout << "TAPER 0 POUR CONTINUER" << endl; cin >> cintoto;}
1021  }
1022  } // end of if( ret_code == kTRUE )
1023  else
1024  {
1025  cout << "!TEcnaRun::GetSampleAdcValues(...) *** ERROR ***> ret_code = kFALSE "
1026  << fTTBELL << endl;
1027  }
1028  } // end of if(fReadyToReadData == 1)
1029  else
1030  {
1031  cout << "!TEcnaRun::GetSampleAdcValues(...) *** ERROR ***> GetReadyToReadData(...) not called."
1032  << fTTBELL << endl;
1033  ret_code = kFALSE;
1034  }
1035  //.................................................................. (GetSampleAdcValues)
1036  if (ret_code == kFALSE)
1037  {
1038  cout << "!TEcnaRun::GetSampleAdcValues(...)> *** ERROR ***> ret_code = " << ret_code
1039  << " (FALSE). Event: " << n1EventNumber
1040  << ", " << fStexName.Data() << ": " << fFileHeader->fStex
1041  << ", " << fStinName.Data() << ": " << n1StexStin
1042  << ", channel: " << i0StinEcha
1043  << ", Sample: " << i0Sample
1044  << ", ADC value: " << adcvalue << endl;
1045  }
1046  return ret_code;
1047 }
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t fBuildEvtNotSkipped
Definition: TEcnaRun.h:405
Int_t * fTagStinNumbers
Definition: TEcnaRun.h:424
Int_t fReadyToReadData
Definition: TEcnaRun.h:396
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString fStexName
Definition: TEcnaRun.h:393
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:55
Int_t fNbOfEvtsCalc
Definition: TEcnaHeader.h:67
Int_t fNbSampForFic
Definition: TEcnaRun.h:407
TString fFlagSubDet
Definition: TEcnaRun.h:392
Int_t fStinIndexBuilt
Definition: TEcnaRun.h:404
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Int_t * fTagNbOfEvts
Definition: TEcnaRun.h:421
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fSpecialStexStinNotIndexed
Definition: TEcnaRun.h:403
Int_t MaxCrysInStin()
Int_t MaxCrysEcnaInStex()
Int_t MaxSampADC()
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
Int_t ** fT2d_NbOfEvts
Definition: TEcnaRun.h:419
Int_t fStinNumbersCalc
Definition: TEcnaHeader.h:66
TString fStinName
Definition: TEcnaRun.h:393
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRun.h:423
TString fTTBELL
Definition: TEcnaRun.h:376
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::HighFrequencyCorrelationsBetweenChannels ( )

Definition at line 2637 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fFlagSubDet, TEcnaHeader::fHfCorCalc, fMiscDiag, TEcnaHeader::fStex, fT2d1_hf_cor, fT2d_hf_cor, fT2d_hf_cov, fTagHfCor, fTagHfCov, HighFrequencyCovariancesBetweenChannels(), TEcnaParEcal::MaxCrysEcnaInStex(), mathSSE::sqrt(), and TEcnaNumbering::StexEchaForCons().

Referenced by Expert1Calculations(), and HighFrequencyMeanCorrelationsBetweenStins().

2638 {
2639 //Calculation of the High Frequency Correlations between channels
2640 
2641  //... preliminary calculation of the covariances if not done yet.
2642  if ( fTagHfCov[0] != 1 )
2644 
2645  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::HighFrequencyCorrelationsBetweenChannels()" << endl;}
2647  cout << " Calculation of the High Frequency Correlations between channels" << endl
2648  << " Starting allocation. "
2649  << endl;}
2650 
2651  //................. allocation fT2d_hf_cor + init to zero (mandatory)
2652  if( fT2d_hf_cor == 0 ){
2653  const Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
2654  fT2d_hf_cor = new Double_t*[n_StexEcha]; fCnew++;
2655  fT2d1_hf_cor = new Double_t[n_StexEcha*n_StexEcha]; fCnew++;
2656  for(Int_t i0StexEcha = 0 ; i0StexEcha < n_StexEcha ; i0StexEcha++){
2657  fT2d_hf_cor[i0StexEcha] = &fT2d1_hf_cor[0] + i0StexEcha*n_StexEcha;}
2658  }
2659 
2660  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2661  {
2662  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
2663  {
2664  if( fT2d_hf_cor[i0StexEcha][j0StexEcha] != (Double_t)0 )
2665  {fMiscDiag[24]++; fT2d_hf_cor[i0StexEcha][j0StexEcha] = (Double_t)0;}
2666  }
2667  }
2668 
2669  //................. calculation
2670  //........................... computation of half of the matrix, diagonal included
2671 
2672  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2673  {
2674  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2675  || ( fFlagSubDet == "EB") )
2676  {
2677  for (Int_t j0StexEcha = 0 ; j0StexEcha <= i0StexEcha ; j0StexEcha++)
2678  {
2679  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, j0StexEcha) > 0)
2680  || ( fFlagSubDet == "EB") )
2681  {
2682  if( fT2d_hf_cov[i0StexEcha][i0StexEcha] > 0
2683  && fT2d_hf_cov[j0StexEcha][j0StexEcha] > 0 )
2684  {
2685  fT2d_hf_cor[i0StexEcha][j0StexEcha] =
2686  fT2d_hf_cov[i0StexEcha][j0StexEcha]/
2687  ( (Double_t)sqrt(fT2d_hf_cov[i0StexEcha][i0StexEcha]) *
2688  (Double_t)sqrt(fT2d_hf_cov[j0StexEcha][j0StexEcha]) );
2689  }
2690  else
2691  {
2692  fT2d_hf_cor[i0StexEcha][j0StexEcha] = (Double_t)0.;
2693  }
2694 
2695  fT2d_hf_cor[j0StexEcha][i0StexEcha] = fT2d_hf_cor[i0StexEcha][j0StexEcha];
2696  }
2697  }
2698  }
2699  if( i0StexEcha%100 == 0 ){cout << i0StexEcha << "[HFN Cor], ";}
2700  }
2701  cout << endl;
2702 
2703  fTagHfCor[0] = 1; fFileHeader->fHfCorCalc++;
2704 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fHfCorCalc
Definition: TEcnaHeader.h:79
Double_t ** fT2d_hf_cor
Definition: TEcnaRun.h:489
TString fFlagSubDet
Definition: TEcnaRun.h:392
Double_t ** fT2d_hf_cov
Definition: TEcnaRun.h:485
T sqrt(T t)
Definition: SSEVec.h:46
Int_t * fTagHfCor
Definition: TEcnaRun.h:491
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t StexEchaForCons(const Int_t &, const Int_t &)
Int_t fCnew
Definition: TEcnaRun.h:373
Double_t * fT2d1_hf_cor
Definition: TEcnaRun.h:490
Int_t * fTagHfCov
Definition: TEcnaRun.h:487
void HighFrequencyCovariancesBetweenChannels()
Definition: TEcnaRun.cc:2520
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::HighFrequencyCovariancesBetweenChannels ( )

Definition at line 2520 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fFlagSubDet, TEcnaHeader::fHfCovCalc, fMiscDiag, fNbSampForCalc, fNumberOfEvents, TEcnaHeader::fStex, fT2d1_hf_cov, fT2d_hf_cov, fT3d_AdcValues, fTagHfCov, TEcnaParEcal::MaxCrysEcnaInStex(), and TEcnaNumbering::StexEchaForCons().

Referenced by HighFrequencyCorrelationsBetweenChannels().

2521 {
2522 //Calculation of the High Frequency Covariances between channels
2523 
2524  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::HighFrequencyCovariancesBetweenChannels()" << endl;}
2526  cout << " Calculation of the High Frequency Covariances between channels" << endl;}
2527 
2528  //................. allocation fT2d_hf_cov + init to zero (mandatory)
2529  if( fT2d_hf_cov == 0 ){
2530  const Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
2531  fT2d_hf_cov = new Double_t*[n_StexEcha]; fCnew++;
2532  fT2d1_hf_cov = new Double_t[n_StexEcha*n_StexEcha]; fCnew++;
2533  for(Int_t i0StexEcha = 0 ; i0StexEcha < n_StexEcha ; i0StexEcha++){
2534  fT2d_hf_cov[i0StexEcha] = &fT2d1_hf_cov[0] + i0StexEcha*n_StexEcha;}
2535  }
2536 
2537  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2538  {
2539  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
2540  {
2541  if( fT2d_hf_cov[i0StexEcha][j0StexEcha] != (Double_t)0 )
2542  {fMiscDiag[23]++; fT2d_hf_cov[i0StexEcha][j0StexEcha] = (Double_t)0;}
2543  }
2544  }
2545 
2546  //................... Allocation mean_over_samples(i0StexEcha, n_event)
2547  TMatrixD mean_over_samples(fEcal->MaxCrysEcnaInStex(), fNumberOfEvents);
2548  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2549  {for(Int_t n_event=0; n_event<fNumberOfEvents; n_event++)
2550  {mean_over_samples(i0StexEcha, n_event)=(Double_t)0.;}}
2551  //................... Allocation cov_over_samp(i0StexEcha,j0StexEcha)
2552  TMatrixD cov_over_samp(fEcal->MaxCrysEcnaInStex(), fEcal->MaxCrysEcnaInStex());
2553  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2554  {for(Int_t j0StexEcha=0; j0StexEcha<fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
2555  {cov_over_samp(i0StexEcha, j0StexEcha)=(Double_t)0.;}}
2556 
2557  //........................................... Calculation (HighFrequencyCovariancesBetweenChannels)
2559  cout << " Calculation of the mean (over the events)" << endl
2560  << " of the covariances between the channels (over the samples 1 to "
2561  << fNbSampForCalc << ")." << endl;}
2562 
2563  cout << " Please, wait (end at i= " << fEcal->MaxCrysEcnaInStex() << "): " << endl;
2564 
2565  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2566  {
2567  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2568  || ( fFlagSubDet == "EB") )
2569  {
2570  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
2571  {
2572  // Calculation, for each event, of the mean over the samples ( = E_s[A(c_i,s*,e_n] )
2573  mean_over_samples(i0StexEcha, n_event) = (Double_t)0.;
2574  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
2575  {mean_over_samples(i0StexEcha, n_event) += fT3d_AdcValues[i0StexEcha][i0Sample][n_event];}
2576  mean_over_samples(i0StexEcha, n_event) /= (Double_t)fNbSampForCalc;
2577  }
2578  }
2579  if( i0StexEcha%100 == 0 ){cout << i0StexEcha << "[HFNa Cov], ";}
2580  }
2581  cout << endl;
2582 
2583  cout << " Please, wait (end at i= " << fEcal->MaxCrysEcnaInStex() << "): " << endl;
2584 
2585  //... Calculation of half of the matrix, diagonal included (HighFrequencyCovariancesBetweenChannels)
2586  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2587  {
2588  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2589  || ( fFlagSubDet == "EB") )
2590  {
2591  for(Int_t j0StexEcha = 0; j0StexEcha <= i0StexEcha; j0StexEcha++)
2592  {
2593  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, j0StexEcha) > 0)
2594  || ( fFlagSubDet == "EB") )
2595  {
2596  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
2597  {
2598  // Calculation, for each event, of the covariance over the samples
2599  cov_over_samp(i0StexEcha,j0StexEcha) = (Double_t)0;
2600  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
2601  {
2602  cov_over_samp(i0StexEcha,j0StexEcha) +=
2603  ( fT3d_AdcValues[i0StexEcha][i0Sample][n_event] - mean_over_samples(i0StexEcha, n_event) )*
2604  ( fT3d_AdcValues[j0StexEcha][i0Sample][n_event] - mean_over_samples(j0StexEcha, n_event) );
2605  }
2606  cov_over_samp(i0StexEcha,j0StexEcha) /= (Double_t)fNbSampForCalc;
2607 
2608  }
2609  //....... Calculation of the mean over the events of Cov_s[A(c_i,s*,e*),A(c_j,s*,e*)]
2610  //......... Calculation of half of the matrix, diagonal included
2611  fT2d_hf_cov[i0StexEcha][j0StexEcha] = (Double_t)0;
2612  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
2613  {
2614  fT2d_hf_cov[i0StexEcha][j0StexEcha] += cov_over_samp(i0StexEcha,j0StexEcha);
2615  }
2616  fT2d_hf_cov[i0StexEcha][j0StexEcha] /= (Double_t)fNumberOfEvents;
2617 
2618  fT2d_hf_cov[j0StexEcha][i0StexEcha] = fT2d_hf_cov[i0StexEcha][j0StexEcha];
2619  }
2620  }
2621  }
2622  if( i0StexEcha%100 == 0 ){cout << i0StexEcha << "[HFNb Cov], ";}
2623  }
2624  cout << endl;
2625 
2626  fTagHfCov[0] = 1; fFileHeader->fHfCovCalc++;
2627 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fHfCovCalc
Definition: TEcnaHeader.h:78
TString fFlagSubDet
Definition: TEcnaRun.h:392
Double_t ** fT2d_hf_cov
Definition: TEcnaRun.h:485
Double_t * fT2d1_hf_cov
Definition: TEcnaRun.h:486
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fNumberOfEvents
Definition: TEcnaRun.h:410
Int_t StexEchaForCons(const Int_t &, const Int_t &)
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t * fTagHfCov
Definition: TEcnaRun.h:487
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::HighFrequencyMeanCorrelationsBetweenSCs ( )

Definition at line 2818 of file TEcnaRun.cc.

References HighFrequencyMeanCorrelationsBetweenStins().

void HighFrequencyMeanCorrelationsBetweenStins()
Definition: TEcnaRun.cc:2821
void TEcnaRun::HighFrequencyMeanCorrelationsBetweenStins ( )

Definition at line 2821 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, fFlagSubDet, TEcnaHeader::fHFccMoStinsCalc, fMiscDiag, fT2d1_hfcc_mostins, fT2d_hf_cor, fT2d_hfcc_mostins, fTagHFccMoStins, fTagHfCor, fTTBELL, HighFrequencyCorrelationsBetweenChannels(), i, TEcnaParEcal::MaxCrysInStin(), and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by Expert2Calculations(), HighFrequencyMeanCorrelationsBetweenSCs(), and HighFrequencyMeanCorrelationsBetweenTowers().

2822 {
2823 //Calculation of the mean High Frequency Correlations
2824 //between channels for each Stin
2825 
2826  //... preliminary calculation of the High Frequency Cor(c,c) if not done yet
2827  // Only one tag (dim=1) to set to 0 (no write in the result ROOT file)
2829 
2830  //..... mean fT2d_hfcc_mostins for each pair (Stin_X,Stin_Y)
2831  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::HighFrequencyMeanCorrelationsBetweenStins()" << endl;}
2833  cout << " Calculation of the mean, for each "
2834  << fFlagSubDet.Data() << ", of the" << endl
2835  << " High Frequency Correlations between channels." << endl;}
2836 
2837  //................. allocation fT2d_hfcc_mostins + init to zero (mandatory)
2838  if( fT2d_hfcc_mostins == 0 ){
2839  const Int_t n_Stin = fEcal->MaxStinEcnaInStex();
2840  fT2d_hfcc_mostins = new Double_t*[n_Stin]; fCnew++;
2841  fT2d1_hfcc_mostins = new Double_t[n_Stin*n_Stin]; fCnew++;
2842  for(Int_t i0StexStinEcna = 0 ; i0StexStinEcna < n_Stin ; i0StexStinEcna++){
2843  fT2d_hfcc_mostins[i0StexStinEcna] = &fT2d1_hfcc_mostins[0] + i0StexStinEcna*n_Stin;}
2844  }
2845 
2846  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2847  {
2848  for(Int_t j0StexStinEcna=0; j0StexStinEcna<fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
2849  {
2850  if( fT2d_hfcc_mostins[i0StexStinEcna][j0StexStinEcna] != (Double_t)0 )
2851  {fMiscDiag[32]++; fT2d_hfcc_mostins[i0StexStinEcna][j0StexStinEcna] = (Double_t)0;}
2852  }
2853  }
2854 
2855  //..... Calculation of the mean HF Cor(c,c) for each pair (Stin_X,Stin_Y)
2856  //
2857  // ! => Warning: this matrix is NOT symmetric => take N*N elements
2858  // Only (Stin,Stin) matrix is symmetric.
2859  // (StinEcha,StinEcha) matrix inside a (Stin,Stin) element is NOT symmetric
2860  // (except for the (Stin,Stin) DIAGONAL elements)
2861  // Then:
2862  // 1D array half_LFccMos[N*N] to put the (channel,channel) correlations
2863 
2864  Int_t ndim = (Int_t)(fEcal->MaxCrysInStin()*fEcal->MaxCrysInStin());
2865 
2866  TVectorD half_HFccMos(ndim); for(Int_t i=0; i<ndim; i++){half_HFccMos(i)=(Double_t)0.;}
2867 
2868  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::HighFrequencyMeanCorrelationsBetweenStins()" << endl;}
2870  cout << " Calculation, for each "
2871  << fFlagSubDet.Data() << ", of the mean " << endl
2872  << " High Frequency cor(c,c)." << endl;}
2873 
2874  //..................... Calculation
2875  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2876  {
2877  for(Int_t j0StexStinEcna=0; j0StexStinEcna<fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
2878  {
2879  //.................... Copy the relevant Mean Correlations(c,c') in 1D vector half_HFccMos()
2880  Int_t i_count = 0;
2881  for(Int_t i0StinCrys=0; i0StinCrys<fEcal->MaxCrysInStin(); i0StinCrys++)
2882  {
2883  Int_t i0StexEcha = i0StexStinEcna*fEcal->MaxCrysInStin() + i0StinCrys;
2884  for(Int_t j0StinCrys=0; j0StinCrys<fEcal->MaxCrysInStin(); j0StinCrys++)
2885  {
2886  Int_t j0StexEcha = j0StexStinEcna*fEcal->MaxCrysInStin() + j0StinCrys;
2887  if( (i0StexEcha>= 0 && i0StexEcha < fEcal->MaxCrysEcnaInStex()) &&
2888  (j0StexEcha>= 0 && j0StexEcha < fEcal->MaxCrysEcnaInStex()) )
2889  {half_HFccMos(i_count) = fT2d_hf_cor[i0StexEcha][j0StexEcha]; i_count++;}
2890  else
2891  {cout << "!TEcnaRun::HighFrequencyMeanCorrelationsBetweenStins()> Channel number out of range."
2892  << "i0StexEcha = " << i0StexEcha <<", j0StexEcha = " << j0StexEcha << fTTBELL << endl; }
2893  }
2894  }
2895  //..... Calculation of the mean absolute values of the HF mean Correlations(c,c')
2896  fT2d_hfcc_mostins[i0StexStinEcna][j0StexStinEcna] = (Double_t)0;
2897  for(Int_t i_rcor = 0; i_rcor < ndim; i_rcor++)
2898  {
2899  fT2d_hfcc_mostins[i0StexStinEcna][j0StexStinEcna] += fabs(half_HFccMos(i_rcor));
2900  }
2901  fT2d_hfcc_mostins[i0StexStinEcna][j0StexStinEcna] /= (Double_t)ndim;
2902  }
2903  if( i0StexStinEcna%10 == 0 ){cout << i0StexStinEcna << "[HFN MCtt], ";}
2904  }
2905  cout << endl;
2906 
2908 } // ------- end of HighFrequencyMeanCorrelationsBetweenStins() -------
int i
Definition: DBlmapReader.cc:9
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fHFccMoStinsCalc
Definition: TEcnaHeader.h:83
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Double_t ** fT2d_hfcc_mostins
Definition: TEcnaRun.h:498
Double_t ** fT2d_hf_cor
Definition: TEcnaRun.h:489
TString fFlagSubDet
Definition: TEcnaRun.h:392
Int_t * fTagHfCor
Definition: TEcnaRun.h:491
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t * fTagHFccMoStins
Definition: TEcnaRun.h:500
Double_t * fT2d1_hfcc_mostins
Definition: TEcnaRun.h:499
void HighFrequencyCorrelationsBetweenChannels()
Definition: TEcnaRun.cc:2637
Int_t MaxCrysInStin()
Int_t fCnew
Definition: TEcnaRun.h:373
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
TString fTTBELL
Definition: TEcnaRun.h:376
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::HighFrequencyMeanCorrelationsBetweenTowers ( )

Definition at line 2816 of file TEcnaRun.cc.

References HighFrequencyMeanCorrelationsBetweenStins().

void HighFrequencyMeanCorrelationsBetweenStins()
Definition: TEcnaRun.cc:2821
void TEcnaRun::HighFrequencyNoise ( )

Definition at line 1748 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, TEcnaHeader::fHfnCalc, fMiscDiag, fNbSampForCalc, fNumberOfEvents, fT1d_evevt_of_sigsamp, fT3d_AdcValues, fTagHfn, fTTBELL, i, TEcnaParEcal::MaxCrysEcnaInStex(), and mathSSE::sqrt().

Referenced by AverageHighFrequencyNoise(), and StandardCalculations().

1749 {
1750 // Calculation, for each channel, of the mean (over the events)
1751 // of the ADC sigmas (over the samples 0 to fNbSampForCalc-1)
1752 
1753  //................... Allocation fT1d_evevt_of_sigsamp + init to zero (mandatory)
1754  if( fT1d_evevt_of_sigsamp == 0 ){
1755  fT1d_evevt_of_sigsamp = new Double_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
1756  }
1757  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1758  {
1759  if( fT1d_evevt_of_sigsamp[i0StexEcha] != (Double_t)0 )
1760  {fMiscDiag[14]++; fT1d_evevt_of_sigsamp[i0StexEcha] = (Double_t)0;}
1761  }
1762 
1763  //................... Allocations mean_over_samples, sigma_over_sample
1764  TVectorD mean_over_samples(fNumberOfEvents);
1765  for(Int_t i=0; i<fNumberOfEvents; i++){mean_over_samples(i)=(Double_t)0.;}
1766  TVectorD sigma_over_samples(fNumberOfEvents);
1767  for(Int_t i=0; i<fNumberOfEvents; i++){sigma_over_samples(i)=(Double_t)0.;}
1768 
1769  //..................... Calculation
1770  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::HighFrequencyNoise()" << endl;}
1772  cout << " Calculation, for each channel, of the sigma (over the events)" << endl
1773  << " of the ADC expectation values (over the samples 1 to "
1774  << fNbSampForCalc << ")." << endl;}
1775 
1776  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1777  {
1778  //..................... Calculation of the sigma over samples
1779  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
1780  {
1781  // Calculation, for each event, of the mean over the samples
1782  mean_over_samples(n_event) = (Double_t)0.;
1783  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
1784  {mean_over_samples(n_event) += fT3d_AdcValues[i0StexEcha][i0Sample][n_event];}
1785  mean_over_samples(n_event) /= (Double_t)fNbSampForCalc;
1786 
1787  // Calculation, for each event, of the sigma over the samples
1788  Double_t var_over_samples = (Double_t)0;
1789  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
1790  {Double_t deviation = fT3d_AdcValues[i0StexEcha][i0Sample][n_event] - mean_over_samples(n_event);
1791  var_over_samples += deviation*deviation;}
1792  var_over_samples /= (Double_t)fNbSampForCalc;
1793 
1794  if( var_over_samples < 0)
1795  {cout << "!TEcnaRun::HighFrequencyNoise() *** ERROR ***> Negative variance! " << fTTBELL << endl;}
1796  else
1797  {sigma_over_samples(n_event) = sqrt(var_over_samples);}
1798  }
1799 
1800  //....... Calculation of the mean over the events of the sigma over samples
1801  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
1802  {fT1d_evevt_of_sigsamp[i0StexEcha] += sigma_over_samples(n_event);}
1803 
1804  fT1d_evevt_of_sigsamp[i0StexEcha] /= (Double_t)fNumberOfEvents;
1805  }
1806  fTagHfn[0] = 1; fFileHeader->fHfnCalc++;
1807 }
int i
Definition: DBlmapReader.cc:9
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
Int_t fHfnCalc
Definition: TEcnaHeader.h:88
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t * fTagHfn
Definition: TEcnaRun.h:466
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
T sqrt(T t)
Definition: SSEVec.h:46
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fNumberOfEvents
Definition: TEcnaRun.h:410
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
TString fTTBELL
Definition: TEcnaRun.h:376
Double_t * fT1d_evevt_of_sigsamp
Definition: TEcnaRun.h:465
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::Init ( void  )

Definition at line 135 of file TEcnaRun.cc.

References fBuildEvtNotSkipped, fCdelete, fCnaCommand, fCnaError, fCnaParCout, fCnew, fCodePrintAllComments, fCodePrintComments, fCodePrintNoComment, fCodePrintWarnings, fFlagPrint, fgMaxCar, fMaxMsgIndexForMiscDiag, fMemoReadNumberOfEventsforSamples, fMiscDiag, fNbOfMiscDiagCounters, fNumberOfEvents, fOpenRootFile, fReadyToReadData, fSpecialStexStinNotIndexed, fStinIndexBuilt, fT1d_av_ev_corss, fT1d_av_hifn, fT1d_av_lofn, fT1d_av_mped, fT1d_av_sig_corss, fT1d_av_totn, fT1d_ev, fT1d_ev_cor_ss, fT1d_ev_ev, fT1d_evevt_of_sigsamp, fT1d_evsamp_of_sigevt, fT1d_NbOfEvts, fT1d_sig, fT1d_sig_cor_ss, fT1d_sigevt_of_evsamp, fT1d_StexStinFromIndex, fT1dCrysNumbersTable, fT2d1_hf_cor, fT2d1_hf_cov, fT2d1_hfcc_mostins, fT2d1_lf_cor, fT2d1_lf_cov, fT2d1_lfcc_mostins, fT2d_ev, fT2d_hf_cor, fT2d_hf_cov, fT2d_hfcc_mostins, fT2d_lf_cor, fT2d_lf_cov, fT2d_lfcc_mostins, fT2d_NbOfEvts, fT2d_sig, fT2dCrysNumbersTable, fT3d1_AdcValues, fT3d1_cor_ss, fT3d1_cov_ss, fT3d2_AdcValues, fT3d2_cor_ss, fT3d2_cov_ss, fT3d_AdcValues, fT3d_cor_ss, fT3d_cov_ss, fTagAdcEvt, fTagAvHfn, fTagAvLfn, fTagAvMeanCorss, fTagAvPed, fTagAvSigCorss, fTagAvTno, fTagCorCss, fTagCovCss, fTagHFccMoStins, fTagHfCor, fTagHfCov, fTagHfn, fTagLFccMoStins, fTagLfCor, fTagLfCov, fTagLfn, fTagMeanCorss, fTagMSp, fTagNbOfEvts, fTagPed, fTagSigCorss, fTagSSp, fTagStinNumbers, fTagTno, fTTBELL, gCnaRootFile, and TEcnaParCout::GetCodePrint().

Referenced by TEcnaRun().

136 {
137 //Initialisation
138 
139  fCnew = 0;
140  fCdelete = 0;
141  fCnaCommand = 0;
142  fCnaError = 0;
143 
144  fTTBELL = '\007';
145 
146  //........................... TString file names init
147  fgMaxCar = (Int_t)512;
148 
149  //................ MiscDiag counters .................
150  fMaxMsgIndexForMiscDiag = (Int_t)10;
151  fNbOfMiscDiagCounters = (Int_t)50;
152  fMiscDiag = 0;
153 
154  fNumberOfEvents = 0;
155  //............................. init pointers ( Init() )
156  fT3d_AdcValues = 0;
157  fT3d2_AdcValues = 0;
158  fT3d1_AdcValues = 0;
159 
161 
162  fT2d_NbOfEvts = 0;
163  fT1d_NbOfEvts = 0;
164 
165  fT2d_ev = 0;
166  fT1d_ev = 0;
167  fT2d_sig = 0;
168  fT1d_sig = 0;
169 
170  fT3d_cov_ss = 0;
171  fT3d2_cov_ss = 0;
172  fT3d1_cov_ss = 0;
173 
174  fT3d_cor_ss = 0;
175  fT3d2_cor_ss = 0;
176  fT3d1_cor_ss = 0;
177 
178  fT2d_lf_cov = 0;
179  fT2d1_lf_cov = 0;
180 
181  fT2d_lf_cor = 0;
182  fT2d1_lf_cor = 0;
183 
184  fT2d_hf_cov = 0;
185  fT2d1_hf_cov = 0;
186 
187  fT2d_hf_cor = 0;
188  fT2d1_hf_cor = 0;
189 
190  fT2d_lfcc_mostins = 0;
191  fT2d1_lfcc_mostins = 0;
192 
193  fT2d_hfcc_mostins = 0;
194  fT2d1_hfcc_mostins = 0;
195 
196  fT1d_ev_ev = 0;
198  fT1d_ev_cor_ss = 0;
199  fT1d_av_mped = 0;
200  fT1d_av_totn = 0;
201  fT1d_av_lofn = 0;
202  fT1d_av_hifn = 0;
203  fT1d_av_ev_corss = 0;
204  fT1d_av_sig_corss = 0;
205 
208  fT1d_sig_cor_ss = 0;
209 
212 
213  //................................ tags ( Init() )
214  fTagStinNumbers = 0;
215 
216  fTagNbOfEvts = 0;
217 
218  fTagAdcEvt = 0;
219 
220  fTagMSp = 0;
221  fTagSSp = 0;
222 
223  fTagCovCss = 0;
224  fTagCorCss = 0;
225 
226  fTagHfCov = 0;
227  fTagHfCor = 0;
228  fTagLfCov = 0;
229  fTagLfCor = 0;
230 
231  fTagLFccMoStins = 0;
232  fTagHFccMoStins = 0;
233 
234  fTagPed = 0;
235  fTagTno = 0;
236  fTagMeanCorss = 0;
237 
238  fTagLfn = 0;
239  fTagHfn = 0;
240  fTagSigCorss = 0;
241 
242  fTagAvPed = 0;
243  fTagAvTno = 0;
244  fTagAvLfn = 0;
245  fTagAvHfn = 0;
246 
247  fTagAvMeanCorss = 0;
248  fTagAvSigCorss = 0;
249 
250  //................................................... Code Print ( Init() )
252  fCodePrintWarnings = fCnaParCout->GetCodePrint("Warnings "); // => default value
255 
257 
258  //...................................................
259  gCnaRootFile = 0;
260  fOpenRootFile = kFALSE;
261  fReadyToReadData = 0;
262 
263  //.............................................. Miscellaneous
265 
266  fStinIndexBuilt = 0;
268 
270 
271 }// end of Init()
Double_t * fT1d_av_sig_corss
Definition: TEcnaRun.h:472
Double_t * fT1d_av_mped
Definition: TEcnaRun.h:447
Double_t * fT3d1_cor_ss
Definition: TEcnaRun.h:441
Int_t * fTagCorCss
Definition: TEcnaRun.h:442
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t * fTagLFccMoStins
Definition: TEcnaRun.h:496
Double_t * fT1d_sigevt_of_evsamp
Definition: TEcnaRun.h:460
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fBuildEvtNotSkipped
Definition: TEcnaRun.h:405
Bool_t fOpenRootFile
Definition: TEcnaRun.h:395
Int_t * fTagStinNumbers
Definition: TEcnaRun.h:424
Int_t fCdelete
Definition: TEcnaRun.h:374
Int_t * fTagLfCor
Definition: TEcnaRun.h:482
Int_t fReadyToReadData
Definition: TEcnaRun.h:396
TEcnaParCout * fCnaParCout
Definition: TEcnaRun.h:386
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
Double_t * fT1d_sig_cor_ss
Definition: TEcnaRun.h:470
Int_t * fTagCovCss
Definition: TEcnaRun.h:437
Double_t * fT2d1_lf_cov
Definition: TEcnaRun.h:477
Int_t * fTagPed
Definition: TEcnaRun.h:446
Int_t * fT1dCrysNumbersTable
Definition: TEcnaRun.h:505
Double_t * fT1d_av_ev_corss
Definition: TEcnaRun.h:457
Double_t ** fT2d_hfcc_mostins
Definition: TEcnaRun.h:498
Int_t * fTagAvTno
Definition: TEcnaRun.h:453
Double_t * fT3d1_AdcValues
Definition: TEcnaRun.h:416
Int_t * fTagHfn
Definition: TEcnaRun.h:466
Double_t *** fT3d_cor_ss
Definition: TEcnaRun.h:439
Double_t * fT1d_av_totn
Definition: TEcnaRun.h:452
Double_t * fT2d1_lf_cor
Definition: TEcnaRun.h:481
Double_t ** fT2d_sig
Definition: TEcnaRun.h:430
Int_t * fTagSSp
Definition: TEcnaRun.h:432
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Double_t ** fT2d_ev
Definition: TEcnaRun.h:426
Double_t ** fT2d_hf_cor
Definition: TEcnaRun.h:489
Double_t * fT1d_ev_ev
Definition: TEcnaRun.h:445
Double_t ** fT3d2_cov_ss
Definition: TEcnaRun.h:435
Int_t fCnaError
Definition: TEcnaRun.h:371
Int_t * fTagTno
Definition: TEcnaRun.h:451
Double_t ** fT3d2_cor_ss
Definition: TEcnaRun.h:440
Double_t * fT1d_av_hifn
Definition: TEcnaRun.h:467
Int_t GetCodePrint(const TString)
Definition: TEcnaParCout.cc:70
Double_t ** fT2d_hf_cov
Definition: TEcnaRun.h:485
Double_t * fT3d1_cov_ss
Definition: TEcnaRun.h:436
Int_t * fTagAvLfn
Definition: TEcnaRun.h:463
Int_t * fT1d_NbOfEvts
Definition: TEcnaRun.h:420
Int_t fStinIndexBuilt
Definition: TEcnaRun.h:404
Int_t * fTagLfn
Definition: TEcnaRun.h:461
Double_t * fT2d1_hf_cov
Definition: TEcnaRun.h:486
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Int_t fCodePrintComments
Definition: TEcnaRun.h:510
Double_t *** fT3d_cov_ss
Definition: TEcnaRun.h:434
Int_t * fTagAvSigCorss
Definition: TEcnaRun.h:473
Int_t * fTagHfCor
Definition: TEcnaRun.h:491
Int_t * fTagNbOfEvts
Definition: TEcnaRun.h:421
Int_t * fTagAvPed
Definition: TEcnaRun.h:448
Int_t fMemoReadNumberOfEventsforSamples
Definition: TEcnaRun.h:412
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fMaxMsgIndexForMiscDiag
Definition: TEcnaRun.h:380
Int_t * fTagHFccMoStins
Definition: TEcnaRun.h:500
Int_t fNumberOfEvents
Definition: TEcnaRun.h:410
Double_t * fT2d1_hfcc_mostins
Definition: TEcnaRun.h:499
Int_t fSpecialStexStinNotIndexed
Definition: TEcnaRun.h:403
Int_t * fTagAvMeanCorss
Definition: TEcnaRun.h:458
Double_t ** fT2d_lf_cor
Definition: TEcnaRun.h:480
Int_t * fTagLfCov
Definition: TEcnaRun.h:478
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t fCodePrintWarnings
Definition: TEcnaRun.h:510
Double_t * fT2d1_hf_cor
Definition: TEcnaRun.h:490
Double_t * fT1d_evsamp_of_sigevt
Definition: TEcnaRun.h:450
Int_t * fTagHfCov
Definition: TEcnaRun.h:487
Int_t * fTagAvHfn
Definition: TEcnaRun.h:468
Int_t * fTagSigCorss
Definition: TEcnaRun.h:471
Double_t * fT2d1_lfcc_mostins
Definition: TEcnaRun.h:495
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Double_t * fT1d_ev
Definition: TEcnaRun.h:427
Int_t * fTagAdcEvt
Definition: TEcnaRun.h:417
Int_t fgMaxCar
Definition: TEcnaRun.h:369
Double_t ** fT3d2_AdcValues
Definition: TEcnaRun.h:415
Double_t ** fT2d_lf_cov
Definition: TEcnaRun.h:476
Int_t ** fT2d_NbOfEvts
Definition: TEcnaRun.h:419
Double_t * fT1d_av_lofn
Definition: TEcnaRun.h:462
Int_t fCnaCommand
Definition: TEcnaRun.h:371
Int_t ** fT2dCrysNumbersTable
Definition: TEcnaRun.h:504
Int_t fNbOfMiscDiagCounters
Definition: TEcnaRun.h:379
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRun.h:423
TString fTTBELL
Definition: TEcnaRun.h:376
Double_t * fT1d_evevt_of_sigsamp
Definition: TEcnaRun.h:465
Int_t * fTagMeanCorss
Definition: TEcnaRun.h:456
Double_t * fT1d_sig
Definition: TEcnaRun.h:431
Double_t * fT1d_ev_cor_ss
Definition: TEcnaRun.h:455
Double_t ** fT2d_lfcc_mostins
Definition: TEcnaRun.h:494
void TEcnaRun::LowFrequencyCorrelationsBetweenChannels ( )

Definition at line 2437 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fFlagSubDet, TEcnaHeader::fLfCorCalc, fMiscDiag, TEcnaHeader::fStex, fT2d1_lf_cor, fT2d_lf_cor, fT2d_lf_cov, fTagLfCor, fTagLfCov, LowFrequencyCovariancesBetweenChannels(), TEcnaParEcal::MaxCrysEcnaInStex(), mathSSE::sqrt(), and TEcnaNumbering::StexEchaForCons().

Referenced by Expert1Calculations(), and LowFrequencyMeanCorrelationsBetweenStins().

2438 {
2439 //Calculation of the Low Frequency Correlations between channels
2440 
2441  //... preliminary calculation of the covariances if not done yet.
2442  if ( fTagLfCov[0] != 1 )
2444 
2445  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::LowFrequencyCorrelationsBetweenChannels()" << endl;}
2447  cout << " Calculation of the Low Frequency Correlations between channels" << endl
2448  << " Starting allocation. "
2449  << endl;}
2450 
2451  //................. allocation fT2d_lf_cor + init to zero (mandatory)
2452  if( fT2d_lf_cor == 0 ){
2453  const Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
2454  fT2d_lf_cor = new Double_t*[n_StexEcha]; fCnew++;
2455  fT2d1_lf_cor = new Double_t[n_StexEcha*n_StexEcha]; fCnew++;
2456  for(Int_t i0StexEcha = 0 ; i0StexEcha < n_StexEcha ; i0StexEcha++){
2457  fT2d_lf_cor[i0StexEcha] = &fT2d1_lf_cor[0] + i0StexEcha*n_StexEcha;}
2458  }
2459 
2460  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2461  {
2462  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
2463  {
2464  if( fT2d_lf_cor[i0StexEcha][j0StexEcha] != (Double_t)0 )
2465  {fMiscDiag[22]++; fT2d_lf_cor[i0StexEcha][j0StexEcha] = (Double_t)0;}
2466  }
2467  }
2468 
2469  //................. calculation
2470  //........................... computation of half of the matrix, diagonal included
2471  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2472  {
2473  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2474  || ( fFlagSubDet == "EB") )
2475  {
2476  for (Int_t j0StexEcha = 0 ; j0StexEcha <= i0StexEcha ; j0StexEcha++)
2477  {
2478  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, j0StexEcha) > 0)
2479  || ( fFlagSubDet == "EB") )
2480  {
2481  if( fT2d_lf_cov[i0StexEcha][i0StexEcha] > 0
2482  && fT2d_lf_cov[j0StexEcha][j0StexEcha] > 0 )
2483  {
2484  fT2d_lf_cor[i0StexEcha][j0StexEcha] =
2485  fT2d_lf_cov[i0StexEcha][j0StexEcha]/
2486  ( (Double_t)sqrt( fT2d_lf_cov[i0StexEcha][i0StexEcha]*
2487  fT2d_lf_cov[j0StexEcha][j0StexEcha] ) );
2488  }
2489  else
2490  {
2491  fT2d_lf_cor[i0StexEcha][j0StexEcha] = (Double_t)0.;
2492  }
2493  fT2d_lf_cor[j0StexEcha][i0StexEcha] = fT2d_lf_cor[i0StexEcha][j0StexEcha];
2494  }
2495  }
2496  }
2497  if( i0StexEcha%100 == 0 ){cout << i0StexEcha << "[LFN Cor], ";}
2498  }
2499  cout << endl;
2500 
2501  fTagLfCor[0] = 1; fFileHeader->fLfCorCalc++;
2502 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t * fTagLfCor
Definition: TEcnaRun.h:482
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Double_t * fT2d1_lf_cor
Definition: TEcnaRun.h:481
TString fFlagSubDet
Definition: TEcnaRun.h:392
T sqrt(T t)
Definition: SSEVec.h:46
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t StexEchaForCons(const Int_t &, const Int_t &)
Double_t ** fT2d_lf_cor
Definition: TEcnaRun.h:480
Int_t * fTagLfCov
Definition: TEcnaRun.h:478
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t fLfCorCalc
Definition: TEcnaHeader.h:81
Int_t MaxCrysEcnaInStex()
void LowFrequencyCovariancesBetweenChannels()
Definition: TEcnaRun.cc:2332
tuple cout
Definition: gather_cfg.py:121
Double_t ** fT2d_lf_cov
Definition: TEcnaRun.h:476
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::LowFrequencyCovariancesBetweenChannels ( )

Definition at line 2332 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fEcalNumbering, fFileHeader, fFlagPrint, fFlagSubDet, TEcnaHeader::fLfCovCalc, fMiscDiag, fNbSampForCalc, fNumberOfEvents, TEcnaHeader::fStex, fT2d1_lf_cov, fT2d_lf_cov, fT3d_AdcValues, fTagLfCov, TEcnaParEcal::MaxCrysEcnaInStex(), and TEcnaNumbering::StexEchaForCons().

Referenced by LowFrequencyCorrelationsBetweenChannels().

2333 {
2334 //Calculation of the Low Frequency Covariances between channels
2335 
2336  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::LowFrequencyCovariancesBetweenChannels()" << endl;}
2338  cout << " Calculation of the Low Frequency Covariances between channels" << endl;}
2339 
2340  //................. allocation fT2d_lf_cov + init to zero (mandatory)
2341  if( fT2d_lf_cov == 0 ){
2342  const Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
2343  fT2d_lf_cov = new Double_t*[n_StexEcha]; fCnew++;
2344  fT2d1_lf_cov = new Double_t[n_StexEcha*n_StexEcha]; fCnew++;
2345  for(Int_t i0StexEcha = 0 ; i0StexEcha < n_StexEcha ; i0StexEcha++){
2346  fT2d_lf_cov[i0StexEcha] = &fT2d1_lf_cov[0] + i0StexEcha*n_StexEcha;}}
2347 
2348  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2349  {
2350  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
2351  {
2352  if( fT2d_lf_cov[i0StexEcha][j0StexEcha] != (Double_t)0 )
2353  {fMiscDiag[21]++; fT2d_lf_cov[i0StexEcha][j0StexEcha] = (Double_t)0;}
2354  }
2355  }
2356  //........................................... Calculation (LowFrequencyCovariancesBetweenChannels)
2357  //................... Allocation mean_over_samples(i0StexEcha, n_event)
2358  TMatrixD mean_over_samples(fEcal->MaxCrysEcnaInStex(), fNumberOfEvents);
2359  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2360  {for(Int_t n_event=0; n_event<fNumberOfEvents; n_event++)
2361  {mean_over_samples(i0StexEcha, n_event)=(Double_t)0.;}}
2362  //................... Allocation MoeOfMos(i0StexEcha)
2363  TVectorD MoeOfMos(fEcal->MaxCrysEcnaInStex());
2364  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2365  { MoeOfMos(i0StexEcha)=(Double_t)0.;}
2366 
2367  //................... Calculation
2369  cout << " Calculation, for each pair of channels, of the covariance (over the events)" << endl
2370  << " between the ADC expectation values (over the samples 1 to "
2371  << fNbSampForCalc << ")." << endl;}
2372 
2373  cout << " Please, wait (end at i= " << fEcal->MaxCrysEcnaInStex() << "): " << endl;
2374 
2375  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2376  {
2377  MoeOfMos(i0StexEcha) = (Double_t)0;
2378 
2379  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2380  || ( fFlagSubDet == "EB") )
2381  {
2382  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
2383  {
2384  // Calculation, for each event, of the mean over the samples ( = E_s[A(c_i,s*,e_n] )
2385  mean_over_samples(i0StexEcha, n_event) = (Double_t)0.;
2386  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
2387  {
2388  mean_over_samples(i0StexEcha, n_event) += fT3d_AdcValues[i0StexEcha][i0Sample][n_event];
2389  }
2390  mean_over_samples(i0StexEcha, n_event) /= (Double_t)fNbSampForCalc;
2391  }
2392  //Calculation of the mean over the events of E_s[A(c_i,s*,e_n] ( = E_e[E_s[A(c_i,s*,e*]] )
2393  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
2394  {MoeOfMos(i0StexEcha) += mean_over_samples(i0StexEcha, n_event);}
2395  MoeOfMos(i0StexEcha) /= (Double_t)fNumberOfEvents;
2396  }
2397  }
2398 
2399  //... Calculation of half of the matrix, diagonal included (LowFrequencyCovariancesBetweenChannels)
2400  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2401  {
2402  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2403  || ( fFlagSubDet == "EB") )
2404  {
2405  for(Int_t j0StexEcha = 0; j0StexEcha <= i0StexEcha; j0StexEcha++)
2406  {
2407  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, j0StexEcha) > 0)
2408  || ( fFlagSubDet == "EB") )
2409  {
2410  fT2d_lf_cov[i0StexEcha][j0StexEcha] = (Double_t)0;
2411  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
2412  {
2413  fT2d_lf_cov[i0StexEcha][j0StexEcha] +=
2414  ( mean_over_samples(i0StexEcha, n_event) - MoeOfMos(i0StexEcha) )
2415  *( mean_over_samples(j0StexEcha, n_event) - MoeOfMos(j0StexEcha) );
2416  }
2417  fT2d_lf_cov[i0StexEcha][j0StexEcha] /= (Double_t)fNumberOfEvents;
2418 
2419  fT2d_lf_cov[j0StexEcha][i0StexEcha] = fT2d_lf_cov[i0StexEcha][j0StexEcha];
2420  }
2421  }
2422  if( i0StexEcha%100 == 0 ){cout << i0StexEcha << "[LFN Cov], ";}
2423  }
2424  }
2425  cout << endl;
2426  fTagLfCov[0] = 1; fFileHeader->fLfCovCalc++;
2427 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Double_t * fT2d1_lf_cov
Definition: TEcnaRun.h:477
TString fFlagSubDet
Definition: TEcnaRun.h:392
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fNumberOfEvents
Definition: TEcnaRun.h:410
Int_t StexEchaForCons(const Int_t &, const Int_t &)
Int_t * fTagLfCov
Definition: TEcnaRun.h:478
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysEcnaInStex()
Int_t fLfCovCalc
Definition: TEcnaHeader.h:80
tuple cout
Definition: gather_cfg.py:121
Double_t ** fT2d_lf_cov
Definition: TEcnaRun.h:476
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::LowFrequencyMeanCorrelationsBetweenSCs ( )

Definition at line 2720 of file TEcnaRun.cc.

References LowFrequencyMeanCorrelationsBetweenStins().

void LowFrequencyMeanCorrelationsBetweenStins()
Definition: TEcnaRun.cc:2723
void TEcnaRun::LowFrequencyMeanCorrelationsBetweenStins ( )

Definition at line 2723 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, TEcnaHeader::fLFccMoStinsCalc, fMiscDiag, fStinName, fT2d1_lfcc_mostins, fT2d_lf_cor, fT2d_lfcc_mostins, fTagLFccMoStins, fTagLfCor, fTTBELL, i, LowFrequencyCorrelationsBetweenChannels(), TEcnaParEcal::MaxCrysInStin(), and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by Expert2Calculations(), LowFrequencyMeanCorrelationsBetweenSCs(), and LowFrequencyMeanCorrelationsBetweenTowers().

2724 {
2725 //Calculation of the mean Low Frequency Correlations
2726 //between channels for each Stin
2727 
2728  //... preliminary calculation of the Low Frequency Cor(c,c) if not done yet
2729  // Only one tag (dim=1) to set to 0 (no write in the result ROOT file)
2731 
2732  //..... mean fT2d_lfcc_mostins for each pair (Stin_X,Stin_Y)
2733  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::LowFrequencyMeanCorrelationsBetweenStins()" << endl;}
2735  cout << " Calculation of the mean, for each "
2736  << fStinName.Data() << ", of the" << endl
2737  << " Low Frequency Correlations between channels." << endl;}
2738 
2739  //................. allocation fT2d_lfcc_mostins + init to zero (mandatory)
2740  if( fT2d_lfcc_mostins == 0 ){
2741  const Int_t n_Stin = fEcal->MaxStinEcnaInStex();
2742  fT2d_lfcc_mostins = new Double_t*[n_Stin]; fCnew++;
2743  fT2d1_lfcc_mostins = new Double_t[n_Stin*n_Stin]; fCnew++;
2744  for(Int_t i0StexStinEcna = 0 ; i0StexStinEcna < n_Stin ; i0StexStinEcna++){
2745  fT2d_lfcc_mostins[i0StexStinEcna] = &fT2d1_lfcc_mostins[0] + i0StexStinEcna*n_Stin;}
2746  }
2747 
2748  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2749  {
2750  for(Int_t j0StexStinEcna=0; j0StexStinEcna<fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
2751  {
2752  if( fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] != (Double_t)0 )
2753  {fMiscDiag[31]++; fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] = (Double_t)0;}
2754  }
2755  }
2756 
2757  //..... Calculation of the mean LF Cor(c,c) for each pair (Stin_X,Stin_Y)
2758  //
2759  // ! => Warning: this matrix is NOT symmetric => take N*N elements
2760  // Only (Stin,Stin) matrix is symmetric.
2761  // (StinEcha,StinEcha) matrix inside a (Stin,Stin) element is NOT symmetric
2762  // (except for the (Stin,Stin) DIAGONAL elements)
2763  // Then:
2764  // 1D array half_LFccMos[N*N] to put the (channel,channel) correlations
2765 
2766  Int_t ndim = (Int_t)(fEcal->MaxCrysInStin()*fEcal->MaxCrysInStin());
2767 
2768  TVectorD half_LFccMos(ndim); for(Int_t i=0; i<ndim; i++){half_LFccMos(i)=(Double_t)0.;}
2769 
2770  //..................... Calculation
2771  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::LowFrequencyMeanCorrelationsBetweenStins()" << endl;}
2773  cout << " Calculation, for each "
2774  << fStinName.Data() << ", of the mean " << endl
2775  << " Low Frequency cor(c,c)." << endl;}
2776 
2777  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2778  {
2779  for(Int_t j0StexStinEcna=0; j0StexStinEcna<fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
2780  {
2781  //................... .Copy the Mean Correlations(c,c') in 1D vector half_LFccMos()
2782  Int_t i_count = 0;
2783  for(Int_t i0StinCrys=0; i0StinCrys<fEcal->MaxCrysInStin(); i0StinCrys++)
2784  {
2785  Int_t i0StexEcha = i0StexStinEcna*fEcal->MaxCrysInStin() + i0StinCrys;
2786  for(Int_t j0StinCrys=0; j0StinCrys<fEcal->MaxCrysInStin(); j0StinCrys++)
2787  {
2788  Int_t j0StexEcha = j0StexStinEcna*fEcal->MaxCrysInStin() + j0StinCrys;
2789  if( (i0StexEcha>= 0 && i0StexEcha < fEcal->MaxCrysEcnaInStex()) &&
2790  (j0StexEcha>= 0 && j0StexEcha < fEcal->MaxCrysEcnaInStex()) )
2791  {half_LFccMos(i_count) = fT2d_lf_cor[i0StexEcha][j0StexEcha]; i_count++;}
2792  else
2793  {cout << "!TEcnaRun::LowFrequencyMeanCorrelationsBetweenStins()> Channel number out of range."
2794  << "i0StexEcha = " << i0StexEcha <<", j0StexEcha = " << j0StexEcha << fTTBELL << endl; }
2795  }
2796  }
2797  //...... Calculation of the mean absolute values of the LF mean Correlations(c,c')
2798  fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] = (Double_t)0;
2799  for(Int_t i_rcor = 0; i_rcor < ndim; i_rcor++)
2800  {
2801  fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] += fabs(half_LFccMos(i_rcor));
2802  }
2803  fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] /= (Double_t)ndim;
2804  }
2805  if( i0StexStinEcna%10 == 0 ){cout << i0StexStinEcna << "[LFN MCtt], ";}
2806  }
2807  cout << endl;
2808 
2810 } // ------- end of LowFrequencyMeanCorrelationsBetweenStins() -------
int i
Definition: DBlmapReader.cc:9
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t * fTagLFccMoStins
Definition: TEcnaRun.h:496
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t * fTagLfCor
Definition: TEcnaRun.h:482
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t MaxCrysInStin()
Double_t ** fT2d_lf_cor
Definition: TEcnaRun.h:480
Int_t fCnew
Definition: TEcnaRun.h:373
Double_t * fT2d1_lfcc_mostins
Definition: TEcnaRun.h:495
Int_t fLFccMoStinsCalc
Definition: TEcnaHeader.h:82
void LowFrequencyCorrelationsBetweenChannels()
Definition: TEcnaRun.cc:2437
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
TString fStinName
Definition: TEcnaRun.h:393
TString fTTBELL
Definition: TEcnaRun.h:376
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
Double_t ** fT2d_lfcc_mostins
Definition: TEcnaRun.h:494
void TEcnaRun::LowFrequencyMeanCorrelationsBetweenTowers ( )

Definition at line 2718 of file TEcnaRun.cc.

References LowFrequencyMeanCorrelationsBetweenStins().

void LowFrequencyMeanCorrelationsBetweenStins()
Definition: TEcnaRun.cc:2723
void TEcnaRun::LowFrequencyNoise ( )

Definition at line 1678 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, TEcnaHeader::fLfnCalc, fMiscDiag, fNbSampForCalc, fNumberOfEvents, fT1d_sigevt_of_evsamp, fT3d_AdcValues, fTagLfn, i, TEcnaParEcal::MaxCrysEcnaInStex(), and mathSSE::sqrt().

Referenced by AverageLowFrequencyNoise(), and StandardCalculations().

1679 {
1680 // Calculation, for each channel, of the sigma (over the events)
1681 // of the ADC expectation values (over the samples 0 to fNbSampForCalc-1)
1682 
1683  //................... Allocation fT1d_sigevt_of_evsamp + init to zero (mandatory)
1684  if( fT1d_sigevt_of_evsamp == 0 ){
1685  fT1d_sigevt_of_evsamp = new Double_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
1686  }
1687  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1688  {
1689  if( fT1d_sigevt_of_evsamp[i0StexEcha] != (Double_t)0 )
1690  {fMiscDiag[13]++; fT1d_sigevt_of_evsamp[i0StexEcha] = (Double_t)0;}
1691  }
1692 
1693  //................... Allocation mean_over_samples
1694  TVectorD mean_over_samples(fNumberOfEvents);
1695  for(Int_t i=0; i<fNumberOfEvents; i++){mean_over_samples(i)=(Double_t)0.;}
1696 
1697  //..................... Calculation
1698  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::LowFrequencyNoise()" << endl;}
1700  cout << " Calculation, for each channel, of the sigma (over the events)" << endl
1701  << " of the ADC expectation values (over the samples 1 to "
1702  << fNbSampForCalc << ")." << endl;}
1703 
1704  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1705  {
1706  // Calculation of the mean over the events of the mean over the samples
1707  Double_t mean_over_events = (Double_t)0;
1708  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
1709  {
1710  // Calculation, for each event, of the mean over the samples
1711  mean_over_samples(n_event) = (Double_t)0.;
1712  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
1713  {
1714  mean_over_samples(n_event) += fT3d_AdcValues[i0StexEcha][i0Sample][n_event];
1715  }
1716  mean_over_samples(n_event) /= (Double_t)fNbSampForCalc;
1717 
1718  mean_over_events += mean_over_samples(n_event);
1719  }
1720  mean_over_events /= (Double_t)fNumberOfEvents;
1721 
1722  // Calculation of the sigma over the events of the mean over the samples
1723  Double_t var = (Double_t)0;
1724  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
1725  {
1726  Double_t ecart = mean_over_samples(n_event) - mean_over_events;
1727  var += ecart*ecart;
1728  }
1729  var /= (Double_t)fNumberOfEvents;
1730 
1731  fT1d_sigevt_of_evsamp[i0StexEcha] = sqrt(var);
1732  }
1733  fTagLfn[0] = 1; fFileHeader->fLfnCalc++;
1734 }
int i
Definition: DBlmapReader.cc:9
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Double_t * fT1d_sigevt_of_evsamp
Definition: TEcnaRun.h:460
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t * fTagLfn
Definition: TEcnaRun.h:461
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
T sqrt(T t)
Definition: SSEVec.h:46
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fNumberOfEvents
Definition: TEcnaRun.h:410
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
Int_t fLfnCalc
Definition: TEcnaHeader.h:87
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::MeanCorrelationsBetweenSamples ( )

Definition at line 1820 of file TEcnaRun.cc.

References CorrelationsBetweenSamples(), gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, TEcnaHeader::fMeanCorssCalc, fMiscDiag, fNbSampForCalc, fT1d_ev_cor_ss, fT3d_cor_ss, fTagCorCss, fTagMeanCorss, i, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by AverageMeanCorrelationsBetweenSamples(), SigmaOfCorrelationsBetweenSamples(), and StandardCalculations().

1821 {
1822  // Calculation, for all the channels, of the expectation values
1823  // of the correlations between the first fNbSampForCalc samples
1824 
1825  //... preliminary calculation of the correlations if not done yet
1826  // (test only the first element since the cor are computed globaly)
1827  if ( fTagCorCss[0] != 1 ){CorrelationsBetweenSamples(); fTagCorCss[0]=0;}
1828 
1829  //................... Allocations ev_cor_ss + init to zero (mandatory)
1830  if( fT1d_ev_cor_ss == 0 ){
1831  Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
1832  fT1d_ev_cor_ss = new Double_t[n_StexEcha]; fCnew++;
1833  }
1834  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1835  {
1836  if( fT1d_ev_cor_ss[i0StexEcha] != (Double_t)0 )
1837  {fMiscDiag[15]++; fT1d_ev_cor_ss[i0StexEcha] = (Double_t)0;}
1838  }
1839 
1840  //.......... 1D array half_cor_ss[N(N-1)/2] to put the N (sample,sample) correlations
1841  // ( half of (them minus the diagonal) )
1842  Int_t ndim = (Int_t)(fNbSampForCalc*(fNbSampForCalc - 1)/2);
1843 
1844  TVectorD half_cor_ss(ndim); for(Int_t i=0; i<ndim; i++){half_cor_ss(i)=(Double_t)0.;}
1845 
1846  //..................... Calculation
1847  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::MeanCorrelationsBetweenSamples()" << endl;}
1849  cout << " Calculation, for all the channels, of the expectation values of the" << endl
1850  << " correlations between the first " << fNbSampForCalc << " samples." << endl;}
1851 
1852  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1853  {
1854  //..................... half_cor_ss() array filling
1855  Int_t i_count = 0;
1856  for (Int_t i0Sample = 0; i0Sample < fNbSampForCalc; i0Sample++)
1857  {
1858  for (Int_t j0Sample = 0; j0Sample < i0Sample; j0Sample++)
1859  {
1860  half_cor_ss(i_count) = fT3d_cor_ss[i0StexEcha][i0Sample][j0Sample];
1861  i_count++;
1862  }
1863  }
1864  //...................... mean cor(s,s') calculation
1865  fT1d_ev_cor_ss[i0StexEcha] = (Double_t)0;
1866  for(Int_t i_rcor = 0; i_rcor < ndim; i_rcor++)
1867  {
1868  fT1d_ev_cor_ss[i0StexEcha] += half_cor_ss(i_rcor);
1869  }
1870  fT1d_ev_cor_ss[i0StexEcha] /= (Double_t)ndim;
1871  }
1873 }
int i
Definition: DBlmapReader.cc:9
Int_t * fTagCorCss
Definition: TEcnaRun.h:442
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Double_t *** fT3d_cor_ss
Definition: TEcnaRun.h:439
Int_t fMeanCorssCalc
Definition: TEcnaHeader.h:86
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
void CorrelationsBetweenSamples()
Definition: TEcnaRun.cc:1506
Int_t * fTagMeanCorss
Definition: TEcnaRun.h:456
Double_t * fT1d_ev_cor_ss
Definition: TEcnaRun.h:455
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
Bool_t TEcnaRun::OpenRootFile ( const Text_t *  name,
TString  status 
)

Definition at line 2926 of file TEcnaRun.cc.

References gather_cfg::cout, fCnaParPaths, fCodePrintAllComments, fFlagPrint, fObjectManager, fOpenRootFile, TEcnaRootFile::fRootFileStatus, gCnaRootFile, TEcnaObject::GetPointerValue(), TEcnaRootFile::OpenR(), TEcnaRootFile::OpenW(), TEcnaRootFile::ReStart(), TEcnaParPaths::ResultsRootFilePath(), and ntuplemaker::status.

Referenced by WriteRootFile().

2926  {
2927 //Open the Root file
2928 
2929  Bool_t ok_open = kFALSE;
2930 
2931  TString s_name;
2932  s_name = fCnaParPaths->ResultsRootFilePath();
2933  s_name.Append('/');
2934  s_name.Append(name);
2935 
2936  //gCnaRootFile = new TEcnaRootFile(fObjectManager, s_name.Data(), status); fCnew++;
2937 
2938  Long_t iCnaRootFile = fObjectManager->GetPointerValue("TEcnaRootFile");
2939  if( iCnaRootFile == 0 )
2940  {
2941  gCnaRootFile = new TEcnaRootFile(fObjectManager, s_name.Data(), status); /* Anew("gCnaRootFile");*/
2942  }
2943  else
2944  {
2945  gCnaRootFile = (TEcnaRootFile*)iCnaRootFile;
2946  gCnaRootFile->ReStart(s_name.Data(), status);
2947  }
2948 
2949  if ( gCnaRootFile->fRootFileStatus == "RECREATE" ){ok_open = gCnaRootFile->OpenW();}
2950  if ( gCnaRootFile->fRootFileStatus == "READ" ){ok_open = gCnaRootFile->OpenR();}
2951 
2952  if (!ok_open) // unable to open file
2953  {
2954  cout << "TEcnaRun::OpenRootFile> Cannot open file " << s_name.Data() << endl;
2955  }
2956  else
2957  {
2959  {cout << "*TEcnaRun::OpenRootFile> Open ROOT file OK for file " << s_name.Data() << endl;}
2960  fOpenRootFile = kTRUE;
2961  }
2962  return ok_open;
2963 }
Bool_t OpenR(const Text_t *="")
Bool_t fOpenRootFile
Definition: TEcnaRun.h:395
TEcnaObject * fObjectManager
Definition: TEcnaRun.h:382
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Long_t GetPointerValue(const TString)
Definition: TEcnaObject.cc:229
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
Int_t fFlagPrint
Definition: TEcnaRun.h:509
TString fRootFileStatus
Definition: TEcnaRootFile.h:34
TString ResultsRootFilePath()
void ReStart(const Text_t *)
tuple cout
Definition: gather_cfg.py:121
Bool_t OpenW(const Text_t *="")
tuple status
Definition: ntuplemaker.py:245
void TEcnaRun::Pedestals ( )

Definition at line 1580 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, fMiscDiag, fNbSampForCalc, TEcnaHeader::fPedCalc, fT1d_ev_ev, fT2d_ev, fTagMSp, fTagPed, TEcnaParEcal::MaxCrysEcnaInStex(), and SampleMeans().

Referenced by AveragePedestals(), and StandardCalculations().

1581 {
1582 // Calculation, for each channel, of the expectation values
1583 // (over the samples 0 to fNbSampForCalc-1) of the ADC expectation values
1584 // (over the events)
1585 
1586  //... preliminary calculation of the expectation values if not done yet
1587  if ( fTagMSp[0] != 1 ){SampleMeans(); fTagMSp[0]=0;}
1588 
1589  //................... Allocation ev_ev + init to zero (mandatory)
1590  if( fT1d_ev_ev == 0 ){fT1d_ev_ev = new Double_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;}
1591  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1592  {if( fT1d_ev_ev[i0StexEcha] != (Double_t)0 )
1593  {fMiscDiag[11]++; fT1d_ev_ev[i0StexEcha] = (Double_t)0;}}
1594 
1595  //..................... Calculation
1596  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::Pedestals()" << endl;}
1598  cout << " Calculation, for all the channels, of the expectation values (over the samples 1 to "
1599  << fNbSampForCalc << ")" << endl
1600  << " of the ADC expectation values (over the events)." << endl;}
1601 
1602  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1603  {
1604  for (Int_t i0Sample = 0; i0Sample < fNbSampForCalc; i0Sample++)
1605  {
1606  fT1d_ev_ev[i0StexEcha] += fT2d_ev[i0StexEcha][i0Sample];
1607  }
1608  fT1d_ev_ev[i0StexEcha] /= fNbSampForCalc;
1609  }
1610  fTagPed[0] = 1; fFileHeader->fPedCalc++;
1611 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t * fTagPed
Definition: TEcnaRun.h:446
Double_t ** fT2d_ev
Definition: TEcnaRun.h:426
Double_t * fT1d_ev_ev
Definition: TEcnaRun.h:445
Int_t fPedCalc
Definition: TEcnaHeader.h:84
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
void SampleMeans()
Definition: TEcnaRun.cc:1326
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::PrintAllComments ( )

Definition at line 4541 of file TEcnaRun.cc.

References gather_cfg::cout, fCodePrintAllComments, and fFlagPrint.

4542 {
4543 // Set flags to authorize printing of the comments of all the methods
4544 
4546  cout << "*TEcnaRun::PrintAllComments()> All the comments will be printed" << endl;
4547 }
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
Int_t fFlagPrint
Definition: TEcnaRun.h:509
tuple cout
Definition: gather_cfg.py:121
void TEcnaRun::PrintComments ( )

Definition at line 4525 of file TEcnaRun.cc.

References gather_cfg::cout, fCodePrintComments, and fFlagPrint.

4526 {
4527 // Set flags to authorize printing of some comments concerning initialisations (default)
4528 
4530  cout << "*TEcnaRun::PrintComments()> Warnings and some comments on init will be printed" << endl;
4531 }
Int_t fCodePrintComments
Definition: TEcnaRun.h:510
Int_t fFlagPrint
Definition: TEcnaRun.h:509
tuple cout
Definition: gather_cfg.py:121
void TEcnaRun::PrintNoComment ( )

Definition at line 4549 of file TEcnaRun.cc.

References fCodePrintNoComment, and fFlagPrint.

4550 {
4551 // Set flags to forbid the printing of all the comments
4552 
4554 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fFlagPrint
Definition: TEcnaRun.h:509
void TEcnaRun::PrintWarnings ( )

Definition at line 4533 of file TEcnaRun.cc.

References gather_cfg::cout, fCodePrintWarnings, and fFlagPrint.

4534 {
4535 // Set flags to authorize printing of warnings
4536 
4538  cout << "*TEcnaRun::PrintWarnings()> Warnings will be printed" << endl;
4539 }
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fCodePrintWarnings
Definition: TEcnaRun.h:510
tuple cout
Definition: gather_cfg.py:121
Bool_t TEcnaRun::ReadSampleAdcValues ( )

Definition at line 1054 of file TEcnaRun.cc.

References fEcal, and TEcnaParEcal::MaxSampADC().

Referenced by TEcnaGui::Calculations().

1054 {return ReadSampleAdcValues(fEcal->MaxSampADC());}
Bool_t ReadSampleAdcValues()
Definition: TEcnaRun.cc:1054
Int_t MaxSampADC()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
Bool_t TEcnaRun::ReadSampleAdcValues ( const Int_t &  nb_samp_for_calc)

Definition at line 1056 of file TEcnaRun.cc.

References gather_cfg::cout, TEcnaRead::DataExist(), fCnaParPaths, fEcal, fFileHeader, TEcnaHeader::fFirstReqEvtNumber, fFlagSubDet, TEcnaRead::FileParameters(), TEcnaHeader::fLastReqEvtNumber, TEcnaHeader::fNbOfEvtsCalc, TEcnaHeader::fNbOfSamples, fNbSampForCalc, fObjectManager, TEcnaHeader::fReqNbOfEvts, fRootFileName, fRootFileNameShort, TEcnaHeader::fRunNumber, TEcnaHeader::fStartDate, TEcnaHeader::fStartTime, TEcnaHeader::fStex, TEcnaHeader::fStinNumbersCalc, TEcnaHeader::fStopDate, TEcnaHeader::fStopTime, fT1d_StexStinFromIndex, fT2d_NbOfEvts, fT3d_AdcValues, fTagNbOfEvts, fTagStinNumbers, fTTBELL, TEcnaHeader::fTypAna, TEcnaRead::GetRootFileName(), TEcnaRead::GetRootFileNameShort(), TEcnaRead::GetStartDate(), TEcnaRead::GetStartTime(), TEcnaRead::GetStexStinFromIndex(), TEcnaRead::GetStopDate(), TEcnaRead::GetStopTime(), i, j, TEcnaRead::LookAtRootFile(), TEcnaParEcal::MaxCrysEcnaInStex(), TEcnaParEcal::MaxCrysInStin(), TEcnaParEcal::MaxStinEcnaInStex(), TEcnaRead::PrintNoComment(), TEcnaRead::ReadNumberOfEventsForSamples(), TEcnaRead::ReadSampleAdcValuesSameFile(), TEcnaRead::ReadStinNumbers(), and TEcnaParPaths::ResultsRootFilePath().

1057 {
1058  // read the Sample ADC values from "ADC" result root files (ReadSampleAdcValues)
1059 
1060  // put the number of sample for calculations in attribute fNbSampForCalc
1061  // and call the method without arguments
1062  // We must have: nb_samp_for_calc <= fFileHeader->fNbOfSamples (= nb of samples in ROOT file)
1063 
1064  fNbSampForCalc = nb_samp_for_calc;
1065 
1066 // TEcnaRead* MyRootFile = new TEcnaRead(fFlagSubDet.Data(), fCnaParPaths, fCnaParCout,
1067 // fFileHeader, fEcalNumbering, fCnaWrite); // fCnew++;
1068 
1069  TEcnaRead* MyRootFile = new TEcnaRead(fObjectManager, fFlagSubDet.Data()); // fCnew++;
1070 
1071  MyRootFile->PrintNoComment();
1072 
1076  fCnaParPaths->ResultsRootFilePath().Data());
1077 
1078  Bool_t ok_read = MyRootFile->LookAtRootFile();
1079 
1080  fFileHeader->fStartTime = MyRootFile->GetStartTime();
1081  fFileHeader->fStopTime = MyRootFile->GetStopTime();
1082  fFileHeader->fStartDate = MyRootFile->GetStartDate();
1083  fFileHeader->fStopDate = MyRootFile->GetStopDate();
1084 
1085  if ( ok_read == kTRUE )
1086  {
1087  fRootFileName = MyRootFile->GetRootFileName();
1088  fRootFileNameShort = MyRootFile->GetRootFileNameShort();
1089  cout << "*TEcnaRun::ReadSampleAdcValues> Reading sample ADC values from file: " << endl
1090  << " " << fRootFileName << endl;
1091 
1092  size_t i_no_data = 0;
1093 
1094  //.......... Read the StinNumbers in the old file (ReadSampleAdcValues)
1095  TVectorD vec(fEcal->MaxStinEcnaInStex());
1096  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
1097  vec = MyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
1098  if( MyRootFile->DataExist() == kTRUE )
1099  {
1100  fTagStinNumbers[0] = 1;
1102  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
1103  {fT1d_StexStinFromIndex[i0StexStinEcna] = (Int_t)vec(i0StexStinEcna);}
1104  }
1105  else
1106  {
1107  i_no_data++;
1108  }
1109  //.......... Read the Numbers of Events in the old file (ReadSampleAdcValues)
1110  TMatrixD partial_matrix(fEcal->MaxCrysInStin(), fFileHeader->fNbOfSamples);
1111  for(Int_t i=0; i<fEcal->MaxCrysInStin(); i++)
1112  {for(Int_t j=0; j<fFileHeader->fNbOfSamples; j++){partial_matrix(i,j)=(Double_t)0.;}}
1113 
1114  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
1115  {
1116  Int_t n1StexStin = MyRootFile->GetStexStinFromIndex(i0StexStinEcna);
1117  if(n1StexStin != -1)
1118  {
1119  partial_matrix =
1120  MyRootFile->ReadNumberOfEventsForSamples
1121  (n1StexStin, fEcal->MaxCrysInStin(), fFileHeader->fNbOfSamples);
1122 
1123  if( MyRootFile->DataExist() == kTRUE )
1124  {
1125  fTagNbOfEvts[0] = 1;
1127  for(Int_t i0StinCrys=0; i0StinCrys<fEcal->MaxCrysInStin(); i0StinCrys++)
1128  {
1129  Int_t i0StexEcha = (n1StexStin-1)*fEcal->MaxCrysInStin() + i0StinCrys;
1130  for(Int_t i0Sample=0; i0Sample<fFileHeader->fNbOfSamples; i0Sample++)
1131  {fT2d_NbOfEvts[i0StexEcha][i0Sample] = (Int_t)partial_matrix(i0StinCrys,i0Sample);}
1132  }
1133  }
1134  else
1135  {
1136  i_no_data++;
1137  }
1138  }
1139  }
1140 
1141  //.......... Read the Sample ADC values in the old file (ReadSampleAdcValues)
1142  Double_t*** fT3d_read_AdcValues =
1143  MyRootFile->ReadSampleAdcValuesSameFile
1145 
1146  if( MyRootFile->DataExist() == kTRUE )
1147  {
1148  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1149  {
1150  for(Int_t i0Sample=0; i0Sample<fFileHeader->fNbOfSamples;i0Sample++)
1151  {
1152  for(Int_t i_event=0; i_event<fFileHeader->fReqNbOfEvts; i_event++)
1153  {fT3d_AdcValues[i0StexEcha][i0Sample][i_event] =
1154  fT3d_read_AdcValues[i0StexEcha][i0Sample][i_event];}
1155  }
1156  }
1157  }
1158  else
1159  {
1160  i_no_data++;
1161  }
1162  if(i_no_data)
1163  {
1164  cout << "!TEcnaRun::ReadSampleAdcValues(...)> *ERROR* =====> "
1165  << " Read failure. i_no_data = " << i_no_data << fTTBELL << endl;
1166  }
1167  }
1168  else
1169  {
1170  cout << "!TEcnaRun::ReadSampleAdcValues(...)> *ERROR* =====> "
1171  << " ROOT file not found" << fTTBELL << endl;
1172  }
1173  delete MyRootFile; // fCdelete++;
1174  return ok_read;
1175 }
int i
Definition: DBlmapReader.cc:9
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fTagStinNumbers
Definition: TEcnaRun.h:424
TEcnaObject * fObjectManager
Definition: TEcnaRun.h:382
void FileParameters(TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, TString)
Definition: TEcnaRead.cc:649
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString GetStartDate()
Definition: TEcnaRead.cc:756
TString GetRootFileNameShort()
Definition: TEcnaRead.cc:4376
time_t GetStopTime()
Definition: TEcnaRead.cc:755
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:55
Int_t fNbOfEvtsCalc
Definition: TEcnaHeader.h:67
Int_t fNbOfSamples
Definition: TEcnaHeader.h:51
TString fStopDate
Definition: TEcnaHeader.h:61
TString fFlagSubDet
Definition: TEcnaRun.h:392
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:1132
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Int_t GetStexStinFromIndex(const Int_t &)
Definition: TEcnaRead.cc:4384
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
int j
Definition: DBlmapReader.cc:9
Int_t * fTagNbOfEvts
Definition: TEcnaRun.h:421
TString GetStopDate()
Definition: TEcnaRead.cc:757
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
void PrintNoComment()
Definition: TEcnaRead.cc:4481
Int_t MaxCrysInStin()
TString GetRootFileName()
Definition: TEcnaRead.cc:4375
TString fStartDate
Definition: TEcnaHeader.h:60
Bool_t DataExist()
Definition: TEcnaRead.cc:978
TString fTypAna
Definition: TEcnaHeader.h:50
TMatrixD ReadNumberOfEventsForSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1724
Double_t *** ReadSampleAdcValuesSameFile(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:4181
Int_t fFirstReqEvtNumber
Definition: TEcnaHeader.h:53
TString ResultsRootFilePath()
Int_t MaxCrysEcnaInStex()
time_t fStartTime
Definition: TEcnaHeader.h:58
time_t fStopTime
Definition: TEcnaHeader.h:59
Int_t fLastReqEvtNumber
Definition: TEcnaHeader.h:54
Bool_t LookAtRootFile()
Definition: TEcnaRead.cc:922
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
Int_t fRunNumber
Definition: TEcnaHeader.h:52
TString fRootFileName
Definition: TEcnaRun.h:398
Int_t ** fT2d_NbOfEvts
Definition: TEcnaRun.h:419
Int_t fStinNumbersCalc
Definition: TEcnaHeader.h:66
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRun.h:423
TString fTTBELL
Definition: TEcnaRun.h:376
time_t GetStartTime()
Definition: TEcnaRead.cc:754
TString fRootFileNameShort
Definition: TEcnaRun.h:399
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::SampleMeans ( )

Definition at line 1326 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, fMiscDiag, TEcnaHeader::fMSpCalc, fNbSampForCalc, fNumberOfEvents, fT1d_ev, fT2d_ev, fT3d_AdcValues, fTagMSp, i, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by CovariancesBetweenSamples(), Pedestals(), SampleSigmas(), and StandardCalculations().

1327 {
1328 // Calculation of the expectation values over events
1329 // for the samples 0 to fNbSampForCalc and for all the StexEchas
1330 
1331  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::SampleMeans() " << endl;}
1333  cout << " Calculation: sample expectation values over the events"
1334  << " for each channel." << endl;}
1335 
1336  //................... Allocation fT2d_ev
1337  if ( fT2d_ev == 0 ){
1338  Int_t n_samp = fNbSampForCalc;
1339  Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
1340  fT2d_ev = new Double_t*[n_StexEcha]; fCnew++;
1341  fT1d_ev = new Double_t[n_StexEcha*n_samp]; fCnew++;
1342  for(Int_t i = 0 ; i < n_StexEcha ; i++){
1343  fT2d_ev[i] = &fT1d_ev[0] + i*n_samp;}
1344  }
1345  //................... init fT2d_ev to zero
1346  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1347  {
1348  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
1349  {
1350  if( fT2d_ev[i0StexEcha][i0Sample] != (Double_t)0 )
1351  {fMiscDiag[1]++; fT2d_ev[i0StexEcha][i0Sample] = (Double_t)0;}
1352  }
1353  }
1354 
1355  //................... Calculation
1356  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
1357  {
1358  for (Int_t i0Sample = 0 ; i0Sample < fNbSampForCalc ; i0Sample++)
1359  {
1360  for( Int_t i_event = 0; i_event < fNumberOfEvents; i_event++ )
1361  {
1362  fT2d_ev[i0StexEcha][i0Sample] += fT3d_AdcValues[i0StexEcha][i0Sample][i_event];
1363  }
1364  fT2d_ev[i0StexEcha][i0Sample] /= fNumberOfEvents;
1365  }
1366  }
1367  fTagMSp[0] = 1; fFileHeader->fMSpCalc++;
1368 }
int i
Definition: DBlmapReader.cc:9
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fMSpCalc
Definition: TEcnaHeader.h:70
Double_t ** fT2d_ev
Definition: TEcnaRun.h:426
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fNumberOfEvents
Definition: TEcnaRun.h:410
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Int_t MaxCrysEcnaInStex()
Double_t * fT1d_ev
Definition: TEcnaRun.h:427
tuple cout
Definition: gather_cfg.py:121
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::SampleSigmas ( )

Definition at line 1378 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, fMiscDiag, fNbSampForCalc, fNumberOfEvents, TEcnaHeader::fSSpCalc, fT1d_sig, fT2d_ev, fT2d_sig, fT3d_AdcValues, fTagMSp, fTagSSp, TEcnaParEcal::MaxCrysEcnaInStex(), SampleMeans(), and mathSSE::sqrt().

Referenced by StandardCalculations(), and TotalNoise().

1379 {
1380 //Calculation of the sigmas of the samples for all the StexEchas
1381 
1382  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::SampleSigmas()" << endl;}
1384  cout << " Calculation: sample ADC sigmas over the events "
1385  << " for each channel." << endl;}
1386 
1387  //... preliminary calculation of the expectation values if not done yet.
1388  // The tag is set to 1 after call to the method. It is reset to 0
1389  // because the expectation values must not be written in the result ROOT file
1390  // (since the tag was equal to 0)
1391  if(fTagMSp[0] != 1){SampleMeans(); fTagMSp[0] = 0;}
1392 
1393  //................... Allocation fT2d_sig
1394  if( fT2d_sig == 0){
1395  Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
1396  Int_t n_samp = fNbSampForCalc;
1397  fT2d_sig = new Double_t*[n_StexEcha]; fCnew++;
1398  fT1d_sig = new Double_t[n_StexEcha*n_samp]; fCnew++;
1399  for(Int_t i0StexEcha = 0 ; i0StexEcha < n_StexEcha ; i0StexEcha++){
1400  fT2d_sig[i0StexEcha] = &fT1d_sig[0] + i0StexEcha*n_samp;}
1401  }
1402  // ................... init fT2d_sig to zero
1403  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1404  {
1405  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
1406  {
1407  if( fT2d_sig[i0StexEcha][i0Sample] != (Double_t)0 )
1408  {fMiscDiag[2]++; fT2d_sig[i0StexEcha][i0Sample] = (Double_t)0;}
1409  }
1410  }
1411 
1412  //................... Calculation
1413  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
1414  {
1415  for (Int_t i0Sample = 0 ; i0Sample < fNbSampForCalc ; i0Sample++)
1416  {
1417  Double_t variance = (Double_t)0.;
1418  for( Int_t i_event = 0; i_event < fNumberOfEvents; i_event++ )
1419  {
1420  Double_t ecart = fT3d_AdcValues[i0StexEcha][i0Sample][i_event] - fT2d_ev[i0StexEcha][i0Sample];
1421  variance += ecart*ecart;
1422  }
1423  variance /= fNumberOfEvents;
1424  fT2d_sig[i0StexEcha][i0Sample] = sqrt(variance);
1425  }
1426  }
1427  fTagSSp[0] = 1; fFileHeader->fSSpCalc++;
1428 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fSSpCalc
Definition: TEcnaHeader.h:71
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Double_t ** fT2d_sig
Definition: TEcnaRun.h:430
Int_t * fTagSSp
Definition: TEcnaRun.h:432
Double_t ** fT2d_ev
Definition: TEcnaRun.h:426
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
T sqrt(T t)
Definition: SSEVec.h:46
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fNumberOfEvents
Definition: TEcnaRun.h:410
void SampleMeans()
Definition: TEcnaRun.cc:1326
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
Double_t * fT1d_sig
Definition: TEcnaRun.h:431
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::SampleValues ( )

Definition at line 1254 of file TEcnaRun.cc.

References TEcnaHeader::fAdcEvtCalc, fEcal, fFileHeader, fTagAdcEvt, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by EcnaAnalyzer::analyze(), and EcnaAnalyzer::~EcnaAnalyzer().

1255 {
1256 //3D histo of the sample ADC values for all the triples (StexEcha, sample, event)
1257 
1258  // The histo is already in fT3d_AdcValues[][][]
1259  // this method sets the "Tag", increment the "f...Calc" (and must be kept for that)
1260  // f...Calc > 0 => allow writing on file.
1261 
1263  for( Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1264  {fTagAdcEvt[i0StexEcha] = 1; fFileHeader->fAdcEvtCalc++;}
1265 }
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fAdcEvtCalc
Definition: TEcnaHeader.h:69
Int_t MaxCrysEcnaInStex()
Int_t * fTagAdcEvt
Definition: TEcnaRun.h:417
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::SetEcalSubDetector ( const TString  SubDet)

Definition at line 274 of file TEcnaRun.cc.

References fCnaParCout, fCnaParPaths, fCnaWrite, fEcal, fEcalNumbering, fFlagSubDet, fgMaxCar, fStexName, and fStinName.

Referenced by TEcnaRun().

275 {
276  // Set Subdetector (EB or EE)
277 
278  Int_t MaxCar = fgMaxCar;
279  fFlagSubDet.Resize(MaxCar);
280  fFlagSubDet = SubDet.Data();
281 
282  fEcal = 0; fEcal = new TEcnaParEcal(fFlagSubDet.Data()); //fCnew++;
283  fEcalNumbering = 0; fEcalNumbering = new TEcnaNumbering(fFlagSubDet.Data(), fEcal); //fCnew++;
284  fCnaWrite = 0;
285  fCnaWrite =
287 
288  if( fFlagSubDet == "EB" ){fStexName = "SM "; fStinName = "tower";}
289  if( fFlagSubDet == "EE" ){fStexName = "Dee"; fStinName = " SC ";}
290 }
TEcnaParCout * fCnaParCout
Definition: TEcnaRun.h:386
TString fStexName
Definition: TEcnaRun.h:393
TString fFlagSubDet
Definition: TEcnaRun.h:392
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
Int_t fgMaxCar
Definition: TEcnaRun.h:369
TString fStinName
Definition: TEcnaRun.h:393
TEcnaWrite * fCnaWrite
Definition: TEcnaRun.h:388
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::SigmaOfCorrelationsBetweenSamples ( )

Definition at line 1886 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, fMiscDiag, fNbSampForCalc, TEcnaHeader::fSigCorssCalc, fT1d_ev_cor_ss, fT1d_sig_cor_ss, fT3d_cor_ss, fTagMeanCorss, fTagSigCorss, i, TEcnaParEcal::MaxCrysEcnaInStex(), MeanCorrelationsBetweenSamples(), and mathSSE::sqrt().

Referenced by AverageSigmaOfCorrelationsBetweenSamples(), and StandardCalculations().

1887 {
1888  //Calculation of the sigmas of the (sample,sample) correlations for all the StexEchas
1889 
1890  //... preliminary calculation of the mean cor(s,s') if not done yet
1891  // (test only the first element since the cor are computed globaly)
1892  // Results available in array fT1d_ev_cor_ss[i0StexEcha]
1894 
1895  //................... Allocations sig_cor_ss + init to zero
1896  if( fT1d_sig_cor_ss == 0 ){
1897  Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
1898  fT1d_sig_cor_ss = new Double_t[n_StexEcha]; fCnew++;
1899  }
1900  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1901  {
1902  if( fT1d_sig_cor_ss[i0StexEcha] != (Double_t)0 )
1903  {fMiscDiag[16]++; fT1d_sig_cor_ss[i0StexEcha] = (Double_t)0;}
1904  }
1905 
1906  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::SigmasOfCorrelationsBetweenSamples()" << endl;}
1908  cout << " Calculation of the sigmas of the (sample,sample)" << endl
1909  << " correlations for all the channels." << endl;}
1910 
1911  //.......... 1D array half_cor_ss[N(N-1)/2] to put the N (sample,sample) correlations
1912  // (half of them minus the diagonal)
1913  Int_t ndim = (Int_t)(fNbSampForCalc*(fNbSampForCalc - 1)/2);
1914 
1915  TVectorD half_cor_ss(ndim); for(Int_t i=0; i<ndim; i++){half_cor_ss(i)=(Double_t)0.;}
1916 
1917  //.................. Calculation
1918  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1919  {
1920  //..................... half_cor_ss() array filling
1921  Int_t i_count = 0;
1922  for (Int_t i0Sample = 0; i0Sample < fNbSampForCalc; i0Sample++)
1923  {
1924  for (Int_t j0Sample = 0; j0Sample < i0Sample; j0Sample++)
1925  {
1926  half_cor_ss(i_count) = fT3d_cor_ss[i0StexEcha][i0Sample][j0Sample];
1927  i_count++;
1928  }
1929  }
1930 
1931  //...................... sigma of cor(s,s') calculation
1932  Double_t var = (Double_t)0;
1933  for(Int_t i_rcor = 0; i_rcor < ndim; i_rcor++)
1934  {
1935  Double_t ecart = half_cor_ss(i_rcor) - fT1d_ev_cor_ss[i0StexEcha];
1936  var += ecart*ecart;
1937  }
1938  var /= (Double_t)ndim;
1939  fT1d_sig_cor_ss[i0StexEcha] = sqrt(var);
1940  }
1942 }
int i
Definition: DBlmapReader.cc:9
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
Double_t * fT1d_sig_cor_ss
Definition: TEcnaRun.h:470
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Double_t *** fT3d_cor_ss
Definition: TEcnaRun.h:439
T sqrt(T t)
Definition: SSEVec.h:46
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t * fTagSigCorss
Definition: TEcnaRun.h:471
void MeanCorrelationsBetweenSamples()
Definition: TEcnaRun.cc:1820
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
Int_t fSigCorssCalc
Definition: TEcnaHeader.h:89
Int_t * fTagMeanCorss
Definition: TEcnaRun.h:456
Double_t * fT1d_ev_cor_ss
Definition: TEcnaRun.h:455
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::StandardCalculations ( )

Definition at line 1275 of file TEcnaRun.cc.

References AverageHighFrequencyNoise(), AverageLowFrequencyNoise(), AverageMeanCorrelationsBetweenSamples(), AveragePedestals(), AverageSigmaOfCorrelationsBetweenSamples(), AverageTotalNoise(), CorrelationsBetweenSamples(), HighFrequencyNoise(), LowFrequencyNoise(), MeanCorrelationsBetweenSamples(), Pedestals(), SampleMeans(), SampleSigmas(), SigmaOfCorrelationsBetweenSamples(), and TotalNoise().

Referenced by TEcnaGui::Calculations().

1276 {
1277  SampleMeans();
1278  SampleSigmas();
1280 
1281  Pedestals(); // => mean over Xtal's
1282  TotalNoise();
1287 
1288  AveragePedestals(); // Average => mean over Stin's (Tower if EB, SC if EE)
1294 }
void AverageTotalNoise()
Definition: TEcnaRun.cc:2012
void TotalNoise()
Definition: TEcnaRun.cc:1625
void SigmaOfCorrelationsBetweenSamples()
Definition: TEcnaRun.cc:1886
void AverageMeanCorrelationsBetweenSamples()
Definition: TEcnaRun.cc:2192
void AverageLowFrequencyNoise()
Definition: TEcnaRun.cc:2072
void SampleMeans()
Definition: TEcnaRun.cc:1326
void LowFrequencyNoise()
Definition: TEcnaRun.cc:1678
void AverageSigmaOfCorrelationsBetweenSamples()
Definition: TEcnaRun.cc:2252
void MeanCorrelationsBetweenSamples()
Definition: TEcnaRun.cc:1820
void SampleSigmas()
Definition: TEcnaRun.cc:1378
void AveragePedestals()
Definition: TEcnaRun.cc:1951
void HighFrequencyNoise()
Definition: TEcnaRun.cc:1748
void AverageHighFrequencyNoise()
Definition: TEcnaRun.cc:2132
void Pedestals()
Definition: TEcnaRun.cc:1580
void CorrelationsBetweenSamples()
Definition: TEcnaRun.cc:1506
void TEcnaRun::StartStopDate ( TString  c_startdate,
TString  c_stopdate 
)

Definition at line 1203 of file TEcnaRun.cc.

References fFileHeader, TEcnaHeader::fStartDate, and TEcnaHeader::fStopDate.

Referenced by EcnaAnalyzer::analyze(), and EcnaAnalyzer::~EcnaAnalyzer().

1204 {
1205 // Put the start an stop date (if they exist) in fFileHeader class attributes.
1206 
1207  fFileHeader->fStartDate = c_startdate;
1208  fFileHeader->fStopDate = c_stopdate;
1209 }
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString fStopDate
Definition: TEcnaHeader.h:61
TString fStartDate
Definition: TEcnaHeader.h:60
void TEcnaRun::StartStopTime ( time_t  t_startime,
time_t  t_stoptime 
)

Definition at line 1195 of file TEcnaRun.cc.

References fFileHeader, TEcnaHeader::fStartTime, and TEcnaHeader::fStopTime.

Referenced by EcnaAnalyzer::analyze(), and EcnaAnalyzer::~EcnaAnalyzer().

1196 {
1197 // Put the start an stop time (if they exist) in fFileHeader class attributes.
1198 
1199  fFileHeader->fStartTime = t_startime;
1200  fFileHeader->fStopTime = t_stoptime;
1201 }
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
time_t fStartTime
Definition: TEcnaHeader.h:58
time_t fStopTime
Definition: TEcnaHeader.h:59
void TEcnaRun::TotalNoise ( )

Definition at line 1625 of file TEcnaRun.cc.

References gather_cfg::cout, fCnew, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, fMiscDiag, fNbSampForCalc, fT1d_evsamp_of_sigevt, fT2d_sig, fTagSSp, fTagTno, TEcnaHeader::fTnoCalc, fTTBELL, TEcnaParEcal::MaxCrysEcnaInStex(), and SampleSigmas().

Referenced by AverageTotalNoise(), and StandardCalculations().

1626 {
1627 // Calculation, for each channel, of the expectation values
1628 // (over the samples 0 to fNbSampForCalc-1) of the sigmas
1629 // (over the events)
1630 
1631  //... preliminary calculation of the sigmas if not done yet
1632  if ( fTagSSp[0] != 1 ){SampleSigmas(); fTagSSp[0]=0;}
1633 
1634  //................... Allocation ev_ev + init to zero (mandatory)
1635  if( fT1d_evsamp_of_sigevt == 0 ){fT1d_evsamp_of_sigevt = new Double_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;}
1636  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1637  {if( fT1d_evsamp_of_sigevt[i0StexEcha] != (Double_t)0 )
1638  {fMiscDiag[12]++; fT1d_evsamp_of_sigevt[i0StexEcha] = (Double_t)0;}}
1639 
1640  //..................... Calculation
1641  if(fFlagPrint != fCodePrintNoComment){cout << "*TEcnaRun::TotalNoise()" << endl;}
1643  cout << " Calculation, for all the channels, of the expectation values (over the samples 1 to "
1644  << fNbSampForCalc << ")" << endl
1645  << " of the ADC expectation values (over the events)." << endl;}
1646 
1647  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1648  {
1649  for (Int_t i0Sample = 0; i0Sample < fNbSampForCalc; i0Sample++)
1650  {
1651  if( fT2d_sig[i0StexEcha][i0Sample] < 0)
1652  {
1653  cout << "!TEcnaRun::TotalNoise() *** ERROR ***> Negative sigma!"
1654  << fTTBELL << endl;
1655  }
1656  else
1657  {
1658  fT1d_evsamp_of_sigevt[i0StexEcha] += fT2d_sig[i0StexEcha][i0Sample];
1659  }
1660  }
1661  fT1d_evsamp_of_sigevt[i0StexEcha] /= fNbSampForCalc;
1662  }
1663  fTagTno[0] = 1; fFileHeader->fTnoCalc++;
1664 }
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t * fMiscDiag
Definition: TEcnaRun.h:378
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Double_t ** fT2d_sig
Definition: TEcnaRun.h:430
Int_t * fTagSSp
Definition: TEcnaRun.h:432
Int_t * fTagTno
Definition: TEcnaRun.h:451
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fCnew
Definition: TEcnaRun.h:373
Double_t * fT1d_evsamp_of_sigevt
Definition: TEcnaRun.h:450
void SampleSigmas()
Definition: TEcnaRun.cc:1378
Int_t fTnoCalc
Definition: TEcnaHeader.h:85
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
TString fTTBELL
Definition: TEcnaRun.h:376
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootAdcEvt ( const Int_t &  user_StexEcha,
const Int_t &  argNbSampWrite 
)

Definition at line 4062 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fFileHeader, TEcnaResultType::fMatHis, TEcnaHeader::fReqNbOfEvts, fT3d_AdcValues, fTagAdcEvt, and gCnaRootFile.

Referenced by WriteRootFile().

4063 {
4064  if (fTagAdcEvt[user_StexEcha] == 1 )
4065  {
4066  for (Int_t i0Sample = 0; i0Sample < argNbSampWrite; i0Sample++)
4067  {
4068  //...................... all the bins set to zero
4069  for (Int_t j_bin = 0; j_bin < fFileHeader->fReqNbOfEvts; j_bin++)
4070  {
4071  gCnaRootFile->fCnaIndivResult->fMatHis(i0Sample, j_bin) = (Double_t)0.;
4072  }
4073  //...................... fill the non-zero bins
4074  for (Int_t j_bin = 0; j_bin < fFileHeader->fReqNbOfEvts; j_bin++)
4075  {
4076  gCnaRootFile->fCnaIndivResult->fMatHis(i0Sample, j_bin) =
4077  fT3d_AdcValues[user_StexEcha][i0Sample][j_bin];
4078  }
4079  }
4080  }
4081 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:55
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Int_t * fTagAdcEvt
Definition: TEcnaRun.h:417
void TEcnaRun::TRootAvEvCorss ( )

Definition at line 4488 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_av_ev_corss, fTagAvMeanCorss, gCnaRootFile, and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by WriteRootFile().

4489 {
4490  if (fTagAvMeanCorss[0] == 1 ) // test 1st elt only since global calc
4491  {
4492  for (Int_t j0StexStinEcna = 0; j0StexStinEcna < fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
4493  {
4494  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexStinEcna) =
4495  fT1d_av_ev_corss[j0StexStinEcna];
4496  }
4497  }
4498 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Double_t * fT1d_av_ev_corss
Definition: TEcnaRun.h:457
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t * fTagAvMeanCorss
Definition: TEcnaRun.h:458
Int_t MaxStinEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootAvHfn ( )

Definition at line 4210 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_av_hifn, fTagAvHfn, gCnaRootFile, and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by WriteRootFile().

4211 {
4212  if (fTagAvHfn[0] == 1 )
4213  {
4214  for (Int_t j0StexStinEcna = 0; j0StexStinEcna < fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
4215  {
4216  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexStinEcna) =
4217  fT1d_av_hifn[j0StexStinEcna];
4218  }
4219  }
4220 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Double_t * fT1d_av_hifn
Definition: TEcnaRun.h:467
TEcnaNArrayD fMatHis
Int_t * fTagAvHfn
Definition: TEcnaRun.h:468
Int_t MaxStinEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootAvLfn ( )

Definition at line 4192 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_av_lofn, fTagAvLfn, gCnaRootFile, and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by WriteRootFile().

4193 {
4194  if (fTagAvLfn[0] == 1 )
4195  {
4196  for (Int_t j0StexStinEcna = 0; j0StexStinEcna < fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
4197  {
4198  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexStinEcna) =
4199  fT1d_av_lofn[j0StexStinEcna];
4200  }
4201  }
4202 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Int_t * fTagAvLfn
Definition: TEcnaRun.h:463
TEcnaNArrayD fMatHis
Int_t MaxStinEcnaInStex()
Double_t * fT1d_av_lofn
Definition: TEcnaRun.h:462
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootAvPed ( )

Definition at line 4469 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_av_mped, fTagAvPed, gCnaRootFile, and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by WriteRootFile().

4470 {
4471  if (fTagAvPed[0] == 1 )
4472  {
4473  for (Int_t j0StexStinEcna = 0; j0StexStinEcna < fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
4474  {
4475  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexStinEcna) =
4476  fT1d_av_mped[j0StexStinEcna];
4477  }
4478  }
4479 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Double_t * fT1d_av_mped
Definition: TEcnaRun.h:447
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t * fTagAvPed
Definition: TEcnaRun.h:448
Int_t MaxStinEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootAvSigCorss ( )

Definition at line 4507 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_av_sig_corss, fTagAvSigCorss, gCnaRootFile, and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by WriteRootFile().

4508 {
4509  if (fTagAvSigCorss[0] == 1 ) // test 1st elt only since global calc
4510  {
4511  for (Int_t j0StexStinEcna = 0; j0StexStinEcna < fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
4512  {
4513  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexStinEcna) =
4514  fT1d_av_sig_corss[j0StexStinEcna];
4515  }
4516  }
4517 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Double_t * fT1d_av_sig_corss
Definition: TEcnaRun.h:472
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t * fTagAvSigCorss
Definition: TEcnaRun.h:473
Int_t MaxStinEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootAvTno ( )

Definition at line 4175 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_av_totn, fTagAvTno, gCnaRootFile, and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by WriteRootFile().

4176 {
4177  if (fTagAvTno[0] == 1 )
4178  {
4179  for (Int_t j0StexStinEcna = 0; j0StexStinEcna < fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
4180  {
4181  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexStinEcna) =
4182  fT1d_av_totn[j0StexStinEcna];
4183  }
4184  }
4185 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Int_t * fTagAvTno
Definition: TEcnaRun.h:453
Double_t * fT1d_av_totn
Definition: TEcnaRun.h:452
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t MaxStinEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootCorCss ( const Int_t &  user_StexEcha,
const Int_t &  argNbSampWrite 
)

Definition at line 4334 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, TEcnaResultType::fMatMat, fT3d_cor_ss, fTagCorCss, and gCnaRootFile.

Referenced by WriteRootFile().

4335 {
4336  if (fTagCorCss[user_StexEcha] == 1 )
4337  {
4338  for (Int_t i0Sample = 0; i0Sample < argNbSampWrite; i0Sample++)
4339  {
4340  for (Int_t j0Sample = 0; j0Sample < argNbSampWrite; j0Sample++)
4341  {
4342  gCnaRootFile->fCnaIndivResult->fMatMat(i0Sample, j0Sample) =
4343  fT3d_cor_ss[user_StexEcha][i0Sample][j0Sample];
4344  }
4345  }
4346  }
4347 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaNArrayD fMatMat
Int_t * fTagCorCss
Definition: TEcnaRun.h:442
Double_t *** fT3d_cor_ss
Definition: TEcnaRun.h:439
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
void TEcnaRun::TRootCovCss ( const Int_t &  user_StexEcha,
const Int_t &  argNbSampWrite 
)

Definition at line 4313 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, TEcnaResultType::fMatMat, fT3d_cov_ss, fTagCovCss, and gCnaRootFile.

Referenced by WriteRootFile().

4314 {
4315  if (fTagCovCss[user_StexEcha] == 1 )
4316  {
4317  for (Int_t i0Sample = 0; i0Sample < argNbSampWrite; i0Sample++)
4318  {
4319  for (Int_t j0Sample = 0; j0Sample < argNbSampWrite; j0Sample++)
4320  {
4321  gCnaRootFile->fCnaIndivResult->fMatMat(i0Sample, j0Sample) =
4322  fT3d_cov_ss[user_StexEcha][i0Sample][j0Sample];
4323  }
4324  }
4325  }
4326 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaNArrayD fMatMat
Int_t * fTagCovCss
Definition: TEcnaRun.h:437
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Double_t *** fT3d_cov_ss
Definition: TEcnaRun.h:434
void TEcnaRun::TRootHFccMoStins ( )

Definition at line 4154 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatMat, fT2d_hfcc_mostins, fTagHFccMoStins, gCnaRootFile, and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by WriteRootFile().

4155 {
4156  if (fTagHFccMoStins[0] == 1 )
4157  {
4158  for (Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
4159  {
4160  for (Int_t j0StexStinEcna = 0; j0StexStinEcna < fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
4161  {
4162  gCnaRootFile->fCnaIndivResult->fMatMat(i0StexStinEcna, j0StexStinEcna) =
4163  fT2d_hfcc_mostins[i0StexStinEcna][j0StexStinEcna];
4164  }
4165  }
4166  }
4167 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaNArrayD fMatMat
Double_t ** fT2d_hfcc_mostins
Definition: TEcnaRun.h:498
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Int_t * fTagHFccMoStins
Definition: TEcnaRun.h:500
Int_t MaxStinEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootHfCor ( )

Definition at line 4291 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatMat, fT2d_hf_cor, fTagHfCor, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4292 {
4293  if (fTagHfCor[0] == 1 )
4294  {
4295  for (Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
4296  {
4297  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4298  {
4299  gCnaRootFile->fCnaIndivResult->fMatMat(i0StexEcha, j0StexEcha) =
4300  fT2d_hf_cor[i0StexEcha][j0StexEcha];
4301  }
4302  }
4303  }
4304 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaNArrayD fMatMat
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Double_t ** fT2d_hf_cor
Definition: TEcnaRun.h:489
Int_t * fTagHfCor
Definition: TEcnaRun.h:491
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootHfCov ( )

Definition at line 4270 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatMat, fT2d_hf_cov, fTagHfCov, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4271 {
4272  if (fTagHfCov[0] == 1 )
4273  {
4274  for (Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
4275  {
4276  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4277  {
4278  gCnaRootFile->fCnaIndivResult->fMatMat(i0StexEcha, j0StexEcha) =
4279  fT2d_hf_cov[i0StexEcha][j0StexEcha];
4280  }
4281  }
4282  }
4283 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaNArrayD fMatMat
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Double_t ** fT2d_hf_cov
Definition: TEcnaRun.h:485
Int_t * fTagHfCov
Definition: TEcnaRun.h:487
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootHfn ( )

Definition at line 4431 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_evevt_of_sigsamp, fTagHfn, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4432 {
4433  if (fTagHfn[0] == 1 )
4434  {
4435  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4436  {
4437  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexEcha) =
4438  fT1d_evevt_of_sigsamp[j0StexEcha];
4439  }
4440  }
4441 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Int_t * fTagHfn
Definition: TEcnaRun.h:466
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t MaxCrysEcnaInStex()
Double_t * fT1d_evevt_of_sigsamp
Definition: TEcnaRun.h:465
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootLFccMoStins ( )

Definition at line 4132 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatMat, fT2d_lfcc_mostins, fTagLFccMoStins, gCnaRootFile, and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by WriteRootFile().

4133 {
4134  if (fTagLFccMoStins[0] == 1 )
4135  {
4136  for (Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
4137  {
4138  for (Int_t j0StexStinEcna = 0; j0StexStinEcna < fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
4139  {
4140  gCnaRootFile->fCnaIndivResult->fMatMat(i0StexStinEcna, j0StexStinEcna) =
4141  fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna];
4142  }
4143  }
4144  }
4145 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaNArrayD fMatMat
Int_t * fTagLFccMoStins
Definition: TEcnaRun.h:496
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Int_t MaxStinEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
Double_t ** fT2d_lfcc_mostins
Definition: TEcnaRun.h:494
void TEcnaRun::TRootLfCor ( )

Definition at line 4249 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatMat, fT2d_lf_cor, fTagLfCor, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4250 {
4251  if (fTagLfCor[0] == 1 )
4252  {
4253  for (Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
4254  {
4255  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4256  {
4257  gCnaRootFile->fCnaIndivResult->fMatMat(i0StexEcha, j0StexEcha) =
4258  fT2d_lf_cor[i0StexEcha][j0StexEcha];
4259  }
4260  }
4261  }
4262 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaNArrayD fMatMat
Int_t * fTagLfCor
Definition: TEcnaRun.h:482
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Double_t ** fT2d_lf_cor
Definition: TEcnaRun.h:480
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootLfCov ( )

Definition at line 4228 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatMat, fT2d_lf_cov, fTagLfCov, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4229 {
4230  if (fTagLfCov[0] == 1 )
4231  {
4232  for (Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
4233  {
4234  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4235  {
4236  gCnaRootFile->fCnaIndivResult->fMatMat(i0StexEcha, j0StexEcha) =
4237  fT2d_lf_cov[i0StexEcha][j0StexEcha];
4238  }
4239  }
4240  }
4241 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaNArrayD fMatMat
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Int_t * fTagLfCov
Definition: TEcnaRun.h:478
Int_t MaxCrysEcnaInStex()
Double_t ** fT2d_lf_cov
Definition: TEcnaRun.h:476
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootLfn ( )

Definition at line 4412 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_sigevt_of_evsamp, fTagLfn, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4413 {
4414  if (fTagLfn[0] == 1 )
4415  {
4416  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4417  {
4418  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexEcha) =
4419  fT1d_sigevt_of_evsamp[j0StexEcha];
4420  }
4421  }
4422 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Double_t * fT1d_sigevt_of_evsamp
Definition: TEcnaRun.h:460
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t * fTagLfn
Definition: TEcnaRun.h:461
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootMeanCorss ( )

Definition at line 4393 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_ev_cor_ss, fTagMeanCorss, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4394 {
4395  if (fTagMeanCorss[0] == 1 )
4396  {
4397  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4398  {
4399  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexEcha) =
4400  fT1d_ev_cor_ss[j0StexEcha];
4401  }
4402  }
4403 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t MaxCrysEcnaInStex()
Int_t * fTagMeanCorss
Definition: TEcnaRun.h:456
Double_t * fT1d_ev_cor_ss
Definition: TEcnaRun.h:455
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootMSp ( const Int_t &  argNbSampWrite)

Definition at line 4089 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT2d_ev, fTagMSp, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4090 {
4091  if (fTagMSp[0] == 1 )
4092  {
4093  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4094  {
4095  for (Int_t i0Sample = 0; i0Sample < argNbSampWrite; i0Sample++)
4096  {
4097  gCnaRootFile->fCnaIndivResult->fMatHis( j0StexEcha, i0Sample) =
4098  fT2d_ev[j0StexEcha][i0Sample];
4099  }
4100  }
4101  }
4102 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Double_t ** fT2d_ev
Definition: TEcnaRun.h:426
TEcnaNArrayD fMatHis
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootNbOfEvts ( const Int_t &  argNbSampWrite)

Definition at line 4041 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT2d_NbOfEvts, fTagNbOfEvts, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4042 {
4043  if (fTagNbOfEvts[0] == 1 )
4044  {
4045  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4046  {
4047  for (Int_t i0Sample = 0; i0Sample < argNbSampWrite; i0Sample++)
4048  {
4049  gCnaRootFile->fCnaIndivResult->fMatHis(j0StexEcha, i0Sample) =
4050  fT2d_NbOfEvts[j0StexEcha][i0Sample];
4051  }
4052  }
4053  }
4054 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t * fTagNbOfEvts
Definition: TEcnaRun.h:421
Int_t MaxCrysEcnaInStex()
Int_t ** fT2d_NbOfEvts
Definition: TEcnaRun.h:419
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootPed ( )

Definition at line 4356 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_ev_ev, fTagPed, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4357 {
4358  if (fTagPed[0] == 1 )
4359  {
4360  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4361  {
4362  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexEcha) =
4363  fT1d_ev_ev[j0StexEcha];
4364  }
4365  }
4366 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Int_t * fTagPed
Definition: TEcnaRun.h:446
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Double_t * fT1d_ev_ev
Definition: TEcnaRun.h:445
TEcnaNArrayD fMatHis
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootSigCorss ( )

Definition at line 4450 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_sig_cor_ss, fTagSigCorss, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4451 {
4452  if (fTagSigCorss[0] == 1 )
4453  {
4454  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4455  {
4456  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexEcha) =
4457  fT1d_sig_cor_ss[j0StexEcha];
4458  }
4459  }
4460 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Double_t * fT1d_sig_cor_ss
Definition: TEcnaRun.h:470
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t * fTagSigCorss
Definition: TEcnaRun.h:471
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootSSp ( const Int_t &  argNbSampWrite)

Definition at line 4110 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT2d_sig, fTagSSp, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4111 {
4112  if (fTagSSp[0] == 1 )
4113  {
4114  for (Int_t j0StexEcha=0; j0StexEcha<fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4115  {
4116  for (Int_t i0Sample=0; i0Sample<argNbSampWrite; i0Sample++)
4117  {
4118  gCnaRootFile->fCnaIndivResult->fMatHis(j0StexEcha, i0Sample) =
4119  fT2d_sig[j0StexEcha][i0Sample];
4120  }
4121  }
4122  }
4123 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Double_t ** fT2d_sig
Definition: TEcnaRun.h:430
Int_t * fTagSSp
Definition: TEcnaRun.h:432
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootStinNumbers ( )

Definition at line 4023 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_StexStinFromIndex, fTagStinNumbers, gCnaRootFile, and TEcnaParEcal::MaxStinEcnaInStex().

Referenced by WriteRootFile().

4024 {
4025  if (fTagStinNumbers[0] == 1 )
4026  {
4027  for (Int_t j0StexStinEcna = 0; j0StexStinEcna < fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
4028  {
4029  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexStinEcna) =
4030  fT1d_StexStinFromIndex[j0StexStinEcna];
4031  }
4032  }
4033 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
Int_t * fTagStinNumbers
Definition: TEcnaRun.h:424
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
TEcnaNArrayD fMatHis
Int_t MaxStinEcnaInStex()
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRun.h:423
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::TRootTno ( )

Definition at line 4374 of file TEcnaRun.cc.

References TEcnaRootFile::fCnaIndivResult, fEcal, TEcnaResultType::fMatHis, fT1d_evsamp_of_sigevt, fTagTno, gCnaRootFile, and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteRootFile().

4375 {
4376  if (fTagTno[0] == 1 )
4377  {
4378  for (Int_t j0StexEcha = 0; j0StexEcha < fEcal->MaxCrysEcnaInStex(); j0StexEcha++)
4379  {
4380  gCnaRootFile->fCnaIndivResult->fMatHis(0, j0StexEcha) =
4381  fT1d_evsamp_of_sigevt[j0StexEcha];
4382  }
4383  }
4384 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Int_t * fTagTno
Definition: TEcnaRun.h:451
TEcnaNArrayD fMatHis
Double_t * fT1d_evsamp_of_sigevt
Definition: TEcnaRun.h:450
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
Bool_t TEcnaRun::WriteNewRootFile ( const TString  TypAna)

Definition at line 3067 of file TEcnaRun.cc.

References gather_cfg::cout, fCnaWrite, fCodePrintAllComments, fFileHeader, TEcnaHeader::fFirstReqEvtNumber, fFlagPrint, TEcnaHeader::fLastReqEvtNumber, TEcnaWrite::fMakeResultsFileName(), fNbSampForCalc, fNewRootFileName, fNewRootFileNameShort, TEcnaHeader::fReqNbOfEvts, TEcnaHeader::fRunNumber, TEcnaHeader::fStartDate, TEcnaHeader::fStartTime, TEcnaHeader::fStex, TEcnaHeader::fStopDate, TEcnaHeader::fStopTime, TEcnaWrite::GetRootFileName(), TEcnaWrite::GetRootFileNameShort(), TEcnaWrite::RegisterFileParameters(), and WriteRootFile().

Referenced by TEcnaGui::Calculations().

3067  {
3068 //Write a new Root file. File name automatically generated by fCnaWrite->fMakeResultsFileName()
3069 //called here.
3070 
3071  Bool_t ok_write = kFALSE;
3072 
3078 
3079  fCnaWrite->fMakeResultsFileName(); // set fRootFileName, fRootFileNameShort
3082 
3083  const Text_t *FileShortName = (const Text_t *)fNewRootFileNameShort.Data();
3084 
3086  cout << "*TEcnaRun::WriteNewRootFile()> Results are going to be written in the ROOT file: " << endl
3087  << " " << fNewRootFileNameShort.Data() << endl;}
3088 
3089  ok_write = WriteRootFile(FileShortName, fNbSampForCalc);
3090 
3091  return ok_write;
3092 }
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:55
TString fStopDate
Definition: TEcnaHeader.h:61
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)
Definition: TEcnaWrite.cc:609
Bool_t WriteRootFile()
Definition: TEcnaRun.cc:3015
Int_t fNbSampForCalc
Definition: TEcnaRun.h:408
Int_t fFlagPrint
Definition: TEcnaRun.h:509
TString fStartDate
Definition: TEcnaHeader.h:60
Int_t fFirstReqEvtNumber
Definition: TEcnaHeader.h:53
TString fNewRootFileNameShort
Definition: TEcnaRun.h:401
time_t fStartTime
Definition: TEcnaHeader.h:58
time_t fStopTime
Definition: TEcnaHeader.h:59
Int_t fLastReqEvtNumber
Definition: TEcnaHeader.h:54
tuple cout
Definition: gather_cfg.py:121
Int_t fRunNumber
Definition: TEcnaHeader.h:52
TString GetRootFileNameShort()
Definition: TEcnaWrite.cc:385
TString fNewRootFileName
Definition: TEcnaRun.h:400
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:639
TString GetRootFileName()
Definition: TEcnaWrite.cc:384
TEcnaWrite * fCnaWrite
Definition: TEcnaRun.h:388
Bool_t TEcnaRun::WriteRootFile ( )

Definition at line 3015 of file TEcnaRun.cc.

References gather_cfg::cout, fCnaWrite, fCodePrintAllComments, fCodePrintNoComment, fEcal, fFileHeader, fFlagPrint, TEcnaHeader::fNbOfSamples, fT2d_NbOfEvts, fTTBELL, TEcnaWrite::GetRootFileName(), TEcnaWrite::GetRootFileNameShort(), and TEcnaParEcal::MaxCrysEcnaInStex().

Referenced by WriteNewRootFile().

3015  {
3016 //Write the Root file.
3017 //File name automatically generated by fCnaWrite->fMakeResultsFileName()
3018 //previously called in GetReadyToCompute().
3019 
3020  Bool_t ok_write = kFALSE;
3021 
3022  //============================= check number of found events
3023  Int_t nCountEvts = 0;
3024 
3025  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
3026  {for(Int_t i0Sample=0; i0Sample<fFileHeader->fNbOfSamples; i0Sample++)
3027  {nCountEvts += fT2d_NbOfEvts[i0StexEcha][i0Sample];}}
3028 
3029  if ( nCountEvts <= 0 )
3030  {
3031  //============== no write if no event found
3032  cout << "!TEcnaRun::WriteRootFile()> No event found for file " << fCnaWrite->GetRootFileNameShort().Data()
3033  << ". File will not be written." << endl;
3034  ok_write = kTRUE;
3035  }
3036  else
3037  {
3039  cout << "*TEcnaRun::WriteRootFile()> Results are going to be written in the ROOT file: " << endl
3040  << " " << fCnaWrite->GetRootFileName().Data() << endl;}
3041 
3042  const Text_t *FileShortName = (const Text_t *)fCnaWrite->GetRootFileNameShort().Data();
3043  ok_write = WriteRootFile(FileShortName, fFileHeader->fNbOfSamples);
3044 
3045  if( ok_write == kTRUE )
3046  {
3048  {cout << "*TEcnaRun::WriteRootFile()> Writing OK for file " << fCnaWrite->GetRootFileName().Data()
3049  << endl;}
3050  }
3051  else
3052  {
3053  cout << "!TEcnaRun::WriteRootFile()> Writing FAILLED for file " << fCnaWrite->GetRootFileName().Data()
3054  << fTTBELL << endl;
3055  }
3056  }
3057  return ok_write;
3058 } // end of WriteRootFile()
Int_t fCodePrintNoComment
Definition: TEcnaRun.h:510
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t fNbOfSamples
Definition: TEcnaHeader.h:51
Bool_t WriteRootFile()
Definition: TEcnaRun.cc:3015
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t MaxCrysEcnaInStex()
tuple cout
Definition: gather_cfg.py:121
TString GetRootFileNameShort()
Definition: TEcnaWrite.cc:385
Int_t ** fT2d_NbOfEvts
Definition: TEcnaRun.h:419
TString GetRootFileName()
Definition: TEcnaWrite.cc:384
TEcnaWrite * fCnaWrite
Definition: TEcnaRun.h:388
TString fTTBELL
Definition: TEcnaRun.h:376
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
Bool_t TEcnaRun::WriteRootFile ( const Text_t *  name,
Int_t &  argNbSampWrite 
)

Definition at line 3108 of file TEcnaRun.cc.

References CloseRootFile(), gather_cfg::cout, cTypAdcEvt, cTypAvHfn, cTypAvLfn, cTypAvMeanCorss, cTypAvPed, cTypAvSigCorss, cTypAvTno, cTypCorCss, cTypCovCss, cTypHFccMoStins, cTypHfCor, cTypHfCov, cTypHfn, cTypLFccMoStins, cTypLfCor, cTypLfCov, cTypLfn, cTypMeanCorss, cTypMSp, cTypNbOfEvts, cTypNumbers, cTypPed, cTypSigCorss, cTypSSp, cTypTno, TEcnaHeader::fAdcEvtCalc, TEcnaHeader::fAvHfnCalc, TEcnaHeader::fAvLfnCalc, TEcnaHeader::fAvMeanCorssCalc, TEcnaHeader::fAvPedCalc, TEcnaHeader::fAvSigCorssCalc, TEcnaHeader::fAvTnoCalc, TEcnaRootFile::fCnaIndivResult, fCnaParPaths, TEcnaRootFile::fCnaResultsTree, fCodePrintAllComments, TEcnaHeader::fCorCssCalc, TEcnaHeader::fCovCssCalc, fEcal, fFileHeader, fFlagPrint, fgMaxCar, TEcnaHeader::fHFccMoStinsCalc, TEcnaHeader::fHfCorCalc, TEcnaHeader::fHfCovCalc, TEcnaHeader::fHfnCalc, cmsPerfSuiteHarvest::file_name, TEcnaResultType::fIthElement, TEcnaHeader::fLFccMoStinsCalc, TEcnaHeader::fLfCorCalc, TEcnaHeader::fLfCovCalc, TEcnaHeader::fLfnCalc, TEcnaResultType::fMatHis, TEcnaResultType::fMatMat, TEcnaHeader::fMeanCorssCalc, TEcnaHeader::fMSpCalc, TEcnaHeader::fNbOfEvtsCalc, fOpenRootFile, TEcnaHeader::fPedCalc, TEcnaHeader::fReqNbOfEvts, TEcnaRootFile::fRootFile, TEcnaHeader::fSigCorssCalc, TEcnaHeader::fSSpCalc, TEcnaHeader::fStinNumbersCalc, fTagAdcEvt, fTagAvHfn, fTagAvLfn, fTagAvMeanCorss, fTagAvPed, fTagAvSigCorss, fTagAvTno, fTagCorCss, fTagCovCss, fTagHFccMoStins, fTagHfCor, fTagHfCov, fTagHfn, fTagLFccMoStins, fTagLfCor, fTagLfCov, fTagLfn, fTagMeanCorss, fTagMSp, fTagNbOfEvts, fTagPed, fTagSigCorss, fTagSSp, fTagStinNumbers, fTagTno, TEcnaHeader::fTnoCalc, fTTBELL, TEcnaResultType::fTypOfCnaResult, gCnaRootFile, i, TEcnaParEcal::MaxCrysEcnaInStex(), TEcnaParEcal::MaxStinEcnaInStex(), mergeVDriftHistosByStation::name, OpenRootFile(), TEcnaNArrayD::ReSet(), TEcnaParPaths::ResultsRootFilePath(), TEcnaResultType::SetSizeHis(), TEcnaResultType::SetSizeMat(), TRootAdcEvt(), TRootAvEvCorss(), TRootAvHfn(), TRootAvLfn(), TRootAvPed(), TRootAvSigCorss(), TRootAvTno(), TRootCorCss(), TRootCovCss(), TRootHFccMoStins(), TRootHfCor(), TRootHfCov(), TRootHfn(), TRootLFccMoStins(), TRootLfCor(), TRootLfCov(), TRootLfn(), TRootMeanCorss(), TRootMSp(), TRootNbOfEvts(), TRootPed(), TRootSigCorss(), TRootSSp(), TRootStinNumbers(), and TRootTno().

3109 {
3110 //Write the Root file
3111 
3112  const Text_t* file_name = name;
3113 
3114  Bool_t ok_write = kFALSE;
3115 
3116  if ( fOpenRootFile )
3117  {
3118  cout << "!TEcnaRun::WriteRootFile(...) *** ERROR ***> Writing on file already open."
3119  << fTTBELL << endl;
3120  }
3121  else
3122  {
3123  // List of the different element types and associated parameters as ordered in the ROOT file (smaller -> larger)
3124  // ==========
3125  //
3126  // WARNING *** HERE SIZES ARE THESE FOR THE BARREL (1700 Xtals) and for 10 samples ***
3127  //
3128  // Nb of Type of element Type Type Size Comment
3129  // elements Number Name
3130  //
3131  // 1 fMatHis(1,StexStin) ( 0) cTypNumbers 1*( 1, 68) = 68
3132 
3133  // 1 fMatHis(1,StexStin) (12) cTypAvPed 1*( 1, 68) = 68
3134  // 1 fMatHis(1,StexStin) ( 3) cTypAvTno 1*( 1, 68) = 68
3135  // 1 fMatHis(1,StexStin) ( 4) cTypAvLfn 1*( 1, 68) = 68
3136  // 1 fMatHis(1,StexStin) ( 5) cTypAvHfn 1*( 1, 68) = 68
3137  // 1 fMatHis(1,StexStin) (13) cTypAvMeanCorss 1*( 1, 68) = 68
3138  // 1 fMatHis(1,StexStin) (14) cTypAvSigCorss 1*( 1, 68) = 68
3139 
3140  // 1 fMatHis(1,StexEcha) (16) cTypPed 1*( 1,1700) = 1 700
3141  // 1 fMatHis(1,StexEcha) (17) cTypTno 1*( 1,1700) = 1 700
3142  // 1 fMatHis(1,StexEcha) (10) cTypMeanCorss 1*( 1,1700) = 1 700
3143  // 1 fMatHis(1,StexEcha) (18) cTypLfn 1*( 1,1700) = 1 700
3144  // 1 fMatHis(1,StexEcha) (19) cTypHfn 1*( 1,1700) = 1 700
3145  // 1 fMatHis(1,StexEcha) (11) cTypSigCorss 1*( 1,1700) = 1 700
3146 
3147  // 1 fMatMat(Stin,Stin) (23) cTypLFccMoStins 1*( 68, 68) = 4 624
3148  // 1 fMatMat(Stin,Stin) (24) cTypHFccMoStins 1*( 68, 68) = 4 624
3149 
3150  // 1 fMatHis(StexEcha, sample) (15) cTypNbOfEvts 1*(1700, 10) = 17 000
3151  // 1 fMatHis(StexEcha, sample) ( 1) cTypMSp 1*(1700, 10) = 17 000
3152  // 1 fMatHis(StexEcha, sample) ( 2) cTypSSp 1*(1700, 10) = 17 000
3153 
3154  // StexEcha fMatMat(sample, sample) ( 8) cTypCovCss 1700*( 10, 10) = 170 000
3155  // StexEcha fMatMat(sample, sample ( 9) cTypCorCss 1700*( 10, 10) = 170 000
3156 
3157  // StexEcha fMatHis(sample, bin_evt) (20) cTypAdcEvt, 1700*( 10, 150) = 2 550 000
3158 
3159  // 1 fMatMat(StexEcha, StexEcha) (21) cTypLfCov 1*(1700,1700) = 2 890 000
3160  // 1 fMatMat(StexEcha, StexEcha) (22) cTypLfCor 1*(1700,1700) = 2 890 000
3161 
3162  // 1 fMatMat(StexEcha, StexEcha) ( 6) cTypHfCov 1*(1700,1700) = 2 890 000 // (06/05/08)
3163  // 1 fMatMat(StexEcha, StexEcha) ( 7) cTypHfCor 1*(1700,1700) = 2 890 000 // (06/05/08)
3164 
3165 
3166  //......................................................................................................
3167 
3168  OpenRootFile(file_name, "RECREATE");
3169 
3170  TString typ_name = "?";
3171  Int_t v_nb_times = 0;
3172  Int_t v_dim_one = 0;
3173  Int_t v_dim_two = 0;
3174  Int_t v_size = 0;
3175  Int_t v_tot = 0;
3176  Int_t v_tot_writ = 0;
3177 
3178  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3179  //
3180  // ===> no general method and no translation to TEcnaWrite
3181  // because the fT1d.. and fT2d... arrays
3182  // are attributes of TEcnaRun (calls to the "TRootXXXX" methods)
3183  //
3184  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3185 
3186  //-------------------------- Stin numbers
3187  // 1 fMatHis(1,Stin) ( 0) cTypNumbers 1*( 1, 68) = 68
3188 
3189  Int_t MaxCar = fgMaxCar;
3190  typ_name.Resize(MaxCar);
3191  typ_name = "StinNumbers";
3192  v_nb_times = fFileHeader->fStinNumbersCalc;
3193  v_dim_one = 1;
3194  v_dim_two = fEcal->MaxStinEcnaInStex();
3195  v_size = v_nb_times*v_dim_one*v_dim_two;
3196  v_tot += v_size;
3197 
3199  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3200  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3201  << setw(9) << v_size;}
3202 
3203  for (Int_t i = 0; i < v_nb_times; i++)
3204  {
3205  if ( fTagStinNumbers[0] == 1 )
3206  {
3209  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3211  TRootStinNumbers();
3212  gCnaRootFile->fCnaResultsTree->Fill();
3213  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3214  }
3215  }
3216  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3217 
3218  //-------------------------- Average Pedestals (1 value per Stin)
3219  // 1 fMatHis(1, StexStin) (12) cTypAvPed 1*(1, 68) = 68
3220 
3221  MaxCar = fgMaxCar;
3222  typ_name.Resize(MaxCar);
3223  typ_name = "AvPed";
3224  v_nb_times = fFileHeader->fAvPedCalc;
3225  v_dim_one = 1;
3226  v_dim_two = fEcal->MaxStinEcnaInStex();
3227  v_size = v_nb_times*v_dim_one*v_dim_two;
3228  v_tot += v_size;
3229 
3231  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3232  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3233  << setw(9) << v_size;}
3234 
3235  for (Int_t i = 0; i < v_nb_times; i++)
3236  {
3237  if ( fTagAvPed[0] == 1 )
3238  {
3241  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3243  TRootAvPed();
3244  gCnaRootFile->fCnaResultsTree->Fill();
3245  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3246  }
3247  }
3248  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3249 
3250  //-------------------------- Average Total noise
3251  // StexEcha fMatHis(1, StexStin) ( 3) cTypAvTno 1*(1, 68) = 68
3252 
3253  MaxCar = fgMaxCar;
3254  typ_name.Resize(MaxCar);
3255  typ_name = "AvTno";
3256  v_nb_times = fFileHeader->fAvTnoCalc;
3257  v_dim_one = 1;
3258  v_dim_two = fEcal->MaxStinEcnaInStex();
3259  v_size = v_nb_times*v_dim_one*v_dim_two;
3260  v_tot += v_size;
3261 
3263  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3264  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3265  << setw(9) << v_size;}
3266 
3267  for (Int_t i = 0; i < v_nb_times; i++)
3268  {
3269  if ( fTagAvTno[0] == 1 )
3270  {
3273  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3275  TRootAvTno();
3276  gCnaRootFile->fCnaResultsTree->Fill();
3277  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3278  }
3279  }
3280  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3281 
3282  //-------------------------- Average Low frequency noise
3283  // 1 fMatHis(1, StexStin) ( 4) cTypAvLfn 1*(1, 68) = 68
3284 
3285  MaxCar = fgMaxCar;
3286  typ_name.Resize(MaxCar);
3287  typ_name = "AvLfn";
3288  v_nb_times = fFileHeader->fAvLfnCalc;
3289  v_dim_one = 1;
3290  v_dim_two = fEcal->MaxStinEcnaInStex();
3291  v_size = v_nb_times*v_dim_one*v_dim_two;
3292  v_tot += v_size;
3293 
3295  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3296  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3297  << setw(9) << v_size;}
3298 
3299  for (Int_t i = 0; i < v_nb_times; i++)
3300  {
3301  if ( fTagAvLfn[0] == 1 )
3302  {
3305  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3307  TRootAvLfn();
3308  gCnaRootFile->fCnaResultsTree->Fill();
3309  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3310  }
3311  }
3312  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3313 
3314  //-------------------------- Average High frequency noise
3315  // 1 fMatHis(1, StexStin) ( 5) cTypAvHfn 1*(1, 68) = 68
3316 
3317  MaxCar = fgMaxCar;
3318  typ_name.Resize(MaxCar);
3319  typ_name = "AvHfn";
3320  v_nb_times = fFileHeader->fAvHfnCalc;
3321  v_dim_one = 1;
3322  v_dim_two = fEcal->MaxStinEcnaInStex();
3323  v_size = v_nb_times*v_dim_one*v_dim_two;
3324  v_tot += v_size;
3325 
3327  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3328  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3329  << setw(9) << v_size;}
3330 
3331  for (Int_t i = 0; i < v_nb_times; i++)
3332  {
3333  if ( fTagAvHfn[0] == 1 )
3334  {
3337  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3339  TRootAvHfn();
3340  gCnaRootFile->fCnaResultsTree->Fill();
3341  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3342  }
3343  }
3344  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3345 
3346  //-------------------------- Average mean cor(s,s)
3347  // 1 fMatHis(1, StexStin) (13) cTypAvMeanCorss 1*(1, 68) = 68
3348 
3349  MaxCar = fgMaxCar;
3350  typ_name.Resize(MaxCar);
3351  typ_name = "AvMeanCorss";
3352  v_nb_times = fFileHeader->fAvMeanCorssCalc;
3353  v_dim_one = 1;
3354  v_dim_two = fEcal->MaxStinEcnaInStex();
3355  v_size = v_nb_times*v_dim_one*v_dim_two;
3356  v_tot += v_size;
3357 
3359  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3360  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3361  << setw(9) << v_size;}
3362 
3363  for (Int_t i = 0; i < v_nb_times; i++)
3364  {
3365  if ( fTagAvMeanCorss[0] == 1 )
3366  {
3369  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3371  TRootAvEvCorss();
3372  gCnaRootFile->fCnaResultsTree->Fill();
3373  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3374  }
3375  }
3376  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3377 
3378  //-------------------------- Average sigma of cor(s,s)
3379  // 1 fMatHis(1, StexStin) (14) cTypAvSigCorss 1*(1, 68) = 68
3380 
3381  MaxCar = fgMaxCar;
3382  typ_name.Resize(MaxCar);
3383  typ_name = "AvSigCorss";
3384  v_nb_times = fFileHeader->fAvSigCorssCalc;
3385  v_dim_one = 1;
3386  v_dim_two = fEcal->MaxStinEcnaInStex();
3387  v_size = v_nb_times*v_dim_one*v_dim_two;
3388  v_tot += v_size;
3389 
3391  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3392  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3393  << setw(9) << v_size;}
3394 
3395  for (Int_t i = 0; i < v_nb_times; i++)
3396  {
3397  if ( fTagAvSigCorss[0] == 1 )
3398  {
3401  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3403  TRootAvSigCorss();
3404  gCnaRootFile->fCnaResultsTree->Fill();
3405  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3406  }
3407  }
3408  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3409 
3410  //-------------------------- Expectation values of the expectation values of the samples (pedestals)
3411  // 1 fMatHis(1,StexEcha) (16) cTypPed 1*( 1,1700) = 1 700
3412 
3413  MaxCar = fgMaxCar;
3414  typ_name.Resize(MaxCar);
3415  typ_name = "Ped";
3416  v_nb_times = fFileHeader->fPedCalc;
3417  v_dim_one = 1;
3418  v_dim_two = fEcal->MaxCrysEcnaInStex();
3419  v_size = v_nb_times*v_dim_one*v_dim_two;
3420  v_tot += v_size;
3421 
3423  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3424  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3425  << setw(9) << v_size;}
3426 
3427  for (Int_t i = 0; i < v_nb_times; i++)
3428  {
3429  if ( fTagPed[0] == 1 )
3430  {
3433  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3435  TRootPed();
3436  gCnaRootFile->fCnaResultsTree->Fill();
3437  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3438  }
3439  }
3440  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3441 
3442  //-------------------------- Expectation values of the sigmas the samples
3443  // 1 fMatHis(1,StexEcha) (17) cTypTno 1*( 1,1700) = 1 700
3444 
3445  MaxCar = fgMaxCar;
3446  typ_name.Resize(MaxCar);
3447  typ_name = "Tno";
3448  v_nb_times = fFileHeader->fTnoCalc;
3449  v_dim_one = 1;
3450  v_dim_two = fEcal->MaxCrysEcnaInStex();
3451  v_size = v_nb_times*v_dim_one*v_dim_two;
3452  v_tot += v_size;
3453 
3455  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3456  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3457  << setw(9) << v_size;}
3458 
3459  for (Int_t i = 0; i < v_nb_times; i++)
3460  {
3461  if ( fTagTno[0] == 1 )
3462  {
3465  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3467  TRootTno();
3468  gCnaRootFile->fCnaResultsTree->Fill();
3469  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3470  }
3471  }
3472  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3473 
3474  //-------------------------- Expectation values of the correlations between the samples
3475  // 1 fMatHis(1,StexEcha) (10) cTypMeanCorss 1*( 1,1700) = 1 700
3476 
3477  MaxCar = fgMaxCar;
3478  typ_name.Resize(MaxCar);
3479  typ_name = "MeanCorss";
3480  v_nb_times = fFileHeader->fMeanCorssCalc;
3481  v_dim_one = 1;
3482  v_dim_two = fEcal->MaxCrysEcnaInStex();
3483  v_size = v_nb_times*v_dim_one*v_dim_two;
3484  v_tot += v_size;
3485 
3487  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3488  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3489  << setw(9) << v_size;}
3490 
3491  for (Int_t i = 0; i < v_nb_times; i++)
3492  {
3493  if ( fTagMeanCorss[0] == 1 )
3494  {
3497  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3499  TRootMeanCorss();
3500  gCnaRootFile->fCnaResultsTree->Fill();
3501  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3502  }
3503  }
3504  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3505 
3506  //-------------------------- Sigmas of the expectation values of the samples
3507  // 1 fMatHis(1,StexEcha) (18) cTypLfn 1*( 1,1700) = 1 700
3508 
3509  MaxCar = fgMaxCar;
3510  typ_name.Resize(MaxCar);
3511  typ_name = "Lfn";
3512  v_nb_times = fFileHeader->fLfnCalc;
3513  v_dim_one = 1;
3514  v_dim_two = fEcal->MaxCrysEcnaInStex();
3515  v_size = v_nb_times*v_dim_one*v_dim_two;
3516  v_tot += v_size;
3517 
3519  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3520  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3521  << setw(9) << v_size;}
3522 
3523  for (Int_t i = 0; i < v_nb_times; i++)
3524  {
3525  if ( fTagLfn[0] == 1 )
3526  {
3529  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3531  TRootLfn();
3532  gCnaRootFile->fCnaResultsTree->Fill();
3533  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3534  }
3535  }
3536  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3537 
3538  //-------------------------- Sigmas of the sigmas of the samples
3539  // 1 fMatHis(1,StexEcha) (19) cTypHfn 1*( 1,1700) = 1 700
3540 
3541  MaxCar = fgMaxCar;
3542  typ_name.Resize(MaxCar);
3543  typ_name = "Hfn";
3544  v_nb_times = fFileHeader->fHfnCalc;
3545  v_dim_one = 1;
3546  v_dim_two = fEcal->MaxCrysEcnaInStex();
3547  v_size = v_nb_times*v_dim_one*v_dim_two;
3548  v_tot += v_size;
3549 
3551  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3552  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3553  << setw(9) << v_size;}
3554 
3555  for (Int_t i = 0; i < v_nb_times; i++)
3556  {
3557  if ( fTagHfn[0] == 1 )
3558  {
3561  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3563  TRootHfn();
3564  gCnaRootFile->fCnaResultsTree->Fill();
3565  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3566  }
3567  }
3568  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3569 
3570  //-------------------------- Sigmas of the correlations between the samples
3571  // 1 fMatHis(1,StexEcha) (11) cTypSigCorss 1*( 1,1700) = 1 700
3572 
3573  MaxCar = fgMaxCar;
3574  typ_name.Resize(MaxCar);
3575  typ_name = "SigCorss";
3576  v_nb_times = fFileHeader->fSigCorssCalc;
3577  v_dim_one = 1;
3578  v_dim_two = fEcal->MaxCrysEcnaInStex();
3579  v_size = v_nb_times*v_dim_one*v_dim_two;
3580  v_tot += v_size;
3581 
3583  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3584  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3585  << setw(9) << v_size;}
3586 
3587  for (Int_t i = 0; i < v_nb_times; i++)
3588  {
3589  if ( fTagSigCorss[0] == 1 )
3590  {
3593  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3595  TRootSigCorss();
3596  gCnaRootFile->fCnaResultsTree->Fill();
3597  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3598  }
3599  }
3600  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3601 
3602  //----- Mean Covariances between StexEchas (averaged over samples) for all (Stin_X,Stin_Y)
3603  // 1 fMatMat(Stin,Stin) (23) cTypLFccMoStins 1*( 68, 68) = 4 624
3604 
3605  MaxCar = fgMaxCar;
3606  typ_name.Resize(MaxCar);
3607  typ_name = "LFccMoStins";
3608  v_nb_times = fFileHeader->fLFccMoStinsCalc;
3609  v_dim_one = fEcal->MaxStinEcnaInStex();
3610  v_dim_two = fEcal->MaxStinEcnaInStex();
3611  v_size = v_nb_times*v_dim_one*v_dim_two;
3612  v_tot += v_size;
3613 
3615  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3616  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3617  << setw(9) << v_size;}
3618 
3619  for (Int_t i = 0; i < v_nb_times; i++)
3620  {
3621  if ( fTagLFccMoStins[0] == 1 )
3622  {
3625  gCnaRootFile->fCnaIndivResult->SetSizeMat(v_dim_one,v_dim_two);
3627  TRootLFccMoStins();
3628  gCnaRootFile->fCnaResultsTree->Fill();
3629  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3630  }
3631  }
3632  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3633 
3634  //----- Mean Correlations between StexEchas (averaged over samples) for all (Stin_X,Stin_Y)
3635  // 1 fMatMat(Stin,Stin) (24) cTypHFccMoStins 1*( 68, 68) = 4 624
3636 
3637  MaxCar = fgMaxCar;
3638  typ_name.Resize(MaxCar);
3639  typ_name = "HFccMoStins";
3640  v_nb_times = fFileHeader->fHFccMoStinsCalc;
3641  v_dim_one = fEcal->MaxStinEcnaInStex();
3642  v_dim_two = fEcal->MaxStinEcnaInStex();
3643  v_size = v_nb_times*v_dim_one*v_dim_two;
3644  v_tot += v_size;
3645 
3647  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3648  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3649  << setw(9) << v_size;}
3650 
3651  for (Int_t i = 0; i < v_nb_times; i++)
3652  {
3653  if ( fTagHFccMoStins[0] == 1 )
3654  {
3657  gCnaRootFile->fCnaIndivResult->SetSizeMat(v_dim_one,v_dim_two);
3659  TRootHFccMoStins();
3660  gCnaRootFile->fCnaResultsTree->Fill();
3661  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3662  }
3663  }
3664  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3665 
3666  //-------------------------- Numbers of found events (NbOfEvts)
3667  // 1 fMatHis(StexEcha, sample) (15) cTypNbOfEvts 1*(1700, 10) = 17 000
3668 
3669  MaxCar = fgMaxCar;
3670  typ_name.Resize(MaxCar);
3671  typ_name = "NbOfEvts";
3672  v_nb_times = fFileHeader->fNbOfEvtsCalc;
3673  v_dim_one = fEcal->MaxCrysEcnaInStex();
3674  v_dim_two = argNbSampWrite;
3675  v_size = v_nb_times*v_dim_one*v_dim_two;
3676  v_tot += v_size;
3677 
3679  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3680  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3681  << setw(9) << v_size;}
3682 
3683  for (Int_t i = 0; i < v_nb_times; i++)
3684  {
3685  if ( fTagNbOfEvts[0] == 1 )
3686  {
3689  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3691  TRootNbOfEvts(argNbSampWrite);
3692  gCnaRootFile->fCnaResultsTree->Fill();
3693  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3694  }
3695  }
3696  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3697 
3698  //-------------------------- Expectation values of the samples
3699  // 1 fMatHis(StexEcha, sample) ( 1) cTypMSp 1*(1700, 10) = 17 000
3700 
3701  MaxCar = fgMaxCar;
3702  typ_name.Resize(MaxCar);
3703  typ_name = "MSp";
3704  v_nb_times = fFileHeader->fMSpCalc;
3705  v_dim_one = fEcal->MaxCrysEcnaInStex();
3706  v_dim_two = argNbSampWrite;
3707  v_size = v_nb_times*v_dim_one*v_dim_two;
3708  v_tot += v_size;
3709 
3711  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3712  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3713  << setw(9) << v_size;}
3714 
3715  for (Int_t i = 0; i < v_nb_times; i++)
3716  {
3717  if ( fTagMSp[0] == 1 )
3718  {
3721  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3723  TRootMSp(argNbSampWrite);
3724  gCnaRootFile->fCnaResultsTree->Fill();
3725  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3726  }
3727  }
3728  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3729 
3730  //-------------------------- Sigmas of the samples
3731  // 1 fMatHis(StexEcha, sample) ( 2) cTypSSp 1*(1700, 10) = 17 000
3732 
3733  MaxCar = fgMaxCar;
3734  typ_name.Resize(MaxCar);
3735  typ_name = "SSp";
3736  v_nb_times = fFileHeader->fSSpCalc;
3737  v_dim_one = fEcal->MaxCrysEcnaInStex();
3738  v_dim_two = argNbSampWrite;
3739  v_size = v_nb_times*v_dim_one*v_dim_two;
3740  v_tot += v_size;
3741 
3743  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3744  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3745  << setw(9) << v_size;}
3746 
3747  for (Int_t i = 0; i < v_nb_times; i++)
3748  {
3749  if ( fTagSSp[0] == 1 )
3750  {
3753  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3755  TRootSSp(argNbSampWrite);
3756  gCnaRootFile->fCnaResultsTree->Fill();
3757  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3758  }
3759  }
3760  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3761 
3762  //-------------------------- Covariances between samples
3763 
3764  // StexEcha fMatMat(sample, sample) ( 8) cTypCovCss 1700*( 10, 10) = 170 000
3765 
3766  MaxCar = fgMaxCar;
3767  typ_name.Resize(MaxCar);
3768  typ_name = "CovCss";
3769  v_nb_times = fFileHeader->fCovCssCalc;
3770  v_dim_one = argNbSampWrite;
3771  v_dim_two = argNbSampWrite;
3772  v_size = v_nb_times*v_dim_one*v_dim_two;
3773  v_tot += v_size;
3774 
3776  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3777  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3778  << setw(9) << v_size;}
3779 
3780  for (Int_t i0StexEcha = 0; i0StexEcha < v_nb_times; i0StexEcha++)
3781  {
3782  if ( fTagCovCss[i0StexEcha] == 1 )
3783  {
3785  gCnaRootFile->fCnaIndivResult->fIthElement = i0StexEcha;
3786  gCnaRootFile->fCnaIndivResult->SetSizeMat(v_dim_one,v_dim_two);
3788  TRootCovCss(i0StexEcha, argNbSampWrite);
3789  gCnaRootFile->fCnaResultsTree->Fill();
3790  if( i0StexEcha == 0 && fFlagPrint == fCodePrintAllComments)
3791  {cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3792  }
3793  }
3794  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3795 
3796  //-------------------------- Correlations between samples
3797  // StexEcha fMatMat(sample, sample) ( 9) cTypCorCss 1700*( 10, 10) = 170 000
3798 
3799  MaxCar = fgMaxCar;
3800  typ_name.Resize(MaxCar);
3801  typ_name = "CorCss";
3802  v_nb_times = fFileHeader->fCorCssCalc;
3803  v_dim_one = argNbSampWrite;
3804  v_dim_two = argNbSampWrite;
3805  v_size = v_nb_times*v_dim_one*v_dim_two;
3806  v_tot += v_size;
3807 
3809  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3810  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3811  << setw(9) << v_size;}
3812 
3813  for (Int_t i0StexEcha = 0; i0StexEcha < v_nb_times; i0StexEcha++)
3814  {
3815  if ( fTagCorCss[i0StexEcha] == 1 )
3816  {
3818  gCnaRootFile->fCnaIndivResult->fIthElement = i0StexEcha;
3819  gCnaRootFile->fCnaIndivResult->SetSizeMat(v_dim_one,v_dim_two);
3821  TRootCorCss(i0StexEcha, argNbSampWrite);
3822  gCnaRootFile->fCnaResultsTree->Fill();
3823  if( i0StexEcha == 0 && fFlagPrint == fCodePrintAllComments)
3824  {cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3825  }
3826  }
3827  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3828 
3829  //-------------------------- Samples as a function of event = events distributions
3830  // StexEcha fMatHis(sample, bins) (20) cTypAdcEvt, 1700*( 10, 150) = 2 550 000
3831 
3832  MaxCar = fgMaxCar;
3833  typ_name.Resize(MaxCar);
3834  typ_name = "AdcEvt";
3835  v_nb_times = fFileHeader->fAdcEvtCalc;
3836  v_dim_one = argNbSampWrite;
3837  v_dim_two = fFileHeader->fReqNbOfEvts;
3838  v_size = v_nb_times*v_dim_one*v_dim_two;
3839  v_tot += v_size;
3840 
3842  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3843  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3844  << setw(9) << v_size;}
3845 
3846  for (Int_t i0StexEcha = 0; i0StexEcha < v_nb_times; i0StexEcha++)
3847  {
3848  if ( fTagAdcEvt[i0StexEcha] == 1 )
3849  {
3851  gCnaRootFile->fCnaIndivResult->fIthElement = i0StexEcha;
3852  gCnaRootFile->fCnaIndivResult->SetSizeHis(v_dim_one,v_dim_two);
3854  TRootAdcEvt(i0StexEcha, argNbSampWrite);
3855  gCnaRootFile->fCnaResultsTree->Fill();
3856  if( i0StexEcha == 0 && fFlagPrint == fCodePrintAllComments )
3857  {cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3858  }
3859  }
3860  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3861 
3862  //-------------------------- Low Frequency Covariances between StexEchas
3863  // sample fMatMat(StexEcha, StexEcha) (21) cTypLfCov 1*(1700,1700) = 2 890 000
3864 
3865  MaxCar = fgMaxCar;
3866  typ_name.Resize(MaxCar);
3867  typ_name = "LfCov";
3868  v_nb_times = fFileHeader->fLfCovCalc;
3869  v_dim_one = fEcal->MaxCrysEcnaInStex();
3870  v_dim_two = fEcal->MaxCrysEcnaInStex();
3871  v_size = v_nb_times*v_dim_one*v_dim_two;
3872  v_tot += v_size;
3873 
3875  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3876  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3877  << setw(9) << v_size;}
3878 
3879  for (Int_t i = 0; i < v_nb_times; i++)
3880  { //=================================== Record type EB
3881  if ( fTagLfCov[0] == 1 )
3882  {
3885  gCnaRootFile->fCnaIndivResult->SetSizeMat(v_dim_one,v_dim_two);
3887  TRootLfCov();
3888  gCnaRootFile->fCnaResultsTree->Fill();
3889  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3890  }
3891  }
3892  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3893 
3894  //-------------------------- Low Frequency Correlations between StexEchas
3895  // sample fMatMat(StexEcha, StexEcha) (22) cTypLfCor 1*(1700,1700) = 2 890 000
3896 
3897  MaxCar = fgMaxCar;
3898  typ_name.Resize(MaxCar);
3899  typ_name = "LfCor";
3900  v_nb_times = fFileHeader->fLfCorCalc;
3901  v_dim_one = fEcal->MaxCrysEcnaInStex();
3902  v_dim_two = fEcal->MaxCrysEcnaInStex();
3903  v_size = v_nb_times*v_dim_one*v_dim_two;
3904  v_tot += v_size;
3905 
3907  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3908  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3909  << setw(9) << v_size;}
3910 
3911  for (Int_t i = 0; i < v_nb_times; i++)
3912  {
3913  if ( fTagLfCor[0] == 1 )
3914  {
3917  gCnaRootFile->fCnaIndivResult->SetSizeMat(v_dim_one,v_dim_two);
3919  TRootLfCor();
3920  gCnaRootFile->fCnaResultsTree->Fill();
3921  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3922  }
3923  }
3924  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3925 
3926  //-------------------------- High Frequency Covariances between StexEchas
3927  // sample fMatMat(StexEcha, StexEcha) (6) cTypHfCov 1*(1700,1700) = 2 890 000
3928 
3929  MaxCar = fgMaxCar;
3930  typ_name.Resize(MaxCar);
3931  typ_name = "HfCov";
3932  v_nb_times = fFileHeader->fHfCovCalc;
3933  v_dim_one = fEcal->MaxCrysEcnaInStex();
3934  v_dim_two = fEcal->MaxCrysEcnaInStex();
3935  v_size = v_nb_times*v_dim_one*v_dim_two;
3936  v_tot += v_size;
3937 
3939  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3940  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3941  << setw(9) << v_size;}
3942 
3943  for (Int_t i = 0; i < v_nb_times; i++)
3944  {
3945  if ( fTagHfCov[0] == 1 )
3946  {
3949  gCnaRootFile->fCnaIndivResult->SetSizeMat(v_dim_one,v_dim_two);
3951  TRootHfCov();
3952  gCnaRootFile->fCnaResultsTree->Fill();
3953  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3954  }
3955  }
3956  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3957 
3958  //-------------------------- High Frequency Correlations between StexEchas
3959  // sample fMatMat(StexEcha, StexEcha) (7) cTypHfCor 1*(1700,1700) = 2 890 000
3960 
3961  MaxCar = fgMaxCar;
3962  typ_name.Resize(MaxCar);
3963  typ_name = "HfCor";
3964  v_nb_times = fFileHeader->fHfCorCalc;
3965  v_dim_one = fEcal->MaxCrysEcnaInStex();
3966  v_dim_two = fEcal->MaxCrysEcnaInStex();
3967  v_size = v_nb_times*v_dim_one*v_dim_two;
3968  v_tot += v_size;
3969 
3971  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
3972  << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
3973  << setw(9) << v_size;}
3974 
3975  for (Int_t i = 0; i < v_nb_times; i++)
3976  {
3977  if ( fTagHfCor[0] == 1 )
3978  {
3981  gCnaRootFile->fCnaIndivResult->SetSizeMat(v_dim_one,v_dim_two);
3983  TRootHfCor();
3984  gCnaRootFile->fCnaResultsTree->Fill();
3985  if( i == 0 && fFlagPrint == fCodePrintAllComments ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
3986  }
3987  }
3988  if(fFlagPrint == fCodePrintAllComments){cout << endl;}
3989 
3990  //---------------------------------------------- WRITING
3991  //...................................... file
3992  gCnaRootFile->fRootFile->Write();
3993  //...................................... header
3994  fFileHeader->Write();
3995 
3996  //...................................... status message
3998  cout << "*TEcnaRun::WriteRootFile(...)> " << setw(20) << "TOTAL: "
3999  << setw(21) << "CALCULATED = " << setw(9) << v_tot
4000  << " => WRITTEN ON FILE = " << setw(9) << v_tot_writ << endl;}
4001 
4003  cout << "*TEcnaRun::WriteRootFile(...)> Write OK in file " << file_name << " in directory:" << endl
4004  << " " << fCnaParPaths->ResultsRootFilePath().Data()
4005  << endl;}
4006 
4007  ok_write = kTRUE;
4008 
4009  //...................................... close
4010  CloseRootFile(file_name);
4011  }
4012  return ok_write;
4013 } //-------------- End of WriteRootFile(...) -----------------------
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TEcnaNArrayD fMatMat
void TRootAdcEvt(const Int_t &, const Int_t &)
Definition: TEcnaRun.cc:4062
int i
Definition: DBlmapReader.cc:9
Int_t * fTagCorCss
Definition: TEcnaRun.h:442
Int_t fHFccMoStinsCalc
Definition: TEcnaHeader.h:83
void TRootHfn()
Definition: TEcnaRun.cc:4431
Int_t * fTagLFccMoStins
Definition: TEcnaRun.h:496
Int_t fAvLfnCalc
Definition: TEcnaHeader.h:73
Int_t fSSpCalc
Definition: TEcnaHeader.h:71
Bool_t fOpenRootFile
Definition: TEcnaRun.h:395
Int_t * fTagStinNumbers
Definition: TEcnaRun.h:424
Int_t * fTagLfCor
Definition: TEcnaRun.h:482
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRun.cc:2926
void TRootSigCorss()
Definition: TEcnaRun.cc:4450
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
void TRootSSp(const Int_t &)
Definition: TEcnaRun.cc:4110
Int_t fHfnCalc
Definition: TEcnaHeader.h:88
void TRootLfCor()
Definition: TEcnaRun.cc:4249
void TRootLFccMoStins()
Definition: TEcnaRun.cc:4132
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Int_t * fTagCovCss
Definition: TEcnaRun.h:437
Int_t fAvMeanCorssCalc
Definition: TEcnaHeader.h:92
void TRootCovCss(const Int_t &, const Int_t &)
Definition: TEcnaRun.cc:4313
Int_t * fTagPed
Definition: TEcnaRun.h:446
void TRootAvTno()
Definition: TEcnaRun.cc:4175
Int_t fHfCorCalc
Definition: TEcnaHeader.h:79
void SetSizeHis(Int_t, Int_t)
void TRootAvLfn()
Definition: TEcnaRun.cc:4192
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:55
Int_t * fTagAvTno
Definition: TEcnaRun.h:453
Int_t * fTagHfn
Definition: TEcnaRun.h:466
void TRootHfCor()
Definition: TEcnaRun.cc:4291
Int_t fMSpCalc
Definition: TEcnaHeader.h:70
void TRootAvEvCorss()
Definition: TEcnaRun.cc:4488
Int_t fNbOfEvtsCalc
Definition: TEcnaHeader.h:67
Int_t * fTagSSp
Definition: TEcnaRun.h:432
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRootFile.h:68
Int_t fMeanCorssCalc
Definition: TEcnaHeader.h:86
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRun.cc:2969
void TRootStinNumbers()
Definition: TEcnaRun.cc:4023
void TRootHFccMoStins()
Definition: TEcnaRun.cc:4154
void TRootMSp(const Int_t &)
Definition: TEcnaRun.cc:4089
Int_t fHfCovCalc
Definition: TEcnaHeader.h:78
Int_t * fTagTno
Definition: TEcnaRun.h:451
Int_t * fTagAvLfn
Definition: TEcnaRun.h:463
TEcnaNArrayD fMatHis
CnaResultTyp fTypOfCnaResult
Int_t * fTagLfn
Definition: TEcnaRun.h:461
void TRootAvHfn()
Definition: TEcnaRun.cc:4210
Int_t fCorCssCalc
Definition: TEcnaHeader.h:77
void TRootPed()
Definition: TEcnaRun.cc:4356
void TRootTno()
Definition: TEcnaRun.cc:4374
void TRootCorCss(const Int_t &, const Int_t &)
Definition: TEcnaRun.cc:4334
Int_t fAvTnoCalc
Definition: TEcnaHeader.h:72
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
Int_t * fTagAvSigCorss
Definition: TEcnaRun.h:473
Int_t fPedCalc
Definition: TEcnaHeader.h:84
Int_t * fTagHfCor
Definition: TEcnaRun.h:491
Int_t * fTagNbOfEvts
Definition: TEcnaRun.h:421
Int_t * fTagAvPed
Definition: TEcnaRun.h:448
void TRootLfn()
Definition: TEcnaRun.cc:4412
void TRootLfCov()
Definition: TEcnaRun.cc:4228
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fAvHfnCalc
Definition: TEcnaHeader.h:74
Int_t * fTagHFccMoStins
Definition: TEcnaRun.h:500
Int_t * fTagAvMeanCorss
Definition: TEcnaRun.h:458
Int_t * fTagLfCov
Definition: TEcnaRun.h:478
void SetSizeMat(Int_t, Int_t)
void ReSet(Int_t)
Int_t fAvPedCalc
Definition: TEcnaHeader.h:91
void TRootAvSigCorss()
Definition: TEcnaRun.cc:4507
Int_t * fTagHfCov
Definition: TEcnaRun.h:487
Int_t * fTagAvHfn
Definition: TEcnaRun.h:468
Int_t * fTagSigCorss
Definition: TEcnaRun.h:471
TString ResultsRootFilePath()
Int_t fLfCorCalc
Definition: TEcnaHeader.h:81
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Int_t fAdcEvtCalc
Definition: TEcnaHeader.h:69
Int_t fTnoCalc
Definition: TEcnaHeader.h:85
Int_t MaxCrysEcnaInStex()
void TRootNbOfEvts(const Int_t &)
Definition: TEcnaRun.cc:4041
Int_t fLfCovCalc
Definition: TEcnaHeader.h:80
Int_t fLFccMoStinsCalc
Definition: TEcnaHeader.h:82
Int_t * fTagAdcEvt
Definition: TEcnaRun.h:417
void TRootMeanCorss()
Definition: TEcnaRun.cc:4393
Int_t fgMaxCar
Definition: TEcnaRun.h:369
tuple cout
Definition: gather_cfg.py:121
Int_t MaxStinEcnaInStex()
Int_t fSigCorssCalc
Definition: TEcnaHeader.h:89
Int_t fLfnCalc
Definition: TEcnaHeader.h:87
void TRootHfCov()
Definition: TEcnaRun.cc:4270
Int_t fStinNumbersCalc
Definition: TEcnaHeader.h:66
TString fTTBELL
Definition: TEcnaRun.h:376
TTree * fCnaResultsTree
Definition: TEcnaRootFile.h:40
Int_t * fTagMeanCorss
Definition: TEcnaRun.h:456
Int_t fAvSigCorssCalc
Definition: TEcnaHeader.h:93
Int_t fCovCssCalc
Definition: TEcnaHeader.h:76
TFile * fRootFile
Definition: TEcnaRootFile.h:36
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TRootAvPed()
Definition: TEcnaRun.cc:4469

Member Data Documentation

Int_t TEcnaRun::fBuildEvtNotSkipped
private

Definition at line 405 of file TEcnaRun.h.

Referenced by GetSampleAdcValues(), Init(), and ~TEcnaRun().

Int_t TEcnaRun::fCdelete
private

Definition at line 374 of file TEcnaRun.h.

Referenced by Init(), and ~TEcnaRun().

Int_t TEcnaRun::fCnaCommand
private

Definition at line 371 of file TEcnaRun.h.

Referenced by Init().

Int_t TEcnaRun::fCnaError
private

Definition at line 371 of file TEcnaRun.h.

Referenced by Init().

TEcnaParCout* TEcnaRun::fCnaParCout
private

Definition at line 386 of file TEcnaRun.h.

Referenced by Init(), SetEcalSubDetector(), and TEcnaRun().

TEcnaParPaths* TEcnaRun::fCnaParPaths
private
TEcnaWrite* TEcnaRun::fCnaWrite
private

Definition at line 388 of file TEcnaRun.h.

Referenced by GetReadyToCompute(), SetEcalSubDetector(), WriteNewRootFile(), and WriteRootFile().

Int_t TEcnaRun::fCnew
private
Int_t TEcnaRun::fCodePrintAllComments
private
Int_t TEcnaRun::fCodePrintComments
private

Definition at line 510 of file TEcnaRun.h.

Referenced by Init(), and PrintComments().

Int_t TEcnaRun::fCodePrintNoComment
private
Int_t TEcnaRun::fCodePrintWarnings
private

Definition at line 510 of file TEcnaRun.h.

Referenced by Init(), PrintWarnings(), and ~TEcnaRun().

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

Definition at line 507 of file TEcnaRun.h.

TEcnaHeader* TEcnaRun::fFileHeader
private
Int_t TEcnaRun::fFlagPrint
private
TString TEcnaRun::fFlagSubDet
private
Int_t TEcnaRun::fgMaxCar
private

Definition at line 369 of file TEcnaRun.h.

Referenced by Init(), SetEcalSubDetector(), and WriteRootFile().

Int_t TEcnaRun::fMaxMsgIndexForMiscDiag
private

Definition at line 380 of file TEcnaRun.h.

Referenced by Init().

Int_t TEcnaRun::fMemoReadNumberOfEventsforSamples
private

Definition at line 412 of file TEcnaRun.h.

Referenced by Init().

Int_t* TEcnaRun::fMiscDiag
private
Int_t TEcnaRun::fNbOfMiscDiagCounters
private

Definition at line 379 of file TEcnaRun.h.

Referenced by GetReadyToReadData(), Init(), and ~TEcnaRun().

Int_t TEcnaRun::fNbSampForCalc
private
Int_t TEcnaRun::fNbSampForFic
private

Definition at line 407 of file TEcnaRun.h.

Referenced by GetReadyToCompute(), GetReadyToReadData(), GetSampleAdcValues(), and TEcnaRun().

TString TEcnaRun::fNewRootFileName
private

Definition at line 400 of file TEcnaRun.h.

Referenced by GetNewRootFileName(), and WriteNewRootFile().

TString TEcnaRun::fNewRootFileNameShort
private

Definition at line 401 of file TEcnaRun.h.

Referenced by GetNewRootFileNameShort(), and WriteNewRootFile().

Int_t TEcnaRun::fNumberOfEvents
private
TEcnaObject* TEcnaRun::fObjectManager
private

Definition at line 382 of file TEcnaRun.h.

Referenced by GetReadyToReadData(), OpenRootFile(), ReadSampleAdcValues(), and TEcnaRun().

Bool_t TEcnaRun::fOpenRootFile
private

Definition at line 395 of file TEcnaRun.h.

Referenced by CloseRootFile(), Init(), OpenRootFile(), and WriteRootFile().

Int_t TEcnaRun::fReadyToReadData
private

Definition at line 396 of file TEcnaRun.h.

Referenced by GetReadyToReadData(), GetSampleAdcValues(), and Init().

TString TEcnaRun::fRootFileName
private

Definition at line 398 of file TEcnaRun.h.

Referenced by GetRootFileName(), and ReadSampleAdcValues().

TString TEcnaRun::fRootFileNameShort
private

Definition at line 399 of file TEcnaRun.h.

Referenced by GetRootFileNameShort(), and ReadSampleAdcValues().

Int_t TEcnaRun::fSpecialStexStinNotIndexed
private

Definition at line 403 of file TEcnaRun.h.

Referenced by GetReadyToReadData(), GetSampleAdcValues(), and Init().

TString TEcnaRun::fStexName
private
Int_t TEcnaRun::fStinIndexBuilt
private

Definition at line 404 of file TEcnaRun.h.

Referenced by GetSampleAdcValues(), and Init().

TString TEcnaRun::fStinName
private
Double_t* TEcnaRun::fT1d_av_ev_corss
private

Definition at line 457 of file TEcnaRun.h.

Referenced by AverageMeanCorrelationsBetweenSamples(), Init(), TRootAvEvCorss(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_av_hifn
private

Definition at line 467 of file TEcnaRun.h.

Referenced by AverageHighFrequencyNoise(), Init(), TRootAvHfn(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_av_lofn
private

Definition at line 462 of file TEcnaRun.h.

Referenced by AverageLowFrequencyNoise(), Init(), TRootAvLfn(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_av_mped
private

Definition at line 447 of file TEcnaRun.h.

Referenced by AveragePedestals(), Init(), TRootAvPed(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_av_sig_corss
private
Double_t* TEcnaRun::fT1d_av_totn
private

Definition at line 452 of file TEcnaRun.h.

Referenced by AverageTotalNoise(), Init(), TRootAvTno(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_ev
private

Definition at line 427 of file TEcnaRun.h.

Referenced by Init(), SampleMeans(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_ev_cor_ss
private
Double_t* TEcnaRun::fT1d_ev_ev
private

Definition at line 445 of file TEcnaRun.h.

Referenced by AveragePedestals(), Init(), Pedestals(), TRootPed(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_evevt_of_sigsamp
private

Definition at line 465 of file TEcnaRun.h.

Referenced by AverageHighFrequencyNoise(), HighFrequencyNoise(), Init(), TRootHfn(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_evsamp_of_sigevt
private

Definition at line 450 of file TEcnaRun.h.

Referenced by AverageTotalNoise(), Init(), TotalNoise(), TRootTno(), and ~TEcnaRun().

Int_t* TEcnaRun::fT1d_NbOfEvts
private

Definition at line 420 of file TEcnaRun.h.

Referenced by GetReadyToReadData(), Init(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_sig
private

Definition at line 431 of file TEcnaRun.h.

Referenced by Init(), SampleSigmas(), and ~TEcnaRun().

Double_t* TEcnaRun::fT1d_sig_cor_ss
private
Double_t* TEcnaRun::fT1d_sigevt_of_evsamp
private

Definition at line 460 of file TEcnaRun.h.

Referenced by AverageLowFrequencyNoise(), Init(), LowFrequencyNoise(), TRootLfn(), and ~TEcnaRun().

Int_t* TEcnaRun::fT1d_StexStinFromIndex
private
Int_t* TEcnaRun::fT1dCrysNumbersTable
private

Definition at line 505 of file TEcnaRun.h.

Referenced by Init(), and ~TEcnaRun().

Double_t* TEcnaRun::fT2d1_hf_cor
private

Definition at line 490 of file TEcnaRun.h.

Referenced by HighFrequencyCorrelationsBetweenChannels(), Init(), and ~TEcnaRun().

Double_t* TEcnaRun::fT2d1_hf_cov
private

Definition at line 486 of file TEcnaRun.h.

Referenced by HighFrequencyCovariancesBetweenChannels(), Init(), and ~TEcnaRun().

Double_t* TEcnaRun::fT2d1_hfcc_mostins
private

Definition at line 499 of file TEcnaRun.h.

Referenced by HighFrequencyMeanCorrelationsBetweenStins(), Init(), and ~TEcnaRun().

Double_t* TEcnaRun::fT2d1_lf_cor
private

Definition at line 481 of file TEcnaRun.h.

Referenced by Init(), LowFrequencyCorrelationsBetweenChannels(), and ~TEcnaRun().

Double_t* TEcnaRun::fT2d1_lf_cov
private

Definition at line 477 of file TEcnaRun.h.

Referenced by Init(), LowFrequencyCovariancesBetweenChannels(), and ~TEcnaRun().

Double_t* TEcnaRun::fT2d1_lfcc_mostins
private

Definition at line 495 of file TEcnaRun.h.

Referenced by Init(), LowFrequencyMeanCorrelationsBetweenStins(), and ~TEcnaRun().

Double_t** TEcnaRun::fT2d_ev
private
Double_t** TEcnaRun::fT2d_hf_cor
private
Double_t** TEcnaRun::fT2d_hf_cov
private
Double_t** TEcnaRun::fT2d_hfcc_mostins
private
Double_t** TEcnaRun::fT2d_lf_cor
private
Double_t** TEcnaRun::fT2d_lf_cov
private
Double_t** TEcnaRun::fT2d_lfcc_mostins
private
Int_t** TEcnaRun::fT2d_NbOfEvts
private
Double_t** TEcnaRun::fT2d_sig
private

Definition at line 430 of file TEcnaRun.h.

Referenced by Init(), SampleSigmas(), TotalNoise(), TRootSSp(), and ~TEcnaRun().

Int_t** TEcnaRun::fT2dCrysNumbersTable
private

Definition at line 504 of file TEcnaRun.h.

Referenced by Init(), and ~TEcnaRun().

Double_t* TEcnaRun::fT3d1_AdcValues
private

Definition at line 416 of file TEcnaRun.h.

Referenced by GetReadyToReadData(), Init(), and ~TEcnaRun().

Double_t* TEcnaRun::fT3d1_cor_ss
private

Definition at line 441 of file TEcnaRun.h.

Referenced by CorrelationsBetweenSamples(), Init(), and ~TEcnaRun().

Double_t* TEcnaRun::fT3d1_cov_ss
private

Definition at line 436 of file TEcnaRun.h.

Referenced by CovariancesBetweenSamples(), Init(), and ~TEcnaRun().

Double_t** TEcnaRun::fT3d2_AdcValues
private

Definition at line 415 of file TEcnaRun.h.

Referenced by GetReadyToReadData(), Init(), and ~TEcnaRun().

Double_t** TEcnaRun::fT3d2_cor_ss
private

Definition at line 440 of file TEcnaRun.h.

Referenced by CorrelationsBetweenSamples(), Init(), and ~TEcnaRun().

Double_t** TEcnaRun::fT3d2_cov_ss
private

Definition at line 435 of file TEcnaRun.h.

Referenced by CovariancesBetweenSamples(), Init(), and ~TEcnaRun().

Double_t*** TEcnaRun::fT3d_AdcValues
private
Double_t*** TEcnaRun::fT3d_cor_ss
private
Double_t*** TEcnaRun::fT3d_cov_ss
private
Int_t* TEcnaRun::fTagAdcEvt
private
Int_t* TEcnaRun::fTagAvHfn
private
Int_t* TEcnaRun::fTagAvLfn
private
Int_t* TEcnaRun::fTagAvMeanCorss
private
Int_t* TEcnaRun::fTagAvPed
private
Int_t* TEcnaRun::fTagAvSigCorss
private
Int_t* TEcnaRun::fTagAvTno
private
Int_t* TEcnaRun::fTagCorCss
private
Int_t* TEcnaRun::fTagCovCss
private
Int_t* TEcnaRun::fTagHFccMoStins
private
Int_t* TEcnaRun::fTagHfCor
private
Int_t* TEcnaRun::fTagHfCov
private
Int_t* TEcnaRun::fTagHfn
private
Int_t* TEcnaRun::fTagLFccMoStins
private
Int_t* TEcnaRun::fTagLfCor
private
Int_t* TEcnaRun::fTagLfCov
private
Int_t* TEcnaRun::fTagLfn
private
Int_t* TEcnaRun::fTagMeanCorss
private
Int_t* TEcnaRun::fTagMSp
private
Int_t* TEcnaRun::fTagNbOfEvts
private
Int_t* TEcnaRun::fTagPed
private
Int_t* TEcnaRun::fTagSigCorss
private
Int_t* TEcnaRun::fTagSSp
private
Int_t* TEcnaRun::fTagStinNumbers
private
Int_t* TEcnaRun::fTagTno
private
TString TEcnaRun::fTTBELL
private