Changeset 7115 for trunk/MagicSoft/Mars/mpointing
- Timestamp:
- 05/31/05 11:53:09 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpointing/MPointingPosCalc.cc
r5583 r7115 34 34 // * Real Data: Copy the nominal poiting position (Nominal Zd, Nominal Az 35 35 // in MReportDrive) to MPointingPosition 36 // 37 // We do a trick: Because it is not guranteed, that MReadReports calls 38 // ReInit before the first event from the drive-tree is read (because 39 // the first data event may have a time-stamp later than the first 40 // drive event) we always assume that the current run is a data run. 41 // If the assumption is true fReport should be initialized correctly. 42 // For MC runs this should never happen, Because they are read though 43 // MReadMarsFile which gurantees, that ReInit is always called before 44 // Process. If we encounter such a case we stop execution. 36 45 // 37 46 // Future: Interpolate the pointing position for each event between two … … 81 90 { 82 91 case MRawRunHeader::kRTData: 83 fReport = (MReportDrive*)plist->FindObject("MReportDrive");84 92 if (!fReport) 85 93 { … … 121 129 { 122 130 fPosition = (MPointingPos*)plist->FindCreateObj("MPointingPos"); 131 fReport = (MReportDrive*)plist->FindObject("MReportDrive"); 132 133 // We use kRTNone here as a placeholder for data runs. 134 fRunType = MRawRunHeader::kRTNone; 135 123 136 return fPosition ? kTRUE : kFALSE; 124 137 } … … 130 143 Int_t MPointingPosCalc::Process() 131 144 { 132 if (!fReport && fRunType == MRawRunHeader::kRTData)133 {134 *fLog << warn << "WARNING - MPointingPosCalc::Process was called BEFORE the first" << endl;135 *fLog << " data event was read (means ReInit was executed!" << endl;136 return kTRUE;137 }138 139 145 switch (fRunType) 140 146 { 147 case MRawRunHeader::kRTNone: 141 148 case MRawRunHeader::kRTData: 149 if (!fReport) 150 { 151 *fLog << warn; 152 *fLog << "MPointingPosCalc::Process: fReport==NULL && fRunType!=kRTMonteCarlo... abort!" << endl; 153 return kERROR; 154 } 142 155 fPosition->SetLocalPosition(fReport->GetNominalZd(), fReport->GetNominalAz()); 143 156 fPosition->SetSkyPosition(fReport->GetRa(), fReport->GetDec()); … … 145 158 146 159 case MRawRunHeader::kRTMonteCarlo: 160 if (!fMcEvt) 161 { 162 *fLog << warn; 163 *fLog << "MPointingPosCalc::Process: fMcEvt==NULL && fRunType==kRTMonteCarlo... abort!" << endl; 164 return kERROR; 165 } 147 166 fPosition->SetLocalPosition(fMcEvt->GetTelescopeTheta()*TMath::RadToDeg(), fMcEvt->GetTelescopePhi()*TMath::RadToDeg()); 148 167 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.