Changeset 1888
- Timestamp:
- 04/02/03 09:03:22 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1886 r1888 1 1 -*-*- END OF LINE -*-*- 2 3 2003/04/02: Wolfgang Wittek 4 5 * mfileio/Makefile 6 - mhist added, because MBinning is used in MCT1ReadPreproc 7 8 * mfileio/MCT1ReadPreProc.[h,cc] 9 - new member function SmearTheta 10 - store smeared Theta in MMcEvt::fTelescopeTheta 11 store original Theta in MParameterD container "ThetaOrig" 12 store fhourangle in MParameterD container "HourAngle" 13 14 * manalysis/MPointingCorr.[h,cc] 15 - get hour angle from ParameterD container "HourAngle" 16 17 * manalysis/MSelBasic.[h,cc] 18 MSelStandard.[h,cc] 19 MSelFinal.[h,cc] 20 - new member functions SetCuts() 21 2 22 3 23 2003/04/01: Abelardo Moralejo … … 13 33 14 34 2003/03/31: Thomas Bretz 15 16 * mhist/MHArray.[h,cc]:17 - added default constructor18 - added Set-function19 - added Init function20 - moved code from constructors to Set and Init21 35 22 36 * Makefile.conf.linux: -
trunk/MagicSoft/Mars/manalysis/MPointingCorr.cc
r1885 r1888 38 38 #include "MSrcPosCam.h" 39 39 #include "MGeomCam.h" 40 #include "MParameters.h" 40 41 41 42 #include "MLog.h" … … 81 82 } 82 83 84 fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD"); 85 if (!fHourAngle) 86 { 87 *fLog << dbginf << "HourAngle not found... aborting." << endl; 88 return kFALSE; 89 } 90 83 91 84 92 fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam"); … … 104 112 // (cx, cy) is the source position in the camera [mm] 105 113 // 106 Float_t fhourangle = fMcEvt->GetOtherCphFraction(); 114 Float_t fhourangle = fHourAngle->GetVal(); 115 116 //*fLog << "MPointingCorr::Process; fhourangle = " 117 // << fhourangle << endl; 118 107 119 Float_t cx = -0.05132 - 0.001064 * fhourangle 108 120 - 3.530e-6 * fhourangle * fhourangle; -
trunk/MagicSoft/Mars/manalysis/MPointingCorr.h
r1868 r1888 16 16 class MMcEvt; 17 17 class MSrcPosCam; 18 class MParameterD; 19 18 20 19 21 class MPointingCorr : public MTask … … 23 25 MSrcPosCam *fSrcPos; 24 26 TString fSrcName; 27 MParameterD *fHourAngle; 25 28 26 29 Float_t fMm2Deg; -
trunk/MagicSoft/Mars/manalysis/MSelBasic.cc
r1885 r1888 61 61 fTitle = title ? title : "Task to evaluate basic cuts"; 62 62 63 ThetaMin = 0.0;64 ThetaMax = 60.0;63 fThetaMin = 0.0; 64 fThetaMax = 60.0; 65 65 } 66 66 … … 109 109 } 110 110 111 memset(f Errors, 0, sizeof(fErrors));111 memset(fCut, 0, sizeof(fCut)); 112 112 113 113 return kTRUE; … … 123 123 Bool_t MSelBasic::Process() 124 124 { 125 /*126 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$127 *fLog << "=========================================================" << endl;128 *fLog << "" << endl;129 *fLog << "MmcEvt data : " << endl;130 *fLog << "" << endl;131 fMcEvt->Print();132 *fLog << "" << endl;133 *fLog << "PartId() = " << fMcEvt->GetPartId() << endl;134 *fLog << "Energy() = " << fMcEvt->GetEnergy() << endl;135 *fLog << "Theta() = " << fMcEvt->GetTheta() << endl;136 137 *fLog << "Phi() = " << fMcEvt->GetPhi() << endl;138 //*fLog << "CoreD() = " << fMcEvt->GetCoreD() << endl;139 //*fLog << "CoreX() = " << fMcEvt->GetCoreX() << endl;140 141 //*fLog << "CoreY() = " << fMcEvt->GetCoreY() << endl;142 *fLog << "Impact() = " << fMcEvt->GetImpact() << endl;143 //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl;144 145 //*fLog << "PassPhotAtm() = " << fMcEvt->GetPassPhotAtm() << endl;146 //*fLog << "PassPhotRef() = " << fMcEvt->GetPassPhotRef() << endl;147 //*fLog << "PassPhotCone() = " << fMcEvt->GetPassPhotCone() << endl;148 149 //*fLog << "PhotElfromShower() = " << fMcEvt->GetPhotElfromShower() << endl;150 //*fLog << "PhotElinCamera() = " << fMcEvt->GetPhotElinCamera() << endl;151 *fLog << "TelescopePhi() = " << fMcEvt->GetTelescopePhi() << endl;152 153 *fLog << "TelescopeTheta() = " << fMcEvt->GetTelescopeTheta() << endl;154 *fLog << "Impact() = " << fMcEvt->GetImpact() << endl;155 //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl;156 *fLog << "" << endl;157 *fLog << "=========================================================" << endl;158 159 *fLog << "=========================================================" << endl;160 *fLog << "" << endl;161 *fLog << "MPedestalPix data : " << endl;162 *fLog << "" << endl;163 164 Int_t ntot;165 ntot = fPed->GetSize();166 *fLog << "MeanRms() :" << endl;167 for (Int_t i=0; i<ntot; i++)168 {169 MPedestalPix &pix = (*fPed)[i];170 //*fLog << "Mean() = " << i << ", " << pix.GetMean() << endl;171 //*fLog << "Sigma() = " << i << ", " << pix.GetSigma() << endl;172 *fLog << pix.GetMeanRms() << " ";173 //*fLog << "SigmaRms()= " << i << ", " << pix.GetSigmaRms() << endl;174 }175 *fLog << "" << endl;176 177 *fLog << "" << endl;178 ntot = fEvt->GetNumPixels();179 *fLog << "MCerPhotPix : pix.GetNumPhotons()" << endl;180 for (Int_t i=0; i<ntot; i++)181 {182 MCerPhotPix &pix = (*fEvt)[i];183 *fLog << pix.GetNumPhotons() << " ";184 }185 *fLog << "" << endl;186 187 *fLog << "" << endl;188 ntot = fEvt->GetNumPixels();189 *fLog << "MCerPhotPix : pix.GetErrorPhot()" << endl;190 for (Int_t i=0; i<ntot; i++)191 {192 MCerPhotPix &pix = (*fEvt)[i];193 *fLog << pix.GetErrorPhot() << " ";194 }195 *fLog << "" << endl;196 197 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$198 */199 200 201 125 Int_t rc = 0; 202 126 … … 207 131 //} 208 132 209 Double_t Theta = kRad2Deg*fMcEvt->GetTelescopeTheta();210 if ( Theta <ThetaMin )133 Double_t theta = kRad2Deg*fMcEvt->GetTelescopeTheta(); 134 if ( theta < fThetaMin ) 211 135 { 212 136 *fLog << "MSelBasic::Process; Run, Event, Theta = " 213 137 << fRawRun->GetRunNumber()<< ", " 214 << fMcEvt->GetEvtNumber() << ", " << Theta << endl;138 << fMcEvt->GetEvtNumber() << ", " << theta << endl; 215 139 rc = 1; 216 140 } 217 141 218 else if ( Theta >ThetaMax )142 else if ( theta > fThetaMax ) 219 143 { 220 144 rc = 2; … … 227 151 } 228 152 229 f Errors[rc]++;153 fCut[rc]++; 230 154 231 155 return rc==0 ? kTRUE : kCONTINUE; … … 246 170 const Int_t entries = fEvt->GetNumPixels(); 247 171 248 //$$$$$$$$$$$$$$$$$$249 //const Int_t nall = fPed->GetSize();250 //*fLog << "nall = " << nall << endl;251 //for (Int_t id=0; id<nall; id++)252 //{253 // MGeomPix &gpix = (*fCam)[id];254 // if ( gpix.IsInOutermostRing() )255 // {256 // *fLog << "IsInOutermostRing : pixel no. = " << id << endl;257 // }258 259 // if ( gpix.IsInOuterRing() )260 // {261 // *fLog << "IsInOuterRing : pixel no. = " << id << endl;262 // }263 //}264 //$$$$$$$$$$$$$$$$$$265 266 267 172 for (Int_t i=0; i<entries; i++) 268 173 { … … 316 221 *fLog << GetDescriptor() << " execution statistics:" << endl; 317 222 *fLog << dec << setfill(' '); 318 *fLog << " " << setw(7) << f Errors[1] << " (" << setw(3)319 << (int)(f Errors[1]*100/GetNumExecutions())320 << "%) Evts skipped due to: Zenith angle < " << ThetaMin << endl;321 322 *fLog << " " << setw(7) << f Errors[2] << " (" << setw(3)323 << (int)(f Errors[2]*100/GetNumExecutions())324 << "%) Evts skipped due to: Zenith angle > " << ThetaMax << endl;325 326 *fLog << " " << setw(7) << f Errors[3] << " (" << setw(3)327 << (int)(f Errors[3]*100/GetNumExecutions())223 *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) 224 << (int)(fCut[1]*100/GetNumExecutions()) 225 << "%) Evts skipped due to: Zenith angle < " << fThetaMin << endl; 226 227 *fLog << " " << setw(7) << fCut[2] << " (" << setw(3) 228 << (int)(fCut[2]*100/GetNumExecutions()) 229 << "%) Evts skipped due to: Zenith angle > " << fThetaMax << endl; 230 231 *fLog << " " << setw(7) << fCut[3] << " (" << setw(3) 232 << (int)(fCut[3]*100/GetNumExecutions()) 328 233 << "%) Evts skipped due to: Software trigger not fullfilled" << endl; 329 234 330 *fLog << " " << f Errors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions())235 *fLog << " " << fCut[0] << " (" << (int)(fCut[0]*100/GetNumExecutions()) 331 236 << "%) Evts survived Basic selections!" << endl; 332 237 *fLog << endl; … … 336 241 337 242 243 244 245 246 247 248 249 -
trunk/MagicSoft/Mars/manalysis/MSelBasic.h
r1872 r1888 24 24 { 25 25 private: 26 const MPedestalCam *fPed; // Pedestal information27 const MGeomCam *fCam; // Camera Geometry28 const MCerPhotEvt *fEvt; // Cerenkov Photon Event29 const MMcEvt *fMcEvt;26 const MPedestalCam *fPed; // Pedestal information 27 const MGeomCam *fCam; // Camera Geometry 28 const MCerPhotEvt *fEvt; // Cerenkov Photon Event 29 const MMcEvt *fMcEvt; 30 30 const MRawRunHeader *fRawRun; 31 31 32 Double_tThetaMin;33 Double_tThetaMax;32 Float_t fThetaMin; 33 Float_t fThetaMax; 34 34 35 Int_t f Errors[4];35 Int_t fCut[4]; 36 36 37 37 public: … … 43 43 44 44 Bool_t SwTrigger(); 45 void SetCuts(Float_t thetamin, Float_t thetamax) 46 { fThetaMin = thetamin; fThetaMax = thetamax; } 45 47 46 48 ClassDef(MSelBasic, 0) // Task to evaluate basic cuts -
trunk/MagicSoft/Mars/manalysis/MSelFinal.cc
r1885 r1888 67 67 fHilSrcName = HilSrcName; 68 68 69 fHadronnessCut = 0.2; 70 fAlphaCut = 100.0; //degrees 69 // default values of cuts 70 fHadronnessMax = 1.0; 71 fAlphaMax = 100.0; //degrees 71 72 } 72 73 … … 109 110 } 110 111 111 memset(f Errors, 0, sizeof(fErrors));112 memset(fCut, 0, sizeof(fCut)); 112 113 113 114 return kTRUE; … … 133 134 Double_t h = fHadronness->GetHadronness(); 134 135 135 if ( h>fHadronness Cut)136 if ( h>fHadronnessMax ) 136 137 { 137 138 //*fLog << "MSelFinal::Process; h, alpha = " << h << ", " … … 140 141 } 141 142 142 else if ( modalpha > fAlpha Cut)143 else if ( modalpha > fAlphaMax ) 143 144 { 144 145 //*fLog << "MSelFinal::Process; h, alpha = " << h << ", " … … 147 148 } 148 149 149 f Errors[rc]++;150 fCut[rc]++; 150 151 151 152 return rc==0 ? kTRUE : kCONTINUE; … … 164 165 *fLog << GetDescriptor() << " execution statistics:" << endl; 165 166 *fLog << dec << setfill(' '); 166 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 167 << (int)(fErrors[1]*100/GetNumExecutions()) 168 << "%) Evts skipped due to: g/h separation cut (" << fHadronnessCut 169 << ")" << endl; 167 *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) 168 << (int)(fCut[1]*100/GetNumExecutions()) 169 << "%) Evts skipped due to: hadroness > "<< fHadronnessMax << endl; 170 170 171 *fLog << " " << setw(7) << f Errors[2] << " (" << setw(3)172 << (int)(f Errors[2]*100/GetNumExecutions())173 << "%) Evts skipped due to: cut in ALPHA (" << fAlphaCut174 << " degrees)" << endl;171 *fLog << " " << setw(7) << fCut[2] << " (" << setw(3) 172 << (int)(fCut[2]*100/GetNumExecutions()) 173 << "%) Evts skipped due to: |ALPHA| > " << fAlphaMax 174 << " [degrees]" << endl; 175 175 176 *fLog << " " << f Errors[0] << " ("177 << (int)(f Errors[0]*100/GetNumExecutions())176 *fLog << " " << fCut[0] << " (" 177 << (int)(fCut[0]*100/GetNumExecutions()) 178 178 << "%) Evts survived Final selections!" << endl; 179 179 *fLog << endl; -
trunk/MagicSoft/Mars/manalysis/MSelFinal.h
r1847 r1888 32 32 33 33 Double_t fMm2Deg; // conversion mm to degrees in camera 34 Int_t f Errors[3];34 Int_t fCut[3]; 35 35 TString fHilName; 36 36 TString fHilSrcName; 37 37 38 Float_t fHadronness Cut;39 Float_t fAlpha Cut;38 Float_t fHadronnessMax; 39 Float_t fAlphaMax; 40 40 41 41 public: … … 47 47 Bool_t PostProcess(); 48 48 49 void Set HadronnessCut(Float_t hadcut) { fHadronnessCut = hadcut; }50 void SetAlphaCut(Float_t alpha) { fAlphaCut = alpha; }49 void SetCuts(Float_t hadmax, Float_t alphamax) 50 { fHadronnessMax = hadmax; fAlphaMax = alphamax; } 51 51 52 52 ClassDef(MSelFinal, 0) // Task to evaluate final cuts -
trunk/MagicSoft/Mars/manalysis/MSelStandard.cc
r1885 r1888 64 64 fHilName = HilName; 65 65 fHilSrcName = HilSrcName; 66 67 // default values of cuts 68 fUsedPixelsMax = 92; 69 fCorePixelsMin = 4; 70 fSizeMin = 60; 71 fDistMin = 0.4; 72 fDistMax = 1.05; 73 fLengthMin = 0.0; 74 fWidthMin = 0.0; 66 75 } 67 76 … … 114 123 //*fLog << "fMm2Deg = " << fMm2Deg << endl; 115 124 116 memset(f Errors, 0, sizeof(fErrors));125 memset(fCut, 0, sizeof(fCut)); 117 126 118 127 return kTRUE; … … 131 140 Int_t rc = 0; 132 141 133 Double_t fLength = fHil->GetLength() * fMm2Deg; 134 Double_t fWidth = fHil->GetWidth() * fMm2Deg; 135 Double_t fDist = fHilSrc->GetDist()* fMm2Deg; 136 //Double_t fDelta = fHil->GetDelta() * kRad2Deg; 137 Double_t fSize = fHil->GetSize(); 138 Int_t fNumUsedPixels = fHil->GetNumUsedPixels(); 139 Int_t fNumCorePixels = fHil->GetNumCorePixels(); 140 141 if ( fNumUsedPixels >= 92 || fNumCorePixels <= 4 ) 142 { 143 //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = " 144 // << fSize << ", " << fDist << ", " << fNumUsedPixels << ", " 145 // << fNumCorePixels << endl; 142 Double_t length = fHil->GetLength() * fMm2Deg; 143 Double_t width = fHil->GetWidth() * fMm2Deg; 144 Double_t dist = fHilSrc->GetDist()* fMm2Deg; 145 //Double_t delta = fHil->GetDelta() * kRad2Deg; 146 Double_t size = fHil->GetSize(); 147 Int_t numusedpixels = fHil->GetNumUsedPixels(); 148 Int_t numcorepixels = fHil->GetNumCorePixels(); 149 150 if ( numusedpixels >= fUsedPixelsMax || numcorepixels <= fCorePixelsMin ) 151 { 146 152 rc = 1; 147 153 } 148 154 149 else if ( fSize <= 60.0 || fDist< 0.4 || fDist > 1.05 ) 150 { 151 //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = " 152 // << fSize << ", " << fDist << ", " << fNumUsedPixels << ", " 153 // << fNumCorePixels << endl; 155 else if ( size <= fSizeMin ) 156 { 154 157 rc = 2; 155 158 } 156 159 157 else if ( fLength <= 0.0 || fWidth <= 0.0 ) 158 { 159 //*fLog << "MSelStandard::Process; fLength, fWidth = " 160 // << fLength << ", " << fWidth << endl; 160 else if ( dist< fDistMin || dist > fDistMax ) 161 { 161 162 rc = 3; 162 163 } 163 164 164 165 fErrors[rc]++; 165 else if ( length <= fLengthMin || width <= fWidthMin ) 166 { 167 rc = 4; 168 } 169 170 171 fCut[rc]++; 166 172 167 173 return rc==0 ? kTRUE : kCONTINUE; … … 180 186 *fLog << GetDescriptor() << " execution statistics:" << endl; 181 187 *fLog << dec << setfill(' '); 182 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 183 << (int)(fErrors[1]*100/GetNumExecutions()) 184 << "%) Evts skipped due to: Requirements on no.of used or core pxels not fullfilled" << endl; 185 186 *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) 187 << (int)(fErrors[2]*100/GetNumExecutions()) 188 << "%) Evts skipped due to: Requirements on SIZE or DIST not fullfilled" << endl; 189 190 *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) 191 << (int)(fErrors[3]*100/GetNumExecutions()) 192 << "%) Evts skipped due to: Length or Width is <= 0" << endl; 193 194 *fLog << " " << fErrors[0] << " (" 195 << (int)(fErrors[0]*100/GetNumExecutions()) 188 *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) 189 << (int)(fCut[1]*100/GetNumExecutions()) 190 << "%) Evts skipped due to: Used pixels >= " << fUsedPixelsMax 191 << " or Core pixels <= " << fCorePixelsMin << endl; 192 193 *fLog << " " << setw(7) << fCut[2] << " (" << setw(3) 194 << (int)(fCut[2]*100/GetNumExecutions()) 195 << "%) Evts skipped due to: SIZE <= " << fSizeMin << endl; 196 197 *fLog << " " << setw(7) << fCut[3] << " (" << setw(3) 198 << (int)(fCut[3]*100/GetNumExecutions()) 199 << "%) Evts skipped due to: DIST < " << fDistMin 200 << " or DIST > " << fDistMax << endl; 201 202 *fLog << " " << setw(7) << fCut[4] << " (" << setw(3) 203 << (int)(fCut[4]*100/GetNumExecutions()) 204 << "%) Evts skipped due to: LENGTH <= " << fLengthMin 205 << " or WIDTH <= " << fWidthMin << endl; 206 207 *fLog << " " << fCut[0] << " (" 208 << (int)(fCut[0]*100/GetNumExecutions()) 196 209 << "%) Evts survived Standard selections!" << endl; 197 210 *fLog << endl; … … 201 214 202 215 216 217 218 219 220 221 222 223 224 225 -
trunk/MagicSoft/Mars/manalysis/MSelStandard.h
r1847 r1888 30 30 31 31 Double_t fMm2Deg; // conversion mm to degrees in camera 32 Int_t f Errors[4];32 Int_t fCut[5]; 33 33 TString fHilName; 34 34 TString fHilSrcName; 35 36 Float_t fUsedPixelsMax; 37 Float_t fCorePixelsMin; 38 Float_t fSizeMin; 39 Float_t fDistMin; 40 Float_t fDistMax; 41 Float_t fLengthMin; 42 Float_t fWidthMin; 35 43 36 44 public: … … 42 50 Bool_t PostProcess(); 43 51 52 void SetCuts(Float_t usedpixelsmax, Float_t corepixelsmin, 53 Float_t sizemin, Float_t distmin, Float_t distmax, 54 Float_t lengthmin, Float_t widthmin) 55 { fUsedPixelsMax = usedpixelsmax; fCorePixelsMin = corepixelsmin; 56 fSizeMin = sizemin; fDistMin = distmin; fDistMax = distmax; 57 fLengthMin = lengthmin; fWidthMin = widthmin; } 44 58 45 59 ClassDef(MSelStandard, 0) // Task to evaluate standard cuts -
trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc
r1880 r1888 79 79 #include "MMcEvt.hxx" 80 80 #include "MMcTrig.hxx" 81 #include "MBinning.h" 82 83 #include "TRandom3.h" 84 #include "MParameters.h" 81 85 82 86 ClassImp(MCT1ReadPreProc); … … 119 123 // Add this file as the last entry in the chain 120 124 // 121 Int_t MCT1ReadPreProc::AddFile(const char *txt, Int_t)125 void MCT1ReadPreProc::AddFile(const char *txt) 122 126 { 123 127 const char *name = gSystem->ExpandPathName(txt); … … 129 133 { 130 134 *fLog << warn << "WARNING - Problem reading header... ignored." << endl; 131 return 0;135 return; 132 136 } 133 137 … … 136 140 { 137 141 *fLog << warn << "WARNING - File contains no data... ignored." << endl; 138 return 0;142 return; 139 143 } 140 144 … … 144 148 145 149 fFileNames->AddLast(new TNamed(txt, "")); 146 return 1;147 150 } 148 151 … … 703 706 704 707 // 708 // look for the HourAngle container in the plist 709 // 710 fHourAngle = (MParameterD*)pList->FindCreateObj("MParameterD","HourAngle"); 711 if (!fHourAngle) 712 return kFALSE; 713 fHourAngle->SetTitle("Store the CT1 hour angle [deg]"); 714 715 // 716 // look for the ThetaOrig container in the plist 717 // 718 fThetaOrig = (MParameterD*)pList->FindCreateObj("MParameterD","ThetaOrig"); 719 if (!fThetaOrig) 720 return kFALSE; 721 fThetaOrig->SetTitle("Store the original CT1 zenith angle [rad]"); 722 723 // 705 724 // look for the MCerPhotEvt class in the plist 706 725 // … … 772 791 773 792 return GetSelector() ? GetSelector()->CallPreProcess(pList) : kTRUE; 793 } 794 795 796 // -------------------------------------------------------------------------- 797 // 798 // Smear Theta uniformly in a bin of Theta; result is stored in ThetaSmeared 799 // 800 // 801 Bool_t MCT1ReadPreProc::SmearTheta(MParList *plist, Float_t *Theta, 802 Float_t *ThetaSmeared) 803 { 804 // both Theta and ThetaSmeared are in [radians] 805 // the edges are in [degrees] 806 807 const MBinning *binstheta = (MBinning*)plist->FindObject("BinningTheta"); 808 if (!binstheta) 809 { 810 *fLog << err << dbginf << "BinningTheta not found ... aborting." << endl; 811 return kFALSE; 812 } 813 814 Int_t nedges = binstheta->GetNumEdges(); 815 Double_t *edges = (Double_t*)binstheta->GetEdges(); 816 817 Int_t bin = -1; 818 *ThetaSmeared = *Theta; 819 820 Float_t Thetadeg = (*Theta) * 180.0/TMath::Pi(); 821 Float_t ThetaSmeareddeg; 822 823 // search Theta bin 824 Int_t i; 825 for (i=1; i<nedges; i++) 826 { 827 if (Thetadeg >= *(edges+i) ) continue; 828 if (Thetadeg < *(edges+i-1)) break; 829 bin = i; 830 break; 831 } 832 833 Float_t low=0.0; 834 Float_t up =0.0; 835 836 // smear Theta within the Theta bin 837 ThetaSmeareddeg = -1.0; 838 if (bin != -1) 839 { 840 low = *(edges+bin-1); 841 up = *(edges+bin); 842 843 Double_t ran = ran3.Rndm(1); 844 ThetaSmeareddeg = (low + ran * (up-low)); 845 } 846 *ThetaSmeared = ThetaSmeareddeg * TMath::Pi()/180.0; 847 848 //*fLog << "SmearTheta : Thetadeg, ThetaSmeareddeg, low, up, bin = " 849 // << Thetadeg 850 // << ", " << ThetaSmeareddeg << ", " << low << ", " << up << ", " 851 // << bin << endl; 852 853 return kTRUE; 774 854 } 775 855 … … 860 940 // int ipreproc_alt_arcs; // "should be" alt according to preproc (arcseconds) 861 941 // int ipreproc_az_arcs; // "should be" az according to preproc (arcseconds) 942 943 // smear Theta in its Theta bin 944 Float_t ThetaOrig = TMath::Pi()*(0.5-1./180*event.ialt_arcs/3600); // [radians] 945 Float_t ThetaSmeared; // [radians] 946 SmearTheta(fParList, &ThetaOrig, &ThetaSmeared); 947 fThetaOrig->SetVal(ThetaOrig); 948 949 // store hour angle 950 fHourAngle->SetVal(event.fhourangle); 951 952 //*fLog << "MCt1ReadPreProc::ProcessEvent; fhourangle = " 953 // << event.fhourangle << endl; 862 954 863 955 fMcEvt->Fill(event.isecs_since_midday, //0, /*fEvtNum*/ … … 877 969 fIsMcFile ? event.imcimpact_m*100 : 0, 878 970 TMath::Pi()/180*event.iaz_arcs/3600, // azimuth (arcseconds) 879 T Math::Pi()*(0.5-1./180*event.ialt_arcs/3600), // altitude (arcseconds)971 ThetaSmeared, 880 972 0, /* fTFirst */ 881 973 0, /* fTLast */ … … 895 987 0, /* elec */ 896 988 0, /* muon */ 897 event.fhourangle/* other */989 0 /* other */ 898 990 ); 899 991 -
trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.h
r1880 r1888 9 9 #include "MRead.h" 10 10 #endif 11 12 #include <TRandom3.h> 11 13 12 14 class TList; … … 22 24 class MTaskList; 23 25 class MParList; 26 class MParameterD; 24 27 25 28 struct outputpars; … … 42 45 MRawRunHeader *fRawRunHeader; // raw run header 43 46 MParList *fParList; // parameter list 47 MParameterD *fHourAngle; // hour angle [deg] 48 MParameterD *fThetaOrig; // original zenith angle [rad] 44 49 45 50 Bool_t fIsMcFile; // Flag whether current run is a MC run … … 53 58 TArrayF fPedRMS; 54 59 60 TRandom3 ran3; 55 61 56 62 Bool_t OpenNextFile(); … … 77 83 ~MCT1ReadPreProc(); 78 84 79 Int_t AddFile(const char *fname, Int_t dummy=-1);85 void AddFile(const char *fname); 80 86 81 87 UInt_t GetEntries() { return fEntries; } 88 89 Bool_t SmearTheta(MParList *plist, Float_t *theta, Float_t *thetasmeared); 82 90 83 91 ClassDef(MCT1ReadPreProc, 0) // Reads the CT1 preproc data file … … 86 94 #endif 87 95 96 97 -
trunk/MagicSoft/Mars/mfileio/Makefile
r1600 r1888 20 20 # @endcode 21 21 22 INCLUDES = -I. -I../mbase -I../mraw -I../mmc -I../mdata -I../manalysis -I../mgeom 22 INCLUDES = -I. -I../mbase -I../mraw -I../mmc -I../mdata -I../manalysis -I../mgeom -I../mhist 23 23 24 24 # @code
Note:
See TracChangeset
for help on using the changeset viewer.