CMS 3D CMS Logo

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

#include <TEcnaRead.h>

Inheritance diagram for TEcnaRead:

Public Member Functions

void Adelete (const TString)
 
void Anew (const TString)
 
Bool_t CloseRootFile (const Text_t *)
 
Bool_t DataExist ()
 
TString GetAnalysisName ()
 
Int_t GetFirstReqEvtNumber ()
 
Int_t GetNumberOfBinsSampleAsFunctionOfTime ()
 
void GetReadyToReadRootFile (TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, TString)
 
Int_t GetReqNbOfEvts ()
 
TString GetRootFileName ()
 
TString GetRootFileNameShort ()
 
TString GetRunType ()
 
TString GetStartDate ()
 
time_t GetStartTime ()
 
Int_t GetStexStinFromIndex (const Int_t &)
 
Int_t GetStinIndex (const Int_t &)
 
TString GetStopDate ()
 
time_t GetStopTime ()
 
TString GetTypeOfQuantity (const CnaResultTyp)
 
void Init ()
 
Bool_t LookAtRootFile ()
 
Bool_t OpenRootFile (const Text_t *, TString)
 
TEcnaReadoperator= (const TEcnaRead &)
 
void PrintAllComments ()
 
void PrintComments ()
 
void PrintNoComment ()
 
void PrintWarnings ()
 
TVectorD ReadAveragedHighFrequencyNoise (const Int_t &)
 
TVectorD ReadAveragedLowFrequencyNoise (const Int_t &)
 
TVectorD ReadAveragedMeanOfCorrelationsBetweenSamples (const Int_t &)
 
TVectorD ReadAveragedNumberOfEvents (const Int_t &)
 
TVectorD ReadAveragedPedestals (const Int_t &)
 
TVectorD ReadAveragedSigmaOfCorrelationsBetweenSamples (const Int_t &)
 
TVectorD ReadAveragedTotalNoise (const Int_t &)
 
TMatrixD ReadCorrelationsBetweenSamples (const Int_t &, const Int_t &, const Int_t &)
 
TMatrixD ReadCovariancesBetweenSamples (const Int_t &, const Int_t &, const Int_t &)
 
TMatrixD ReadHighFrequencyCorrelationsBetweenChannels (const Int_t &, const Int_t &, const Int_t &)
 
TMatrixD ReadHighFrequencyCorrelationsBetweenChannels (const Int_t &)
 
TMatrixD ReadHighFrequencyCovariancesBetweenChannels (const Int_t &, const Int_t &, const Int_t &)
 
TMatrixD ReadHighFrequencyCovariancesBetweenChannels (const Int_t &)
 
TMatrixD ReadHighFrequencyMeanCorrelationsBetweenStins (const Int_t &)
 
TVectorD ReadHighFrequencyNoise (const Int_t &)
 
TMatrixD ReadLowFrequencyCorrelationsBetweenChannels (const Int_t &, const Int_t &, const Int_t &)
 
TMatrixD ReadLowFrequencyCorrelationsBetweenChannels (const Int_t &)
 
TMatrixD ReadLowFrequencyCovariancesBetweenChannels (const Int_t &, const Int_t &, const Int_t &)
 
TMatrixD ReadLowFrequencyCovariancesBetweenChannels (const Int_t &)
 
TMatrixD ReadLowFrequencyMeanCorrelationsBetweenStins (const Int_t &)
 
TVectorD ReadLowFrequencyNoise (const Int_t &)
 
TVectorD ReadMeanOfCorrelationsBetweenSamples (const Int_t &)
 
TVectorD ReadNumberOfEvents (const Int_t &)
 
TMatrixD ReadNumberOfEventsForSamples (const Int_t &, const Int_t &, const Int_t &)
 
TVectorD ReadPedestals (const Int_t &)
 
TVectorD ReadRelevantCorrelationsBetweenSamples (const Int_t &, const Int_t &, const Int_t &)
 
Bool_t ReadRootFileHeader (const Int_t &)
 
TVectorD ReadSampleMeans (const Int_t &, const Int_t &, const Int_t &)
 
TVectorD ReadSampleSigmas (const Int_t &, const Int_t &, const Int_t &)
 
TVectorD ReadSampleValues (const Int_t &, const Int_t &, const Int_t &)
 
Double_t *** ReadSampleValuesSameFile (const Int_t &, const Int_t &, const Int_t &)
 
TVectorD ReadSigmaOfCorrelationsBetweenSamples (const Int_t &)
 
TVectorD ReadStinNumbers (const Int_t &)
 
TVectorD ReadTotalNoise (const Int_t &)
 
void SetEcalSubDetector (const TString, const TEcnaNumbering *, const TEcnaWrite *)
 
 TEcnaRead ()
 
 TEcnaRead (const TString, const TEcnaParPaths *, const TEcnaParCout *, const TEcnaHeader *, const TEcnaNumbering *, const TEcnaWrite *)
 
 TEcnaRead (const TEcnaRead &)
 
virtual ~TEcnaRead ()
 

Private Member Functions

void fCopy (const TEcnaRead &)
 

Private Attributes

Int_t fCdelete
 
TEcnaParCoutfCnaParCout
 
TEcnaParPathsfCnaParPaths
 
TEcnaWritefCnaWrite
 
Int_t fCnew
 
Int_t fCodePrintAllComments
 
Int_t fCodePrintComments
 
Int_t fCodePrintNoComment
 
Int_t fCodePrintWarnings
 
Bool_t fDataExist
 
TEcnaParEcalfEcal
 
TEcnaNumberingfEcalNumbering
 
TEcnaHeaderfFileHeader
 
Int_t fFlagPrint
 
TString fFlagSubDet
 
Int_t fgMaxCar
 
Int_t fLookAtRootFile
 
Int_t fMemoStinNumbers
 
Int_t fNbChanByLine
 
Int_t fNbSampByLine
 
Bool_t fOpenRootFile
 
TString fPathRoot
 
Int_t fReadyToReadRootFile
 
Int_t fSectChanSizeX
 
Int_t fSectChanSizeY
 
Int_t fSectSampSizeX
 
Int_t fSectSampSizeY
 
TString fStexName
 
TString fStinName
 
Int_t * fT1d_StexStinFromIndex
 
Double_t * fT3d1_distribs
 
Double_t ** fT3d2_distribs
 
Double_t *** fT3d_distribs
 
Int_t * fTagStinNumbers
 
TString fTTBELL
 
Int_t fUserChan
 
Int_t fUserSamp
 

Detailed Description

Definition at line 38 of file TEcnaRead.h.

Constructor & Destructor Documentation

TEcnaRead::TEcnaRead ( )

Definition at line 263 of file TEcnaRead.cc.

264 {
265 //Constructor without argument
266 
267  // cout << "[Info Management] CLASS: TEcnaRead. CREATE OBJECT: this = " << this << endl;
268 
269  Init();
270 }
void Init()
Definition: TEcnaRead.cc:309
TEcnaRead::TEcnaRead ( const TString  SubDet,
const TEcnaParPaths pCnaParPaths,
const TEcnaParCout pCnaParCout,
const TEcnaHeader pFileHeader,
const TEcnaNumbering pEcalNumbering,
const TEcnaWrite pCnaWrite 
)

Definition at line 272 of file TEcnaRead.cc.

References fCnaParCout, fCnaParPaths, fFileHeader, Init(), and SetEcalSubDetector().

278 {
279 //Constructor with argument
280 
281  // cout << "[Info Management] CLASS: TEcnaRead. CREATE OBJECT: this = " << this << endl;
282 
283  fCnaParPaths = 0;
284  if( pCnaParPaths == 0 )
285  {fCnaParPaths = new TEcnaParPaths(); /* Anew("fCnaParPaths");*/ }
286  else
287  {fCnaParPaths = (TEcnaParPaths*)pCnaParPaths;}
288 
289  fCnaParCout = 0;
290  if( pCnaParCout == 0 )
291  {fCnaParCout = new TEcnaParCout(); /*Anew("fCnaParCout");*/ }
292  else
293  {fCnaParCout = (TEcnaParCout*)pCnaParCout;}
294 
295  fFileHeader = 0;
296  if( pFileHeader == 0 )
297  {
298  const Text_t *h_name = "CnaHeader"; //==> voir cette question avec FXG
299  const Text_t *h_title = "CnaHeader"; //==> voir cette question avec FXG
300  fFileHeader = new TEcnaHeader(h_name, h_title); // Anew("fFileHeader");
301  }
302  else
303  {fFileHeader = (TEcnaHeader*)pFileHeader;}
304 
305  Init();
306  SetEcalSubDetector(SubDet.Data(), pEcalNumbering, pCnaWrite);
307 }
void SetEcalSubDetector(const TString, const TEcnaNumbering *, const TEcnaWrite *)
Definition: TEcnaRead.cc:366
TEcnaParCout * fCnaParCout
Definition: TEcnaRead.h:53
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRead.h:54
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
void Init()
Definition: TEcnaRead.cc:309
TEcnaRead::TEcnaRead ( const TEcnaRead dcop)

Definition at line 452 of file TEcnaRead.cc.

References gather_cfg::cout.

453 {
454  cout << "*TEcnaRead::TEcnaRead(const TEcnaRead& dcop)> "
455  << " It is time to write a copy constructor" << endl
456  // << " type an integer value and then RETURN to continue"
457  << endl;
458 
459  // { Int_t cintoto; cin >> cintoto; }
460 
461 }
tuple cout
Definition: gather_cfg.py:41
TEcnaRead::~TEcnaRead ( )
virtual

Definition at line 483 of file TEcnaRead.cc.

References Adelete(), gather_cfg::cout, fCdelete, fCnew, fCodePrintAllComments, fCodePrintComments, fFlagPrint, fT1d_StexStinFromIndex, fT3d1_distribs, fT3d2_distribs, fT3d_distribs, fTagStinNumbers, and fTTBELL.

484 {
485 //Destructor
486 
487  // cout << "[Info Management] CLASS: TEcnaRead. DESTROY OBJECT: this = " << this << endl;
488 
490  cout << "*TEcnaRead::~TEcnaRead()> Entering destructor" << endl;}
491 
492  //if (fFileHeader != 0){delete fFileHeader; Adelete("fFileHeader");}
493  //if (fEcal != 0){delete fEcal; Adelete("fEcal");}
494  //if (fCnaParCout != 0){delete fCnaParCout; Adelete("fCnaParCout");}
495  //if (fCnaParPaths != 0){delete fCnaParPaths; Adelete("fCnaParPaths");}
496  //if (fCnaWrite != 0){delete fCnaWrite; Adelete("fCnaWrite");}
497  //if (fEcalNumbering != 0){delete fEcalNumbering; Adelete("fEcalNumbering");}
498 
499  if (fT1d_StexStinFromIndex != 0){delete [] fT1d_StexStinFromIndex; Adelete("fT1d_StexStinFromIndex");}
500  if (fTagStinNumbers != 0){delete [] fTagStinNumbers; Adelete("fTagStinNumbers");}
501 
502  if (fT3d_distribs != 0){delete [] fT3d_distribs; Adelete("fT3d_distribs");}
503  if (fT3d2_distribs != 0){delete [] fT3d2_distribs; Adelete("fT3d2_distribs");}
504  if (fT3d1_distribs != 0){delete [] fT3d1_distribs; Adelete("fT3d1_distribs");}
505 
506  if ( fCnew != fCdelete )
507  {
508  cout << "!TEcnaRead/destructor> WRONG MANAGEMENT OF ALLOCATIONS: fCnew = "
509  << fCnew << ", fCdelete = " << fCdelete << fTTBELL << endl;
510  }
511  else
512  {
513  // cout << "*TEcnaRead/destructor> BRAVO! GOOD MANAGEMENT OF ALLOCATIONS: fCnew = "
514  // << fCnew << ", fCdelete = " << fCdelete << endl;
515  }
516 
518  cout << "*TEcnaRead::~TEcnaRead()> End of destructor " << endl;}
519 }
Double_t *** fT3d_distribs
Definition: TEcnaRead.h:91
Int_t fCnew
Definition: TEcnaRead.h:48
Double_t ** fT3d2_distribs
Definition: TEcnaRead.h:92
Double_t * fT3d1_distribs
Definition: TEcnaRead.h:93
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRead.h:69
TString fTTBELL
Definition: TEcnaRead.h:51
Int_t fCdelete
Definition: TEcnaRead.h:49
Int_t fFlagPrint
Definition: TEcnaRead.h:83
tuple cout
Definition: gather_cfg.py:41
Int_t * fTagStinNumbers
Definition: TEcnaRead.h:70
Int_t fCodePrintComments
Definition: TEcnaRead.h:84
void Adelete(const TString)
Definition: TEcnaRead.cc:403

Member Function Documentation

void TEcnaRead::Adelete ( const TString  VarName)

Definition at line 403 of file TEcnaRead.cc.

References fCdelete.

Referenced by CloseRootFile(), OpenRootFile(), and ~TEcnaRead().

404 {
405  // allocation survey for delete
406 
407  fCdelete++;
408  // cout << "TEcnaRead::Adelete> ========== delete" << setw(4) << fCdelete << " -> " << setw(25)
409  // << VarName.Data() << " / object(this): " << this << endl;
410 }
Int_t fCdelete
Definition: TEcnaRead.h:49
void TEcnaRead::Anew ( const TString  VarName)

Definition at line 394 of file TEcnaRead.cc.

References fCnew.

Referenced by LookAtRootFile(), and OpenRootFile().

395 {
396  // allocation survey for new
397 
398  fCnew++;
399  // cout << "TEcnaRead::Anew---> new " << setw(4) << fCnew << " --------------> " << setw(25)
400  // << VarName.Data() << " / object(this): " << this << endl;
401 }
Int_t fCnew
Definition: TEcnaRead.h:48
Bool_t TEcnaRead::CloseRootFile ( const Text_t *  name)

Definition at line 844 of file TEcnaRead.cc.

References Adelete(), TCnaRootFile::CloseFile(), gather_cfg::cout, fCodePrintAllComments, fFlagPrint, fOpenRootFile, fTTBELL, and gCnaRootFile.

Referenced by ReadAveragedHighFrequencyNoise(), ReadAveragedLowFrequencyNoise(), ReadAveragedMeanOfCorrelationsBetweenSamples(), ReadAveragedPedestals(), ReadAveragedSigmaOfCorrelationsBetweenSamples(), ReadAveragedTotalNoise(), ReadCorrelationsBetweenSamples(), ReadCovariancesBetweenSamples(), ReadHighFrequencyCorrelationsBetweenChannels(), ReadHighFrequencyCovariancesBetweenChannels(), ReadHighFrequencyMeanCorrelationsBetweenStins(), ReadHighFrequencyNoise(), ReadLowFrequencyCorrelationsBetweenChannels(), ReadLowFrequencyCovariancesBetweenChannels(), ReadLowFrequencyMeanCorrelationsBetweenStins(), ReadLowFrequencyNoise(), ReadMeanOfCorrelationsBetweenSamples(), ReadNumberOfEventsForSamples(), ReadPedestals(), ReadRelevantCorrelationsBetweenSamples(), ReadRootFileHeader(), ReadSampleMeans(), ReadSampleSigmas(), ReadSampleValues(), ReadSampleValuesSameFile(), ReadSigmaOfCorrelationsBetweenSamples(), ReadStinNumbers(), and ReadTotalNoise().

844  {
845 //Close the Root file
846 
847  Bool_t ok_close = kFALSE;
848 
849  if (fOpenRootFile == kTRUE )
850  {
852 
854  TString e_path; e_path.Append(name);
855  cout << "*TEcnaRead::CloseRootFile> Close ROOT file " << e_path.Data() << " OK " << endl;}
856 
857  if( gCnaRootFile != 0 ){delete gCnaRootFile; gCnaRootFile = 0; Adelete("gCnaRootFile");}
858  fOpenRootFile = kFALSE;
859  ok_close = kTRUE;
860  }
861  else
862  {
863  cout << "*TEcnaRead::CloseRootFile(...)> no close since no file is open"
864  << fTTBELL << endl;
865  }
866 
867  return ok_close;
868 }
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
TString fTTBELL
Definition: TEcnaRead.h:51
void CloseFile()
Int_t fFlagPrint
Definition: TEcnaRead.h:83
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
void Adelete(const TString)
Definition: TEcnaRead.cc:403
Bool_t TEcnaRead::DataExist ( )

Definition at line 876 of file TEcnaRead.cc.

References fDataExist.

Referenced by TEcnaHistos::GetHistoValues(), TEcnaHistos::GetOkViewHisto(), TEcnaRun::ReadEventDistributions(), TEcnaHistos::StexHocoVecoLHFCorcc(), TEcnaHistos::ViewHisto(), TEcnaHistos::ViewMatrix(), TEcnaHistos::ViewStas(), TEcnaHistos::ViewStex(), and TEcnaHistos::ViewStin().

877 {
878  // return kTRUE if the data are present in the ROOT file, kFALSE if not.
879  // fDataExist is set in the read methods
880 
881  return fDataExist;
882 }
Bool_t fDataExist
Definition: TEcnaRead.h:88
void TEcnaRead::fCopy ( const TEcnaRead rund)
private

Definition at line 414 of file TEcnaRead.cc.

References fCdelete, fCnew, fCodePrintAllComments, fCodePrintComments, fCodePrintNoComment, fCodePrintWarnings, fFileHeader, fFlagPrint, fOpenRootFile, fPathRoot, fSectChanSizeX, fSectChanSizeY, fSectSampSizeX, fSectSampSizeY, fTagStinNumbers, fUserChan, and fUserSamp.

