]>
Commit | Line | Data |
---|---|---|
2410262d | 1 | /************************************************************************** |
2374af72 | 2 | * This file is property of and copyright by the ALICE HLT Project * |
3 | * All rights reserved. * | |
2410262d | 4 | * * |
2374af72 | 5 | * Primary Authors: Oystein Djuvsland * |
2410262d | 6 | * * |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
2374af72 | 12 | * about the suitability of this software for any purpose. It is * |
2410262d | 13 | * provided "as is" without express or implied warranty. * |
14 | **************************************************************************/ | |
15 | ||
2374af72 | 16 | /** |
17 | * @file AliHLTPHOSPhysicsAnalyzer.cxx | |
18 | * @author Oystein Djuvsland | |
19 | * @date | |
20 | * @brief Physics analysis base class */ | |
21 | ||
22 | // see header file for class documentation | |
23 | // or | |
24 | // refer to README to build package | |
25 | // or | |
26 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
2410262d | 27 | |
28 | #include "AliHLTPHOSPhysicsAnalyzer.h" | |
29 | #include "TVector3.h" | |
30 | #include "TFile.h" | |
31 | #include "TMath.h" | |
91b95d47 | 32 | #include "TH1F.h" |
d6e6cb01 | 33 | #include "AliPHOSGeometry.h" |
91b95d47 | 34 | #include "Rtypes.h" |
35 | #include "AliHLTPHOSCommonDefs.h" | |
2374af72 | 36 | #include "AliHLTPHOSRecPointDataStruct.h" |
91b95d47 | 37 | |
2410262d | 38 | |
39 | ClassImp(AliHLTPHOSPhysicsAnalyzer); | |
40 | ||
25b7f84c | 41 | AliHLTPHOSPhysicsAnalyzer::AliHLTPHOSPhysicsAnalyzer(): |
42 | fRecPointsPtr(0), | |
43 | fRootHistPtr(0), | |
44 | fPHOSRadius(0) | |
2410262d | 45 | { |
91b95d47 | 46 | //Constructor |
2374af72 | 47 | //See header file for documentation |
2410262d | 48 | AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV"); |
49 | ||
2374af72 | 50 | // fPHOSRadius = geom->GetIPtoCrystalSurface(); |
25b7f84c | 51 | fPHOSRadius = geom->GetIPtoCrystalSurface(); |
2374af72 | 52 | |
b444d727 | 53 | for(int i = 0; i < N_MODULES; i++) |
2410262d | 54 | { |
94594220 | 55 | // fRotParametersCos[i] = cos((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360); |
56 | // fRotParametersSin[i] = sin((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360); | |
57 | fRotParametersCos[i] = cos((geom->GetPHOSAngle(i))*2*TMath::Pi()/360); | |
58 | fRotParametersSin[i] = sin((geom->GetPHOSAngle(i))*2*TMath::Pi()/360); | |
59 | ||
2410262d | 60 | } |
61 | } | |
2374af72 | 62 | /* |
6e709a0d | 63 | AliHLTPHOSPhysicsAnalyzer::AliHLTPHOSPhysicsAnalyzer(const AliHLTPHOSPhysicsAnalyzer &):fClustersPtr(0), fRootHistPtr(0), fPHOSRadius(0) |
2410262d | 64 | |
65 | { | |
91b95d47 | 66 | //Cooy constructor |
2374af72 | 67 | //See header file for documentation |
2410262d | 68 | AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV"); |
69 | ||
70 | fPHOSRadius = geom->GetIPtoCrystalSurface(); | |
71 | ||
1804b020 | 72 | for(UInt_t i = 0; i < N_MODULES; i++) |
2410262d | 73 | { |
74 | fRotParametersCos[i] = cos((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360); | |
75 | ||
76 | fRotParametersSin[i] = sin((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360); | |
77 | } | |
91b95d47 | 78 | |
2410262d | 79 | } |
2374af72 | 80 | */ |
2410262d | 81 | |
82 | AliHLTPHOSPhysicsAnalyzer::~AliHLTPHOSPhysicsAnalyzer() | |
83 | { | |
91b95d47 | 84 | //Destructor |
2374af72 | 85 | //See header file for documentation |
86 | fRecPointsPtr = 0; | |
91b95d47 | 87 | fRootHistPtr = 0; |
2410262d | 88 | } |
89 | ||
90 | void | |
25b7f84c | 91 | AliHLTPHOSPhysicsAnalyzer::LocalPosition(AliHLTPHOSRecPointDataStruct* /*recPointPtr*/, Float_t* /*locPositionPtr*/) |
2410262d | 92 | { |
2374af72 | 93 | //Get local position for a recPoint |
2410262d | 94 | |
2374af72 | 95 | // locPositionPtr[0] = recPointPtr->fLocalPositionPtr[0]; |
96 | //locPositionPtr[1] = recPointPtr->fLocalPositionPtr[1]; | |
2410262d | 97 | |
98 | } | |
99 | ||
100 | void | |
2374af72 | 101 | AliHLTPHOSPhysicsAnalyzer::GlobalPosition(AliHLTPHOSRecPointDataStruct* recPointPtr, Float_t* positionPtr) |
2410262d | 102 | { |
2374af72 | 103 | //Get global position for a recPoint |
104 | //See header file for documentation | |
2410262d | 105 | Float_t tempPosX = 0; |
25b7f84c | 106 | |
107 | ||
108 | Int_t module = recPointPtr->fModule; | |
2374af72 | 109 | |
110 | tempPosX = kCRYSTAL_SIZE*(recPointPtr->fX-N_XCOLUMNS_MOD/2) + kCRYSTAL_SIZE/2; | |
2410262d | 111 | |
112 | positionPtr[0] = tempPosX*fRotParametersSin[module] + fPHOSRadius*fRotParametersCos[module]; | |
113 | ||
114 | positionPtr[1] = tempPosX*fRotParametersCos[module] - fPHOSRadius*fRotParametersSin[module]; | |
25b7f84c | 115 | |
2374af72 | 116 | positionPtr[2] = kCRYSTAL_SIZE*(recPointPtr->fZ-N_ZROWS_MOD/2) + kCRYSTAL_SIZE/2; |
2410262d | 117 | |
118 | } | |
119 | ||
120 | void | |
121 | AliHLTPHOSPhysicsAnalyzer::GlobalPosition(Float_t* locPositionPtr, Float_t* positionPtr, Int_t module) | |
122 | { | |
91b95d47 | 123 | //Get global position from local postion and module number |
2374af72 | 124 | //See header file for documentation |
25b7f84c | 125 | positionPtr[0] = kCRYSTAL_SIZE*(locPositionPtr[0]-N_XCOLUMNS_MOD/2)*fRotParametersCos[module] + fPHOSRadius*fRotParametersSin[module]; |
91b95d47 | 126 | |
25b7f84c | 127 | positionPtr[1] = kCRYSTAL_SIZE*(locPositionPtr[0]-N_XCOLUMNS_MOD/2)*fRotParametersSin[module] - fPHOSRadius*fRotParametersCos[module]; |
2410262d | 128 | |
442af5b7 | 129 | positionPtr[2] = kCRYSTAL_SIZE*(locPositionPtr[1]-N_ZROWS_MOD); |
2410262d | 130 | |
131 | } | |
132 | ||
133 | void | |
134 | AliHLTPHOSPhysicsAnalyzer::WriteHistogram(Char_t* fileName) | |
135 | { | |
91b95d47 | 136 | //Write the histogram |
2374af72 | 137 | //See header file for documentation |
2410262d | 138 | TFile *outfile = new TFile(fileName,"recreate"); |
139 | ||
140 | fRootHistPtr->Write(); | |
141 | ||
142 | outfile->Close(); | |
91b95d47 | 143 | |
144 | delete outfile; | |
145 | outfile = 0; | |
2410262d | 146 | |
147 | } | |
148 | ||
149 |