- Timestamp:
- 11/03/03 17:06:29 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2455 r2456 1 1 -*-*- END OF LINE -*-*- 2 2 2003/11/03: Thomas Bretz 3 3 4 4 * manalysis/MMcPedestalCopy.[h,cc], manalysis/MMcPedestalNSBAdd.[h,cc]: … … 26 26 - added comments to the data members 27 27 28 29 30 2003/10/31: Marcos Lopez 28 * mars.cc: 29 - added code for a possible use of a TGApplication 30 (in comments) 31 32 * merpp.cc, readraw.cc: 33 - unified with the other executables (StartUpMessage, etc) 34 - removed TROOT-object 35 - readraw.cc: added more functionality 36 37 38 39 2003/10/31: Marcos Lopez 31 40 32 41 * mhist/MFillH.cc: … … 51 60 52 61 53 62 2003/10/31: Thomas Bretz 54 63 55 64 * mars.cc: … … 60 69 61 70 62 71 2003/10/30: Antonio Stamerra 63 72 64 73 * manalysis/MMcTriggerLvl2.[h,cc] … … 73 82 74 83 75 84 2003/10/30: Thomas Bretz 76 85 77 86 * manalysis/MCerPhotEvt.[h,cc]: … … 90 99 91 100 92 101 2003/10/29: Thomas Bretz 93 102 94 103 * manalysis/AnalysisLinkDef.h, manalysis/Makefile: … … 118 127 119 128 120 129 2003/10/28: Thomas Bretz 121 130 122 131 * macros/readCT1.C: … … 159 168 160 169 161 170 2003/10/28: Wolfgang Wittek 162 171 163 172 * manalysis/MCT1PadONOFF.cc … … 175 184 176 185 177 186 2003/10/26: Oscar Blanch Bigas 178 187 179 188 * mmc/MMcFadcHeader.[cc,h] … … 184 193 185 194 186 195 2003/10/24: Abelardo Moralejo 187 196 188 197 * manalysis/MMcPedestalRead.[cc,h] … … 197 206 198 207 199 208 2003/10/23: Abelardo Moralejo 200 209 201 210 * mhistmc/MHMcEnergyMigration.cc … … 207 216 208 217 209 218 2003/10/23: Thomas Bretz 210 219 211 220 * macros/star.C: … … 217 226 218 227 219 228 2003/10/22: Thomas Bretz 220 229 221 230 * mars.cc: … … 232 241 233 242 234 243 2003/10/21: Wolfgang Wittek 235 244 236 245 * manalysis/MMatrixLoop.[h,cc] … … 242 251 243 252 244 253 2003/10/20: Thomas Bretz 245 254 246 255 * mraw/MRawEvtPixelIter.[h,cc]: … … 331 340 332 341 333 342 2003/10/17: Oscar Blanch 334 343 335 344 * mmc/MMcFadcHeader.[cxx,hxx]: … … 348 357 349 358 350 359 2003/10/15: Thomas Bretz 351 360 352 361 * Makefile.conf.general: … … 402 411 403 412 404 413 2003/10/05: Abelardo Moralejo 405 414 406 415 * macros/star.C: … … 410 419 411 420 412 421 2003/10/04: Thomas Bretz 413 422 414 423 * macros/MagicHillas.C, macros/pedestalvstime.C, macros/pixfirerate.C, … … 456 465 457 466 458 467 2003/10/02: Thomas Bretz 459 468 460 469 * mraw/MRawEvtData.cc: … … 463 472 464 473 465 474 2003/10/01: Nicola Galante 466 475 467 476 * mhistmc/MHMcTriggerLvl2.[h,cc]: … … 478 487 479 488 480 489 2003/09/30: Robert Wagner 481 490 482 491 * mfileio/MCT1ReadPreProc.cc … … 486 495 487 496 488 497 2003/09/29: Nicola Galante & Antonio Stamerra 489 498 490 499 * mmc/MMcTrig.cxx: -
trunk/MagicSoft/Mars/mars.cc
r2447 r2456 1 #include <TROOT.h>2 1 #include <TApplication.h> 3 2 … … 16 15 17 16 using namespace std; 17 /* 18 #if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02) 19 #include <TRootGuiFactory.h> 20 #include <TPluginManager.h> 21 void InitGuiFactory() 22 { 23 if (gROOT->IsBatch()) 24 gROOT->SetBatch(kFALSE); 25 26 // 27 // Must be loaded by hand, because it is not loaded by TGApplication. 28 // We could also use TApplication instead, but TApplication doesn't 29 // deal with the DISPLAY variable in a convient way. 30 // 31 TPluginHandler *h; 32 if ((h = gROOT->GetPluginManager()->FindHandler("TGuiFactory", "root"))) 33 { 34 if (h->LoadPlugin() == -1) 35 return; 36 gGuiFactory = (TGuiFactory*)h->ExecPlugin(0); 37 } 38 } 39 #endif 40 */ 18 41 19 42 // ********************************************************************** … … 42 65 static void Usage() 43 66 { 67 gLog << all << endl; 44 68 gLog << "Sorry the usage is:" << endl; 45 69 gLog << " mars [-v#]" << endl << endl; … … 58 82 59 83 StartUpMessage(); 60 61 TApplication app("MarsApp", &argc, argv);62 if (gROOT->IsBatch() || !gClient)63 {64 gLog << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;65 return 1;66 }67 /*68 TGApplication app("MarsApp", &argc, argv);69 if (gROOT->IsBatch())70 gROOT->SetBatch(kFALSE);71 */72 84 73 85 // … … 111 123 112 124 // 125 // initialise ROOT 126 // 127 TApplication app("Mars", &argc, argv); 128 if (gROOT->IsBatch() || !gClient) 129 { 130 gLog << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl; 131 return 1; 132 } 133 134 // 113 135 // Swtich of TObjectStreamer in our base classes derived from TObject 114 136 // 115 137 MArray::Class()->IgnoreTObjectStreamer(); 116 138 MParContainer::Class()->IgnoreTObjectStreamer(); 139 140 /* 141 TGApplication app("Mars", &argc, argv); 142 143 #if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02) 144 InitGuiFactory(); 145 #endif 146 */ 117 147 118 148 #ifdef HAVE_XPM -
trunk/MagicSoft/Mars/merpp.cc
r2299 r2456 36 36 ////////////////////////////////////////////////////////////////////////////// 37 37 38 void Usage()38 static void StartUpMessage() 39 39 { 40 gLog << all << endl; 41 42 // 1 2 3 4 5 43 // 12345678901234567890123456789012345678901234567890 44 gLog << "==================================================" << endl; 45 gLog << " MERPP - MARS V" << MARSVER << endl; 46 gLog << " MARS - Merging and Preprocessing Program" << endl; 47 gLog << " Compiled on <" << __DATE__ << ">" << endl; 48 gLog << " Using ROOT v" << ROOTVER << endl; 49 gLog << "==================================================" << endl; 50 gLog << endl; 51 } 52 53 static void Usage() 54 { 55 gLog << all << endl; 40 56 gLog << "Sorry the usage is:" << endl; 41 57 gLog << " merpp [-a0] [-vn] [-cn] inputfile[.raw] [outputfile[.root]]" << endl << endl; … … 43 59 gLog << " ouput file: Merpped root file." << endl; 44 60 gLog << " -a0: Do not use Ansii codes." << endl; 45 gLog << " -cn: Compression level n=1..9 [default= 1]" << endl;61 gLog << " -cn: Compression level n=1..9 [default=2]" << endl; 46 62 gLog << " -vn: Verbosity level n [default=2]" << endl << endl; 47 63 } … … 49 65 int main(const int argc, const char **argv) 50 66 { 67 StartUpMessage(); 68 69 // 70 // Evaluate arguments 71 // 51 72 MArgs arg(argc, argv); 52 53 gLog << "==================================================" << endl ;54 gLog << " MERPP v0.1" << endl;55 gLog << " MARS Merging and Preprocessing Program" << endl ;56 gLog << " Compiled on <" << __DATE__ << ">" << endl ;57 gLog << " Using ROOT v" << ROOTVER << endl ;58 gLog << "==================================================" << endl ;59 gLog << endl;60 73 61 74 // … … 84 97 TString kNameout = arg.GetArgumentStr(1); 85 98 86 //87 // initialize ROOT (this is obligatory here)88 //89 TROOT merpp("merpp", "Mars - Merging and Preprocessing Program");90 merpp.SetBatch();91 92 99 if (!kNamein.EndsWith(".raw")) 93 100 kNamein += ".raw"; … … 98 105 if (!kNameout.EndsWith(".root")) 99 106 kNameout += ".root"; 107 108 // 109 // Initialize Non-GUI (batch) mode 110 // 111 gROOT->SetBatch(); 100 112 101 113 // -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r2438 r2456 184 184 if (manip) 185 185 *fLog << ' '; 186 *fLog << flush;187 186 } 187 *fLog << flush; 188 188 189 189 if (!(l<nLoPix && (*fLoGainPixId)[l]==(*fHiGainPixId)[i])) … … 199 199 if (manip) 200 200 *fLog << ' '; 201 *fLog << flush;202 201 } 202 203 *fLog << flush; 203 204 l++; 204 205 } -
trunk/MagicSoft/Mars/readraw.cc
r2173 r2456 10 10 11 11 #include "MLog.h" 12 #include "MLogManip.h" 13 14 #include "MArgs.h" 12 15 #include "MTime.h" 13 16 #include "MRawRunHeader.h" … … 25 28 // 26 29 // This is an demonstration how to read in a merpped root file 30 // This is a demonstration how to use root, not how you should 31 // read a merpped file! 27 32 // 28 33 ///////////////////////////////////////////////////////////////////////////// 29 34 35 static void StartUpMessage() 36 { 37 gLog << all << endl; 38 39 // 1 2 3 4 5 40 // 12345678901234567890123456789012345678901234567890 41 gLog << "==================================================" << endl; 42 gLog << " ReadRaw - MARS V" << MARSVER << endl; 43 gLog << " MARS - Read and print raw data files" << endl; 44 gLog << " Compiled on <" << __DATE__ << ">" << endl; 45 gLog << " Using ROOT v" << ROOTVER << endl; 46 gLog << "==================================================" << endl; 47 gLog << endl; 48 } 49 50 static void Usage() 51 { 52 gLog << all << endl; 53 gLog << "Sorry the usage is:" << endl; 54 gLog << " readraw [-vn] [-dec] [-a0] inputfile[.root]" << endl << endl; 55 gLog << " input file: Magic DAQ binary file." << endl; 56 gLog << " -a0: Do not use Ansii codes." << endl; 57 gLog << " -vn: Verbosity level n [default=2]" << endl; 58 gLog << " -d1: print data in decimal values" << endl; 59 } 60 30 61 void EnableBranch(TTree *t, TString name, void *ptr) 31 62 { … … 37 68 } 38 69 39 int main(const int argc, const char **argv) 40 { 41 gLog << "==================================================" << endl; 42 gLog << " ReadRaw v0.1 " << endl; 43 gLog << " MARS - Read and print raw data file " << endl; 44 gLog << " Compiled on <" << __DATE__ << ">" << endl; 45 gLog << "==================================================" << endl; 46 gLog << endl; 70 int main(int argc, const char **argv) 71 { 72 StartUpMessage(); 73 74 // 75 // Evaluate arguments 76 // 77 MArgs arg(argc, argv); 78 79 // 80 // Set verbosity to highest level. 81 // 82 gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2); 83 84 if (arg.HasOption("-a") && arg.GetIntAndRemove("-a")==0) 85 gLog.SetNoColors(); 86 87 const bool kDecimal = arg.HasOption("-d") && arg.GetIntAndRemove("-d")==1; 47 88 48 89 // 49 90 // check for the right usage of the program 50 91 // 51 if (argc!=2) 52 { 53 gLog << "Sorry the usage is:" << endl; 54 gLog << " readraw inputfile" << endl << endl; 92 if (arg.GetNumArguments()!=1) 93 { 94 Usage(); 55 95 return -1; 56 96 } 57 97 58 98 // 59 // initialize ROOT (this is obligatory here) 60 // 61 TROOT simple("readraw","Mars - Read and print raw data file"); 99 // This is to make argv[i] more readable insidethe code 100 // 101 TString kNamein = arg.GetArgumentStr(0); 102 103 if (!kNamein.EndsWith(".root")) 104 kNamein += ".root"; 105 106 // 107 // Initialize Non-GUI (batch) mode 108 // 109 gROOT->SetBatch(); 62 110 63 111 // 64 112 // check whether the given files are OK. 65 113 // 66 if (gSystem->AccessPathName( argv[1], kFileExists))67 { 68 gLog << "Sorry, the file '" << argv[1]<< "' doesn't exist." << endl;114 if (gSystem->AccessPathName(kNamein, kFileExists)) 115 { 116 gLog << err << "Sorry, the input file '" << kNamein << "' doesn't exist." << endl; 69 117 return -1; 70 118 } … … 73 121 // open the file 74 122 // 75 gLog << " Open the file '" << argv[1]<< "'" << endl;76 TFile input( argv[1], "READ");123 gLog << " Open the file '" << kNamein << "'" << endl; 124 TFile input(kNamein, "READ"); 77 125 78 126 // … … 127 175 // loop over all entries 128 176 // 129 Int_t nent = (Int_t)evttree->GetEntries();177 const Int_t nent = (Int_t)evttree->GetEntries(); 130 178 131 179 gLog << endl; … … 153 201 evtcrate->Print(); 154 202 if (evtdata) 155 evtdata->Print(); 203 evtdata->Print(kDecimal?"dec":"hex"); 204 205 gLog << endl; 156 206 } 157 207 158 // end of small readin program208 // end of small readin program 159 209 160 210 return 0; 161 211 } 162 163
Note:
See TracChangeset
for help on using the changeset viewer.