Changeset 1108
- Timestamp:
- 12/11/01 15:22:10 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1107 r1108 8 8 * mbase/MGList.cc: 9 9 - changed cast in IsExisting to ?: 10 11 * NEWS: 12 - changed 13 14 * manalysis/MCerPhotCalc.cc, mfilter/MTriggerLvl1.cc, 15 mmontecarlo/MMcCollectionAreaCalc.cc, 16 mmontacarlo/MMcThresholdCalc.cc, 17 MMcTriggerRateCalc.cc: 18 - added Masterbranch name to AddToBranchList 19 20 * manalysis/MMcPedestalCopy.cc: 21 - added Masterbranch name to AddToBranchList 22 - fixed a bug in the branch name 23 24 * mbase/MGList.[h,cc]: 25 - added a better output if a picture wasn't found 26 27 * mbase/MReadTree.[h,cc]: 28 - added support for branches with master branch names to auto scheme 29 (first the complete branch name is tried and if this isn't found 30 only the subbranch name is used to enable the branch) 31 32 * mbase/MWriteRootFile.cc: 33 - appended a '.' to all newly create branches 34 35 * mmain/MBrowser.cc, mmain/MMars.cc: 36 - add the gui elements only if the corresponding picture was found 37 38 * mmain/MMars.[h,cc]: 39 - removed fPic1 40 - removed fPic2 41 - changed TList to MGList 42 43 * mraw/MRawFileWrite.cc: 44 - added a '.' to all branch names 45 46 * mbase/MTask.[h,cc]: 47 - added Prototype for ReInit-function 48 49 * mbase/MTaskList.[h,cc]: 50 - implemented ReInit for a task list 51 52 * mhist/MHFadcCam.h: 53 - added '->' to fArray 10 54 11 55 -
trunk/MagicSoft/Mars/NEWS
r1100 r1108 11 11 - Fixed several bugs in MFTriggerLvl1 which caused to filter not to 12 12 work correctly (thanks to Abelardo) 13 14 - Introduced correct treatment of the diffuse Night Sky Background 15 and NSB (MMcPedestalNSB) 16 17 - Corrected treatment of the electronic noise (MMcPedestalCopy) 18 19 - Introduced MMcRunHeaders which contains monte carlo run informations 13 20 14 21 -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r1092 r1108 63 63 fTitle = title ? title : "Task to calculate Cerenkov photons from raw data"; 64 64 65 AddToBranchList(" fHiGainPixId");66 AddToBranchList(" fLoGainPixId");67 AddToBranchList(" fHiGainFadcSamples");68 AddToBranchList(" fLoGainFadcSamples");65 AddToBranchList("MRawEvtData.fHiGainPixId"); 66 AddToBranchList("MRawEvtData.fLoGainPixId"); 67 AddToBranchList("MRawEvtData.fHiGainFadcSamples"); 68 AddToBranchList("MRawEvtData.fLoGainFadcSamples"); 69 69 70 70 } -
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
r1081 r1108 53 53 fTitle = title ? title : "Task to copy monte carlo pedestals into MPedestal Container"; 54 54 55 AddToBranchList(" fPedestalMean");56 AddToBranchList(" fElecNoise");55 AddToBranchList("MMcFadcHeader.fPedesMean"); 56 AddToBranchList("MMcFadcHeader.fElecNoise"); 57 57 } 58 58 -
trunk/MagicSoft/Mars/mbase/MGList.cc
r1105 r1108 167 167 // - The picture is freed as often as it was retrieved from gClient 168 168 // 169 void MGList::AddPicture(const TGPicture *pic )169 void MGList::AddPicture(const TGPicture *pic, const char *name) 170 170 { 171 171 // … … 174 174 if (!pic) 175 175 { 176 cout << "Warning: Requested picture not found... ignored." << endl; 176 cout << "Warning: Requested picture '" << name << "' not found... ignored." << endl; 177 cout << " Please copy " << name << " to $HOME or $HOME/icons or add" << endl; 178 cout << " Unix.*.Gui.IconPath: ~/Path/To/The/Picture" << endl; 179 cout << " to [$HOME/].rootrc." << endl; 177 180 return; 178 181 } … … 199 202 { 200 203 const TGPicture *pic = gClient->GetPicture(name); 201 AddPicture(pic );204 AddPicture(pic, name); 202 205 return pic; 203 206 } … … 218 221 { 219 222 const TGPicture *pic = gClient->GetPicture(name, width, height); 220 AddPicture(pic );223 AddPicture(pic, name); 221 224 return pic; 222 225 } -
trunk/MagicSoft/Mars/mbase/MGList.h
r1086 r1108 15 15 Bool_t IsExisting(TObject *obj) const; 16 16 17 void AddPicture(const TGPicture *pic );17 void AddPicture(const TGPicture *pic, const char *name); 18 18 19 19 public: -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r1085 r1108 149 149 Bool_t MReadTree::Notify() 150 150 { 151 fNotify->ForEach(TObject, Notify)(); 151 // 152 // FIXME: This is correct! 153 // 154 // fNotify->ForEach(TObject, Notify)(); 155 156 fTaskList->ReInit(); 157 152 158 return kTRUE; 153 159 } … … 209 215 // -------------------------------------------------------------------------- 210 216 // 217 // Set branch status of branch name 218 // 219 void MReadTree::SetBranchStatus(const char *name, Bool_t status) 220 { 221 fChain->SetBranchStatus(name, status); 222 223 *fLog << inf << (status ? "Enabled" : "Disabled"); 224 *fLog << " subbranch '" << name << "'." << endl; 225 } 226 227 // -------------------------------------------------------------------------- 228 // 211 229 // Checks whether a branch with the given name exists in the chain 212 230 // and sets the branch status of this branch corresponding to status. … … 222 240 // Check whether this branch really exists 223 241 // 224 if (!fChain->GetBranch(name)) 242 if (fChain->GetBranch(name)) 243 SetBranchStatus(name, status); 244 245 // 246 // Remove trailing '.' if one and try to enable the subbranch without 247 // the master barnch name. This is to be compatible with older mars 248 // and camera files. 249 // 250 const char *dot = strrchr(name, '.'); 251 if (!dot) 225 252 return; 226 253 227 // 228 // Set the branch status 229 // 230 fChain->SetBranchStatus(name, status); 231 *fLog << inf << (status ? "Enabled" : "Disabled"); 232 *fLog << " subbranch '" << name << "'." << endl; 254 if (fChain->GetBranch(dot+1)) 255 SetBranchStatus(dot+1, kTRUE); 233 256 } 234 257 … … 265 288 // check whether branch choosing must be switched on 266 289 // 267 EnableBranchChoosing();290 //EnableBranchChoosing(); 268 291 269 292 // … … 324 347 Bool_t MReadTree::PreProcess(MParList *pList) 325 348 { 349 fTaskList = (MTaskList*)pList->FindObject("MTaskList"); 350 326 351 // 327 352 // get number of events in this tree -
trunk/MagicSoft/Mars/mbase/MReadTree.h
r1086 r1108 8 8 class TChain; 9 9 class TBranch; 10 class MTaskList; 10 11 class TGProgressBar; 11 12 … … 24 25 TList *fNotify; // List of TObjects to notify when switching files 25 26 27 MTaskList *fTaskList; //! Tasklist for reinitialization 26 28 TGProgressBar *fProgress; //! Possible display of status 27 29 28 30 void SetBranchStatus(const TList *list, Bool_t status); 29 31 void SetBranchStatus(TObject *branch, Bool_t status); 32 void SetBranchStatus(const char *name, Bool_t status); 30 33 31 34 void DisableSubBranches(TBranch *b); -
trunk/MagicSoft/Mars/mbase/MTask.cc
r1086 r1108 100 100 // recommended method is to call this function for exactly all 101 101 // branches you want to have, eg: 102 // AddToBranchList("MMcTrig.fNumFirstLevel"); 102 103 // AddToBranchList("MMcTrig;1.fNumFirstLevel"); 103 104 // AddToBranchList("MMcTrig;2.fNumFirstLevel"); … … 181 182 // -------------------------------------------------------------------------- 182 183 // 184 // This is reinit function 185 // 186 // This function is called asynchronously if the tasks in the tasklist need 187 // reinitialization. This for example happens when the eventloop switches 188 // from one group of events to another one (eg. switching between events 189 // of different runs means reading a new run header and a new run header 190 // may mean that some value must be reinitialized) 191 // 192 // the virtual implementation returns kTRUE 193 // 194 Bool_t MTask::ReInit(MParList *pList) 195 { 196 return kTRUE; 197 } 198 199 // -------------------------------------------------------------------------- 200 // 183 201 // This is processed before the eventloop starts 184 202 // -
trunk/MagicSoft/Mars/mbase/MTask.h
r1084 r1108 74 74 UInt_t GetNumExecutions() { return fNumExecutions; } 75 75 76 virtual Bool_t ReInit(MParList *pList); 77 76 78 virtual Bool_t CallPreProcess(MParList *plist); 77 79 virtual Bool_t CallProcess(); -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1086 r1108 214 214 // -------------------------------------------------------------------------- 215 215 // 216 // do reinit of all tasks in the task-list 217 // 218 Bool_t MTaskList::ReInit(MParList *pList) 219 { 220 *fLog << all << "Reinit... " << flush; 221 222 // 223 // create the Iterator over the tasklist 224 // 225 TIter Next(fTasks); 226 227 MTask *task=NULL; 228 229 // 230 // loop over all tasks for preproccesing 231 // 232 while ((task=(MTask*)Next())) 233 { 234 *fLog << all << task->GetName() << "... " << flush; 235 236 if (!task->ReInit(pList?fParList:pList)) 237 return kFALSE; 238 } 239 240 *fLog << all << endl; 241 242 return kTRUE; 243 } 244 245 // -------------------------------------------------------------------------- 246 // 216 247 // do pre processing (before eventloop) of all tasks in the task-list 217 248 // -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1083 r1108 42 42 TObject *FindObject(const TObject *obj) const; 43 43 44 Bool_t ReInit(MParList *pList=NULL); 45 44 46 Bool_t PreProcess(MParList *pList); 45 47 Bool_t Process(); -
trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc
r1086 r1108 286 286 // The containers should be written in Splitlevel=1 287 287 // 288 branch = tree->Branch(cname, cont->ClassName(), entry->GetAddress()); 288 TString branchname(cname); 289 branchname.Append("."); 290 branch = tree->Branch(branchname, cont->ClassName(), entry->GetAddress()); 289 291 290 292 *fLog << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl; -
trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc
r1081 r1108 66 66 fValue = val; 67 67 68 AddToBranchList(" fNumFirstLevel");68 AddToBranchList("MMcTrig.fNumFirstLevel"); 69 69 } 70 70 -
trunk/MagicSoft/Mars/mhist/MHFadcCam.h
r1077 r1108 20 20 { 21 21 private: 22 TObjArray *fArray; // List of Lo/Hi gain Histograms22 TObjArray *fArray; //-> List of Lo/Hi gain Histograms 23 23 24 24 void FillHi(UInt_t ipix, Byte_t data) { (*this)[ipix]->FillHi(data); } -
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r1086 r1108 113 113 { 114 114 // 115 // Create Dir-Listbox and buttons in first frame116 //117 TGFSComboBox *dir = new TGFSComboBox(frame, kCBDirectory);118 dir->SetHeight(fEntry->GetHeight());119 120 //121 // Get the three picturs from the system (must be deleted by FreePicture)122 //123 const TGPicture *pic1 = fList->GetPicture("tb_uplevel.xpm");124 const TGPicture *pic2 = fList->GetPicture("tb_list.xpm");125 const TGPicture *pic3 = fList->GetPicture("tb_details.xpm");126 127 //128 // Create the corresponding picture buttons129 //130 TGPictureButton *cdup = new TGPictureButton(frame, pic1, kButDirUp);131 TGPictureButton *list = new TGPictureButton(frame, pic2, kButListMode);132 TGPictureButton *detail = new TGPictureButton(frame, pic3, kButDetailMode);133 134 //135 // setup the buttons136 //137 cdup ->SetToolTipText("One Level up!");138 list ->SetToolTipText("List Mode");139 detail->SetToolTipText("Details Mode");140 141 list ->SetState(kButtonUp);142 detail->SetState(kButtonEngaged);143 144 list ->AllowStayDown(kTRUE);145 detail->AllowStayDown(kTRUE);146 147 //148 // send messages to 'this' object149 //150 dir ->Associate(this);151 cdup ->Associate(this);152 detail->Associate(this);153 list ->Associate(this);154 155 //156 // Add to list for 'automatic' deletion157 //158 fList->Add(dir);159 fList->Add(cdup);160 fList->Add(list);161 fList->Add(detail);162 163 //164 115 // Layout Dir-Listbox and buttons in one row (frame) 165 116 // … … 169 120 // 170 121 TGLayoutHints *laydir = new TGLayoutHints(kLHintsExpandX|kLHintsLeft|kLHintsCenterY); //, 5, 5, 5, 5); 122 TGLayoutHints *layout = new TGLayoutHints(kLHintsRight|kLHintsCenterY, 10); //, 5, 5, 5); 123 171 124 fList->Add(laydir); 172 173 TGLayoutHints *layout = new TGLayoutHints(kLHintsRight|kLHintsCenterY, 10); //, 5, 5, 5);174 125 fList->Add(layout); 175 126 176 frame->AddFrame(dir, laydir); 177 frame->AddFrame(list, layout); 178 frame->AddFrame(detail, layout); 179 frame->AddFrame(cdup, layout); 127 // 128 // Create Dir-Listbox and buttons in first frame 129 // 130 TGFSComboBox *dir = new TGFSComboBox(frame, kCBDirectory); 131 dir->SetHeight(fEntry->GetHeight()); 132 dir->Associate(this); 133 fList->Add(dir); 134 frame->AddFrame(dir, laydir); 135 136 // 137 // Get the three picturs from the system (must be deleted by FreePicture) 138 // 139 const TGPicture *pic1 = fList->GetPicture("tb_list.xpm"); 140 if (pic1) 141 { 142 TGPictureButton *list = new TGPictureButton(frame, pic1, kButListMode); 143 list->SetToolTipText("List Mode"); 144 list->SetState(kButtonUp); 145 list->AllowStayDown(kTRUE); 146 list->Associate(this); 147 fList->Add(list); 148 frame->AddFrame(list, layout); 149 } 150 151 const TGPicture *pic2 = fList->GetPicture("tb_details.xpm"); 152 if (pic2) 153 { 154 TGPictureButton *detail = new TGPictureButton(frame, pic2, kButDetailMode); 155 detail->SetToolTipText("Details Mode"); 156 detail->SetState(kButtonEngaged); 157 detail->AllowStayDown(kTRUE); 158 detail->Associate(this); 159 fList->Add(detail); 160 frame->AddFrame(detail, layout); 161 } 162 163 const TGPicture *pic3 = fList->GetPicture("tb_uplevel.xpm"); 164 if (pic3) 165 { 166 TGPictureButton *cdup = new TGPictureButton(frame, pic3, kButDirUp); 167 cdup->SetToolTipText("One Level up!"); 168 cdup->Associate(this); 169 fList->Add(cdup); 170 frame->AddFrame(cdup, layout); 171 } 180 172 } 181 173 -
trunk/MagicSoft/Mars/mmain/MMars.cc
r1082 r1108 26 26 #include "MMars.h" 27 27 28 #include <iostream.h> 29 28 30 #include <TApplication.h> // gROOT->GetApplication()->... 29 31 … … 35 37 #include <TG3DLine.h> // TGHorizontal3DLine 36 38 39 #include "MGList.h" 37 40 #include "MEvtDisp.h" 38 41 #include "MAnalysis.h" … … 85 88 void MMars::CreateTopFrame(TGHorizontalFrame *top) 86 89 { 87 fPic1 = gClient->GetPicture("magiclogo.xpm"); 88 fPic2 = gClient->GetPicture("marslogo.xpm"); 89 90 TGPictureButton *magic = new TGPictureButton(top, fPic1, kPicMagic); 91 TGPictureButton *mars = new TGPictureButton(top, fPic2, kPicMars); 92 93 fList->Add(magic); 94 fList->Add(mars); 95 96 magic->Associate(this); 97 mars->Associate(this); 98 99 TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.); 100 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.); 101 102 fList->Add(lay1); 103 fList->Add(lay2); 104 105 top->AddFrame(magic, lay1); 106 top->AddFrame(mars, lay2); 90 const TGPicture *pic1 = fList->GetPicture("magiclogo.xpm"); 91 if (pic1) 92 { 93 TGPictureButton *magic = new TGPictureButton(top, pic1, kPicMagic); 94 fList->Add(magic); 95 magic->Associate(this); 96 TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.); 97 fList->Add(lay1); 98 top->AddFrame(magic, lay1); 99 } 100 101 const TGPicture *pic2 = fList->GetPicture("marslogo.xpm"); 102 if (pic2) 103 { 104 TGPictureButton *mars = new TGPictureButton(top, pic2, kPicMars); 105 fList->Add(mars); 106 mars->Associate(this); 107 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.); 108 fList->Add(lay2); 109 top->AddFrame(mars, lay2); 110 } 107 111 } 108 112 … … 176 180 // Create the deletion list 177 181 // 178 fList = new TList;182 fList = new MGList; 179 183 fList->SetOwner(); 180 184 … … 230 234 MMars::~MMars() 231 235 { 232 gClient->FreePicture(fPic1);233 gClient->FreePicture(fPic2);234 235 236 delete fList; 236 237 } -
trunk/MagicSoft/Mars/mmain/MMars.h
r1052 r1108 10 10 #endif 11 11 12 class TList;12 class MGList; 13 13 class TGVerticalFrame; 14 14 class TGLayoutHints; … … 18 18 private: 19 19 20 TList *fList; 21 22 const TGPicture *fPic1; 23 const TGPicture *fPic2; 20 MGList *fList; 24 21 25 22 void CreateTextButton(TGVerticalFrame *tab, const char *text, -
trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc
r1082 r1108 44 44 fTitle = title ? title : "Task to calculate the collection area"; 45 45 46 if (input) 47 { 48 fObjName = input; 49 AddToBranchList(Form("%s.fNumFirstLevel", input)); 50 } 51 else 52 { 53 fObjName = "MMcTrig"; 54 AddToBranchList("fNumFirstLevel"); 55 } 46 fObjName = input ? input : "MMcTrig"; 47 AddToBranchList(Form("%s.fNumFirstLevel", input)); 56 48 57 AddToBranchList(" fEnergy");58 AddToBranchList(" fImpact");49 AddToBranchList("MMcEvt.fEnergy"); 50 AddToBranchList("MMcEvt.fImpact"); 59 51 } 60 52 -
trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc
r1088 r1108 77 77 fNum = fLast-fFirst+1; 78 78 79 AddToBranchList(" fEnergy");79 AddToBranchList("MMcEvt.fEnergy"); 80 80 AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast); 81 81 } -
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
r1082 r1108 61 61 fNum = fLast-fFirst+1; 62 62 63 AddToBranchList(" fImpact");64 AddToBranchList(" fEnergy");65 AddToBranchList(" fPhi");66 AddToBranchList(" fTheta");67 AddToBranchList(" fPhotElfromShower");63 AddToBranchList("MMcEvt.fImpact"); 64 AddToBranchList("MMcEvt.fEnergy"); 65 AddToBranchList("MMcEvt.fPhi"); 66 AddToBranchList("MMcEvt.fTheta"); 67 AddToBranchList("MMcEvt.fPhotElfromShower"); 68 68 AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast); 69 69 } -
trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc
r1082 r1108 207 207 // FIXME: Can we calculate a good buffer size out of the event size? 208 208 // using splitlevel=0 sppeds up writing by a factor of 5-10% 209 fTData ->Branch("MTime ", "MTime", &fRawEvtTime, 32000);210 fTPedestal ->Branch("MTime ", "MTime", &fRawEvtTime, 32000);211 fTCalibration->Branch("MTime ", "MTime", &fRawEvtTime, 32000);212 fTData ->Branch("MRawEvtHeader ", "MRawEvtHeader", &fRawEvtHeader, 32000);213 fTPedestal ->Branch("MRawEvtHeader ", "MRawEvtHeader", &fRawEvtHeader, 32000);214 fTCalibration->Branch("MRawEvtHeader ", "MRawEvtHeader", &fRawEvtHeader, 32000);215 fTData ->Branch("MRawEvtData ", "MRawEvtData", &fRawEvtData, 320000);216 fTPedestal ->Branch("MRawEvtData ", "MRawEvtData", &fRawEvtData, 320000);217 fTCalibration->Branch("MRawEvtData ", "MRawEvtData", &fRawEvtData, 320000);209 fTData ->Branch("MTime.", "MTime", &fRawEvtTime, 32000); 210 fTPedestal ->Branch("MTime.", "MTime", &fRawEvtTime, 32000); 211 fTCalibration->Branch("MTime.", "MTime", &fRawEvtTime, 32000); 212 fTData ->Branch("MRawEvtHeader.", "MRawEvtHeader", &fRawEvtHeader, 32000); 213 fTPedestal ->Branch("MRawEvtHeader.", "MRawEvtHeader", &fRawEvtHeader, 32000); 214 fTCalibration->Branch("MRawEvtHeader.", "MRawEvtHeader", &fRawEvtHeader, 32000); 215 fTData ->Branch("MRawEvtData.", "MRawEvtData", &fRawEvtData, 320000); 216 fTPedestal ->Branch("MRawEvtData.", "MRawEvtData", &fRawEvtData, 320000); 217 fTCalibration->Branch("MRawEvtData.", "MRawEvtData", &fRawEvtData, 320000); 218 218 //fTree->Branch("MRawCrateArray", fRawCrateArray->GetArray(), 32000, 1); 219 fTData ->Branch("MRawCrateArray ", "MRawCrateArray", &fRawCrateArray, 32000);220 fTPedestal ->Branch("MRawCrateArray ", "MRawCrateArray", &fRawCrateArray, 32000);221 fTCalibration->Branch("MRawCrateArray ", "MRawCrateArray", &fRawCrateArray, 32000);219 fTData ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000); 220 fTPedestal ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000); 221 fTCalibration->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000); 222 222 223 223 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.