Changeset 9314 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 02/11/09 11:57:57 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationPatternDecode.cc
r7194 r9314 34 34 // Input: 35 35 // MRawEvtData 36 // MRawRunHeader 36 37 // 37 38 // Output: … … 68 69 Int_t MCalibrationPatternDecode::PreProcess(MParList *pList) 69 70 { 70 fRunHeader = (MRawRunHeader*)pList->Find CreateObj("MRawRunHeader");71 fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 71 72 if (!fRunHeader) 72 73 { … … 84 85 fPattern = (MCalibrationPattern*)pList->FindCreateObj("MCalibrationPattern"); 85 86 if (!fPattern) 86 {87 *fLog << err << "MCalibratinPattern not found... abort." << endl;88 87 return kFALSE; 89 }90 88 91 89 return kTRUE; … … 102 100 // been called just before 103 101 if (fRunHeader->GetFormatVersion()<5) 104 return kTRUE;102 return kTRUE; 105 103 106 UInt_t pattern = fEvtHeader->GetCalibrationPattern(); 104 // Get calibration pattern from event header 105 const UInt_t pattern = fEvtHeader->GetCalibrationPattern(); 107 106 108 fPattern->fCLStrength = pattern & 0xff; 109 fPattern->fCLColor = (MCalibrationPattern::CLColor_t)((pattern>>8)&0xf); 110 111 const UInt_t pulserpattern = (pattern >> 16) & 0xffff; 107 const UInt_t str = (pattern ) & 0x00ff; 108 const UInt_t col = (pattern>> 8) & 0x000f; 109 const UInt_t pat = (pattern>>16) & 0xffff; 112 110 113 fPattern->fPulserColor = MCalibrationCam::kNONE; 111 fPattern->fCLStrength = str; 112 fPattern->fCLColor = (MCalibrationPattern::CLColor_t)col; 114 113 115 if ((pulserpattern & kGreenAndBlue) || (pulserpattern & kBlueAndUV) || (pulserpattern & kGreenAndUV)) 116 fPattern->fPulserColor = MCalibrationCam::kNONE; 117 if (pulserpattern & kCT1Pulser) 118 fPattern->fPulserColor = MCalibrationCam::kCT1; 119 if (pulserpattern & kAnyUV) 120 fPattern->fPulserColor = MCalibrationCam::kUV; 121 if (pulserpattern & kAnyGreen) 122 fPattern->fPulserColor = MCalibrationCam::kGREEN; 123 if (pulserpattern & kAnyBlue) 124 fPattern->fPulserColor = MCalibrationCam::kBLUE; 114 // Set a default pattern 115 fPattern->fPulserColor = MCalibrationCam::kNONE; 125 116 126 Float_t strength = 0.; 117 // Check the pattern 118 if ((pat & kGreenAndBlue) || (pat & kBlueAndUV) || (pat & kGreenAndUV)) 119 fPattern->fPulserColor = MCalibrationCam::kNONE; 120 121 if (pat & kCT1Pulser) 122 fPattern->fPulserColor = MCalibrationCam::kCT1; 123 124 if (pat & kAnyUV) 125 fPattern->fPulserColor = MCalibrationCam::kUV; 126 127 if (pat & kAnyGreen) 128 fPattern->fPulserColor = MCalibrationCam::kGREEN; 129 130 if (pat & kAnyBlue) 131 fPattern->fPulserColor = MCalibrationCam::kBLUE; 132 133 // Now decode the strength 134 fPattern->fPulserStrength = 0.; 127 135 128 136 switch (fPattern->fPulserColor) 129 137 { 130 138 case MCalibrationCam::kNONE: 131 break; 139 break; 140 132 141 case MCalibrationCam::kGREEN: 133 if (pulserpattern & kSlot1Green) 134 strength += 5.; 135 if (pulserpattern & kSlot2Green) 136 strength += 2.; 137 if (pulserpattern & kSlot15Green) 138 strength += 1.; 139 if (pulserpattern & kSlot16AttGreen) 140 strength += 0.2; 141 break; 142 if (pat & kSlot1Green) 143 fPattern->fPulserStrength += 5.0; 144 if (pat & kSlot2Green) 145 fPattern->fPulserStrength += 2.0; 146 if (pat & kSlot15Green) 147 fPattern->fPulserStrength += 1.0; 148 if (pat & kSlot16AttGreen) 149 fPattern->fPulserStrength += 0.2; 150 break; 151 142 152 case MCalibrationCam::kBLUE: 143 if (pulserpattern & kSlot3Blue) 144 strength += 5.1; 145 if (pulserpattern & kSlot6Blue) 146 strength += 5.2; 147 if (pulserpattern & kSlot7Blue) 148 strength += 5.4; 149 if (pulserpattern & kSlot8Blue) 150 strength += 2.; 151 if (pulserpattern & kSlot9AttBlue) 152 strength += 0.25; 153 if (pulserpattern & kSlot10Blue) 154 strength += 0.; 155 if (pulserpattern & kSlot11Blue) 156 strength += 1.; 157 if (pulserpattern & kSlot14Blue) 158 strength += 5.8; 159 break; 153 if (pat & kSlot3Blue) 154 fPattern->fPulserStrength += 5.1; 155 if (pat & kSlot6Blue) 156 fPattern->fPulserStrength += 5.2; 157 if (pat & kSlot7Blue) 158 fPattern->fPulserStrength += 5.4; 159 if (pat & kSlot8Blue) 160 fPattern->fPulserStrength += 2.0; 161 if (pat & kSlot9AttBlue) 162 fPattern->fPulserStrength += 0.25; 163 if (pat & kSlot10Blue) 164 fPattern->fPulserStrength += 0.0; 165 if (pat & kSlot11Blue) 166 fPattern->fPulserStrength += 1.0; 167 if (pat & kSlot14Blue) 168 fPattern->fPulserStrength += 5.8; 169 break; 170 160 171 case MCalibrationCam::kUV: 161 if (pulserpattern & kSlot4UV) 162 strength += 1.; 163 if (pulserpattern & kSlot5UV) 164 strength += 2.; 165 if (pulserpattern & kSlot12UV) 166 strength += 5.1; 167 if (pulserpattern & kSlot13UV) 168 strength += 5.2; 169 break; 172 if (pat & kSlot4UV) 173 fPattern->fPulserStrength += 1.0; 174 if (pat & kSlot5UV) 175 fPattern->fPulserStrength += 2.0; 176 if (pat & kSlot12UV) 177 fPattern->fPulserStrength += 5.1; 178 if (pat & kSlot13UV) 179 fPattern->fPulserStrength += 5.2; 180 break; 181 170 182 case MCalibrationCam::kCT1: 171 strength = 20.; 172 break; 173 } 174 175 fPattern->fPulserStrength = strength; 183 fPattern->fPulserStrength = 20.; 184 break; 185 } 176 186 177 187 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.