CMS 3D CMS Logo

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 (const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
 
void GetReadyToReadData (const 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 *, const 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 (const TString &, const 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 &)
 
 ~TEcnaRun () override
 

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
 
std::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: 05/10/2012 Authors: B.Fabbro (berna.nosp@m.rd.f.nosp@m.abbro.nosp@m.@cea.nosp@m..fr), FX Gentit DSM/IRFU/SPP CEA-Saclay Copyright: Those valid for CEA sofware

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

cna_new/Correlated_Noise_Analysis/ECNA_main_page.htm

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(const TString& StartDate, const 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  // std::cout << "[Info Management] CLASS: TEcnaRun. CREATE OBJECT: this = " << this << std::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  // std::cout << "[Info Management] CLASS: TEcnaRun. CREATE OBJECT: this = " << this << std::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 = nullptr;
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 = nullptr;
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 = nullptr;
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
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:105
Int_t fNbSampForFic
Definition: TEcnaRun.h:407
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
void Init()
Definition: TEcnaRun.cc:136
void SetEcalSubDetector(const TString &)
Definition: TEcnaRun.cc:275
Int_t MaxSampADC()
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:232
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 = nullptr;
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 = nullptr;
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 = nullptr;
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  std::cout << "TEcnaRun/CONSTRUCTOR> Number of required samples = " << NbOfSamples
126  << ": OUT OF RANGE. Set to the default value (= " << fEcal->MaxSampADC() << ")."
127  << fTTBELL << std::endl;
128  fNbSampForFic = fEcal->MaxSampADC(); // DEFAULT Number of samples for file reading
129  }
130 
131 }
TEcnaObject * fObjectManager
Definition: TEcnaRun.h:382
TEcnaParCout * fCnaParCout
Definition: TEcnaRun.h:386
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:105
Int_t fNbSampForFic
Definition: TEcnaRun.h:407
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
void Init()
Definition: TEcnaRun.cc:136
void SetEcalSubDetector(const TString &)
Definition: TEcnaRun.cc:275
Int_t MaxSampADC()
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:232
TString fTTBELL
Definition: TEcnaRun.h:376
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
TEcnaRun::TEcnaRun ( const TEcnaRun dcop)

Definition at line 300 of file TEcnaRun.cc.

References gather_cfg::cout.

301 {
302  std::cout << "*TEcnaRun::TEcnaRun(const TEcnaRun& dcop)> "
303  << " Now is the time to write a copy constructor"
304  << std::endl;
305 
306  //{ Int_t cintoto; cin >> cintoto; }
307 
308 }
TEcnaRun::~TEcnaRun ( )
override

Definition at line 329 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 mps_fire::i.

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

2136 {
2137 // Calculation of the average
2138 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the High Frequency Noise
2139 
2140  //... preliminary calculation of the High Frequency Noise if not done yet
2141  if ( fTagHfn[0] != 1 ){HighFrequencyNoise(); fTagHfn[0]=0;}
2142  //................... Allocation av_hifn + init to zero (mandatory)
2143  if( fT1d_av_hifn == nullptr ){fT1d_av_hifn = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2144  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2145  {if( fT1d_av_hifn[i0StexStinEcna] != (Double_t)0 )
2146  {fMiscDiag[44]++; fT1d_av_hifn[i0StexStinEcna] = (Double_t)0;}}
2147 
2148  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::AverageHighFrequencyNoise()" << std::endl;}
2150  std::cout << " Calculation, for all the "
2151  << fStinName.Data() << "s, of the average High Frequency Noise" << std::endl;}
2152 
2153  //................... Calculation
2154  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2155  {
2156  Int_t n1StexStinEcna = i0StexStinEcna+1;
2157  fT1d_av_hifn[i0StexStinEcna] = (Double_t)0;
2158  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2159  {
2160  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2161 
2162  if( fStexName == "SM " )
2163  {fT1d_av_hifn[i0StexStinEcna] += fT1d_evevt_of_sigsamp[i0StexEcha];}
2164 
2165  if( fStexName == "Dee" )
2166  {
2167  //---------------- Special translation for mixed SCEcna (29 and 32)
2168  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2169  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2170  Int_t n1StinEcha = i0StinEcha+1;
2171  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2172  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2173  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2174  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2175  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2176  {fT1d_av_hifn[i0StexStinEcna] += fT1d_evevt_of_sigsamp[i0StexEcha];}
2177  }
2178  }
2179  Double_t xdivis = (Double_t)0.;
2180  if( fStexName == "SM " )
2181  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2182  if( fStexName == "Dee" )
2183  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2184 
2185  fT1d_av_hifn[i0StexStinEcna] = fT1d_av_hifn[i0StexStinEcna]/xdivis;
2186  }
2187  fTagAvHfn[0] = 1; fFileHeader->fAvHfnCalc++;
2188 }
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:1751
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
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 2075 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().

2076 {
2077 // Calculation of the average
2078 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the Low Frequency Noise
2079 
2080  //... preliminary calculation of the Low Frequency Noise if not done yet
2081  if ( fTagLfn[0] != 1 ){LowFrequencyNoise(); fTagLfn[0]=0;}
2082  //................... Allocation av_lofn + init to zero (mandatory)
2083  if( fT1d_av_lofn == nullptr ){fT1d_av_lofn = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2084  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2085  {if( fT1d_av_lofn[i0StexStinEcna] != (Double_t)0 )
2086  {fMiscDiag[43]++; fT1d_av_lofn[i0StexStinEcna] = (Double_t)0;}}
2087 
2088  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::AverageLowFrequencyNoise()" << std::endl;}
2090  std::cout << " Calculation, for all the "
2091  << fStinName.Data() << "s, of the average Low Frequency Noise" << std::endl;}
2092 
2093  //................... Calculation
2094  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2095  {
2096  Int_t n1StexStinEcna = i0StexStinEcna+1;
2097  fT1d_av_lofn[i0StexStinEcna] = (Double_t)0;
2098  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2099  {
2100  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2101 
2102  if( fStexName == "SM " )
2103  {fT1d_av_lofn[i0StexStinEcna] += fT1d_sigevt_of_evsamp[i0StexEcha];}
2104 
2105  if( fStexName == "Dee" )
2106  {
2107  //---------------- Special translation for mixed SCEcna (29 and 32)
2108  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2109  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2110  Int_t n1StinEcha = i0StinEcha+1;
2111  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2112  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2113  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2114  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2115  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2116  {fT1d_av_lofn[i0StexStinEcna] += fT1d_sigevt_of_evsamp[i0StexEcha];}
2117  }
2118  }
2119  Double_t xdivis = (Double_t)0.;
2120  if( fStexName == "SM " )
2121  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2122  if( fStexName == "Dee" )
2123  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2124 
2125  fT1d_av_lofn[i0StexStinEcna] = fT1d_av_lofn[i0StexStinEcna]/xdivis;
2126  }
2127  fTagAvLfn[0] = 1; fFileHeader->fAvLfnCalc++;
2128 }
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:1681
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 &)
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 2195 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().

2196 {
2197 // Calculation of the average
2198 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the mean cor(s,s)
2199 
2200  //... preliminary calculation of the mean cor(s,s) if not done yet
2202  //................... Allocation av_ev_corss + init to zero (mandatory)
2203  if( fT1d_av_ev_corss == nullptr ){fT1d_av_ev_corss = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2204  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2205  {if( fT1d_av_ev_corss[i0StexStinEcna] != (Double_t)0 )
2206  {fMiscDiag[45]++; fT1d_av_ev_corss[i0StexStinEcna] = (Double_t)0;}}
2207 
2208  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::AverageMeanCorrelationsBetweenSamples()" << std::endl;}
2210  std::cout << " Calculation, for all the "
2211  << fStinName.Data() << "s, of the average mean cor(s,s)" << std::endl;}
2212 
2213  //................... Calculation
2214  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2215  {
2216  Int_t n1StexStinEcna = i0StexStinEcna+1;
2217  fT1d_av_ev_corss[i0StexStinEcna] = (Double_t)0;
2218  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2219  {
2220  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2221 
2222  if( fStexName == "SM " )
2223  {fT1d_av_ev_corss[i0StexStinEcna] += fT1d_ev_cor_ss[i0StexEcha];}
2224 
2225  if( fStexName == "Dee" )
2226  {
2227  //---------------- Special translation for mixed SCEcna (29 and 32)
2228  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2229  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2230  Int_t n1StinEcha = i0StinEcha+1;
2231  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2232  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2233  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2234  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2235  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2236  {fT1d_av_ev_corss[i0StexStinEcna] += fT1d_ev_cor_ss[i0StexEcha];}
2237  }
2238  }
2239  Double_t xdivis = (Double_t)0.;
2240  if( fStexName == "SM " )
2241  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2242  if( fStexName == "Dee" )
2243  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2244 
2245  fT1d_av_ev_corss[i0StexStinEcna] = fT1d_av_ev_corss[i0StexStinEcna]/xdivis;
2246  }
2248 }
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:1823
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
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 1954 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().