Referenced by operator=().

415 {
416 //Private copy
417 
418  fFileHeader = rund.fFileHeader;
420 
421  fUserSamp = rund.fUserSamp;
422  fUserChan = rund.fUserChan;
423 
428 
429  //........................................ Codes
430 
435 
436  //.................................................. Tags
438 
439  fFlagPrint = rund.fFlagPrint;
440  fPathRoot = rund.fPathRoot;
441 
442  fCnew = rund.fCnew;
443  fCdelete = rund.fCdelete;
444 }
Int_t fCnew
Definition: TEcnaRead.h:48
Int_t fUserChan
Definition: TEcnaRead.h:81
TString fPathRoot
Definition: TEcnaRead.h:73
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
Int_t fUserSamp
Definition: TEcnaRead.h:80
Int_t fCodePrintWarnings
Definition: TEcnaRead.h:84
Int_t fCodePrintNoComment
Definition: TEcnaRead.h:84
Int_t fSectChanSizeX
Definition: TEcnaRead.h:75
Int_t fSectSampSizeY
Definition: TEcnaRead.h:75
Int_t fCdelete
Definition: TEcnaRead.h:49
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
Int_t fFlagPrint
Definition: TEcnaRead.h:83
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Int_t * fTagStinNumbers
Definition: TEcnaRead.h:70
Int_t fCodePrintComments
Definition: TEcnaRead.h:84
Int_t fSectSampSizeX
Definition: TEcnaRead.h:75
Int_t fSectChanSizeY
Definition: TEcnaRead.h:75
TString TEcnaRead::GetAnalysisName ( )

Definition at line 3188 of file TEcnaRead.cc.

References gather_cfg::cout, fFileHeader, and TEcnaHeader::fTypAna.

3189 {
3190  TString astring = "?";
3191  if (fFileHeader != 0){astring = fFileHeader->fTypAna;}
3192  else {cout << "!TEcnaRead::GetAnalysisName()> fFileHeader pointer = "
3193  << fFileHeader << endl;}
3194  return astring;
3195 }
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
TString fTypAna
Definition: TEcnaHeader.h:33
tuple cout
Definition: gather_cfg.py:41
Int_t TEcnaRead::GetFirstReqEvtNumber ( )

Definition at line 3197 of file TEcnaRead.cc.

References gather_cfg::cout, fFileHeader, and TEcnaHeader::fFirstReqEvtNumber.

3198 {
3199  Int_t number = -1;
3200  if (fFileHeader != 0){number = fFileHeader->fFirstReqEvtNumber;}
3201  else {cout << "!TEcnaRead::GetFirstReqEvtNumber()> fFileHeader pointer = "
3202  << fFileHeader << endl;}
3203  return number;
3204 }
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
Int_t fFirstReqEvtNumber
Definition: TEcnaHeader.h:36
tuple cout
Definition: gather_cfg.py:41
Int_t TEcnaRead::GetNumberOfBinsSampleAsFunctionOfTime ( )

Definition at line 3216 of file TEcnaRead.cc.

References GetReqNbOfEvts().

3216 {return GetReqNbOfEvts();}
Int_t GetReqNbOfEvts()
Definition: TEcnaRead.cc:3206
void TEcnaRead::GetReadyToReadRootFile ( TString  typ_ana,
const Int_t &  nb_of_samples,
const Int_t &  run_number,
const Int_t &  nfirst,
const Int_t &  nlast,
const Int_t &  nreqevts,
const Int_t &  Stex,
TString  path_root 
)

Definition at line 532 of file TEcnaRead.cc.

References gather_cfg::cout, fCnaWrite, fCodePrintAllComments, fCodePrintComments, fFileHeader, TEcnaHeader::fFirstReqEvtNumber, fFlagPrint, TEcnaHeader::fLastReqEvtNumber, TEcnaWrite::fMakeResultsFileName(), fMemoStinNumbers, TEcnaHeader::fNbOfSamples, fPathRoot, fReadyToReadRootFile, TEcnaHeader::fReqNbOfEvts, TEcnaHeader::fRunNumber, TEcnaHeader::fStex, TEcnaHeader::fTypAna, TEcnaHeader::HeaderParameters(), nlast, and TEcnaWrite::RegisterFileParameters().

Referenced by TEcnaRun::ReadEventDistributions(), TEcnaHistos::StexHocoVecoLHFCorcc(), TEcnaHistos::ViewHistime(), TEcnaHistos::ViewHisto(), TEcnaHistos::ViewMatrix(), TEcnaHistos::ViewStas(), TEcnaHistos::ViewStex(), and TEcnaHistos::ViewStin().

536 {
537  //Preparation for reading the ROOT file
538 
539  // Preliminary save of the arguments values because it can be of the form: fFileHeader->...
540  // and because fFileHeader can be deleted and re-created in this method
541 
542  TString sTypAna = typ_ana;
543  Int_t nNbOfSamples = nb_of_samples;
544  Int_t nRunNumber = run_number;
545  Int_t nFirstEvt = nfirst;
546  Int_t nLastEvt = nlast;
547  Int_t nReqNbOfEvts = nreqevts;
548  Int_t nStexNumber = Stex;
549 
550  //................................................................................................
551  const Text_t *h_name = "CnaHeader"; //==> voir cette question avec FXG
552  const Text_t *h_title = "CnaHeader"; //==> voir cette question avec FXG
553 
554  //----------- old version, with arguments h_name, h_title, (FXG) -----(----
555  //
556  // fFileHeader->HeaderParameters(h_name, h_title,
557  // sTypAna, nNbOfSamples, nRunNumber,
558  // nFirstEvt, nLastEvt, nReqNbOfEvts, nStexNumber);
559  //
560  //-------------------------------------------------------------------------
561 
562  //---------- new version
563  if( fFileHeader == 0 ){fFileHeader = new TEcnaHeader(h_name, h_title); /* Anew("fFileHeader") */ ;}
564  fFileHeader->HeaderParameters(sTypAna, nNbOfSamples, nRunNumber,
565  nFirstEvt, nLastEvt, nReqNbOfEvts, nStexNumber);
566 
567  // After this call to TEcnaHeader, we have:
568  // fFileHeader->fTypAna = sTypAna
569  // fFileHeader->fNbOfSamples = nNbOfSamples
570  // fFileHeader->fRunNumber = nRunNumber
571  // fFileHeader->fFirstReqEvtNumber = nFirstEvt
572  // fFileHeader->fLastReqEvtNumber = nLastEvt
573  // fFileHeader->fReqNbOfEvts = nReqNbOfEvts
574  // fFileHeader->fStex = nStexNumber ( GetReadyToReadRootFile(...) )
575  //.......................... path_root
576  fPathRoot = path_root;
577 
578  //-------- gets the arguments for the file names (long and short) and makes these names
579  fCnaWrite->RegisterFileParameters(typ_ana, nb_of_samples, run_number, nfirst, nlast, nreqevts, Stex);
581 
582  //------------------------- init Stin numbers memo flags
583  fMemoStinNumbers = 0;
584 
586  {
587  cout << endl;
588  cout << "*TEcnaRead::GetReadyToReadRootFile(...)>" << endl
589  << " The method has been called with the following argument values:" << endl
590  << " Analysis name = "
591  << fFileHeader->fTypAna << endl
592  << " Nb of required samples = "
593  << fFileHeader->fNbOfSamples << endl
594  << " Run number = "
595  << fFileHeader->fRunNumber << endl
596  << " First requested event number = "
597  << fFileHeader->fFirstReqEvtNumber << endl
598  << " Last requested event number = "
599  << fFileHeader->fLastReqEvtNumber << endl
600  << " Requested number of events = "
601  << fFileHeader->fReqNbOfEvts << endl
602  << " Stex number = "
603  << fFileHeader->fStex << endl
604  << " Path for the ROOT file = "
605  << fPathRoot << endl
606  << endl;
607  }
608 
609  fReadyToReadRootFile = 1; // set flag
610 
612  cout << "*TEcnaRead::GetReadyToReadRootFile(...)> Leaving the method."
613  << endl;}
614 } //----------------- end of GetReadyToReadRootFile(...)
Int_t fStex
Definition: TEcnaHeader.h:39
Int_t fMemoStinNumbers
Definition: TEcnaRead.h:71
TString fPathRoot
Definition: TEcnaRead.h:73
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
Int_t fReadyToReadRootFile
Definition: TEcnaRead.h:66
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:38
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
Int_t fNbOfSamples
Definition: TEcnaHeader.h:34
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:446
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
TString fTypAna
Definition: TEcnaHeader.h:33
Int_t fFirstReqEvtNumber
Definition: TEcnaHeader.h:36
Int_t fFlagPrint
Definition: TEcnaRead.h:83
Int_t fLastReqEvtNumber
Definition: TEcnaHeader.h:37
int nlast
Definition: AMPTWrapper.h:47
void HeaderParameters(TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaHeader.cc:114
tuple cout
Definition: gather_cfg.py:41
Int_t fRunNumber
Definition: TEcnaHeader.h:35
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:476
Int_t fCodePrintComments
Definition: TEcnaRead.h:84
Int_t TEcnaRead::GetReqNbOfEvts ( )

Definition at line 3206 of file TEcnaRead.cc.

References gather_cfg::cout, fFileHeader, and TEcnaHeader::fReqNbOfEvts.

Referenced by GetNumberOfBinsSampleAsFunctionOfTime().

3207 {
3208  Int_t number = -1;
3209  if (fFileHeader != 0){number = fFileHeader->fReqNbOfEvts;}
3210  else {cout << "!TEcnaRead::GetReqNbOfEvts()> fFileHeader pointer = "
3211  << fFileHeader << endl;}
3212  return number;
3213 }
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:38
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
tuple cout
Definition: gather_cfg.py:41
TString TEcnaRead::GetRootFileName ( )

Definition at line 3167 of file TEcnaRead.cc.

References fCnaWrite, and TEcnaWrite::GetRootFileName().

Referenced by TEcnaRun::ReadEventDistributions().

3167 {return fCnaWrite->GetRootFileName();}
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetRootFileName()
Definition: TEcnaWrite.cc:269
TString TEcnaRead::GetRootFileNameShort ( )
TString TEcnaRead::GetRunType ( )

Definition at line 625 of file TEcnaRead.cc.

References fFileHeader, and TEcnaHeader::fRunType.

Referenced by TEcnaHistos::GetHistoValues(), TEcnaHistos::StexHocoVecoLHFCorcc(), TEcnaHistos::ViewHisto(), TEcnaHistos::ViewMatrix(), TEcnaHistos::ViewStas(), TEcnaHistos::ViewStex(), and TEcnaHistos::ViewStin().

626 {
627  TString cType = "run type not defined";
628  Int_t numtype = fFileHeader->fRunType;
629  //----------------------------------------- run types
630 
631  if( numtype == 0 ){cType = "COSMICS";}
632  if( numtype == 1 ){cType = "BEAMH4";}
633  if( numtype == 2 ){cType = "BEAMH2";}
634  if( numtype == 3 ){cType = "MTCC";}
635  if( numtype == 4 ){cType = "LASER_STD";}
636  if( numtype == 5 ){cType = "LASER_POWER_SCAN";}
637  if( numtype == 6 ){cType = "LASER_DELAY_SCAN";}
638  if( numtype == 7 ){cType = "TESTPULSE_SCAN_MEM";}
639  if( numtype == 8 ){cType = "TESTPULSE_MGPA";}
640  if( numtype == 9 ){cType = "PEDESTAL_STD";}
641  if( numtype == 10 ){cType = "PEDESTAL_OFFSET_SCAN";}
642  if( numtype == 11 ){cType = "PEDESTAL_25NS_SCAN";}
643  if( numtype == 12 ){cType = "LED_STD";}
644 
645  if( numtype == 13 ){cType = "PHYSICS_GLOBAL";}
646  if( numtype == 14 ){cType = "COSMICS_GLOBAL";}
647  if( numtype == 15 ){cType = "HALO_GLOBAL";}
648 
649  if( numtype == 16 ){cType = "LASER_GAP";}
650  if( numtype == 17 ){cType = "TESTPULSE_GAP";}
651  if( numtype == 18 ){cType = "PEDESTAL_GAP";}
652  if( numtype == 19 ){cType = "LED_GAP";}
653 
654  if( numtype == 20 ){cType = "PHYSICS_LOCAL";}
655  if( numtype == 21 ){cType = "COSMICS_LOCAL";}
656  if( numtype == 22 ){cType = "HALO_LOCAL";}
657  if( numtype == 23 ){cType = "CALIB_LOCAL";}
658 
659  if( numtype == 24 ){cType = "PEDSIM";}
660 
661  return cType;
662 }
Int_t fRunType
Definition: TEcnaHeader.h:46
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
TString TEcnaRead::GetStartDate ( )
time_t TEcnaRead::GetStartTime ( )
Int_t TEcnaRead::GetStexStinFromIndex ( const Int_t &  i0StexStinEcna)

Definition at line 3176 of file TEcnaRead.cc.

References fEcal, i, TEcnaParEcal::MaxStinEcnaInStex(), and ReadStinNumbers().

Referenced by TEcnaRun::ReadEventDistributions(), and TEcnaHistos::ViewStex().

3177 {
3178 // Get the Stin number in Stex from the Stin index
3179 
3180  Int_t number = -1;
3181  TVectorD vec(fEcal->MaxStinEcnaInStex());
3182  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
3184  number = (Int_t)vec(i0StexStinEcna);
3185  return number;
3186 }
int i
Definition: DBlmapReader.cc:9
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Int_t MaxStinEcnaInStex()
Int_t TEcnaRead::GetStinIndex ( const Int_t &  n1StexStin)

Definition at line 3222 of file TEcnaRead.cc.

References gather_cfg::cout, fCodePrintAllComments, fEcal, fFlagPrint, fTTBELL, i, TEcnaParEcal::MaxStinEcnaInStex(), and ReadStinNumbers().

Referenced by ReadHighFrequencyCorrelationsBetweenChannels(), ReadHighFrequencyCovariancesBetweenChannels(), ReadLowFrequencyCorrelationsBetweenChannels(), ReadLowFrequencyCovariancesBetweenChannels(), and ReadNumberOfEventsForSamples().

3223 {
3224 //Get the index of the Stin from its number in Stex
3225 
3227  cout << "*TEcnaRead::GetStinIndex(...)> fEcal->MaxStinEcnaInStex() = "
3228  << fEcal->MaxStinEcnaInStex() << endl
3229  << " n1StexStin = " << n1StexStin
3230  << endl << endl;}
3231 
3232  Int_t Stin_index = n1StexStin-1; // suppose les 68 tours
3233 
3234 #define NOGT
3235 #ifndef NOGT
3236  Int_t Stin_index = -1;
3237  TVectorD vec(fEcal->MaxStinEcnaInStex());
3238  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
3240 
3241  //........................... Get the Stin index
3242 
3243  for(Int_t i=0; i < fEcal->MaxStinEcnaInStex(); i++)
3244  {
3246  cout << "*TEcnaRead::GetStinIndex(...)> StinNumber[" << i << "] = "
3247  << vec[i] << endl;}
3248  if ( vec[i] == n1StexStin ){Stin_index = i;}
3249  }
3250 
3252  cout << "~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-" << endl;
3253  cout << "*TEcnaRead::GetStinIndex> Stin number: " << n1StexStin << endl
3254  << " Stin index : " << Stin_index << endl;
3255  cout << "~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-" << endl;}
3256 
3257  if ( Stin_index < 0 )
3258  {
3260  cout << "!TEcnaRead::GetStinIndex *** WARNING ***> n1StexStin" << n1StexStin << " : "
3261  << "index Stin not found"
3262  << fTTBELL << endl;}
3263  }
3264 #endif // NOGT
3265 
3266  return Stin_index;
3267 }
int i
Definition: DBlmapReader.cc:9
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TString fTTBELL
Definition: TEcnaRead.h:51
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Int_t fFlagPrint
Definition: TEcnaRead.h:83
tuple cout
Definition: gather_cfg.py:41
Int_t MaxStinEcnaInStex()
TString TEcnaRead::GetStopDate ( )
time_t TEcnaRead::GetStopTime ( )

Definition at line 622 of file TEcnaRead.cc.

References fFileHeader, and TEcnaHeader::fStopTime.

Referenced by TEcnaRun::ReadEventDistributions(), TEcnaHistos::ViewHisto(), and TEcnaHistos::ViewStas().

622 {return fFileHeader->fStopTime;}
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
time_t fStopTime
Definition: TEcnaHeader.h:42
TString TEcnaRead::GetTypeOfQuantity ( const CnaResultTyp  arg_typ)

Definition at line 3113 of file TEcnaRead.cc.

References cTypAdcEvt, cTypAvHfn, cTypAvLfn, cTypAvMeanCorss, cTypAvPed, cTypAvSigCorss, cTypAvTno, cTypCorCss, cTypCovCss, cTypHFccMoStins, cTypHfCor, cTypHfCov, cTypHfn, cTypLFccMoStins, cTypLfCor, cTypLfCov, cTypLfn, cTypMeanCorss, cTypMSp, cTypNbOfEvts, cTypNumbers, cTypPed, cTypSigCorss, cTypSSp, cTypTno, and fFlagSubDet.

