CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/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 //  const char* listchain = 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   const char *bufferchain = fAnaText->GetBuffer()->GetString();
03267 
03268   fKeyAnaType = bufferchain;
03269   
03270   fCnaCommand++;
03271   cout << "   *TEcnaGui [" << fCnaCommand
03272        << "]> Registration of analysis name -> "
03273        << fKeyAnaType << endl;
03274 }
03275 
03276 //----------------------------------------------------------------------
03277 void TEcnaGui::DoButtonNors()
03278 {
03279 //Registration of the number of samples (ROOT file)
03280 
03281   const char *bufferchain = fNorsText->GetBuffer()->GetString();
03282   fKeyNbOfSamplesString = bufferchain;
03283   fKeyNbOfSamples = atoi(bufferchain);
03284 
03285   if ( !(fKeyNbOfSamples >= 1 && fKeyNbOfSamples <= fEcal->MaxSampADC()) )
03286     {
03287       fCnaError++;
03288       cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===>"
03289            << " Number of required samples for reading ROOT file = " << fKeyNbOfSamples
03290            << ": OUT OF RANGE, " << endl 
03291            << "                                        forced to the default value (="
03292            << fEcal->MaxSampADC() << ")." << fTTBELL << endl;
03293       fKeyNbOfSamples = fEcal->MaxSampADC();
03294       DisplayInEntryField(fNorsText,fKeyNbOfSamples);
03295     }
03296 
03297   //................... Update of Sample Button Text according to the number of sample
03298   TString xSampButText = " Sample [?,?] ";
03299   
03300   if( fKeyNbOfSamples ==  1 ){xSampButText  = " Sample [1,1] ";}
03301   if( fKeyNbOfSamples ==  2 ){xSampButText  = " Sample [1,2] ";}
03302   if( fKeyNbOfSamples ==  3 ){xSampButText  = " Sample [1,3] ";}
03303   if( fKeyNbOfSamples ==  4 ){xSampButText  = " Sample [1,4] ";}
03304   if( fKeyNbOfSamples ==  5 ){xSampButText  = " Sample [1,5] ";}
03305   if( fKeyNbOfSamples ==  6 ){xSampButText  = " Sample [1,6] ";}
03306   if( fKeyNbOfSamples ==  7 ){xSampButText  = " Sample [1,7] ";}
03307   if( fKeyNbOfSamples ==  8 ){xSampButText  = " Sample [1,8] ";}
03308   if( fKeyNbOfSamples ==  9 ){xSampButText  = " Sample [1,9] ";}
03309   if( fKeyNbOfSamples == 10 ){xSampButText  = " Sample [1,10] ";}
03310   
03311   fSampBut->SetText(xSampButText);
03312   
03313   fCnaCommand++;
03314   cout << "   *TEcnaGui [" << fCnaCommand
03315        << "]> Registration of number of samples in ROOT file -> "
03316        << fKeyNbOfSamples << endl;
03317 }
03318 //----------------------------------------------------------------------
03319 void TEcnaGui::DoButtonNbSampForCalc()
03320 {
03321 //Registration of the number of samples (ROOT file)
03322 
03323   const char *bufferchain = fNbSampForCalcText->GetBuffer()->GetString();
03324   fKeyNbOfSampForCalcString = bufferchain;
03325   fKeyNbOfSampForCalc = atoi(bufferchain);
03326 
03327   if ( !(fKeyNbOfSampForCalc >= 1 && fKeyNbOfSampForCalc <= fKeyNbOfSamples) )
03328     {
03329       fCnaError++;
03330       cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===>"
03331            << " Number of required samples for calculations = " << fKeyNbOfSampForCalc
03332            << ": OUT OF RANGE, " << endl 
03333            << "                                        forced to the default value (="
03334            << fKeyNbOfSamples << ")." << fTTBELL << endl;
03335       fKeyNbOfSampForCalc = fKeyNbOfSamples;
03336       DisplayInEntryField(fNbSampForCalcText,fKeyNbOfSampForCalc);
03337     }
03338   fCnaCommand++;
03339   cout << "   *TEcnaGui [" << fCnaCommand
03340        << "]> Registration of number of samples for calculations -> "
03341        << fKeyNbOfSampForCalc << endl;
03342 }
03343 
03344 //----------------------------------------------------------------------
03345 void TEcnaGui::DoButtonRun()
03346 {
03347 //Register run number
03348   
03349   //........................... get info from the entry field
03350   const char* bufferchain = fRunText->GetBuffer()->GetString();
03351   fKeyRunNumberString = bufferchain;
03352   fKeyRunNumber = atoi(bufferchain);
03353   fCnaCommand++;
03354   cout << "   *TEcnaGui [" << fCnaCommand
03355        << "]> Registration of run number -> "
03356        << fKeyRunNumber << endl;
03357 }
03358 //-------------------------------------------------------------------
03359 
03360 void TEcnaGui::DoButtonFev()
03361 {
03362 //Registration of the first requested event number
03363 
03364   const char *bufferchain = fFevText->GetBuffer()->GetString();
03365   fKeyFirstReqEvtNumberString = bufferchain;
03366   fKeyFirstReqEvtNumber = atoi(bufferchain);
03367 
03368   if ( fKeyFirstReqEvtNumber <= 0)
03369     {
03370       fCnaError++;
03371       cout << "   !TEcnaGui (" << fCnaError << ") *ERROR* ===> "
03372            << " First event number = " << fKeyFirstReqEvtNumber
03373            << ": negative. " << endl 
03374            << fTTBELL << endl;
03375     }
03376 
03377   fCnaCommand++;
03378   cout << "   *TEcnaGui [" << fCnaCommand
03379        << "]> Registration of first requested event number -> "
03380        << fKeyFirstReqEvtNumber << endl;
03381 }
03382 //-------------------------------------------------------------------
03383 void TEcnaGui::DoButtonLev()
03384 {
03385 //Registration of the last requested event number
03386 
03387   const char *bufferchain = fLevText->GetBuffer()->GetString();
03388   fKeyLastReqEvtNumberString = bufferchain;
03389   fKeyLastReqEvtNumber = atoi(bufferchain);
03390 
03391   if ( fKeyLastReqEvtNumber <= fKeyFirstReqEvtNumber )
03392     {
03393       fCnaError++;
03394       cout << "   !TEcnaGui (" << fCnaError << ") *WARNING* ===> "
03395            << " Last requested event number = " << fKeyLastReqEvtNumber
03396            << ": less than first requested event number (= " << fKeyFirstReqEvtNumber << ")." 
03397            << endl;
03398     }
03399 
03400   fCnaCommand++;
03401   cout << "   *TEcnaGui [" << fCnaCommand
03402        << "]> Registration of last requested event number -> "
03403        << fKeyLastReqEvtNumber << endl;
03404 }
03405 //-------------------------------------------------------------------
03406 void TEcnaGui::DoButtonRev()
03407 {
03408 //Registration of the nb ofrequested events
03409 
03410   const char *bufferchain = fRevText->GetBuffer()->GetString();
03411   fKeyReqNbOfEvtsString = bufferchain;
03412   fKeyReqNbOfEvts = atoi(bufferchain);
03413 
03414   Int_t nb_range_evts = fKeyLastReqEvtNumber - fKeyFirstReqEvtNumber + 1;
03415 
03416   if( fKeyLastReqEvtNumber < fKeyFirstReqEvtNumber)
03417     {
03418       fCnaError++;
03419       cout << "   !TEcnaGui (" << fCnaError << ") *WARNING* ===> "
03420            << " Last requested event number = " << fKeyLastReqEvtNumber
03421            << " less than first requested event number = " << fKeyFirstReqEvtNumber
03422            << endl;
03423     }
03424 
03425   if ( fKeyLastReqEvtNumber >= fKeyFirstReqEvtNumber && fKeyReqNbOfEvts > nb_range_evts )
03426     {
03427       fCnaError++;
03428       cout << "   !TEcnaGui (" << fCnaError << ") *WARNING* ===> "
03429            << " Nb of requested events = " << fKeyReqNbOfEvts
03430            << ": out of range (range = " << fKeyFirstReqEvtNumber << ","
03431            << fKeyLastReqEvtNumber << ") => " << nb_range_evts << " events."
03432            << endl;
03433     }
03434 
03435   fCnaCommand++;
03436   cout << "   *TEcnaGui [" << fCnaCommand
03437        << "]> Registration of requested number of events -> "
03438        << fKeyReqNbOfEvts << endl;
03439 }
03440 
03441 //-------------------------------------------------------------------
03442 void TEcnaGui::DoButtonStex()
03443 {
03444 //Registration of the Stex number
03445 
03446   const char *bufferchain = fStexText->GetBuffer()->GetString();
03447   fKeyStexNumberString = bufferchain;
03448   fKeyStexNumber = atoi(bufferchain);
03449 
03450   if( fSubDet == "EB" )
03451     {
03452       fCnaCommand++;
03453       cout << "   *TEcnaGui [" << fCnaCommand
03454            << "]> Registration of SuperModule number -> "
03455            << fKeyStexNumber << endl;
03456 
03457       //.......... Positive number for EB- [-1,-18] -> [19,36]  
03458       if( fKeyStexNumber < 0 ){fKeyStexNumber = - fKeyStexNumber + fEcal->MaxSMInEB()/2;}
03459 
03460       if( (fKeyStexNumber < 0) || (fKeyStexNumber > fEcal->MaxSMInEB() )  )
03461         {
03462           fCnaError++;
03463           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
03464                << " EB / SM number = " << fKeyStexNumber
03465                << ": out of range. Range = 0 (EB) or [ 1 ," << fEcal->MaxSMInEB() << " ] (SM)"
03466                << " or [ -" << fEcal->MaxSMInEBMinus() << ", +" <<  fEcal->MaxSMInEBPlus() << "] (SM)"
03467                << fTTBELL << endl;
03468         }
03469     }
03470 
03471   if( fSubDet == "EE" )
03472     {
03473       //................... Update of SC Button Text according to the Dee Number
03474       TString xStinAButText = "?";
03475       TString xStinBButText = "?";
03476       if ( fSubDet == "EE" && ( fKeyStexNumber == 1 || fKeyStexNumber == 3 ) )
03477         {xStinAButText = "SC for const. [150,298] "; xStinBButText  = "SC' for const. [150,298] ";
03478         fStinABut->SetText(xStinAButText); fStinBBut->SetText(xStinBButText);}
03479       if ( fSubDet == "EE" && ( fKeyStexNumber == 2 || fKeyStexNumber == 4 ) )
03480         {xStinAButText = "SC for const. [  1,149] "; xStinBButText  = "SC' for const. [  1,149] ";
03481         fStinABut->SetText(xStinAButText); fStinBBut->SetText(xStinBButText);}
03482 
03483       if ( fSubDet == "EE" && ( fKeyStexNumber == 0 ) )
03484         {xStinAButText = "SC for const.           "; xStinBButText  = "SC' for const.           ";
03485         fStinABut->SetText(xStinAButText); fStinBBut->SetText(xStinBButText);}
03486       
03487       //................... Update of SC widget according to the Dee Number
03488       if( fKeyStexNumber > 0 )
03489         {
03490           Int_t StinAValue = fKeyStinANumber;
03491           if( fSubDet == "EE" )
03492             {StinAValue = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinANumber);}
03493           DisplayInEntryField(fStinAText,StinAValue);
03494           Int_t StinBValue = fKeyStinBNumber;
03495           if( fSubDet == "EE" )
03496             {StinBValue = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinBNumber);}
03497           DisplayInEntryField(fStinBText,StinBValue);
03498         }
03499       //............................................ Command message
03500       fCnaCommand++;
03501       cout << "   *TEcnaGui [" << fCnaCommand
03502            << "]> Registration of Dee number -> "
03503            << fKeyStexNumber << endl;
03504       
03505       if ( (fKeyStexNumber < 0) || (fKeyStexNumber > fEcal->MaxDeeInEE() )  )
03506         {
03507           fCnaError++;
03508           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
03509                << " EE / Dee number = " << fKeyStexNumber
03510                << ": out of range. Range = 0 (EE) or [ 1 ," << fEcal->MaxDeeInEE() << " ] (Dee)"
03511                << fTTBELL << endl;
03512         }
03513     }  // -- end of if( fSubDet == "EE" ) -------
03514 }
03515 //-------------------------------------------------------------------
03516 
03517 void TEcnaGui::DoButtonVminD_NOE_ChNb()
03518 {
03519 //Registration of Ymin for number of events
03520 
03521   const char *bufferchain = fVminD_NOE_ChNbText->GetBuffer()->GetString();
03522 
03523   fKeyVminD_NOE_ChNb = (Double_t)atof(bufferchain);
03524 
03525   fCnaCommand++;
03526   cout << "   *TEcnaGui [" << fCnaCommand
03527        << "]> Registration of Ymin for plot 'number of events' -> "
03528        << fKeyVminD_NOE_ChNb << endl;
03529 }
03530 //-------------------------------------------------------------------
03531 
03532 void TEcnaGui::DoButtonVmaxD_NOE_ChNb()
03533 {
03534 //Registration of Ymax for number of events
03535 
03536   const char *bufferchain = fVmaxD_NOE_ChNbText->GetBuffer()->GetString();
03537 
03538   fKeyVmaxD_NOE_ChNb = (Double_t)atof(bufferchain);
03539 
03540   fCnaCommand++;
03541   cout << "   *TEcnaGui [" << fCnaCommand
03542        << "]> Registration of Ymax for plot 'number of events' -> "
03543        << fKeyVmaxD_NOE_ChNb << endl;
03544 }
03545 //-------------------------------------------------------------------
03546 
03547 void TEcnaGui::DoButtonVminD_Ped_ChNb()
03548 {
03549 //Registration of Ymin for pedestals
03550 
03551   const char *bufferchain = fVminD_Ped_ChNbText->GetBuffer()->GetString();
03552 
03553   fKeyVminD_Ped_ChNb = (Double_t)atof(bufferchain);
03554 
03555   fCnaCommand++;
03556   cout << "   *TEcnaGui [" << fCnaCommand
03557        << "]> Registration of Ymin for plot 'pedestal' -> "
03558        << fKeyVminD_Ped_ChNb << endl;
03559 }
03560 //-------------------------------------------------------------------
03561 
03562 void TEcnaGui::DoButtonVmaxD_Ped_ChNb()
03563 {
03564 //Registration of Ymax for pedestals
03565 
03566   const char *bufferchain = fVmaxD_Ped_ChNbText->GetBuffer()->GetString();
03567 
03568   fKeyVmaxD_Ped_ChNb = (Double_t)atof(bufferchain);
03569 
03570   fCnaCommand++;
03571   cout << "   *TEcnaGui [" << fCnaCommand
03572        << "]> Registration of Ymax for plot 'pedestal' -> "
03573        << fKeyVmaxD_Ped_ChNb << endl;
03574 }
03575 //-------------------------------------------------------------------
03576 
03577 void TEcnaGui::DoButtonVminD_TNo_ChNb()
03578 {
03579 //Registration of Ymin for mean sample sigmas (noise)
03580 
03581   const char *bufferchain = fVminD_TNo_ChNbText->GetBuffer()->GetString();
03582 
03583   fKeyVminD_TNo_ChNb = (Double_t)atof(bufferchain);
03584 
03585   fCnaCommand++;
03586   cout << "   *TEcnaGui [" << fCnaCommand
03587        << "]> Registration of Ymin for plot 'total noise' -> "
03588        << fKeyVminD_TNo_ChNb << endl;
03589 }
03590 //-------------------------------------------------------------------
03591 
03592 void TEcnaGui::DoButtonVmaxD_TNo_ChNb()
03593 {
03594 //Registration of Ymax for mean sample sigmas (noise)
03595 
03596   const char *bufferchain = fVmaxD_TNo_ChNbText->GetBuffer()->GetString();
03597 
03598   fKeyVmaxD_TNo_ChNb = (Double_t)atof(bufferchain);
03599 
03600   fCnaCommand++;
03601   cout << "   *TEcnaGui [" << fCnaCommand
03602        << "]> Registration of Ymax for plot 'total noise' -> "
03603        << fKeyVmaxD_TNo_ChNb << endl;
03604 }
03605 //-------------------------------------------------------------------
03606 
03607 void TEcnaGui::DoButtonVminD_MCs_ChNb()
03608 {
03609 //Registration of Ymin for mean cor(s,s')
03610 
03611   const char *bufferchain = fVminD_MCs_ChNbText->GetBuffer()->GetString();
03612 
03613   fKeyVminD_MCs_ChNb = (Double_t)atof(bufferchain);
03614 
03615   fCnaCommand++;
03616   cout << "   *TEcnaGui [" << fCnaCommand
03617        << "]> Registration of Ymin for plot 'mean cor(s,s')' -> "
03618        << fKeyVminD_MCs_ChNb << endl;
03619 }
03620 //-------------------------------------------------------------------
03621 
03622 void TEcnaGui::DoButtonVmaxD_MCs_ChNb()
03623 {
03624 //Registration of Ymax for mean cor(s,s')
03625 
03626   const char *bufferchain = fVmaxD_MCs_ChNbText->GetBuffer()->GetString();
03627 
03628   fKeyVmaxD_MCs_ChNb = (Double_t)atof(bufferchain);
03629 
03630   fCnaCommand++;
03631   cout << "   *TEcnaGui [" << fCnaCommand
03632        << "]> Registration of Ymax for plot 'mean cor(s,s')' -> "
03633        << fKeyVmaxD_MCs_ChNb << endl;
03634 }
03635 //-------------------------------------------------------------------
03636 
03637 
03638 void TEcnaGui::DoButtonVminD_LFN_ChNb()
03639 {
03640 //Registration of Ymin for sigmas of sample means
03641 
03642   const char *bufferchain = fVminD_LFN_ChNbText->GetBuffer()->GetString();
03643 
03644   fKeyVminD_LFN_ChNb = (Double_t)atof(bufferchain);
03645 
03646   fCnaCommand++;
03647   cout << "   *TEcnaGui [" << fCnaCommand
03648        << "]> Registration of Ymin for plot 'low frequency noise' -> "
03649        << fKeyVminD_LFN_ChNb << endl;
03650 }
03651 //-------------------------------------------------------------------
03652 
03653 void TEcnaGui::DoButtonVmaxD_LFN_ChNb()
03654 {
03655 //Registration of Ymax for sigmas of sample means 
03656 
03657   const char *bufferchain = fVmaxD_LFN_ChNbText->GetBuffer()->GetString();
03658 
03659   fKeyVmaxD_LFN_ChNb = (Double_t)atof(bufferchain);
03660 
03661   fCnaCommand++;
03662   cout << "   *TEcnaGui [" << fCnaCommand
03663        << "]> Registration of Ymax for plot 'low frequency noise' -> "
03664        << fKeyVmaxD_LFN_ChNb << endl;
03665 }
03666 //-------------------------------------------------------------------
03667 
03668 void TEcnaGui::DoButtonVminD_HFN_ChNb()
03669 {
03670 //Registration of Ymin for sigmas of sample sigmas
03671 
03672   const char *bufferchain = fVminD_HFN_ChNbText->GetBuffer()->GetString();
03673 
03674   fKeyVminD_HFN_ChNb = (Double_t)atof(bufferchain);
03675 
03676   fCnaCommand++;
03677   cout << "   *TEcnaGui [" << fCnaCommand
03678        << "]> Registration of Ymin for plot 'high frequency noise' -> "
03679        << fKeyVminD_HFN_ChNb << endl;
03680 }
03681 //-------------------------------------------------------------------
03682 
03683 void TEcnaGui::DoButtonVmaxD_HFN_ChNb()
03684 {
03685 //Registration of Ymax for sigmas of sample sigmas
03686 
03687   const char *bufferchain = fVmaxD_HFN_ChNbText->GetBuffer()->GetString();
03688 
03689   fKeyVmaxD_HFN_ChNb = (Double_t)atof(bufferchain);
03690 
03691   fCnaCommand++;
03692   cout << "   *TEcnaGui [" << fCnaCommand
03693        << "]> Registration of Ymax for plot 'high frequency noise' -> "
03694        << fKeyVmaxD_HFN_ChNb << endl;
03695 }
03696 //-------------------------------------------------------------------
03697 
03698 void TEcnaGui::DoButtonVminD_SCs_ChNb()
03699 {
03700 //Registration of Ymin for sigmas of cor(s,s')
03701 
03702   const char *bufferchain = fVminD_SCs_ChNbText->GetBuffer()->GetString();
03703 
03704   fKeyVminD_SCs_ChNb = (Double_t)atof(bufferchain);
03705 
03706   fCnaCommand++;
03707   cout << "   *TEcnaGui [" << fCnaCommand
03708        << "]> Registration of Ymin for plot 'sigma of cor(s,s')' -> "
03709        << fKeyVminD_SCs_ChNb << endl;
03710 }
03711 //-------------------------------------------------------------------
03712 
03713 void TEcnaGui::DoButtonVmaxD_SCs_ChNb()
03714 {
03715 //Registration of Ymax for sigmas of cor(s,s')
03716 
03717   const char *bufferchain = (char*)fVmaxD_SCs_ChNbText->GetBuffer()->GetString();
03718 
03719   fKeyVmaxD_SCs_ChNb = (Double_t)atof(bufferchain);
03720 
03721   fCnaCommand++;
03722   cout << "   *TEcnaGui [" << fCnaCommand
03723        << "]> Registration of Ymax for plot 'sigma of cor(s,s')' -> "
03724        << fKeyVmaxD_SCs_ChNb << endl;
03725 }
03726 //-------------------------------------------------------------------
03727 
03728 void TEcnaGui::DoButtonVminLFccMos()
03729 {
03730 //Registration of Ymin for LF Mean Cor(c,c')
03731 
03732   const char *bufferchain = fVminLFccMosText->GetBuffer()->GetString();
03733 
03734   fKeyVminLFccMos = (Double_t)atof(bufferchain);
03735 
03736   fCnaCommand++;
03737   cout << "   *TEcnaGui [" << fCnaCommand
03738        << "]> Registration of Ymin for plot 'mean LF |cor(c,c')|' -> "
03739        << fKeyVminLFccMos << endl;
03740 }
03741 //-------------------------------------------------------------------
03742 
03743 void TEcnaGui::DoButtonVmaxLFccMos()
03744 {
03745 //Registration of Ymax for LF Mean Cor(c,c')
03746 
03747   const char *bufferchain = fVmaxLFccMosText->GetBuffer()->GetString();
03748 
03749   fKeyVmaxLFccMos = (Double_t)atof(bufferchain);
03750 
03751   fCnaCommand++;
03752   cout << "   *TEcnaGui [" << fCnaCommand
03753        << "]> Registration of Ymax for plot 'mean LF |cor(c,c')|' -> "
03754        << fKeyVmaxLFccMos << endl;
03755 }
03756 //-------------------------------------------------------------------
03757 
03758 void TEcnaGui::DoButtonVminHFccMos()
03759 {
03760 //Registration of Ymin for HF Mean Cor(c,c')
03761 
03762   const char *bufferchain = fVminHFccMosText->GetBuffer()->GetString();
03763 
03764   fKeyVminHFccMos = (Double_t)atof(bufferchain);
03765 
03766   fCnaCommand++;
03767   cout << "   *TEcnaGui [" << fCnaCommand
03768        << "]> Registration of Ymin for plot 'mean HF |cor(c,c')|' -> "
03769        << fKeyVminHFccMos << endl;
03770 }
03771 //-------------------------------------------------------------------
03772 
03773 void TEcnaGui::DoButtonVmaxHFccMos()
03774 {
03775 //Registration of Ymax for HF Mean Cor(c,c')
03776 
03777   const char *bufferchain = fVmaxHFccMosText->GetBuffer()->GetString();
03778 
03779   fKeyVmaxHFccMos = (Double_t)atof(bufferchain);
03780 
03781   fCnaCommand++;
03782   cout << "   *TEcnaGui [" << fCnaCommand
03783        << "]> Registration of Ymax for plot 'mean HF |cor(c,c')|' -> "
03784        << fKeyVmaxHFccMos << endl;
03785 }
03786 
03787 //-------------------------------------------------------------------
03788 
03789 void TEcnaGui::DoButtonVminLHFcc()
03790 {
03791 //Registration of Ymin for cov(c,c') in Stins
03792 
03793   const char *bufferchain = fVminLHFccText->GetBuffer()->GetString();
03794 
03795   fKeyVminLHFcc = (Double_t)atof(bufferchain);
03796 
03797   fCnaCommand++;
03798   cout << "   *TEcnaGui [" << fCnaCommand
03799        << "]> Registration of Ymin for plot 'cor(c,c') in "
03800        << fStinName.Data() << "s' -> " << fKeyVminLHFcc << endl;
03801 }
03802 //-------------------------------------------------------------------
03803 
03804 void TEcnaGui::DoButtonVmaxLHFcc()
03805 {
03806 //Registration of Ymax for cov(c,c') in Stins
03807 
03808   const char *bufferchain = fVmaxLHFccText->GetBuffer()->GetString();
03809 
03810   fKeyVmaxLHFcc = (Double_t)atof(bufferchain);
03811 
03812   fCnaCommand++;
03813   cout << "   *TEcnaGui [" << fCnaCommand
03814        << "]> Registration of Ymax for plot 'cor(c,c') in "
03815        << fStinName.Data() << "s' -> " << fKeyVmaxLHFcc << endl;
03816 }
03817 
03818 //-------------------------------------------------------------------
03819 
03820 void TEcnaGui::DoButtonStexNb()
03821 {
03822   ViewStexStinNumbering();  // message in the method
03823 }
03824 //-------------------------------------------------------------------
03825 void TEcnaGui::DoButtonStinA()
03826 {
03827 //Registration of the Stin A number (A = X coordinate for cor(c,c') plots)
03828 
03829   const char *bufferchain = (char*)fStinAText->GetBuffer()->GetString();
03830 
03831   Int_t xReadStinANumberForCons = atoi(bufferchain);
03832 
03833   if( fSubDet == "EB" ){fKeyStinANumber = xReadStinANumberForCons;}
03834   if( fSubDet == "EE" )
03835     {fKeyStinANumber = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fKeyStexNumber, xReadStinANumberForCons);}
03836 
03837   if( fSubDet == "EB" )
03838     {
03839       fCnaCommand++;
03840       cout << "   *TEcnaGui [" << fCnaCommand
03841            << "]> Registration of " << fStinName.Data() << " number -> "
03842            << xReadStinANumberForCons << endl;
03843 
03844       if ( (fKeyStinANumber < 1) || (fKeyStinANumber > fEcal->MaxStinEcnaInStex())  )
03845         {
03846           fCnaError++;
03847           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> " << fStinName.Data()
03848                << " number = " << fKeyStinANumber
03849                << ": out of range ( range = [ 1 ," << fEcal->MaxStinEcnaInStex() << " ] ) "
03850                << fTTBELL << endl;
03851         }
03852     }
03853   
03854   if( fSubDet == "EE" )
03855     {
03856       fCnaCommand++;
03857       cout << "   *TEcnaGui [" << fCnaCommand
03858            << "]> Registration of " << fStinName.Data() << " number for construction -> "
03859            << xReadStinANumberForCons << endl;
03860 
03861       if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxDeeInEE() )
03862         {
03863           Int_t off_set_cons = 0;
03864           if( fKeyStexNumber == 1 || fKeyStexNumber == 3 ){off_set_cons = fEcal->MaxSCForConsInDee();}
03865           
03866           if( xReadStinANumberForCons <= off_set_cons ||
03867               xReadStinANumberForCons > fEcal->MaxSCForConsInDee()+off_set_cons )
03868             {
03869               fCnaError++;
03870               cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> SC nb for construction = "
03871                    << xReadStinANumberForCons << ". Out of range ( range = [ " << off_set_cons+1
03872                    << "," << fEcal->MaxSCForConsInDee()+off_set_cons << "] )"
03873                    << fTTBELL << endl;
03874             }
03875         }
03876       else
03877         {
03878           fCnaError++;
03879           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> DeeNumber = " <<  fKeyStexNumber
03880                << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )"
03881                << fTTBELL << endl;
03882         }      
03883     }
03884 }
03885 
03886 //-------------------------------------------------------------------
03887 void TEcnaGui::DoButtonStinB()
03888 {
03889 //Registration of the Stin B number (B = Y coordinate for cor(c,c') plots)
03890 
03891   const char *bufferchain = fStinBText->GetBuffer()->GetString();
03892 
03893   Int_t xReadStinBNumberForCons = atoi(bufferchain);
03894 
03895   if( fSubDet == "EB" ){fKeyStinBNumber = xReadStinBNumberForCons;}
03896   if( fSubDet == "EE" )
03897     {fKeyStinBNumber = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fKeyStexNumber, xReadStinBNumberForCons);}
03898 
03899   fCnaCommand++;
03900   cout << "   *TEcnaGui [" << fCnaCommand
03901        << "]> Registration of " << fStinName.Data() << "' number -> "
03902        << xReadStinBNumberForCons << endl;
03903 
03904   if( fSubDet == "EB" )
03905     {
03906       if ( (fKeyStinBNumber < 1) || (fKeyStinBNumber > fEcal->MaxStinEcnaInStex())  )
03907         {
03908           fCnaError++;
03909           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> " << fStinName.Data()
03910                << "' number = " << fKeyStinBNumber
03911                << ": out of range ( range = [ 1 ," << fEcal->MaxStinEcnaInStex() << " ] ) "
03912                << fTTBELL << endl;
03913         }
03914     }
03915   
03916   if( fSubDet == "EE" )
03917     {
03918       if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxDeeInEE() )
03919         {
03920           Int_t off_set_cons = 0;
03921           if( fKeyStexNumber == 1 || fKeyStexNumber == 3 ){off_set_cons = fEcal->MaxSCForConsInDee();}
03922           
03923           if( xReadStinBNumberForCons < off_set_cons ||
03924               xReadStinBNumberForCons > fEcal->MaxSCForConsInDee()+off_set_cons )
03925             {
03926               fCnaError++;
03927               cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> SC nb for construction = "
03928                    << xReadStinBNumberForCons << ". Out of range ( range = [ " << off_set_cons+1
03929                    << "," << fEcal->MaxSCForConsInDee()+off_set_cons << "] )"
03930                    << fTTBELL << endl;
03931             }
03932         }
03933       else
03934         {
03935           fCnaError++;
03936           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> DeeNumber = " <<  fKeyStexNumber
03937                << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )"
03938                << fTTBELL << endl;
03939         }      
03940     }
03941 }
03942 //-------------------------------------------------------------------
03943 void TEcnaGui::DoButtonChNb()
03944 {
03945 //Display of StinA Channel numbering
03946   ViewStinCrystalNumbering(fKeyStinANumber);
03947 }
03948 
03949 //-------------------------------------------------------------------
03950 void TEcnaGui::DoButtonChan()
03951 {
03952 //Registration of the channel number
03953 
03954   const char *bufferchain = fChanText->GetBuffer()->GetString();
03955   Int_t xReadNumber = atoi(bufferchain);
03956 
03957   Int_t Choffset = -1;
03958   TString ChString = "?";
03959 
03960   if( fSubDet == "EB"){Choffset = 0; ChString = "channel";}
03961   if( fSubDet == "EE"){Choffset = 1; ChString = "crystal";}
03962 
03963   fKeyChanNumber = xReadNumber-Choffset;   // fKeyChanNumber : range = [0,25]
03964   fCnaCommand++;
03965   cout << "   *TEcnaGui [" << fCnaCommand
03966        << "]> Registration of " << ChString.Data() << " number -> "
03967        << xReadNumber << endl;
03968   
03969   if ( (fKeyChanNumber < 0) || (fKeyChanNumber > fEcal->MaxCrysInStin()-1 )  )
03970     {
03971       fCnaError++;
03972       cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
03973            << ChString.Data() << " number in " << fStinName.Data() << " = " << xReadNumber
03974            << ": out of range ( range = [" << Choffset << ","
03975            << fEcal->MaxCrysInStin()-1+Choffset << "] )"
03976            << fTTBELL << endl;
03977     } 
03978 }
03979 //-------------------------------------------------------------------
03980 void TEcnaGui::DoButtonSamp()
03981 {
03982 //Registration of the sample number
03983 
03984   const char *bufferchain = fSampText->GetBuffer()->GetString();
03985   Int_t xKeySampNumber = atoi(bufferchain);
03986 
03987   fCnaCommand++;
03988   cout << "   *TEcnaGui [" << fCnaCommand
03989        << "]> Registration of sample number -> "
03990        << xKeySampNumber << endl;
03991 
03992   if ( (xKeySampNumber < 1) || (xKeySampNumber > fKeyNbOfSamples )  )
03993     {
03994       fCnaError++;
03995       cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
03996            << " Sample number = " << xKeySampNumber
03997            << ": out of range ( range = [ 1 ," << fKeyNbOfSamples << " ] )"
03998            << fTTBELL << endl;
03999     }
04000 
04001   fKeySampNumber = xKeySampNumber-1;
04002 }
04003 
04004 //----------------------------------------------------------------------
04005 void TEcnaGui::DoButtonRul()
04006 {
04007 //Register the name of the file containing the list of run parameters
04008 
04009   //........................... get info from the entry field
04010   char* listchain = (char*)fRulText->GetBuffer()->GetString();
04011   if( listchain[0] == '\0' )
04012     {
04013       fCnaError++;
04014       cout << "   !TEcnaGui (" << fCnaError << ") *ERROR* ===> "
04015            << " Empty file name in entry for TIME EVOLUTION plots."
04016            << fTTBELL << endl;
04017       fKeyFileNameRunList = fKeyRunListInitCode;
04018     }
04019   else
04020     {
04021       char tchiffr[10] = {'0', '1', '2',  '3',  '4',  '5',  '6',  '7',  '8',  '9' };
04022       
04023       //............. test of the first character (figure => run number, letter => file name)
04024       if( listchain[0] == tchiffr [0] || listchain[0] == tchiffr [1] ||
04025           listchain[0] == tchiffr [2] || listchain[0] == tchiffr [3] ||
04026           listchain[0] == tchiffr [4] || listchain[0] == tchiffr [5] ||
04027           listchain[0] == tchiffr [6] || listchain[0] == tchiffr [7] ||
04028           listchain[0] == tchiffr [8] || listchain[0] == tchiffr [9] )
04029         {
04030           fCnaError++;
04031           cout << "   !TEcnaGui (" << fCnaError << ") *ERROR* ===> "
04032                << " Please, enter a file name beginning with an alphabetic letter."
04033                << fTTBELL << endl;
04034         }
04035       else
04036         {
04037           fKeyFileNameRunList = listchain;
04038           
04039           fCnaCommand++;
04040           cout << "   *TEcnaGui [" << fCnaCommand
04041                << "]> Registration of run list file name for history plots -> "
04042                << fKeyFileNameRunList.Data() << endl;
04043         }
04044     }
04045 }
04046 
04047 //----------------------------------------------------------------------
04048 void TEcnaGui::DoButtonGent()
04049 {
04050 //Register the general title
04051   //........................... get info from the entry field
04052   char* listchain = (char*)fGentText->GetBuffer()->GetString();  
04053   fKeyGeneralTitle = listchain;
04054   
04055   fCnaCommand++;
04056   cout << "   *TEcnaGui [" << fCnaCommand
04057        << "]> Registration of general title -> "
04058        << fKeyGeneralTitle.Data() << endl;
04059 }
04060 //-------------------------------------------------------------------
04061 //
04062 //                        Last buttons methods
04063 //
04064 //-------------------------------------------------------------------
04065 //======================= LIN/LOG + Projy FRAME
04066 
04067 void TEcnaGui::DoButtonLogx()
04068 {
04069   if( fMemoScaleX == "LOG"){fKeyScaleX = "LIN";}
04070   if( fMemoScaleX == "LIN"){fKeyScaleX = "LOG";}
04071   fMemoScaleX = fKeyScaleX;
04072 
04073   fCnaCommand++;
04074   cout << "   *TEcnaGui [" << fCnaCommand
04075        << "]> X axis -> " << fKeyScaleX << " scale " << endl;
04076 }
04077 void TEcnaGui::DoButtonLogy()
04078 {
04079   if( fMemoScaleY == "LOG" ){fKeyScaleY = "LIN";}
04080   if( fMemoScaleY == "LIN" ){fKeyScaleY = "LOG";}
04081   fMemoScaleY = fKeyScaleY;
04082 
04083   fCnaCommand++;
04084   cout << "   *TEcnaGui [" << fCnaCommand
04085        << "]> Y axis -> " << fKeyScaleY << " scale " << endl;
04086 }
04087 
04088 void TEcnaGui::DoButtonProjy()
04089 {
04090   if( fMemoProjY == "Y projection" ){fKeyProjY = "normal";}
04091   if( fMemoProjY == "normal"       ){fKeyProjY = "Y projection";}
04092   fMemoProjY = fKeyProjY;
04093 
04094   fCnaCommand++;
04095   cout << "   *TEcnaGui [" << fCnaCommand
04096        << "]> 1D Histo display -> " << fKeyProjY << " mode " << endl;
04097 }
04098 
04099 //------------------------------------------------------------------- Colors + Exit
04100 
04101 void TEcnaGui::DoButtonColPal()
04102 {
04103   if( fMemoColPal == "ECCNAColor"   ){fKeyColPal = "Rainbow";}
04104   if( fMemoColPal == "Rainbow" ){fKeyColPal = "ECCNAColor";}
04105   fMemoColPal = fKeyColPal;
04106 
04107   TString sColPalComment = "?";
04108   if( fKeyColPal == "ECCNAColor" )
04109     {sColPalComment = "ECNAColor option: black-red-blue-green-brown-purple (default)";}
04110   if( fKeyColPal == "Rainbow"    )
04111     {sColPalComment = "Rainbow option:   red-orange-yellow-green-blue-indigo-purple";}
04112 
04113   fCnaCommand++;
04114   cout << "   *TEcnaGui [" << fCnaCommand
04115        << "]> Color palette -> " << sColPalComment << endl;
04116 }
04117 
04118 void TEcnaGui::DoButtonExit()
04119 {
04120   fCnaCommand++;
04121   cout << "   *TEcnaGui [" << fCnaCommand
04122        << "]> Exit CNA session."
04123        << endl;
04124   //............................ Quit the ROOT session
04125   fButExit->SetCommand(".q");
04126 }
04127 
04128 //======================= LAST FRAME
04129 //-------------------------------------------------------------------
04130 void TEcnaGui::DoButtonClone()
04131 {
04132   fCnaCommand++;
04133   cout << "   *TEcnaGui [" << fCnaCommand
04134        << "]> Clone last canvas. " << endl;
04135 
04136   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());      /*fCnew++*/ ;}
04137   fHistos->PlotCloneOfCurrentCanvas();
04138 }
04139 //-------------------------------------------------------------------
04140 void TEcnaGui::DoButtonRoot()
04141 {
04142   fCnaCommand++;
04143   cout << "   *TEcnaGui [" << fCnaCommand
04144        << "]> This is ROOT version " << gROOT->GetVersion()
04145        << endl;
04146 }
04147 //-------------------------------------------------------------------
04148 void TEcnaGui::DoButtonHelp()
04149 {
04150   fCnaCommand++;
04151   cout << "   *TEcnaGui [" << fCnaCommand
04152        << "]> HELP: for documentation, see the ECNA web page: " << endl
04153        << "    http://cms-fabbro.web.cern.ch/cms-fabbro/cna_new/Correlated_Noise_analysis/ECNA_main_page.htm"
04154        << endl;
04155 }
04156 
04157 //===================================================================
04158 //
04159 //                       HandleMenu
04160 //
04161 //===================================================================
04162 void TEcnaGui::HandleMenu(Int_t id)
04163 {
04164   //HandleMenu
04165   //.................... SUBMIT on batch system
04166 
04167   if( id == fMenuSubmit8nmC ){SubmitOnBatchSystem("8nm");}
04168   if( id == fMenuSubmit1nhC ){SubmitOnBatchSystem("1nh");}
04169   if( id == fMenuSubmit8nhC ){SubmitOnBatchSystem("8nh");}
04170   if( id == fMenuSubmit1ndC ){SubmitOnBatchSystem("1nd");}
04171   if( id == fMenuSubmit1nwC ){SubmitOnBatchSystem("1nw");}
04172 
04173   //.................... Clean
04174   if( id == fMenuCleanSubC  ){CleanBatchFiles("Sub");}
04175   if( id == fMenuCleanJobC  ){CleanBatchFiles("Job");}
04176   if( id == fMenuCleanPythC ){CleanBatchFiles("Pyth");}
04177   if( id == fMenuCleanAllC  ){CleanBatchFiles("All");}
04178 
04179   //.................... Calculations
04180   if( id == fMenuComputStdC ){Calculations("Std");}
04181   if( id == fMenuComputSttC ){Calculations("Stt");}
04182   if( id == fMenuComputSccC ){Calculations("Scc");}
04183 
04184   //.................... Nb of events in Stex
04185   if( id == fMenuD_NOE_ChNbFullC )
04186     {
04187       if( fMemoProjY == "normal"      ){ViewHistoSorSNumberOfEventsOfCrystals(fOptPlotFull);}
04188       if( fMemoProjY == "Y projection"){ViewHistoSorSNumberOfEventsDistribution(fOptPlotFull);}
04189     }
04190   if( id == fMenuD_NOE_ChNbSameC )
04191     {
04192       if( fMemoProjY == "normal"      ){ViewHistoSorSNumberOfEventsOfCrystals(fOptPlotSame);}
04193       if( fMemoProjY == "Y projection"){ViewHistoSorSNumberOfEventsDistribution(fOptPlotSame);}
04194     }
04195   if( id == fMenuD_NOE_ChNbHocoVecoC   ){ViewSorSNumberOfEvents();}
04196   if( id == fMenuD_NOE_ChNbAsciiFileC  ){ViewHistoSorSNumberOfEventsOfCrystals(fOptAscii);}
04197 
04198   //.................... Pedestal in Stex                  (HandleMenu)
04199   if( id == fMenuD_Ped_ChNbFullC )
04200     {
04201       if( fMemoProjY == "normal"      ){ViewHistoSorSPedestalsOfCrystals(fOptPlotFull);}
04202       if( fMemoProjY == "Y projection"){ViewHistoSorSPedestalsDistribution(fOptPlotFull);}
04203     }
04204   if( id == fMenuD_Ped_ChNbSameC )
04205     {
04206       if( fMemoProjY == "normal"      ){ViewHistoSorSPedestalsOfCrystals(fOptPlotSame);}
04207       if( fMemoProjY == "Y projection"){ViewHistoSorSPedestalsDistribution(fOptPlotSame);}
04208     }
04209   if( id == fMenuD_Ped_ChNbHocoVecoC   ){ViewSorSPedestals();}
04210   if( id == fMenuD_Ped_ChNbAsciiFileC  ){ViewHistoSorSPedestalsOfCrystals(fOptAscii);}
04211 
04212   //.................... Total noise in Stex                 (HandleMenu)
04213   if( id == fMenuD_TNo_ChNbFullC )
04214     {
04215       if( fMemoProjY == "normal"      ){ViewHistoSorSTotalNoiseOfCrystals(fOptPlotFull);}
04216       if( fMemoProjY == "Y projection"){ViewHistoSorSTotalNoiseDistribution(fOptPlotFull);}
04217     }
04218   if( id == fMenuD_TNo_ChNbSameC )
04219     {
04220       if( fMemoProjY == "normal"      ){ViewHistoSorSTotalNoiseOfCrystals(fOptPlotSame);}
04221       if( fMemoProjY == "Y projection"){ViewHistoSorSTotalNoiseDistribution(fOptPlotSame);}
04222     }
04223   if( id == fMenuD_TNo_ChNbSamePC)
04224     {
04225       if( fMemoProjY == "normal"      ){ViewHistoSorSTotalNoiseOfCrystals(fOptPlotSameP);}
04226       if( fMemoProjY == "Y projection"){ViewHistoSorSTotalNoiseDistribution(fOptPlotSameP);}
04227     }
04228   if( id == fMenuD_TNo_ChNbHocoVecoC   ){ViewSorSTotalNoise();}
04229   if( id == fMenuD_TNo_ChNbAsciiFileC  ){ViewHistoSorSTotalNoiseOfCrystals(fOptAscii);}
04230 
04231   //.................... Low Frequency noise in Stex                 (HandleMenu)
04232   if( id == fMenuD_LFN_ChNbFullC )
04233     {
04234       if( fMemoProjY == "normal"      ){ViewHistoSorSLowFrequencyNoiseOfCrystals(fOptPlotFull);}
04235       if( fMemoProjY == "Y projection"){ViewHistoSorSLowFrequencyNoiseDistribution(fOptPlotFull);}
04236     }
04237   if( id == fMenuD_LFN_ChNbSameC )
04238     {
04239       if( fMemoProjY == "normal"      ){ViewHistoSorSLowFrequencyNoiseOfCrystals(fOptPlotSame);}
04240       if( fMemoProjY == "Y projection"){ViewHistoSorSLowFrequencyNoiseDistribution(fOptPlotSame);}
04241     }
04242   if( id == fMenuD_LFN_ChNbSamePC)
04243     {
04244       if( fMemoProjY == "normal"      ){ViewHistoSorSLowFrequencyNoiseOfCrystals(fOptPlotSameP);}
04245       if( fMemoProjY == "Y projection"){ViewHistoSorSLowFrequencyNoiseDistribution(fOptPlotSameP);}
04246     }
04247   if( id == fMenuD_LFN_ChNbHocoVecoC   ){ViewSorSLowFrequencyNoise();}
04248   if( id == fMenuD_LFN_ChNbAsciiFileC  ){ViewHistoSorSLowFrequencyNoiseOfCrystals(fOptAscii);}
04249 
04250   //.................... High Frequency noise in Stex                 (HandleMenu)
04251   if( id == fMenuD_HFN_ChNbFullC )
04252     {
04253       if( fMemoProjY == "normal"      ){ViewHistoSorSHighFrequencyNoiseOfCrystals(fOptPlotFull);}
04254       if( fMemoProjY == "Y projection"){ViewHistoSorSHighFrequencyNoiseDistribution(fOptPlotFull);}
04255     }
04256   if( id == fMenuD_HFN_ChNbSameC )
04257     {
04258       if( fMemoProjY == "normal"      ){ViewHistoSorSHighFrequencyNoiseOfCrystals(fOptPlotSame);}
04259       if( fMemoProjY == "Y projection"){ViewHistoSorSHighFrequencyNoiseDistribution(fOptPlotSame);}
04260     }
04261   if( id == fMenuD_HFN_ChNbSamePC)
04262     {
04263       if( fMemoProjY == "normal"      ){ViewHistoSorSHighFrequencyNoiseOfCrystals(fOptPlotSameP);}
04264       if( fMemoProjY == "Y projection"){ViewHistoSorSHighFrequencyNoiseDistribution(fOptPlotSameP);}
04265     }
04266   if( id == fMenuD_HFN_ChNbHocoVecoC   ){ViewSorSHighFrequencyNoise();}
04267   if( id == fMenuD_HFN_ChNbAsciiFileC  ){ViewHistoSorSHighFrequencyNoiseOfCrystals(fOptAscii);}
04268 
04269   //.................... Mean Corss in Stex                 (HandleMenu)
04270   if( id == fMenuD_MCs_ChNbFullC )
04271     {
04272       if( fMemoProjY == "normal"      ){ViewHistoSorSMeanCorssOfCrystals(fOptPlotFull);}
04273       if( fMemoProjY == "Y projection"){ViewHistoSorSMeanCorssDistribution(fOptPlotFull);}
04274     }
04275   if( id == fMenuD_MCs_ChNbSameC )
04276     {
04277       if( fMemoProjY == "normal"      ){ViewHistoSorSMeanCorssOfCrystals(fOptPlotSame);}
04278       if( fMemoProjY == "Y projection"){ViewHistoSorSMeanCorssDistribution(fOptPlotSame);}
04279     }
04280   if( id == fMenuD_MCs_ChNbSamePC)
04281     {
04282       if( fMemoProjY == "normal"      ){ViewHistoSorSMeanCorssOfCrystals(fOptPlotSameP);}
04283       if( fMemoProjY == "Y projection"){ViewHistoSorSMeanCorssDistribution(fOptPlotSameP);}
04284     }
04285   if( id == fMenuD_MCs_ChNbHocoVecoC   ){ViewSorSMeanCorss();}
04286   if( id == fMenuD_MCs_ChNbAsciiFileC  ){ViewHistoSorSMeanCorssOfCrystals(fOptAscii);}
04287 
04288   //.................... Sigma of Corss in the Stex                 (HandleMenu)
04289   if( id == fMenuD_SCs_ChNbFullC )
04290     {
04291       if( fMemoProjY == "normal"      ){ViewHistoSorSSigmaOfCorssOfCrystals(fOptPlotFull);}
04292       if( fMemoProjY == "Y projection"){ViewHistoSorSSigmaOfCorssDistribution(fOptPlotFull);}
04293     }
04294   if( id == fMenuD_SCs_ChNbSameC )
04295     {
04296       if( fMemoProjY == "normal"      ){ViewHistoSorSSigmaOfCorssOfCrystals(fOptPlotSame);}
04297       if( fMemoProjY == "Y projection"){ViewHistoSorSSigmaOfCorssDistribution(fOptPlotSame);}
04298     }
04299   if( id == fMenuD_SCs_ChNbSamePC)
04300     {
04301       if( fMemoProjY == "normal"      ){ViewHistoSorSSigmaOfCorssOfCrystals(fOptPlotSameP);}
04302       if( fMemoProjY == "Y projection"){ViewHistoSorSSigmaOfCorssDistribution(fOptPlotSameP);}
04303     }
04304   if( id == fMenuD_SCs_ChNbHocoVecoC   ){ViewSorSSigmaOfCorss();}
04305   if( id == fMenuD_SCs_ChNbAsciiFileC  ){ViewHistoSorSSigmaOfCorssOfCrystals(fOptAscii);}
04306 
04307   //............................... Low Freq Mean Cor(c,c') for each pair of Stins                 (HandleMenu)
04308   if( id == fMenuLFccMosColzC ){ViewMatrixLowFrequencyMeanCorrelationsBetweenStins("COLZ");}
04309   if( id == fMenuLFccMosLegoC ){ViewMatrixLowFrequencyMeanCorrelationsBetweenStins("LEGO2Z");}
04310   //............................... High Freq Mean Cor(c,c') for each pair of Stins
04311   if( id == fMenuHFccMosColzC ){ViewMatrixHighFrequencyMeanCorrelationsBetweenStins("COLZ");}
04312   if( id == fMenuHFccMosLegoC ){ViewMatrixHighFrequencyMeanCorrelationsBetweenStins("LEGO2Z");}
04313 
04314   //............................... Corcc for each Stin in the Stex
04315   if( id == fMenuLFccColzC ){ViewStexLowFrequencyCorcc();}
04316   if( id == fMenuHFccColzC ){ViewStexHighFrequencyCorcc();}
04317 
04318   //--------> Nb for Cons for Stin numbers in case of EE
04319   Int_t cKeyStinANumber = fKeyStinANumber;
04320   if( fSubDet == "EE" && fKeyStexNumber != 0 )
04321     {cKeyStinANumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinANumber);}
04322   Int_t cKeyStinBNumber = fKeyStinBNumber;
04323   if( fSubDet == "EE" && fKeyStexNumber != 0 )
04324     {cKeyStinBNumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber, fKeyStinBNumber);}
04325 
04326   //............................... Low Frequency Correlations and covariances between channels
04327   if( id == fMenuLFCorccColzC )
04328     {ViewMatrixLowFrequencyCorrelationsBetweenChannels(cKeyStinANumber, cKeyStinBNumber, "COLZ");}
04329   if( id == fMenuLFCorccLegoC )
04330     {ViewMatrixLowFrequencyCorrelationsBetweenChannels(cKeyStinANumber, cKeyStinBNumber, "LEGO2Z");}
04331 
04332   if( id == fMenuHFCorccColzC )
04333     {ViewMatrixHighFrequencyCorrelationsBetweenChannels(cKeyStinANumber, cKeyStinBNumber, "COLZ");}
04334   if( id == fMenuHFCorccLegoC )
04335     {ViewMatrixHighFrequencyCorrelationsBetweenChannels(cKeyStinANumber, cKeyStinBNumber, "LEGO2Z");}
04336 
04337   //.................................... Correlations and covariances between samples     (HandleMenu)
04338   if( id == fMenuCorssColzC      ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "COLZ");}
04339   if( id == fMenuCorssBoxC       ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "BOX");}
04340   if( id == fMenuCorssTextC      ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "TEXT");}
04341   if( id == fMenuCorssContzC     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "CONTZ");}
04342   if( id == fMenuCorssLegoC      ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "LEGO2Z");}
04343   if( id == fMenuCorssSurf1C     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "SURF1Z");}
04344   if( id == fMenuCorssSurf2C     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "SURF2Z");}
04345   if( id == fMenuCorssSurf3C     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "SURF3Z");}
04346   if( id == fMenuCorssSurf4C     ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "SURF4");}
04347   if( id == fMenuCorssAsciiFileC ){ViewMatrixCorrelationSamples(cKeyStinANumber, fKeyChanNumber, "ASCII");}
04348 
04349   if( id == fMenuCovssColzC      ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "COLZ");}
04350   if( id == fMenuCovssBoxC       ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "BOX");}
04351   if( id == fMenuCovssTextC      ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "TEXT");}
04352   if( id == fMenuCovssContzC     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "CONTZ");}
04353   if( id == fMenuCovssLegoC      ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "LEGO2Z");}
04354   if( id == fMenuCovssSurf1C     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "SURF1Z");}
04355   if( id == fMenuCovssSurf2C     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "SURF2Z");}
04356   if( id == fMenuCovssSurf3C     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "SURF3Z");}
04357   if( id == fMenuCovssSurf4C     ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "SURF4");}
04358   if( id == fMenuCovssAsciiFileC ){ViewMatrixCovarianceSamples(cKeyStinANumber, fKeyChanNumber, "ASCII");}
04359 
04360   //.................... Correlations and covariances between samples for all channels of a Stin
04361   if( id == fMenuCorssAllColzC ){ViewStinCorrelationSamples(cKeyStinANumber);}
04362   if( id == fMenuCovssAllColzC ){ViewStinCovarianceSamples(cKeyStinANumber);}
04363      
04364   //..................................... Sample means (pedestals)       (HandleMenu) 
04365   if( id == fMenuD_MSp_SpNbLineFullC )
04366     {
04367       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleMeans(cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04368       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleMeansDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04369     }
04370 
04371   if( id == fMenuD_MSp_SpNbLineSameC )
04372     {
04373       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleMeans(cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04374       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleMeansDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04375     }
04376   if( id == fMenuD_MSp_SpNbLineAllStinC )
04377     {
04378       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleMeans(cKeyStinANumber, fKeyChanNumber, fOptPlotSameInStin);}
04379       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleMeansDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotSameInStin);}
04380     }
04381     
04382   //..................................... Sample sigmas
04383   if( id == fMenuD_SSp_SpNbLineFullC )
04384     {
04385       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleSigmas(cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04386       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleSigmasDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04387     }
04388   if( id == fMenuD_SSp_SpNbLineSameC )
04389     {
04390       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleSigmas(cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04391       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleSigmasDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04392     }
04393    if( id == fMenuD_SSp_SpNbLineAllStinC )
04394     {
04395       if( fMemoProjY == "normal"      ){ViewHistoCrystalSampleSigmas(cKeyStinANumber, fKeyChanNumber, fOptPlotSameInStin);}
04396       if( fMemoProjY == "Y projection"){ViewHistoCrystalSampleSigmasDistribution(cKeyStinANumber, fKeyChanNumber, fOptPlotSameInStin);}
04397     }
04398    
04399   //..................................... Evolution in time (ViewHistime, except EvolSamp -> Viewhisto)
04400   if(   id == fMenuH_Ped_DatePolmFullC || id == fMenuH_Ped_DatePolmSameC  
04401      || id == fMenuH_TNo_DatePolmFullC || id == fMenuH_TNo_DatePolmSameC || id == fMenuH_TNo_DatePolmSamePC
04402      || id == fMenuH_LFN_DatePolmFullC || id == fMenuH_LFN_DatePolmSameC || id == fMenuH_LFN_DatePolmSamePC
04403      || id == fMenuH_HFN_DatePolmFullC || id == fMenuH_HFN_DatePolmSameC || id == fMenuH_HFN_DatePolmSamePC
04404      || id == fMenuH_MCs_DatePolmFullC || id == fMenuH_MCs_DatePolmSameC || id == fMenuH_MCs_DatePolmSamePC
04405      || id == fMenuH_SCs_DatePolmFullC || id == fMenuH_SCs_DatePolmSameC || id == fMenuH_SCs_DatePolmSamePC)
04406     {
04407       if(fKeyFileNameRunList == fKeyRunListInitCode )
04408         {fCnaError++;
04409           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===> "
04410                << " EMPTY STRING for list of run file name (TIME EVOLUTION plots)." << fTTBELL << endl;}
04411       else
04412         {
04413           //........................................ Pedestals                 (HandleMenu / ViewHistime)
04414           if( id == fMenuH_Ped_DatePolmFullC )
04415             {
04416               if( fMemoProjY == "normal"      )
04417                 {ViewHistimeCrystalPedestals(fKeyFileNameRunList.Data(),
04418                                              cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04419               if( fMemoProjY == "Y projection")
04420                 {ViewHistimeCrystalPedestalsRuns(fKeyFileNameRunList.Data(),
04421                                                  cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04422             }
04423           if( id == fMenuH_Ped_DatePolmSameC )
04424             { if( fMemoProjY == "normal"      )
04425               {ViewHistimeCrystalPedestals(fKeyFileNameRunList.Data(),
04426                                            cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04427             if( fMemoProjY == "Y projection")
04428               {ViewHistimeCrystalPedestalsRuns(fKeyFileNameRunList.Data(),
04429                                                cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04430             }
04431 
04432           //........................................ Total noise
04433           if( id == fMenuH_TNo_DatePolmFullC )
04434             {
04435               if( fMemoProjY == "normal"      )
04436                 {ViewHistimeCrystalTotalNoise(fKeyFileNameRunList.Data(),
04437                                               cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04438               if( fMemoProjY == "Y projection")
04439                 {ViewHistimeCrystalTotalNoiseRuns(fKeyFileNameRunList.Data(),
04440                                                   cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04441             }
04442           if( id == fMenuH_TNo_DatePolmSameC )
04443             {
04444               if( fMemoProjY == "normal"      )
04445                 {ViewHistimeCrystalTotalNoise(fKeyFileNameRunList.Data(),
04446                                               cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04447               if( fMemoProjY == "Y projection")
04448                 {ViewHistimeCrystalTotalNoiseRuns(fKeyFileNameRunList.Data(),
04449                                                   cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04450             }
04451           if( id == fMenuH_TNo_DatePolmSamePC )
04452             {
04453               if( fMemoProjY == "normal"      )
04454                 {ViewHistimeCrystalTotalNoise(fKeyFileNameRunList.Data(),
04455                                               cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04456               if( fMemoProjY == "Y projection")
04457                 {ViewHistimeCrystalTotalNoiseRuns(fKeyFileNameRunList.Data(),
04458                                                   cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04459             }
04460 
04461           //........................................ Low frequency noise                 (HandleMenu / ViewHistime)
04462           if( id == fMenuH_LFN_DatePolmFullC )
04463             {
04464               if( fMemoProjY == "normal"      )
04465                 {ViewHistimeCrystalLowFrequencyNoise(fKeyFileNameRunList.Data(),
04466                                                      cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04467               if( fMemoProjY == "Y projection")
04468                 {ViewHistimeCrystalLowFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04469                                                          cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04470             }
04471           if( id == fMenuH_LFN_DatePolmSameC )
04472             {
04473               if( fMemoProjY == "normal"      )
04474                 {ViewHistimeCrystalLowFrequencyNoise(fKeyFileNameRunList.Data(),
04475                                                      cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04476               if( fMemoProjY == "Y projection")
04477                 {ViewHistimeCrystalLowFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04478                                                          cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04479             }
04480           if( id == fMenuH_LFN_DatePolmSamePC )
04481             {
04482               if( fMemoProjY == "normal"      )
04483                 {ViewHistimeCrystalLowFrequencyNoise(fKeyFileNameRunList.Data(),
04484                                                      cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04485               if( fMemoProjY == "Y projection")
04486                 {ViewHistimeCrystalLowFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04487                                                          cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04488             }
04489           
04490           //........................................ High frequency noise
04491           if( id == fMenuH_HFN_DatePolmFullC )
04492             {
04493               if( fMemoProjY == "normal"      )
04494                 {ViewHistimeCrystalHighFrequencyNoise(fKeyFileNameRunList.Data(),
04495                                                       cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04496               if( fMemoProjY == "Y projection")
04497                 {ViewHistimeCrystalHighFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04498                                                           cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04499             }
04500           if( id == fMenuH_HFN_DatePolmSameC )
04501             {
04502               if( fMemoProjY == "normal"      )
04503                 {ViewHistimeCrystalHighFrequencyNoise(fKeyFileNameRunList.Data(),
04504                                                       cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04505               if( fMemoProjY == "Y projection")
04506                 {ViewHistimeCrystalHighFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04507                                                           cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04508             }
04509           if( id == fMenuH_HFN_DatePolmSamePC )
04510             {
04511               if( fMemoProjY == "normal"      )
04512                 {ViewHistimeCrystalHighFrequencyNoise(fKeyFileNameRunList.Data(),
04513                                                       cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04514               if( fMemoProjY == "Y projection")
04515                 {ViewHistimeCrystalHighFrequencyNoiseRuns(fKeyFileNameRunList.Data(),
04516                                                           cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04517             }
04518           
04519           //........................................ Mean Corss                 (HandleMenu / ViewHistime)
04520           if( id == fMenuH_MCs_DatePolmFullC )
04521             {
04522               if( fMemoProjY == "normal"      )
04523                 {ViewHistimeCrystalMeanCorss(fKeyFileNameRunList.Data(),
04524                                                cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04525               if( fMemoProjY == "Y projection")
04526                 {ViewHistimeCrystalMeanCorssRuns(fKeyFileNameRunList.Data(),
04527                                                    cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04528             }
04529           if( id == fMenuH_MCs_DatePolmSameC )
04530             {
04531               if( fMemoProjY == "normal"      )
04532                 {ViewHistimeCrystalMeanCorss(fKeyFileNameRunList.Data(),
04533                                                cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04534               if( fMemoProjY == "Y projection")
04535                 {ViewHistimeCrystalMeanCorssRuns(fKeyFileNameRunList.Data(),
04536                                                    cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04537             }
04538           if( id == fMenuH_MCs_DatePolmSamePC )
04539             {
04540               if( fMemoProjY == "normal"      )
04541                 {ViewHistimeCrystalMeanCorss(fKeyFileNameRunList.Data(),
04542                                                cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04543               if( fMemoProjY == "Y projection")
04544                 {ViewHistimeCrystalMeanCorssRuns(fKeyFileNameRunList.Data(),
04545                                                    cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04546             }
04547           
04548           //........................................ Sigmas of Corss
04549           if( id == fMenuH_SCs_DatePolmFullC )
04550             {
04551               if( fMemoProjY == "normal"      )
04552                 {ViewHistimeCrystalSigmaOfCorss(fKeyFileNameRunList.Data(),
04553                                                 cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04554               if( fMemoProjY == "Y projection")
04555                 {ViewHistimeCrystalSigmaOfCorssRuns(fKeyFileNameRunList.Data(),
04556                                                     cKeyStinANumber, fKeyChanNumber, fOptPlotFull);}
04557             }
04558           if( id == fMenuH_SCs_DatePolmSameC )
04559             {
04560               if( fMemoProjY == "normal"      )
04561                 {ViewHistimeCrystalSigmaOfCorss(fKeyFileNameRunList.Data(),
04562                                                 cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04563               if( fMemoProjY == "Y projection")
04564                 {ViewHistimeCrystalSigmaOfCorssRuns(fKeyFileNameRunList.Data(),
04565                                                     cKeyStinANumber, fKeyChanNumber, fOptPlotSame);}
04566             }
04567           if( id == fMenuH_SCs_DatePolmSamePC )
04568             {
04569               if( fMemoProjY == "normal"      )
04570                 {ViewHistimeCrystalSigmaOfCorss(fKeyFileNameRunList.Data(),
04571                                                 cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04572               if( fMemoProjY == "Y projection")
04573                 {ViewHistimeCrystalSigmaOfCorssRuns(fKeyFileNameRunList.Data(),
04574                                                     cKeyStinANumber, fKeyChanNumber, fOptPlotSameP);}
04575             }
04576         }
04577     }
04578 
04579   //...................................... SampTime                               (HandleMenu / ADC)
04580   if( id == fMenuAdcProjSampLineFullC )
04581     {
04582       if( fMemoProjY == "normal"      )
04583         {ViewHistoCrystalSampleValues(cKeyStinANumber, fKeyChanNumber, fKeySampNumber, fOptPlotFull);}
04584       if( fMemoProjY == "Y projection")
04585         {ViewHistoSampleEventDistribution(cKeyStinANumber, fKeyChanNumber, fKeySampNumber, fOptPlotFull);}
04586     }
04587   if( id == fMenuAdcProjSampLineSameC )
04588     {
04589       if( fMemoProjY == "normal"      )
04590         {ViewHistoCrystalSampleValues(cKeyStinANumber, fKeyChanNumber, fKeySampNumber, fOptPlotSame);}
04591       if( fMemoProjY == "Y projection")
04592         {ViewHistoSampleEventDistribution(cKeyStinANumber, fKeyChanNumber, fKeySampNumber, fOptPlotSame);}
04593     }
04594 }
04595 // ------------- ( end of HandleMenu(...) ) -------------
04596 
04597 //==========================================================================
04598 //
04599 //             SubmitOnBatchSystem()   M E T H O D 
04600 //
04601 //==========================================================================
04602 void TEcnaGui::SubmitOnBatchSystem(const TString& QueueCode)
04603 {
04604   //Submit job in batch mode
04605   
04606   if( (fConfirmSubmit == 1) && (fConfirmRunNumber == fKeyRunNumber) )
04607     {
04608       fCnaCommand++;
04609       cout << "   *TEcnaGui [" << fCnaCommand
04610            << "]> Submitting job in batch mode for run " << fConfirmRunNumber << endl;
04611 
04612       //.......................... get the path "modules/data"
04613       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/data/
04614       TString ModulesdataPath = fCnaParPaths->PathModulesData();
04615 
04616       //---------------------------------- python file building script: command text
04617       TString CnaPythonCommand = ModulesdataPath;
04618 
04619       //......................................... Script for python file building: script name
04620       TString PythonScriptName = "EcnaSystemScriptPython";
04621       const Text_t *t_PythonScriptName = (const Text_t *)PythonScriptName.Data();
04622       CnaPythonCommand.Append(t_PythonScriptName);
04623 
04624       //......................................... Script for python file building: arguments
04625       //  In the calling command, TString arguments must be of the form: \"STRING1\"  \"STRING2\"  etc...
04626 
04627       //......................................... arguments -> Run number
04628       //.......... ${1}
04629       CnaPythonCommand.Append(' ');
04630       CnaPythonCommand.Append(fConfirmRunNumberString);
04631 
04632       //......................................... arguments -> Analyzer parameters
04633       //.......... ${2}
04634       CnaPythonCommand.Append(' ');
04635       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04636       const Text_t *t_StringAnaType = (const Text_t *)fKeyAnaType.Data();
04637       CnaPythonCommand.Append(t_StringAnaType);
04638       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04639 
04640       //.......... ${3}
04641       CnaPythonCommand.Append(' ');
04642       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04643       const Text_t *t_NbOfSamplesString = (const Text_t *)fKeyNbOfSamplesString.Data();
04644       CnaPythonCommand.Append(t_NbOfSamplesString);
04645       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04646 
04647       //.......... ${4}
04648       CnaPythonCommand.Append(' ');
04649       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04650       const Text_t *t_FirstReqEvtNumberString = (const Text_t *)fKeyFirstReqEvtNumberString.Data();
04651       CnaPythonCommand.Append(t_FirstReqEvtNumberString);
04652       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04653 
04654       //.......... ${5}
04655       CnaPythonCommand.Append(' ');
04656       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04657       const Text_t *t_LastReqEvtNumberString = (const Text_t *)fKeyLastReqEvtNumberString.Data();
04658       CnaPythonCommand.Append(t_LastReqEvtNumberString);
04659       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04660 
04661       //.......... ${6}
04662       CnaPythonCommand.Append(' ');
04663       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04664       const Text_t *t_ReqNbOfEvtsString = (const Text_t *)fKeyReqNbOfEvtsString.Data();
04665       CnaPythonCommand.Append(t_ReqNbOfEvtsString);
04666       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04667 
04668       //.......... ${7}
04669       CnaPythonCommand.Append(' ');
04670       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04671       const Text_t *t_fStexName = (const Text_t *)fStexName.Data();
04672       CnaPythonCommand.Append(t_fStexName);
04673       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04674 
04675       //.......... ${8}
04676       CnaPythonCommand.Append(' ');
04677       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04678       const Text_t *t_StexNumberString = (const Text_t *)fKeyStexNumberString.Data();
04679       CnaPythonCommand.Append(t_StexNumberString);
04680       CnaPythonCommand.Append('\\'); CnaPythonCommand.Append('\"');
04681 
04682       //......................................... arguments -> python file name
04683       //.......... ${9}
04684       // - - - - - - - - - - - - - - - - - Build the name
04685       fPythonFileName = "EcnaPython_";
04686 
04687       fPythonFileName.Append(t_StringAnaType);
04688       fPythonFileName.Append('_');
04689 
04690       fPythonFileName.Append('S');
04691       fPythonFileName.Append('1');
04692       fPythonFileName.Append('_');
04693       fPythonFileName.Append(t_NbOfSamplesString);
04694       fPythonFileName.Append('_');
04695       fPythonFileName.Append('R');
04696 
04697       const Text_t *t_fConfirmRunNumberString = (const Text_t *)fConfirmRunNumberString.Data();
04698       fPythonFileName.Append(t_fConfirmRunNumberString);
04699       fPythonFileName.Append('_');
04700 
04701       fPythonFileName.Append(t_FirstReqEvtNumberString);
04702       fPythonFileName.Append('_');
04703 
04704       fPythonFileName.Append(t_LastReqEvtNumberString);
04705       fPythonFileName.Append('_');
04706 
04707       fPythonFileName.Append(t_ReqNbOfEvtsString);
04708       fPythonFileName.Append('_');
04709 
04710       fPythonFileName.Append(t_fStexName);
04711 
04712       fPythonFileName.Append(t_StexNumberString);      //  <== (python file name without extension .py)
04713       // - - - - - - - - - - - - - - - - - 
04714 
04715       CnaPythonCommand.Append(' ');
04716       const Text_t *t_fPythonFileName = (const Text_t *)fPythonFileName.Data();
04717       CnaPythonCommand.Append(t_fPythonFileName);
04718 
04719       //......................................... arguments -> modules:data path
04720       //.......... ${9}
04721       CnaPythonCommand.Append(' ');
04722       const Text_t *t_modules_data_path = (const Text_t *)ModulesdataPath.Data();
04723       CnaPythonCommand.Append(t_modules_data_path);
04724 
04725       //......................................... arguments -> last evt number (without "")
04726       //.......... ${10}
04727       //CnaPythonCommand.Append(' ');
04728       //CnaPythonCommand.Append(t_LastReqEvtNumberString);
04729 
04730       //......................................... arguments -> SourceForPythonFileName
04731       //.......... ${11}
04732       //CnaPythonCommand.Append(' ');
04733       //const Text_t *t_Pyf = (const Text_t *)fKeyPyf.Data();
04734       //CnaPythonCommand.Append(t_Pyf);
04735 
04736       //---------------------------------- Exec python file building command (csh before command text)  
04737       const Text_t *t_cnapythoncommand = (const Text_t *)CnaPythonCommand.Data();
04738       TString CnaExecPythonCommand = "csh ";
04739       CnaExecPythonCommand.Append(t_cnapythoncommand);
04740 
04741       Int_t i_exec_python = gSystem->Exec(CnaExecPythonCommand.Data());
04742 
04743       if( i_exec_python != 0 )
04744         {
04745           cout << "*TEcnaGui> Script for python file building was executed with error code = "
04746                << i_exec_python << "." << endl
04747                << "           python file: " << fPythonFileName.Data() << ".py" << endl
04748                << "           Command: " << CnaExecPythonCommand.Data() << endl
04749                << fTTBELL << endl;
04750         }
04751       else
04752         {
04753           cout << "*TEcnaGui> Script for python file building was successfully executed." << endl
04754                << "           python file: " << fPythonFileName.Data() << ".py" << endl
04755                << "           (Command: " << CnaExecPythonCommand.Data() << ")" << endl;
04756 
04757           //========================================================== Job submission script
04758           TString CnaSubmitCommand = ModulesdataPath;
04759 
04760           //......................................... Script for job submission: command name
04761           TString SubmitScriptName = "EcnaSystemScriptSubmit";
04762           const Text_t *t_SubmitScriptName= (const Text_t *)SubmitScriptName.Data();
04763           CnaSubmitCommand.Append(t_SubmitScriptName);
04764           CnaSubmitCommand.Append(' ');
04765 
04766           //......................................... Script for job submission: arguments
04767           const Text_t *t_cmssw_base = (const Text_t *)fCnaParPaths->CMSSWBase().Data();
04768           CnaSubmitCommand.Append(t_cmssw_base);
04769           CnaSubmitCommand.Append(' ');
04770 
04771           const Text_t *t_cmssw_subsystem = (const Text_t *)fCnaParPaths->CMSSWSubsystem().Data();
04772           CnaSubmitCommand.Append(t_cmssw_subsystem);
04773           CnaSubmitCommand.Append(' ');
04774 
04775           const Text_t *t_cfgp_file = (const Text_t *)fPythonFileName.Data();
04776           CnaSubmitCommand.Append(t_cfgp_file);
04777           CnaSubmitCommand.Append(' ');
04778       
04779           const Text_t *t_QueueCode = (const Text_t *)QueueCode.Data();
04780           CnaSubmitCommand.Append(t_QueueCode);
04781 
04782           //----------------------------------------- Exec Submit Command (csh before command text)
04783           const Text_t *t_cnasubmitcommand = (const Text_t *)CnaSubmitCommand.Data();
04784           TString CnaExecSubmitCommand = "csh ";
04785           CnaExecSubmitCommand.Append(t_cnasubmitcommand);
04786 
04787           Int_t i_exec_submit = gSystem->Exec(CnaExecSubmitCommand.Data());
04788       
04789           if( i_exec_submit != 0 )
04790             {
04791               cout << "*TEcnaGui> Script for job submission was executed with error code = "
04792                    << i_exec_submit << "."  << endl
04793                    << "          Command: " << CnaExecSubmitCommand.Data() << endl
04794                    << fTTBELL << endl;
04795             }
04796           else
04797             {
04798               cout << "*TEcnaGui> Job with configuration file: " << fPythonFileName.Data()
04799                    << " was successfully submitted." << endl
04800                    << "          (Command: " << CnaExecSubmitCommand.Data() << ")" << endl;       
04801             }
04802       
04803           fConfirmSubmit          = 0;
04804           fConfirmRunNumber       = 0;
04805           fConfirmRunNumberString = "0";
04806         }
04807     }
04808   else
04809     {
04810       if( fKeyAnaType.BeginsWith("Adc") )
04811         {
04812           fCnaCommand++;
04813           cout << "   *TEcnaGui [" << fCnaCommand
04814                << "]> Request for submitting job in batch mode for run " << fKeyRunNumber
04815                << ". Syntax OK. Please, click again to confirm."
04816                << fTTBELL << endl;
04817           
04818           fConfirmSubmit          = 1;
04819           fConfirmRunNumber       = fKeyRunNumber;
04820           fConfirmRunNumberString = fKeyRunNumberString;
04821         }
04822       else
04823         {
04824           fCnaError++;
04825           cout << "   !TEcnaGui (" << fCnaError << ") *** ERROR *** ===>"
04826                << " Analysis name = " << fKeyAnaType
04827                << ": should begin with 'Adc'."
04828                << " Please, change the analysis name." << fTTBELL << endl;
04829           
04830           fConfirmSubmit          = 0;
04831           fConfirmRunNumber       = 0;
04832           fConfirmRunNumberString = "0";
04833         }
04834     }
04835 }
04836 //------------------------------------------- end of SubmitOnBatchSystem() ------------------------
04837 
04838 //==========================================================================
04839 //
04840 //             CleanBatchFiles()   M E T H O D 
04841 //
04842 //==========================================================================
04843 void TEcnaGui::CleanBatchFiles(const TString& clean_code)
04844 {
04845   //Clean python files, submission scripts,...
04846 
04847   fCnaCommand++;
04848   cout << "   *TEcnaGui [" << fCnaCommand
04849        << "]> Clean requested with code: " << clean_code
04850        << endl;
04851 
04852   //================================ CLEAN SUBMISSION SCRIPTS ===================================
04853   if( clean_code == "Sub"  || clean_code == "All")
04854     {
04855       //.......................... get the path "modules/data"
04856       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/data/
04857       TString ModulesdataPath = fCnaParPaths->PathModulesData();
04858 
04859       //----------------------------------------- submission clean script: command text
04860       //......................................... submission clean script: script name
04861       TString CnaCleanSubmissionCommand = ModulesdataPath;
04862       TString CleanSubmissionScriptName = "EcnaSystemScriptCleanSubmissionScripts";
04863       const Text_t *t_CleanSubmissionScriptName = (const Text_t *)CleanSubmissionScriptName.Data();
04864       CnaCleanSubmissionCommand.Append(t_CleanSubmissionScriptName);
04865 
04866       //......................................... arguments -> test/slc... path
04867       //.......................... get the path "test/slc4_ia32_gcc345"
04868       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/test/slc4_ia32_gcc345/
04869       TString TestslcPath = fCnaParPaths->PathTestScramArch();
04870       CnaCleanSubmissionCommand.Append(' ');
04871       const Text_t *t_modules_data_path = (const Text_t *)TestslcPath.Data();
04872       CnaCleanSubmissionCommand.Append(t_modules_data_path);
04873 
04874       //----------------------------------------- Exec CleanSubmission Command (csh before command text)
04875       const Text_t *t_cnacleansubmissioncommand = (const Text_t *)CnaCleanSubmissionCommand.Data();
04876       TString CnaExecCleanSubmissionCommand = "csh ";
04877       CnaExecCleanSubmissionCommand.Append(t_cnacleansubmissioncommand);
04878 
04879       Int_t i_exec_cleansubmission = gSystem->Exec(CnaExecCleanSubmissionCommand.Data());
04880 
04881       if( i_exec_cleansubmission != 0 )
04882         {
04883           cout << "*TEcnaGui> Script for submission script clean was executed with error code = "
04884                << i_exec_cleansubmission << "."  << endl
04885                << "          Command: " << CnaExecCleanSubmissionCommand.Data() << endl
04886                << fTTBELL << endl;
04887         }
04888       else
04889         {
04890           cout << "*TEcnaGui> Script for submission script clean"
04891                << " was successfully executed." << endl
04892                << "          (Command: " << CnaExecCleanSubmissionCommand.Data() << ")" << endl;          
04893         }
04894 
04895     }
04896 
04897   //================================= CLEAN LSFJOB REPORTS ======================================
04898   if( clean_code == "Job"  || clean_code == "All")
04899     {
04900       //.......................... get the path "modules/data"
04901       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/data/
04902       TString ModulesdataPath = fCnaParPaths->PathModulesData();
04903 
04904       //----------------------------------------- jobreport clean script: command text
04905       //......................................... jobreport clean script: script name
04906       TString CnaCleanJobreportCommand = ModulesdataPath;
04907       TString CleanJobreportScriptName = "EcnaSystemScriptCleanLSFJOBReports";
04908       const Text_t *t_CleanJobreportScriptName = (const Text_t *)CleanJobreportScriptName.Data();
04909       CnaCleanJobreportCommand.Append(t_CleanJobreportScriptName);
04910 
04911       //......................................... arguments -> test/slc... path
04912       //.......................... get the path "test/slc4_ia32_gcc345"
04913       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/test/slc4_ia32_gcc345/
04914       TString TestslcPath = fCnaParPaths->PathTestScramArch();
04915       CnaCleanJobreportCommand.Append(' ');
04916       const Text_t *t_modules_data_path = (const Text_t *)TestslcPath.Data();
04917       CnaCleanJobreportCommand.Append(t_modules_data_path);
04918 
04919       //----------------------------------------- Exec CleanJobreport Command (csh before command text)
04920       const Text_t *t_cnacleanjobreportcommand = (const Text_t *)CnaCleanJobreportCommand.Data();
04921       TString CnaExecCleanJobreportCommand = "csh ";
04922       CnaExecCleanJobreportCommand.Append(t_cnacleanjobreportcommand);
04923 
04924       Int_t i_exec_cleanjobreport = gSystem->Exec(CnaExecCleanJobreportCommand.Data());
04925 
04926       if( i_exec_cleanjobreport != 0 )
04927         {
04928           cout << "*TEcnaGui> Script for LSFJOB report clean was executed with error code = "
04929                << i_exec_cleanjobreport << "."  << endl
04930                << "          Command: " << CnaExecCleanJobreportCommand.Data() << endl
04931                << fTTBELL << endl;
04932         }
04933       else
04934         {
04935           cout << "*TEcnaGui> Script for LSFJOB report clean"
04936                << " was successfully executed." << endl
04937                << "          (Command: " << CnaExecCleanJobreportCommand.Data() << ")" << endl;   
04938         }
04939     }
04940 
04941   //==================================== CLEAN PYTHON FILES =====================================
04942   if( clean_code == "Pyth" || clean_code == "All")
04943     {
04944       //.......................... get the path "modules/data"
04945       // /afs/cern.ch/user/U/USERNAME/cmssw/CMSSW_X_Y_Z/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/data/
04946       TString ModulesdataPath = fCnaParPaths->PathModulesData();
04947 
04948       //----------------------------------------- python file clean script: command text
04949       //......................................... python file clean script: script name
04950       TString CnaCleanPythonCommand = ModulesdataPath;
04951       TString CleanPythonScriptName = "EcnaSystemScriptCleanPythonFiles";
04952       const Text_t *t_CleanPythonScriptName = (const Text_t *)CleanPythonScriptName.Data();
04953       CnaCleanPythonCommand.Append(t_CleanPythonScriptName);
04954 
04955       //......................................... arguments -> modules:data path
04956       CnaCleanPythonCommand.Append(' ');
04957       const Text_t *t_modules_data_path = (const Text_t *)ModulesdataPath.Data();
04958       CnaCleanPythonCommand.Append(t_modules_data_path);
04959 
04960       //----------------------------------------- Exec CleanPython Command (csh before command text)
04961       const Text_t *t_cnacleanpythoncommand = (const Text_t *)CnaCleanPythonCommand.Data();
04962       TString CnaExecCleanPythonCommand = "csh ";
04963       CnaExecCleanPythonCommand.Append(t_cnacleanpythoncommand);
04964 
04965       Int_t i_exec_cleanpython = gSystem->Exec(CnaExecCleanPythonCommand.Data());
04966 
04967       if( i_exec_cleanpython != 0 )
04968         {
04969           cout << "*TEcnaGui> Script for python file clean was executed with error code = "
04970                << i_exec_cleanpython << "."  << endl
04971                << "          Command: " << CnaExecCleanPythonCommand.Data() << endl
04972                << fTTBELL << endl;
04973         }
04974       else
04975         {
04976           cout << "*TEcnaGui> Script for python file clean"
04977                << " was successfully executed." << endl
04978                << "          (Command: " << CnaExecCleanPythonCommand.Data() << ")" << endl;      
04979         }
04980     }
04981 }
04982 //------------------------------------------- end of CleanBatchFiles() -----------------------
04983 
04984 //==========================================================================
04985 //
04986 //             Calculations()   M E T H O D 
04987 //
04988 //==========================================================================
04989 void TEcnaGui::Calculations(const TString& calc_code)
04990 {
04991   //Calculations of quantities (Pedestals, correlations, ... )
04992 
04993   fCnaCommand++;
04994   cout << "   *TEcnaGui [" << fCnaCommand
04995        << "]> Calculations requested with code: " << calc_code
04996        << endl;
04997 
04998   //===== Check if Analysis name is right 
04999   if( fKeyAnaType == "AdcPed1"  || fKeyAnaType == "AdcSPed1"  ||   
05000       fKeyAnaType == "AdcPed6"  || fKeyAnaType == "AdcSPed6"  || 
05001       fKeyAnaType == "AdcPed12" || fKeyAnaType == "AdcSPed12" || 
05002       fKeyAnaType == "AdcPeg12" || fKeyAnaType == "AdcSPeg12" ||
05003       fKeyAnaType == "AdcLaser" || fKeyAnaType == "AdcSLaser" || 
05004       fKeyAnaType == "AdcPes12" || fKeyAnaType == "AdcSPes12" || 
05005       fKeyAnaType == "AdcPhys"  || fKeyAnaType == "AdcAny" )
05006     {
05007       //------------ Check if Std or (Scc or Stt)-Confirmed
05008       if( calc_code == "Std" || ( ( calc_code == "Scc" || calc_code == "Stt" ) && fConfirmCalcScc == 1 ) )
05009         {
05010           if( fKeyNbOfSamples >= fKeyNbOfSampForCalc )
05011             {
05012               Int_t nStexMin = fKeyStexNumber;
05013               Int_t nStexMax = fKeyStexNumber;
05014               if( fKeyStexNumber == 0 ){nStexMin = 1; nStexMax = fEcal->MaxStexInStas();}
05015 
05016               for( Int_t nStex = nStexMin; nStex<= nStexMax; nStex++)
05017                 {
05018                   Int_t n_samp_fic = fKeyNbOfSamples;
05019 
05020                   //....................... READ the "ADC" (AdcPed.., AdcLaser..., ...) file
05021                   TEcnaRun* MyRun = 0; 
05022                   if ( MyRun == 0 ){MyRun = new TEcnaRun(fObjectManager, fSubDet.Data(), n_samp_fic);  fCnew++;}
05023 
05024                   MyRun->GetReadyToReadData(fKeyAnaType.Data(),    fKeyRunNumber,
05025                                             fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, nStex);
05026 
05027                   if( MyRun->ReadSampleAdcValues(fKeyNbOfSampForCalc) == kTRUE )
05028                     {
05029                       cout << "*TEcnaGui::Calculations> File "
05030                            << MyRun->GetRootFileNameShort() << " found. Starting calculations."
05031                            << endl;
05032 
05033                       MyRun->GetReadyToCompute();
05034 
05035                       //............... Calculations
05036                       if( calc_code == "Std" ||
05037                           ( (calc_code == "Scc" || calc_code == "Stt") && fConfirmCalcScc == 1 ) )
05038                         {
05039                           //-------------- Standard calculations: pedestals, noises, correlations between samples
05040                           MyRun->StandardCalculations();
05041                         }
05042                       if( (calc_code == "Scc" || calc_code == "Stt") && fConfirmCalcScc == 1 )
05043                         {
05044                           if( calc_code == "Scc" )
05045                             {
05046                               //------ Additional calculations:
05047                               //       "correlations" between Xtals and Stins (long time, big file)
05048                               cout << "*TEcnaGui::Calculations> Please, wait." << endl;
05049                           
05050                               MyRun->Expert1Calculations();    //   (long time, big file)
05051                               // <=> MyRun->LowFrequencyCorrelationsBetweenChannels();     //   (big file)
05052                               //     MyRun->HighFrequencyCorrelationsBetweenChannels();    //   (big file) 
05053                           
05054                               MyRun->Expert2Calculations();    //   (fast because expert1 has been called)
05055                               // <=> MyRun->LowFrequencyMeanCorrelationsBetweenStins();
05056                               //     MyRun->HighFrequencyMeanCorrelationsBetweenStins();
05057                             }
05058                       
05059                           if( calc_code == "Stt" )
05060                             {
05061                               //---Additional calculations:
05062                               //   "correlations" between Stins (long time, "normal" size file)
05063                               cout << "*TEcnaGui::Calculations> Please, wait." << endl;
05064 
05065                               MyRun->Expert2Calculations();    //  (long time but not big file)
05066 
05067                               // Explanation/example: if MyRun->LowFrequencyCorrelationsBetweenChannels() (expert1)
05068                               // has not been called by the user, it is automatically called by
05069                               // MyRun->LowFrequencyMeanCorrelationsBetweenStins()
05070                               // but the corresponding file is not written (idem for "HighFrequency")
05071                             }
05072                         }
05073                       //.......................... WRITE results in file 
05074                       TString calc_file_name = "?";
05075                       if( calc_code == "Std" )
05076                         {
05077                           if( fKeyAnaType == "AdcPed1"   ){calc_file_name = "StdPed1";}
05078                           if( fKeyAnaType == "AdcPed6"   ){calc_file_name = "StdPed6";}
05079                           if( fKeyAnaType == "AdcPed12"  ){calc_file_name = "StdPed12";}
05080                           if( fKeyAnaType == "AdcPeg12"  ){calc_file_name = "StdPeg12";}
05081                           if( fKeyAnaType == "AdcLaser"  ){calc_file_name = "StdLaser";}
05082                           if( fKeyAnaType == "AdcPes12"  ){calc_file_name = "StdPes12";}
05083 
05084                           if( fKeyAnaType == "AdcSPed1"  ){calc_file_name = "StdSPed1";}
05085                           if( fKeyAnaType == "AdcSPed6"  ){calc_file_name = "StdSPed6";}
05086                           if( fKeyAnaType == "AdcSPed12" ){calc_file_name = "StdSPed12";}
05087                           if( fKeyAnaType == "AdcSPeg12" ){calc_file_name = "StdSPeg12";}
05088                           if( fKeyAnaType == "AdcSLaser" ){calc_file_name = "StdSLaser";}
05089                           if( fKeyAnaType == "AdcSPes12" ){calc_file_name = "StdSPes12";}
05090 
05091                           if( fKeyAnaType == "AdcPhys"   ){calc_file_name = "StdPhys";}
05092                           if( fKeyAnaType == "AdcAny"    ){calc_file_name = "StdAny";}
05093 
05094                         }
05095                       if( calc_code == "Scc" )
05096                         {
05097                           if( fKeyAnaType == "AdcPed1"   ){calc_file_name = "SccPed1";}
05098                           if( fKeyAnaType == "AdcPed6"   ){calc_file_name = "SccPed6";}
05099                           if( fKeyAnaType == "AdcPed12"  ){calc_file_name = "SccPed12";}
05100                           if( fKeyAnaType == "AdcPeg12"  ){calc_file_name = "SccPeg12";}
05101                           if( fKeyAnaType == "AdcLaser"  ){calc_file_name = "SccLaser";}
05102                           if( fKeyAnaType == "AdcPes12"  ){calc_file_name = "SccPes12" ;}
05103 
05104                           if( fKeyAnaType == "AdcSPed1"  ){calc_file_name = "SccSPed1";}
05105                           if( fKeyAnaType == "AdcSPed6"  ){calc_file_name = "SccSPed6";}
05106                           if( fKeyAnaType == "AdcSPed12" ){calc_file_name = "SccSPed12";}
05107                           if( fKeyAnaType == "AdcSPeg12" ){calc_file_name = "SccSPeg12";}
05108                           if( fKeyAnaType == "AdcSLaser" ){calc_file_name = "SccSLaser";}
05109                           if( fKeyAnaType == "AdcSPes12" ){calc_file_name = "SccSPes12";}
05110 
05111                           if( fKeyAnaType == "AdcPhys"   ){calc_file_name = "SccPhys";}
05112                           if( fKeyAnaType == "AdcAny"    ){calc_file_name = "SccAny";}
05113                         }
05114 
05115                       if( calc_code == "Stt" )
05116                         {
05117                           if( fKeyAnaType == "AdcPed1"   ){calc_file_name = "SttPed1";}
05118                           if( fKeyAnaType == "AdcPed6"   ){calc_file_name = "SttPed6";}
05119                           if( fKeyAnaType == "AdcPed12"  ){calc_file_name = "SttPed12";}
05120                           if( fKeyAnaType == "AdcPeg12"  ){calc_file_name = "SttPeg12";}
05121                           if( fKeyAnaType == "AdcLaser"  ){calc_file_name = "SttLaser";}
05122                           if( fKeyAnaType == "AdcPes12"  ){calc_file_name = "SttPes12" ;}
05123 
05124                           if( fKeyAnaType == "AdcSPed1"  ){calc_file_name = "SttSPed1";}
05125                           if( fKeyAnaType == "AdcSPed6"  ){calc_file_name = "SttSPed6";}
05126                           if( fKeyAnaType == "AdcSPed12" ){calc_file_name = "SttSPed12";}
05127                           if( fKeyAnaType == "AdcSPeg12" ){calc_file_name = "SttSPeg12";}
05128                           if( fKeyAnaType == "AdcSLaser" ){calc_file_name = "SttSLaser";}
05129                           if( fKeyAnaType == "AdcSPes12" ){calc_file_name = "SttSPes12";}
05130 
05131                           if( fKeyAnaType == "AdcPhys"   ){calc_file_name = "SttPhys";}
05132                           if( fKeyAnaType == "AdcAny"    ){calc_file_name = "SttAny";}
05133                         }
05134 
05135                       if( MyRun->WriteNewRootFile(calc_file_name.Data()) == kTRUE )
05136                         {
05137                           cout << "*TEcnaGui::Calculations> Done. Write ROOT file: "
05138                                << MyRun->GetNewRootFileNameShort() << " OK" << endl << endl;
05139                         }
05140                       else 
05141                         {
05142                           cout << "!TEcnaGui::Calculations> Writing ROOT file failure for file "
05143                                << MyRun->GetNewRootFileNameShort()
05144                                << fTTBELL << endl << endl;
05145                         }
05146                     }
05147                   else
05148                     {
05149                       cout << "!TEcnaGui::Calculations> " << MyRun->GetRootFileNameShort() << ": file not found."
05150                            << fTTBELL << endl << endl;
05151                     }
05152                   //.......................................................................
05153                   delete MyRun; MyRun = 0;                    fCdelete++;
05154                 } // end of for( Int_t nStex = nStexMin; nStex<= nStexMax; nStex++)
05155               fConfirmCalcScc = 0;
05156             } // end of if( fKeyNbOfSamples >= fKeyNbOfSampForCalc )
05157           else
05158             {
05159               cout << "!TEcnaGui::Calculations> *** ERROR *** Number of samples in file (=" << fKeyNbOfSamples
05160                    << ") less than number of samples for calculations (= " << fKeyNbOfSampForCalc << "). " << endl;
05161             }
05162         } // end of if( calc_code == "Std" || ( ( calc_code == "Scc" || calc_code == "Stt" ) && fConfirmCalcScc == 1 ) )
05163       else
05164         {
05165           cout << "   *TEcnaGui [" << fCnaCommand
05166                << "]> Calculation requested with option " << calc_code
05167                << ". This can last more than 5 minutes. Please, click again to confirm."
05168                << fTTBELL << endl;
05169           fConfirmCalcScc = 1;
05170         }
05171     }
05172   else
05173     {
05174       cout << "!TEcnaGui::Calculations> fKeyAnaType = " << fKeyAnaType
05175            << "  : wrong code in analysis name." << endl
05176            << "                        List of available standard analysis names for calculations: " << endl
05177            << "                        AdcPed1,  AdcPed6,  AdcPed12,  AdcPeg12,  AdcLaser,  AdcPes12," << endl
05178            << "                        AdcSPed1, AdcSPed6, AdcSPed12, AdcSPeg12, AdcSLaser, AdcSPes12," << endl
05179            << "                        AdcPhys,  AdcAny (all names must begin with 'Adc')."
05180            << fTTBELL << endl; 
05181     }
05182 }
05183 //==========================================================================
05184 //
05185 //                       "View"    M E T H O D S
05186 //
05187 //==========================================================================
05188 //---------- common messages
05189 
05190 void TEcnaGui::MessageCnaCommandReplyA(const TString& first_same_plot)
05191 {
05192   // reply message of the Cna command
05193 
05194   cout << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
05195        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber
05196        << ", last req. evt#: " << fKeyLastReqEvtNumber << endl;
05197   
05198   if( first_same_plot == "ASCII" )
05199     {
05200       cout  << "                   " << fStexName.Data() << ": " << fKeyStexNumber
05201             << ", option: " << first_same_plot << endl;
05202     }
05203 }
05204 
05205 void TEcnaGui::MessageCnaCommandReplyB(const TString& first_same_plot)
05206 {
05207   // reply message of the Cna command
05208 
05209   if( first_same_plot == "ASCII" )
05210     {
05211       if(fKeyStexNumber > 0)
05212         {
05213           if( fHistos->StatusFileFound() == kTRUE && fHistos->StatusDataExist() == kTRUE )
05214             {
05215               TString xAsciiFileName = fHistos->AsciiFileName();
05216               if( xAsciiFileName != "?" )
05217                 {cout  << "               Histo written in ASCII file: " << xAsciiFileName.Data();}
05218             }
05219         }
05220       else
05221         {
05222           cout  << "               No writing in ASCII file since "
05223                 << fStexName.Data() << " number = " << fKeyStexNumber;
05224         }
05225       cout << endl;
05226     }
05227 }
05228 
05229 //==========================================================================
05230 //
05231 //                  View  Matrix
05232 //
05233 //==========================================================================
05234 //---------------------------- Cortt
05235 void TEcnaGui::ViewMatrixLowFrequencyMeanCorrelationsBetweenStins(const TString& option_plot)
05236 {
05237   // Plot of Low Frequency Mean Cor(c,c') for each pair of Stins
05238 
05239   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05240   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05241                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05242 
05243   fCnaCommand++;
05244   cout << "   *TEcnaGui [" << fCnaCommand
05245        << "]> Low Frequency Mean Cor(c,c') for each pair of " << fStinName.Data()
05246        << "s. Option: "
05247        << option_plot;
05248   MessageCnaCommandReplyA(option_plot);
05249 
05250   fHistos->SetHistoMin(fKeyVminLFccMos);
05251   fHistos->SetHistoMax(fKeyVmaxLFccMos);
05252   fHistos->GeneralTitle(fKeyGeneralTitle);
05253   fHistos->PlotMatrix("Cor", "MttLF", option_plot);
05254 
05255   MessageCnaCommandReplyB(option_plot);
05256 }
05257 void TEcnaGui::ViewMatrixHighFrequencyMeanCorrelationsBetweenStins(const TString& option_plot)
05258 {
05259   // Plot of Low Frequency Mean Cor(c,c') for each pair of Stins
05260 
05261   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05262   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05263                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05264 
05265   fCnaCommand++;
05266   cout << "   *TEcnaGui [" << fCnaCommand
05267        << "]> High Frequency Mean Cor(c,c') for each pair of " << fStinName.Data()
05268        << "s. Option: "
05269        << option_plot;
05270   MessageCnaCommandReplyA(option_plot);
05271 
05272   fHistos->SetHistoMin(fKeyVminHFccMos);
05273   fHistos->SetHistoMax(fKeyVmaxHFccMos);
05274   fHistos->GeneralTitle(fKeyGeneralTitle); 
05275   fHistos->PlotMatrix("Cor", "MttHF", option_plot);
05276 
05277   MessageCnaCommandReplyB(option_plot);
05278 }
05279 //---------------------------------------------- Corcc
05280 void TEcnaGui::ViewMatrixLowFrequencyCorrelationsBetweenChannels(const Int_t&  cStexStin_A,
05281                                                                  const Int_t&  cStexStin_B,
05282                                                                  const TString& option_plot)
05283 {
05284   // Low Frequency Correlation matrix (crystal of Stin X, crystal of Stin X) for each Stin
05285 
05286   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05287   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05288                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05289   
05290   fCnaCommand++;
05291   cout << "   *TEcnaGui [" << fCnaCommand
05292        << "]> Low Frequency Correlation matrix between channels. "
05293        << fStinName.Data() << " A: " << cStexStin_A
05294        << ", " << fStinName.Data() << " B: " << cStexStin_B
05295        << ", option: " << option_plot;
05296   MessageCnaCommandReplyA(option_plot);
05297 
05298   fHistos->SetHistoMin(fKeyVminLHFcc);
05299   fHistos->SetHistoMax(fKeyVmaxLHFcc); 
05300   fHistos->GeneralTitle(fKeyGeneralTitle);
05301   fHistos->PlotMatrix("Cor", "MccLF", cStexStin_A, cStexStin_B, option_plot);
05302   MessageCnaCommandReplyB(option_plot);
05303 }
05304 
05305 void TEcnaGui::ViewMatrixHighFrequencyCorrelationsBetweenChannels(const Int_t&  cStexStin_A, const Int_t& cStexStin_B,
05306                                                                   const TString& option_plot)
05307 {
05308 // High Frequency Correlation matrix (crystal of Stin X, crystal of Stin X) for each Stin
05309 
05310   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05311   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05312                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05313   
05314   fCnaCommand++;
05315   cout << "   *TEcnaGui [" << fCnaCommand
05316        << "]> High Frequency Correlation matrix between channels. "
05317        << fStinName.Data() << " A: " << cStexStin_A
05318        << ", " << fStinName.Data() << " B: " << cStexStin_B
05319        << ", option: " << option_plot;
05320   MessageCnaCommandReplyA(option_plot);
05321 
05322   fHistos->SetHistoMin(fKeyVminLHFcc);
05323   fHistos->SetHistoMax(fKeyVmaxLHFcc); 
05324   fHistos->GeneralTitle(fKeyGeneralTitle);
05325   fHistos->PlotMatrix("Cor", "MccHF", cStexStin_A, cStexStin_B, option_plot);
05326   
05327   MessageCnaCommandReplyB(option_plot);
05328 }
05329 
05330 void TEcnaGui::ViewStexLowFrequencyCorcc()
05331 {
05332   //===> big matrix
05333 
05334   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05335   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05336                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05337 
05338   fCnaCommand++;
05339   cout << "   *TEcnaGui [" << fCnaCommand
05340        << "]> LF Correlations between channels for each " << fStinName.Data()
05341        << " in " << fStexName.Data() << ". 2D histo. "
05342        << fStexName.Data() << ": " << fKeyStexNumber;
05343   MessageCnaCommandReplyA("DUMMY");
05344 
05345   fHistos->SetHistoMin(fKeyVminLHFcc);
05346   fHistos->SetHistoMax(fKeyVmaxLHFcc);
05347   fHistos->GeneralTitle(fKeyGeneralTitle);
05348   fHistos->PlotMatrix("Cor", "MccLF", "COLZ");
05349 
05350   MessageCnaCommandReplyB("DUMMY");
05351 }
05352 
05353 void TEcnaGui::ViewStexHighFrequencyCorcc()
05354 {
05355   //===> big matrix
05356 
05357   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05358   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05359                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05360 
05361   fCnaCommand++;
05362   cout << "   *TEcnaGui [" << fCnaCommand
05363        << "]> HF Correlations between channels for each " << fStinName.Data()
05364        << " in " << fStexName.Data() << ". 2D histo. "
05365        << fStexName.Data() << ": " << fKeyStexNumber;
05366   MessageCnaCommandReplyA("DUMMY");
05367 
05368   fHistos->SetHistoMin(fKeyVminLHFcc);
05369   fHistos->SetHistoMax(fKeyVmaxLHFcc);
05370   fHistos->GeneralTitle(fKeyGeneralTitle);
05371   fHistos->PlotMatrix("Cor", "MccHF", "COLZ");
05372 
05373   MessageCnaCommandReplyB("DUMMY");
05374 }
05375 
05376 //---------------------------- Corss, Covss
05377 void TEcnaGui::ViewMatrixCorrelationSamples(const Int_t&  cStexStin_A, const Int_t& i0StinEcha,
05378                                            const TString& option_plot)
05379 {
05380 // Plot of correlation matrix between samples for a given channel
05381 
05382   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05383   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05384                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05385   
05386   Int_t ChOffset = 0;
05387   if(fSubDet == "EE"){ChOffset = 1;}
05388 
05389   fCnaCommand++;
05390   cout << "   *TEcnaGui [" << fCnaCommand
05391        << "]> Correlation matrix between samples. "
05392        << fStinName.Data() << ": " << cStexStin_A  << ", channel " << i0StinEcha + ChOffset
05393        << ", option: " << option_plot;
05394   MessageCnaCommandReplyA(option_plot);
05395 
05396   fHistos->GeneralTitle(fKeyGeneralTitle);
05397   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
05398   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
05399   fHistos->PlotMatrix("Cor", "Mss", cStexStin_A, i0StinEcha, option_plot);
05400 
05401 
05402   MessageCnaCommandReplyB(option_plot);
05403 }
05404 
05405 void TEcnaGui::ViewMatrixCovarianceSamples(const Int_t&  cStexStin_A, const Int_t& i0StinEcha,
05406                                           const TString& option_plot)
05407 {
05408 // Plot of covariance matrix between samples for a given channel
05409 
05410   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05411   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05412                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05413 
05414   Int_t ChOffset = 0;
05415   if(fSubDet == "EE"){ChOffset = 1;}
05416   
05417   fCnaCommand++;
05418   cout << "   *TEcnaGui [" << fCnaCommand
05419        << "]> Covariance matrix between samples. "
05420        << fStinName.Data() << ": " << cStexStin_A  << ", channel " << i0StinEcha + ChOffset
05421        << ", option: " << option_plot;
05422   MessageCnaCommandReplyA(option_plot);
05423 
05424   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);  // same as mean sample sigmas
05425   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb);
05426   fHistos->GeneralTitle(fKeyGeneralTitle);
05427   fHistos->PlotMatrix("Cov", "Mss", cStexStin_A, i0StinEcha, option_plot);
05428 
05429   MessageCnaCommandReplyB(option_plot);
05430 }
05431 
05432 //==========================================================================
05433 //
05434 //                         ViewStin...     
05435 //
05436 //     StexStin ==> (sample,sample) matrices for all the crystal of cStexStin              
05437 //
05438 //==========================================================================
05439 void TEcnaGui::ViewStinCorrelationSamples(const Int_t& cStexStin)
05440 {
05441   // Plot of (sample,sample) correlation matrices for all the crystal of a given Stin  
05442 
05443   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05444   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05445                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05446   
05447   fCnaCommand++;
05448   cout << "   *TEcnaGui [" << fCnaCommand
05449        << "]> Correlation matrices between samples for each channel of "
05450        << fStinName.Data() << " " << cStexStin;
05451   MessageCnaCommandReplyA("DUMMY"); 
05452 
05453   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
05454   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
05455   fHistos->GeneralTitle(fKeyGeneralTitle);  
05456   fHistos->CorrelationsBetweenSamples(cStexStin);
05457   
05458   MessageCnaCommandReplyB("DUMMY");
05459 }
05460 
05461 void TEcnaGui::ViewStinCovarianceSamples(const Int_t& cStexStin)
05462 {
05463   // Plot of (sample,sample) covariance matrices for all the crystal of a given Stin  
05464 
05465   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05466   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05467                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05468   
05469   fCnaCommand++;
05470   cout << "   *TEcnaGui [" << fCnaCommand
05471        << "]> Covariance matrices between samples for each channel of "
05472        << fStinName.Data() << " " << cStexStin;
05473   MessageCnaCommandReplyA("DUMMY");
05474 
05475   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);   // same as mean sample sigmas
05476   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb);
05477   fHistos->GeneralTitle(fKeyGeneralTitle);    
05478   fHistos->CovariancesBetweenSamples(cStexStin);
05479   
05480   MessageCnaCommandReplyB("DUMMY");
05481 }
05482 //==========================================================================
05483 //
05484 //                         ViewSorS (eta,phi)
05485 //
05486 //==========================================================================
05487 
05488 void TEcnaGui::ViewSorSNumberOfEvents()
05489 {
05490   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05491 
05492   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05493     {
05494       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05495                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05496       fCnaCommand++;
05497       cout << "   *TEcnaGui [" << fCnaCommand
05498            << "]> Number of Events. 2D histo. "
05499            << fStexName.Data() << ": " << fKeyStexNumber;
05500     }
05501   if( fKeyStexNumber == 0 )
05502     {
05503       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05504                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05505       fCnaCommand++;
05506       cout << "   *TEcnaGui [" << fCnaCommand
05507            << "]> Average Number of Events. 2D histo for "
05508            << fSubDet.Data();
05509     }
05510 
05511   MessageCnaCommandReplyA("DUMMY");
05512 
05513   fHistos->SetHistoMin(fKeyVminD_NOE_ChNb);
05514   fHistos->SetHistoMax(fKeyVmaxD_NOE_ChNb); 
05515   fHistos->GeneralTitle(fKeyGeneralTitle);    
05516   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05517     {fHistos->PlotDetector("NOE", "SM");}
05518   if( fKeyStexNumber == 0 )
05519     {fHistos->PlotDetector("NOE", "EB");}
05520 
05521   MessageCnaCommandReplyB("DUMMY");
05522 }
05523 
05524 void TEcnaGui::ViewSorSPedestals()
05525 {
05526   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05527 
05528   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05529     {
05530       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05531                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05532       fCnaCommand++;
05533       cout << "   *TEcnaGui [" << fCnaCommand
05534            << "]> Pedestals. 2D histo. "
05535            << fStexName.Data() << ": " << fKeyStexNumber;
05536     }
05537   if( fKeyStexNumber == 0 )
05538     {
05539       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05540                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05541       fCnaCommand++;
05542       cout << "   *TEcnaGui [" << fCnaCommand
05543            << "]> Pedestals. 2D histo for "
05544            << fSubDet.Data();
05545     }
05546   MessageCnaCommandReplyA("DUMMY");
05547 
05548   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
05549   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb); 
05550   fHistos->GeneralTitle(fKeyGeneralTitle);
05551      
05552   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05553     {fHistos->PlotDetector("Ped", "SM");}
05554   if( fKeyStexNumber == 0 )
05555     {fHistos->PlotDetector("Ped", "EB");}
05556 
05557   MessageCnaCommandReplyB("DUMMY");
05558 }
05559 
05560 void TEcnaGui::ViewSorSTotalNoise()
05561 {
05562   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05563 
05564   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05565     {
05566       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05567                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05568       fCnaCommand++;
05569       cout << "   *TEcnaGui [" << fCnaCommand
05570            << "]> Total noise. 2D histo. "
05571            << fStexName.Data() << ": " << fKeyStexNumber;
05572     }
05573   if( fKeyStexNumber == 0 )
05574     {
05575       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05576                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05577       fCnaCommand++;
05578       cout << "   *TEcnaGui [" << fCnaCommand
05579            << "]> Average total noise. 2D histo for "
05580            << fSubDet.Data();
05581     }
05582   MessageCnaCommandReplyA("DUMMY");
05583 
05584   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
05585   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
05586   fHistos->GeneralTitle(fKeyGeneralTitle);      
05587   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05588     {fHistos->PlotDetector("TNo", "SM");}
05589   if( fKeyStexNumber == 0 )
05590     {fHistos->PlotDetector("TNo", "EB");}
05591   
05592   MessageCnaCommandReplyB("DUMMY");
05593 }
05594 
05595 
05596 void TEcnaGui::ViewSorSLowFrequencyNoise()
05597 {
05598   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05599 
05600   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05601     {
05602       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05603                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05604       fCnaCommand++;
05605       cout << "   *TEcnaGui [" << fCnaCommand
05606            << "]> Low frequency noise. 2D histo. "
05607            << fStexName.Data() << ": " << fKeyStexNumber;
05608     }
05609   if( fKeyStexNumber == 0 )
05610     {
05611       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05612                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05613       fCnaCommand++;
05614       cout << "   *TEcnaGui [" << fCnaCommand
05615            << "]> Average low frequency noise. 2D histo for "
05616            << fSubDet.Data();
05617     }
05618   MessageCnaCommandReplyA("DUMMY");
05619 
05620   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
05621   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb);
05622   fHistos->GeneralTitle(fKeyGeneralTitle);     
05623   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05624     {fHistos->PlotDetector("LFN", "SM");}
05625   if( fKeyStexNumber == 0 )
05626     {fHistos->PlotDetector("LFN", "EB");}
05627   
05628   MessageCnaCommandReplyB("DUMMY");
05629 }
05630 
05631 void TEcnaGui::ViewSorSHighFrequencyNoise()
05632 {
05633   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05634 
05635   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05636     {
05637       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05638                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05639       fCnaCommand++;
05640       cout << "   *TEcnaGui [" << fCnaCommand
05641            << "]> High frequency noise. 2D histo. "
05642            << fStexName.Data() << ": " << fKeyStexNumber;
05643     }
05644   if( fKeyStexNumber == 0 )
05645     {
05646       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05647                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05648       fCnaCommand++;
05649       cout << "   *TEcnaGui [" << fCnaCommand
05650            << "]> Average high frequency noise. 2D histo for "
05651            << fSubDet.Data();
05652     }
05653   MessageCnaCommandReplyA("DUMMY");
05654 
05655   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
05656   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb); 
05657   fHistos->GeneralTitle(fKeyGeneralTitle);       
05658   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05659     {
05660       fHistos->PlotDetector("HFN", "SM");
05661     }
05662   if( fKeyStexNumber == 0 )
05663     {
05664       fHistos->PlotDetector("HFN", "EB");
05665     }
05666   
05667   MessageCnaCommandReplyB("DUMMY");
05668 }
05669 
05670 void TEcnaGui::ViewSorSMeanCorss()
05671 {
05672   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05673 
05674   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05675     {
05676       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05677                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05678       fCnaCommand++;
05679       cout << "   *TEcnaGui [" << fCnaCommand
05680            << "]> Mean cor(s,s'). 2D histo. "
05681            << fStexName.Data() << ": " << fKeyStexNumber;
05682     }
05683   if( fKeyStexNumber == 0 )
05684     {
05685       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05686                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05687       fCnaCommand++;
05688       cout << "   *TEcnaGui [" << fCnaCommand
05689            << "]> Average mean cor(s,s'). 2D histo for "
05690            << fSubDet.Data();
05691     }
05692   MessageCnaCommandReplyA("DUMMY");
05693 
05694   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
05695   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
05696   fHistos->GeneralTitle(fKeyGeneralTitle);     
05697   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05698     {
05699       fHistos->PlotDetector("MCs", "SM");
05700     }
05701   if( fKeyStexNumber == 0 )
05702     {
05703       fHistos->PlotDetector("MCs", "EB");
05704     }
05705   
05706   MessageCnaCommandReplyB("DUMMY");
05707 }
05708 
05709 void TEcnaGui::ViewSorSSigmaOfCorss()
05710 {
05711   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05712 
05713   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05714     {
05715       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05716                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);      
05717       fCnaCommand++;
05718       cout << "   *TEcnaGui [" << fCnaCommand
05719            << "]> Sigma of Cor(s,s'). 2D histo. "
05720            << fStexName.Data() << ": " << fKeyStexNumber;
05721     }
05722   if( fKeyStexNumber == 0 )
05723     {
05724       fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05725                               fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, 0);
05726       fCnaCommand++;
05727       cout << "   *TEcnaGui [" << fCnaCommand
05728            << "]> Average sigma of Cor(s,s'). 2D histo for "
05729            << fSubDet.Data();
05730     }
05731   MessageCnaCommandReplyA("DUMMY");
05732 
05733   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
05734   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
05735   fHistos->GeneralTitle(fKeyGeneralTitle);
05736   if( fKeyStexNumber > 0 && fKeyStexNumber <= fEcal->MaxStexInStas() )
05737     {
05738       fHistos->PlotDetector("SCs", "SM");
05739     }
05740   if( fKeyStexNumber == 0 )
05741     {
05742       fHistos->PlotDetector("SCs", "EB");
05743     }
05744 
05745   MessageCnaCommandReplyB("DUMMY");
05746 }
05747 
05748 //=======================================================================================
05749 //
05750 //                        ViewStinCrystalNumbering
05751 //
05752 //=======================================================================================  
05753 void TEcnaGui::ViewStinCrystalNumbering(const Int_t& StexStinEcna)
05754 {
05755   // Plot the crystal numbering of one Stin
05756 
05757   Int_t StinNumber = -1;
05758   if( fSubDet == "EB" ){StinNumber = StexStinEcna;}
05759   if( fSubDet == "EE"  && fKeyStexNumber != 0 )
05760     {StinNumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fKeyStexNumber,StexStinEcna);}
05761 
05762   fCnaCommand++;
05763   cout << "   *TEcnaGui [" << fCnaCommand
05764        << "]> Crystal numbering for " << " " << fStexName.Data() << " "
05765        << fKeyStexNumber << ", " << fStinName.Data() << " " << StinNumber << endl;
05766 
05767   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;} 
05768   fHistos->GeneralTitle(fKeyGeneralTitle);
05769   fHistos->StinCrystalNumbering(fKeyStexNumber, StinNumber);
05770 }
05771 //---------------->  end of ViewStinCrystalNumbering()
05772 
05773 //===========================================================================
05774 //
05775 //                        ViewStexStinNumbering
05776 //
05777 //===========================================================================  
05778 void TEcnaGui::ViewStexStinNumbering()
05779 {
05780   // Plot the Stin numbering of one Stex.
05781   // No argument here since the Stex number is a part of the ROOT file name
05782   // and is in the entry field of the Stex button (fKeyStexNumber)
05783 
05784   fCnaCommand++;
05785   cout << "   *TEcnaGui [" << fCnaCommand
05786        << "]> " << fStinName.Data() << " numbering for " << fStexName.Data()
05787        << " " << fKeyStexNumber << endl;
05788 
05789   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05790   fHistos->GeneralTitle(fKeyGeneralTitle);
05791   fHistos->StexStinNumbering(fKeyStexNumber);
05792 }
05793 //---------------->  end of ViewStexStinNumbering()
05794 
05795 //===============================================================================
05796 //
05797 //                         ViewHisto...
05798 //
05799 //===============================================================================
05800 //......................... Nb of evts
05801 void TEcnaGui::ViewHistoSorSNumberOfEventsOfCrystals(const TString& first_same_plot)
05802 {
05803 // Plot the 1D histogram of the number of events (found in the data)
05804 // as a function of crystals (grouped by Stins)
05805 
05806   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05807   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05808                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05809 
05810   fCnaCommand++;
05811   cout << "   *TEcnaGui [" << fCnaCommand
05812        << "]> Number of events for crystals";
05813   MessageCnaCommandReplyA(first_same_plot);
05814 
05815   fHistos->SetHistoMin(fKeyVminD_NOE_ChNb);
05816   fHistos->SetHistoMax(fKeyVmaxD_NOE_ChNb);
05817   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
05818   fHistos->SetHistoColorPalette(fKeyColPal);
05819   fHistos->GeneralTitle(fKeyGeneralTitle);
05820   fHistos->Plot1DHisto("Xtal", "NOE", "SM", first_same_plot);  // "SM" not active since fFapStexNumber is defined "outside"
05821 
05822   MessageCnaCommandReplyB(first_same_plot);
05823 }
05824 
05825 void TEcnaGui::ViewHistoSorSNumberOfEventsDistribution(const TString& first_same_plot)
05826 {
05827 // Plot the 1D histogram of the number of events distribution for a Stex
05828 
05829   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05830   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05831                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05832 
05833   fCnaCommand++;
05834   cout << "   *TEcnaGui [" << fCnaCommand
05835        << "]> Number of events distribution";
05836   MessageCnaCommandReplyA(first_same_plot);
05837 
05838   fHistos->SetHistoMin(fKeyVminD_NOE_ChNb);
05839   fHistos->SetHistoMax(fKeyVmaxD_NOE_ChNb); 
05840   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
05841   fHistos->SetHistoColorPalette(fKeyColPal);
05842   fHistos->GeneralTitle(fKeyGeneralTitle);
05843   fHistos->Plot1DHisto("NOE", "NOX", "SM", first_same_plot);
05844 
05845   MessageCnaCommandReplyB(first_same_plot);
05846 }
05847 
05848 //........................... Pedestals
05849 void TEcnaGui::ViewHistoSorSPedestalsOfCrystals(const TString& first_same_plot)
05850 {
05851 // Plot the 1D histogram of the pedestals as a function of crystals (grouped by Stins)
05852 
05853   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05854   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05855                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05856 
05857   fCnaCommand++;
05858   cout << "   *TEcnaGui [" << fCnaCommand
05859        << "]> Pedestals";
05860   MessageCnaCommandReplyA(first_same_plot);
05861 
05862   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
05863   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
05864   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05865   fHistos->SetHistoColorPalette(fKeyColPal);
05866   fHistos->GeneralTitle(fKeyGeneralTitle);
05867   fHistos->Plot1DHisto("Xtal", "Ped", "SM", first_same_plot);
05868 
05869   MessageCnaCommandReplyB(first_same_plot);
05870 }
05871 
05872 void TEcnaGui::ViewHistoSorSPedestalsDistribution(const TString& first_same_plot)
05873 {
05874 // Plot the 1D histogram of the pedestals distribution for a Stex
05875 
05876   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05877   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05878                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05879 
05880   fCnaCommand++;
05881   cout << "   *TEcnaGui [" << fCnaCommand
05882        << "]> Pedestals distribution";
05883   MessageCnaCommandReplyA(first_same_plot);
05884 
05885   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
05886   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
05887   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05888   fHistos->SetHistoColorPalette(fKeyColPal);
05889   fHistos->GeneralTitle(fKeyGeneralTitle);
05890   fHistos->Plot1DHisto("Ped", "NOX", "SM", first_same_plot);
05891 
05892   MessageCnaCommandReplyB(first_same_plot);
05893 }
05894 
05895 //............................... Total noise
05896 void TEcnaGui::ViewHistoSorSTotalNoiseOfCrystals(const TString& first_same_plot)
05897 {
05898 // Plot the 1D histogram of the mean sample sigmas as a function of crystals (grouped by Stins)
05899 
05900   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05901   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05902                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
05903 
05904   fCnaCommand++;
05905   cout << "   *TEcnaGui [" << fCnaCommand
05906        << "]> Total noise";
05907   MessageCnaCommandReplyA(first_same_plot);
05908 
05909   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
05910   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb);
05911   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05912   fHistos->SetHistoColorPalette(fKeyColPal);
05913   fHistos->GeneralTitle(fKeyGeneralTitle);
05914   fHistos->Plot1DHisto("Xtal", "TNo", "SM", first_same_plot);
05915 
05916   MessageCnaCommandReplyB(first_same_plot);
05917 }
05918 
05919 void TEcnaGui::ViewHistoSorSTotalNoiseDistribution(const TString& first_same_plot)
05920 {
05921 // Plot the 1D histogram of the mean sample sigmas distribution for a Stex
05922 
05923   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05924   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05925                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);  
05926 
05927   fCnaCommand++;
05928   cout << "   *TEcnaGui [" << fCnaCommand
05929        << "]> Total noise distribution";
05930   MessageCnaCommandReplyA(first_same_plot);
05931 
05932   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
05933   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb);  
05934   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05935   fHistos->SetHistoColorPalette(fKeyColPal);
05936   fHistos->GeneralTitle(fKeyGeneralTitle);
05937   fHistos->Plot1DHisto("TNo", "NOX", "SM", first_same_plot);
05938 
05939   MessageCnaCommandReplyB(first_same_plot);
05940 }
05941 
05942 
05943 //............................ Low frequency noise
05944 void TEcnaGui::ViewHistoSorSLowFrequencyNoiseOfCrystals(const TString& first_same_plot)
05945 {
05946 // Plot the 1D histogram of the pedestals as a function of crystals (grouped by Stins)
05947 
05948   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05949   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05950                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
05951 
05952   fCnaCommand++;
05953   cout << "   *TEcnaGui [" << fCnaCommand
05954        << "]> Low frequency noise";
05955   MessageCnaCommandReplyA(first_same_plot);
05956 
05957   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
05958   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb);
05959   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05960   fHistos->SetHistoColorPalette(fKeyColPal);
05961   fHistos->GeneralTitle(fKeyGeneralTitle);
05962   fHistos->Plot1DHisto("Xtal", "LFN", "SM", first_same_plot);
05963 
05964   MessageCnaCommandReplyB(first_same_plot);
05965 }
05966 
05967 void TEcnaGui::ViewHistoSorSLowFrequencyNoiseDistribution(const TString& first_same_plot)
05968 {
05969 // Plot the 1D histogram of the pedestals distribution for a Stex
05970 
05971   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05972   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05973                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
05974 
05975   fCnaCommand++;
05976   cout << "   *TEcnaGui [" << fCnaCommand
05977        << "]> Low frequency noise distribution";
05978   MessageCnaCommandReplyA(first_same_plot);
05979 
05980   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
05981   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb);
05982   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
05983   fHistos->SetHistoColorPalette(fKeyColPal);
05984   fHistos->GeneralTitle(fKeyGeneralTitle);
05985   fHistos->Plot1DHisto("LFN", "NOX", "SM", first_same_plot);
05986 
05987   MessageCnaCommandReplyB(first_same_plot);
05988 }
05989 
05990 //............................ High frequency noise
05991 void TEcnaGui::ViewHistoSorSHighFrequencyNoiseOfCrystals(const TString& first_same_plot)
05992 {
05993 // Plot the 1D histogram of the mean sample sigmas as a function of crystals (grouped by Stins)
05994 
05995   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
05996   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
05997                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
05998 
05999   fCnaCommand++;
06000   cout << "   *TEcnaGui [" << fCnaCommand
06001        << "]> High frequency noise";
06002   MessageCnaCommandReplyA(first_same_plot);
06003 
06004   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
06005   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb);
06006   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06007   fHistos->SetHistoColorPalette(fKeyColPal);
06008   fHistos->GeneralTitle(fKeyGeneralTitle);
06009   fHistos->Plot1DHisto("Xtal", "HFN", "SM", first_same_plot);
06010 
06011   MessageCnaCommandReplyB(first_same_plot);
06012 }
06013 
06014 void TEcnaGui::ViewHistoSorSHighFrequencyNoiseDistribution(const TString& first_same_plot)
06015 {
06016 // Plot the 1D histogram of the mean sample sigmas distribution for a Stex
06017 
06018   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06019   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06020                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06021 
06022   fCnaCommand++;
06023   cout << "   *TEcnaGui [" << fCnaCommand
06024        << "]> High frequency noise distribution";
06025   MessageCnaCommandReplyA(first_same_plot);
06026 
06027   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
06028   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb);  
06029   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06030   fHistos->SetHistoColorPalette(fKeyColPal);
06031   fHistos->GeneralTitle(fKeyGeneralTitle);
06032   fHistos->Plot1DHisto("HFN", "NOX", "SM", first_same_plot);
06033 
06034   MessageCnaCommandReplyB(first_same_plot);
06035 }
06036 
06037 //............................ Correlations between samples
06038 void TEcnaGui::ViewHistoSorSMeanCorssOfCrystals(const TString& first_same_plot)
06039 {
06040 // Plot the 1D histogram of the mean cor(s,s') as a function of crystals (grouped by Stins)
06041 
06042   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06043   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06044                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06045 
06046   fCnaCommand++;
06047   cout << "   *TEcnaGui [" << fCnaCommand
06048        << "]> Mean cor(s,s')";
06049   MessageCnaCommandReplyA(first_same_plot);
06050 
06051   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
06052   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
06053   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06054   fHistos->SetHistoColorPalette(fKeyColPal);
06055   fHistos->GeneralTitle(fKeyGeneralTitle);
06056   fHistos->Plot1DHisto("Xtal", "MCs", "SM", first_same_plot);
06057 
06058   MessageCnaCommandReplyB(first_same_plot);
06059 }
06060 
06061 void TEcnaGui::ViewHistoSorSMeanCorssDistribution(const TString& first_same_plot)
06062 {
06063 // Plot the 1D histogram of the mean cor(s,s') sigmas distribution for a Stex
06064 
06065   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06066   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06067                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06068 
06069   fCnaCommand++;
06070   cout << "   *TEcnaGui [" << fCnaCommand
06071        << "]> Mean cor(s,s') distribution";
06072   MessageCnaCommandReplyA(first_same_plot);
06073 
06074   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
06075   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
06076   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06077   fHistos->SetHistoColorPalette(fKeyColPal);
06078   fHistos->GeneralTitle(fKeyGeneralTitle);
06079   fHistos->Plot1DHisto("MCs", "NOX", "SM", first_same_plot);
06080 
06081   MessageCnaCommandReplyB(first_same_plot);
06082 }
06083 
06084 void TEcnaGui::ViewHistoSorSSigmaOfCorssOfCrystals(const TString& first_same_plot)
06085 {
06086 // Plot the 1D histogram of the mean cor(s,s') as a function of crystals (grouped by Stins)
06087 
06088   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06089   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06090                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06091 
06092   fCnaCommand++;
06093   cout << "   *TEcnaGui [" << fCnaCommand
06094        << "]> Sigma of cor(s,s')";
06095   MessageCnaCommandReplyA(first_same_plot);
06096 
06097   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
06098   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
06099   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06100   fHistos->SetHistoColorPalette(fKeyColPal);
06101   fHistos->GeneralTitle(fKeyGeneralTitle);
06102   fHistos->Plot1DHisto("Xtal", "SCs", "SM", first_same_plot);
06103 
06104   MessageCnaCommandReplyB(first_same_plot);
06105 }
06106 
06107 void TEcnaGui::ViewHistoSorSSigmaOfCorssDistribution(const TString& first_same_plot)
06108 {
06109 // Plot the 1D histogram of the mean cor(s,s') sigmas distribution for a Stex
06110 
06111   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06112   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06113                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06114 
06115   fCnaCommand++;
06116   cout << "   *TEcnaGui [" << fCnaCommand
06117        << "]> Sigma of cor(s,s') distribution";
06118   MessageCnaCommandReplyA(first_same_plot);
06119 
06120   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
06121   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
06122   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06123   fHistos->SetHistoColorPalette(fKeyColPal);
06124   fHistos->GeneralTitle(fKeyGeneralTitle);
06125   fHistos->Plot1DHisto("SCs", "NOX", "SM", first_same_plot);
06126 
06127   MessageCnaCommandReplyB(first_same_plot);
06128 }
06129 
06130 //........................................................................................................
06131 void TEcnaGui::ViewHistoCrystalSampleMeans(const Int_t&  cStexStin_A, const Int_t& crystal,
06132                                            const TString& first_same_plot)
06133 {
06134 // Plot the 1D histogram of the mean sample ADC for a crystal
06135 
06136   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06137   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06138                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06139 
06140   fCnaCommand++;
06141   cout << "   *TEcnaGui [" << fCnaCommand
06142        << "]> Sample means"
06143        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06144        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06145        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal" << crystal
06146        << ", option: " << first_same_plot << endl;
06147 
06148   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06149   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
06150   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06151   fHistos->SetHistoColorPalette(fKeyColPal);
06152   fHistos->GeneralTitle(fKeyGeneralTitle);
06153   fHistos->Plot1DHisto("Sample#", "SampleMean", cStexStin_A, crystal, first_same_plot);
06154 }
06155 
06156 //........................................................................................................
06157 void TEcnaGui::ViewHistoCrystalSampleMeansDistribution(const Int_t&  cStexStin_A, const Int_t& crystal,
06158                                                        const TString& first_same_plot)
06159 {
06160 // Plot the 1D histogram distribution of the mean sample ADC for a crystal
06161 
06162   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06163   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06164                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06165 
06166   fCnaCommand++;
06167   cout << "   *TEcnaGui [" << fCnaCommand
06168        << "]> Sample means"
06169        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06170        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06171        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal" << crystal
06172        << ", option: " << first_same_plot << endl;
06173 
06174   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06175   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
06176   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06177   fHistos->SetHistoColorPalette(fKeyColPal);
06178   fHistos->GeneralTitle(fKeyGeneralTitle);
06179   fHistos->Plot1DHisto("SampleMean", "NbOfSamples", cStexStin_A, crystal, first_same_plot);
06180 }
06181 
06182 void TEcnaGui::ViewHistoCrystalSampleSigmas(const Int_t&  cStexStin_A, const Int_t& crystal,
06183                                             const TString& first_same_plot)
06184 {
06185 // Plot the 1D histogram of the sigmas of the sample ADC for a crystal
06186 
06187   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06188   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06189                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06190 
06191   fCnaCommand++;
06192   cout << "   *TEcnaGui [" << fCnaCommand
06193        << "]> Sample sigmas"
06194        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06195        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06196        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal:" << crystal
06197        << ", option: " << first_same_plot << endl;
06198 
06199   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
06200   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
06201   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06202   fHistos->SetHistoColorPalette(fKeyColPal);
06203   fHistos->GeneralTitle(fKeyGeneralTitle);
06204   fHistos->Plot1DHisto("Sample#", "SampleSigma", cStexStin_A, crystal, first_same_plot);
06205 }
06206 
06207 void TEcnaGui::ViewHistoCrystalSampleSigmasDistribution(const Int_t&  cStexStin_A, const Int_t& crystal,
06208                                                         const TString& first_same_plot)
06209 {
06210 // Plot the 1D histogram distribution of the sigmas of the sample ADC for a crystal
06211 
06212   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06213   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06214                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06215 
06216   fCnaCommand++;
06217   cout << "   *TEcnaGui [" << fCnaCommand
06218        << "]> Sample sigmas"
06219        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06220        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06221        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal:" << crystal
06222        << ", option: " << first_same_plot << endl;
06223 
06224   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
06225   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
06226   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06227   fHistos->SetHistoColorPalette(fKeyColPal);
06228   fHistos->GeneralTitle(fKeyGeneralTitle);
06229   fHistos->Plot1DHisto("SampleSigma", "NbOfSamples", cStexStin_A, crystal, first_same_plot);
06230 }
06231 
06232 //............................ Sample values
06233 void TEcnaGui::ViewHistoCrystalSampleValues(const Int_t& cStexStin_A, const Int_t& crystal,
06234                                             const Int_t& sample,     const TString& first_same_plot)
06235 {
06236 // Plot the 1D histogram of the pedestals as a function of the event number for a crystal
06237 
06238   Int_t n1Sample = sample+1;
06239   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06240   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06241                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06242 
06243   fCnaCommand++;
06244   cout << "   *TEcnaGui [" << fCnaCommand
06245        << "]> ADC sample values"
06246        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06247        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06248        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal: " << crystal
06249        << ", sample: " << n1Sample << ", option: " << first_same_plot << endl;
06250 
06251   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06252   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb); 
06253   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06254   fHistos->SetHistoColorPalette(fKeyColPal);
06255   fHistos->GeneralTitle(fKeyGeneralTitle);
06256   fHistos->Plot1DHisto("Event#", "AdcValue", cStexStin_A, crystal, n1Sample, first_same_plot);
06257 }
06258 
06259 void TEcnaGui::ViewHistoSampleEventDistribution(const Int_t& cStexStin_A, const Int_t& crystal,
06260                                                 const Int_t& sample,      const TString& first_same_plot)
06261 {
06262 // Plot the 1D histogram of the ADC event distribution for a sample
06263 
06264   Int_t n1Sample = sample+1;
06265   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06266   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, fKeyRunNumber,
06267                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber); 
06268 
06269   fCnaCommand++;
06270   cout << "   *TEcnaGui [" << fCnaCommand
06271        << "]> ADC event distribution"
06272        << ". Analysis: " << fKeyAnaType << ", Run: " << fKeyRunNumber
06273        << ", 1st req. evt#: " << fKeyFirstReqEvtNumber << ", last req. evt#: " << fKeyLastReqEvtNumber
06274        << ", Stex: " << fKeyStexNumber << ", " << fStinName.Data() << ": " << cStexStin_A << ", crystal: " << crystal
06275        << ", sample " << n1Sample << ", option: " << first_same_plot << endl;
06276  
06277   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06278   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb);
06279   fHistos->SetHistoScaleY(fKeyScaleY);    fHistos->SetHistoScaleX(fKeyScaleX);
06280   fHistos->SetHistoColorPalette(fKeyColPal);
06281   fHistos->GeneralTitle(fKeyGeneralTitle);
06282   fHistos->Plot1DHisto("AdcValue", "NbOfEvts", cStexStin_A, crystal, n1Sample, first_same_plot);
06283 }
06284 
06285 //------------------------------------------------------- Evolution in time (as a function of run date)
06286 void TEcnaGui::ViewHistimeCrystalPedestals(const TString&  run_par_file_name,
06287                                            const Int_t&   cStexStin_A, const Int_t& i0StinEcha,
06288                                            const TString&  first_same_plot)
06289 {
06290 // Plot the graph of Pedestals evolution for a given channel
06291 
06292   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06293 
06294   fCnaCommand++;
06295   cout << "   *TEcnaGui [" << fCnaCommand
06296        << "]> Pedestal history"
06297        << ". Run parameters file name: " << run_par_file_name
06298        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06299        << ", option: " << first_same_plot << endl;
06300 
06301   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06302   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb); 
06303   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06304   fHistos->SetHistoColorPalette(fKeyColPal);
06305   fHistos->GeneralTitle(fKeyGeneralTitle);
06306   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06307                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06308   fHistos->PlotHistory("Time", "Ped", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06309 }
06310 
06311 void TEcnaGui::ViewHistimeCrystalPedestalsRuns(const TString&  run_par_file_name,
06312                                                const Int_t&   cStexStin_A, const Int_t& i0StinEcha,
06313                                                const TString&  first_same_plot)
06314 {
06315 // Plot the graph of Pedestals evolution for a given channel
06316 
06317   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06318 
06319   fCnaCommand++;
06320   cout << "   *TEcnaGui [" << fCnaCommand
06321        << "]> Pedestal history distribution"
06322        << ". Run parameters file name: " << run_par_file_name
06323        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06324        << ", option: " << first_same_plot << endl;
06325 
06326   fHistos->SetHistoMin(fKeyVminD_Ped_ChNb);
06327   fHistos->SetHistoMax(fKeyVmaxD_Ped_ChNb); 
06328   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06329   fHistos->SetHistoColorPalette(fKeyColPal);
06330   fHistos->GeneralTitle(fKeyGeneralTitle);
06331   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06332                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06333   fHistos->PlotHistory("Ped", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06334 }
06335 
06336 //....................................................................................................
06337 void TEcnaGui::ViewHistimeCrystalTotalNoise(const TString&  run_par_file_name,
06338                                             const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06339                                             const TString&  first_same_plot)
06340 {
06341 // Plot the graph of total noise evolution for a given channel
06342   
06343   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06344 
06345   fCnaCommand++;
06346   cout << "   *TEcnaGui [" << fCnaCommand
06347        << "]> Total noise history"
06348        << ". Run parameters file name: " << run_par_file_name
06349        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06350        << ", option: " << first_same_plot << endl;
06351 
06352   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
06353   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
06354   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06355   fHistos->SetHistoColorPalette(fKeyColPal);
06356   fHistos->GeneralTitle(fKeyGeneralTitle);
06357   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06358                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06359   fHistos->PlotHistory("Time", "TNo", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06360 }
06361 
06362 void TEcnaGui::ViewHistimeCrystalTotalNoiseRuns(const TString&  run_par_file_name,
06363                                                 const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06364                                                 const TString&  first_same_plot)
06365 {
06366 // Plot the graph of total noise evolution for a given channel
06367   
06368   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06369 
06370   fCnaCommand++;
06371   cout << "   *TEcnaGui [" << fCnaCommand
06372        << "]> Total noise history distribution"
06373        << ". Run parameters file name: " << run_par_file_name
06374        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06375        << ", option: " << first_same_plot << endl;
06376 
06377   fHistos->SetHistoMin(fKeyVminD_TNo_ChNb);
06378   fHistos->SetHistoMax(fKeyVmaxD_TNo_ChNb); 
06379   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06380   fHistos->SetHistoColorPalette(fKeyColPal);
06381   fHistos->GeneralTitle(fKeyGeneralTitle);
06382   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06383                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06384   fHistos->PlotHistory("TNo", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06385 }
06386 //....................................................................................................
06387 void TEcnaGui::ViewHistimeCrystalLowFrequencyNoise(const TString&  run_par_file_name,
06388                                                    const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06389                                                    const TString&  first_same_plot)
06390 {
06391 // Plot the graph of Low Frequency Noise evolution for a given channel
06392   
06393   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06394 
06395   fCnaCommand++;
06396   cout << "   *TEcnaGui [" << fCnaCommand
06397        << "]> Low frequency noise history"
06398        << ". Run parameters file name: " << run_par_file_name
06399        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06400        << ", option: " << first_same_plot << endl;
06401 
06402   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
06403   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb); 
06404   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06405   fHistos->SetHistoColorPalette(fKeyColPal);
06406   fHistos->GeneralTitle(fKeyGeneralTitle);
06407   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06408                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06409   fHistos->PlotHistory("Time", "LFN", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06410 }
06411 
06412 void TEcnaGui::ViewHistimeCrystalLowFrequencyNoiseRuns(const TString&  run_par_file_name,
06413                                                        const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06414                                                        const TString&  first_same_plot)
06415 {
06416 // Plot the graph of Low Frequency Noise evolution for a given channel
06417   
06418   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06419 
06420   fCnaCommand++;
06421   cout << "   *TEcnaGui [" << fCnaCommand
06422        << "]> Low frequency noise history distribution"
06423        << ". Run parameters file name: " << run_par_file_name
06424        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06425        << ", option: " << first_same_plot << endl;
06426 
06427   fHistos->SetHistoMin(fKeyVminD_LFN_ChNb);
06428   fHistos->SetHistoMax(fKeyVmaxD_LFN_ChNb); 
06429   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06430   fHistos->SetHistoColorPalette(fKeyColPal);
06431   fHistos->GeneralTitle(fKeyGeneralTitle);
06432   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06433                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06434   fHistos->PlotHistory("LFN", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06435 }
06436 //....................................................................................................
06437 void TEcnaGui::ViewHistimeCrystalHighFrequencyNoise(const TString&  run_par_file_name,
06438                                                     const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06439                                                     const TString&  first_same_plot)
06440 {
06441 // Plot the graph of High Frequency Noise evolution for a given channel
06442   
06443   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06444 
06445   fCnaCommand++;
06446   cout << "   *TEcnaGui [" << fCnaCommand
06447        << "]> High frequency noise history"
06448        << ". Run parameters file name: " << run_par_file_name
06449        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06450        << ", option: " << first_same_plot << endl;
06451 
06452   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
06453   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb); 
06454   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06455   fHistos->SetHistoColorPalette(fKeyColPal);
06456   fHistos->GeneralTitle(fKeyGeneralTitle);
06457   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06458                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06459   fHistos->PlotHistory("Time", "HFN", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06460 }
06461 
06462 void TEcnaGui::ViewHistimeCrystalHighFrequencyNoiseRuns(const TString&  run_par_file_name,
06463                                                         const Int_t&   cStexStin_A,    const Int_t&  i0StinEcha,
06464                                                         const TString&  first_same_plot)
06465 {
06466 // Plot the graph of High Frequency Noise evolution for a given channel
06467   
06468   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06469 
06470   fCnaCommand++;
06471   cout << "   *TEcnaGui [" << fCnaCommand
06472        << "]> High frequency noise history distribution"
06473        << ". Run parameters file name: " << run_par_file_name
06474        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06475        << ", option: " << first_same_plot << endl;
06476 
06477   fHistos->SetHistoMin(fKeyVminD_HFN_ChNb);
06478   fHistos->SetHistoMax(fKeyVmaxD_HFN_ChNb); 
06479   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06480   fHistos->SetHistoColorPalette(fKeyColPal);
06481   fHistos->GeneralTitle(fKeyGeneralTitle);
06482   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06483                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06484   fHistos->PlotHistory("HFN", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06485 }
06486 //....................................................................................................
06487 void TEcnaGui::ViewHistimeCrystalMeanCorss(const TString&  run_par_file_name,
06488                                            const Int_t&   cStexStin_A,    const Int_t& i0StinEcha,
06489                                            const TString&  first_same_plot)
06490 {
06491 // Plot the graph for Mean Corss evolution for a given channel
06492 
06493   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06494 
06495   fCnaCommand++;
06496   cout << "   *TEcnaGui [" << fCnaCommand
06497        << "]> Mean corss history"
06498        << ". Run parameters file name: " << run_par_file_name
06499        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06500        << ", option: " << first_same_plot << endl;
06501 
06502   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
06503   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
06504   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06505   fHistos->SetHistoColorPalette(fKeyColPal);
06506   fHistos->GeneralTitle(fKeyGeneralTitle);
06507   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06508                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06509   fHistos->PlotHistory("Time", "MCs", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06510 }
06511 
06512 void TEcnaGui::ViewHistimeCrystalMeanCorssRuns(const TString&  run_par_file_name,
06513                                                const Int_t&   cStexStin_A,    const Int_t& i0StinEcha,
06514                                                const TString&  first_same_plot)
06515 {
06516 // Plot the graph for Mean Corss evolution for a given channel
06517 
06518   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/ ;}
06519 
06520   fCnaCommand++;
06521   cout << "   *TEcnaGui [" << fCnaCommand
06522        << "]> Mean corss history distribution"
06523        << ". Run parameters file name: " << run_par_file_name
06524        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06525        << ", option: " << first_same_plot << endl;
06526 
06527   fHistos->SetHistoMin(fKeyVminD_MCs_ChNb);
06528   fHistos->SetHistoMax(fKeyVmaxD_MCs_ChNb);
06529   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06530   fHistos->SetHistoColorPalette(fKeyColPal);
06531   fHistos->GeneralTitle(fKeyGeneralTitle);
06532   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06533                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06534   fHistos->PlotHistory("MCs", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06535 }
06536 //....................................................................................................
06537 void TEcnaGui::ViewHistimeCrystalSigmaOfCorss(const TString& run_par_file_name,
06538                                               const Int_t&  cStexStin_A, const Int_t& i0StinEcha,
06539                                               const TString& first_same_plot)
06540 {
06541 // Plot the graph of Mean Corss evolution for a given channel
06542 
06543   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/;}
06544 
06545   fCnaCommand++;
06546   cout << "   *TEcnaGui [" << fCnaCommand
06547        << "]> Sigma of corss history"
06548        << ". Run parameters file name: " << run_par_file_name
06549        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06550        << ", option: " << first_same_plot << endl;
06551 
06552   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
06553   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
06554   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06555   fHistos->SetHistoColorPalette(fKeyColPal);
06556   fHistos->GeneralTitle(fKeyGeneralTitle);
06557   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06558                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06559   fHistos->PlotHistory("Time", "SCs", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06560 }
06561 
06562 void TEcnaGui::ViewHistimeCrystalSigmaOfCorssRuns(const TString& run_par_file_name,
06563                                                   const Int_t&  cStexStin_A, const Int_t& i0StinEcha,
06564                                                   const TString& first_same_plot)
06565 {
06566 // Plot the graph of Mean Corss evolution for a given channel
06567 
06568   if( fHistos == 0 ){fHistos = new TEcnaHistos(fObjectManager, fSubDet.Data());       /*fCnew++*/;}
06569 
06570   fCnaCommand++;
06571   cout << "   *TEcnaGui [" << fCnaCommand
06572        << "]> Sigma of corss history distribution"
06573        << ". Run parameters file name: " << run_par_file_name
06574        << ", " << fStinName.Data() << ": " << cStexStin_A << ", channel: " << i0StinEcha
06575        << ", option: " << first_same_plot << endl;
06576 
06577   fHistos->SetHistoMin(fKeyVminD_SCs_ChNb);
06578   fHistos->SetHistoMax(fKeyVmaxD_SCs_ChNb);
06579   fHistos->SetHistoScaleY(fKeyScaleY);  fHistos->SetHistoScaleX(fKeyScaleX);
06580   fHistos->SetHistoColorPalette(fKeyColPal);
06581   fHistos->GeneralTitle(fKeyGeneralTitle);
06582   fHistos->FileParameters(fKeyAnaType, fKeyNbOfSamples, 0,
06583                           fKeyFirstReqEvtNumber, fKeyLastReqEvtNumber, fKeyReqNbOfEvts, fKeyStexNumber);
06584   fHistos->PlotHistory("SCs", "NOR", run_par_file_name, cStexStin_A, i0StinEcha, first_same_plot);
06585 }
06586 
06587 //====================================================================================================
06588 
06589 void TEcnaGui::InitKeys()
06590 {
06591   //.....Input widgets for: analysis, run, channel, sample,
06592   //                        number of events, first event number, etc...
06593   
06594   //fKeyPyf = "";
06595 
06596   fKeyAnaType = "StdPeg12";
06597   Int_t MaxCar = fgMaxCar;
06598   fKeyRunListInitCode.Resize(MaxCar);
06599   fKeyRunListInitCode = "0123";
06600 
06601   MaxCar = fgMaxCar;
06602   fKeyFileNameRunList.Resize(MaxCar);
06603   fKeyFileNameRunList = fKeyRunListInitCode.Data();
06604 
06605   fKeyNbOfSamples = fEcal->MaxSampADC();
06606   fKeyNbOfSamplesString = "10";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyNbOfSamples VALUE
06607 
06608   fKeyNbOfSampForCalc = fEcal->MaxSampADC();
06609   fKeyNbOfSampForCalcString = "10";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyNbOfSampForCalc VALUE
06610 
06611   fKeyRunNumber  = 0;
06612 
06613   fKeyFirstReqEvtNumber = 1;
06614   fKeyFirstReqEvtNumberString = "1";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyFirstReqEvtNumber VALUE
06615 
06616   fKeyLastReqEvtNumber = 0;
06617   fKeyLastReqEvtNumberString = "0";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyLastReqEvtNumber VALUE
06618 
06619   fKeyReqNbOfEvts = 150;
06620   fKeyReqNbOfEvtsString = "150";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyReqNbOfEvts VALUE
06621 
06622   fKeyStexNumber = 1;
06623   fKeyStexNumberString = "1";  // ! THE NUMBER IN STRING MUST BE EQUAL TO fKeyStexNumber VALUE
06624 
06625   fKeyChanNumber = 0;
06626   fKeySampNumber = 0;
06627 
06628   fKeyStinANumber = 1;
06629   fKeyStinBNumber = 1;
06630   if( fSubDet == "EE" )
06631     {if( fKeyStexNumber == 1 || fKeyStexNumber == 3 )
06632       {
06633         fKeyStinANumber = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fKeyStexNumber, 150);
06634         fKeyStinBNumber = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fKeyStexNumber, 150);
06635       }
06636     }
06637 
06638   MaxCar = fgMaxCar;
06639   fKeyScaleX.Resize(MaxCar); 
06640   fKeyScaleX = "LIN";
06641   MaxCar = fgMaxCar;
06642   fKeyScaleY.Resize(MaxCar); 
06643   fKeyScaleY = "LIN";
06644   fKeyGeneralTitle = "Ecal Correlated Noise Analysis";
06645 
06646   fKeyColPal = "ECCNAColor";
06647 
06648   //.... ymin and ymax values => values which are displayed on the dialog box
06649 
06650   fKeyVminD_NOE_ChNb = (Double_t)0.; 
06651   fKeyVmaxD_NOE_ChNb = fKeyReqNbOfEvts + fKeyReqNbOfEvts/3;
06652  
06653   fKeyVminD_Ped_ChNb = (Double_t)0.; 
06654   fKeyVmaxD_Ped_ChNb = (Double_t)0.;
06655 
06656   fKeyVminD_TNo_ChNb = (Double_t)0.; 
06657   fKeyVmaxD_TNo_ChNb = (Double_t)0.;
06658 
06659   fKeyVminD_LFN_ChNb = (Double_t)0.; 
06660   fKeyVmaxD_LFN_ChNb = (Double_t)0.;
06661 
06662   fKeyVminD_HFN_ChNb = (Double_t)0.;
06663   fKeyVmaxD_HFN_ChNb = (Double_t)0.;
06664 
06665   fKeyVminD_MCs_ChNb = (Double_t)(-1.); 
06666   fKeyVmaxD_MCs_ChNb = (Double_t)1.;
06667 
06668   fKeyVminD_SCs_ChNb = (Double_t)0.; 
06669   fKeyVmaxD_SCs_ChNb = (Double_t)0.; 
06670 
06671   fKeyVminLHFcc = fKeyVminD_MCs_ChNb;
06672   fKeyVmaxLHFcc = fKeyVmaxD_MCs_ChNb;
06673 
06674   fKeyVminLFccMos = (Double_t)-1.; 
06675   fKeyVmaxLFccMos = (Double_t)1.;
06676   fKeyVminHFccMos = (Double_t)0.; 
06677   fKeyVmaxHFccMos = (Double_t)1.;
06678 
06679   fKeyFileNameRunList = "";
06680 }
06681 
06682 void  TEcnaGui::DisplayInEntryField(TGTextEntry* StringOfField, Int_t& value)
06683 {
06684   char* f_in = new char[20];          fCnew++;
06685   sprintf( f_in, "%d", value );
06686   StringOfField->SetText(f_in);
06687   delete [] f_in;                     fCdelete++;
06688 }
06689 
06690 void  TEcnaGui::DisplayInEntryField(TGTextEntry* StringOfField, Double_t& value)
06691 {
06692   char* f_in = new char[20];          fCnew++;
06693   sprintf( f_in, "%g", value );
06694   StringOfField->SetText(f_in);
06695   delete [] f_in;                     fCdelete++;
06696 }
06697 void  TEcnaGui::DisplayInEntryField(TGTextEntry* StringOfField, const TString& value)
06698 {
06699   //StringOfField->Insert(value);
06700   StringOfField->SetText(value);
06701 }