Changeset 1172
- Timestamp:
- 01/14/02 17:34:02 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1171 r1172 1 1 -*-*- END -*-*- 2 2002/01/14: Thomas Bretz 3 4 * manalysis/MMcPedestalCopy.cc, manalysis/MMcPedestalNSBAdd.cc: 5 - added comments 6 7 * mbase/MReadMarsFile.cc: 8 - changed output when switching to new file 9 10 * meventdisp/MGFadcDisp.cc: 11 - made char array in constructor const 12 - changed char-array to TString 13 14 * mmain/MBrowser.[h,cc]: 15 - changed char-arrays to TString 16 17 * mmain/MDataCheck.[h,cc]: 18 - made char array in constructor const 19 20 * Makefile.conf.linux, Makefile.conf.linux-gnu: 21 - changed to O5 22 23 * mbase/MEvtLoop.cc: 24 - check for inheritance from MTaskList 25 26 27 2 28 2002/01/11: Oscar Blanch Bigas 3 * m ain/MAnalysis.cc:29 * mmain/MAnalysis.cc: 4 30 - added MBlindPixelCalc step. 5 31 -
trunk/MagicSoft/Mars/Makefile.conf.linux
r1076 r1172 20 20 # ----->>> settings for compilation 21 21 # 22 OPTIM = -O 3-Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual22 OPTIM = -O5 -Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual 23 23 DEBUG = 24 24 ARCHDEF = -D__LINUX__ -
trunk/MagicSoft/Mars/Makefile.conf.linux-gnu
r1076 r1172 20 20 # 21 21 22 OPTIM = -O 3-Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual22 OPTIM = -O5 -Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual 23 23 DEBUG = 24 24 ARCHDEF = -D__LINUX__ -
trunk/MagicSoft/Mars/NEWS
r1154 r1172 21 21 22 22 - Introduced MMcRunHeaders which contains monte carlo run informations 23 24 - Added a 'Print'-Task (MPrint) which calls the Print function 25 of a parameter container for each event 23 26 24 27 -
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
r1131 r1172 26 26 // // 27 27 // MMcPedestalCopy // 28 // // 28 29 // This task looks for the ìnformation about FADC pedestals in // 29 30 // MMcFadcHeader and translates it to the pedestal values in // … … 64 65 } 65 66 67 // -------------------------------------------------------------------------- 68 // 69 // Check for the run type. Return kTRUE if it is a MC run or if there 70 // is no MC run header (old camera files) kFALSE in case of a different 71 // run type 72 // 66 73 Bool_t MMcPedestalCopy::CheckRunType(MParList *pList) const 67 74 { … … 76 83 } 77 84 85 // -------------------------------------------------------------------------- 86 // 87 // Check runtype and search for MPedestalCam and MMcFadcHeader. 88 // If the runtype check fails the task is removed from the task list. 89 // 78 90 Bool_t MMcPedestalCopy::PreProcess(MParList *pList) 79 91 { … … 99 111 } 100 112 113 // -------------------------------------------------------------------------- 114 // 115 // Check for the runtype. (not yet: If the check fails the eventloop is 116 // stopped.) 117 // Initialize the size of MPedestalCam to the number of pixels from 118 // MMcFadcHeader. 119 // 101 120 Bool_t MMcPedestalCopy::ReInit(MParList *pList) 102 121 { -
trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc
r1132 r1172 33 33 // MPedestalCam the NSB contribution. // 34 34 // The number of photons from the diffuse NSB follows a poisson // 35 // distribution with expected mean value X, then its standard de sviation//35 // distribution with expected mean value X, then its standard deviation // 36 36 // is sqrt(X). // 37 37 // X is the number of phe per ns so we have to convert in FADC counts per // … … 85 85 } 86 86 87 // -------------------------------------------------------------------------- 88 // 89 // Check for the run type. Return kTRUE if it is a MC run or if there 90 // is no MC run header (old camera files) kFALSE in case of a different 91 // run type 92 // 87 93 Bool_t MMcPedestalNSBAdd::CheckRunType(MParList *pList) const 88 94 { … … 141 147 142 148 return kTRUE; 149 } 150 151 Float_t MMcPedestalNSBAdd::GetDnsb(MParList *pList) const 152 { 153 MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader"); 154 if (!mcrunheader && fDnsbPixel < 0 ) 155 { 156 *fLog << err << dbginf << "Using the default argument of MMcPedestalNSB::MMcPedestalNSB() "; 157 *fLog << "only allowed if MMcRunHeader is available... aborting." << endl; 158 return -1; 159 } 160 161 if (!mcrunheader) 162 return fDnsbPixel; 163 164 if (fDnsbPixel >= 0 && fDnsbPixel != mcrunheader->GetNumPheFromDNSB()) 165 { 166 *fLog << warn << dbginf << "The MC file has been generated with diffuse nsb " << mcrunheader->GetNumPheFromDNSB(); 167 *fLog <<" but you set up the diffuse NSB to " << fDnsbPixel << endl; 168 169 return fDnsbPixel; 170 } 171 172 return mcrunheader->GetNumPheFromDNSB(); 143 173 } 144 174 … … 158 188 // - MPedestalCam 159 189 // 160 Float_t MMcPedestalNSBAdd::GetDnsb(MParList *pList) const161 {162 MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader");163 if (!mcrunheader && fDnsbPixel < 0 )164 {165 *fLog << err << dbginf << "Using the default argument of MMcPedestalNSB::MMcPedestalNSB() ";166 *fLog << "only allowed if MMcRunHeader is available... aborting." << endl;167 return -1;168 }169 170 if (!mcrunheader)171 return fDnsbPixel;172 173 if (fDnsbPixel >= 0 && fDnsbPixel != mcrunheader->GetNumPheFromDNSB())174 {175 *fLog << warn << dbginf << "The MC file has been generated with diffuse nsb " << mcrunheader->GetNumPheFromDNSB();176 *fLog <<" but you set up the diffuse NSB to " << fDnsbPixel << endl;177 178 return fDnsbPixel;179 }180 181 return mcrunheader->GetNumPheFromDNSB();182 }183 184 190 Bool_t MMcPedestalNSBAdd::ReInit(MParList *pList) 185 191 { -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r1130 r1172 129 129 } 130 130 131 if (!fTaskList->InheritsFrom("MTasklist")) 132 { 133 *fLog << err << dbginf << "'" << tlist << "' doesn't inherit from MTaskList!" << endl; 134 return kFALSE; 135 } 136 131 137 if (fLog != &gLog) 132 fParList 138 fParList->SetLogStream(fLog); 133 139 134 140 // -
trunk/MagicSoft/Mars/mbase/MReadMarsFile.cc
r1132 r1172 114 114 if (fRun->Process()) 115 115 { 116 *fLog << inf << "MReadMarsFile: Switching to '" << GetFileName() << "' "; 117 *fLog << "(before processing event #" << GetEventNum()-1 << ")" << endl; 116 TString name(GetFileName()); 117 name.Remove(0, name.Last('/')+1); 118 119 *fLog << inf << "MReadMarsFile: Switching to '" << name << "' "; 120 *fLog << "(before event #" << GetEventNum()-1 << ")" << endl; 118 121 119 122 fTaskList->ReInit(); -
trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc
r1081 r1172 112 112 // Constructor 113 113 // 114 MGFadcDisp::MGFadcDisp(c har *filename,char *treename,114 MGFadcDisp::MGFadcDisp(const char *filename, const char *treename, 115 115 const TGWindow *p, const TGWindow *main, 116 116 UInt_t w, UInt_t h) … … 172 172 while (pixel.Next()) 173 173 { 174 char txt[100];175 sprintf(txt, "%d", pixel.GetPixelId());174 TString txt; 175 txt += pixel.GetPixelId(); 176 176 fPixelList->AddEntry(txt, pixel.GetPixelId()); 177 177 } … … 193 193 } 194 194 195 char txt[100]; 196 sprintf(txt, "GRAPH%d", lastsel); 195 TString txt("GRAPH"); 196 txt += lastsel; 197 197 198 data->Draw(txt); 199 198 200 fPixelList->Select(lastsel, kTRUE); 199 201 fPixelList->SetTopEntry(lastsel); -
trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.h
r1015 r1172 22 22 public: 23 23 24 MGFadcDisp(c har *filename,char *treename,24 MGFadcDisp(const char *filename, const char *treename, 25 25 const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h); 26 26 -
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r1108 r1172 280 280 main?main:gClient->GetRoot(), w, h) 281 281 { 282 fInputFile[0] = '\0';283 284 282 fList = new MGList; 285 283 fList->SetOwner(); … … 382 380 // Checks if there is a selected input root file 383 381 // 384 return fInputFile[0]!='\0';382 return !fInputFile.IsNull(); //[0]!='\0'; 385 383 } 386 384 … … 417 415 } 418 416 419 void MBrowser::SetFileName(const char *name) 420 { 421 // 422 // determine the file type by extensions 423 // 424 const char *ext=strrchr(name, '.'); 425 426 Bool_t failed = kFALSE; 427 428 if (!ext) 429 failed = kTRUE; 430 else 431 if (strcasecmp(ext, ".root")) 432 failed = kTRUE; 433 434 char *fname=NULL; 435 if (!failed) 417 void MBrowser::SetFileName(TString name) 418 { 419 if (name[0]!='/') 436 420 { 437 const char *dir = fFileCont->GetDirectory(); 438 439 fname = Form("%s/%s", dir, name); 440 441 failed = gSystem->AccessPathName(fname, kFileExists); 421 name.Insert(0, "/"); 422 name.Insert(0, fFileCont->GetDirectory()); 442 423 } 443 424 444 if (!failed) 445 strcpy(fInputFile, fname); 446 else 447 fname = Form(fInputFile); 448 449 char *slash = strrchr(fname, '/'); 450 451 fEntry->SetText(slash ? slash+1 : ""); 452 453 if (!slash) 425 if (gSystem->AccessPathName(name, kFileExists)) 454 426 return; 455 427 456 *slash = '\0'; 457 ChangeDir(fname); 428 if (name.EndsWith(".root", TString::kIgnoreCase)) 429 fInputFile = name; 430 431 fEntry->SetText(gSystem->BaseName(name)); 432 433 ChangeDir(gSystem->DirName(name)); 458 434 } 459 435 … … 483 459 const TGTextLBEntry *selected = (TGTextLBEntry*)filter->GetListBox()->GetSelectedEntry(); 484 460 485 const char *txt = StrDup(selected->GetText()->GetString());486 487 461 // 488 462 // find filter and remove leading spaces 489 463 // 490 char *lt = strchr(txt, '<'); 491 if (lt) 492 { 493 do *lt-- = '\0'; 494 while (lt>txt && *lt==' '); 495 496 // 497 // Set new filter and refresh the file container 498 // 499 fFileCont->SetFilter(txt); 500 fFileCont->DisplayDirectory(); 501 } 502 503 delete [] txt; 464 TString txt = selected->GetText()->GetString(); 465 if (txt.First('<') < 0) 466 return; 467 468 // 469 // Set new filter and refresh the file container 470 // 471 txt.Remove(txt.First('<')); 472 473 TString ftxt = txt.Strip(); 474 fFileCont->SetFilter(ftxt); 475 fFileCont->DisplayDirectory(); 504 476 } 505 477 -
trunk/MagicSoft/Mars/mmain/MBrowser.h
r1086 r1172 36 36 void CreateDirListBox(TGCompositeFrame *frame); 37 37 38 void SetFileName( const char *name);38 void SetFileName(TString name); 39 39 40 40 void SetFilter(); … … 44 44 protected: 45 45 MGList *fList; 46 Char_t fInputFile[256];46 TString fInputFile; 47 47 48 48 TGCompositeFrame *CreateNewTab(const char *name); -
trunk/MagicSoft/Mars/mmain/MDataCheck.cc
r1086 r1172 97 97 // histograms. 98 98 // 99 void MDataCheck::ViewAdcSpectra( Char_t *inputfile,Char_t *treeName)99 void MDataCheck::ViewAdcSpectra(const Char_t *inputfile, const Char_t *treeName) 100 100 { 101 101 // -
trunk/MagicSoft/Mars/mmain/MDataCheck.h
r1016 r1172 9 9 { 10 10 private: 11 void ViewAdcSpectra( Char_t *inputfile,Char_t *treeName);11 void ViewAdcSpectra(const Char_t *inputfile, const Char_t *treeName); 12 12 13 13 public:
Note:
See TracChangeset
for help on using the changeset viewer.