Changeset 4714 for trunk/MagicSoft/Mars
- Timestamp:
- 08/23/04 15:42:56 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4710 r4714 91 91 * mmain/MEventDisplay.cc: 92 92 - added display of island index 93 - changed to support files with calibrated data, too 93 94 94 95 * mhvstime/MHVsTime.[h,cc]: … … 138 139 * mpointing/MSrcPosCam.h: 139 140 - made StreamPrimitive public 141 142 * msignal/MArrivalTime.h: 143 - removed operator() 140 144 141 145 -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r4702 r4714 33 33 // 34 34 #include <TFile.h> // TFile 35 #include <TTree.h> // TTree 35 36 #include <TList.h> // TList::Add 36 37 #include <TStyle.h> // gStyle->SetOptStat … … 51 52 // 52 53 #include "MGList.h" // MGList 54 55 #include "MLog.h" 56 #include "MLogManip.h" 53 57 54 58 #include "MParList.h" // MParList::AddToList … … 93 97 #include "MMcTriggerLvl2.h" // MMcTriggerLvl2 94 98 99 using namespace std; 100 95 101 ClassImp(MEventDisplay); 96 102 … … 135 141 } 136 142 143 Int_t MEventDisplay::GetFileType(const char *tree, const char *fname) const 144 { 145 TFile f(fname, "READ"); 146 TTree *t = (TTree*)f.Get(tree); 147 if (!t) 148 return -1; 149 150 if (t->FindBranch("MCerPhotEvt.")) 151 return 1; 152 153 if (t->FindBranch("MRawEvtData.")) 154 return 2; 155 156 return -2; 157 } 158 137 159 // -------------------------------------------------------------------------- 138 160 // … … 148 170 MBadPixelsCam *badpix = new MBadPixelsCam; 149 171 150 TFile file(pname, "READ"); 151 if (!file.IsZombie()) 152 pcam = new MPedPhotCam; 153 if (pcam) 172 const Int_t type = GetFileType(tname, fname); 173 switch (type) 154 174 { 155 if (pcam->Read()<=0) 175 case 1: gLog << all << "Calibrated Data File detected..." << endl; break; 176 case 2: gLog << all << "Raw Data File detected..." << endl; break; 177 case -2: gLog << err << "File type unknown... abort." << endl; return; 178 case -1: gLog << err << "Tree " << tname << " not found... abort." << endl; return; 179 } 180 181 if (type==2) 182 { 183 TFile file(pname, "READ"); 184 if (!file.IsZombie()) 185 pcam = new MPedPhotCam; 186 if (pcam) 156 187 { 157 delete pcam; 158 pcam = NULL; 188 if (pcam->Read()<=0) 189 { 190 delete pcam; 191 pcam = NULL; 192 } 193 194 if (file.FindKey("MBadPixelsCam")) 195 { 196 MBadPixelsCam bad; 197 if (bad.Read()>0) 198 badpix->Merge(bad); 199 } 159 200 } 160 161 if (file.FindKey("MBadPixelsCam")) 201 file.Close(); 202 file.Open(cname, "READ"); 203 if (!file.IsZombie()) 204 ccam = new MCalibrationChargeCam; 205 if (ccam) 162 206 { 163 MBadPixelsCam bad; 164 if (bad.Read()>0) 165 badpix->Merge(bad); 207 if (ccam->Read()<=0) 208 { 209 delete ccam; 210 ccam = NULL; 211 } 212 213 if (file.FindKey("MBadPixelsCam")) 214 { 215 MBadPixelsCam bad; 216 if (bad.Read()>0) 217 badpix->Merge(bad); 218 } 166 219 } 220 file.Close(); 167 221 } 168 file.Close();169 file.Open(cname, "READ");170 if (!file.IsZombie())171 ccam = new MCalibrationChargeCam;172 if (ccam)173 {174 if (ccam->Read()<=0)175 {176 delete ccam;177 ccam = NULL;178 }179 180 if (file.FindKey("MBadPixelsCam"))181 {182 MBadPixelsCam bad;183 if (bad.Read()>0)184 badpix->Merge(bad);185 }186 }187 file.Close();188 222 189 223 // … … 265 299 266 300 // If no pedestal or no calibration file is availble 267 if ( !pcam || !ccam)301 if (type==2) 268 302 { 269 MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5); 270 MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5); 271 f1->SetName("MFMonteCarlo"); 272 f2->SetName("MFRealData"); 273 274 MMcPedestalCopy *pcopy = new MMcPedestalCopy; 275 MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd; 276 277 MExtractSignal* extra = new MExtractSignal(); 278 extra->SetRange(0, 14, 0, 14); 279 extra->SetSaturationLimit(240); 280 281 MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate; 282 mcupd->SetOuterPixelsGainScaling(kFALSE); 283 284 MCalibrate* mccal = new MCalibrate; 285 mccal->SetCalibrationMode(MCalibrate::kFfactor); 286 287 // MC 288 extra->SetFilter(f1); 289 mcupd->SetFilter(f1); 290 mccal->SetFilter(f1); 291 trcal->SetFilter(f1); 292 //fill09->SetFilter(f1); 293 294 // Data 295 nanal->SetFilter(f2); 296 297 // TaskList 298 tlist->AddToList(f1); 299 tlist->AddToList(f2); 300 tlist->AddToList(pcopy); 301 tlist->AddToList(pdnsb); 302 303 tlist->AddToList(extra); 304 tlist->AddToList(mcupd); 305 tlist->AddToList(mccal); 306 307 308 tlist->AddToList(nanal); 309 } 310 else 311 { 312 MCalibrate* calib = new MCalibrate; 313 tlist->AddToList(calib); 303 if (!pcam || !ccam) 304 { 305 MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5); 306 MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5); 307 f1->SetName("MFMonteCarlo"); 308 f2->SetName("MFRealData"); 309 310 MMcPedestalCopy *pcopy = new MMcPedestalCopy; 311 MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd; 312 313 MExtractSignal* extra = new MExtractSignal(); 314 extra->SetRange(0, 14, 0, 14); 315 extra->SetSaturationLimit(240); 316 317 MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate; 318 mcupd->SetOuterPixelsGainScaling(kFALSE); 319 320 MCalibrate* mccal = new MCalibrate; 321 mccal->SetCalibrationMode(MCalibrate::kFfactor); 322 323 // MC 324 extra->SetFilter(f1); 325 mcupd->SetFilter(f1); 326 mccal->SetFilter(f1); 327 trcal->SetFilter(f1); 328 //fill09->SetFilter(f1); 329 330 // Data 331 nanal->SetFilter(f2); 332 333 // TaskList 334 tlist->AddToList(f1); 335 tlist->AddToList(f2); 336 tlist->AddToList(pcopy); 337 tlist->AddToList(pdnsb); 338 339 tlist->AddToList(extra); 340 tlist->AddToList(mcupd); 341 tlist->AddToList(mccal); 342 343 344 tlist->AddToList(nanal); 345 } 346 else 347 { 348 MCalibrate* calib = new MCalibrate; 349 tlist->AddToList(calib); 350 } 314 351 } 315 352 … … 326 363 tlist->AddToList(fill10); 327 364 328 if ( !pcam || !ccam)365 if ((!pcam || !ccam) && type==2) 329 366 { 330 367 MArrivalTimeCalc *tcalc = new MArrivalTimeCalc; … … 337 374 tlist->AddToList(trcal); 338 375 tlist->AddToList(fill09); 376 } 377 378 if (type==1) 379 { 380 MFillH *fill08 = new MFillH(evt08, "MArrivalTime", "MFillH8"); 381 tlist->AddToList(fill08); 339 382 } 340 383 -
trunk/MagicSoft/Mars/mmain/MEventDisplay.h
r3503 r4714 44 44 void ReadinEvent(Int_t dir=0); 45 45 46 Int_t GetFileType(const char *tree, const char *fname) const; 47 46 48 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); 47 49 -
trunk/MagicSoft/Mars/msignal/MArrivalTime.h
r4577 r4714 41 41 42 42 Double_t operator[](int i) { return fData[i]; } 43 Double_t operator()(int i) { return fDataErr[i]; } 43 44 // Do not do such things! It is highly dangerous to use two very similar operators 45 // to do completely different things! People won't recognize it... 46 //Double_t operator()(int i) { return fDataErr[i]; } 44 47 45 48 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 46 49 void DrawPixelContent(Int_t num) const; 47 50 48 ClassDef(MArrivalTime, 0) // class for an event containing the arrival times51 ClassDef(MArrivalTime, 1) // class for an event containing the arrival times 49 52 }; 50 53
Note:
See TracChangeset
for help on using the changeset viewer.