Changeset 9272 for trunk/MagicSoft/Mars/msimcamera
- Timestamp:
- 01/26/09 14:26:47 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/msimcamera
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msimcamera/MSimCalibrationSignal.cc
r9256 r9272 107 107 } 108 108 109 110 fEvt = 0; 111 fTrigger = 0; 112 113 if (fRunHeader->IsCalibrationRun()) 114 { 115 fEvt = (MPhotonEvent*)pList->FindCreateObj("MPhotonEvent"); 116 if (!fEvt) 117 return kFALSE; 118 } 119 else 120 { 121 fTrigger = (MParameterD*)pList->FindCreateObj("MParameterD", "TriggerPos"); 122 if (!fTrigger) 123 return kFALSE; 124 } 109 fEvt = (MPhotonEvent*)pList->FindCreateObj("MPhotonEvent"); 110 if (!fEvt) 111 return kFALSE; 112 113 fTrigger = (MParameterD*)pList->FindCreateObj("MParameterD", "TriggerPos"); 114 if (!fTrigger) 115 return kFALSE; 125 116 126 117 fStat = (MPhotonStatistics*)pList->FindCreateObj("MPhotonStatistics"); … … 155 146 // ReInit the task-list if this is the first "event from this fake file" 156 147 // 157 Bool_t MSimCalibrationSignal:: ReInit(MParList *plist)158 { 159 if ( plist)148 Bool_t MSimCalibrationSignal::CallReInit() 149 { 150 if (GetNumExecutions()>0) 160 151 return kTRUE; 161 152 162 if (GetNumExecutions()==0) 163 return kTRUE; 164 165 MTask *fTaskList = (MTask*)fParList->FindObject("MTaskList"); 166 if (!fTaskList) 153 MTask *tlist = (MTask*)fParList->FindObject("MTaskList"); 154 if (!tlist) 167 155 { 168 156 *fLog << err << dbginf << "MTaskList not found... abort." << endl; … … 170 158 } 171 159 172 if (!fTaskList->ReInit(fParList)) 173 return kFALSE; 174 175 return kTRUE; 160 return tlist->ReInit(fParList); 176 161 } 177 162 … … 182 167 Int_t MSimCalibrationSignal::Process() 183 168 { 184 if (GetNumExecutions() ==fNumEntries)185 return kFALSE; 186 187 if (! ReInit())169 if (GetNumExecutions()>fNumEntries) 170 return kFALSE; 171 172 if (!CallReInit()) 188 173 return kERROR; 189 174 … … 194 179 { 195 180 // FIXME: Where to get this number from? 196 for (int i=0; i<5 0; i++)181 for (int i=0; i<5; i++) 197 182 { 198 183 MPhotonData &ph = fEvt->Add(cnt++); … … 200 185 const Float_t tm = gRandom->Gaus(0, 1); 201 186 187 ph.SetPrimary(MMcEvtBasic::kArtificial); 202 188 ph.SetTag(idx); 203 189 ph.SetWeight(); -
trunk/MagicSoft/Mars/msimcamera/MSimCalibrationSignal.h
r9256 r9272 34 34 Int_t PreProcess(MParList *pList); 35 35 Int_t Process(); 36 Bool_t ReInit(MParList *plist=0); 36 37 // MSimCalibrationSignal 38 Bool_t CallReInit(); 37 39 38 40 //Int_t ReadRouting(const char *fname, TObjArray &arr); -
trunk/MagicSoft/Mars/msimcamera/MSimRandomPhotons.cc
r9243 r9272 179 179 // Set source to NightSky, time to t and tag to pixel index 180 180 ph.SetPrimary(MMcEvtBasic::kNightSky); 181 ph.SetWeight(); 181 182 ph.SetTime(t); 182 183 ph.SetTag(idx); -
trunk/MagicSoft/Mars/msimcamera/MSimReadout.cc
r9270 r9272 131 131 132 132 fRunHeader->InitPixels(cam->GetNumPixels()); 133 fRunHeader->SetValidMagicNumber(); 134 fRunHeader->SetSourceInfo("MonteCarlo"); // "Muon" from first event?? 133 135 134 136 fData->InitRead(fRunHeader); … … 237 239 fData->SetReadyToSave(); 238 240 241 fRunHeader->SetNumEvents(fRunHeader->GetNumEvents()+1); 242 239 243 return kTRUE; 240 244 }
Note:
See TracChangeset
for help on using the changeset viewer.