Referenced by ReadAveragedHighFrequencyNoise(), ReadAveragedLowFrequencyNoise(), ReadAveragedMeanOfCorrelationsBetweenSamples(), ReadAveragedPedestals(), ReadAveragedSigmaOfCorrelationsBetweenSamples(), ReadAveragedTotalNoise(), ReadCorrelationsBetweenSamples(), ReadCovariancesBetweenSamples(), ReadHighFrequencyCorrelationsBetweenChannels(), ReadHighFrequencyCovariancesBetweenChannels(), ReadHighFrequencyMeanCorrelationsBetweenStins(), ReadHighFrequencyNoise(), ReadLowFrequencyCorrelationsBetweenChannels(), ReadLowFrequencyCovariancesBetweenChannels(), ReadLowFrequencyMeanCorrelationsBetweenStins(), ReadLowFrequencyNoise(), ReadMeanOfCorrelationsBetweenSamples(), ReadNumberOfEventsForSamples(), ReadPedestals(), ReadRelevantCorrelationsBetweenSamples(), ReadSampleMeans(), ReadSampleSigmas(), ReadSampleValues(), ReadSampleValuesSameFile(), ReadSigmaOfCorrelationsBetweenSamples(), ReadStinNumbers(), and ReadTotalNoise().

3114 {
3115  TString quantity_name = "?";
3116 
3117  if( arg_typ == cTypNumbers)
3118  {
3119  if( fFlagSubDet == "EB" ){quantity_name = "SM numbers";}
3120  if( fFlagSubDet == "EE" ){quantity_name = "Dee numbers";}
3121  }
3122  if( arg_typ == cTypMSp ){quantity_name = "Mean of samples";}
3123  if( arg_typ == cTypSSp ){quantity_name = "Sigma of samples";}
3124 
3125  if( arg_typ == cTypNbOfEvts ){quantity_name = "Number of events";}
3126  if( arg_typ == cTypPed ){quantity_name = "Pedestals";}
3127  if( arg_typ == cTypTno ){quantity_name = "Total noise";}
3128  if( arg_typ == cTypLfn ){quantity_name = "LF noise";}
3129  if( arg_typ == cTypHfn ){quantity_name = "HF noise";}
3130  if( arg_typ == cTypMeanCorss){quantity_name = "Mean of cor(s,s')";}
3131  if( arg_typ == cTypSigCorss ){quantity_name = "Sigma of cor(s,s')";}
3132 
3133  if( arg_typ == cTypAvPed ){quantity_name = "Averaged pedestals";}
3134  if( arg_typ == cTypAvTno ){quantity_name = "Averaged total noise";}
3135  if( arg_typ == cTypAvLfn ){quantity_name = "Averaged LF noise";}
3136  if( arg_typ == cTypAvHfn ){quantity_name = "Averaged HF noise";}
3137  if( arg_typ == cTypAvMeanCorss){quantity_name = "Averaged mean of cor(s,s')";}
3138  if( arg_typ == cTypAvSigCorss ){quantity_name = "Averaged sigma of cor(s,s')";}
3139 
3140  if( arg_typ == cTypAdcEvt ){quantity_name = "Sample ADC a.f.o event number";}
3141 
3142  if( arg_typ == cTypCovCss ){quantity_name = "Cov(s,s')";}
3143  if( arg_typ == cTypCorCss ){quantity_name = "Cor(s,s')";}
3144  if( arg_typ == cTypLfCov ){quantity_name = "LF Cov(c,c')";}
3145  if( arg_typ == cTypLfCor ){quantity_name = "LF Cor(c,c')";}
3146  if( arg_typ == cTypHfCov ){quantity_name = "HF Cov(c,c')";}
3147  if( arg_typ == cTypHfCor ){quantity_name = "HF Cor(c,c')";}
3148 
3149  if( fFlagSubDet == "EB" )
3150  {
3151  if( arg_typ == cTypLFccMoStins){quantity_name = "Mean LF |Cor(c,c')| in (tow,tow')";}
3152  if( arg_typ == cTypHFccMoStins){quantity_name = "Mean HF |Cor(c,c')| in (tow,tow')";}
3153  }
3154  if( fFlagSubDet == "EE" )
3155  {
3156  if( arg_typ == cTypLFccMoStins){quantity_name = "Mean LF |Cor(c,c')| in (SC,SC')";}
3157  if( arg_typ == cTypHFccMoStins){quantity_name = "Mean HF |Cor(c,c')| in (SC,SC')";}
3158  }
3159  return quantity_name;
3160 }
TString fFlagSubDet
Definition: TEcnaRead.h:61
void TEcnaRead::Init ( void  )

Definition at line 309 of file TEcnaRead.cc.

References fCdelete, fCnaParCout, fCnew, fCodePrintAllComments, fCodePrintComments, fCodePrintNoComment, fCodePrintWarnings, fDataExist, fFlagPrint, fgMaxCar, fLookAtRootFile, fMemoStinNumbers, fOpenRootFile, fPathRoot, fReadyToReadRootFile, fSectChanSizeX, fSectChanSizeY, fSectSampSizeX, fSectSampSizeY, fT1d_StexStinFromIndex, fT3d1_distribs, fT3d2_distribs, fT3d_distribs, fTagStinNumbers, fTTBELL, fUserChan, fUserSamp, and TEcnaParCout::GetCodePrint().

Referenced by TEcnaRead().

310 {
311 //Initialisation concerning the ROOT file
312 
313  fCnew = 0;
314  fCdelete = 0;
315 
316  fTTBELL = '\007';
317 
318  fgMaxCar = (Int_t)512;
319 
324 
325  //.................................. Set flag print to "Warnings" (Init)
327 
328  fUserSamp = -1;
329  fUserChan = -1;
330 
331  fSectChanSizeX = 0;
332  fSectChanSizeY = 0;
333  fSectSampSizeX = 0;
334  fSectSampSizeY = 0;
335 
336  //.................................. Flags for Root File (Init)
337  fOpenRootFile = kFALSE;
338 
340  fLookAtRootFile = 0;
341 
343 
344  //................................ tags Stin numbers
345  fTagStinNumbers = 0;
346  fMemoStinNumbers = 0;
347 
348  //.......................... flag data exist
349  fDataExist = kFALSE;
350 
351  //......................... transfert Sample ADC Values 3D array (Init)
352  fT3d_distribs = 0;
353  fT3d2_distribs = 0;
354  fT3d1_distribs = 0;
355 
356  //................................. others
357  Int_t MaxCar = fgMaxCar;
358 
359  MaxCar = fgMaxCar;
360  fPathRoot.Resize(MaxCar);
361  fPathRoot = "fPathRoot> not defined";
362 
363 }// end of Init()
Double_t *** fT3d_distribs
Definition: TEcnaRead.h:91
Int_t fCnew
Definition: TEcnaRead.h:48
Int_t fMemoStinNumbers
Definition: TEcnaRead.h:71
Int_t fUserChan
Definition: TEcnaRead.h:81
TString fPathRoot
Definition: TEcnaRead.h:73
Double_t ** fT3d2_distribs
Definition: TEcnaRead.h:92
Double_t * fT3d1_distribs
Definition: TEcnaRead.h:93
Int_t fgMaxCar
Definition: TEcnaRead.h:46
Int_t fReadyToReadRootFile
Definition: TEcnaRead.h:66
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
Int_t fUserSamp
Definition: TEcnaRead.h:80
Int_t fCodePrintWarnings
Definition: TEcnaRead.h:84
Int_t fCodePrintNoComment
Definition: TEcnaRead.h:84
Int_t fSectChanSizeX
Definition: TEcnaRead.h:75
Int_t GetCodePrint(const TString)
Definition: TEcnaParCout.cc:77
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRead.h:69
Int_t fSectSampSizeY
Definition: TEcnaRead.h:75
TString fTTBELL
Definition: TEcnaRead.h:51
TEcnaParCout * fCnaParCout
Definition: TEcnaRead.h:53
Int_t fCdelete
Definition: TEcnaRead.h:49
Int_t fFlagPrint
Definition: TEcnaRead.h:83
Bool_t fDataExist
Definition: TEcnaRead.h:88
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Int_t * fTagStinNumbers
Definition: TEcnaRead.h:70
Int_t fCodePrintComments
Definition: TEcnaRead.h:84
Int_t fSectSampSizeX
Definition: TEcnaRead.h:75
Int_t fLookAtRootFile
Definition: TEcnaRead.h:67
Int_t fSectChanSizeY
Definition: TEcnaRead.h:75
Bool_t TEcnaRead::LookAtRootFile ( )

Definition at line 675 of file TEcnaRead.cc.

References Anew(), gather_cfg::cout, fEcal, fFileHeader, fLookAtRootFile, fReadyToReadRootFile, TEcnaHeader::fStinNumbersCalc, fT1d_StexStinFromIndex, fTagStinNumbers, fTTBELL, i, TEcnaParEcal::MaxStinEcnaInStex(), ReadRootFileHeader(), and ReadStinNumbers().

Referenced by TEcnaRun::ReadEventDistributions(), TEcnaHistos::StexHocoVecoLHFCorcc(), TEcnaHistos::ViewHistime(), TEcnaHistos::ViewHisto(), TEcnaHistos::ViewMatrix(), TEcnaHistos::ViewStas(), TEcnaHistos::ViewStex(), and TEcnaHistos::ViewStin().

676 {
677 //---------- Reads the ROOT file header and makes allocations and some other things
678 
679  fLookAtRootFile = 0; // set flag to zero before looking for the file
680 
681  Bool_t ok_read = kFALSE;
682 
683  if(fReadyToReadRootFile == 1)
684  {
685  //------------ Call to ReadRootFileHeader
686  if( ReadRootFileHeader(0) == kTRUE ) // (1) = print, (0) = no print
687  {
688  //........................................ allocation tags
689  if( fTagStinNumbers == 0 ){fTagStinNumbers = new Int_t[1]; Anew("fTagStinNumbers");}
690 
691  //...................... allocation for fT1d_StexStinFromIndex[]
692  if(fT1d_StexStinFromIndex == 0)
693  {fT1d_StexStinFromIndex = new Int_t[fEcal->MaxStinEcnaInStex()]; Anew("fT1d_StexStinFromIndex");}
694 
695  //.. recover of the Stin numbers from the ROOT file (= init fT1d_StexStinFromIndex+init TagStin)
696  TVectorD vec(fEcal->MaxStinEcnaInStex());
697  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
699 
700  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++ ){
701  fT1d_StexStinFromIndex[i] = (Int_t)vec(i);}
702 
704  ok_read = kTRUE;
705 
706  fLookAtRootFile = 1; // set flag
707  }
708  else
709  {
710  cout << "!TEcnaRead::LookAtRootFile()> *** ERROR ***>"
711  << " ROOT file not found " << fTTBELL << endl;
712  ok_read = kFALSE;
713  }
714  }
715  else
716  {
717  cout << "!TEcnaRead::LookAtRootFile()> *** ERROR ***>"
718  << " GetReadyToReadRootFile not called " << fTTBELL << endl;
719  ok_read = kFALSE;
720  }
721  return ok_read;
722 } //----------------- end of LookAtRootFile()
void Anew(const TString)
Definition: TEcnaRead.cc:394
int i
Definition: DBlmapReader.cc:9
Int_t fReadyToReadRootFile
Definition: TEcnaRead.h:66
Bool_t ReadRootFileHeader(const Int_t &)
Definition: TEcnaRead.cc:729
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRead.h:69
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TString fTTBELL
Definition: TEcnaRead.h:51
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
tuple cout
Definition: gather_cfg.py:41
Int_t MaxStinEcnaInStex()
Int_t * fTagStinNumbers
Definition: TEcnaRead.h:70
Int_t fStinNumbersCalc
Definition: TEcnaHeader.h:49
Int_t fLookAtRootFile
Definition: TEcnaRead.h:67
Bool_t TEcnaRead::OpenRootFile ( const Text_t *  name,
TString  status 
)

Definition at line 808 of file TEcnaRead.cc.

References Adelete(), Anew(), gather_cfg::cout, fCodePrintAllComments, fFlagPrint, fOpenRootFile, fPathRoot, TCnaRootFile::fRootFileStatus, gCnaRootFile, TCnaRootFile::OpenR(), TCnaRootFile::OpenW(), and ntuplemaker::status.

Referenced by ReadAveragedHighFrequencyNoise(), ReadAveragedLowFrequencyNoise(), ReadAveragedMeanOfCorrelationsBetweenSamples(), ReadAveragedPedestals(), ReadAveragedSigmaOfCorrelationsBetweenSamples(), ReadAveragedTotalNoise(), ReadCorrelationsBetweenSamples(), ReadCovariancesBetweenSamples(), ReadHighFrequencyCorrelationsBetweenChannels(), ReadHighFrequencyCovariancesBetweenChannels(), ReadHighFrequencyMeanCorrelationsBetweenStins(), ReadHighFrequencyNoise(), ReadLowFrequencyCorrelationsBetweenChannels(), ReadLowFrequencyCovariancesBetweenChannels(), ReadLowFrequencyMeanCorrelationsBetweenStins(), ReadLowFrequencyNoise(), ReadMeanOfCorrelationsBetweenSamples(), ReadNumberOfEventsForSamples(), ReadPedestals(), ReadRelevantCorrelationsBetweenSamples(), ReadRootFileHeader(), ReadSampleMeans(), ReadSampleSigmas(), ReadSampleValues(), ReadSampleValuesSameFile(), ReadSigmaOfCorrelationsBetweenSamples(), ReadStinNumbers(), and ReadTotalNoise().

808  {
809 //Open the Root file
810 
811  TString s_path;
812  s_path = fPathRoot;
813  s_path.Append('/');
814  s_path.Append(name);
815 
816  gCnaRootFile = 0; gCnaRootFile = new TEcnaRootFile(s_path.Data(), status); Anew("gCnaRootFile");
817 
818  Bool_t ok_open = kFALSE;
819 
820  if ( gCnaRootFile->fRootFileStatus == "RECREATE" ){ok_open = gCnaRootFile->OpenW();}
821  if ( gCnaRootFile->fRootFileStatus == "READ" ){ok_open = gCnaRootFile->OpenR();}
822 
823  if (!ok_open)
824  {
825  cout << "!TEcnaRead::OpenRootFile> " << s_path.Data() << ": file not found." << endl;
826  if( gCnaRootFile != 0 ){delete gCnaRootFile; gCnaRootFile = 0; Adelete("gCnaRootFile");}
827  }
828  else
829  {
831  TString e_path; e_path.Append(name);
832  cout << "*TEcnaRead::OpenRootFile> Open ROOT file " << e_path.Data() << " OK " << endl;}
833  fOpenRootFile = kTRUE;
834  }
835 
836  return ok_open;
837 } // end of OpenRootFile()
void Anew(const TString)
Definition: TEcnaRead.cc:394
TString fRootFileStatus
Definition: TCnaRootFile.h:19
TString fPathRoot
Definition: TEcnaRead.h:73
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
Bool_t OpenW(const Text_t *="")
Int_t fFlagPrint
Definition: TEcnaRead.h:83
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t OpenR(const Text_t *="")
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
tuple status
Definition: ntuplemaker.py:245
void Adelete(const TString)
Definition: TEcnaRead.cc:403
TEcnaRead & TEcnaRead::operator= ( const TEcnaRead dcop)

Definition at line 469 of file TEcnaRead.cc.

References fCopy().

470 {
471 //Overloading of the operator=
472 
473  fCopy(dcop);
474  return *this;
475 }
void fCopy(const TEcnaRead &)
Definition: TEcnaRead.cc:414
void TEcnaRead::PrintAllComments ( )

Definition at line 3291 of file TEcnaRead.cc.

References gather_cfg::cout, fCodePrintAllComments, and fFlagPrint.

3292 {
3293 // Set flags to authorize printing of the comments of all the methods
3294 
3296  cout << "*TEcnaRead::PrintAllComments()> All the comments will be printed" << endl;
3297 }
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
Int_t fFlagPrint
Definition: TEcnaRead.h:83
tuple cout
Definition: gather_cfg.py:41
void TEcnaRead::PrintComments ( )

Definition at line 3275 of file TEcnaRead.cc.

References gather_cfg::cout, fCodePrintComments, and fFlagPrint.

3276 {
3277 // Set flags to authorize printing of some comments concerning initialisations (default)
3278 
3280  cout << "*TEcnaRead::PrintComments()> Warnings and some comments on init will be printed" << endl;
3281 }
Int_t fFlagPrint
Definition: TEcnaRead.h:83
tuple cout
Definition: gather_cfg.py:41
Int_t fCodePrintComments
Definition: TEcnaRead.h:84
void TEcnaRead::PrintNoComment ( )
void TEcnaRead::PrintWarnings ( )

Definition at line 3283 of file TEcnaRead.cc.

References gather_cfg::cout, fCodePrintWarnings, and fFlagPrint.

3284 {
3285 // Set flags to authorize printing of warnings
3286 
3288  cout << "*TEcnaRead::PrintWarnings()> Warnings will be printed" << endl;
3289 }
Int_t fCodePrintWarnings
Definition: TEcnaRead.h:84
Int_t fFlagPrint
Definition: TEcnaRead.h:83
tuple cout
Definition: gather_cfg.py:41
TVectorD TEcnaRead::ReadAveragedHighFrequencyNoise ( const Int_t &  VecDim)

Definition at line 2933 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypAvHfn, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewHisto(), and TEcnaHistos::ViewStas().

