Changeset 4817
- Timestamp:
- 08/31/04 10:21:26 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4815 r4817 19 19 20 20 -*-*- END OF LINE -*-*- 21 2004/08/31: Thomas Bretz 22 23 * star.cc: 24 - implemented batch- and quit-mode 25 26 * mastro/MAstroCatalog.h: 27 - implemented default argument for magnitude in MVector3 28 setters 29 30 * mbase/MDirIter.cc: 31 - fixed a typo 32 33 * mfileio/MWriteRootFile.cc: 34 - fixed a typo 35 36 * mimage/MHHillasSrc.[h,cc], mimage/MHillasSrc.[h,cc]: 37 - added DCA and DCADelta as discussed with the ETH people 38 - incrementes version number of MHillasSrc 39 - changed return type of MHillasSrc::Calc from Bool_t to Int_t 40 41 * mpointing/MPointingPos.h: 42 - added Getter for ZdA7Az in rad 43 44 * mpointing/MPointingPosCalc.cc: 45 - fixed a bug which converted Ra/Dec wrongly to rad 46 47 48 21 49 2004/08/30: Markus Gaug 22 50 … … 32 60 - exchanged all arrays by MArray's 33 61 62 63 34 64 2004/08/30: Thomas Bretz 35 36 65 37 66 * showlog.cc, showplot.cc: -
trunk/MagicSoft/Mars/mastro/MAstroCatalog.h
r4521 r4817 38 38 Double_t Magnitude() const { return -2.5*TMath::Log10(Mag()); } 39 39 40 void SetRaDec(Double_t ra, Double_t dec, Double_t mag )40 void SetRaDec(Double_t ra, Double_t dec, Double_t mag=0) 41 41 { 42 42 fType = kIsRaDec; … … 44 44 } 45 45 void SetName(const TString &str) { fName = str.Strip(TString::kBoth); } 46 void SetZdAz(Double_t zd, Double_t az, Double_t mag )46 void SetZdAz(Double_t zd, Double_t az, Double_t mag=0) 47 47 { 48 48 fType = kIsZdAz; 49 49 SetMagThetaPhi(pow(10, -mag/2.5), zd, az); 50 50 } 51 void SetAltAz(Double_t alt, Double_t az, Double_t mag )51 void SetAltAz(Double_t alt, Double_t az, Double_t mag=0) 52 52 { 53 53 fType = kIsAltAz; -
trunk/MagicSoft/Mars/mbase/MDirIter.cc
r4722 r4817 90 90 Int_t MDirIter::AddDirectory(const char *d, const char *filter, Int_t recursive) 91 91 { 92 TString dir = d;92 TString dir(d); 93 93 94 94 // Sanity check … … 142 142 continue; 143 143 144 // If entry is a directory add it with a lower erecursivity144 // If entry is a directory add it with a lower recursivity 145 145 if (IsDir(c)==0) 146 146 rc += AddDirectory(c, filter, recursive-1); -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r4698 r4817 417 417 { 418 418 *fLog << warn << endl; 419 *fLog << "WARNING: You are updating an existing branch. For this" << endl;420 *fLog << " case file-splitting mode is not allowed...disabled!" << endl;419 *fLog << "WARNING: You are updating an existing branch. For this case" << endl; 420 *fLog << " file-splitting mode is not allowed... disabled!" << endl; 421 421 *fLog << endl; 422 422 fSplitRule = ""; -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
r2438 r4817 70 70 // connect all the histogram with the container fHist 71 71 // 72 fAlpha = new TH1F("Alpha", "Alpha of Ellipse", 181, -90, 90); 73 fDist = new TH1F("Dist", "Dist of Ellipse", 100, 0, 445); 74 fCosDA = new TH1F("CosDA", "cos(Delta,Alpha) of Ellipse", 101, -1, 1); 72 fAlpha = new TH1F("Alpha", "Alpha of Ellipse", 181, -90, 90); 73 fDist = new TH1F("Dist", "Dist of Ellipse", 100, 0, 445); 74 fCosDA = new TH1F("CosDA", "cos(Delta,Alpha) of Ellipse", 101, -1, 1); 75 fDCA = new TH1F("DCA", "Distance of closest aproach", 101, -1, 1); 76 fDCADelta = new TH1F("DCADelta", "Angle between shower and x-axis", 101, 0, 360); 75 77 76 78 fAlpha->SetDirectory(NULL); 77 79 fDist->SetDirectory(NULL); 78 80 fCosDA->SetDirectory(NULL); 81 fDCA->SetDirectory(NULL); 82 fDCADelta->SetDirectory(NULL); 79 83 80 84 fAlpha->SetXTitle("\\alpha [\\circ]"); 81 85 fDist->SetXTitle("Dist [mm]"); 82 86 fCosDA->SetXTitle("cos(\\delta,\\alpha)"); 87 fDCA->SetXTitle("DCA [\\circ]"); 88 fDCADelta->SetXTitle("DCADelta [0, 2\\pi]"); 83 89 84 90 fAlpha->SetYTitle("Counts"); 85 91 fDist->SetYTitle("Counts"); 86 92 fCosDA->SetYTitle("Counts"); 93 fDCA->SetYTitle("Counts"); 94 fDCADelta->SetYTitle("Counts"); 87 95 } 88 96 … … 96 104 delete fDist; 97 105 delete fCosDA; 106 delete fDCA; 107 delete fDCADelta; 98 108 } 99 109 … … 121 131 ApplyBinning(*plist, "Alpha", fAlpha); 122 132 ApplyBinning(*plist, "Dist", fDist); 133 ApplyBinning(*plist, "DCA", fDCA); 134 ApplyBinning(*plist, "DCADelta", fDCADelta); 123 135 124 136 return kTRUE; … … 143 155 fDist ->Fill(fUseMmScale ? h.GetDist() : fMm2Deg*h.GetDist(), w); 144 156 fCosDA->Fill(h.GetCosDeltaAlpha(), w); 157 fDCA ->Fill(fUseMmScale ? h.GetDCA() : fMm2Deg*h.GetDCA(), w); 158 fDCADelta ->Fill(h.GetDCADelta(), w); 145 159 146 160 return kTRUE; … … 186 200 const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg; 187 201 MH::ScaleAxis(fDist, scale); 202 MH::ScaleAxis(fDCA, scale); 188 203 189 204 fDist->SetXTitle(mmscale ? "Dist [mm]" : "Dist [\\circ]"); 205 fDCA->SetXTitle(mmscale ? "DCA [mm]" : "DCA [\\circ]"); 190 206 191 207 fUseMmScale = mmscale; … … 217 233 fDist->Draw(); 218 234 219 delete pad->GetPad(3); 235 pad->cd(3); 236 gPad->SetBorderMode(0); 237 fDCA->Draw(); 220 238 221 239 pad->cd(4); 222 240 gPad->SetBorderMode(0); 223 //gPad->SetLogy(); 241 242 TVirtualPad *p = gPad; 243 p->Divide(1,2); 244 p->cd(1); 245 gPad->SetBorderMode(0); 224 246 fCosDA->Draw(); 247 248 p->cd(2); 249 gPad->SetBorderMode(0); 250 fDCADelta->Draw(); 225 251 226 252 pad->Modified(); -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.h
r2416 r4817 15 15 TH1F *fDist; //-> 16 16 TH1F *fCosDA; //-> 17 18 TH1F *fDCA; //-> 19 TH1F *fDCADelta; //-> 17 20 18 21 Float_t fMm2Deg; … … 34 37 TH1F *GetHistDist() { return fDist; } 35 38 TH1F *GetHistCosDeltaAlpha() { return fCosDA; } 39 TH1F *GetHistDCA() { return fDCA; } 40 TH1F *GetHistDCADelta() { return fDCADelta; } 36 41 37 42 void Draw(Option_t *opt=NULL); -
trunk/MagicSoft/Mars/mimage/MHillasSrc.cc
r4710 r4817 57 57 // Version 4: 58 58 // ---------- 59 //60 59 // fHeadTail removed 60 // 61 // 62 // Version 5: 63 // ---------- 64 // - added Float_t fDCA; // [mm] Distance to closest approach 'DCA' 65 // - added Float_t fDCADelta; // [deg] Angle of the shower axis with respect 66 // to the x-axis [0,2pi] 61 67 // 62 68 ///////////////////////////////////////////////////////////////////////////// … … 91 97 fAlpha = 0; 92 98 fCosDeltaAlpha = 0; 99 100 fDCA = -1; 101 fDCADelta = 0; 93 102 } 94 103 … … 99 108 // you call the Reset member function before. 100 109 // 101 Bool_t MHillasSrc::Calc(const MHillas &hillas) 102 { 103 const Double_t mx = hillas.GetMeanX(); // [mm] 104 const Double_t my = hillas.GetMeanY(); // [mm] 105 106 const Double_t sx = mx - fSrcPos->GetX(); // [mm] 107 const Double_t sy = my - fSrcPos->GetY(); // [mm] 108 109 const Double_t sd = hillas.GetSinDelta(); // [1] 110 const Double_t cd = hillas.GetCosDelta(); // [1] 111 112 // 113 // Distance from source position to center of ellipse. 114 // If the distance is 0 distance, Alpha is not specified. 115 // The calculation has failed and returnes kFALSE. 116 // 117 const Double_t dist = sqrt(sx*sx + sy*sy); // [mm] 118 if (dist==0) 119 return kFALSE; 120 121 // 122 // Calculate Alpha and Cosda = cos(d,a) 123 // The sign of Cosda will be used for quantities containing 124 // a head-tail information 125 // 126 // *OLD* const Double_t arg = (sy-tand*sx) / (dist*sqrt(tand*tand+1)); 127 // *OLD* fAlpha = asin(arg)*kRad2Deg; 128 // 129 const Double_t arg1 = cd*sy-sd*sx; // [mm] 130 const Double_t arg2 = cd*sx+sd*sy; // [mm] 131 132 // 133 // Due to numerical uncertanties in the calculation of the 134 // square root (dist) and arg1 it can happen (in less than 1e-5 cases) 135 // that the absolute value of arg exceeds 1. Because this uncertainty 136 // results in an Delta Alpha which is still less than 1e-3 we don't care 137 // about this uncertainty in general and simply set values which exceed 138 // to 1 saving its sign. 139 // 140 const Double_t arg = arg1/dist; 141 fAlpha = TMath::Abs(arg)>1 ? TMath::Sign(90., arg) : asin(arg)*kRad2Deg; // [deg] 142 143 fCosDeltaAlpha = arg2/dist; // [1] 144 fDist = dist; // [mm] 145 146 SetReadyToSave(); 147 148 return kTRUE; 149 } 110 Int_t MHillasSrc::Calc(const MHillas &hillas) 111 { 112 const Double_t mx = hillas.GetMeanX(); // [mm] 113 const Double_t my = hillas.GetMeanY(); // [mm] 114 115 const Double_t sx = mx - fSrcPos->GetX(); // [mm] 116 const Double_t sy = my - fSrcPos->GetY(); // [mm] 117 118 const Double_t sd = hillas.GetSinDelta(); // [1] 119 const Double_t cd = hillas.GetCosDelta(); // [1] 120 121 // 122 // Distance from source position to center of ellipse. 123 // If the distance is 0 distance, Alpha is not specified. 124 // The calculation has failed and returnes kFALSE. 125 // 126 const Double_t dist = TMath::Sqrt(sx*sx + sy*sy); // [mm] 127 if (dist==0) 128 return 1; 129 130 // 131 // Calculate Alpha and Cosda = cos(d,a) 132 // The sign of Cosda will be used for quantities containing 133 // a head-tail information 134 // 135 // *OLD* const Double_t arg = (sy-tand*sx) / (dist*sqrt(tand*tand+1)); 136 // *OLD* fAlpha = asin(arg)*kRad2Deg; 137 // 138 const Double_t arg2 = cd*sx + sd*sy; // [mm] 139 if (arg2==0) 140 return 2; 141 142 const Double_t arg1 = cd*sy - sd*sx; // [mm] 143 144 // 145 // Due to numerical uncertanties in the calculation of the 146 // square root (dist) and arg1 it can happen (in less than 1e-5 cases) 147 // that the absolute value of arg exceeds 1. Because this uncertainty 148 // results in an Delta Alpha which is still less than 1e-3 we don't care 149 // about this uncertainty in general and simply set values which exceed 150 // to 1 saving its sign. 151 // 152 const Double_t arg = arg1/dist; 153 fAlpha = TMath::Abs(arg)>1 ? TMath::Sign(90., arg) : TMath::ASin(arg)*TMath::RadToDeg(); // [deg] 154 155 fCosDeltaAlpha = arg2/dist; // [1] 156 fDist = dist; // [mm] 157 158 // ----- Calculation of Distance to closest approach 'DCA' ----- 159 160 // Components of DCA vector 161 const Double_t fpd1 = sx - arg2*cd; // [mm] 162 const Double_t fpd2 = sy - arg2*sd; // [mm] 163 164 // Determine the correct sign of the DCA (cross product of DCA vector and the 165 // vector going from the intersection point of the DCA vector with the shower axis 166 // to the COG) 167 const Double_t sign = arg2*cd*fpd2 - arg2*sd*fpd1; 168 fDCA = TMath::Sign(TMath::Sqrt(fpd1*fpd1 + fpd2*fpd2), sign); // [mm] 169 170 // Calculate angle of the shower axis with respect to the x-axis 171 fDCADelta = TMath::ACos((sx-fpd1)/TMath::Abs(arg2))*TMath::RadToDeg(); // [deg] 172 173 // Enlarge the interval of fDdca to [0, 2pi] 174 if (sy < fpd2) 175 fDCADelta = 360 - fDCADelta; 176 177 SetReadyToSave(); 178 179 return 0; 180 } 150 181 151 182 // -------------------------------------------------------------------------- … … 160 191 *fLog << " - Alpha [deg] = " << fAlpha << endl; 161 192 *fLog << " - CosDeltaAlpha = " << fCosDeltaAlpha << endl; 193 *fLog << " - DCA [mm] = " << fDCA << endl; 194 *fLog << " - DCA delta [deg] = " << fDCADelta*TMath::RadToDeg() << endl; 162 195 } 163 196 … … 174 207 *fLog << " - Alpha [deg] = " << fAlpha << endl; 175 208 *fLog << " - CosDeltaAlpha = " << fCosDeltaAlpha << endl; 209 *fLog << " - DCA [deg] = " << fDCA*geom.GetConvMm2Deg() << endl; 210 *fLog << " - DCA delta [deg] = " << fDCADelta*TMath::RadToDeg() << endl; 176 211 } 177 212 … … 183 218 void MHillasSrc::Set(const TArrayF &arr) 184 219 { 185 if (arr.GetSize() != 3)220 if (arr.GetSize() != 5) 186 221 return; 187 222 … … 189 224 fDist = arr.At(1); // [mm] distance between src and center of ellipse 190 225 fCosDeltaAlpha = arr.At(2); // [1] cosine of angle between d and a 191 } 226 fDCA = arr.At(3); // [mm] 227 fDCADelta = arr.At(4); // [mm] 228 } -
trunk/MagicSoft/Mars/mimage/MHillasSrc.h
r4710 r4817 17 17 Float_t fCosDeltaAlpha; // [1] cosine of angle between d and a 18 18 19 Float_t fDCA; // [mm] Distance to closest approach 'DCA' 20 Float_t fDCADelta; // [deg] Angle of the shower axis with respect to the x-axis 21 19 22 public: 20 23 MHillasSrc(const char *name=NULL, const char *title=NULL); … … 28 31 Float_t GetDist() const { return fDist; } 29 32 Float_t GetCosDeltaAlpha() const { return fCosDeltaAlpha; } 33 Float_t GetDCA() const { return fDCA; } 34 Float_t GetDCADelta() const { return fDCADelta; } 30 35 31 36 void Print(Option_t *opt=NULL) const; 32 37 void Print(const MGeomCam &geom) const; 33 38 34 virtual Bool_t Calc(const MHillas &hillas);39 virtual Int_t Calc(const MHillas &hillas); 35 40 36 41 void Set(const TArrayF &arr); 37 42 38 ClassDef(MHillasSrc, 4) // Container to hold source position dependant parameters43 ClassDef(MHillasSrc, 5) // Container to hold source position dependant parameters 39 44 }; 40 45 -
trunk/MagicSoft/Mars/mpointing/MPointingPos.h
r4731 r4817 4 4 #ifndef MARS_MParContainer 5 5 #include "MParContainer.h" 6 #endif 7 8 // FIXME: Should not be here... 9 #ifndef MARS_MPointing 10 #include "MPointing.h" 6 11 #endif 7 12 … … 32 37 Double_t GetAz() const { return fAz; } 33 38 39 Double_t GetZdRad() const { return fZd*TMath::DegToRad(); } 40 Double_t GetAzRad() const { return fAz*TMath::DegToRad(); } 41 42 ZdAz GetZdAz() const { return ZdAz(fZd, fAz); } 43 34 44 Double_t GetRa() const { return fRa; } 35 45 Double_t GetHa() const { return fHa; } -
trunk/MagicSoft/Mars/mpointing/MPointingPosCalc.cc
r3544 r4817 134 134 case MRawRunHeader::kRTData: 135 135 fPosition->SetLocalPosition(fReport->GetNominalZd(), fReport->GetNominalAz()); 136 fPosition->SetSkyPosition(fReport->GetRa() *TMath::DegToRad()/15, fReport->GetDec()*TMath::DegToRad());136 fPosition->SetSkyPosition(fReport->GetRa()/**TMath::DegToRad()/15*/, fReport->GetDec()/**TMath::DegToRad()*/); 137 137 return kTRUE; 138 138 -
trunk/MagicSoft/Mars/star.cc
r4756 r4817 49 49 gLog << " --debug-env Debug setting resources from file" << endl << endl; 50 50 gLog << endl; 51 gLog << " Output options:" << endl; 52 gLog << " -q Quit when job is finished" << endl; 51 53 gLog << " -f Force overwrite of existing files" << endl; 52 54 gLog << " -ff Force execution if not all files found" << endl; … … 87 89 const Bool_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env"); 88 90 91 const Bool_t kQuit = arg.HasOnlyAndRemove("-q"); 92 const Bool_t kBatch = arg.HasOnlyAndRemove("-b"); 89 93 const Bool_t kOverwrite = arg.HasOnlyAndRemove("-f"); 90 94 const Bool_t kForceExec = arg.HasOnlyAndRemove("-ff"); 91 95 92 const TString kInpath = arg.GetStringAndRemove("--in =","");96 const TString kInpath = arg.GetStringAndRemove("--ind=", ""); 93 97 const TString kOutpath = arg.GetStringAndRemove("--out=", "."); 94 98 … … 141 145 // 142 146 MDirIter iter; 143 seq.SetupDatRuns(iter, kInpath);144 147 145 148 const Int_t n0 = seq.SetupDatRuns(iter, kInpath); … … 179 182 180 183 TApplication app("Star", &argc, argv); 181 if ( gROOT->IsBatch() ||!gClient)184 if (!gROOT->IsBatch() && !gClient) 182 185 { 183 186 gLog << err << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl; … … 219 222 } 220 223 224 if (kBatch || kQuit) 225 { 226 delete d; 227 return 0; 228 } 229 221 230 // From now on each 'Close' means: Terminate the application 222 231 d->SetBit(MStatusDisplay::kExitLoopOnClose);
Note:
See TracChangeset
for help on using the changeset viewer.