Changeset 8636 for trunk/MagicSoft/Mars
- Timestamp:
- 07/15/07 19:25:45 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8634 r8636 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 22 2007/07/15 Thomas Bretz 23 24 * mdata/MDataPhrase.[h,cc]: 25 - fixed a problem with predefined variables (such as used for 26 disp optimization [0]) 27 - added a debug member function GetRuleRaw() 28 29 * mhflux/MHAlpha.[h,cc]: 30 - allow to set the watermark from the DrawNice menu entry 31 32 * mjobs/MDataSet.cc: 33 - allow to set the default sequence- and data-path from 34 the dataset file 35 36 * mjobs/MJCut.cc: 37 - set the number of random off-source position for the on-data 38 - fixed a "&", should have been a logical And 39 - make sure that even for MCs the source position is always 40 calculated (this is necessary for more than one wobble position) 41 42 * mjoptim/MJOptimizeDisp.cc: 43 - fixed a typo which made the optimtrain.C fail (kDegToRad does 44 not exist) 45 46 * mjtrain/MJTrainEnergy.cc: 47 - some cosmetics: changed kRad2Deg to TMath::RadToDeg() 48 49 * mpointing/MSrcPosCalc.[h,cc]: 50 - added a random off-source position calculation to make the 51 more-than-one-off-source-position analysis symmetric in case of 52 on-source 53 - added lots of comments 54 20 55 21 56 -
trunk/MagicSoft/Mars/NEWS
r8632 r8636 11 11 resource file (to check it open it in the TBrowser and choose Print() 12 12 from the context menu) 13 14 - general: Dataset files now allow to overwrite the default path 15 to search for sequence and data files. Note, that the program 16 option and individual resources will overwrite it. For example: 17 SequencePath: /magic/montecarlo/sequences 18 DataPath: /magic/montecarlo/star 19 20 - general: Fixed a problem with variables in MDataPhrase. It seems 21 that only optimdisp (didn't work) was effected. 13 22 14 23 - merpp: Merpp can read file format version 9 now. Please realize … … 113 122 is not properly set. 114 123 (Rem: ThetaSqN is no longer needed) 124 125 - ganymed: is now storing the events of all source (on- and off- 126 source positions) even in the case of more than one off-source 127 position. This should allow sponde to work properly and the 128 energy estimation is done correctly in all cases (without any 129 "nearest position" trick) 130 131 - ganymed: From XXXX on a real starguider calibration with a real 132 pointing model for the starguider is done. 115 133 116 134 - ganymed: From 85340 (19.3.2006) on a real starguider calibration -
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r8601 r8636 885 885 } 886 886 887 void MHAlpha::DrawNicePlot(Bool_t newc, const char *title )887 void MHAlpha::DrawNicePlot(Bool_t newc, const char *title, const char *watermark) 888 888 { 889 889 if (!newc && !fDisplay) … … 972 972 text.SetTextSize(0.07); 973 973 text.SetTextAngle(2.5); 974 text.DrawLatex(0.45, 0.2, "preliminary"); 974 if (watermark) 975 text.DrawLatex(0.45, 0.2, watermark); 975 976 //enum { kTextNDC = BIT(14) }; 976 977 -
trunk/MagicSoft/Mars/mhflux/MHAlpha.h
r8136 r8636 132 132 void ForceUsingSize(Bool_t b=kTRUE) { fForceUsingSize=b; } 133 133 134 void DrawNicePlot(const char *title="MAGIC Telescope observation" ) { DrawNicePlot(kTRUE, title); } //*MENU*135 void DrawNicePlot(Bool_t newc, const char *title=0 );134 void DrawNicePlot(const char *title="MAGIC Telescope observation", const char *watermark="preliminary") { DrawNicePlot(kTRUE, title, watermark); } //*MENU* 135 void DrawNicePlot(Bool_t newc, const char *title=0, const char *watermark=0); 136 136 void DrawAll() { DrawAll(kTRUE); } //*MENU* 137 137 void DrawAll(Bool_t newc); -
trunk/MagicSoft/Mars/mjobs/MDataSet.cc
r8441 r8636 38 38 // SequencesOff: 36817 39 39 // 40 // SequencePath: /magic/sequences 41 // DataPath: /magic/data/star 42 // 40 43 // Sequence00035222.File: sequences/sequence035222.txt 41 44 // Sequence00036817.File: sequences/sequence036817.txt … … 44 47 // Sequence00036817.Dir: /data2/wuerzburg/Crab-Analyse/images/036817 45 48 // 46 // The analysis number is an artifical number used to name the output 47 // files automatically if the names are not overwritten in the corresponding 48 // programs. 49 // 50 // The sequence number are used to concatenate the filenames of the 51 // sequences using the file structure used in the datacenter. Each sequence 52 // can be added to the on and off data at the same time but only once. 49 // MonteCarlo: No 50 // 51 // AnalysisNumber: The analysis number is an artifical number used to name 52 // the output files automatically if the names are not overwritten in the 53 // corresponding programs. 54 // 55 // SequencePath: In case it is not specified the datacenter default path is 56 // used. If it is given it is the place at which the sequence files 57 // are searched, if not overwritten by either a program command line 58 // option (aka. a argument to the constructor) or a resource for 59 // an individual sequence file. Note, that the four digits high-level 60 // directories to sort the sequences are added to the given path. 61 // 62 // DataPath: In case it is not specified the datacenter default path is 63 // used. If it is given it is the place at which the data files 64 // are searched, if not overwritten by either a program command line 65 // option (aka. a argument to the constructor) or a resource for 66 // an individual data path. Note, that the four digits high-level 67 // directories to sort the sequences are added to the given path. 68 // 69 // SequencesOn/Off: The sequence number are used to concatenate the filenames 70 // of the sequences using the file structure used in the datacenter. Each 71 // sequence can be added to the on and off data at the same time but only 72 // once. 53 73 // 54 74 // If you have different file names you can overwrite the default file names … … 59 79 // overwrite the directories in which the sequence-files (eg I-files) are 60 80 // stored using Sequence%08d.Dir (make sure you have 8 digits!) 81 // 82 // 61 83 // 62 84 // Resource file entries are case sensitive! … … 226 248 fComment = env.GetValue("Comment", ""); 227 249 228 SetupDefaultPath(sequences, GetDefPathSequences()); 229 SetupDefaultPath(data, GetDefPathDataFiles()); 250 const TString defpathseq = env.GetValue("SequencePath", GetDefPathSequences()); 251 const TString defpathdata = env.GetValue("DataPath", GetDefPathDataFile()); 252 253 SetupDefaultPath(sequences, defpathseq); 254 SetupDefaultPath(data, defpathdata); 230 255 231 256 fPathSequences = sequences; -
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r8633 r8636 873 873 874 874 scalc.SetMode(MSrcPosCalc::kDefault); 875 scalc.SetNumRandomOffPositions(fNumOffSourcePos); 875 876 876 877 MFillH fill1b("MHHillasOnPre [MHHillas]", "MHillas", "FillHillasPre"); … … 947 948 MFillH fillsrc(&hsrcpos, "MSrcPosCam", "FillSrcPosCam"); 948 949 fillsrc.SetNameTab("SrcPos"); 949 if (set.IsWobbleMode() & !set.IsMonteCarlo()) 950 951 if (set.IsWobbleMode() && !set.IsMonteCarlo()) 950 952 tlist2.AddToListBefore(&fillsrc, &hcalc); 951 953 … … 983 985 if (!set.IsMonteCarlo()) 984 986 tlist.AddToList(&fillvs, "EffectiveOnTime"); 985 else 986 tlist2.AddToListBefore(&fillvs, &scalc); 987 988 // It is not really necessary to re-calculate the image parameters 989 // for the the on-source for MCs, but it is done for symmetry reasons 990 tlist2.AddToListBefore(&fillvs, &scalc); 987 991 } 988 992 -
trunk/MagicSoft/Mars/mjoptim/MJOptimizeDisp.cc
r8223 r8636 117 117 parlist.AddToList(&fit); 118 118 119 // To avoid this hard-coded we have to switch to MReadMarsFile 119 120 MGeomCamMagic geom; // For GetConvMm2Deg 120 121 parlist.AddToList(&geom); … … 125 126 126 127 const Int_t num1 = m.AddColumn("MHillasSrc.fDist*MGeomCam.fConvMm2Deg"); 127 const Int_t num2 = m.AddColumn("MHillasSrc.fAlpha* kDegToRad");128 const Int_t num2 = m.AddColumn("MHillasSrc.fAlpha*TMath::DegToRad()"); 128 129 const Int_t num3 = m.AddColumn("MHillas.fSize"); 129 130 … … 202 203 203 204 // Print the result 204 *fLog << inf << "Finished processing of " << fname << endl; 205 *fLog << inf << "With Rule: " << rule << endl; 205 *fLog << inf; 206 *fLog << "Finished processing of " << fname << endl; 207 *fLog << "With Rule: " << rule << endl; 206 208 hist.GetAlphaFitter().Print("result"); 207 209 -
trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.cc
r8223 r8636 112 112 train.AddColumn("MWeight.fVal"); 113 113 train.AddColumn("MMcEvt.fImpact/100"); 114 train.AddColumn("MMcEvt.fTelescopeTheta* kRad2Deg");114 train.AddColumn("MMcEvt.fTelescopeTheta*TMath::RadToDeg()"); 115 115 train.AddColumn("MMcEvt.fEnergy"); 116 116 -
trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc
r8618 r8636 42 42 // is taken from MGeomCam. The time is taken from MTime, and the 43 43 // coordinates of the observatory from MObservatory. 44 // 44 // 45 // FIXME: Add here some information about the more-cycle calculation 46 // 45 47 // Input Container: 46 48 // MPointingPos … … 65 67 #include "MSrcPosCalc.h" 66 68 69 #include <TRandom.h> 67 70 #include <TVector2.h> 68 71 … … 96 99 : fObservatory(NULL), fPointPos(NULL), fSourcePos(NULL), fDeviation(NULL), 97 100 fSrcPosCam(NULL), fSrcPosAnti(NULL), fGeom(NULL), fTime(NULL), fCallback(NULL), 98 fMode(kDefault) 101 fMode(kDefault), fNumRandomOffPositions(0) 99 102 { 100 103 fName = name ? name : "MSrcPosCalc"; … … 157 160 Int_t MSrcPosCalc::PreProcess(MParList *pList) 158 161 { 162 // Reset fixed position 163 fFixedPos = TVector2(); 164 159 165 fSrcPosCam = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam"); 160 166 if (!fSrcPosCam) … … 172 178 *fLog << inf; 173 179 *fLog << "MSourcePos [MPointPos] not found... The source position" << endl; 174 *fLog << "set in MSrcPosCam will be set to 180 *fLog << "set in MSrcPosCam will be set to (0/0) or in the case" << endl; 175 181 *fLog << "of Monte Carlo set to the appropriate wobble position." << endl; 176 182 return kTRUE; … … 199 205 *fLog << "Source Position: " << GetRaDec(*fSourcePos) << endl; 200 206 if (fCallback) 201 *fLog << "Using " << fCallback->GetNumPasses() << " off-regions." << endl; 207 *fLog << "Calculating " << fCallback->GetNumPasses() << " off-regions." << endl; 208 if (fNumRandomOffPositions) 209 *fLog << "Calculating " << fNumRandomOffPositions << " random off-regions." << endl; 202 210 203 211 // For the case ReInit is never called we try: … … 211 219 // -------------------------------------------------------------------------- 212 220 // 221 // Divide the 360deg into num+1 positions. Rotate the given vector 222 // by pass+1 steps and return the result. 223 // 224 TVector2 MSrcPosCalc::Rotate(TVector2 v, Int_t pass, Int_t num) const 225 { 226 const Double_t step = TMath::TwoPi()/(num+1); 227 return v.Rotate(step*(pass+1)); 228 } 229 230 // -------------------------------------------------------------------------- 231 // 213 232 // If fIsWobbleMode==kFALSE set source position to v and anto-source 214 233 // position to -v, if fIsWobbleMode==kTRUE vice versa. … … 218 237 if (fMode==kWobble) 219 238 { 239 // The trick here is that the anti-source position in case 240 // of the off-source regions is always the on-source positon 241 // thus a proper anti-source cut is possible. 220 242 fSrcPosAnti->SetXY(v); 221 222 243 if (fCallback) 223 { 224 const Double_t step = TMath::TwoPi()/(fCallback->GetNumPasses()+1); 225 v = v.Rotate(step*(fCallback->GetNumPass()+1)); 226 } 244 v = Rotate(v, fCallback->GetNumPass(), fCallback->GetNumPasses()); 227 245 else 228 246 v *= -1; 229 230 247 fSrcPosCam->SetXY(v); 231 248 } 232 249 else 233 250 { 251 // Because we don't process this three times like in the 252 // wobble case we have to find another way to determine which 253 // off-source region is the right anti-source position 254 // We do it randomly. 234 255 fSrcPosCam->SetXY(v); 235 v *= -1; 256 if (fNumRandomOffPositions>1) 257 v = Rotate(v, gRandom->Integer(fNumRandomOffPositions), fNumRandomOffPositions); 258 else 259 v *= -1; 236 260 fSrcPosAnti->SetXY(v); 237 261 } … … 247 271 if (fMode==kOffData) 248 272 { 249 SetSrcPos(TVector2()); 273 // Set fixed position to camera center 274 fFixedPos = TVector2(); 275 276 // It is set here for the cases in which Process is not called at all 277 fSrcPosCam->SetXY(fFixedPos); 250 278 return kTRUE; 251 279 } … … 284 312 } 285 313 314 // Determine Monte Carlo position from Monte Carlo header 286 315 TVector2 v(0, 0); 287 316 if (h->GetWobbleMode()>0.5) … … 290 319 v.Set(-120., 0.); 291 320 292 SetSrcPos(v); 293 321 // Set fixed position 322 fFixedPos = v; 323 324 // It is set here for the cases in which Process is not called at all 325 fSrcPosCam->SetXY(fFixedPos); 326 327 // Informal message output 294 328 *fLog << inf; 295 *fLog << "Source Position set to x=" << f SrcPosCam->GetX() << "mm ";296 *fLog << "y=" << f SrcPosCam->GetY() << "mm" << endl;329 *fLog << "Source Position set to x=" << fFixedPos.X() << "mm "; 330 *fLog << "y=" << fFixedPos.Y() << "mm" << endl; 297 331 298 332 return kTRUE; … … 350 384 if (fRunType==MRawRunHeader::kRTMonteCarlo || !fSourcePos || !fTime || !fObservatory || fMode==kOffData) 351 385 { 352 // If this is MC data do not change source position 353 if (fRunType==MRawRunHeader::kRTMonteCarlo) 354 return kTRUE; 355 356 // For real data reset source position to 0/0 357 SetSrcPos(); 386 SetSrcPos(fFixedPos); 358 387 return kTRUE; 359 388 } -
trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h
r8618 r8636 23 23 public: 24 24 enum Mode_t { 25 kDefault = 0, 26 kOffData = 1, 27 kWobble = 2 25 kDefault = 0, // Set source position to on-position 26 kOffData = 1, // The source position is fixed to (0/0) 27 kWobble = 2 // The source position is set to the wobble aka. anti-source position depending on the cycle number 28 28 }; 29 29 private: … … 32 32 }; 33 33 34 MObservatory *fObservatory; 35 MPointingPos *fPointPos; 36 MPointingPos *fSourcePos; 37 MPointingDev *fDeviation; 38 MSrcPosCam *fSrcPosCam; 39 MSrcPosCam *fSrcPosAnti; 40 MGeomCam *fGeom; 41 MTime *fTime; 42 MTaskList *fCallback; 34 MObservatory *fObservatory; //! Observatory location 35 MPointingPos *fPointPos; //! Present pointing position of the telescope in Zd/Az 36 MPointingPos *fSourcePos; //! Source Postion in sky coordinates 37 MPointingDev *fDeviation; //! Deviation calculated from starguider data 38 MSrcPosCam *fSrcPosCam; //! Output: Source position in the camera 39 MSrcPosCam *fSrcPosAnti; //! Output: Anti Source position in the camera 40 MGeomCam *fGeom; //! Camera geomety 41 MTime *fTime; //! Time of the current event 42 MTaskList *fCallback; //! Callback function to get the number of the cycle 43 43 44 44 UShort_t fRunType; //! Run Type to decide where to get pointing position from 45 45 46 Int_t fMode; 46 TVector2 fFixedPos; //! Fixed source position 47 48 Int_t fMode; // Mode how the source position is calculated 49 50 Int_t fNumRandomOffPositions; // Number of possible random off-sourcr position 47 51 48 52 // MSrcPosCalc 49 53 void SetSrcPos(TVector2 v=TVector2()) const; 54 TVector2 Rotate(TVector2 v, Int_t pass, Int_t num) const; 50 55 TVector2 CalcXYinCamera(const MVector3 &pos0, const MVector3 &pos) const; 51 56 TString GetRaDec(const MPointingPos &pos) const; … … 71 76 void SetMode(Mode_t m=kDefault) { fMode = m; } 72 77 void SetCallback(MTaskList *list) { fCallback=list; } 78 void SetNumRandomOffPositions(Int_t num=0) { fNumRandomOffPositions=num; } 73 79 74 80 ClassDef(MSrcPosCalc, 0) // Calculates the source position in the camera
Note:
See TracChangeset
for help on using the changeset viewer.