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