2934 {
2935 //Read the expectation values of the Pedestals
2936 //for all the Stins of a given Stex
2937 //in the ROOT file and return them in a TVectorD
2938 //
2939 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2940 
2941  TVectorD vec(VecDim);
2942  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2943 
2944  CnaResultTyp typ = cTypAvHfn; // averaged High FrequencyNoise type
2945  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2946 
2947  Bool_t ok_open = kFALSE;
2948  Bool_t ok_read = kFALSE;
2949 
2950  if ( fOpenRootFile )
2951  {
2952  cout << "!TEcnaRead::ReadAveragedHighFrequencyNoise(...) *** ERROR ***> "
2953  << "Reading on file already open." << fTTBELL << endl;
2954  }
2955  else
2956  {
2957  ok_open = OpenRootFile(file_name, "READ");
2958 
2959  Int_t i_zero = 0;
2960  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2961 
2962  if ( ok_read == kTRUE )
2963  {
2964  fDataExist = kTRUE;
2965  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
2966  {
2967  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
2968  }
2969  }
2970  else
2971  {
2972  fDataExist = kFALSE;
2973  cout << "!TEcnaRead::ReadAveragedHighFrequencyNoise(...) *** ERROR ***> "
2974  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2975  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2976  << fTTBELL << endl;
2977  }
2978  }
2979  CloseRootFile(file_name);
2980  return vec;
2981 } // end of ReadAveragedHighFrequencyNoise
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadAveragedLowFrequencyNoise ( const Int_t &  VecDim)

Definition at line 2878 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypAvLfn, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewHisto(), and TEcnaHistos::ViewStas().

2879 {
2880 //Read the expectation values of the Pedestals
2881 //for all the Stins of a given Stex
2882 //in the ROOT file and return them in a TVectorD
2883 //
2884 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2885 
2886  TVectorD vec(VecDim);
2887  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2888 
2889  CnaResultTyp typ = cTypAvLfn; // averaged Low FrequencyNoise type
2890  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2891 
2892  Bool_t ok_open = kFALSE;
2893  Bool_t ok_read = kFALSE;
2894 
2895  if ( fOpenRootFile )
2896  {
2897  cout << "!TEcnaRead::ReadAveragedLowFrequencyNoise(...) *** ERROR ***> "
2898  << "Reading on file already open." << fTTBELL << endl;
2899  }
2900  else
2901  {
2902  ok_open = OpenRootFile(file_name, "READ");
2903 
2904  Int_t i_zero = 0;
2905  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2906 
2907  if ( ok_read == kTRUE )
2908  {
2909  fDataExist = kTRUE;
2910  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
2911  {
2912  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
2913  }
2914  }
2915  else
2916  {
2917  fDataExist = kFALSE;
2918  cout << "!TEcnaRead::ReadAveragedLowFrequencyNoise(...) *** ERROR ***> "
2919  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2920  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2921  << fTTBELL << endl;
2922  }
2923  }
2924  CloseRootFile(file_name);
2925  return vec;
2926 } // end of ReadAveragedLowFrequencyNoise
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadAveragedMeanOfCorrelationsBetweenSamples ( const Int_t &  VecDim)

Definition at line 2988 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypAvMeanCorss, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewHisto(), and TEcnaHistos::ViewStas().

2989 {
2990 //Read the expectation values of the Pedestals
2991 //for all the Stins of a given Stex
2992 //in the ROOT file and return them in a TVectorD
2993 //
2994 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2995 
2996  TVectorD vec(VecDim);
2997  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2998 
2999  CnaResultTyp typ = cTypAvMeanCorss; // averaged MeanOfCorrelationsBetweenSamples type
3000  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
3001 
3002  Bool_t ok_open = kFALSE;
3003  Bool_t ok_read = kFALSE;
3004 
3005  if ( fOpenRootFile )
3006  {
3007  cout << "!TEcnaRead::ReadAveragedMeanOfCorrelationsBetweenSamples(...) *** ERROR ***> "
3008  << "Reading on file already open." << fTTBELL << endl;
3009  }
3010  else
3011  {
3012  ok_open = OpenRootFile(file_name, "READ");
3013 
3014  Int_t i_zero = 0;
3015  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
3016 
3017  if ( ok_read == kTRUE )
3018  {
3019  fDataExist = kTRUE;
3020  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
3021  {
3022  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
3023  }
3024  }
3025  else
3026  {
3027  fDataExist = kFALSE;
3028  cout << "!TEcnaRead::ReadAveragedMeanOfCorrelationsBetweenSamples(...) *** ERROR ***> "
3029  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
3030  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
3031  << fTTBELL << endl;
3032  }
3033  }
3034  CloseRootFile(file_name);
3035  return vec;
3036 } // end of ReadAveragedMeanOfCorrelationsBetweenSamples
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadAveragedNumberOfEvents ( const Int_t &  VecDim)

Definition at line 2708 of file TEcnaRead.cc.

References fEcal, fEcalNumbering, fFileHeader, TEcnaHeader::fStex, fStexName, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), i, TEcnaParEcal::MaxCrysEcnaInStex(), TEcnaParEcal::MaxCrysInStin(), TEcnaNumbering::MaxCrysInStinEcna(), and ReadNumberOfEvents().

Referenced by TEcnaHistos::ViewHisto(), and TEcnaHistos::ViewStas().

2709 {
2710 //Read the numbers of found events in the data
2711 //for the crystals and for the samples for all the Stin's in the Stex
2712 //in the ROOT file, compute the average on the samples and on the crystals
2713 //and return them in a TVectorD(MaxStinEcnaInStex)
2714 //
2715 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2716 
2717  TVectorD vecAveraged(VecDim);
2718  for(Int_t i=0; i<VecDim; i++){vecAveraged(i)=(Double_t)0.;}
2719 
2720  TVectorD vecMean(fEcal->MaxCrysEcnaInStex());
2721  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){vecMean(i)=(Double_t)0.;}
2722 
2724 
2725  for(Int_t i0StexStin=0; i0StexStin<VecDim; i0StexStin++)
2726  {
2727  Int_t n1StexStin = i0StexStin+1;
2728  vecAveraged(i0StexStin) = 0;
2729  //.... average value over the crystals
2730  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
2731  {
2732  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(i0StexStin+1, i0StinEcha);
2733 
2734  if( fStexName == "SM" )
2735  {vecAveraged(i0StexStin) += vecMean(i0StexEcha);}
2736 
2737  if( fStexName == "Dee" )
2738  {
2739  //--------- EE --> Special translation for mixed SCEcna (29 and 32)
2740  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2741  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2742  Int_t n1StinEcha = i0StinEcha+1;
2743  if( n1StexStin == 10 && n1StinEcha == 11 )
2744  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2745  if( n1StexStin == 11 && n1StinEcha == 11 )
2746  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2747  if( !( (n1StexStin == 29 || n1StexStin == 32) && n1StinEcha == 11 ) )
2748  {vecAveraged(i0StexStin) += vecMean(i0StexEcha);}
2749  }
2750  }
2751 
2752  Double_t xdivis = (Double_t)0.;
2753  if( fStexName == "SM" )
2754  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2755  if( fStexName == "Dee" )
2756  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, i0StexStin+1, "TEcnaRead");}
2757 
2758  vecAveraged(i0StexStin) = vecAveraged(i0StexStin)/xdivis;
2759  }
2760  return vecAveraged;
2761 }
int i
Definition: DBlmapReader.cc:9
Int_t fStex
Definition: TEcnaHeader.h:39
TString fStexName
Definition: TEcnaRead.h:62
Int_t MaxCrysInStin()
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString)
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Int_t MaxCrysEcnaInStex()
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRead.h:59
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
TVectorD ReadNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:2338
TVectorD TEcnaRead::ReadAveragedPedestals ( const Int_t &  VecDim)

Definition at line 2768 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypAvPed, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewHisto(), and TEcnaHistos::ViewStas().

2769 {
2770 //Read the expectation values of the Pedestals
2771 //for all the Stins of a given Stex
2772 //in the ROOT file and return them in a TVectorD
2773 //
2774 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2775 
2776  TVectorD vec(VecDim);
2777  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2778 
2779  CnaResultTyp typ = cTypAvPed; // averaged pedestals type
2780  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2781 
2782  Bool_t ok_open = kFALSE;
2783  Bool_t ok_read = kFALSE;
2784 
2785  if ( fOpenRootFile )
2786  {
2787  cout << "!TEcnaRead::ReadAveragedPedestals(...) *** ERROR ***> "
2788  << "Reading on file already open." << fTTBELL << endl;
2789  }
2790  else
2791  {
2792  ok_open = OpenRootFile(file_name, "READ");
2793 
2794  Int_t i_zero = 0;
2795  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2796 
2797  if ( ok_read == kTRUE )
2798  {
2799  fDataExist = kTRUE;
2800  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
2801  {
2802  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
2803  }
2804  }
2805  else
2806  {
2807  fDataExist = kFALSE;
2808  cout << "!TEcnaRead::ReadAveragedPedestals(...) *** ERROR ***> "
2809  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2810  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2811  << fTTBELL << endl;
2812  }
2813  }
2814  CloseRootFile(file_name);
2815  return vec;
2816 } // end of ReadAveragedPedestals
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadAveragedSigmaOfCorrelationsBetweenSamples ( const Int_t &  VecDim)

Definition at line 3043 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypAvSigCorss, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewHisto(), and TEcnaHistos::ViewStas().

3044 {
3045 //Read the expectation values of the Pedestals
3046 //for all the Stins of a given Stex
3047 //in the ROOT file and return them in a TVectorD
3048 //
3049 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
3050 
3051  TVectorD vec(VecDim);
3052  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
3053 
3054  CnaResultTyp typ = cTypAvSigCorss; // averaged SigmaOfCorrelationsBetweenSamples type
3055  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
3056 
3057  Bool_t ok_open = kFALSE;
3058  Bool_t ok_read = kFALSE;
3059 
3060  if ( fOpenRootFile )
3061  {
3062  cout << "!TEcnaRead::ReadAveragedSigmaOfCorrelationsBetweenSamples(...) *** ERROR ***> "
3063  << "Reading on file already open." << fTTBELL << endl;
3064  }
3065  else
3066  {
3067  ok_open = OpenRootFile(file_name, "READ");
3068 
3069  Int_t i_zero = 0;
3070  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
3071 
3072  if ( ok_read == kTRUE )
3073  {
3074  fDataExist = kTRUE;
3075  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
3076  {
3077  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
3078  }
3079  }
3080  else
3081  {
3082  fDataExist = kFALSE;
3083  cout << "!TEcnaRead::ReadAveragedSigmaOfCorrelationsBetweenSamples(...) *** ERROR ***> "
3084  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
3085  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
3086  << fTTBELL << endl;
3087  }
3088  }
3089  CloseRootFile(file_name);
3090  return vec;
3091 } // end of ReadAveragedSigmaOfCorrelationsBetweenSamples
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadAveragedTotalNoise ( const Int_t &  VecDim)

Definition at line 2823 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypAvTno, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewHisto(), and TEcnaHistos::ViewStas().

2824 {
2825 //Read the expectation values of the Total Noise
2826 //for all the Stins of a given Stex
2827 //in the ROOT file and return them in a TVectorD
2828 //
2829 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2830 
2831  TVectorD vec(VecDim);
2832  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2833 
2834  CnaResultTyp typ = cTypAvTno; // averaged Total Noise type
2835  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2836 
2837  Bool_t ok_open = kFALSE;
2838  Bool_t ok_read = kFALSE;
2839 
2840  if ( fOpenRootFile )
2841  {
2842  cout << "!TEcnaRead::ReadAveragedTotalNoise(...) *** ERROR ***> "
2843  << "Reading on file already open." << fTTBELL << endl;
2844  }
2845  else
2846  {
2847  ok_open = OpenRootFile(file_name, "READ");
2848 
2849  Int_t i_zero = 0;
2850  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2851 
2852  if ( ok_read == kTRUE )
2853  {
2854  fDataExist = kTRUE;
2855  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
2856  {
2857  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
2858  }
2859  }
2860  else
2861  {
2862  fDataExist = kFALSE;
2863  cout << "!TEcnaRead::ReadAveragedTotalNoise(...) *** ERROR ***> "
2864  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2865  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2866  << fTTBELL << endl;
2867  }
2868  }
2869  CloseRootFile(file_name);
2870  return vec;
2871 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadCorrelationsBetweenSamples ( const Int_t &  n1StexStin,
const Int_t &  i0StinEcha,
const Int_t &  MatDim 
)

Definition at line 1466 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypCorCss, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcalNumbering, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), GetTypeOfQuantity(), i, j, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewMatrix(), and TEcnaHistos::ViewStin().

1468 {
1469 //Read the (sample,sample) correlations for a given channel
1470 //in ROOT file and return them in a TMatrixD
1471 //
1472 //Possible values for MatDim: (1) MatDim = fFileHeader->fNbOfSamples
1473 
1474  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1475  TMatrixD mat(MatDim, MatDim);
1476  for(Int_t i=0; i<MatDim; i++)
1477  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1478 
1479  CnaResultTyp typ = cTypCorCss;
1480  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1481 
1482  Bool_t ok_open = kFALSE;
1483  Bool_t ok_read = kFALSE;
1484 
1485  if ( fOpenRootFile )
1486  {
1487  cout << "!TEcnaRead::ReadCorrelationsBetweenSamples(...) *** ERROR ***> "
1488  << "Reading on file already open." << fTTBELL << endl;
1489  }
1490  else
1491  {
1492  ok_open = OpenRootFile(file_name, "READ");
1493  ok_read = gCnaRootFile->ReadElement(typ, i0StexEcha);
1494 
1495  if ( ok_read == kTRUE )
1496  {
1497  fDataExist = kTRUE;
1498  for ( Int_t i_samp = 0; i_samp < MatDim; i_samp++){
1499  for ( Int_t j_samp = 0; j_samp < MatDim; j_samp++){
1500  mat(i_samp, j_samp) = gCnaRootFile->fCnaIndivResult->fMatMat(i_samp,j_samp);}}
1501  }
1502  else
1503  {
1504  fDataExist = kFALSE;
1505  cout << "!TEcnaRead::ReadCorrelationsBetweenSamples() *** ERROR ***> "
1506  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1507  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1508  << fTTBELL << endl;
1509  }
1510  }
1511  CloseRootFile(file_name);
1512  return mat;
1513 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRead.h:59
Bool_t fDataExist
Definition: TEcnaRead.h:88
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadCovariancesBetweenSamples ( const Int_t &  n1StexStin,
const Int_t &  i0StinEcha,
const Int_t &  MatDim 
)

Definition at line 1403 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypCovCss, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcalNumbering, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), GetTypeOfQuantity(), i, j, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewMatrix(), and TEcnaHistos::ViewStin().

