Changeset 2470 for trunk/MagicSoft/Mars
- Timestamp:
- 11/04/03 17:08:27 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 1 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2469 r2470 84 84 * mraw/MRawFileWrite.cc: 85 85 - automatically add .root extension 86 87 * star.cc: 88 - added 86 89 87 90 -
trunk/MagicSoft/Mars/Makefile
r2263 r2470 20 20 # 21 21 22 PROGRAMS = readraw merpp mars22 PROGRAMS = readraw merpp star mars 23 23 SOLIB = mars.so 24 24 CINT = M -
trunk/MagicSoft/Mars/macros/star.C
r2423 r2470 47 47 plist.AddToList(&tlist); 48 48 49 MSrcPosCam src;50 src.SetReadyToSave();51 plist.AddToList(&src);52 53 49 // 54 50 // Now setup the tasks and tasklist: … … 76 72 // ------------- user change ----------------- 77 73 MWriteRootFile write("starfile.root"); 78 write.AddContainer("MMcEvt", "Events");79 write.AddContainer("MSigmabar", "Events");80 write.AddContainer("MHillas", "Events");81 write.AddContainer("MHillasExt", "Events");82 write.AddContainer("MHillasSrc", "Events");83 write.AddContainer("MNewImagePar", "Events");84 write.AddContainer("MRawRunHeader", "RunHeaders");85 write.AddContainer("MMcRunHeader", "RunHeaders");86 write.AddContainer("MSrcPosCam", "RunHeaders");87 74 88 75 tlist.AddToList(&read); … … 97 84 tlist.AddToList(&scalc); 98 85 tlist.AddToList(&write); 86 87 // ------------- user change ----------------- 88 // You may use the "UPDATE" option in the constructor 89 // of MWriteRootFile to update an existing file. 90 // 91 // tlist.SetSerialNumber(1); // Serial number of telescope 92 93 write.AddContainer(write.AddSerialNumber("MMcEvt"), "Events"); 94 write.AddContainer(write.AddSerialNumber("MSigmabar"), "Events"); 95 write.AddContainer(write.AddSerialNumber("MHillas"), "Events"); 96 write.AddContainer(write.AddSerialNumber("MHillasExt"), "Events"); 97 write.AddContainer(write.AddSerialNumber("MHillasSrc"), "Events"); 98 write.AddContainer(write.AddSerialNumber("MNewImagePar"), "Events"); 99 write.AddContainer(write.AddSerialNumber("MSrcPosCam"), "RunHeaders"); 100 write.AddContainer("MRawRunHeader", "RunHeaders"); 101 write.AddContainer("MMcRunHeader", "RunHeaders"); 99 102 100 103 // -
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
r2377 r2470 59 59 // 60 60 // Input Containers: 61 // MCerPhotEvt[, MBlindPixels] 61 // MCerPhotEvt 62 // [MBlindPixels] 62 63 // 63 64 // Output Containers: 64 // MCerPhotEvt, MBlindPixels 65 // MCerPhotEvt 66 // MBlindPixels 65 67 // 66 68 ///////////////////////////////////////////////////////////////////////////// … … 112 114 { 113 115 if (TESTBIT(fFlags, kUseBlindPixels)) 114 fPixels = (MBlindPixels*)pList->FindObject( "MBlindPixels");116 fPixels = (MBlindPixels*)pList->FindObject(AddSerialNumber("MBlindPixels")); 115 117 else 116 fPixels = (MBlindPixels*)pList->FindCreateObj( "MBlindPixels");118 fPixels = (MBlindPixels*)pList->FindCreateObj(AddSerialNumber("MBlindPixels")); 117 119 if (!fPixels) 118 120 return kFALSE; 119 121 120 fEvt = (MCerPhotEvt*)pList->FindObject( "MCerPhotEvt");122 fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt")); 121 123 if (!fEvt) 122 124 { … … 124 126 return kFALSE; 125 127 } 126 fPed = (MPedestalCam*)pList->FindObject( "MPedestalCam");128 fPed = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); 127 129 if (!fEvt) 128 130 { … … 131 133 } 132 134 133 fGeomCam = (MGeomCam*)pList->FindObject( "MGeomCam");135 fGeomCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); 134 136 if (!fGeomCam) 135 137 *fLog << warn << dbginf << "No camera geometry available... can't use interpolation." << endl; -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r2424 r2470 35 35 // 36 36 // Input Containers: 37 // MRawRunHeader, MRawEvtData, MPedestalCam 37 // MRawEvtData 38 // MPedestalCam 39 // [MRawRunHeader] 38 40 // 39 41 // Output Containers: … … 99 101 } 100 102 101 fRawEvt = (MRawEvtData*)pList->FindObject( "MRawEvtData");103 fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData")); 102 104 if (!fRawEvt) 103 105 { … … 106 108 } 107 109 108 fPedestals = (MPedestalCam*)pList->FindCreateObj( "MPedestalCam");110 fPedestals = (MPedestalCam*)pList->FindCreateObj(AddSerialNumber("MPedestalCam")); 109 111 if (!fPedestals) 110 112 { … … 113 115 } 114 116 115 fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj( "MCerPhotEvt");117 fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj(AddSerialNumber("MCerPhotEvt")); 116 118 if (!fCerPhotEvt) 117 119 return kFALSE; -
trunk/MagicSoft/Mars/manalysis/MGeomApply.cc
r2438 r2470 44 44 // 45 45 // Output Containers: 46 // MPedestalCam, MBlindPixels 46 // [MPedestalCam] 47 // [MBlindPixels] 47 48 // 48 49 ////////////////////////////////////////////////////////////////////////////// … … 79 80 Int_t MGeomApply::PreProcess(MParList *pList) 80 81 { 81 MGeomCam *cam = (MGeomCam*)pList->FindObject( "MGeomCam");82 MGeomCam *cam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); 82 83 if (cam) 83 84 return kTRUE; 84 85 85 cam = (MGeomCam*)pList->FindCreateObj( fGeomName, "MGeomCam");86 cam = (MGeomCam*)pList->FindCreateObj(AddSerialNumber(fGeomName), "MGeomCam"); 86 87 87 88 return cam ? kTRUE : kFALSE; … … 97 98 Bool_t MGeomApply::ReInit(MParList *pList) 98 99 { 99 MGeomCam *cam = (MGeomCam*)pList->FindObject( "MGeomCam");100 MGeomCam *cam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); 100 101 if (!cam) 101 102 { … … 104 105 } 105 106 106 MPedestalCam *ped = (MPedestalCam*)pList->FindObject( "MPedestalCam");107 MPedestalCam *ped = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); 107 108 if (ped) 108 109 ped->InitSize(cam->GetNumPixels()); 109 110 110 MBlindPixels *bnd = (MBlindPixels*)pList->FindObject( "MBlindPixels");111 MBlindPixels *bnd = (MBlindPixels*)pList->FindObject(AddSerialNumber("MBlindPixels")); 111 112 if (bnd) 112 113 bnd->InitSize(cam->GetNumPixels()); -
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
r2454 r2470 33 33 // Input Containers: 34 34 // MMcFadcHeader 35 // [MMcRunHeader] 36 // [MRawRunHeader] 35 37 // 36 38 // Output Containers: … … 104 106 // to be done only if this is a MC file. 105 107 // 106 MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 108 MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject(AddSerialNumber("MMcFadcHeader")); 109 if (!fadc) 110 { 111 *fLog << err << dbginf << "MMcFadcHeader not found... aborting." << endl; 112 return kFALSE; 113 } 114 115 MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj(AddSerialNumber("MPedestalCam")); 107 116 if (!pedcam) 108 117 return kFALSE; … … 111 120 if (!mcrun) 112 121 *fLog << warn << dbginf << "MMcRunHeader not found... assuming camera<0.7" << endl; 113 114 MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");115 if (!fadc)116 {117 *fLog << err << dbginf << "MMcFadcHeader not found... aborting." << endl;118 return kFALSE;119 }120 122 121 123 const int num = pedcam->GetSize(); -
trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc
r2454 r2470 24 24 25 25 ///////////////////////////////////////////////////////////////////////////// 26 // //27 // MMcPedestalNSBAdd //28 // ----------------- //29 // //30 // This Task adds the contribution of the diffuse NSB to the FADC //31 // pedestals. We assume that NSB introduces larger fluctuation but does //32 // not change the mean value. //33 // To be precise we add quadratically to the rms, which is already in //34 // MPedestalCam, the NSB contribution. //35 // The number of photons from the diffuse NSB follows a poisson //36 // distribution with expected mean value X, then its standard deviation //37 // is sqrt(X). //38 // X is the number of phe per ns so we have to convert in FADC counts per //39 // slice: //40 // //41 // Y = sqrt(X * FADC_time / Number_of_slices * pixel_size) //42 // * Amp_single_phe_response //43 // //44 // Input Containers: //45 // MMcFadcHeader //46 // M McRunHeader //47 // MRawRunHeader //48 // //49 // Output Containers: //50 // MPedestalCam //51 // //26 // 27 // MMcPedestalNSBAdd 28 // ----------------- 29 // 30 // This Task adds the contribution of the diffuse NSB to the FADC 31 // pedestals. We assume that NSB introduces larger fluctuation but does 32 // not change the mean value. 33 // To be precise we add quadratically to the rms, which is already in 34 // MPedestalCam, the NSB contribution. 35 // The number of photons from the diffuse NSB follows a poisson 36 // distribution with expected mean value X, then its standard deviation 37 // is sqrt(X). 38 // X is the number of phe per ns so we have to convert in FADC counts per 39 // slice: 40 // 41 // Y = sqrt(X * FADC_time / Number_of_slices * pixel_size) 42 // * Amp_single_phe_response 43 // 44 // Input Containers: 45 // MMcFadcHeader 46 // MRawRunHeader 47 // [MMcRunHeader] 48 // 49 // Output Containers: 50 // MPedestalCam 51 // 52 52 ///////////////////////////////////////////////////////////////////////////// 53 53 #include "MMcPedestalNSBAdd.h" … … 186 186 // is correct. 187 187 // 188 MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj( "MPedestalCam");188 MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj(AddSerialNumber("MPedestalCam")); 189 189 if (!pedcam) 190 190 return kFALSE; 191 191 192 MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject( "MMcFadcHeader");192 MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject(AddSerialNumber("MMcFadcHeader")); 193 193 if (!fadc) 194 194 { … … 197 197 } 198 198 199 MGeomCam *geom = (MGeomCam*)pList->FindObject( "MGeomCam");199 MGeomCam *geom = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); 200 200 if (!geom) 201 201 { -
trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.cc
r2209 r2470 25 25 26 26 ///////////////////////////////////////////////////////////////////////////// 27 // // 28 // MSigmabarCalc // 29 // // 30 // This task calculates Sigmabar using the MSigmabar container and stores // 31 // its extremal values together with the corresponding Theta values // 32 // in MSigmabarParam. For the time being, Theta is taken from a Monte // 33 // Carlo container. This is preliminary and to be changed ASAP. // 34 // // 27 // 28 // MSigmabarCalc 29 // 30 // This task calculates Sigmabar using the MSigmabar container and stores 31 // its extremal values together with the corresponding Theta values 32 // in MSigmabarParam. For the time being, Theta is taken from a Monte 33 // Carlo container. This is preliminary and to be changed ASAP. 34 // 35 // Input Containers: 36 // MGeomCam 37 // MPedestalCam 38 // MRawRunHeader 39 // MMcEvt (FIXME: Must be replaced by a 'real-data' container) 40 // MCerPhotEvt 41 // 42 // Output Containers: 43 // MSigmabar 44 // MSigmabarParam 45 // 35 46 ///////////////////////////////////////////////////////////////////////////// 36 47 #include "MSigmabarCalc.h" … … 72 83 Int_t MSigmabarCalc::PreProcess(MParList *pList) 73 84 { 74 fCam = (MGeomCam*)pList->FindObject( "MGeomCam");85 fCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); 75 86 if (!fCam) 76 87 { … … 79 90 } 80 91 81 fPed = (MPedestalCam*)pList->FindObject( "MPedestalCam");92 fPed = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); 82 93 if (!fPed) 83 94 { … … 94 105 95 106 // This is needed for determining min/max Theta 96 fMcEvt = (MMcEvt*)pList->FindObject( "MMcEvt");107 fMcEvt = (MMcEvt*)pList->FindObject(AddSerialNumber("MMcEvt")); 97 108 if (!fMcEvt) 98 109 { … … 102 113 } 103 114 104 fEvt = (MCerPhotEvt*)pList->FindObject( "MCerPhotEvt");115 fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt")); 105 116 if (!fEvt) 106 117 { … … 109 120 } 110 121 111 fSig = (MSigmabar*)pList->FindCreateObj( "MSigmabar");122 fSig = (MSigmabar*)pList->FindCreateObj(AddSerialNumber("MSigmabar")); 112 123 if (!fSig) 113 124 return kFALSE; 114 125 115 fSigParam = (MSigmabarParam*)pList->FindCreateObj("MSigmabarParam"); 126 // FIXME: This might have to change in a 127 // 'more-than-one-telescope-environment' 128 fSigParam = (MSigmabarParam*)pList->FindCreateObj(AddSerialNumber("MSigmabarParam")); 116 129 if (!fSigParam) 117 130 return kFALSE; -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r2416 r2470 163 163 // -------------------------------------------------------------------------- 164 164 // 165 // Returns the name of the object. If the name of the object is not the 166 // class name it returns the object name and in []-brackets the class name. 167 // 168 const char *MParContainer::GetDescriptor() const 169 { 170 // 171 // Because it returns a (const char*) we cannot return a casted 172 // local TString. The pointer would - immediatly after return - 173 // point to a random memory segment, because the TString has gone. 174 // 175 return fName==ClassName() ? ClassName() : Form("%s [%s]", fName.Data(), ClassName()); 176 } 177 178 // -------------------------------------------------------------------------- 179 // 165 180 // Return a unique name for this container. It is created from 166 181 // the container name and the unique Id. (This is mostly used -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r2416 r2470 74 74 virtual void FillBuffer(char *&buffer); 75 75 76 virtual const char *GetDescriptor() const { return fName==ClassName() ? ClassName() : Form("%s [%s]", fName.Data(), ClassName()); }76 virtual const char *GetDescriptor() const; 77 77 virtual const TString GetUniqueName() const; 78 78 virtual const char *GetName() const { return fName.Data(); } -
trunk/MagicSoft/Mars/mbase/MTask.cc
r2206 r2470 24 24 25 25 ///////////////////////////////////////////////////////////////////////////// 26 // // 27 // MTask // 28 // // 29 // Base class for all tasks which can perfomed in a tasklist // 30 // For each event processed in the eventloop all the different // 31 // tasks in the tasklist will be processed. // 32 // // 33 // So all tasks must inherit from this baseclass. // 34 // // 35 // The inheritance from MInputStreamID is used to indicate the // 36 // type of event that this task is for. If it is "All" it is executed // 37 // independantly of the actual ID of the task list. // 38 // // 39 // Inside this abstract class, there are three fundamental function: // 40 // // 41 // - PreProcess(): executed before the eventloop starts. Here you // 42 // can initiate different things, open files, etc. // 43 // As an argument this function gets a pointer to the // 44 // parameter list. You can stop the execution by // 45 // returning kFALSE instead of kTRUE. If an error // 46 // occured and you return kFALSE make sure, that // 47 // any action is closed correctly and all newly // 48 // created object are deleted. The PostProcess in // 49 // such a case won't be executed by the Tasklist or // 50 // Eventloop. // 51 // // 52 // - Process(): executed for each event in the eventloop. Do it // 53 // one task after the other (as they occur in the // 54 // tasklist). Only the tasks with a Stream ID // 55 // which matches the actual ID of the tasklist // 56 // are executed. A task can return kFALSE to // 57 // stop the execuition of the tasklist or // 58 // kCONTINUE to skip the pending tasks. If you want // 59 // to stop the eventloop and wants the eventloop to // 60 // return the status 'failed' return kERROR. // 61 // // 62 // - PostProcess(): executed after the eventloop. Here you can close // 63 // output files, start display of the run parameter, // 64 // etc. PostProcess is only executed in case of // 65 // PreProcess was successfull (returned kTRUE) // 66 // // 26 // 27 // MTask 28 // 29 // Base class for all tasks which can perfomed in a tasklist 30 // For each event processed in the eventloop all the different 31 // tasks in the tasklist will be processed. 32 // 33 // So all tasks must inherit from this baseclass. 34 // 35 // The inheritance from MInputStreamID is used to indicate the 36 // type of event that this task is for. If it is "All" it is executed 37 // independantly of the actual ID of the task list. 38 // 39 // Inside this abstract class, there are three fundamental function: 40 // 41 // - PreProcess(): executed before the eventloop starts. Here you 42 // can initiate different things, open files, etc. 43 // As an argument this function gets a pointer to the 44 // parameter list. You can stop the execution by 45 // returning kFALSE instead of kTRUE. If an error 46 // occured and you return kFALSE make sure, that 47 // any action is closed correctly and all newly 48 // created object are deleted. The PostProcess in 49 // such a case won't be executed by the Tasklist or 50 // Eventloop. 51 // 52 // - Process(): executed for each event in the eventloop. Do it 53 // one task after the other (as they occur in the 54 // tasklist). Only the tasks with a Stream ID 55 // which matches the actual ID of the tasklist 56 // are executed. A task can return kFALSE to 57 // stop the execuition of the tasklist or 58 // kCONTINUE to skip the pending tasks. If you want 59 // to stop the eventloop and wants the eventloop to 60 // return the status 'failed' return kERROR. 61 // 62 // - PostProcess(): executed after the eventloop. Here you can close 63 // output files, start display of the run parameter, 64 // etc. PostProcess is only executed in case of 65 // PreProcess was successfull (returned kTRUE) 66 // 67 // Version 1: 68 // ---------- 69 // - first version 70 // 71 // Version 2: 72 // ---------- 73 // - added fSerialNumber 74 // 67 75 ///////////////////////////////////////////////////////////////////////////// 68 76 #include "MTask.h" … … 286 294 { 287 295 return kTRUE; 296 } 297 298 // -------------------------------------------------------------------------- 299 // 300 // Returns the name of the object. If the name of the object is not the 301 // class name it returns the object name and in []-brackets the class name. 302 // If a serial number is set (!=0) the serial number is added to the 303 // name (eg. ;1) 304 // 305 const char *MTask::GetDescriptor() const 306 { 307 // 308 // Because it returns a (const char*) we cannot return a casted 309 // local TString. The pointer would - immediatly after return - 310 // point to a random memory segment, because the TString has gone. 311 // 312 if (fName==ClassName()) 313 return fSerialNumber==0 ? ClassName() : Form("%s;%d", ClassName(), fSerialNumber); 314 315 return fSerialNumber>0 ? 316 Form("%s;%d [%s]", fName.Data(), fSerialNumber, ClassName()) : 317 Form("%s [%s]", fName.Data(), ClassName()); 288 318 } 289 319 … … 327 357 fFilter->SavePrimitive(out); 328 358 */ 329 out << " " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl; 359 out << " " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl; 360 if (fSerialNumber>0) 361 out << " " << GetUniqueName() << ".SetSerialNumber(" << fSerialNumber <<");" << endl; 330 362 } 331 363 -
trunk/MagicSoft/Mars/mbase/MTask.h
r2454 r2470 25 25 26 26 MFilter *fFilter; // Filter for conditional task execution 27 Byte_t fSerialNumber; // Serial number having more than one detector of the same type 27 28 28 29 Bool_t fIsPreprocessed; //! Indicates the success of the PreProcessing (set by MTaskList) … … 68 69 const MFilter *GetFilter() const { return fFilter; } 69 70 MFilter *GetFilter() { return fFilter; } // for MContinue only 71 70 72 void SetDisplay(MStatusDisplay *d); 71 73 virtual void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const; 74 75 virtual void SetSerialNumber(Byte_t num) { fSerialNumber = num; } 76 Byte_t GetSerialNumber() const { return fSerialNumber; } 77 TString AddSerialNumber(const char *str) const { TString s(str); if (fSerialNumber==0) return s; s += ";"; s += fSerialNumber; return s; } 78 TString AddSerialNumber(const TString &str) const { return AddSerialNumber((const char*)str); } 79 80 const char *GetDescriptor() const; 72 81 73 82 UInt_t GetNumExecutions() const { return fNumExecutions; } … … 85 94 void SavePrimitive(ofstream &out, Option_t *o=""); 86 95 87 ClassDef(MTask, 1) //Abstract base class for a task96 ClassDef(MTask, 2) //Abstract base class for a task 88 97 }; 89 98 -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r2454 r2470 145 145 } 146 146 147 // -------------------------------------------------------------------------- 148 // 149 // Set the display for the all tasks in the list and the tasklist itself. 150 // 147 151 void MTaskList::SetDisplay(MStatusDisplay *d) 148 152 { 149 153 fTasks->ForEach(MTask, SetDisplay)(d); 150 154 MTask::SetDisplay(d); 155 } 156 157 // -------------------------------------------------------------------------- 158 // 159 // Set the serial number for the all tasks in the list and the tasklist 160 // itself. 161 // 162 void MTaskList::SetSerialNumber(Byte_t num) 163 { 164 fTasks->ForEach(MTask, SetSerialNumber)(num); 165 MTask::SetSerialNumber(num); 151 166 } 152 167 -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r2206 r2470 47 47 Bool_t AddToList(MTask *task, const char *tType="All"); 48 48 49 void SetSerialNumber(Byte_t num); 50 49 51 Bool_t RemoveFromList(MTask *task); 50 52 -
trunk/MagicSoft/Mars/mfileio/MReadTree.cc
r2296 r2470 779 779 if (!c) continue; 780 780 if ((*c)->InheritsFrom(MRawEvtData::Class())) 781 ((MRawEvtData*)(*c))->DeletePixels(kFALSE);781 static_cast<MRawEvtData*>(*c)->DeletePixels(kFALSE); 782 782 783 783 } -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r2377 r2470 53 53 static const TString gsDefName = "MWriteRootFile"; 54 54 static const TString gsDefTitle = "Task which writes a root-output file"; 55 55 56 // -------------------------------------------------------------------------- 56 57 // -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h
r2130 r2470 83 83 kFillTree = BIT(14), 84 84 // TBranch::kAutoDelete = BIT(15) 85 kIsNewTree = BIT(16) 85 // TBranchElement::kDeleteObject = BIT(16) 86 kIsNewTree = BIT(17) 86 87 }; 87 88 -
trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
r2463 r2470 24 24 \* ======================================================================== */ 25 25 26 /////////////////////////////////////////////////////////////////////// 26 ///////////////////////////////////////////////////////////////////////////// 27 27 // 28 28 // MGeomCam … … 32 32 // interface of how to acccess the geometry information. 33 33 // 34 // We use a TObjArray for possible future usage (it is much more flexible 35 // than a TClonesArray so that it can store more types of pixels (eg 36 // fake pixels which are not really existing) 34 37 // 35 38 // Version 1: … … 42 45 // - added fPixRatioSqrt 43 46 // 44 // 45 /////////////////////////////////////////////////////////////////////// 47 ///////////////////////////////////////////////////////////////////////////// 46 48 #include "MGeomCam.h" 47 49 … … 57 59 using namespace std; 58 60 61 // -------------------------------------------------------------------------- 62 // 63 // Default Constructor 64 // 59 65 MGeomCam::MGeomCam() 60 66 : fNumPixels(0), fCamDist(0), fConvMm2Deg(0) … … 62 68 } 63 69 64 65 66 70 // -------------------------------------------------------------------------- 67 71 // … … 86 90 } 87 91 92 // -------------------------------------------------------------------------- 93 // 94 // Returns a reference of the i-th entry (the pixel with the software idx i) 95 // The access is unchecked (for speed reasons!) accesing non existing 96 // entries may crash the program! 97 // 88 98 MGeomPix &MGeomCam::operator[](Int_t i) 89 99 { … … 91 101 } 92 102 103 // -------------------------------------------------------------------------- 104 // 105 // Returns a reference of the i-th entry (the pixel with the software idx i) 106 // The access is unchecked (for speed reasons!) accesing non existing 107 // entries may crash the program! 108 // 93 109 MGeomPix &MGeomCam::operator[](Int_t i) const 94 110 { … … 208 224 } 209 225 226 // -------------------------------------------------------------------------- 227 // 228 // Create a clone of this container. This is very easy, because we 229 // simply have to create a new object of the same type. 230 // 210 231 TObject *MGeomCam::Clone(const char *newname) const 211 232 { -
trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
r2463 r2470 45 45 // 46 46 // 47 // FIXME: According to an agreement we have to change the name 'Id' 48 // to 'idx' 47 // FIXME: According to an agreement we have to change the name 'Id' to 'idx' 49 48 // 50 49 //////////////////////////////////////////////////////////////////////////// … … 127 126 { 128 127 // information about a pixel 129 *fLog << all << "MPixGeom: x= " << fX 130 << " y= " << fY 131 << " d= " << fD 132 << " A= " << fA 133 << endl ; 128 *fLog << all << "MPixGeom: x= " << fX << "mm y= " << fY << "mm "; 129 *fLog << "d= " << fD << "mm A= " << fA << "mm²" << endl; 134 130 } 135 -
trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
r2455 r2470 48 48 // 49 49 // Input Containers: 50 // MCerPhotEvt, MGeomCam[, MHillas] 50 // MCerPhotEvt 51 // MGeomCam 52 // [MHillas] 51 53 // 52 54 // Output Containers: 53 // [MHillas,] MHillasExt, MNewImagePar 55 // [MHillas] 56 // MHillasExt 57 // MNewImagePar 54 58 // 55 59 ///////////////////////////////////////////////////////////////////////////// … … 93 97 { 94 98 // necessary 95 fCerPhotEvt = (MCerPhotEvt*)pList->FindObject( "MCerPhotEvt");99 fCerPhotEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt")); 96 100 if (!fCerPhotEvt) 97 101 { … … 101 105 102 106 // necessary 103 fGeomCam = (MGeomCam*)pList->FindObject( "MGeomCam");107 fGeomCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); 104 108 if (!fGeomCam) 105 109 { … … 110 114 // depend on whether MHillas is an in- or output container 111 115 if (TestFlag(kCalcHillas)) 112 fHillas = (MHillas*)pList->FindCreateObj("MHillas", fHilName);116 fHillas = (MHillas*)pList->FindCreateObj("MHillas", AddSerialNumber(fHilName)); 113 117 else 114 118 { 115 fHillas = (MHillas*)pList->FindObject( fHilName, "MHillas");119 fHillas = (MHillas*)pList->FindObject(AddSerialNumber(fHilName), "MHillas"); 116 120 *fLog << err << fHilName << " [MHillas] not found... aborting." << endl; 117 121 } … … 122 126 if (TestFlag(kCalcHillasExt)) 123 127 { 124 fHillasExt = (MHillasExt*)pList->FindCreateObj("MHillasExt", fHilExtName);128 fHillasExt = (MHillasExt*)pList->FindCreateObj("MHillasExt", AddSerialNumber(fHilExtName)); 125 129 if (!fHillasExt) 126 130 return kFALSE; … … 130 134 if (TestFlag(kCalcNewImagePar)) 131 135 { 132 fNewImgPar = (MNewImagePar*)pList->FindCreateObj("MNewImagePar", fImgParName);136 fNewImgPar = (MNewImagePar*)pList->FindCreateObj("MNewImagePar", AddSerialNumber(fImgParName)); 133 137 if (!fNewImgPar) 134 138 return kFALSE; -
trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.cc
r2209 r2470 29 29 // 30 30 // Task to calculate the source dependant part of the hillas parameters 31 // 32 // FIXME: Merge with MHillasCalc 33 // 34 // Input Containers: 35 // MHillas 36 // [MSrcPosCam] 37 // 38 // Output Containers: 39 // MHillasSrc 31 40 // 32 41 ////////////////////////////////////////////////////////////////////////////// … … 74 83 Int_t MHillasSrcCalc::PreProcess(MParList *pList) 75 84 { 76 fHillas = (MHillas*)pList->FindObject( fHillasInput, "MHillas");85 fHillas = (MHillas*)pList->FindObject(AddSerialNumber(fHillasInput), "MHillas"); 77 86 if (!fHillas) 78 87 { … … 81 90 } 82 91 83 fSrcPos = (MSrcPosCam*)pList->FindObject( fSrcName, "MSrcPosCam");92 fSrcPos = (MSrcPosCam*)pList->FindObject(AddSerialNumber(fSrcName), "MSrcPosCam"); 84 93 if (!fSrcPos) 85 94 { 86 *fLog << warn << fSrcName << " [MSrcPosCam] not found... creating default MSrcPosCam." << endl;87 fSrcPos = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam", fSrcName);95 *fLog << warn << AddSerialNumber(fSrcName) << " [MSrcPosCam] not found... creating default container." << endl; 96 fSrcPos = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam", AddSerialNumber(fSrcName)); 88 97 if (!fSrcPos) 89 98 return kFALSE; 90 99 } 91 100 92 fHillasSrc = (MHillasSrc*)pList->FindCreateObj("MHillasSrc", fHillasName);101 fHillasSrc = (MHillasSrc*)pList->FindCreateObj("MHillasSrc", AddSerialNumber(fHillasName)); 93 102 if (!fHillasSrc) 94 103 return kFALSE; -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r2465 r2470 244 244 // 245 245 // Input Containers: 246 // MGeomCam, MCerPhotEvt, MSigmabar 246 // MGeomCam 247 // MCerPhotEvt 248 // [MSigmabar] 247 249 // 248 250 // Output Containers: … … 646 648 Int_t MImgCleanStd::PreProcess (MParList *pList) 647 649 { 648 fCam = (MGeomCam*)pList->FindObject( "MGeomCam");650 fCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); 649 651 if (!fCam) 650 652 { … … 653 655 } 654 656 655 fEvt = (MCerPhotEvt*)pList->FindObject( "MCerPhotEvt");657 fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt")); 656 658 if (!fEvt) 657 659 { … … 662 664 if (fCleaningMethod == kDemocratic) 663 665 { 664 fSgb = (MSigmabar*)pList->FindObject( "MSigmabar");666 fSgb = (MSigmabar*)pList->FindObject(AddSerialNumber("MSigmabar")); 665 667 if (!fSgb) 666 668 { … … 671 673 else 672 674 { 673 fPed = (MPedestalCam*)pList->FindObject( "MPedestalCam");675 fPed = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); 674 676 if (!fPed) 675 677 { -
trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc
r2207 r2470 73 73 // Open a rootfile 74 74 // 75 fOut = new TFile(fname, opt, ftitle, comp); 75 TString str(fname); 76 if (!str.EndsWith(".root", TString::kIgnoreCase)) 77 str += ".root"; 78 79 fOut = new TFile(str, opt, ftitle, comp); 76 80 } 77 81
Note:
See TracChangeset
for help on using the changeset viewer.