CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/src/TEcnaGui.cc

Go to the documentation of this file.
00001 //----------Author's Name: B.Fabbro DSM/IRFU/SPP CEA-Saclay
00002 //----------Copyright: Those valid for CEA sofware
00003 //----------Modified: 13/04/2011
00004 
00005 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaGui.h"
00006 #include <cstdlib>
00007 
00008 //--------------------------------------
00009 //  TEcnaGui.cc
00010 //  Class creation: 03 Dec 2002
00011 //  Documentation: see TEcnaGui.h
00012 //--------------------------------------
00013 
00014 ClassImp(TEcnaGui)
00015 //______________________________________________________________________________
00016 //
00017 
00018   TEcnaGui::~TEcnaGui()
00019 {
00020   //destructor
00021 
00022 #define DEST
00023 #ifdef DEST
00024   // cout << "TEcnaGui> Entering destructor" << endl;
00025   // cout << "            fCnew = " << fCnew << ", fCdelete = " << fCdelete << endl;
00026  
00027   //.... general variables 
00028   //if ( fHistos             != 0 ) {delete fHistos;             fCdelete++;}
00029 
00030   //if ( fCnaParHistos       != 0 ) {delete fCnaParHistos;       fCdelete++;}
00031   //if ( fCnaParPaths        != 0 ) {delete fCnaParPaths;        fCdelete++;}
00032   //if ( fEcalNumbering      != 0 ) {delete fEcalNumbering;      fCdelete++;}
00033   //if ( fEcal               != 0 ) {delete fEcal;               fCdelete++;}
00034 
00035   //.... general frames
00036 
00037   if ( fLayoutGeneral      != 0 ) {delete fLayoutGeneral;      fCdelete++;}
00038   if ( fLayoutBottLeft     != 0 ) {delete fLayoutBottLeft;     fCdelete++;}
00039   if ( fLayoutBottRight    != 0 ) {delete fLayoutBottRight;    fCdelete++;}
00040   if ( fLayoutTopLeft      != 0 ) {delete fLayoutTopLeft;      fCdelete++;}
00041   if ( fLayoutTopRight     != 0 ) {delete fLayoutTopRight;     fCdelete++;}
00042   if ( fLayoutCenterYLeft  != 0 ) {delete fLayoutCenterYLeft;  fCdelete++;}
00043   if ( fLayoutCenterYRight != 0 ) {delete fLayoutCenterYRight; fCdelete++;}
00044   if ( fLayoutCenterXTop   != 0 ) {delete fLayoutCenterXTop;   fCdelete++;}
00045 
00046   if ( fVoidFrame          != 0 ) {delete fVoidFrame;          fCdelete++;}
00047 
00048   //..... specific frames + buttons + menus
00049 
00050   //++++++++++++++++++++++++++++++ Horizontal frame Analysis + First requested evt number + Run number
00051   if ( fAnaNorsRunFrame       != 0 ) {delete fAnaNorsRunFrame;       fCdelete++;}
00052   if ( fLayoutAnaNorsRunFrame != 0 ) {delete fLayoutAnaNorsRunFrame; fCdelete++;}
00053 
00054   //--------------------------------- Sub-Frame Analysis Name (Button+Entry Field)
00055   if ( fAnaFrame       != 0 ) {delete fAnaFrame;       fCdelete++;}
00056   if ( fAnaBut         != 0 ) {delete fAnaBut;         fCdelete++;}
00057   if ( fLayoutAnaBut   != 0 ) {delete fLayoutAnaBut;   fCdelete++;}
00058   if ( fEntryAnaNumber != 0 ) {delete fEntryAnaNumber; fCdelete++;}
00059   if ( fAnaText        != 0 ) {fAnaText->Delete();     fCdelete++;}
00060   if ( fLayoutAnaField != 0 ) {delete fLayoutAnaField; fCdelete++;}
00061 
00062   //------------------- subframe first requested evt number
00063   if ( fFevFrame            != 0 ) {delete fFevFrame;            fCdelete++;}
00064   if ( fFevBut              != 0 ) {delete fFevBut;              fCdelete++;}
00065   if ( fLayoutFevBut        != 0 ) {delete fLayoutFevBut;        fCdelete++;}
00066   if ( fEntryFevNumber      != 0 ) {delete fEntryFevNumber;      fCdelete++;}
00067   if ( fFevText             != 0 ) {fFevText->Delete();          fCdelete++;}  
00068   if ( fLayoutFevFieldText  != 0 ) {delete fLayoutFevFieldText;  fCdelete++;}
00069   if ( fLayoutFevFieldFrame != 0 ) {delete fLayoutFevFieldFrame; fCdelete++;}
00070 
00071   //-------------------------------- Sub-Frame Run number (Button+Entry Field)  
00072   if ( fRunFrame       != 0 ) {delete fRunFrame;           fCdelete++;}
00073   if ( fRunBut         != 0 ) {delete fRunBut;             fCdelete++;}
00074   if ( fLayoutRunBut   != 0 ) {delete fLayoutRunBut;       fCdelete++;}
00075   if ( fEntryRunNumber != 0 ) {delete fEntryRunNumber;     fCdelete++;}
00076   if ( fRunText        != 0 ) {fRunText->Delete();         fCdelete++;}
00077   if ( fLayoutRunField != 0 ) {delete fLayoutRunField;     fCdelete++;}
00078 
00079   //+++++++++++++++++++++++++++++ Horizontal frame Nb Of Samples + last requested events + Clean + Submit
00080   if ( fFevLevStexFrame       != 0 ) {delete fFevLevStexFrame;       fCdelete++;}
00081   if ( fLayoutFevLevStexFrame != 0 ) {delete fLayoutFevLevStexFrame; fCdelete++;}
00082 
00083   //------------------- Sub-Frame Nb of Required Samples (Button+Entry Field)
00084   if ( fNorsFrame          != 0 ) {delete fNorsFrame;          fCdelete++;}
00085   if ( fNorsBut            != 0 ) {delete fNorsBut;            fCdelete++;}
00086   if ( fLayoutNorsBut      != 0 ) {delete fLayoutNorsBut;      fCdelete++;}
00087   if ( fEntryNorsNumber    != 0 ) {delete fEntryNorsNumber;    fCdelete++;}
00088   if ( fNorsText           != 0 ) {fNorsText->Delete();        fCdelete++;}
00089   if ( fLayoutNorsField    != 0 ) {delete fLayoutNorsField;    fCdelete++;}
00090 
00091   //------------------- subframe last requested evt number
00092   if ( fLevFrame            != 0 ) {delete fLevFrame;            fCdelete++;}
00093   if ( fLevBut              != 0 ) {delete fLevBut;              fCdelete++;}
00094   if ( fLayoutLevBut        != 0 ) {delete fLayoutLevBut;        fCdelete++;}
00095   if ( fEntryLevNumber      != 0 ) {delete fEntryLevNumber;      fCdelete++;}
00096   if ( fLevText             != 0 ) {fLevText->Delete();          fCdelete++;}
00097   if ( fLayoutLevFieldText  != 0 ) {delete fLayoutLevFieldText;  fCdelete++;}
00098   if ( fLayoutLevFieldFrame != 0 ) {delete fLayoutLevFieldFrame; fCdelete++;}
00099 
00100   //................................ Menu for Clean
00101   if ( fMenuClean          != 0 ) {delete fMenuClean;          fCdelete++;}
00102   if ( fMenuBarClean       != 0 ) {fMenuBarClean->Delete();    fCdelete++;}
00103   //................................ Menu for Submit jobs on batch system
00104   if ( fMenuSubmit         != 0 ) {delete fMenuSubmit;         fCdelete++;}
00105   if ( fMenuBarSubmit      != 0 ) {fMenuBarSubmit->Delete();   fCdelete++;}
00106 
00107   //+++++++++++++++++++++++++++++++++++++++++++++++++  Horizontal Frame:Stex number + NbOfReqEvts
00108   if ( fCompStRqFrame       != 0 ) {delete fCompStRqFrame;       fCdelete++;}
00109   if ( fLayoutCompStRqFrame != 0 ) {delete fLayoutCompStRqFrame; fCdelete++;}
00110 
00111   //------------------- subframe stex number
00112   if ( fStexFrame            != 0 ) {delete fStexFrame;            fCdelete++;}
00113   if ( fStexBut              != 0 ) {delete fStexBut;              fCdelete++;}
00114   if ( fLayoutStexBut        != 0 ) {delete fLayoutStexBut;        fCdelete++;}
00115   if ( fEntryStexNumber      != 0 ) {delete fEntryStexNumber;      fCdelete++;}
00116   if ( fStexText             != 0 ) {fStexText->Delete();          fCdelete++;}  
00117   if ( fLayoutStexFieldText  != 0 ) {delete fLayoutStexFieldText;  fCdelete++;}
00118   if ( fLayoutStexFieldFrame != 0 ) {delete fLayoutStexFieldFrame; fCdelete++;}
00119 
00120   //------------------- subframe number of requested evts
00121   if ( fRevFrame            != 0 ) {delete fRevFrame;            fCdelete++;}
00122   if ( fRevBut              != 0 ) {delete fRevBut;              fCdelete++;}
00123   if ( fLayoutRevBut        != 0 ) {delete fLayoutRevBut;        fCdelete++;}
00124   if ( fEntryRevNumber      != 0 ) {delete fEntryRevNumber;      fCdelete++;}
00125   if ( fRevText             != 0 ) {fRevText->Delete();          fCdelete++;}
00126   if ( fLayoutRevFieldText  != 0 ) {delete fLayoutRevFieldText;  fCdelete++;}
00127   if ( fLayoutRevFieldFrame != 0 ) {delete fLayoutRevFieldFrame; fCdelete++;}
00128 
00129   //+++++++++++++++++++++++  Horizontal Frame StexStin numbering + Nb Samp for calc + Calculations
00130   if ( fCompStnbFrame       != 0 ) {delete fCompStnbFrame;       fCdelete++;}
00131   if ( fLayoutCompStnbFrame != 0 ) {delete fLayoutCompStnbFrame; fCdelete++;}
00132 
00133   //............................ Stex Stin Numbering view (Button)
00134   if ( fButStexNb           != 0 ) {delete fButStexNb;           fCdelete++;}
00135   if ( fLayoutStexNbBut     != 0 ) {delete fLayoutStexNbBut;     fCdelete++;}
00136   //------------------- subframe NbSampForCalc
00137   if ( fNbSampForCalcFrame            != 0 ) {delete fNbSampForCalcFrame;            fCdelete++;}
00138   if ( fNbSampForCalcBut              != 0 ) {delete fNbSampForCalcBut;              fCdelete++;}
00139   if ( fLayoutNbSampForCalcBut        != 0 ) {delete fLayoutNbSampForCalcBut;        fCdelete++;}
00140   if ( fEntryNbSampForCalcNumber      != 0 ) {delete fEntryNbSampForCalcNumber;      fCdelete++;}
00141   if ( fNbSampForCalcText             != 0 ) {fNbSampForCalcText->Delete();          fCdelete++;}  
00142   if ( fLayoutNbSampForCalcFieldText  != 0 ) {delete fLayoutNbSampForCalcFieldText;  fCdelete++;}
00143   if ( fLayoutNbSampForCalcFieldFrame != 0 ) {delete fLayoutNbSampForCalcFieldFrame; fCdelete++;}
00144   //................................ Menus for CALCULATIONS
00145   if ( fMenuComput          != 0 ) {delete fMenuComput;          fCdelete++;}
00146   if ( fMenuBarComput       != 0 ) {fMenuBarComput->Delete();    fCdelete++;}
00147 
00148   //+++++++++++++++++++++++++++++++++++++++++++ Frame for quantities relative to the Stex 
00149   if ( fStexUpFrame          != 0 ) {delete fStexUpFrame;          fCdelete++;}
00150 
00151   //................................ Menus+Ymin+Ymax for the Stex ............................
00152 
00153   //...................................... Nb of evts in the data
00154 
00155   if ( fVmmD_NOE_ChNbFrame            != 0 ) {delete fVmmD_NOE_ChNbFrame;            fCdelete++;}
00156 
00157   if ( fVmaxD_NOE_ChNbFrame           != 0 ) {delete fVmaxD_NOE_ChNbFrame;           fCdelete++;}
00158   if ( fVmaxD_NOE_ChNbBut             != 0 ) {delete fVmaxD_NOE_ChNbBut;             fCdelete++;}
00159   if ( fLayoutVmaxD_NOE_ChNbBut       != 0 ) {delete fLayoutVmaxD_NOE_ChNbBut;       fCdelete++;}
00160   if ( fEntryVmaxD_NOE_ChNbNumber     != 0 ) {delete fEntryVmaxD_NOE_ChNbNumber;     fCdelete++;}
00161   if ( fVmaxD_NOE_ChNbText            != 0 ) {fVmaxD_NOE_ChNbText->Delete();         fCdelete++;}
00162   if ( fLayoutVmaxD_NOE_ChNbFieldText != 0 ) {delete fLayoutVmaxD_NOE_ChNbFieldText; fCdelete++;}
00163   if ( fLayoutVmaxD_NOE_ChNbFrame     != 0 ) {delete fLayoutVmaxD_NOE_ChNbFrame;     fCdelete++;}
00164 
00165   if ( fVminD_NOE_ChNbFrame           != 0 ) {delete fVminD_NOE_ChNbFrame;           fCdelete++;}
00166   if ( fVminD_NOE_ChNbBut             != 0 ) {delete fVminD_NOE_ChNbBut;             fCdelete++;}
00167   if ( fLayoutVminD_NOE_ChNbBut       != 0 ) {delete fLayoutVminD_NOE_ChNbBut;       fCdelete++;}
00168   if ( fEntryVminD_NOE_ChNbNumber     != 0 ) {delete fEntryVminD_NOE_ChNbNumber;     fCdelete++;}
00169   if ( fVminD_NOE_ChNbText            != 0 ) {fVminD_NOE_ChNbText->Delete();         fCdelete++;}
00170   if ( fLayoutVminD_NOE_ChNbFieldText != 0 ) {delete fLayoutVminD_NOE_ChNbFieldText; fCdelete++;}
00171   if ( fLayoutVminD_NOE_ChNbFrame     != 0 ) {delete fLayoutVminD_NOE_ChNbFrame;     fCdelete++;}
00172 
00173   if ( fMenuD_NOE_ChNb                != 0 ) {delete fMenuD_NOE_ChNb;                fCdelete++;}
00174   if ( fMenuBarD_NOE_ChNb             != 0 ) {fMenuBarD_NOE_ChNb->Delete();          fCdelete++;}
00175   if ( fVminD_NOE_ChNbText            != 0 ) {fVminD_NOE_ChNbText->Delete();         fCdelete++;}
00176 
00177   if ( fLayoutVmmD_NOE_ChNbFrame      != 0 ) {delete fLayoutVmmD_NOE_ChNbFrame;      fCdelete++;}
00178 
00179   //---------------------------------------------------
00180   if ( fVmmD_Ped_ChNbFrame            != 0 ) {delete fVmmD_Ped_ChNbFrame;            fCdelete++;}
00181 
00182   if ( fVmaxD_Ped_ChNbFrame           != 0 ) {delete fVmaxD_Ped_ChNbFrame;           fCdelete++;}
00183   if ( fVmaxD_Ped_ChNbBut             != 0 ) {delete fVmaxD_Ped_ChNbBut;             fCdelete++;}
00184   if ( fLayoutVmaxD_Ped_ChNbBut       != 0 ) {delete fLayoutVmaxD_Ped_ChNbBut;       fCdelete++;}
00185   if ( fVmaxD_Ped_ChNbText            != 0 ) {fVmaxD_Ped_ChNbText->Delete();         fCdelete++;}
00186   if ( fEntryVmaxD_Ped_ChNbNumber     != 0 ) {delete fEntryVmaxD_Ped_ChNbNumber;     fCdelete++;}
00187   if ( fLayoutVmaxD_Ped_ChNbFieldText != 0 ) {delete fLayoutVmaxD_Ped_ChNbFieldText; fCdelete++;}
00188   if ( fLayoutVmaxD_Ped_ChNbFrame     != 0 ) {delete fLayoutVmaxD_Ped_ChNbFrame;     fCdelete++;}
00189 
00190   if ( fVminD_Ped_ChNbFrame           != 0 ) {delete fVminD_Ped_ChNbFrame;           fCdelete++;}
00191   if ( fVminD_Ped_ChNbBut             != 0 ) {delete fVminD_Ped_ChNbBut;             fCdelete++;}
00192   if ( fLayoutVminD_Ped_ChNbBut       != 0 ) {delete fLayoutVminD_Ped_ChNbBut;       fCdelete++;}
00193   if ( fVminD_Ped_ChNbText            != 0 ) {fVminD_Ped_ChNbText->Delete();         fCdelete++;}
00194   if ( fEntryVminD_Ped_ChNbNumber     != 0 ) {delete fEntryVminD_Ped_ChNbNumber;     fCdelete++;}
00195   if ( fLayoutVminD_Ped_ChNbFieldText != 0 ) {delete fLayoutVminD_Ped_ChNbFieldText; fCdelete++;}
00196   if ( fLayoutVminD_Ped_ChNbFrame     != 0 ) {delete fLayoutVminD_Ped_ChNbFrame;     fCdelete++;}
00197 
00198   if ( fMenuD_Ped_ChNb                != 0 ) {delete fMenuD_Ped_ChNb;                fCdelete++;}
00199   if ( fMenuBarD_Ped_ChNb             != 0 ) {fMenuBarD_Ped_ChNb->Delete();          fCdelete++;}
00200   if ( fLayoutMenuBarD_Ped_ChNb       != 0 ) {delete fLayoutMenuBarD_Ped_ChNb;       fCdelete++;}
00201 
00202   if ( fLayoutVmmD_Ped_ChNbFrame      != 0 ) {delete fLayoutVmmD_Ped_ChNbFrame;      fCdelete++;}
00203 
00204   //----------------------------------------------------
00205   if ( fVmmD_TNo_ChNbFrame            != 0 ) {delete fVmmD_TNo_ChNbFrame;            fCdelete++;}
00206 
00207   if ( fVmaxD_TNo_ChNbFrame           != 0 ) {delete fVmaxD_TNo_ChNbFrame;           fCdelete++;}
00208   if ( fVmaxD_TNo_ChNbBut             != 0 ) {delete fVmaxD_TNo_ChNbBut;             fCdelete++;}
00209   if ( fLayoutVmaxD_TNo_ChNbBut       != 0 ) {delete fLayoutVmaxD_TNo_ChNbBut;       fCdelete++;}
00210   if ( fVmaxD_TNo_ChNbText            != 0 ) {fVmaxD_TNo_ChNbText->Delete();         fCdelete++;}
00211   if ( fEntryVmaxD_TNo_ChNbNumber     != 0 ) {delete fEntryVmaxD_TNo_ChNbNumber;     fCdelete++;}
00212   if ( fLayoutVmaxD_TNo_ChNbFieldText != 0 ) {delete fLayoutVmaxD_TNo_ChNbFieldText; fCdelete++;}
00213   if ( fLayoutVmaxD_TNo_ChNbFrame     != 0 ) {delete fLayoutVmaxD_TNo_ChNbFrame;     fCdelete++;}
00214  
00215   if ( fVminD_TNo_ChNbFrame           != 0 ) {delete fVminD_TNo_ChNbFrame;           fCdelete++;}
00216   if ( fVminD_TNo_ChNbBut             != 0 ) {delete fVminD_TNo_ChNbBut;             fCdelete++;}
00217   if ( fLayoutVminD_TNo_ChNbBut       != 0 ) {delete fLayoutVminD_TNo_ChNbBut;       fCdelete++;}
00218   if ( fVminD_TNo_ChNbText            != 0 ) {fVminD_TNo_ChNbText->Delete();         fCdelete++;}
00219   if ( fEntryVminD_TNo_ChNbNumber     != 0 ) {delete fEntryVminD_TNo_ChNbNumber;     fCdelete++;}
00220   if ( fLayoutVminD_TNo_ChNbFieldText != 0 ) {delete fLayoutVminD_TNo_ChNbFieldText; fCdelete++;}
00221   if ( fLayoutVminD_TNo_ChNbFrame     != 0 ) {delete fLayoutVminD_TNo_ChNbFrame;     fCdelete++;}
00222  
00223   if ( fMenuD_TNo_ChNb                != 0 ) {delete fMenuD_TNo_ChNb;                fCdelete++;}
00224   if ( fMenuBarD_TNo_ChNb             != 0 ) {fMenuBarD_TNo_ChNb->Delete();          fCdelete++;}
00225   if ( fLayoutMenuBarD_TNo_ChNb       != 0 ) {delete fLayoutMenuBarD_TNo_ChNb;       fCdelete++;}
00226 
00227   if ( fLayoutVmmD_TNo_ChNbFrame      != 0 ) {delete fLayoutVmmD_TNo_ChNbFrame;      fCdelete++;}
00228 
00229   //-----------------------------------------------------------
00230   if ( fVmmD_MCs_ChNbFrame            != 0 ) {delete fVmmD_MCs_ChNbFrame;            fCdelete++;}
00231 
00232   if ( fVmaxD_MCs_ChNbFrame           != 0 ) {delete fVmaxD_MCs_ChNbFrame;           fCdelete++;}
00233   if ( fVmaxD_MCs_ChNbBut             != 0 ) {delete fVmaxD_MCs_ChNbBut;             fCdelete++;}
00234   if ( fLayoutVmaxD_MCs_ChNbBut       != 0 ) {delete fLayoutVmaxD_MCs_ChNbBut;       fCdelete++;}
00235   if ( fVmaxD_MCs_ChNbText            != 0 ) {fVmaxD_MCs_ChNbText->Delete();         fCdelete++;}
00236   if ( fEntryVmaxD_MCs_ChNbNumber     != 0 ) {delete fEntryVmaxD_MCs_ChNbNumber;     fCdelete++;}
00237   if ( fLayoutVmaxD_MCs_ChNbFieldText != 0 ) {delete fLayoutVmaxD_MCs_ChNbFieldText; fCdelete++;}
00238   if ( fLayoutVmaxD_MCs_ChNbFrame     != 0 ) {delete fLayoutVmaxD_MCs_ChNbFrame;     fCdelete++;}
00239 
00240   if ( fVminD_MCs_ChNbFrame           != 0 ) {delete fVminD_MCs_ChNbFrame;           fCdelete++;}
00241   if ( fVminD_MCs_ChNbBut             != 0 ) {delete fVminD_MCs_ChNbBut;             fCdelete++;}
00242   if ( fLayoutVminD_MCs_ChNbBut       != 0 ) {delete fLayoutVminD_MCs_ChNbBut;       fCdelete++;}
00243   if ( fVminD_MCs_ChNbText            != 0 ) {fVminD_MCs_ChNbText->Delete();         fCdelete++;}
00244   if ( fEntryVminD_MCs_ChNbNumber     != 0 ) {delete fEntryVminD_MCs_ChNbNumber;     fCdelete++;}
00245   if ( fLayoutVminD_MCs_ChNbFieldText != 0 ) {delete fLayoutVminD_MCs_ChNbFieldText; fCdelete++;}
00246   if ( fLayoutVminD_MCs_ChNbFrame     != 0 ) {delete fLayoutVminD_MCs_ChNbFrame;     fCdelete++;}
00247 
00248   if ( fMenuD_MCs_ChNb                != 0 ) {delete fMenuD_MCs_ChNb;                fCdelete++;}
00249   if ( fMenuBarD_MCs_ChNb             != 0 ) {fMenuBarD_MCs_ChNb->Delete();          fCdelete++;}
00250   if ( fLayoutMenuBarD_MCs_ChNb       != 0 ) {delete fLayoutMenuBarD_MCs_ChNb;       fCdelete++;}
00251 
00252   if ( fLayoutVmmD_MCs_ChNbFrame      != 0 ) {delete fLayoutVmmD_MCs_ChNbFrame;      fCdelete++;}
00253   
00254   //............................................... Frame Sig + Menus Sig
00255   if ( fStexHozFrame         != 0 ) {delete fStexHozFrame;         fCdelete++;}
00256 
00257   //------------------------------------------------------------- 
00258   if ( fVmmD_LFN_ChNbFrame            != 0 ) {delete fVmmD_LFN_ChNbFrame;            fCdelete++;}
00259 
00260   if ( fVmaxD_LFN_ChNbFrame           != 0 ) {delete fVmaxD_LFN_ChNbFrame;           fCdelete++;}
00261   if ( fVmaxD_LFN_ChNbBut             != 0 ) {delete fVmaxD_LFN_ChNbBut;             fCdelete++;}
00262   if ( fLayoutVmaxD_LFN_ChNbBut       != 0 ) {delete fLayoutVmaxD_LFN_ChNbBut;       fCdelete++;}
00263   if ( fVmaxD_LFN_ChNbText            != 0 ) {fVmaxD_LFN_ChNbText->Delete();         fCdelete++;}
00264   if ( fEntryVmaxD_LFN_ChNbNumber     != 0 ) {delete fEntryVmaxD_LFN_ChNbNumber;     fCdelete++;}
00265   if ( fLayoutVmaxD_LFN_ChNbFieldText != 0 ) {delete fLayoutVmaxD_LFN_ChNbFieldText; fCdelete++;}
00266   if ( fLayoutVmaxD_LFN_ChNbFrame     != 0 ) {delete fLayoutVmaxD_LFN_ChNbFrame;     fCdelete++;}
00267 
00268   if ( fVminD_LFN_ChNbFrame           != 0 ) {delete fVminD_LFN_ChNbFrame;           fCdelete++;}
00269   if ( fVminD_LFN_ChNbBut             != 0 ) {delete fVminD_LFN_ChNbBut;             fCdelete++;}
00270   if ( fLayoutVminD_LFN_ChNbBut       != 0 ) {delete fLayoutVminD_LFN_ChNbBut;       fCdelete++;}
00271   if ( fVminD_LFN_ChNbText            != 0 ) {fVminD_LFN_ChNbText->Delete();         fCdelete++;}
00272   if ( fEntryVminD_LFN_ChNbNumber     != 0 ) {delete fEntryVminD_LFN_ChNbNumber;     fCdelete++;}
00273   if ( fLayoutVminD_LFN_ChNbFieldText != 0 ) {delete fLayoutVminD_LFN_ChNbFieldText; fCdelete++;}
00274   if ( fLayoutVminD_LFN_ChNbFrame     != 0 ) {delete fLayoutVminD_LFN_ChNbFrame;     fCdelete++;}
00275 
00276   if ( fMenuD_LFN_ChNb                != 0 ) {delete fMenuD_LFN_ChNb;                fCdelete++;}
00277   if ( fMenuBarD_LFN_ChNb             != 0 ) {fMenuBarD_LFN_ChNb->Delete();          fCdelete++;}
00278   if ( fLayoutMenuBarD_LFN_ChNb       != 0 ) {delete fLayoutMenuBarD_LFN_ChNb;       fCdelete++;}
00279 
00280   if ( fLayoutVmmD_LFN_ChNbFrame      != 0 ) {delete fLayoutVmmD_LFN_ChNbFrame;      fCdelete++;}
00281 
00282   //-------------------------------------------------------------
00283   if ( fVmmD_HFN_ChNbFrame            != 0 ) {delete fVmmD_HFN_ChNbFrame;            fCdelete++;}
00284 
00285   if ( fVmaxD_HFN_ChNbFrame           != 0 ) {delete fVmaxD_HFN_ChNbFrame;           fCdelete++;}
00286   if ( fVmaxD_HFN_ChNbBut             != 0 ) {delete fVmaxD_HFN_ChNbBut;             fCdelete++;}
00287   if ( fLayoutVmaxD_HFN_ChNbBut       != 0 ) {delete fLayoutVmaxD_HFN_ChNbBut;       fCdelete++;}
00288   if ( fVmaxD_HFN_ChNbText            != 0 ) {fVmaxD_HFN_ChNbText->Delete();         fCdelete++;}
00289   if ( fEntryVmaxD_HFN_ChNbNumber     != 0 ) {delete fEntryVmaxD_HFN_ChNbNumber;     fCdelete++;}
00290   if ( fLayoutVmaxD_HFN_ChNbFieldText != 0 ) {delete fLayoutVmaxD_HFN_ChNbFieldText; fCdelete++;}
00291   if ( fLayoutVmaxD_HFN_ChNbFrame     != 0 ) {delete fLayoutVmaxD_HFN_ChNbFrame;     fCdelete++;}
00292 
00293   if ( fVminD_HFN_ChNbFrame           != 0 ) {delete fVminD_HFN_ChNbFrame;           fCdelete++;}
00294   if ( fVminD_HFN_ChNbBut             != 0 ) {delete fVminD_HFN_ChNbBut;             fCdelete++;}
00295   if ( fLayoutVminD_HFN_ChNbBut       != 0 ) {delete fLayoutVminD_HFN_ChNbBut;       fCdelete++;}
00296   if ( fVminD_HFN_ChNbText            != 0 ) {fVminD_HFN_ChNbText->Delete();         fCdelete++;}
00297   if ( fEntryVminD_HFN_ChNbNumber     != 0 ) {delete fEntryVminD_HFN_ChNbNumber;     fCdelete++;}
00298   if ( fLayoutVminD_HFN_ChNbFieldText != 0 ) {delete fLayoutVminD_HFN_ChNbFieldText; fCdelete++;}
00299   if ( fLayoutVminD_HFN_ChNbFrame     != 0 ) {delete fLayoutVminD_HFN_ChNbFrame;     fCdelete++;}
00300 
00301   if ( fMenuD_HFN_ChNb                != 0 ) {delete fMenuD_HFN_ChNb;                fCdelete++;}
00302   if ( fMenuBarD_HFN_ChNb             != 0 ) {fMenuBarD_HFN_ChNb->Delete();          fCdelete++;}
00303   if ( fLayoutMenuBarD_HFN_ChNb       != 0 ) {delete fLayoutMenuBarD_HFN_ChNb;       fCdelete++;}
00304 
00305   if ( fLayoutVmmD_HFN_ChNbFrame      != 0 ) {delete fLayoutVmmD_HFN_ChNbFrame;      fCdelete++;}
00306 
00307   //-------------------------------------------------------------
00308   if ( fVmmD_SCs_ChNbFrame            != 0 ) {delete fVmmD_SCs_ChNbFrame;            fCdelete++;}
00309 
00310   if ( fVmaxD_SCs_ChNbFrame           != 0 ) {delete fVmaxD_SCs_ChNbFrame;           fCdelete++;}
00311   if ( fVmaxD_SCs_ChNbBut             != 0 ) {delete fVmaxD_SCs_ChNbBut;             fCdelete++;}
00312   if ( fLayoutVmaxD_SCs_ChNbBut       != 0 ) {delete fLayoutVmaxD_SCs_ChNbBut;       fCdelete++;}
00313   if ( fVmaxD_SCs_ChNbText            != 0 ) {fVmaxD_SCs_ChNbText->Delete();         fCdelete++;}
00314   if ( fEntryVmaxD_SCs_ChNbNumber     != 0 ) {delete fEntryVmaxD_SCs_ChNbNumber;     fCdelete++;}
00315   if ( fLayoutVmaxD_SCs_ChNbFieldText != 0 ) {delete fLayoutVmaxD_SCs_ChNbFieldText; fCdelete++;}
00316   if ( fLayoutVmaxD_SCs_ChNbFrame     != 0 ) {delete fLayoutVmaxD_SCs_ChNbFrame;     fCdelete++;}
00317 
00318   if ( fVminD_SCs_ChNbFrame           != 0 ) {delete fVminD_SCs_ChNbFrame;           fCdelete++;}
00319   if ( fVminD_SCs_ChNbBut             != 0 ) {delete fVminD_SCs_ChNbBut;             fCdelete++;}
00320   if ( fLayoutVminD_SCs_ChNbBut       != 0 ) {delete fLayoutVminD_SCs_ChNbBut;       fCdelete++;}
00321   if ( fVminD_SCs_ChNbText            != 0 ) {fVminD_SCs_ChNbText->Delete();         fCdelete++;}
00322   if ( fEntryVminD_SCs_ChNbNumber     != 0 ) {delete fEntryVminD_SCs_ChNbNumber;     fCdelete++;}
00323   if ( fLayoutVminD_SCs_ChNbFieldText != 0 ) {delete fLayoutVminD_SCs_ChNbFieldText; fCdelete++;}
00324   if ( fLayoutVminD_SCs_ChNbFrame     != 0 ) {delete fLayoutVminD_SCs_ChNbFrame;     fCdelete++;}
00325 
00326   if ( fMenuD_SCs_ChNb                != 0 ) {delete fMenuD_SCs_ChNb;                fCdelete++;}
00327   if ( fMenuBarD_SCs_ChNb             != 0 ) {fMenuBarD_SCs_ChNb->Delete();          fCdelete++;}
00328   if ( fLayoutMenuBarD_SCs_ChNb       != 0 ) {delete fLayoutMenuBarD_SCs_ChNb;       fCdelete++;}
00329 
00330   if ( fLayoutVmmD_SCs_ChNbFrame      != 0 ) {delete fLayoutVmmD_SCs_ChNbFrame;      fCdelete++;}
00331   //-------------------------------------------------------------
00332   if ( fLayoutStexHozFrame          != 0 ) {delete fLayoutStexHozFrame;          fCdelete++;}
00333 
00334   //----------------------------------------------------------------------------------------------
00335 
00336   //...................................... Covariances between Stins
00337   if ( fVmmLHFccFrame            != 0 ) {delete fVmmLHFccFrame;            fCdelete++;}
00338 
00339   if ( fVmaxLHFccFrame           != 0 ) {delete fVmaxLHFccFrame;           fCdelete++;}
00340   if ( fVmaxLHFccBut             != 0 ) {delete fVmaxLHFccBut;             fCdelete++;}
00341   if ( fLayoutVmaxLHFccBut       != 0 ) {delete fLayoutVmaxLHFccBut;       fCdelete++;}
00342   if ( fVmaxLHFccText            != 0 ) {fVmaxLHFccText->Delete();         fCdelete++;}
00343   if ( fEntryVmaxLHFccNumber     != 0 ) {delete fEntryVmaxLHFccNumber;     fCdelete++;}
00344   if ( fLayoutVmaxLHFccFieldText != 0 ) {delete fLayoutVmaxLHFccFieldText; fCdelete++;}
00345   if ( fLayoutVmaxLHFccFrame     != 0 ) {delete fLayoutVmaxLHFccFrame;     fCdelete++;}
00346 
00347   if ( fVminLHFccFrame           != 0 ) {delete fVminLHFccFrame;           fCdelete++;}
00348   if ( fVminLHFccBut             != 0 ) {delete fVminLHFccBut;             fCdelete++;}
00349   if ( fLayoutVminLHFccBut       != 0 ) {delete fLayoutVminLHFccBut;       fCdelete++;}
00350   if ( fVminLHFccText            != 0 ) {fVminLHFccText->Delete();         fCdelete++;}
00351   if ( fEntryVminLHFccNumber     != 0 ) {delete fEntryVminLHFccNumber;     fCdelete++;}
00352   if ( fLayoutVminLHFccFieldText != 0 ) {delete fLayoutVminLHFccFieldText; fCdelete++;}
00353   if ( fLayoutVminLHFccFrame     != 0 ) {delete fLayoutVminLHFccFrame;     fCdelete++;}
00354 
00355   if ( fMenuLHFcc             != 0 ) {delete fMenuLHFcc;             fCdelete++;}
00356   if ( fMenuBarLHFcc          != 0 ) {fMenuBarLHFcc->Delete();       fCdelete++;}
00357   if ( fLayoutMenuBarLHFcc    != 0 ) {delete fLayoutMenuBarLHFcc;    fCdelete++;}
00358 
00359   if ( fLayoutVmmLHFccFrame      != 0 ) {delete fLayoutVmmLHFccFrame;      fCdelete++;}
00360 
00361   //...................................... Low Freq Cor(c,c') for each pair of Stins  
00362   if ( fVmmLFccMosFrame            != 0 ) {delete fVmmLFccMosFrame;            fCdelete++;}
00363 
00364   if ( fVmaxLFccMosFrame           != 0 ) {delete fVmaxLFccMosFrame;           fCdelete++;}
00365   if ( fVmaxLFccMosBut             != 0 ) {delete fVmaxLFccMosBut;             fCdelete++;}
00366   if ( fLayoutVmaxLFccMosBut       != 0 ) {delete fLayoutVmaxLFccMosBut;       fCdelete++;}
00367   if ( fVmaxLFccMosText            != 0 ) {fVmaxLFccMosText->Delete();         fCdelete++;}
00368   if ( fEntryVmaxLFccMosNumber     != 0 ) {delete fEntryVmaxLFccMosNumber;     fCdelete++;}
00369   if ( fLayoutVmaxLFccMosFieldText != 0 ) {delete fLayoutVmaxLFccMosFieldText; fCdelete++;}
00370   if ( fLayoutVmaxLFccMosFrame     != 0 ) {delete fLayoutVmaxLFccMosFrame;     fCdelete++;}
00371 
00372   if ( fVminLFccMosFrame           != 0 ) {delete fVminLFccMosFrame;           fCdelete++;}
00373   if ( fVminLFccMosBut             != 0 ) {delete fVminLFccMosBut;             fCdelete++;}
00374   if ( fLayoutVminLFccMosBut       != 0 ) {delete fLayoutVminLFccMosBut;       fCdelete++;}
00375   if ( fVminLFccMosText            != 0 ) {fVminLFccMosText->Delete();         fCdelete++;}
00376   if ( fEntryVminLFccMosNumber     != 0 ) {delete fEntryVminLFccMosNumber;     fCdelete++;}
00377   if ( fLayoutVminLFccMosFieldText != 0 ) {delete fLayoutVminLFccMosFieldText; fCdelete++;}
00378   if ( fLayoutVminLFccMosFrame     != 0 ) {delete fLayoutVminLFccMosFrame;     fCdelete++;}
00379 
00380   if ( fMenuLFccMos                  != 0 ) {delete fMenuLFccMos;                  fCdelete++;}
00381   if ( fMenuBarLFccMos               != 0 ) {fMenuBarLFccMos->Delete();            fCdelete++;}
00382   if ( fLayoutMenuBarLFccMos         != 0 ) {delete fLayoutMenuBarLFccMos;         fCdelete++;}
00383 
00384   if ( fLayoutVmmLFccMosFrame      != 0 ) {delete fLayoutVmmLFccMosFrame;      fCdelete++;}
00385 
00386   //...................................... High Freq Cor(c,c') for each pair of Stins  
00387   if ( fVmmHFccMosFrame            != 0 ) {delete fVmmHFccMosFrame;            fCdelete++;}
00388 
00389   if ( fVmaxHFccMosFrame           != 0 ) {delete fVmaxHFccMosFrame;           fCdelete++;}
00390   if ( fVmaxHFccMosBut             != 0 ) {delete fVmaxHFccMosBut;             fCdelete++;}
00391   if ( fLayoutVmaxHFccMosBut       != 0 ) {delete fLayoutVmaxHFccMosBut;       fCdelete++;}
00392   if ( fVmaxHFccMosText            != 0 ) {fVmaxHFccMosText->Delete();         fCdelete++;}
00393   if ( fEntryVmaxHFccMosNumber     != 0 ) {delete fEntryVmaxHFccMosNumber;     fCdelete++;}
00394   if ( fLayoutVmaxHFccMosFieldText != 0 ) {delete fLayoutVmaxHFccMosFieldText; fCdelete++;}
00395   if ( fLayoutVmaxHFccMosFrame     != 0 ) {delete fLayoutVmaxHFccMosFrame;     fCdelete++;}
00396 
00397   if ( fVminHFccMosFrame           != 0 ) {delete fVminHFccMosFrame;           fCdelete++;}
00398   if ( fVminHFccMosBut             != 0 ) {delete fVminHFccMosBut;             fCdelete++;}
00399   if ( fLayoutVminHFccMosBut       != 0 ) {delete fLayoutVminHFccMosBut;       fCdelete++;}
00400   if ( fVminHFccMosText            != 0 ) {fVminHFccMosText->Delete();         fCdelete++;}
00401   if ( fEntryVminHFccMosNumber     != 0 ) {delete fEntryVminHFccMosNumber;     fCdelete++;}
00402   if ( fLayoutVminHFccMosFieldText != 0 ) {delete fLayoutVminHFccMosFieldText; fCdelete++;}
00403   if ( fLayoutVminHFccMosFrame     != 0 ) {delete fLayoutVminHFccMosFrame;     fCdelete++;}
00404 
00405   if ( fMenuHFccMos                != 0 ) {delete fMenuHFccMos;                fCdelete++;}
00406   if ( fMenuBarHFccMos             != 0 ) {fMenuBarHFccMos->Delete();          fCdelete++;}
00407   if ( fLayoutMenuBarHFccMos       != 0 ) {delete fLayoutMenuBarHFccMos;       fCdelete++;}
00408 
00409   if ( fLayoutVmmHFccMosFrame      != 0 ) {delete fLayoutVmmHFccMosFrame;      fCdelete++;}
00410 
00411   if ( fLayoutStexUpFrame          != 0 ) {delete fLayoutStexUpFrame;          fCdelete++;}
00412 
00413   //+++++++++++++++++++++++++++++++++++++++++ Horizontal frame Stin_A + Stin_B
00414   if ( fStinSpFrame       != 0 ) {delete fStinSpFrame;         fCdelete++;}
00415   
00416   //----------------------------------- SubFrame Stin_A (Button + EntryField)
00417   if ( fTxSubFrame        != 0 ) {delete fTxSubFrame;          fCdelete++;}
00418 
00419   if ( fStinAFrame        != 0 ) {delete fStinAFrame;          fCdelete++;}
00420   if ( fStinABut          != 0 ) {delete fStinABut;            fCdelete++;}
00421   if ( fLayoutStinABut    != 0 ) {delete fLayoutStinABut;      fCdelete++;} 
00422   if ( fEntryStinANumber  != 0 ) {delete fEntryStinANumber;    fCdelete++;}
00423   if ( fStinAText         != 0 ) {fStinAText->Delete();        fCdelete++;} 
00424   if ( fLayoutStinAField  != 0 ) {delete fLayoutStinAField;    fCdelete++;} 
00425 
00426   //............................ Stin Crystal Numbering view (Button)
00427   if ( fButChNb          != 0 ) {delete fButChNb;            fCdelete++;}
00428   if ( fLayoutChNbBut    != 0 ) {delete fLayoutChNbBut;      fCdelete++;} 
00429 
00430   //............................ Menus Stin_A
00431   if ( fMenuCorssAll     != 0 ) {delete fMenuCorssAll;       fCdelete++;}
00432   if ( fMenuBarCorssAll  != 0 ) {fMenuBarCorssAll->Delete(); fCdelete++;}
00433 
00434   //if ( fMenuCovssAll     != 0 ) {delete fMenuCovssAll;       fCdelete++;}
00435   //if ( fMenuBarCovssAll  != 0 ) {fMenuBarCovssAll->Delete(); fCdelete++;}
00436 
00437   if ( fLayoutTxSubFrame != 0 ) {delete fLayoutTxSubFrame;   fCdelete++;}
00438 
00439   //----------------------------------- SubFrame Stin_B (Button + EntryField)
00440 
00441   if ( fTySubFrame        != 0 ) {delete fTySubFrame;        fCdelete++;}
00442 
00443   if ( fStinBFrame        != 0 ) {delete fStinBFrame;        fCdelete++;}
00444   if ( fStinBBut          != 0 ) {delete fStinBBut;          fCdelete++;}
00445   if ( fLayoutStinBBut    != 0 ) {delete fLayoutStinBBut;    fCdelete++;}
00446   if ( fEntryStinBNumber  != 0 ) {delete fEntryStinBNumber;  fCdelete++;}
00447   if ( fStinBText         != 0 ) {fStinBText->Delete();      fCdelete++;}
00448   if ( fLayoutStinBField  != 0 ) {delete fLayoutStinBField;  fCdelete++;}
00449 
00450   if ( fLayoutTySubFrame  != 0 ) {delete fLayoutTySubFrame;  fCdelete++;}
00451 
00452   if ( fLayoutStinSpFrame != 0 ) {delete fLayoutStinSpFrame; fCdelete++;}
00453 
00454   //.................................. Menus for Horizontal frame (Stin_A + Stin_B)
00455 
00456   if ( fMenuLFCorcc     != 0 ) {delete fMenuLFCorcc;        fCdelete++;}
00457   if ( fMenuBarLFCorcc  != 0 ) {fMenuBarLFCorcc->Delete();  fCdelete++;}
00458 
00459   if ( fMenuHFCorcc     != 0 ) {delete fMenuHFCorcc;        fCdelete++;}
00460   if ( fMenuBarHFCorcc  != 0 ) {fMenuBarHFCorcc->Delete();  fCdelete++;}
00461 
00462   //++++++++++++++++++++++++ Horizontal frame channel number (Stin_A crystal number) + sample number
00463   if ( fChSpFrame        != 0 ) {delete fChSpFrame;         fCdelete++;}
00464 
00465   //------------------------------------- SubFrame Channel (Button + EntryField)
00466 
00467   if ( fChSubFrame       != 0 ) {delete fChSubFrame;        fCdelete++;}
00468 
00469   if ( fChanFrame        != 0 ) {delete fChanFrame;         fCdelete++;}
00470   if ( fChanBut          != 0 ) {delete fChanBut;           fCdelete++;}
00471   if ( fLayoutChanBut    != 0 ) {delete fLayoutChanBut;     fCdelete++;}
00472   if ( fEntryChanNumber  != 0 ) {delete fEntryChanNumber;   fCdelete++;}
00473   if ( fChanText         != 0 ) {fChanText->Delete();       fCdelete++;}
00474   if ( fLayoutChanField  != 0 ) {delete fLayoutChanField;   fCdelete++;}
00475 
00476   //................................ Menus Stin_A crystal number
00477   if ( fMenuCorss        != 0 ) {delete fMenuCorss;         fCdelete++;}
00478   if ( fMenuBarCorss     != 0 ) {fMenuBarCorss->Delete();   fCdelete++;}
00479 
00480   if ( fMenuCovss        != 0 ) {delete fMenuCovss;         fCdelete++;}
00481   if ( fMenuBarCovss     != 0 ) {fMenuBarCovss->Delete();   fCdelete++;}
00482 
00483   if ( fMenuD_MSp_SpNb    != 0 ) {delete fMenuD_MSp_SpNb;       fCdelete++;}
00484   if ( fMenuBarD_MSp_SpNb != 0 ) {fMenuBarD_MSp_SpNb->Delete(); fCdelete++;}
00485   if ( fMenuD_MSp_SpDs    != 0 ) {delete fMenuD_MSp_SpDs;       fCdelete++;}
00486   if ( fMenuBarD_MSp_SpDs != 0 ) {fMenuBarD_MSp_SpDs->Delete(); fCdelete++;}
00487 
00488   if ( fMenuD_SSp_SpNb    != 0 ) {delete fMenuD_SSp_SpNb;       fCdelete++;}
00489   if ( fMenuBarD_SSp_SpNb != 0 ) {fMenuBarD_SSp_SpNb->Delete(); fCdelete++;}
00490   if ( fMenuD_SSp_SpDs    != 0 ) {delete fMenuD_SSp_SpDs;       fCdelete++;}
00491   if ( fMenuBarD_SSp_SpDs != 0 ) {fMenuBarD_SSp_SpDs->Delete(); fCdelete++;}
00492 
00493   if ( fLayoutChSubFrame != 0 ) {delete fLayoutChSubFrame;  fCdelete++;}
00494 
00495   //------------------------------------ SubFrame Sample (Button + EntryField)
00496   if ( fSpSubFrame       != 0 ) {delete fSpSubFrame;        fCdelete++;}
00497   if ( fSampFrame        != 0 ) {delete fSampFrame;         fCdelete++;}
00498   if ( fSampBut          != 0 ) {delete fSampBut;           fCdelete++;}
00499   if ( fLayoutSampBut    != 0 ) {delete fLayoutSampBut;     fCdelete++;}
00500   if ( fEntrySampNumber  != 0 ) {delete fEntrySampNumber;   fCdelete++;}
00501   if ( fSampText         != 0 ) {fSampText->Delete();       fCdelete++;}
00502   if ( fLayoutSampField  != 0 ) {delete fLayoutSampField;   fCdelete++;}
00503   if ( fLayoutSpSubFrame != 0 ) {delete fLayoutSpSubFrame;  fCdelete++;}
00504 
00505   //................................ Menus Sample number
00506 
00507   //     (no menu in this SubFrame)
00508 
00509   if ( fLayoutChSpFrame  != 0 ) {delete fLayoutChSpFrame;   fCdelete++;}
00510 
00511   //++++++++++++++++++++++++++++++++++++ Menu Event Distribution
00512   if ( fMenuAdcProj            != 0 ) {delete fMenuAdcProj;            fCdelete++;}
00513   if ( fMenuBarAdcProj         != 0 ) {fMenuBarAdcProj->Delete();      fCdelete++;}
00514   if ( fLayoutMenuBarAdcProj   != 0 ) {delete fLayoutMenuBarAdcProj;   fCdelete++;}
00515 
00516   //++++++++++++++++++++++++++++++++++++ Frame: Run List (Rul) (Button + EntryField)
00517   if ( fRulFrame            != 0 ) {delete fRulFrame;            fCdelete++;}
00518   if ( fRulBut              != 0 ) {delete fRulBut;              fCdelete++;}
00519   if ( fLayoutRulBut        != 0 ) {delete fLayoutRulBut;        fCdelete++;}
00520   if ( fEntryRulNumber      != 0 ) {delete fEntryRulNumber;      fCdelete++;}
00521   if ( fRulText             != 0 ) {fRulText->Delete();          fCdelete++;}
00522   if ( fLayoutRulFieldText  != 0 ) {delete fLayoutRulFieldText;  fCdelete++;}
00523   if ( fLayoutRulFieldFrame != 0 ) {delete fLayoutRulFieldFrame; fCdelete++;}
00524 
00525   //................................ Menus for time evolution
00526   if ( fMenuHistory         != 0 ) {delete fMenuHistory;         fCdelete++;}
00527   if ( fMenuBarHistory      != 0 ) {fMenuBarHistory->Delete();   fCdelete++;}
00528 
00529   //++++++++++++++++++++++++++++++++++++ LinLog Frame
00530   if ( fLinLogFrame   != 0 ) {delete fLinLogFrame;   fCdelete++;}
00531 
00532   //---------------------------------- Lin/Log X
00533   if ( fButLogx         != 0 ) {delete fButLogx;         fCdelete++;}
00534   if ( fLayoutLogxBut   != 0 ) {delete fLayoutLogxBut;   fCdelete++;}
00535   //---------------------------------- Lin/Log Y
00536   if ( fButLogy         != 0 ) {delete fButLogy;         fCdelete++;}
00537   if ( fLayoutLogyBut   != 0 ) {delete fLayoutLogyBut;   fCdelete++;} 
00538   //---------------------------------- Proj Y
00539   if ( fButProjy        != 0 ) {delete fButProjy;        fCdelete++;}
00540   if ( fLayoutProjyBut  != 0 ) {delete fLayoutProjyBut;  fCdelete++;} 
00541 
00542   //++++++++++++++++++++++++++++++++++++ Frame: General Title (Gent) (Button + EntryField)
00543   if ( fGentFrame            != 0 ) {delete fGentFrame;            fCdelete++;}
00544   if ( fGentBut              != 0 ) {delete fGentBut;              fCdelete++;}
00545   if ( fLayoutGentBut        != 0 ) {delete fLayoutGentBut;        fCdelete++;}
00546   if ( fEntryGentNumber      != 0 ) {delete fEntryGentNumber;      fCdelete++;}
00547   if ( fGentText             != 0 ) {fGentText->Delete();          fCdelete++;}
00548   if ( fLayoutGentFieldText  != 0 ) {delete fLayoutGentFieldText;  fCdelete++;}
00549   if ( fLayoutGentFieldFrame != 0 ) {delete fLayoutGentFieldFrame; fCdelete++;}
00550 
00551   //++++++++++++++++++++++++++++++++++++ Color + EXIT BUTTON
00552   if ( fColorExitFrame       != 0 ) {delete fColorExitFrame;       fCdelete++;}
00553   if ( fLayoutColorExitFrame != 0 ) {delete fLayoutColorExitFrame; fCdelete++;}
00554 
00555   //---------------------------------- Color Palette
00556   if ( fButColPal       != 0 ) {delete fButColPal;       fCdelete++;}
00557   if ( fLayoutColPalBut != 0 ) {delete fLayoutColPalBut; fCdelete++;}
00558   //---------------------------------- Exit
00559   if ( fButExit       != 0 ) {delete fButExit;       fCdelete++;}
00560   if ( fLayoutExitBut != 0 ) {delete fLayoutExitBut; fCdelete++;}
00561  
00562   //++++++++++++++++++++++++++++++++++++ Last Frame
00563   if ( fLastFrame     != 0 ) {delete fLastFrame;     fCdelete++;}
00564 
00565   //--------------------------------- Clone Last Canvas (Button)
00566   if ( fButClone       != 0 ) {delete fButClone;       fCdelete++;}
00567   if ( fLayoutCloneBut != 0 ) {delete fLayoutCloneBut; fCdelete++;}
00568 
00569   //--------------------------------- Root version (Button)
00570   if ( fButRoot       != 0 ) {delete fButRoot;       fCdelete++;}
00571   if ( fLayoutRootBut != 0 ) {delete fLayoutRootBut; fCdelete++;}
00572 
00573   //--------------------------------- Help (Button)
00574   if ( fButHelp       != 0 ) {delete fButHelp;       fCdelete++;}
00575   if ( fLayoutHelpBut != 0 ) {delete fLayoutHelpBut; fCdelete++;}
00576 
00577   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00578 
00579   if ( fCnew != fCdelete )
00580     {
00581       cout << "*TEcnaGui> WRONG MANAGEMENT OF ALLOCATIONS: fCnew = "
00582            << fCnew << ", fCdelete = " << fCdelete << endl;
00583     }
00584   else
00585     {
00586       //cout << "*TEcnaGui> BRAVO! GOOD MANAGEMENT OF ALLOCATIONS: fCnew = "
00587       //   << fCnew << ", fCdelete = " << fCdelete << endl;
00588     }
00589 
00590 #endif // DEST
00591 
00592 #define MGRA
00593 #ifndef MGRA
00594   if ( fCnewRoot != fCdeleteRoot )
00595     {
00596       cout << "*TEcnaGui> WRONG MANAGEMENT OF ROOT ALLOCATIONS: fCnewRoot = "
00597            << fCnewRoot << ", fCdeleteRoot = " << fCdeleteRoot << endl;
00598     }
00599   else
00600     {
00601       cout << "*TEcnaGui> BRAVO! GOOD MANAGEMENT OF ROOT ALLOCATIONS:"
00602            << " fCnewRoot = " << fCnewRoot <<", fCdeleteRoot = "
00603            << fCdeleteRoot << endl;
00604     }
00605 #endif // MGRA
00606 
00607   // cout << "TEcnaGui> Leaving destructor" << endl;
00608   // cout << "            fCnew = " << fCnew << ", fCdelete = " << fCdelete << endl;
00609 
00610   // cout << "[Info Management] CLASS: TEcnaGui.           DESTROY OBJECT: this = " << this << endl;
00611 
00612 }
00613 //   end of destructor
00614 
00615 //===================================================================
00616 //
00617 //                   Constructors
00618 //
00619 //===================================================================
00620 
00621 TEcnaGui::TEcnaGui()
00622 {
00623   Init();
00624 }
00625 
00626 TEcnaGui::TEcnaGui(TEcnaObject* pObjectManager, const TString SubDet, const TGWindow *p, UInt_t w, UInt_t h):
00627 TGMainFrame(p, w, h) 
00628 {
00629   // cout << "[Info Management] CLASS: TEcnaGui.           CREATE OBJECT: this = " << this << endl;
00630 
00631   // cout << "TEcnaGui> Entering constructor with arguments" << endl;
00632   // cout << "            fCnew = " << fCnew << ", fCdelete = " << fCdelete << endl;
00633 
00634   fObjectManager = (TEcnaObject*)pObjectManager;
00635   Long_t i_this = (Long_t)this;
00636   pObjectManager->RegisterPointer("TEcnaGui", i_this);
00637 
00638   Int_t MaxCar = fgMaxCar;
00639   fSubDet.Resize(MaxCar); 
00640   fSubDet = SubDet.Data();
00641 
00642   //............................ fCnaParCout
00643   fCnaParCout = 0;
00644   Long_t iCnaParCout = pObjectManager->GetPointerValue("TEcnaParCout");
00645   if( iCnaParCout == 0 )
00646     {fCnaParCout = new TEcnaParCout(pObjectManager); /*fCnew++*/}
00647   else
00648     {fCnaParCout = (TEcnaParCout*)iCnaParCout;}
00649 
00650   //fCnaParPaths = 0; fCnaParPaths = new TEcnaParPaths();                        //fCnew++;
00651   //fCnaParPaths->GetPaths();
00652   //if( fCnaParPaths->GetPaths() == kTRUE )
00653   // {
00654   //fCnaParPaths->GetCMSSWParameters();
00655 
00656   //............................ fCnaParPaths
00657   fCnaParPaths = 0;
00658   Long_t iCnaParPaths = pObjectManager->GetPointerValue("TEcnaParPaths");
00659   if( iCnaParPaths == 0 )
00660     {fCnaParPaths = new TEcnaParPaths(pObjectManager); /*fCnew++*/}
00661   else
00662     {fCnaParPaths = (TEcnaParPaths*)iCnaParPaths;}
00663 
00664   fCnaParPaths->GetPaths();
00665   fCnaParPaths->GetCMSSWParameters();
00666 
00667   //............................ fEcal  => to be changed in fParEcal
00668   fEcal = 0;
00669   Long_t iParEcal = pObjectManager->GetPointerValue("TEcnaParEcal");
00670   if( iParEcal == 0 )
00671     {fEcal = new TEcnaParEcal(pObjectManager, SubDet.Data()); /*fCnew++*/}
00672   else
00673     {fEcal = (TEcnaParEcal*)iParEcal;}
00674 
00675   //............................ fEcalNumbering
00676   fEcalNumbering = 0;
00677   Long_t iEcalNumbering = pObjectManager->GetPointerValue("TEcnaNumbering");
00678   if( iEcalNumbering == 0 )
00679     {fEcalNumbering = new TEcnaNumbering(pObjectManager, SubDet.Data()); /*fCnew++*/}
00680   else
00681     {fEcalNumbering = (TEcnaNumbering*)iEcalNumbering;}
00682 
00683   //............................ fCnaParHistos
00684   fCnaParHistos = 0;
00685   Long_t iCnaParHistos = pObjectManager->GetPointerValue("TEcnaParHistos");
00686   if( iCnaParHistos == 0 )
00687     {fCnaParHistos = new TEcnaParHistos(pObjectManager, SubDet.Data()); /*fCnew++*/}
00688   else
00689     {fCnaParHistos = (TEcnaParHistos*)iCnaParHistos;}
00690 
00691   //............................ fCnaWrite
00692   fCnaWrite = 0;
00693   Long_t iCnaWrite = pObjectManager->GetPointerValue("TEcnaWrite");
00694   if( iCnaWrite == 0 )
00695     {fCnaWrite = new TEcnaWrite(pObjectManager, SubDet.Data()); /*fCnew++*/}
00696   else
00697     {fCnaWrite = (TEcnaWrite*)iCnaWrite;}
00698 
00699   //............................ fHistos
00700   //fHistos     = 0;
00701   //fHistos = new TEcnaHistos(fSubDet.Data(), fCnaParPaths, fCnaParCout,
00702   //                          fEcal, fCnaParHistos, fEcalNumbering, fCnaWrite);       fCnew++;
00703 
00704   fHistos = 0;
00705   Long_t iHistos = pObjectManager->GetPointerValue("TEcnaHistos");
00706   if( iHistos == 0 )
00707     {fHistos = new TEcnaHistos(pObjectManager, SubDet.Data()); /*fCnew++*/}
00708   else
00709     {fHistos = (TEcnaHistos*)iHistos;}
00710 
00711   //fMyRootFile = 0;
00712 
00713   Init();
00714 }
00715 
00716 void TEcnaGui::Init()
00717 {
00718   //========================= GENERAL INITIALISATION 
00719   fCnew        = 0;
00720   fCdelete     = 0;
00721   fCnewRoot    = 0;
00722   fCdeleteRoot = 0;
00723 
00724 
00725   Int_t fgMaxCar = (Int_t)512;
00726   fTTBELL = '\007';
00727 
00728   //........................ init View and Cna parameters
00729 
00730   //............................................................................
00731 
00732   if( fSubDet == "EB" ){fStexName = "SM";  fStinName = "tower";}
00733   if( fSubDet == "EE" ){fStexName = "Dee"; fStinName = "SC";}
00734 
00735   //................. Init Keys
00736   InitKeys();
00737 
00738   //................ Init CNA Command and error numbering
00739   fCnaCommand = 0;
00740   fCnaError   = 0;
00741   //................ Init Confirm flags
00742   fConfirmSubmit    = 0;
00743   fConfirmRunNumber = 0;
00744   fConfirmCalcScc   = 0;
00745 
00746   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Init GUI DIALOG BOX pointers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00747 
00748   fLayoutGeneral      = 0;
00749   fLayoutBottLeft     = 0;
00750   fLayoutBottRight    = 0;
00751   fLayoutTopLeft      = 0;
00752   fLayoutTopRight     = 0;  
00753   fLayoutCenterYLeft  = 0;
00754   fLayoutCenterYRight = 0; 
00755 
00756   fVoidFrame = 0;
00757 
00758   //+++++++++++++++++++++++++++++++++ Horizontal frame Analysis + 1st requested evt number + Run number
00759   fAnaNorsRunFrame       = 0;
00760   fLayoutAnaNorsRunFrame = 0;
00761   //--------------------------------- Sub-Frame Analysis Name (Button+Entry Field)
00762   fAnaFrame       = 0;
00763   fAnaBut         = 0;
00764   fLayoutAnaBut   = 0;
00765   fAnaText        = 0;
00766   fEntryAnaNumber = 0;
00767   fLayoutAnaField = 0;
00768   //--------------------------------- SubFrame: first requested evt number
00769   fFevFrame            = 0;
00770   fFevBut              = 0;
00771   fLayoutFevBut        = 0;
00772   fFevText             = 0;
00773   fEntryFevNumber      = 0;
00774   fLayoutFevFieldText  = 0;
00775   fLayoutFevFieldFrame = 0;
00776   //-------------------------------- Sub-Frame Run number (Button+Entry Field)  
00777   fRunFrame       = 0;  
00778   fRunBut         = 0;
00779   fLayoutRunBut   = 0;
00780   fRunText        = 0;
00781   fEntryRunNumber = 0;
00782   fLayoutRunField = 0;
00783 
00784   //+++++++++++++++++++++++++ Horizontal frame Nb Of Samples + Last requested evt number + Clean + submit
00785   fFevLevStexFrame       = 0;
00786   fLayoutFevLevStexFrame = 0;
00787   //-------------------------------- Sub-Frame: Nb Of Requesred Samples (Button+Entry Field)  
00788   fNorsFrame       = 0;
00789   fNorsBut         = 0;
00790   fLayoutNorsBut   = 0;
00791   fNorsText        = 0;
00792   fEntryNorsNumber = 0;
00793   fLayoutNorsField = 0;
00794   //---------------------------- SubFrame: last requested event number
00795   fLevFrame            = 0;
00796   fLevBut              = 0;
00797   fLayoutLevBut        = 0;
00798   fLevText             = 0;
00799   fEntryLevNumber      = 0;
00800   fLayoutLevFieldText  = 0;
00801   fLayoutLevFieldFrame = 0;
00802   //................................ Menu for Clean
00803   fMenuClean    = 0;
00804   fMenuBarClean = 0;
00805   //................................ Menu for SUBMIT
00806   fMenuSubmit    = 0;
00807   fMenuBarSubmit = 0;
00808 
00809   //+++++++++++++++++++++++++++++++++++ Horizontal frame StexStin number +  Nb of Req evts
00810   fCompStRqFrame       = 0;
00811   fLayoutCompStRqFrame = 0;
00812 
00813   //---------------------------- SubFrame: Stex number
00814   fStexFrame            = 0;
00815   fStexBut              = 0;
00816   fLayoutStexBut        = 0;
00817   fStexText             = 0;
00818   fEntryStexNumber      = 0;
00819   fLayoutStexFieldText  = 0;
00820   fLayoutStexFieldFrame = 0;
00821 
00822   //---------------------------- SubFrame: number of requested events
00823   fRevFrame            = 0;
00824   fRevBut              = 0;
00825   fLayoutRevBut        = 0;
00826   fRevText             = 0;
00827   fEntryRevNumber      = 0;
00828   fLayoutRevFieldText  = 0;
00829   fLayoutRevFieldFrame = 0;
00830 
00831   //+++++++++++++++++++++++++++++++++++ Horizontal frame StexStin numbering +  Nb of samp for Calc + Calculations
00832   fCompStnbFrame       = 0;
00833   fLayoutCompStnbFrame = 0;
00834 
00835   //................................ Stex Stin Numbering view (Button)
00836   fButStexNb       = 0;
00837   fLayoutStexNbBut = 0;
00838 
00839   //---------------------------- SubFrame: NbSampForCalc
00840   fNbSampForCalcFrame            = 0;
00841   fNbSampForCalcBut              = 0;
00842   fLayoutNbSampForCalcBut        = 0;
00843   fNbSampForCalcText             = 0;
00844   fEntryNbSampForCalcNumber      = 0;
00845   fLayoutNbSampForCalcFieldText  = 0;
00846   fLayoutNbSampForCalcFieldFrame = 0;
00847 
00848   //................................ Menu for Calculations
00849   fMenuComput    = 0;
00850   fMenuBarComput = 0;
00851 
00852   //=====================================================================================
00853 
00854   //+++++++++++++++++++++++++++++++++++++++++++ Frame for quantities relative to the Stex
00855   fStexUpFrame       = 0; 
00856 
00857   //................................ Menus+Ymin+Ymax for the Stex ............................
00858 
00859   //...................................... Nb of evts in the data
00860   fVmmD_NOE_ChNbFrame       = 0;
00861 
00862   fVmaxD_NOE_ChNbFrame           = 0;
00863   fVmaxD_NOE_ChNbBut             = 0;
00864   fLayoutVmaxD_NOE_ChNbBut       = 0;
00865   fVmaxD_NOE_ChNbText            = 0;
00866   fEntryVmaxD_NOE_ChNbNumber     = 0;
00867   fLayoutVmaxD_NOE_ChNbFieldText = 0;
00868   fLayoutVmaxD_NOE_ChNbFrame     = 0;
00869 
00870   fVminD_NOE_ChNbFrame           = 0;
00871   fVminD_NOE_ChNbBut             = 0;
00872   fLayoutVminD_NOE_ChNbBut       = 0;
00873   fVminD_NOE_ChNbText            = 0;
00874   fEntryVminD_NOE_ChNbNumber     = 0;
00875   fLayoutVminD_NOE_ChNbFieldText = 0;
00876   fLayoutVminD_NOE_ChNbFrame     = 0;
00877 
00878   fMenuD_NOE_ChNb           = 0;
00879   fMenuBarD_NOE_ChNb        = 0;
00880   fLayoutMenuBarD_NOE_ChNb  = 0;
00881 
00882   fLayoutVmmD_NOE_ChNbFrame = 0;
00883 
00884   //-------------------------------------------------------------
00885   fVmmD_Ped_ChNbFrame       = 0;
00886 
00887   fVmaxD_Ped_ChNbFrame           = 0;
00888   fVmaxD_Ped_ChNbBut             = 0;
00889   fLayoutVmaxD_Ped_ChNbBut       = 0;
00890   fVmaxD_Ped_ChNbText            = 0;
00891   fEntryVmaxD_Ped_ChNbNumber     = 0;
00892   fLayoutVmaxD_Ped_ChNbFieldText = 0;
00893   fLayoutVmaxD_Ped_ChNbFrame     = 0;
00894 
00895   fVminD_Ped_ChNbFrame           = 0;
00896   fVminD_Ped_ChNbBut             = 0;
00897   fLayoutVminD_Ped_ChNbBut       = 0;
00898   fVminD_Ped_ChNbText            = 0;
00899   fEntryVminD_Ped_ChNbNumber     = 0;
00900   fLayoutVminD_Ped_ChNbFieldText = 0;
00901   fLayoutVminD_Ped_ChNbFrame     = 0;
00902 
00903   fMenuD_Ped_ChNb          = 0;
00904   fMenuBarD_Ped_ChNb       = 0;
00905   fLayoutMenuBarD_Ped_ChNb = 0;
00906 
00907   fLayoutVmmD_Ped_ChNbFrame = 0;
00908 
00909   //-------------------------------------------------------------
00910   fVmmD_TNo_ChNbFrame       = 0;
00911 
00912   fVmaxD_TNo_ChNbFrame           = 0;
00913   fVmaxD_TNo_ChNbBut             = 0;
00914   fLayoutVmaxD_TNo_ChNbBut       = 0;
00915   fVmaxD_TNo_ChNbText            = 0;
00916   fEntryVmaxD_TNo_ChNbNumber     = 0;
00917   fLayoutVmaxD_TNo_ChNbFieldText = 0;
00918 
00919   fVminD_TNo_ChNbFrame           = 0;
00920   fVminD_TNo_ChNbBut             = 0;
00921   fLayoutVminD_TNo_ChNbBut       = 0;
00922   fVminD_TNo_ChNbText            = 0;
00923   fEntryVminD_TNo_ChNbNumber     = 0;
00924   fLayoutVminD_TNo_ChNbFieldText = 0;
00925   fLayoutVminD_TNo_ChNbFrame     = 0;
00926 
00927   fMenuD_TNo_ChNb          = 0;
00928   fMenuBarD_TNo_ChNb       = 0;
00929   fLayoutMenuBarD_TNo_ChNb = 0;
00930   fLayoutVmaxD_TNo_ChNbFrame = 0;
00931 
00932   fLayoutVmmD_TNo_ChNbFrame = 0;
00933 
00934   //-------------------------------------------------------------
00935   fVmmD_MCs_ChNbFrame       = 0;
00936 
00937   fVmaxD_MCs_ChNbFrame           = 0;
00938   fVmaxD_MCs_ChNbBut             = 0;
00939   fLayoutVmaxD_MCs_ChNbBut       = 0;
00940   fVmaxD_MCs_ChNbText            = 0;
00941   fEntryVmaxD_MCs_ChNbNumber     = 0;
00942   fLayoutVmaxD_MCs_ChNbFieldText = 0;
00943   fLayoutVmaxD_MCs_ChNbFrame     = 0;
00944 
00945   fVminD_MCs_ChNbFrame           = 0;
00946   fVminD_MCs_ChNbBut             = 0;
00947   fLayoutVminD_MCs_ChNbBut       = 0;
00948   fVminD_MCs_ChNbText            = 0;
00949   fEntryVminD_MCs_ChNbNumber     = 0;
00950   fLayoutVminD_MCs_ChNbFieldText = 0;
00951   fLayoutVminD_MCs_ChNbFrame     = 0;
00952 
00953   fMenuD_MCs_ChNb          = 0;
00954   fMenuBarD_MCs_ChNb       = 0;
00955   fLayoutMenuBarD_MCs_ChNb = 0;
00956   fLayoutVmmD_MCs_ChNbFrame = 0;
00957 
00958   //............................................... Frame Sig + Menus Sig
00959   fStexHozFrame       = 0; 
00960 
00961   //-------------------------------------------------------------
00962   fVmmD_LFN_ChNbFrame       = 0;
00963 
00964   fVmaxD_LFN_ChNbFrame           = 0;
00965   fVmaxD_LFN_ChNbBut             = 0;
00966   fLayoutVmaxD_LFN_ChNbBut       = 0;
00967   fVmaxD_LFN_ChNbText            = 0;
00968   fEntryVmaxD_LFN_ChNbNumber     = 0;
00969   fLayoutVmaxD_LFN_ChNbFieldText = 0;
00970   fLayoutVmaxD_LFN_ChNbFrame     = 0;
00971 
00972   fVminD_LFN_ChNbFrame           = 0;
00973   fVminD_LFN_ChNbBut             = 0;
00974   fLayoutVminD_LFN_ChNbBut       = 0;
00975   fVminD_LFN_ChNbText            = 0;
00976   fEntryVminD_LFN_ChNbNumber     = 0;
00977   fLayoutVminD_LFN_ChNbFieldText = 0;
00978   fLayoutVminD_LFN_ChNbFrame     = 0;
00979 
00980   fMenuD_LFN_ChNb          = 0;
00981   fMenuBarD_LFN_ChNb       = 0;
00982   fLayoutMenuBarD_LFN_ChNb = 0;
00983 
00984   fLayoutVmmD_LFN_ChNbFrame = 0;
00985 
00986   //-------------------------------------------------------------
00987   fVmmD_HFN_ChNbFrame       = 0;
00988 
00989   fVmaxD_HFN_ChNbFrame           = 0;
00990   fVmaxD_HFN_ChNbBut             = 0;
00991   fLayoutVmaxD_HFN_ChNbBut       = 0;
00992   fVmaxD_HFN_ChNbText            = 0;
00993   fEntryVmaxD_HFN_ChNbNumber     = 0;
00994   fLayoutVmaxD_HFN_ChNbFieldText = 0;
00995   fLayoutVmaxD_HFN_ChNbFrame     = 0;
00996 
00997   fVminD_HFN_ChNbFrame           = 0;
00998   fVminD_HFN_ChNbBut             = 0;
00999   fLayoutVminD_HFN_ChNbBut       = 0;
01000   fVminD_HFN_ChNbText            = 0;
01001   fEntryVminD_HFN_ChNbNumber     = 0;
01002   fLayoutVminD_HFN_ChNbFieldText = 0;
01003   fLayoutVminD_HFN_ChNbFrame     = 0;
01004 
01005   fMenuD_HFN_ChNb          = 0; 
01006   fMenuBarD_HFN_ChNb       = 0;
01007   fLayoutMenuBarD_HFN_ChNb = 0;
01008 
01009   fLayoutVmmD_HFN_ChNbFrame = 0;
01010 
01011   //-------------------------------------------------------------
01012   fVmmD_SCs_ChNbFrame       = 0;
01013 
01014   fVmaxD_SCs_ChNbFrame           = 0;
01015   fVmaxD_SCs_ChNbBut             = 0;
01016   fLayoutVmaxD_SCs_ChNbBut       = 0;
01017   fVmaxD_SCs_ChNbText            = 0;
01018   fEntryVmaxD_SCs_ChNbNumber     = 0;
01019   fLayoutVmaxD_SCs_ChNbFieldText = 0;
01020   fLayoutVmaxD_SCs_ChNbFrame     = 0;
01021 
01022   fVminD_SCs_ChNbFrame           = 0;
01023   fVminD_SCs_ChNbBut             = 0;
01024   fLayoutVminD_SCs_ChNbBut       = 0;
01025   fVminD_SCs_ChNbText            = 0;
01026   fEntryVminD_SCs_ChNbNumber     = 0;
01027   fLayoutVminD_SCs_ChNbFieldText = 0;
01028   fLayoutVminD_SCs_ChNbFrame     = 0;
01029 
01030   fMenuD_SCs_ChNb          = 0;
01031   fMenuBarD_SCs_ChNb       = 0;
01032   fLayoutMenuBarD_SCs_ChNb = 0;
01033 
01034   fLayoutVmmD_SCs_ChNbFrame = 0;
01035 
01036   //----------------------------------------------------------------------------------
01037 
01038   //...................................... Low Freq Cor(c,c') for each pair of  Stins
01039   fVmmLFccMosFrame       = 0;
01040 
01041   fVmaxLFccMosFrame           = 0;
01042   fVmaxLFccMosBut             = 0;
01043   fLayoutVmaxLFccMosBut       = 0;
01044   fVmaxLFccMosText            = 0;
01045   fEntryVmaxLFccMosNumber     = 0;
01046   fLayoutVmaxLFccMosFieldText = 0;
01047   fLayoutVmaxLFccMosFrame     = 0;
01048 
01049   fVminLFccMosFrame           = 0;
01050   fVminLFccMosBut             = 0;
01051   fLayoutVminLFccMosBut       = 0;
01052   fVminLFccMosText            = 0;
01053   fEntryVminLFccMosNumber     = 0;
01054   fLayoutVminLFccMosFieldText = 0;
01055   fLayoutVminLFccMosFrame     = 0;
01056 
01057   fMenuLFccMos          = 0;
01058   fMenuBarLFccMos       = 0;
01059   fLayoutMenuBarLFccMos = 0;
01060 
01061   fLayoutVmmLFccMosFrame = 0;
01062 
01063   //...................................... High Freq Cor(c,c') for each pair of  Stins
01064   fVmmHFccMosFrame       = 0;
01065 
01066   fVmaxHFccMosFrame           = 0;
01067   fVmaxHFccMosBut             = 0;
01068   fLayoutVmaxHFccMosBut       = 0;
01069   fVmaxHFccMosText            = 0;
01070   fEntryVmaxHFccMosNumber     = 0;
01071   fLayoutVmaxHFccMosFieldText = 0;
01072   fLayoutVmaxHFccMosFrame     = 0;
01073 
01074   fVminHFccMosFrame           = 0;
01075   fVminHFccMosBut             = 0;
01076   fLayoutVminHFccMosBut       = 0;
01077   fVminHFccMosText            = 0;
01078   fEntryVminHFccMosNumber     = 0;
01079   fLayoutVminHFccMosFieldText = 0;
01080   fLayoutVminHFccMosFrame     = 0;
01081 
01082   fMenuHFccMos          = 0;
01083   fMenuBarHFccMos       = 0;
01084   fLayoutMenuBarHFccMos = 0;
01085 
01086   fLayoutVmmHFccMosFrame = 0;
01087 
01088   //...................................... LF and HF Cor(c,c')
01089   fVmmLHFccFrame            = 0;
01090 
01091   fVmaxLHFccFrame           = 0;
01092   fVmaxLHFccBut             = 0;
01093   fLayoutVmaxLHFccBut       = 0;
01094   fVmaxLHFccText            = 0;
01095   fEntryVmaxLHFccNumber     = 0;
01096   fLayoutVmaxLHFccFieldText = 0;
01097   fLayoutVmaxLHFccFrame     = 0;
01098 
01099   fVminLHFccFrame           = 0;
01100   fVminLHFccBut             = 0;
01101   fLayoutVminLHFccBut       = 0;
01102   fVminLHFccText            = 0;
01103   fEntryVminLHFccNumber     = 0;
01104   fLayoutVminLHFccFieldText = 0;
01105   fLayoutVminLHFccFrame     = 0;
01106 
01107   fMenuLHFcc          = 0;
01108   fMenuBarLHFcc       = 0;
01109   fLayoutMenuBarLHFcc = 0;
01110 
01111   fLayoutVmmLHFccFrame = 0;
01112 
01113   fLayoutStexHozFrame = 0;
01114 
01115   fLayoutStexUpFrame = 0;
01116 
01117   //+++++++++++++++++++++++++++++++++++++++++ Horizontal frame Stin_A + Stin_B
01118   fStinSpFrame      = 0;
01119   fLayoutStinSpFrame = 0;
01120   
01121   //----------------------------------- SubFrame Stin_A (Button + EntryField)
01122 
01123   fTxSubFrame       = 0; 
01124   fLayoutTxSubFrame = 0;
01125 
01126   fStinAFrame     = 0;
01127   fStinABut       = 0;
01128   fLayoutStinABut = 0; 
01129 
01130   fStinAText        = 0;
01131   fEntryStinANumber = 0; 
01132   fLayoutStinAField = 0;
01133   
01134   //............................ Stin Crystal Numbering view (Button)
01135   fButChNb       = 0;
01136   fLayoutChNbBut = 0;
01137 
01138   //............................ Menus Stin_A
01139   fMenuCorssAll    = 0;
01140   fMenuBarCorssAll = 0;
01141 
01142   //fMenuCovssAll    = 0;
01143   //fMenuBarCovssAll = 0;
01144 
01145   //----------------------------------- SubFrame Stin_B (Button + EntryField)
01146   fTySubFrame       = 0;
01147   fLayoutTySubFrame = 0;
01148 
01149   fStinBFrame     = 0;
01150   fStinBBut       = 0;
01151   fLayoutStinBBut = 0;
01152 
01153   fStinBText        = 0;  
01154   fEntryStinBNumber = 0;
01155   fLayoutStinBField = 0;
01156 
01157   //.................................. Menus for Horizontal frame (Stin_A + Stin_B)
01158   fMenuBarLFCorcc = 0;
01159   fMenuLFCorcc    = 0; 
01160 
01161   fMenuBarHFCorcc = 0;  
01162   fMenuHFCorcc    = 0;
01163 
01164   //++++++++++++++++++++++++ Horizontal frame channel number (Stin_A crystal number) + sample number
01165   fChSpFrame       = 0;
01166   fLayoutChSpFrame = 0;
01167 
01168   //------------------------------------- SubFrame Channel (Button + EntryField)
01169   fChanFrame       = 0;
01170   fChanBut         = 0;
01171   fChanText        = 0;
01172   fEntryChanNumber = 0;
01173   fLayoutChanBut   = 0;
01174   fLayoutChanField = 0;
01175 
01176   fChSubFrame       = 0;
01177   fLayoutChSubFrame = 0;
01178 
01179   //................................ Menus Stin_A crystal number
01180   fMenuCorss    = 0;
01181   fMenuBarCorss = 0;
01182 
01183   fMenuCovss    = 0; 
01184   fMenuBarCovss = 0;
01185 
01186   fMenuD_MSp_SpNb    = 0;
01187   fMenuBarD_MSp_SpNb = 0;
01188   fMenuD_MSp_SpDs    = 0;
01189   fMenuBarD_MSp_SpDs = 0;
01190 
01191   fMenuD_SSp_SpNb    = 0;
01192   fMenuBarD_SSp_SpNb = 0;
01193   fMenuD_SSp_SpDs    = 0;
01194   fMenuBarD_SSp_SpDs = 0;
01195 
01196   //------------------------------------ SubFrame Sample (Button + EntryField)
01197   fSampFrame = 0;
01198   fSampBut   = 0;
01199 
01200   fSampText        = 0;  
01201   fEntrySampNumber = 0;
01202   fLayoutSampBut   = 0;
01203   fLayoutSampField = 0;
01204 
01205   fSpSubFrame       = 0;
01206   fLayoutSpSubFrame = 0;
01207 
01208   //................................ Menus Sample number
01209 
01210   //     (no menu in this SubFrame)
01211 
01212   //++++++++++++++++++++++++++++++++++++ Frame: Run List (Rul) (Button + EntryField)
01213   fRulFrame            = 0;
01214   fRulBut              = 0;
01215   fLayoutRulBut        = 0;
01216   fRulText             = 0;
01217   fEntryRulNumber      = 0;
01218   fLayoutRulFieldText  = 0;
01219   fLayoutRulFieldFrame = 0;
01220 
01221   //................................ Menus for time evolution
01222   fMenuHistory    = 0;
01223   fMenuBarHistory = 0;
01224 
01225   //++++++++++++++++++++++++++++++++++++ Menu Event Distribution
01226   fMenuAdcProj          = 0;
01227   fMenuBarAdcProj       = 0;
01228   fLayoutMenuBarAdcProj = 0;
01229 
01230   //++++++++++++++++++++++++++++++++++++ LinLog + Color Palette Frame
01231   fLinLogFrame = 0;  
01232 
01233   //---------------------------------- Lin/Log X
01234   fButLogx         = 0;
01235   fLayoutLogxBut   = 0;
01236   //---------------------------------- Lin/Log Y
01237   fButLogy         = 0;
01238   fLayoutLogyBut   = 0;
01239   //---------------------------------- Proj Y
01240   fButProjy        = 0;
01241   fLayoutProjyBut  = 0;
01242 
01243   //++++++++++++++++++++++++++++++++++++ Frame: General Title (Gent) (Button + EntryField)
01244   fGentFrame            = 0;
01245   fGentBut              = 0;
01246   fLayoutGentBut        = 0;
01247   fGentText             = 0;
01248   fEntryGentNumber      = 0;
01249   fLayoutGentFieldText  = 0;
01250   fLayoutGentFieldFrame = 0;
01251 
01252   //++++++++++++++++++++++++++++++++++++ Color + Exit
01253   //---------------------------------- Color Palette
01254   fButColPal       = 0;
01255   fLayoutColPalBut = 0;
01256   //---------------------------------- Exit
01257   fButExit       = 0;   
01258   fLayoutExitBut = 0;
01259 
01260   //++++++++++++++++++++++++++++++++++++ Last Frame
01261   fLastFrame = 0;   
01262 
01263   //--------------------------------- Clone Last Canvas (Button)
01264   fButClone       = 0;
01265   fLayoutCloneBut = 0;
01266 
01267   //--------------------------------- Root version (Button)
01268   fButRoot       = 0;
01269   fLayoutRootBut = 0;
01270 
01271   //--------------------------------- Help (Button)
01272   fButHelp       = 0;
01273   fLayoutHelpBut = 0;
01274 
01275   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end of init GUI DIALOG BOX pointers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01276 
01277   //........ Init Buttons codes with input widgets:
01278   //         run, channel, sample
01279 
01280   fAnaButC  = 1;
01281   fRunButC  = 2;
01282 
01283   //.................. Init codes Menu bars (all the numbers must be different)
01284 
01285   fMenuSubmit8nmC  = 2011;
01286   fMenuSubmit1nhC  = 2012;
01287   fMenuSubmit8nhC  = 2013;
01288   fMenuSubmit1ndC  = 2014;
01289   fMenuSubmit1nwC  = 2015;
01290 
01291   fMenuCleanSubC  = 3011;
01292   fMenuCleanJobC  = 3012;
01293   fMenuCleanPythC = 3013;
01294   fMenuCleanAllC  = 3014;
01295 
01296   fMenuComputStdC = 3111;
01297   fMenuComputSccC = 3112;
01298   fMenuComputSttC = 3113;
01299 
01300   fMenuD_NOE_ChNbFullC      = 600101;
01301   fMenuD_NOE_ChNbSameC      = 600102;
01302   fMenuD_NOE_ChNbAsciiFileC = 600104;
01303 
01304   fMenuD_Ped_ChNbFullC      = 123051;
01305   fMenuD_Ped_ChNbSameC      = 123052;
01306   fMenuD_Ped_ChNbAsciiFileC = 123054;
01307 
01308   fMenuD_TNo_ChNbFullC      = 123061;
01309   fMenuD_TNo_ChNbSameC      = 123062;
01310   fMenuD_TNo_ChNbSamePC     = 123063;
01311   fMenuD_TNo_ChNbAsciiFileC = 123064;
01312 
01313   fMenuD_MCs_ChNbFullC      = 123071;
01314   fMenuD_MCs_ChNbSameC      = 123072;
01315   fMenuD_MCs_ChNbSamePC     = 123073;
01316   fMenuD_MCs_ChNbAsciiFileC = 123074;
01317 
01318   fMenuD_LFN_ChNbFullC      = 800051;
01319   fMenuD_LFN_ChNbSameC      = 800052;
01320   fMenuD_LFN_ChNbSamePC     = 800053;
01321   fMenuD_LFN_ChNbAsciiFileC = 800054;
01322 
01323   fMenuD_HFN_ChNbFullC      = 800061;
01324   fMenuD_HFN_ChNbSameC      = 800062;
01325   fMenuD_HFN_ChNbSamePC     = 800063;
01326   fMenuD_HFN_ChNbAsciiFileC = 800064;
01327 
01328   fMenuD_SCs_ChNbFullC      = 800071;
01329   fMenuD_SCs_ChNbSameC      = 800072;
01330   fMenuD_SCs_ChNbSamePC     = 800073;
01331   fMenuD_SCs_ChNbAsciiFileC = 800074;
01332 
01333   fMenuLFccColzC = 70010;
01334   fMenuLFccLegoC = 70011;
01335   fMenuHFccColzC = 70020;
01336   fMenuHFccLegoC = 70021;
01337 
01338   fMenuLFccMosColzC = 70110;
01339   fMenuLFccMosLegoC = 70111;
01340   fMenuHFccMosColzC = 70120;
01341   fMenuHFccMosLegoC = 70121;
01342 
01343   fMenuD_NOE_ChNbHocoVecoC = 524051;
01344   fMenuD_Ped_ChNbHocoVecoC = 524052;
01345   fMenuD_TNo_ChNbHocoVecoC = 524053;
01346   fMenuD_MCs_ChNbHocoVecoC = 524054;
01347   fMenuD_LFN_ChNbHocoVecoC = 524055;
01348   fMenuD_HFN_ChNbHocoVecoC = 524056;
01349   fMenuD_SCs_ChNbHocoVecoC = 524057;
01350 
01351   fStinAButC = 90009; 
01352   fStinBButC = 90010;
01353 
01354   fChanButC = 6;
01355   fSampButC = 7;
01356 
01357   fMenuCorssAllColzC = 10;
01358   fMenuCovssAllColzC = 11;
01359  
01360   fMenuCorssColzC      = 221;
01361   fMenuCorssBoxC       = 222;
01362   fMenuCorssTextC      = 223;
01363   fMenuCorssContzC     = 224;
01364   fMenuCorssLegoC      = 225;
01365   fMenuCorssSurf1C     = 226;
01366   fMenuCorssSurf2C     = 227;
01367   fMenuCorssSurf3C     = 228;
01368   fMenuCorssSurf4C     = 229;
01369   fMenuCorssAsciiFileC = 220;
01370 
01371   fMenuCovssColzC      = 231;
01372   fMenuCovssBoxC       = 232;
01373   fMenuCovssTextC      = 233;
01374   fMenuCovssContzC     = 234;
01375   fMenuCovssLegoC      = 235;
01376   fMenuCovssSurf1C     = 236;
01377   fMenuCovssSurf2C     = 237;
01378   fMenuCovssSurf3C     = 238;
01379   fMenuCovssSurf4C     = 239;
01380   fMenuCovssAsciiFileC = 230;
01381  
01382   fMenuD_MSp_SpNbLineFullC    = 411;
01383   fMenuD_MSp_SpNbLineSameC    = 412;
01384   fMenuD_MSp_SpNbLineAllStinC = 413;
01385   fMenuD_MSp_SpDsLineFullC    = 414;
01386   fMenuD_MSp_SpDsLineSameC    = 415;
01387   fMenuD_MSp_SpDsLineAllStinC = 416;
01388 
01389   fMenuD_SSp_SpNbLineFullC    = 421;
01390   fMenuD_SSp_SpNbLineSameC    = 422;
01391   fMenuD_SSp_SpNbLineAllStinC = 423;
01392   fMenuD_SSp_SpDsLineFullC    = 424;
01393   fMenuD_SSp_SpDsLineSameC    = 425;
01394   fMenuD_SSp_SpDsLineAllStinC = 426;
01395 
01396   fMenuLFCorccColzC = 51;
01397   fMenuLFCorccLegoC = 52;
01398 
01399   fMenuHFCorccColzC = 61;
01400   fMenuHFCorccLegoC = 62;
01401   
01402   fMenuAdcProjSampLineFullC = 711;
01403   fMenuAdcProjSampLineSameC = 712;
01404   fMenuAdcProjLineLinyFullC = 713;
01405   fMenuAdcProjLineLinySameC = 714;
01406 
01407   fMenuH_Ped_DatePolmFullC = 811;
01408   fMenuH_Ped_DatePolmSameC = 812;
01409 
01410   fMenuH_TNo_DatePolmFullC  = 821;
01411   fMenuH_TNo_DatePolmSameC  = 822;
01412   fMenuH_TNo_DatePolmSamePC = 823;
01413 
01414   fMenuH_LFN_DatePolmFullC  = 824;
01415   fMenuH_LFN_DatePolmSameC  = 825;
01416   fMenuH_LFN_DatePolmSamePC = 826;
01417 
01418   fMenuH_HFN_DatePolmFullC  = 827;
01419   fMenuH_HFN_DatePolmSameC  = 828;
01420   fMenuH_HFN_DatePolmSamePC = 829;
01421 
01422   fMenuH_MCs_DatePolmFullC  = 831;
01423   fMenuH_MCs_DatePolmSameC  = 832;
01424   fMenuH_MCs_DatePolmSamePC = 833;
01425 
01426   fMenuH_SCs_DatePolmFullC  = 841;
01427   fMenuH_SCs_DatePolmSameC  = 842;
01428   fMenuH_SCs_DatePolmSamePC = 843;
01429 
01430   //...................... Init Button codes: Root version, Help, Exit
01431   fButStexNbC = 90;
01432   fButChNbC   = 91;
01433   fButCloneC  = 95;
01434   fButRootC   = 96;
01435   fButHelpC   = 97;
01436   fButExitC   = 98;
01437 
01438   //=================================== LIN/LOG + Y proj + Color palette flags
01439   Int_t MaxCar = fgMaxCar;
01440   fMemoScaleX.Resize(MaxCar);   
01441   fMemoScaleX = "LIN";
01442 
01443   MaxCar = fgMaxCar;
01444   fMemoScaleY.Resize(MaxCar); 
01445   fMemoScaleY = "LIN";
01446 
01447   MaxCar = fgMaxCar;
01448   fMemoProjY.Resize(MaxCar); 
01449   fMemoProjY = "normal";
01450 
01451   MaxCar = fgMaxCar;
01452   fMemoColPal.Resize(MaxCar); 
01453   fMemoColPal = "ECCNAColor";
01454 
01455   //=================================== Init option codes =================================
01456 
01457   MaxCar = fgMaxCar;
01458   fOptPlotFull.Resize(MaxCar);
01459   fOptPlotFull = "ONLYONE";
01460 
01461   MaxCar = fgMaxCar;
01462   fOptPlotSame.Resize(MaxCar);
01463   fOptPlotSame = "SAME";
01464 
01465   MaxCar = fgMaxCar;
01466   fOptPlotSameP.Resize(MaxCar);
01467   fOptPlotSameP = "SAME n";
01468 
01469   MaxCar = fgMaxCar;
01470   fOptPlotSameInStin.Resize(MaxCar);
01471   fOptPlotSameInStin = "SAME in Stin";
01472 
01473   MaxCar = fgMaxCar;
01474   fOptAscii.Resize(MaxCar);
01475   fOptAscii = "ASCII";
01476 
01477 }  // end of Init()
01478 
01479 
01480 
01481 //================================================================================================
01482 
01483 //-------------------------------------------------------------------------
01484 //
01485 //
01486 //                      B O X     M A K I N G
01487 //
01488 //
01489 //-------------------------------------------------------------------------
01490 
01491 void TEcnaGui::DialogBox()
01492 {
01493   // Gui box making
01494 
01495   //fCnaP = (TGWindow *)p;
01496   //fCnaW = w;
01497   //fCnaH = h;
01498 
01499   //......................... Background colors
01500 
01501   //TColor* my_color = new TColor();
01502   //Color_t orange  = (Color_t)my_color->GetColor("#FF6611");  // orange
01503 
01504   Pixel_t SubDetColor = GetBackground();
01505 
01506   if( fSubDet == "EB" ){SubDetColor = GetBackground();}
01507   if( fSubDet == "EE" ){SubDetColor = GetBackground();}
01508 
01509   // Bool_t GlobFont = kFALSE;
01510 
01511   //Pixel_t BkgColMainWindow  = (Pixel_t)SubDetColor;
01512   //Pixel_t BkgColChSpFrame   = (Pixel_t)SubDetColor;
01513   //Pixel_t BkgColStexUpFrame = (Pixel_t)SubDetColor;
01514 
01515   //  Pixel_t BkgColButExit     = (Pixel_t)555888;
01516 
01517   // enum ELayoutHints {
01518   //   kLHintsNoHints = 0,
01519   //   kLHintsLeft    = BIT(0),
01520   //   kLHintsCenterX = BIT(1),
01521   //   kLHintsRight   = BIT(2),
01522   //   kLHintsTop     = BIT(3),
01523   //   kLHintsCenterY = BIT(4),
01524   //   kLHintsBottom  = BIT(5),
01525   //   kLHintsExpandX = BIT(6),
01526   //   kLHintsExpandY = BIT(7),
01527   //   kLHintsNormal  = (kLHintsLeft | kLHintsTop)
01528   //   bits 8-11 used by ETableLayoutHints
01529   // };
01530 
01531   fLayoutGeneral      = new TGLayoutHints (kLHintsCenterX | kLHintsCenterY);   fCnew++;
01532   fLayoutBottLeft     = new TGLayoutHints (kLHintsLeft    | kLHintsBottom);    fCnew++;
01533   fLayoutTopLeft      = new TGLayoutHints (kLHintsLeft    | kLHintsTop);       fCnew++;
01534   fLayoutBottRight    = new TGLayoutHints (kLHintsRight   | kLHintsBottom);    fCnew++;
01535   fLayoutTopRight     = new TGLayoutHints (kLHintsRight   | kLHintsTop);       fCnew++;
01536   fLayoutCenterYLeft  = new TGLayoutHints (kLHintsLeft    | kLHintsCenterY);   fCnew++;  
01537   fLayoutCenterYRight = new TGLayoutHints (kLHintsRight   | kLHintsCenterY);   fCnew++;  
01538   fLayoutCenterXTop   = new TGLayoutHints (kLHintsCenterX | kLHintsTop);       fCnew++;  
01539 
01540   fVoidFrame = new TGCompositeFrame(this,60,20, kVerticalFrame, kSunkenFrame); fCnew++;
01541   AddFrame(fVoidFrame, fLayoutGeneral);
01542 
01543   //......................... Pads border
01544   Int_t xB1 = 0;
01545 
01546   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01547   //
01548   //                 SECTOR 1:  Submit, File Parameters, Calculations, ...
01549   //
01550   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01551 
01552   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01553   //
01554   //             Horizontal frame Analysis + First requested evt number + Run number
01555   //
01556   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01557   fAnaNorsRunFrame = new TGCompositeFrame(this,60,20,kHorizontalFrame,
01558                                           GetDefaultFrameBackground());   fCnew++;
01559 
01560   //=================================== ANALYSIS NAME (type of analysis)
01561   TString xAnaButText  = " Analysis ";
01562   Int_t typ_of_ana_buf_lenght = 80;
01563   fAnaFrame =  new TGCompositeFrame(fAnaNorsRunFrame,60,20, kHorizontalFrame,
01564                                     kSunkenFrame);                    fCnew++;
01565   //..................... Button  
01566   fAnaBut = new TGTextButton(fAnaFrame, xAnaButText, fAnaButC);       fCnew++;
01567   fAnaBut->Connect("Clicked()","TEcnaGui", this, "DoButtonAna()");
01568   // fAnaBut->Resize(typ_of_ana_buf_lenght, fAnaBut->GetDefaultHeight());
01569   fAnaBut->SetToolTipText("Click here to register the analysis name written on the right");
01570   fAnaBut->SetBackgroundColor(SubDetColor);
01571   //fAnaBut->SetFont("courier", GlobFont);
01572   fLayoutAnaBut =
01573     new TGLayoutHints(kLHintsLeft | kLHintsTop, xB1,xB1,xB1,xB1);     fCnew++;
01574   fAnaFrame->AddFrame(fAnaBut,  fLayoutAnaBut);
01575   //...................... Entry field
01576   fEntryAnaNumber = new TGTextBuffer();                               fCnew++;
01577   fAnaText = new TGTextEntry(fAnaFrame, fEntryAnaNumber);             fCnew++;
01578   fAnaText->SetToolTipText
01579     ("Click and enter the analysis name (code for type of analysis)");
01580   fAnaText->Resize(typ_of_ana_buf_lenght, fAnaText->GetDefaultHeight());
01581   DisplayInEntryField(fAnaText,fKeyAnaType);
01582   fAnaText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonAna()");
01583   fLayoutAnaField =
01584     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);     fCnew++;
01585   fAnaFrame->AddFrame(fAnaText, fLayoutAnaField);
01586 
01587   //=================================== FIRST REQUESTED EVENT NUMBER
01588   TString xFirstReqEvtNumberButText = " 1st event#  ";
01589   Int_t first_evt_buf_lenght   = 65;
01590   fFevFrame =
01591     new TGCompositeFrame(fAnaNorsRunFrame,60,20, kHorizontalFrame, kSunkenFrame); fCnew++;
01592   
01593   fFevBut= new TGTextButton(fFevFrame, xFirstReqEvtNumberButText);                fCnew++;
01594   fFevBut->Connect("Clicked()","TEcnaGui", this, "DoButtonFev()");
01595   fFevBut->SetToolTipText
01596     ("Click here to register the number of the first requested event number");
01597   fFevBut->SetBackgroundColor(SubDetColor);
01598   fLayoutFevBut =
01599     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);     fCnew++;
01600   fFevFrame->AddFrame(fFevBut,  fLayoutFevBut);
01601 
01602   fEntryFevNumber = new TGTextBuffer();                               fCnew++;
01603   fFevText = new TGTextEntry(fFevFrame, fEntryFevNumber);             fCnew++;
01604   fFevText->SetToolTipText("Click and enter the first requested event number");
01605   fFevText->Resize(first_evt_buf_lenght, fFevText->GetDefaultHeight());
01606   DisplayInEntryField(fFevText,fKeyFirstReqEvtNumber);
01607   fFevText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonFev()");
01608   fLayoutFevFieldText =
01609     new TGLayoutHints(kLHintsBottom | kLHintsLeft, xB1,xB1,xB1,xB1);  fCnew++;
01610   fFevFrame->AddFrame(fFevText, fLayoutFevFieldText);
01611 
01612   //=================================== RUN
01613   TString xRunButText  = " Run ";
01614   Int_t run_buf_lenght = 65;
01615   fRunFrame = new TGCompositeFrame(fAnaNorsRunFrame,0,0,
01616                                    kHorizontalFrame, kSunkenFrame);   fCnew++;
01617   fRunBut = new TGTextButton(fRunFrame, xRunButText, fRunButC);       fCnew++;
01618   fRunBut->Connect("Clicked()","TEcnaGui", this, "DoButtonRun()");
01619   fRunBut->SetToolTipText("Click here to register the run number");
01620   fRunBut->SetBackgroundColor(SubDetColor);
01621   // fRunBut->SetFont("helvetica", GlobFont);
01622   fLayoutRunBut =
01623     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);  fCnew++;
01624   fRunFrame->AddFrame(fRunBut,  fLayoutRunBut);
01625   fEntryRunNumber = new TGTextBuffer();                               fCnew++;
01626   fRunText = new TGTextEntry(fRunFrame, fEntryRunNumber);             fCnew++;
01627   fRunText->SetToolTipText("Click and enter the run number");
01628   fRunText->Resize(run_buf_lenght, fRunText->GetDefaultHeight());
01629   DisplayInEntryField(fRunText,fKeyRunNumber);
01630   fRunText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonRun()");
01631   fLayoutRunField =
01632     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);    fCnew++;
01633   fRunFrame->AddFrame(fRunText, fLayoutRunField);
01634 
01635   //-------------------------- display frame ana + Fev + Run
01636   fAnaNorsRunFrame->AddFrame(fAnaFrame, fLayoutTopLeft);
01637   fAnaNorsRunFrame->AddFrame(fFevFrame, fLayoutTopLeft);
01638   fAnaNorsRunFrame->AddFrame(fRunFrame,fLayoutTopRight);
01639   fLayoutAnaNorsRunFrame =  new TGLayoutHints(kLHintsTop | kLHintsExpandX,
01640                                               xB1, xB1, xB1, xB1);    fCnew++;
01641 
01642   AddFrame(fAnaNorsRunFrame, fLayoutAnaNorsRunFrame);
01643 
01644   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01645   //
01646   //    Horizontal frame Nb Of Samples + last requested evt number + Clean + Submit       
01647   //
01648   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01649   fFevLevStexFrame = new TGCompositeFrame(this,60,20,kHorizontalFrame,
01650                                           GetDefaultFrameBackground());            fCnew++;
01651 
01652   //=================================== Number Of Requested Samples
01653   TString xNorsButText  = "Nb Samp in File";
01654   Int_t nors_buf_lenght = 45;
01655   fNorsFrame = new TGCompositeFrame(fFevLevStexFrame,0,0, kHorizontalFrame,
01656                                     kSunkenFrame);                                 fCnew++;  
01657   //..................... Button  
01658   fNorsBut = new TGTextButton(fNorsFrame, xNorsButText, fNorsButC);                fCnew++;
01659   fNorsBut->Connect("Clicked()","TEcnaGui", this, "DoButtonNors()");
01660   //fNorsBut->Resize(nors_buf_lenght, fNorsBut->GetDefaultHeight());
01661   fNorsBut->SetToolTipText("Click here to register the value written on the right");
01662   fNorsBut->SetBackgroundColor(SubDetColor);
01663   //fNorsBut->SetFont("courier", GlobFont);
01664   fLayoutNorsBut =
01665     new TGLayoutHints(kLHintsLeft | kLHintsTop, xB1,xB1,xB1,xB1);                 fCnew++;
01666   fNorsFrame->AddFrame(fNorsBut,  fLayoutNorsBut);
01667   //...................... Entry field
01668   fEntryNorsNumber = new TGTextBuffer();                                          fCnew++;
01669   fNorsText = new TGTextEntry(fNorsFrame, fEntryNorsNumber);                      fCnew++;
01670   fNorsText->SetToolTipText("Click and enter the number of required samples");
01671   fNorsText->Resize(nors_buf_lenght, fNorsText->GetDefaultHeight());
01672   DisplayInEntryField(fNorsText,fKeyNbOfSamples);
01673   fNorsText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonNors()");
01674   fLayoutNorsField =
01675     new TGLayoutHints(kLHintsTop | kLHintsCenterX, xB1,xB1,xB1,xB1);              fCnew++;
01676   fNorsFrame->AddFrame(fNorsText, fLayoutNorsField);
01677 
01678   //=================================== LAST REQUESTED EVENT NUMBER
01679   TString xLastReqEvtButText  = " Last event# ";
01680   Int_t last_evt_buf_lenght = 65;
01681   fLevFrame =
01682     new TGCompositeFrame(fFevLevStexFrame,60,20, kHorizontalFrame, kSunkenFrame); fCnew++;
01683   
01684   fLevBut = new TGTextButton(fLevFrame, xLastReqEvtButText);                      fCnew++;
01685   fLevBut->Connect("Clicked()","TEcnaGui", this, "DoButtonLev()");
01686   fLevBut->SetToolTipText("Click here to register the last requested event number");
01687   fLevBut->SetBackgroundColor(SubDetColor);
01688   fLayoutLevBut =
01689     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                 fCnew++;
01690   fLevFrame->AddFrame(fLevBut,  fLayoutLevBut);
01691 
01692   fEntryLevNumber = new TGTextBuffer();                                           fCnew++;
01693   fLevText = new TGTextEntry(fLevFrame, fEntryLevNumber);                         fCnew++;
01694   fLevText->SetToolTipText("Click and enter the last requested event number");
01695   fLevText->Resize(last_evt_buf_lenght, fLevText->GetDefaultHeight());
01696   DisplayInEntryField(fLevText,fKeyLastReqEvtNumber);
01697   fLevText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonLev()");
01698   fLayoutLevFieldText =
01699     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);             fCnew++;
01700   fLevFrame->AddFrame(fLevText, fLayoutLevFieldText);
01701 
01702   //----------------------------------- Clean
01703   TString xMenuBarClean  = "Clean  ";
01704 
01705   fMenuClean = new TGPopupMenu(gClient->GetRoot());                                fCnew++;
01706   fMenuClean->AddEntry("Submission scripts",fMenuCleanSubC);
01707   fMenuClean->AddEntry("LSFJOB reports",fMenuCleanJobC);
01708   fMenuClean->AddEntry("Python files",fMenuCleanPythC);
01709   fMenuClean->AddEntry("All",fMenuCleanAllC);
01710 
01711   fMenuClean->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
01712   fMenuBarClean = new TGMenuBar(fFevLevStexFrame , 1, 1, kHorizontalFrame);        fCnew++;
01713   fMenuBarClean->AddPopup(xMenuBarClean, fMenuClean, fLayoutTopLeft);
01714 
01715   //--------------------------------- SUBMIT IN BATCH MODE
01716   TString xMenuBarSubmit  = " Submit ";
01717   fMenuSubmit = new TGPopupMenu(gClient->GetRoot());                               fCnew++;
01718 
01719   fMenuSubmit->AddEntry(" -q 8nm ",fMenuSubmit8nmC);
01720   fMenuSubmit->AddEntry(" -q 1nh ",fMenuSubmit1nhC);
01721   fMenuSubmit->AddEntry(" -q 8nh ",fMenuSubmit8nhC);
01722   fMenuSubmit->AddEntry(" -q 1nd ",fMenuSubmit1ndC);
01723   fMenuSubmit->AddEntry(" -q 1nw ",fMenuSubmit1nwC);
01724 
01725   fMenuSubmit->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
01726   fMenuBarSubmit = new TGMenuBar(fFevLevStexFrame, 1, 1, kHorizontalFrame);        fCnew++;
01727   fMenuBarSubmit->AddPopup(xMenuBarSubmit, fMenuSubmit, fLayoutTopLeft);
01728 
01729   //-------------------------- display frame Nors + Lev + Clean + Submit
01730   fFevLevStexFrame->AddFrame(fNorsFrame,fLayoutTopLeft);
01731   fFevLevStexFrame->AddFrame(fLevFrame, fLayoutTopLeft);
01732   fFevLevStexFrame->AddFrame(fMenuBarSubmit, fLayoutTopRight);
01733   fFevLevStexFrame->AddFrame(fMenuBarClean, fLayoutTopRight);
01734 
01735   fLayoutFevLevStexFrame =  new TGLayoutHints(kLHintsTop | kLHintsExpandX,
01736                                               xB1, xB1, xB1, xB1);                 fCnew++;
01737 
01738   AddFrame(fFevLevStexFrame, fLayoutFevLevStexFrame);
01739 
01740 
01741   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01742   //
01743   //      Horizontal Frame: StexNumber + Nb of Requested events
01744   //
01745   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01746   fCompStRqFrame = new TGCompositeFrame(this,60,20,kHorizontalFrame,
01747                                         GetDefaultFrameBackground());              fCnew++;
01748 
01749   //----------------------------------- STEX NUMBER
01750   TString xSumoButText;
01751   if( fSubDet == "EB" ){xSumoButText = "  SM#   (0=EB)  ";}
01752   if( fSubDet == "EE" ){xSumoButText = " Dee#  (0=EE)  ";} 
01753 
01754   Int_t stex_number_buf_lenght = 36;
01755   fStexFrame =
01756     new TGCompositeFrame(fCompStRqFrame,60,20, kHorizontalFrame, kSunkenFrame);   fCnew++;
01757 
01758   fStexBut = new TGTextButton(fStexFrame, xSumoButText);                          fCnew++;
01759   fStexBut->Connect("Clicked()","TEcnaGui", this, "DoButtonStex()");
01760   fStexBut->SetToolTipText("Click here to register the number written on the right");
01761   fStexBut->SetBackgroundColor(SubDetColor);
01762   //fStexBut->SetFont("courier", GlobFont);
01763   fLayoutStexBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);  fCnew++;
01764   fStexFrame->AddFrame(fStexBut,  fLayoutStexBut);
01765 
01766   fEntryStexNumber = new TGTextBuffer();                                          fCnew++;
01767   fStexText = new TGTextEntry(fStexFrame, fEntryStexNumber);                      fCnew++;
01768 
01769   TString xStexNumber;
01770   if( fSubDet == "EB" ){xStexNumber = "Click and enter the SM number";}
01771   if( fSubDet == "EE" ){xStexNumber = "Click and enter the Dee number";}
01772   fStexText->SetToolTipText(xStexNumber);
01773   fStexText->Resize(stex_number_buf_lenght, fStexText->GetDefaultHeight());
01774   DisplayInEntryField(fStexText, fKeyStexNumber);
01775   fStexText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonStex()");
01776   
01777   fLayoutStexFieldText =
01778     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);             fCnew++;
01779   fStexFrame->AddFrame(fStexText, fLayoutStexFieldText);
01780   
01781   //=================================== NUMBER OF REQUESTED EVENTS
01782   TString xNbOfReqEvtButText  = " Nb of events ";
01783   Int_t nbof_evt_buf_lenght = 65;
01784   fRevFrame =
01785     new TGCompositeFrame(fCompStRqFrame,60,20, kHorizontalFrame, kSunkenFrame); fCnew++;
01786   
01787   fRevBut = new TGTextButton(fRevFrame, xNbOfReqEvtButText);                      fCnew++;
01788   fRevBut->Connect("Clicked()","TEcnaGui", this, "DoButtonRev()");
01789   fRevBut->SetToolTipText("Click here to register the requested number of events");
01790   fRevBut->SetBackgroundColor(SubDetColor);
01791   fLayoutRevBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                 fCnew++;
01792   fRevFrame->AddFrame(fRevBut,  fLayoutRevBut);
01793 
01794   fEntryRevNumber = new TGTextBuffer();                                           fCnew++;
01795   fRevText = new TGTextEntry(fRevFrame, fEntryRevNumber);                         fCnew++;
01796   fRevText->SetToolTipText("Click and enter the requested number of events");
01797   fRevText->Resize(nbof_evt_buf_lenght, fRevText->GetDefaultHeight());
01798   DisplayInEntryField(fRevText,fKeyReqNbOfEvts);
01799   fRevText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonRev()");
01800   fLayoutRevFieldText =
01801     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);             fCnew++;
01802   fRevFrame->AddFrame(fRevText, fLayoutRevFieldText);
01803 
01804   //-------------------------- display frame stex number + Nb of req evts
01805   fCompStRqFrame->AddFrame(fStexFrame,fLayoutTopLeft);
01806   fCompStRqFrame->AddFrame(fRevFrame,fLayoutTopLeft);
01807 
01808   fLayoutCompStRqFrame =  new TGLayoutHints(kLHintsTop | kLHintsExpandX,
01809                                             xB1, xB1, xB1, xB1);                  fCnew++;
01810   AddFrame(fCompStRqFrame, fLayoutCompStRqFrame);
01811   AddFrame(fVoidFrame, fLayoutGeneral);
01812 
01813 
01814   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01815   //
01816   //      Horizontal Frame: StexStin numbering + NbSampForCalc + Calculations
01817   //
01818   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01819   fCompStnbFrame = new TGCompositeFrame(this,60,20,kHorizontalFrame,
01820                                         GetDefaultFrameBackground());              fCnew++;
01821 
01822 
01823   // ---------------------------------STEX STIN NUMBERING VIEW BUTTON
01824   //............ Button texts and lenghts of the input widgets
01825   TString xStexNbButText;
01826   if( fSubDet == "EB" ){xStexNbButText = "SM Tower Numbering";}
01827   if( fSubDet == "EE" ){xStexNbButText = "Dee SC Numbering";}
01828   fButStexNb = new TGTextButton(fCompStnbFrame, xStexNbButText, fButStexNbC);     fCnew++;
01829   fButStexNb->Connect("Clicked()","TEcnaGui", this, "DoButtonStexNb()");
01830   fButStexNb->SetBackgroundColor(SubDetColor); 
01831 
01832   //----------------------------------- Nb Of Samples For Calculations
01833   TString xNbSampForCalcButText = "Nb Samp Calc";
01834   Int_t nb_of_samp_calc_buf_lenght = 28;
01835   fNbSampForCalcFrame =
01836     new TGCompositeFrame(fCompStnbFrame,60,20, kHorizontalFrame, kSunkenFrame);   fCnew++;
01837 
01838   fNbSampForCalcBut = new TGTextButton(fNbSampForCalcFrame, xNbSampForCalcButText);                          fCnew++;
01839   fNbSampForCalcBut->Connect("Clicked()","TEcnaGui", this, "DoButtonNbSampForCalc()");
01840   fNbSampForCalcBut->SetToolTipText("Click here to register the number written on the right");
01841   fNbSampForCalcBut->SetBackgroundColor(SubDetColor);
01842   //fNbSampForCalcBut->SetFont("courier", GlobFont);
01843   fLayoutNbSampForCalcBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);  fCnew++;
01844   fNbSampForCalcFrame->AddFrame(fNbSampForCalcBut,  fLayoutNbSampForCalcBut);
01845 
01846   fEntryNbSampForCalcNumber = new TGTextBuffer();                                          fCnew++;
01847   fNbSampForCalcText = new TGTextEntry(fNbSampForCalcFrame, fEntryNbSampForCalcNumber);                      fCnew++;
01848 
01849   TString xNbSampForCalcNumber = "Click and enter the nb of samples for calculations";
01850   fNbSampForCalcText->SetToolTipText(xNbSampForCalcNumber);
01851   fNbSampForCalcText->Resize(nb_of_samp_calc_buf_lenght, fNbSampForCalcText->GetDefaultHeight());
01852   DisplayInEntryField(fNbSampForCalcText, fKeyNbOfSampForCalc);
01853   fNbSampForCalcText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonNbSampForCalc()");
01854   
01855   fLayoutNbSampForCalcFieldText =
01856     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);             fCnew++;
01857   fNbSampForCalcFrame->AddFrame(fNbSampForCalcText, fLayoutNbSampForCalcFieldText);
01858   
01859   //--------------------------------- Calculations Menu
01860   TString xMenuBarComput  = "Calculations  ";
01861   fMenuComput = new TGPopupMenu(gClient->GetRoot());                              fCnew++;
01862   fMenuComput->AddEntry("Standard ( Pedestals, Noises, Cor(s,s') )",fMenuComputStdC);
01863   fMenuComput->AddEntry("Standard + |Cor(t,t')|  (long time)",fMenuComputSttC);
01864   fMenuComput->AddEntry("Standard + |Cor(t,t')| + |Cor(c,c')|  (long time + big file)",fMenuComputSccC);
01865 
01866   fMenuComput->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
01867   fMenuBarComput = new TGMenuBar(fCompStnbFrame , 1, 1, kHorizontalFrame);        fCnew++;
01868   fMenuBarComput->AddPopup(xMenuBarComput, fMenuComput, fLayoutTopLeft);
01869 
01870   //-------------------------- display frame stexstin numbering + Nb samp for calc + Calculations
01871   fCompStnbFrame->AddFrame(fButStexNb,fLayoutTopLeft);
01872   fCompStnbFrame->AddFrame(fMenuBarComput,fLayoutTopRight);
01873   fCompStnbFrame->AddFrame(fNbSampForCalcFrame,fLayoutTopRight);
01874 
01875   fLayoutCompStnbFrame =  new TGLayoutHints(kLHintsTop | kLHintsExpandX,
01876                                             xB1, xB1, xB1, xB1);                  fCnew++;
01877   AddFrame(fCompStnbFrame, fLayoutCompStnbFrame);
01878   AddFrame(fVoidFrame, fLayoutGeneral);
01879 
01880   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01881   //
01882   //                             SECTOR 2: Stex's if SM # 0 or Stas's if SM =0 
01883   //
01884   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01885   Int_t minmax_buf_lenght = 45;
01886 
01887   fStexUpFrame = new TGCompositeFrame
01888     (this,60,20,kVerticalFrame, GetDefaultFrameBackground());                    fCnew++;
01889   TString xYminButText = " Ymin ";
01890   TString xYmaxButText = " Ymax ";
01891   //########################################### Composite frame number of events found in the data
01892   fVmmD_NOE_ChNbFrame = new TGCompositeFrame
01893     (fStexUpFrame,60,20, kHorizontalFrame, kSunkenFrame);                        fCnew++;
01894   //...................................... Menu number of events found in the data
01895 
01896   //...................................... Frame for Ymax
01897   fVmaxD_NOE_ChNbFrame = new TGCompositeFrame
01898     (fVmmD_NOE_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                 fCnew++;
01899   //...................................... Button Max + Entry field 
01900   fVmaxD_NOE_ChNbBut = new TGTextButton(fVmaxD_NOE_ChNbFrame, xYmaxButText);     fCnew++;
01901   fVmaxD_NOE_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxD_NOE_ChNb()");
01902   fVmaxD_NOE_ChNbBut->SetToolTipText("Click here to register ymax for the display of the quantity");
01903   fVmaxD_NOE_ChNbBut->SetBackgroundColor(SubDetColor); 
01904   fLayoutVmaxD_NOE_ChNbBut =
01905     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                fCnew++;
01906   fVmaxD_NOE_ChNbFrame->AddFrame(fVmaxD_NOE_ChNbBut,  fLayoutVmaxD_NOE_ChNbBut);
01907   fEntryVmaxD_NOE_ChNbNumber = new TGTextBuffer();                               fCnew++;
01908   fVmaxD_NOE_ChNbText =
01909     new TGTextEntry(fVmaxD_NOE_ChNbFrame, fEntryVmaxD_NOE_ChNbNumber);           fCnew++;
01910   fVmaxD_NOE_ChNbText->SetToolTipText("Click and enter ymax");
01911   fVmaxD_NOE_ChNbText->Resize(minmax_buf_lenght, fVmaxD_NOE_ChNbText->GetDefaultHeight());
01912   DisplayInEntryField(fVmaxD_NOE_ChNbText, fKeyVmaxD_NOE_ChNb);
01913   fVmaxD_NOE_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxD_NOE_ChNb()");
01914 
01915   fLayoutVmaxD_NOE_ChNbFieldText =
01916     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);            fCnew++;
01917   fVmaxD_NOE_ChNbFrame->AddFrame(fVmaxD_NOE_ChNbText, fLayoutVmaxD_NOE_ChNbFieldText);
01918   fLayoutVmaxD_NOE_ChNbFrame =
01919     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);               fCnew++;
01920   fVmmD_NOE_ChNbFrame->AddFrame(fVmaxD_NOE_ChNbFrame, fLayoutVmaxD_NOE_ChNbFrame);
01921 
01922   //...................................... Frame for Ymin
01923   fVminD_NOE_ChNbFrame = new TGCompositeFrame       
01924     (fVmmD_NOE_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                 fCnew++;
01925   //...................................... Button Min + Entry field 
01926   fVminD_NOE_ChNbBut = new TGTextButton(fVminD_NOE_ChNbFrame, xYminButText);     fCnew++;
01927   fVminD_NOE_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminD_NOE_ChNb()");
01928   fVminD_NOE_ChNbBut->SetToolTipText("Click here to register ymin for the display of the quantity");
01929   fVminD_NOE_ChNbBut->SetBackgroundColor(SubDetColor);
01930   fLayoutVminD_NOE_ChNbBut =
01931     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);               fCnew++;
01932   fVminD_NOE_ChNbFrame->AddFrame(fVminD_NOE_ChNbBut,  fLayoutVminD_NOE_ChNbBut);
01933   fEntryVminD_NOE_ChNbNumber = new TGTextBuffer();                              fCnew++;
01934   fVminD_NOE_ChNbText =
01935     new TGTextEntry(fVminD_NOE_ChNbFrame, fEntryVminD_NOE_ChNbNumber);          fCnew++;
01936   fVminD_NOE_ChNbText->SetToolTipText("Click and enter ymin");
01937   fVminD_NOE_ChNbText->Resize(minmax_buf_lenght, fVminD_NOE_ChNbText->GetDefaultHeight());
01938   DisplayInEntryField(fVminD_NOE_ChNbText,fKeyVminD_NOE_ChNb);
01939   fVminD_NOE_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminD_NOE_ChNb()");
01940   fLayoutVminD_NOE_ChNbFieldText =
01941     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);           fCnew++;
01942   fVminD_NOE_ChNbFrame->AddFrame(fVminD_NOE_ChNbText, fLayoutVminD_NOE_ChNbFieldText);
01943   fLayoutVminD_NOE_ChNbFrame =
01944     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);              fCnew++;
01945   fVmmD_NOE_ChNbFrame->AddFrame(fVminD_NOE_ChNbFrame, fLayoutVminD_NOE_ChNbFrame);
01946 
01947   //...................................... MenuBar strings
01948   TString xHistoChannels = "1D Histo";
01949   TString xHistoChannelsSame = "1D Histo SAME" ;
01950   TString xHistoChannelsSameP = "1D Histo SAME n";
01951   TString xHistoProjection = "1D Histo Projection";
01952   TString xHistoProjectionSame = "1D Histo Projection SAME";
01953   TString xHistoProjectionSameP = "1D Histo Projection SAME n";
01954   TString xHocoVecoViewSorS = "2D, Histo";
01955   if( fSubDet == "EB" ){xHocoVecoViewSorS = "2D, Histo (eta,phi)";}
01956   if( fSubDet == "EE" ){xHocoVecoViewSorS = "2D, Histo (IX,IY)";}
01957   TString xAsciiFileStex = "1D Histo, write in ASCII file";
01958 
01959   //...................................... Frame
01960   TString xMenuD_NOE_ChNb = "Numbers of events ";
01961   fMenuD_NOE_ChNb = new TGPopupMenu(gClient->GetRoot());                                   fCnew++;
01962   fMenuD_NOE_ChNb->AddEntry(xHistoChannels,fMenuD_NOE_ChNbFullC);
01963   fMenuD_NOE_ChNb->AddEntry(xHistoChannelsSame,fMenuD_NOE_ChNbSameC);
01964   fMenuD_NOE_ChNb->AddSeparator();
01965   fMenuD_NOE_ChNb->AddEntry(xHocoVecoViewSorS,fMenuD_NOE_ChNbHocoVecoC);
01966   fMenuD_NOE_ChNb->AddSeparator();
01967   fMenuD_NOE_ChNb->AddEntry(xAsciiFileStex,fMenuD_NOE_ChNbAsciiFileC);
01968   fMenuD_NOE_ChNb->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
01969   fMenuBarD_NOE_ChNb = new TGMenuBar(fVmmD_NOE_ChNbFrame, 1, 1, kHorizontalFrame);         fCnew++;
01970 
01971   //fMenuBarD_NOE_ChNb->SetMinWidth(200);    // <= N'A STRICTEMENT AUCUN EFFET.
01972 
01973   fMenuBarD_NOE_ChNb->AddPopup(xMenuD_NOE_ChNb, fMenuD_NOE_ChNb, fLayoutGeneral);
01974   fLayoutMenuBarD_NOE_ChNb = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);             fCnew++;
01975   fVmmD_NOE_ChNbFrame->AddFrame(fMenuBarD_NOE_ChNb, fLayoutMenuBarD_NOE_ChNb);
01976   fLayoutVmmD_NOE_ChNbFrame =
01977     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                         fCnew++;
01978   fStexUpFrame->AddFrame(fVmmD_NOE_ChNbFrame, fLayoutVmmD_NOE_ChNbFrame);
01979 
01980   //............................. Expectation values + Sigmas Vertical frame
01981   fStexHozFrame =
01982     new TGCompositeFrame(fStexUpFrame,60,20,kVerticalFrame,
01983                          GetDefaultFrameBackground());                   fCnew++;
01984 
01985   //########################################### Composite frame ev of ev (pedestals)
01986   fVmmD_Ped_ChNbFrame = new TGCompositeFrame
01987     (fStexHozFrame,60,20, kHorizontalFrame, kSunkenFrame);          fCnew++;
01988 
01989   //...................................... Menu ev of ev
01990 
01991   //...................................... Frame for Ymax
01992   fVmaxD_Ped_ChNbFrame = new TGCompositeFrame
01993     (fVmmD_Ped_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                           fCnew++;
01994   //...................................... Button Max + Entry field 
01995   fVmaxD_Ped_ChNbBut = new TGTextButton(fVmaxD_Ped_ChNbFrame, xYmaxButText);               fCnew++;
01996   fVmaxD_Ped_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxD_Ped_ChNb()");
01997   fVmaxD_Ped_ChNbBut->SetToolTipText("Click here to register ymax for the display of the quantity");
01998   fLayoutVmaxD_Ped_ChNbBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1); fCnew++;
01999   fVmaxD_Ped_ChNbBut->SetBackgroundColor(SubDetColor);
02000   fVmaxD_Ped_ChNbFrame->AddFrame(fVmaxD_Ped_ChNbBut,  fLayoutVmaxD_Ped_ChNbBut);
02001   fEntryVmaxD_Ped_ChNbNumber = new TGTextBuffer();                                         fCnew++;
02002   fVmaxD_Ped_ChNbText = new TGTextEntry(fVmaxD_Ped_ChNbFrame, fEntryVmaxD_Ped_ChNbNumber); fCnew++;
02003   fVmaxD_Ped_ChNbText->SetToolTipText("Click and enter ymax");
02004   fVmaxD_Ped_ChNbText->Resize(minmax_buf_lenght, fVmaxD_Ped_ChNbText->GetDefaultHeight());
02005   DisplayInEntryField(fVmaxD_Ped_ChNbText,fKeyVmaxD_Ped_ChNb);
02006   fVmaxD_Ped_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxD_Ped_ChNb()");
02007   fLayoutVmaxD_Ped_ChNbFieldText =
02008     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                      fCnew++;
02009   fVmaxD_Ped_ChNbFrame->AddFrame(fVmaxD_Ped_ChNbText, fLayoutVmaxD_Ped_ChNbFieldText);
02010   fLayoutVmaxD_Ped_ChNbFrame =
02011     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                         fCnew++;
02012   fVmmD_Ped_ChNbFrame->AddFrame(fVmaxD_Ped_ChNbFrame, fLayoutVmaxD_Ped_ChNbFrame);
02013 
02014   //...................................... Frame for Ymin
02015   fVminD_Ped_ChNbFrame = new TGCompositeFrame
02016     (fVmmD_Ped_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                           fCnew++;
02017   //...................................... Button Min + Entry field 
02018   fVminD_Ped_ChNbBut = new TGTextButton(fVminD_Ped_ChNbFrame, xYminButText);               fCnew++;
02019   fVminD_Ped_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminD_Ped_ChNb()");
02020   fVminD_Ped_ChNbBut->SetToolTipText("Click here to register ymin for the display of the quantity");
02021   fVminD_Ped_ChNbBut->SetBackgroundColor(SubDetColor);
02022   fLayoutVminD_Ped_ChNbBut =
02023     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                          fCnew++;
02024   fVminD_Ped_ChNbFrame->AddFrame(fVminD_Ped_ChNbBut,  fLayoutVminD_Ped_ChNbBut);
02025 
02026   fEntryVminD_Ped_ChNbNumber = new TGTextBuffer();                                         fCnew++;
02027   fVminD_Ped_ChNbText = new TGTextEntry(fVminD_Ped_ChNbFrame, fEntryVminD_Ped_ChNbNumber); fCnew++;
02028   fVminD_Ped_ChNbText->SetToolTipText("Click and enter ymin");
02029   fVminD_Ped_ChNbText->Resize(minmax_buf_lenght, fVminD_Ped_ChNbText->GetDefaultHeight());
02030   DisplayInEntryField(fVminD_Ped_ChNbText,fKeyVminD_Ped_ChNb);
02031   fVminD_Ped_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminD_Ped_ChNb()");
02032   fLayoutVminD_Ped_ChNbFieldText =
02033     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                  fCnew++;
02034   fVminD_Ped_ChNbFrame->AddFrame(fVminD_Ped_ChNbText, fLayoutVminD_Ped_ChNbFieldText);
02035   fLayoutVminD_Ped_ChNbFrame =
02036     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                     fCnew++;
02037   fVmmD_Ped_ChNbFrame->AddFrame(fVminD_Ped_ChNbFrame, fLayoutVminD_Ped_ChNbFrame);
02038 
02039   //...................................... Frame
02040   TString xMenuD_Ped_ChNb = "       Pedestals ";
02041   fMenuD_Ped_ChNb = new TGPopupMenu(gClient->GetRoot());                               fCnew++;
02042   fMenuD_Ped_ChNb->AddEntry(xHistoChannels,fMenuD_Ped_ChNbFullC);
02043   fMenuD_Ped_ChNb->AddEntry(xHistoChannelsSame,fMenuD_Ped_ChNbSameC);
02044   fMenuD_Ped_ChNb->AddSeparator();
02045   fMenuD_Ped_ChNb->AddEntry(xHocoVecoViewSorS,fMenuD_Ped_ChNbHocoVecoC);
02046   fMenuD_Ped_ChNb->AddSeparator();
02047   fMenuD_Ped_ChNb->AddEntry(xAsciiFileStex,fMenuD_Ped_ChNbAsciiFileC);
02048   fMenuD_Ped_ChNb->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02049   fMenuBarD_Ped_ChNb = new TGMenuBar(fVmmD_Ped_ChNbFrame, 1, 1, kHorizontalFrame);     fCnew++;
02050   fMenuBarD_Ped_ChNb->AddPopup(xMenuD_Ped_ChNb, fMenuD_Ped_ChNb, fLayoutGeneral);
02051   fLayoutMenuBarD_Ped_ChNb = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);         fCnew++;
02052   fVmmD_Ped_ChNbFrame->AddFrame(fMenuBarD_Ped_ChNb, fLayoutMenuBarD_Ped_ChNb);  
02053 
02054   fLayoutVmmD_Ped_ChNbFrame =
02055     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                     fCnew++;
02056   fStexHozFrame->AddFrame(fVmmD_Ped_ChNbFrame, fLayoutVmmD_Ped_ChNbFrame);
02057 
02058   //########################################### Composite frame for TOTAL NOISE
02059   fVmmD_TNo_ChNbFrame = new TGCompositeFrame
02060     (fStexHozFrame,60,20, kHorizontalFrame, kSunkenFrame);                                  fCnew++;
02061 
02062   //...................................... Menu ev of sig 
02063   //...................................... Frame for Ymax
02064   fVmaxD_TNo_ChNbFrame = new TGCompositeFrame
02065     (fVmmD_TNo_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                            fCnew++;
02066   //...................................... Button Max + Entry field 
02067   fVmaxD_TNo_ChNbBut = new TGTextButton(fVmaxD_TNo_ChNbFrame, xYmaxButText);                fCnew++;
02068   fVmaxD_TNo_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxD_TNo_ChNb()");
02069   fVmaxD_TNo_ChNbBut->SetToolTipText("Click here to register ymax for the display of the quantity");
02070   fVmaxD_TNo_ChNbBut->SetBackgroundColor(SubDetColor);
02071   fLayoutVmaxD_TNo_ChNbBut =
02072     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                           fCnew++;
02073   fVmaxD_TNo_ChNbFrame->AddFrame(fVmaxD_TNo_ChNbBut,  fLayoutVmaxD_TNo_ChNbBut);
02074   fEntryVmaxD_TNo_ChNbNumber = new TGTextBuffer();                                          fCnew++;
02075   fVmaxD_TNo_ChNbText = new TGTextEntry(fVmaxD_TNo_ChNbFrame, fEntryVmaxD_TNo_ChNbNumber);  fCnew++;
02076   fVmaxD_TNo_ChNbText->SetToolTipText("Click and enter ymax");
02077   fVmaxD_TNo_ChNbText->Resize(minmax_buf_lenght, fVmaxD_TNo_ChNbText->GetDefaultHeight());
02078   DisplayInEntryField(fVmaxD_TNo_ChNbText,fKeyVmaxD_TNo_ChNb);
02079   fVmaxD_TNo_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxD_TNo_ChNb()");
02080   fLayoutVmaxD_TNo_ChNbFieldText =
02081     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                       fCnew++;
02082   fVmaxD_TNo_ChNbFrame->AddFrame(fVmaxD_TNo_ChNbText, fLayoutVmaxD_TNo_ChNbFieldText);
02083   fLayoutVmaxD_TNo_ChNbFrame =
02084     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                          fCnew++;
02085   fVmmD_TNo_ChNbFrame->AddFrame(fVmaxD_TNo_ChNbFrame, fLayoutVmaxD_TNo_ChNbFrame);
02086 
02087   //...................................... Frame for Ymin
02088   fVminD_TNo_ChNbFrame = new TGCompositeFrame
02089     (fVmmD_TNo_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                            fCnew++;
02090   //...................................... Button Min + Entry field 
02091   fVminD_TNo_ChNbBut = new TGTextButton(fVminD_TNo_ChNbFrame, xYminButText);                fCnew++;
02092   fVminD_TNo_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminD_TNo_ChNb()");
02093   fVminD_TNo_ChNbBut->SetToolTipText("Click here to register ymin for the display of the quantity");
02094   fVminD_TNo_ChNbBut->SetBackgroundColor(SubDetColor);
02095   fLayoutVminD_TNo_ChNbBut =
02096     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                           fCnew++;
02097   fVminD_TNo_ChNbFrame->AddFrame(fVminD_TNo_ChNbBut,  fLayoutVminD_TNo_ChNbBut);
02098 
02099   fEntryVminD_TNo_ChNbNumber = new TGTextBuffer();                                          fCnew++;
02100   fVminD_TNo_ChNbText = new TGTextEntry(fVminD_TNo_ChNbFrame, fEntryVminD_TNo_ChNbNumber);  fCnew++;
02101   fVminD_TNo_ChNbText->SetToolTipText("Click and enter ymin");
02102   fVminD_TNo_ChNbText->Resize(minmax_buf_lenght, fVminD_TNo_ChNbText->GetDefaultHeight());
02103   DisplayInEntryField(fVminD_TNo_ChNbText,fKeyVminD_TNo_ChNb);
02104   fVminD_TNo_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminD_TNo_ChNb()");
02105   fLayoutVminD_TNo_ChNbFieldText =
02106     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                 fCnew++;
02107   fVminD_TNo_ChNbFrame->AddFrame(fVminD_TNo_ChNbText, fLayoutVminD_TNo_ChNbFieldText);
02108   fLayoutVminD_TNo_ChNbFrame =
02109     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                    fCnew++;
02110   fVmmD_TNo_ChNbFrame->AddFrame(fVminD_TNo_ChNbFrame, fLayoutVminD_TNo_ChNbFrame);
02111 
02112   //...................................... Frame
02113   TString xMenuD_TNo_ChNb =  "        Total Noise ";
02114   fMenuD_TNo_ChNb = new TGPopupMenu(gClient->GetRoot());                              fCnew++;
02115   fMenuD_TNo_ChNb->AddEntry(xHistoChannels,fMenuD_TNo_ChNbFullC);
02116   fMenuD_TNo_ChNb->AddEntry(xHistoChannelsSame,fMenuD_TNo_ChNbSameC);
02117   fMenuD_TNo_ChNb->AddEntry(xHistoChannelsSameP,fMenuD_TNo_ChNbSamePC);
02118   fMenuD_TNo_ChNb->AddSeparator();
02119   fMenuD_TNo_ChNb->AddEntry(xHocoVecoViewSorS,fMenuD_TNo_ChNbHocoVecoC);
02120   fMenuD_TNo_ChNb->AddSeparator();
02121   fMenuD_TNo_ChNb->AddEntry(xAsciiFileStex,fMenuD_TNo_ChNbAsciiFileC);
02122   fMenuD_TNo_ChNb->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02123   fMenuBarD_TNo_ChNb = new TGMenuBar(fVmmD_TNo_ChNbFrame, 1, 1, kHorizontalFrame);    fCnew++;
02124   fMenuBarD_TNo_ChNb->AddPopup(xMenuD_TNo_ChNb, fMenuD_TNo_ChNb, fLayoutGeneral);
02125   fLayoutMenuBarD_TNo_ChNb = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);        fCnew++;
02126   fVmmD_TNo_ChNbFrame->AddFrame(fMenuBarD_TNo_ChNb, fLayoutMenuBarD_TNo_ChNb);
02127 
02128   fLayoutVmmD_TNo_ChNbFrame =
02129     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                     fCnew++;
02130   fStexHozFrame->AddFrame(fVmmD_TNo_ChNbFrame, fLayoutVmmD_TNo_ChNbFrame);
02131 
02132   //########################################### Composite frame for LOW FREQUENCY NOISE
02133   fVmmD_LFN_ChNbFrame = new TGCompositeFrame
02134     (fStexHozFrame,60,20, kHorizontalFrame, kSunkenFrame);                                     fCnew++;
02135 
02136   //...................................... Menu sig of ev (LOW FREQUENCY NOISE)
02137   //...................................... Frame for Ymax
02138   fVmaxD_LFN_ChNbFrame = new TGCompositeFrame
02139     (fVmmD_LFN_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                               fCnew++;
02140   //...................................... Button Max + Entry field 
02141   fVmaxD_LFN_ChNbBut = new TGTextButton(fVmaxD_LFN_ChNbFrame, xYmaxButText);                   fCnew++;
02142   fVmaxD_LFN_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxD_LFN_ChNb()");
02143   fVmaxD_LFN_ChNbBut->SetToolTipText("Click here to register ymax for the display of the quantity");
02144   fVmaxD_LFN_ChNbBut->SetBackgroundColor(SubDetColor);
02145   fLayoutVmaxD_LFN_ChNbBut =
02146     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                              fCnew++;
02147   fVmaxD_LFN_ChNbFrame->AddFrame(fVmaxD_LFN_ChNbBut,  fLayoutVmaxD_LFN_ChNbBut);
02148   fEntryVmaxD_LFN_ChNbNumber = new TGTextBuffer();                                             fCnew++;
02149   fVmaxD_LFN_ChNbText = new TGTextEntry(fVmaxD_LFN_ChNbFrame, fEntryVmaxD_LFN_ChNbNumber);     fCnew++;
02150   fVmaxD_LFN_ChNbText->SetToolTipText("Click and enter ymax");
02151   fVmaxD_LFN_ChNbText->Resize(minmax_buf_lenght, fVmaxD_LFN_ChNbText->GetDefaultHeight());
02152   DisplayInEntryField(fVmaxD_LFN_ChNbText,fKeyVmaxD_LFN_ChNb);
02153   fVmaxD_LFN_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxD_LFN_ChNb()");
02154   fLayoutVmaxD_LFN_ChNbFieldText =
02155     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                          fCnew++;
02156   fVmaxD_LFN_ChNbFrame->AddFrame(fVmaxD_LFN_ChNbText, fLayoutVmaxD_LFN_ChNbFieldText);
02157   fLayoutVmaxD_LFN_ChNbFrame =
02158     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                             fCnew++;
02159   fVmmD_LFN_ChNbFrame->AddFrame(fVmaxD_LFN_ChNbFrame, fLayoutVmaxD_LFN_ChNbFrame);
02160 
02161   //...................................... Frame for Ymin
02162   fVminD_LFN_ChNbFrame = new TGCompositeFrame
02163     (fVmmD_LFN_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                               fCnew++;
02164   //...................................... Button Min + Entry field 
02165   fVminD_LFN_ChNbBut = new TGTextButton(fVminD_LFN_ChNbFrame, xYminButText);                   fCnew++;
02166   fVminD_LFN_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminD_LFN_ChNb()");
02167   fVminD_LFN_ChNbBut->SetToolTipText("Click here to register ymin for the display of the quantity");
02168   fVminD_LFN_ChNbBut->SetBackgroundColor(SubDetColor);
02169   fLayoutVminD_LFN_ChNbBut =
02170     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                             fCnew++;
02171   fVminD_LFN_ChNbFrame->AddFrame(fVminD_LFN_ChNbBut,  fLayoutVminD_LFN_ChNbBut);
02172   fEntryVminD_LFN_ChNbNumber = new TGTextBuffer();                                            fCnew++;
02173   fVminD_LFN_ChNbText = new TGTextEntry(fVminD_LFN_ChNbFrame, fEntryVminD_LFN_ChNbNumber);    fCnew++;
02174   fVminD_LFN_ChNbText->SetToolTipText("Click and enter ymin");
02175   fVminD_LFN_ChNbText->Resize(minmax_buf_lenght, fVminD_LFN_ChNbText->GetDefaultHeight());
02176   DisplayInEntryField(fVminD_LFN_ChNbText,fKeyVminD_LFN_ChNb);
02177   fVminD_LFN_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminD_LFN_ChNb()");
02178   fLayoutVminD_LFN_ChNbFieldText =
02179     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                         fCnew++;
02180   fVminD_LFN_ChNbFrame->AddFrame(fVminD_LFN_ChNbText, fLayoutVminD_LFN_ChNbFieldText);
02181   fLayoutVminD_LFN_ChNbFrame =
02182     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                            fCnew++;
02183   fVmmD_LFN_ChNbFrame->AddFrame(fVminD_LFN_ChNbFrame, fLayoutVminD_LFN_ChNbFrame);
02184 
02185   //...................................... Frame
02186   TString xMenuD_LFN_ChNb =      " Low Frequency Noise ";
02187   fMenuD_LFN_ChNb = new TGPopupMenu(gClient->GetRoot());                                      fCnew++;
02188   fMenuD_LFN_ChNb->AddEntry(xHistoChannels,fMenuD_LFN_ChNbFullC);
02189   fMenuD_LFN_ChNb->AddEntry(xHistoChannelsSame,fMenuD_LFN_ChNbSameC);
02190   fMenuD_LFN_ChNb->AddEntry(xHistoChannelsSameP,fMenuD_LFN_ChNbSamePC);
02191   fMenuD_LFN_ChNb->AddSeparator();
02192   fMenuD_LFN_ChNb->AddEntry(xHocoVecoViewSorS,fMenuD_LFN_ChNbHocoVecoC);
02193   fMenuD_LFN_ChNb->AddSeparator();
02194   fMenuD_LFN_ChNb->AddEntry(xAsciiFileStex,fMenuD_LFN_ChNbAsciiFileC);
02195   fMenuD_LFN_ChNb->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02196   fMenuBarD_LFN_ChNb = new TGMenuBar(fVmmD_LFN_ChNbFrame, 1, 1, kHorizontalFrame);            fCnew++;
02197   fMenuBarD_LFN_ChNb->AddPopup(xMenuD_LFN_ChNb, fMenuD_LFN_ChNb, fLayoutGeneral);
02198   fLayoutMenuBarD_LFN_ChNb = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);                fCnew++;
02199   fVmmD_LFN_ChNbFrame->AddFrame(fMenuBarD_LFN_ChNb, fLayoutMenuBarD_LFN_ChNb);
02200   fLayoutVmmD_LFN_ChNbFrame =
02201     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                            fCnew++;
02202   fStexHozFrame->AddFrame(fVmmD_LFN_ChNbFrame, fLayoutVmmD_LFN_ChNbFrame);
02203 
02204   //########################################### Composite frame for HIGH FREQUENCY NOISE
02205   fVmmD_HFN_ChNbFrame = new TGCompositeFrame
02206     (fStexHozFrame,60,20, kHorizontalFrame, kSunkenFrame);                                    fCnew++;
02207 
02208   //...................................... Menu sig of sig (HIGH FREQUENCY NOISE)
02209   //...................................... Frame for Ymax
02210   fVmaxD_HFN_ChNbFrame = new TGCompositeFrame
02211     (fVmmD_HFN_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                              fCnew++;
02212   //...................................... Button Max + Entry field
02213   fVmaxD_HFN_ChNbBut = new TGTextButton(fVmaxD_HFN_ChNbFrame, xYmaxButText);                  fCnew++; 
02214   fVmaxD_HFN_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxD_HFN_ChNb()");
02215   fVmaxD_HFN_ChNbBut->SetToolTipText("Click here to register ymax for the display of the quantity");
02216   fVmaxD_HFN_ChNbBut->SetBackgroundColor(SubDetColor);
02217   fLayoutVmaxD_HFN_ChNbBut =
02218     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                             fCnew++;
02219   fVmaxD_HFN_ChNbFrame->AddFrame(fVmaxD_HFN_ChNbBut,  fLayoutVmaxD_HFN_ChNbBut);
02220   fEntryVmaxD_HFN_ChNbNumber = new TGTextBuffer();                                            fCnew++;
02221   fVmaxD_HFN_ChNbText = new TGTextEntry(fVmaxD_HFN_ChNbFrame, fEntryVmaxD_HFN_ChNbNumber);    fCnew++;
02222   fVmaxD_HFN_ChNbText->SetToolTipText("Click and enter ymax");
02223   fVmaxD_HFN_ChNbText->Resize(minmax_buf_lenght, fVmaxD_HFN_ChNbText->GetDefaultHeight());
02224   DisplayInEntryField(fVmaxD_HFN_ChNbText,fKeyVmaxD_HFN_ChNb);
02225   fVmaxD_HFN_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxD_HFN_ChNb()");
02226   fLayoutVmaxD_HFN_ChNbFieldText =
02227     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                         fCnew++;
02228   fVmaxD_HFN_ChNbFrame->AddFrame(fVmaxD_HFN_ChNbText, fLayoutVmaxD_HFN_ChNbFieldText);
02229   fLayoutVmaxD_HFN_ChNbFrame =
02230     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                            fCnew++;
02231   fVmmD_HFN_ChNbFrame->AddFrame(fVmaxD_HFN_ChNbFrame, fLayoutVmaxD_HFN_ChNbFrame);
02232 
02233   //...................................... Frame for Ymin
02234   fVminD_HFN_ChNbFrame = new TGCompositeFrame
02235     (fVmmD_HFN_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                              fCnew++;
02236   //...................................... Button Min + Entry field
02237   fVminD_HFN_ChNbBut = new TGTextButton(fVminD_HFN_ChNbFrame, xYminButText);                  fCnew++;
02238   fVminD_HFN_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminD_HFN_ChNb()");
02239   fVminD_HFN_ChNbBut->SetToolTipText("Click here to register ymin for the display of the quantity");
02240   fVminD_HFN_ChNbBut->SetBackgroundColor(SubDetColor);
02241   fLayoutVminD_HFN_ChNbBut =
02242     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                          fCnew++;
02243   fVminD_HFN_ChNbFrame->AddFrame(fVminD_HFN_ChNbBut,  fLayoutVminD_HFN_ChNbBut);
02244   fEntryVminD_HFN_ChNbNumber = new TGTextBuffer();                                         fCnew++;
02245   fVminD_HFN_ChNbText = new TGTextEntry(fVminD_HFN_ChNbFrame, fEntryVminD_HFN_ChNbNumber); fCnew++;
02246   fVminD_HFN_ChNbText->SetToolTipText("Click and enter ymin");
02247   fVminD_HFN_ChNbText->Resize(minmax_buf_lenght, fVminD_HFN_ChNbText->GetDefaultHeight());
02248   DisplayInEntryField(fVminD_HFN_ChNbText,fKeyVminD_HFN_ChNb);
02249   fVminD_HFN_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminD_HFN_ChNb()");
02250   fLayoutVminD_HFN_ChNbFieldText =
02251     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                      fCnew++;
02252   fVminD_HFN_ChNbFrame->AddFrame(fVminD_HFN_ChNbText, fLayoutVminD_HFN_ChNbFieldText);
02253   fLayoutVminD_HFN_ChNbFrame =
02254     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                         fCnew++;
02255   fVmmD_HFN_ChNbFrame->AddFrame(fVminD_HFN_ChNbFrame, fLayoutVminD_HFN_ChNbFrame);
02256 
02257   //...................................... Frame
02258   TString xMenuD_HFN_ChNb =  " High Frequency Noise ";
02259   fMenuD_HFN_ChNb = new TGPopupMenu(gClient->GetRoot());                              fCnew++;
02260   fMenuD_HFN_ChNb->AddEntry(xHistoChannels,fMenuD_HFN_ChNbFullC);
02261   fMenuD_HFN_ChNb->AddEntry(xHistoChannelsSame,fMenuD_HFN_ChNbSameC);
02262   fMenuD_HFN_ChNb->AddEntry(xHistoChannelsSameP,fMenuD_HFN_ChNbSamePC);
02263   fMenuD_HFN_ChNb->AddSeparator();
02264   fMenuD_HFN_ChNb->AddEntry(xHocoVecoViewSorS,fMenuD_HFN_ChNbHocoVecoC);
02265   fMenuD_HFN_ChNb->AddSeparator();
02266   fMenuD_HFN_ChNb->AddEntry(xAsciiFileStex,fMenuD_HFN_ChNbAsciiFileC);
02267   fMenuD_HFN_ChNb->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02268   fMenuBarD_HFN_ChNb = new TGMenuBar(fVmmD_HFN_ChNbFrame, 1, 1, kHorizontalFrame);    fCnew++;
02269   fMenuBarD_HFN_ChNb->AddPopup(xMenuD_HFN_ChNb, fMenuD_HFN_ChNb, fLayoutGeneral);
02270   fLayoutMenuBarD_HFN_ChNb = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);        fCnew++;
02271   fVmmD_HFN_ChNbFrame->AddFrame(fMenuBarD_HFN_ChNb, fLayoutMenuBarD_HFN_ChNb);
02272 
02273   fLayoutVmmD_HFN_ChNbFrame =
02274     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                    fCnew++;
02275   fStexHozFrame->AddFrame(fVmmD_HFN_ChNbFrame, fLayoutVmmD_HFN_ChNbFrame);
02276 
02277   //########################################### Composite frame for MEAN COR(s,s')
02278   fVmmD_MCs_ChNbFrame = new TGCompositeFrame
02279     (fStexHozFrame,60,20, kHorizontalFrame, kSunkenFrame);                            fCnew++;
02280 
02281   //...................................... Menu ev of Corss
02282 
02283   //...................................... Frame
02284   fVmaxD_MCs_ChNbFrame = new TGCompositeFrame
02285     (fVmmD_MCs_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                              fCnew++;
02286   //...................................... Button Max + Entry field 
02287   fVmaxD_MCs_ChNbBut = new TGTextButton(fVmaxD_MCs_ChNbFrame, xYmaxButText);                  fCnew++;
02288   fVmaxD_MCs_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxD_MCs_ChNb()");
02289   fVmaxD_MCs_ChNbBut->SetToolTipText("Click here to register ymax for the display of the quantity");
02290   fVmaxD_MCs_ChNbBut->SetBackgroundColor(SubDetColor);
02291   fLayoutVmaxD_MCs_ChNbBut =
02292     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                             fCnew++;
02293   fVmaxD_MCs_ChNbFrame->AddFrame(fVmaxD_MCs_ChNbBut,  fLayoutVmaxD_MCs_ChNbBut);
02294   fEntryVmaxD_MCs_ChNbNumber = new TGTextBuffer();                                            fCnew++;
02295   fVmaxD_MCs_ChNbText = new TGTextEntry(fVmaxD_MCs_ChNbFrame, fEntryVmaxD_MCs_ChNbNumber);    fCnew++;
02296   fVmaxD_MCs_ChNbText->SetToolTipText("Click and enter ymax");
02297   fVmaxD_MCs_ChNbText->Resize(minmax_buf_lenght, fVmaxD_MCs_ChNbText->GetDefaultHeight());
02298   DisplayInEntryField(fVmaxD_MCs_ChNbText, fKeyVmaxD_MCs_ChNb);
02299   fVmaxD_MCs_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxD_MCs_ChNb()");
02300   fLayoutVmaxD_MCs_ChNbFieldText =
02301     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                         fCnew++;
02302   fVmaxD_MCs_ChNbFrame->AddFrame(fVmaxD_MCs_ChNbText, fLayoutVmaxD_MCs_ChNbFieldText);
02303   fLayoutVmaxD_MCs_ChNbFrame =
02304     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                            fCnew++;
02305   fVmmD_MCs_ChNbFrame->AddFrame(fVmaxD_MCs_ChNbFrame, fLayoutVmaxD_MCs_ChNbFrame);
02306 
02307   //...................................... Frame for Ymin
02308   fVminD_MCs_ChNbFrame = new TGCompositeFrame
02309     (fVmmD_MCs_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                              fCnew++;
02310   //...................................... Button Min + Entry field 
02311   fVminD_MCs_ChNbBut = new TGTextButton(fVminD_MCs_ChNbFrame, xYminButText);                  fCnew++;
02312   fVminD_MCs_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminD_MCs_ChNb()");
02313   fVminD_MCs_ChNbBut->SetToolTipText("Click here to register ymin for the display of the quantity");
02314   fVminD_MCs_ChNbBut->SetBackgroundColor(SubDetColor);
02315   fLayoutVminD_MCs_ChNbBut =
02316     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                             fCnew++;
02317   fVminD_MCs_ChNbFrame->AddFrame(fVminD_MCs_ChNbBut,  fLayoutVminD_MCs_ChNbBut);
02318   fEntryVminD_MCs_ChNbNumber = new TGTextBuffer();                                            fCnew++;
02319   fVminD_MCs_ChNbText = new TGTextEntry(fVminD_MCs_ChNbFrame, fEntryVminD_MCs_ChNbNumber);    fCnew++;
02320   fVminD_MCs_ChNbText->SetToolTipText("Click and enter ymin");
02321   fVminD_MCs_ChNbText->Resize(minmax_buf_lenght, fVminD_MCs_ChNbText->GetDefaultHeight());
02322   DisplayInEntryField(fVminD_MCs_ChNbText,fKeyVminD_MCs_ChNb);
02323   fVminD_MCs_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminD_MCs_ChNb()");
02324   fLayoutVminD_MCs_ChNbFieldText =
02325     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                         fCnew++;
02326   fVminD_MCs_ChNbFrame->AddFrame(fVminD_MCs_ChNbText, fLayoutVminD_MCs_ChNbFieldText);
02327   fLayoutVminD_MCs_ChNbFrame =
02328     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                            fCnew++;
02329   fVmmD_MCs_ChNbFrame->AddFrame(fVminD_MCs_ChNbFrame, fLayoutVminD_MCs_ChNbFrame);
02330 
02331   //...................................... Frame for Mean cor(s,s')
02332   TString xMenuD_MCs_ChNb = "     Mean cor(s,s') ";
02333   fMenuD_MCs_ChNb = new TGPopupMenu(gClient->GetRoot());                                   fCnew++;
02334   fMenuD_MCs_ChNb->AddEntry(xHistoChannels,fMenuD_MCs_ChNbFullC);
02335   fMenuD_MCs_ChNb->AddEntry(xHistoChannelsSame,fMenuD_MCs_ChNbSameC);
02336   fMenuD_MCs_ChNb->AddEntry(xHistoChannelsSameP,fMenuD_MCs_ChNbSamePC);
02337   fMenuD_MCs_ChNb->AddSeparator();
02338   fMenuD_MCs_ChNb->AddEntry(xHocoVecoViewSorS,fMenuD_MCs_ChNbHocoVecoC);
02339   fMenuD_MCs_ChNb->AddSeparator();
02340   fMenuD_MCs_ChNb->AddEntry(xAsciiFileStex,fMenuD_MCs_ChNbAsciiFileC);
02341   fMenuD_MCs_ChNb->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02342   fMenuBarD_MCs_ChNb = new TGMenuBar(fVmmD_MCs_ChNbFrame, 1, 1, kHorizontalFrame);         fCnew++;
02343   fMenuBarD_MCs_ChNb->AddPopup(xMenuD_MCs_ChNb, fMenuD_MCs_ChNb, fLayoutGeneral);
02344   fLayoutMenuBarD_MCs_ChNb = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);             fCnew++;
02345   fVmmD_MCs_ChNbFrame->AddFrame(fMenuBarD_MCs_ChNb, fLayoutMenuBarD_MCs_ChNb);
02346 
02347   fLayoutVmmD_MCs_ChNbFrame =
02348     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                         fCnew++;
02349   fStexHozFrame->AddFrame(fVmmD_MCs_ChNbFrame, fLayoutVmmD_MCs_ChNbFrame);
02350 
02351   //########################################### Composite frame for SIG OF COR(s,s')
02352   fVmmD_SCs_ChNbFrame = new TGCompositeFrame 
02353     (fStexHozFrame,60,20, kHorizontalFrame, kSunkenFrame);                                 fCnew++;
02354 
02355   //...................................... Menu sig of Corss
02356   //...................................... Frame for Ymax
02357   fVmaxD_SCs_ChNbFrame = new TGCompositeFrame
02358     (fVmmD_SCs_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                           fCnew++;
02359   //...................................... Button Max + Entry field
02360   fVmaxD_SCs_ChNbBut = new TGTextButton(fVmaxD_SCs_ChNbFrame, xYmaxButText);               fCnew++;
02361   fVmaxD_SCs_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxD_SCs_ChNb()");
02362   fVmaxD_SCs_ChNbBut->SetToolTipText("Click here to register ymax for the display of the quantity");
02363   fVmaxD_SCs_ChNbBut->SetBackgroundColor(SubDetColor);
02364   fLayoutVmaxD_SCs_ChNbBut =
02365     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                          fCnew++;
02366   fVmaxD_SCs_ChNbFrame->AddFrame(fVmaxD_SCs_ChNbBut,  fLayoutVmaxD_SCs_ChNbBut);
02367   fEntryVmaxD_SCs_ChNbNumber = new TGTextBuffer();                                         fCnew++;
02368   fVmaxD_SCs_ChNbText = new TGTextEntry(fVmaxD_SCs_ChNbFrame, fEntryVmaxD_SCs_ChNbNumber); fCnew++;
02369   fVmaxD_SCs_ChNbText->SetToolTipText("Click and enter ymax");
02370   fVmaxD_SCs_ChNbText->Resize(minmax_buf_lenght, fVmaxD_SCs_ChNbText->GetDefaultHeight());
02371   DisplayInEntryField(fVmaxD_SCs_ChNbText,fKeyVmaxD_SCs_ChNb);
02372   fVmaxD_SCs_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxD_SCs_ChNb()");
02373   fLayoutVmaxD_SCs_ChNbFieldText =
02374     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                      fCnew++;
02375   fVmaxD_SCs_ChNbFrame->AddFrame(fVmaxD_SCs_ChNbText, fLayoutVmaxD_SCs_ChNbFieldText);
02376   fLayoutVmaxD_SCs_ChNbFrame =
02377     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                         fCnew++;
02378   fVmmD_SCs_ChNbFrame->AddFrame(fVmaxD_SCs_ChNbFrame, fLayoutVmaxD_SCs_ChNbFrame);
02379 
02380   //...................................... Frame for Ymin
02381   fVminD_SCs_ChNbFrame = new TGCompositeFrame
02382     (fVmmD_SCs_ChNbFrame,60,20, kHorizontalFrame, kSunkenFrame);                           fCnew++;
02383   //...................................... Button Min + Entry field 
02384   fVminD_SCs_ChNbBut = new TGTextButton(fVminD_SCs_ChNbFrame, xYminButText);               fCnew++;
02385   fVminD_SCs_ChNbBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminD_SCs_ChNb()");
02386   fVminD_SCs_ChNbBut->SetToolTipText("Click here to register ymin for the display of the quantity");
02387   fVminD_SCs_ChNbBut->SetBackgroundColor(SubDetColor);
02388   fLayoutVminD_SCs_ChNbBut =
02389     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                          fCnew++;
02390   fVminD_SCs_ChNbFrame->AddFrame(fVminD_SCs_ChNbBut,  fLayoutVminD_SCs_ChNbBut);
02391   fEntryVminD_SCs_ChNbNumber = new TGTextBuffer();                                         fCnew++;
02392   fVminD_SCs_ChNbText = new TGTextEntry(fVminD_SCs_ChNbFrame, fEntryVminD_SCs_ChNbNumber); fCnew++;
02393   fVminD_SCs_ChNbText->SetToolTipText("Click and enter ymin");
02394   fVminD_SCs_ChNbText->Resize(minmax_buf_lenght, fVminD_SCs_ChNbText->GetDefaultHeight());
02395   DisplayInEntryField(fVminD_SCs_ChNbText,fKeyVminD_SCs_ChNb);
02396   fVminD_SCs_ChNbText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminD_SCs_ChNb()");
02397   fLayoutVminD_SCs_ChNbFieldText =
02398     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                 fCnew++;
02399   fVminD_SCs_ChNbFrame->AddFrame(fVminD_SCs_ChNbText, fLayoutVminD_SCs_ChNbFieldText);
02400   fLayoutVminD_SCs_ChNbFrame =
02401     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                    fCnew++;
02402   fVmmD_SCs_ChNbFrame->AddFrame(fVminD_SCs_ChNbFrame, fLayoutVminD_SCs_ChNbFrame);
02403 
02404   //...................................... Frame
02405   TString xMenuD_SCs_ChNb = "   Sigma of cor(s,s') ";
02406   fMenuD_SCs_ChNb = new TGPopupMenu(gClient->GetRoot());                              fCnew++;
02407   fMenuD_SCs_ChNb->AddEntry(xHistoChannels,fMenuD_SCs_ChNbFullC);
02408   fMenuD_SCs_ChNb->AddEntry(xHistoChannelsSame,fMenuD_SCs_ChNbSameC);
02409   fMenuD_SCs_ChNb->AddEntry(xHistoChannelsSameP,fMenuD_SCs_ChNbSamePC);
02410   fMenuD_SCs_ChNb->AddSeparator();
02411   fMenuD_SCs_ChNb->AddEntry(xHocoVecoViewSorS,fMenuD_SCs_ChNbHocoVecoC);
02412   fMenuD_SCs_ChNb->AddSeparator();
02413   fMenuD_SCs_ChNb->AddEntry(xAsciiFileStex,fMenuD_SCs_ChNbAsciiFileC);
02414   fMenuD_SCs_ChNb->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02415   fMenuBarD_SCs_ChNb = new TGMenuBar(fVmmD_SCs_ChNbFrame, 1, 1, kHorizontalFrame);    fCnew++;
02416   fMenuBarD_SCs_ChNb->AddPopup(xMenuD_SCs_ChNb, fMenuD_SCs_ChNb, fLayoutGeneral);
02417   fLayoutMenuBarD_SCs_ChNb = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);        fCnew++;
02418   fVmmD_SCs_ChNbFrame->AddFrame(fMenuBarD_SCs_ChNb, fLayoutMenuBarD_SCs_ChNb);
02419 
02420   fLayoutVmmD_SCs_ChNbFrame =
02421     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                    fCnew++;
02422   fStexHozFrame->AddFrame(fVmmD_SCs_ChNbFrame, fLayoutVmmD_SCs_ChNbFrame);
02423 
02424   //######################################################################################################"
02425 
02426   //------------------------------------------- subframe
02427   fLayoutStexHozFrame =
02428     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1, xB1, xB1, xB1);                fCnew++;
02429   fStexUpFrame->AddFrame(fStexHozFrame, fLayoutStexHozFrame);
02430   AddFrame(fVoidFrame, fLayoutGeneral);
02431 
02432   //########################################### Composite frame corcc in Stins
02433   fVmmLHFccFrame = new TGCompositeFrame
02434     (fStexUpFrame,60,20, kHorizontalFrame, kSunkenFrame);                            fCnew++;
02435  
02436   //............ Menu Low and High Frequency correlations between channels for each Stin of Stex
02437   //...................................... Frame for Ymax
02438   fVmaxLHFccFrame = new TGCompositeFrame
02439     (fVmmLHFccFrame,60,20, kHorizontalFrame, kSunkenFrame);                          fCnew++;
02440   //...................................... Button Max + Entry field 
02441   fVmaxLHFccBut = new TGTextButton(fVmaxLHFccFrame, xYmaxButText);                   fCnew++;
02442   fVmaxLHFccBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxLHFcc()");
02443   fVmaxLHFccBut->SetToolTipText("Click here to register ymax for the display of the quantity");
02444   fVmaxLHFccBut->SetBackgroundColor(SubDetColor);
02445   fLayoutVmaxLHFccBut =
02446     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                    fCnew++;
02447   fVmaxLHFccFrame->AddFrame(fVmaxLHFccBut,  fLayoutVmaxLHFccBut);
02448   fEntryVmaxLHFccNumber = new TGTextBuffer();                                        fCnew++;
02449   fVmaxLHFccText = new TGTextEntry(fVmaxLHFccFrame, fEntryVmaxLHFccNumber);          fCnew++;
02450   fVmaxLHFccText->SetToolTipText("Click and enter ymax");
02451   fVmaxLHFccText->Resize(minmax_buf_lenght, fVmaxLHFccText->GetDefaultHeight());
02452   DisplayInEntryField(fVmaxLHFccText, fKeyVmaxLHFcc);
02453   fVmaxLHFccText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxLHFcc()");
02454 
02455   fLayoutVmaxLHFccFieldText =
02456     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                fCnew++;
02457   fVmaxLHFccFrame->AddFrame(fVmaxLHFccText, fLayoutVmaxLHFccFieldText);
02458   fLayoutVmaxLHFccFrame =
02459     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                   fCnew++;
02460   fVmmLHFccFrame->AddFrame(fVmaxLHFccFrame, fLayoutVmaxLHFccFrame);
02461 
02462   //...................................... Frame for Ymin
02463   fVminLHFccFrame = new TGCompositeFrame
02464     (fVmmLHFccFrame,60,20, kHorizontalFrame, kSunkenFrame);                          fCnew++;
02465   //...................................... Button Min + Entry field
02466   fVminLHFccBut = new TGTextButton(fVminLHFccFrame, xYminButText);                   fCnew++;
02467   fVminLHFccBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminLHFcc()");
02468   fVminLHFccBut->SetToolTipText("Click here to register ymin for the display of the quantity");
02469   fVminLHFccBut->SetBackgroundColor(SubDetColor);
02470   fLayoutVminLHFccBut =
02471     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                    fCnew++;
02472   fVminLHFccFrame->AddFrame(fVminLHFccBut,  fLayoutVminLHFccBut);
02473   fEntryVminLHFccNumber = new TGTextBuffer();                                        fCnew++;
02474   fVminLHFccText = new TGTextEntry(fVminLHFccFrame, fEntryVminLHFccNumber);          fCnew++;
02475   fVminLHFccText->SetToolTipText("Click and enter ymin");
02476   fVminLHFccText->Resize(minmax_buf_lenght, fVminLHFccText->GetDefaultHeight());
02477   DisplayInEntryField(fVminLHFccText,fKeyVminLHFcc);
02478   fVminLHFccText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminLHFcc()");
02479   fLayoutVminLHFccFieldText =
02480     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                fCnew++;
02481   fVminLHFccFrame->AddFrame(fVminLHFccText, fLayoutVminLHFccFieldText);
02482   fLayoutVminLHFccFrame =
02483     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                   fCnew++;
02484   fVmmLHFccFrame->AddFrame(fVminLHFccFrame, fLayoutVminLHFccFrame);
02485 
02486   //........................................... Frame
02487   TString xMenuLHFcc = "GeoView LF,HF Cor(c,c') (expert)";
02488   TString xLFccViewSorS;
02489   if( fSubDet == "EB" ){xLFccViewSorS = "Low Frequency Cor(c,c'), tower place -> Cor matrix";}
02490   if( fSubDet == "EE" ){xLFccViewSorS = "Low Frequency Cor(c,c'), SC place -> Cor matrix";}
02491   TString xHFccViewSorS;
02492   if( fSubDet == "EB" ){xHFccViewSorS = "High Frequency Cor(c,c'), tower place -> Cor matrix";}
02493   if( fSubDet == "EE" ){xHFccViewSorS = "High Frequency Cor(c,c'), SC place -> Cor matrix";}
02494 
02495   fMenuLHFcc = new TGPopupMenu(gClient->GetRoot());                                  fCnew++;
02496   fMenuLHFcc->AddEntry(xLFccViewSorS,fMenuLFccColzC);
02497   fMenuLHFcc->AddEntry(xHFccViewSorS,fMenuHFccColzC);
02498   fMenuLHFcc->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02499   fMenuBarLHFcc = new TGMenuBar(fVmmLHFccFrame, 1, 1, kHorizontalFrame);             fCnew++;
02500   fMenuBarLHFcc->AddPopup(xMenuLHFcc, fMenuLHFcc, fLayoutGeneral);
02501   fLayoutMenuBarLHFcc = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);            fCnew++;
02502   fVmmLHFccFrame->AddFrame(fMenuBarLHFcc, fLayoutMenuBarLHFcc);
02503   fLayoutVmmLHFccFrame =
02504     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                   fCnew++;
02505   fStexUpFrame->AddFrame(fVmmLHFccFrame, fLayoutVmmLHFccFrame);
02506 
02507   //################################# Composite frame Low Freq Cor(c,c') for each pair of Stins
02508   fVmmLFccMosFrame = new TGCompositeFrame
02509     (fStexUpFrame,60,20, kHorizontalFrame, kSunkenFrame);                            fCnew++;
02510  
02511   //...................................... Menu correlations between Stins 
02512   //...................................... Frame
02513   fVmaxLFccMosFrame = new TGCompositeFrame
02514     (fVmmLFccMosFrame,60,20, kHorizontalFrame, kSunkenFrame);                        fCnew++;
02515   //...................................... Button Max + Entry field 
02516   fVmaxLFccMosBut = new TGTextButton(fVmaxLFccMosFrame, xYmaxButText);               fCnew++;
02517   fVmaxLFccMosBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxLFccMos()");
02518   fVmaxLFccMosBut->SetToolTipText("Click here to register ymax for the display of the quantity");
02519   fVmaxLFccMosBut->SetBackgroundColor(SubDetColor);
02520   fLayoutVmaxLFccMosBut =
02521     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                    fCnew++;
02522   fVmaxLFccMosFrame->AddFrame(fVmaxLFccMosBut,  fLayoutVmaxLFccMosBut);
02523   fEntryVmaxLFccMosNumber = new TGTextBuffer();                                      fCnew++;
02524   fVmaxLFccMosText = new TGTextEntry(fVmaxLFccMosFrame, fEntryVmaxLFccMosNumber);    fCnew++;
02525   fVmaxLFccMosText->SetToolTipText("Click and enter ymax");
02526   fVmaxLFccMosText->Resize(minmax_buf_lenght, fVmaxLFccMosText->GetDefaultHeight());
02527   DisplayInEntryField(fVmaxLFccMosText, fKeyVmaxLFccMos);
02528   fVmaxLFccMosText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxLFccMos()");
02529 
02530   fLayoutVmaxLFccMosFieldText =
02531     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                fCnew++;
02532   fVmaxLFccMosFrame->AddFrame(fVmaxLFccMosText, fLayoutVmaxLFccMosFieldText);
02533   fLayoutVmaxLFccMosFrame =
02534     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                   fCnew++;
02535   fVmmLFccMosFrame->AddFrame(fVmaxLFccMosFrame, fLayoutVmaxLFccMosFrame);
02536 
02537   //...................................... Frame for Ymin
02538   fVminLFccMosFrame = new TGCompositeFrame
02539     (fVmmLFccMosFrame,60,20, kHorizontalFrame, kSunkenFrame);                        fCnew++;
02540   //...................................... Button Min + Entry field 
02541   fVminLFccMosBut = new TGTextButton(fVminLFccMosFrame, xYminButText);               fCnew++;
02542   fVminLFccMosBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminLFccMos()");
02543   fVminLFccMosBut->SetToolTipText("Click here to register ymin for the display of the quantity");
02544   fVminLFccMosBut->SetBackgroundColor(SubDetColor);
02545   fLayoutVminLFccMosBut =
02546     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                    fCnew++;
02547   fVminLFccMosFrame->AddFrame(fVminLFccMosBut,  fLayoutVminLFccMosBut);
02548   fEntryVminLFccMosNumber = new TGTextBuffer();                                      fCnew++;
02549   fVminLFccMosText = new TGTextEntry(fVminLFccMosFrame, fEntryVminLFccMosNumber);    fCnew++;
02550   fVminLFccMosText->SetToolTipText("Click and enter ymin");
02551   fVminLFccMosText->Resize(minmax_buf_lenght, fVminLFccMosText->GetDefaultHeight());
02552   DisplayInEntryField(fVminLFccMosText,fKeyVminLFccMos);
02553   fVminLFccMosText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminLFccMos()");
02554   fLayoutVminLFccMosFieldText =
02555     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                fCnew++;
02556   fVminLFccMosFrame->AddFrame(fVminLFccMosText, fLayoutVminLFccMosFieldText);
02557   fLayoutVminLFccMosFrame =
02558     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                   fCnew++;
02559   fVmmLFccMosFrame->AddFrame(fVminLFccMosFrame, fLayoutVminLFccMosFrame);
02560 
02561   //...................................... Frame
02562   TString xMenuLFccMos;
02563   if( fSubDet == "EB" ){xMenuLFccMos = "Mean LF |Cor(c,c')| in (tow,tow')";}
02564   if( fSubDet == "EE" ){xMenuLFccMos = "Mean LF |Cor(c,c')| in (SC,SC')";}
02565 
02566   fMenuLFccMos = new TGPopupMenu(gClient->GetRoot());                                fCnew++;
02567   fMenuLFccMos->AddEntry("2D, COLZ ",fMenuLFccMosColzC);
02568   fMenuLFccMos->AddEntry("3D, LEGO2Z" ,fMenuLFccMosLegoC);
02569   fMenuLFccMos->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02570   fMenuBarLFccMos = new TGMenuBar(fVmmLFccMosFrame, 1, 1, kHorizontalFrame);         fCnew++;
02571   fMenuBarLFccMos->AddPopup(xMenuLFccMos, fMenuLFccMos, fLayoutGeneral);
02572   fLayoutMenuBarLFccMos = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);          fCnew++;
02573   fVmmLFccMosFrame->AddFrame(fMenuBarLFccMos, fLayoutMenuBarLFccMos);
02574   fLayoutVmmLFccMosFrame =
02575     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                   fCnew++;
02576   fStexUpFrame->AddFrame(fVmmLFccMosFrame, fLayoutVmmLFccMosFrame);
02577  
02578   //################################# Composite frame High Freq Cor(c,c') for each pair of Stins
02579   fVmmHFccMosFrame = new TGCompositeFrame
02580     (fStexUpFrame,60,20, kHorizontalFrame, kSunkenFrame);                            fCnew++;
02581  
02582   //...................................... Menu correlations between Stins 
02583   //...................................... Frame
02584   fVmaxHFccMosFrame = new TGCompositeFrame
02585     (fVmmHFccMosFrame,60,20, kHorizontalFrame, kSunkenFrame);                        fCnew++;
02586   //...................................... Button Max + Entry field 
02587   fVmaxHFccMosBut = new TGTextButton(fVmaxHFccMosFrame, xYmaxButText);               fCnew++;
02588   fVmaxHFccMosBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVmaxHFccMos()");
02589   fVmaxHFccMosBut->SetToolTipText("Click here to register ymax for the display of the quantity");
02590   fVmaxHFccMosBut->SetBackgroundColor(SubDetColor);
02591   fLayoutVmaxHFccMosBut =
02592     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                    fCnew++;
02593   fVmaxHFccMosFrame->AddFrame(fVmaxHFccMosBut,  fLayoutVmaxHFccMosBut);
02594   fEntryVmaxHFccMosNumber = new TGTextBuffer();                                      fCnew++;
02595   fVmaxHFccMosText = new TGTextEntry(fVmaxHFccMosFrame, fEntryVmaxHFccMosNumber);    fCnew++;
02596   fVmaxHFccMosText->SetToolTipText("Click and enter ymax");
02597   fVmaxHFccMosText->Resize(minmax_buf_lenght, fVmaxHFccMosText->GetDefaultHeight());
02598   DisplayInEntryField(fVmaxHFccMosText, fKeyVmaxHFccMos);
02599   fVmaxHFccMosText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVmaxHFccMos()");
02600 
02601   fLayoutVmaxHFccMosFieldText =
02602     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                fCnew++;
02603   fVmaxHFccMosFrame->AddFrame(fVmaxHFccMosText, fLayoutVmaxHFccMosFieldText);
02604   fLayoutVmaxHFccMosFrame =
02605     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                   fCnew++;
02606   fVmmHFccMosFrame->AddFrame(fVmaxHFccMosFrame, fLayoutVmaxHFccMosFrame);
02607 
02608   //...................................... Frame for Ymin
02609   fVminHFccMosFrame = new TGCompositeFrame
02610     (fVmmHFccMosFrame,60,20, kHorizontalFrame, kSunkenFrame);                        fCnew++;
02611   //...................................... Button Min + Entry field 
02612   fVminHFccMosBut = new TGTextButton(fVminHFccMosFrame, xYminButText);               fCnew++;
02613   fVminHFccMosBut->Connect("Clicked()","TEcnaGui", this, "DoButtonVminHFccMos()");
02614   fVminHFccMosBut->SetToolTipText("Click here to register ymin for the display of the quantity");
02615   fVminHFccMosBut->SetBackgroundColor(SubDetColor);
02616   fLayoutVminHFccMosBut =
02617     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);                    fCnew++;
02618   fVminHFccMosFrame->AddFrame(fVminHFccMosBut,  fLayoutVminHFccMosBut);
02619   fEntryVminHFccMosNumber = new TGTextBuffer();                                      fCnew++;
02620   fVminHFccMosText = new TGTextEntry(fVminHFccMosFrame, fEntryVminHFccMosNumber);    fCnew++;
02621   fVminHFccMosText->SetToolTipText("Click and enter ymin");
02622   fVminHFccMosText->Resize(minmax_buf_lenght, fVminHFccMosText->GetDefaultHeight());
02623   DisplayInEntryField(fVminHFccMosText,fKeyVminHFccMos);
02624   fVminHFccMosText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonVminHFccMos()");
02625   fLayoutVminHFccMosFieldText =
02626     new TGLayoutHints(kLHintsBottom | kLHintsRight, xB1,xB1,xB1,xB1);                fCnew++;
02627   fVminHFccMosFrame->AddFrame(fVminHFccMosText, fLayoutVminHFccMosFieldText);
02628   fLayoutVminHFccMosFrame =
02629     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                   fCnew++;
02630   fVmmHFccMosFrame->AddFrame(fVminHFccMosFrame, fLayoutVminHFccMosFrame);
02631 
02632   //...................................... Frame
02633   TString xMenuHFccMos;
02634   if( fSubDet == "EB" ){xMenuHFccMos = "Mean HF |Cor(c,c')| in (tow,tow')";}
02635   if( fSubDet == "EE" ){xMenuHFccMos = "Mean HF |Cor(c,c')| in (SC,SC')";}
02636 
02637   fMenuHFccMos = new TGPopupMenu(gClient->GetRoot());                                fCnew++;
02638   fMenuHFccMos->AddEntry("2D, COLZ ",fMenuHFccMosColzC);
02639   fMenuHFccMos->AddEntry("3D, LEGO2Z" ,fMenuHFccMosLegoC);
02640   fMenuHFccMos->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02641   fMenuBarHFccMos = new TGMenuBar(fVmmHFccMosFrame, 1, 1, kHorizontalFrame);         fCnew++;
02642   fMenuBarHFccMos->AddPopup(xMenuHFccMos, fMenuHFccMos, fLayoutGeneral);
02643   fLayoutMenuBarHFccMos = new TGLayoutHints(kLHintsRight, xB1,xB1,xB1,xB1);          fCnew++;
02644   fVmmHFccMosFrame->AddFrame(fMenuBarHFccMos, fLayoutMenuBarHFccMos);
02645   fLayoutVmmHFccMosFrame =
02646     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1);                   fCnew++;
02647   fStexUpFrame->AddFrame(fVmmHFccMosFrame, fLayoutVmmHFccMosFrame);
02648  
02649 
02650   //======================================= "Stex" frame =====================================
02651   fLayoutStexUpFrame =
02652     new TGLayoutHints(kLHintsTop | kLHintsCenterX, xB1, xB1, xB1, xB1);              fCnew++;
02653   AddFrame(fStexUpFrame, fLayoutStexUpFrame);
02654 
02655   AddFrame(fVoidFrame, fLayoutGeneral);
02656 
02657   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02658   //
02659   //                             SECTOR 3: Stin's
02660   //
02661   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02662 
02663   //-------------------------------- Stin A & Stin B FRAME
02664   fStinSpFrame =
02665     new TGCompositeFrame(this,60,20,kHorizontalFrame,
02666                          GetDefaultFrameBackground());                               fCnew++;
02667 
02668   TString xStinAButText = "?";
02669   TString xStinBButText = "?";
02670   Int_t Stin_buf_lenght = 10;
02671 
02672   if ( fSubDet == "EB" )
02673     {xStinAButText = "      Tower# [1,68]     "; xStinBButText  = "     Tower'# [1,68]      "; Stin_buf_lenght =  50;}
02674   if ( fSubDet == "EE" && ( fKeyStexNumber == 1 || fKeyStexNumber == 3 ) )
02675     {xStinAButText = "SC# for const. [150,298] "; xStinBButText  = "SC'# for const. [150,298] "; Stin_buf_lenght =  50;}
02676   if ( fSubDet == "EE" && ( fKeyStexNumber == 2 || fKeyStexNumber == 4 ) )
02677     {xStinAButText = "SC# for const. [  1,149] "; xStinBButText  = "SC'# for const. [  1,149] "; Stin_buf_lenght =  50;}
02678 
02679   //============================= STIN A =====================================
02680   TString xStinNumberText;
02681   if ( fSubDet == "EB" )
02682     {xStinNumberText = "Click here to register the tower number written on the right";}
02683   if ( fSubDet == "EE" )
02684     {xStinNumberText = "Click here to register the SC number written on the right";}
02685 
02686   TString xStinNumberValue;
02687   if ( fSubDet == "EB" )
02688     {xStinNumberValue = "Click and enter the tower number";}
02689   if ( fSubDet == "EE" )
02690     {xStinNumberValue = "Click and enter the SC number";}
02691 
02692   fTxSubFrame = new TGCompositeFrame
02693     (fStinSpFrame,60,20,kVerticalFrame, GetDefaultFrameBackground());     fCnew++;
02694 
02695   fStinAFrame = new TGCompositeFrame
02696     (fTxSubFrame,60,20,kHorizontalFrame,kSunkenFrame);                    fCnew++;
02697 
02698   fStinABut = new TGTextButton(fStinAFrame, xStinAButText, fStinAButC);   fCnew++;
02699   fStinABut->Connect("Clicked()","TEcnaGui", this, "DoButtonStinA()");
02700   fStinABut->SetToolTipText(xStinNumberText);
02701   fStinABut->Resize(Stin_buf_lenght, fStinABut->GetDefaultHeight());
02702   fStinABut->SetBackgroundColor(SubDetColor);
02703   fLayoutStinABut =
02704     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);         fCnew++;
02705   fStinAFrame->AddFrame(fStinABut,  fLayoutStinABut);
02706 
02707   fEntryStinANumber = new TGTextBuffer();                                 fCnew++;
02708   fStinAText = new TGTextEntry(fStinAFrame, fEntryStinANumber);           fCnew++;
02709   fStinAText->SetToolTipText(xStinNumberValue);
02710   fStinAText->Resize(Stin_buf_lenght, fStinAText->GetDefaultHeight());
02711 
02712   Int_t StinAValue = 0;
02713   if( fSubDet == "EB"){StinAValue = fKeyStinANumber;}
02714   if( fSubDet == "EE" && fKeyStexNumber != 0 )
02715     {StinAValue = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinANumber);}
02716   DisplayInEntryField(fStinAText,StinAValue);
02717 
02718   fStinAText->Connect("ReturnPressed()", "TEcnaGui",this, "DoButtonStinA()");
02719   fLayoutStinAField =
02720     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1 );        fCnew++;
02721   fStinAFrame->AddFrame(fStinAText, fLayoutStinAField);
02722   fTxSubFrame->AddFrame(fStinAFrame, fLayoutGeneral);
02723 
02724   //========================== STIN A CRYSTAL NUMBERING VIEW
02725   TString xChNbButText;
02726   if ( fSubDet == "EB" ){xChNbButText = "Tower Xtal Numbering ";}
02727   if ( fSubDet == "EE" ){xChNbButText = "   SC Xtal Numbering  ";}
02728 
02729   fButChNb = new TGTextButton(fTxSubFrame, xChNbButText, fButChNbC);      fCnew++;
02730   fButChNb->Connect("Clicked()","TEcnaGui", this, "DoButtonChNb()");
02731   fButChNb->SetBackgroundColor(SubDetColor);
02732   fLayoutChNbBut =
02733     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);      fCnew++;
02734   fTxSubFrame->AddFrame(fButChNb, fLayoutChNbBut); 
02735 
02736   //---------------- menus relative to the Stin A subframe 
02737 
02738   //===================== Menus relative to the Stin A ======================
02739   TString xMenuBarCorGlob;
02740   if ( fSubDet == "EB" ){xMenuBarCorGlob = " GeoView Cor(s,s') (expert)";}
02741   if ( fSubDet == "EE" ){xMenuBarCorGlob = " GeoView Cor(s,s') (expert)";}
02742 
02743   TString xMenuBarCovGlob;
02744   if ( fSubDet == "EB" ){xMenuBarCovGlob = " GeoView Cov(s,s') (expert)";}
02745   if ( fSubDet == "EE" ){xMenuBarCovGlob = " GeoView Cov(s,s') (expert)";}
02746 
02747   //................. Menu correlations between samples for all the channels. Global view
02748   fMenuCorssAll = new TGPopupMenu(gClient->GetRoot());                      fCnew++;
02749   fMenuCorssAll->AddEntry(" Cor(s,s'), Xtal place -> Cor matrix",fMenuCorssAllColzC);
02750   fMenuCorssAll->AddEntry(" Cov(s,s'), Xtal place -> Cov matrix",fMenuCovssAllColzC);
02751   fMenuCorssAll->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02752   fMenuBarCorssAll =  new TGMenuBar(fTxSubFrame, 1, 1, kHorizontalFrame);   fCnew++;
02753   fMenuBarCorssAll->AddPopup(xMenuBarCorGlob, fMenuCorssAll, fLayoutGeneral);
02754   fTxSubFrame->AddFrame(fMenuBarCorssAll, fLayoutTopLeft);
02755 
02756   //................. Menu covariances between samples for all the channels. Global view
02757   //fMenuCovssAll = new TGPopupMenu(gClient->GetRoot());                      fCnew++;
02758   //fMenuCovssAll->AddEntry(" Cov(s,s'), Xtal place -> Cov matrix",fMenuCovssAllColzC);
02759   //fMenuCovssAll->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02760   //fMenuBarCovssAll =  new TGMenuBar(fTxSubFrame, 1, 1, kHorizontalFrame);   fCnew++;
02761   //fMenuBarCovssAll->AddPopup(xMenuBarCovGlob, fMenuCovssAll, fLayoutGeneral);
02762   //fTxSubFrame->AddFrame(fMenuBarCovssAll, fLayoutTopLeft);
02763 
02764   //------------------ Add Stin A frame to the subframe 
02765   fLayoutTxSubFrame = 
02766     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);        fCnew++;
02767   fStinSpFrame->AddFrame(fTxSubFrame, fLayoutTxSubFrame);
02768 
02769   //============================= STIN B =====================================
02770   fTySubFrame = new TGCompositeFrame
02771     (fStinSpFrame,60,20,kVerticalFrame, GetDefaultFrameBackground());  fCnew++;
02772 
02773   fStinBFrame = new TGCompositeFrame
02774     (fTySubFrame,60,20,kHorizontalFrame,kSunkenFrame);                 fCnew++;
02775 
02776   fStinBBut =
02777     new TGTextButton(fStinBFrame, xStinBButText, fStinBButC);          fCnew++;
02778   fStinBBut->Connect("Clicked()","TEcnaGui", this, "DoButtonStinB()");
02779   fStinBBut->SetToolTipText(xStinNumberText);
02780   fStinBBut->Resize(Stin_buf_lenght, fStinBBut->GetDefaultHeight());
02781   fStinBBut->SetBackgroundColor(SubDetColor);
02782   fLayoutStinBBut = new TGLayoutHints(kLHintsLeft, xB1,xB1,xB1,xB1);   fCnew++;
02783   fStinBFrame->AddFrame(fStinBBut,  fLayoutStinBBut);
02784 
02785   fEntryStinBNumber = new TGTextBuffer();                              fCnew++;
02786   fStinBText = new TGTextEntry(fStinBFrame, fEntryStinBNumber);        fCnew++;
02787   fStinBText->SetToolTipText(xStinNumberValue);
02788   fStinBText->Resize(Stin_buf_lenght, fStinBText->GetDefaultHeight());
02789 
02790   Int_t StinBValue = 0;
02791   if( fSubDet == "EB"){StinBValue = fKeyStinBNumber;}
02792   if( fSubDet == "EE" && fKeyStexNumber != 0 )
02793     {StinBValue = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinBNumber);}
02794   DisplayInEntryField(fStinBText, StinBValue);
02795 
02796   fStinBText->Connect("ReturnPressed()", "TEcnaGui",this, "DoButtonStinB()");
02797   fLayoutStinBField =
02798     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1 );    fCnew++;
02799   fStinBFrame->AddFrame(fStinBText, fLayoutStinBField);
02800   fTySubFrame->AddFrame(fStinBFrame, fLayoutGeneral);
02801 
02802   //---------------- menus relative to the Stin B subframe 
02803 
02804   //                    (no such menus )
02805 
02806   //------------------ Add Stin B subframe to the frame 
02807   fLayoutTySubFrame =  new TGLayoutHints
02808     (kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);                   fCnew++;
02809 
02810   fStinSpFrame->AddFrame(fTySubFrame, fLayoutTySubFrame);
02811 
02812   //---------------------- composite frame (Stin X, Stin Y)
02813   fLayoutStinSpFrame =  new TGLayoutHints
02814     (kLHintsTop | kLHintsCenterX, xB1, xB1, xB1, xB1);                fCnew++;
02815   AddFrame(fStinSpFrame, fLayoutStinSpFrame);
02816 
02817   //------------------ menus relatives to the Horizontal frame (Stin_A + Stin_B)
02818   TString xMenuBarLFCorcc;
02819   if ( fSubDet == "EB" ){xMenuBarLFCorcc = " Low Frequency Cor(Xtal tower, Xtal tower')";}
02820   if ( fSubDet == "EE" ){xMenuBarLFCorcc = " Low Frequency Cor(Xtal SC, Xtal SC')";}
02821 
02822   TString xMenuBarHFCorcc;
02823   if ( fSubDet == "EB" ){xMenuBarHFCorcc = " High Frequency Cor(Xtal tower, Xtal tower')";}
02824   if ( fSubDet == "EE" ){xMenuBarHFCorcc = " High Frequency Cor(Xtal SC, Xtal SC')";}
02825 
02826   //...................... Menu LF correlations between channels
02827   fMenuLFCorcc = new TGPopupMenu(gClient->GetRoot());                   fCnew++;
02828   fMenuLFCorcc->AddEntry("2D, COLZ",fMenuLFCorccColzC);
02829   fMenuLFCorcc->AddSeparator();
02830   fMenuLFCorcc->AddEntry("3D, LEGO2Z",fMenuLFCorccLegoC);
02831   fMenuLFCorcc->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02832   fMenuBarLFCorcc = new TGMenuBar(this, 1, 1, kHorizontalFrame);        fCnew++;
02833   fMenuBarLFCorcc->AddPopup(xMenuBarLFCorcc, fMenuLFCorcc, fLayoutTopRight);
02834   AddFrame(fMenuBarLFCorcc, fLayoutGeneral);
02835 
02836   //...................... Menu HF correlations between channels
02837   fMenuHFCorcc = new TGPopupMenu(gClient->GetRoot());                   fCnew++;
02838   fMenuHFCorcc->AddEntry("2D, COLZ",fMenuHFCorccColzC);
02839   fMenuHFCorcc->AddSeparator();
02840   fMenuHFCorcc->AddEntry("3D, LEGO2Z",fMenuHFCorccLegoC);
02841   fMenuHFCorcc->Connect("Activated(Int_t)", "TEcnaGui", this,"HandleMenu(Int_t)");
02842   fMenuBarHFCorcc = new TGMenuBar(this, 1, 1, kHorizontalFrame);        fCnew++;
02843   fMenuBarHFCorcc->AddPopup(xMenuBarHFCorcc, fMenuHFCorcc, fLayoutTopRight);
02844   AddFrame(fMenuBarHFCorcc, fLayoutGeneral);
02845 
02846   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02847   //
02848   //                             SECTOR 4: Channels, Samples
02849   //
02850   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02851 
02852   fChSpFrame = new TGCompositeFrame(this,60,20,kHorizontalFrame,
02853                                     GetDefaultFrameBackground());     fCnew++;
02854 
02855   TString xChanButText;
02856   if ( fSubDet == "EB" ){xChanButText = " Channel# in tower [0,24] ";}
02857   if ( fSubDet == "EE" ){xChanButText = " Crystal# in SC [1,25] ";}
02858 
02859   TString xSampButText  = " Sample# [1,10] ";
02860 
02861   Int_t chan_buf_lenght =  50;
02862   Int_t samp_buf_lenght =  50;
02863 
02864   TString xMenuBarCorss    = " Correlations between samples";
02865   TString xMenuBarCovss    = " Covariances between samples";
02866   TString xMenuBarEvs      = " Sample means";
02867   TString xMenuBarSigs     = " Sample sigmas";
02868 
02869   //=================================== CHANNEL (CRYSTAL)
02870   fChSubFrame = new TGCompositeFrame
02871     (fChSpFrame,60,20,kVerticalFrame, GetDefaultFrameBackground());   fCnew++;
02872 
02873   fChanFrame = new TGCompositeFrame
02874     (fChSubFrame,60,20,kHorizontalFrame,kSunkenFrame);                fCnew++;
02875 
02876   fChanBut =
02877     new TGTextButton(fChanFrame, xChanButText, fChanButC);            fCnew++;
02878   fChanBut->Connect("Clicked()","TEcnaGui", this, "DoButtonChan()");
02879   fChanBut->SetToolTipText("Click here to register the channel number written to the right");
02880   fChanBut->Resize(chan_buf_lenght, fChanBut->GetDefaultHeight());
02881   fChanBut->SetBackgroundColor(SubDetColor);
02882   fLayoutChanBut = new TGLayoutHints(kLHintsLeft, xB1,xB1,xB1,xB1);   fCnew++;
02883   fChanFrame->AddFrame(fChanBut,  fLayoutChanBut);
02884 
02885   fEntryChanNumber = new TGTextBuffer();                              fCnew++;
02886   fChanText = new TGTextEntry(fChanFrame, fEntryChanNumber);          fCnew++;
02887   fChanText->SetToolTipText("Click and enter the channel number");
02888   fChanText->Resize(chan_buf_lenght, fChanText->GetDefaultHeight());
02889 
02890   Int_t xReadChanNumber = 0;
02891   if( fSubDet == "EB" ){xReadChanNumber = 0;}         // offset =  0 (EB: electronic channel number)
02892   if( fSubDet == "EE" ){xReadChanNumber = 1;}         // offset = +1 (EE: xtal number for construction)
02893   DisplayInEntryField(fChanText, xReadChanNumber);
02894 
02895   fChanText->Connect("ReturnPressed()", "TEcnaGui",this, "DoButtonChan()");
02896   fLayoutChanField =
02897     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1 );    fCnew++;
02898   fChanFrame->AddFrame(fChanText, fLayoutChanField);
02899   fChSubFrame->AddFrame(fChanFrame, fLayoutGeneral);
02900 
02901   //--------------------- Menus relative to the channel SubFrame -------------
02902   //...................... Menu correlations between samples
02903 
02904   fMenuCorss = new TGPopupMenu(gClient->GetRoot());                   fCnew++;
02905   fMenuCorss->AddEntry("2D, COLZ", fMenuCorssColzC);
02906   fMenuCorss->AddEntry("2D, BOX",  fMenuCorssBoxC);
02907   fMenuCorss->AddEntry("2D, TEXT", fMenuCorssTextC);
02908   fMenuCorss->AddEntry("2D, CONTZ",fMenuCorssContzC);
02909   fMenuCorss->AddSeparator();
02910   fMenuCorss->AddEntry("3D, LEGO2Z",fMenuCorssLegoC);
02911   fMenuCorss->AddEntry("3D, SURF1Z",fMenuCorssSurf1C);
02912   fMenuCorss->AddEntry("3D, SURF2Z",fMenuCorssSurf2C);
02913   fMenuCorss->AddEntry("3D, SURF3Z",fMenuCorssSurf3C);
02914   fMenuCorss->AddEntry("3D, SURF4" ,fMenuCorssSurf4C);
02915   fMenuCorss->AddSeparator();
02916   fMenuCorss->AddEntry("2D, Write in ASCII file",fMenuCorssAsciiFileC);
02917   fMenuCorss->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02918   fMenuBarCorss = new TGMenuBar(fChSubFrame, 1, 1, kHorizontalFrame); fCnew++;
02919   fMenuBarCorss->AddPopup(xMenuBarCorss, fMenuCorss, fLayoutTopLeft);
02920   fChSubFrame->AddFrame(fMenuBarCorss, fLayoutTopLeft);
02921 
02922   //...................... Menu covariances between samples
02923 
02924   fMenuCovss = new TGPopupMenu(gClient->GetRoot());                   fCnew++;
02925   fMenuCovss->AddEntry("2D, COLZ", fMenuCovssColzC);
02926   fMenuCovss->AddEntry("2D, BOX",  fMenuCovssBoxC);
02927   fMenuCovss->AddEntry("2D, TEXT", fMenuCovssTextC);
02928   fMenuCovss->AddEntry("2D, CONTZ",fMenuCovssContzC);
02929   fMenuCovss->AddSeparator();
02930   fMenuCovss->AddEntry("3D, LEGO2Z",fMenuCovssLegoC);
02931   fMenuCovss->AddEntry("3D, SURF1Z",fMenuCovssSurf1C);
02932   fMenuCovss->AddEntry("3D, SURF2Z",fMenuCovssSurf2C);
02933   fMenuCovss->AddEntry("3D, SURF3Z",fMenuCovssSurf3C);
02934   fMenuCovss->AddEntry("3D, SURF4" ,fMenuCovssSurf4C);
02935   fMenuCovss->AddSeparator();
02936   fMenuCovss->AddEntry("2D, Write in ASCII file",fMenuCovssAsciiFileC);
02937   fMenuCovss->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02938   fMenuBarCovss = new TGMenuBar(fChSubFrame, 1, 1, kHorizontalFrame); fCnew++;
02939   fMenuBarCovss->AddPopup(xMenuBarCovss, fMenuCovss, fLayoutTopLeft);
02940   fChSubFrame->AddFrame(fMenuBarCovss, fLayoutTopLeft);
02941 
02942   //...................... Menu expectation values of the samples
02943 
02944   fMenuD_MSp_SpNb = new TGPopupMenu(gClient->GetRoot());                      fCnew++;
02945   fMenuD_MSp_SpNb->AddEntry("1D Histo ",fMenuD_MSp_SpNbLineFullC);
02946   fMenuD_MSp_SpNb->AddEntry("1D Histo SAME",fMenuD_MSp_SpNbLineSameC);
02947   fMenuD_MSp_SpNb->AddEntry("1D Histo 25 Xtals",fMenuD_MSp_SpNbLineAllStinC);
02948   fMenuD_MSp_SpNb->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02949   fMenuBarD_MSp_SpNb = new TGMenuBar(fChSubFrame, 1, 1, kHorizontalFrame);    fCnew++;
02950   fMenuBarD_MSp_SpNb->AddPopup(xMenuBarEvs, fMenuD_MSp_SpNb, fLayoutTopLeft);
02951   fChSubFrame->AddFrame(fMenuBarD_MSp_SpNb, fLayoutTopLeft);
02952 
02953   //...................... Menu sigmas/variances of the samples
02954 
02955   fMenuD_SSp_SpNb = new TGPopupMenu(gClient->GetRoot());                     fCnew++;
02956   fMenuD_SSp_SpNb->AddEntry("1D Histo ",fMenuD_SSp_SpNbLineFullC);
02957   fMenuD_SSp_SpNb->AddEntry("1D Histo SAME",fMenuD_SSp_SpNbLineSameC);
02958   fMenuD_SSp_SpNb->AddEntry("1D Histo 25 Xtals",fMenuD_SSp_SpNbLineAllStinC);
02959   fMenuD_SSp_SpNb->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
02960   fMenuBarD_SSp_SpNb = new TGMenuBar(fChSubFrame, 1, 1, kHorizontalFrame);   fCnew++;
02961   fMenuBarD_SSp_SpNb->AddPopup(xMenuBarSigs, fMenuD_SSp_SpNb, fLayoutTopLeft);
02962   fChSubFrame->AddFrame(fMenuBarD_SSp_SpNb, fLayoutTopLeft);
02963 
02964   //------------------ Add Channel subframe to the frame 
02965   fLayoutChSubFrame =  new TGLayoutHints
02966     (kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);                   fCnew++;
02967   fChSpFrame->AddFrame(fChSubFrame, fLayoutChSubFrame);
02968 
02969   //=================================== SAMPLE
02970   fSpSubFrame = new TGCompositeFrame
02971     (fChSpFrame,60,20,kVerticalFrame, GetDefaultFrameBackground());   fCnew++;
02972 
02973   fSampFrame = new TGCompositeFrame
02974     (fSpSubFrame,60,20,kHorizontalFrame, kSunkenFrame);               fCnew++;
02975 
02976   fSampBut = new TGTextButton(fSampFrame, xSampButText, fSampButC);   fCnew++;
02977   fSampBut->Connect("Clicked()","TEcnaGui", this, "DoButtonSamp()");
02978   fSampBut->SetToolTipText("Click here to register the sample number written to the right");
02979   fSampBut->Resize(samp_buf_lenght, fSampBut->GetDefaultHeight());
02980   fSampBut->SetBackgroundColor(SubDetColor);
02981   fLayoutSampBut =
02982     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);     fCnew++;
02983   fSampFrame->AddFrame(fSampBut, fLayoutSampBut);
02984 
02985   fEntrySampNumber = new TGTextBuffer();                              fCnew++;
02986   fSampText = new TGTextEntry(fSampFrame, fEntrySampNumber);          fCnew++;
02987   fSampText->SetToolTipText("Click and enter the sample number");
02988   fSampText->Resize(samp_buf_lenght, fSampText->GetDefaultHeight());
02989   Int_t xKeySampNumber = fKeySampNumber+1;
02990   DisplayInEntryField(fSampText, xKeySampNumber);
02991   fSampText->Connect("ReturnPressed()", "TEcnaGui",this, "DoButtonSamp()");
02992   fLayoutSampField =
02993     new TGLayoutHints(kLHintsTop | kLHintsRight, xB1,xB1,xB1,xB1 );   fCnew++;
02994   fSampFrame->AddFrame(fSampText, fLayoutSampField);
02995 
02996   fSpSubFrame->AddFrame(fSampFrame,fLayoutGeneral);
02997 
02998   fLayoutSpSubFrame =  new TGLayoutHints
02999     (kLHintsTop | kLHintsRight, xB1, xB1, xB1, xB1);                  fCnew++;
03000   fChSpFrame->AddFrame(fSpSubFrame, fLayoutSpSubFrame);
03001 
03002   //---------------------- composite frame (channel/sample+menus)
03003   fLayoutChSpFrame =  new TGLayoutHints
03004     (kLHintsTop | kLHintsCenterX, xB1, xB1, xB1, xB1);                fCnew++;
03005   AddFrame(fChSpFrame, fLayoutChSpFrame);
03006 
03007   //====================== Menu histogram of the distribution
03008   //                       for a given (channel, sample)
03009   fMenuAdcProj = new TGPopupMenu(gClient->GetRoot());                 fCnew++;
03010   fMenuAdcProj->AddEntry("1D Histo ",fMenuAdcProjSampLineFullC);
03011   fMenuAdcProj->AddEntry("1D Histo SAME",fMenuAdcProjSampLineSameC);
03012   fMenuAdcProj->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
03013 
03014   fMenuBarAdcProj = new TGMenuBar(this, 1, 1, kHorizontalFrame);      fCnew++;
03015 
03016   TString xEvtDistrib;
03017   xEvtDistrib = "ADC sample values for (Xtal, Sample)";
03018 
03019   fMenuBarAdcProj->AddPopup(xEvtDistrib, fMenuAdcProj, fLayoutGeneral);
03020 
03021   fLayoutMenuBarAdcProj =
03022     new TGLayoutHints(kLHintsCenterX, xB1,xB1,xB1,xB1);               fCnew++;
03023   AddFrame(fMenuBarAdcProj, fLayoutMenuBarAdcProj);
03024 
03025   AddFrame(fVoidFrame, fLayoutGeneral);
03026 
03027   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03028   //
03029   //                             SECTOR 5: Time Evolution / history plots
03030   //
03031   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03032   TString xRunListButText = " List of run file name for history plots ";
03033   Int_t run_list_buf_lenght = 170;
03034 
03035   fRulFrame = new TGCompositeFrame(this,60,20, kHorizontalFrame, kSunkenFrame); fCnew++;
03036   
03037   fRulBut= new TGTextButton(fRulFrame, xRunListButText);                        fCnew++;
03038   fRulBut->Connect("Clicked()","TEcnaGui", this, "DoButtonRul()");
03039   fRulBut->SetToolTipText
03040     ("Click here to register the name of the file \n containing the run list (written on the right)");
03041   fRulBut->SetBackgroundColor(SubDetColor);
03042   fLayoutRulBut =
03043     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);     fCnew++;
03044   fRulFrame->AddFrame(fRulBut,  fLayoutRulBut);
03045 
03046   fEntryRulNumber = new TGTextBuffer();                               fCnew++;
03047   fRulText = new TGTextEntry(fRulFrame, fEntryRulNumber);             fCnew++;
03048   fRulText->SetToolTipText("Click and enter the name of the file \n containing the run list");
03049   fRulText->Resize(run_list_buf_lenght, fRulText->GetDefaultHeight());
03050   fRulText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonRul()");
03051   fLayoutRulFieldText =
03052     new TGLayoutHints(kLHintsBottom | kLHintsLeft, xB1,xB1,xB1,xB1);  fCnew++;
03053   fRulFrame->AddFrame(fRulText, fLayoutRulFieldText);
03054 
03055   fLayoutRulFieldFrame =
03056     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);     fCnew++;
03057   AddFrame(fRulFrame, fLayoutRulFieldFrame);
03058 
03059   //...................... Menu history plot (evolution in time)
03060   TString xMenuBarHistory = " Menu for history plots";
03061   fMenuHistory = new TGPopupMenu(gClient->GetRoot());                 fCnew++;
03062   fMenuHistory->AddEntry("1D, Pedestals ",fMenuH_Ped_DatePolmFullC);
03063   fMenuHistory->AddEntry("1D, Pedestals SAME",fMenuH_Ped_DatePolmSameC);
03064   fMenuHistory->AddSeparator();
03065   fMenuHistory->AddEntry("1D, Total Noise ",fMenuH_TNo_DatePolmFullC);
03066   fMenuHistory->AddEntry("1D, Total Noise SAME",fMenuH_TNo_DatePolmSameC);
03067   fMenuHistory->AddEntry("1D, Total Noise SAME n",fMenuH_TNo_DatePolmSamePC);
03068   fMenuHistory->AddSeparator();
03069   fMenuHistory->AddEntry("1D, Low Frequency Noise ",fMenuH_LFN_DatePolmFullC);
03070   fMenuHistory->AddEntry("1D, Low Frequency Noise SAME",fMenuH_LFN_DatePolmSameC);
03071   fMenuHistory->AddEntry("1D, Low Frequency Noise SAME n",fMenuH_LFN_DatePolmSamePC);
03072   fMenuHistory->AddSeparator();
03073   fMenuHistory->AddEntry("1D, High Frequency Noise ",fMenuH_HFN_DatePolmFullC);
03074   fMenuHistory->AddEntry("1D, High Frequency Noise SAME",fMenuH_HFN_DatePolmSameC);
03075   fMenuHistory->AddEntry("1D, High Frequency Noise SAME n",fMenuH_HFN_DatePolmSamePC);
03076   fMenuHistory->AddSeparator();
03077   fMenuHistory->AddEntry("1D, Mean cor(s,s') ",fMenuH_MCs_DatePolmFullC);
03078   fMenuHistory->AddEntry("1D, Mean cor(s,s') SAME",fMenuH_MCs_DatePolmSameC);
03079   fMenuHistory->AddEntry("1D, Mean cor(s,s') SAME n",fMenuH_MCs_DatePolmSamePC);
03080   fMenuHistory->AddSeparator();
03081   fMenuHistory->AddEntry("1D, Sigma of cor(s,s') ",fMenuH_SCs_DatePolmFullC);
03082   fMenuHistory->AddEntry("1D, Sigma of cor(s,s') SAME",fMenuH_SCs_DatePolmSameC);
03083   fMenuHistory->AddEntry("1D, Sigma of cor(s,s') SAME n",fMenuH_SCs_DatePolmSamePC);
03084 
03085   fMenuHistory->Connect("Activated(Int_t)", "TEcnaGui", this, "HandleMenu(Int_t)");
03086   fMenuBarHistory = new TGMenuBar(this , 1, 1, kHorizontalFrame);        fCnew++;
03087   fMenuBarHistory->AddPopup(xMenuBarHistory, fMenuHistory, fLayoutTopLeft);
03088   AddFrame(fMenuBarHistory, fLayoutTopLeft);
03089 
03090   AddFrame(fVoidFrame, fLayoutGeneral);
03091 
03092   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03093   //
03094   //                             SECTOR 6: Last Buttons
03095   //
03096   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
03097 
03098   //GContext_t   norm = GetDefaultGC()();
03099   //FontStruct_t font = GetDefaultFontStruct();
03100 
03101   //========================== LinLog frame: buttons: LinX/LogX, LinY/LogY, Projection on Y Axis
03102 
03103   fLinLogFrame = new TGCompositeFrame(this,60,20, kHorizontalFrame, kSunkenFrame);    fCnew++;
03104 
03105 
03106   //-------------------------- Lin X <-> Log X
03107   TString xLogxButText     = " LOG X ";
03108   fButLogx = new TGCheckButton(fLinLogFrame, xLogxButText, fButLogxC);             fCnew++;
03109   fButLogx->Connect("Clicked()","TEcnaGui", this, "DoButtonLogx()");
03110   fButLogx->SetBackgroundColor(SubDetColor);
03111   fLayoutLogxBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);   fCnew++;
03112   fLinLogFrame->AddFrame(fButLogx, fLayoutLogxBut);
03113 
03114   //-------------------------- Lin Y <-> Log Y
03115   TString xLogyButText     = " LOG Y ";
03116   fButLogy = new TGCheckButton(fLinLogFrame, xLogyButText, fButLogyC);             fCnew++;
03117   fButLogy->Connect("Clicked()","TEcnaGui", this, "DoButtonLogy()");
03118   fButLogy->SetBackgroundColor(SubDetColor);
03119   fLayoutLogyBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);   fCnew++;
03120   fLinLogFrame->AddFrame(fButLogy, fLayoutLogyBut);
03121 
03122   //-------------------------- Projection
03123   TString xProjyButText     = " Y projection ";
03124   fButProjy = new TGCheckButton(fLinLogFrame, xProjyButText, fButProjyC);           fCnew++;
03125   fButProjy->Connect("Clicked()","TEcnaGui", this, "DoButtonProjy()");
03126   fButProjy->SetBackgroundColor(SubDetColor);
03127   fLayoutProjyBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);  fCnew++;
03128   fLinLogFrame->AddFrame(fButProjy, fLayoutProjyBut);
03129 
03130   AddFrame(fVoidFrame, fLayoutBottRight);
03131   AddFrame(fLinLogFrame, fLayoutGeneral);
03132 
03133   //======================================== GENERAL TITLE FOR THE PLOTS
03134   TString xGenTitleButText  = " General title for plots ";
03135   Int_t gen_title_buf_lenght  = 220;
03136 
03137   fGentFrame = new TGCompositeFrame(this,60,20, kHorizontalFrame, kSunkenFrame); fCnew++;
03138   
03139   fGentBut= new TGTextButton(fGentFrame, xGenTitleButText);                      fCnew++;
03140   fGentBut->Connect("Clicked()","TEcnaGui", this, "DoButtonGent()");
03141   fGentBut->SetToolTipText
03142     ("Click here to register the general title (written on the right)");
03143   fGentBut->SetBackgroundColor(SubDetColor);
03144   fLayoutGentBut =
03145     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);       fCnew++;
03146   fGentFrame->AddFrame(fGentBut,  fLayoutGentBut);
03147 
03148   fEntryGentNumber = new TGTextBuffer();                                fCnew++;
03149   fGentText = new TGTextEntry(fGentFrame, fEntryGentNumber);            fCnew++;
03150   fGentText->SetToolTipText("Click and enter the general title");
03151   fGentText->Resize(gen_title_buf_lenght, fGentText->GetDefaultHeight());
03152   DisplayInEntryField(fGentText, fKeyGeneralTitle);
03153   fGentText->Connect("ReturnPressed()", "TEcnaGui", this, "DoButtonGent()");
03154   fLayoutGentFieldText =
03155     new TGLayoutHints(kLHintsBottom | kLHintsLeft, xB1,xB1,xB1,xB1);    fCnew++;
03156   fGentFrame->AddFrame(fGentText, fLayoutGentFieldText);
03157 
03158   fLayoutGentFieldFrame =
03159     new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1,xB1,xB1,xB1);       fCnew++;
03160   AddFrame(fGentFrame, fLayoutGentFieldFrame);
03161   AddFrame(fVoidFrame);
03162 
03163   //========================== Color Palette + EXIT
03164   fColorExitFrame = new TGCompositeFrame(this,60,20, kHorizontalFrame,
03165                                          GetDefaultFrameBackground());  fCnew++;
03166 
03167   //-------------------------- Black/Red/Blue <-> Rainbow
03168   TString xColPalButText     = " Colors ";
03169   fButColPal = new TGCheckButton(fColorExitFrame, xColPalButText, fButColPalC);          fCnew++;
03170   fButColPal->Connect("Clicked()","TEcnaGui", this, "DoButtonColPal()");
03171   fButColPal->SetBackgroundColor(SubDetColor);
03172   fLayoutColPalBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1); fCnew++;
03173   fColorExitFrame->AddFrame(fButColPal, fLayoutColPalBut);
03174 
03175   //-------------------------- Exit
03176   TString xExitButText     = " Exit ";
03177   fButExit = new TGTextButton(fColorExitFrame, xExitButText, fButExitC);              fCnew++;
03178   fButExit->Connect("Clicked()","TEcnaGui", this, "DoButtonExit()");
03179   fButExit->SetBackgroundColor(SubDetColor);
03180   fLayoutExitBut = new TGLayoutHints(kLHintsTop | kLHintsRight, xB1, xB1, xB1, xB1);  fCnew++;
03181   fColorExitFrame->AddFrame(fButExit, fLayoutExitBut);
03182  
03183   fLayoutColorExitFrame =  new TGLayoutHints(kLHintsTop | kLHintsExpandX,
03184                                              xB1, xB1, xB1, xB1);     fCnew++;
03185 
03186   //AddFrame(fVoidFrame, fLayoutBottRight);
03187   AddFrame(fColorExitFrame, fLayoutColorExitFrame);
03188 
03189   //========================== Last frame: buttons: ROOT version, Help
03190 
03191   fLastFrame = new TGCompositeFrame(this,60,20, kHorizontalFrame, kSunkenFrame);      fCnew++;
03192 
03193   //-------------------------- Clone Last Canvas
03194   TString xCloneButText     = " Clone Last Canvas ";
03195   fButClone = new TGTextButton(fLastFrame, xCloneButText, fButCloneC);                fCnew++;
03196   fButClone->Connect("Clicked()","TEcnaGui", this, "DoButtonClone()");
03197   fButClone->SetBackgroundColor(SubDetColor);
03198   fLayoutCloneBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);  fCnew++;
03199   fLastFrame->AddFrame(fButClone, fLayoutCloneBut);
03200 
03201   //-------------------------- ROOT version
03202   TString xRootButText     = " ROOT Version ";
03203   fButRoot = new TGTextButton(fLastFrame, xRootButText, fButRootC);                   fCnew++;
03204   fButRoot->Connect("Clicked()","TEcnaGui", this, "DoButtonRoot()");
03205   fButRoot->SetBackgroundColor(SubDetColor);
03206   fLayoutRootBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);   fCnew++;
03207   fLastFrame->AddFrame(fButRoot, fLayoutRootBut);
03208 
03209   //-------------------------- HELP
03210   TString xHelpButText     = " Help ";
03211   fButHelp = new TGTextButton(fLastFrame, xHelpButText, fButHelpC);                   fCnew++;
03212   fButHelp->Connect("Clicked()","TEcnaGui", this, "DoButtonHelp()");
03213   fButHelp->SetBackgroundColor(SubDetColor);
03214   fLayoutHelpBut = new TGLayoutHints(kLHintsTop | kLHintsLeft, xB1, xB1, xB1, xB1);   fCnew++;
03215   fLastFrame->AddFrame(fButHelp, fLayoutHelpBut);
03216 
03217   AddFrame(fLastFrame, fLayoutGeneral);
03218 
03219   //................................. Window
03220 
03221   MapSubwindows();
03222   Layout();
03223 
03224   if( fSubDet == "EB" ){SetWindowName("CMS  Ecal Correlated Noise Analysis  <EB>");}
03225   if( fSubDet == "EE" ){SetWindowName("CMS  Ecal Correlated Noise Analysis  <EE>");}
03226 
03227   SetBackgroundColor(SubDetColor);
03228   SetIconName("CNA");
03229   MapWindow();
03230   // } // end of if( fCnaParPaths-GetPaths() == kTRUE )
03231 }
03232 //   end of constructor with arguments
03233 
03234 //###################################################################
03235 //
03236 //                        M E T H O D S
03237 //
03238 //###################################################################
03239 
03240 //===============================================================
03241 //
03242 //                          Buttons
03243 //
03244 //===============================================================
03245 
03246 //----------------------------------------------------------------------
03247 //void TEcnaGui::DoButtonPyf()
03248 //{
03251   
03252 //  //........................... get info from the entry field
03253 //  char* listchain = (char*)fPyfText->GetBuffer()->GetString();  
03254 //  fKeyPyf = listchain;
03255   
03256 //  fCnaCommand++;
03257 //  cout << "   *TEcnaGui [" << fCnaCommand
03258 //       << "]> Registration of file name for python file source sector -> "
03259 //       << fKeyPyf.Data() << endl;
03260 //}
03261 //----------------------------------------------------------------------
03262 void TEcnaGui::DoButtonAna()
03263 {
03264 //Registration of the type of the analysis
03265 
03266   char* bufferchain;
03267   bufferchain = (char*)fAnaText->GetBuffer()->GetString();
03268 
03269   fKeyAnaType = bufferchain;
03270   
03271   fCnaCommand++;
03272   cout << "   *TEcnaGui [" << fCnaCommand
03273        << "]> Registration of analysis name -> "
03274        << fKeyAnaType << endl;
03275 }
03276 
03277 //----------------------------------------------------------------------
03278 void TEcnaGui::DoButtonNors()
03279 {
03280 //Registration of the number of samples (ROOT file)
03281 
03282   char* bufferchain;
03283   bufferchain = (char*)fNorsText->GetBuffer()->GetString();
03284   fKeyNbOfSamplesString = bufferchain;
03285   fKeyNbOfSamples = atoi(bufferchain);
03286 
03287   if ( !(fKeyNbOfSamples >= 1 && fKeyNbOfSamples <= fEcal->MaxSampADC()) )
03288     {
03289       fCnaError++;
03290       cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===>"
03291            << " Number of required samples for reading ROOT file = " << fKeyNbOfSamples
03292            << ": OUT OF RANGE, " << endl 
03293            << "                                        forced to the default value (="
03294            << fEcal->MaxSampADC() << ")." << fTTBELL << endl;
03295       fKeyNbOfSamples = fEcal->MaxSampADC();
03296       DisplayInEntryField(fNorsText,fKeyNbOfSamples);
03297     }
03298 
03299   //................... Update of Sample Button Text according to the number of sample
03300   TString xSampButText = " Sample [?,?] ";
03301   
03302   if( fKeyNbOfSamples ==  1 ){xSampButText  = " Sample [1,1] ";}
03303   if( fKeyNbOfSamples ==  2 ){xSampButText  = " Sample [1,2] ";}
03304   if( fKeyNbOfSamples ==  3 ){xSampButText  = " Sample [1,3] ";}
03305   if( fKeyNbOfSamples ==  4 ){xSampButText  = " Sample [1,4] ";}
03306   if( fKeyNbOfSamples ==  5 ){xSampButText  = " Sample [1,5] ";}
03307   if( fKeyNbOfSamples ==  6 ){xSampButText  = " Sample [1,6] ";}
03308   if( fKeyNbOfSamples ==  7 ){xSampButText  = " Sample [1,7] ";}
03309   if( fKeyNbOfSamples ==  8 ){xSampButText  = " Sample [1,8] ";}
03310   if( fKeyNbOfSamples ==  9 ){xSampButText  = " Sample [1,9] ";}
03311   if( fKeyNbOfSamples == 10 ){xSampButText  = " Sample [1,10] ";}
03312   
03313   fSampBut->SetText(xSampButText);
03314   
03315   fCnaCommand++;
03316   cout << "   *TEcnaGui [" << fCnaCommand
03317        << "]> Registration of number of samples in ROOT file -> "
03318        << fKeyNbOfSamples << endl;
03319 }
03320 //----------------------------------------------------------------------
03321 void TEcnaGui::DoButtonNbSampForCalc()
03322 {
03323 //Registration of the number of samples (ROOT file)
03324 
03325   char* bufferchain;
03326   bufferchain = (char*)fNbSampForCalcText->GetBuffer()->GetString();
03327   fKeyNbOfSampForCalcString = bufferchain;
03328   fKeyNbOfSampForCalc = atoi(bufferchain);
03329 
03330   if ( !(fKeyNbOfSampForCalc >= 1 && fKeyNbOfSampForCalc <= fKeyNbOfSamples) )
03331     {
03332       fCnaError++;
03333       cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===>"
03334            << " Number of required samples for calculations = " << fKeyNbOfSampForCalc
03335            << ": OUT OF RANGE, " << endl 
03336            << "                                        forced to the default value (="
03337            << fKeyNbOfSamples << ")." << fTTBELL << endl;
03338       fKeyNbOfSampForCalc = fKeyNbOfSamples;
03339       DisplayInEntryField(fNbSampForCalcText,fKeyNbOfSampForCalc);
03340     }
03341   fCnaCommand++;
03342   cout << "   *TEcnaGui [" << fCnaCommand
03343        << "]> Registration of number of samples for calculations -> "
03344        << fKeyNbOfSampForCalc << endl;
03345 }
03346 
03347 //----------------------------------------------------------------------
03348 void TEcnaGui::DoButtonRun()
03349 {
03350 //Register run number
03351   
03352   //........................... get info from the entry field
03353   char* bufferchain = (char*)fRunText->GetBuffer()->GetString();
03354   fKeyRunNumberString = bufferchain;
03355   fKeyRunNumber = atoi(bufferchain);
03356   fCnaCommand++;
03357   cout << "   *TEcnaGui [" << fCnaCommand
03358        << "]> Registration of run number -> "
03359        << fKeyRunNumber << endl;
03360 }
03361 //-------------------------------------------------------------------
03362 
03363 void TEcnaGui::DoButtonFev()
03364 {
03365 //Registration of the first requested event number
03366 
03367   char* bufferchain;
03368   bufferchain = (char*)fFevText->GetBuffer()->GetString();
03369   fKeyFirstReqEvtNumberString = bufferchain;
03370   fKeyFirstReqEvtNumber = atoi(bufferchain);
03371 
03372   if ( fKeyFirstReqEvtNumber <= 0)
03373     {
03374       fCnaError++;
03375       cout << "   !TEcnaGui (" << fCnaError << ") *ERROR* ===> "
03376            << " First event number = " << fKeyFirstReqEvtNumber
03377            << ": negative. " << endl 
03378            << fTTBELL << endl;
03379     }
03380 
03381   fCnaCommand++;
03382   cout << "   *TEcnaGui [" << fCnaCommand
03383        << "]> Registration of first requested event number -> "
03384        << fKeyFirstReqEvtNumber << endl;
03385 }
03386 //-------------------------------------------------------------------
03387 void TEcnaGui::DoButtonLev()
03388 {
03389 //Registration of the last requested event number
03390 
03391   char* bufferchain;
03392   bufferchain = (char*)fLevText->GetBuffer()->GetString();
03393   fKeyLastReqEvtNumberString = bufferchain;
03394   fKeyLastReqEvtNumber = atoi(bufferchain);
03395 
03396   if ( fKeyLastReqEvtNumber <= fKeyFirstReqEvtNumber )
03397     {
03398       fCnaError++;
03399       cout << "   !TEcnaGui (" << fCnaError << ") *WARNING* ===> "
03400            << " Last requested event number = " << fKeyLastReqEvtNumber
03401            << ": less than first requested event number (= " << fKeyFirstReqEvtNumber << ")." 
03402            << endl;
03403     }
03404 
03405   fCnaCommand++;
03406   cout << "   *TEcnaGui [" << fCnaCommand
03407        << "]> Registration of last requested event number -> "
03408        << fKeyLastReqEvtNumber << endl;
03409 }
03410 //-------------------------------------------------------------------
03411 void TEcnaGui::DoButtonRev()
03412 {
03413 //Registration of the nb ofrequested events
03414 
03415   char* bufferchain;
03416   bufferchain = (char*)fRevText->GetBuffer()->GetString();
03417   fKeyReqNbOfEvtsString = bufferchain;
03418   fKeyReqNbOfEvts = atoi(bufferchain);
03419 
03420   Int_t nb_range_evts = fKeyLastReqEvtNumber - fKeyFirstReqEvtNumber + 1;
03421 
03422   if( fKeyLastReqEvtNumber < fKeyFirstReqEvtNumber)
03423     {
03424       fCnaError++;
03425       cout << "   !TEcnaGui (" << fCnaError << ") *WARNING* ===> "
03426            << " Last requested event number = " << fKeyLastReqEvtNumber
03427            << " less than first requested event number = " << fKeyFirstReqEvtNumber
03428            << endl;
03429     }
03430 
03431   if ( fKeyLastReqEvtNumber >= fKeyFirstReqEvtNumber && fKeyReqNbOfEvts > nb_range_evts )
03432     {
03433       fCnaError++;
03434       cout << "   !TEcnaGui (" << fCnaError << ") *WARNING* ===> "
03435            << " Nb of requested events = " << fKeyReqNbOfEvts
03436            << ": out of range (range = " << fKeyFirstReqEvtNumber << ","
03437            << fKeyLastReqEvtNumber << ") => " << nb_range_evts << " events."
03438            << endl;
03439     }
03440 
03441   fCnaCommand++;
03442   cout << "   *TEcnaGui [" << fCnaCommand
03443        << "]> Registration of requested number of events -> "
03444        << fKeyReqNbOfEvts << endl;
03445 }
03446 
03447 //-------------------------------------------------------------------
03448 void TEcnaGui::DoButtonStex()
03449 {
03450 //Registration of the Stex number
03451 
03452   char* bufferchain;
03453   bufferchain = (char*)fStexText->GetBuffer()->GetString();
03454   fKeyStexNumberString = bufferchain;
03455   fKeyStexNumber = atoi(bufferchain);
03456 
03457   if( fSubDet == "EB" )
03458     {
03459       fCnaCommand++;
03460       cout << "   *TEcnaGui [" << fCnaCommand
03461            << "]> Registration of SuperModule number -> "
03462            << fKeyStexNumber << endl;
03463 
03464       //.......... Positive number for EB- [-1,-18] -> [19,36]  
03465       if( fKeyStexNumber < 0 ){fKeyStexNumber = - fKeyStexNumber + fEcal->MaxSMInEB()/2;}
03466 
03467       if( (fKeyStexNumber < 0) || (fKeyStexNumber > fEcal->MaxSMInEB() )  )
03468         {
03469           fCnaError++;
03470           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
03471                << " EB / SM number = " << fKeyStexNumber
03472                << ": out of range. Range = 0 (EB) or [ 1 ," << fEcal->MaxSMInEB() << " ] (SM)"
03473                << " or [ -" << fEcal->MaxSMInEBMinus() << ", +" <<  fEcal->MaxSMInEBPlus() << "] (SM)"
03474                << fTTBELL << endl;
03475         }
03476     }
03477 
03478   if( fSubDet == "EE" )
03479     {
03480       //................... Update of SC Button Text according to the Dee Number
03481       TString xStinAButText = "?";
03482       TString xStinBButText = "?";
03483       if ( fSubDet == "EE" && ( fKeyStexNumber == 1 || fKeyStexNumber == 3 ) )
03484         {xStinAButText = "SC for const. [150,298] "; xStinBButText  = "SC' for const. [150,298] ";
03485         fStinABut->SetText(xStinAButText); fStinBBut->SetText(xStinBButText);}
03486       if ( fSubDet == "EE" && ( fKeyStexNumber == 2 || fKeyStexNumber == 4 ) )
03487         {xStinAButText = "SC for const. [  1,149] "; xStinBButText  = "SC' for const. [  1,149] ";
03488         fStinABut->SetText(xStinAButText); fStinBBut->SetText(xStinBButText);}
03489 
03490       if ( fSubDet == "EE" && ( fKeyStexNumber == 0 ) )
03491         {xStinAButText = "SC for const.           "; xStinBButText  = "SC' for const.           ";
03492         fStinABut->SetText(xStinAButText); fStinBBut->SetText(xStinBButText);}
03493       
03494       //................... Update of SC widget according to the Dee Number
03495       if( fKeyStexNumber > 0 )
03496         {
03497           Int_t StinAValue = fKeyStinANumber;
03498           if( fSubDet == "EE" )
03499             {StinAValue = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinANumber);}
03500           DisplayInEntryField(fStinAText,StinAValue);
03501           Int_t StinBValue = fKeyStinBNumber;
03502           if( fSubDet == "EE" )
03503             {StinBValue = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinBNumber);}
03504           DisplayInEntryField(fStinBText,StinBValue);
03505         }
03506       //............................................ Command message
03507       fCnaCommand++;
03508       cout << "   *TEcnaGui [" << fCnaCommand
03509            << "]> Registration of Dee number -> "
03510            << fKeyStexNumber << endl;
03511       
03512       if ( (fKeyStexNumber < 0) || (fKeyStexNumber > fEcal->MaxDeeInEE() )  )
03513         {
03514           fCnaError++;
03515           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
03516                << " EE / Dee number = " << fKeyStexNumber
03517                << ": out of range. Range = 0 (EE) or [ 1 ," << fEcal->MaxDeeInEE() << " ] (Dee)"
03518                << fTTBELL << endl;
03519         }
03520     }  // -- end of if( fSubDet == "EE" ) -------
03521 }
03522 //-------------------------------------------------------------------
03523 
03524 void TEcnaGui::DoButtonVminD_NOE_ChNb()
03525 {
03526 //Registration of Ymin for number of events
03527 
03528   char* bufferchain;
03529   bufferchain = (char*)fVminD_NOE_ChNbText->GetBuffer()->GetString();
03530 
03531   fKeyVminD_NOE_ChNb = (Double_t)atof(bufferchain);
03532 
03533   fCnaCommand++;
03534   cout << "   *TEcnaGui [" << fCnaCommand
03535        << "]> Registration of Ymin for plot 'number of events' -> "
03536        << fKeyVminD_NOE_ChNb << endl;
03537 }
03538 //-------------------------------------------------------------------
03539 
03540 void TEcnaGui::DoButtonVmaxD_NOE_ChNb()
03541 {
03542 //Registration of Ymax for number of events
03543 
03544   char* bufferchain;
03545   bufferchain = (char*)fVmaxD_NOE_ChNbText->GetBuffer()->GetString();
03546 
03547   fKeyVmaxD_NOE_ChNb = (Double_t)atof(bufferchain);
03548 
03549   fCnaCommand++;
03550   cout << "   *TEcnaGui [" << fCnaCommand
03551        << "]> Registration of Ymax for plot 'number of events' -> "
03552        << fKeyVmaxD_NOE_ChNb << endl;
03553 }
03554 //-------------------------------------------------------------------
03555 
03556 void TEcnaGui::DoButtonVminD_Ped_ChNb()
03557 {
03558 //Registration of Ymin for pedestals
03559 
03560   char* bufferchain;
03561   bufferchain = (char*)fVminD_Ped_ChNbText->GetBuffer()->GetString();
03562 
03563   fKeyVminD_Ped_ChNb = (Double_t)atof(bufferchain);
03564 
03565   fCnaCommand++;
03566   cout << "   *TEcnaGui [" << fCnaCommand
03567        << "]> Registration of Ymin for plot 'pedestal' -> "
03568        << fKeyVminD_Ped_ChNb << endl;
03569 }
03570 //-------------------------------------------------------------------
03571 
03572 void TEcnaGui::DoButtonVmaxD_Ped_ChNb()
03573 {
03574 //Registration of Ymax for pedestals
03575 
03576   char* bufferchain;
03577   bufferchain = (char*)fVmaxD_Ped_ChNbText->GetBuffer()->GetString();
03578 
03579   fKeyVmaxD_Ped_ChNb = (Double_t)atof(bufferchain);
03580 
03581   fCnaCommand++;
03582   cout << "   *TEcnaGui [" << fCnaCommand
03583        << "]> Registration of Ymax for plot 'pedestal' -> "
03584        << fKeyVmaxD_Ped_ChNb << endl;
03585 }
03586 //-------------------------------------------------------------------
03587 
03588 void TEcnaGui::DoButtonVminD_TNo_ChNb()
03589 {
03590 //Registration of Ymin for mean sample sigmas (noise)
03591 
03592   char* bufferchain;
03593   bufferchain = (char*)fVminD_TNo_ChNbText->GetBuffer()->GetString();
03594 
03595   fKeyVminD_TNo_ChNb = (Double_t)atof(bufferchain);
03596 
03597   fCnaCommand++;
03598   cout << "   *TEcnaGui [" << fCnaCommand
03599        << "]> Registration of Ymin for plot 'total noise' -> "
03600        << fKeyVminD_TNo_ChNb << endl;
03601 }
03602 //-------------------------------------------------------------------
03603 
03604 void TEcnaGui::DoButtonVmaxD_TNo_ChNb()
03605 {
03606 //Registration of Ymax for mean sample sigmas (noise)
03607 
03608   char* bufferchain;
03609   bufferchain = (char*)fVmaxD_TNo_ChNbText->GetBuffer()->GetString();
03610 
03611   fKeyVmaxD_TNo_ChNb = (Double_t)atof(bufferchain);
03612 
03613   fCnaCommand++;
03614   cout << "   *TEcnaGui [" << fCnaCommand
03615        << "]> Registration of Ymax for plot 'total noise' -> "
03616        << fKeyVmaxD_TNo_ChNb << endl;
03617 }
03618 //-------------------------------------------------------------------
03619 
03620 void TEcnaGui::DoButtonVminD_MCs_ChNb()
03621 {
03622 //Registration of Ymin for mean cor(s,s')
03623 
03624   char* bufferchain;
03625   bufferchain = (char*)fVminD_MCs_ChNbText->GetBuffer()->GetString();
03626 
03627   fKeyVminD_MCs_ChNb = (Double_t)atof(bufferchain);
03628 
03629   fCnaCommand++;
03630   cout << "   *TEcnaGui [" << fCnaCommand
03631        << "]> Registration of Ymin for plot 'mean cor(s,s')' -> "
03632        << fKeyVminD_MCs_ChNb << endl;
03633 }
03634 //-------------------------------------------------------------------
03635 
03636 void TEcnaGui::DoButtonVmaxD_MCs_ChNb()
03637 {
03638 //Registration of Ymax for mean cor(s,s')
03639 
03640   char* bufferchain;
03641   bufferchain = (char*)fVmaxD_MCs_ChNbText->GetBuffer()->GetString();
03642 
03643   fKeyVmaxD_MCs_ChNb = (Double_t)atof(bufferchain);
03644 
03645   fCnaCommand++;
03646   cout << "   *TEcnaGui [" << fCnaCommand
03647        << "]> Registration of Ymax for plot 'mean cor(s,s')' -> "
03648        << fKeyVmaxD_MCs_ChNb << endl;
03649 }
03650 //-------------------------------------------------------------------
03651 
03652 
03653 void TEcnaGui::DoButtonVminD_LFN_ChNb()
03654 {
03655 //Registration of Ymin for sigmas of sample means
03656 
03657   char* bufferchain;
03658   bufferchain = (char*)fVminD_LFN_ChNbText->GetBuffer()->GetString();
03659 
03660   fKeyVminD_LFN_ChNb = (Double_t)atof(bufferchain);
03661 
03662   fCnaCommand++;
03663   cout << "   *TEcnaGui [" << fCnaCommand
03664        << "]> Registration of Ymin for plot 'low frequency noise' -> "
03665        << fKeyVminD_LFN_ChNb << endl;
03666 }
03667 //-------------------------------------------------------------------
03668 
03669 void TEcnaGui::DoButtonVmaxD_LFN_ChNb()
03670 {
03671 //Registration of Ymax for sigmas of sample means 
03672 
03673   char* bufferchain;
03674   bufferchain = (char*)fVmaxD_LFN_ChNbText->GetBuffer()->GetString();
03675 
03676   fKeyVmaxD_LFN_ChNb = (Double_t)atof(bufferchain);
03677 
03678   fCnaCommand++;
03679   cout << "   *TEcnaGui [" << fCnaCommand
03680        << "]> Registration of Ymax for plot 'low frequency noise' -> "
03681        << fKeyVmaxD_LFN_ChNb << endl;
03682 }
03683 //-------------------------------------------------------------------
03684 
03685 void TEcnaGui::DoButtonVminD_HFN_ChNb()
03686 {
03687 //Registration of Ymin for sigmas of sample sigmas
03688 
03689   char* bufferchain;
03690   bufferchain = (char*)fVminD_HFN_ChNbText->GetBuffer()->GetString();
03691 
03692   fKeyVminD_HFN_ChNb = (Double_t)atof(bufferchain);
03693 
03694   fCnaCommand++;
03695   cout << "   *TEcnaGui [" << fCnaCommand
03696        << "]> Registration of Ymin for plot 'high frequency noise' -> "
03697        << fKeyVminD_HFN_ChNb << endl;
03698 }
03699 //-------------------------------------------------------------------
03700 
03701 void TEcnaGui::DoButtonVmaxD_HFN_ChNb()
03702 {
03703 //Registration of Ymax for sigmas of sample sigmas
03704 
03705   char* bufferchain;
03706   bufferchain = (char*)fVmaxD_HFN_ChNbText->GetBuffer()->GetString();
03707 
03708   fKeyVmaxD_HFN_ChNb = (Double_t)atof(bufferchain);
03709 
03710   fCnaCommand++;
03711   cout << "   *TEcnaGui [" << fCnaCommand
03712        << "]> Registration of Ymax for plot 'high frequency noise' -> "
03713        << fKeyVmaxD_HFN_ChNb << endl;
03714 }
03715 //-------------------------------------------------------------------
03716 
03717 void TEcnaGui::DoButtonVminD_SCs_ChNb()
03718 {
03719 //Registration of Ymin for sigmas of cor(s,s')
03720 
03721   char* bufferchain;
03722   bufferchain = (char*)fVminD_SCs_ChNbText->GetBuffer()->GetString();
03723 
03724   fKeyVminD_SCs_ChNb = (Double_t)atof(bufferchain);
03725 
03726   fCnaCommand++;
03727   cout << "   *TEcnaGui [" << fCnaCommand
03728        << "]> Registration of Ymin for plot 'sigma of cor(s,s')' -> "
03729        << fKeyVminD_SCs_ChNb << endl;
03730 }
03731 //-------------------------------------------------------------------
03732 
03733 void TEcnaGui::DoButtonVmaxD_SCs_ChNb()
03734 {
03735 //Registration of Ymax for sigmas of cor(s,s')
03736 
03737   char* bufferchain;
03738   bufferchain = (char*)fVmaxD_SCs_ChNbText->GetBuffer()->GetString();
03739 
03740   fKeyVmaxD_SCs_ChNb = (Double_t)atof(bufferchain);
03741 
03742   fCnaCommand++;
03743   cout << "   *TEcnaGui [" << fCnaCommand
03744        << "]> Registration of Ymax for plot 'sigma of cor(s,s')' -> "
03745        << fKeyVmaxD_SCs_ChNb << endl;
03746 }
03747 //-------------------------------------------------------------------
03748 
03749 void TEcnaGui::DoButtonVminLFccMos()
03750 {
03751 //Registration of Ymin for LF Mean Cor(c,c')
03752 
03753   char* bufferchain;
03754   bufferchain = (char*)fVminLFccMosText->GetBuffer()->GetString();
03755 
03756   fKeyVminLFccMos = (Double_t)atof(bufferchain);
03757 
03758   fCnaCommand++;
03759   cout << "   *TEcnaGui [" << fCnaCommand
03760        << "]> Registration of Ymin for plot 'mean LF |cor(c,c')|' -> "
03761        << fKeyVminLFccMos << endl;
03762 }
03763 //-------------------------------------------------------------------
03764 
03765 void TEcnaGui::DoButtonVmaxLFccMos()
03766 {
03767 //Registration of Ymax for LF Mean Cor(c,c')
03768 
03769   char* bufferchain;
03770   bufferchain = (char*)fVmaxLFccMosText->GetBuffer()->GetString();
03771 
03772   fKeyVmaxLFccMos = (Double_t)atof(bufferchain);
03773 
03774   fCnaCommand++;
03775   cout << "   *TEcnaGui [" << fCnaCommand
03776        << "]> Registration of Ymax for plot 'mean LF |cor(c,c')|' -> "
03777        << fKeyVmaxLFccMos << endl;
03778 }
03779 //-------------------------------------------------------------------
03780 
03781 void TEcnaGui::DoButtonVminHFccMos()
03782 {
03783 //Registration of Ymin for HF Mean Cor(c,c')
03784 
03785   char* bufferchain;
03786   bufferchain = (char*)fVminHFccMosText->GetBuffer()->GetString();
03787 
03788   fKeyVminHFccMos = (Double_t)atof(bufferchain);
03789 
03790   fCnaCommand++;
03791   cout << "   *TEcnaGui [" << fCnaCommand
03792        << "]> Registration of Ymin for plot 'mean HF |cor(c,c')|' -> "
03793        << fKeyVminHFccMos << endl;
03794 }
03795 //-------------------------------------------------------------------
03796 
03797 void TEcnaGui::DoButtonVmaxHFccMos()
03798 {
03799 //Registration of Ymax for HF Mean Cor(c,c')
03800 
03801   char* bufferchain;
03802   bufferchain = (char*)fVmaxHFccMosText->GetBuffer()->GetString();
03803 
03804   fKeyVmaxHFccMos = (Double_t)atof(bufferchain);
03805 
03806   fCnaCommand++;
03807   cout << "   *TEcnaGui [" << fCnaCommand
03808        << "]> Registration of Ymax for plot 'mean HF |cor(c,c')|' -> "
03809        << fKeyVmaxHFccMos << endl;
03810 }
03811 
03812 //-------------------------------------------------------------------
03813 
03814 void TEcnaGui::DoButtonVminLHFcc()
03815 {
03816 //Registration of Ymin for cov(c,c') in Stins
03817 
03818   char* bufferchain;
03819   bufferchain = (char*)fVminLHFccText->GetBuffer()->GetString();
03820 
03821   fKeyVminLHFcc = (Double_t)atof(bufferchain);
03822 
03823   fCnaCommand++;
03824   cout << "   *TEcnaGui [" << fCnaCommand
03825        << "]> Registration of Ymin for plot 'cor(c,c') in "
03826        << fStinName.Data() << "s' -> " << fKeyVminLHFcc << endl;
03827 }
03828 //-------------------------------------------------------------------
03829 
03830 void TEcnaGui::DoButtonVmaxLHFcc()
03831 {
03832 //Registration of Ymax for cov(c,c') in Stins
03833 
03834   char* bufferchain;
03835   bufferchain = (char*)fVmaxLHFccText->GetBuffer()->GetString();
03836 
03837   fKeyVmaxLHFcc = (Double_t)atof(bufferchain);
03838 
03839   fCnaCommand++;
03840   cout << "   *TEcnaGui [" << fCnaCommand
03841        << "]> Registration of Ymax for plot 'cor(c,c') in "
03842        << fStinName.Data() << "s' -> " << fKeyVmaxLHFcc << endl;
03843 }
03844 
03845 //-------------------------------------------------------------------
03846 
03847 void TEcnaGui::DoButtonStexNb()
03848 {
03849   ViewStexStinNumbering();  // message in the method
03850 }
03851 //-------------------------------------------------------------------
03852 void TEcnaGui::DoButtonStinA()
03853 {
03854 //Registration of the Stin A number (A = X coordinate for cor(c,c') plots)
03855 
03856   char* bufferchain;
03857   bufferchain = (char*)fStinAText->GetBuffer()->GetString();
03858 
03859   Int_t xReadStinANumberForCons = atoi(bufferchain);
03860 
03861   if( fSubDet == "EB" ){fKeyStinANumber = xReadStinANumberForCons;}
03862   if( fSubDet == "EE" )
03863     {fKeyStinANumber = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fKeyStexNumber, xReadStinANumberForCons);}
03864 
03865   if( fSubDet == "EB" )
03866     {
03867       fCnaCommand++;
03868       cout << "   *TEcnaGui [" << fCnaCommand
03869            << "]> Registration of " << fStinName.Data() << " number -> "
03870            << xReadStinANumberForCons << endl;
03871 
03872       if ( (fKeyStinANumber < 1) || (fKeyStinANumber > fEcal->MaxStinEcnaInStex())  )
03873         {
03874           fCnaError++;
03875           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> " << fStinName.Data()
03876                << " number = " << fKeyStinANumber
03877                << ": out of range ( range = [ 1 ," << fEcal->MaxStinEcnaInStex() << " ] ) "
03878                << fTTBELL << endl;
03879         }
03880     }
03881   
03882   if( fSubDet == "EE" )
03883     {
03884       fCnaCommand++;
03885       cout << "   *TEcnaGui [" << fCnaCommand
03886            << "]> Registration of " << fStinName.Data() << " number for construction -> "
03887            << xReadStinANumberForCons << endl;
03888 
03889       if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxDeeInEE() )
03890         {
03891           Int_t off_set_cons = 0;
03892           if( fKeyStexNumber == 1 || fKeyStexNumber == 3 ){off_set_cons = fEcal->MaxSCForConsInDee();}
03893           
03894           if( xReadStinANumberForCons <= off_set_cons ||
03895               xReadStinANumberForCons > fEcal->MaxSCForConsInDee()+off_set_cons )
03896             {
03897               fCnaError++;
03898               cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> SC nb for construction = "
03899                    << xReadStinANumberForCons << ". Out of range ( range = [ " << off_set_cons+1
03900                    << "," << fEcal->MaxSCForConsInDee()+off_set_cons << "] )"
03901                    << fTTBELL << endl;
03902             }
03903         }
03904       else
03905         {
03906           fCnaError++;
03907           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> DeeNumber = " <<  fKeyStexNumber
03908                << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )"
03909                << fTTBELL << endl;
03910         }      
03911     }
03912 }
03913 
03914 //-------------------------------------------------------------------
03915 void TEcnaGui::DoButtonStinB()
03916 {
03917 //Registration of the Stin B number (B = Y coordinate for cor(c,c') plots)
03918 
03919   char* bufferchain;
03920   bufferchain = (char*)fStinBText->GetBuffer()->GetString();
03921 
03922   Int_t xReadStinBNumberForCons = atoi(bufferchain);
03923 
03924   if( fSubDet == "EB" ){fKeyStinBNumber = xReadStinBNumberForCons;}
03925   if( fSubDet == "EE" )
03926     {fKeyStinBNumber = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fKeyStexNumber, xReadStinBNumberForCons);}
03927 
03928   fCnaCommand++;
03929   cout << "   *TEcnaGui [" << fCnaCommand
03930        << "]> Registration of " << fStinName.Data() << "' number -> "
03931        << xReadStinBNumberForCons << endl;
03932 
03933   if( fSubDet == "EB" )
03934     {
03935       if ( (fKeyStinBNumber < 1) || (fKeyStinBNumber > fEcal->MaxStinEcnaInStex())  )
03936         {
03937           fCnaError++;
03938           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> " << fStinName.Data()
03939                << "' number = " << fKeyStinBNumber
03940                << ": out of range ( range = [ 1 ," << fEcal->MaxStinEcnaInStex() << " ] ) "
03941                << fTTBELL << endl;
03942         }
03943     }
03944   
03945   if( fSubDet == "EE" )
03946     {
03947       if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxDeeInEE() )
03948         {
03949           Int_t off_set_cons = 0;
03950           if( fKeyStexNumber == 1 || fKeyStexNumber == 3 ){off_set_cons = fEcal->MaxSCForConsInDee();}
03951           
03952           if( xReadStinBNumberForCons < off_set_cons ||
03953               xReadStinBNumberForCons > fEcal->MaxSCForConsInDee()+off_set_cons )
03954             {
03955               fCnaError++;
03956               cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> SC nb for construction = "
03957                    << xReadStinBNumberForCons << ". Out of range ( range = [ " << off_set_cons+1
03958                    << "," << fEcal->MaxSCForConsInDee()+off_set_cons << "] )"
03959                    << fTTBELL << endl;
03960             }
03961         }
03962       else
03963         {
03964           fCnaError++;
03965           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> DeeNumber = " <<  fKeyStexNumber
03966                << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )"
03967                << fTTBELL << endl;
03968         }      
03969     }
03970 }
03971 //-------------------------------------------------------------------
03972 void TEcnaGui::DoButtonChNb()
03973 {
03974 //Display of StinA Channel numbering
03975   ViewStinCrystalNumbering(fKeyStinANumber);
03976 }
03977 
03978 //-------------------------------------------------------------------
03979 void TEcnaGui::DoButtonChan()
03980 {
03981 //Registration of the channel number
03982 
03983   char* bufferchain;
03984   bufferchain = (char*)fChanText->GetBuffer()->GetString();
03985   Int_t xReadNumber = atoi(bufferchain);
03986 
03987   Int_t Choffset = -1;
03988   TString ChString = "?";
03989 
03990   if( fSubDet == "EB"){Choffset = 0; ChString = "channel";}
03991   if( fSubDet == "EE"){Choffset = 1; ChString = "crystal";}
03992 
03993   fKeyChanNumber = xReadNumber-Choffset;   // fKeyChanNumber : range = [0,25]
03994   fCnaCommand++;
03995   cout << "   *TEcnaGui [" << fCnaCommand
03996        << "]> Registration of " << ChString.Data() << " number -> "
03997        << xReadNumber << endl;
03998   
03999   if ( (fKeyChanNumber < 0) || (fKeyChanNumber > fEcal->MaxCrysInStin()-1 )  )
04000     {
04001       fCnaError++;
04002       cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
04003            << ChString.Data() << " number in " << fStinName.Data() << " = " << xReadNumber
04004            << ": out of range ( range = [" << Choffset << ","
04005            << fEcal->MaxCrysInStin()-1+Choffset << "] )"
04006            << fTTBELL << endl;
04007     } 
04008 }
04009 //-------------------------------------------------------------------
04010 void TEcnaGui::DoButtonSamp()
04011 {
04012 //Registration of the sample number
04013 
04014   char* bufferchain;
04015   bufferchain = (char*)fSampText->GetBuffer()->GetString();
04016   Int_t xKeySampNumber = atoi(bufferchain);
04017 
04018   fCnaCommand++;
04019   cout << "   *TEcnaGui [" << fCnaCommand
04020        << "]> Registration of sample number -> "
04021        << xKeySampNumber << endl;
04022 
04023   if ( (xKeySampNumber < 1) || (xKeySampNumber > fKeyNbOfSamples )  )
04024     {
04025       fCnaError++;
04026       cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
04027            << " Sample number = " << xKeySampNumber
04028            << ": out of range ( range = [ 1 ," << fKeyNbOfSamples << " ] )"
04029            << fTTBELL << endl;
04030     }
04031 
04032   fKeySampNumber = xKeySampNumber-1;
04033 }
04034 
04035 //----------------------------------------------------------------------
04036 void TEcnaGui::DoButtonRul()
04037 {
04038 //Register the name of the file containing the list of run parameters
04039 
04040   //........................... get info from the entry field
04041   char* listchain = (char*)fRulText->GetBuffer()->GetString();
04042   if( listchain[0] == '\0' )
04043     {
04044       fCnaError++;
04045       cout << "   !TEcnaGui (" << fCnaError << ") *ERROR* ===> "
04046            << " Empty file name in entry for TIME EVOLUTION plots."
04047            << fTTBELL << endl;
04048       fKeyFileNameRunList = fKeyRunListInitCode;
04049     }
04050   else
04051     {
04052       char tchiffr[10] = {'0', '1', '2',  '3',  '4',  '5',  '6',  '7',  '8',  '9' };
04053       
04054       //............. test of the first character (figure => run number, letter => file name)
04055       if( listchain[0] == tchiffr [0] || listchain[0] == tchiffr [1] ||
04056           listchain[0] == tchiffr [2] || listchain[0] == tchiffr [3] ||
04057           listchain[0] == tchiffr [4] || listchain[0] == tchiffr [5] ||
04058           listchain[0] == tchiffr [6] || listchain[0] == tchiffr [7] ||
04059           listchain[0] == tchiffr [8] || listchain[0] == tchiffr [9] )
04060         {
04061           fCnaError++;
04062           cout << "   !TEcnaGui (" << fCnaError << ") *ERROR* ===> "
04063                << " Please, enter a file name beginning with an alphabetic letter."
04064                << fTTBELL << endl;
04065         }
04066       else
04067         {
04068           fKeyFileNameRunList = listchain;
04069           
04070           fCnaCommand++;
04071           cout << "   *TEcnaGui [" << fCnaCommand
04072                << "]> Registration of run list file name for history plots -> "
04073                << fKeyFileNameRunList.Data() << endl;
04074         }
04075     }
04076 }
04077 
04078 //----------------------------------------------------------------------
04079 void TEcnaGui::DoButtonGent()
04080 {
04081 //Register the general title
04082   //........................... get info from the entry field
04083   char* listchain = (char*)fGentText->GetBuffer()->GetString();  
04084   fKeyGeneralTitle = listchain;
04085   
04086   fCnaCommand++;
04087   cout << "   *TEcnaGui [" << fCnaCommand
04088        << "]> Registration of general title -> "
04089        << fKeyGeneralTitle.Data() << endl;
04090 }
04091 //-------------------------------------------------------------------
04092 //
04093 //                        Last buttons methods
04094 //
04095 //-------------------------------------------------------------------
04096 //======================= LIN/LOG + Projy FRAME
04097 
04098 void TEcnaGui::DoButtonLogx()
04099 {
04100   if( fMemoScaleX == "LOG"){fKeyScaleX = "LIN";}
04101   if( fMemoScaleX == "LIN"){fKeyScaleX = "LOG";}
04102   fMemoScaleX = fKeyScaleX;
04103 
04104   fCnaCommand++;
04105   cout << "   *TEcnaGui [" << fCnaCommand
04106        << "]> X axis -> " << fKeyScaleX << " scale " << endl;
04107 }
04108 void TEcnaGui::DoButtonLogy()
04109 {
04110   if( fMemoScaleY == "LOG" ){fKeyScaleY = "LIN";}
04111   if( fMemoScaleY == "LIN" ){fKeyScaleY = "LOG";}
04112   fMemoScaleY = fKeyScaleY;
04113 
04114   fCnaCommand++;
04115   cout << "   *TEcnaGui [" << fCnaCommand
04116        << "]> Y axis -> " << fKeyScaleY << " scale " << endl;
04117 }
04118 
04119 void TEcnaGui::DoButtonProjy()
04120 {
04121   if( fMemoProjY == "Y projection" ){fKeyProjY = "normal";}
04122   if( fMemoProjY == "normal"       ){fKeyProjY = "Y projection";}
04123   fMemoProjY = fKeyProjY;
04124 
04125   fCnaCommand++;
04126   cout << "   *TEcnaGui [" << fCnaCommand
04127        << "]> 1D Histo display -> " << fKeyProjY << " mode " << endl;
04128 }
04129 
04130 //------------------------------------------------------------------- Colors + Exit
04131 
04132 void TEcnaGui::DoButtonColPal()
04133 {
04134   if( fMemoColPal == "ECCNAColor"   ){fKeyColPal = "Rainbow";}
04135   if( fMemoColPal == "Rainbow" ){fKeyColPal = "ECCNAColor";}
04136   fMemoColPal = fKeyColPal;
04137 
04138   TString sColPalComment = "?";
04139   if( fKeyColPal == "ECCNAColor" )
04140     {sColPalComment = "ECNAColor option: black-red-blue-green-brown-purple (default)";}
04141   if( fKeyColPal == "Rainbow"    )
04142     {sColPalComment = "Rainbow option:   red-orange-yellow-green-blue-indigo-purple";}
04143 
04144   fCnaCommand++;
04145   cout << "   *TEcnaGui [" << fCnaCommand
04146        << "]> Color palette -> " << sColPalComment << endl;
04147 }
04148 
04149 void TEcnaGui::DoButtonExit()
04150 {
04151   fCnaCommand++;
04152   cout << "   *TEcnaGui [" << fCnaCommand
04153        << "]> Exit CNA session."
04154        << endl;
04155   //............................ Quit the ROOT session
04156   fButExit->SetCommand(".q");
04157 }
04158 
04159 //======================= LAST FRAME
04160 //-------------------------------------------------------------------
04161 void TEcnaGui::DoButtonClone()
04162 {
04163   fCnaCommand++;
04164   cout << "   *TEcnaGui [" << fCnaCommand
04165        << "]> Clone last canvas. " << endl;
04166 
04167   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());      /*fCnew++*/ ;}
04168   fHistos->PlotCloneOfCurrentCanvas();
04169 }
04170 //-------------------------------------------------------------------
04171 void TEcnaGui::DoButtonRoot()
04172 {
04173   fCnaCommand++;
04174   cout << "   *TEcnaGui [" << fCnaCommand
04175        << "]> This is ROOT version " << gROOT->GetVersion()
04176        << endl;
04177 }
04178 //-------------------------------------------------------------------
04179 void TEcnaGui::DoButtonHelp()
04180 {
04181   fCnaCommand++;
04182   cout << "   *TEcnaGui [" << fCnaCommand
04183        << "]> HELP: for documentation, see the ECNA web page: " << endl
04184        << "    http://cms-fabbro.web.cern.ch/cms-fabbro/cna_new/Correlated_Noise_analysis/ECNA_main_page.htm"
04185        << endl;
04186 }
04187 
04188 //===================================================================
04189 //
04190 //                       HandleMenu
04191 //
04192 //===================================================================
04193 void TEcnaGui::HandleMenu(Int_t id)
04194 {
04195   //HandleMenu
04196   //.................... SUBMIT on batch system
04197 
04198   if( id == fMenuSubmit8nmC ){SubmitOnBatchSystem("8nm");}
04199   if( id == fMenuSubmit1nhC ){SubmitOnBatchSystem("1nh");}
04200   if( id == fMenuSubmit8nhC ){SubmitOnBatchSystem("8nh");}
04201   if( id == fMenuSubmit1ndC ){SubmitOnBatchSystem("1nd");}
04202   if( id == fMenuSubmit1nwC ){SubmitOnBatchSystem("1nw");}
04203 
04204   //.................... Clean
04205   if( id == fMenuCleanSubC  ){CleanBatchFiles("Sub");}
04206   if( id == fMenuCleanJobC  ){CleanBatchFiles("Job");}
04207   if( id == fMenuCleanPythC ){CleanBatchFiles("Pyth");}
04208   if( id == fMenuCleanAllC  ){CleanBatchFiles("All");}
04209 
04210   //.................... Calculations
04211   if( id == fMenuComputStdC ){Calculations("Std");}
04212   if( id == fMenuComputSttC ){Calculations("Stt");}
04213   if( id == fMenuComputSccC ){Calculations("Scc");}
04214 
04215   //.................... Nb of events in Stex
04216   if( id == fMenuD_NOE_ChNbFullC )
04217     {
04218       if( fMemoProjY == "normal"      ){ViewHistoSorSNumberOfEventsOfCrystals(fOptPlotFull);}
04219       if( fMemoProjY == "Y projection"){ViewHistoSorSNumberOfEventsDistribution(fOptPlotFull);}
04220     }
04221   if( id == fMenuD_NOE_ChNbSameC )
04222     {
04223       if( fMemoProjY == "normal"      ){ViewHistoSorSNumberOfEventsOfCrystals(fOptPlotSame);}
04224       if( fMemoProjY == "Y projection"){ViewHistoSorSNumberOfEventsDistribution(fOptPlotSame);}
04225     }
04226   if( id == fMenuD_NOE_ChNbHocoVecoC   ){ViewSorSNumberOfEvents();}
04227   if( id == fMenuD_NOE_ChNbAsciiFileC  ){ViewHistoSorSNumberOfEventsOfCrystals(fOptAscii);}
04228 
04229   //.................... Pedestal in Stex                  (HandleMenu)
04230   if( id == fMenuD_Ped_ChNbFullC )
04231     {
04232       if( fMemoProjY == "normal"      ){ViewHistoSorSPedestalsOfCrystals(fOptPlotFull);}
04233       if( fMemoProjY == "Y projection"){ViewHistoSorSPedestalsDistribution(fOptPlotFull);}
04234     }
04235   if( id == fMenuD_Ped_ChNbSameC )
04236     {
04237       if( fMemoProjY == "normal"      ){ViewHistoSorSPedestalsOfCrystals(fOptPlotSame);}
04238       if( fMemoProjY == "Y projection"){ViewHistoSorSPedestalsDistribution(fOptPlotSame);}
04239     }
04240   if( id == fMenuD_Ped_ChNbHocoVecoC   ){ViewSorSPedestals();}
04241   if( id == fMenuD_Ped_ChNbAsciiFileC  ){ViewHistoSorSPedestalsOfCrystals(fOptAscii);}
04242 
04243   //.................... Total noise in Stex                 (HandleMenu)
04244   if( id == fMenuD_TNo_ChNbFullC )
04245     {
04246       if( fMemoProjY == "normal"      ){ViewHistoSorSTotalNoiseOfCrystals(fOptPlotFull);}
04247       if( fMemoProjY == "Y projection"){ViewHistoSorSTotalNoiseDistribution(fOptPlotFull);}
04248     }
04249   if( id == fMenuD_TNo_ChNbSameC )
04250     {
04251       if( fMemoProjY == "normal"      ){ViewHistoSorSTotalNoiseOfCrystals(fOptPlotSame);}
04252       if( fMemoProjY == "Y projection"){ViewHistoSorSTotalNoiseDistribution(fOptPlotSame);}
04253     }
04254   if( id == fMenuD_TNo_ChNbSamePC)
04255     {
04256       if( fMemoProjY == "normal"      ){ViewHistoSorSTotalNoiseOfCrystals(fOptPlotSameP);}
04257       if( fMemoProjY == "Y projection"){ViewHistoSorSTotalNoiseDistribution(fOptPlotSameP);}
04258     }
04259   if( id == fMenuD_TNo_ChNbHocoVecoC   ){ViewSorSTotalNoise();}
04260   if( id == fMenuD_TNo_ChNbAsciiFileC  ){ViewHistoSorSTotalNoiseOfCrystals(fOptAscii);}
04261 
04262   //.................... Low Frequency noise in Stex                 (HandleMenu)
04263   if( id == fMenuD_LFN_ChNbFullC )
04264     {
04265       if( fMemoProjY == "normal"      ){ViewHistoSorSLowFrequencyNoiseOfCrystals(fOptPlotFull);}
04266       if( fMemoProjY == "Y projection"){ViewHistoSorSLowFrequencyNoiseDistribution(fOptPlotFull);}
04267     }
04268   if( id == fMenuD_LFN_ChNbSameC )
04269     {
04270       if( fMemoProjY == "normal"      ){ViewHistoSorSLowFrequencyNoiseOfCrystals(fOptPlotSame);}
04271       if( fMemoProjY == "Y projection"){ViewHistoSorSLowFrequencyNoiseDistribution(fOptPlotSame);}
04272     }
04273   if( id == fMenuD_LFN_ChNbSamePC)
04274     {
04275       if( fMemoProjY == "normal"      ){ViewHistoSorSLowFrequencyNoiseOfCrystals(fOptPlotSameP);}
04276       if( fMemoProjY == "Y projection"){ViewHistoSorSLowFrequencyNoiseDistribution(fOptPlotSameP);}
04277     }
04278   if( id == fMenuD_LFN_ChNbHocoVecoC   ){ViewSorSLowFrequencyNoise();}
04279   if( id == fMenuD_LFN_ChNbAsciiFileC  ){ViewHistoSorSLowFrequencyNoiseOfCrystals(fOptAscii);}
04280 
04281   //.................... High Frequency noise in Stex                 (HandleMenu)
04282   if( id == fMenuD_HFN_ChNbFullC )
04283     {
04284       if( fMemoProjY == "normal"      ){ViewHistoSorSHighFrequencyNoiseOfCrystals(fOptPlotFull);}
04285       if( fMemoProjY == "Y projection"){ViewHistoSorSHighFrequencyNoiseDistribution(fOptPlotFull);}
04286     }
04287   if( id == fMenuD_HFN_ChNbSameC )
04288     {
04289       if( fMemoProjY == "normal"      ){ViewHistoSorSHighFrequencyNoiseOfCrystals(fOptPlotSame);}
04290       if( fMemoProjY == "Y projection"){ViewHistoSorSHighFrequencyNoiseDistribution(fOptPlotSame);}
04291     }
04292   if( id == fMenuD_HFN_ChNbSamePC)
04293     {
04294       if( fMemoProjY == "normal"      ){ViewHistoSorSHighFrequencyNoiseOfCrystals(fOptPlotSameP);}
04295       if( fMemoProjY == "Y projection"){ViewHistoSorSHighFrequencyNoiseDistribution(fOptPlotSameP);}
04296     }
04297   if( id == fMenuD_HFN_ChNbHocoVecoC   ){ViewSorSHighFrequencyNoise();}
04298   if( id == fMenuD_HFN_ChNbAsciiFileC  ){ViewHistoSorSHighFrequencyNoiseOfCrystals(fOptAscii);}
04299 
04300   //.................... Mean Corss in Stex                 (HandleMenu)
04301   if( id == fMenuD_MCs_ChNbFullC )
04302     {
04303       if( fMemoProjY == "normal"      ){ViewHistoSorSMeanCorssOfCrystals(fOptPlotFull);}
04304       if( fMemoProjY == "Y projection"){ViewHistoSorSMeanCorssDistribution(fOptPlotFull);}
04305     }
04306   if( id == fMenuD_MCs_ChNbSameC )
04307     {
04308       if( fMemoProjY == "normal"      ){ViewHistoSorSMeanCorssOfCrystals(fOptPlotSame);}
04309       if( fMemoProjY == "Y projection"){ViewHistoSorSMeanCorssDistribution(fOptPlotSame);}
04310     }
04311   if( id == fMenuD_MCs_ChNbSamePC)
04312     {
04313       if( fMemoProjY == "normal"      ){ViewHistoSorSMeanCorssOfCrystals(fOptPlotSameP);}
04314       if( fMemoProjY == "Y projection"){ViewHistoSorSMeanCorssDistribution(fOptPlotSameP);}
04315     }
04316   if( id == fMenuD_MCs_ChNbHocoVecoC   ){ViewSorSMeanCorss();}
04317   if( id == fMenuD_MCs_ChNbAsciiFileC  ){ViewHistoSorSMeanCorssOfCrystals(fOptAscii);}
04318 
04319   //.................... Sigma of Corss in the Stex                 (HandleMenu)
04320   if( id == fMenuD_SCs_ChNbFullC )
04321     {
04322       if( fMemoProjY == "normal"      ){ViewHistoSorSSigmaOfCorssOfCrystals(fOptPlotFull);}
04323       if( fMemoProjY == "Y projection"){ViewHistoSorSSigmaOfCorssDistribution(fOptPlotFull);}
04324     }
04325   if( id == fMenuD_SCs_ChNbSameC )
04326     {
04327       if( fMemoProjY == "normal"      ){ViewHistoSorSSigmaOfCorssOfCrystals(fOptPlotSame);}
04328       if( fMemoProjY == "Y projection"){ViewHistoSorSSigmaOfCorssDistribution(fOptPlotSame);}
04329     }
04330   if( id == fMenuD_SCs_ChNbSamePC)
04331     {
04332       if( fMemoProjY == "normal"      ){ViewHistoSorSSigmaOfCorssOfCrystals(fOptPlotSameP);}
04333       if( fMemoProjY == "Y projection"){ViewHistoSorSSigmaOfCorssDistribution(fOptPlotSameP);}
04334     }
04335   if( id == fMenuD_SCs_ChNbHocoVecoC   ){ViewSorSSigmaOfCorss();}
04336   if( id == fMenuD_SCs_ChNbAsciiFileC  ){ViewHistoSorSSigmaOfCorssOfCrystals(fOptAscii);}
04337 
04338   //............................... Low Freq Mean Cor(c,c') for each pair of Stins                 (HandleMenu)
04339   if( id == fMenuLFccMosColzC ){ViewMatrixLowFrequencyMeanCorrelationsBetweenStins("COLZ");}
04340   if( id == fMenuLFccMosLegoC ){ViewMatrixLowFrequencyMeanCorrelationsBetweenStins("LEGO2Z");}
04341   //............................... High Freq Mean Cor(c,c') for each pair of Stins
04342   if( id == fMenuHFccMosColzC ){ViewMatrixHighFrequencyMeanCorrelationsBetweenStins("COLZ");}
04343   if( id == fMenuHFccMosLegoC ){ViewMatrixHighFrequencyMeanCorrelationsBetweenStins("LEGO2Z");}
04344 
04345   //............................... Corcc for each Stin in the Stex
04346   if( id == fMenuLFccColzC ){ViewStexLowFrequencyCorcc();}
04347   if( id == fMenuHFccColzC ){ViewStexHighFrequencyCorcc();}
04348 
04349   //--------> Nb for Cons for Stin numbers in case of EE
04350   Int_t cKeyStinANumber = fKeyStinANumber;
04351   if( fSubDet == "EE" && fKeyStexNumber != 0 )
04352     {cKeyStinANumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinANumber);}
04353   Int_t cKeyStinBNumber = fKeyStinBNumber;
04354   if( fSubDet == "EE" && fKeyStexNumber != 0 )
04355     {cKeyStinBNumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinBNumber);}
04356 
04357   //............................... Low Frequency Correlations and covariances between channels
04358   if( id == fMenuLFCorccColzC )
04359     {ViewMatrixLowFrequencyCorrelationsBetweenChannels(cKeyStinANumber, cKeyStinBNumber, "COLZ");}
04360   if( id == fMenuLFCorccLegoC )
04361     {ViewMatrixLowFrequencyCorrelationsBetweenChannels(cKeyStinANumber, cKeyStinBNumber, "LEGO2Z");}
04362 
04363   if( id == fMenuHFCorccColzC )
04364     {ViewMatrixHighFrequencyCorrelationsBetweenChannels(cKeyStinANumber, cKeyStinBNumber, "COLZ");}
04365   if( id == fMenuHFCorccLegoC )
04366     {ViewMatrixHighFrequencyCorrelationsBetweenChannels(cKeyStinANumber, cKeyStinBNumber, "LEGO2Z");}
04367 
04368   //.................................... Correlations and covariances between samples     (HandleMenu)
04369   if( id == fMenuCorssColzC      ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "COLZ");}
04370   if( id == fMenuCorssBoxC       ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "BOX");}
04371   if( id == fMenuCorssTextC      ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "TEXT");}
04372   if( id == fMenuCorssContzC     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "CONTZ");}
04373   if( id == fMenuCorssLegoC      ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "LEGO2Z");}
04374   if( id == fMenuCorssSurf1C     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "SURF1Z");}
04375   if( id == fMenuCorssSurf2C     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "SURF2Z");}
04376   if( id == fMenuCorssSurf3C     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "SURF3Z");}
04377   if( id == fMenuCorssSurf4C     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "SURF4");}
04378   if( id == fMenuCorssAsciiFileC ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "ASCII");}
04379 
04380   if( id == fMenuCovssColzC      ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "COLZ");}
04381   if( id == fMenuCovssBoxC       ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "BOX");}
04382   if( id == fMenuCovssTextC      ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "TEXT");}
04383   if( id == fMenuCovssContzC     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "CONTZ");}
04384   if( id == fMenuCovssLegoC      ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "LEGO2Z");}
04385   if( id == fMenuCovssSurf1C     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "SURF1Z");}
04386   if( id == fMenuCovssSurf2C     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "SURF2Z");}
04387   if( id == fMenuCovssSurf3C     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "SURF3Z");}
04388   if( id == fMenuCovssSurf4C     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "SURF4");}
04389   if( id == fMenuCovssAsciiFileC ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "ASCII");}
04390 
04391   //.................... Correlations and covariances between samples for all channels of a Stin
04392   if( id == fMenuCorssAllColzC ){ViewStinCorrelationSamples(cKeyStinANumber);}
04393   if( id == fMenuCovssAllColzC ){ViewStinCovarianceSamples(cKeyStinANumber);}
04394      
04395   //..................................... Sample means (pedestals)       (HandleMenu) 
04396   if( id == fMenuD_MSp_SpNbLineFullC )
04397     {
04398       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleMeans(cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04399       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleMeansDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04400     }
04401 
04402   if( id == fMenuD_MSp_SpNbLineSameC )
04403     {
04404       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleMeans(cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04405       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleMeansDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04406     }
04407   if( id == fMenuD_MSp_SpNbLineAllStinC )
04408     {
04409       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleMeans(cKeyStinANumber, fKeyChanNumber, fOptPlotSameInStin);}
04410       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleMeansDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotSameInStin);}
04411     }
04412     
04413   //..................................... Sample sigmas
04414   if( id == fMenuD_SSp_SpNbLineFullC )
04415     {
04416       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleSigmas(cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04417       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleSigmasDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04418     }
04419   if( id == fMenuD_SSp_SpNbLineSameC )
04420     {
04421       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleSigmas(cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04422       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleSigmasDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04423     }
04424    if( id == fMenuD_SSp_SpNbLineAllStinC )
04425     {
04426       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleSigmas(cKeyStinANumber, fKeyChanNumber, fOptPlotSameInStin);}
04427       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleSigmasDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotSameInStin);}
04428     }
04429    
04430   //..................................... Evolution in time (ViewHistime, except EvolSamp -> Viewhisto)
04431   if(   id == fMenuH_Ped_DatePolmFullC || id == fMenuH_Ped_DatePolmSameC  
04432      || id == fMenuH_TNo_DatePolmFullC || id == fMenuH_TNo_DatePolmSameC || id == fMenuH_TNo_DatePolmSamePC
04433      || id == fMenuH_LFN_DatePolmFullC || id == fMenuH_LFN_DatePolmSameC || id == fMenuH_LFN_DatePolmSamePC
04434      || id == fMenuH_HFN_DatePolmFullC || id == fMenuH_HFN_DatePolmSameC || id == fMenuH_HFN_DatePolmSamePC
04435      || id == fMenuH_MCs_DatePolmFullC || id == fMenuH_MCs_DatePolmSameC || id == fMenuH_MCs_DatePolmSamePC
04436      || id == fMenuH_SCs_DatePolmFullC || id == fMenuH_SCs_DatePolmSameC || id == fMenuH_SCs_DatePolmSamePC)
04437     {
04438       if(fKeyFileNameRunList == fKeyRunListInitCode )
04439         {fCnaError++;
04440           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
04441                << " EMPTY STRING for list of run file name (TIME EVOLUTION plots)." << fTTBELL << endl;}
04442       else
04443         {
04444           //........................................ Pedestals                 (HandleMenu / ViewHistime)
04445           if( id == fMenuH_Ped_DatePolmFullC )
04446             {
04447               if( fMemoProjY == "normal"      )
04448                 {ViewHistimeCrystalPedestals(fKeyFileNameRunList.Data(),
04449                                              cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04450               if( fMemoProjY == "Y projection")
04451                 {ViewHistimeCrystalPedestalsRuns(fKeyFileNameRunList.Data(),
04452                                                  cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04453             }
04454           if( id == fMenuH_Ped_DatePolmSameC )
04455             { if( fMemoProjY == "normal"      )
04456               {ViewHistimeCrystalPedestals(fKeyFileNameRunList.Data(),
04457                                            cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04458             if( fMemoProjY == "Y projection")
04459               {ViewHistimeCrystalPedestalsRuns(fKeyFileNameRunList.Data(),
04460                                                cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04461             }
04462 
04463           //........................................ Total noise
04464           if( id == fMenuH_TNo_DatePolmFullC )
04465             {
04466               if( fMemoProjY == "normal"      )
04467                 {ViewHistimeCrystalTotalNoise(fKeyFileNameRunList.Data(),
04468                                               cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04469               if( fMemoProjY == "Y projection")
04470                 {ViewHistimeCrystalTotalNoiseRuns(fKeyFileNameRunList.Data(),
04471                                                   cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04472             }
04473           if( id == fMenuH_TNo_DatePolmSameC )
04474             {
04475               if( fMemoProjY == "normal"      )
04476                 {ViewHistimeCrystalTotalNoise(fKeyFileNameRunList.Data(),
04477                                               cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04478               if( fMemoProjY == "Y projection")
04479                 {ViewHistimeCrystalTotalNoiseRuns(fKeyFileNameRunList.Data(),
04480                                                   cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04481             }
04482           if( id == fMenuH_TNo_DatePolmSamePC )
04483             {
04484               if( fMemoProjY == "normal"      )
04485                 {ViewHistimeCrystalTotalNoise(fKeyFileNameRunList.Data(),
04486                                               cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04487               if( fMemoProjY == "Y projection")
04488                 {ViewHistimeCrystalTotalNoiseRuns(fKeyFileNameRunList.Data(),
04489                                                   cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04490             }
04491 
04492           //........................................ Low frequency noise                 (HandleMenu / ViewHistime)
04493           if( id == fMenuH_LFN_DatePolmFullC )
04494             {
04495               if( fMemoProjY == "normal"      )
04496                 {ViewHistimeCrystalLowFrequencyNoise(fKeyFileNameRunList.Data(),
04497                                                      cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04498               if( fMemoProjY == "Y projection")
04499                 {ViewHistimeCrystalLowFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04500                                                          cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04501             }
04502           if( id == fMenuH_LFN_DatePolmSameC )
04503             {
04504               if( fMemoProjY == "normal"      )
04505                 {ViewHistimeCrystalLowFrequencyNoise(fKeyFileNameRunList.Data(),
04506                                                      cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04507               if( fMemoProjY == "Y projection")
04508                 {ViewHistimeCrystalLowFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04509                                                          cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04510             }
04511           if( id == fMenuH_LFN_DatePolmSamePC )
04512             {
04513               if( fMemoProjY == "normal"      )
04514                 {ViewHistimeCrystalLowFrequencyNoise(fKeyFileNameRunList.Data(),
04515                                                      cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04516               if( fMemoProjY == "Y projection")
04517                 {ViewHistimeCrystalLowFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04518                                                          cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04519             }
04520           
04521           //........................................ High frequency noise
04522           if( id == fMenuH_HFN_DatePolmFullC )
04523             {
04524               if( fMemoProjY == "normal"      )
04525                 {ViewHistimeCrystalHighFrequencyNoise(fKeyFileNameRunList.Data(),
04526                                                       cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04527               if( fMemoProjY == "Y projection")
04528                 {ViewHistimeCrystalHighFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04529                                                           cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04530             }
04531           if( id == fMenuH_HFN_DatePolmSameC )
04532             {
04533               if( fMemoProjY == "normal"      )
04534                 {ViewHistimeCrystalHighFrequencyNoise(fKeyFileNameRunList.Data(),
04535                                                       cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04536               if( fMemoProjY == "Y projection")
04537                 {ViewHistimeCrystalHighFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04538                                                           cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04539             }
04540           if( id == fMenuH_HFN_DatePolmSamePC )
04541             {
04542               if( fMemoProjY == "normal"      )
04543                 {ViewHistimeCrystalHighFrequencyNoise(fKeyFileNameRunList.Data(),
04544                                                       cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04545               if( fMemoProjY == "Y projection")
04546                 {ViewHistimeCrystalHighFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04547                                                           cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04548             }
04549           
04550           //........................................ Mean Corss                 (HandleMenu / ViewHistime)
04551           if( id == fMenuH_MCs_DatePolmFullC )
04552             {
04553               if( fMemoProjY == "normal"      )
04554                 {ViewHistimeCrystalMeanCorss(fKeyFileNameRunList.Data(),
04555                                                cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04556               if( fMemoProjY == "Y projection")
04557                 {ViewHistimeCrystalMeanCorssRuns(fKeyFileNameRunList.Data(),
04558                                                    cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04559             }
04560           if( id == fMenuH_MCs_DatePolmSameC )
04561             {
04562               if( fMemoProjY == "normal"      )
04563                 {ViewHistimeCrystalMeanCorss(fKeyFileNameRunList.Data(),
04564                                                cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04565               if( fMemoProjY == "Y projection")
04566                 {ViewHistimeCrystalMeanCorssRuns(fKeyFileNameRunList.Data(),
04567                                                    cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04568             }
04569           if( id == fMenuH_MCs_DatePolmSamePC )
04570             {
04571               if( fMemoProjY == "normal"      )
04572                 {ViewHistimeCrystalMeanCorss(fKeyFileNameRunList.Data(),
04573                                                cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04574               if( fMemoProjY == "Y projection")
04575                 {ViewHistimeCrystalMeanCorssRuns(fKeyFileNameRunList.Data(),
04576                                                    cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04577             }
04578           
04579           //........................................ Sigmas of Corss
04580           if( id == fMenuH_SCs_DatePolmFullC )
04581             {
04582               if( fMemoProjY == "normal"      )
04583                 {ViewHistimeCrystalSigmaOfCorss(fKeyFileNameRunList.Data(),
04584                                                 cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04585               if( fMemoProjY == "Y projection")
04586                 {ViewHistimeCrystalSigmaOfCorssRuns(fKeyFileNameRunList.Data(),
04587                                                     cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04588             }
04589           if( id == fMenuH_SCs_DatePolmSameC )
04590             {
04591               if( fMemoProjY == "normal"      )
04592                 {ViewHistimeCrystalSigmaOfCorss(fKeyFileNameRunList.Data(),
04593                                                 cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04594               if( fMemoProjY == "Y projection")
04595                 {ViewHistimeCrystalSigmaOfCorssRuns(fKeyFileNameRunList.Data(),
04596                                                     cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04597             }
04598           if( id == fMenuH_SCs_DatePolmSamePC )
04599             {
04600               if( fMemoProjY == "normal"      )
04601                 {ViewHistimeCrystalSigmaOfCorss(fKeyFileNameRunList.Data(),
04602                                                 cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04603               if( fMemoProjY == "Y projection")
04604                 {ViewHistimeCrystalSigmaOfCorssRuns(fKeyFileNameRunList.Data(),
04605                                                     cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04606             }
04607         }
04608     }
04609 
04610   //...................................... SampTime                               (HandleMenu / ADC)
04611   if( id == fMenuAdcProjSampLineFullC )
04612     {
04613       if( fMemoProjY == "normal"      )
04614         {ViewHistoCrystalSampleValues(cKeyStinANumber, fKeyChanNumber, fKeySampNumber, fOptPlotFull);}
04615       if( fMemoProjY == "Y projection")
04616         {ViewHistoSampleEventDistribution(cKeyStinANumber, fKeyChanNumber, fKeySampNumber, fOptPlotFull);}
04617     }
04618   if( id == fMenuAdcProjSampLineSameC )
04619     {
04620       if( fMemoProjY == "normal"      )
04621         {ViewHistoCrystalSampleValues(cKeyStinANumber, fKeyChanNumber, fKeySampNumber, fOptPlotSame);}
04622       if( fMemoProjY == "Y projection")
04623         {ViewHistoSampleEventDistribution(cKeyStinANumber, fKeyChanNumber, fKeySampNumber, fOptPlotSame);}
04624     }
04625 }
04626 // ------------- ( end of HandleMenu(...) ) -------------
04627 
04628 //==========================================================================
04629 //
04630 //             SubmitOnBatchSystem()   M E T H O D 
04631 //
04632 //==========================================================================
04633 void TEcnaGui::SubmitOnBatchSystem(const TString QueueCode)
04634 {
04635   //Submit job in batch mode
04636   
04637   if( (fConfirmSubmit == 1) && (fConfirmRunNumber == fKeyRunNumber) )
04638     {
04639       fCnaCommand++;
04640       cout << "   *TEcnaGui [" << fCnaCommand
04641            << "]> Submitting job in batch mode for run " << fConfirmRunNumber << endl;
04642 
04643       //.......................... get the path "modules/data"
04644       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/data/
04645       TString ModulesdataPath = fCnaParPaths->PathModulesData();
04646 
04647       //---------------------------------- python file building script: command text
04648       TString CnaPythonCommand = ModulesdataPath;
04649 
04650       //......................................... Script for python file building: script name
04651       TString PythonScriptName = "EcnaSystemScriptPython";
04652       const Text_t *t_PythonScriptName = (const Text_t *)PythonScriptName.Data();
04653       CnaPythonCommand.Append(t_PythonScriptName);
04654 
04655       //......................................... Script for python file building: arguments
04656       //  In the calling command, TString arguments must be of the form: \"STRING1\"  \"STRING2\"  etc...
04657 
04658       //......................................... arguments -> Run number
04659       //.......... ${1}
04660       CnaPythonCommand.Append(' ');
04661       CnaPythonCommand.Append(fConfirmRunNumberString);
04662 
04663       //......................................... arguments -> Analyzer parameters
04664       //.......... ${2}
04665       CnaPythonCommand.Append(' ');
04666       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04667       const Text_t *t_StringAnaType = (const Text_t *)fKeyAnaType.Data();
04668       CnaPythonCommand.Append(t_StringAnaType);
04669       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04670 
04671       //.......... ${3}
04672       CnaPythonCommand.Append(' ');
04673       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04674       const Text_t *t_NbOfSamplesString = (const Text_t *)fKeyNbOfSamplesString.Data();
04675       CnaPythonCommand.Append(t_NbOfSamplesString);
04676       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04677 
04678       //.......... ${4}
04679       CnaPythonCommand.Append(' ');
04680       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04681       const Text_t *t_FirstReqEvtNumberString = (const Text_t *)fKeyFirstReqEvtNumberString.Data();
04682       CnaPythonCommand.Append(t_FirstReqEvtNumberString);
04683       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04684 
04685       //.......... ${5}
04686       CnaPythonCommand.Append(' ');
04687       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04688       const Text_t *t_LastReqEvtNumberString = (const Text_t *)fKeyLastReqEvtNumberString.Data();
04689       CnaPythonCommand.Append(t_LastReqEvtNumberString);
04690       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04691 
04692       //.......... ${6}
04693       CnaPythonCommand.Append(' ');
04694       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04695       const Text_t *t_ReqNbOfEvtsString = (const Text_t *)fKeyReqNbOfEvtsString.Data();
04696       CnaPythonCommand.Append(t_ReqNbOfEvtsString);
04697       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04698 
04699       //.......... ${7}
04700       CnaPythonCommand.Append(' ');
04701       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04702       const Text_t *t_fStexName = (const Text_t *)fStexName.Data();
04703       CnaPythonCommand.Append(t_fStexName);
04704       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04705 
04706       //.......... ${8}
04707       CnaPythonCommand.Append(' ');
04708       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04709       const Text_t *t_StexNumberString = (const Text_t *)fKeyStexNumberString.Data();
04710       CnaPythonCommand.Append(t_StexNumberString);
04711       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04712 
04713       //......................................... arguments -> python file name
04714       //.......... ${9}
04715       // - - - - - - - - - - - - - - - - - Build the name
04716       fPythonFileName = "EcnaPython_";
04717 
04718       fPythonFileName.Append(t_StringAnaType);
04719       fPythonFileName.Append('_');
04720 
04721       fPythonFileName.Append('S');
04722       fPythonFileName.Append('1');
04723       fPythonFileName.Append('_');
04724       fPythonFileName.Append(t_NbOfSamplesString);
04725       fPythonFileName.Append('_');
04726       fPythonFileName.Append('R');
04727 
04728       const Text_t *t_fConfirmRunNumberString = (const Text_t *)fConfirmRunNumberString.Data();
04729       fPythonFileName.Append(t_fConfirmRunNumberString);
04730       fPythonFileName.Append('_');
04731 
04732       fPythonFileName.Append(t_FirstReqEvtNumberString);
04733       fPythonFileName.Append('_');
04734 
04735       fPythonFileName.Append(t_LastReqEvtNumberString);
04736       fPythonFileName.Append('_');
04737 
04738       fPythonFileName.Append(t_ReqNbOfEvtsString);
04739       fPythonFileName.Append('_');
04740 
04741       fPythonFileName.Append(t_fStexName);
04742 
04743       fPythonFileName.Append(t_StexNumberString);      //  <== (python file name without extension .py)
04744       // - - - - - - - - - - - - - - - - - 
04745 
04746       CnaPythonCommand.Append(' ');
04747       const Text_t *t_fPythonFileName = (const Text_t *)fPythonFileName.Data();
04748       CnaPythonCommand.Append(t_fPythonFileName);
04749 
04750       //......................................... arguments -> modules:data path
04751       //.......... ${9}
04752       CnaPythonCommand.Append(' ');
04753       const Text_t *t_modules_data_path = (const Text_t *)ModulesdataPath.Data();
04754       CnaPythonCommand.Append(t_modules_data_path);
04755 
04756       //......................................... arguments -> last evt number (without "")
04757       //.......... ${10}
04758       //CnaPythonCommand.Append(' ');
04759       //CnaPythonCommand.Append(t_LastReqEvtNumberString);
04760 
04761       //......................................... arguments -> SourceForPythonFileName
04762       //.......... ${11}
04763       //CnaPythonCommand.Append(' ');
04764       //const Text_t *t_Pyf = (const Text_t *)fKeyPyf.Data();
04765       //CnaPythonCommand.Append(t_Pyf);
04766 
04767       //---------------------------------- Exec python file building command (csh before command text)  
04768       const Text_t *t_cnapythoncommand = (const Text_t *)CnaPythonCommand.Data();
04769       TString CnaExecPythonCommand = "csh ";
04770       CnaExecPythonCommand.Append(t_cnapythoncommand);
04771 
04772       Int_t i_exec_python = gSystem->Exec(CnaExecPythonCommand.Data());
04773 
04774       if( i_exec_python != 0 )
04775         {
04776           cout << "*TEcnaGui> Script for python file building was executed with error code = "
04777                << i_exec_python << "." << endl
04778                << "           python file: " << fPythonFileName.Data() << ".py" << endl
04779                << "           Command: " << CnaExecPythonCommand.Data() << endl
04780                << fTTBELL << endl;
04781         }
04782       else
04783         {
04784           cout << "*TEcnaGui> Script for python file building was successfully executed." << endl
04785                << "           python file: " << fPythonFileName.Data() << ".py" << endl
04786                << "           (Command: " << CnaExecPythonCommand.Data() << ")" << endl;
04787 
04788           //========================================================== Job submission script
04789           TString CnaSubmitCommand = ModulesdataPath;
04790 
04791           //......................................... Script for job submission: command name
04792           TString SubmitScriptName = "EcnaSystemScriptSubmit";
04793           const Text_t *t_SubmitScriptName= (const Text_t *)SubmitScriptName.Data();
04794           CnaSubmitCommand.Append(t_SubmitScriptName);
04795           CnaSubmitCommand.Append(' ');
04796 
04797           //......................................... Script for job submission: arguments
04798           const Text_t *t_cmssw_base = (const Text_t *)fCnaParPaths->CMSSWBase().Data();
04799           CnaSubmitCommand.Append(t_cmssw_base);
04800           CnaSubmitCommand.Append(' ');
04801 
04802           const Text_t *t_cmssw_subsystem = (const Text_t *)fCnaParPaths->CMSSWSubsystem().Data();
04803           CnaSubmitCommand.Append(t_cmssw_subsystem);
04804           CnaSubmitCommand.Append(' ');
04805 
04806           const Text_t *t_cfgp_file = (const Text_t *)fPythonFileName.Data();
04807           CnaSubmitCommand.Append(t_cfgp_file);
04808           CnaSubmitCommand.Append(' ');
04809       
04810           const Text_t *t_QueueCode = (const Text_t *)QueueCode.Data();
04811           CnaSubmitCommand.Append(t_QueueCode);
04812 
04813           //----------------------------------------- Exec Submit Command (csh before command text)
04814           const Text_t *t_cnasubmitcommand = (const Text_t *)CnaSubmitCommand.Data();
04815           TString CnaExecSubmitCommand = "csh ";
04816           CnaExecSubmitCommand.Append(t_cnasubmitcommand);
04817 
04818           Int_t i_exec_submit = gSystem->Exec(CnaExecSubmitCommand.Data());
04819       
04820           if( i_exec_submit != 0 )
04821             {
04822               cout << "*TEcnaGui> Script for job submission was executed with error code = "
04823                    << i_exec_submit << "."  << endl
04824                    << "          Command: " << CnaExecSubmitCommand.Data() << endl
04825                    << fTTBELL << endl;
04826             }
04827           else
04828             {
04829               cout << "*TEcnaGui> Job with configuration file: " << fPythonFileName.Data()
04830                    << " was successfully submitted." << endl
04831                    << "          (Command: " << CnaExecSubmitCommand.Data() << ")" << endl;       
04832             }
04833       
04834           fConfirmSubmit          = 0;
04835           fConfirmRunNumber       = 0;
04836           fConfirmRunNumberString = "0";
04837         }
04838     }
04839   else
04840     {
04841       if( fKeyAnaType.BeginsWith("Adc") )
04842         {
04843           fCnaCommand++;
04844           cout << "   *TEcnaGui [" << fCnaCommand
04845                << "]> Request for submitting job in batch mode for run " << fKeyRunNumber
04846                << ". Syntax OK. Please, click again to confirm."
04847                << fTTBELL << endl;
04848           
04849           fConfirmSubmit          = 1;
04850           fConfirmRunNumber       = fKeyRunNumber;
04851           fConfirmRunNumberString = fKeyRunNumberString;
04852         }
04853       else
04854         {
04855           fCnaError++;
04856           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===>"
04857                << " Analysis name = " << fKeyAnaType
04858                << ": should begin with 'Adc'."
04859                << " Please, change the analysis name." << fTTBELL << endl;
04860           
04861           fConfirmSubmit          = 0;
04862           fConfirmRunNumber       = 0;
04863           fConfirmRunNumberString = "0";
04864         }
04865     }
04866 }
04867 //------------------------------------------- end of SubmitOnBatchSystem() ------------------------
04868 
04869 //==========================================================================
04870 //
04871 //             CleanBatchFiles()   M E T H O D 
04872 //
04873 //==========================================================================
04874 void TEcnaGui::CleanBatchFiles(const TString clean_code)
04875 {
04876   //Clean python files, submission scripts,...
04877 
04878   fCnaCommand++;
04879   cout << "   *TEcnaGui [" << fCnaCommand
04880        << "]> Clean requested with code: " << clean_code
04881        << endl;
04882 
04883   //================================ CLEAN SUBMISSION SCRIPTS ===================================
04884   if( clean_code == "Sub"  || clean_code == "All")
04885     {
04886       //.......................... get the path "modules/data"
04887       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/data/
04888       TString ModulesdataPath = fCnaParPaths->PathModulesData();
04889 
04890       //----------------------------------------- submission clean script: command text
04891       //......................................... submission clean script: script name
04892       TString CnaCleanSubmissionCommand = ModulesdataPath;
04893       TString CleanSubmissionScriptName = "EcnaSystemScriptCleanSubmissionScripts";
04894       const Text_t *t_CleanSubmissionScriptName = (const Text_t *)CleanSubmissionScriptName.Data();
04895       CnaCleanSubmissionCommand.Append(t_CleanSubmissionScriptName);
04896 
04897       //......................................... arguments -> test/slc... path
04898       //.......................... get the path "test/slc4_ia32_gcc345"
04899       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/test/slc4_ia32_gcc345/
04900       TString TestslcPath = fCnaParPaths->PathTestScramArch();
04901       CnaCleanSubmissionCommand.Append(' ');
04902       const Text_t *t_modules_data_path = (const Text_t *)TestslcPath.Data();
04903       CnaCleanSubmissionCommand.Append(t_modules_data_path);
04904 
04905       //----------------------------------------- Exec CleanSubmission Command (csh before command text)
04906       const Text_t *t_cnacleansubmissioncommand = (const Text_t *)CnaCleanSubmissionCommand.Data();
04907       TString CnaExecCleanSubmissionCommand = "csh ";
04908       CnaExecCleanSubmissionCommand.Append(t_cnacleansubmissioncommand);
04909 
04910       Int_t i_exec_cleansubmission = gSystem->Exec(CnaExecCleanSubmissionCommand.Data());
04911 
04912       if( i_exec_cleansubmission != 0 )
04913         {
04914           cout << "*TEcnaGui> Script for submission script clean was executed with error code = "
04915                << i_exec_cleansubmission << "."  << endl
04916                << "          Command: " << CnaExecCleanSubmissionCommand.Data() << endl
04917                << fTTBELL << endl;
04918         }
04919       else
04920         {
04921           cout << "*TEcnaGui> Script for submission script clean"
04922                << " was successfully executed." << endl
04923                << "          (Command: " << CnaExecCleanSubmissionCommand.Data() << ")" << endl;          
04924         }
04925 
04926     }
04927 
04928   //================================= CLEAN LSFJOB REPORTS ======================================
04929   if( clean_code == "Job"  || clean_code == "All")
04930     {
04931       //.......................... get the path "modules/data"
04932       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/data/
04933       TString ModulesdataPath = fCnaParPaths->PathModulesData();
04934 
04935       //----------------------------------------- jobreport clean script: command text
04936       //......................................... jobreport clean script: script name
04937       TString CnaCleanJobreportCommand = ModulesdataPath;
04938       TString CleanJobreportScriptName = "EcnaSystemScriptCleanLSFJOBReports";
04939       const Text_t *t_CleanJobreportScriptName = (const Text_t *)CleanJobreportScriptName.Data();
04940       CnaCleanJobreportCommand.Append(t_CleanJobreportScriptName);
04941 
04942       //......................................... arguments -> test/slc... path
04943       //.......................... get the path "test/slc4_ia32_gcc345"
04944       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/test/slc4_ia32_gcc345/
04945       TString TestslcPath = fCnaParPaths->PathTestScramArch();
04946       CnaCleanJobreportCommand.Append(' ');
04947       const Text_t *t_modules_data_path = (const Text_t *)TestslcPath.Data();
04948       CnaCleanJobreportCommand.Append(t_modules_data_path);
04949 
04950       //----------------------------------------- Exec CleanJobreport Command (csh before command text)
04951       const Text_t *t_cnacleanjobreportcommand = (const Text_t *)CnaCleanJobreportCommand.Data();
04952       TString CnaExecCleanJobreportCommand = "csh ";
04953       CnaExecCleanJobreportCommand.Append(t_cnacleanjobreportcommand);
04954 
04955       Int_t i_exec_cleanjobreport = gSystem->Exec(CnaExecCleanJobreportCommand.Data());
04956 
04957       if( i_exec_cleanjobreport != 0 )
04958         {
04959           cout << "*TEcnaGui> Script for LSFJOB report clean was executed with error code = "
04960                << i_exec_cleanjobreport << "."  << endl
04961                << "          Command: " << CnaExecCleanJobreportCommand.Data() << endl
04962                << fTTBELL << endl;
04963         }
04964       else
04965         {
04966           cout << "*TEcnaGui> Script for LSFJOB report clean"
04967                << " was successfully executed." << endl
04968                << "          (Command: " << CnaExecCleanJobreportCommand.Data() << ")" << endl;   
04969         }
04970     }
04971 
04972   //==================================== CLEAN PYTHON FILES =====================================
04973   if( clean_code == "Pyth" || clean_code == "All")
04974     {
04975       //.......................... get the path "modules/data"
04976       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/data/
04977       TString ModulesdataPath = fCnaParPaths->PathModulesData();
04978 
04979       //----------------------------------------- python file clean script: command text
04980       //......................................... python file clean script: script name
04981       TString CnaCleanPythonCommand = ModulesdataPath;
04982       TString CleanPythonScriptName = "EcnaSystemScriptCleanPythonFiles";
04983       const Text_t *t_CleanPythonScriptName = (const Text_t *)CleanPythonScriptName.Data();
04984       CnaCleanPythonCommand.Append(t_CleanPythonScriptName);
04985 
04986       //......................................... arguments -> modules:data path
04987       CnaCleanPythonCommand.Append(' ');
04988       const Text_t *t_modules_data_path = (const Text_t *)ModulesdataPath.Data();
04989       CnaCleanPythonCommand.Append(t_modules_data_path);
04990 
04991       //----------------------------------------- Exec CleanPython Command (csh before command text)
04992       const Text_t *t_cnacleanpythoncommand = (const Text_t *)CnaCleanPythonCommand.Data();
04993       TString CnaExecCleanPythonCommand = "csh ";
04994       CnaExecCleanPythonCommand.Append(t_cnacleanpythoncommand);
04995 
04996       Int_t i_exec_cleanpython = gSystem->Exec(CnaExecCleanPythonCommand.Data());
04997 
04998       if( i_exec_cleanpython != 0 )
04999         {
05000           cout << "*TEcnaGui> Script for python file clean was executed with error code = "
05001                << i_exec_cleanpython << "."  << endl
05002                << "          Command: " << CnaExecCleanPythonCommand.Data() << endl
05003                << fTTBELL << endl;
05004         }
05005       else
05006         {
05007           cout << "*TEcnaGui> Script for python file clean"
05008                << " was successfully executed." << endl
05009                << "          (Command: " << CnaExecCleanPythonCommand.Data() << ")" << endl;      
05010         }
05011     }
05012 }
05013 //------------------------------------------- end of CleanBatchFiles() -----------------------
05014 
05015 //==========================================================================
05016 //
05017 //             Calculations()   M E T H O D 
05018 //
05019 //==========================================================================
05020 void TEcnaGui::Calculations(const TString calc_code)
05021 {
05022   //Calculations of quantities (Pedestals, correlations, ... )
05023 
05024   fCnaCommand++;
05025   cout << "   *TEcnaGui [" << fCnaCommand
05026        << "]> Calculations requested with code: " << calc_code
05027        << endl;
05028 
05029   //===== Check if Analysis name is right 
05030   if( fKeyAnaType == "AdcPed1"  || fKeyAnaType == "AdcSPed1"  ||   
05031       fKeyAnaType == "AdcPed6"  || fKeyAnaType == "AdcSPed6"  || 
05032       fKeyAnaType == "AdcPed12" || fKeyAnaType == "AdcSPed12" || 
05033       fKeyAnaType == "AdcPeg12" || fKeyAnaType == "AdcSPeg12" ||
05034       fKeyAnaType == "AdcLaser" || fKeyAnaType == "AdcSLaser" || 
05035       fKeyAnaType == "AdcPes12" || fKeyAnaType == "AdcSPes12" || 
05036       fKeyAnaType == "AdcPhys"  || fKeyAnaType == "AdcAny" )
05037     {
05038       //------------ Check if Std or (Scc or Stt)-Confirmed
05039       if( calc_code == "Std" || ( ( calc_code == "Scc" || calc_code == "Stt" ) && fConfirmCalcScc == 1 ) )
05040         {
05041           if( fKeyNbOfSamples >= fKeyNbOfSampForCalc )
05042             {
05043               Int_t nStexMin = fKeyStexNumber;
05044               Int_t nStexMax = fKeyStexNumber;
05045               if( fKeyStexNumber == 0 ){nStexMin = 1; nStexMax = fEcal->MaxStexInStas();}
05046 
05047               for( Int_t nStex = nStexMin; nStex<= nStexMax; nStex++)
05048                 {
05049                   Int_t n_samp_fic = fKeyNbOfSamples;
05050 
05051                   //....................... READ the "ADC" (AdcPed.., AdcLaser..., ...) file
05052                   TEcnaRun* MyRun = 0; 
05053                   if ( MyRun == 0 ){MyRun = new TEcnaRun(fObjectManager, fSubDet.Data(), n_samp_fic);  fCnew++;}
05054 
05055                   MyRun->GetReadyToReadData(fKeyAnaType.Data(),    fKeyRunNumber,
05056                                             fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, nStex);
05057 
05058                   if( MyRun->ReadSampleAdcValues(fKeyNbOfSampForCalc) == kTRUE )
05059                     {
05060                       cout << "*TEcnaGui::Calculations> File "
05061                            << MyRun->GetRootFileNameShort() << " found. Starting calculations."
05062                            << endl;
05063 
05064                       MyRun->GetReadyToCompute();
05065 
05066                       //............... Calculations
05067                       if( calc_code == "Std" ||
05068                           ( (calc_code == "Scc" || calc_code == "Stt") && fConfirmCalcScc == 1 ) )
05069                         {
05070                           //-------------- Standard calculations: pedestals, noises, correlations between samples
05071                           MyRun->StandardCalculations();
05072                         }
05073                       if( (calc_code == "Scc" || calc_code == "Stt") && fConfirmCalcScc == 1 )
05074                         {
05075                           if( calc_code == "Scc" )
05076                             {
05077                               //------ Additional calculations:
05078                               //       "correlations" between Xtals and Stins (long time, big file)
05079                               cout << "*TEcnaGui::Calculations> Please, wait." << endl;
05080                           
05081                               MyRun->Expert1Calculations();    //   (long time, big file)
05082                               // <=> MyRun->LowFrequencyCorrelationsBetweenChannels();     //   (big file)
05083                               //     MyRun->HighFrequencyCorrelationsBetweenChannels();    //   (big file) 
05084                           
05085                               MyRun->Expert2Calculations();    //   (fast because expert1 has been called)
05086                               // <=> MyRun->LowFrequencyMeanCorrelationsBetweenStins();
05087                               //     MyRun->HighFrequencyMeanCorrelationsBetweenStins();
05088                             }
05089                       
05090                           if( calc_code == "Stt" )
05091                             {
05092                               //---Additional calculations:
05093                               //   "correlations" between Stins (long time, "normal" size file)
05094                               cout << "*TEcnaGui::Calculations> Please, wait." << endl;
05095 
05096                               MyRun->Expert2Calculations();    //  (long time but not big file)
05097 
05098                               // Explanation/example: if MyRun->LowFrequencyCorrelationsBetweenChannels() (expert1)
05099                               // has not been called by the user, it is automatically called by
05100                               // MyRun->LowFrequencyMeanCorrelationsBetweenStins()
05101                               // but the corresponding file is not written (idem for "HighFrequency")
05102                             }
05103                         }
05104                       //.......................... WRITE results in file 
05105                       TString calc_file_name = "?";
05106                       if( calc_code == "Std" )
05107                         {
05108                           if( fKeyAnaType == "AdcPed1"   ){calc_file_name = "StdPed1";}
05109                           if( fKeyAnaType == "AdcPed6"   ){calc_file_name = "StdPed6";}
05110                           if( fKeyAnaType == "AdcPed12"  ){calc_file_name = "StdPed12";}
05111                           if( fKeyAnaType == "AdcPeg12"  ){calc_file_name = "StdPeg12";}
05112                           if( fKeyAnaType == "AdcLaser"  ){calc_file_name = "StdLaser";}
05113                           if( fKeyAnaType == "AdcPes12"  ){calc_file_name = "StdPes12";}
05114 
05115                           if( fKeyAnaType == "AdcSPed1"  ){calc_file_name = "StdSPed1";}
05116                           if( fKeyAnaType == "AdcSPed6"  ){calc_file_name = "StdSPed6";}
05117                           if( fKeyAnaType == "AdcSPed12" ){calc_file_name = "StdSPed12";}
05118                           if( fKeyAnaType == "AdcSPeg12" ){calc_file_name = "StdSPeg12";}
05119                           if( fKeyAnaType == "AdcSLaser" ){calc_file_name = "StdSLaser";}
05120                           if( fKeyAnaType == "AdcSPes12" ){calc_file_name = "StdSPes12";}
05121 
05122                           if( fKeyAnaType == "AdcPhys"   ){calc_file_name = "StdPhys";}
05123                           if( fKeyAnaType == "AdcAny"    ){calc_file_name = "StdAny";}
05124 
05125                         }
05126                       if( calc_code == "Scc" )
05127                         {
05128                           if( fKeyAnaType == "AdcPed1"   ){calc_file_name = "SccPed1";}
05129                           if( fKeyAnaType == "AdcPed6"   ){calc_file_name = "SccPed6";}
05130                           if( fKeyAnaType == "AdcPed12"  ){calc_file_name = "SccPed12";}
05131                           if( fKeyAnaType == "AdcPeg12"  ){calc_file_name = "SccPeg12";}
05132                           if( fKeyAnaType == "AdcLaser"  ){calc_file_name = "SccLaser";}
05133                           if( fKeyAnaType == "AdcPes12"  ){calc_file_name = "SccPes12" ;}
05134 
05135                           if( fKeyAnaType == "AdcSPed1"  ){calc_file_name = "SccSPed1";}
05136                           if( fKeyAnaType == "AdcSPed6"  ){calc_file_name = "SccSPed6";}
05137                           if( fKeyAnaType == "AdcSPed12" ){calc_file_name = "SccSPed12";}
05138                           if( fKeyAnaType == "AdcSPeg12" ){calc_file_name = "SccSPeg12";}
05139                           if( fKeyAnaType == "AdcSLaser" ){calc_file_name = "SccSLaser";}
05140                           if( fKeyAnaType == "AdcSPes12" ){calc_file_name = "SccSPes12";}
05141 
05142                           if( fKeyAnaType == "AdcPhys"   ){calc_file_name = "SccPhys";}
05143                           if( fKeyAnaType == "AdcAny"    ){calc_file_name = "SccAny";}
05144                         }
05145 
05146                       if( calc_code == "Stt" )
05147                         {
05148                           if( fKeyAnaType == "AdcPed1"   ){calc_file_name = "SttPed1";}
05149                           if( fKeyAnaType == "AdcPed6"   ){calc_file_name = "SttPed6";}
05150                           if( fKeyAnaType == "AdcPed12"  ){calc_file_name = "SttPed12";}
05151                           if( fKeyAnaType == "AdcPeg12"  ){calc_file_name = "SttPeg12";}
05152                           if( fKeyAnaType == "AdcLaser"  ){calc_file_name = "SttLaser";}
05153                           if( fKeyAnaType == "AdcPes12"  ){calc_file_name = "SttPes12" ;}
05154 
05155                           if( fKeyAnaType == "AdcSPed1"  ){calc_file_name = "SttSPed1";}
05156                           if( fKeyAnaType == "AdcSPed6"  ){calc_file_name = "SttSPed6";}
05157                           if( fKeyAnaType == "AdcSPed12" ){calc_file_name = "SttSPed12";}
05158                           if( fKeyAnaType == "AdcSPeg12" ){calc_file_name = "SttSPeg12";}
05159                           if( fKeyAnaType == "AdcSLaser" ){calc_file_name = "SttSLaser";}
05160                           if( fKeyAnaType == "AdcSPes12" ){calc_file_name = "SttSPes12";}
05161 
05162                           if( fKeyAnaType == "AdcPhys"   ){calc_file_name = "SttPhys";}
05163                           if( fKeyAnaType == "AdcAny"    ){calc_file_name = "SttAny";}
05164                         }
05165 
05166                       if( MyRun->WriteNewRootFile(calc_file_name.Data()) == kTRUE )
05167                         {
05168                           cout << "*TEcnaGui::Calculations> Done. Write ROOT file: "
05169                                << MyRun->GetNewRootFileNameShort() << " OK" << endl << endl;
05170                         }
05171                       else 
05172                         {
05173                           cout << "!TEcnaGui::Calculations> Writing ROOT file failure for file "
05174                                << MyRun->GetNewRootFileNameShort()
05175                                << fTTBELL << endl << endl;
05176                         }
05177                     }
05178                   else
05179                     {
05180                       cout << "!TEcnaGui::Calculations> " << MyRun->GetRootFileNameShort() << ": file not found."
05181                            << fTTBELL << endl << endl;
05182                     }
05183                   //.......................................................................
05184                   delete MyRun; MyRun = 0;                    fCdelete++;
05185                 } // end of for( Int_t nStex = nStexMin; nStex<= nStexMax; nStex++)
05186               fConfirmCalcScc = 0;
05187             } // end of if( fKeyNbOfSamples >= fKeyNbOfSampForCalc )
05188           else
05189             {
05190               cout << "!TEcnaGui::Calculations> *** ERROR *** Number of samples in file (=" << fKeyNbOfSamples
05191                    << ") less than number of samples for calculations (= " << fKeyNbOfSampForCalc << "). " << endl;
05192             }
05193         } // end of if( calc_code == "Std" || ( ( calc_code == "Scc" || calc_code == "Stt" ) && fConfirmCalcScc == 1 ) )
05194       else
05195         {
05196           cout << "   *TEcnaGui [" << fCnaCommand
05197                << "]> Calculation requested with option " << calc_code
05198                << ". This can last more than 5 minutes. Please, click again to confirm."
05199                << fTTBELL << endl;
05200           fConfirmCalcScc = 1;
05201         }
05202     }
05203   else
05204     {
05205       cout << "!TEcnaGui::Calculations> fKeyAnaType = " << fKeyAnaType
05206            << "  : wrong code in analysis name." << endl
05207            << "                        List of available standard analysis names for calculations: " << endl
05208            << "                        AdcPed1,  AdcPed6,  AdcPed12,  AdcPeg12,  AdcLaser,  AdcPes12," << endl
05209            << "                        AdcSPed1, AdcSPed6, AdcSPed12, AdcSPeg12, AdcSLaser, AdcSPes12," << endl
05210            << "                        AdcPhys,  AdcAny (all names must begin with 'Adc')."
05211            << fTTBELL << endl; 
05212     }
05213 }
05214 //==========================================================================
05215 //
05216 //                       "View"    M E T H O D S
05217 //
05218 //==========================================================================
05219 //---------- common messages
05220 
05221 void TEcnaGui::MessageCnaCommandReplyA(const TString first_same_plot)
05222 {
05223   // reply message of the Cna command
05224 
05225   cout << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
05226        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber
05227        << ", last req. evt#: " << fKeyLastReqEvtNumber << endl;
05228   
05229   if( first_same_plot == "ASCII" )
05230     {
05231       cout  << "                   " << fStexName.Data() << ": " << fKeyStexNumber
05232             << ", option: " << first_same_plot << endl;
05233     }
05234 }
05235 
05236 void TEcnaGui::MessageCnaCommandReplyB(const TString first_same_plot)
05237 {
05238   // reply message of the Cna command
05239 
05240   if( first_same_plot == "ASCII" )
05241     {
05242       if(fKeyStexNumber > 0)
05243         {
05244           if( fHistos->StatusFileFound() == kTRUE && fHistos->StatusDataExist() == kTRUE )
05245             {
05246               TString xAsciiFileName = fHistos->AsciiFileName();
05247               if( xAsciiFileName != "?" )
05248                 {cout  << "               Histo written in ASCII file: " << xAsciiFileName.Data();}
05249             }
05250         }
05251       else
05252         {
05253           cout  << "               No writing in ASCII file since "
05254                 << fStexName.Data() << " number = " << fKeyStexNumber;
05255         }
05256       cout << endl;
05257     }
05258 }
05259 
05260 //==========================================================================
05261 //
05262 //                  View  Matrix
05263 //
05264 //==========================================================================
05265 //---------------------------- Cortt
05266 void TEcnaGui::ViewMatrixLowFrequencyMeanCorrelationsBetweenStins(const TString option_plot)
05267 {
05268   // Plot of Low Frequency Mean Cor(c,c') for each pair of Stins
05269 
05270   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05271   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05272                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05273 
05274   fCnaCommand++;
05275   cout << "   *TEcnaGui [" << fCnaCommand
05276        << "]> Low Frequency Mean Cor(c,c') for each pair of " << fStinName.Data()
05277        << "s. Option: "
05278        << option_plot;
05279   MessageCnaCommandReplyA(option_plot);
05280 
05281   fHistos->SetHistoMin(fKeyVminLFccMos);
05282   fHistos->SetHistoMax(fKeyVmaxLFccMos);
05283   fHistos->GeneralTitle(fKeyGeneralTitle);
05284   fHistos->PlotMatrix("Cor", "MttLF", option_plot);
05285 
05286   MessageCnaCommandReplyB(option_plot);
05287 }
05288 void TEcnaGui::ViewMatrixHighFrequencyMeanCorrelationsBetweenStins(const TString option_plot)
05289 {
05290   // Plot of Low Frequency Mean Cor(c,c') for each pair of Stins
05291 
05292   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05293   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05294                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05295 
05296   fCnaCommand++;
05297   cout << "   *TEcnaGui [" << fCnaCommand
05298        << "]> High Frequency Mean Cor(c,c') for each pair of " << fStinName.Data()
05299        << "s. Option: "
05300        << option_plot;
05301   MessageCnaCommandReplyA(option_plot);
05302 
05303   fHistos->SetHistoMin(fKeyVminHFccMos);
05304   fHistos->SetHistoMax(fKeyVmaxHFccMos);
05305   fHistos->GeneralTitle(fKeyGeneralTitle); 
05306   fHistos->PlotMatrix("Cor", "MttHF", option_plot);
05307 
05308   MessageCnaCommandReplyB(option_plot);
05309 }
05310 //---------------------------------------------- Corcc
05311 void TEcnaGui::ViewMatrixLowFrequencyCorrelationsBetweenChannels(const Int_t&  cStexStin_A,
05312                                                                  const Int_t&  cStexStin_B,
05313                                                                  const TString option_plot)
05314 {
05315   // Low Frequency Correlation matrix (crystal of Stin X, crystal of Stin X) for each Stin
05316 
05317   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05318   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05319                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05320   
05321   fCnaCommand++;
05322   cout << "   *TEcnaGui [" << fCnaCommand
05323        << "]> Low Frequency Correlation matrix between channels. "
05324        << fStinName.Data() << " A: " << cStexStin_A
05325        << ", " << fStinName.Data() << " B: " << cStexStin_B
05326        << ", option: " << option_plot;
05327   MessageCnaCommandReplyA(option_plot);
05328 
05329   fHistos->SetHistoMin(fKeyVminLHFcc);
05330   fHistos->SetHistoMax(fKeyVmaxLHFcc); 
05331   fHistos->GeneralTitle(fKeyGeneralTitle);
05332   fHistos->PlotMatrix("Cor", "MccLF", cStexStin_A, cStexStin_B, option_plot);
05333   MessageCnaCommandReplyB(option_plot);
05334 }
05335 
05336 void TEcnaGui::ViewMatrixHighFrequencyCorrelationsBetweenChannels(const Int_t&  cStexStin_A, const Int_t& cStexStin_B,
05337                                                                   const TString option_plot)
05338 {
05339 // High Frequency Correlation matrix (crystal of Stin X, crystal of Stin X) for each Stin
05340 
05341   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05342   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05343                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05344   
05345   fCnaCommand++;
05346   cout << "   *TEcnaGui [" << fCnaCommand
05347        << "]> High Frequency Correlation matrix between channels. "
05348        << fStinName.Data() << " A: " << cStexStin_A
05349        << ", " << fStinName.Data() << " B: " << cStexStin_B
05350        << ", option: " << option_plot;
05351   MessageCnaCommandReplyA(option_plot);
05352 
05353   fHistos->SetHistoMin(fKeyVminLHFcc);
05354   fHistos->SetHistoMax(fKeyVmaxLHFcc); 
05355   fHistos->GeneralTitle(fKeyGeneralTitle);
05356   fHistos->PlotMatrix("Cor", "MccHF", cStexStin_A, cStexStin_B, option_plot);
05357   
05358   MessageCnaCommandReplyB(option_plot);
05359 }
05360 
05361 void TEcnaGui::ViewStexLowFrequencyCorcc()
05362 {
05363   //===> big matrix
05364 
05365   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05366   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05367                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05368 
05369   fCnaCommand++;
05370   cout << "   *TEcnaGui [" << fCnaCommand
05371        << "]> LF Correlations between channels for each " << fStinName.Data()
05372        << " in " << fStexName.Data() << ". 2D histo. "
05373        << fStexName.Data() << ": " << fKeyStexNumber;
05374   MessageCnaCommandReplyA("DUMMY");
05375 
05376   fHistos->SetHistoMin(fKeyVminLHFcc);
05377   fHistos->SetHistoMax(fKeyVmaxLHFcc);
05378   fHistos->GeneralTitle(fKeyGeneralTitle);
05379   fHistos->PlotMatrix("Cor", "MccLF", "COLZ");
05380 
05381   MessageCnaCommandReplyB("DUMMY");
05382 }
05383 
05384 void TEcnaGui::ViewStexHighFrequencyCorcc()
05385 {
05386   //===> big matrix
05387 
05388   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05389   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05390                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05391 
05392   fCnaCommand++;
05393   cout << "   *TEcnaGui [" << fCnaCommand
05394        << "]> HF Correlations between channels for each " << fStinName.Data()
05395        << " in " << fStexName.Data() << ". 2D histo. "
05396        << fStexName.Data() << ": " << fKeyStexNumber;
05397   MessageCnaCommandReplyA("DUMMY");
05398 
05399   fHistos->SetHistoMin(fKeyVminLHFcc);
05400   fHistos->SetHistoMax(fKeyVmaxLHFcc);
05401   fHistos->GeneralTitle(fKeyGeneralTitle);
05402   fHistos->PlotMatrix("Cor", "MccHF", "COLZ");
05403 
05404   MessageCnaCommandReplyB("DUMMY");
05405 }
05406 
05407 //---------------------------- Corss, Covss
05408 void TEcnaGui::ViewMatrixCorrelationSamples(const Int_t&  cStexStin_A, const Int_t& i0StinEcha,
05409                                            const TString option_plot)
05410 {
05411 // Plot of correlation matrix between samples for a given channel
05412 
05413   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05414   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05415                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05416   
05417   Int_t ChOffset = 0;
05418   if(fSubDet == "EE"){ChOffset = 1;}
05419 
05420   fCnaCommand++;
05421   cout << "   *TEcnaGui [" << fCnaCommand
05422        << "]> Correlation matrix between samples. "
05423        << fStinName.Data() << ": " << cStexStin_A  << ", channel " << i0StinEcha + ChOffset
05424        << ", option: " << option_plot;
05425   MessageCnaCommandReplyA(option_plot);
05426 
05427   fHistos->GeneralTitle(fKeyGeneralTitle);
05428   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
05429   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
05430   fHistos->PlotMatrix("Cor", "Mss", cStexStin_A, i0StinEcha, option_plot);
05431 
05432 
05433   MessageCnaCommandReplyB(option_plot);
05434 }
05435 
05436 void TEcnaGui::ViewMatrixCovarianceSamples(const Int_t&  cStexStin_A, const Int_t& i0StinEcha,
05437                                           const TString option_plot)
05438 {
05439 // Plot of covariance matrix between samples for a given channel
05440 
05441   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05442   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05443                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05444 
05445   Int_t ChOffset = 0;
05446   if(fSubDet == "EE"){ChOffset = 1;}
05447   
05448   fCnaCommand++;
05449   cout << "   *TEcnaGui [" << fCnaCommand
05450        << "]> Covariance matrix between samples. "
05451        << fStinName.Data() << ": " << cStexStin_A  << ", channel " << i0StinEcha + ChOffset
05452        << ", option: " << option_plot;
05453   MessageCnaCommandReplyA(option_plot);
05454 
05455   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);  // same as mean sample sigmas
05456   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb);
05457   fHistos->GeneralTitle(fKeyGeneralTitle);
05458   fHistos->PlotMatrix("Cov", "Mss", cStexStin_A, i0StinEcha, option_plot);
05459 
05460   MessageCnaCommandReplyB(option_plot);
05461 }
05462 
05463 //==========================================================================
05464 //
05465 //                         ViewStin...     
05466 //
05467 //     StexStin ==> (sample,sample) matrices for all the crystal of cStexStin              
05468 //
05469 //==========================================================================
05470 void TEcnaGui::ViewStinCorrelationSamples(const Int_t& cStexStin)
05471 {
05472   // Plot of (sample,sample) correlation matrices for all the crystal of a given Stin  
05473 
05474   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05475   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05476                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05477   
05478   fCnaCommand++;
05479   cout << "   *TEcnaGui [" << fCnaCommand
05480        << "]> Correlation matrices between samples for each channel of "
05481        << fStinName.Data() << " " << cStexStin;
05482   MessageCnaCommandReplyA("DUMMY"); 
05483 
05484   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
05485   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
05486   fHistos->GeneralTitle(fKeyGeneralTitle);  
05487   fHistos->CorrelationsBetweenSamples(cStexStin);
05488   
05489   MessageCnaCommandReplyB("DUMMY");
05490 }
05491 
05492 void TEcnaGui::ViewStinCovarianceSamples(const Int_t& cStexStin)
05493 {
05494   // Plot of (sample,sample) covariance matrices for all the crystal of a given Stin  
05495 
05496   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05497   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05498                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05499   
05500   fCnaCommand++;
05501   cout << "   *TEcnaGui [" << fCnaCommand
05502        << "]> Covariance matrices between samples for each channel of "
05503        << fStinName.Data() << " " << cStexStin;
05504   MessageCnaCommandReplyA("DUMMY");
05505 
05506   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);   // same as mean sample sigmas
05507   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb);
05508   fHistos->GeneralTitle(fKeyGeneralTitle);    
05509   fHistos->CovariancesBetweenSamples(cStexStin);
05510   
05511   MessageCnaCommandReplyB("DUMMY");
05512 }
05513 //==========================================================================
05514 //
05515 //                         ViewSorS (eta,phi)
05516 //
05517 //==========================================================================
05518 
05519 void TEcnaGui::ViewSorSNumberOfEvents()
05520 {
05521   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05522 
05523   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05524     {
05525       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05526                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05527       fCnaCommand++;
05528       cout << "   *TEcnaGui [" << fCnaCommand
05529            << "]> Number of Events. 2D histo. "
05530            << fStexName.Data() << ": " << fKeyStexNumber;
05531     }
05532   if( fKeyStexNumber == 0 )
05533     {
05534       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05535                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05536       fCnaCommand++;
05537       cout << "   *TEcnaGui [" << fCnaCommand
05538            << "]> Average Number of Events. 2D histo for "
05539            << fSubDet.Data();
05540     }
05541 
05542   MessageCnaCommandReplyA("DUMMY");
05543 
05544   fHistos->SetHistoMin(fKeyVminD_NOE_ChNb);
05545   fHistos->SetHistoMax(fKeyVmaxD_NOE_ChNb); 
05546   fHistos->GeneralTitle(fKeyGeneralTitle);    
05547   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05548     {fHistos->PlotDetector("NOE", "SM");}
05549   if( fKeyStexNumber == 0 )
05550     {fHistos->PlotDetector("NOE", "EB");}
05551 
05552   MessageCnaCommandReplyB("DUMMY");
05553 }
05554 
05555 void TEcnaGui::ViewSorSPedestals()
05556 {
05557   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05558 
05559   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05560     {
05561       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05562                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05563       fCnaCommand++;
05564       cout << "   *TEcnaGui [" << fCnaCommand
05565            << "]> Pedestals. 2D histo. "
05566            << fStexName.Data() << ": " << fKeyStexNumber;
05567     }
05568   if( fKeyStexNumber == 0 )
05569     {
05570       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05571                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05572       fCnaCommand++;
05573       cout << "   *TEcnaGui [" << fCnaCommand
05574            << "]> Pedestals. 2D histo for "
05575            << fSubDet.Data();
05576     }
05577   MessageCnaCommandReplyA("DUMMY");
05578 
05579   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
05580   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb); 
05581   fHistos->GeneralTitle(fKeyGeneralTitle);
05582      
05583   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05584     {fHistos->PlotDetector("Ped", "SM");}
05585   if( fKeyStexNumber == 0 )
05586     {fHistos->PlotDetector("Ped", "EB");}
05587 
05588   MessageCnaCommandReplyB("DUMMY");
05589 }
05590 
05591 void TEcnaGui::ViewSorSTotalNoise()
05592 {
05593   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05594 
05595   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05596     {
05597       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05598                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05599       fCnaCommand++;
05600       cout << "   *TEcnaGui [" << fCnaCommand
05601            << "]> Total noise. 2D histo. "
05602            << fStexName.Data() << ": " << fKeyStexNumber;
05603     }
05604   if( fKeyStexNumber == 0 )
05605     {
05606       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05607                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05608       fCnaCommand++;
05609       cout << "   *TEcnaGui [" << fCnaCommand
05610            << "]> Average total noise. 2D histo for "
05611            << fSubDet.Data();
05612     }
05613   MessageCnaCommandReplyA("DUMMY");
05614 
05615   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
05616   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
05617   fHistos->GeneralTitle(fKeyGeneralTitle);      
05618   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05619     {fHistos->PlotDetector("TNo", "SM");}
05620   if( fKeyStexNumber == 0 )
05621     {fHistos->PlotDetector("TNo", "EB");}
05622   
05623   MessageCnaCommandReplyB("DUMMY");
05624 }
05625 
05626 
05627 void TEcnaGui::ViewSorSLowFrequencyNoise()
05628 {
05629   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05630 
05631   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05632     {
05633       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05634                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05635       fCnaCommand++;
05636       cout << "   *TEcnaGui [" << fCnaCommand
05637            << "]> Low frequency noise. 2D histo. "
05638            << fStexName.Data() << ": " << fKeyStexNumber;
05639     }
05640   if( fKeyStexNumber == 0 )
05641     {
05642       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05643                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05644       fCnaCommand++;
05645       cout << "   *TEcnaGui [" << fCnaCommand
05646            << "]> Average low frequency noise. 2D histo for "
05647            << fSubDet.Data();
05648     }
05649   MessageCnaCommandReplyA("DUMMY");
05650 
05651   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
05652   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb);
05653   fHistos->GeneralTitle(fKeyGeneralTitle);     
05654   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05655     {fHistos->PlotDetector("LFN", "SM");}
05656   if( fKeyStexNumber == 0 )
05657     {fHistos->PlotDetector("LFN", "EB");}
05658   
05659   MessageCnaCommandReplyB("DUMMY");
05660 }
05661 
05662 void TEcnaGui::ViewSorSHighFrequencyNoise()
05663 {
05664   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05665 
05666   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05667     {
05668       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05669                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05670       fCnaCommand++;
05671       cout << "   *TEcnaGui [" << fCnaCommand
05672            << "]> High frequency noise. 2D histo. "
05673            << fStexName.Data() << ": " << fKeyStexNumber;
05674     }
05675   if( fKeyStexNumber == 0 )
05676     {
05677       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05678                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05679       fCnaCommand++;
05680       cout << "   *TEcnaGui [" << fCnaCommand
05681            << "]> Average high frequency noise. 2D histo for "
05682            << fSubDet.Data();
05683     }
05684   MessageCnaCommandReplyA("DUMMY");
05685 
05686   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
05687   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb); 
05688   fHistos->GeneralTitle(fKeyGeneralTitle);       
05689   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05690     {
05691       fHistos->PlotDetector("HFN", "SM");
05692     }
05693   if( fKeyStexNumber == 0 )
05694     {
05695       fHistos->PlotDetector("HFN", "EB");
05696     }
05697   
05698   MessageCnaCommandReplyB("DUMMY");
05699 }
05700 
05701 void TEcnaGui::ViewSorSMeanCorss()
05702 {
05703   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05704 
05705   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05706     {
05707       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05708                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05709       fCnaCommand++;
05710       cout << "   *TEcnaGui [" << fCnaCommand
05711            << "]> Mean cor(s,s'). 2D histo. "
05712            << fStexName.Data() << ": " << fKeyStexNumber;
05713     }
05714   if( fKeyStexNumber == 0 )
05715     {
05716       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05717                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05718       fCnaCommand++;
05719       cout << "   *TEcnaGui [" << fCnaCommand
05720            << "]> Average mean cor(s,s'). 2D histo for "
05721            << fSubDet.Data();
05722     }
05723   MessageCnaCommandReplyA("DUMMY");
05724 
05725   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
05726   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
05727   fHistos->GeneralTitle(fKeyGeneralTitle);     
05728   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05729     {
05730       fHistos->PlotDetector("MCs", "SM");
05731     }
05732   if( fKeyStexNumber == 0 )
05733     {
05734       fHistos->PlotDetector("MCs", "EB");
05735     }
05736   
05737   MessageCnaCommandReplyB("DUMMY");
05738 }
05739 
05740 void TEcnaGui::ViewSorSSigmaOfCorss()
05741 {
05742   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05743 
05744   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05745     {
05746       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05747                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05748       fCnaCommand++;
05749       cout << "   *TEcnaGui [" << fCnaCommand
05750            << "]> Sigma of Cor(s,s'). 2D histo. "
05751            << fStexName.Data() << ": " << fKeyStexNumber;
05752     }
05753   if( fKeyStexNumber == 0 )
05754     {
05755       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05756                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05757       fCnaCommand++;
05758       cout << "   *TEcnaGui [" << fCnaCommand
05759            << "]> Average sigma of Cor(s,s'). 2D histo for "
05760            << fSubDet.Data();
05761     }
05762   MessageCnaCommandReplyA("DUMMY");
05763 
05764   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
05765   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
05766   fHistos->GeneralTitle(fKeyGeneralTitle);
05767   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05768     {
05769       fHistos->PlotDetector("SCs", "SM");
05770     }
05771   if( fKeyStexNumber == 0 )
05772     {
05773       fHistos->PlotDetector("SCs", "EB");
05774     }
05775 
05776   MessageCnaCommandReplyB("DUMMY");
05777 }
05778 
05779 //=======================================================================================
05780 //
05781 //                        ViewStinCrystalNumbering
05782 //
05783 //=======================================================================================  
05784 void TEcnaGui::ViewStinCrystalNumbering(const Int_t& StexStinEcna)
05785 {
05786   // Plot the crystal numbering of one Stin
05787 
05788   Int_t StinNumber = -1;
05789   if( fSubDet == "EB" ){StinNumber = StexStinEcna;}
05790   if( fSubDet == "EE"  && fKeyStexNumber != 0 )
05791     {StinNumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber,StexStinEcna);}
05792 
05793   fCnaCommand++;
05794   cout << "   *TEcnaGui [" << fCnaCommand
05795        << "]> Crystal numbering for " << " " << fStexName.Data() << " "
05796        << fKeyStexNumber << ", " << fStinName.Data() << " " << StinNumber << endl;
05797 
05798   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05799   fHistos->GeneralTitle(fKeyGeneralTitle);
05800   fHistos->StinCrystalNumbering(fKeyStexNumber, StinNumber);
05801 }
05802 //---------------->  end of ViewStinCrystalNumbering()
05803 
05804 //===========================================================================
05805 //
05806 //                        ViewStexStinNumbering
05807 //
05808 //===========================================================================  
05809 void TEcnaGui::ViewStexStinNumbering()
05810 {
05811   // Plot the Stin numbering of one Stex.
05812   // No argument here since the Stex number is a part of the ROOT file name
05813   // and is in the entry field of the Stex button (fKeyStexNumber)
05814 
05815   fCnaCommand++;
05816   cout << "   *TEcnaGui [" << fCnaCommand
05817        << "]> " << fStinName.Data() << " numbering for " << fStexName.Data()
05818        << " " << fKeyStexNumber << endl;
05819 
05820   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05821   fHistos->GeneralTitle(fKeyGeneralTitle);
05822   fHistos->StexStinNumbering(fKeyStexNumber);
05823 }
05824 //---------------->  end of ViewStexStinNumbering()
05825 
05826 //===============================================================================
05827 //
05828 //                         ViewHisto...
05829 //
05830 //===============================================================================
05831 //......................... Nb of evts
05832 void TEcnaGui::ViewHistoSorSNumberOfEventsOfCrystals(const TString first_same_plot)
05833 {
05834 // Plot the 1D histogram of the number of events (found in the data)
05835 // as a function of crystals (grouped by Stins)
05836 
05837   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05838   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05839                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05840 
05841   fCnaCommand++;
05842   cout << "   *TEcnaGui [" << fCnaCommand
05843        << "]> Number of events for crystals";
05844   MessageCnaCommandReplyA(first_same_plot);
05845 
05846   fHistos->SetHistoMin(fKeyVminD_NOE_ChNb);
05847   fHistos->SetHistoMax(fKeyVmaxD_NOE_ChNb);
05848   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
05849   fHistos->SetHistoColorPalette(fKeyColPal);
05850   fHistos->GeneralTitle(fKeyGeneralTitle);
05851   fHistos->Plot1DHisto("Xtal", "NOE", "SM", first_same_plot);  // "SM" not active since fFapStexNumber is defined "outside"
05852 
05853   MessageCnaCommandReplyB(first_same_plot);
05854 }
05855 
05856 void TEcnaGui::ViewHistoSorSNumberOfEventsDistribution(const TString first_same_plot)
05857 {
05858 // Plot the 1D histogram of the number of events distribution for a Stex
05859 
05860   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05861   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05862                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05863 
05864   fCnaCommand++;
05865   cout << "   *TEcnaGui [" << fCnaCommand
05866        << "]> Number of events distribution";
05867   MessageCnaCommandReplyA(first_same_plot);
05868 
05869   fHistos->SetHistoMin(fKeyVminD_NOE_ChNb);
05870   fHistos->SetHistoMax(fKeyVmaxD_NOE_ChNb); 
05871   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
05872   fHistos->SetHistoColorPalette(fKeyColPal);
05873   fHistos->GeneralTitle(fKeyGeneralTitle);
05874   fHistos->Plot1DHisto("NOE", "NOX", "SM", first_same_plot);
05875 
05876   MessageCnaCommandReplyB(first_same_plot);
05877 }
05878 
05879 //........................... Pedestals
05880 void TEcnaGui::ViewHistoSorSPedestalsOfCrystals(const TString first_same_plot)
05881 {
05882 // Plot the 1D histogram of the pedestals as a function of crystals (grouped by Stins)
05883 
05884   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05885   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05886                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05887 
05888   fCnaCommand++;
05889   cout << "   *TEcnaGui [" << fCnaCommand
05890        << "]> Pedestals";
05891   MessageCnaCommandReplyA(first_same_plot);
05892 
05893   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
05894   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
05895   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05896   fHistos->SetHistoColorPalette(fKeyColPal);
05897   fHistos->GeneralTitle(fKeyGeneralTitle);
05898   fHistos->Plot1DHisto("Xtal", "Ped", "SM", first_same_plot);
05899 
05900   MessageCnaCommandReplyB(first_same_plot);
05901 }
05902 
05903 void TEcnaGui::ViewHistoSorSPedestalsDistribution(const TString first_same_plot)
05904 {
05905 // Plot the 1D histogram of the pedestals distribution for a Stex
05906 
05907   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05908   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05909                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05910 
05911   fCnaCommand++;
05912   cout << "   *TEcnaGui [" << fCnaCommand
05913        << "]> Pedestals distribution";
05914   MessageCnaCommandReplyA(first_same_plot);
05915 
05916   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
05917   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
05918   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05919   fHistos->SetHistoColorPalette(fKeyColPal);
05920   fHistos->GeneralTitle(fKeyGeneralTitle);
05921   fHistos->Plot1DHisto("Ped", "NOX", "SM", first_same_plot);
05922 
05923   MessageCnaCommandReplyB(first_same_plot);
05924 }
05925 
05926 //............................... Total noise
05927 void TEcnaGui::ViewHistoSorSTotalNoiseOfCrystals(const TString first_same_plot)
05928 {
05929 // Plot the 1D histogram of the mean sample sigmas as a function of crystals (grouped by Stins)
05930 
05931   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05932   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05933                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05934 
05935   fCnaCommand++;
05936   cout << "   *TEcnaGui [" << fCnaCommand
05937        << "]> Total noise";
05938   MessageCnaCommandReplyA(first_same_plot);
05939 
05940   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
05941   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb);
05942   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05943   fHistos->SetHistoColorPalette(fKeyColPal);
05944   fHistos->GeneralTitle(fKeyGeneralTitle);
05945   fHistos->Plot1DHisto("Xtal", "TNo", "SM", first_same_plot);
05946 
05947   MessageCnaCommandReplyB(first_same_plot);
05948 }
05949 
05950 void TEcnaGui::ViewHistoSorSTotalNoiseDistribution(const TString first_same_plot)
05951 {
05952 // Plot the 1D histogram of the mean sample sigmas distribution for a Stex
05953 
05954   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05955   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05956                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);  
05957 
05958   fCnaCommand++;
05959   cout << "   *TEcnaGui [" << fCnaCommand
05960        << "]> Total noise distribution";
05961   MessageCnaCommandReplyA(first_same_plot);
05962 
05963   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
05964   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb);  
05965   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05966   fHistos->SetHistoColorPalette(fKeyColPal);
05967   fHistos->GeneralTitle(fKeyGeneralTitle);
05968   fHistos->Plot1DHisto("TNo", "NOX", "SM", first_same_plot);
05969 
05970   MessageCnaCommandReplyB(first_same_plot);
05971 }
05972 
05973 
05974 //............................ Low frequency noise
05975 void TEcnaGui::ViewHistoSorSLowFrequencyNoiseOfCrystals(const TString first_same_plot)
05976 {
05977 // Plot the 1D histogram of the pedestals as a function of crystals (grouped by Stins)
05978 
05979   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05980   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05981                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
05982 
05983   fCnaCommand++;
05984   cout << "   *TEcnaGui [" << fCnaCommand
05985        << "]> Low frequency noise";
05986   MessageCnaCommandReplyA(first_same_plot);
05987 
05988   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
05989   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb);
05990   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05991   fHistos->SetHistoColorPalette(fKeyColPal);
05992   fHistos->GeneralTitle(fKeyGeneralTitle);
05993   fHistos->Plot1DHisto("Xtal", "LFN", "SM", first_same_plot);
05994 
05995   MessageCnaCommandReplyB(first_same_plot);
05996 }
05997 
05998 void TEcnaGui::ViewHistoSorSLowFrequencyNoiseDistribution(const TString first_same_plot)
05999 {
06000 // Plot the 1D histogram of the pedestals distribution for a Stex
06001 
06002   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06003   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06004                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06005 
06006   fCnaCommand++;
06007   cout << "   *TEcnaGui [" << fCnaCommand
06008        << "]> Low frequency noise distribution";
06009   MessageCnaCommandReplyA(first_same_plot);
06010 
06011   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
06012   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb);
06013   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06014   fHistos->SetHistoColorPalette(fKeyColPal);
06015   fHistos->GeneralTitle(fKeyGeneralTitle);
06016   fHistos->Plot1DHisto("LFN", "NOX", "SM", first_same_plot);
06017 
06018   MessageCnaCommandReplyB(first_same_plot);
06019 }
06020 
06021 //............................ High frequency noise
06022 void TEcnaGui::ViewHistoSorSHighFrequencyNoiseOfCrystals(const TString first_same_plot)
06023 {
06024 // Plot the 1D histogram of the mean sample sigmas as a function of crystals (grouped by Stins)
06025 
06026   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06027   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06028                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06029 
06030   fCnaCommand++;
06031   cout << "   *TEcnaGui [" << fCnaCommand
06032        << "]> High frequency noise";
06033   MessageCnaCommandReplyA(first_same_plot);
06034 
06035   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
06036   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb);
06037   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06038   fHistos->SetHistoColorPalette(fKeyColPal);
06039   fHistos->GeneralTitle(fKeyGeneralTitle);
06040   fHistos->Plot1DHisto("Xtal", "HFN", "SM", first_same_plot);
06041 
06042   MessageCnaCommandReplyB(first_same_plot);
06043 }
06044 
06045 void TEcnaGui::ViewHistoSorSHighFrequencyNoiseDistribution(const TString first_same_plot)
06046 {
06047 // Plot the 1D histogram of the mean sample sigmas distribution for a Stex
06048 
06049   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06050   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06051                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06052 
06053   fCnaCommand++;
06054   cout << "   *TEcnaGui [" << fCnaCommand
06055        << "]> High frequency noise distribution";
06056   MessageCnaCommandReplyA(first_same_plot);
06057 
06058   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
06059   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb);  
06060   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06061   fHistos->SetHistoColorPalette(fKeyColPal);
06062   fHistos->GeneralTitle(fKeyGeneralTitle);
06063   fHistos->Plot1DHisto("HFN", "NOX", "SM", first_same_plot);
06064 
06065   MessageCnaCommandReplyB(first_same_plot);
06066 }
06067 
06068 //............................ Correlations between samples
06069 void TEcnaGui::ViewHistoSorSMeanCorssOfCrystals(const TString first_same_plot)
06070 {
06071 // Plot the 1D histogram of the mean cor(s,s') as a function of crystals (grouped by Stins)
06072 
06073   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06074   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06075                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06076 
06077   fCnaCommand++;
06078   cout << "   *TEcnaGui [" << fCnaCommand
06079        << "]> Mean cor(s,s')";
06080   MessageCnaCommandReplyA(first_same_plot);
06081 
06082   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
06083   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
06084   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06085   fHistos->SetHistoColorPalette(fKeyColPal);
06086   fHistos->GeneralTitle(fKeyGeneralTitle);
06087   fHistos->Plot1DHisto("Xtal", "MCs", "SM", first_same_plot);
06088 
06089   MessageCnaCommandReplyB(first_same_plot);
06090 }
06091 
06092 void TEcnaGui::ViewHistoSorSMeanCorssDistribution(const TString first_same_plot)
06093 {
06094 // Plot the 1D histogram of the mean cor(s,s') sigmas distribution for a Stex
06095 
06096   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06097   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06098                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06099 
06100   fCnaCommand++;
06101   cout << "   *TEcnaGui [" << fCnaCommand
06102        << "]> Mean cor(s,s') distribution";
06103   MessageCnaCommandReplyA(first_same_plot);
06104 
06105   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
06106   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
06107   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06108   fHistos->SetHistoColorPalette(fKeyColPal);
06109   fHistos->GeneralTitle(fKeyGeneralTitle);
06110   fHistos->Plot1DHisto("MCs", "NOX", "SM", first_same_plot);
06111 
06112   MessageCnaCommandReplyB(first_same_plot);
06113 }
06114 
06115 void TEcnaGui::ViewHistoSorSSigmaOfCorssOfCrystals(const TString first_same_plot)
06116 {
06117 // Plot the 1D histogram of the mean cor(s,s') as a function of crystals (grouped by Stins)
06118 
06119   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06120   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06121                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06122 
06123   fCnaCommand++;
06124   cout << "   *TEcnaGui [" << fCnaCommand
06125        << "]> Sigma of cor(s,s')";
06126   MessageCnaCommandReplyA(first_same_plot);
06127 
06128   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
06129   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
06130   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06131   fHistos->SetHistoColorPalette(fKeyColPal);
06132   fHistos->GeneralTitle(fKeyGeneralTitle);
06133   fHistos->Plot1DHisto("Xtal", "SCs", "SM", first_same_plot);
06134 
06135   MessageCnaCommandReplyB(first_same_plot);
06136 }
06137 
06138 void TEcnaGui::ViewHistoSorSSigmaOfCorssDistribution(const TString first_same_plot)
06139 {
06140 // Plot the 1D histogram of the mean cor(s,s') sigmas distribution for a Stex
06141 
06142   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06143   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06144                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06145 
06146   fCnaCommand++;
06147   cout << "   *TEcnaGui [" << fCnaCommand
06148        << "]> Sigma of cor(s,s') distribution";
06149   MessageCnaCommandReplyA(first_same_plot);
06150 
06151   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
06152   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
06153   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06154   fHistos->SetHistoColorPalette(fKeyColPal);
06155   fHistos->GeneralTitle(fKeyGeneralTitle);
06156   fHistos->Plot1DHisto("SCs", "NOX", "SM", first_same_plot);
06157 
06158   MessageCnaCommandReplyB(first_same_plot);
06159 }
06160 
06161 //........................................................................................................
06162 void TEcnaGui::ViewHistoCrystalSampleMeans(const Int_t&  cStexStin_A, const Int_t& crystal,
06163                                            const TString first_same_plot)
06164 {
06165 // Plot the 1D histogram of the mean sample ADC for a crystal
06166 
06167   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06168   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06169                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06170 
06171   fCnaCommand++;
06172   cout << "   *TEcnaGui [" << fCnaCommand
06173        << "]> Sample means"
06174        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06175        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06176        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal" << crystal
06177        << ", option: " << first_same_plot << endl;
06178 
06179   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06180   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
06181   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06182   fHistos->SetHistoColorPalette(fKeyColPal);
06183   fHistos->GeneralTitle(fKeyGeneralTitle);
06184   fHistos->Plot1DHisto("Sample#", "SampleMean", cStexStin_A, crystal, first_same_plot);
06185 }
06186 
06187 //........................................................................................................
06188 void TEcnaGui::ViewHistoCrystalSampleMeansDistribution(const Int_t&  cStexStin_A, const Int_t& crystal,
06189                                                        const TString first_same_plot)
06190 {
06191 // Plot the 1D histogram distribution of the mean sample ADC for a crystal
06192 
06193   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06194   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06195                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06196 
06197   fCnaCommand++;
06198   cout << "   *TEcnaGui [" << fCnaCommand
06199        << "]> Sample means"
06200        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06201        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06202        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal" << crystal
06203        << ", option: " << first_same_plot << endl;
06204 
06205   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06206   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
06207   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06208   fHistos->SetHistoColorPalette(fKeyColPal);
06209   fHistos->GeneralTitle(fKeyGeneralTitle);
06210   fHistos->Plot1DHisto("SampleMean", "NbOfSamples", cStexStin_A, crystal, first_same_plot);
06211 }
06212 
06213 void TEcnaGui::ViewHistoCrystalSampleSigmas(const Int_t&  cStexStin_A, const Int_t& crystal,
06214                                             const TString first_same_plot)
06215 {
06216 // Plot the 1D histogram of the sigmas of the sample ADC for a crystal
06217 
06218   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06219   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06220                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06221 
06222   fCnaCommand++;
06223   cout << "   *TEcnaGui [" << fCnaCommand
06224        << "]> Sample sigmas"
06225        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06226        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06227        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal:" << crystal
06228        << ", option: " << first_same_plot << endl;
06229 
06230   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
06231   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
06232   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06233   fHistos->SetHistoColorPalette(fKeyColPal);
06234   fHistos->GeneralTitle(fKeyGeneralTitle);
06235   fHistos->Plot1DHisto("Sample#", "SampleSigma", cStexStin_A, crystal, first_same_plot);
06236 }
06237 
06238 void TEcnaGui::ViewHistoCrystalSampleSigmasDistribution(const Int_t&  cStexStin_A, const Int_t& crystal,
06239                                                         const TString first_same_plot)
06240 {
06241 // Plot the 1D histogram distribution of the sigmas of the sample ADC for a crystal
06242 
06243   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06244   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06245                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06246 
06247   fCnaCommand++;
06248   cout << "   *TEcnaGui [" << fCnaCommand
06249        << "]> Sample sigmas"
06250        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06251        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06252        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal:" << crystal
06253        << ", option: " << first_same_plot << endl;
06254 
06255   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
06256   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
06257   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06258   fHistos->SetHistoColorPalette(fKeyColPal);
06259   fHistos->GeneralTitle(fKeyGeneralTitle);
06260   fHistos->Plot1DHisto("SampleSigma", "NbOfSamples", cStexStin_A, crystal, first_same_plot);
06261 }
06262 
06263 //............................ Sample values
06264 void TEcnaGui::ViewHistoCrystalSampleValues(const Int_t& cStexStin_A, const Int_t& crystal,
06265                                             const Int_t& sample,     const TString first_same_plot)
06266 {
06267 // Plot the 1D histogram of the pedestals as a function of the event number for a crystal
06268 
06269   Int_t n1Sample = sample+1;
06270   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06271   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06272                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06273 
06274   fCnaCommand++;
06275   cout << "   *TEcnaGui [" << fCnaCommand
06276        << "]> ADC sample values"
06277        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06278        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06279        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal: " << crystal
06280        << ", sample: " << n1Sample << ", option: " << first_same_plot << endl;
06281 
06282   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06283   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb); 
06284   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06285   fHistos->SetHistoColorPalette(fKeyColPal);
06286   fHistos->GeneralTitle(fKeyGeneralTitle);
06287   fHistos->Plot1DHisto("Event#", "AdcValue", cStexStin_A, crystal, n1Sample, first_same_plot);
06288 }
06289 
06290 void TEcnaGui::ViewHistoSampleEventDistribution(const Int_t& cStexStin_A, const Int_t& crystal,
06291                                                 const Int_t& sample,      const TString first_same_plot)
06292 {
06293 // Plot the 1D histogram of the ADC event distribution for a sample
06294 
06295   Int_t n1Sample = sample+1;
06296   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06297   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06298                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06299 
06300   fCnaCommand++;
06301   cout << "   *TEcnaGui [" << fCnaCommand
06302        << "]> ADC event distribution"
06303        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06304        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06305        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal: " << crystal
06306        << ", sample " << n1Sample << ", option: " << first_same_plot << endl;
06307  
06308   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06309   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
06310   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06311   fHistos->SetHistoColorPalette(fKeyColPal);
06312   fHistos->GeneralTitle(fKeyGeneralTitle);
06313   fHistos->Plot1DHisto("AdcValue", "NbOfEvts", cStexStin_A, crystal, n1Sample, first_same_plot);
06314 }
06315 
06316 //------------------------------------------------------- Evolution in time (as a function of run date)
06317 void TEcnaGui::ViewHistimeCrystalPedestals(const TString  run_par_file_name,
06318                                            const Int_t&   cStexStin_A, const Int_t& i0StinEcha,
06319                                            const TString  first_same_plot)
06320 {
06321 // Plot the graph of Pedestals evolution for a given channel
06322 
06323   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06324 
06325   fCnaCommand++;
06326   cout << "   *TEcnaGui [" << fCnaCommand
06327        << "]> Pedestal history"
06328        << ". Run parameters file name: " << run_par_file_name
06329        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06330        << ", option: " << first_same_plot << endl;
06331 
06332   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06333   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb); 
06334   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06335   fHistos->SetHistoColorPalette(fKeyColPal);
06336   fHistos->GeneralTitle(fKeyGeneralTitle);
06337   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06338                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06339   fHistos->PlotHistory("Time", "Ped", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06340 }
06341 
06342 void TEcnaGui::ViewHistimeCrystalPedestalsRuns(const TString  run_par_file_name,
06343                                                const Int_t&   cStexStin_A, const Int_t& i0StinEcha,
06344                                                const TString  first_same_plot)
06345 {
06346 // Plot the graph of Pedestals evolution for a given channel
06347 
06348   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06349 
06350   fCnaCommand++;
06351   cout << "   *TEcnaGui [" << fCnaCommand
06352        << "]> Pedestal history distribution"
06353        << ". Run parameters file name: " << run_par_file_name
06354        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06355        << ", option: " << first_same_plot << endl;
06356 
06357   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06358   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb); 
06359   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06360   fHistos->SetHistoColorPalette(fKeyColPal);
06361   fHistos->GeneralTitle(fKeyGeneralTitle);
06362   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06363                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06364   fHistos->PlotHistory("Ped", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06365 }
06366 
06367 //....................................................................................................
06368 void TEcnaGui::ViewHistimeCrystalTotalNoise(const TString  run_par_file_name,
06369                                             const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06370                                             const TString  first_same_plot)
06371 {
06372 // Plot the graph of total noise evolution for a given channel
06373   
06374   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06375 
06376   fCnaCommand++;
06377   cout << "   *TEcnaGui [" << fCnaCommand
06378        << "]> Total noise history"
06379        << ". Run parameters file name: " << run_par_file_name
06380        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06381        << ", option: " << first_same_plot << endl;
06382 
06383   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
06384   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
06385   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06386   fHistos->SetHistoColorPalette(fKeyColPal);
06387   fHistos->GeneralTitle(fKeyGeneralTitle);
06388   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06389                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06390   fHistos->PlotHistory("Time", "TNo", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06391 }
06392 
06393 void TEcnaGui::ViewHistimeCrystalTotalNoiseRuns(const TString  run_par_file_name,
06394                                                 const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06395                                                 const TString  first_same_plot)
06396 {
06397 // Plot the graph of total noise evolution for a given channel
06398   
06399   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06400 
06401   fCnaCommand++;
06402   cout << "   *TEcnaGui [" << fCnaCommand
06403        << "]> Total noise history distribution"
06404        << ". Run parameters file name: " << run_par_file_name
06405        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06406        << ", option: " << first_same_plot << endl;
06407 
06408   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
06409   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
06410   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06411   fHistos->SetHistoColorPalette(fKeyColPal);
06412   fHistos->GeneralTitle(fKeyGeneralTitle);
06413   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06414                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06415   fHistos->PlotHistory("TNo", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06416 }
06417 //....................................................................................................
06418 void TEcnaGui::ViewHistimeCrystalLowFrequencyNoise(const TString  run_par_file_name,
06419                                                    const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06420                                                    const TString  first_same_plot)
06421 {
06422 // Plot the graph of Low Frequency Noise evolution for a given channel
06423   
06424   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06425 
06426   fCnaCommand++;
06427   cout << "   *TEcnaGui [" << fCnaCommand
06428        << "]> Low frequency noise history"
06429        << ". Run parameters file name: " << run_par_file_name
06430        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06431        << ", option: " << first_same_plot << endl;
06432 
06433   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
06434   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb); 
06435   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06436   fHistos->SetHistoColorPalette(fKeyColPal);
06437   fHistos->GeneralTitle(fKeyGeneralTitle);
06438   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06439                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06440   fHistos->PlotHistory("Time", "LFN", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06441 }
06442 
06443 void TEcnaGui::ViewHistimeCrystalLowFrequencyNoiseRuns(const TString  run_par_file_name,
06444                                                        const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06445                                                        const TString  first_same_plot)
06446 {
06447 // Plot the graph of Low Frequency Noise evolution for a given channel
06448   
06449   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06450 
06451   fCnaCommand++;
06452   cout << "   *TEcnaGui [" << fCnaCommand
06453        << "]> Low frequency noise history distribution"
06454        << ". Run parameters file name: " << run_par_file_name
06455        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06456        << ", option: " << first_same_plot << endl;
06457 
06458   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
06459   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb); 
06460   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06461   fHistos->SetHistoColorPalette(fKeyColPal);
06462   fHistos->GeneralTitle(fKeyGeneralTitle);
06463   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06464                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06465   fHistos->PlotHistory("LFN", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06466 }
06467 //....................................................................................................
06468 void TEcnaGui::ViewHistimeCrystalHighFrequencyNoise(const TString  run_par_file_name,
06469                                                     const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06470                                                     const TString  first_same_plot)
06471 {
06472 // Plot the graph of High Frequency Noise evolution for a given channel
06473   
06474   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06475 
06476   fCnaCommand++;
06477   cout << "   *TEcnaGui [" << fCnaCommand
06478        << "]> High frequency noise history"
06479        << ". Run parameters file name: " << run_par_file_name
06480        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06481        << ", option: " << first_same_plot << endl;
06482 
06483   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
06484   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb); 
06485   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06486   fHistos->SetHistoColorPalette(fKeyColPal);
06487   fHistos->GeneralTitle(fKeyGeneralTitle);
06488   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06489                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06490   fHistos->PlotHistory("Time", "HFN", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06491 }
06492 
06493 void TEcnaGui::ViewHistimeCrystalHighFrequencyNoiseRuns(const TString  run_par_file_name,
06494                                                         const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06495                                                         const TString  first_same_plot)
06496 {
06497 // Plot the graph of High Frequency Noise evolution for a given channel
06498   
06499   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06500 
06501   fCnaCommand++;
06502   cout << "   *TEcnaGui [" << fCnaCommand
06503        << "]> High frequency noise history distribution"
06504        << ". Run parameters file name: " << run_par_file_name
06505        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06506        << ", option: " << first_same_plot << endl;
06507 
06508   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
06509   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb); 
06510   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06511   fHistos->SetHistoColorPalette(fKeyColPal);
06512   fHistos->GeneralTitle(fKeyGeneralTitle);
06513   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06514                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06515   fHistos->PlotHistory("HFN", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06516 }
06517 //....................................................................................................
06518 void TEcnaGui::ViewHistimeCrystalMeanCorss(const TString  run_par_file_name,
06519                                            const Int_t&   cStexStin_A,    const Int_t& i0StinEcha,
06520                                            const TString  first_same_plot)
06521 {
06522 // Plot the graph for Mean Corss evolution for a given channel
06523 
06524   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06525 
06526   fCnaCommand++;
06527   cout << "   *TEcnaGui [" << fCnaCommand
06528        << "]> Mean corss history"
06529        << ". Run parameters file name: " << run_par_file_name
06530        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06531        << ", option: " << first_same_plot << endl;
06532 
06533   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
06534   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
06535   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06536   fHistos->SetHistoColorPalette(fKeyColPal);
06537   fHistos->GeneralTitle(fKeyGeneralTitle);
06538   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06539                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06540   fHistos->PlotHistory("Time", "MCs", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06541 }
06542 
06543 void TEcnaGui::ViewHistimeCrystalMeanCorssRuns(const TString  run_par_file_name,
06544                                                const Int_t&   cStexStin_A,    const Int_t& i0StinEcha,
06545                                                const TString  first_same_plot)
06546 {
06547 // Plot the graph for Mean Corss evolution for a given channel
06548 
06549   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06550 
06551   fCnaCommand++;
06552   cout << "   *TEcnaGui [" << fCnaCommand
06553        << "]> Mean corss history distribution"
06554        << ". Run parameters file name: " << run_par_file_name
06555        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06556        << ", option: " << first_same_plot << endl;
06557 
06558   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
06559   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
06560   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06561   fHistos->SetHistoColorPalette(fKeyColPal);
06562   fHistos->GeneralTitle(fKeyGeneralTitle);
06563   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06564                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06565   fHistos->PlotHistory("MCs", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06566 }
06567 //....................................................................................................
06568 void TEcnaGui::ViewHistimeCrystalSigmaOfCorss(const TString run_par_file_name,
06569                                               const Int_t&  cStexStin_A, const Int_t& i0StinEcha,
06570                                               const TString first_same_plot)
06571 {
06572 // Plot the graph of Mean Corss evolution for a given channel
06573 
06574   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/;}
06575 
06576   fCnaCommand++;
06577   cout << "   *TEcnaGui [" << fCnaCommand
06578        << "]> Sigma of corss history"
06579        << ". Run parameters file name: " << run_par_file_name
06580        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06581        << ", option: " << first_same_plot << endl;
06582 
06583   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
06584   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
06585   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06586   fHistos->SetHistoColorPalette(fKeyColPal);
06587   fHistos->GeneralTitle(fKeyGeneralTitle);
06588   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06589                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06590   fHistos->PlotHistory("Time", "SCs", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06591 }
06592 
06593 void TEcnaGui::ViewHistimeCrystalSigmaOfCorssRuns(const TString run_par_file_name,
06594                                                   const Int_t&  cStexStin_A, const Int_t& i0StinEcha,
06595                                                   const TString first_same_plot)
06596 {
06597 // Plot the graph of Mean Corss evolution for a given channel
06598 
06599   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/;}
06600 
06601   fCnaCommand++;
06602   cout << "   *TEcnaGui [" << fCnaCommand
06603        << "]> Sigma of corss history distribution"
06604        << ". Run parameters file name: " << run_par_file_name
06605        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06606        << ", option: " << first_same_plot << endl;
06607 
06608   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
06609   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
06610   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06611   fHistos->SetHistoColorPalette(fKeyColPal);
06612   fHistos->GeneralTitle(fKeyGeneralTitle);
06613   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06614                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06615   fHistos->PlotHistory("SCs", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06616 }
06617 
06618 //====================================================================================================
06619 
06620 void TEcnaGui::InitKeys()
06621 {
06622   //.....Input widgets for: analysis, run, channel, sample,
06623   //                        number of events, first event number, etc...
06624   
06625   //fKeyPyf = "";
06626 
06627   fKeyAnaType = "StdPeg12";
06628   Int_t MaxCar = fgMaxCar;
06629   fKeyRunListInitCode.Resize(MaxCar);
06630   fKeyRunListInitCode = "0123";
06631 
06632   MaxCar = fgMaxCar;
06633   fKeyFileNameRunList.Resize(MaxCar);
06634   fKeyFileNameRunList = fKeyRunListInitCode.Data();
06635 
06636   fKeyNbOfSamples = fEcal->MaxSampADC();
06637   fKeyNbOfSamplesString = "10";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyNbOfSamples VALUE
06638 
06639   fKeyNbOfSampForCalc = fEcal->MaxSampADC();
06640   fKeyNbOfSampForCalcString = "10";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyNbOfSampForCalc VALUE
06641 
06642   fKeyRunNumber  = 0;
06643 
06644   fKeyFirstReqEvtNumber = 1;
06645   fKeyFirstReqEvtNumberString = "1";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyFirstReqEvtNumber VALUE
06646 
06647   fKeyLastReqEvtNumber = 0;
06648   fKeyLastReqEvtNumberString = "0";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyLastReqEvtNumber VALUE
06649 
06650   fKeyReqNbOfEvts = 150;
06651   fKeyReqNbOfEvtsString = "150";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyReqNbOfEvts VALUE
06652 
06653   fKeyStexNumber = 1;
06654   fKeyStexNumberString = "1";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyStexNumber VALUE
06655 
06656   fKeyChanNumber = 0;
06657   fKeySampNumber = 0;
06658 
06659   fKeyStinANumber = 1;
06660   fKeyStinBNumber = 1;
06661   if( fSubDet == "EE" )
06662     {if( fKeyStexNumber == 1 || fKeyStexNumber == 3 )
06663       {
06664         fKeyStinANumber = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fKeyStexNumber, 150);
06665         fKeyStinBNumber = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fKeyStexNumber, 150);
06666       }
06667     }
06668 
06669   MaxCar = fgMaxCar;
06670   fKeyScaleX.Resize(MaxCar); 
06671   fKeyScaleX = "LIN";
06672   MaxCar = fgMaxCar;
06673   fKeyScaleY.Resize(MaxCar); 
06674   fKeyScaleY = "LIN";
06675   fKeyGeneralTitle = "Ecal Correlated Noise Analysis";
06676 
06677   fKeyColPal = "ECCNAColor";
06678 
06679   //.... ymin and ymax values => values which are displayed on the dialog box
06680 
06681   fKeyVminD_NOE_ChNb = (Double_t)0.; 
06682   fKeyVmaxD_NOE_ChNb = fKeyReqNbOfEvts + fKeyReqNbOfEvts/3;
06683  
06684   fKeyVminD_Ped_ChNb = (Double_t)0.; 
06685   fKeyVmaxD_Ped_ChNb = (Double_t)0.;
06686 
06687   fKeyVminD_TNo_ChNb = (Double_t)0.; 
06688   fKeyVmaxD_TNo_ChNb = (Double_t)0.;
06689 
06690   fKeyVminD_LFN_ChNb = (Double_t)0.; 
06691   fKeyVmaxD_LFN_ChNb = (Double_t)0.;
06692 
06693   fKeyVminD_HFN_ChNb = (Double_t)0.;
06694   fKeyVmaxD_HFN_ChNb = (Double_t)0.;
06695 
06696   fKeyVminD_MCs_ChNb = (Double_t)(-1.); 
06697   fKeyVmaxD_MCs_ChNb = (Double_t)1.;
06698 
06699   fKeyVminD_SCs_ChNb = (Double_t)0.; 
06700   fKeyVmaxD_SCs_ChNb = (Double_t)0.; 
06701 
06702   fKeyVminLHFcc = fKeyVminD_MCs_ChNb;
06703   fKeyVmaxLHFcc = fKeyVmaxD_MCs_ChNb;
06704 
06705   fKeyVminLFccMos = (Double_t)-1.; 
06706   fKeyVmaxLFccMos = (Double_t)1.;
06707   fKeyVminHFccMos = (Double_t)0.; 
06708   fKeyVmaxHFccMos = (Double_t)1.;
06709 
06710   fKeyFileNameRunList = "";
06711 }
06712 
06713 void  TEcnaGui::DisplayInEntryField(TGTextEntry* StringOfField, Int_t& value)
06714 {
06715   char* f_in = new char[20];          fCnew++;
06716   sprintf( f_in, "%d", value );
06717   StringOfField->SetText(f_in);
06718   delete [] f_in;                     fCdelete++;
06719 }
06720 
06721 void  TEcnaGui::DisplayInEntryField(TGTextEntry* StringOfField, Double_t& value)
06722 {
06723   char* f_in = new char[20];          fCnew++;
06724   sprintf( f_in, "%g", value );
06725   StringOfField->SetText(f_in);
06726   delete [] f_in;                     fCdelete++;
06727 }
06728 void  TEcnaGui::DisplayInEntryField(TGTextEntry* StringOfField, const TString value)
06729 {
06730   //StringOfField->Insert(value);
06731   StringOfField->SetText(value);
06732 }