1955 {
1956 // Calculation of the average
1957 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the Pedestals
1958 
1959  //... preliminary calculation of the Pedestals if not done yet
1960  if ( fTagPed[0] != 1 ){Pedestals(); fTagPed[0]=0;}
1961  //................... Allocation av_mped + init to zero (mandatory)
1962  if( fT1d_av_mped == nullptr ){fT1d_av_mped = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
1963  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
1964  {if( fT1d_av_mped[i0StexStinEcna] != (Double_t)0 )
1965  {fMiscDiag[41]++; fT1d_av_mped[i0StexStinEcna] = (Double_t)0;}}
1966 
1967  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::AveragePedestals()" << std::endl;}
1969  std::cout << " Calculation, for all the "
1970  << fStinName.Data() << "s, of the average Pedestals" << std::endl;}
1971 
1972  //................... Calculation
1973  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
1974  {
1975  Int_t n1StexStinEcna = i0StexStinEcna+1;
1976  fT1d_av_mped[i0StexStinEcna] = (Double_t)0;
1977  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
1978  {
1979  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
1980 
1981  if( fStexName == "SM " )
1982  {fT1d_av_mped[i0StexStinEcna] += fT1d_ev_ev[i0StexEcha];}
1983 
1984  if( fStexName == "Dee" )
1985  {
1986  //---------------- Special translation for mixed SCEcna (29 and 32)
1987  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
1988  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
1989  Int_t n1StinEcha = i0StinEcha+1;
1990  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
1991  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
1992  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
1993  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
1994  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
1995  {fT1d_av_mped[i0StexStinEcna] += fT1d_ev_ev[i0StexEcha];}
1996  }
1997  }
1998  Double_t xdivis = (Double_t)0.;
1999  if( fStexName == "SM " )
2000  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2001  if( fStexName == "Dee" )
2002  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2003 
2004  fT1d_av_mped[i0StexStinEcna] = fT1d_av_mped[i0StexStinEcna]/xdivis;
2005  }
2006 
2007  fTagAvPed[0] = 1; fFileHeader->fAvPedCalc++;
2008 }
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:1583
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
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 2255 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().

2256 {
2257 // Calculation of the average
2258 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the sigma of cor(s,s)
2259 
2260  //... preliminary calculation of the sigma of cor(s,s) if not done yet
2262  //................... Allocation av_sig_corss + init to zero (mandatory)
2263  if( fT1d_av_sig_corss == nullptr ){fT1d_av_sig_corss = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2264  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2265  {if( fT1d_av_sig_corss[i0StexStinEcna] != (Double_t)0 )
2266  {fMiscDiag[46]++; fT1d_av_sig_corss[i0StexStinEcna] = (Double_t)0;}}
2267 
2268  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::AverageSigmaOfCorrelationsBetweenSamples()" << std::endl;}
2270  std::cout << " Calculation, for all the "
2271  << fStinName.Data() << "s, of the average sigma of cor(s,s)" << std::endl;}
2272 
2273  //................... Calculation
2274  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2275  {
2276  Int_t n1StexStinEcna = i0StexStinEcna+1;
2277  fT1d_av_sig_corss[i0StexStinEcna] = (Double_t)0;
2278  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2279  {
2280  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2281 
2282  if( fStexName == "SM " )
2283  {fT1d_av_sig_corss[i0StexStinEcna] += fT1d_sig_cor_ss[i0StexEcha];}
2284 
2285  if( fStexName == "Dee" )
2286  {
2287  //---------------- Special translation for mixed SCEcna (29 and 32)
2288  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2289  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2290  Int_t n1StinEcha = i0StinEcha+1;
2291  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2292  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2293  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2294  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2295  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2296  {fT1d_av_sig_corss[i0StexStinEcna] += fT1d_sig_cor_ss[i0StexEcha];}
2297  }
2298  }
2299  Double_t xdivis = (Double_t)0.;
2300  if( fStexName == "SM " )
2301  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2302  if( fStexName == "Dee" )
2303  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2304 
2305  fT1d_av_sig_corss[i0StexStinEcna] = fT1d_av_sig_corss[i0StexStinEcna]/xdivis;
2306  }
2308 }
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:1889
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 &)
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 2015 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().

2016 {
2017 // Calculation of the average
2018 // (over the Stin's 0 to fEcal->MaxStinInStex()) of the Total Noise
2019 
2020  //... preliminary calculation of the averaged Total Noise if not done yet
2021  if ( fTagTno[0] != 1 ){TotalNoise(); fTagTno[0]=0;}
2022  //................... Allocation av_totn + init to zero (mandatory)
2023  if( fT1d_av_totn == nullptr ){fT1d_av_totn = new Double_t[fEcal->MaxStinEcnaInStex()]; fCnew++;}
2024  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2025  {if( fT1d_av_totn[i0StexStinEcna] != (Double_t)0 )
2026  {fMiscDiag[42]++; fT1d_av_totn[i0StexStinEcna] = (Double_t)0;}}
2027 
2028  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::AverageTotalNoise()" << std::endl;}
2030  std::cout << " Calculation, for all the "
2031  << fStinName.Data() << "s, of the average total Noise" << std::endl;}
2032 
2033  //................... Calculation
2034  for(Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2035  {
2036  Int_t n1StexStinEcna = i0StexStinEcna+1;
2037  fT1d_av_totn[i0StexStinEcna] = (Double_t)0;
2038  for(Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++)
2039  {
2040  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStinEcna, i0StinEcha);
2041 
2042  if( fStexName == "SM " )
2043  {fT1d_av_totn[i0StexStinEcna] += fT1d_evsamp_of_sigevt[i0StexEcha];}
2044 
2045  if( fStexName == "Dee" )
2046  {
2047  //---------------- Special translation for mixed SCEcna (29 and 32)
2048  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2049  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2050  Int_t n1StinEcha = i0StinEcha+1;
2051  if( n1StexStinEcna == 10 && n1StinEcha == 11 )
2052  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2053  if( n1StexStinEcna == 11 && n1StinEcha == 11 )
2054  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2055  if( !( (n1StexStinEcna == 29 || n1StexStinEcna == 32) && n1StinEcha == 11 ) )
2056  {fT1d_av_totn[i0StexStinEcna] += fT1d_evsamp_of_sigevt[i0StexEcha];}
2057  }
2058  }
2059  Double_t xdivis = (Double_t)0.;
2060  if( fStexName == "SM " )
2061  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2062  if( fStexName == "Dee" )
2063  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, n1StexStinEcna, "TEcnaRun");}
2064 
2065  fT1d_av_totn[i0StexStinEcna] = fT1d_av_totn[i0StexStinEcna]/xdivis;
2066  }
2067  fTagAvTno[0] = 1; fFileHeader->fAvTnoCalc++;
2068 }
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:1628
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 &)
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 2972 of file TEcnaRun.cc.

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

Referenced by WriteRootFile().

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

Definition at line 1509 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, mps_fire::i, TEcnaParEcal::MaxCrysEcnaInStex(), and mathSSE::sqrt().

Referenced by MeanCorrelationsBetweenSamples(), and StandardCalculations().

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

Definition at line 1449 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, mps_fire::i, TEcnaParEcal::MaxCrysEcnaInStex(), and SampleMeans().

Referenced by CorrelationsBetweenSamples().

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

Definition at line 1299 of file TEcnaRun.cc.

