Changeset 18102 for branches/Mars_McMismatchStudy/manalysis
- Timestamp:
- 02/03/15 14:08:30 (10 years ago)
- Location:
- branches/Mars_McMismatchStudy/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Mars_McMismatchStudy/manalysis/MEnergyTable.cc
r18101 r18102 68 68 fNameMC = "MMcEvt"; 69 69 fNamePoint = "MPointingPos"; 70 70 71 //fNameParameter = "MParameterD"; 71 fNameParameter = "MEnergyTable"; 72 73 fNameParameter = "MEnergyTable"; 74 fNameParameterL = "ScaledLength"; 75 fNameParameterW = "ScaledWidth"; 72 76 73 77 SetNameParameter("MEnergyTable"); … … 85 89 delete fHillas; 86 90 delete fParameter; 91 delete fParameterL; 92 delete fParameterW; 87 93 delete fPointing; 88 94 … … 108 114 fParameter = (MParameterD*)pList->FindCreateObj("MParameterD", fNameParameter); 109 115 if (!fParameter) 116 return kFALSE; 117 118 fParameterW = (MParameterD*)pList->FindCreateObj("MParameterD", fNameParameterW); 119 if (!fParameterW) 120 return kFALSE; 121 122 fParameterL = (MParameterD*)pList->FindCreateObj("MParameterD", fNameParameterL); 123 if (!fParameterL) 110 124 return kFALSE; 111 125 … … 141 155 iY = hEnergy[iZenith][0]->GetYaxis()->FindBin(fDist); 142 156 fEnergy1 = hEnergy[iZenith][0]->GetBinContent(iX,iY); 157 fLength1 = hLength[iZenith][0]->GetBinContent(iX,iY); 158 fLengthSigma1 = hLength[iZenith][0]->GetBinContent(iX,iY); 159 fWidth1 = hLength[iZenith][0]->GetBinContent(iX,iY); 160 fWidthSigma1 = hLength[iZenith][0]->GetBinContent(iX,iY); 161 143 162 144 163 iX = hEnergy[iZenith+1][0]->GetXaxis()->FindBin(log10(fSize)); 145 164 iY = hEnergy[iZenith+1][0]->GetYaxis()->FindBin(fDist); 146 165 fEnergy2 = hEnergy[iZenith+1][0]->GetBinContent(iX,iY); 166 fLength2 = hLength[iZenith+1][0]->GetBinContent(iX,iY); 167 fLengthSigma2 = hLength[iZenith+1][0]->GetBinContent(iX,iY); 168 fWidth2 = hLength[iZenith+1][0]->GetBinContent(iX,iY); 169 fWidthSigma2 = hLength[iZenith+1][0]->GetBinContent(iX,iY); 147 170 148 171 fEnergyRecon = fEnergy2-fEnergy1; … … 151 174 fEnergyRecon += fEnergy1; 152 175 176 fLength = fLength2-fLength1; 177 fLength /= cos(D2R*iZen[iZenith+1]) - cos(D2R*iZen[iZenith]); 178 fLength *= cos(D2R*fZenith) - cos(D2R*iZen[iZenith]); 179 fLength += fLength1; 180 181 fLengthSigma = fLengthSigma2-fLengthSigma1; 182 fLengthSigma /= cos(D2R*iZen[iZenith+1]) - cos(D2R*iZen[iZenith]); 183 fLengthSigma *= cos(D2R*fZenith) - cos(D2R*iZen[iZenith]); 184 fLengthSigma += fLengthSigma1; 185 186 fWidth = fWidth2-fWidth1; 187 fWidth /= cos(D2R*iZen[iZenith+1]) - cos(D2R*iZen[iZenith]); 188 fWidth *= cos(D2R*fZenith) - cos(D2R*iZen[iZenith]); 189 fWidth += fWidth1; 190 191 fWidthSigma = fWidthSigma2-fWidthSigma1; 192 fWidthSigma /= cos(D2R*iZen[iZenith+1]) - cos(D2R*iZen[iZenith]); 193 fWidthSigma *= cos(D2R*fZenith) - cos(D2R*iZen[iZenith]); 194 fWidthSigma += fWidthSigma1; 195 196 197 RSW = (fHillas->GetWidth()-fWidth)/fWidthSigma; 198 RSL = (fHillas->GetLength()-fLength)/fLengthSigma; 199 153 200 } 154 201 155 202 fParameter->SetVal(fEnergyRecon); 156 203 fParameter->SetReadyToSave(); 204 205 fParameterW->SetVal(RSW); 206 fParameterW->SetReadyToSave(); 207 fParameterL->SetVal(RSL); 208 fParameterL->SetReadyToSave(); 209 157 210 return kTRUE; 158 211 … … 182 235 for( int j = 0; j < 3; j++ ) 183 236 { 237 184 238 sprintf(sHistDir,"z%.2d/t%.2d",iZen[i],iThr[j]); 185 239 sprintf(sHistName,"z%.2d/t%.2d/hEnergyAverage_%.2d_%.2d",iZen[i],iThr[j],iZen[i],iThr[j]); 240 sprintf(sHistNameL,"z%.2d/t%.2d/hLengthAverage_%.2d_%.2d",iZen[i],iThr[j],iZen[i],iThr[j]); 241 sprintf(sHistNameLS,"z%.2d/t%.2d/hLengthSigma_%.2d_%.2d",iZen[i],iThr[j],iZen[i],iThr[j]); 242 sprintf(sHistNameW,"z%.2d/t%.2d/hWidthAverage_%.2d_%.2d",iZen[i],iThr[j],iZen[i],iThr[j]); 243 sprintf(sHistNameWS,"z%.2d/t%.2d/hWidthSigma_%.2d_%.2d",iZen[i],iThr[j],iZen[i],iThr[j]); 244 186 245 if( fTableFile->GetDirectory(sHistDir) ) 187 246 { 188 247 fTableFile->cd(sHistDir); 189 248 cout << "Adding: " << i << " " << j << " " << sHistDir << endl; 190 htemp.push_back( (TH2F*)fTableFile->Get(sHistName) ); 249 250 htempE.push_back( (TH2F*)fTableFile->Get(sHistName) ); 251 htempL.push_back( (TH2F*)fTableFile->Get(sHistNameL) ); 252 htempLS.push_back( (TH2F*)fTableFile->Get(sHistNameLS) ); 253 htempW.push_back( (TH2F*)fTableFile->Get(sHistNameW) ); 254 htempWS.push_back( (TH2F*)fTableFile->Get(sHistNameWS) ); 255 191 256 } else 192 257 { … … 195 260 } 196 261 } 197 hEnergy.push_back(htemp); 198 htemp.clear(); 262 263 hEnergy.push_back(htempE); 264 hLength.push_back(htempL); 265 hLengthSigma.push_back(htempLS); 266 hWidth.push_back(htempW); 267 hWidthSigma.push_back(htempWS); 268 269 htempE.clear(); 270 htempL.clear(); 271 htempLS.clear(); 272 htempW.clear(); 273 htempWS.clear(); 274 199 275 } 200 276 -
branches/Mars_McMismatchStudy/manalysis/MEnergyTable.h
r18101 r18102 34 34 private: 35 35 36 MParameterD *fParameterW; 37 MParameterD *fParameterL; 36 38 MParameterD *fParameter; 37 39 MHillasSrc *fHillasSrc; … … 45 47 TString fNameMC; 46 48 TString fNameParameter; 49 TString fNameParameterW; 50 TString fNameParameterL; 47 51 48 52 Double_t fMm2Deg; … … 55 59 char sHistDir[500]; 56 60 char sHistName[500]; 61 char sHistNameL[500]; 62 char sHistNameLS[500]; 63 char sHistNameW[500]; 64 char sHistNameWS[500]; 57 65 int iZen[3]; 58 66 int iThr[3]; 59 67 60 vector<TH2F *> htemp; 68 vector<TH2F *> htempE; 69 vector<TH2F *> htempL; 70 vector<TH2F *> htempLS; 71 vector<TH2F *> htempW; 72 vector<TH2F *> htempWS; 73 61 74 vector< vector<TH2F *> > hEnergy; 75 vector< vector<TH2F *> > hLength; 76 vector< vector<TH2F *> > hLengthSigma; 77 vector< vector<TH2F *> > hWidth; 78 vector< vector<TH2F *> > hWidthSigma; 62 79 63 80 Float_t fZenith; … … 70 87 float fEnergy2; 71 88 float fEnergyRecon; 89 90 float fLength; 91 float fWidth; 92 float fLengthSigma; 93 float fWidthSigma; 94 95 float fLength1; 96 float fLength2; 97 float fWidth1; 98 float fWidth2; 99 float fLengthSigma1; 100 float fLengthSigma2; 101 float fWidthSigma1; 102 float fWidthSigma2; 103 104 float RSW,RSL; 72 105 73 106 public:
Note:
See TracChangeset
for help on using the changeset viewer.