1405 {
1406 //Read the (sample,sample) covariances for a given channel
1407 //in ROOT file and return them in a TMatrixD
1408 //
1409 //Possible values for MatDim: (1) MatDim = fFileHeader->fNbOfSamples
1410 
1411  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1412 
1413  TMatrixD mat(MatDim, MatDim);
1414  for(Int_t i=0; i<MatDim; i++)
1415  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1416 
1417  CnaResultTyp typ = cTypCovCss;
1418 
1419  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1420 
1421  Bool_t ok_open = kFALSE;
1422  Bool_t ok_read = kFALSE;
1423 
1424  if ( fOpenRootFile )
1425  {
1426  cout << "!TEcnaRead::ReadCovariancesBetweenSamples(...) *** ERROR ***> "
1427  << "Reading on file already open." << fTTBELL << endl;
1428  }
1429  else
1430  {
1431  ok_open = OpenRootFile(file_name, "READ");
1432 
1433  ok_read = gCnaRootFile->ReadElement(typ, i0StexEcha);
1434 
1435  if ( ok_read == kTRUE )
1436  {
1437  fDataExist = kTRUE;
1438  for( Int_t i_samp = 0; i_samp < MatDim; i_samp++ )
1439  {
1440  for ( Int_t j_samp = 0; j_samp < MatDim; j_samp++)
1441  {
1442  mat(i_samp, j_samp) = gCnaRootFile->fCnaIndivResult->fMatMat(i_samp,j_samp);
1443  }
1444  }
1445  }
1446  else
1447  {
1448  fDataExist = kFALSE;
1449  cout << "!TEcnaRead::ReadCovariancesBetweenSamples() *** ERROR ***> "
1450  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1451  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1452  << fTTBELL << endl;
1453  }
1454  }
1455 
1456  CloseRootFile(file_name);
1457 
1458  return mat;
1459 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRead.h:59
Bool_t fDataExist
Definition: TEcnaRead.h:88
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels ( const Int_t &  n1StexStin_a,
const Int_t &  n1StexStin_b,
const Int_t &  MatDim 
)

Definition at line 1784 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypHfCor, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetStinIndex(), GetTypeOfQuantity(), i, j, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::StexHocoVecoLHFCorcc(), and TEcnaHistos::ViewMatrix().

1787 {
1788 //Read the High Frequency Cor(i0StinEcha of Stin_a, i0StinEcha of Stin b)
1789 //in ROOT file and return them in a TMatrixD
1790 //
1791 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysInStin()
1792 
1793  Int_t index_Stin_a = GetStinIndex(n1StexStin_a);
1794  Int_t index_Stin_b = GetStinIndex(n1StexStin_b);
1795 
1796  TMatrixD mat(MatDim, MatDim);
1797  for(Int_t i=0; i<MatDim; i++)
1798  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1799 
1800  CnaResultTyp typ = cTypHfCor;
1801 
1802  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1803 
1804  Bool_t ok_open = kFALSE;
1805  Bool_t ok_read = kFALSE;
1806 
1807  if ( fOpenRootFile )
1808  {
1809  cout << "!TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels(...) *** ERROR ***>"
1810  << " Reading on file already open." << fTTBELL << endl;
1811  }
1812  else
1813  {
1814  ok_open = OpenRootFile(file_name, "READ");
1815 
1816  Int_t i_zero = 0;
1817 
1818  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1819 
1820  if ( ok_read == kTRUE )
1821  {
1822  fDataExist = kTRUE;
1823  for ( Int_t i_crys = 0; i_crys < MatDim; i_crys++)
1824  {
1825  Int_t i_cna_chan = index_Stin_a*MatDim + i_crys;
1826  for ( Int_t j_crys = 0; j_crys < MatDim; j_crys++)
1827  {
1828  Int_t j_cna_chan = index_Stin_b*MatDim + j_crys;
1829  mat(i_crys, j_crys) = gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1830  }
1831  }
1832  }
1833  else
1834  {
1835  fDataExist = kFALSE;
1836  cout << "!TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels(...) *** ERROR ***> "
1837  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1838  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1839  << fTTBELL << endl;
1840  }
1841  }
1842 
1843  CloseRootFile(file_name);
1844 
1845  return mat;
1846 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
Int_t GetStinIndex(const Int_t &)
Definition: TEcnaRead.cc:3222
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels ( const Int_t &  MatDim)

Definition at line 2103 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypHfCor, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcal, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, j, TEcnaParEcal::MaxCrysInStin(), TEcnaParEcal::MaxStinEcnaInStex(), OpenRootFile(), TCnaRootFile::ReadElement(), and ReadStinNumbers().

2104 {
2105 //Read all the High Frequency correlations
2106 //in ROOT file and return them in a TMatrixD
2107 //
2108 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2109 
2110  //=====> WARNING: BIG MATRIX (1700x1700)
2111  TMatrixD mat(MatDim, MatDim);
2112  for(Int_t i=0; i<MatDim; i++){for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
2113 
2114  TVectorD vec(fEcal->MaxStinEcnaInStex());
2115  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
2117 
2118  CnaResultTyp typ = cTypHfCor;
2119 
2120  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2121 
2122  Bool_t ok_open = kFALSE;
2123  Bool_t ok_read = kFALSE;
2124 
2125  if ( fOpenRootFile )
2126  {
2127  cout << "!TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels() *** ERROR ***>"
2128  << " Reading on file already open." << fTTBELL << endl;
2129  }
2130  else
2131  {
2132  ok_open = OpenRootFile(file_name, "READ");
2133 
2134  Int_t i_zero = 0;
2135  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2136 
2137  if ( ok_read == kTRUE )
2138  {
2139  fDataExist = kTRUE;
2140  for (Int_t index_Stin_a = 0; index_Stin_a < fEcal->MaxStinEcnaInStex(); index_Stin_a++)
2141  {
2142  if ( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= fEcal->MaxStinEcnaInStex())
2143  {
2144  for (Int_t index_Stin_b = 0; index_Stin_b < fEcal->MaxStinEcnaInStex(); index_Stin_b++)
2145  {
2146  if ( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= fEcal->MaxStinEcnaInStex())
2147  {
2148  for ( Int_t i_crys = 0; i_crys < fEcal->MaxCrysInStin(); i_crys++)
2149  {
2150  Int_t i_cna_chan = index_Stin_a*fEcal->MaxCrysInStin() + i_crys;
2151  Int_t i_chan_sm = (Int_t)(vec(index_Stin_a)-1)*fEcal->MaxCrysInStin() + i_crys;
2152  for ( Int_t j_crys = 0; j_crys < fEcal->MaxCrysInStin(); j_crys++)
2153  {
2154  Int_t j_cna_chan = index_Stin_b*fEcal->MaxCrysInStin() + j_crys;
2155  Int_t j_chan_sm = (Int_t)(vec(index_Stin_b)-1)*fEcal->MaxCrysInStin() + j_crys;
2156  mat(i_chan_sm, j_chan_sm) =
2157  gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
2158  }
2159  }
2160  }
2161  }
2162  }
2163  }
2164  }
2165  else
2166  {
2167  fDataExist = kFALSE;
2168  cout << "!TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels() *** ERROR ***> "
2169  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2170  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2171  << fTTBELL << endl;
2172  }
2173  }
2174 
2175  CloseRootFile(file_name);
2176 
2177  return mat;
2178 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
Int_t MaxCrysInStin()
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Int_t MaxStinEcnaInStex()
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels ( const Int_t &  n1StexStin_a,
const Int_t &  n1StexStin_b,
const Int_t &  MatDim 
)

Definition at line 1715 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypHfCov, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetStinIndex(), GetTypeOfQuantity(), i, j, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewMatrix().

1718 {
1719 //Read the High Frequency cov(i0StinEcha of Stin_a, i0StinEcha of Stin b)
1720 //in ROOT file and return them in a TMatrixD
1721 //
1722 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysInStin()
1723 
1724  Int_t index_Stin_a = GetStinIndex(n1StexStin_a);
1725  Int_t index_Stin_b = GetStinIndex(n1StexStin_b);
1726 
1727  TMatrixD mat(MatDim, MatDim);
1728  for(Int_t i=0; i<MatDim; i++)
1729  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1730 
1731  CnaResultTyp typ = cTypHfCov;
1732 
1733  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1734 
1735  Bool_t ok_open = kFALSE;
1736  Bool_t ok_read = kFALSE;
1737 
1738  if ( fOpenRootFile )
1739  {
1740  cout << "!TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels(...) *** ERROR ***>"
1741  << " Reading on file already open." << fTTBELL << endl;
1742  }
1743  else
1744  {
1745  ok_open = OpenRootFile(file_name, "READ");
1746 
1747  Int_t i_zero = 0;
1748  ok_read = gCnaRootFile->ReadElement(typ,i_zero);
1749 
1750  if ( ok_read == kTRUE )
1751  {
1752  fDataExist = kTRUE;
1753  for ( Int_t i_crys = 0; i_crys < MatDim; i_crys++)
1754  {
1755  Int_t i_cna_chan = index_Stin_a*MatDim + i_crys;
1756  for ( Int_t j_crys = 0; j_crys < MatDim; j_crys++)
1757  {
1758  Int_t j_cna_chan = index_Stin_b*MatDim + j_crys;
1759  mat(i_crys, j_crys) = gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1760  }
1761  }
1762  }
1763  else
1764  {
1765  fDataExist = kFALSE;
1766  cout << "!TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels(...) *** ERROR ***> "
1767  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1768  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1769  << fTTBELL << endl;
1770  }
1771  }
1772 
1773  CloseRootFile(file_name);
1774 
1775  return mat;
1776 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
Int_t GetStinIndex(const Int_t &)
Definition: TEcnaRead.cc:3222
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels ( const Int_t &  MatDim)

Definition at line 2020 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypHfCov, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcal, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, j, TEcnaParEcal::MaxCrysInStin(), TEcnaParEcal::MaxStinEcnaInStex(), OpenRootFile(), TCnaRootFile::ReadElement(), and ReadStinNumbers().

2021 {
2022 //Read all the High Frequency covariances
2023 //in ROOT file and return them in a TMatrixD
2024 //
2025 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2026 
2027  //=====> WARNING: BIG MATRIX (1700x1700)
2028  TMatrixD mat(MatDim, MatDim);
2029  for(Int_t i=0; i<MatDim; i++){for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
2030 
2031  TVectorD vec(fEcal->MaxStinEcnaInStex());
2032  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
2034 
2035  CnaResultTyp typ = cTypHfCov;
2036 
2037  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2038 
2039  Bool_t ok_open = kFALSE;
2040  Bool_t ok_read = kFALSE;
2041 
2042  if ( fOpenRootFile )
2043  {
2044  cout << "!TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels() *** ERROR ***>"
2045  << " Reading on file already open." << fTTBELL << endl;
2046  }
2047  else
2048  {
2049  ok_open = OpenRootFile(file_name, "READ");
2050 
2051  Int_t i_zero = 0;
2052  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2053 
2054  if ( ok_read == kTRUE )
2055  {
2056  fDataExist = kTRUE;
2057  for (Int_t index_Stin_a = 0; index_Stin_a < fEcal->MaxStinEcnaInStex(); index_Stin_a++)
2058  {
2059  if ( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= fEcal->MaxStinEcnaInStex())
2060  {
2061  for (Int_t index_Stin_b = 0; index_Stin_b < fEcal->MaxStinEcnaInStex(); index_Stin_b++)
2062  {
2063  if ( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= fEcal->MaxStinEcnaInStex())
2064  {
2065  for ( Int_t i_crys = 0; i_crys < fEcal->MaxCrysInStin(); i_crys++)
2066  {
2067  Int_t i_cna_chan = index_Stin_a*fEcal->MaxCrysInStin() + i_crys;
2068  Int_t i_chan_sm = (Int_t)(vec(index_Stin_a)-1)*fEcal->MaxCrysInStin() +i_crys;
2069  for ( Int_t j_crys = 0; j_crys < fEcal->MaxCrysInStin(); j_crys++)
2070  {
2071  Int_t j_cna_chan = index_Stin_b*fEcal->MaxCrysInStin() + j_crys;
2072  Int_t j_chan_sm = (Int_t)(vec(index_Stin_b)-1)*fEcal->MaxCrysInStin() +j_crys;
2073  mat(i_chan_sm, j_chan_sm) =
2074  gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
2075  }
2076  }
2077  }
2078  }
2079  }
2080  }
2081  }
2082  else
2083  {
2084  fDataExist = kFALSE;
2085  cout << "!TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels() *** ERROR ***> "
2086  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2087  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2088  << fTTBELL << endl;
2089  }
2090  }
2091 
2092  CloseRootFile(file_name);
2093 
2094  return mat;
2095 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
Int_t MaxCrysInStin()
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Int_t MaxStinEcnaInStex()
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadHighFrequencyMeanCorrelationsBetweenStins ( const Int_t &  MatDim)

Definition at line 2260 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypHFccMoStins, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcal, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, j, TEcnaParEcal::MaxStinEcnaInStex(), OpenRootFile(), TCnaRootFile::ReadElement(), and ReadStinNumbers().

Referenced by TEcnaHistos::ViewMatrix().

2261 {
2262 //Read all the High Frequency Mean Correlations Between Towers the for all (Stin_X, Stin_Y)
2263 //in ROOT file and return them in a TMatrixD
2264 //
2265 //Possible values for MatDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2266 
2267  TMatrixD mat(MatDim, MatDim);
2268  for(Int_t i=0; i<MatDim; i++)
2269  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
2270 
2271  TVectorD vec(fEcal->MaxStinEcnaInStex());
2272  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
2274 
2276 
2277  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2278 
2279  Bool_t ok_open = kFALSE;
2280  Bool_t ok_read = kFALSE;
2281 
2282  if ( fOpenRootFile )
2283  {
2284  cout << "!TEcnaRead::ReadHighFrequencyMeanCorrelationsBetweenStins() *** ERROR ***>"
2285  << " Reading on file already open." << fTTBELL << endl;
2286  }
2287  else
2288  {
2289  ok_open = OpenRootFile(file_name, "READ");
2290 
2291  Int_t i_zero = 0;
2292  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2293 
2294  if( ok_read == kTRUE )
2295  {
2296  fDataExist = kTRUE;
2297  for(Int_t index_Stin_a = 0; index_Stin_a < MatDim; index_Stin_a++)
2298  {
2299  for(Int_t index_Stin_b = 0; index_Stin_b < MatDim; index_Stin_b++)
2300  {
2301  if( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= MatDim)
2302  {
2303  if( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= MatDim)
2304  {
2305  mat((Int_t)vec(index_Stin_a)-1, (Int_t)vec(index_Stin_b)-1) =
2306  gCnaRootFile->fCnaIndivResult->fMatMat(index_Stin_a,index_Stin_b);
2307  }
2308  }
2309  }
2310  }
2311  }
2312  else
2313  {
2314  fDataExist = kFALSE;
2315  cout << "!TEcnaRead::ReadHighFrequencyMeanCorrelationsBetweenStins() *** ERROR ***> "
2316  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2317  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2318  << fTTBELL << endl;
2319  }
2320 
2321  CloseRootFile(file_name);
2322  }
2323 
2324  return mat;
2325 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Int_t MaxStinEcnaInStex()
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadHighFrequencyNoise ( const Int_t &  VecDim)

Definition at line 2593 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypHfn, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetHistoValues(), TEcnaHistos::ViewHistime(), and TEcnaHistos::ViewStex().

2594 {
2595 //Read the sigmas of the sigmas of the samples
2596 //for all the channels of a given Stin
2597 //in the ROOT file and return them in a TVectorD
2598 //
2599 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2600 
2601  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2602  CnaResultTyp typ = cTypHfn; // high frequency noise type
2603  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2604 
2605  Bool_t ok_open = kFALSE;
2606  Bool_t ok_read = kFALSE;
2607 
2608  if ( fOpenRootFile )
2609  {
2610  cout << "!TEcnaRead::ReadHighFrequencyNoise(...) *** ERROR ***> "
2611  << "Reading on file already open." << fTTBELL << endl;
2612  }
2613  else
2614  {
2615  ok_open = OpenRootFile(file_name, "READ");
2616 
2617  Int_t i_zero = 0;
2618  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2619 
2620  if ( ok_read == kTRUE )
2621  {
2622  fDataExist = kTRUE;
2623  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2624  {
2625  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2626  }
2627  }
2628  else
2629  {
2630  fDataExist = kFALSE;
2631  cout << "!TEcnaRead::ReadHighFrequencyNoise(...) *** ERROR ***> "
2632  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2633  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2634  << fTTBELL << endl;
2635  }
2636  }
2637 
2638  CloseRootFile(file_name);
2639  return vec;
2640 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels ( const Int_t &  n1StexStin_a,
const Int_t &  n1StexStin_b,
const Int_t &  MatDim 
)

Definition at line 1645 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypLfCor, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetStinIndex(), GetTypeOfQuantity(), i, j, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::StexHocoVecoLHFCorcc(), and TEcnaHistos::ViewMatrix().

1648 {
1649 //Read the Low Frequency cor(i0StinEcha of Stin_a, i0StinEcha of Stin b)
1650 //in ROOT file and return them in a TMatrixD
1651 //
1652 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysInStin()
1653 
1654  Int_t index_Stin_a = GetStinIndex(n1StexStin_a);
1655  Int_t index_Stin_b = GetStinIndex(n1StexStin_b);
1656 
1657  TMatrixD mat(MatDim, MatDim);
1658  for(Int_t i=0; i<MatDim; i++)
1659  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1660 
1661  CnaResultTyp typ = cTypLfCor;
1662 
1663  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1664 
1665  Bool_t ok_open = kFALSE;
1666  Bool_t ok_read = kFALSE;
1667 
1668  if ( fOpenRootFile )
1669  {
1670  cout << "!TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels(...) *** ERROR ***>"
1671  << " Reading on file already open." << fTTBELL << endl;
1672  }
1673  else
1674  {
1675  ok_open = OpenRootFile(file_name, "READ");
1676 
1677  Int_t i_zero = 0;
1678 
1679  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1680 
1681  if ( ok_read == kTRUE )
1682  {
1683  fDataExist = kTRUE;
1684  for ( Int_t i_crys = 0; i_crys < MatDim; i_crys++)
1685  {
1686  Int_t i_cna_chan = index_Stin_a*MatDim + i_crys;
1687  for ( Int_t j_crys = 0; j_crys < MatDim; j_crys++)
1688  {
1689  Int_t j_cna_chan = index_Stin_b*MatDim + j_crys;
1690  mat(i_crys, j_crys) = gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1691  }
1692  }
1693  }
1694  else
1695  {
1696  fDataExist = kFALSE;
1697  cout << "!TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels(...) *** ERROR ***> "
1698  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1699  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1700  << fTTBELL << endl;
1701  }
1702  }
1703 
1704  CloseRootFile(file_name);
1705 
1706  return mat;
1707 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
Int_t GetStinIndex(const Int_t &)
Definition: TEcnaRead.cc:3222
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels ( const Int_t &  MatDim)

Definition at line 1937 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypLfCor, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcal, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, j, TEcnaParEcal::MaxCrysInStin(), TEcnaParEcal::MaxStinEcnaInStex(), OpenRootFile(), TCnaRootFile::ReadElement(), and ReadStinNumbers().

1938 {
1939 //Read all the Low Frequency correlations
1940 //in ROOT file and return them in a TMatrixD
1941 //
1942 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
1943 
1944  //=====> WARNING: BIG MATRIX (1700x1700)
1945  TMatrixD mat(MatDim, MatDim);
1946  for(Int_t i=0; i<MatDim; i++){for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1947 
1948  TVectorD vec(fEcal->MaxStinEcnaInStex());
1949  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
1951 
1952  CnaResultTyp typ = cTypLfCor;
1953 
1954  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1955 
1956  Bool_t ok_open = kFALSE;
1957  Bool_t ok_read = kFALSE;
1958 
1959  if ( fOpenRootFile )
1960  {
1961  cout << "!TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels() *** ERROR ***>"
1962  << " Reading on file already open." << fTTBELL << endl;
1963  }
1964  else
1965  {
1966  ok_open = OpenRootFile(file_name, "READ");
1967 
1968  Int_t i_zero = 0;
1969  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1970 
1971  if ( ok_read == kTRUE )
1972  {
1973  fDataExist = kTRUE;
1974  for (Int_t index_Stin_a = 0; index_Stin_a < fEcal->MaxStinEcnaInStex(); index_Stin_a++)
1975  {
1976  if ( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= fEcal->MaxStinEcnaInStex())
1977  {
1978  for (Int_t index_Stin_b = 0; index_Stin_b < fEcal->MaxStinEcnaInStex(); index_Stin_b++)
1979  {
1980  if ( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= fEcal->MaxStinEcnaInStex())
1981  {
1982  for ( Int_t i_crys = 0; i_crys < fEcal->MaxCrysInStin(); i_crys++)
1983  {
1984  Int_t i_cna_chan = index_Stin_a*fEcal->MaxCrysInStin() + i_crys;
1985  Int_t i_chan_sm = (Int_t)(vec(index_Stin_a)-1)*fEcal->MaxCrysInStin() + i_crys;
1986  for ( Int_t j_crys = 0; j_crys < fEcal->MaxCrysInStin(); j_crys++)
1987  {
1988  Int_t j_cna_chan = index_Stin_b*fEcal->MaxCrysInStin() + j_crys;
1989  Int_t j_chan_sm = (Int_t)(vec(index_Stin_b)-1)*fEcal->MaxCrysInStin() + j_crys;
1990  mat(i_chan_sm, j_chan_sm) =
1991  gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1992  }
1993  }
1994  }
1995  }
1996  }
1997  }
1998  }
1999  else
2000  {
2001  fDataExist = kFALSE;
2002  cout << "!TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels() *** ERROR ***> "
2003  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2004  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2005  << fTTBELL << endl;
2006  }
2007  }
2008 
2009  CloseRootFile(file_name);
2010 
2011  return mat;
2012 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
Int_t MaxCrysInStin()
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Int_t MaxStinEcnaInStex()
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels ( const Int_t &  n1StexStin_a,
const Int_t &  n1StexStin_b,
const Int_t &  MatDim 
)

Definition at line 1576 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypLfCov, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetStinIndex(), GetTypeOfQuantity(), i, j, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::ViewMatrix().

1579 {
1580 //Read the Low Frequency cov(i0StinEcha of Stin_a, i0StinEcha of Stin b)
1581 //in ROOT file and return them in a TMatrixD
1582 //
1583 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysInStin()
1584 
1585  Int_t index_Stin_a = GetStinIndex(n1StexStin_a);
1586  Int_t index_Stin_b = GetStinIndex(n1StexStin_b);
1587 
1588  TMatrixD mat(MatDim, MatDim);
1589  for(Int_t i=0; i<MatDim; i++)
1590  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1591 
1592  CnaResultTyp typ = cTypLfCov;
1593 
1594  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1595 
1596  Bool_t ok_open = kFALSE;
1597  Bool_t ok_read = kFALSE;
1598 
1599  if ( fOpenRootFile )
1600  {
1601  cout << "!TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels(...) *** ERROR ***>"
1602  << " Reading on file already open." << fTTBELL << endl;
1603  }
1604  else
1605  {
1606  ok_open = OpenRootFile(file_name, "READ");
1607 
1608  Int_t i_zero = 0;
1609  ok_read = gCnaRootFile->ReadElement(typ,i_zero);
1610 
1611  if ( ok_read == kTRUE )
1612  {
1613  fDataExist = kTRUE;
1614  for ( Int_t i_crys = 0; i_crys < MatDim; i_crys++)
1615  {
1616  Int_t i_cna_chan = index_Stin_a*MatDim + i_crys;
1617  for ( Int_t j_crys = 0; j_crys < MatDim; j_crys++)
1618  {
1619  Int_t j_cna_chan = index_Stin_b*MatDim + j_crys;
1620  mat(i_crys, j_crys) = gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1621  }
1622  }
1623  }
1624  else
1625  {
1626  fDataExist = kFALSE;
1627  cout << "!TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels(...) *** ERROR ***> "
1628  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1629  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1630  << fTTBELL << endl;
1631  }
1632  }
1633 
1634  CloseRootFile(file_name);
1635 
1636  return mat;
1637 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
Int_t GetStinIndex(const Int_t &)
Definition: TEcnaRead.cc:3222
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels ( const Int_t &  MatDim)

Definition at line 1854 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypLfCov, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcal, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, j, TEcnaParEcal::MaxCrysInStin(), TEcnaParEcal::MaxStinEcnaInStex(), OpenRootFile(), TCnaRootFile::ReadElement(), and ReadStinNumbers().

1855 {
1856 //Read all the Low Frequency covariances
1857 //in ROOT file and return them in a TMatrixD
1858 //
1859 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
1860 
1861  //=====> WARNING: BIG MATRIX (1700x1700)
1862  TMatrixD mat(MatDim, MatDim);
1863  for(Int_t i=0; i<MatDim; i++){for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1864 
1865  TVectorD vec(fEcal->MaxStinEcnaInStex());
1866  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
1868 
1869  CnaResultTyp typ = cTypLfCov;
1870 
1871  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1872 
1873  Bool_t ok_open = kFALSE;
1874  Bool_t ok_read = kFALSE;
1875 
1876  if ( fOpenRootFile )
1877  {
1878  cout << "!TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels() *** ERROR ***>"
1879  << " Reading on file already open." << fTTBELL << endl;
1880  }
1881  else
1882  {
1883  ok_open = OpenRootFile(file_name, "READ");
1884 
1885  Int_t i_zero = 0;
1886  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1887 
1888  if ( ok_read == kTRUE )
1889  {
1890  fDataExist = kTRUE;
1891  for (Int_t index_Stin_a = 0; index_Stin_a < fEcal->MaxStinEcnaInStex(); index_Stin_a++)
1892  {
1893  if ( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= fEcal->MaxStinEcnaInStex())
1894  {
1895  for (Int_t index_Stin_b = 0; index_Stin_b < fEcal->MaxStinEcnaInStex(); index_Stin_b++)
1896  {
1897  if ( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= fEcal->MaxStinEcnaInStex())
1898  {
1899  for ( Int_t i_crys = 0; i_crys < fEcal->MaxCrysInStin(); i_crys++)
1900  {
1901  Int_t i_cna_chan = index_Stin_a*fEcal->MaxCrysInStin() + i_crys;
1902  Int_t i_chan_sm = (Int_t)(vec(index_Stin_a)-1)*fEcal->MaxCrysInStin() +i_crys;
1903  for ( Int_t j_crys = 0; j_crys < fEcal->MaxCrysInStin(); j_crys++)
1904  {
1905  Int_t j_cna_chan = index_Stin_b*fEcal->MaxCrysInStin() + j_crys;
1906  Int_t j_chan_sm = (Int_t)(vec(index_Stin_b)-1)*fEcal->MaxCrysInStin() +j_crys;
1907  mat(i_chan_sm, j_chan_sm) =
1908  gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1909  }
1910  }
1911  }
1912  }
1913  }
1914  }
1915  }
1916  else
1917  {
1918  fDataExist = kFALSE;
1919  cout << "!TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels() *** ERROR ***> "
1920  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1921  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1922  << fTTBELL << endl;
1923  }
1924  }
1925 
1926  CloseRootFile(file_name);
1927 
1928  return mat;
1929 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
Int_t MaxCrysInStin()
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Int_t MaxStinEcnaInStex()
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TMatrixD TEcnaRead::ReadLowFrequencyMeanCorrelationsBetweenStins ( const Int_t &  MatDim)

Definition at line 2187 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypLFccMoStins, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcal, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, j, TEcnaParEcal::MaxStinEcnaInStex(), OpenRootFile(), TCnaRootFile::ReadElement(), and ReadStinNumbers().

Referenced by TEcnaHistos::ViewMatrix().

2188 {
2189 //Read all the Low Frequency Mean Correlations Between Towers the for all (Stin_X, Stin_Y)
2190 //in ROOT file and return them in a TMatrixD
2191 //
2192 //Possible values for MatDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2193 
2194  TMatrixD mat(MatDim, MatDim);
2195  for(Int_t i=0; i<MatDim; i++)
2196  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
2197 
2198  TVectorD vec(fEcal->MaxStinEcnaInStex());
2199  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
2201 
2203 
2204  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2205 
2206  Bool_t ok_open = kFALSE;
2207  Bool_t ok_read = kFALSE;
2208 
2209  if ( fOpenRootFile )
2210  {
2211  cout << "!TEcnaRead::ReadLowFrequencyMeanCorrelationsBetweenStins() *** ERROR ***>"
2212  << " Reading on file already open." << fTTBELL << endl;
2213  }
2214  else
2215  {
2216  ok_open = OpenRootFile(file_name, "READ");
2217 
2218  Int_t i_zero = 0;
2219  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2220 
2221  if( ok_read == kTRUE )
2222  {
2223  fDataExist = kTRUE;
2224  for(Int_t index_Stin_a = 0; index_Stin_a < MatDim; index_Stin_a++)
2225  {
2226  for(Int_t index_Stin_b = 0; index_Stin_b < MatDim; index_Stin_b++)
2227  {
2228  if( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= MatDim)
2229  {
2230  if( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= MatDim)
2231  {
2232  mat((Int_t)vec(index_Stin_a)-1, (Int_t)vec(index_Stin_b)-1) =
2233  gCnaRootFile->fCnaIndivResult->fMatMat(index_Stin_a,index_Stin_b);
2234  }
2235  }
2236  }
2237  }
2238  }
2239  else
2240  {
2241  fDataExist = kFALSE;
2242  cout << "!TEcnaRead::ReadLowFrequencyMeanCorrelationsBetweenStins() *** ERROR ***> "
2243  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2244  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2245  << fTTBELL << endl;
2246  }
2247 
2248  CloseRootFile(file_name);
2249  }
2250 
2251  return mat;
2252 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Int_t MaxStinEcnaInStex()
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadLowFrequencyNoise ( const Int_t &  VecDim)

Definition at line 2539 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypLfn, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetHistoValues(), TEcnaHistos::ViewHistime(), and TEcnaHistos::ViewStex().

2540 {
2541 //Read the sigmas of the expectation values of the samples
2542 //for all the channels of a given Stin
2543 //in the ROOT file and return them in a TVectorD
2544 //
2545 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2546 
2547  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2548  CnaResultTyp typ = cTypLfn; // low frequency noise type
2549  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2550 
2551  Bool_t ok_open = kFALSE;
2552  Bool_t ok_read = kFALSE;
2553 
2554  if ( fOpenRootFile )
2555  {
2556  cout << "!TEcnaRead::ReadLowFrequencyNoise(...) *** ERROR ***> "
2557  << "Reading on file already open." << fTTBELL << endl;
2558  }
2559  else
2560  {
2561  ok_open = OpenRootFile(file_name, "READ");
2562 
2563  Int_t i_zero = 0;
2564  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2565 
2566  if ( ok_read == kTRUE )
2567  {
2568  fDataExist = kTRUE;
2569  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2570  {
2571  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2572  }
2573  }
2574  else
2575  {
2576  fDataExist = kFALSE;
2577  cout << "!TEcnaRead::ReadLowFrequencyNoise(...) *** ERROR ***> "
2578  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2579  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2580  << fTTBELL << endl;
2581  }
2582  }
2583 
2584  CloseRootFile(file_name);
2585  return vec;
2586 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadMeanOfCorrelationsBetweenSamples ( const Int_t &  VecDim)

Definition at line 2485 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypMeanCorss, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetHistoValues(), TEcnaHistos::ViewHistime(), and TEcnaHistos::ViewStex().

2486 {
2487 //Read the Expectation values of the (sample,sample) correlations
2488 //for all the channels of a given Stin
2489 //in the ROOT file and return them in a TVectorD
2490 //
2491 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2492 
2493  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2494  CnaResultTyp typ = cTypMeanCorss; // mean of corss type
2495  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2496 
2497  Bool_t ok_open = kFALSE;
2498  Bool_t ok_read = kFALSE;
2499 
2500  if ( fOpenRootFile )
2501  {
2502  cout << "!TEcnaRead::ReadMeanOfCorrelationsBetweenSamples(...) *** ERROR ***> "
2503  << "Reading on file already open." << fTTBELL << endl;
2504  }
2505  else
2506  {
2507  ok_open = OpenRootFile(file_name, "READ");
2508 
2509  Int_t i_zero = 0;
2510  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2511 
2512  if ( ok_read == kTRUE )
2513  {
2514  fDataExist = kTRUE;
2515  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2516  {
2517  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2518  }
2519  }
2520  else
2521  {
2522  fDataExist = kFALSE;
2523  cout << "!TEcnaRead::ReadMeanOfCorrelationsBetweenSamples(...) *** ERROR ***> "
2524  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2525  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2526  << fTTBELL << endl;
2527  }
2528  }
2529 
2530  CloseRootFile(file_name);
2531  return vec;
2532 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadNumberOfEvents ( const Int_t &  VecDim)

Definition at line 2338 of file TEcnaRead.cc.

References fEcal, fEcalNumbering, fFileHeader, TEcnaHeader::fNbOfSamples, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), i, j, TEcnaParEcal::MaxCrysInStin(), TEcnaParEcal::MaxStinEcnaInStex(), and ReadNumberOfEventsForSamples().

Referenced by TEcnaHistos::GetHistoValues(), TEcnaHistos::GetNumberOfEvents(), ReadAveragedNumberOfEvents(), and TEcnaHistos::ViewStex().

2339 {
2340 //Read the numbers of found events in the data
2341 //for the crystals and for the samples for all the Stin's in the Stex
2342 //in the ROOT file, compute the average on the samples
2343 //and return them in a TVectorD(MaxCrysEcnaInStex)
2344 //
2345 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2346 
2347  TVectorD vec(VecDim);
2348  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2349 
2350  TMatrixD mat(fEcal->MaxCrysInStin(), fFileHeader->fNbOfSamples);
2351 
2352  for(Int_t iStexStin=0; iStexStin<fEcal->MaxStinEcnaInStex(); iStexStin++)
2353  {
2354  //............. set mat(,) to zero before reading it
2355  for(Int_t i=0; i<fEcal->MaxCrysInStin(); i++)
2356  {for(Int_t j=0; j<fFileHeader->fNbOfSamples; j++){mat(i,j)=(Double_t)0.;}}
2357  //............. read mat(,)
2359 
2360  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
2361  {
2362  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(iStexStin+1, i0StinEcha);
2363  vec(i0StexEcha) = 0;
2364  //.... average value over the samples
2365  for(Int_t i_samp=0; i_samp<fFileHeader->fNbOfSamples; i_samp++)
2366  {vec(i0StexEcha) += mat(i0StinEcha, i_samp);}
2367  vec(i0StexEcha) = vec(i0StexEcha)/fFileHeader->fNbOfSamples;
2368  }
2369  }
2370  return vec;
2371 }
int i
Definition: DBlmapReader.cc:9
Int_t fNbOfSamples
Definition: TEcnaHeader.h:34
int j
Definition: DBlmapReader.cc:9
Int_t MaxCrysInStin()
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
TMatrixD ReadNumberOfEventsForSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:973
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRead.h:59
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
Int_t MaxStinEcnaInStex()
TMatrixD TEcnaRead::ReadNumberOfEventsForSamples ( const Int_t &  n1StexStin,
const Int_t &  MatDimX,
const Int_t &  MatDimY 
)

Definition at line 973 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypNbOfEvts, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fLookAtRootFile, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetStinIndex(), GetTypeOfQuantity(), i, j, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaRun::ReadEventDistributions(), and ReadNumberOfEvents().

975 {
976 //Read the numbers of found events in the data
977 //for the crystals and for the samples, for a given Stin in the Stex
978 //in the ROOT file and return them in a TMatrixD(MaxCrysInStin,NbOfSamples)
979 //
980 //Possible values for MatDimX and MatDimY:
981 // (1) MatDimX = fEcal->MaxCrysInStin(), MatDimY = fFileHeader->fNbOfSamples
982 
983  TMatrixD mat(MatDimX, MatDimY);
984  for(Int_t i=0; i<MatDimX; i++)
985  {for(Int_t j=0; j<MatDimY; j++){mat(i,j)=(Double_t)0.;}}
986 
987  Int_t Stin_index = GetStinIndex(n1StexStin);
988  if( Stin_index >= 0 )
989  {
990  if(fLookAtRootFile == 1)
991  {
993  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
994 
995  Bool_t ok_open = kFALSE;
996  Bool_t ok_read = kFALSE;
997 
998  if ( fOpenRootFile )
999  {
1000  cout << "!TEcnaRead::ReadNumberOfEventsForSamples(...) *** ERROR ***> "
1001  << " Reading on file already open." << fTTBELL << endl;
1002  }
1003  else
1004  {
1005  ok_open = OpenRootFile(file_name, "READ");
1006 
1007  Int_t i_zero = 0;
1008  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1009 
1010  if ( ok_read == kTRUE )
1011  {
1012  fDataExist = kTRUE;
1013  for (Int_t i_crys=0; i_crys<MatDimX; i_crys++)
1014  {
1015  Int_t j_cna_chan = Stin_index*MatDimX + i_crys;
1016  for ( Int_t i_samp=0; i_samp<MatDimY; i_samp++)
1017  {
1018  mat(i_crys, i_samp) = gCnaRootFile->fCnaIndivResult->fMatHis(j_cna_chan, i_samp);
1019  }
1020  }
1021  }
1022  else
1023  {
1024  fDataExist = kFALSE;
1025  cout << "!TEcnaRead::ReadNumberOfEventsForSamples(...) *** ERROR ***> "
1026  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1027  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1028  << fTTBELL << endl;
1029  }
1030  }
1031  CloseRootFile(file_name);
1032  }
1033  else
1034  {
1035  cout << "!TEcnaRead::ReadNumberOfEventsForSamples(...) *** ERROR ***> "
1036  << "It is not possible to access the number of found events: the ROOT file has not been read."
1037  << fTTBELL << endl;
1038  }
1039  } // end of if (Stin_index >= 0)
1040  return mat;
1041 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
Int_t GetStinIndex(const Int_t &)
Definition: TEcnaRead.cc:3222
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Int_t fLookAtRootFile
Definition: TEcnaRead.h:67
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadPedestals ( const Int_t &  VecDim)

Definition at line 2378 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypPed, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetHistoValues(), TEcnaHistos::ViewHistime(), and TEcnaHistos::ViewStex().

2379 {
2380 //Read the expectation values of the expectation values of the samples
2381 //for all the channels of a given Stin
2382 //in the ROOT file and return them in a TVectorD
2383 //
2384 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2385 
2386  TVectorD vec(VecDim);
2387  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2388 
2389  CnaResultTyp typ = cTypPed; // pedestals type
2390  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2391 
2392  Bool_t ok_open = kFALSE;
2393  Bool_t ok_read = kFALSE;
2394 
2395  if ( fOpenRootFile )
2396  {
2397  cout << "!TEcnaRead::ReadPedestals(...) *** ERROR ***> "
2398  << "Reading on file already open." << fTTBELL << endl;
2399  }
2400  else
2401  {
2402  ok_open = OpenRootFile(file_name, "READ");
2403 
2404  Int_t i_zero = 0;
2405  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2406 
2407  if ( ok_read == kTRUE )
2408  {
2409  fDataExist = kTRUE;
2410  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2411  {
2412  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i_StexCrys);
2413  }
2414  }
2415  else
2416  {
2417  fDataExist = kFALSE;
2418  cout << "!TEcnaRead::ReadPedestals(...) *** ERROR ***> "
2419  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2420  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2421  << fTTBELL << endl;
2422  }
2423  }
2424  CloseRootFile(file_name);
2425  return vec;
2426 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadRelevantCorrelationsBetweenSamples ( const Int_t &  n1StexStin,
const Int_t &  i0StinEcha,
const Int_t &  InPutMatDim 
)

Definition at line 1519 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypCorCss, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcalNumbering, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

1521 {
1522 //Read the (sample,sample) correlations for a given channel
1523 //in ROOT file and return the relevant correlations in a TVectorD
1524 //
1525 //Possible values for InPutMatDim: (1) InPutMatDim = fFileHeader->fNbOfSamples
1526 //
1527 // *===> OutPut TVectorD dimension value = InPutMatDim*(InPutMatDim-1)/2
1528 
1529  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1530  Int_t nb_of_relevant = InPutMatDim*(InPutMatDim-1)/2;
1531  TVectorD vec_rel(nb_of_relevant); for(Int_t i=0; i<nb_of_relevant; i++){vec_rel(i)=(Double_t)0.;}
1532  CnaResultTyp typ = cTypCorCss;
1533  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1534 
1535  Bool_t ok_open = kFALSE;
1536  Bool_t ok_read = kFALSE;
1537 
1538  if ( fOpenRootFile )
1539  {
1540  cout << "!TEcnaRead::ReadRelevantCorrelationsBetweenSamples(...) *** ERROR ***> "
1541  << "Reading on file already open." << fTTBELL << endl;
1542  }
1543  else
1544  {
1545  ok_open = OpenRootFile(file_name, "READ");
1546  ok_read = gCnaRootFile->ReadElement(typ, i0StexEcha);
1547 
1548  if ( ok_read == kTRUE )
1549  {
1550  fDataExist = kTRUE;
1551  Int_t k_cor = 0;
1552  for ( Int_t i_samp = 0; i_samp < InPutMatDim; i_samp++){
1553  for ( Int_t j_samp = 0; j_samp < i_samp; j_samp++){
1554  vec_rel(k_cor) = gCnaRootFile->fCnaIndivResult->fMatMat(i_samp,j_samp);
1555  k_cor++;}}
1556  }
1557  else
1558  {
1559  fDataExist = kFALSE;
1560  cout << "!TEcnaRead::ReadRelevantCorrelationsBetweenSamples() *** ERROR ***> "
1561  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1562  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1563  << fTTBELL << endl;
1564  }
1565  }
1566  CloseRootFile(file_name);
1567  return vec_rel;
1568 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRead.h:59
Bool_t fDataExist
Definition: TEcnaRead.h:88
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
Bool_t TEcnaRead::ReadRootFileHeader ( const Int_t &  i_print)

Definition at line 729 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, TEcnaHeader::fAdcEvtCalc, TEcnaHeader::fAvHfnCalc, TEcnaHeader::fAvLfnCalc, TEcnaHeader::fAvMeanCorssCalc, TEcnaHeader::fAvPedCalc, TEcnaHeader::fAvSigCorssCalc, TEcnaHeader::fAvTnoCalc, fCnaWrite, TEcnaHeader::fCorCssCalc, TEcnaHeader::fCovCssCalc, fFileHeader, TEcnaHeader::fHFccMoStinsCalc, TEcnaHeader::fHfCorCalc, TEcnaHeader::fHfCovCalc, cmsPerfSuiteHarvest::file_name, TEcnaHeader::fLFccMoStinsCalc, TEcnaHeader::fLfCorCalc, TEcnaHeader::fLfCovCalc, TEcnaHeader::fMeanCorssCalc, TEcnaHeader::fMSpCalc, fOpenRootFile, TCnaRootFile::fRootFile, TEcnaWrite::fRootFileNameShort, TEcnaHeader::fRunType, TEcnaHeader::fSigCorssCalc, TEcnaHeader::fSSpCalc, TEcnaHeader::fStartDate, TEcnaHeader::fStartTime, TEcnaHeader::fStinNumbersCalc, TEcnaHeader::fStopDate, TEcnaHeader::fStopTime, fTTBELL, gCnaRootFile, h, OpenRootFile(), and TEcnaHeader::Print().

Referenced by LookAtRootFile().

730 {
731 //Read the header of the Root file
732 
733  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
734 
735  if( i_print == 1 ){cout << "*TEcnaRead::ReadRootFileHeader> file_name = "
736  << fCnaWrite->fRootFileNameShort.Data() << endl;}
737 
738  Bool_t ok_open = kFALSE;
739  Bool_t ok_read = kFALSE;
740 
741  if ( fOpenRootFile )
742  {
743  cout << "!TEcnaRead::ReadRootFileHeader(...)*** ERROR ***> "
744  << "Reading header on file already open." << endl;
745  }
746  else
747  {
748  ok_open = OpenRootFile(file_name, "READ");
749 
750  if(ok_open)
751  {
752  TEcnaHeader *h;
753  h =(TEcnaHeader*)gCnaRootFile->fRootFile->Get("CnaHeader");
754 
755  //..... get the attributes which are not already set by the call to TEcnaHeader
756  // in GetReadyToReadRootFile(...) and are only available in the ROOT file
757 
762 
764 
765  //........................................................................
773 
784 
788 
789  if(i_print == 1){fFileHeader->Print();}
790  CloseRootFile(file_name);
791  ok_read = kTRUE;
792  }
793  else
794  {
795  cout << "!TEcnaRead::ReadRootFileHeader(...) *** ERROR ***> Open ROOT file failed for file: "
796  << file_name << fTTBELL << endl;
797  ok_read = kFALSE;
798  }
799  }
800  return ok_read;
801 }
Int_t fHFccMoStinsCalc
Definition: TEcnaHeader.h:66
Int_t fAvLfnCalc
Definition: TEcnaHeader.h:56
Int_t fSSpCalc
Definition: TEcnaHeader.h:54
void Print()
Definition: TEcnaHeader.cc:131
Int_t fRunType
Definition: TEcnaHeader.h:46
Int_t fAvMeanCorssCalc
Definition: TEcnaHeader.h:75
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
Int_t fHfCorCalc
Definition: TEcnaHeader.h:62
TFile * fRootFile
Definition: TCnaRootFile.h:20
Int_t fMSpCalc
Definition: TEcnaHeader.h:53
TString fStopDate
Definition: TEcnaHeader.h:44
Int_t fMeanCorssCalc
Definition: TEcnaHeader.h:69
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Int_t fHfCovCalc
Definition: TEcnaHeader.h:61
Int_t fCorCssCalc
Definition: TEcnaHeader.h:60
Int_t fAvTnoCalc
Definition: TEcnaHeader.h:55
TString fTTBELL
Definition: TEcnaRead.h:51
Int_t fAvHfnCalc
Definition: TEcnaHeader.h:57
TString fStartDate
Definition: TEcnaHeader.h:43
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
Int_t fAvPedCalc
Definition: TEcnaHeader.h:74
Int_t fLfCorCalc
Definition: TEcnaHeader.h:64
Int_t fAdcEvtCalc
Definition: TEcnaHeader.h:52
time_t fStartTime
Definition: TEcnaHeader.h:41
time_t fStopTime
Definition: TEcnaHeader.h:42
Int_t fLfCovCalc
Definition: TEcnaHeader.h:63
Int_t fLFccMoStinsCalc
Definition: TEcnaHeader.h:65
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Int_t fSigCorssCalc
Definition: TEcnaHeader.h:72
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Int_t fStinNumbersCalc
Definition: TEcnaHeader.h:49
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Int_t fAvSigCorssCalc
Definition: TEcnaHeader.h:76
Int_t fCovCssCalc
Definition: TEcnaHeader.h:59
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadSampleMeans ( const Int_t &  n1StexStin,
const Int_t &  i0StinEcha,
const Int_t &  VecDim 
)

Definition at line 1215 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypMSp, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcalNumbering, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetHistoValues().

1217 {
1218 //Read the expectation values of the samples
1219 //for a given Stin and a given channel
1220 //in the ROOT file and return them in a TVectorD
1221 //
1222 //Possible values for VecDim : (1) VecDim = fFileHeader->fNbOfSamples
1223 
1224  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1225 
1226  TVectorD vec(VecDim);
1227  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
1228 
1229  CnaResultTyp typ = cTypMSp;
1230 
1231  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1232 
1233  Bool_t ok_open = kFALSE;
1234  Bool_t ok_read = kFALSE;
1235 
1236  if ( fOpenRootFile )
1237  {
1238  cout << "!TEcnaRead::ReadSampleMeans(...) *** ERROR ***> "
1239  << " Reading on file already open." << fTTBELL << endl;
1240  }
1241  else
1242  {
1243  ok_open = OpenRootFile(file_name, "READ");
1244 
1245  Int_t i_zero = 0;
1246  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1247 
1248  if ( ok_read == kTRUE )
1249  {
1250  fDataExist = kTRUE;
1251  for ( Int_t i_samp = 0; i_samp < VecDim; i_samp++)
1252  {
1253  vec(i_samp) = gCnaRootFile->fCnaIndivResult->fMatHis(i0StexEcha, i_samp);
1254  }
1255  }
1256  else
1257  {
1258  fDataExist = kFALSE;
1259  cout << "!TEcnaRead::ReadSampleMeans(...) *** ERROR ***> "
1260  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1261  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1262  << fTTBELL << endl;
1263  }
1264  }
1265  CloseRootFile(file_name);
1266  return vec;
1267 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRead.h:59
Bool_t fDataExist
Definition: TEcnaRead.h:88
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadSampleSigmas ( const Int_t &  n1StexStin,
const Int_t &  i0StinEcha,
const Int_t &  VecDim 
)

Definition at line 1274 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypSSp, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, fEcalNumbering, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, TEcnaNumbering::Get0StexEchaFrom1StexStinAnd0StinEcha(), GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetHistoValues().

1276 {
1277 //Read the expectation values of the samples
1278 //for a given Stin and a given channel
1279 //in the ROOT file and return them in a TVectorD
1280 //
1281 //Possible values for VecDim : (1) VecDim = fFileHeader->fNbOfSamples
1282 
1283  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1284 
1285  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
1286 
1287  CnaResultTyp typ = cTypSSp;
1288 
1289  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1290 
1291  Bool_t ok_open = kFALSE;
1292  Bool_t ok_read = kFALSE;
1293 
1294  if ( fOpenRootFile )
1295  {
1296  cout << "!TEcnaRead::ReadSampleSigmas(...) *** ERROR ***> "
1297  << "Reading on file already open." << fTTBELL << endl;
1298  }
1299  else
1300  {
1301  ok_open = OpenRootFile(file_name, "READ");
1302 
1303  Int_t i_zero = 0;
1304  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1305 
1306  if ( ok_read == kTRUE )
1307  {
1308  fDataExist = kTRUE;
1309  for ( Int_t i_samp = 0; i_samp < VecDim; i_samp++)
1310  {
1311  vec(i_samp) = gCnaRootFile->fCnaIndivResult->fMatHis(i0StexEcha,i_samp);
1312  }
1313  }
1314  else
1315  {
1316  fDataExist = kFALSE;
1317  cout << "!TEcnaRead::ReadSampleSigmas(...) *** ERROR ***> "
1318  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1319  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1320  << fTTBELL << endl;
1321  }
1322  }
1323  CloseRootFile(file_name);
1324  return vec;
1325 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRead.h:59
Bool_t fDataExist
Definition: TEcnaRead.h:88
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadSampleValues ( const Int_t &  i0StexEcha,
const Int_t &  sample,
const Int_t &  VecDim 
)

Definition at line 1048 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypAdcEvt, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetHistoValues().

1049 {
1050 //Read the event distribution for a given i0StexEcha and a given sample
1051 //in the results ROOT file and return it in a TVectorD(nb of evts in burst)
1052 //
1053 //Possible values for VecDim: (1) VecDim = fFileHeader->fReqNbOfEvts
1054 
1055  TVectorD vec(VecDim);
1056  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
1057 
1058  CnaResultTyp typ = cTypAdcEvt; // sample as a function of time type
1059 
1060  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1061 
1062  Bool_t ok_open = kFALSE;
1063  Bool_t ok_read = kFALSE;
1064 
1065  if ( fOpenRootFile )
1066  {
1067  cout << "!TEcnaRead::ReadSampleValues(...) *** ERROR ***> "
1068  << "Reading on file already open." << fTTBELL << endl;
1069  }
1070  else
1071  {
1072  ok_open = OpenRootFile(file_name, "READ");
1073  ok_read = gCnaRootFile->ReadElement(typ, i0StexEcha);
1074 
1075  if ( ok_read == kTRUE )
1076  {
1077  fDataExist = kTRUE;
1078  for ( Int_t i_bin=0; i_bin<VecDim; i_bin++)
1079  {
1080  vec(i_bin) = gCnaRootFile->fCnaIndivResult->fMatHis(sample, i_bin);
1081  }
1082  }
1083  else
1084  {
1085  fDataExist = kFALSE;
1086  cout << "!TEcnaRead::ReadSampleValues(...) *** ERROR ***> "
1087  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1088  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1089  << fTTBELL << endl;
1090  }
1091  }
1092  CloseRootFile(file_name);
1093 
1094  return vec;
1095 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
Double_t *** TEcnaRead::ReadSampleValuesSameFile ( const Int_t &  DimX,
const Int_t &  DimY,
const Int_t &  DimZ 
)

Definition at line 1104 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypAdcEvt, TCnaRootFile::fCnaIndivResult, fCnaWrite, fCnew, fDataExist, cmsPerfSuiteHarvest::file_name, TEcnaWrite::fRootFileNameShort, fT3d1_distribs, fT3d2_distribs, fT3d_distribs, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaRun::ReadEventDistributions().

1105 {
1106 
1107 //Possible values for DimX, DimY, DimZ : (1) DimX = fEcal->MaxCrysEcnaInStex()
1108 // DimY = fFileHeader->fNbOfSamples
1109 // DimZ = fFileHeader->fReqNbOfEvts
1110 
1111  if(fT3d_distribs == 0)
1112  {
1113  //............ Allocation for the 3d array
1114  fT3d_distribs = new Double_t**[DimX]; fCnew++;
1115  fT3d2_distribs = new Double_t*[DimX*DimY]; fCnew++;
1116  fT3d1_distribs = new Double_t[DimX*DimY*DimZ]; fCnew++;
1117 
1118  for(Int_t i0StexEcha = 0 ; i0StexEcha < DimX ; i0StexEcha++){
1119  fT3d_distribs[i0StexEcha] = &fT3d2_distribs[0] + i0StexEcha*DimY;
1120  for(Int_t j_samp = 0 ; j_samp < DimY ; j_samp++){
1121  fT3d2_distribs[DimY*i0StexEcha + j_samp] = &fT3d1_distribs[0]+
1122  DimZ*(DimY*i0StexEcha+j_samp);}}
1123  }
1124 
1125  //................................. Init to zero (ReadSampleValuesSameFile)
1126  for (Int_t iza=0; iza<DimX; iza++)
1127  {
1128  for (Int_t izb=0; izb<DimY; izb++)
1129  {
1130  for (Int_t izc=0; izc<DimZ; izc++)
1131  {
1132  if( fT3d_distribs[iza][izb][izc] != (Double_t)0 )
1133  {
1134  fT3d_distribs[iza][izb][izc] = (Double_t)0;
1135  }
1136  }
1137  }
1138  }
1139 
1140  //-------------------------------------------------------------------------- (ReadSampleValuesSameFile)
1141  CnaResultTyp typ = cTypAdcEvt; // sample as a function of time type
1142 
1143  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1144 
1145  Bool_t ok_open = kFALSE;
1146  Bool_t ok_read = kFALSE;
1147 
1148  Int_t i_entry = 0;
1149  Int_t i_entry_fail = 0;
1150 
1151  ok_open = OpenRootFile(file_name, "READ");
1152 
1153  if( ok_open == kTRUE )
1154  {
1155  for(Int_t i0StexEcha=0; i0StexEcha<DimX; i0StexEcha++)
1156  {
1157  if( i0StexEcha == 0 )
1158  {
1159  i_entry = gCnaRootFile->ReadElementNextEntryNumber(typ, i0StexEcha);
1160  if( i_entry >= 0 ){ok_read = kTRUE;}
1161  }
1162  if( i_entry >= 0 ) // (ReadSampleValuesSameFile)
1163  {
1164  if( i0StexEcha > 0 ){ok_read = gCnaRootFile->ReadElement(i_entry); i_entry++;}
1165 
1166  if ( ok_read == kTRUE )
1167  {
1168  fDataExist = kTRUE;
1169  for(Int_t sample=0; sample<DimY; sample++)
1170  {
1171  for ( Int_t i_bin=0; i_bin<DimZ; i_bin++)
1172  {
1173  fT3d_distribs[i0StexEcha][sample][i_bin]
1174  = gCnaRootFile->fCnaIndivResult->fMatHis(sample, i_bin);
1175  }
1176  }
1177  }
1178  else // (ReadSampleValuesSameFile)
1179  {
1180  fDataExist = kFALSE;
1181  cout << "!TEcnaRead::ReadSampleValuesSameFile(...) *** ERROR ***> "
1182  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1183  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1184  << fTTBELL << endl;
1185  }
1186  }
1187  else
1188  {
1189  i_entry_fail++;
1190  }
1191  }
1192  CloseRootFile(file_name);
1193  }
1194  else
1195  {
1196  cout << "*TEcnaRead::ReadSampleValuesSameFile(...)> *ERROR* =====> "
1197  << " ROOT file not found" << fTTBELL << endl;
1198  }
1199 
1200  if(i_entry_fail > 0 )
1201  {
1202  cout << "*TEcnaRead::ReadSampleValuesSameFile(...)> *ERROR* =====> "
1203  << " Entry reading failure(s). i_entry_fail = "
1204  << i_entry_fail << fTTBELL << endl;
1205  }
1206  return fT3d_distribs;
1207 }
Double_t *** fT3d_distribs
Definition: TEcnaRead.h:91
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
Int_t fCnew
Definition: TEcnaRead.h:48
CnaResultTyp
Double_t ** fT3d2_distribs
Definition: TEcnaRead.h:92
Double_t * fT3d1_distribs
Definition: TEcnaRead.h:93
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadSigmaOfCorrelationsBetweenSamples ( const Int_t &  VecDim)

Definition at line 2647 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypSigCorss, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetHistoValues(), TEcnaHistos::ViewHistime(), and TEcnaHistos::ViewStex().

2648 {
2649 //Read the Expectation values of the (sample,sample) correlations
2650 //for all the channels of a given Stin
2651 //in the ROOT file and return them in a TVectorD
2652 //
2653 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2654 
2655  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2656  CnaResultTyp typ = cTypSigCorss; // sigma of corss type
2657  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2658 
2659  Bool_t ok_open = kFALSE;
2660  Bool_t ok_read = kFALSE;
2661 
2662  if ( fOpenRootFile )
2663  {
2664  cout << "!TEcnaRead::ReadSigmaOfCorrelationsBetweenSamples(...) *** ERROR ***> "
2665  << "Reading on file already open." << fTTBELL << endl;
2666  }
2667  else
2668  {
2669  ok_open = OpenRootFile(file_name, "READ");
2670 
2671  Int_t i_zero = 0;
2672  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2673 
2674  if ( ok_read == kTRUE )
2675  {
2676  fDataExist = kTRUE;
2677  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2678  {
2679  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2680  }
2681  }
2682  else
2683  {
2684  fDataExist = kFALSE;
2685  cout << "!TEcnaRead::ReadSigmaOfCorrelationsBetweenSamples(...) *** ERROR ***> "
2686  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2687  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2688  << fTTBELL << endl;
2689  }
2690  }
2691 
2692  CloseRootFile(file_name);
2693  return vec;
2694 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadStinNumbers ( const Int_t &  VecDim)

Definition at line 888 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypNumbers, TCnaRootFile::fCnaIndivResult, fCnaWrite, fCodePrintAllComments, fDataExist, fFlagPrint, cmsPerfSuiteHarvest::file_name, fMemoStinNumbers, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fT1d_StexStinFromIndex, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetOkViewHisto(), GetStexStinFromIndex(), GetStinIndex(), LookAtRootFile(), TEcnaRun::ReadEventDistributions(), ReadHighFrequencyCorrelationsBetweenChannels(), ReadHighFrequencyCovariancesBetweenChannels(), ReadHighFrequencyMeanCorrelationsBetweenStins(), ReadLowFrequencyCorrelationsBetweenChannels(), ReadLowFrequencyCovariancesBetweenChannels(), ReadLowFrequencyMeanCorrelationsBetweenStins(), TEcnaHistos::StexHocoVecoLHFCorcc(), TEcnaHistos::ViewMatrix(), and TEcnaHistos::ViewStin().

889 {
890 //Get the Stin numbers and put them in a TVectorD
891 //Read the ROOT file at first call and load in a TVectorD attribute
892 //Get directly the TVectorD attribute at other times
893 //
894 // Possible values for VecDim:
895 // (1) VecDim = fEcal->MaxCrysEcnaInStex()
896 
897  TVectorD vec(VecDim);
898  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
899 
900  if (fMemoStinNumbers == 0)
901  {
903  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
904 
905  //.............. reading of the ROOT file data type TResultTyp = cTypStinsNumbers
906  // to get the conversion: Stin index -> Stin number (n1StexStin)
907 
908  Bool_t ok_open = kFALSE;
909  Bool_t ok_read = kFALSE;
910 
911  if ( fOpenRootFile )
912  {
913  cout << "!TEcnaRead::ReadStinNumbers(...) *** ERROR ***> Reading on file already open."
914  << fTTBELL << endl;
915  }
916  else
917  {
918  ok_open = OpenRootFile(file_name, "READ");
919 
920  Int_t i_zero = 0;
921  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
922 
923  if ( ok_read == kTRUE )
924  {
925  fDataExist = kTRUE;
926  //......... Get the Stin numbers and put them in TVectorD vec()
927  for ( Int_t i_Stin = 0; i_Stin < VecDim; i_Stin++)
928  {
929  vec(i_Stin) = gCnaRootFile->fCnaIndivResult->fMatHis(0,i_Stin);
930  fT1d_StexStinFromIndex[i_Stin] = (Int_t)vec(i_Stin);
931  }
933  }
934  else
935  {
936  fDataExist = kFALSE;
937  cout << "!TEcnaRead::ReadStinNumbers(...) *** ERROR ***> "
938  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
939  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
940  << fTTBELL << endl;
941  }
942  }
943  CloseRootFile(file_name);
944 
945  if( ok_read == kTRUE )
946  {
947  //........................... Print the Stin numbers
949  {
950  for(Int_t i=0; i < VecDim; i++)
951  {
952  cout << "*TEcnaRead::ReadStinNumbers(...)> StinNumber[" << i << "] = "
953  << vec[i] << endl;
954  }
955  }
956  }
957  }
958  else
959  {
960  fDataExist = kTRUE;
961  for ( Int_t i_Stin = 0; i_Stin < VecDim; i_Stin++)
962  {vec(i_Stin) = fT1d_StexStinFromIndex[i_Stin];}
963  }
964 
965  return vec;
966 } // ----------------- ( end of ReadStinNumbers(...) ) -----------------
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
Int_t fMemoStinNumbers
Definition: TEcnaRead.h:71
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRead.h:69
TString fTTBELL
Definition: TEcnaRead.h:51
Int_t fFlagPrint
Definition: TEcnaRead.h:83
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
TVectorD TEcnaRead::ReadTotalNoise ( const Int_t &  VecDim)

Definition at line 2433 of file TEcnaRead.cc.

References CloseRootFile(), gather_cfg::cout, cTypTno, TCnaRootFile::fCnaIndivResult, fCnaWrite, fDataExist, cmsPerfSuiteHarvest::file_name, fOpenRootFile, TEcnaWrite::fRootFileNameShort, fTTBELL, gCnaRootFile, GetTypeOfQuantity(), i, OpenRootFile(), and TCnaRootFile::ReadElement().

Referenced by TEcnaHistos::GetHistoValues(), TEcnaHistos::ViewHistime(), and TEcnaHistos::ViewStex().

2434 {
2435 //Read the expectation values of the sigmas of the samples
2436 //for all the channels of a given Stin
2437 //in the ROOT file and return them in a TVectorD
2438 //
2439 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2440 
2441  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2442  CnaResultTyp typ = cTypTno; // Total noise type
2443  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2444 
2445  Bool_t ok_open = kFALSE;
2446  Bool_t ok_read = kFALSE;
2447 
2448  if ( fOpenRootFile )
2449  {
2450  cout << "!TEcnaRead::ReadTotalNoise(...) *** ERROR ***> "
2451  << "Reading on file already open." << fTTBELL << endl;
2452  }
2453  else
2454  {
2455  ok_open = OpenRootFile(file_name, "READ");
2456 
2457  Int_t i_zero = 0;
2458  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2459 
2460  if ( ok_read == kTRUE )
2461  {
2462  fDataExist = kTRUE;
2463  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2464  {
2465  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2466  }
2467  }
2468  else
2469  {
2470  fDataExist = kFALSE;
2471  cout << "!TEcnaRead::ReadTotalNoise(...) *** ERROR ***> "
2472  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2473  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2474  << fTTBELL << endl;
2475  }
2476  }
2477  CloseRootFile(file_name);
2478  return vec;
2479 }
int i
Definition: DBlmapReader.cc:9
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
CnaResultTyp
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Bool_t ReadElement(Int_t)
TString fTTBELL
Definition: TEcnaRead.h:51
Bool_t fDataExist
Definition: TEcnaRead.h:88
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
void TEcnaRead::SetEcalSubDetector ( const TString  SubDet,
const TEcnaNumbering pEcalNumbering,
const TEcnaWrite pCnaWrite 
)

Definition at line 366 of file TEcnaRead.cc.

References fCnaParCout, fCnaParPaths, fCnaWrite, fEcal, fEcalNumbering, fFlagSubDet, fgMaxCar, fStexName, fStinName, and TEcnaParEcal::GetEcalSubDetector().

Referenced by TEcnaRead().

369 {
370  // Set Subdetector (EB or EE)
371 
372  fEcal = 0; fEcal = new TEcnaParEcal(SubDet.Data()); // Anew("fEcal");
373  Int_t MaxCar = fgMaxCar;
374  fFlagSubDet.Resize(MaxCar);
376 
377  if( fFlagSubDet == "EB" ){fStexName = "SM"; fStinName = "tower";}
378  if( fFlagSubDet == "EE" ){fStexName = "Dee"; fStinName = "SC";}
379 
380  fEcalNumbering = 0;
381  if( pEcalNumbering == 0 )
382  {fEcalNumbering = new TEcnaNumbering(fFlagSubDet.Data(), fEcal); /*Anew("fEcalNumbering")*/ ;}
383  else
384  {fEcalNumbering = (TEcnaNumbering*)pEcalNumbering;}
385 
386  fCnaWrite = 0;
387  if( pCnaWrite == 0 )
388  {fCnaWrite =
389  new TEcnaWrite(fFlagSubDet.Data(), fCnaParPaths, fCnaParCout, fEcal, fEcalNumbering); /*Anew("fCnaWrite")*/ ;}
390  else
391  {fCnaWrite = (TEcnaWrite*)pCnaWrite;}
392 }
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
Int_t fgMaxCar
Definition: TEcnaRead.h:46
TString fStexName
Definition: TEcnaRead.h:62
TEcnaParCout * fCnaParCout
Definition: TEcnaRead.h:53
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRead.h:54
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRead.h:59
TString fFlagSubDet
Definition: TEcnaRead.h:61
TString GetEcalSubDetector()
TString fStinName
Definition: TEcnaRead.h:62

Member Data Documentation

Int_t TEcnaRead::fCdelete
private

Definition at line 49 of file TEcnaRead.h.

Referenced by Adelete(), fCopy(), Init(), and ~TEcnaRead().

TEcnaParCout* TEcnaRead::fCnaParCout
private

Definition at line 53 of file TEcnaRead.h.

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

TEcnaParPaths* TEcnaRead::fCnaParPaths
private

Definition at line 54 of file TEcnaRead.h.

Referenced by SetEcalSubDetector(), and TEcnaRead().

TEcnaWrite* TEcnaRead::fCnaWrite
private
Int_t TEcnaRead::fCnew
private

Definition at line 48 of file TEcnaRead.h.

Referenced by Anew(), fCopy(), Init(), ReadSampleValuesSameFile(), and ~TEcnaRead().

Int_t TEcnaRead::fCodePrintAllComments
private
Int_t TEcnaRead::fCodePrintComments
private

Definition at line 84 of file TEcnaRead.h.

Referenced by fCopy(), GetReadyToReadRootFile(), Init(), PrintComments(), and ~TEcnaRead().

Int_t TEcnaRead::fCodePrintNoComment
private

Definition at line 84 of file TEcnaRead.h.

Referenced by fCopy(), Init(), and PrintNoComment().

Int_t TEcnaRead::fCodePrintWarnings
private

Definition at line 84 of file TEcnaRead.h.

Referenced by fCopy(), Init(), and PrintWarnings().

Bool_t TEcnaRead::fDataExist
private
TEcnaParEcal* TEcnaRead::fEcal
private
TEcnaNumbering* TEcnaRead::fEcalNumbering
private
TEcnaHeader* TEcnaRead::fFileHeader
private
Int_t TEcnaRead::fFlagPrint
private
TString TEcnaRead::fFlagSubDet
private

Definition at line 61 of file TEcnaRead.h.

Referenced by GetTypeOfQuantity(), and SetEcalSubDetector().

Int_t TEcnaRead::fgMaxCar
private

Definition at line 46 of file TEcnaRead.h.

Referenced by Init(), and SetEcalSubDetector().

Int_t TEcnaRead::fLookAtRootFile
private

Definition at line 67 of file TEcnaRead.h.

Referenced by Init(), LookAtRootFile(), and ReadNumberOfEventsForSamples().

Int_t TEcnaRead::fMemoStinNumbers
private

Definition at line 71 of file TEcnaRead.h.

Referenced by GetReadyToReadRootFile(), Init(), and ReadStinNumbers().

Int_t TEcnaRead::fNbChanByLine
private

Definition at line 78 of file TEcnaRead.h.

Int_t TEcnaRead::fNbSampByLine
private

Definition at line 79 of file TEcnaRead.h.

Bool_t TEcnaRead::fOpenRootFile
private
TString TEcnaRead::fPathRoot
private

Definition at line 73 of file TEcnaRead.h.

Referenced by fCopy(), GetReadyToReadRootFile(), Init(), and OpenRootFile().

Int_t TEcnaRead::fReadyToReadRootFile
private

Definition at line 66 of file TEcnaRead.h.

Referenced by GetReadyToReadRootFile(), Init(), and LookAtRootFile().

Int_t TEcnaRead::fSectChanSizeX
private

Definition at line 75 of file TEcnaRead.h.

Referenced by fCopy(), and Init().

Int_t TEcnaRead::fSectChanSizeY
private

Definition at line 75 of file TEcnaRead.h.

Referenced by fCopy(), and Init().

Int_t TEcnaRead::fSectSampSizeX
private

Definition at line 75 of file TEcnaRead.h.

Referenced by fCopy(), and Init().

Int_t TEcnaRead::fSectSampSizeY
private

Definition at line 75 of file TEcnaRead.h.

Referenced by fCopy(), and Init().

TString TEcnaRead::fStexName
private

Definition at line 62 of file TEcnaRead.h.

Referenced by ReadAveragedNumberOfEvents(), and SetEcalSubDetector().

TString TEcnaRead::fStinName
private

Definition at line 62 of file TEcnaRead.h.

Referenced by SetEcalSubDetector().

Int_t* TEcnaRead::fT1d_StexStinFromIndex
private

Definition at line 69 of file TEcnaRead.h.

Referenced by Init(), LookAtRootFile(), ReadStinNumbers(), and ~TEcnaRead().

Double_t* TEcnaRead::fT3d1_distribs
private

Definition at line 93 of file TEcnaRead.h.

Referenced by Init(), ReadSampleValuesSameFile(), and ~TEcnaRead().

Double_t** TEcnaRead::fT3d2_distribs
private

Definition at line 92 of file TEcnaRead.h.

Referenced by Init(), ReadSampleValuesSameFile(), and ~TEcnaRead().

Double_t*** TEcnaRead::fT3d_distribs
private

Definition at line 91 of file TEcnaRead.h.

Referenced by Init(), ReadSampleValuesSameFile(), and ~TEcnaRead().

Int_t* TEcnaRead::fTagStinNumbers
private

Definition at line 70 of file TEcnaRead.h.

Referenced by fCopy(), Init(), LookAtRootFile(), and ~TEcnaRead().

TString TEcnaRead::fTTBELL
private
Int_t TEcnaRead::fUserChan
private

Definition at line 81 of file TEcnaRead.h.

Referenced by fCopy(), and Init().

Int_t TEcnaRead::fUserSamp
private

Definition at line 80 of file TEcnaRead.h.

Referenced by fCopy(), and Init().