References HighFrequencyCorrelationsBetweenChannels(), and LowFrequencyCorrelationsBetweenChannels().

Referenced by TEcnaGui::Calculations().

1300 {
1301  // long time, big file
1302 
1305 }
void HighFrequencyCorrelationsBetweenChannels()
Definition: TEcnaRun.cc:2640
void LowFrequencyCorrelationsBetweenChannels()
Definition: TEcnaRun.cc:2440
void TEcnaRun::Expert2Calculations ( )

Definition at line 1307 of file TEcnaRun.cc.

References HighFrequencyMeanCorrelationsBetweenStins(), and LowFrequencyMeanCorrelationsBetweenStins().

Referenced by TEcnaGui::Calculations().

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

Definition at line 3103 of file TEcnaRun.cc.

References fNewRootFileName.

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

Definition at line 3104 of file TEcnaRun.cc.

References fNewRootFileNameShort.

Referenced by TEcnaGui::Calculations().

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

Definition at line 134 of file TEcnaRun.cc.

References fCnaParPaths, and TEcnaParPaths::GetPathForResultsRootFiles().

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

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

1220 {
1221 //
1222  // MAKE THE RESULTS FILE NAME and
1223  // CHECK OF THE NUMBER OF FOUND EVENTS AND init fNumberOfEvents
1224  // (number used to compute the average values over the events)
1225  // The number of events fNumberOfEvents is extracted from the array fT2d_NbOfEvts[]
1226  // which has been filled by the GetSampleAdcValues(...) method
1227 
1228  //..................... Making of the Root File name that will be written
1233 
1234  fCnaWrite->fMakeResultsFileName(); // set fRootFileName, fRootFileNameShort
1235 
1236  //..................... Checking numbers of found events channel by channel
1237  if( fT2d_NbOfEvts != nullptr )
1238  {
1241  }
1242  else
1243  {
1244  std::cout << "*TEcnaRun::GetReadyToCompute()> no data? fT2d_NbOfEvts = " << fT2d_NbOfEvts << std::endl;
1245  }
1246 }
Int_t NumberOfEventsAnalysis(Int_t **, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaWrite.cc:520
Int_t fStex
Definition: TEcnaHeader.h:56
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:610
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
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
Int_t fRunNumber
Definition: TEcnaHeader.h:52
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:640
Int_t ** fT2d_NbOfEvts
Definition: TEcnaRun.h:419
TEcnaWrite * fCnaWrite
Definition: TEcnaRun.h:388
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::GetReadyToReadData ( const 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 507 of file TEcnaRun.cc.

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

510 {
511 //Preparation of the data reading. Set part of the header. No RunType as argument.
512 //Use default value = 99999999 and call method with all the arguments (see below)
513 
514  Int_t RunType = 99999999;
515  GetReadyToReadData(typ_ana, run_number, nfirst, nlast, nbevts, Stex, RunType);
516 }
void GetReadyToReadData(const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRun.cc:507
int nlast
Definition: AMPTWrapper.h:47
void TEcnaRun::GetReadyToReadData ( const 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 518 of file TEcnaRun.cc.

References MessageLogger_cfi::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().

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

References fRootFileName.

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

Definition at line 1186 of file TEcnaRun.cc.

References fRootFileNameShort.

Referenced by TEcnaGui::Calculations().

1186 {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 838 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().

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

2641 {
2642 //Calculation of the High Frequency Correlations between channels
2643 
2644  //... preliminary calculation of the covariances if not done yet.
2645  if ( fTagHfCov[0] != 1 )
2647 
2648  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::HighFrequencyCorrelationsBetweenChannels()" << std::endl;}
2650  std::cout << " Calculation of the High Frequency Correlations between channels" << std::endl
2651  << " Starting allocation. "
2652  << std::endl;}
2653 
2654  //................. allocation fT2d_hf_cor + init to zero (mandatory)
2655  if( fT2d_hf_cor == nullptr ){
2656  const Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
2657  fT2d_hf_cor = new Double_t*[n_StexEcha]; fCnew++;
2658  fT2d1_hf_cor = new Double_t[n_StexEcha*n_StexEcha]; fCnew++;
2659  for(Int_t i0StexEcha = 0 ; i0StexEcha < n_StexEcha ; i0StexEcha++){
2660  fT2d_hf_cor[i0StexEcha] = &fT2d1_hf_cor[0] + i0StexEcha*n_StexEcha;}
2661  }
2662 
2663  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2664  {
2665  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
2666  {
2667  if( fT2d_hf_cor[i0StexEcha][j0StexEcha] != (Double_t)0 )
2668  {fMiscDiag[24]++; fT2d_hf_cor[i0StexEcha][j0StexEcha] = (Double_t)0;}
2669  }
2670  }
2671 
2672  //................. calculation
2673  //........................... computation of half of the matrix, diagonal included
2674 
2675  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2676  {
2677  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2678  || ( fFlagSubDet == "EB") )
2679  {
2680  for (Int_t j0StexEcha = 0 ; j0StexEcha <= i0StexEcha ; j0StexEcha++)
2681  {
2682  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, j0StexEcha) > 0)
2683  || ( fFlagSubDet == "EB") )
2684  {
2685  if( fT2d_hf_cov[i0StexEcha][i0StexEcha] > 0
2686  && fT2d_hf_cov[j0StexEcha][j0StexEcha] > 0 )
2687  {
2688  fT2d_hf_cor[i0StexEcha][j0StexEcha] =
2689  fT2d_hf_cov[i0StexEcha][j0StexEcha]/
2690  ( (Double_t)sqrt(fT2d_hf_cov[i0StexEcha][i0StexEcha]) *
2691  (Double_t)sqrt(fT2d_hf_cov[j0StexEcha][j0StexEcha]) );
2692  }
2693  else
2694  {
2695  fT2d_hf_cor[i0StexEcha][j0StexEcha] = (Double_t)0.;
2696  }
2697 
2698  fT2d_hf_cor[j0StexEcha][i0StexEcha] = fT2d_hf_cor[i0StexEcha][j0StexEcha];
2699  }
2700  }
2701  }
2702  if( i0StexEcha%100 == 0 ){std::cout << i0StexEcha << "[HFN Cor], ";}
2703  }
2704  std::cout << std::endl;
2705 
2706  fTagHfCor[0] = 1; fFileHeader->fHfCorCalc++;
2707 }
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:18
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:2523
Int_t MaxCrysEcnaInStex()
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRun.h:385
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::HighFrequencyCovariancesBetweenChannels ( )

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

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

Definition at line 2821 of file TEcnaRun.cc.

References HighFrequencyMeanCorrelationsBetweenStins().

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

Definition at line 2824 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(), mps_fire::i, TEcnaParEcal::MaxCrysInStin(), and TEcnaParEcal::MaxStinEcnaInStex().

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

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

Definition at line 2819 of file TEcnaRun.cc.

References HighFrequencyMeanCorrelationsBetweenStins().

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

Definition at line 1751 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, mps_fire::i, TEcnaParEcal::MaxCrysEcnaInStex(), and mathSSE::sqrt().

Referenced by AverageHighFrequencyNoise(), and StandardCalculations().

