Changeset 2521
- Timestamp:
- 11/17/03 22:26:16 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2519 r2521 12 12 * mbase/MStatusDisplay.cc: 13 13 - removed ==13 using TryLock() (this was wrong) 14 15 * mreport/* 16 - added 17 18 * macros/readrep.C: 19 - added 14 20 15 21 -
trunk/MagicSoft/Mars/NEWS
r2519 r2521 5 5 multi-telescope files which can be produced with the coming 6 6 camera version 0.7. 7 8 - added classes to read and interprete central control report files 9 (Directory: mreport, Base-Class: MReport, Reader: MReportFileRead, ...) 7 10 8 11 -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r2328 r2521 77 77 // floor(x) round down to the nearest integer (floor(9.9)=9) 78 78 // ceil(x) round up to the nearest integer (floor(9.1)=10) 79 // round(x) round to the nearest integer 79 80 // r2d(x) transform radians to degrees 80 81 // d2r(x) transform degrees to radians … … 565 566 case kEFloor: return TMath::Floor(val); 566 567 case kECeil: return TMath::Ceil(val); 568 case kERound: return TMath::Nint(val); 567 569 case kERad2Deg: return val*180/TMath::Pi(); 568 570 case kEDeg2Rad: return val*TMath::Pi()/180; … … 664 666 case kEFloor: str += "floor" ; break; 665 667 case kECeil: str += "ceil" ; break; 668 case kERound: str += "round" ; break; 666 669 case kERad2Deg: str += "r2d" ; break; 667 670 case kEDeg2Rad: str += "d2r" ; break; -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r2328 r2521 31 31 kEPositive, 32 32 kENegative, 33 kEFloor, kECeil, 33 kEFloor, kECeil, kERound, 34 34 kERad2Deg, kEDeg2Rad, kERandom, 35 35 kERandomP, kERandomE, kERandomI, kERandomG, kERandomL, -
trunk/MagicSoft/Mars/merpp.cc
r2456 r2521 55 55 gLog << all << endl; 56 56 gLog << "Sorry the usage is:" << endl; 57 gLog << " merpp [- a0] [-vn] [-cn] inputfile[.raw] [outputfile[.root]]" << endl << endl;57 gLog << " merpp [-h] [-?] [-a0] [-vn] [-cn] inputfile[.raw] [outputfile[.root]]" << endl << endl; 58 58 gLog << " input file: Magic DAQ binary file." << endl; 59 59 gLog << " ouput file: Merpped root file." << endl; 60 60 gLog << " -a0: Do not use Ansii codes." << endl; 61 61 gLog << " -cn: Compression level n=1..9 [default=2]" << endl; 62 gLog << " -vn: Verbosity level n [default=2]" << endl << endl; 62 gLog << " -vn: Verbosity level n [default=2]" << endl; 63 gLog << " -?/-h: This help" << endl << endl; 63 64 } 64 65 … … 71 72 // 72 73 MArgs arg(argc, argv); 74 75 if (arg.HasOption("-?") || arg.HasOption("-h")) 76 { 77 Usage(); 78 return -1; 79 } 73 80 74 81 // -
trunk/MagicSoft/Mars/mfilter/FilterLinkDef.h
r2510 r2521 17 17 #pragma link C++ class MFDataChain+; 18 18 #pragma link C++ class MFDataMember+; 19 #pragma link C++ class MFRealTimePeriod+; 19 20 20 21 #pragma link C++ class MFCT1SelBasic+; -
trunk/MagicSoft/Mars/mfilter/Makefile
r2510 r2521 43 43 MFGeomag.cc \ 44 44 MFParticleId.cc \ 45 MFRealTimePeriod.cc \ 45 46 MFAlpha.cc \ 46 47 MFCT1SelBasic.cc \ -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r2463 r2521 35 35 void CalcNumSectors(); 36 36 void InitOuterRing(); 37 void InitGeometry() 38 { 39 CalcNumSectors(); 40 CalcMaxRadius(); 41 CalcPixRatio(); 42 InitOuterRing(); 43 } 44 37 45 38 46 public: … … 60 68 61 69 #endif 62 -
trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc
r2463 r2521 56 56 CreateCam(); 57 57 CreateNN(); 58 CalcNumSectors(); 59 CalcMaxRadius(); 60 CalcPixRatio(); 58 InitGeometry(); 61 59 } 62 60 … … 200 198 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2], 201 199 nn[i][3], nn[i][4], nn[i][5]); 202 203 InitOuterRing();204 200 } 205 201 -
trunk/MagicSoft/Mars/mgeom/MGeomCamCT1Daniel.cc
r2463 r2521 60 60 CreateCam(); 61 61 CreateNN(); 62 CalcNumSectors(); 63 CalcMaxRadius(); 64 CalcPixRatio(); 62 InitGeometry(); 65 63 } 66 64 … … 204 202 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2], 205 203 nn[i][3], nn[i][4], nn[i][5]); 206 207 InitOuterRing();208 204 } 209 205 -
trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc
r2463 r2521 52 52 CreateCam(); 53 53 CreateNN(); 54 CalcNumSectors(); 55 CalcMaxRadius(); 56 CalcPixRatio(); 54 InitGeometry(); 57 55 } 58 56 … … 895 893 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2], 896 894 nn[i][3], nn[i][4], nn[i][5]); 897 898 InitOuterRing();899 895 } -
trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc
r2463 r2521 56 56 CreateCam(); 57 57 CreateNN(); 58 CalcNumSectors(); 59 CalcMaxRadius(); 60 CalcPixRatio(); 58 InitGeometry(); 61 59 } 62 60 … … 3403 3401 { 2285, 2286, 2398, 2400, -1, -1}, 3404 3402 { 2286, 2399, -1, -1, -1, -1} // 2400 3405 3403 }; 3406 3404 3407 3405 for (Int_t i=0; i<2401; i++) 3408 3406 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2], 3409 3407 nn[i][3], nn[i][4], nn[i][5]); 3410 3411 InitOuterRing();3412 3408 } -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc
r2463 r2521 48 48 CreateCam(); 49 49 CreateNN(); 50 CalcPixRatio(); 51 CalcNumSectors(); 52 CalcMaxRadius(); 53 CalcPixRatio(); 50 InitGeometry(); 54 51 } 55 52 … … 925 922 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2], 926 923 nn[i][3], nn[i][4], nn[i][5]); 927 928 InitOuterRing();929 924 } -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagic919.cc
r2463 r2521 49 49 CreateCam(); 50 50 CreateNN(); 51 CalcMaxRadius(); 52 CalcPixRatio(); 51 InitGeometry(); 53 52 } 54 53 … … 1362 1361 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2], 1363 1362 nn[i][3], nn[i][4], nn[i][5]); 1364 1365 InitOuterRing();1366 1363 } -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagicHG.cc
r2463 r2521 48 48 CreateCam(); 49 49 CreateNN(); 50 CalcNumSectors(); 51 CalcMaxRadius(); 52 CalcPixRatio(); 50 InitGeometry(); 53 51 } 54 52 … … 3397 3395 (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2], 3398 3396 nn[i][3], nn[i][4], nn[i][5]); 3399 3400 InitOuterRing();3401 3397 } -
trunk/MagicSoft/Mars/mgeom/MGeomCorsikaCT.cc
r2463 r2521 64 64 fCTdiam=ctdiam; 65 65 fCTfocal=ctfocal; 66 67 66 } -
trunk/MagicSoft/Mars/mgeom/MGeomMirror.cc
r2394 r2521 103 103 } 104 104 105 void MGeomMirror::SetMirrorDeviations(Float_t dev_x, Float_t dev_y){ 105 void MGeomMirror::SetMirrorDeviations(Float_t dev_x, Float_t dev_y) 106 { 106 107 fDeviationX=dev_x; // deviation in x [cm] 107 108 fDeviationY=dev_y; // deviation in y [cm] … … 127 128 fReflectivity = ref; 128 129 } 129 130 131 132 133 134 135 136 -
trunk/MagicSoft/Mars/mgeom/MGeomPMT.cc
r2173 r2521 69 69 fQE = qe; 70 70 } 71 72 73 74 75 -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r2512 r2521 60 60 #include "MReadMarsFile.h" // MReadMarsFile 61 61 #include "MGeomApply.h" // MGeomApply 62 #include "MFDataMember.h" // MFDataMember 62 63 #include "MMcPedestalCopy.h" // MMcPedestalCopy 63 64 #include "MMcPedestalNSBAdd.h" // MMcPedestalNSBAdd 64 65 #include "MCerPhotCalc.h" // MCerPhotCalc 66 #include "MCerPhotAnal2.h" // MCerPhotAnal2 65 67 #include "MImgCleanStd.h" // MImgCleanStd 66 68 #include "MHillasCalc.h" // MHillasCalc … … 182 184 MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd; 183 185 MCerPhotCalc *ncalc = new MCerPhotCalc; 186 MCerPhotAnal2 *nanal = new MCerPhotAnal2; 184 187 MFillH *fill1 = new MFillH(evt1, "MCerPhotEvt", "MFillH1"); 185 188 MImgCleanStd *clean = new MImgCleanStd; … … 193 196 MHillasSrcCalc *scalc = new MHillasSrcCalc; 194 197 198 MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5); 199 MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5); 200 201 ncalc->SetFilter(f1); 202 nanal->SetFilter(f2); 203 204 tlist->AddToList(f1); 205 tlist->AddToList(f2); 195 206 tlist->AddToList(pcopy); 196 207 tlist->AddToList(pdnsb); 197 208 tlist->AddToList(ncalc); 209 tlist->AddToList(nanal); 198 210 tlist->AddToList(fill1); 199 211 tlist->AddToList(clean); -
trunk/MagicSoft/Mars/mmain/Makefile
r2506 r2521 24 24 INCLUDES = -I. -I../mbase -I../manalysis -I../mdatacheck -I../mraw \ 25 25 -I../mgui -I../mgeom -I../mhist -I../mmontecarlo -I../mfileio \ 26 -I../mimage -I../mhistmc -I../mgbase 26 -I../mimage -I../mhistmc -I../mgbase -I../mfilter -I../mdata 27 27 28 28 #------------------------------------------------------------------------------ -
trunk/MagicSoft/Mars/mona.cc
r2497 r2521 15 15 #include "MFillH.h" 16 16 #include "MFRealTimePeriod.h" 17 #include "MOnlineDump2.h"18 17 #include "MHTriggerLvl0.h" 19 18 #include "MHCamera.h" // ::Class() … … 24 23 #include "MHillasCalc.h" 25 24 #include "MHillasSrcCalc.h" 25 26 #include "MArgs.h" 27 28 // -------------------------------------------------------------------- 29 30 #include "MTime.h" 31 #include "MRawEvtHeader.h" // MRawEvtHeader 32 #include "MRawRunHeader.h" // MRawRunHeader 33 34 class MOnlineDump : public MTask 35 { 36 private: 37 MFillH *fFill1; 38 MFillH *fFill2; 39 MFillH *fFill3; 40 MFRealTimePeriod *fFilter; 41 42 UInt_t fRunNumber; 43 UInt_t fEvtNumber; 44 45 MRawEvtHeader *fRawEvtHeader; 46 MRawRunHeader *fRawRunHeader; 47 48 MTime *fEvtTime; 49 Double_t fTime; 50 51 void SetNoContextMenu(TObject *c) 52 { 53 if (fDisplay->HasCanvas((TCanvas*)c)) 54 c->ResetBit(kNoContextMenu); 55 } 56 void DisplayTriggerRate() 57 { 58 if (*fEvtTime==0) 59 fEvtTime->SetTime(gSystem->Now()); 60 61 if (fEvtNumber==0 || fRawRunHeader->GetRunNumber()!=fRunNumber) 62 { 63 fEvtNumber = fRawEvtHeader->GetDAQEvtNumber(); 64 fRunNumber = fRawRunHeader->GetRunNumber(); 65 fTime = *fEvtTime; 66 return; 67 } 68 69 const UInt_t evts = fRawEvtHeader->GetDAQEvtNumber() - fEvtNumber; 70 const Double_t sec = *fEvtTime-fTime; 71 72 if (evts>0 && sec>0 && fDisplay) 73 fDisplay->SetStatusLine2(Form("Trigger Rate: %.1fHz", evts/sec)); 74 } 75 76 public: 77 MOnlineDump() { fName = "MOnlineDump"; } 78 Int_t PreProcess(MParList *pList) 79 { 80 if (gROOT->IsBatch()) 81 { 82 *fLog << err << "We are in batch mode!" << endl; 83 return kFALSE; 84 } 85 if (!fDisplay) 86 { 87 *fLog << err << "fDisplay not set." << endl; 88 return kFALSE; 89 } 90 91 MTaskList *tasks = (MTaskList*)pList->FindObject("MTaskList"); 92 if (!tasks) 93 { 94 *fLog << err << "MTaskList not found... abort." << endl; 95 return kFALSE; 96 } 97 98 fFill1 = (MFillH*)tasks->FindObject("MFillCamEvent"); 99 if (!fFill1) 100 { 101 *fLog << err << "MFillCamEvent not found... abort." << endl; 102 return kFALSE; 103 } 104 fFill2 = (MFillH*)tasks->FindObject("MFillEvent"); 105 if (!fFill2) 106 { 107 *fLog << err << "MFillEvent not found... abort." << endl; 108 return kFALSE; 109 } 110 fFill3 = (MFillH*)tasks->FindObject("MFillTriggerLvl0"); 111 if (!fFill3) 112 { 113 *fLog << err << "MFillTriggerLvl0 not found... abort." << endl; 114 return kFALSE; 115 } 116 fRawEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader"); 117 if (!fRawEvtHeader) 118 { 119 *fLog << err << "MRawEvtHeader not found... abort." << endl; 120 return kFALSE; 121 } 122 123 fRawRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 124 if (!fRawRunHeader) 125 { 126 *fLog << err << "MRawRunHeader not found... abort." << endl; 127 return kFALSE;; 128 } 129 130 fEvtTime = (MTime*)pList->FindObject("MRawEvtTime"); 131 if (!fEvtTime) 132 { 133 *fLog << err << "MRawEvtTime not found... abort." << endl; 134 return kFALSE; 135 } 136 137 fRunNumber = 0xffffffff; 138 fEvtNumber = 0; 139 140 SetNoContextMenu((TObject*)fFill1->GetCanvas()); 141 SetNoContextMenu((TObject*)fFill2->GetCanvas()); 142 SetNoContextMenu((TObject*)fFill3->GetCanvas()); 143 144 return kTRUE; 145 } 146 Int_t Process() 147 { 148 DisplayTriggerRate(); 149 150 if (fDisplay) 151 fDisplay->SetProgressBarPosition((Float_t)fEvtNumber/fRawRunHeader->GetNumEvents()); 152 153 return kTRUE; 154 } 155 Int_t PostProcess() 156 { 157 if (fDisplay) 158 fDisplay->SetProgressBarPosition(1); 159 160 return kTRUE; 161 } 162 // ClassDef(MOnlineDump, 0) // Task to fill a histogram with data from a parameter container 163 }; 164 //ClassImp(MOnlineDump); 165 // -------------------------------------------------------------------- 26 166 27 167 void StartUpMessage() … … 73 213 } 74 214 75 Bool_t Loop(MStatusDisplay *display )215 Bool_t Loop(MStatusDisplay *display, Int_t port) 76 216 { 77 217 // … … 81 221 // 82 222 MRawSocketRead reader; 83 reader.SetPort( 7000);223 reader.SetPort(port); 84 224 85 225 // … … 112 252 tasks.AddToList(&fill3); 113 253 114 MOnlineDump 2dump;254 MOnlineDump dump; 115 255 dump.SetFilter(&filter); 116 256 tasks.AddToList(&dump); … … 151 291 void *thread(void *ptr) 152 292 { 293 const Int_t port = *(Int_t*)ptr; 294 153 295 MStatusDisplay d; 154 296 d.Resize(740, 600); … … 159 301 // 160 302 while (d.CheckStatus()!=MStatusDisplay::kFileExit) 161 Loop(&d );303 Loop(&d, port); 162 304 163 305 gLog << dbg << "Exit System Loop... " << flush; … … 194 336 */ 195 337 338 static void Usage() 339 { 340 gLog << all << endl; 341 gLog << "Sorry the usage is:" << endl; 342 gLog << " mona [-?] [-h] [-a0] [-h] [-pn] [-vn]" << endl << endl; 343 gLog << " -a0: Do not use Ansii codes." << endl; 344 gLog << " -pn: TCP/IP port n [default=7000]" << endl; 345 gLog << " -vn: Verbosity level n [default=2]" << endl << endl; 346 gLog << " -?/-h: This help" << endl << endl; 347 } 348 349 196 350 int main(int argc, char **argv) 197 351 { 198 352 StartUpMessage(); 353 354 // 355 // Evaluate arguments 356 // 357 MArgs arg(argc, (const char**)argv); 358 359 if (arg.HasOption("-?") || arg.HasOption("-h")) 360 { 361 Usage(); 362 return -1; 363 } 364 365 // 366 // Set verbosity to highest level. 367 // 368 gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2); 369 370 if (arg.HasOption("-a") && arg.GetIntAndRemove("-a")==0) 371 gLog.SetNoColors(); 372 373 const Int_t port = arg.HasOption("-p") ? arg.GetIntAndRemove("-p") : 7000; 374 375 // 376 // check for the right usage of the program 377 // 378 if (arg.GetNumArguments()>0) 379 { 380 Usage(); 381 return -1; 382 } 199 383 200 384 TApplication app("Mars", &argc, argv); … … 204 388 return 1; 205 389 } 390 206 391 /* 207 392 TGApplication app("Mona", &argc, argv); … … 219 404 // 220 405 gLog << dbg << "Starting Thread..." << endl; 221 TThread t(thread );406 TThread t(thread, (void*)&port); 222 407 t.Run(); 223 408 -
trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
r2299 r2521 242 242 Int_t MRawFileRead::PostProcess() 243 243 { 244 fIn->close(); 245 244 246 // 245 247 // Sanity check for the number of events -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r2386 r2521 23 23 const UShort_t kMagicNumber = 0xc0c0; 24 24 25 // 26 // enum for the Run Type. Monte Carlo Runs have 27 // to have a value greater than 255 (>0xff) 28 // 25 29 enum { 26 30 kRTData = 0, -
trunk/MagicSoft/Mars/mraw/RawIncl.h
r454 r2521 1 1 #ifndef __CINT__ 2 2 3 #include "MTime.h"4 3 #include "MArrayB.h" 5 4 #include "MArrayS.h" 6 #include "MParList.h"7 8 #include <TClonesArray.h>9 5 10 6 #endif // __CINT__ -
trunk/MagicSoft/Mars/readraw.cc
r2456 r2521 52 52 gLog << all << endl; 53 53 gLog << "Sorry the usage is:" << endl; 54 gLog << " readraw [- vn] [-dec] [-a0] inputfile[.root]" << endl << endl;54 gLog << " readraw [-h] [-?] [-vn] [-dec] [-a0] inputfile[.root]" << endl << endl; 55 55 gLog << " input file: Magic DAQ binary file." << endl; 56 56 gLog << " -a0: Do not use Ansii codes." << endl; 57 57 gLog << " -vn: Verbosity level n [default=2]" << endl; 58 58 gLog << " -d1: print data in decimal values" << endl; 59 gLog << " -?/-h: This help" << endl << endl; 59 60 } 60 61 … … 76 77 // 77 78 MArgs arg(argc, argv); 79 80 if (arg.HasOption("-?") || arg.HasOption("-h")) 81 { 82 Usage(); 83 return -1; 84 } 78 85 79 86 // -
trunk/MagicSoft/Mars/status.cc
r2506 r2521 53 53 #include "MFillH.h" 54 54 #include "MEvtLoop.h" 55 #include "MFDataMember.h" 55 56 56 57 #include <TApplication.h> … … 80 81 gLog << " input file: Mars root file." << endl; 81 82 gLog << " -a0: Do not use Ansii codes." << endl; 82 gLog << " -vn: Verbosity level n [default=2]" << endl << endl; 83 gLog << " -vn: Verbosity level n [default=2]" << endl; 84 gLog << " -?/-h: This help" << endl << endl; 83 85 } 84 86 … … 92 94 // 93 95 MArgs arg(argc, (const char**)argv); 96 97 if (arg.HasOption("-?") || arg.HasOption("-h")) 98 { 99 Usage(); 100 return -1; 101 } 94 102 95 103 // … … 181 189 MMcPedestalNSBAdd pnsb; 182 190 MCerPhotCalc ncalc; 183 // MCerPhotAnal2 ncalc; 191 MCerPhotAnal2 nanal; 192 193 MFDataMember f1("MRawRunHeader.fRunType", '>', 255.5); 194 MFDataMember f2("MRawRunHeader.fRunType", '<', 255.5); 195 196 ncalc.SetFilter(&f1); 197 nanal.SetFilter(&f2); 184 198 /* 185 199 TArrayS blinds(6); … … 230 244 231 245 tlist.AddToList(&read); 246 tlist.AddToList(&f1); 247 tlist.AddToList(&f2); 232 248 tlist.AddToList(&geomapl); 233 249 tlist.AddToList(&pcopy); 234 250 tlist.AddToList(&pnsb); 235 251 tlist.AddToList(&ncalc); 252 tlist.AddToList(&nanal); 236 253 //tlist.AddToList(&blind); 237 254 tlist.AddToList(&hfill0);
Note:
See TracChangeset
for help on using the changeset viewer.