Changeset 852 for trunk/MagicSoft/Mars
- Timestamp:
- 06/20/01 10:41:23 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r851 r852 1 1 -*-*- END -*-*- 2 3 2001/06/20: Thomas Bretz 4 5 * macros/merpp.C: 6 - fixed type in comment 7 8 * manalysis/MHillas.cc: 9 - fixed 'FIXME' comment 10 11 * mbase/MWriteFile.[h,cc]: 12 - added 13 14 * mbase/MWriteRootFile.[h,cc]: 15 - added 16 17 * mbase/BaseLinkDef.h: 18 - Added MWriteFile 19 - Added MWriteRootFile 20 21 * mbase/MEvtLoop.cc: 22 - fixed the counting in the eventloop 23 24 * mbase/MWriteAsciiFile.[h,cc]: 25 - changed class that it is based on MWriteFile now 26 27 * mbase/Makefile: 28 - added MWriteFile 29 - added MWriteRootFile 30 31 * mhist/MFillHFadc.[h,cc]: 32 - added set for HasChanged (new PostProcess) 33 34 * mhist/MFillHHillas.cc: 35 - added set for HasChanged (new PostProcess) 36 37 * mhist/MFillHStarMap.cc: 38 - added set for HasChanged (new PostProcess) 39 40 * mhist/MHHillas.cc: 41 - Set kCanDelete to make sure, that the histograms are deleted 42 together with the canvas 43 44 * mraw/MRawFileWrite.[h,cc]: 45 - changed the handling of opening, closing and checking file 46 47 2 48 3 49 2001/06/13: Thomas Bretz … … 39 85 * mraw/MRawEvtData.cc: 40 86 - Set kCanDelete in Draw function 41 42 87 43 88 -
trunk/MagicSoft/Mars/macros/merpp.C
r776 r852 30 30 // 31 31 // REMARK: Don't change the order of the two instantiations. 32 // I don't have an idea why, but here it crashes t o32 // I don't have an idea why, but here it crashes the 33 33 // Interpreter. 34 34 // (Using root 2.25/03, with Cint 5.14.50 on OSF1) -
trunk/MagicSoft/Mars/manalysis/MHillas.cc
r842 r852 58 58 59 59 Reset(); 60 // FIXME: Initialization of values missing60 // FIXME: (intelligent) initialization of values missing 61 61 } 62 62 -
trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc
r765 r852 60 60 // (Hillas) container or create one. 61 61 // 62 Bool_t MHillasCalc::PreProcess( MParList *pList)62 Bool_t MHillasCalc::PreProcess(MParList *pList) 63 63 { 64 64 fCerPhotEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt"); -
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r843 r852 29 29 30 30 #pragma link C++ class MReadTree; 31 #pragma link C++ class MWriteFile; 31 32 #pragma link C++ class MWriteAsciiFile; 33 #pragma link C++ class MWriteRootFile; 32 34 33 35 #pragma link C++ class MArray; -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r843 r852 160 160 // 161 161 if (maxcnt<0) 162 while (fTaskList->Process() && ++dummy); 162 // process first and increment if sucessfull 163 while (fTaskList->Process()) dummy++; 163 164 else 164 while (fTaskList->Process() && dummy--); 165 // check for number and break if unsuccessfull 166 while (dummy-- && fTaskList->Process()); 165 167 166 168 // -
trunk/MagicSoft/Mars/mbase/MParList.cc
r847 r852 102 102 Bool_t MParList::AddToList(MParContainer *obj, MParContainer *where) 103 103 { 104 // 105 // check if the object (you want to add) exists 106 // 107 108 if (!obj) return kTRUE; 109 110 *fLog << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush; 104 111 // 105 // check if the object (you want to add) exists 106 // 107 108 if (!obj) return kTRUE; 109 110 *fLog << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush; 111 // 112 // check if it is in the list yet 113 // 114 if (fContainer.FindObject(obj)) 115 { 116 *fLog << dbginf << "Container already added" << endl; 117 return kTRUE; 118 } 119 120 // 121 // check if you want to add the new parameter container somewhere 112 // check if it is in the list yet 113 // 114 if (fContainer.FindObject(obj)) 115 { 116 *fLog << dbginf << "Container already added" << endl; 117 return kTRUE; 118 } 119 120 // 121 // check if you want to add the new parameter container somewhere 122 122 // special (in that case you specify "where") 123 //124 if (where)125 {126 if (!fContainer.FindObject(where))127 {128 *fLog << dbginf << "Cannot find parameter container after which the new one should be added!" << endl;129 return kFALSE;130 }131 }132 133 fContainer.Add(obj);134 *fLog << "Done." << endl;135 136 return kTRUE;123 // 124 if (where) 125 { 126 if (!fContainer.FindObject(where)) 127 { 128 *fLog << dbginf << "Cannot find parameter container after which the new one should be added!" << endl; 129 return kFALSE; 130 } 131 } 132 133 fContainer.Add(obj); 134 *fLog << "Done." << endl; 135 136 return kTRUE; 137 137 } 138 138 -
trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc
r850 r852 64 64 fNameFile = filename; 65 65 fNameContainer = contname; 66 67 fOut = new ofstream(fNameFile); 66 68 } 67 69 … … 80 82 fNameFile = filename; 81 83 fNameContainer = cont->GetName(); 84 85 fOut = new ofstream(fNameFile); 82 86 } 83 87 … … 89 93 MWriteAsciiFile::~MWriteAsciiFile() 90 94 { 91 if (fOut) 92 delete fOut; 95 delete fOut; 93 96 } 94 97 95 98 // -------------------------------------------------------------------------- 96 99 // 97 // Tries to open the given output file. And tries to get a pointer to the 98 // instance of the container which should be written. 99 // If the container has already the HasChanged flag it is immediatly written 100 // to the output file. 100 // Check if our container is ready for writing. If so write it. 101 101 // 102 Bool_t MWriteAsciiFile::PreProcess (MParList *pList) 102 void MWriteAsciiFile::CheckAndWrite() const 103 { 104 if (fContainer->HasChanged()) 105 fContainer->AsciiWrite(*fOut); 106 } 107 108 // -------------------------------------------------------------------------- 109 // 110 // Return open state of the file 111 // 112 Bool_t MWriteAsciiFile::IsFileOpen() const 113 { 114 return (bool)(*fOut); 115 } 116 117 // -------------------------------------------------------------------------- 118 // 119 // If the container is yet unknown and the name of it is known only, try 120 // to get the container from the parameter list. 121 // 122 Bool_t MWriteAsciiFile::GetContainer(MParList *pList) 103 123 { 104 124 // 105 125 // Try to find the container which should be stored. 106 126 // 107 if (!fContainer) 108 { 109 fContainer = (MParContainer*)pList->FindObject(fNameContainer); 110 if (!fContainer) 111 { 112 *fLog << dbginf << "Cannot find parameter container '" << fContainer << "'." << endl; 113 return kFALSE; 114 } 115 } 127 if (fContainer) 128 return kTRUE; 116 129 117 // 118 // Try to open the output file 119 // 120 fOut = new ofstream(fNameFile); 130 fContainer = (MParContainer*)pList->FindObject(fNameContainer); 131 if (fContainer) 132 return kTRUE; 121 133 122 if (!(*fOut)) 123 { 124 *fLog << dbginf << "Cannot open Ascii file '" << fNameFile << "' for writing." << endl; 125 return kFALSE; 126 } 127 128 *fLog << "Ascii file '" << fNameFile << "' opened for writing." << endl; 129 130 // 131 // write the container if it is already in changed state 132 // 133 if (fContainer->HasChanged()) 134 fContainer->AsciiWrite(*fOut); 135 136 return kTRUE; 134 *fLog << dbginf << "Cannot find parameter container '" << fContainer << "'." << endl; 135 return kFALSE; 137 136 } 138 139 // --------------------------------------------------------------------------140 //141 // Checks if the HasChanged flag of the output container is set. If it is set142 // the container is instructed to write itself to the ascii file.143 // (By calling its memberfunction AsciiWrite. You find the Prototype in144 // MParContainer)145 //146 Bool_t MWriteAsciiFile::Process()147 {148 if (fContainer->HasChanged())149 fContainer->AsciiWrite(*fOut);150 151 return kTRUE;152 }153 154 // --------------------------------------------------------------------------155 //156 // If the output container has the HasChanged flag set, it is written to the157 // output file (eg. this could be some calculated result)158 // If the output file object exists, delete it. (The file is closed159 // automatically in the corresponding destructor)160 //161 Bool_t MWriteAsciiFile::PostProcess()162 {163 //164 // check if the container changed state is set165 //166 if (fContainer->HasChanged())167 fContainer->AsciiWrite(*fOut);168 169 //170 // delete (close) file171 //172 delete fOut;173 fOut = NULL;174 175 return kTRUE;176 }177 -
trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.h
r850 r852 2 2 #define MWRITEASCIIFILE_H 3 3 4 #ifndef M TASK_H5 #include "M Task.h"4 #ifndef MWRITEFILE_H 5 #include "MWriteFile.h" 6 6 #endif 7 7 8 class MWriteAsciiFile : public M Task8 class MWriteAsciiFile : public MWriteFile //MTask 9 9 { 10 10 private: … … 16 16 MParContainer *fContainer; 17 17 18 virtual void CheckAndWrite() const; 19 virtual Bool_t IsFileOpen() const; 20 virtual Bool_t GetContainer(MParList *pList); 21 virtual const char *GetFileName() const { return fNameFile; } 22 23 18 24 public: 19 25 MWriteAsciiFile(const char *filename, const char *contname, … … 23 29 ~MWriteAsciiFile(); 24 30 25 Bool_t PreProcess(MParList *pList);26 Bool_t Process();27 Bool_t PostProcess();28 29 31 ClassDef(MWriteAsciiFile, 0) // Class to write one container to an ascii file 30 32 }; -
trunk/MagicSoft/Mars/mbase/Makefile
r846 r852 38 38 MEvtLoop.cc \ 39 39 MReadTree.cc \ 40 MWriteFile.cc \ 40 41 MWriteAsciiFile.cc \ 42 MWriteRootFile.cc \ 41 43 MArray.cc \ 42 44 MArrayB.cc \ -
trunk/MagicSoft/Mars/mhist/MFillHFadc.cc
r765 r852 108 108 109 109 return kTRUE; 110 } 110 111 112 Bool_t MFillHFadc::PostProcess() 113 { 114 fHistos->SetHasChanged(); 115 return kTRUE; 111 116 } -
trunk/MagicSoft/Mars/mhist/MFillHFadc.h
r712 r852 14 14 class MRawEvtData; 15 15 16 class MFillHFadc : public MTask { 17 private: 18 MRawEvtData *fRawEvtData; // The raw event data from which the spektrum is created 19 MHFadcCam *fHistos ; // The histogram container into which holds the spektrum 16 class MFillHFadc : public MTask 17 { 18 private: 19 MRawEvtData *fRawEvtData; // The raw event data from which the spektrum is created 20 MHFadcCam *fHistos ; // The histogram container into which holds the spektrum 20 21 21 public: 22 MFillHFadc (const char *name=NULL, const char *title=NULL);22 public: 23 MFillHFadc (const char *name=NULL, const char *title=NULL); 23 24 24 Bool_t PreProcess(MParList *pList); 25 Bool_t Process() ; 26 27 ClassDef(MFillHFadc, 0) // Task to fill the fadc data into histograms 25 Bool_t PreProcess(MParList *pList); 26 Bool_t Process(); 27 Bool_t PostProcess(); 28 28 29 ClassDef(MFillHFadc, 0) // Task to fill the fadc data into histograms 29 30 }; 30 31 -
trunk/MagicSoft/Mars/mhist/MFillHHillas.cc
r765 r852 72 72 return kTRUE; 73 73 } 74 75 Bool_t MFillHHillas::PostProcess() 76 { 77 fHistos->SetHasChanged(); 78 return kTRUE; 79 } -
trunk/MagicSoft/Mars/mhist/MFillHHillas.h
r712 r852 23 23 24 24 Bool_t PreProcess(MParList *pList); 25 Bool_t Process() ; 25 Bool_t Process(); 26 Bool_t PostProcess(); 26 27 27 28 ClassDef(MFillHHillas, 0) // Task to fill the Hillas parameters into histograms -
trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc
r765 r852 73 73 return kTRUE; 74 74 } 75 76 Bool_t MFillHStarMap::PostProcess() 77 { 78 fHistos->SetHasChanged(); 79 80 return kTRUE; 81 } -
trunk/MagicSoft/Mars/mhist/MFillHStarMap.h
r712 r852 23 23 24 24 Bool_t PreProcess(MParList *pList); 25 Bool_t Process() ; 25 Bool_t Process(); 26 Bool_t PostProcess(); 26 27 27 28 ClassDef(MFillHStarMap, 0) // Task to fill a 2-dim histogram by the Hillas parameters -
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r713 r852 74 74 75 75 c->cd(1); 76 fAlpha->SetBit(kCanDelete); 76 77 fAlpha->Draw(); 77 78 c->cd(2); 79 fLength->SetBit(kCanDelete); 78 80 fLength->Draw(); 79 81 c->cd(3); 82 fDist->SetBit(kCanDelete); 80 83 fDist->Draw(); 81 84 c->cd(4); 85 fWidth->SetBit(kCanDelete); 82 86 fWidth->Draw(); 83 87 -
trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc
r749 r852 17 17 ! 18 18 ! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de) 19 ! Author(s):Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)19 ! Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de) 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2001 … … 35 35 MCollArea::MCollArea(const char *name, const char *title) 36 36 { 37 //38 // default constructor39 //37 // 38 // default constructor 39 // 40 40 41 // initialize the histogram for the distribution r vs E42 //43 // we set the energy range from 1 Gev to 10000 GeV (in log 5 orders44 // of magnitude) and for each order we take 10 subdivision --> 50 xbins45 //46 // we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins41 // initialize the histogram for the distribution r vs E 42 // 43 // we set the energy range from 1 Gev to 10000 GeV (in log 5 orders 44 // of magnitude) and for each order we take 10 subdivision --> 50 xbins 45 // 46 // we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins 47 47 48 48 49 *fName = name ? name : "MCollArea"; 50 *fTitle = title ? title : "Data to Calculate Coll-Area"; 51 52 53 fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution", 54 50, 0., 5., 55 50, 0., 500. ) ; 56 57 fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution", 58 50, 0., 5., 59 50, 0., 500. ) ; 49 *fName = name ? name : "MCollArea"; 50 *fTitle = title ? title : "Data to Calculate Coll-Area"; 60 51 61 fHistCol = new TH1D("collArea", "Collection Area", 62 50, 0., 5.) ; 63 64 } 52 53 fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution", 54 50, 0., 5., 55 50, 0., 500. ) ; 56 57 fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution", 58 50, 0., 5., 59 50, 0., 500. ) ; 60 61 fHistCol = new TH1D("collArea", "Collection Area", 62 50, 0., 5.) ; 63 64 } 65 65 66 66 MCollArea::~MCollArea() 67 { 68 delete fHistAll ;69 delete fHistSel ;70 delete fHistCol ;71 } 67 { 68 delete fHistAll ; 69 delete fHistSel ; 70 delete fHistCol ; 71 } 72 72 73 73 void MCollArea::FillAll(Float_t log10E, Float_t radius) 74 { 75 fHistAll->Fill(log10E, radius ) ;76 } 74 { 75 fHistAll->Fill(log10E, radius ) ; 76 } 77 77 78 78 void MCollArea::FillSel(Float_t log10E, Float_t radius) 79 { 80 fHistSel->Fill(log10E, radius ) ;81 } 79 { 80 fHistSel->Fill(log10E, radius ) ; 81 } 82 82 83 void MCollArea::DrawAll() 84 { 85 fHistAll->Draw() ;86 } 83 void MCollArea::DrawAll() 84 { 85 fHistAll->Draw() ; 86 } 87 87 88 void MCollArea::DrawSel() 89 { 90 fHistSel->Draw() ;91 } 88 void MCollArea::DrawSel() 89 { 90 fHistSel->Draw() ; 91 } 92 92 93 void MCollArea::Draw(Option_t* option) 94 { 95 fHistCol->Draw(option) ;96 } 93 void MCollArea::Draw(Option_t* option) 94 { 95 fHistCol->Draw(option) ; 96 } 97 97 98 98 void MCollArea::CalcEfficiency() 99 { 99 { 100 100 // Description! 101 101 … … 114 114 const Float_t Nall = fHistAll->GetCellContent(ix, iy); 115 115 116 if ( Nall <= 0 ) { 117 // cout << ix << " " << iy << endl ; 116 if (Nall <= 0) 118 117 continue; 119 }120 118 121 119 const Double_t eff = N / Nall ; 122 120 const Double_t err = sqrt(Nall + Nall*N - N*N - N) / (Nall*Nall); 123 /* 124 cout << ix << " " << iy 125 << " N " << N 126 << " Nall " << Nall 127 << " effi " << eff 128 << " error " << err 129 << endl ; 130 */ 121 131 122 fHistSel->SetCellContent(ix, iy, eff); 132 123 fHistSel->SetCellError(ix, iy, err); -
trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc
r749 r852 17 17 ! 18 18 ! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de) 19 ! Author(s):Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)19 ! Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de) 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2001 … … 26 26 #include "MCollAreaTrigger.h" 27 27 28 #include "MParList.h" 29 28 30 #include "MLog.h" 29 31 #include "MLogManip.h" 30 #include "MParList.h"31 32 32 #include "MCollArea.h" 33 #include "MMcEvt.hxx" 33 #include "MMcEvt.hxx" 34 34 #include "MMcTrig.hxx" 35 36 #include "MHMcCollectionArea.h" 35 37 36 38 ClassImp(MCollAreaTrigger) … … 38 40 MCollAreaTrigger::MCollAreaTrigger (const char *name, const char *title) 39 41 { 40 *fName = name ? name : "MCollAreaTrigger";41 *fTitle = title ? title : "Task to calc the collection area ";42 *fName = name ? name : "MCollAreaTrigger"; 43 *fTitle = title ? title : "Task to calc the collection area "; 42 44 } 43 44 45 45 46 Bool_t MCollAreaTrigger::PreProcess (MParList *pList) 46 47 { 47 // connect the raw data with this task 48 49 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt") ; 50 if (!fMcEvt) { 51 *fLog << dbginf << "MMcEvt not found... exit." << endl; 52 return kFALSE; 53 } 48 // connect the raw data with this task 54 49 55 fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig") ; 56 if (!fMcTrig) { 57 *fLog << dbginf << "MMcTrig not found... exit." << endl; 58 return kFALSE; 59 } 50 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt"); 51 if (!fMcEvt) 52 { 53 *fLog << dbginf << "MMcEvt not found... exit." << endl; 54 return kFALSE; 55 } 60 56 61 fCollArea = (MCollArea*)pList->FindCreateObj("MCollArea") ; 62 if (!fCollArea) 63 return kFALSE; 57 fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig"); 58 if (!fMcTrig) 59 { 60 *fLog << dbginf << "MMcTrig not found... exit." << endl; 61 return kFALSE; 62 } 64 63 65 return kTRUE ; 64 fCollArea = (MHMcCollectionArea*)pList->FindCreateObj("MHMcCollectionArea"); 65 if (!fCollArea) 66 return kFALSE; 66 67 67 } 68 68 return kTRUE; 69 } 69 70 70 71 Bool_t MCollAreaTrigger::Process () … … 75 76 fCollArea->FillAll(energy, impact); 76 77 77 78 78 if (fMcTrig->GetFirstLevel() <= 0) 79 79 return kTRUE; … … 81 81 fCollArea->FillSel(energy, impact); 82 82 83 return kTRUE 83 return kTRUE; 84 84 } 85 85 86 86 Bool_t MCollAreaTrigger::PostProcess () 87 87 { 88 // 89 // do the calculation of the effectiv area 90 // 88 // 89 // do the calculation of the effectiv area 90 // 91 fCollArea->CalcEfficiency(); 91 92 92 fCollArea->CalcEfficiency() ; 93 94 return kTRUE ; 93 return kTRUE; 95 94 } -
trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.h
r698 r852 1 #ifndef M COLLAREATRIGGER_H2 #define M COLLAREATRIGGER_H1 #ifndef MMCCOLLECTIONAREACALC_H 2 #define MMCCOLLECTIONAREACALC_H 3 3 4 4 #ifndef MTASK_H … … 7 7 8 8 class MParList; 9 class MMcEvt ;10 class MMcTrig ;11 class M CollArea;9 class MMcEvt; 10 class MMcTrig; 11 class MHMcCollectionArea; 12 12 13 class M CollAreaTrigger : public MTask {14 private: 15 MMcEvt *fMcEvt ; //! 16 MMcTrig *fMcTrig ; //!17 MCollArea *fCollArea ; //!13 class MMcCollectionAreaCalc : public MTask 14 { 15 private: 16 MMcEvt *fMcEvt; 17 MMcTrig *fMcTrig; 18 18 19 public: 20 MCollAreaTrigger (const char *name=NULL, const char *title=NULL); 19 MHMcCollectionArea *fCollArea; 21 20 22 Bool_t PreProcess(MParList *pList); 23 Bool_t Process() ; 24 Bool_t PostProcess() ; 25 26 ClassDef(MCollAreaTrigger, 0) // Task to fill the collection area histograms 21 public: 22 MMcCollectionAreaCalc(const char *name=NULL, const char *title=NULL); 27 23 24 Bool_t PreProcess(MParList *pList); 25 Bool_t Process() ; 26 Bool_t PostProcess() ; 27 28 ClassDef(MMcCollectionAreaCalc, 0) // Task to calculate the collection area histogram 28 29 }; 29 30 -
trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc
r763 r852 53 53 // Default constructor. It opens the output file (root-file) 54 54 // 55 MRawFileWrite::MRawFileWrite(const char *fname, Option_t *opt, 56 const char *ftitle, Int_t comp, 55 MRawFileWrite::MRawFileWrite(const char *fname, 56 const Option_t *opt, 57 const char *ftitle, 58 const Int_t comp, 57 59 const char *name, const char *title) 58 60 { … … 60 62 *fTitle = title ? title : "Write task to write DAQ root files"; 61 63 62 // FIXME: move file open to preproc!63 64 64 // 65 65 // Open a rootfile 66 66 // 67 67 fOut = new TFile(fname, opt, ftitle, comp); 68 69 // 70 // test whether file is now open or not 71 // 72 if (!fOut->IsOpen())73 {74 *fLog << "MRawFileWrite::MRawFileWrite: ERROR: Cannot open file '";75 *fLog << fname << "'" << endl;76 77 } 68 } 69 70 MRawFileWrite::~MRawFileWrite() 71 { 72 // 73 // delete instance, this laso does a fOut->Close() 74 // 75 delete fOut; 76 } 77 78 78 79 79 // -------------------------------------------------------------------------- … … 94 94 { 95 95 // 96 // test whether file is now open or not 97 // 98 if (!fOut->IsOpen()) 99 { 100 *fLog << dbginf << "Cannot open file '" << fOut->GetName() << "'" << endl; 101 return kFALSE; 102 } 103 104 // 96 105 // remember the pointer to the parameter list fur further usage 97 106 // … … 105 114 if (!fRawEvtHeader) 106 115 { 107 *fLog << "MRawFileWrite::PreProcess - ERROR:MRawEvtHeader not found... aborting." << endl;116 *fLog << dbginf << "MRawEvtHeader not found... aborting." << endl; 108 117 return kFALSE; 109 118 } … … 112 121 if (!fRawEvtData) 113 122 { 114 *fLog << "MRawFileWrite::PreProcess - ERROR:MRawEvtData not found... aborting." << endl;123 *fLog << dbginf << "MRawEvtData not found... aborting." << endl; 115 124 return kFALSE; 116 125 } … … 119 128 if (!fRawCrateArray) 120 129 { 121 *fLog << "MRawFileWrite::PreProcess - ERROR:MRawCrateArray not found... aborting." << endl;130 *fLog << dbginf << "MRawCrateArray not found... aborting." << endl; 122 131 return kFALSE; 123 132 } … … 126 135 if (!fRawEvtTime) 127 136 { 128 *fLog << "MRawFileWrite::PreProcess - WARNING:MRawEvtTime not found... aborting." << endl;137 *fLog << dbginf << "MRawEvtTime not found... aborting." << endl; 129 138 return kFALSE; 130 139 } … … 133 142 if (!fRawRunHeader) 134 143 { 135 *fLog << "MRawFileWrite::PreProcess - ERROR:MRawRunHeader not found... aborting." << endl;144 *fLog << dbginf << "MRawRunHeader not found... aborting." << endl; 136 145 return kFALSE; 137 146 } … … 222 231 fOut->Write(); 223 232 224 //225 // close root file226 //227 fOut->Close();228 229 //230 // delete instance231 //232 delete fOut;233 234 233 return kTRUE; 235 234 } -
trunk/MagicSoft/Mars/mraw/MRawFileWrite.h
r698 r852 35 35 public: 36 36 MRawFileWrite(const char *fname, 37 Option_t *opt="UPDATE",37 const Option_t *opt="UPDATE", 38 38 const char *ftitle="Unnamed", 39 Int_t comp=9,39 const Int_t comp=9, 40 40 const char *name=NULL, const char *title=NULL); 41 ~MRawFileWrite(); 41 42 42 43 Bool_t PreProcess(MParList *pList);
Note:
See TracChangeset
for help on using the changeset viewer.