1752 {
1753 // Calculation, for each channel, of the mean (over the events)
1754 // of the ADC sigmas (over the samples 0 to fNbSampForCalc-1)
1755 
1756  //................... Allocation fT1d_evevt_of_sigsamp + init to zero (mandatory)
1757  if( fT1d_evevt_of_sigsamp == nullptr ){
1758  fT1d_evevt_of_sigsamp = new Double_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
1759  }
1760  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1761  {
1762  if( fT1d_evevt_of_sigsamp[i0StexEcha] != (Double_t)0 )
1763  {fMiscDiag[14]++; fT1d_evevt_of_sigsamp[i0StexEcha] = (Double_t)0;}
1764  }
1765 
1766  //................... Allocations mean_over_samples, sigma_over_sample
1767  TVectorD mean_over_samples(fNumberOfEvents);
1768  for(Int_t i=0; i<fNumberOfEvents; i++){mean_over_samples(i)=(Double_t)0.;}
1769  TVectorD sigma_over_samples(fNumberOfEvents);
1770  for(Int_t i=0; i<fNumberOfEvents; i++){sigma_over_samples(i)=(Double_t)0.;}
1771 
1772  //..................... Calculation
1773  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::HighFrequencyNoise()" << std::endl;}
1775  std::cout << " Calculation, for each channel, of the sigma (over the events)" << std::endl
1776  << " of the ADC expectation values (over the samples 1 to "
1777  << fNbSampForCalc << ")." << std::endl;}
1778 
1779  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1780  {
1781  //..................... Calculation of the sigma over samples
1782  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
1783  {
1784  // Calculation, for each event, of the mean over the samples
1785  mean_over_samples(n_event) = (Double_t)0.;
1786  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
1787  {mean_over_samples(n_event) += fT3d_AdcValues[i0StexEcha][i0Sample][n_event];}
1788  mean_over_samples(n_event) /= (Double_t)fNbSampForCalc;
1789 
1790  // Calculation, for each event, of the sigma over the samples
1791  Double_t var_over_samples = (Double_t)0;
1792  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
1793  {Double_t deviation = fT3d_AdcValues[i0StexEcha][i0Sample][n_event] - mean_over_samples(n_event);
1794  var_over_samples += deviation*deviation;}
1795  var_over_samples /= (Double_t)fNbSampForCalc;
1796 
1797  if( var_over_samples < 0)
1798  {std::cout << "!TEcnaRun::HighFrequencyNoise() *** ERROR ***> Negative variance! " << fTTBELL << std::endl;}
1799  else
1800  {sigma_over_samples(n_event) = sqrt(var_over_samples);}
1801  }
1802 
1803  //....... Calculation of the mean over the events of the sigma over samples
1804  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
1805  {fT1d_evevt_of_sigsamp[i0StexEcha] += sigma_over_samples(n_event);}
1806 
1807  fT1d_evevt_of_sigsamp[i0StexEcha] /= (Double_t)fNumberOfEvents;
1808  }
1809  fTagHfn[0] = 1; fFileHeader->fHfnCalc++;
1810 }
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:18
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()
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 136 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().

137 {
138 //Initialisation
139 
140  fCnew = 0;
141  fCdelete = 0;
142  fCnaCommand = 0;
143  fCnaError = 0;
144 
145  fTTBELL = '\007';
146 
147  //........................... TString file names init
148  fgMaxCar = (Int_t)512;
149 
150  //................ MiscDiag counters .................
151  fMaxMsgIndexForMiscDiag = (Int_t)10;
152  fNbOfMiscDiagCounters = (Int_t)50;
153  fMiscDiag = nullptr;
154 
155  fNumberOfEvents = 0;
156  //............................. init pointers ( Init() )
157  fT3d_AdcValues = nullptr;
158  fT3d2_AdcValues = nullptr;
159  fT3d1_AdcValues = nullptr;
160 
161  fT1d_StexStinFromIndex = nullptr;
162 
163  fT2d_NbOfEvts = nullptr;
164  fT1d_NbOfEvts = nullptr;
165 
166  fT2d_ev = nullptr;
167  fT1d_ev = nullptr;
168  fT2d_sig = nullptr;
169  fT1d_sig = nullptr;
170 
171  fT3d_cov_ss = nullptr;
172  fT3d2_cov_ss = nullptr;
173  fT3d1_cov_ss = nullptr;
174 
175  fT3d_cor_ss = nullptr;
176  fT3d2_cor_ss = nullptr;
177  fT3d1_cor_ss = nullptr;
178 
179  fT2d_lf_cov = nullptr;
180  fT2d1_lf_cov = nullptr;
181 
182  fT2d_lf_cor = nullptr;
183  fT2d1_lf_cor = nullptr;
184 
185  fT2d_hf_cov = nullptr;
186  fT2d1_hf_cov = nullptr;
187 
188  fT2d_hf_cor = nullptr;
189  fT2d1_hf_cor = nullptr;
190 
191  fT2d_lfcc_mostins = nullptr;
192  fT2d1_lfcc_mostins = nullptr;
193 
194  fT2d_hfcc_mostins = nullptr;
195  fT2d1_hfcc_mostins = nullptr;
196 
197  fT1d_ev_ev = nullptr;
198  fT1d_evsamp_of_sigevt = nullptr;
199  fT1d_ev_cor_ss = nullptr;
200  fT1d_av_mped = nullptr;
201  fT1d_av_totn = nullptr;
202  fT1d_av_lofn = nullptr;
203  fT1d_av_hifn = nullptr;
204  fT1d_av_ev_corss = nullptr;
205  fT1d_av_sig_corss = nullptr;
206 
207  fT1d_sigevt_of_evsamp = nullptr;
208  fT1d_evevt_of_sigsamp = nullptr;
209  fT1d_sig_cor_ss = nullptr;
210 
211  fT2dCrysNumbersTable = nullptr;
212  fT1dCrysNumbersTable = nullptr;
213 
214  //................................ tags ( Init() )
215  fTagStinNumbers = nullptr;
216 
217  fTagNbOfEvts = nullptr;
218 
219  fTagAdcEvt = nullptr;
220 
221  fTagMSp = nullptr;
222  fTagSSp = nullptr;
223 
224  fTagCovCss = nullptr;
225  fTagCorCss = nullptr;
226 
227  fTagHfCov = nullptr;
228  fTagHfCor = nullptr;
229  fTagLfCov = nullptr;
230  fTagLfCor = nullptr;
231 
232  fTagLFccMoStins = nullptr;
233  fTagHFccMoStins = nullptr;
234 
235  fTagPed = nullptr;
236  fTagTno = nullptr;
237  fTagMeanCorss = nullptr;
238 
239  fTagLfn = nullptr;
240  fTagHfn = nullptr;
241  fTagSigCorss = nullptr;
242 
243  fTagAvPed = nullptr;
244  fTagAvTno = nullptr;
245  fTagAvLfn = nullptr;
246  fTagAvHfn = nullptr;
247 
248  fTagAvMeanCorss = nullptr;
249  fTagAvSigCorss = nullptr;
250 
251  //................................................... Code Print ( Init() )
253  fCodePrintWarnings = fCnaParCout->GetCodePrint("Warnings "); // => default value
256 
258 
259  //...................................................
260  gCnaRootFile = nullptr;
261  fOpenRootFile = kFALSE;
262  fReadyToReadData = 0;
263 
264  //.............................................. Miscellaneous
266 
267  fStinIndexBuilt = 0;
269 
271 
272 }// 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
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
R__EXTERN TEcnaRootFile * gCnaRootFile
Definition: TEcnaRun.cc:13
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 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
Int_t GetCodePrint(const TString &)
Definition: TEcnaParCout.cc:70
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 2440 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().

2441 {
2442 //Calculation of the Low Frequency Correlations between channels
2443 
2444  //... preliminary calculation of the covariances if not done yet.
2445  if ( fTagLfCov[0] != 1 )
2447 
2448  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::LowFrequencyCorrelationsBetweenChannels()" << std::endl;}
2450  std::cout << " Calculation of the Low Frequency Correlations between channels" << std::endl
2451  << " Starting allocation. "
2452  << std::endl;}
2453 
2454  //................. allocation fT2d_lf_cor + init to zero (mandatory)
2455  if( fT2d_lf_cor == nullptr ){
2456  const Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
2457  fT2d_lf_cor = new Double_t*[n_StexEcha]; fCnew++;
2458  fT2d1_lf_cor = new Double_t[n_StexEcha*n_StexEcha]; fCnew++;
2459  for(Int_t i0StexEcha = 0 ; i0StexEcha < n_StexEcha ; i0StexEcha++){
2460  fT2d_lf_cor[i0StexEcha] = &fT2d1_lf_cor[0] + i0StexEcha*n_StexEcha;}
2461  }
2462 
2463  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2464  {
2465  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
2466  {
2467  if( fT2d_lf_cor[i0StexEcha][j0StexEcha] != (Double_t)0 )
2468  {fMiscDiag[22]++; fT2d_lf_cor[i0StexEcha][j0StexEcha] = (Double_t)0;}
2469  }
2470  }
2471 
2472  //................. calculation
2473  //........................... computation of half of the matrix, diagonal included
2474  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2475  {
2476  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2477  || ( fFlagSubDet == "EB") )
2478  {
2479  for (Int_t j0StexEcha = 0 ; j0StexEcha <= i0StexEcha ; j0StexEcha++)
2480  {
2481  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, j0StexEcha) > 0)
2482  || ( fFlagSubDet == "EB") )
2483  {
2484  if( fT2d_lf_cov[i0StexEcha][i0StexEcha] > 0
2485  && fT2d_lf_cov[j0StexEcha][j0StexEcha] > 0 )
2486  {
2487  fT2d_lf_cor[i0StexEcha][j0StexEcha] =
2488  fT2d_lf_cov[i0StexEcha][j0StexEcha]/
2489  ( (Double_t)sqrt( fT2d_lf_cov[i0StexEcha][i0StexEcha]*
2490  fT2d_lf_cov[j0StexEcha][j0StexEcha] ) );
2491  }
2492  else
2493  {
2494  fT2d_lf_cor[i0StexEcha][j0StexEcha] = (Double_t)0.;
2495  }
2496  fT2d_lf_cor[j0StexEcha][i0StexEcha] = fT2d_lf_cor[i0StexEcha][j0StexEcha];
2497  }
2498  }
2499  }
2500  if( i0StexEcha%100 == 0 ){std::cout << i0StexEcha << "[LFN Cor], ";}
2501  }
2502  std::cout << std::endl;
2503 
2504  fTagLfCor[0] = 1; fFileHeader->fLfCorCalc++;
2505 }
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:18
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:2335
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 2335 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().

