CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/src/TEcnaParHistos.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:10/10/2011
00004 
00005 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParHistos.h"
00006 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaNumbering.h"
00007 
00008 //--------------------------------------
00009 //  TEcnaParHistos.cc
00010 //  Class creation: 19 May 2005
00011 //  Documentation: see TEcnaParHistos.h
00012 //--------------------------------------
00013 
00014 ClassImp(TEcnaParHistos)
00015 //______________________________________________________________________________
00016 //
00017 
00018   TEcnaParHistos::~TEcnaParHistos()
00019 {
00020   //destructor
00021   
00022   //if (fEcalNumbering != 0){delete  fEcalNumbering; fCdelete++;}
00023   //if (fEcal          != 0){delete  fEcal;          fCdelete++;}
00024   
00025   //cout << "[Info Management] CLASS: TEcnaParHistos.     DESTROY OBJECT: this = " << this << endl;
00026 }
00027 
00028 //===================================================================
00029 //
00030 //                   Constructors
00031 //
00032 //===================================================================
00033 TEcnaParHistos::TEcnaParHistos()
00034 {
00035 // Constructor without argument
00036 
00037   //cout << "[Info Management] CLASS: TEcnaParHistos.     CREATE OBJECT: this = " << this << endl;
00038 
00039   Init();
00040 }
00041 
00042 TEcnaParHistos::TEcnaParHistos(TEcnaObject* pObjectManager, const TString SubDet)
00043 {
00044 // Constructor without argument
00045 
00046   //cout << "[Info Management] CLASS: TEcnaParHistos.     CREATE OBJECT: this = " << this << endl;
00047 
00048   Init();
00049   Long_t i_this = (Long_t)this;
00050   pObjectManager->RegisterPointer("TEcnaParHistos", i_this);
00051 
00052   //............................ fEcal  => to be changed in fParEcal
00053   fEcal = 0;
00054   Long_t iParEcal = pObjectManager->GetPointerValue("TEcnaParEcal");
00055   if( iParEcal == 0 )
00056     {fEcal = new TEcnaParEcal(pObjectManager, SubDet.Data()); /*fCnew++*/}
00057   else
00058     {fEcal = (TEcnaParEcal*)iParEcal;}
00059 
00060   //............................ fEcalNumbering
00061   fEcalNumbering = 0;
00062   Long_t iEcalNumbering = pObjectManager->GetPointerValue("TEcnaNumbering");
00063   if( iEcalNumbering == 0 )
00064     {fEcalNumbering = new TEcnaNumbering(pObjectManager, SubDet.Data()); /*fCnew++*/}
00065   else
00066     {fEcalNumbering = (TEcnaNumbering*)iEcalNumbering;}
00067 
00068   SetEcalSubDetector(SubDet.Data());
00069 }
00070 
00071 
00072 
00073 TEcnaParHistos::TEcnaParHistos(const TString SubDet,
00074                                const TEcnaParEcal* pEcal,
00075                                const TEcnaNumbering*  pEcalNumbering)
00076 {
00077 // Constructor with argument
00078 
00079   //cout << "[Info Management] CLASS: TEcnaParHistos.     CREATE OBJECT: this = " << this << endl;
00080 
00081   Init();
00082   SetEcalSubDetector(SubDet.Data(), pEcal, pEcalNumbering);
00083 }
00084 
00085 void  TEcnaParHistos::Init()
00086 {
00087   fgMaxCar = (Int_t)512;              // max number of characters in TStrings
00088 
00089   fTTBELL = '\007';
00090 
00091   //................ Init CNA Command and error numbering
00092   fCnaCommand = 0;
00093   fCnaError   = 0;
00094 
00095   //........................................................................................
00096 
00097   fMaxColorNumber     = (Int_t)4;       // number_of_colors - 1 for histos in option SAME
00098 
00099   fMarginAutoMinMax   = (Double_t)0.05; // factor for automatic margin plots:
00100                                         // plot min = min - (max-min)*fMarginAutoMinMax
00101                                         // plot max = max + (max-min)*fMarginAutoMinMax
00102 
00103   fNbOfRunsDisplayed  = (Int_t)20;      // Nb of run numbers displayed on the top of the plot
00104                                         // in stability/evolution plots, option ONLYONE
00105 
00106   fMaxNbOfRunsInLists = (Int_t)5000;    // Maximum number of runs in the ListOfRun files
00107                                         // used for the stability/evolution plots.
00108 
00109   //........................ init code plot type                      (Init)
00110   Int_t MaxCar = fgMaxCar;
00111   fOnlyOnePlot.Resize(MaxCar);
00112   fOnlyOnePlot = "ONLYONE";
00113 
00114   MaxCar = fgMaxCar;
00115   fSeveralPlot.Resize(MaxCar);
00116   fSeveralPlot = "SAME";
00117 
00118   MaxCar = fgMaxCar;
00119   fSameOnePlot.Resize(MaxCar);
00120   fSameOnePlot = "SAME n";
00121 
00122   MaxCar = fgMaxCar;
00123   fAllXtalsInStinPlot.Resize(MaxCar);
00124   fAllXtalsInStinPlot = "SAME in Stin";
00125 
00126   fPlotAllXtalsInStin = 0;
00127 
00128 }// end of Init()
00129 
00130 void TEcnaParHistos::SetEcalSubDetector(const TString SubDet)
00131 {
00132  // Set Subdetector (EB or EE)
00133 
00134   Int_t MaxCar = fgMaxCar;
00135   fFlagSubDet.Resize(MaxCar);
00136   fFlagSubDet = fEcal->GetEcalSubDetector();
00137 }
00138 
00139 
00140 void TEcnaParHistos::SetEcalSubDetector(const TString SubDet,
00141                                        const TEcnaParEcal* pEcal,
00142                                        const TEcnaNumbering*  pEcalNumbering)
00143 {
00144  // Set Subdetector (EB or EE)
00145 
00146   fEcal = 0;
00147   if( pEcal == 0 )
00148     {fEcal = new TEcnaParEcal(SubDet.Data());     /*fCnew++*/ ;}
00149   else
00150     {fEcal = (TEcnaParEcal*)pEcal;}
00151 
00152   Int_t MaxCar = fgMaxCar;
00153   fFlagSubDet.Resize(MaxCar);
00154   fFlagSubDet = fEcal->GetEcalSubDetector();
00155 
00156   fEcalNumbering = 0;
00157   if( pEcalNumbering == 0 )
00158     {fEcalNumbering = new TEcnaNumbering(fFlagSubDet.Data(), fEcal);     /*fCnew++*/ ;}
00159   else
00160     {fEcalNumbering = (TEcnaNumbering*)pEcalNumbering;}
00161 }
00162 
00163 
00164 Int_t TEcnaParHistos::MaxNbOfRunsInLists(){return fMaxNbOfRunsInLists;}
00165 
00166 //---------------------------------------------------------------------------------------------
00167 // HistoCode list modification (06/10/09)
00168 //
00169 //    D = Detector Plot    ChNb = Channel Number
00170 //                         ChDs = Channel Distribution (Y projection)
00171 //
00172 //    H = History  Plot    Date = date in format YYMMJJ hhmmss
00173 //                         RuDs = Run distribution
00174 //
00175 //      old code             new code
00176 //
00177 // *  1 H1NbOfEvtsGlobal     D_NOE_ChNb    NOE  = Number Of Events
00178 // *  2 H1NbOfEvtsProj       D_NOE_ChDs    
00179 // *  3 H1EvEvGlobal         D_Ped_ChNb    Ped  = Pedestal
00180 // *  4 H1EvEvProj           D_Ped_ChDs
00181 // *  5 H1EvSigGlobal        D_TNo_ChNb    TNo  = Total Noise
00182 // *  6 H1EvSigProj          D_TNo_ChDs
00183 // *  7 H1SigEvGlobal        D_LFN_ChNb    LFN  = Low Frequency noise
00184 // *  8 H1SigEvProj          D_LFN_ChDs
00185 // *  9 H1SigSigGlobal       D_HFN_ChNb    HFN  = High Frequency noise
00186 // * 10 H1SigSigProj         D_HFN_ChDs
00187 // * 11 H1EvCorssGlobal      D_MCs_ChNb    MCs  = Mean correlations between samples
00188 // * 12 H1EvCorssProj        D_MCs_ChDs
00189 // * 13 H1SigCorssGlobal     D_SCs_ChNb    SCs  = Sigma of the correlations between samples
00190 // * 14 H1SigCorssProj       D_SCs_ChDs
00191 // * 15 Ev                   D_MSp_SpNb    MSp  = Mean samples
00192 // * 16 EvProj               D_MSp_SpDs
00193 // * 17 Sigma                D_SSp_SpNb    SSp  = Sigma of the samples
00194 // * 18 SigmaProj            D_SSp_SpDs
00195 // * 19 SampTime             D_Adc_EvNb    Adc  = ADC count as a function of Event number
00196 // * 20 AdcProj              D_Adc_EvDs
00197 // * 21 EvolEvEv             H_Ped_Date    
00198 // * 22 EvolEvEvProj         H_Ped_RuDs    
00199 // * 23 EvolEvSig            H_TNo_Date
00200 // * 24 EvolEvSigProj        H_TNo_RuDs   
00201 // * 25 EvolSigEv            H_LFN_Date 
00202 // * 26 EvolSigEvProj        H_LFN_RuDs 
00203 // * 27 EvolSigSig           H_HFN_Date 
00204 // * 28 EvolSigSigProj       H_HFN_RuDs 
00205 // * 29 EvolEvCorss          H_MCs_Date   
00206 // * 30 EvolEvCorssProj      H_MCs_RuDs   
00207 // * 31 EvolSigCorss         H_SCs_Date   
00208 // * 32 EvolSigCorssProj     H_SCs_RuDs   
00209 //
00210 //===========================================================================
00211 //
00212 //    SetCanvasWidth, SetCanvasHeight,
00213 //    CanvasFormatW, CanvasFormatH,
00214 //
00215 //===========================================================================
00216 UInt_t TEcnaParHistos::SetCanvasWidth(const TString HistoCode, const TString opt_plot)
00217 {
00218 //........................................ Taille/format canvas
00219   
00220   UInt_t canv_w = CanvasFormatW("petit");
00221 
00222   if( HistoCode == "D_Adc_EvNb" || HistoCode == "D_NOE_ChNb" ||
00223       HistoCode == "D_Ped_ChNb" || HistoCode == "D_LFN_ChNb" ||
00224       HistoCode == "D_TNo_ChNb" || HistoCode == "D_HFN_ChNb" ||
00225       HistoCode == "D_MCs_ChNb" || HistoCode == "D_SCs_ChNb" ||
00226       HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" ||
00227       HistoCode == "H_MCs_Date" || HistoCode == "H_LFN_Date" ||
00228       HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
00229       (HistoCode == "D_MSp_SpNb" && opt_plot != "ONLYONE")   || 
00230       (HistoCode == "D_SSp_SpNb" && opt_plot != "ONLYONE") )
00231     {        
00232       canv_w = CanvasFormatH("moyen");    // format 29.7*21 ( = 21*29.7 en paysage)
00233     }
00234   
00235   if( (HistoCode == "D_Adc_EvDs" || HistoCode == "D_NOE_ChDs" ||
00236        HistoCode == "D_Ped_ChDs" || HistoCode == "D_LFN_ChDs" ||
00237        HistoCode == "D_TNo_ChDs" || HistoCode == "D_HFN_ChDs" ||
00238        HistoCode == "D_MCs_ChDs" || HistoCode == "D_SCs_ChDs" ||
00239        HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" ||
00240        HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" ||
00241        HistoCode == "H_MCs_RuDs" || HistoCode == "H_LFN_RuDs" ||
00242        HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs") && opt_plot != "ONLYONE" )
00243     {        
00244       canv_w = CanvasFormatH("moyen");    // format 29.7*21 ( = 21*29.7 en paysage)
00245     }
00246 
00247   return canv_w;
00248 }
00249 
00250 UInt_t TEcnaParHistos::SetCanvasHeight(const TString HistoCode, const TString opt_plot)
00251 {
00252 //........................................ Taille/format canvas
00253   
00254   UInt_t canv_h = CanvasFormatH("petit");
00255 
00256   if( HistoCode == "D_Adc_EvNb" || HistoCode == "D_NOE_ChNb" ||
00257       HistoCode == "D_Ped_ChNb" || HistoCode == "D_LFN_ChNb" ||
00258       HistoCode == "D_TNo_ChNb" || HistoCode == "D_HFN_ChNb" ||
00259       HistoCode == "D_MCs_ChNb" || HistoCode == "D_SCs_ChNb" ||
00260       HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" ||
00261       HistoCode == "H_MCs_Date" || HistoCode == "H_LFN_Date" ||
00262       HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
00263       (HistoCode == "D_MSp_SpNb" && opt_plot != "ONLYONE")   ||
00264       (HistoCode == "D_SSp_SpNb" && opt_plot != "ONLYONE") )
00265     {
00266       canv_h = CanvasFormatW("moyen");    // format 29.7*21 ( = 21*29.7 en paysage)
00267     }
00268 
00269   if( (HistoCode == "D_Adc_EvDs" || HistoCode == "D_NOE_ChDs" ||
00270        HistoCode == "D_Ped_ChDs" || HistoCode == "D_LFN_ChDs" ||
00271        HistoCode == "D_TNo_ChDs" || HistoCode == "D_HFN_ChDs" ||
00272        HistoCode == "D_MCs_ChDs" || HistoCode == "D_SCs_ChDs" ||
00273        HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" ||
00274        HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" ||
00275        HistoCode == "H_MCs_RuDs" || HistoCode == "H_LFN_RuDs" ||
00276        HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs") && opt_plot != "ONLYONE" )
00277     {        
00278       canv_h = CanvasFormatW("moyen");    // format 29.7*21 ( = 21*29.7 en paysage)
00279     }
00280 
00281   return canv_h;
00282 }
00283 
00284 UInt_t TEcnaParHistos::CanvasFormatW(const TString chformat)
00285 {
00286 //Set Canvas width
00287 
00288   UInt_t canv_w = 375;         // default = "petit"
00289 
00290   if ( chformat == "petit"    ){canv_w = 375;} // 21x29.7 portrait
00291   if ( chformat == "moyen"    ){canv_w = 450;} // 21x29.7 portrait
00292   if ( chformat == "grand"    ){canv_w = 572;} // 21x29.7 portrait
00293 
00294   if ( chformat == "etaphiSM" ){canv_w = 760;} // landscape etroit en hauteur pour plot SM
00295   if ( chformat == "phietaEB" ){canv_w = 636;} // landscape pour plot EB (32 SMs)
00296 
00297   if ( chformat == "IXIYDee"  ){canv_w = 320;} // portrait etroit en largeur pour plot Dee
00298   if ( chformat == "IYIXEE"   ){canv_w = 636;} // landscape pour plot EE (4 dees)
00299   return canv_w;
00300 }
00301 //......................................................................
00302 UInt_t TEcnaParHistos::CanvasFormatH(const TString chformat)
00303 {
00304 //Set Canvas height
00305 
00306   UInt_t canv_h = 530;         // default = "petit"
00307 
00308   if ( chformat == "petit"    ){canv_h = 530;} // 21x29.7 portrait
00309   if ( chformat == "moyen"    ){canv_h = 636;} // 21x29.7 portrait
00310   if ( chformat == "grand"    ){canv_h = 810;} // 21x29.7 portrait
00311 
00312   if ( chformat == "etaphiSM" ){canv_h = 306;} // landscape etroit en hauteur pour plot SM
00313   if ( chformat == "phietaEB" ){canv_h = 450;} // landscape pour plot EB (32 SMs)
00314 
00315   if ( chformat == "IXIYDee"  ){canv_h = 720;} // portrait etroit en largeur pour plot Dee
00316   if ( chformat == "IYIXEE"   ){canv_h = 450;} // landscape pour plot EE (4 dees)
00317   return canv_h;
00318 }
00319 
00320 //===========================================================================
00321 //
00322 //          BoxLeftX, BoxRightX, BoxBottomY, BoxTopY
00323 //
00324 //===========================================================================
00325 Double_t TEcnaParHistos::BoxLeftX(const TString chtype)
00326 {
00327 //Set the x left coordinate of the box
00328 
00329   Double_t value = 0.4;
00330 
00331   if ( chtype == "general_comment"      ) {value = 0.015;}
00332 
00333   if ( chtype == "top_left_box_SM"      ) {value = 0.015;}
00334   if ( chtype == "top_left_box_EB"      ) {value = 0.015;}
00335   if ( chtype == "top_mid_box_EB"       ) {value = 0.350;}
00336   if ( chtype == "top_right_box_EB"     ) {value = 0.630;}
00337 
00338   if ( chtype == "top_left_box_Dee"     ) {value = 0.015;}
00339   if ( chtype == "top_left_box_EE"      ) {value = 0.015;}
00340   if ( chtype == "top_mid_box_EE"       ) {value = 0.240;}
00341   if ( chtype == "top_right_box_EE"     ) {value = 0.610;}
00342 
00343   if ( chtype == "bottom_left_box"      ) {value = 0.015;}
00344   if ( chtype == "bottom_left_box_evol" ) {value = 0.015;}
00345   if ( chtype == "bottom_mid_box"       ) {value = 0.250;}
00346   if ( chtype == "bottom_right_box"     ) {value = 0.455;}
00347   if ( chtype == "bottom_right_box_evol") {value = 0.540;}
00348   if ( chtype == "bottom_right_box_evpr") {value = 0.540;}
00349 
00350   if ( chtype == "several_plots_box"    ) {value = 0.015;}
00351   if ( chtype == "several_evol_box"     ) {value = 0.015;}
00352   if ( chtype == "several_evpr_box"     ) {value = 0.015;}
00353 
00354  return value;
00355 }
00356 //.................................................................
00357 Double_t TEcnaParHistos::BoxRightX(const TString chtype)
00358 {
00359 //Set the x right coordinate of the box
00360   
00361   Double_t value = 0.6;
00362   
00363   if ( chtype == "general_comment"      ) {value = 0.680;}
00364 
00365   if ( chtype == "top_left_box_SM"      ) {value = 0.125;}
00366   if ( chtype == "top_left_box_EB"      ) {value = 0.349;}
00367   if ( chtype == "top_mid_box_EB"       ) {value = 0.629;}
00368   if ( chtype == "top_right_box_EB"     ) {value = 0.985;}
00369 
00370   if ( chtype == "top_left_box_Dee"     ) {value = 0.425;}
00371   if ( chtype == "top_left_box_EE"      ) {value = 0.260;}
00372   if ( chtype == "top_mid_box_EE"       ) {value = 0.609;}
00373   if ( chtype == "top_right_box_EE"     ) {value = 0.985;}
00374 
00375   if ( chtype == "bottom_left_box"      ) {value = 0.445;}
00376   if ( chtype == "bottom_left_box_evol" ) {value = 0.450;} // ex 370
00377   if ( chtype == "bottom_mid_box"       ) {value = 0.750;}
00378   if ( chtype == "bottom_right_box"     ) {value = 0.985;}
00379   if ( chtype == "bottom_right_box_evol") {value = 0.985;}
00380   if ( chtype == "bottom_right_box_evpr") {value = 0.985;}
00381 
00382   if ( chtype == "several_plots_box"    ) {value = 0.985;}
00383   if ( chtype == "several_evol_box"     ) {value = 0.635;}
00384   if ( chtype == "several_evpr_box"     ) {value = 0.635;}
00385   
00386  return value;
00387 }
00388 //.................................................................
00389 Double_t TEcnaParHistos::BoxBottomY(const TString chtype)
00390 {
00391 //Set the y bottom coordinate of the box
00392 
00393   Double_t value = 0.8;
00394   
00395   if ( chtype == "general_comment"      ) {value = 0.960;}
00396 
00397   if ( chtype == "top_left_box_SM"      ) {value = 0.880;}
00398   if ( chtype == "top_left_box_EB"      ) {value = 0.880;}
00399   if ( chtype == "top_mid_box_EB"       ) {value = 0.880;}
00400   if ( chtype == "top_right_box_EB"     ) {value = 0.880;}
00401 
00402   if ( chtype == "top_left_box_Dee"     ) {value = 0.925;}
00403   if ( chtype == "top_left_box_EE"      ) {value = 0.880;}
00404   if ( chtype == "top_mid_box_EE"       ) {value = 0.880;}
00405   if ( chtype == "top_right_box_EE"     ) {value = 0.880;}
00406 
00407   if ( chtype == "bottom_left_box"      ) {value = 0.010;}
00408   if ( chtype == "bottom_left_box_evol" ) {value = 0.010;}
00409   if ( chtype == "bottom_right_box"     ) {value = 0.010;}
00410   if ( chtype == "bottom_right_box_evol") {value = 0.010;}
00411   if ( chtype == "bottom_right_box_evpr") {value = 0.010;}
00412   if ( chtype == "several_plots_box"    ) {value = 0.010;}
00413   if ( chtype == "several_evol_box"     ) {value = 0.010;}
00414   if ( chtype == "several_evpr_box"     ) {value = 0.010;}
00415 
00416  return value;
00417 }
00418 //.................................................................
00419 Double_t TEcnaParHistos::BoxTopY(const TString chtype)
00420 {
00421 //Set the y top coordinate of the box
00422 
00423   Double_t value = 0.9;
00424   
00425   if ( chtype == "general_comment"      ) {value = 0.999;}
00426 
00427   if ( chtype == "top_left_box_SM"      ) {value = 0.955;}
00428   if ( chtype == "top_left_box_EB"      ) {value = 0.955;}
00429   if ( chtype == "top_mid_box_EB"       ) {value = 0.955;}
00430   if ( chtype == "top_right_box_EB"     ) {value = 0.955;}
00431 
00432   if ( chtype == "top_left_box_Dee"     ) {value = 0.969;}
00433   if ( chtype == "top_left_box_EE"      ) {value = 0.955;}
00434   if ( chtype == "top_mid_box_EE"       ) {value = 0.955;}
00435   if ( chtype == "top_right_box_EE"     ) {value = 0.955;}
00436   
00437   if ( chtype == "bottom_left_box"      ) {value = 0.120;}  
00438   if ( chtype == "bottom_left_box_evol" ) {value = 0.120;}
00439   if ( chtype == "bottom_right_box"     ) {value = 0.120;}
00440   if ( chtype == "bottom_right_box_Dee" ) {value = 0.100;}
00441 
00442   if ( chtype == "bottom_right_box_evol") {value = 0.120;}
00443   if ( chtype == "bottom_right_box_evpr") {value = 0.120;}
00444   if ( chtype == "several_plots_box"    ) {value = 0.200;}
00445   if ( chtype == "several_evol_box"     ) {value = 0.200;}
00446   if ( chtype == "several_evpr_box"     ) {value = 0.200;}
00447 
00448  return value;
00449 }
00450 
00451 //===========================================================================
00452 //
00453 //       SetColorPalette, ColorTab, ColorDefinition 
00454 //
00455 //===========================================================================
00456 
00457 void TEcnaParHistos::SetColorPalette(const TString user_color_palette)
00458 {
00459   //Set color number for palette
00460 
00461   fMaxColorNumber = 4;         // default: 4 ==> Black/Red/Blue/Green/Braun
00462 
00463   if (!(user_color_palette == "Rainbow" || user_color_palette == "rainbow") ){fMaxColorNumber = 5;}
00464   if (  user_color_palette == "Rainbow" || user_color_palette == "rainbow"  ){fMaxColorNumber = 6;}
00465 }
00466 //...........................................................................
00467 Color_t TEcnaParHistos::ColorTab(const Int_t& user_color_number)
00468 {
00469   //Set color from user color number
00470 
00471   //=========> Color definition: see ROOT User's guide p.151
00472 
00473   TColor* my_color = new TColor();
00474 
00475   Color_t couleur = ColorDefinition("noir");        // default = "noir"
00476 
00477   if ( fMaxColorNumber  != 6 )
00478     {
00479       //................... Standard: 6 colors (fMaxColorNumber = 5)
00480       if(user_color_number == 0){couleur = ColorDefinition("noir");}                  //    noir        black    1
00481       if(user_color_number == 1){couleur = ColorDefinition("rouge");}                 //    rouge       red      2
00482       if(user_color_number == 2){couleur = ColorDefinition("bleu");}                  //    bleu        blue     9
00483       if(user_color_number == 3){couleur = (Color_t)my_color->GetColor("#009900");}   //    vert        green
00484       if(user_color_number == 4){couleur = ColorDefinition("marron28");}              //    marron 28   braun   28
00485       if(user_color_number == 5){couleur = (Color_t)my_color->GetColor("#9900BB");}   //    violet      purple
00486 
00487     }
00488   if ( fMaxColorNumber  == 6 )
00489     {
00490       //................... Rainbow:7  colors (fMaxColorNumber = 6)
00491       if(user_color_number == 0){couleur = (Color_t)my_color->GetColor("#EE0000");}  //   rouge
00492       if(user_color_number == 1){couleur = (Color_t)my_color->GetColor("#FF6611");}  //   orange
00493       if(user_color_number == 2){couleur = (Color_t)my_color->GetColor("#FFCC00");}  //   jaune
00494       if(user_color_number == 3){couleur = (Color_t)my_color->GetColor("#009900");}  //   vert
00495       if(user_color_number == 4){couleur = (Color_t)my_color->GetColor("#0044EE");}  //   bleu
00496       if(user_color_number == 5){couleur = (Color_t)my_color->GetColor("#6633BB");}  //   indigo
00497       if(user_color_number == 6){couleur = (Color_t)my_color->GetColor("#9900BB");}  //   violet
00498     }
00499 
00500   if( user_color_number < 0 || user_color_number > fMaxColorNumber ){couleur = 0;}
00501 
00502   return couleur;
00503 }
00504 // end of ColorTab
00505 
00506 Color_t TEcnaParHistos::ColorDefinition(const TString chcolor)
00507 {
00508   //Set color from color name
00509 
00510   //=========> Color definition: see ROOT User's guide p.151
00511 
00512   Color_t couleur = 1;        // default = "noir"
00513 
00514   if ( chcolor == "noir"       ) {couleur =  1;}
00515   if ( chcolor == "rouge"      ) {couleur =  2;}
00516   if ( chcolor == "vert_fonce" ) {couleur =  3;}
00517   if ( chcolor == "bleu_fonce" ) {couleur =  4;}
00518   if ( chcolor == "jaune"      ) {couleur =  5;}
00519   if ( chcolor == "rose"       ) {couleur =  6;}
00520   if ( chcolor == "bleu_clair" ) {couleur =  7;}
00521   if ( chcolor == "vert"       ) {couleur =  8;}
00522   if ( chcolor == "bleu"       ) {couleur =  9;}
00523   if ( chcolor == "blanc"      ) {couleur = 10;}
00524 
00525   if ( chcolor == "marron23"   ) {couleur = 23;}
00526   if ( chcolor == "marron24"   ) {couleur = 24;}
00527   if ( chcolor == "marron25"   ) {couleur = 24;}
00528   if ( chcolor == "marron27"   ) {couleur = 27;}
00529   if ( chcolor == "marron28"   ) {couleur = 28;}
00530 
00531   if ( chcolor == "bleu33"     ) {couleur = 33;}
00532   if ( chcolor == "bleu36"     ) {couleur = 36;}
00533   if ( chcolor == "bleu38"     ) {couleur = 38;}
00534   if ( chcolor == "bleu39"     ) {couleur = 39;}
00535 
00536   if ( chcolor == "orange41"   ) {couleur = 41;}
00537   if ( chcolor == "orange42"   ) {couleur = 42;}
00538 
00539   if ( chcolor == "rouge44"    ) {couleur = 44;}
00540   if ( chcolor == "rouge46"    ) {couleur = 46;}
00541   if ( chcolor == "rouge47"    ) {couleur = 47;}
00542   if ( chcolor == "rouge48"    ) {couleur = 48;}
00543   if ( chcolor == "rouge49"    ) {couleur = 49;}
00544   if ( chcolor == "rouge50"    ) {couleur = 50;}
00545 
00546   if ( chcolor == "vert31"     ) {couleur = 31;}
00547   if ( chcolor == "vert32"     ) {couleur = 32;}
00548   if ( chcolor == "vert36"     ) {couleur = 36;}
00549   if ( chcolor == "vert37"     ) {couleur = 37;}
00550 
00551   if ( chcolor == "violet"     ) {couleur = 49;}
00552 
00553   if ( chcolor == "turquoise29") {couleur = 29;}
00554 
00555   if ( chcolor == "gris12"     ) {couleur = 12;}
00556   if ( chcolor == "gris13"     ) {couleur = 13;}
00557   if ( chcolor == "gris14"     ) {couleur = 14;}
00558   if ( chcolor == "gris15"     ) {couleur = 15;}
00559   if ( chcolor == "gris16"     ) {couleur = 16;}
00560   if ( chcolor == "gris17"     ) {couleur = 17;}
00561   if ( chcolor == "gris18"     ) {couleur = 18;}
00562 
00563   return couleur;
00564 }
00565 // end of ColorDefinition
00566 
00567 //===========================================================================
00568 //       GetMaxNbOfColors, GetMarginAutoMinMax, GetNbOfRunsDisplayed
00569 //===========================================================================
00570 Int_t TEcnaParHistos::GetMaxNbOfColors(){return fMaxColorNumber;}
00571 Int_t TEcnaParHistos::GetNbOfRunsDisplayed(){return fNbOfRunsDisplayed;}
00572 Double_t TEcnaParHistos::GetMarginAutoMinMax(){return fMarginAutoMinMax;}
00573 
00574 //===========================================================================
00575 //
00576 //      SetViewHistoStyle, SetViewHistoPadMargins
00577 //
00578 //===========================================================================
00579 void TEcnaParHistos::SetViewHistoStyle(const TString HistoType)
00580 {
00581 // Set style parameters for histo view
00582 
00583   //......................... Palette
00584   gStyle->SetPalette(1,0);  // default: rainbow spectrum
00585 
00586   //............................... Date
00587   gStyle->SetOptDate(0);
00588 
00589   //............................... Histo title size
00590   gStyle->SetTitleW(0.5); gStyle->SetTitleH(0.075);     // default
00591 
00592   if( HistoType == "colz"  || HistoType == "lego"  ||
00593       HistoType == "surf"  || HistoType == "Stin" )
00594     {gStyle->SetTitleW(0.8); gStyle->SetTitleH(0.075);}
00595 
00596   if( (HistoType == "H1Basic") || (HistoType == "Evol") )
00597     {gStyle->SetTitleW(0.5); gStyle->SetTitleH(0.075);}
00598 
00599   if( HistoType == "Stex2DEB" )
00600     {gStyle->SetTitleW(0.2); gStyle->SetTitleH(0.095);}
00601 
00602   if( HistoType == "Stex2DEE" )
00603     {gStyle->SetTitleW(0.45); gStyle->SetTitleH(0.08);}
00604 
00605   if( HistoType == "Stex2DEENb" )
00606     {gStyle->SetTitleW(0.85); gStyle->SetTitleH(0.08);}
00607 
00608   if( HistoType == "Stas2DEB" || HistoType == "Stas2DEE" )
00609     {gStyle->SetTitleW(0.225); gStyle->SetTitleH(0.095);}
00610 
00611   if(HistoType == "Global" || HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj")
00612     {gStyle->SetTitleW(0.5); gStyle->SetTitleH(0.08);}
00613 
00614   //............................. Statistics box style
00615      gStyle->SetOptStat(1110); 
00616 
00617   //............................. Statistics box size
00618   if( HistoType == "colz"  || HistoType == "lego"  ||
00619       HistoType == "surf"  || HistoType == "Stin" )
00620     {
00621       gStyle->SetStatW(0.55);  gStyle->SetStatH(0.2);
00622       gStyle->SetStatY(1);
00623     }
00624 
00625   if( HistoType == "Global" )
00626     {
00627       gStyle->SetStatW(0.375);  gStyle->SetStatH(0.180);
00628       gStyle->SetStatY(0.9875);
00629     }
00630   if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj" )
00631     {
00632       gStyle->SetStatW(0.375);  gStyle->SetStatH(0.180);
00633       gStyle->SetStatY(0.9875);
00634     }
00635 
00636   if( (HistoType == "H1Basic") || (HistoType == "Evol") )
00637     {
00638       gStyle->SetStatW(0.375);   gStyle->SetStatH(0.180);
00639       gStyle->SetStatY(0.9875);
00640     }
00641 
00642   //....... Marker and line style
00643 
00644   gStyle->SetMarkerStyle(1);
00645   if( HistoType == "Global" ){gStyle->SetMarkerStyle(20);}
00646 
00647 
00648 }
00649 //------- (end of SetViewHistoStyle) ----------------
00650 
00651 void TEcnaParHistos::SetViewHistoPadMargins(const TString HistoType, const TString opt_plot)
00652 {
00653 // Set active pad margins for histo view
00654 
00655 //.......... default
00656   gStyle->SetPadBottomMargin(0.125);              
00657   gStyle->SetPadTopMargin(0.125);
00658   gStyle->SetPadLeftMargin(0.125);
00659   gStyle->SetPadRightMargin(0.125);
00660   
00661   if(HistoType == "colz"  || HistoType == "lego"  ||
00662      HistoType == "surf"  || HistoType == "Stin")  
00663     {
00664       gStyle->SetPadBottomMargin(0.125);                  
00665       gStyle->SetPadTopMargin(0.135);
00666       gStyle->SetPadLeftMargin(0.135);
00667       gStyle->SetPadRightMargin(0.135); 
00668     }
00669   
00670   if( HistoType == "Stex2DEB" )
00671     {
00672       gStyle->SetPadBottomMargin(0.145);                  
00673       gStyle->SetPadTopMargin(0.135);
00674       gStyle->SetPadLeftMargin(0.125);
00675       gStyle->SetPadRightMargin(0.125); 
00676     }
00677 
00678   if( HistoType == "Stex2DEE" || HistoType == "Stex2DEENb")
00679     {
00680       gStyle->SetPadBottomMargin(0.120);                  
00681       gStyle->SetPadTopMargin(0.110);
00682       gStyle->SetPadLeftMargin(0.130);
00683       gStyle->SetPadRightMargin(0.130); 
00684     }
00685   if( HistoType == "Stas2DEB" )
00686     {
00687       gStyle->SetPadBottomMargin(0.145);                  
00688       gStyle->SetPadTopMargin(0.135);
00689       gStyle->SetPadLeftMargin(0.125);
00690       gStyle->SetPadRightMargin(0.125); 
00691     }
00692 
00693   if( HistoType == "Stas2DEE")
00694     {
00695       gStyle->SetPadBottomMargin(0.145);                  
00696       gStyle->SetPadTopMargin(0.135);
00697       gStyle->SetPadLeftMargin(0.105);
00698       gStyle->SetPadRightMargin(0.115); 
00699     }
00700   if(HistoType == "Global")
00701     {
00702       gStyle->SetPadBottomMargin((Float_t)0.125);                 
00703       gStyle->SetPadTopMargin((Float_t)0.175);
00704       gStyle->SetPadLeftMargin((Float_t)0.115);
00705       gStyle->SetPadRightMargin((Float_t)0.05);
00706     }
00707 
00708   if(HistoType == "Proj" || HistoType == "SampProj")
00709     {
00710       gStyle->SetPadBottomMargin(0.115);
00711       gStyle->SetPadTopMargin(0.155);
00712       gStyle->SetPadLeftMargin(0.15);
00713       gStyle->SetPadRightMargin(0.05);
00714     }
00715 
00716   if( HistoType == "H1Basic" )
00717     {
00718       gStyle->SetPadBottomMargin(0.1275);                 
00719       gStyle->SetPadTopMargin(0.165);
00720       gStyle->SetPadLeftMargin(0.15);
00721       gStyle->SetPadRightMargin(0.05);
00722     }
00723 
00724   if( HistoType == "Evol" && opt_plot == "ONLYONE")
00725     {
00726       gStyle->SetPadBottomMargin(0.110);                  
00727       gStyle->SetPadTopMargin(0.2);
00728       gStyle->SetPadLeftMargin(0.115);
00729       gStyle->SetPadRightMargin(0.035);
00730     }
00731   if( HistoType == "Evol" && opt_plot == "SAME")
00732     {
00733       gStyle->SetPadBottomMargin(0.110);                  
00734       gStyle->SetPadTopMargin(0.185);
00735       gStyle->SetPadLeftMargin(0.115);
00736       gStyle->SetPadRightMargin(0.035);   
00737     }
00738   if( HistoType == "Evol" && opt_plot == "SAME n")
00739     {
00740       gStyle->SetPadBottomMargin(0.110);                  
00741       gStyle->SetPadTopMargin(0.1);
00742       gStyle->SetPadLeftMargin(0.115);
00743       gStyle->SetPadRightMargin(0.035);   
00744     }
00745 
00746   if( HistoType == "EvolProj" && opt_plot == "ONLYONE")
00747     {
00748       gStyle->SetPadBottomMargin(0.1275);                 
00749       gStyle->SetPadTopMargin(0.165);
00750       gStyle->SetPadLeftMargin(0.15);
00751       gStyle->SetPadRightMargin(0.05);
00752     }
00753   if( HistoType == "EvolProj" && opt_plot == "SAME")
00754     {
00755       gStyle->SetPadBottomMargin(0.110);                  
00756       gStyle->SetPadTopMargin(0.185);
00757       gStyle->SetPadLeftMargin(0.115);
00758       gStyle->SetPadRightMargin(0.035);   
00759     }
00760   if( HistoType == "EvolProj" && opt_plot == "SAME n")
00761     {
00762       gStyle->SetPadBottomMargin(0.110);                  
00763       gStyle->SetPadTopMargin(0.1);
00764       gStyle->SetPadLeftMargin(0.115);
00765       gStyle->SetPadRightMargin(0.035);   
00766     }
00767 }
00768 //------- (end of SetViewHistoPadMargins) ----------------
00769 
00770 //===========================================================================
00771 //
00772 //      SetViewHistoStats, SetViewHistoOffsets,
00773 //      AxisTitleOffset, AxisTitleSize, AxisLabelOffset,
00774 //      AxisLabelSize, AxisTickSize, DeeOffsetX, DeeNameOffsetX,
00775 //      SetViewGraphOffsets
00776 //      
00777 //===========================================================================
00778 void TEcnaParHistos::SetViewHistoStats(TH1D* histo, const TString HistoType)
00779 {
00780   // Set stats box for histo view
00781 
00782   Bool_t b_true  = kTRUE;
00783   Bool_t b_false = kFALSE;
00784 
00785   histo->SetStats(b_false);
00786               
00787   if(HistoType == "Global"){histo->SetStats(b_false);}
00788   if(HistoType == "Proj" || HistoType == "SampProj" ){histo->SetStats(b_true);}
00789 }
00790 
00791 void TEcnaParHistos::SetViewHistoOffsets(TH1D* histo, const TString HistoType, const TString opt_plot)
00792 {
00793 // Set offsets of labels, title axis, etc... for histo view
00794   
00795   if(HistoType == "Global")
00796     {
00797       //....................... x axis
00798       histo->GetXaxis()->SetTitleOffset((Float_t)1.05);
00799       histo->GetXaxis()->SetTitleSize((Float_t)0.04);
00800 
00801       histo->GetXaxis()->SetLabelOffset((Float_t)0.006);
00802       histo->GetXaxis()->SetLabelSize((Float_t)0.04);
00803 
00804       histo->GetXaxis()->SetTickLength((Float_t)0.03);
00805       histo->GetXaxis()->SetNdivisions((Int_t)510);
00806 
00807       //....................... y axis
00808       histo->GetYaxis()->SetTitleOffset((Float_t)1.5);
00809       histo->GetYaxis()->SetTitleSize((Float_t)0.04);
00810 
00811       histo->GetYaxis()->SetLabelOffset((Float_t)0.01);
00812       histo->GetYaxis()->SetLabelSize((Float_t)0.04);
00813 
00814       histo->GetYaxis()->SetTickLength((Float_t)0.03);
00815       histo->GetYaxis()->SetNdivisions((Int_t)510);
00816     }
00817   
00818   if(HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj" )
00819     {
00820       //....................... x axis
00821       histo->GetXaxis()->SetTitleOffset((Float_t)1.05);
00822       histo->GetXaxis()->SetTitleSize((Float_t)0.04);
00823 
00824       histo->GetXaxis()->SetLabelOffset((Float_t)0.006);
00825       histo->GetXaxis()->SetLabelSize((Float_t)0.04);
00826 
00827       histo->GetXaxis()->SetTickLength((Float_t)0.03);
00828       histo->GetXaxis()->SetNdivisions((Int_t)510);
00829 
00830       //....................... y axis
00831       histo->GetYaxis()->SetTitleOffset((Float_t)1.75);
00832       histo->GetYaxis()->SetTitleSize((Float_t)0.04);
00833 
00834       histo->GetYaxis()->SetLabelOffset((Float_t)0.01);
00835       histo->GetYaxis()->SetLabelSize((Float_t)0.04);
00836 
00837       histo->GetYaxis()->SetTickLength((Float_t)0.03);
00838       histo->GetYaxis()->SetNdivisions((Int_t)510);
00839     }
00840   
00841   if( HistoType == "H1Basic" || HistoType == "Evol" ||
00842       ( HistoType == "EvolProj" && !(opt_plot == "SAME" || opt_plot == "SAME n") ) )
00843     {
00844       //....................... x axis
00845       histo->GetXaxis()->SetTitleOffset((Float_t)1.25);
00846       histo->GetXaxis()->SetTitleSize((Float_t)0.04);
00847 
00848       histo->GetXaxis()->SetLabelOffset((Float_t)0.005);
00849       histo->GetXaxis()->SetLabelSize((Float_t)0.04);
00850 
00851       histo->GetXaxis()->SetTickLength((Float_t)0.03);
00852       histo->GetXaxis()->SetNdivisions((Int_t)510);
00853 
00854       //....................... y axis
00855       histo->GetYaxis()->SetTitleOffset((Float_t)1.75);
00856       histo->GetYaxis()->SetTitleSize((Float_t)0.04);
00857       
00858       histo->GetYaxis()->SetLabelOffset((Float_t)0.01);
00859       histo->GetYaxis()->SetLabelSize((Float_t)0.04);
00860       
00861       histo->GetYaxis()->SetTickLength((Float_t)0.03);
00862       histo->GetYaxis()->SetNdivisions((Int_t)510);
00863     }
00864   
00865   if( HistoType == "EvolProj" && (opt_plot == "SAME" || opt_plot == "SAME n") )
00866     {
00867       //....................... x axis
00868       histo->GetXaxis()->SetTitleOffset((Float_t)1.25);
00869       histo->GetXaxis()->SetTitleSize((Float_t)0.04);
00870       
00871       histo->GetXaxis()->SetLabelOffset((Float_t)0.005);
00872       histo->GetXaxis()->SetLabelSize((Float_t)0.04);
00873 
00874       histo->GetXaxis()->SetTickLength((Float_t)0.03);
00875       histo->GetXaxis()->SetNdivisions((Int_t)510);
00876 
00877       //....................... y axis
00878       histo->GetYaxis()->SetTitleOffset((Float_t)1.25);
00879       histo->GetYaxis()->SetTitleSize((Float_t)0.04);
00880 
00881       histo->GetYaxis()->SetLabelOffset((Float_t)0.01);
00882       histo->GetYaxis()->SetLabelSize((Float_t)0.04);
00883 
00884       histo->GetYaxis()->SetTickLength((Float_t)0.03);
00885       histo->GetYaxis()->SetNdivisions((Int_t)510);
00886     }
00887   
00888   if(HistoType == "colz")
00889     {
00890       //....................... x axis
00891       histo->GetXaxis()->SetTitleOffset((Float_t)1.25);
00892       histo->GetXaxis()->SetTitleSize((Float_t)0.04);
00893 
00894       histo->GetXaxis()->SetLabelOffset((Float_t)0.005);
00895       histo->GetXaxis()->SetLabelSize((Float_t)0.04);
00896 
00897       histo->GetXaxis()->SetTickLength((Float_t)0.03);
00898       histo->GetXaxis()->SetNdivisions((Int_t)510);
00899 
00900       //....................... y axis
00901       histo->GetYaxis()->SetTitleOffset((Float_t)1.45);
00902       histo->GetYaxis()->SetTitleSize((Float_t)0.04);
00903 
00904       histo->GetYaxis()->SetLabelOffset((Float_t)0.01);
00905       histo->GetYaxis()->SetLabelSize((Float_t)0.04);
00906 
00907       histo->GetYaxis()->SetTickLength((Float_t)0.03);
00908       histo->GetYaxis()->SetNdivisions((Int_t)510);
00909     }
00910 
00911   if(HistoType == "lego" || HistoType == "surf" )
00912     {
00913       //....................... x axis
00914       histo->GetXaxis()->SetTitleOffset((Float_t)1.7);
00915       histo->GetXaxis()->SetTitleSize((Float_t)0.04);
00916 
00917       histo->GetXaxis()->SetLabelOffset((Float_t)0.005);
00918       histo->GetXaxis()->SetLabelSize((Float_t)0.04);
00919 
00920       histo->GetXaxis()->SetTickLength((Float_t)0.03);
00921       histo->GetXaxis()->SetNdivisions((Int_t)510);
00922 
00923       //....................... y axis
00924       histo->GetYaxis()->SetTitleOffset((Float_t)1.85);
00925       histo->GetYaxis()->SetTitleSize((Float_t)0.04);
00926 
00927       histo->GetYaxis()->SetLabelOffset((Float_t)0.01);
00928       histo->GetYaxis()->SetLabelSize((Float_t)0.04);
00929 
00930       histo->GetYaxis()->SetTickLength((Float_t)0.03);
00931       histo->GetYaxis()->SetNdivisions((Int_t)510);
00932     }
00933 
00934   if(HistoType == "Stin")
00935     {
00936       //.......... x axis (remove labels and ticks)
00937       histo->GetXaxis()->SetTitleOffset((Float_t)9999.);
00938       histo->GetXaxis()->SetTitleSize((Float_t)0.05); 
00939  
00940       histo->GetXaxis()->SetLabelOffset((Float_t)9999.);
00941       histo->GetXaxis()->SetLabelSize((Float_t)0.);
00942 
00943       histo->GetXaxis()->SetNdivisions((Int_t)1);
00944       histo->GetXaxis()->SetTickLength((Float_t)0.);
00945 
00946       //.......... y axis (remove labels and ticks)
00947       histo->GetYaxis()->SetTitleOffset((Float_t)9999.);
00948       histo->GetYaxis()->SetTitleSize((Float_t)0.05);
00949      
00950       histo->GetYaxis()->SetLabelOffset((Float_t)9999.);
00951       histo->GetYaxis()->SetLabelSize((Float_t)0.);
00952 
00953       histo->GetYaxis()->SetNdivisions((Int_t)1);
00954       histo->GetYaxis()->SetTickLength((Float_t)0.);
00955     }
00956 
00957   if( HistoType == "Stex2DEB" || HistoType == "Stex2DEE" || HistoType == "Stex2DEENb" ||
00958       HistoType == "Stas2DEB" || HistoType == "Stas2DEE" )
00959     {
00960       //.......... x axis (remove labels and ticks)
00961       histo->GetXaxis()->SetTitleOffset((Float_t)9999.);
00962       histo->GetXaxis()->SetTitleSize((Float_t)0.075); 
00963  
00964       histo->GetXaxis()->SetLabelOffset((Float_t)9999.);
00965       histo->GetXaxis()->SetLabelSize((Float_t)0.);
00966 
00967       histo->GetXaxis()->SetNdivisions((Int_t)1);
00968       histo->GetXaxis()->SetTickLength((Float_t)0.);
00969 
00970       //.......... y axis (remove labels and ticks)
00971       histo->GetYaxis()->SetTitleOffset((Float_t)9999.);
00972       histo->GetYaxis()->SetTitleSize((Float_t)0.075);
00973      
00974       histo->GetYaxis()->SetLabelOffset((Float_t)9999.);
00975       histo->GetYaxis()->SetLabelSize((Float_t)0.);
00976 
00977       histo->GetYaxis()->SetNdivisions((Int_t)1);
00978       histo->GetYaxis()->SetTickLength((Float_t)0.);
00979     }
00980 }
00981 
00982 //----------------------------------------------
00983 Float_t TEcnaParHistos::AxisTitleOffset()
00984 {
00985  return AxisTitleOffset("");
00986 }
00987 Float_t TEcnaParHistos::AxisTitleOffset(const TString opt)
00988 {
00989   Float_t tit_off = 1.;
00990 
00991   if( opt == ""        ){tit_off = 0.055;}
00992   if( opt == "Towx"    ){tit_off = 1.15;}
00993   if( opt == "Towy"    ){tit_off = 1.15;}
00994   if( opt == "SMx"     ){tit_off = 1.15;}
00995   if( opt == "SMy"     ){tit_off = 0.5;}
00996   if( opt == "SMyInEB" ){tit_off = 0.7;}
00997   if( opt == "EBy"     ){tit_off = 1.;}
00998   if( opt == "EBx"     ){tit_off = 1.3;}
00999 
01000   if( opt == "SCx" ){tit_off = 1.15;}
01001   if( opt == "SCy" ){tit_off = 1.15;}
01002   if( opt == "Deex"){tit_off = 0.75;}
01003   if( opt == "Deey"){tit_off = 1.2;}
01004   if( opt == "EEx" ){tit_off = 1.2;}
01005   if( opt == "EEy" ){tit_off = 1.;}
01006 
01007   return tit_off;
01008 }
01009 //............................................
01010 Float_t TEcnaParHistos::AxisTitleSize()
01011 {
01012  return AxisTitleSize("");
01013 }
01014 Float_t  TEcnaParHistos::AxisTitleSize(const TString opt)
01015 {
01016   Float_t tit_siz = 0.045;
01017   if( opt == ""  ){tit_siz = 0.045;}
01018   return tit_siz;
01019 }
01020 //............................................
01021 Float_t  TEcnaParHistos::AxisLabelOffset()
01022 {
01023  return AxisLabelOffset("");
01024 }
01025 Float_t TEcnaParHistos::AxisLabelOffset(const TString opt)
01026 {
01027   Float_t lab_off = 0.02;
01028   if( opt == ""    ){lab_off = 0.02;}
01029 
01030   if( opt == "Towx"){lab_off = 0.01;}
01031   if( opt == "Towy"){lab_off = 0.03;}
01032   if( opt == "SMx" ){lab_off = 0.01;}
01033   if( opt == "SMy" ){lab_off = 0.015;}
01034   if( opt == "EBx" ){lab_off = 0.03;}
01035   if( opt == "EBy" ){lab_off = 0.015;}
01036 
01037   if( opt == "SCx" ){lab_off = 0.01;}
01038   if( opt == "SCy" ){lab_off = 0.03;}
01039   if( opt == "Deex"){lab_off = 0.002;}
01040   if( opt == "Deey"){lab_off = 0.03;}
01041   if( opt == "EEx" ){lab_off = 0.015;}
01042   if( opt == "EEy" ){lab_off = 0.02;}
01043 
01044   return lab_off;
01045 }
01046 //............................................
01047 Float_t TEcnaParHistos::AxisLabelSize()
01048 {
01049  return AxisLabelSize("");
01050 }
01051 Float_t  TEcnaParHistos::AxisLabelSize(const TString opt)
01052 {
01053   Float_t lab_siz = 0.035;
01054   if( opt == "SMx"  ){lab_siz = 0.05;}
01055   if( opt == "SMy"  ){lab_siz = 0.05;}
01056   if( opt == "EBx"  ){lab_siz = 0.04;}
01057   if( opt == "EBy"  ){lab_siz = 0.04;}
01058   return lab_siz;
01059 }
01060 //............................................
01061 Float_t TEcnaParHistos::AxisTickSize()
01062 {
01063  return AxisTickSize("");
01064 }
01065 Float_t TEcnaParHistos::AxisTickSize(const TString opt)
01066 {
01067 //.......... works only with option "S" in TGaxis
01068   Float_t tic_siz = 0.;  
01069   if( opt == "Dee"  ){tic_siz = 0.;}
01070   if( opt == "Deex" ){tic_siz = 0.01;}
01071   if( opt == "Deey" ){tic_siz = 0.02;}
01072   if( opt == "SMx"  ){tic_siz = 0.03;}
01073   if( opt == "SMy"  ){tic_siz = 0.0075;}
01074   if( opt == "EEx"  ){tic_siz = 0.06;}
01075   if( opt == "EEy"  ){tic_siz = 0.005;}
01076 
01077   return tic_siz;
01078 }
01079 //-----------------------------------------------
01080 
01081 void TEcnaParHistos::SetViewGraphOffsets(TGraph* graph, const TString HistoType)
01082 {
01083 // Set offsets of labels, title axis, etc... for histo view
01084 
01085   if( (HistoType == "H1Basic") || (HistoType == "Evol") )
01086     {
01087       //....................... x axis
01088       graph->GetXaxis()->SetTitleOffset((Float_t)1.10);
01089       graph->GetXaxis()->SetTitleSize((Float_t)0.04);
01090 
01091       graph->GetXaxis()->SetLabelOffset((Float_t)0.015);
01092       graph->GetXaxis()->SetLabelSize((Float_t)0.04);
01093 
01094       graph->GetXaxis()->SetTickLength((Float_t)0.02);
01095       graph->GetXaxis()->SetNdivisions((Int_t)510);
01096 
01097       //....................... y axis
01098       graph->GetYaxis()->SetTitleOffset((Float_t)1.25);
01099       graph->GetYaxis()->SetTitleSize((Float_t)0.04);
01100 
01101       graph->GetYaxis()->SetLabelOffset((Float_t)0.01);
01102       graph->GetYaxis()->SetLabelSize((Float_t)0.04);
01103 
01104       graph->GetYaxis()->SetTickLength((Float_t)0.03);
01105       graph->GetYaxis()->SetNdivisions((Int_t)510);
01106     }
01107 }
01108 //-----------------------------------------------
01109 Float_t TEcnaParHistos::DeeOffsetX(const TString opt_plot, const Int_t& DeeNumber)
01110 {
01111   Float_t offset = 0;
01112   if( opt_plot == "Dee" ){offset = 0;}
01113   if( opt_plot == "EE"  )
01114     {
01115       Double_t vertic_empty_strip_1 = 1.;
01116       if( DeeNumber == 1 ){offset = vertic_empty_strip_1
01117                              + fEcal->MaxStinHocoInStex()+ 2*fEcal->MaxStinHocoInStex() + 1.;}
01118       if( DeeNumber == 2 ){offset = vertic_empty_strip_1 + 2*fEcal->MaxStinHocoInStex() + 1.;}
01119       if( DeeNumber == 3 ){offset = vertic_empty_strip_1 + fEcal->MaxStinHocoInStex();}
01120       if( DeeNumber == 4 ){offset = vertic_empty_strip_1 + 0.;}
01121     }
01122   return offset;
01123 }
01124 
01125 //-----------------------------------------------
01126 Float_t TEcnaParHistos::DeeNameOffsetX(const Int_t& DeeNumber)
01127 {
01128   Float_t offset = 0;
01129 
01130   if( DeeNumber == 1 ){offset = 8.;}
01131   if( DeeNumber == 2 ){offset = 0.;}
01132   if( DeeNumber == 3 ){offset = 7.6;}
01133   if( DeeNumber == 4 ){offset = -0.5;}
01134   
01135   return offset;
01136 }
01137 //-----------------------------------------------
01138 Float_t TEcnaParHistos::DeeNumberOffsetX(const TString opt_plot, const Int_t& DeeNumber)
01139 {
01140   Float_t offset = 0;
01141 
01142   if( opt_plot == "Dee"  )
01143     {
01144       if( DeeNumber == 1 ){offset = 2.5;}
01145       if( DeeNumber == 2 ){offset = 41.5;}
01146       if( DeeNumber == 3 ){offset = 2.5;}
01147       if( DeeNumber == 4 ){offset = 41.5;}
01148     }
01149   if( opt_plot == "EE"  )
01150     {
01151       if( DeeNumber == 1 ){offset = 0.42;}
01152       if( DeeNumber == 2 ){offset = 8.15;}
01153       if( DeeNumber == 3 ){offset = 0.42;}
01154       if( DeeNumber == 4 ){offset = 8.15;}
01155     }
01156   return offset;
01157 }
01158 //===========================================================================
01159 //
01160 //     SetPaveGeneralComment,
01161 //     SetPaveAnalysisRun, SetPaveNbOfEvts,
01162 //     SetPaveEvolNbOfEvtsAna, SetPaveEvolRuns,
01163 //     SetOptionSamePaveBorder
01164 //
01165 //
01166 //                           W A R N I N G
01167 //
01168 //     ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
01169 //
01170 //     WARNING => Paves for plot option "SEVERAL" and "SAMEONE" are treated
01171 //                in TEcnaHistos
01172 //
01173 //     ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
01174 //
01175 //===========================================================================
01176 
01177 TPaveText* TEcnaParHistos::SetPaveGeneralComment(const TString comment)
01178 {
01179 // General comment
01180  
01181   TPaveText* title_g1;
01182  
01183   if( comment != "" )
01184     {
01185       fCnew++;
01186       
01187       Double_t pav_gen_xgauche = BoxLeftX("general_comment");
01188       Double_t pav_gen_xdroite = BoxRightX("general_comment");
01189       Double_t pav_gen_ybas    = BoxBottomY("general_comment");
01190       Double_t pav_gen_yhaut   = BoxTopY("general_comment");
01191 
01192       title_g1 =
01193         new TPaveText(pav_gen_xgauche, pav_gen_ybas,
01194                       pav_gen_xdroite, pav_gen_yhaut);       fCnewRoot++;
01195 
01196       Option_t* opt_pav = "arc";  title_g1->SetOption(opt_pav);  // <= NE MARCHE PAS
01197       
01198       TString tit_gen = comment.Data();
01199       
01200       //<<<<<<< TEcnaParHistos.cc
01201       //sprintf( f_in, tit_gen.Data());
01202       //title_g1->AddText(f_in);
01203       //=======
01204       title_g1->AddText(tit_gen);
01205       //>>>>>>> 1.5
01206 
01207       //   1 = left adjusted, 2 = vertically centered      
01208       Int_t    cTextPaveAlign   = 12;    title_g1->SetTextAlign(cTextPaveAlign);
01209       // 10*10 = 10*(ID10 = Courier New) // 10*4  = 10*(ID4  = Arial)      
01210       Int_t    cTextPaveFont    = 40;    title_g1->SetTextFont(cTextPaveFont);
01211       // 0.95 = 95% of the pave size      
01212       Float_t  cTextPaveSize    = 0.04;  title_g1->SetTextSize(cTextPaveSize);
01213       Int_t    cTextBorderSize  = 0;     title_g1->SetBorderSize(cTextBorderSize);
01214       Double_t cTextPaveRadius  = 5.;    title_g1->SetCornerRadius(cTextPaveRadius); // <= NE MARCHE PAS
01215       // Int_t cTextPaveShadCol = 0; title_g1->SetShadowColor(cTextPaveShadCol);  // <= methode non reconnue   
01216 
01217       fCdelete++;
01218     }
01219   else
01220     {
01221       title_g1 = new TPaveText( 0, 0, 0, 0);  title_g1=0;  fCnewRoot++;
01222     }
01223   return title_g1;
01224 }
01225 
01226 TPaveText* TEcnaParHistos::SetPaveAnalysisRun(const TString ana_type,  const Int_t&  nb_of_samples,
01227                                              const Int_t& run_number, const TString run_type,
01228                                              const Int_t& first_evt,  const Int_t&  last_evt, const TString nb_col)
01229 {
01230 // Analysis name + Nb of samples + run number comment
01231 
01232   char* f_in = new char[fgMaxCar];                           fCnew++;
01233   
01234   //...................... Pave Analysis name/run number (bottom_left_box)
01235   Double_t pav_bot_left_xgauche = BoxLeftX("bottom_left_box");
01236   Double_t pav_bot_left_xdroite = BoxRightX("bottom_left_box");
01237   Double_t pav_bot_left_ybas    = BoxBottomY("bottom_left_box");
01238   Double_t pav_bot_left_yhaut   = BoxTopY("bottom_left_box");
01239 
01240   TPaveText *com_bot_left =
01241     new TPaveText(pav_bot_left_xgauche, pav_bot_left_ybas,
01242                   pav_bot_left_xdroite, pav_bot_left_yhaut);  fCnewRoot++;
01243 
01244   // (1 = left adjusted, 2 = centered adjusted, 3 = left adjusted), 2 = vertically centered
01245   Int_t   cTextPaveAlign   = 12;    com_bot_left->SetTextAlign(cTextPaveAlign);
01246   // 10*10 = 10*(ID10 = Courier New) // 10*4  = 10*(ID4  = Arial)
01247   Int_t   cTextPaveFont    = 100;    com_bot_left->SetTextFont(cTextPaveFont); 
01248   // 0.95 = 95% of the pave size         
01249   Float_t cTextPaveSize    = 0.025;  com_bot_left->SetTextSize(cTextPaveSize);
01250   // Int_t   cTextPaveShadCol = 0;     com_bot_left->SetShadowColor(cTextPaveShadCol);
01251   Int_t   cTextBorderSize = 1;      com_bot_left->SetBorderSize(cTextBorderSize);
01252 
01253   if( nb_col == "TwoCol")
01254     {
01255       cTextPaveSize = 0.035; com_bot_left->SetTextSize(cTextPaveSize);
01256       sprintf(f_in, "Run:  %d                  Samples:   1 - %d", run_number, nb_of_samples);   
01257       com_bot_left->AddText(f_in);
01258       cTextPaveSize = 0.035; com_bot_left->SetTextSize(cTextPaveSize);
01259       sprintf(f_in, "Type: %-20s", run_type.Data());  
01260       com_bot_left->AddText(f_in);
01261       sprintf(f_in, "Analysis: %-10s         Evts range: %d - %d ", ana_type.Data(), first_evt, last_evt);
01262       com_bot_left->AddText(f_in);   
01263     }
01264   else
01265     {
01266       cTextPaveSize    = 0.0225;  com_bot_left->SetTextSize(cTextPaveSize);
01267       sprintf(f_in, "Run:  %d ", run_number);  
01268       com_bot_left->AddText(f_in);
01269       sprintf(f_in, "Type: %-20s", run_type.Data());  
01270       com_bot_left->AddText(f_in);
01271       sprintf(f_in, "Analysis: %-10s ", ana_type.Data());
01272       com_bot_left->AddText(f_in);
01273       Int_t un = 1; 
01274       sprintf(f_in, "Samples:    %d - %d", un, nb_of_samples);
01275       com_bot_left->AddText(f_in);
01276       sprintf(f_in, "Evts range: %d - %d", first_evt, last_evt);
01277       com_bot_left->AddText(f_in);
01278     }
01279 
01280   delete [] f_in;                                           fCdelete++;
01281   
01282   return com_bot_left;
01283 }
01284 
01285 TPaveText* TEcnaParHistos::SetPaveNbOfEvts(const Int_t& nb_of_evts,
01286                                           const TString start_date, const TString stop_date,
01287                                           const TString nb_col)
01288 {
01289 // Number of events box
01290 
01291   char* f_in = new char[fgMaxCar];                           fCnew++;
01292   
01293   //...................... Pave number of events (bottom_right_box)
01294 
01295   Double_t pav_bot_right_xgauche = BoxLeftX("bottom_right_box");
01296   Double_t pav_bot_right_xdroite = BoxRightX("bottom_right_box");
01297   Double_t pav_bot_right_ybas    = BoxBottomY("bottom_right_box");
01298   Double_t pav_bot_right_yhaut   = BoxTopY("bottom_right_box");
01299   TPaveText *com_bot_right =
01300     new TPaveText(pav_bot_right_xgauche, pav_bot_right_ybas,
01301                   pav_bot_right_xdroite, pav_bot_right_yhaut);      fCnewRoot++;
01302 
01303   // 1 = left adjusted, 2 = vertically centered
01304   Int_t   cTextPaveAlign   = 12;     com_bot_right->SetTextAlign(cTextPaveAlign);
01305   // 10*4 = 10*(ID4 = Arial)   // 10*10 = 10*(ID10 = Courier New)          
01306   Int_t   cTextPaveFont    = 100;    com_bot_right->SetTextFont(cTextPaveFont);         
01307   // 0.05 = 5% of the pave size        
01308   Float_t cTextPaveSize    = 0.025;  com_bot_right->SetTextSize(cTextPaveSize);
01309   //Int_t   cTextPaveShadCol = 0;     com_bot_right->SetShadowColor(cTextPaveShadCol);
01310   Int_t   cTextBorderSize = 1;       com_bot_right->SetBorderSize(cTextBorderSize);
01311 
01312   if( nb_col == "TwoCol")
01313     {
01314       cTextPaveSize = 0.0325; com_bot_right->SetTextSize(cTextPaveSize);
01315       sprintf(f_in, "First evt: %s              %8d events ", start_date.Data(), nb_of_evts);
01316       com_bot_right->AddText(f_in);  
01317       sprintf(f_in, "Last  evt: %s ",  stop_date.Data());
01318       com_bot_right->AddText(f_in);
01319     }
01320   else
01321     {
01322       cTextPaveSize = 0.0225; com_bot_right->SetTextSize(cTextPaveSize);
01323       sprintf(f_in, "%d events", nb_of_evts);
01324       com_bot_right->AddText(f_in);     
01325       sprintf(f_in, "First evt: %s ", start_date.Data());
01326       com_bot_right->AddText(f_in);      
01327       sprintf(f_in, "Last  evt: %s ",  stop_date.Data());
01328       com_bot_right->AddText(f_in);
01329     }
01330   
01331   delete [] f_in;                                           fCdelete++;
01332   
01333   return com_bot_right;
01334 }
01335 
01336 TPaveText* TEcnaParHistos::SetPaveEvolNbOfEvtsAna(const TString ana_type,      const Int_t& nb_of_samples,
01337                                                  const Int_t&  first_req_evt, const Int_t& last_req_evt,
01338                                                  const TString HistoType)
01339 {
01340 // Analysis name + run number comment
01341 
01342   char* f_in = new char[fgMaxCar];                           fCnew++;
01343   
01344   //...................... Pave Analysis name/run number (bottom_left_box)
01345   Double_t pav_bot_left_xgauche = BoxLeftX("bottom_left_box");
01346   Double_t pav_bot_left_xdroite = BoxRightX("bottom_left_box");
01347   Double_t pav_bot_left_ybas    = BoxBottomY("bottom_left_box");
01348   Double_t pav_bot_left_yhaut   = BoxTopY("bottom_left_box");
01349 
01350   if( HistoType == "EvolProj" )
01351     {
01352       pav_bot_left_xgauche = BoxLeftX("bottom_left_box_evol");
01353       pav_bot_left_xdroite = BoxRightX("bottom_left_box_evol");
01354       pav_bot_left_ybas    = BoxBottomY("bottom_left_box_evol");
01355       pav_bot_left_yhaut   = BoxTopY("bottom_left_box_evol");
01356     }
01357 
01358   TPaveText *com_bot_left =
01359     new TPaveText(pav_bot_left_xgauche, pav_bot_left_ybas,
01360                   pav_bot_left_xdroite, pav_bot_left_yhaut);  fCnewRoot++;
01361   
01362   // 1 = left adjusted, 2 = vertically centered
01363   Int_t   cTextPaveAlign = 12;    com_bot_left->SetTextAlign(cTextPaveAlign);
01364   // 10*10 = 10*(ID10 = Courier New)    // 10*4 = 10*(ID4 = Arial)        
01365   Int_t   cTextPaveFont  = 100;   com_bot_left->SetTextFont(cTextPaveFont);      
01366   // 0.95 = 95% of the pave size   
01367   Float_t cTextPaveSize  = 0.03;  com_bot_left->SetTextSize(cTextPaveSize);
01368   Int_t   cTextBorderSize = 1;    com_bot_left->SetBorderSize(cTextBorderSize);
01369 
01370   TString analysis_name    = ana_type.Data();
01371 
01372   sprintf(f_in, "Analysis:   %s", analysis_name.Data());
01373   com_bot_left->AddText(f_in);
01374   sprintf(f_in, "Samples:    1 - %d", nb_of_samples);
01375   com_bot_left->AddText(f_in);
01376   sprintf(f_in, "Evts range: %d - %d ", first_req_evt, last_req_evt);
01377   com_bot_left->AddText(f_in);
01378 
01379   delete [] f_in;                                           fCdelete++;
01380   
01381   return com_bot_left;
01382 }
01383 
01384 TPaveText* TEcnaParHistos::SetPaveEvolRuns(const Int_t&  start_evol_run, const TString start_evol_date,
01385                                           const Int_t&  stop_evol_run,  const TString stop_evol_date,
01386                                           const TString opt_plot,       const TString HistoType)
01387 {
01388 // First and last run of the list of runs
01389 
01390   char* f_in = new char[fgMaxCar];                           fCnew++;
01391 
01392   //...................... Pave first and last runs (bottom_right_box)
01393   Double_t pav_border_xgauche = BoxLeftX("bottom_right_box_evol");
01394   Double_t pav_border_xdroite = BoxRightX("bottom_right_box_evol");
01395   Double_t pav_border_ybas    = BoxBottomY("bottom_right_box_evol");
01396   Double_t pav_border_yhaut   = BoxTopY("bottom_right_box_evol");
01397 
01398   if( opt_plot == "SAME n" )
01399     {
01400       pav_border_xgauche = BoxLeftX("bottom_right_box_evpr");
01401       pav_border_xdroite = BoxRightX("bottom_right_box_evpr");
01402       pav_border_ybas    = BoxBottomY("top_right_box_EB");
01403       pav_border_yhaut   = BoxTopY("top_right_box_EB");
01404     }
01405 
01406   TPaveText *pav_evol_runs =
01407     new TPaveText(pav_border_xgauche, pav_border_ybas,
01408                   pav_border_xdroite, pav_border_yhaut);      fCnewRoot++;
01409 
01410   // 1 = left adjusted, 2 = vertically centered
01411   Int_t   cTextPaveAlign = 12; pav_evol_runs->SetTextAlign(cTextPaveAlign);
01412   // 10*4 = 10*(ID4 = Courier helvetica-medium-r-normal = Arial)
01413   // 10*10 = 10*(ID10 = Courier bold-r-normal = Courier New)          
01414   Int_t   cTextPaveFont  = 100; pav_evol_runs->SetTextFont(cTextPaveFont);
01415   // 0.03 = 3% of the pave height           
01416   Float_t cTextPaveSize  = 0.025;
01417   if( HistoType == "Evol" || HistoType == "EvolProj"){cTextPaveSize  = 0.0225;}
01418 
01419   pav_evol_runs->SetTextSize(cTextPaveSize);
01420   Int_t   cTextBorderSize = 1; pav_evol_runs->SetBorderSize(cTextBorderSize);
01421 
01422   if( !( (HistoType == "Evol"     && opt_plot == "SAME n") ||
01423          (HistoType == "EvolProj" && opt_plot == "SAME n") ) )
01424     {
01425       sprintf(f_in, "First run: %d", start_evol_run);
01426       pav_evol_runs->AddText(f_in);
01427       sprintf(f_in, "(%s) ", start_evol_date.Data());
01428       pav_evol_runs->AddText(f_in);
01429       sprintf(f_in, "Last run:  %d", stop_evol_run);
01430       pav_evol_runs->AddText(f_in);
01431       sprintf(f_in, "(%s) ", stop_evol_date.Data());
01432       pav_evol_runs->AddText(f_in);
01433     }
01434 
01435   if( (HistoType == "Evol"     && opt_plot == "SAME n") ||
01436       (HistoType == "EvolProj" && opt_plot == "SAME n") )
01437     {
01438       sprintf(f_in, "First run: %d (%s) ", start_evol_run, start_evol_date.Data());
01439       pav_evol_runs->AddText(f_in);
01440       sprintf(f_in, "Last run:  %d (%s)", stop_evol_run, stop_evol_date.Data());
01441       pav_evol_runs->AddText(f_in);
01442     }
01443 
01444   delete [] f_in;                                           fCdelete++;
01445   
01446   return pav_evol_runs;
01447 }
01448 
01449 TPaveText* TEcnaParHistos::SetOptionSamePaveBorder(const TString chopt, const TString HistoType)
01450 {
01451 // Pave for plots with option SAME and SAME n.
01452 // Gives just the size/border and return the pointer to the Pave. No text.
01453 // The Pave text is drawn in TEcnaHistos.cc
01454   
01455   //.................................. DEFAULT OPTION: "several"
01456   
01457   Double_t pav_left_xgauche = BoxLeftX("several_plots_box");
01458   Double_t pav_left_xdroite = BoxRightX("several_plots_box");
01459   Double_t pav_left_ybas    = BoxBottomY("several_plots_box");
01460   Double_t pav_left_yhaut   = BoxTopY("several_plots_box");
01461 
01462   if(chopt == "sevevol")
01463     {    
01464       pav_left_xgauche = BoxLeftX("several_evol_box");
01465       pav_left_xdroite = BoxRightX("several_evol_box");
01466       pav_left_ybas    = BoxBottomY("several_evol_box");
01467       pav_left_yhaut   = BoxTopY("several_evol_box");
01468 
01469       if( HistoType == "EvolProj" )
01470         {
01471           pav_left_xgauche = BoxLeftX("several_evpr_box");
01472           pav_left_xdroite = BoxRightX("several_evpr_box");
01473           pav_left_ybas    = BoxBottomY("several_evpr_box");
01474           pav_left_yhaut   = BoxTopY("several_evpr_box");
01475         }
01476     }
01477 
01478   TPaveText *com_several =
01479     new TPaveText(pav_left_xgauche, pav_left_ybas,
01480                   pav_left_xdroite, pav_left_yhaut);  fCnewRoot++;
01481 
01482   return com_several;
01483 }
01484 //.... end of SetOptionSamePaveBorder
01485 //===========================================================================
01486 //
01487 //     SetPaveSM, SetPaveTower, SetPaveTowersXY,
01488 //     SetPaveEBCrystal, SetPaveEBCrystalSample,
01489 //     SetPaveLVRB, SetColorsForNumbers
01490 //
01491 //===========================================================================
01492 TPaveText* TEcnaParHistos::SetPaveStas()
01493 {
01494   char* f_in = new char[fgMaxCar];                           fCnew++;
01495   //.................................. DEFAULT OPTION: "standard"   
01496   Double_t pav_top_left_xgauche = BoxLeftX("top_left_box_SM");
01497   Double_t pav_top_left_xdroite = BoxRightX("top_left_box_SM");
01498   Double_t pav_top_left_ybas    = BoxBottomY("top_left_box_SM");
01499   Double_t pav_top_left_yhaut   = BoxTopY("top_left_box_SM");
01500 
01501   TPaveText *com_top_left =
01502     new TPaveText(pav_top_left_xgauche, pav_top_left_ybas,
01503                   pav_top_left_xdroite, pav_top_left_yhaut);  fCnewRoot++;
01504  
01505   // 1 = left adjusted, 2 = vertically centered
01506   Int_t   cTextPaveAlign  = 12;   com_top_left->SetTextAlign(cTextPaveAlign);
01507   // 10*10 = 10*(ID10 = Courier New)          
01508   Int_t   cTextPaveFont   = 100;  com_top_left->SetTextFont(cTextPaveFont);
01509   // 0.95 = 95% of the pave size         
01510   Float_t cTextPaveSize   = 0.04; com_top_left->SetTextSize(cTextPaveSize);
01511   Int_t   cTextBorderSize = 1;    com_top_left->SetBorderSize(cTextBorderSize);
01512 
01513   if ( fFlagSubDet == "EB"){sprintf(f_in, "EB");}
01514   if ( fFlagSubDet == "EE"){sprintf(f_in, "EE");}
01515 
01516   com_top_left->AddText(f_in);
01517   
01518   delete [] f_in;                                           fCdelete++;
01519   
01520   return com_top_left;
01521 }
01522 
01523 TPaveText* TEcnaParHistos::SetPaveSM(const TString chopt, const Int_t& SM_number,
01524                                     const TString EB_type)
01525 {
01526 // Pave for Super-module plots
01527   
01528   char* f_in = new char[fgMaxCar];                           fCnew++;
01529 
01530   //.................................. DEFAULT OPTION: "standard"   
01531   Double_t pav_top_left_xgauche = BoxLeftX("top_left_box_SM");
01532   Double_t pav_top_left_xdroite = BoxRightX("top_left_box_SM");
01533   Double_t pav_top_left_ybas    = BoxBottomY("top_left_box_SM");
01534   Double_t pav_top_left_yhaut   = BoxTopY("top_left_box_SM");
01535 
01536   if( chopt == "standard" || (chopt == "standGH" && EB_type == "EB-") )
01537     {  
01538       pav_top_left_xgauche = BoxLeftX("top_left_box_EB");
01539       pav_top_left_xdroite = BoxRightX("top_left_box_EB");
01540       pav_top_left_ybas    = BoxBottomY("top_left_box_EB");
01541       pav_top_left_yhaut   = BoxTopY("top_left_box_EB");
01542     }
01543 
01544   if( chopt == "standSM" || chopt == "standStex" || (chopt == "standGH" && EB_type == "EB+") )
01545     {  
01546       pav_top_left_xgauche = BoxLeftX("top_left_box_SM");
01547       pav_top_left_xdroite = BoxRightX("top_left_box_SM");
01548       pav_top_left_ybas    = BoxBottomY("top_left_box_SM");
01549       pav_top_left_yhaut   = BoxTopY("top_left_box_SM");
01550     }
01551 
01552   if( chopt == "several" )
01553     {    
01554       pav_top_left_xgauche = BoxLeftX("several_plots_box");
01555       pav_top_left_xdroite = BoxRightX("several_plots_box");
01556       pav_top_left_ybas    = BoxBottomY("several_plots_box");
01557       pav_top_left_yhaut   = BoxTopY("several_plots_box");
01558     }
01559 
01560   if( chopt == "sevevol" )
01561     {    
01562       pav_top_left_xgauche = BoxLeftX("several_evol_box");
01563       pav_top_left_xdroite = BoxRightX("several_evol_box");
01564       pav_top_left_ybas    = BoxBottomY("several_evol_box");
01565       pav_top_left_yhaut   = BoxTopY("several_evol_box");
01566     }
01567 
01568   TPaveText *com_top_left =
01569     new TPaveText(pav_top_left_xgauche, pav_top_left_ybas,
01570                   pav_top_left_xdroite, pav_top_left_yhaut);  fCnewRoot++;
01571  
01572   // 1 = left adjusted, 2 = vertically centered
01573   Int_t   cTextPaveAlign  = 12;   com_top_left->SetTextAlign(cTextPaveAlign);
01574   // 10*10 = 10*(ID10 = Courier New)          
01575   Int_t   cTextPaveFont   = 100;  com_top_left->SetTextFont(cTextPaveFont);
01576   // 0.95 = 95% of the pave size         
01577   Float_t cTextPaveSize   = 0.04; com_top_left->SetTextSize(cTextPaveSize);
01578   Int_t   cTextBorderSize = 1;    com_top_left->SetBorderSize(cTextBorderSize);
01579  
01580   if( chopt == "standard" || chopt == "standSM" || chopt == "standStex" || chopt == "standGH")
01581     {
01582       Int_t sm_nb = SM_number;
01583       if( EB_type == "EB+" ){sprintf(f_in, "EB+%d", sm_nb);}
01584       if( EB_type == "EB-" )
01585         {sm_nb = -SM_number+fEcal->MaxSMInEB()/2;
01586         sprintf(f_in, "EB%d (SM%d)", sm_nb, SM_number);}
01587       com_top_left->AddText(f_in);
01588     }
01589 
01590   delete [] f_in;                                           fCdelete++;
01591   
01592   return com_top_left;
01593 }
01594 
01595 TPaveText* TEcnaParHistos::SetPaveTower(const Int_t& SMtower_X)
01596 {
01597 // Tower comment
01598 
01599   char* f_in = new char[fgMaxCar];                           fCnew++;
01600   //...................... Pave tower/crystal(channel)/sample (top_right_box)
01601   Double_t pav_top_mid_xgauche = BoxLeftX("top_mid_box_EB");
01602   Double_t pav_top_mid_xdroite = BoxRightX("top_mid_box_EB");
01603   Double_t pav_top_mid_ybas    = BoxBottomY("top_mid_box_EB");
01604   Double_t pav_top_mid_yhaut   = BoxTopY("top_mid_box_EB");
01605   TPaveText *com_top_mid =
01606     new TPaveText(pav_top_mid_xgauche, pav_top_mid_ybas,
01607                   pav_top_mid_xdroite, pav_top_mid_yhaut);  fCnewRoot++;
01608 
01609   // 1 = left adjusted, 2 = vertically centered
01610   Int_t   cTextPaveAlign = 12;    com_top_mid->SetTextAlign(cTextPaveAlign);
01611   // 10*10 = 10*(ID10 = Courier New)          
01612   Int_t   cTextPaveFont  = 100;   com_top_mid->SetTextFont(cTextPaveFont);   
01613   // 0.95 = 95% of the pave size     
01614   Float_t cTextPaveSize  = 0.03;  com_top_mid->SetTextSize(cTextPaveSize);
01615   Int_t   cTextBorderSize = 1;    com_top_mid->SetBorderSize(cTextBorderSize);
01616           
01617   sprintf(f_in, " Tower: %d ", SMtower_X);
01618   com_top_mid->AddText(f_in);
01619   
01620   delete [] f_in;                                           fCdelete++;
01621 
01622   return com_top_mid;
01623 }
01624 
01625 TPaveText* TEcnaParHistos::SetPaveTowersXY(const Int_t& SMtower_X, const Int_t& SMtower_Y)
01626 {
01627 // Towers X and Y for (TowEcha,TowEcha) cov or cor matrix
01628 
01629   char* f_in = new char[fgMaxCar];                           fCnew++;
01630   //...................... Pave tower/TowEcha(channel)/sample (top_right_box)
01631   Double_t pav_top_mid_xgauche = BoxLeftX("top_mid_box_EB");
01632   Double_t pav_top_mid_xdroite = BoxRightX("top_mid_box_EB");
01633   Double_t pav_top_mid_ybas    = BoxBottomY("top_mid_box_EB");
01634   Double_t pav_top_mid_yhaut   = BoxTopY("top_mid_box_EB");
01635   TPaveText *com_top_mid =
01636     new TPaveText(pav_top_mid_xgauche, pav_top_mid_ybas,
01637                   pav_top_mid_xdroite, pav_top_mid_yhaut);  fCnewRoot++;
01638   
01639   // 1 = left adjusted, 2 = vertically centered
01640   Int_t   cTextPaveAlign = 12;   com_top_mid->SetTextAlign(cTextPaveAlign);
01641   // 10*10 = 10*(ID10 = Courier New)          
01642   Int_t   cTextPaveFont  = 100;  com_top_mid->SetTextFont(cTextPaveFont);
01643   // 0.95 = 95% of the pave size            
01644   Float_t cTextPaveSize  = 0.03; com_top_mid->SetTextSize(cTextPaveSize);
01645   Int_t   cTextBorderSize = 1;   com_top_mid->SetBorderSize(cTextBorderSize);
01646                   
01647   sprintf(f_in, " Tower X: %d ", SMtower_X);
01648   com_top_mid->AddText(f_in);
01649   sprintf(f_in, " Tower Y: %d ", SMtower_Y);
01650   com_top_mid->AddText(f_in);  
01651 
01652   delete [] f_in;                                           fCdelete++;
01653 
01654   return com_top_mid;
01655 }
01656 
01657 
01658 TPaveText* TEcnaParHistos::SetPaveCrystal(const Int_t& StexCrys, const Int_t& StexStinA,
01659                                           const Int_t& StinEcha)
01660 {
01661   Int_t arg_AlreadyRead = 0;
01662   Int_t flag_all_samples = 0;
01663   return SetPaveCrystal(StexCrys, StexStinA, StinEcha, arg_AlreadyRead, flag_all_samples);
01664 }
01665 
01666 TPaveText* TEcnaParHistos::SetPaveCrystal(const Int_t& StexCrys, const Int_t& StexStinA,
01667                                           const Int_t& StinEcha, const Int_t& arg_AlreadyRead,
01668                                           const Int_t& flag_all_samples)
01669 {
01670 // Tower + StinEcha comment. StexCrys range: [1,max]
01671 
01672   char* f_in = new char[fgMaxCar];                           fCnew++;
01673   //...................... Pave tower/StinEcha(channel)/sample (top_right_box)
01674 
01675   Double_t pav_top_right_xgauche = BoxLeftX("top_right_box_EB");
01676   Double_t pav_top_right_xdroite = BoxRightX("top_right_box_EB");
01677   Double_t pav_top_right_ybas    = BoxBottomY("top_right_box_EB");
01678   Double_t pav_top_right_yhaut   = BoxTopY("top_right_box_EB");
01679   if( fFlagSubDet == "EE" )
01680     {
01681       pav_top_right_xgauche = BoxLeftX("top_right_box_EE");
01682       pav_top_right_xdroite = BoxRightX("top_right_box_EE");
01683       pav_top_right_ybas    = BoxBottomY("top_right_box_EE");
01684       pav_top_right_yhaut   = BoxTopY("top_right_box_EE");
01685     }
01686 
01687   TPaveText *com_top_right =
01688     new TPaveText(pav_top_right_xgauche, pav_top_right_ybas,
01689                   pav_top_right_xdroite, pav_top_right_yhaut);  fCnewRoot++;
01690 
01691   // 1 = left adjusted, 2 = vertically centered
01692   Int_t   cTextPaveAlign = 12;   com_top_right->SetTextAlign(cTextPaveAlign);
01693   // 10*10 = 10*(ID10 = Courier New)           
01694   Int_t   cTextPaveFont  = 100;  com_top_right->SetTextFont(cTextPaveFont);   
01695   // 0.95 = 95% of the pave size      
01696   Float_t cTextPaveSize  = 0.03; com_top_right->SetTextSize(cTextPaveSize);
01697   Int_t   cTextBorderSize = 1;   com_top_right->SetBorderSize(cTextBorderSize);
01698 
01699   if( fFlagSubDet == "EB" )
01700     {
01701       if( arg_AlreadyRead == 0 || (arg_AlreadyRead == 1 && flag_all_samples == 0 ) )
01702         {sprintf(f_in, "Channel: %d ", StinEcha);}      // EB => range = [0,24]
01703       if( arg_AlreadyRead == 1 && flag_all_samples == 1 )
01704         {sprintf(f_in, "Channel: 0 to %d", fEcal->MaxCrysInStin()-1 );}
01705       com_top_right->AddText(f_in);
01706       if( arg_AlreadyRead == 0 || (arg_AlreadyRead == 1 && flag_all_samples == 0 ) )
01707         {sprintf(f_in, "Crystal in SM: %d ", StexCrys);
01708           com_top_right->AddText(f_in);}
01709     }
01710 
01711   if( fFlagSubDet == "EE" )
01712     {
01713       Int_t StinEchap = StinEcha+1;
01714       if( arg_AlreadyRead == 0 || (arg_AlreadyRead == 1 && flag_all_samples == 0 ) )
01715         {sprintf(f_in, "Xtal in SC: %d ", StinEchap);} // EE => range = [1,25]
01716       if( arg_AlreadyRead == 1 && flag_all_samples == 1 )
01717         {sprintf(f_in, "Xtal in SC: 1 to %d", fEcal->MaxCrysInStin());}
01718       com_top_right->AddText(f_in);
01719       if( arg_AlreadyRead == 0 || (arg_AlreadyRead == 1 && flag_all_samples == 0 ) )
01720         {
01721           Int_t IX_Dee_crys = StexCrys/fEcal->MaxCrysIYInDee() + 1;
01722           Int_t IY_Dee_crys = StexCrys%fEcal->MaxCrysIYInDee();
01723           if( IY_Dee_crys == 0 ){IX_Dee_crys--; IY_Dee_crys = fEcal->MaxCrysIYInDee();}     
01724           sprintf(f_in, "(IX,IY)[Xtal]=(%d,%d)", IX_Dee_crys, IY_Dee_crys);
01725           com_top_right->AddText(f_in);
01726         }
01727     }
01728 
01729   delete [] f_in;                                           fCdelete++;
01730 
01731   return com_top_right; 
01732 }
01733 
01734 TPaveText* TEcnaParHistos::SetPaveCrystalSample(const Int_t& StexCrys, const Int_t& StexStinA,
01735                                                const Int_t& StinEcha, const Int_t& iSample)
01736 {
01737 // Tower + StinEcha + sample comment
01738 
01739   char* f_in = new char[fgMaxCar];                           fCnew++;
01740   //...................... Pave tower/StinEcha(channel)/sample (top_right_box)
01741   Double_t pav_top_right_xgauche = BoxLeftX("top_right_box_EB");
01742   Double_t pav_top_right_xdroite = BoxRightX("top_right_box_EB");
01743   Double_t pav_top_right_ybas    = BoxBottomY("top_right_box_EB");
01744   Double_t pav_top_right_yhaut   = BoxTopY("top_right_box_EB");
01745   if( fFlagSubDet == "EE" )
01746     {
01747       pav_top_right_xgauche = BoxLeftX("top_right_box_EE");
01748       pav_top_right_xdroite = BoxRightX("top_right_box_EE");
01749       pav_top_right_ybas    = BoxBottomY("top_right_box_EE");
01750       pav_top_right_yhaut   = BoxTopY("top_right_box_EE");
01751     }
01752 
01753   TPaveText *com_top_right =
01754     new TPaveText(pav_top_right_xgauche, pav_top_right_ybas,
01755                   pav_top_right_xdroite, pav_top_right_yhaut);  fCnewRoot++;
01756   
01757   // 1 = left adjusted, 2 = vertically centered
01758   Int_t   cTextPaveAlign = 12;   com_top_right->SetTextAlign(cTextPaveAlign);
01759   // 10*10 = 10*(ID10 = Courier New)            
01760   Int_t   cTextPaveFont  = 100;  com_top_right->SetTextFont(cTextPaveFont);
01761   // 0.95 = 95% of the pave size    
01762   Float_t cTextPaveSize  = 0.03; com_top_right->SetTextSize(cTextPaveSize);
01763   Int_t   cTextBorderSize = 1;   com_top_right->SetBorderSize(cTextBorderSize);
01764 
01765 
01766   if( fFlagSubDet == "EB" )
01767     {
01768       sprintf(f_in, " Channel: %d ", StinEcha);
01769       com_top_right->AddText(f_in); 
01770       sprintf(f_in, " Crystal in SM: %d ", StexCrys);
01771       com_top_right->AddText(f_in);
01772     }
01773 
01774   if( fFlagSubDet == "EE" )
01775     {
01776       Int_t StinEchap = StinEcha+1;
01777       sprintf(f_in, " Channel: %d ", StinEchap);    // EE => range = [1,25]
01778       com_top_right->AddText(f_in); 
01779       Int_t IX_Dee_crys = StexCrys/fEcal->MaxCrysIYInDee() + 1;
01780       Int_t IY_Dee_crys = StexCrys%fEcal->MaxCrysIYInDee();
01781       if( IY_Dee_crys == 0 ){IX_Dee_crys--; IY_Dee_crys = fEcal->MaxCrysIYInDee();}
01782       sprintf(f_in, "(IX,IY)[Xtal]=(%d,%d)", IX_Dee_crys, IY_Dee_crys);
01783       com_top_right->AddText(f_in);
01784     }
01785 
01786   Int_t iSample_p = iSample+1;
01787   sprintf(f_in, " Sample: %d ", iSample_p);
01788   com_top_right->AddText(f_in);
01789 
01790   delete [] f_in;                                           fCdelete++;
01791 
01792   return com_top_right;
01793 }
01794 
01795 TPaveText* TEcnaParHistos::SetPaveLVRB(const Int_t& SMNumber, const Int_t& SMtower)
01796 {
01797 // LVRB at the top or at the bottom comment
01798 
01799   //....................... GRAND pave "LVRB"
01800   Double_t pav_bot_xgauche = BoxLeftX("bottom_left_box");
01801   Double_t pav_bot_xdroite = BoxRightX("bottom_right_box");
01802   Double_t pav_bot_ybas    = BoxBottomY("bottom_left_box");
01803   Double_t pav_bot_yhaut   = BoxTopY("bottom_left_box");
01804   TPaveText *com_bot_mid =
01805     new TPaveText(pav_bot_xgauche, pav_bot_ybas,
01806                   pav_bot_xdroite, pav_bot_yhaut);    fCnewRoot++;
01807 
01808   Color_t couleur_noir       = ColorDefinition("noir");
01809   Color_t couleur_rouge      = SetColorsForNumbers("lvrb_top");
01810   Color_t couleur_bleu_fonce = SetColorsForNumbers("lvrb_bottom");
01811 
01812   if(fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+")
01813     {
01814       TText *t1 = com_bot_mid->AddText("   <= IP (#eta = 0)       (#eta = +85) =>   ");
01815       t1->SetTextColor(couleur_noir);
01816     }
01817 
01818   if(fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-")
01819     {
01820       TText *t2 = com_bot_mid->AddText("   <= (#eta = -85)       IP (#eta = 0) =>   ");
01821       t2->SetTextColor(couleur_noir);
01822     }
01823 
01824   if(fEcalNumbering->GetTowerLvrbType(SMtower) == "top")
01825     {
01826       TText *t3 = 0;
01827       if(fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+")
01828         {t3 =  com_bot_mid->AddText("       <=== LVRB       ");}
01829       if(fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-")
01830         {t3 =  com_bot_mid->AddText("       LVRB ===>       ");}
01831       t3->SetTextColor(couleur_rouge);
01832     }
01833   
01834   if(fEcalNumbering->GetTowerLvrbType(SMtower) == "bottom")
01835     {
01836       TText *t4 = 0;
01837       if(fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+")
01838         {t4 = com_bot_mid->AddText("        LVRB ===>       ");}
01839       if(fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-")
01840         {t4 = com_bot_mid->AddText("        <=== LVRB       ");}
01841       t4->SetTextColor(couleur_bleu_fonce);
01842     }
01843   return com_bot_mid;
01844 
01845 }//  end of SetPaveLVRB
01846 
01847 Color_t TEcnaParHistos::SetColorsForNumbers(const TString chtype_number)
01848 {
01849  //Set color of the numbers for SuperModule- or Tower-  numbering plots
01850 
01851   Color_t couleur = ColorDefinition("noir");        // default = "noir"
01852 
01853   if ( chtype_number == "crystal"     ){couleur = ColorDefinition("noir");}
01854   if ( chtype_number == "lvrb_top"    ){couleur = ColorDefinition("rouge");}
01855   if ( chtype_number == "lvrb_bottom" ){couleur = ColorDefinition("bleu_fonce");}
01856 
01857   return couleur;
01858 }
01859 
01860 //===========================================================================
01861 //
01862 //     SetPaveDee, SetPaveSC, SetPaveSCsXY,
01863 //     SetPaveEECrystal
01864 //
01865 //===========================================================================
01866 
01867 TPaveText* TEcnaParHistos::SetPaveDee(const TString chopt,   const Int_t&  DeeNumber,
01868                                      const TString DeeType)
01869 {
01870 // Dee pav. Called only once.
01871   
01872   char* f_in = new char[fgMaxCar];                           fCnew++;
01873 
01874   //.................................. DEFAULT OPTION: "standard"   
01875   Double_t pav_top_left_xgauche = BoxLeftX("top_left_box_EE");
01876   Double_t pav_top_left_xdroite = BoxRightX("top_left_box_EE");
01877   Double_t pav_top_left_ybas    = BoxBottomY("top_left_box_EE");
01878   Double_t pav_top_left_yhaut   = BoxTopY("top_left_box_EE");
01879   
01880   if(chopt == "standard" || chopt == "standGH")
01881     {  
01882       pav_top_left_xgauche = BoxLeftX("top_left_box_EE");
01883       pav_top_left_xdroite = BoxRightX("top_left_box_EE");
01884       pav_top_left_ybas    = BoxBottomY("top_left_box_EE");
01885       pav_top_left_yhaut   = BoxTopY("top_left_box_EE");
01886     }
01887 
01888   if( chopt == "standDee" || chopt == "standStex" )
01889     {  
01890       pav_top_left_xgauche = BoxLeftX("top_left_box_Dee");
01891       pav_top_left_xdroite = BoxRightX("top_left_box_Dee");
01892       pav_top_left_ybas    = BoxBottomY("top_left_box_Dee");
01893       pav_top_left_yhaut   = BoxTopY("top_left_box_Dee");
01894     }
01895 
01896   if(chopt == "several")
01897     {    
01898       pav_top_left_xgauche = BoxLeftX("several_plots_box");
01899       pav_top_left_xdroite = BoxRightX("several_plots_box");
01900       pav_top_left_ybas    = BoxBottomY("several_plots_box");
01901       pav_top_left_yhaut   = BoxTopY("several_plots_box");
01902     }
01903   if(chopt == "sevevol")
01904     {    
01905       pav_top_left_xgauche = BoxLeftX("several_evol_box");
01906       pav_top_left_xdroite = BoxRightX("several_evol_box");
01907       pav_top_left_ybas    = BoxBottomY("several_evol_box");
01908       pav_top_left_yhaut   = BoxTopY("several_evol_box");
01909     }
01910   
01911   TPaveText *com_top_left =
01912     new TPaveText(pav_top_left_xgauche, pav_top_left_ybas,
01913                   pav_top_left_xdroite, pav_top_left_yhaut);  fCnewRoot++;
01914   
01915   // 1 = left adjusted, 2 = vertically centered
01916   Int_t   cTextPaveAlign = 12;    com_top_left->SetTextAlign(cTextPaveAlign);
01917   // 10*10 = 10*(ID10 = Courier New)            
01918   Int_t   cTextPaveFont  = 100;   com_top_left->SetTextFont(cTextPaveFont);
01919   // 0.95 = 95% of the pave size            
01920   Float_t cTextPaveSize  = 0.04;  com_top_left->SetTextSize(cTextPaveSize);
01921   Int_t   cTextBorderSize = 1;    com_top_left->SetBorderSize(cTextBorderSize);
01922   
01923   if( chopt == "standard" )
01924     {
01925       sprintf(f_in, " Dee: %d", DeeNumber);
01926       com_top_left->AddText(f_in);
01927       sprintf(f_in, " (%s)", DeeType.Data());
01928       com_top_left->AddText(f_in);
01929     }
01930   
01931   if( chopt == "standDee" || chopt == "standStex" || chopt == "standGH" )
01932     {
01933       sprintf(f_in, " Dee: %d  (%s) ", DeeNumber, DeeType.Data());
01934       com_top_left->AddText(f_in);
01935     }
01936   
01937   delete [] f_in;                                           fCdelete++;
01938   
01939   return com_top_left;
01940 }
01941 
01942 TPaveText* TEcnaParHistos::SetPaveSC(const Int_t& DeeSC_X, const Int_t& DeeNumber)
01943 {
01944 // SC comment
01945   
01946   char* f_in = new char[fgMaxCar];                     fCnew++;
01947   //...................... Pave SC/crystal(channel)/sample (top_right_box)
01948   Double_t pav_top_mid_xgauche = BoxLeftX("top_mid_box_EE");
01949   Double_t pav_top_mid_xdroite = BoxRightX("top_mid_box_EE");
01950   Double_t pav_top_mid_ybas    = BoxBottomY("top_mid_box_EE");
01951   Double_t pav_top_mid_yhaut   = BoxTopY("top_mid_box_EE");
01952   TPaveText *com_top_mid =
01953     new TPaveText(pav_top_mid_xgauche, pav_top_mid_ybas,
01954                   pav_top_mid_xdroite, pav_top_mid_yhaut);  fCnewRoot++;
01955   
01956   // 1 = left adjusted, 2 = vertically centered
01957   Int_t   cTextPaveAlign = 12;    com_top_mid->SetTextAlign(cTextPaveAlign);        
01958   // 10*10 = 10*(ID10 = Courier New)
01959   Int_t   cTextPaveFont  = 100;   com_top_mid->SetTextFont(cTextPaveFont);     
01960   // 0.95 = 95% of the pave size
01961   Float_t cTextPaveSize  = 0.03;  com_top_mid->SetTextSize(cTextPaveSize);
01962   Int_t   cTextBorderSize = 1;    com_top_mid->SetBorderSize(cTextBorderSize);
01963 
01964   sprintf(f_in, "Sector: S%d, SC: %d",
01965           fEcalNumbering->GetDSFrom1DeeSCEcna(DeeNumber, DeeSC_X),
01966           fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, DeeSC_X));
01967   com_top_mid->AddText(f_in);
01968   sprintf(f_in, "SC for const.: %d",
01969           fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(DeeNumber,DeeSC_X));
01970   com_top_mid->AddText(f_in); 
01971   sprintf(f_in, "Quadrant: %s",
01972     fEcalNumbering->GetSCQuadFrom1DeeSCEcna(DeeSC_X).Data());
01973    com_top_mid->AddText(f_in); 
01974   delete [] f_in;                                     fCdelete++;
01975 
01976   return com_top_mid;
01977 }
01978 
01979 TPaveText* TEcnaParHistos::SetPaveSCsXY(const Int_t& DeeSC_X, const Int_t& DeeSC_Y)
01980 {
01981 // SCs X and Y for (SCEcha,SCEcha) cov or cor matrix
01982 
01983   char* f_in = new char[fgMaxCar];                           fCnew++;
01984   //...................... Pave SC/SCEcha(channel)/sample (top_right_box)
01985   Double_t pav_top_mid_xgauche = BoxLeftX("top_mid_box_EE");
01986   Double_t pav_top_mid_xdroite = BoxRightX("top_mid_box_EE");
01987   Double_t pav_top_mid_ybas    = BoxBottomY("top_mid_box_EE");
01988   Double_t pav_top_mid_yhaut   = BoxTopY("top_mid_box_EE");
01989   TPaveText *com_top_mid =
01990     new TPaveText(pav_top_mid_xgauche, pav_top_mid_ybas,
01991                   pav_top_mid_xdroite, pav_top_mid_yhaut);  fCnewRoot++;
01992   
01993   // 1 = left adjusted, 2 = vertically centered
01994   Int_t   cTextPaveAlign = 12;   com_top_mid->SetTextAlign(cTextPaveAlign);
01995   // 10*10 = 10*(ID10 = Courier New)
01996   Int_t   cTextPaveFont  = 100;  com_top_mid->SetTextFont(cTextPaveFont);
01997   // 0.95 = 95% of the pave size
01998   Float_t cTextPaveSize  = 0.03; com_top_mid->SetTextSize(cTextPaveSize);
01999   Int_t   cTextBorderSize = 1;   com_top_mid->SetBorderSize(cTextBorderSize);
02000 
02001   sprintf(f_in, "SC X: %d", DeeSC_X);
02002   com_top_mid->AddText(f_in);
02003   sprintf(f_in, "SC Y: %d", DeeSC_Y);
02004   com_top_mid->AddText(f_in);  
02005 
02006   delete [] f_in;                                           fCdelete++;
02007 
02008   return com_top_mid;
02009 }
02010 
02011 TPaveText* TEcnaParHistos::SetPaveCxyz(const Int_t& DeeNumber)
02012 {
02013 // Cxyz at the top or at the bottom comment
02014 
02015   //....................... GRAND pave "Cxyz"
02016   Double_t pav_bot_xgauche = BoxRightX("bottom_mid_box");
02017   Double_t pav_bot_xdroite = BoxLeftX("bottom_mid_box");
02018   Double_t pav_bot_ybas    = BoxBottomY("bottom_left_box");
02019   Double_t pav_bot_yhaut   = BoxTopY("bottom_left_box");
02020   TPaveText *com_bot_mid =
02021     new TPaveText(pav_bot_xgauche, pav_bot_ybas,
02022                   pav_bot_xdroite, pav_bot_yhaut);    fCnewRoot++;
02023 
02024   //com_bot_mid->SetOption("arc");
02025   //com_bot_mid->SetCornerRadius((Double_t)0.5);
02026   //Int_t   cTextPaveFont  = 100;  com_bot_mid->SetTextFont(cTextPaveFont);
02027 
02028   com_bot_mid->SetTextSize(0.0325);
02029   //........................................... (SetPaveCxyz)
02030   if( DeeNumber == 1 )
02031     {
02032       com_bot_mid->AddText("        y ");
02033       com_bot_mid->AddText("        #uparrow ");
02034       com_bot_mid->AddText(" (Near)    x #leftarrow #otimes z     (Far) " );
02035     }
02036   if( DeeNumber == 2 )
02037     {
02038       com_bot_mid->AddText("        y ");
02039       com_bot_mid->AddText("        #uparrow ");
02040       com_bot_mid->AddText(" (Near)    x #leftarrow #otimes z     (Far) " );
02041     }
02042   if( DeeNumber == 3 )
02043     {
02044       com_bot_mid->AddText(" y           ");
02045       com_bot_mid->AddText(" #uparrow          ");
02046       com_bot_mid->AddText(" (Far)      z (#bullet) #rightarrow x     (Near) " );
02047     }
02048   if( DeeNumber == 4 )
02049     {
02050       com_bot_mid->AddText(" y           ");
02051       com_bot_mid->AddText(" #uparrow          ");
02052       com_bot_mid->AddText(" (Far)      z (#bullet) #rightarrow x     (Near) " );
02053     }
02054 
02055   // com_bot_mid->AddText(" (from IP) " );
02056   return com_bot_mid;
02057 } 
02058 //===========================================================================
02059 //
02060 //            SetPaveStex,  SetPaveStin
02061 //
02062 //===========================================================================
02063 
02064 TPaveText* TEcnaParHistos::SetPaveStex(const TString chopt, const Int_t& StexNumber)
02065 {
02066   TPaveText* pav_text = 0;
02067 
02068   if( StexNumber > 0 )
02069     {
02070       if ( fFlagSubDet == "EB" )
02071         {
02072           TString EB_type = fEcalNumbering->GetSMHalfBarrel(StexNumber);
02073           pav_text = SetPaveSM(chopt, StexNumber, EB_type);
02074         }
02075       if ( fFlagSubDet == "EE" )
02076         {
02077           TString dee_type = fEcalNumbering->GetEEDeeType(StexNumber);
02078           pav_text = SetPaveDee(chopt, StexNumber, dee_type);
02079         }
02080     }
02081   if( StexNumber == 0 ){pav_text = SetPaveStas();}
02082 
02083   return pav_text;
02084 }
02085 
02086 TPaveText* TEcnaParHistos::SetPaveStin(const Int_t& StinNumber, const Int_t& StexNumber)
02087 {
02088   TPaveText* pav_text = 0;
02089   if ( fFlagSubDet == "EB"){pav_text = SetPaveTower(StinNumber);}
02090   if ( fFlagSubDet == "EE"){pav_text = SetPaveSC(StinNumber, StexNumber);}
02091   return pav_text;
02092 }
02093 
02094 TPaveText* TEcnaParHistos::SetPaveStinsXY(const Int_t& StexStin_X, const Int_t& StexStin_Y) 
02095 {
02096   TPaveText* pav_text = 0;
02097   if ( fFlagSubDet == "EB"){pav_text = SetPaveTowersXY(StexStin_X, StexStin_Y);}
02098   if ( fFlagSubDet == "EE"){pav_text = SetPaveSCsXY(StexStin_X, StexStin_Y);}
02099   return pav_text;
02100 }
02101 
02102 //===========================================================================
02103 //
02104 //               GetHistoType, GetQuantityName
02105 //
02106 //===========================================================================
02107 TString TEcnaParHistos::GetHistoType(const TString HistoCode)
02108 {
02109 // Type of the quantity as a function of the quantity code
02110 // Histo type <=> Variable in X coordinate
02111 
02112   TString HistoType;
02113   Int_t MaxCar = fgMaxCar;
02114   HistoType.Resize(MaxCar);
02115   HistoType = "(no quantity type info)";
02116 
02117   //.(1a)............................ Global
02118   if ( HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" ||
02119        HistoCode == "D_TNo_ChNb" || HistoCode == "D_LFN_ChNb" || HistoCode == "D_HFN_ChNb" ||
02120        HistoCode == "D_MCs_ChNb" || HistoCode == "D_SCs_ChNb" )
02121     {HistoType = "Global";}   // X coordinate = Xtals for SM or Dee
02122                               //                Tower for EB
02123                               //                SC    for EE
02124   //.(1b)............................ Proj  
02125   if ( HistoCode == "D_NOE_ChDs" || HistoCode == "D_Ped_ChDs" ||
02126        HistoCode == "D_TNo_ChDs" || HistoCode == "D_LFN_ChDs" || HistoCode == "D_HFN_ChDs" || 
02127        HistoCode == "D_MCs_ChDs" || HistoCode == "D_SCs_ChDs" )
02128     {HistoType = "Proj";}    // X coordinate = bin number
02129   
02130   //.(2)............................ H1Basic
02131   if ( HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" )
02132     {HistoType = "H1Basic";}  // X coordinate = sample number
02133 
02134   //.(2)............................ H1BasicProj
02135   if ( HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" )
02136     {HistoType = "H1BasicProj";}  // X coordinate = total noise
02137 
02138   //.(3a)............................ SampGlobal
02139   if ( HistoCode == "D_Adc_EvNb" ){HistoType = "SampGlobal";}  // X coordinate = event number
02140   //.(3b)............................ SampProj
02141   if ( HistoCode == "D_Adc_EvDs"  ){HistoType = "SampProj";}    // X coordinate = bin number
02142 
02143   //.(4a)............................ Evol
02144   if ( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
02145        HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" )
02146     {HistoType = "Evol";}   // X coordinate = date
02147 
02148   //.(4b)............................ EvolProj
02149   if ( HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
02150        HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
02151     {HistoType = "EvolProj";}   // X coordinate = bin number
02152 
02153   return HistoType;
02154 }// end of GetHistoType(...)
02155 
02156 TString TEcnaParHistos::GetXVarHisto(const TString HistoCode, const TString SubDet, const Int_t& StexNumber)
02157 {
02158 // Type of the quantity as a function of the quantity code
02159 // Histo type <=> Variable in X coordinate
02160 
02161   TString HistoType = GetHistoType(HistoCode.Data());
02162 
02163   TString XVarHisto;
02164   Int_t MaxCar = fgMaxCar;
02165   XVarHisto.Resize(MaxCar);
02166   XVarHisto = "(no X variable info)";
02167 
02168   if( HistoType == "Global" )
02169     {
02170       if( StexNumber == 0 && SubDet == "EB" ){XVarHisto = "Tower number";}
02171       if( StexNumber == 0 && SubDet == "EE" ){XVarHisto = "SC number";}
02172       if( StexNumber != 0){XVarHisto = "Xtal number";}
02173     }
02174   if( HistoType == "Proj" ){XVarHisto = "Bin number";}
02175 
02176   if( HistoType == "H1Basic"){XVarHisto = "Sample number";}
02177   if( HistoType == "H1BasicProj"){XVarHisto = "Total noise";}
02178 
02179   if( HistoType == "SampGlobal" ){XVarHisto = "Event number";}
02180 
02181   if( HistoType == "SampProj" ){XVarHisto = "ADC count";}
02182 
02183   if( HistoType == "Evol" ){XVarHisto = "Date";}
02184 
02185   if( HistoType == "EvolProj" ){XVarHisto = "Bin number";}
02186 
02187   return XVarHisto;
02188 
02189 }// end of GetXVarHisto(...)
02190 
02191 TString TEcnaParHistos::GetYVarHisto(const TString HistoCode, const TString SubDet, const Int_t& StexNumber)
02192 {
02193 // Type of the quantity as a function of the quantity code
02194 // Histo type <=> Variable in Y coordinate
02195 
02196   TString HistoType = GetHistoType(HistoCode.Data());
02197 
02198   TString YVarHisto;
02199   Int_t MaxCar = fgMaxCar;
02200   YVarHisto.Resize(MaxCar);
02201   YVarHisto = "(no Y variable info)";
02202 
02203   if( HistoType == "Global" )
02204     {
02205       if( HistoCode == "D_NOE_ChNb" ){YVarHisto = "Nb of events";}
02206       if( HistoCode == "D_Ped_ChNb" ){YVarHisto = "Pedestal";}
02207       if( HistoCode == "D_TNo_ChNb" ){YVarHisto = "Total Noise";}
02208       if( HistoCode == "D_MCs_ChNb" ){YVarHisto = "Mean Cor(s,s')";}
02209       if( HistoCode == "D_LFN_ChNb" ){YVarHisto = "Low Freq. Noise";}
02210       if( HistoCode == "D_HFN_ChNb" ){YVarHisto = "High Freq. Noise";}
02211       if( HistoCode == "D_SCs_ChNb" ){YVarHisto = "Sigma Cor(s,s')";}
02212     }
02213 
02214   if( HistoType == "Proj" )
02215     {
02216       if( StexNumber == 0 && SubDet == "EB" ){YVarHisto = "Number of towers";}
02217       if( StexNumber == 0 && SubDet == "EE" ){YVarHisto = "Number of SCs";}
02218       if( StexNumber != 0){YVarHisto = "Number of Xtals";}
02219     }
02220 
02221   if( HistoType == "H1Basic"){YVarHisto = "ADC count";}
02222   if( HistoType == "H1BasicProj"){YVarHisto = "Number of samples";}
02223 
02224   if( HistoType == "SampGlobal" ){YVarHisto = "ADC count";}
02225 
02226   if( HistoType == "SampProj" ){YVarHisto = "Number of events";}
02227 
02228   if( HistoType == "EvolProj" ){YVarHisto = "Number of runs";}
02229 
02230   if( HistoType == "Evol" )
02231     {
02232       if( HistoCode == "H_Ped_Date" ){YVarHisto = "Pedestal";}
02233       if( HistoCode == "H_TNo_Date" ){YVarHisto = "Total Noise";}
02234       if( HistoCode == "H_MCs_Date" ){YVarHisto = "Mean Cor(s,s')";}
02235       if( HistoCode == "H_LFN_Date" ){YVarHisto = "Low Freq. Noise";}
02236       if( HistoCode == "H_HFN_Date" ){YVarHisto = "High Freq. Noise";}
02237       if( HistoCode == "H_SCs_Date" ){YVarHisto = "Sigma Cor(s,s')";}
02238     }
02239 
02240 //  cout << endl << "*TEcnaParHistos::GetYVarHisto(...)> HistoType = " << HistoType
02241 //       << ", HistoCode = " << HistoCode
02242 //       << ", StexNumber = " << StexNumber
02243 //       << ", YVarHisto = " << YVarHisto << endl;
02244 
02245   return YVarHisto;
02246 
02247 }// end of GetYVarHisto(...)
02248 
02249 TString TEcnaParHistos::GetQuantityName(const TString chqcode)
02250 {
02251 // Name of the quantity as a function of the histo code
02252 
02253   TString chqname;
02254   Int_t MaxCar = fgMaxCar;
02255   chqname.Resize(MaxCar);
02256   chqname = "(no quantity name info)";
02257 
02258   if(chqcode == "D_NOE_ChNb"){chqname = "Number of events";}
02259   if(chqcode == "D_NOE_ChDs"){chqname = "Nb of events";}
02260   if(chqcode == "D_Ped_ChNb"){chqname = "Pedestal";}
02261   if(chqcode == "D_Ped_ChDs"){chqname = "Pedestal";}
02262   if(chqcode == "D_TNo_ChNb"){chqname = "Total Noise";}
02263   if(chqcode == "D_TNo_ChDs"){chqname = "Total Noise";}
02264   if(chqcode == "D_MCs_ChNb"){chqname = "Mean Cor(s,s')";}
02265   if(chqcode == "D_MCs_ChDs"){chqname = "Mean Cor(s,s')";}
02266   if(chqcode == "D_LFN_ChNb"){chqname = "Low Freq. Noise";}
02267   if(chqcode == "D_LFN_ChDs"){chqname = "Low Freq. Noise";}
02268   if(chqcode == "D_HFN_ChNb"){chqname = "High Freq. Noise";}
02269   if(chqcode == "D_HFN_ChDs"){chqname = "High Freq. Noise";}
02270   if(chqcode == "D_SCs_ChNb"){chqname = "Sigma Cor(s,s')";}
02271   if(chqcode == "D_SCs_ChDs"){chqname = "Sigma Cor(s,s')";}
02272   if(chqcode == "D_MSp_SpNb"){chqname = "Sample means";}
02273   if(chqcode == "D_MSp_SpDs"){chqname = "Sample means";}
02274   if(chqcode == "D_SSp_SpNb"){chqname = "Sample sigmas";}
02275   if(chqcode == "D_SSp_SpDs"){chqname = "Sample sigmas";}
02276   if(chqcode == "D_Adc_EvNb"){chqname = "Sample ADC";}
02277   if(chqcode == "D_Adc_EvDs"){chqname = "Sample ADC distribution";}
02278   if(chqcode == "H_Ped_Date"){chqname = "Pedestal";}
02279   if(chqcode == "H_TNo_Date"){chqname = "Total Noise";}
02280   if(chqcode == "H_MCs_Date"){chqname = "Mean Cor(s,s')";}
02281   if(chqcode == "H_LFN_Date"){chqname = "Low Freq. Noise";}
02282   if(chqcode == "H_HFN_Date"){chqname = "High Freq. Noise";}
02283   if(chqcode == "H_SCs_Date"){chqname = "Sigma Cor(s,s')";}
02284   if(chqcode == "H_Ped_RuDs"){chqname = "Pedestal";}
02285   if(chqcode == "H_TNo_RuDs"){chqname = "Total Noise";}
02286   if(chqcode == "H_MCs_RuDs"){chqname = "Mean Cor(s,s')";}
02287   if(chqcode == "H_LFN_RuDs"){chqname = "Low Freq. Noise";}
02288   if(chqcode == "H_HFN_RuDs"){chqname = "High Freq. Noise";}
02289   if(chqcode == "H_SCs_RuDs"){chqname = "Sigma Cor(s,s')";}
02290   return chqname;
02291 }
02292 
02293 Double_t TEcnaParHistos::GetYminDefaultValue(const TString chqcode)
02294 {
02295   Double_t vmin = (Double_t)0.;
02296 
02297   if(chqcode == "H2LFccMosMatrix"){vmin = (Double_t)-1.;}
02298   if(chqcode == "H2HFccMosMatrix"){vmin = (Double_t)-1.;}
02299   if(chqcode == "H2CorccInStins" ){vmin = (Double_t)-1.;}
02300 
02301   if(chqcode == "D_NOE_ChNb"){vmin = (Double_t)0.;}
02302   if(chqcode == "D_Ped_ChNb"){vmin = (Double_t)0.;}
02303   if(chqcode == "D_TNo_ChNb"){vmin = (Double_t)0.;}
02304   if(chqcode == "D_MCs_ChNb"){vmin = (Double_t)-1.;}
02305   if(chqcode == "D_LFN_ChNb"){vmin = (Double_t)0.;}
02306   if(chqcode == "D_HFN_ChNb"){vmin = (Double_t)0.;}
02307   if(chqcode == "D_SCs_ChNb"){vmin = (Double_t)-1.;}
02308 
02309   if(chqcode == "D_NOE_ChDs"){vmin = (Double_t)0.1;}
02310   if(chqcode == "D_Ped_ChDs"){vmin = (Double_t)0.1;}
02311   if(chqcode == "D_TNo_ChDs"){vmin = (Double_t)0.1;}
02312   if(chqcode == "D_MCs_ChDs"){vmin = (Double_t)0.1;}
02313   if(chqcode == "D_LFN_ChDs"){vmin = (Double_t)0.1;}
02314   if(chqcode == "D_HFN_ChDs"){vmin = (Double_t)0.1;}
02315   if(chqcode == "D_SCs_ChDs"){vmin = (Double_t)0.1;}
02316 
02317   if(chqcode == "D_MSp_SpNb"){vmin = (Double_t)0.;}
02318   if(chqcode == "D_MSp_SpDs"){vmin = (Double_t)0.1;}
02319   if(chqcode == "D_SSp_SpNb"){vmin = (Double_t)0.;}
02320   if(chqcode == "D_SSp_SpDs"){vmin = (Double_t)0.1;}
02321 
02322   if(chqcode == "D_Adc_EvNb"){vmin = (Double_t)0.;}
02323   if(chqcode == "D_Adc_EvDs"){vmin = (Double_t)0.1;}
02324 
02325   if(chqcode == "H_Ped_Date"){vmin = (Double_t)0.;}
02326   if(chqcode == "H_TNo_Date"){vmin = (Double_t)0.;}
02327   if(chqcode == "H_MCs_Date"){vmin = (Double_t)-1.;}
02328   if(chqcode == "H_LFN_Date"){vmin = (Double_t)0.;}
02329   if(chqcode == "H_HFN_Date"){vmin = (Double_t)0.;}
02330   if(chqcode == "H_SCs_Date"){vmin = (Double_t)0.;}
02331 
02332   if(chqcode == "H_Ped_RuDs"){vmin = (Double_t)0.1;}
02333   if(chqcode == "H_TNo_RuDs"){vmin = (Double_t)0.1;}
02334   if(chqcode == "H_MCs_RuDs"){vmin = (Double_t)0.1;}
02335   if(chqcode == "H_LFN_RuDs"){vmin = (Double_t)0.1;}
02336   if(chqcode == "H_HFN_RuDs"){vmin = (Double_t)0.1;}
02337   if(chqcode == "H_SCs_RuDs"){vmin = (Double_t)0.1;}
02338 
02339   return vmin;
02340 }
02341 
02342 Double_t TEcnaParHistos::GetYmaxDefaultValue(const TString chqcode)
02343 {
02344   Double_t vmax = (Double_t)0.;
02345 
02346   if( fFlagSubDet == "EB" )
02347     {
02348       if(chqcode == "H2LFccMosMatrix" ){vmax = (Double_t)1.;}
02349       if(chqcode == "H2HFccMosMatrix" ){vmax = (Double_t)1.;}
02350       if(chqcode == "H2CorccInStins"  ){vmax = (Double_t)1.;}
02351 
02352       if(chqcode == "D_NOE_ChNb"){vmax = (Double_t)500.;}
02353       if(chqcode == "D_Ped_ChNb"){vmax = (Double_t)500.;}
02354       if(chqcode == "D_TNo_ChNb"){vmax = (Double_t)2.5;}
02355       if(chqcode == "D_LFN_ChNb"){vmax = (Double_t)2.5;}
02356       if(chqcode == "D_HFN_ChNb"){vmax = (Double_t)2.5;}
02357       if(chqcode == "D_MCs_ChNb"){vmax = (Double_t)1.;}
02358       if(chqcode == "D_SCs_ChNb"){vmax = (Double_t)1.5;}
02359       
02360       if(chqcode == "D_NOE_ChDs"){vmax = (Double_t)5000.;}
02361       if(chqcode == "D_Ped_ChDs"){vmax = (Double_t)5000.;}
02362       if(chqcode == "D_TNo_ChDs"){vmax = (Double_t)5000.;}
02363       if(chqcode == "D_LFN_ChDs"){vmax = (Double_t)5000.;}
02364       if(chqcode == "D_HFN_ChDs"){vmax = (Double_t)5000.;}
02365       if(chqcode == "D_MCs_ChDs"){vmax = (Double_t)5000.;}
02366       if(chqcode == "D_SCs_ChDs"){vmax = (Double_t)5000.;}
02367       
02368       if(chqcode == "D_MSp_SpNb"){vmax = (Double_t)500.;}
02369       if(chqcode == "D_MSp_SpDs"){vmax = (Double_t)10.;}
02370       if(chqcode == "D_SSp_SpNb"){vmax = (Double_t)5.;}
02371       if(chqcode == "D_SSp_SpDs"){vmax = (Double_t)10.;}
02372      
02373       if(chqcode == "D_Adc_EvNb"){vmax = (Double_t)500.;}
02374       if(chqcode == "D_Adc_EvDs"){vmax = (Double_t)150.;}
02375 
02376       if(chqcode == "H_Ped_Date"){vmax = (Double_t)500.;}
02377       if(chqcode == "H_TNo_Date"){vmax = (Double_t)5.;}
02378       if(chqcode == "H_LFN_Date"){vmax = (Double_t)5.;}
02379       if(chqcode == "H_HFN_Date"){vmax = (Double_t)5.;}
02380       if(chqcode == "H_MCs_Date"){vmax = (Double_t)1.;}
02381       if(chqcode == "H_SCs_Date"){vmax = (Double_t)0.5;}
02382 
02383       if(chqcode == "H_Ped_RuDs"){vmax = (Double_t)1000.;}
02384       if(chqcode == "H_TNo_RuDs"){vmax = (Double_t)1000.;}
02385       if(chqcode == "H_LFN_RuDs"){vmax = (Double_t)1000.;}
02386       if(chqcode == "H_HFN_RuDs"){vmax = (Double_t)1000.;}
02387       if(chqcode == "H_MCs_RuDs"){vmax = (Double_t)1000.;}
02388       if(chqcode == "H_SCs_RuDs"){vmax = (Double_t)1000.;}
02389     }
02390 
02391   if( fFlagSubDet == "EE" )
02392     {
02393       if(chqcode == "H2LFccMosMatrix"){vmax = (Double_t)1.;}
02394       if(chqcode == "H2HFccMosMatrix"){vmax = (Double_t)1.;}
02395       if(chqcode == "H2CorccInStins" ){vmax = (Double_t)0.05;}
02396       
02397       if(chqcode == "D_NOE_ChNb"){vmax = (Double_t)500.;}
02398       if(chqcode == "D_Ped_ChNb"){vmax = (Double_t)500.;}
02399       if(chqcode == "D_TNo_ChNb"){vmax = (Double_t)5.;}
02400       if(chqcode == "D_LFN_ChNb"){vmax = (Double_t)5.;}
02401       if(chqcode == "D_HFN_ChNb"){vmax = (Double_t)5.;}
02402       if(chqcode == "D_MCs_ChNb"){vmax = (Double_t)1.;}
02403       if(chqcode == "D_SCs_ChNb"){vmax = (Double_t)2.5;}
02404 
02405       if(chqcode == "D_NOE_ChDs"){vmax = (Double_t)1000.;}
02406       if(chqcode == "D_Ped_ChDs"){vmax = (Double_t)1000.;}
02407       if(chqcode == "D_TNo_ChDs"){vmax = (Double_t)1000.;}
02408       if(chqcode == "D_LFN_ChDs"){vmax = (Double_t)1000.;}
02409       if(chqcode == "D_HFN_ChDs"){vmax = (Double_t)1000.;}
02410       if(chqcode == "D_MCs_ChDs"){vmax = (Double_t)1000.;}
02411       if(chqcode == "D_SCs_ChDs"){vmax = (Double_t)1000.;}
02412 
02413       if(chqcode == "D_MSp_SpNb"){vmax = (Double_t)500.;}
02414       if(chqcode == "D_MSp_SpDs"){vmax = (Double_t)1000.;}
02415       if(chqcode == "D_SSp_SpNb"){vmax = (Double_t)5.;}
02416       if(chqcode == "D_SSp_SpDs"){vmax = (Double_t)100.;}
02417       
02418       if(chqcode == "D_Adc_EvNb"){vmax = (Double_t)500.;}
02419       if(chqcode == "D_Adc_EvDs"){vmax = (Double_t)1000.;}
02420 
02421       if(chqcode == "H_Ped_Date"){vmax = (Double_t)500.;}
02422       if(chqcode == "H_TNo_Date"){vmax = (Double_t)5.;}
02423       if(chqcode == "H_LFN_Date"){vmax = (Double_t)5.;}
02424       if(chqcode == "H_HFN_Date"){vmax = (Double_t)5.;}
02425       if(chqcode == "H_MCs_Date"){vmax = (Double_t)1.;}
02426       if(chqcode == "H_SCs_Date"){vmax = (Double_t)0.5;}
02427 
02428       if(chqcode == "H_Ped_RuDs"){vmax = (Double_t)1000.;}
02429       if(chqcode == "H_TNo_RuDs"){vmax = (Double_t)1000.;}
02430       if(chqcode == "H_LFN_RuDs"){vmax = (Double_t)1000.;}
02431       if(chqcode == "H_HFN_RuDs"){vmax = (Double_t)1000.;}
02432       if(chqcode == "H_MCs_RuDs"){vmax = (Double_t)1000.;}
02433       if(chqcode == "H_SCs_RuDs"){vmax = (Double_t)1000.;}
02434     }
02435   return vmax;
02436 }
02437 
02438 //---------------------------------------------------------------------------------------
02439 //
02440 //             BuildStandardDetectorCode, BuildStandardPlotOption,
02441 //             BuildStandard1DHistoCodeX, BuildStandard1DHistoCodeY,
02442 //             BuildStandardCovOrCorCode, BuildStandardBetweenWhatCode,
02443 //
02444 //---------------------------------------------------------------------------------------
02445 //----------------------- BuildStandardDetectorCode
02446 TString TEcnaParHistos::BuildStandardDetectorCode(const TString UserDetector)
02447 {
02448   TString StandardDetectorCode = "?";
02449 
02450   if( UserDetector == "Super-module" || UserDetector == "SuperModule" ||
02451       UserDetector == "super-module" || UserDetector == "SM" ||
02452       UserDetector == " " || UserDetector == "" )  // (default)
02453     {StandardDetectorCode = "SM";}
02454 
02455    if( UserDetector == "DEE" || UserDetector == "Dee" )
02456     {StandardDetectorCode = "Dee";}
02457 
02458    if( UserDetector == "Ecal barrel" || UserDetector == "EcalBarrel" || 
02459        UserDetector == "ecal barrel" || UserDetector == "Barrel"     || UserDetector == "barrel" || 
02460        UserDetector == "EB" )
02461     {StandardDetectorCode = "EB";}
02462 
02463    if( UserDetector == "Ecal endcap" || UserDetector == "EcalEndcap" || 
02464        UserDetector == "ecal endcap" || UserDetector == "Endcap"     || UserDetector == "endcap" || 
02465        UserDetector == "EE" )
02466     {StandardDetectorCode = "EE";}
02467 
02468    if( StandardDetectorCode == "?" )
02469     {
02470       cout << "*TEcnaParHistos::BuildStandardDetectorCode(...)> UserDetector = " << UserDetector
02471            << " : code not found."
02472            << fTTBELL << endl;
02473 
02474       ListOfStandardCodes("DetectorCode");
02475     }
02476   return StandardDetectorCode;
02477 }
02478 
02479 //----------------------- BuildStandardPlotOption
02480 TString TEcnaParHistos::BuildStandardPlotOption(const TString CallingMethod, const TString UserPlotOption)
02481 {
02482   TString StandardPlotOption = "?";
02483 
02484   if( CallingMethod == "1D" || CallingMethod == "2DS" || CallingMethod == "Time" )
02485     {
02486       if( UserPlotOption == "ONLY ONE" || UserPlotOption == "only one"   || UserPlotOption == "onlyone" ||
02487           UserPlotOption == "Only one" || UserPlotOption == "OnlyOne"    ||
02488           UserPlotOption == "ONLYONE"  || UserPlotOption == fOnlyOnePlot ||
02489           UserPlotOption == " " || UserPlotOption ==  "" )  // (default)
02490         {StandardPlotOption = fOnlyOnePlot;}
02491 
02492       if( UserPlotOption == "SAME" || UserPlotOption ==  "Same" || UserPlotOption == fSeveralPlot )
02493         {StandardPlotOption = fSeveralPlot;}
02494 
02495       if( UserPlotOption ==  "SAME n" || UserPlotOption ==  "Same n" || UserPlotOption == fSameOnePlot )
02496         {StandardPlotOption = fSameOnePlot;}
02497 
02498       if( UserPlotOption == fAllXtalsInStinPlot )  // called with 1D after call with 1DX (special case "SAME in Stin")
02499         {StandardPlotOption = fAllXtalsInStinPlot;}
02500     }
02501 
02502   if( CallingMethod == "1DX" )
02503     {
02504       if( UserPlotOption == "ALL XTALS IN TOWER" || UserPlotOption == "ALL CHANNELS IN TOWER" ||
02505           UserPlotOption == "AllXtalsInTower"    || UserPlotOption == "AllChannelsInTower" ||
02506           UserPlotOption == "ALL XTALS IN TOW"   || UserPlotOption == "ALL CHANNELS IN TOW" ||
02507           UserPlotOption == "AllXtalsInTow"      || UserPlotOption == "AllChannelsInTow" ||
02508           UserPlotOption == "ALL XTALS IN SC"    || UserPlotOption == "ALL CHANNELS IN SC" ||
02509           UserPlotOption == "AllXtalsInSC"       || UserPlotOption == "AllChannelsInSC" ||
02510           UserPlotOption == "SAME IN TOWER"      || UserPlotOption == "SameInTower" || 
02511           UserPlotOption == "SAME IN TOW"        || UserPlotOption == "SameInTow" || 
02512           UserPlotOption == "SAME IN SC"         || UserPlotOption == "SameInSC"  ||
02513           UserPlotOption == "Same in tower"      || UserPlotOption == "Same in tow" ||
02514           UserPlotOption == "Same in SC"         || UserPlotOption == "SameInSC" ||
02515           UserPlotOption == fAllXtalsInStinPlot  ||
02516           UserPlotOption == " " || UserPlotOption == "" ) // (default)
02517         {StandardPlotOption = fAllXtalsInStinPlot;}
02518     }
02519 
02520   if( CallingMethod == "2D" )
02521     {
02522       if( UserPlotOption == "COLZ" ||
02523           UserPlotOption == " " || UserPlotOption == "" ) // (default)
02524         {StandardPlotOption = "COLZ";}
02525       if( UserPlotOption == "BOX"    ){StandardPlotOption = "BOX";}
02526       if( UserPlotOption == "TEXT"   ){StandardPlotOption = "TEXT";}
02527       if( UserPlotOption == "CONTZ"  ){StandardPlotOption = "CONTZ";}
02528       if( UserPlotOption == "LEGO2Z" ){StandardPlotOption = "LEGO2Z";}
02529       if( UserPlotOption == "SURF1Z" ){StandardPlotOption = "SURF1Z";}
02530       if( UserPlotOption == "SURF2Z" ){StandardPlotOption = "SURF2Z";}
02531       if( UserPlotOption == "SURF3Z" ){StandardPlotOption = "SURF3Z";}
02532       if( UserPlotOption == "SURF4"  ){StandardPlotOption = "SURF4";}
02533       if( UserPlotOption == "ASCII"  ){StandardPlotOption = "ASCII";}
02534     }
02535 
02536   //...................................................
02537   if( StandardPlotOption == "?" )
02538     {
02539       cout << "*TEcnaParHistos::BuildStandardPlotOption(...)> UserPlotOption = " << UserPlotOption
02540            << " : code not found."
02541            << fTTBELL << endl;
02542 
02543       ListOfStandardCodes("PlotOption");
02544     }
02545   return StandardPlotOption;
02546 }
02547 
02548 
02549 //----------------------- BuildStandard1DHistoCodeX
02550 TString TEcnaParHistos::BuildStandard1DHistoCodeX(const TString CallingMethod, const TString UserHistoCode)
02551 {
02552   //........................... user code -> standard code
02553   TString StandardHistoCode = "?";
02554   if( CallingMethod == "1D" || CallingMethod == "2DS" || CallingMethod == "Time" )
02555     {
02556       //======================================== Only X Quantity for 1D Histos
02557       if( UserHistoCode == "Tower" || UserHistoCode == "tower" || UserHistoCode == "tow" ||
02558           UserHistoCode == "Tower number" || UserHistoCode == "tower number" || UserHistoCode == "tow nb" ||
02559           UserHistoCode == "Tower#" || UserHistoCode == "tower#" || UserHistoCode == "tow#" ||
02560           UserHistoCode == "Tow#" || UserHistoCode == "Tow" )
02561         {StandardHistoCode = "Tow";}
02562 
02563       if( UserHistoCode == "Super crystal" || UserHistoCode == "SuperCrystal" || UserHistoCode == "SuperXtal" || 
02564           UserHistoCode == "Super crystal number" || UserHistoCode == "SuperCrystalNumber" ||
02565           UserHistoCode == "SuperXtalNumber" || 
02566           UserHistoCode == "Super crystal nb" || UserHistoCode == "SuperCrystal#" ||
02567           UserHistoCode == "SuperXtal#" ||
02568           UserHistoCode == "SC#" || UserHistoCode == "SC" )
02569         {StandardHistoCode = "SC";}
02570 
02571       if( UserHistoCode == "Crystal" || UserHistoCode == "crystal" || UserHistoCode == "Xtal" || 
02572           UserHistoCode == "Crystal number" || UserHistoCode == "crystal number" ||
02573           UserHistoCode == "Xtal number" || 
02574           UserHistoCode == "Crystal#" || UserHistoCode == "crystal#" || UserHistoCode == "Xtal#" ||
02575           UserHistoCode == "Xtal" )
02576         {StandardHistoCode = "Xtal";}
02577 
02578       if( StandardHistoCode == "Tow" || StandardHistoCode == "SC" || StandardHistoCode == "Xtal" )
02579         {StandardHistoCode = "XtalORStin";} // management by means of fFapStexNumber ( >0 => Xtal ; =0 => Tow .OR. SC )
02580 
02581       if( UserHistoCode == "Sample number" || UserHistoCode == "SampleNumber" ||
02582           UserHistoCode == "Sample#" || UserHistoCode == "Samp#" ||
02583           UserHistoCode == "Sample" || UserHistoCode == "sample" ||
02584           UserHistoCode == "Smp" )
02585         {StandardHistoCode = "Smp";}
02586 
02587       if( UserHistoCode == "Event" || UserHistoCode == "event" ||
02588           UserHistoCode == "Event number" || UserHistoCode == "event number" || 
02589           UserHistoCode == "EventNumber"  || UserHistoCode == "Event#" || 
02590           UserHistoCode == "EvtNumber"    || UserHistoCode == "Evt#" ||
02591           UserHistoCode == "Evt number"   || UserHistoCode == "evt number" ||
02592           UserHistoCode == "Evt" )
02593         {StandardHistoCode = "Evt";}
02594       
02595       //======================================== X or Y Quantity for 1D Histos
02596       if( StandardHistoCode == "?" )
02597         {
02598           StandardHistoCode = BuildStandard1DHistoCodeXY(UserHistoCode);
02599         } 
02600     }
02601   
02602   //---------------------------------------------
02603   if( StandardHistoCode == "?" )
02604     {
02605       cout << "*TEcnaParHistos::BuildStandard1DHistoCodeX(...)> UserHistoCode = " << UserHistoCode
02606            << " : code not found."
02607            << fTTBELL << endl;
02608 
02609       ListOfStandardCodes("1DHistoCodeX");
02610     }
02611   return StandardHistoCode;
02612 }
02613 
02614 //----------------------- BuildStandard1DHistoCodeY
02615 TString TEcnaParHistos::BuildStandard1DHistoCodeY(const TString CallingMethod, const TString UserHistoCode)
02616 {
02617   //........................... user code -> standard code
02618   TString StandardHistoCode = "?";
02619 
02620   if( CallingMethod == "1D" || CallingMethod == "2DS" || CallingMethod == "Time" )
02621     {
02622       //======================================== Only Y Quantity for 1D Histos
02623       if( UserHistoCode == "Number of crystals" || UserHistoCode == "NumberOfCrystals" ||
02624           UserHistoCode == "Nb of crystals" || UserHistoCode == "NbOfCrystals" ||
02625           UserHistoCode == "Number of xtals" || UserHistoCode == "NumberOfXtals" ||
02626           UserHistoCode == "Nb of xtals" || UserHistoCode == "NbOfXtals" ||
02627           UserHistoCode == "nox" || UserHistoCode == "NOX" )
02628         {StandardHistoCode = "NOX";}
02629 
02630       if( UserHistoCode == "Number of samples" || UserHistoCode == "NumberOfSamples" ||
02631           UserHistoCode == "Nb of samples" || UserHistoCode == "NbOfSamples" ||
02632           UserHistoCode == "nos" || UserHistoCode == "NOS" )
02633         {StandardHistoCode = "NOS";}
02634 
02635       if( UserHistoCode == "Number of runs" || UserHistoCode == "NumberOfRuns" ||
02636           UserHistoCode == "Nb of runs" || UserHistoCode == "NbOfRuns" ||
02637           UserHistoCode == "nor" || UserHistoCode == "NOR" )
02638         {StandardHistoCode = "NOR";}
02639       
02640       //======================================== X or Y Quantity for 1D Histos
02641       if( StandardHistoCode == "?" )
02642         {
02643           StandardHistoCode = BuildStandard1DHistoCodeXY(UserHistoCode);
02644         }
02645     }
02646   //---------------------------------------------
02647   if( StandardHistoCode == "?" )
02648     {
02649       cout << "*TEcnaParHistos::BuildStandard1DHistoCodeY(...)> UserHistoCode = " << UserHistoCode
02650            << " : code not found."
02651            << fTTBELL << endl;
02652 
02653       ListOfStandardCodes("1DHistoCodeY");
02654     }
02655   return StandardHistoCode;
02656 }
02657 
02658 //----------------------- BuildStandard1DHistoCodeXY
02659 TString TEcnaParHistos::BuildStandard1DHistoCodeXY(const TString UserHistoCode)
02660 {
02661   //........................... user code -> standard code
02662   TString StandardHistoCode = "?";
02663 
02664   //======================================== X or Y Quantity for 1D Histos
02665   if( UserHistoCode == "Number of events" || UserHistoCode == "Nb of evts" || 
02666       UserHistoCode == "NumberbOfEvents"  || UserHistoCode == "NbOfEvts"   ||
02667       UserHistoCode == "number of events" ||
02668       UserHistoCode == "noe"              || UserHistoCode == "NOE" || 
02669       UserHistoCode == " " || UserHistoCode == "" ) // (default)
02670     {StandardHistoCode = "NOE";}
02671  
02672   if( UserHistoCode == "Pedestals" || UserHistoCode == "Pedestal" ||
02673       UserHistoCode == "pedestals" || UserHistoCode == "pedestal" ||
02674       UserHistoCode == "ped"       || UserHistoCode == "Ped" )
02675     {StandardHistoCode = "Ped";}
02676 
02677   if( UserHistoCode == "Total noise" || UserHistoCode == "TotalNoise" ||
02678       UserHistoCode == "total noise" || UserHistoCode == "TN" ||
02679       UserHistoCode == "tn"          || UserHistoCode == "TNo" )
02680     {StandardHistoCode = "TNo";}
02681 
02682   if( UserHistoCode == "Low frequency noise" || UserHistoCode == "LowFrequencyNoise" ||
02683       UserHistoCode == "LF noise"            || UserHistoCode == "LFNoise" || 
02684       UserHistoCode == "low frequency noise" || UserHistoCode == "lfn" ||
02685       UserHistoCode == "LFN")
02686     {StandardHistoCode = "LFN";}
02687 
02688   if( UserHistoCode == "High frequency noise" || UserHistoCode == "HighFrequencyNoise" ||
02689       UserHistoCode == "HF noise"             || UserHistoCode == "HFNoise" || 
02690       UserHistoCode == "high frequency noise" ||
02691       UserHistoCode == "hfn" || UserHistoCode == "HFN")
02692     {StandardHistoCode = "HFN";}
02693 
02694   if( UserHistoCode == "Mean correlations between samples" ||  
02695       UserHistoCode == "MeanCorrelationsBetweenSamples" || 
02696       UserHistoCode == "Correlations between samples" ||  
02697       UserHistoCode == "CorrelationsBetweenSamples" || 
02698       UserHistoCode == "Mean corss" || UserHistoCode == "MeanCorss" ||   
02699       UserHistoCode == "Corss" || UserHistoCode == "corss" ||   
02700       UserHistoCode == "Css"   || UserHistoCode == "css" ||
02701       UserHistoCode == "mean correlations between samples" ||
02702       UserHistoCode == "mcs" || UserHistoCode == "MCs" )
02703     {StandardHistoCode = "MCs";}
02704 
02705   if( UserHistoCode == "Sigma of correlations between samples" ||  
02706       UserHistoCode == "SigmaOfCorrelationsBetweenSamples" || 
02707       UserHistoCode == "Sigma corss" || UserHistoCode == "SigmaCorss" ||   
02708       UserHistoCode == "SigCorss" || UserHistoCode == "sigcorss" ||   
02709       UserHistoCode == "SCss"   || UserHistoCode == "scss" ||
02710       UserHistoCode == "sigma of correlations between samples" ||
02711       UserHistoCode == "scs" || UserHistoCode == "SCs")
02712     {StandardHistoCode = "SCs";}
02713 
02714   if( UserHistoCode == "Sample mean" || UserHistoCode == "SampleMean" ||
02715       UserHistoCode == "Sample average" || UserHistoCode == "SampleAverage" || 
02716       UserHistoCode == "SampMean" || UserHistoCode == "SampAverage" ||
02717       UserHistoCode == "MSp" )
02718     {StandardHistoCode = "MSp";}
02719 
02720   if( UserHistoCode == "Sample sigma"      || UserHistoCode == "SampleSigma" ||
02721       UserHistoCode == "Sigma of samples"  || UserHistoCode == "SigmaOfSamples" ||
02722       UserHistoCode == "SampSigma"         || 
02723       UserHistoCode == "SSp"      )
02724     {StandardHistoCode = "SSp";}
02725 
02726   if( UserHistoCode == "date" || UserHistoCode == "Date" || UserHistoCode == "time" ||
02727       UserHistoCode == "Time" )
02728     {StandardHistoCode = "Time";}
02729 
02730   if( UserHistoCode == "ADC value" || UserHistoCode == "ADCValue" || 
02731       UserHistoCode == "Adc value" || UserHistoCode == "AdcValue" ||
02732       UserHistoCode == "Sample ADC" || UserHistoCode == "SampleAdc" || 
02733       UserHistoCode == "ADC" || UserHistoCode == "Adc"  )
02734     {StandardHistoCode = "Adc";}
02735 
02736   //---------------------------------------------
02737   if( StandardHistoCode == "?" )
02738     {
02739       cout << "*TEcnaParHistos::BuildStandard1DHistoCodeXY(...)> UserHistoCode = " << UserHistoCode
02740            << " : code not found."
02741            << fTTBELL << endl;
02742 
02743       ListOfStandardCodes("1DHistoCodeXY");
02744     }
02745   return StandardHistoCode;
02746 }
02747 
02748 //----------------------- BuildStandardCovOrCorCode
02749 TString TEcnaParHistos::BuildStandardCovOrCorCode(const TString CallingMethod, const TString UserHistoCode)
02750 {
02751   //........................... user code -> standard code
02752   TString StandardHistoCode = "?";
02753   if( CallingMethod == "2D" )
02754     {
02755       //======================================== Correlation or covariance (CorOrCov)
02756       if( UserHistoCode == "Correlation" || UserHistoCode == "Correlations" ||
02757           UserHistoCode == "correlation" || UserHistoCode == "correlations" ||
02758           UserHistoCode == "Correl"      || UserHistoCode == "correl" ||
02759           UserHistoCode == "cor"         || UserHistoCode == "Cor"  || 
02760           UserHistoCode == " " || UserHistoCode == "" ) // (default)
02761         {StandardHistoCode = "Cor";}
02762 
02763       if( UserHistoCode == "Covariance" || UserHistoCode == "Covariances" ||
02764           UserHistoCode == "covariance" || UserHistoCode == "covariances" ||
02765           UserHistoCode == "Covar"      || UserHistoCode == "covar" ||
02766           UserHistoCode == "cov"        || UserHistoCode == "Cov" )
02767         {StandardHistoCode = "Cov";}
02768     }
02769   //---------------------------------------------
02770   if( StandardHistoCode == "?" )
02771     {
02772       cout << "*TEcnaParHistos::BuildStandardCovOrCorCode(...)> UserHistoCode = " << UserHistoCode
02773            << " : code not found."
02774            << fTTBELL << endl;
02775 
02776       ListOfStandardCodes("CovOrCorCode");
02777     }
02778   return StandardHistoCode;
02779 }
02780 
02781 //----------------------- BuildStandardBetweenWhatCode
02782 TString TEcnaParHistos::BuildStandardBetweenWhatCode(const TString CallingMethod, const TString UserHistoCode)
02783 {
02784   //........................... user code -> standard code
02785   TString StandardHistoCode = "?";
02786   if( CallingMethod == "2D" )
02787     {
02788       //======================================== Quantity for correlations (BetweenWhat)
02789       if( UserHistoCode == "Samples" || UserHistoCode == "Between samples" || 
02790           UserHistoCode == "samples" || UserHistoCode == "between samples" ||
02791           UserHistoCode == "BetweenSamples" ||
02792           UserHistoCode == "Samp" || UserHistoCode == "samp" ||
02793           UserHistoCode == "ss" || UserHistoCode == "Mss" )
02794         {StandardHistoCode = "Mss";}
02795 
02796       if( UserHistoCode == "LF channels" || UserHistoCode == "LF between channels" ||
02797           UserHistoCode == "LFChannels"  || UserHistoCode == "LFBetweenChannels" ||
02798           UserHistoCode == "LFChan"      || UserHistoCode == "lfchan" || 
02799           UserHistoCode == "LFcc"        || UserHistoCode == "lfcc"   || UserHistoCode == "MccLF" )
02800         {StandardHistoCode = "MccLF";}
02801 
02802       if( UserHistoCode == "HF channels" || UserHistoCode == "HF between channels" ||
02803           UserHistoCode == "HFChannels"  || UserHistoCode == "HFBetweenChannels" ||
02804           UserHistoCode == "HFChan"      || UserHistoCode == "hfchan" || 
02805           UserHistoCode == "HFcc"        || UserHistoCode == "hfcc"   || UserHistoCode == "MccHF" )
02806         {StandardHistoCode = "MccHF";}
02807 
02808       if( UserHistoCode == "LF towers"    || UserHistoCode == "LF between towers" ||
02809           UserHistoCode == "LFTowers"     || UserHistoCode == "LFBetweenTowers" ||
02810           UserHistoCode == "LFTow"        || UserHistoCode == "lftow" ||
02811           UserHistoCode == "LFtt"         || UserHistoCode == "lftt"  ||
02812           UserHistoCode == "LF SCs"       || UserHistoCode == "LF between SCs" ||
02813           UserHistoCode == "LFSCs"        || UserHistoCode == "LFBetweenSCs" ||
02814           UserHistoCode == "LFSuperXtals" || UserHistoCode == "lfsc" ||
02815           UserHistoCode == "LFSC"         || UserHistoCode == "lfsx" ||
02816           UserHistoCode == "MttLF" )
02817         {StandardHistoCode = "MttLF";}
02818 
02819       if( UserHistoCode == "HF towers"    || UserHistoCode == "HF between towers" ||
02820           UserHistoCode == "HFTowers"     || UserHistoCode == "HFBetweenTowers" ||
02821           UserHistoCode == "HFTow"        || UserHistoCode == "hftow" || 
02822           UserHistoCode == "HFtt"         || UserHistoCode == "hftt"  ||
02823           UserHistoCode == "HF SCs"       || UserHistoCode == "HF between SCs" ||
02824           UserHistoCode == "HFSCs"        || UserHistoCode == "HFBetweenSCs" ||
02825           UserHistoCode == "HFSuperXtals" || UserHistoCode == "hfsc" ||
02826           UserHistoCode == "HFSC"         || UserHistoCode == "hfsx" ||
02827           UserHistoCode == "MttHF" )
02828         {StandardHistoCode = "MttHF";}
02829     }
02830 
02831   //---------------------------------------------
02832   if( StandardHistoCode == "?" )
02833     {
02834       cout << "*TEcnaParHistos::BuildStandardBetweenWhatCode(...)> UserHistoCode = " << UserHistoCode
02835            << " : code not found."
02836            << fTTBELL << endl;
02837 
02838       ListOfStandardCodes("BetweenWhatCode");
02839     }
02840   return StandardHistoCode;
02841 }
02842 
02843 //========================== ListOfStandardCodes ==========================
02844 
02845 void TEcnaParHistos::ListOfStandardCodes(const TString TypeOfCode)
02846 {
02847   //------ Lists of Standard codes for Plot Histos methods
02848 
02849   if(TypeOfCode == "DetectorCode")
02850     {
02851       cout << "*--------------------------------------- Standard detector codes:" << endl;
02852       cout << "    EB   (ECAL Barrel) " << endl;
02853       cout << "    EE   (ECAL Endcap) " << endl;
02854       cout << "    SM   (Barrel Super Module) " << endl;
02855       cout << "    Dee  (Encap Dee) " << endl;
02856       cout << " Other codes are available" << endl;
02857       cout << " See source file: TEcnaParHistos::BuildStandardDetectorCode(...)." << endl;
02858       cout << "*----------------------------------------------------------------" << endl;
02859     }
02860 
02861   if(TypeOfCode == "PlotOption")
02862     {
02863       cout << "*--------------------------------------- Standard plot options:" << endl;
02864       cout << "    All ROOT DRAW options and: " << endl;
02865       cout << "   (nothing) " << endl;
02866       cout << "    SAME n   " << endl;
02867       cout << "    ASCII    " << endl;
02868       cout << " Other codes are available" << endl;
02869       cout << " See source file: TEcnaParHistos::BuildStandardPlotOption(...)." << endl;
02870       cout << "*--------------------------------------------------------------" << endl;
02871     }
02872 
02873   if(TypeOfCode == "1DHistoCodeX")
02874     {
02875       cout << "*---------------------- Standard 1D histo codes for X coordinate:" << endl;
02876       cout << "    Tow  (SM tower) " << endl;
02877       cout << "    SC   (Dee super crystal) " << endl;
02878       cout << "    Xtal (crystal) " << endl;
02879       cout << "    Smp  (Adc sample) " << endl;
02880       cout << "    Evt  (event) " << endl;
02881       cout << " Other codes are available" << endl;
02882       cout << " See source file: TEcnaParHistos::BuildStandard1DHistoCodeX(...)." << endl;
02883       cout << "*----------------------------------------------------------------" << endl;
02884     }
02885 
02886   if(TypeOfCode == "1DHistoCodeY")
02887     {
02888       cout << "*---------------------- Standard 1D histo codes for Y coordinate;" << endl;
02889       cout << "    NOX  (number of crystals) " << endl;
02890       cout << "    NOS  (number of samples) " << endl;
02891       cout << "    NOR  (number of runs) " << endl;
02892       cout << " Other codes are available" << endl;
02893       cout << " See source file: TEcnaParHistos::BuildStandard1DHistoCodeY(...)." << endl;
02894       cout << "*----------------------------------------------------------------" << endl;
02895     }
02896 
02897   if(TypeOfCode == "1DHistoCodeXY")
02898     {
02899       cout << "*------------------ Standard 1D histo codes for X or Y coordinate;" << endl;
02900       cout << "    NOE  (number of events) " << endl;
02901       cout << "    Ped  (pedestal) " << endl;
02902       cout << "    TNo  (total noise) " << endl;
02903       cout << "    LFN  (low frequency noise) " << endl;
02904       cout << "    HFN  (high frequency noise) " << endl;
02905       cout << "    MCs  (mean correlation between samples) " << endl;
02906       cout << "    SCs  (sigma of correlations between samples) " << endl;
02907       cout << "    MSp  (sample mean) " << endl;
02908       cout << "    SSp  (sample sigma) " << endl;
02909       cout << "    Time (time, date) " << endl;
02910       cout << "    Adc  (ADC sample value) " << endl;
02911       cout << " Other codes are available" << endl;
02912       cout << " See source file: TEcnaParHistos::BuildStandard1DHistoCodeXY(...)." << endl;
02913       cout << "*-----------------------------------------------------------------" << endl;
02914     }
02915 
02916   if(TypeOfCode == "CovOrCorCode")
02917     {
02918       cout << "*-------- Standard codes for matrix type (correlation or covariance);" << endl;
02919       cout << "    Cor  (correlation) " << endl;
02920       cout << "    cov  (covariance) " << endl;
02921       cout << " Other codes are available" << endl;
02922       cout << " See source file: TEcnaParHistos::BuildStandardCovOrCorCode(...)." << endl;
02923       cout << "*--------------------------------------------------------------------" << endl;
02924     }
02925 
02926   if(TypeOfCode == "BetweenWhatCode")
02927     {
02928       cout << "*-------- Standard codes for quantities in correlation or covariance;" << endl;
02929       cout << "    Mss    (between samples) " << endl;
02930       cout << "    MccLF  (low  frequency between channels) " << endl;
02931       cout << "    MccHF  (high frequency between channels) " << endl;
02932       cout << "    MttLF  (low  frequency between towers [if EB] or SC [if EE]) " << endl;
02933       cout << "    MttLF  (high frequency between towers [if EB] or SC [if EE]) " << endl;
02934       cout << " Other codes are available" << endl;
02935       cout << " See source file: TEcnaParHistos::BuildStandardBetweenWhatCode(...)." << endl;
02936       cout << "*--------------------------------------------------------------------" << endl;
02937     }
02938 }
02939 
02940 //========================== GetTechHistoCode ==========================
02941 
02942 TString TEcnaParHistos::GetTechHistoCode(const TString StandardHistoCode)
02943 {
02944   TString TechHistoCode = "?";
02945 
02946   //.................... standard code -> technical code for ViewMatrix, ViewStex, ViewStas
02947   if( StandardHistoCode == "NOE" ){TechHistoCode = "D_NOE_ChNb";}
02948   if( StandardHistoCode == "Ped" ){TechHistoCode = "D_Ped_ChNb";}
02949   if( StandardHistoCode == "TNo" ){TechHistoCode = "D_TNo_ChNb";}
02950   if( StandardHistoCode == "LFN" ){TechHistoCode = "D_LFN_ChNb";}
02951   if( StandardHistoCode == "HFN" ){TechHistoCode = "D_HFN_ChNb";}
02952   if( StandardHistoCode == "MCs" ){TechHistoCode = "D_MCs_ChNb";}
02953   if( StandardHistoCode == "SCs" ){TechHistoCode = "D_SCs_ChNb";}
02954 
02955   if( TechHistoCode == "?" )
02956     {
02957       cout << "*TEcnaParHistos::GetTechHistoCode(...)> StandardHistoCode = " << StandardHistoCode
02958            << " : code not found " << fTTBELL << endl;
02959     }
02960   return TechHistoCode;
02961 }
02962 //.......................................................................................................
02963 TString TEcnaParHistos::GetTechHistoCode(const TString X_Quantity, const TString Y_Quantity)
02964 {
02965   //........................... (X,Y) standard codes -> technical code
02966   TString TechHistoCode = "?";
02967 
02968   //........................... Matrix or Histo type
02969   if ( X_Quantity == "XtalORStin" && Y_Quantity == "NOE" ){TechHistoCode = "D_NOE_ChNb";}
02970   if ( X_Quantity == "XtalORStin" && Y_Quantity == "Ped" ){TechHistoCode = "D_Ped_ChNb";}
02971   if ( X_Quantity == "XtalORStin" && Y_Quantity == "TNo" ){TechHistoCode = "D_TNo_ChNb";}
02972   if ( X_Quantity == "XtalORStin" && Y_Quantity == "LFN" ){TechHistoCode = "D_LFN_ChNb";}
02973   if ( X_Quantity == "XtalORStin" && Y_Quantity == "HFN" ){TechHistoCode = "D_HFN_ChNb";}
02974   if ( X_Quantity == "XtalORStin" && Y_Quantity == "MCs" ){TechHistoCode = "D_MCs_ChNb";}
02975   if ( X_Quantity == "XtalORStin" && Y_Quantity == "SCs" ){TechHistoCode = "D_SCs_ChNb";}
02976 
02977   if ( X_Quantity == "NOE" && Y_Quantity == "NOX" ){TechHistoCode = "D_NOE_ChDs";}
02978   if ( X_Quantity == "Ped" && Y_Quantity == "NOX" ){TechHistoCode = "D_Ped_ChDs";}
02979   if ( X_Quantity == "TNo" && Y_Quantity == "NOX" ){TechHistoCode = "D_TNo_ChDs";}
02980   if ( X_Quantity == "LFN" && Y_Quantity == "NOX" ){TechHistoCode = "D_LFN_ChDs";}
02981   if ( X_Quantity == "HFN" && Y_Quantity == "NOX" ){TechHistoCode = "D_HFN_ChDs";}
02982   if ( X_Quantity == "MCs" && Y_Quantity == "NOX" ){TechHistoCode = "D_MCs_ChDs";}
02983   if ( X_Quantity == "SCs" && Y_Quantity == "NOX" ){TechHistoCode = "D_SCs_ChDs";}
02984 
02985   if ( X_Quantity == "Smp" && Y_Quantity == "MSp" ){TechHistoCode = "D_MSp_SpNb";}
02986   if ( X_Quantity == "MSp" && Y_Quantity == "NOS" ){TechHistoCode = "D_MSp_SpDs";}
02987   if ( X_Quantity == "Smp" && Y_Quantity == "SSp" ){TechHistoCode = "D_SSp_SpNb";}
02988   if ( X_Quantity == "SSp" && Y_Quantity == "NOS" ){TechHistoCode = "D_SSp_SpDs";}
02989 
02990   if ( X_Quantity == "Evt" && Y_Quantity == "Adc" ){TechHistoCode = "D_Adc_EvNb";}
02991   if ( X_Quantity == "Adc" && Y_Quantity == "NOE" ){TechHistoCode = "D_Adc_EvDs";}
02992 
02993   //................................ Histime type
02994   if( X_Quantity == "Time" && Y_Quantity == "Ped" ){TechHistoCode = "H_Ped_Date";}
02995   if( X_Quantity == "Ped"  && Y_Quantity == "NOR" ){TechHistoCode = "H_Ped_RuDs";}
02996 
02997   if( X_Quantity == "Time" && Y_Quantity == "TNo" ){TechHistoCode = "H_TNo_Date";}
02998   if( X_Quantity == "TNo"  && Y_Quantity == "NOR" ){TechHistoCode = "H_TNo_RuDs";}
02999 
03000   if( X_Quantity == "Time" && Y_Quantity == "LFN" ){TechHistoCode = "H_LFN_Date";}
03001   if( X_Quantity == "LFN"  && Y_Quantity == "NOR" ){TechHistoCode = "H_LFN_RuDs";}
03002 
03003   if( X_Quantity == "Time" && Y_Quantity == "HFN" ){TechHistoCode = "H_HFN_Date";}
03004   if( X_Quantity == "HFN"  && Y_Quantity == "NOR" ){TechHistoCode = "H_HFN_RuDs";}
03005 
03006   if( X_Quantity == "Time" && Y_Quantity == "MCs" ){TechHistoCode = "H_MCs_Date";}
03007   if( X_Quantity == "MCs"  && Y_Quantity == "NOR" ){TechHistoCode = "H_MCs_RuDs";}
03008 
03009   if( X_Quantity == "Time" && Y_Quantity == "SCs" ){TechHistoCode = "H_SCs_Date";}
03010   if( X_Quantity == "SCs"  && Y_Quantity == "NOR" ){TechHistoCode = "H_SCs_RuDs";}
03011 
03012   if( TechHistoCode == "?" )
03013     {
03014       cout << "TEcnaParHistos::GetTechHistoCode(...)> HistoCode not found. X_Quantity = " << X_Quantity
03015            << ", Y_Quantity = "<< Y_Quantity << endl;
03016     }
03017   return TechHistoCode;
03018 }
03019 
03020 TString TEcnaParHistos::GetCodeOnlyOnePlot(){return fOnlyOnePlot;}
03021 TString TEcnaParHistos::GetCodeSeveralPlot(){return fSeveralPlot;}
03022 TString TEcnaParHistos::GetCodeSameOnePlot(){return fSameOnePlot;}
03023 TString TEcnaParHistos::GetCodeAllXtalsInStinPlot(){return fAllXtalsInStinPlot;}
03024 Int_t   TEcnaParHistos::GetCodePlotAllXtalsInStin(){return fPlotAllXtalsInStin;}
03025 
03026 //================== End of TEcnaParHistos.cc ========================