Changeset 1004 for trunk/MagicSoft
- Timestamp:
- 10/29/01 11:35:19 (23 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r998 r1004 1 1 -*-*- END -*-*- 2 3 2001/10/29: Thomas Bretz 4 5 * Makefile.rules: 6 - changed the output 7 8 * macros/rootlogon.C: 9 - Added IgnorTObjectStreamer 10 11 * manalysis/MCT1ReadAscii.cc: 12 - changed fFileNames to a TList of TNamed objects 13 14 * mbase/MArray.h: 15 - removed include of MArray.h 16 17 * mbase/MParContainer.[h,cc]: 18 - changed fName, fTitle from pointer to static object 19 - Changed ClassVersion to 0 20 21 * mbase/MParList.[h,cc]: 22 - changed fName, fTitle from pointer to static object 23 - changed include of TObjArray to a forward declaration 24 (for faster compilation) 25 - simplified the code 26 27 * mbase/MInputStreamID.[h,cc]: 28 - changed fStreamId from char* to TString 29 - Changed ClassVersion to 0 30 31 * mbase/MReadTree.[h,cc]: 32 - changed veto-list to an array of TNamed objects 33 - implemented auto enabeling 34 35 * mbase/MTask.[h,cc]: 36 - implemented fListOfBranches for auto enabeling 37 38 * mbase/MTaskList.[h,cc]: 39 - changed fName, fTitle from pointer to static object 40 - changed include of TObjArray to a forward declaration 41 (for faster compilation) 42 43 * mbase/MWriteRootFile.cc: 44 - changed fName, fTitle from pointer to static object 45 - set splitlevel in TTree::Branch to default 46 - changed kSaveNow to kFillTree 47 48 * mhist/MFillH.cc: 49 - changed fName, fTitle from pointer to static object 50 - check inharitance from MH 51 52 * mhist/MH.[h,cc]: 53 - changed fName, fTitle from pointer to static object 54 - implementation of simplified static MakeDefCanvas 55 56 * mhist/MHFadcCam.h: 57 - removed include of TH1 58 59 * mhist/MHFadcPix.[h,cc]: 60 - implemented persistent pixid 61 - get rid of 'fixed string sizes' 62 - Delete histograms from file structure (SetDirectory) 63 - changed Root's MakeDefCanvas to TH1::MakeDefCanvas 64 - removed include of TH1 65 66 * mhist/MHHillas.cc 67 - changed fName, fTitle from pointer to static object 68 - Delete histograms from file structure (SetDirectory) 69 - changed Root's MakeDefCanvas to TH1::MakeDefCanvas 70 - changed DrawClone to DrawCopy 71 72 * mhist/MHMcCollectionArea.[h,cc]: 73 - changed fName, fTitle from pointer to static object 74 - Delete histograms from file structure (SetDirectory) 75 - changed Root's MakeDefCanvas to TH1::MakeDefCanvas 76 - changed DrawClone to DrawCopy 77 - changed binning to log scale 78 - removed include of TH1 79 80 * mhist/MHMcEnergy.cc, mhist/MHStarMap.cc: 81 - changed fName, fTitle from pointer to static object 82 - Delete histograms from file structure (SetDirectory) 83 - changed Root's MakeDefCanvas to TH1::MakeDefCanvas 84 85 * manalysis/MCerPhotCalc.cc, manalysis/MCerPhotEvt.cc, 86 manalysis/MHillas.cc, manalysis/MHillasCalc.cc, 87 manalysis/MImgCleanStd.cc, manalysis/MMcPedestalCopy.cc, 88 manalysis/MPedCalcPedRun.cc, manalysis/MPedestalCam.cc, 89 mbase/MClone.cc, mbase/MPrint.cc, mbase/MTime.h, 90 mbase/MWriteAsciiFile.cc, mgui/MGeomCam.cc, 91 mhist/MHFadcCam.cc, mhist/MHMcRate.cc, 92 mmc/MMcTrig.cxx, mmontecarlo/MMcThresholdCalc.cc, 93 mmontecarlo/MMcTriggerRateCalc.cc, 94 mraw/MRawCrateArray.cc, mraw/MRawEvtData.cc, 95 mraw/MRawEvtHeader.cc, mraw/MRawFileRead.cc: 96 - changed fName, fTitle from pointer to static object 97 98 * mraw/MRawFileWrite.cc: 99 - changed fName, fTitle from pointer to static object 100 - changed TTree::Branch to use default split level (99) 101 - added the missing important '.' to the Branch names! 102 103 * mraw/MRawRunHeader.[h,cc]: 104 - changed fName, fTitle from pointer to static object 105 - implemented enum for Run Type 106 107 2 108 3 109 2001/10/26: Thomas Bretz -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r1003 r1004 78 78 virtual void AsciiWrite(ofstream &fout) const; 79 79 80 ClassDef(MParContainer, 1) //The basis for all parameter containers80 ClassDef(MParContainer, 0) //The basis for all parameter containers 81 81 }; 82 82 */ -
trunk/MagicSoft/Mars/mbase/MWriteFile.h
r961 r1004 6 6 #endif 7 7 8 class TFile;9 10 8 class MWriteFile : public MTask 11 9 { 12 10 private: 13 virtual Bool_t IsFileOpen() const = 0; 14 virtual void CheckAndWrite() const = 0; 15 virtual Bool_t GetContainer(MParList *pList) = 0; 11 Bool_t PreProcess(MParList *pList); 12 Bool_t Process(); 13 Bool_t PostProcess(); 14 15 virtual Bool_t IsFileOpen() const = 0; 16 virtual void CheckAndWrite() const = 0; 17 virtual Bool_t GetContainer(MParList *pList) = 0; 16 18 virtual const char *GetFileName() const = 0; 17 18 public:19 20 virtual Bool_t PreProcess(MParList *pList);21 virtual Bool_t Process();22 virtual Bool_t PostProcess();23 19 24 20 ClassDef(MWriteFile, 0) // Base class for tasks to write single containers to several output formats -
trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc
r1003 r1004 46 46 ClassImp(MWriteRootFile); 47 47 48 #define kFillTree BIT(1 )48 #define kFillTree BIT(14) 49 49 50 50 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mhist/MFillH.cc
r967 r1004 60 60 void MFillH::Init(const char *name, const char *title) 61 61 { 62 *fName = name ? name : "MFillH";63 *fTitle = title ? title : "Task to fill Mars histograms";62 fName = name ? name : "MFillH"; 63 fTitle = title ? title : "Task to fill Mars histograms"; 64 64 65 65 fH = NULL; … … 162 162 } 163 163 164 if (!fH->InheritsFrom("MH")) 165 { 166 *fLog << dbginf << fH->GetName() << " [" << fH->ClassName(); 167 *fLog << "] doesn't inherit from MH - cannot be used for MFillH... aborting." << endl; 168 return kFALSE; 169 } 170 164 171 return kTRUE; 165 172 } -
trunk/MagicSoft/Mars/mhist/MH.h
r961 r1004 10 10 #endif 11 11 12 class TCanvas; 13 12 14 class MH : public MParContainer 13 15 { 14 16 public: 15 17 MH(const char *name=NULL, const char *title=NULL); 16 18 17 19 virtual void Fill(const MParContainer *par) = 0; 20 21 static TCanvas *MakeDefCanvas(const char *name=NULL, const char *title="", 22 const UInt_t w=700, const UInt_t h=500); 23 static TCanvas *MakeDefCanvas(const TObject *obj, 24 const UInt_t w=700, const UInt_t h=500); 18 25 19 26 ClassDef(MH, 1) //A histogram base class for Mars histograms -
trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
r887 r1004 34 34 #include "MHFadcCam.h" 35 35 36 #include <TH1.h>37 38 36 #include "MRawEvtData.h" 39 37 #include "MRawEvtPixelIter.h" … … 52 50 // 53 51 54 *fName = name ? name : "MHFadcCam" ;55 *fTitle = title ? title : "Container for ADC spectra histograms" ;52 fName = name ? name : "MHFadcCam" ; 53 fTitle = title ? title : "Container for ADC spectra histograms" ; 56 54 57 55 // … … 72 70 } 73 71 72 // -------------------------------------------------------------------------- 74 73 void MHFadcCam::Fill(const MParContainer *par) 75 74 { … … 113 112 // 114 113 115 fHistLo->Write() 116 fHistHi->Write() 114 fHistLo->Write(); 115 fHistHi->Write(); 117 116 } 118 117 -
trunk/MagicSoft/Mars/mhist/MHFadcCam.h
r887 r1004 17 17 #endif 18 18 19 class TH1F; 19 #ifndef ROOT_TH1 20 #include <TH1.h> 21 #endif 20 22 21 23 class MHFadcCam : public MH -
trunk/MagicSoft/Mars/mhist/MHFadcPix.cc
r959 r1004 35 35 #include "MHFadcPix.h" 36 36 37 #include <TH1.h> 37 38 #include <TPad.h> 39 40 #include "MH.h" 38 41 39 42 ClassImp(MHFadcPix); … … 43 46 // Creates the histograms for lo and hi gain of one pixel 44 47 // 45 MHFadcPix::MHFadcPix(UInt_t pixid) 48 MHFadcPix::MHFadcPix(UInt_t pixid) : fPixId(pixid) 46 49 { 47 // FIXME! Set the right axis titles and ... and ... 48 Char_t tmp1[40]; 49 Char_t tmp2[40]; 50 Char_t *name = StrDup(pixid ? Form("HiGain%03d", pixid) : "HiGain"); 51 Char_t *title = StrDup(pixid ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples"); 50 52 51 // if (pixid) 52 // { 53 sprintf(tmp1, "HiGain%03d", pixid); 54 sprintf(tmp2, "Hi Gain Pixel #%d", pixid); 55 // } 56 fHistHi = new TH1F(tmp1, tmp2, 256, 0, 255); 53 fHistHi = new TH1F(name, title, 256, 0, 255); 57 54 58 // if (pixid) 59 // { 60 sprintf(tmp1, "LoGain%03d", pixid); 61 sprintf(tmp2, "Lo Gain Pixel #%d", pixid); 62 // } 63 fHistLo = new TH1F(tmp2, tmp2, 256, 0, 255); 55 fHistHi->SetDirectory(NULL); 56 fHistHi->SetXTitle("Time/Slices"); 57 fHistHi->SetYTitle("Signal"); 58 59 delete [] name; 60 delete [] title; 61 62 name = StrDup(pixid ? Form("LoGain%03d", pixid) : "LoGain"); 63 title = StrDup(pixid ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples"); 64 65 fHistLo = new TH1F(name, title, 256, 0, 255); 66 67 fHistLo->SetDirectory(NULL); 68 fHistLo->SetXTitle("Time/Slices"); 69 fHistLo->SetYTitle("Signal"); 70 71 delete [] name; 72 delete [] title; 64 73 } 65 74 … … 72 81 73 82 // -------------------------------------------------------------------------- 83 inline void MHFadcPix::FillHi(Byte_t i) 84 { 85 fHistHi->Fill(i); 86 } 87 88 // -------------------------------------------------------------------------- 89 inline void MHFadcPix::FillLo(Byte_t i) 90 { 91 fHistLo->Fill(i); 92 } 93 94 // -------------------------------------------------------------------------- 95 inline void MHFadcPix::DrawHi() 96 { 97 fHistHi->Draw(); 98 } 99 100 // -------------------------------------------------------------------------- 101 inline void MHFadcPix::DrawLo() 102 { 103 fHistLo->Draw(); 104 } 105 106 // -------------------------------------------------------------------------- 74 107 void MHFadcPix::Draw(Option_t *) 75 108 { 76 109 if (!gPad) 77 110 { 78 if (!gROOT->GetMakeDefCanvas()) 79 return; 80 (gROOT->GetMakeDefCanvas())(); 111 const char *name = StrDup(fPixId ? Form("Pixel #%d", fPixId) : "Pixel"); 112 const char *title = StrDup(fPixId ? Form("%s FADC Samples", name) : "FADC Samples"); 113 MH::MakeDefCanvas(name, title); 114 delete [] name; 115 delete [] title; 81 116 } 82 117 83 118 gPad->Divide(1, 2); 84 119 85 gPad->cd( 0);120 gPad->cd(1); 86 121 fHistHi->Draw(); 87 122 88 gPad->cd( 1);123 gPad->cd(2); 89 124 fHistLo->Draw(); 90 125 } -
trunk/MagicSoft/Mars/mhist/MHFadcPix.h
r712 r1004 6 6 #endif 7 7 8 #ifndef ROOT_TH1 9 #include <TH1.h> 10 #endif 8 //#ifndef ROOT_TH1 9 //#include <TH1.h> 10 //#endif 11 12 class TH1F; 11 13 12 14 class MHFadcPix : public TObject … … 15 17 TH1F *fHistHi; 16 18 TH1F *fHistLo; 19 20 UInt_t fPixId; 17 21 18 22 public: … … 23 27 TH1F *GetHistLo() { return fHistLo; } 24 28 25 void FillHi(Byte_t i) { fHistHi->Fill(i); }26 void FillLo(Byte_t i) { fHistLo->Fill(i); }29 void FillHi(Byte_t i); 30 void FillLo(Byte_t i); 27 31 28 void DrawHi() { fHistHi->Draw(); }29 void DrawLo() { fHistLo->Draw(); }32 void DrawHi(); 33 void DrawLo(); 30 34 31 35 void Draw(Option_t *opt=NULL); -
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r995 r1004 26 26 { 27 27 // 28 // default constructor29 // creates an a list of histograms for all pixels and both gain channels30 //31 32 //33 28 // set the name and title of this object 34 29 // 35 36 *fName = name ? name : "MHHillas" ; 37 *fTitle = title ? title : "Container for Hillas histograms" ; 30 fName = name ? name : "MHHillas" ; 31 fTitle = title ? title : "Container for Hillas histograms" ; 38 32 39 33 // … … 42 36 // connect all the histogram with the container fHist 43 37 // 44 // FIXME! Make the histograms looking that they can be used for45 // presentations (axis title, ...)46 //47 38 fAlpha = new TH1F("Alpha [deg]", "Alpha of Hillas", 90, 0, 90); 48 39 fWidth = new TH1F("Width [mm]", "Width of Hillas", 100, 0, 300); 49 40 fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300); 50 41 fDist = new TH1F("Dist [mm]", "Dist of Hillas", 100, 0, 300); 42 43 fAlpha->SetDirectory(NULL); 44 fLength->SetDirectory(NULL); 45 fDist->SetDirectory(NULL); 46 fWidth->SetDirectory(NULL); 51 47 52 48 fAlpha->GetXaxis()->SetTitle("Alpha [deg]"); … … 98 94 TObject *MHHillas::DrawClone(Option_t *opt) const 99 95 { 100 TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");101 c->Divide(2, 2);96 TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters"); 97 c->Divide(2, 2); 102 98 103 99 gROOT->SetSelectedPad(NULL); … … 107 103 // 108 104 c->cd(1); 109 fAlpha->DrawC lone()->SetBit(kCanDelete);105 fAlpha->DrawCopy(); 110 106 111 107 c->cd(2); 112 fLength->DrawC lone()->SetBit(kCanDelete);108 fLength->DrawCopy(); 113 109 114 110 c->cd(3); 115 fDist->DrawC lone()->SetBit(kCanDelete);111 fDist->DrawCopy(); 116 112 117 113 c->cd(4); 118 fWidth->DrawC lone()->SetBit(kCanDelete);114 fWidth->DrawCopy(); 119 115 120 116 c->Modified(); … … 133 129 { 134 130 if (!gPad) 135 { 136 if (!gROOT->GetMakeDefCanvas()) 137 return; 138 (gROOT->GetMakeDefCanvas())(); 139 } 131 MakeDefCanvas("Hillas", "Histograms of Hillas Parameters"); 140 132 141 //TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");142 133 gPad->Divide(2,2); 143 134 -
trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc
r970 r1004 29 29 #include <TCanvas.h> 30 30 31 #include "MH.h" 32 31 33 ClassImp(MHMcCollectionArea); 32 34 … … 48 50 49 51 50 *fName = name ? name : "MHMcCollectionArea"; 51 *fTitle = title ? title : "Data to Calculate Coll-Area"; 52 53 54 fHistAll = new TH2D("AllEvents", "All showers - Radius vs log(E) distribution", 55 50, 0., 5., 56 50, 0., 500.); 57 58 fHistAll->SetXTitle("log(E/GeV)"); 59 fHistAll->SetYTitle("r/m"); 52 fName = name ? name : "MHMcCollectionArea"; 53 fTitle = title ? title : "Data to Calculate Collection Area"; 54 55 const Int_t nbins = 50; 56 const Float_t maxx = 5; 57 const Float_t maxy = 500; 58 59 Float_t *binsx = new Float_t[nbins+1]; 60 for (int i=0; i<nbins+1; i++) 61 binsx[i] = pow(10, maxx*i/nbins); 62 63 Float_t *binsy = new Float_t[nbins+1]; 64 for (int i=0; i<nbins+1; i++) 65 binsy[i] = maxy*i/nbins; 66 67 fHistAll = new TH2D("AllEvents", "All showers - Radius vs Energy distribution", 68 nbins, binsx, nbins, binsy); 69 fHistSel = new TH2D("SelectedEvents", "Selected showers - Radius vs Energy distribution", 70 nbins, binsx, nbins, binsy); 71 fHistCol = new TH1D("CollectionArea", "Collection Area vs. Energy", 72 nbins, binsx); 73 74 delete binsx; 75 delete binsy; 76 77 fHistAll->SetDirectory(NULL); 78 fHistSel->SetDirectory(NULL); 79 fHistCol->SetDirectory(NULL); 80 81 fHistAll->SetXTitle("E [GeV]"); 82 fHistAll->SetYTitle("r [m]"); 60 83 fHistAll->SetZTitle("N"); 61 84 62 fHistSel = new TH2D("SelectedEvents", "Selected showers - Radius vs log(E) distribution", 63 50, 0., 5., 64 50, 0., 500.); 65 66 fHistSel->SetXTitle("log(E/GeV)"); 67 fHistSel->SetYTitle("r/m"); 85 fHistSel->SetXTitle("E [GeV]"); 86 fHistSel->SetYTitle("r [m]"); 68 87 fHistSel->SetYTitle("N"); 69 88 70 fHistCol = new TH1D("CollectionArea", "Collection Area vs. log(E)", 71 50, 0., 5.); 72 73 fHistCol->SetXTitle("log(E/GeV)"); 74 fHistCol->SetYTitle("A/m^{2}"); 89 fHistCol->SetXTitle("E [GeV]"); 90 fHistCol->SetYTitle("A [m^{2}]"); 75 91 } 76 92 … … 90 106 // Fill data into the histogram which contains all showers 91 107 // 92 void MHMcCollectionArea::FillAll(Float_t log10E, Float_t radius)93 { 94 fHistAll->Fill( log10E, radius);108 void MHMcCollectionArea::FillAll(Float_t energy, Float_t radius) 109 { 110 fHistAll->Fill(energy, radius); 95 111 } 96 112 … … 99 115 // Fill data into the histogram which contains the selected showers 100 116 // 101 void MHMcCollectionArea::FillSel(Float_t log10E, Float_t radius)102 { 103 fHistSel->Fill( log10E, radius);117 void MHMcCollectionArea::FillSel(Float_t energy, Float_t radius) 118 { 119 fHistSel->Fill(energy, radius); 104 120 } 105 121 … … 111 127 { 112 128 if (!gPad) 113 { 114 if (!gROOT->GetMakeDefCanvas()) 115 return; 116 (gROOT->GetMakeDefCanvas())(); 117 } 118 119 //TCanvas *c=new TCanvas(fHistAll->GetName(), fHistAll->GetTitle()); 129 MH::MakeDefCanvas(fHistAll); 120 130 121 131 fHistAll->Draw(option); 132 133 gPad->SetLogx(); 122 134 123 135 gPad->Modified(); … … 132 144 { 133 145 if (!gPad) 134 { 135 if (!gROOT->GetMakeDefCanvas()) 136 return; 137 (gROOT->GetMakeDefCanvas())(); 138 } 139 140 //TCanvas *c=new TCanvas(fHistSel->GetName(), fHistSel->GetTitle()); 146 MH::MakeDefCanvas(fHistSel); 141 147 142 148 fHistSel->Draw(option); 149 150 gPad->SetLogx(); 143 151 144 152 gPad->Modified(); … … 154 162 TObject *MHMcCollectionArea::DrawClone(Option_t* option) const 155 163 { 156 TCanvas *c =new TCanvas(fHistCol->GetName(), fHistCol->GetTitle());164 TCanvas *c = MH::MakeDefCanvas(fHistCol); 157 165 158 166 // … … 161 169 gROOT->SetSelectedPad(NULL); 162 170 163 fHistCol->DrawClone(option); 171 fHistCol->DrawCopy(option); 172 173 gPad->SetLogx(); 164 174 165 175 c->Modified(); … … 172 182 { 173 183 if (!gPad) 174 { 175 if (!gROOT->GetMakeDefCanvas()) 176 return; 177 (gROOT->GetMakeDefCanvas())(); 178 } 179 // TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle()); 184 MH::MakeDefCanvas(fHistCol); 180 185 181 186 fHistCol->Draw(option); 187 188 gPad->SetLogx(); 182 189 183 190 gPad->Modified(); -
trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h
r985 r1004 9 9 #endif 10 10 11 // 12 // because of some strange reason this cannot be put into MonteCarloIncl 13 // 14 #ifndef ROOT_TH1 15 #include <TH1.h> 16 #endif 17 11 class TH1D; 18 12 class TH2D; 19 13 … … 31 25 ~MHMcCollectionArea(); 32 26 33 void FillAll(Float_t log10E, Float_t radius);34 void FillSel(Float_t log10E, Float_t radius);27 void FillAll(Float_t energy, Float_t radius); 28 void FillSel(Float_t energy, Float_t radius); 35 29 36 30 void DrawAll(Option_t *option=""); -
trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc
r986 r1004 41 41 #include <TPaveLabel.h> 42 42 43 #include "MH.h" 44 43 45 ClassImp(MHMcEnergy); 44 46 … … 49 51 MHMcEnergy::MHMcEnergy(const char *name, const char *title) 50 52 { 51 *fTitle = title ? title : "Container for an energy distribution histogram";53 fTitle = title ? title : "Container for an energy distribution histogram"; 52 54 53 55 // - we initialize the histogram … … 55 57 // root don't allow us to have diferent histograms with the same name 56 58 57 fHist = new TH1F("", "", 40, 0.5, 4.5); 59 fHist = new TH1F("", "", 20, 0.5, 4.5); 60 61 fHist->SetDirectory(NULL); 58 62 fHist->SetXTitle("log(E/GeV)"); 59 63 fHist->SetYTitle("dN/dE"); … … 77 81 UInt_t idx = semicolon ? atoi(semicolon+1) : 0; 78 82 79 *fName = cname;83 fName = cname; 80 84 81 85 char text[256]; … … 86 90 87 91 char aux[256]; 88 strcpy(aux, " log(E)");92 strcpy(aux, "Threshold"); 89 93 90 94 if (idx>0) … … 163 167 { 164 168 if (!gPad) 165 { 166 if (!gROOT->GetMakeDefCanvas()) 167 return; 168 (gROOT->GetMakeDefCanvas())(); 169 } 170 //TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle()); 169 MH::MakeDefCanvas(fHist); 171 170 172 171 fHist->Draw(option); … … 180 179 TObject *MHMcEnergy::DrawClone(Option_t *option) const 181 180 { 182 TCanvas *c =new TCanvas(fHist->GetName(), fHist->GetTitle());181 TCanvas *c = MH::MakeDefCanvas(fHist); 183 182 184 183 // -
trunk/MagicSoft/Mars/mhist/MHMcRate.cc
r986 r1004 33 33 void MHMcRate::Init(const char *name, const char *title) 34 34 { 35 *fName = name ? name : "MMcTriggerRate";36 *fTitle = title ? title : "Task to calc the collection area ";35 fName = name ? name : "MMcTriggerRate"; 36 fTitle = title ? title : "Task to calc the collection area "; 37 37 38 38 fPartId=0; // Type of particle -
trunk/MagicSoft/Mars/mhist/MHStarMap.cc
r970 r1004 35 35 #include "MHStarMap.h" 36 36 37 #include <TH2.h> // TH2F38 37 #include <TStyle.h> // gStyle 39 38 #include <TColor.h> // SetRGB … … 59 58 // 60 59 61 *fName = name ? name : "MHStarMap" ;62 *fTitle = title ? title : "Container for a Star Map" ;60 fName = name ? name : "MHStarMap" ; 61 fTitle = title ? title : "Container for a Star Map" ; 63 62 64 63 // … … 67 66 // connect all the histogram with the container fHist 68 67 // 69 fStarMap = new TH2F("StarMap", " Counts",68 fStarMap = new TH2F("StarMap", "2D Hillas Star Map", 70 69 150, -300, 300, 71 70 150, -300, 300); 71 72 fStarMap->SetDirectory(NULL); 73 74 fStarMap->SetXTitle("x/mm"); 75 fStarMap->SetYTitle("y/mm"); 76 fStarMap->SetZTitle("Counts"); 72 77 } 73 78 … … 171 176 TObject *MHStarMap::DrawClone(Option_t *opt) const 172 177 { 173 TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500);178 TCanvas *c=MakeDefCanvas(fStarMap, 500, 500); 174 179 175 180 // … … 180 185 PrepareDrawing(); 181 186 182 fStarMap->DrawC lone("colz")->SetBit(kCanDelete);187 fStarMap->DrawCopy("colz"); 183 188 184 189 c->Modified(); … … 197 202 { 198 203 if (!gPad) 199 { 200 if (!gROOT->GetMakeDefCanvas()) 201 return; 202 (gROOT->GetMakeDefCanvas())(); 203 } 204 205 // TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500); 204 MakeDefCanvas(fStarMap, 500, 500); 206 205 207 206 PrepareDrawing(); -
trunk/MagicSoft/Mars/mhist/MHStarMap.h
r970 r1004 11 11 12 12 #ifndef ROOT_TH2 13 // what's the reason that we need this here? cint complains about it14 // if it is missing...15 13 #include <TH2.h> 16 14 #endif -
trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc
r988 r1004 69 69 : fDimension(dim), fMcTrig(NULL), fEnergy(NULL) 70 70 { 71 *fName = name ? name : "MMcThresholdCalc";72 *fTitle = title ? title : "Task to calculate the energy threshold from Monte Carlo";71 fName = name ? name : "MMcThresholdCalc"; 72 fTitle = title ? title : "Task to calculate the energy threshold from Monte Carlo"; 73 73 } 74 74 -
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
r993 r1004 41 41 const char *name, const char *title) 42 42 { 43 *fName = name ? name : "MMcTriggerRateCalc";44 *fTitle = title ? title : "Task to calc the trigger rate ";43 fName = name ? name : "MMcTriggerRateCalc"; 44 fTitle = title ? title : "Task to calc the trigger rate "; 45 45 46 46 fMcTrig = NULL; -
trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc
r859 r1004 51 51 MRawCrateArray::MRawCrateArray(const char *name, const char *title) 52 52 { 53 *fName = name ? name : "MRawCrateArray";54 *fTitle = title ? title : "Array of MRawCrateData Information";53 fName = name ? name : "MRawCrateArray"; 54 fTitle = title ? title : "Array of MRawCrateData Information"; 55 55 56 56 // -
trunk/MagicSoft/Mars/mraw/MRawCrateData.h
r988 r1004 4 4 #ifndef MAGIC_H 5 5 #include "MAGIC.h" 6 #endif7 #ifndef ROOT_TObject8 #include <TObject.h>9 6 #endif 10 7 … … 21 18 MRawCrateData(); 22 19 23 ~MRawCrateData() 24 { 25 } 26 27 UChar_t GetDAQCrateNumber() const 28 { 29 return fDAQCrateNumber; 30 } 31 32 UInt_t GetFADCEvtNumber() const 33 { 34 return fFADCEvtNumber; 35 } 36 37 UInt_t GetFADCClockTick() const 38 { 39 return fFADCClockTick; 40 } 20 UChar_t GetDAQCrateNumber() const { return fDAQCrateNumber; } 21 UInt_t GetFADCEvtNumber() const { return fFADCEvtNumber; } 22 UInt_t GetFADCClockTick() const { return fFADCClockTick; } 41 23 42 24 void Print(Option_t *t=NULL) const; -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r859 r1004 71 71 MRawEvtData::MRawEvtData(const char *name, const char *title) 72 72 { 73 *fName = name ? name : "MRawEvtData";74 *fTitle = title ? title : "Raw Event Data Information";73 fName = name ? name : "MRawEvtData"; 74 fTitle = title ? title : "Raw Event Data Information"; 75 75 76 76 InitArrays(); … … 241 241 242 242 TGraph *graph = new TGraph(n, x, y); 243 graph->SetMaximum (256);244 graph->SetMinimum (0);243 graph->SetMaximum(256); 244 graph->SetMinimum(0); 245 245 246 246 graph->SetBit(kCanDelete); -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
r988 r1004 111 111 MRawEvtHeader::MRawEvtHeader(const char *name, const char *title) 112 112 { 113 *fName = name ? name : "MRawEvtHeader";114 *fTitle = title ? title : "Raw Event Header Information";113 fName = name ? name : "MRawEvtHeader"; 114 fTitle = title ? title : "Raw Event Header Information"; 115 115 116 116 // -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h
r988 r1004 12 12 13 13 // 14 // Trigger Type d(TT)14 // Trigger Type (TT) 15 15 // 16 16 enum { -
trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
r961 r1004 91 91 MRawFileRead::MRawFileRead(const char *fname, const char *name, const char *title) 92 92 { 93 *fName = name ? name : "MRawFileRead";94 *fTitle = title ? title : "Read task to read DAQ binary files";93 fName = name ? name : "MRawFileRead"; 94 fTitle = title ? title : "Read task to read DAQ binary files"; 95 95 96 96 // -
trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc
r949 r1004 65 65 const char *name, const char *title) 66 66 { 67 *fName = name ? name : "MRawFileWrite";68 *fTitle = title ? title : "Write task to write DAQ root files";67 fName = name ? name : "MRawFileWrite"; 68 fTitle = title ? title : "Write task to write DAQ root files"; 69 69 70 70 // … … 159 159 // 160 160 TTree *rh = new TTree("RunHeaders", "Run headers of all runs in this file"); 161 TBranch *tb = rh->Branch("MRawRunHeader", "MRawRunHeader", &fRawRunHeader, 32000 , 1);161 TBranch *tb = rh->Branch("MRawRunHeader", "MRawRunHeader", &fRawRunHeader, 32000); 162 162 rh->Fill(); 163 163 rh->Write(); … … 175 175 // create all branches which are necessary 176 176 // 177 fTData ->Branch("MTime ", "MTime", &fRawEvtTime, 32000, 1);178 fTPedestal ->Branch("MTime ", "MTime", &fRawEvtTime, 32000, 1);179 fTCalibration->Branch("MTime ", "MTime", &fRawEvtTime, 32000, 1);180 fTData ->Branch("MRawEvtHeader ", "MRawEvtHeader", &fRawEvtHeader, 32000, 1);181 fTPedestal ->Branch("MRawEvtHeader ", "MRawEvtHeader", &fRawEvtHeader, 32000, 1);182 fTCalibration->Branch("MRawEvtHeader ", "MRawEvtHeader", &fRawEvtHeader, 32000, 1);183 fTData ->Branch("MRawEvtData ", "MRawEvtData", &fRawEvtData, 32000, 1);184 fTPedestal ->Branch("MRawEvtData ", "MRawEvtData", &fRawEvtData, 320000, 1);185 fTCalibration->Branch("MRawEvtData ", "MRawEvtData", &fRawEvtData, 320000, 1);177 fTData ->Branch("MTime.", "MTime", &fRawEvtTime, 32000); 178 fTPedestal ->Branch("MTime.", "MTime", &fRawEvtTime, 32000); 179 fTCalibration->Branch("MTime.", "MTime", &fRawEvtTime, 32000); 180 fTData ->Branch("MRawEvtHeader.", "MRawEvtHeader", &fRawEvtHeader, 32000); 181 fTPedestal ->Branch("MRawEvtHeader.", "MRawEvtHeader", &fRawEvtHeader, 32000); 182 fTCalibration->Branch("MRawEvtHeader.", "MRawEvtHeader", &fRawEvtHeader, 32000); 183 fTData ->Branch("MRawEvtData.", "MRawEvtData", &fRawEvtData, 32000); 184 fTPedestal ->Branch("MRawEvtData.", "MRawEvtData", &fRawEvtData, 320000); 185 fTCalibration->Branch("MRawEvtData.", "MRawEvtData", &fRawEvtData, 320000); 186 186 //fTree->Branch("MRawCrateArray", fRawCrateArray->GetArray(), 32000, 1); 187 fTData ->Branch("MRawCrateArray ", "MRawCrateArray", &fRawCrateArray, 32000, 1);188 fTPedestal ->Branch("MRawCrateArray ", "MRawCrateArray", &fRawCrateArray, 32000, 1);189 fTCalibration->Branch("MRawCrateArray ", "MRawCrateArray", &fRawCrateArray, 32000, 1);187 fTData ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000); 188 fTPedestal ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000); 189 fTCalibration->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000); 190 190 191 191 return kTRUE; -
trunk/MagicSoft/Mars/mraw/MRawFileWrite.h
r860 r1004 19 19 { 20 20 private: 21 MParList *pParList; 21 MParList *pParList; 22 22 23 MTime *fRawEvtTime; 24 MRawRunHeader *fRawRunHeader; 25 MRawEvtHeader *fRawEvtHeader; 26 MRawEvtData *fRawEvtData; 27 MRawCrateArray *fRawCrateArray; 23 MTime *fRawEvtTime; 24 MRawRunHeader *fRawRunHeader; 25 MRawEvtHeader *fRawEvtHeader; 26 MRawEvtData *fRawEvtData; 27 MRawCrateArray *fRawCrateArray; 28 28 29 29 TTree *fTData; //! -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r988 r1004 48 48 MRawRunHeader::MRawRunHeader(const char *name, const char *title) : fPixAssignment(NULL) 49 49 { 50 *fName = name ? name : "MRawRunHeader";51 *fTitle = title ? title : "Raw Run Header Information";50 fName = name ? name : "MRawRunHeader"; 51 fTitle = title ? title : "Raw Run Header Information"; 52 52 53 53 fPixAssignment = new MArrayS(0); 54 55 // This is only valid for root > 3.056 // IsA()->CanIgnoreTObjectStreamer();57 54 } 58 55 … … 132 129 switch (fRunType) 133 130 { 134 case 0:131 case kRTData: 135 132 *fLog << "Data"; 136 133 break; 137 case 1:134 case kRTPedestal: 138 135 *fLog << "Pedestal"; 139 136 break; 140 case 2:137 case kRTCalibration: 141 138 *fLog << "Calibration"; 142 139 break; 143 case 256:140 case kRTMonteCarlo: 144 141 *fLog << "Monte Carlo Data"; 145 142 break; -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r988 r1004 19 19 // 20 20 const UShort_t kMagicNumber = 0xc0c0; 21 22 enum { 23 kRTData = 0, 24 kRTPedestal = 1, 25 kRTCalibration = 2, 26 kRTMonteCarlo = 256 27 }; 21 28 22 29 class MRawRunHeader : public MParContainer … … 50 57 ~MRawRunHeader(); 51 58 52 void SetMagicNumber(UShort_t a){fMagicNumber=a;} 53 void SetFormatVersion(UShort_t a){fFormatVersion=a;} 54 void SetSoftVersion(UShort_t a){fSoftVersion=a;} 55 void SetRunType(UShort_t a){ fRunType=a;} 56 void SetRunNumber(UInt_t a){fRunNumber=a;} 59 void SetMagicNumber(UShort_t a) { fMagicNumber=a; } 60 void SetFormatVersion(UShort_t a){ fFormatVersion=a; } 61 void SetSoftVersion(UShort_t a) { fSoftVersion=a; } 62 void SetRunType(UShort_t a) { fRunType=a; } 63 void SetRunNumber(UInt_t a) { fRunNumber=a; } 64 void SetNumEvents(UInt_t a) { fNumEvents=a; } 57 65 void SetNumSamples(UShort_t low, UShort_t high) 58 {fNumSamplesLoGain=low;fNumSamplesHiGain=high;} 59 void SetNumEvents(UInt_t a){fNumEvents=a;} 66 { 67 fNumSamplesLoGain=low; 68 fNumSamplesHiGain=high; 69 } 60 70 61 UShort_t GetMagicNumber() const { return fMagicNumber; }62 UShort_t GetFormatversion() const { return fFormatVersion; }63 UShort_t GetSoftVersion() const { return fSoftVersion; }64 UShort_t GetRunType() const { return fRunType; }65 UInt_t GetRunNumber() const { return fRunNumber; }66 const Char_t *GetProjectName() const 67 const Char_t *GetSourceName() const 71 UShort_t GetMagicNumber() const { return fMagicNumber; } 72 UShort_t GetFormatversion() const { return fFormatVersion; } 73 UShort_t GetSoftVersion() const { return fSoftVersion; } 74 UShort_t GetRunType() const { return fRunType; } 75 UInt_t GetRunNumber() const { return fRunNumber; } 76 const Char_t *GetProjectName() const { return fProjectName; } 77 const Char_t *GetSourceName() const { return fSourceName; } 68 78 //Float_t GetSourceRa() const { return fSourceRA; } 69 79 //Float_t GetSourceDec() const { return fSourceDEC; } 70 80 const Char_t *GetSourceEpocheChar() const { return fSourceEpochChar; } 71 UShort_t GetSourceEpocheDate() const { return fSourceEpochDate; }72 Float_t GetMJD() const { return fMJD; }73 UShort_t GetDateYear() const { return fDateYear; }74 Byte_t GetDateMonth() const { return fDateMonth; }75 Byte_t GetDateDay() const { return fDateDay; }76 UShort_t GetNumCrates() const { return fNumCrates; }77 UShort_t GetNumPixInCrate() const { return fNumPixInCrate; }78 UShort_t GetNumSamplesLoGain() const { return fNumSamplesLoGain; }79 UShort_t GetNumSamplesHiGain() const { return fNumSamplesHiGain; }80 UShort_t GetNumEvents() const { return fNumEvents; }81 UShort_t GetSourceEpocheDate() const { return fSourceEpochDate; } 82 Float_t GetMJD() const { return fMJD; } 83 UShort_t GetDateYear() const { return fDateYear; } 84 Byte_t GetDateMonth() const { return fDateMonth; } 85 Byte_t GetDateDay() const { return fDateDay; } 86 UShort_t GetNumCrates() const { return fNumCrates; } 87 UShort_t GetNumPixInCrate() const { return fNumPixInCrate; } 88 UShort_t GetNumSamplesLoGain() const { return fNumSamplesLoGain; } 89 UShort_t GetNumSamplesHiGain() const { return fNumSamplesHiGain; } 90 UShort_t GetNumEvents() const { return fNumEvents; } 81 91 UShort_t GetPixAssignment(UShort_t i) const; 82 92 -
trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx
r991 r1004 23 23 24 24 25 *fName = "MMcTrig";26 *fTitle = "Trigger info from Monte Carlo";25 fName = "MMcTrig"; 26 fTitle = "Trigger info from Monte Carlo"; 27 27 28 28
Note:
See TracChangeset
for help on using the changeset viewer.