2336 {
2337 //Calculation of the Low Frequency Covariances between channels
2338 
2339  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::LowFrequencyCovariancesBetweenChannels()" << std::endl;}
2341  std::cout << " Calculation of the Low Frequency Covariances between channels" << std::endl;}
2342 
2343  //................. allocation fT2d_lf_cov + init to zero (mandatory)
2344  if( fT2d_lf_cov == nullptr ){
2345  const Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
2346  fT2d_lf_cov = new Double_t*[n_StexEcha]; fCnew++;
2347  fT2d1_lf_cov = new Double_t[n_StexEcha*n_StexEcha]; fCnew++;
2348  for(Int_t i0StexEcha = 0 ; i0StexEcha < n_StexEcha ; i0StexEcha++){
2349  fT2d_lf_cov[i0StexEcha] = &fT2d1_lf_cov[0] + i0StexEcha*n_StexEcha;}}
2350 
2351  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
2352  {
2353  for (Int_t j0StexEcha = 0 ; j0StexEcha < fEcal->MaxCrysEcnaInStex() ; j0StexEcha++)
2354  {
2355  if( fT2d_lf_cov[i0StexEcha][j0StexEcha] != (Double_t)0 )
2356  {fMiscDiag[21]++; fT2d_lf_cov[i0StexEcha][j0StexEcha] = (Double_t)0;}
2357  }
2358  }
2359  //........................................... Calculation (LowFrequencyCovariancesBetweenChannels)
2360  //................... Allocation mean_over_samples(i0StexEcha, n_event)
2361  TMatrixD mean_over_samples(fEcal->MaxCrysEcnaInStex(), fNumberOfEvents);
2362  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2363  {for(Int_t n_event=0; n_event<fNumberOfEvents; n_event++)
2364  {mean_over_samples(i0StexEcha, n_event)=(Double_t)0.;}}
2365  //................... Allocation MoeOfMos(i0StexEcha)
2366  TVectorD MoeOfMos(fEcal->MaxCrysEcnaInStex());
2367  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2368  { MoeOfMos(i0StexEcha)=(Double_t)0.;}
2369 
2370  //................... Calculation
2372  std::cout << " Calculation, for each pair of channels, of the covariance (over the events)" << std::endl
2373  << " between the ADC expectation values (over the samples 1 to "
2374  << fNbSampForCalc << ")." << std::endl;}
2375 
2376  std::cout << " Please, wait (end at i= " << fEcal->MaxCrysEcnaInStex() << "): " << std::endl;
2377 
2378  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2379  {
2380  MoeOfMos(i0StexEcha) = (Double_t)0;
2381 
2382  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2383  || ( fFlagSubDet == "EB") )
2384  {
2385  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
2386  {
2387  // Calculation, for each event, of the mean over the samples ( = E_s[A(c_i,s*,e_n] )
2388  mean_over_samples(i0StexEcha, n_event) = (Double_t)0.;
2389  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
2390  {
2391  mean_over_samples(i0StexEcha, n_event) += fT3d_AdcValues[i0StexEcha][i0Sample][n_event];
2392  }
2393  mean_over_samples(i0StexEcha, n_event) /= (Double_t)fNbSampForCalc;
2394  }
2395  //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*]] )
2396  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
2397  {MoeOfMos(i0StexEcha) += mean_over_samples(i0StexEcha, n_event);}
2398  MoeOfMos(i0StexEcha) /= (Double_t)fNumberOfEvents;
2399  }
2400  }
2401 
2402  //... Calculation of half of the matrix, diagonal included (LowFrequencyCovariancesBetweenChannels)
2403  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
2404  {
2405  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, i0StexEcha) > 0)
2406  || ( fFlagSubDet == "EB") )
2407  {
2408  for(Int_t j0StexEcha = 0; j0StexEcha <= i0StexEcha; j0StexEcha++)
2409  {
2410  if( (fFlagSubDet == "EE" && fEcalNumbering->StexEchaForCons(fFileHeader->fStex, j0StexEcha) > 0)
2411  || ( fFlagSubDet == "EB") )
2412  {
2413  fT2d_lf_cov[i0StexEcha][j0StexEcha] = (Double_t)0;
2414  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
2415  {
2416  fT2d_lf_cov[i0StexEcha][j0StexEcha] +=
2417  ( mean_over_samples(i0StexEcha, n_event) - MoeOfMos(i0StexEcha) )
2418  *( mean_over_samples(j0StexEcha, n_event) - MoeOfMos(j0StexEcha) );
2419  }
2420  fT2d_lf_cov[i0StexEcha][j0StexEcha] /= (Double_t)fNumberOfEvents;
2421 
2422  fT2d_lf_cov[j0StexEcha][i0StexEcha] = fT2d_lf_cov[i0StexEcha][j0StexEcha];
2423  }
2424  }
2425  if( i0StexEcha%100 == 0 ){std::cout << i0StexEcha << "[LFN Cov], ";}
2426  }
2427  }
2428  std::cout << std::endl;
2429  fTagLfCov[0] = 1; fFileHeader->fLfCovCalc++;
2430 }
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
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 2723 of file TEcnaRun.cc.

References LowFrequencyMeanCorrelationsBetweenStins().

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

Definition at line 2726 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, mps_fire::i, LowFrequencyCorrelationsBetweenChannels(), TEcnaParEcal::MaxCrysInStin(), and TEcnaParEcal::MaxStinEcnaInStex().

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

