Ignore:
Timestamp:
06/23/03 12:09:05 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MSigmabar.cc

    r2173 r2209  
    145145        }
    146146
    147         const MGeomPix    &gpix = geom[id];
    148         const MPedestalPix &pix =  ped[id];
     147        const MGeomPix &gpix = geom[id];
    149148
    150149        Int_t sector = (Int_t)(atan2(gpix.GetY(),gpix.GetX())*6 / (TMath::Pi()*2));
     
    153152
    154153        // count only those pixels which have a sigma != 0.0
    155         const Float_t sigma = pix.GetMeanRms();
     154        const Float_t sigma = ped[id].GetMeanRms();
    156155
    157156        if ( sigma <= 0 )
  • trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.cc

    r2173 r2209  
    6565}
    6666
    67 MSigmabarCalc::~MSigmabarCalc()
    68 {
    69   // nothing special yet.
    70 }
    71 
    7267// --------------------------------------------------------------------------
    7368//
     
    7570//  if not create one and add them to the list
    7671//
    77 Bool_t MSigmabarCalc::PreProcess(MParList *pList)
     72Int_t MSigmabarCalc::PreProcess(MParList *pList)
    7873{
    7974    fCam = (MGeomCam*)pList->FindObject("MGeomCam");
     
    9186    }
    9287
    93     fSig = (MSigmabar*)pList->FindCreateObj("MSigmabar");
    94     if (!fSig)
    95     {
    96         *fLog << err << "MSigmabar not found... aborting." << endl;
    97         return kFALSE;
    98     }
    99 
    100     fSigParam = (MSigmabarParam*)pList->FindCreateObj("MSigmabarParam");
    101     if (!fSigParam)
    102     {
    103         *fLog << err << "MSigmabarParam not found... aborting." << endl;
    104         return kFALSE;
    105     }
    106 
    10788    fRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    10889    if (!fRun)
     
    11192        return kFALSE;
    11293    }
    113    
     94
    11495    // This is needed for determining min/max Theta
    11596    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
    11697    if (!fMcEvt)
    117       {
    118         *fLog << err << "MMcEvt not found... aborting." << endl;
    119         return kFALSE;
    120       }
     98    {
     99        *fLog << warn << "MMcEvt not found... aborting." << endl;
     100        fThetaMin =  0;
     101        fThetaMax = 90;
     102    }
    121103
    122104    fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
     
    126108        return kFALSE;
    127109      }
     110
     111    fSig = (MSigmabar*)pList->FindCreateObj("MSigmabar");
     112    if (!fSig)
     113        return kFALSE;
     114
     115    fSigParam = (MSigmabarParam*)pList->FindCreateObj("MSigmabarParam");
     116    if (!fSigParam)
     117        return kFALSE;
     118
    128119
    129120    return kTRUE;
     
    137128// values. Preliminary.
    138129//
    139 Bool_t MSigmabarCalc::Process()
     130Int_t MSigmabarCalc::Process()
    140131{
    141132    const Double_t rc = fSig->Calc(*fCam, *fPed, *fEvt);
    142133
    143     fSigmabarMax = TMath::Max(rc, fSigmabarMax);
    144     fSigmabarMin = TMath::Min(rc, fSigmabarMin);
     134    if (rc>fSigmabarMax) fSigmabarMax=rc;
     135    if (rc<fSigmabarMin) fSigmabarMin=rc;
     136
     137    if (!fMcEvt)
     138        return kTRUE;
    145139
    146140    const Double_t theta = fMcEvt->GetTelescopeTheta()*kRad2Deg;
    147141
    148     fThetaMax = TMath::Max(theta, fThetaMax);
    149     fThetaMin = TMath::Min(theta, fThetaMin);
     142    if (theta>fSigmabarMax) fSigmabarMax=theta;
     143    if (theta<fSigmabarMax) fSigmabarMin=theta;
    150144
    151145    return kTRUE;
     
    169163void MSigmabarCalc::Reset()
    170164{
    171     fThetaMin = 200;    // there must be a function which gives me the hightest
    172     fThetaMax = 0;      // value allowed for a certain type!
    173     fSigmabarMin = 200;
     165    if (!fMcEvt)
     166        return;
     167
     168    fThetaMin    = FLT_MAX;
     169    fThetaMax    = 0;
     170    fSigmabarMin = FLT_MAX;
    174171    fSigmabarMax = 0;
    175172}
  • trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.h

    r1951 r2209  
    4848    void Reset();
    4949
     50    Int_t PreProcess(MParList *pList);
     51    Int_t Process();
     52
     53    Bool_t ReInit(MParList *pList);
     54
    5055public:
    5156    MSigmabarCalc(const char *name=NULL, const char *title=NULL);
    52     ~MSigmabarCalc();
    53 
    54     Bool_t PreProcess(MParList *pList);
    55     Bool_t ReInit(MParList *pList);
    56     Bool_t Process();
    5757
    5858    ClassDef(MSigmabarCalc, 0) // task for calculating sigmabar
Note: See TracChangeset for help on using the changeset viewer.