Changeset 706
- Timestamp:
- 03/27/01 16:05:54 (24 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r704 r706 4 4 5 5 * manalysis/MHillas.[h,cc]: 6 fixed some minor errors, added sanity check (N<2) to Calc6 - fixed some minor errors, added sanity check (N<2) to Calc 7 7 8 8 * manalysis/MFillHHillas.cc: 9 skip event if Hillas calculations fails 10 9 - skip event if Hillas calculations fails 10 11 * macros/getCollArea.C, macros/readMagic.C, 12 mdatacheck/MViewAdcSpectra.cc, meventdisp/MGFadcDisp.cc: 13 - changed order in MReadTree constructor 14 15 * manalysis/MCT1ReadAscii.[h,cc]: 16 - changed to use MPedestalCam 17 18 * manalysis/Makefile: 19 - removed MCT1Pedestals 20 21 * mbase/BaseLinkDef.h: 22 - added const values from Magic.h 23 24 * mbase/MLogManip.h: 25 - changed style of dbginf 26 27 * mbase/MParList.cc: 28 - make use of dbginf 29 30 * mbase/MReadTree.[h,cc]: 31 - switched from a TTree to a TChain object 32 - chnaged order of variables of the constructor 33 11 34 12 35 2000/03/21: Thomas Bretz -
trunk/MagicSoft/Mars/NEWS
r704 r706 3 3 4 4 * Hillas Calculation added 5 6 * MReadTree is now able to handle more than one file 7 (Remark: of the same structure) 5 8 6 9 -
trunk/MagicSoft/Mars/macros/readMagic.C
r705 r706 14 14 15 15 MReadTree read("Events", "oscar_protons.root"); 16 MReadTree read.AddFile("test.root");17 16 MCerPhotCalc ncalc; 18 17 MImgCleanStd clean; -
trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc
r695 r706 10 10 11 11 #include "MHillas.h" 12 #include "MCerPhotEvt.h" 12 13 13 14 #include "MLog.h" … … 47 48 Bool_t MHillasCalc::Process() 48 49 { 49 fHillas->Calc(*fGeomCam, *fCerPhotEvt); 50 51 return kTRUE; 50 // 51 // If you want do complex descisions inside the calculations 52 // we must move the calculation code inside this function 53 // 54 // If the calculation wasn't sucessfull skip this event 55 // 56 return fHillas->Calc(*fGeomCam, *fCerPhotEvt) ? kTRUE : kCONTINUE; 52 57 } 53 58 -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r666 r706 18 18 19 19 #include <TFile.h> 20 #include <T Tree.h>20 #include <TChain.h> 21 21 #include <TObjArray.h> 22 22 23 23 #include "MLog.h" 24 #include "MLogManip.h" 25 24 26 #include "MTime.h" 25 27 #include "MParList.h" … … 27 29 ClassImp(MReadTree) 28 30 29 MReadTree::MReadTree(const char * fname, const char *tname,31 MReadTree::MReadTree(const char *tname, const char *fname, 30 32 const char *name, const char *title) 31 33 { … … 36 38 // open the input stream 37 39 // 38 fFileName = fname; 39 fTreeName = tname; 40 fChain = new TChain(tname); 41 42 if (fname) 43 fChain->Add(fname); 44 } 45 46 MReadTree::~MReadTree() 47 { 48 delete fChain; 49 } 50 51 /*Int_t*/ void MReadTree::AddFile(const char *fname) 52 { 53 // 54 // FIXME! A check is missing whether the file already exists or not. 55 // 56 // 57 // returns the number of file which were added 58 // 59 /*return root >3.0*/ fChain->Add(fname); 40 60 } 41 61 … … 45 65 // open file and check if file is really open 46 66 // 47 fFile = new TFile(fFileName, "READ");48 49 if (!fFile->IsOpen())50 {51 *fLog << "MReadTree::PreProcess: ERROR: Cannot open file '";52 *fLog << fFileName << "'" << endl;53 return kFALSE;54 }55 56 //57 // try to get the tree and check if it was found58 //59 fTree = (TTree*)fFile->Get(fTreeName);60 if (!fTree)61 {62 *fLog << "MReadTree::PreProcess: ERROR: Cannot open tree '";63 *fLog << fTreeName << "'" << endl;64 return kFALSE;65 }66 67 67 68 // 68 69 // get number of events in this tree 69 70 // 70 fNumEntries = (UInt_t)fTree->GetEntries(); 71 fNumEntries = (UInt_t)fChain->GetEntries(); 72 73 if (!fNumEntries) 74 { 75 *fLog << dbginf << "No Entries found in chain (file/s)." << endl; 76 return kFALSE; 77 } 71 78 72 79 // … … 78 85 // output logging information 79 86 // 80 *fLog << "File: '" << fFileName << "' Tree: '" << fTreeName; 81 *fLog << "' with " << fNumEntries << " Entries opened." << endl; 87 *fLog << fNumEntries << " Entries found in file(s)." << endl; 82 88 83 89 // … … 85 91 // create the Iterator to loop over all branches 86 92 // 87 TIter Next(f Tree->GetListOfBranches());93 TIter Next(fChain->GetListOfBranches()); 88 94 TBranch *branch=NULL; 89 95 … … 102 108 // 103 109 MParContainer *pcont = pList->FindCreateObj(name); 110 104 111 105 112 if (!pcont) … … 134 141 // get entry 135 142 // 136 f Tree->GetEntry(fNumEntry );143 fChain->GetEntry(fNumEntry ); 137 144 138 145 fNumEntry ++ ; … … 146 153 // Close File 147 154 // 148 fFile->Close();155 //fFile->Close(); 149 156 150 157 return kTRUE; … … 156 163 // Get the Event with the current EventNumber fNumEntry 157 164 // 158 f Tree->GetEntry(fNumEntry);165 fChain->GetEntry(fNumEntry); 159 166 160 167 return kTRUE; -
trunk/MagicSoft/Mars/mdatacheck/MHHillas.cc
r698 r706 11 11 #include <TH1.h> 12 12 #include <TPad.h> 13 #include <TCanvas.h> 13 14 14 15 #include "MHillas.h" … … 36 37 // 37 38 fAlpha = new TH1F("Alpha [deg]", "Alpha of Hillas", 90, 0, 90); 38 fWidth = new TH1F("Width [mm]", "Width of Hillas", 1 50, 0, 150);39 fLength = new TH1F("Length [mm]", "Length of Hillas", 1 50, 0, 150);40 fDist = new TH1F("Dist [mm]", "Dist of Hillas", 200, 0, 200);39 fWidth = new TH1F("Width [mm]", "Width of Hillas", 100, 0, 300); 40 fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300); 41 fDist = new TH1F("Dist [mm]", "Dist of Hillas", 100, 0, 300); 41 42 } 42 43 … … 51 52 void MHHillas::Fill(MHillas *par) 52 53 { 53 fAlpha ->Fill( par->GetAlpha());54 fAlpha ->Fill(fabs(par->GetAlpha())); 54 55 fWidth ->Fill(par->GetWidth()); 55 56 fLength->Fill(par->GetLength()); … … 57 58 } 58 59 59 #include <TCanvas.h>60 60 void MHHillas::Draw(Option_t *) 61 61 { 62 62 63 // 64 // Fixme! Check for an existing canvas. 65 // And create one if no canvas exists only! 66 // 63 67 TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters"); 64 68 c->Divide(2,2); -
trunk/MagicSoft/Mars/mgui/MGMarsMain.h
r698 r706 26 26 // the things for the menu bar 27 27 28 TGMenuBar *fMenuBar ; 29 TGPopupMenu *fFileMenu ; 30 TGLayoutHints *fLayMenuBar, *fLayMenuItem ; 28 TGMenuBar *fMenuBar ; 29 TGPopupMenu *fFileMenu ; 30 TGLayoutHints *fLayMenuBar; 31 TGLayoutHints *fLayMenuItem ; 31 32 TGHorizontal3DLine *fLineSep ; 32 33 … … 40 41 // the object in the top part of the frame 41 42 42 TGPictureButton *fPicMagic, *fPicMars ; 43 TGPictureButton *fPicMagic; 44 TGPictureButton *fPicMars ; 43 45 44 46 // the object in the low part of the frame 45 47 46 TGVerticalFrame *fTabF1, *fTabF2 ; 48 TGVerticalFrame *fTabF1; 49 TGVerticalFrame *fTabF2 ; 47 50 48 TGTextButton *fButEvtDisp, *fButDataCheck, *fButAnalys, *fButMonteCarlo ; 51 TGTextButton *fButEvtDisp; 52 TGTextButton *fButDataCheck; 53 TGTextButton *fButAnalys; 54 TGTextButton *fButMonteCarlo ; 49 55 TGLayoutHints *fButLayout ; 50 56 -
trunk/MagicSoft/Mars/mgui/MGMonteCarloMain.cc
r571 r706 27 27 MGMonteCarloMain::MGMonteCarloMain(const TGWindow *p, const TGWindow *main, 28 28 UInt_t w, UInt_t h ) 29 : TGTransientFrame(p, main, w, h ) 29 : TGTransientFrame(p, main, w, h ) 30 30 { 31 31 // … … 222 222 // Checks if there is a selected input root file 223 223 224 if ( strcmp ( fInputFile, "\n") == 0 ) 225 { 226 return ( kFALSE ) ; 227 } 228 229 return (kTRUE) ; 224 return strcmp ( fInputFile, "\n") == 0 ? kFALSE : kTRUE; 230 225 } 231 226 -
trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc
r686 r706 23 23 24 24 fMcEvt = (MMcEvt*)pList->FindCreateObj("MMcEvt") ; 25 if (!fMcEvt) { 26 *fLog << dbginf << " Error: MMcEvt not found... exit." << endl; 25 if (!fMcEvt) 27 26 return kFALSE; 28 }29 27 30 28 fMcTrig = (MMcTrig*)pList->FindCreateObj("MMcTrig") ; 31 if (!fMcTrig) { 32 *fLog << dbginf << " Error: MMcTrig not found... exit." << endl; 29 if (!fMcTrig) 33 30 return kFALSE; 34 }35 31 36 32 fCollArea = (MCollArea*)pList->FindCreateObj("MCollArea") ; 37 if (!fCollArea) { 38 *fLog << dbginf << " Error: MCollArea not found... exit." << endl; 33 if (!fCollArea) 39 34 return kFALSE; 40 }41 35 42 36 return kTRUE ;
Note:
See TracChangeset
for help on using the changeset viewer.