1 |
/* |
2 |
* ZenVsAzAngleHistoAction.cpp |
3 |
* |
4 |
* Created on: 28-marth-2010 |
5 |
* Author: Vitaly Malakhov |
6 |
*/ |
7 |
|
8 |
/*! @file ZenVsAzAngleHistoAction.cpp The ZenVsAzAbnleHistoAction class implementation file. */ |
9 |
|
10 |
#include "ZenVsAzAngleHistoAction.h" |
11 |
#include "TMath.h" |
12 |
|
13 |
ZenVsAzAngleHistoAction::ZenVsAzAngleHistoAction(const char *actionName, TString outFileBase, TString mode, |
14 |
bool outRoot, bool outText, TString title) : |
15 |
Histo2DAction<Int_t> (actionName, title, outFileBase, mode, outRoot, outText){ |
16 |
|
17 |
} |
18 |
|
19 |
void ZenVsAzAngleHistoAction::OnGood(PamLevel2 *event) { |
20 |
PamTrack *track; |
21 |
track = event->GetTrack(0); |
22 |
Float_t Aaxv = TMath::Abs(track->GetTrkTrack()->axv[0])*TMath::DegToRad(); |
23 |
Float_t Aayv = TMath::Abs(track->GetTrkTrack()->ayv[0])*TMath::DegToRad(); |
24 |
Float_t PamZenith = TMath::RadToDeg()*asin(sqrt(pow(sin(Aayv), 2) + pow(sin(Aaxv), 2))); |
25 |
|
26 |
Float_t axv = -track->GetTrkTrack()->axv[0] * TMath::DegToRad(); |
27 |
Float_t ayv = -track->GetTrkTrack()->ayv[0] * TMath::DegToRad(); |
28 |
Float_t angle = atan(sin(TMath::Abs(ayv))/sin(TMath::Abs(axv))) * TMath::RadToDeg(); |
29 |
|
30 |
Float_t PamAzim = 360. - angle; |
31 |
if(axv>=0 && ayv >=0) PamAzim = angle; |
32 |
if(axv<0 && ayv >0) PamAzim = 180. - angle; |
33 |
if(axv<0 && ayv <0) PamAzim = 180. + angle; |
34 |
|
35 |
PamAzim = PamAzim * TMath::DegToRad(); |
36 |
PamZenith = (180 - PamZenith) * TMath::DegToRad(); |
37 |
|
38 |
Fill(TMath::RadToDeg()*PamAzim, TMath::RadToDeg()*PamZenith); |
39 |
} |