2727 {
2728 //Calculation of the mean Low Frequency Correlations
2729 //between channels for each Stin
2730 
2731  //... preliminary calculation of the Low Frequency Cor(c,c) if not done yet
2732  // Only one tag (dim=1) to set to 0 (no write in the result ROOT file)
2734 
2735  //..... mean fT2d_lfcc_mostins for each pair (Stin_X,Stin_Y)
2736  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::LowFrequencyMeanCorrelationsBetweenStins()" << std::endl;}
2738  std::cout << " Calculation of the mean, for each "
2739  << fStinName.Data() << ", of the" << std::endl
2740  << " Low Frequency Correlations between channels." << std::endl;}
2741 
2742  //................. allocation fT2d_lfcc_mostins + init to zero (mandatory)
2743  if( fT2d_lfcc_mostins == nullptr ){
2744  const Int_t n_Stin = fEcal->MaxStinEcnaInStex();
2745  fT2d_lfcc_mostins = new Double_t*[n_Stin]; fCnew++;
2746  fT2d1_lfcc_mostins = new Double_t[n_Stin*n_Stin]; fCnew++;
2747  for(Int_t i0StexStinEcna = 0 ; i0StexStinEcna < n_Stin ; i0StexStinEcna++){
2748  fT2d_lfcc_mostins[i0StexStinEcna] = &fT2d1_lfcc_mostins[0] + i0StexStinEcna*n_Stin;}
2749  }
2750 
2751  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2752  {
2753  for(Int_t j0StexStinEcna=0; j0StexStinEcna<fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
2754  {
2755  if( fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] != (Double_t)0 )
2756  {fMiscDiag[31]++; fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] = (Double_t)0;}
2757  }
2758  }
2759 
2760  //..... Calculation of the mean LF Cor(c,c) for each pair (Stin_X,Stin_Y)
2761  //
2762  // ! => Warning: this matrix is NOT symmetric => take N*N elements
2763  // Only (Stin,Stin) matrix is symmetric.
2764  // (StinEcha,StinEcha) matrix inside a (Stin,Stin) element is NOT symmetric
2765  // (except for the (Stin,Stin) DIAGONAL elements)
2766  // Then:
2767  // 1D array half_LFccMos[N*N] to put the (channel,channel) correlations
2768 
2769  Int_t ndim = (Int_t)(fEcal->MaxCrysInStin()*fEcal->MaxCrysInStin());
2770 
2771  TVectorD half_LFccMos(ndim); for(Int_t i=0; i<ndim; i++){half_LFccMos(i)=(Double_t)0.;}
2772 
2773  //..................... Calculation
2774  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::LowFrequencyMeanCorrelationsBetweenStins()" << std::endl;}
2776  std::cout << " Calculation, for each "
2777  << fStinName.Data() << ", of the mean " << std::endl
2778  << " Low Frequency cor(c,c)." << std::endl;}
2779 
2780  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2781  {
2782  for(Int_t j0StexStinEcna=0; j0StexStinEcna<fEcal->MaxStinEcnaInStex(); j0StexStinEcna++)
2783  {
2784  //................... .Copy the Mean Correlations(c,c') in 1D vector half_LFccMos()
2785  Int_t i_count = 0;
2786  for(Int_t i0StinCrys=0; i0StinCrys<fEcal->MaxCrysInStin(); i0StinCrys++)
2787  {
2788  Int_t i0StexEcha = i0StexStinEcna*fEcal->MaxCrysInStin() + i0StinCrys;
2789  for(Int_t j0StinCrys=0; j0StinCrys<fEcal->MaxCrysInStin(); j0StinCrys++)
2790  {
2791  Int_t j0StexEcha = j0StexStinEcna*fEcal->MaxCrysInStin() + j0StinCrys;
2792  if( (i0StexEcha>= 0 && i0StexEcha < fEcal->MaxCrysEcnaInStex()) &&
2793  (j0StexEcha>= 0 && j0StexEcha < fEcal->MaxCrysEcnaInStex()) )
2794  {half_LFccMos(i_count) = fT2d_lf_cor[i0StexEcha][j0StexEcha]; i_count++;}
2795  else
2796  {std::cout << "!TEcnaRun::LowFrequencyMeanCorrelationsBetweenStins()> Channel number out of range."
2797  << "i0StexEcha = " << i0StexEcha <<", j0StexEcha = " << j0StexEcha << fTTBELL << std::endl; }
2798  }
2799  }
2800  //...... Calculation of the mean absolute values of the LF mean Correlations(c,c')
2801  fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] = (Double_t)0;
2802  for(Int_t i_rcor = 0; i_rcor < ndim; i_rcor++)
2803  {
2804  fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] += fabs(half_LFccMos(i_rcor));
2805  }
2806  fT2d_lfcc_mostins[i0StexStinEcna][j0StexStinEcna] /= (Double_t)ndim;
2807  }
2808  if( i0StexStinEcna%10 == 0 ){std::cout << i0StexStinEcna << "[LFN MCtt], ";}
2809  }
2810  std::cout << std::endl;
2811 
2813 } // ------- end of LowFrequencyMeanCorrelationsBetweenStins() -------
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:2440
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 2721 of file TEcnaRun.cc.

References LowFrequencyMeanCorrelationsBetweenStins().

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

Definition at line 1681 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, mps_fire::i, TEcnaParEcal::MaxCrysEcnaInStex(), mathSSE::sqrt(), and JetChargeProducer_cfi::var.

Referenced by AverageLowFrequencyNoise(), and StandardCalculations().

1682 {
1683 // Calculation, for each channel, of the sigma (over the events)
1684 // of the ADC expectation values (over the samples 0 to fNbSampForCalc-1)
1685 
1686  //................... Allocation fT1d_sigevt_of_evsamp + init to zero (mandatory)
1687  if( fT1d_sigevt_of_evsamp == nullptr ){
1688  fT1d_sigevt_of_evsamp = new Double_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
1689  }
1690  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1691  {
1692  if( fT1d_sigevt_of_evsamp[i0StexEcha] != (Double_t)0 )
1693  {fMiscDiag[13]++; fT1d_sigevt_of_evsamp[i0StexEcha] = (Double_t)0;}
1694  }
1695 
1696  //................... Allocation mean_over_samples
1697  TVectorD mean_over_samples(fNumberOfEvents);
1698  for(Int_t i=0; i<fNumberOfEvents; i++){mean_over_samples(i)=(Double_t)0.;}
1699 
1700  //..................... Calculation
1701  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::LowFrequencyNoise()" << std::endl;}
1703  std::cout << " Calculation, for each channel, of the sigma (over the events)" << std::endl
1704  << " of the ADC expectation values (over the samples 1 to "
1705  << fNbSampForCalc << ")." << std::endl;}
1706 
1707  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1708  {
1709  // Calculation of the mean over the events of the mean over the samples
1710  Double_t mean_over_events = (Double_t)0;
1711  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
1712  {
1713  // Calculation, for each event, of the mean over the samples
1714  mean_over_samples(n_event) = (Double_t)0.;
1715  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
1716  {
1717  mean_over_samples(n_event) += fT3d_AdcValues[i0StexEcha][i0Sample][n_event];
1718  }
1719  mean_over_samples(n_event) /= (Double_t)fNbSampForCalc;
1720 
1721  mean_over_events += mean_over_samples(n_event);
1722  }
1723  mean_over_events /= (Double_t)fNumberOfEvents;
1724 
1725  // Calculation of the sigma over the events of the mean over the samples
1726  Double_t var = (Double_t)0;
1727  for (Int_t n_event = 0; n_event < fNumberOfEvents; n_event++)
1728  {
1729  Double_t ecart = mean_over_samples(n_event) - mean_over_events;
1730  var += ecart*ecart;
1731  }
1732  var /= (Double_t)fNumberOfEvents;
1733 
1734  fT1d_sigevt_of_evsamp[i0StexEcha] = sqrt(var);
1735  }
1736  fTagLfn[0] = 1; fFileHeader->fLfnCalc++;
1737 }
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:18
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()
Int_t fLfnCalc
Definition: TEcnaHeader.h:87
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::MeanCorrelationsBetweenSamples ( )

Definition at line 1823 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, mps_fire::i, and TEcnaParEcal::MaxCrysEcnaInStex().

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

