Ignore:
Timestamp:
02/03/15 14:08:30 (10 years ago)
Author:
ghughes
Message:
Added Scaled Width and Length Parameters to output
Location:
branches/Mars_McMismatchStudy/manalysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Mars_McMismatchStudy/manalysis/MEnergyTable.cc

    r18101 r18102  
    6868    fNameMC = "MMcEvt";
    6969    fNamePoint = "MPointingPos";
     70
    7071    //fNameParameter = "MParameterD";
    71     fNameParameter = "MEnergyTable";
     72
     73    fNameParameter  = "MEnergyTable";
     74    fNameParameterL = "ScaledLength";
     75    fNameParameterW = "ScaledWidth";
    7276
    7377    SetNameParameter("MEnergyTable");
     
    8589    delete fHillas;
    8690    delete fParameter;
     91    delete fParameterL;
     92    delete fParameterW;
    8793    delete fPointing;
    8894
     
    108114    fParameter = (MParameterD*)pList->FindCreateObj("MParameterD", fNameParameter);
    109115    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)
    110124        return kFALSE;
    111125
     
    141155    iY = hEnergy[iZenith][0]->GetYaxis()->FindBin(fDist);
    142156    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
    143162
    144163    iX = hEnergy[iZenith+1][0]->GetXaxis()->FindBin(log10(fSize));
    145164    iY = hEnergy[iZenith+1][0]->GetYaxis()->FindBin(fDist);
    146165    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);
    147170
    148171    fEnergyRecon = fEnergy2-fEnergy1;
     
    151174    fEnergyRecon += fEnergy1;
    152175
     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
    153200  }
    154201
    155202   fParameter->SetVal(fEnergyRecon);
    156203   fParameter->SetReadyToSave();
     204
     205   fParameterW->SetVal(RSW);
     206   fParameterW->SetReadyToSave();
     207   fParameterL->SetVal(RSL);
     208   fParameterL->SetReadyToSave();
     209
    157210   return kTRUE;
    158211
     
    182235     for( int j = 0; j < 3; j++ )
    183236     {
     237
    184238        sprintf(sHistDir,"z%.2d/t%.2d",iZen[i],iThr[j]);
    185239        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
    186245        if( fTableFile->GetDirectory(sHistDir) )
    187246        {
    188247          fTableFile->cd(sHistDir);
    189248          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
    191256        } else
    192257        {
     
    195260        }
    196261     }
    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
    199275   }
    200276
  • branches/Mars_McMismatchStudy/manalysis/MEnergyTable.h

    r18101 r18102  
    3434private:
    3535
     36    MParameterD   *fParameterW;
     37    MParameterD   *fParameterL;
    3638    MParameterD   *fParameter;
    3739    MHillasSrc    *fHillasSrc;
     
    4547    TString   fNameMC;
    4648    TString   fNameParameter;
     49    TString   fNameParameterW;
     50    TString   fNameParameterL;
    4751
    4852    Double_t fMm2Deg;
     
    5559    char sHistDir[500];
    5660    char sHistName[500];
     61    char sHistNameL[500];
     62    char sHistNameLS[500];
     63    char sHistNameW[500];
     64    char sHistNameWS[500];
    5765    int iZen[3];
    5866    int iThr[3];
    5967
    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
    6174    vector< vector<TH2F *> > hEnergy;
     75    vector< vector<TH2F *> > hLength;
     76    vector< vector<TH2F *> > hLengthSigma;
     77    vector< vector<TH2F *> > hWidth;
     78    vector< vector<TH2F *> > hWidthSigma;
    6279
    6380    Float_t fZenith;
     
    7087    float fEnergy2;
    7188    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;
    72105
    73106public:
Note: See TracChangeset for help on using the changeset viewer.