Changeset 9261 for trunk/MagicSoft


Ignore:
Timestamp:
01/25/09 14:32:11 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/melectronics/MAvalanchePhotoDiode.cc

    r9243 r9261  
    165165        case 2: if (y<fHist.GetNbinsY()) n += HitCellImp(x, y+1, t); break;
    166166        case 3: if (y>1)                 n += HitCellImp(x, y-1, t); break;
    167         /*
    168          case 0: x++; if (x>fHist.GetNbinsX()) continue; break;
    169          case 1: x--; if (x<1) continue;                 break;
    170          case 2: y++; if (y>fHist.GetNbinsY()) continue; break;
    171          case 3: y--; if (y<1) continue;                 break;*/
    172167        }
    173168
    174169        // In the unlikely case the calculated direction is out-of-range,
    175170        // i.e. <0 or >3, we would just try to fill the same cell again which
    176 
    177         //n += HitCellImp(x, y, t);
    178171    }
    179172
     
    236229    for (int i=0; i<n; i++)
    237230        fHist.GetArray()[i] = tm;
     231
     232    fHist.SetEntries(1);
    238233}
    239234
  • trunk/MagicSoft/Mars/melectronics/MAvalanchePhotoDiode.h

    r9242 r9261  
    66#endif
    77
    8 class APD : public TObject
     8class APD : public TObject  // FIXME: Derive from TH2?
    99{
    1010private:
     
    2929    Int_t CountRecoveringCells(Float_t t=0) const;
    3030
     31    Float_t GetCellContent(Int_t x, Int_t y) const { return fHist.GetBinContent(x, y); }
     32    Int_t   GetNumCellsX() const { return fHist.GetNbinsX(); }
     33
     34    Float_t GetCrosstalkProb() const { return fCrosstalkProb; }
     35    Float_t GetDeadTime() const { return fDeadTime; }
     36    Float_t GetRecoveryTime() const { return fRecoveryTime; }
     37
     38    void Draw(Option_t *o="") { fHist.Draw(o); }
     39    void DrawCopy(Option_t *o="") { fHist.DrawCopy(o); }
     40
    3141    ClassDef(APD, 1) // An object representing a Geigermode APD
    3242};
  • trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc

    r9181 r9261  
    4949
    5050#include "MMath.h"
     51#include "MString.h"
    5152#include "MDirIter.h"
    5253
     
    891892    const Double_t exp = TMath::Power(10, i);
    892893
    893     TString str = Form("(%s #pm %s)·10^{%d} ",
    894                        FormFloat(p1/exp).Data(), FormFloat(e1/exp).Data(), i);
    895 
    896     str += Form("#left(#frac{E}{%s}#right)^{-%s #pm %s}", unit,
    897                 FormFloat(p0).Data(), FormFloat(e0).Data());
     894    TString str = MString::Format("(%s #pm %s)·10^{%d} ",
     895                                  FormFloat(p1/exp).Data(), FormFloat(e1/exp).Data(), i);
     896
     897    str += MString::Format("#left(#frac{E}{%s}#right)^{-%s #pm %s}", unit,
     898                           FormFloat(p0).Data(), FormFloat(e0).Data());
    898899
    899900    str += " TeV^{-1} m^{-2} s^{-1}";
     
    909910        return FormFlux(f, "500GeV");
    910911    case 1:
    911         return Form("\\chi^{2}/NDF=%.2f/%d", f.GetChisquare(),f.GetNDF());
     912        return MString::Format("\\chi^{2}/NDF=%.2f/%d", f.GetChisquare(),f.GetNDF());
    912913    case 2:
    913         return Form("P=%.0f%%", 100*TMath::Prob(f.GetChisquare(),  f.GetNDF()));
     914        return MString::Format("P=%.0f%%", 100*TMath::Prob(f.GetChisquare(),  f.GetNDF()));
    914915    }
    915916    return "";
     
    14921493        return kFALSE;
    14931494
    1494     CheckEnv();
     1495    if (!CheckEnv())
     1496        return kFALSE;
    14951497
    14961498    // --------------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r9230 r9261  
    140140    }
    141141
    142     //if (!CheckEnv())
    143     //    return kFALSE;
    144 
    145     CheckEnv();
    146 
    147142    // --------------------------------------------------------------------------------
    148143
     
    152147    *fLog << fSequence.GetFileName() << endl;
    153148    *fLog << endl;
     149
     150    if (!CheckEnv())
     151        return kFALSE;
    154152 
    155153    // --------------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mjobs/MJob.cc

    r9257 r9261  
    277277// For exmaple:
    278278//    RandomNumberGenerator: TRandom3
    279 //    RandomNumberSeeValue:  0
     279//    RandomNumberSeedValue:  0
    280280//
    281281Bool_t MJob::InitRandomNumberGenerator() const
     
    301301
    302302    // Nothing: Keep seed value, 0 set time as seed value, val set seed
    303     const TString seed = GetEnv("RandomNumberSeedNumber", "");
     303    const TString seed = GetEnv("RandomNumberSeedValue", "");
    304304    if (!seed.IsNull())
    305305    {
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.h

    r9239 r9261  
    162162    Bool_t IsPedestalRun() const    { return (fRunType&0xff)==kRTPedestal; }
    163163    Bool_t IsCalibrationRun() const { return (fRunType&0xff)==kRTCalibration; }
     164    Bool_t IsPointRun() const       { return (fRunType&0xff)==kRTPointRun; }
    164165
    165166    void Print(Option_t *t=NULL) const;
  • trunk/MagicSoft/Mars/msignal/MSignalCalc.cc

    r8939 r9261  
    127127Int_t MSignalCalc::Process()
    128128{
     129    if (!fPedestals)
     130        return kFALSE;
     131
    129132    const Int_t npix = fRawEvt->GetNumPixels();
    130133    const Int_t nhi  = fRunHeader->GetNumSamplesHiGain();
     
    259262        // Preliminary: Do not overwrite pedestals calculated by
    260263        // MMcPedestalCopy and MMcPedestalNSBAdd
    261         if (fPedestals)
    262             (*fPedestals)[i].Set(b/fRunHeader->GetScale(), sigb/fRunHeader->GetScale());
     264        (*fPedestals)[i].Set(b/fRunHeader->GetScale(), sigb/fRunHeader->GetScale());
    263265    }
    264266
     
    266268    //fCerPhotEvt->SetReadyToSave();
    267269
    268     if (fPedestals)
    269         fPedestals->SetReadyToSave();
     270    fPedestals->SetReadyToSave();
    270271
    271272    return kTRUE;
  • trunk/MagicSoft/Mars/msignal/MSignalCam.cc

    r9212 r9261  
    570570//  7: arrival time if signa avove 20phe
    571571//  8: arrival time
    572 // 10: arrival time if extracted from lo-gain
    573 // 11: arrival time if extracted from hi-gain (and signal above 20phe)
     572// 10: as 0, but returns kFALSE if signal <=0
     573// 11: as 8, but returns kFALSE if signal <=0
    574574//
    575575Bool_t MSignalCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
     
    648648        */
    649649
     650    case 10:
     651        val = pix.GetNumPhotons()*ratio;
     652        return val>0;
     653
     654    case 11:
     655        val = pix.GetArrivalTime();
     656        return pix.GetNumPhotons()>0;
     657
    650658    case 9:
    651659    default:
  • trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc

    r9243 r9261  
    189189            break;
    190190        }
    191     case 3:
    192     case 4:
     191    case 3: // The maximum radius
     192    case 4: // Two times the pixel-0 traversal size
    193193        {
    194194            MGeomCam *c = (MGeomCam*)pList->FindObject("MGeomCam");
     
    198198                return kFALSE;
    199199            }
    200             xmax = fType==3 ? c->GetMaxRadius()/10 : c->GetMaxRadius()/100;
     200            xmax = fType==3 ? c->GetMaxRadius()/10 : 2*(*c)[0].GetT()/10;
    201201            num  = 50;
    202202
  • trunk/MagicSoft/Mars/msimcamera/MSimSignalCam.cc

    r9243 r9261  
    163163        pix.SetNumPhotons(fCont[idx]); // gRandom->Uniform(last-first)
    164164        pix.SetArrivalTime(fCont[idx]<=0 ? -1 : fTime[idx]/fCont[idx]-first);
    165         pix.SetPixelUsed();
     165        pix.SetRing(fCont[idx]>0); // Used==1, Unused==0
    166166        pix.SetPixelCore(kFALSE);
    167167    }
  • trunk/MagicSoft/Mars/msimcamera/MSimTrigger.cc

    r9256 r9261  
    289289    return kTRUE;
    290290}
     291
     292// --------------------------------------------------------------------------
     293//
     294// FileNameRouteac:         routeac.txt
     295// FileNameCoincidenceMap:  coincidence.txt
     296// DiscriminatorTheshold:   3.5
     297//
     298Int_t MSimTrigger::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     299{
     300    Bool_t rc = kFALSE;
     301    if (IsEnvDefined(env, prefix, "FileNameRouteAC", print))
     302    {
     303        rc = kTRUE;
     304        fNameRouteAC = GetEnvValue(env, prefix, "FileNameRouteAC", fNameRouteAC);
     305    }
     306
     307    if (IsEnvDefined(env, prefix, "FileNameCoincidenceMap", print))
     308    {
     309        rc = kTRUE;
     310        fNameCoincidenceMap = GetEnvValue(env, prefix, "FileNameCoincidenceMap", fNameCoincidenceMap);
     311    }
     312
     313    if (IsEnvDefined(env, prefix, "DiscriminatorThreshold", print))
     314    {
     315        rc = kTRUE;
     316        fDiscriminatorThreshold = GetEnvValue(env, prefix, "DiscriminatorThreshold", fDiscriminatorThreshold);
     317    }
     318
     319    return rc;
     320}
  • trunk/MagicSoft/Mars/msimcamera/MSimTrigger.h

    r9256 r9261  
    4040    Int_t Process();
    4141
     42    // MParContainer
     43    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     44
    4245public:
    4346    MSimTrigger(const char *name=NULL, const char *title=NULL);
Note: See TracChangeset for help on using the changeset viewer.