Changeset 14864 for trunk/Mars/mjobs


Ignore:
Timestamp:
02/04/13 12:04:37 (12 years ago)
Author:
tbretz
Message:
Added the possibility to switch between fits and root files.
Location:
trunk/Mars/mjobs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mjobs/MJSimulation.cc

    r14792 r14864  
    129129MJSimulation::MJSimulation(const char *name, const char *title)
    130130    : fForceMode(kFALSE), fCamera(kTRUE), fForceTrigger(kFALSE),
    131     fOperationMode(kModeData), fRunNumber(-1)
     131    fWriteFitsFile(kFALSE), fOperationMode(kModeData), fRunNumber(-1)
    132132{
    133133    fName  = name  ? name  : "MJSimulation";
     
    544544    MWriteRootFile write4a( 2, rule4, fOverwrite?"RECREATE":"NEW", "Star file");
    545545    MWriteRootFile write4b( 2, rule4, fOverwrite?"RECREATE":"NEW", "Star file");
    546     MWriteFitsFile write3a( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file");
    547546    MWriteRootFile write3b( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file");
    548547    MWriteRootFile write2a( 2, rule2, fOverwrite?"RECREATE":"NEW", "Signal file");
     
    551550    MWriteRootFile write1b( 2, rule1, fOverwrite?"RECREATE":"NEW", "Reflector file");
    552551
    553     write3a.VetoColumn("MParameterD.fVal");
    554     write3a.VetoColumn("MCorsikaEvtHeader.fEvtNumber");
    555     write3a.VetoColumn("MCorsikaEvtHeader.fNumReuse");
    556     write3a.VetoColumn("MCorsikaEvtHeader.fTotalEnergy");
    557     write3a.VetoColumn("MCorsikaEvtHeader.fStartAltitude");
    558     write3a.VetoColumn("MCorsikaEvtHeader.fFirstTargetNum");
    559     write3a.VetoColumn("MCorsikaEvtHeader.fFirstInteractionHeight");
    560     write3a.VetoColumn("MCorsikaEvtHeader.fMomentumX");
    561     write3a.VetoColumn("MCorsikaEvtHeader.fMomentumY");
    562     write3a.VetoColumn("MCorsikaEvtHeader.fMomentumZ");
    563     write3a.VetoColumn("MCorsikaEvtHeader.fAz");
    564     write3a.VetoColumn("MCorsikaEvtHeader.fWeightedNumPhotons");
    565     write3a.VetoColumn("MCorsikaEvtHeader.fZd");
    566     write3a.VetoColumn("MCorsikaEvtHeader.fAd");
    567     write3a.VetoColumn("MCorsikaEvtHeader.fX");
    568     write3a.VetoColumn("MCorsikaEvtHeader.fY");
    569     write3a.VetoColumn("MCorsikaEvtHeader.fWeightNumPhotons");
    570     write3a.VetoColumn("MMcEvt.fEvtNumber");
    571     write3a.VetoColumn("MMcEvt.fThick0");
    572     write3a.VetoColumn("MMcEvt.fFirstTarget");
    573     write3a.VetoColumn("MMcEvt.fZFirstInteraction");
    574     write3a.VetoColumn("MMcEvt.fCoreD");
    575     write3a.VetoColumn("MMcEvt.fCoreX");
    576     write3a.VetoColumn("MMcEvt.fCoreY");
    577     write3a.VetoColumn("MMcEvt.fTimeFirst");
    578     write3a.VetoColumn("MMcEvt.fTimeLast");
    579     write3a.VetoColumn("MMcEvt.fLongiNmax");
    580     write3a.VetoColumn("MMcEvt.fLongit0");
    581     write3a.VetoColumn("MMcEvt.fLongitmax");
    582     write3a.VetoColumn("MMcEvt.fLongia");
    583     write3a.VetoColumn("MMcEvt.fLongib");
    584     write3a.VetoColumn("MMcEvt.fLongic");
    585     write3a.VetoColumn("MMcEvt.fLongichi2");
    586     write3a.VetoColumn("MMcEvt.fPhotIni");
    587     write3a.VetoColumn("MMcEvt.fPassPhotAtm");
    588     write3a.VetoColumn("MMcEvt.fPassPhotRef");
    589     write3a.VetoColumn("MMcEvt.fPassPhotCone");
    590     write3a.VetoColumn("MMcEvt.fPhotElfromShower");
    591     write3a.VetoColumn("MMcEvt.fPhotElinCamera");
    592     write3a.VetoColumn("MMcEvt.fElecCphFraction");
    593     write3a.VetoColumn("MMcEvt.fMuonCphFraction");
    594     write3a.VetoColumn("MMcEvt.fOtherCphFraction");
    595     write3a.VetoColumn("MMcEvt.fFadcTimeJitter");
    596     write3a.VetoColumn("MMcEvt.fEventReuse");
    597     write3a.VetoColumn("MRawEvtData.fHiGainPixId");
    598 //    write3a.VetoColumn("MRawEvtData.fHiGainFadcSamples");
    599     write3a.VetoColumn("MRawEvtData.fLoGainPixId");
    600     write3a.VetoColumn("MRawEvtData.fLoGainFadcSamples");
    601     write3a.VetoColumn("MRawEvtData.fABFlags");
    602     write3a.VetoColumn("MRawEvtData.fStartCells");
    603     write3a.VetoColumn("MRawEvtData.fNumBytesPerSample");
    604     write3a.VetoColumn("MRawEvtData.fIsSigned");
    605 //    write3a.VetoColumn("MRawEvtHeader.fDAQEvtNumber"); //EventNum ?
    606     write3a.VetoColumn("MRawEvtHeader.fNumTrigLvl1");
    607     write3a.VetoColumn("MRawEvtHeader.fNumTrigLvl2");
    608     write3a.VetoColumn("MRawEvtHeader.fTrigPattern");
    609     write3a.VetoColumn("MRawEvtHeader.fNumLoGainOn");
    610 
    611     write3a.SetBytesPerSample("Data", 2);
     552    MWriteFitsFile write3af( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file");
     553    MWriteRootFile write3ar( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file");
     554
     555    MTask &write3a = fWriteFitsFile ? static_cast<MTask&>(write3af) : static_cast<MTask&>(write3ar);
     556
     557    write3af.VetoColumn("MParameterD.fVal");
     558    write3af.VetoColumn("MCorsikaEvtHeader.fEvtNumber");
     559    write3af.VetoColumn("MCorsikaEvtHeader.fNumReuse");
     560    write3af.VetoColumn("MCorsikaEvtHeader.fTotalEnergy");
     561    write3af.VetoColumn("MCorsikaEvtHeader.fStartAltitude");
     562    write3af.VetoColumn("MCorsikaEvtHeader.fFirstTargetNum");
     563    write3af.VetoColumn("MCorsikaEvtHeader.fFirstInteractionHeight");
     564    write3af.VetoColumn("MCorsikaEvtHeader.fMomentumX");
     565    write3af.VetoColumn("MCorsikaEvtHeader.fMomentumY");
     566    write3af.VetoColumn("MCorsikaEvtHeader.fMomentumZ");
     567    write3af.VetoColumn("MCorsikaEvtHeader.fAz");
     568    write3af.VetoColumn("MCorsikaEvtHeader.fWeightedNumPhotons");
     569    write3af.VetoColumn("MCorsikaEvtHeader.fZd");
     570    write3af.VetoColumn("MCorsikaEvtHeader.fAd");
     571    write3af.VetoColumn("MCorsikaEvtHeader.fX");
     572    write3af.VetoColumn("MCorsikaEvtHeader.fY");
     573    write3af.VetoColumn("MCorsikaEvtHeader.fWeightNumPhotons");
     574    write3af.VetoColumn("MMcEvt.fEvtNumber");
     575    write3af.VetoColumn("MMcEvt.fThick0");
     576    write3af.VetoColumn("MMcEvt.fFirstTarget");
     577    write3af.VetoColumn("MMcEvt.fZFirstInteraction");
     578    write3af.VetoColumn("MMcEvt.fCoreD");
     579    write3af.VetoColumn("MMcEvt.fCoreX");
     580    write3af.VetoColumn("MMcEvt.fCoreY");
     581    write3af.VetoColumn("MMcEvt.fTimeFirst");
     582    write3af.VetoColumn("MMcEvt.fTimeLast");
     583    write3af.VetoColumn("MMcEvt.fLongiNmax");
     584    write3af.VetoColumn("MMcEvt.fLongit0");
     585    write3af.VetoColumn("MMcEvt.fLongitmax");
     586    write3af.VetoColumn("MMcEvt.fLongia");
     587    write3af.VetoColumn("MMcEvt.fLongib");
     588    write3af.VetoColumn("MMcEvt.fLongic");
     589    write3af.VetoColumn("MMcEvt.fLongichi2");
     590    write3af.VetoColumn("MMcEvt.fPhotIni");
     591    write3af.VetoColumn("MMcEvt.fPassPhotAtm");
     592    write3af.VetoColumn("MMcEvt.fPassPhotRef");
     593    write3af.VetoColumn("MMcEvt.fPassPhotCone");
     594    write3af.VetoColumn("MMcEvt.fPhotElfromShower");
     595    write3af.VetoColumn("MMcEvt.fPhotElinCamera");
     596    write3af.VetoColumn("MMcEvt.fElecCphFraction");
     597    write3af.VetoColumn("MMcEvt.fMuonCphFraction");
     598    write3af.VetoColumn("MMcEvt.fOtherCphFraction");
     599    write3af.VetoColumn("MMcEvt.fFadcTimeJitter");
     600    write3af.VetoColumn("MMcEvt.fEventReuse");
     601
     602    write3af.VetoColumn("MRawEvtData.fHiGainPixId");
     603    write3af.VetoColumn("MRawEvtData.fLoGainPixId");
     604    write3af.VetoColumn("MRawEvtData.fLoGainFadcSamples");
     605    write3af.VetoColumn("MRawEvtData.fABFlags");
     606    write3af.VetoColumn("MRawEvtData.fStartCells");
     607    write3af.VetoColumn("MRawEvtData.fNumBytesPerSample");
     608    write3af.VetoColumn("MRawEvtData.fIsSigned");
     609    write3af.VetoColumn("MRawEvtHeader.fDAQEvtNumber"); //EventNum ?
     610    write3af.VetoColumn("MRawEvtHeader.fNumTrigLvl1");
     611    write3af.VetoColumn("MRawEvtHeader.fNumTrigLvl2");
     612    write3af.VetoColumn("MRawEvtHeader.fTrigPattern");
     613    write3af.VetoColumn("MRawEvtHeader.fNumLoGainOn");
     614
     615    write3af.SetBytesPerSample("Data", 2);
    612616
    613617    write1a.SetName("WriteRefData");
     
    622626    SetupCommonFileStructure(write1a);
    623627    SetupCommonFileStructure(write2a);
    624     SetupCommonFileStructure(write3a);
     628    SetupCommonFileStructure(write3ar);
     629    SetupCommonFileStructure(write3af);
    625630    SetupCommonFileStructure(write4a);
    626631
     
    633638
    634639    // D: Dedicated file structure
    635     write3a.AddContainer("ElectronicNoise",  "RunHeaders");
    636     write3a.AddContainer("IntendedPulsePos", "RunHeaders");
    637     write3a.AddContainer("MRawEvtData",      "Events");
     640    write3af.AddContainer("ElectronicNoise",  "RunHeaders");
     641    write3af.AddContainer("IntendedPulsePos", "RunHeaders");
     642    write3af.AddContainer("MRawEvtData",      "Events");
     643
     644    write3ar.AddContainer("ElectronicNoise",  "RunHeaders");
     645    write3ar.AddContainer("IntendedPulsePos", "RunHeaders");
     646    write3ar.AddContainer("MRawEvtData",      "Events");
    638647    // It doesn't make much sene to write this information
    639648    // to the file because the units are internal units not
  • trunk/Mars/mjobs/MJSimulation.h

    r14792 r14864  
    2323    Bool_t fCamera;         // Switch on/off camera (for fast reflector processing)
    2424    Bool_t fForceTrigger;   // Force the use of the trigger "electronics"
     25    Bool_t fWriteFitsFile;
    2526
    2627    Int_t  fOperationMode;  // Operation mode (data, ped, cal, pointrun)
     
    3839
    3940    void SetForceMode(Bool_t force=kTRUE) { fForceMode = force; }
    40 
    4141    void SetMode(Int_t mode) { fOperationMode = mode; }
     42    void SetWriteFitsFile(Bool_t fits) { fWriteFitsFile = fits; }
    4243
    4344    void SetRunNumber(Int_t n=-1) { fRunNumber = n%100000000; }
Note: See TracChangeset for help on using the changeset viewer.