Changeset 6385


Ignore:
Timestamp:
02/11/05 19:43:08 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc

    r6206 r6385  
    150150#include <TLegend.h>
    151151#include <TGraph.h>
     152#include <TEnv.h>
    152153
    153154ClassImp(MHCalibrationChargeCam);
     
    174175const Float_t MHCalibrationChargeCam::fgTimeLowerLimit           = 1.;
    175176const Float_t MHCalibrationChargeCam::fgTimeUpperLimit           = 3.;
    176 // 1Led Green, 1 LED blue, 5 LEDs blue, 10 LEDs blue, 10 LEDs UV, CT1, 5Leds Green
    177 const Float_t MHCalibrationChargeCam::gkHiGainInnerRefLines[7]   = { 245., 323. , 1065., 1467., 258., 211. , 533.5};   
    178 const Float_t MHCalibrationChargeCam::gkHiGainOuterRefLines[7]   = { 217., 307.5, 932. , 1405., 262.5, 183.5, 405.5};
    179 const Float_t MHCalibrationChargeCam::gkLoGainInnerRefLines[7]   = { 20.8, 28.0 , 121. , 200.2, 16.5, 13.5 , 41.7 };
    180 const Float_t MHCalibrationChargeCam::gkLoGainOuterRefLines[7]   = { 18.9, 26.0 , 108.3, 198. , 14.0, 11.  , 42.  };
     177const TString MHCalibrationChargeCam::fgReferenceFile = "mjobs/calibrationref.rc";
    181178// --------------------------------------------------------------------------
    182179//
     
    242239  SetAbsHistXTitle(gsAbsHistXTitle.Data());
    243240  SetAbsHistYTitle(gsAbsHistYTitle.Data());
     241
     242  SetReferenceFile();
     243
     244  fInnerRefCharge = 278.;
     245  fOuterRefCharge = 282.;
    244246}
    245247
     
    270272  cam->fLoGainFirst            = fLoGainFirst;
    271273  cam->fLoGainLast             = fLoGainLast;
     274  cam->fReferenceFile          = fReferenceFile;
    272275
    273276  //
     
    12011204         {
    12021205           MHCalibrationChargePix &lopix = (MHCalibrationChargePix&)GetAverageLoGainArea(i);
    1203            DrawDataCheckPixel(lopix,i ? gkLoGainOuterRefLines : gkLoGainInnerRefLines);
     1206           DrawDataCheckPixel(lopix,i ? fOuterRefCharge : fInnerRefCharge);
    12041207         }
    12051208       else
    1206          DrawDataCheckPixel(hipix,i ? gkHiGainOuterRefLines : gkHiGainInnerRefLines);
     1209         DrawDataCheckPixel(hipix,i ? fOuterRefCharge : fInnerRefCharge);
    12071210
    12081211    }     
     
    12171220// Calls the Draw of the fAverageHiGainAreas and fAverageLoGainAreas objects with options
    12181221//
    1219 void MHCalibrationChargeCam::DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline[])
     1222void MHCalibrationChargeCam::DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline)
    12201223{
    12211224 
     
    13311334
    13321335
    1333 void  MHCalibrationChargeCam::DisplayRefLines(const TH1F *hist, const Float_t refline[]) const
     1336void  MHCalibrationChargeCam::DisplayRefLines(const TH1F *hist, const Float_t refline) const
    13341337{
    13351338
    1336   TGraph *green1 = new TGraph(2);
    1337   green1->SetPoint(0,refline[0],0.1);
    1338   green1->SetPoint(1,refline[0],hist->GetMaximum());
    1339   green1->SetBit(kCanDelete);
    1340   green1->SetLineColor(kGreen);
    1341   green1->SetLineStyle(2);
    1342   green1->SetLineWidth(3);
    1343   green1->Draw("L");
    1344 
    1345   TGraph *green5 = new TGraph(2);
    1346   green5->SetPoint(0,refline[6],0.1);
    1347   green5->SetPoint(1,refline[6],hist->GetMaximum());
    1348   green5->SetBit(kCanDelete);
    1349   green5->SetLineColor(8);
    1350   green5->SetLineStyle(2);
    1351   green5->SetLineWidth(3);
    1352   green5->Draw("L");
    1353 
    1354   TGraph *blue1   = new TGraph(2);
    1355   blue1->SetPoint(0,refline[1],0.1);
    1356   blue1->SetPoint(1,refline[1],hist->GetMaximum());
    1357   blue1->SetBit(kCanDelete);
    1358   blue1->SetLineColor(227);
    1359   blue1->SetLineStyle(2);
    1360   blue1->SetLineWidth(3);
    1361   blue1->Draw("L");
    1362 
    1363   TGraph *blue5   = new TGraph(2);
    1364   blue5->SetPoint(0,refline[2],0.1);
    1365   blue5->SetPoint(1,refline[2],hist->GetMaximum());
    1366   blue5->SetBit(kCanDelete);
    1367   blue5->SetLineColor(68);
    1368   blue5->SetLineStyle(2);
    1369   blue5->SetLineWidth(3);
    1370   blue5->Draw("L");
    1371 
    1372   TGraph *blue10   = new TGraph(2);
    1373   blue10->SetPoint(0,refline[3],0.1);
    1374   blue10->SetPoint(1,refline[3],hist->GetMaximum());
    1375   blue10->SetBit(kCanDelete);
    1376   blue10->SetLineColor(4);
    1377   blue10->SetLineStyle(2);
    1378   blue10->SetLineWidth(3);
    1379   blue10->Draw("L");
    1380 
    13811339  TGraph *uv10    = new TGraph(2);
    1382   uv10->SetPoint(0,refline[4],0.1);
    1383   uv10->SetPoint(1,refline[4],hist->GetMaximum());
     1340  uv10->SetPoint(0,refline,0.1);
     1341  uv10->SetPoint(1,refline,hist->GetMaximum());
    13841342  uv10->SetBit(kCanDelete);
    13851343  uv10->SetLineColor(106);
     
    13881346  uv10->Draw("L");
    13891347
    1390   TGraph *ct1    = new TGraph(2);
    1391   ct1->SetPoint(0,refline[5],0.1);
    1392   ct1->SetPoint(1,refline[5],hist->GetMaximum());
    1393   ct1->SetBit(kCanDelete);
    1394   ct1->SetLineColor(6);
    1395   ct1->SetLineStyle(2);
    1396   ct1->SetLineWidth(3);
    1397   ct1->Draw("L");
    1398 
    13991348  TLegend *leg = new TLegend(0.8,0.35,0.99,0.99);
    14001349  leg->SetBit(kCanDelete);
    1401   leg->AddEntry(green1,"1 Led GREEN","l");
    1402   leg->AddEntry(green5,"5 Leds GREEN","l");
    1403   leg->AddEntry(blue1,"1 Led BLUE","l");
    1404   leg->AddEntry(blue5,"5 Leds BLUE","l");
    1405   leg->AddEntry(blue10,"10 Leds BLUE","l");
    14061350  leg->AddEntry(uv10,"10 Leds UV","l");
    1407   leg->AddEntry(ct1,"CT1-Pulser","l");
    14081351
    14091352  leg->Draw();
     
    14661409    }
    14671410   
    1468  
     1411  if (IsEnvDefined(env, prefix, "ReferenceFile", print))
     1412    {
     1413      SetReferenceFile(GetEnvValue(env,prefix,"ReferenceFile",fReferenceFile.Data()));
     1414      rc = kTRUE;
     1415    }
     1416
     1417  TEnv refenv(fReferenceFile);
     1418
     1419  fInnerRefCharge = refenv.GetValue("InnerRefCharge",fInnerRefCharge);
     1420  fOuterRefCharge = refenv.GetValue("OuterRefCharge",fOuterRefCharge);
     1421
    14691422  return rc;
    14701423}
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h

    r5864 r6385  
    3232  static const Float_t fgProbLimit;                  //! The default for fProbLimit    (now set to: 0.00001)
    3333 
     34  static const TString fgReferenceFile;              //! default for fReferenceFile ("mjobs/calibrationref.rc")
     35
    3436  static const TString gsHistName;                   //! Default Histogram names
    3537  static const TString gsHistTitle;                  //! Default Histogram titles
     
    3739  static const TString gsHistYTitle;                 //! Default Histogram y-axis titles
    3840 
    39   static const TString gsAbsHistName;               //! Default Histogram names abs.times
    40   static const TString gsAbsHistTitle;              //! Default Histogram titles abs.times
    41   static const TString gsAbsHistXTitle;             //! Default Histogram x-axis titles abs.times
    42   static const TString gsAbsHistYTitle;             //! Default Histogram y-axis titles abs.times
     41  static const TString gsAbsHistName;                //! Default Histogram names abs.times
     42  static const TString gsAbsHistTitle;               //! Default Histogram titles abs.times
     43  static const TString gsAbsHistXTitle;              //! Default Histogram x-axis titles abs.times
     44  static const TString gsAbsHistYTitle;              //! Default Histogram y-axis titles abs.times
    4345 
    4446  static const Float_t fgNumHiGainSaturationLimit;   //! The default for fNumHiGainSaturationLimit (now at: 0.01)
     
    4850  static const Float_t fgTimeUpperLimit;             //! Default for fTimeUpperLimit    (now set to: 2.)
    4951 
    50   static const Float_t gkHiGainInnerRefLines[7];     //!
    51   static const Float_t gkHiGainOuterRefLines[7];     //!
    52   static const Float_t gkLoGainInnerRefLines[7];     //!
    53   static const Float_t gkLoGainOuterRefLines[7];     //!
    54 
    5552  Int_t   fLoGainNbins;                              // Number of LoGain bins       
    5653  Axis_t  fLoGainFirst;                              // Lower histogram limit low gain
     
    6259  TString fAbsHistYTitle;                            // Histogram y-axis titles abs. times
    6360 
     61  TString fReferenceFile;                            // File name containing the reference values
     62
     63  Float_t fInnerRefCharge;                           // The reference mean arrival time inner pixels
     64  Float_t fOuterRefCharge;                           // The reference mean arrival time outer pixels
     65
    6466  MArrayD fSumhiarea  ;                              //!
    6567  MArrayD fSumloarea  ;                              //!
     
    7678  MArrayI fSatlosector;                              //!
    7779
    78   Float_t fTimeLowerLimit;            // Limit dist. to first signal slice (in units of FADC slices)
    79   Float_t fTimeUpperLimit;            // Limit dist. to last signal slice  (in units of FADC slices)
    80   Byte_t  fFirstHiGain;               // First used slice High Gain
    81   Byte_t  fLastHiGain;                // Last used slice High Gain
    82   Byte_t  fFirstLoGain;               // First used slice Low Gain
    83   Byte_t  fLastLoGain;                // Last used slice Low Gain
     80  Float_t fTimeLowerLimit;                           // Limit dist. to first signal slice (in units of FADC slices)
     81  Float_t fTimeUpperLimit;                           // Limit dist. to last signal slice  (in units of FADC slices)
     82  Byte_t  fFirstHiGain;                              // First used slice High Gain
     83  Byte_t  fLastHiGain;                               // Last used slice High Gain
     84  Byte_t  fFirstLoGain;                              // First used slice Low Gain
     85  Byte_t  fLastLoGain;                               // Last used slice Low Gain
    8486 
    85   MRawEvtData         *fRawEvt;       //!  Raw event data
     87  MRawEvtData         *fRawEvt;                      //!  Raw event data
    8688
    8789  Bool_t SetupHists(const MParList *pList);
     
    9799  void   FinalizeBadPixels();
    98100
    99   void   DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline[]);
    100   void   DisplayRefLines   ( const TH1F *hist,           const Float_t refline[]) const;
     101  void   DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline);
     102  void   DisplayRefLines   ( const TH1F *hist,           const Float_t refline) const;
    101103
    102104  Int_t ReadEnv        ( const TEnv &env, TString prefix, Bool_t print);
     
    110112  TObject *Clone(const char *name="") const;
    111113
    112   void SetLoGainNbins       ( const Int_t  i )       { fLoGainNbins   = i; }
    113   void SetLoGainFirst       ( const Axis_t f )       { fLoGainFirst   = f; }
    114   void SetLoGainLast        ( const Axis_t f )       { fLoGainLast    = f; } 
     114  // Draw
     115  void   Draw(const Option_t *opt);
    115116
    116   void SetTimeLowerLimit    ( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; }
    117   void SetTimeUpperLimit    ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; }
     117  void SetAbsHistName   ( const char *name )  { fAbsHistName   = name; }
     118  void SetAbsHistTitle  ( const char *name )  { fAbsHistTitle  = name; }
     119  void SetAbsHistXTitle ( const char *name )  { fAbsHistXTitle = name; }
     120  void SetAbsHistYTitle ( const char *name )  { fAbsHistYTitle = name; }
     121   
     122  void SetLoGainNbins   ( const Int_t  i )    { fLoGainNbins   = i; }
     123  void SetLoGainFirst   ( const Axis_t f )    { fLoGainFirst   = f; }
     124  void SetLoGainLast    ( const Axis_t f )    { fLoGainLast    = f; } 
     125
     126  void SetReferenceFile ( const TString ref=fgReferenceFile ) { fReferenceFile  = ref; }
     127
     128  void SetTimeLowerLimit( const Float_t f=fgTimeLowerLimit )  { fTimeLowerLimit = f; }
     129  void SetTimeUpperLimit( const Float_t f=fgTimeUpperLimit )  { fTimeUpperLimit = f; }
    118130 
    119   void SetAbsHistName  ( const char *name )  { fAbsHistName  = name;  }
    120   void SetAbsHistTitle ( const char *name )  { fAbsHistTitle = name;  }
    121   void SetAbsHistXTitle( const char *name )  { fAbsHistXTitle = name; }
    122   void SetAbsHistYTitle( const char *name )  { fAbsHistYTitle = name; }
    123    
    124131  Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; }
    125132  void   DrawPixelContent( Int_t num )  const;   
    126 
    127   // Draw
    128   void   Draw(const Option_t *opt);
    129133
    130134  ClassDef(MHCalibrationChargeCam, 1)   // Histogram class for Charge Camera Calibration
  • trunk/MagicSoft/Mars/mjobs/calibrationref.rc

    r6126 r6385  
     1InnerRefCharge:         278.
     2OuterRefCharge:         282.
    13ConvFADC2PheMin:          0.
    24ConvFADC2PheMax:          5.
Note: See TracChangeset for help on using the changeset viewer.