Changeset 4073 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
05/14/04 16:45:04 (20 years ago)
Author:
jlopez
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp/mifae
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MCalibrateDC.cc

    r4063 r4073  
    4242
    4343#include "MParList.h"
     44#include "MTaskList.h"
     45#include "MEvtLoop.h"
     46
     47#include "MReadReports.h"
     48#include "MGeomApply.h"
    4449
    4550ClassImp(MCalibrateDC);
     
    8287    }
    8388
     89    // Initialization of objects that need the information from MGeomCam
     90    fDisplay.SetGeometry(*fGeomCam);
     91    fNumPixels = fGeomCam->GetNumPixels();
     92
    8493    fCurr = (MCameraDC*)pList->FindObject(AddSerialNumber("MCameraDC"));
    8594
     
    99108
    100109    // Run over the continuos light run to get the DC intercalibration factors
    101     fNumPixels = fGeomCam->GetNumPixels();
    102110    fDCCalibrationFactor.Set(fNumPixels);
    103111    fDCCalibrationFactor.Reset(1.);
     
    105113    if ( fFileName != "" )
    106114      {
    107         // FIXME::Here it should be done the loop over the continuos light run
     115        ProcessFile();
    108116        DCCalibrationCalc();
    109117 
     
    136144         
    137145  return kTRUE;
     146}
     147
     148Bool_t MCalibrateDC::ProcessFile()
     149{
     150
     151    MParList plist;
     152    MTaskList tlist;
     153    plist.AddToList(&tlist);
     154
     155    MCameraDC     dccam;
     156    plist.AddToList(&dccam);
     157
     158    // Reads the trees of the root file and the analysed branches
     159    MReadReports read;
     160    read.AddTree("Currents");
     161    read.AddFile(fFileName);     // after the reading of the trees!!!
     162    read.AddToBranchList("MReportCurrents.*");
     163   
     164    MGeomApply geomapl;
     165
     166    tlist.AddToList(&geomapl);
     167    tlist.AddToList(&read);
     168
     169    // Enable logging to file
     170    //*fLog.SetOutputFile(lname, kTRUE);
     171
     172    //
     173    // Execute the eventloop
     174    //
     175    MEvtLoop evtloop(fName);
     176    evtloop.SetParList(&plist);
     177    evtloop.SetLogStream(fLog);
     178
     179    // Execute first analysis
     180      if (!evtloop.PreProcess())
     181        {
     182          *fLog << err << GetDescriptor() << ": Failed." << endl;
     183          return kFALSE;
     184        }
     185       
     186      while (tlist.Process())
     187        fDisplay.AddCamContent(dccam);
     188       
     189      evtloop.PostProcess();
     190
     191    tlist.PrintStatistics();
     192
     193    UInt_t numexecutions = read.GetNumExecutions();
     194    UInt_t numPixels = fDisplay.GetNumPixels();
     195    for (UInt_t pix = 1; pix < numPixels; pix++)
     196      fDisplay[pix] /= numexecutions;
     197   
     198
     199    *fLog << inf << GetDescriptor() << ": Done." << endl;
     200
     201    return kTRUE;
    138202}
    139203
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MCalibrateDC.h

    r4061 r4073  
    22#define MARS_MCalibrateDC
    33
    4 #ifndef ROOT_TArrayF
    5 #include <TArrayF.h>
     4#ifndef ROOT_TArrayD
     5#include <TArrayD.h>
    66#endif
    77
     
    4444
    4545    UInt_t fNumPixels ;
    46     TArrayF fDCCalibrationFactor;
    47     Float_t fDCMissCalibrationFactor;
     46    TArrayD fDCCalibrationFactor;
     47    Double_t fDCMissCalibrationFactor;
    4848   
    49     Float_t fDCCalibration; //[uA]
    50     Float_t fDCCalibrationRMS; //[uA]
     49    Double_t fDCCalibration; //[uA]
     50    Double_t fDCCalibrationRMS; //[uA]
    5151   
     52    Bool_t ProcessFile();
    5253    Bool_t DCCalibrationCalc();
    5354   
     
    6364    void SetFileName(TString filename="") {fFileName=filename;}
    6465   
    65   ClassDef(MCalibrateDC, 0) // Taks to intercalibrate the DC of all pmts from a continuos light run
     66    //Getters
     67    MHCamera& GetDisplay() { return fDisplay; }
     68    TArrayD&  GetDCCalibrationFactor() { return fDCCalibrationFactor; }
     69
     70    ClassDef(MCalibrateDC, 0) // Taks to intercalibrate the DC of all pmts from a continuos light run
    6671};
    6772
  • trunk/MagicSoft/Mars/mtemp/mifae/macros/findstars.C

    r4038 r4073  
    4747
    4848
    49 void findstars(const TString filename="dc_2004_03_18_20_37_19_20663_CrabNebula.root", const TString directory="/nfs/magic/CaCodata/rootdata/CrabNebula/Period015/2004_03_19/", const UInt_t numEvents = 11)
     49void findstars(const TString filename="dc_2004_03_19_00_36_50_20781_Mrk421.root", const TString directory="/nfs/magic/CaCodata/rootdata/Mrk421/Period015/2004_03_19/", const UInt_t numEvents = 0)
    5050{
    5151
     
    8080
    8181  MGeomApply geomapl;
    82 
    83 //   const Int_t numrings = 3;
    84   const Int_t numblind = 5;
    85   const Short_t x[numblind] = {  8,  27, 224, 279, 339};
     82  TString continuoslightfile =
     83    "/nfs/magic/CaCodata/rootdata/Miscellaneous/Period016/2004_04_16/dc_2004_04_16_04_46_18_22368_Off3c279-2CL100.root";
     84  MCalibrateDC dccal;
     85  dccal.SetFileName(continuoslightfile);
     86 
     87  const Int_t numblind = 12;
     88  const Short_t x[numblind] = {  8,  27,
     89                               507, 508, 509, 510, 511,
     90                               543, 559, 560, 561, 567};
    8691  const TArrayS blindpixels(numblind,(Short_t*)x);
    8792  MFindStars findstars;
    88 //   findstars.SetNumRings(numrings);
    89 //   findstars.SetBlindPixels(blindpixels);
     93  findstars.SetBlindPixels(blindpixels);
     94  Float_t ringinterest = 100; //[mm]
     95  Float_t tailcut = 3.5;
     96  UInt_t integratedevents = 10;
     97  findstars.SetRingInterest(ringinterest);
     98  findstars.SetDCTailCut(tailcut);
     99  findstars.SetNumIntegratedEvents(integratedevents);
     100  findstars.SetMinuitPrintOutLevel(0);
    90101
    91102  // prints
     
    95106  tlist.AddToList(&geomapl);
    96107  tlist.AddToList(&read);
     108  tlist.AddToList(&dccal);
    97109  //  tlist.AddToList(&pdc, "Currents");
    98110  tlist.AddToList(&findstars, "Currents");
     
    119131          return;
    120132     
     133       MHCamera display0(geomcam);
     134       display0.SetPrettyPalette();
     135       display0.Draw();
     136//        display0.SetCamContent(dccal.GetDisplay());
     137       display0.SetCamContent(dccal.GetDCCalibrationFactor());
     138       gPad->Modified();
     139       gPad->Update();
     140
     141       // Remove the comments if you want to go through the file
     142       // event-by-event:
     143       if (!HandleInput())
     144         break;
     145
    121146       MHCamera display(geomcam);
    122147       display.SetPrettyPalette();
    123148       display.Draw();
    124149       gPad->cd(1);
    125 //       starscam.Draw();
     150       starcam.Draw();
    126151     
    127       while (tlist.Process())
    128       {
    129           display.SetCamContent(dccam);
    130           gPad->Modified();
    131           gPad->Update();
    132           starcam.Print();
    133           // Remove the comments if you want to go through the file
    134           // event-by-event:
    135           if (!HandleInput())
    136               break;
     152       UInt_t numevents=0;
     153       
     154       while (tlist.Process())
     155         {
     156           numevents++;
     157           if (numevents%integratedevents==0)
     158             {
     159               //               display.SetCamContent(dccam);
     160               display.SetCamContent(findstars.GetDisplay());
     161               gPad->Modified();
     162               gPad->Update();
     163               starcam.Print("maxpossizechi");
     164               // Remove the comments if you want to go through the file
     165               // event-by-event:
     166               if (!HandleInput())
     167                 break;
     168             }
    137169      }
    138170
  • trunk/MagicSoft/Mars/mtemp/mifae/macros/psffit.C

    r3947 r4073  
    4747
    4848
    49 void psffit(const TString filename="dc_2004_02_15_01_51_22_17286_Mrk421.root", const TString directory="/nfs/magic/CaCodata/2004_02_15/", const UInt_t numEvents = 100000)
     49void psffit(const TString filename="dc_2004_03_19_00_36_50_20781_Mrk421.root", const TString directory="/nfs/magic/CaCodata/rootdata/Mrk421/Period015/2004_03_19/", const UInt_t numEvents = 0)
    5050{
    5151
     
    130130          gPad->Modified();
    131131          gPad->Update();
     132          psffit.Print();
    132133          // Remove the comments if you want to go through the file
    133134          // event-by-event:
Note: See TracChangeset for help on using the changeset viewer.