1824 {
1825  // Calculation, for all the channels, of the expectation values
1826  // of the correlations between the first fNbSampForCalc samples
1827 
1828  //... preliminary calculation of the correlations if not done yet
1829  // (test only the first element since the cor are computed globaly)
1830  if ( fTagCorCss[0] != 1 ){CorrelationsBetweenSamples(); fTagCorCss[0]=0;}
1831 
1832  //................... Allocations ev_cor_ss + init to zero (mandatory)
1833  if( fT1d_ev_cor_ss == nullptr ){
1834  Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
1835  fT1d_ev_cor_ss = new Double_t[n_StexEcha]; fCnew++;
1836  }
1837  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1838  {
1839  if( fT1d_ev_cor_ss[i0StexEcha] != (Double_t)0 )
1840  {fMiscDiag[15]++; fT1d_ev_cor_ss[i0StexEcha] = (Double_t)0;}
1841  }
1842 
1843  //.......... 1D array half_cor_ss[N(N-1)/2] to put the N (sample,sample) correlations
1844  // ( half of (them minus the diagonal) )
1845  Int_t ndim = (Int_t)(fNbSampForCalc*(fNbSampForCalc - 1)/2);
1846 
1847  TVectorD half_cor_ss(ndim); for(Int_t i=0; i<ndim; i++){half_cor_ss(i)=(Double_t)0.;}
1848 
1849  //..................... Calculation
1850  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::MeanCorrelationsBetweenSamples()" << std::endl;}
1852  std::cout << " Calculation, for all the channels, of the expectation values of the" << std::endl
1853  << " correlations between the first " << fNbSampForCalc << " samples." << std::endl;}
1854 
1855  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1856  {
1857  //..................... half_cor_ss() array filling
1858  Int_t i_count = 0;
1859  for (Int_t i0Sample = 0; i0Sample < fNbSampForCalc; i0Sample++)
1860  {
1861  for (Int_t j0Sample = 0; j0Sample < i0Sample; j0Sample++)
1862  {
1863  half_cor_ss(i_count) = fT3d_cor_ss[i0StexEcha][i0Sample][j0Sample];
1864  i_count++;
1865  }
1866  }
1867  //...................... mean cor(s,s') calculation
1868  fT1d_ev_cor_ss[i0StexEcha] = (Double_t)0;
1869  for(Int_t i_rcor = 0; i_rcor < ndim; i_rcor++)
1870  {
1871  fT1d_ev_cor_ss[i0StexEcha] += half_cor_ss(i_rcor);
1872  }
1873  fT1d_ev_cor_ss[i0StexEcha] /= (Double_t)ndim;
1874  }
1876 }
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()
void CorrelationsBetweenSamples()
Definition: TEcnaRun.cc:1509
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,
const TString &  status 
)

Definition at line 2929 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 mps_update::status.

Referenced by WriteRootFile().

2929  {
2930 //Open the Root file
2931 
2932  Bool_t ok_open = kFALSE;
2933 
2934  TString s_name;
2935  s_name = fCnaParPaths->ResultsRootFilePath();
2936  s_name.Append('/');
2937  s_name.Append(name);
2938 
2939  //gCnaRootFile = new TEcnaRootFile(fObjectManager, s_name.Data(), status); fCnew++;
2940 
2941  Long_t iCnaRootFile = fObjectManager->GetPointerValue("TEcnaRootFile");
2942  if( iCnaRootFile == 0 )
2943  {
2944  gCnaRootFile = new TEcnaRootFile(fObjectManager, s_name.Data(), status); /* Anew("gCnaRootFile");*/
2945  }
2946  else
2947  {
2948  gCnaRootFile = (TEcnaRootFile*)iCnaRootFile;
2949  gCnaRootFile->ReStart(s_name.Data(), status);
2950  }
2951 
2952  if ( gCnaRootFile->fRootFileStatus == "RECREATE" ){ok_open = gCnaRootFile->OpenW();}
2953  if ( gCnaRootFile->fRootFileStatus == "READ" ){ok_open = gCnaRootFile->OpenR();}
2954 
2955  if (!ok_open) // unable to open file
2956  {
2957  std::cout << "TEcnaRun::OpenRootFile> Cannot open file " << s_name.Data() << std::endl;
2958  }
2959  else
2960  {
2962  {std::cout << "*TEcnaRun::OpenRootFile> Open ROOT file OK for file " << s_name.Data() << std::endl;}
2963  fOpenRootFile = kTRUE;
2964  }
2965  return ok_open;
2966 }
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: TEcnaRun.cc:13
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 *)
Bool_t OpenW(const Text_t *="")
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:232
void TEcnaRun::Pedestals ( )

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

1584 {
1585 // Calculation, for each channel, of the expectation values
1586 // (over the samples 0 to fNbSampForCalc-1) of the ADC expectation values
1587 // (over the events)
1588 
1589  //... preliminary calculation of the expectation values if not done yet
1590  if ( fTagMSp[0] != 1 ){SampleMeans(); fTagMSp[0]=0;}
1591 
1592  //................... Allocation ev_ev + init to zero (mandatory)
1593  if( fT1d_ev_ev == nullptr ){fT1d_ev_ev = new Double_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;}
1594  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1595  {if( fT1d_ev_ev[i0StexEcha] != (Double_t)0 )
1596  {fMiscDiag[11]++; fT1d_ev_ev[i0StexEcha] = (Double_t)0;}}
1597 
1598  //..................... Calculation
1599  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::Pedestals()" << std::endl;}
1601  std::cout << " Calculation, for all the channels, of the expectation values (over the samples 1 to "
1602  << fNbSampForCalc << ")" << std::endl
1603  << " of the ADC expectation values (over the events)." << std::endl;}
1604 
1605  for(Int_t i0StexEcha = 0; i0StexEcha < fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1606  {
1607  for (Int_t i0Sample = 0; i0Sample < fNbSampForCalc; i0Sample++)
1608  {
1609  fT1d_ev_ev[i0StexEcha] += fT2d_ev[i0StexEcha][i0Sample];
1610  }
1611  fT1d_ev_ev[i0StexEcha] /= fNbSampForCalc;
1612  }
1613  fTagPed[0] = 1; fFileHeader->fPedCalc++;
1614 }
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:1329
Int_t fCnew
Definition: TEcnaRun.h:373
Int_t * fTagMSp
Definition: TEcnaRun.h:428
Int_t MaxCrysEcnaInStex()
TEcnaParEcal * fEcal
Definition: TEcnaRun.h:384
void TEcnaRun::PrintAllComments ( )

Definition at line 4544 of file TEcnaRun.cc.

References gather_cfg::cout, fCodePrintAllComments, and fFlagPrint.

4545 {
4546 // Set flags to authorize printing of the comments of all the methods
4547 
4549  std::cout << "*TEcnaRun::PrintAllComments()> All the comments will be printed" << std::endl;
4550 }
Int_t fCodePrintAllComments
Definition: TEcnaRun.h:510
Int_t fFlagPrint
Definition: TEcnaRun.h:509
void TEcnaRun::PrintComments ( )

Definition at line 4528 of file TEcnaRun.cc.

References gather_cfg::cout, fCodePrintComments, and fFlagPrint.

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

Definition at line 4552 of file TEcnaRun.cc.

References fCodePrintNoComment, and fFlagPrint.

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

Definition at line 4536 of file TEcnaRun.cc.

References gather_cfg::cout, fCodePrintWarnings, and fFlagPrint.

4537 {
4538 // Set flags to authorize printing of warnings
4539 
4541  std::cout << "*TEcnaRun::PrintWarnings()> Warnings will be printed" << std::endl;
4542 }
Int_t fFlagPrint
Definition: TEcnaRun.h:509
Int_t fCodePrintWarnings
Definition: TEcnaRun.h:510
Bool_t TEcnaRun::ReadSampleAdcValues ( )

Definition at line 1057 of file TEcnaRun.cc.

References fEcal, and TEcnaParEcal::MaxSampADC().

Referenced by TEcnaGui::Calculations().

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

Definition at line 1059 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(), mps_fire::i, TEcnaRead::LookAtRootFile(), TEcnaParEcal::MaxCrysEcnaInStex(), TEcnaParEcal::MaxCrysInStin(), TEcnaParEcal::MaxStinEcnaInStex(), TEcnaRead::PrintNoComment(), TEcnaRead::ReadNumberOfEventsForSamples(), TEcnaRead::ReadSampleAdcValuesSameFile(), TEcnaRead::ReadStinNumbers(), and TEcnaParPaths::ResultsRootFilePath().

1060 {
1061  // read the Sample ADC values from "ADC" result root files (ReadSampleAdcValues)
1062 
1063  // put the number of sample for calculations in attribute fNbSampForCalc
1064  // and call the method without arguments
1065  // We must have: nb_samp_for_calc <= fFileHeader->fNbOfSamples (= nb of samples in ROOT file)
1066 
1067  fNbSampForCalc = nb_samp_for_calc;
1068 
1069 // TEcnaRead* MyRootFile = new TEcnaRead(fFlagSubDet.Data(), fCnaParPaths, fCnaParCout,
1070 // fFileHeader, fEcalNumbering, fCnaWrite); // fCnew++;
1071 
1072  TEcnaRead* MyRootFile = new TEcnaRead(fObjectManager, fFlagSubDet.Data()); // fCnew++;
1073 
1074  MyRootFile->PrintNoComment();
1075 
1079  fCnaParPaths->ResultsRootFilePath().Data());
1080 
1081  Bool_t ok_read = MyRootFile->LookAtRootFile();
1082 
1083  fFileHeader->fStartTime = MyRootFile->GetStartTime();
1084  fFileHeader->fStopTime = MyRootFile->GetStopTime();
1085  fFileHeader->fStartDate = MyRootFile->GetStartDate();
1086  fFileHeader->fStopDate = MyRootFile->GetStopDate();
1087 
1088  if ( ok_read == kTRUE )
1089  {
1090  fRootFileName = MyRootFile->GetRootFileName();
1091  fRootFileNameShort = MyRootFile->GetRootFileNameShort();
1092  std::cout << "*TEcnaRun::ReadSampleAdcValues> Reading sample ADC values from file: " << std::endl
1093  << " " << fRootFileName << std::endl;
1094 
1095  size_t i_no_data = 0;
1096 
1097  //.......... Read the StinNumbers in the old file (ReadSampleAdcValues)
1098  TVectorD vec(fEcal->MaxStinEcnaInStex());
1099  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
1100  vec = MyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
1101  if( MyRootFile->DataExist() == kTRUE )
1102  {
1103  fTagStinNumbers[0] = 1;
1105  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
1106  {fT1d_StexStinFromIndex[i0StexStinEcna] = (Int_t)vec(i0StexStinEcna);}
1107  }
1108  else
1109  {
1110  i_no_data++;
1111  }
1112  //.......... Read the Numbers of Events in the old file (ReadSampleAdcValues)
1113  TMatrixD partial_matrix(fEcal->MaxCrysInStin(), fFileHeader->fNbOfSamples);
1114  for(Int_t i=0; i<fEcal->MaxCrysInStin(); i++)
1115  {for(Int_t j=0; j<fFileHeader->fNbOfSamples; j++){partial_matrix(i,j)=(Double_t)0.;}}
1116 
1117  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
1118  {
1119  Int_t n1StexStin = MyRootFile->GetStexStinFromIndex(i0StexStinEcna);
1120  if(n1StexStin != -1)
1121  {
1122  partial_matrix =
1123  MyRootFile->ReadNumberOfEventsForSamples
1124  (n1StexStin, fEcal->MaxCrysInStin(), fFileHeader->fNbOfSamples);
1125 
1126  if( MyRootFile->DataExist() == kTRUE )
1127  {
1128  fTagNbOfEvts[0] = 1;
1130  for(Int_t i0StinCrys=0; i0StinCrys<fEcal->MaxCrysInStin(); i0StinCrys++)
1131  {
1132  Int_t i0StexEcha = (n1StexStin-1)*fEcal->MaxCrysInStin() + i0StinCrys;
1133  for(Int_t i0Sample=0; i0Sample<fFileHeader->fNbOfSamples; i0Sample++)
1134  {fT2d_NbOfEvts[i0StexEcha][i0Sample] = (Int_t)partial_matrix(i0StinCrys,i0Sample);}
1135  }
1136  }
1137  else
1138  {
1139  i_no_data++;
1140  }
1141  }
1142  }
1143 
1144  //.......... Read the Sample ADC values in the old file (ReadSampleAdcValues)
1145  Double_t*** fT3d_read_AdcValues =
1146  MyRootFile->ReadSampleAdcValuesSameFile
1148 
1149  if( MyRootFile->DataExist() == kTRUE )
1150  {
1151  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1152  {
1153  for(Int_t i0Sample=0; i0Sample<fFileHeader->fNbOfSamples;i0Sample++)
1154  {
1155  for(Int_t i_event=0; i_event<fFileHeader->fReqNbOfEvts; i_event++)
1156  {fT3d_AdcValues[i0StexEcha][i0Sample][i_event] =
1157  fT3d_read_AdcValues[i0StexEcha][i0Sample][i_event];}
1158  }
1159  }
1160  }
1161  else
1162  {
1163  i_no_data++;
1164  }
1165  if(i_no_data)
1166  {
1167  std::cout << "!TEcnaRun::ReadSampleAdcValues(...)> *ERROR* =====> "
1168  << " Read failure. i_no_data = " << i_no_data << fTTBELL << std::endl;
1169  }
1170  }
1171  else
1172  {
1173  std::cout << "!TEcnaRun::ReadSampleAdcValues(...)> *ERROR* =====> "
1174  << " ROOT file not found" << fTTBELL << std::endl;
1175  }
1176  delete MyRootFile; // fCdelete++;
1177  return ok_read;
1178 }
Int_t fStex
Definition: TEcnaHeader.h:56
Int_t * fTagStinNumbers
Definition: TEcnaRun.h:424
TEcnaObject * fObjectManager
Definition: TEcnaRun.h:382
TEcnaHeader * fFileHeader
Definition: TEcnaRun.h:383
TString GetStartDate()
Definition: TEcnaRead.cc:756
TString GetRootFileNameShort()
Definition: TEcnaRead.cc:4357
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:1129
Double_t *** fT3d_AdcValues
Definition: TEcnaRun.h:414
Int_t GetStexStinFromIndex(const Int_t &)
Definition: TEcnaRead.cc:4365
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRun.h:387
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:4462
Int_t MaxCrysInStin()
TString GetRootFileName()
Definition: TEcnaRead.cc:4356
TString fStartDate
Definition: TEcnaHeader.h:60
Bool_t DataExist()
Definition: TEcnaRead.cc:976
TString fTypAna
Definition: TEcnaHeader.h:50
TMatrixD ReadNumberOfEventsForSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1705
Double_t *** ReadSampleAdcValuesSameFile(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:4162
Int_t fFirstReqEvtNumber
Definition: TEcnaHeader.h:53
void FileParameters(const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Definition: TEcnaRead.cc:649
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
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 1329 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, mps_fire::i, and TEcnaParEcal::MaxCrysEcnaInStex().

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

1330 {
1331 // Calculation of the expectation values over events
1332 // for the samples 0 to fNbSampForCalc and for all the StexEchas
1333 
1334  if(fFlagPrint != fCodePrintNoComment){std::cout << "*TEcnaRun::SampleMeans() " << std::endl;}
1336  std::cout << " Calculation: sample expectation values over the events"
1337  << " for each channel." << std::endl;}
1338 
1339  //................... Allocation fT2d_ev
1340  if ( fT2d_ev == nullptr ){
1341  Int_t n_samp = fNbSampForCalc;
1342  Int_t n_StexEcha = fEcal->MaxCrysEcnaInStex();
1343  fT2d_ev = new Double_t*[n_StexEcha]; fCnew++;
1344  fT1d_ev = new Double_t[n_StexEcha*n_samp]; fCnew++;
1345  for(Int_t i = 0 ; i < n_StexEcha ; i++){
1346  fT2d_ev[i] = &fT1d_ev[0] + i*n_samp;}
1347  }
1348  //................... init fT2d_ev to zero
1349  for(Int_t i0StexEcha=0; i0StexEcha<fEcal->MaxCrysEcnaInStex(); i0StexEcha++)
1350  {
1351  for(Int_t i0Sample=0; i0Sample<fNbSampForCalc; i0Sample++)
1352  {
1353  if( fT2d_ev[i0StexEcha][i0Sample] != (Double_t)0 )
1354  {fMiscDiag[1]++; fT2d_ev[i0StexEcha][i0Sample] = (Double_t)0;}
1355  }
1356  }
1357 
1358  //................... Calculation
1359  for (Int_t i0StexEcha = 0 ; i0StexEcha < fEcal->MaxCrysEcnaInStex() ; i0StexEcha++)
1360  {
1361  for (Int_t i0Sample = 0 ; i0Sample < fNbSampForCalc ; i0Sample++)
1362  {
1363  for( Int_t i_event = 0; i_event < fNumberOfEvents; i_event++ )
1364  {
1365  fT2d_ev[i0StexEcha][i0Sample] += fT3d_AdcValues[i0StexEcha][i0Sample][i_event];
1366  }
1367  fT2d_ev[i0StexEcha][i0Sample] /= fNumberOfEvents;
1368  }
1369  }
1370  fTagMSp[0] = 1; fFileHeader->fMSpCalc++;
1371 }
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