]>
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 |
2410262d | 50 | AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV"); |
51 | ||
2374af72 | 52 | // fPHOSRadius = geom->GetIPtoCrystalSurface(); |
25b7f84c | 53 | fPHOSRadius = geom->GetIPtoCrystalSurface(); |
2374af72 | 54 | |
b444d727 | 55 | for(int i = 0; i < N_MODULES; i++) |
2410262d | 56 | { |
94594220 | 57 | // fRotParametersCos[i] = cos((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360); |
58 | // fRotParametersSin[i] = sin((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360); | |
59 | fRotParametersCos[i] = cos((geom->GetPHOSAngle(i))*2*TMath::Pi()/360); | |
60 | fRotParametersSin[i] = sin((geom->GetPHOSAngle(i))*2*TMath::Pi()/360); | |
61 | ||
2410262d | 62 | } |
63 | } | |
2374af72 | 64 | /* |
6e709a0d | 65 | AliHLTPHOSPhysicsAnalyzer::AliHLTPHOSPhysicsAnalyzer(const AliHLTPHOSPhysicsAnalyzer &):fClustersPtr(0), fRootHistPtr(0), fPHOSRadius(0) |
2410262d | 66 | |
67 | { | |
91b95d47 | 68 | //Cooy constructor |
2374af72 | 69 | //See header file for documentation |
2410262d | 70 | AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV"); |
71 | ||
72 | fPHOSRadius = geom->GetIPtoCrystalSurface(); | |
73 | ||
1804b020 | 74 | for(UInt_t i = 0; i < N_MODULES; i++) |
2410262d | 75 | { |
76 | fRotParametersCos[i] = cos((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360); | |
77 | ||
78 | fRotParametersSin[i] = sin((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360); | |
79 | } | |
91b95d47 | 80 | |
2410262d | 81 | } |
2374af72 | 82 | */ |
2410262d | 83 | |
84 | AliHLTPHOSPhysicsAnalyzer::~AliHLTPHOSPhysicsAnalyzer() | |
85 | { | |
91b95d47 | 86 | //Destructor |
2374af72 | 87 | //See header file for documentation |
88 | fRecPointsPtr = 0; | |
91b95d47 | 89 | fRootHistPtr = 0; |
2410262d | 90 | } |
91 | ||
92 | void | |
25b7f84c | 93 | AliHLTPHOSPhysicsAnalyzer::LocalPosition(AliHLTPHOSRecPointDataStruct* /*recPointPtr*/, Float_t* /*locPositionPtr*/) |
2410262d | 94 | { |
2374af72 | 95 | //Get local position for a recPoint |
2410262d | 96 | |
2374af72 | 97 | // locPositionPtr[0] = recPointPtr->fLocalPositionPtr[0]; |
98 | //locPositionPtr[1] = recPointPtr->fLocalPositionPtr[1]; | |
2410262d | 99 | |
100 | } | |
101 | ||
102 | void | |
2374af72 | 103 | AliHLTPHOSPhysicsAnalyzer::GlobalPosition(AliHLTPHOSRecPointDataStruct* recPointPtr, Float_t* positionPtr) |
2410262d | 104 | { |
2374af72 | 105 | //Get global position for a recPoint |
106 | //See header file for documentation | |
2410262d | 107 | Float_t tempPosX = 0; |
25b7f84c | 108 | |
109 | ||
110 | Int_t module = recPointPtr->fModule; | |
2374af72 | 111 | |
112 | tempPosX = kCRYSTAL_SIZE*(recPointPtr->fX-N_XCOLUMNS_MOD/2) + kCRYSTAL_SIZE/2; | |
2410262d | 113 | |
114 | positionPtr[0] = tempPosX*fRotParametersSin[module] + fPHOSRadius*fRotParametersCos[module]; | |
115 | ||
116 | positionPtr[1] = tempPosX*fRotParametersCos[module] - fPHOSRadius*fRotParametersSin[module]; | |
25b7f84c | 117 | |
2374af72 | 118 | positionPtr[2] = kCRYSTAL_SIZE*(recPointPtr->fZ-N_ZROWS_MOD/2) + kCRYSTAL_SIZE/2; |
2410262d | 119 | |
120 | } | |
121 | ||
122 | void | |
123 | AliHLTPHOSPhysicsAnalyzer::GlobalPosition(Float_t* locPositionPtr, Float_t* positionPtr, Int_t module) | |
124 | { | |
91b95d47 | 125 | //Get global position from local postion and module number |
2374af72 | 126 | //See header file for documentation |
25b7f84c | 127 | positionPtr[0] = kCRYSTAL_SIZE*(locPositionPtr[0]-N_XCOLUMNS_MOD/2)*fRotParametersCos[module] + fPHOSRadius*fRotParametersSin[module]; |
91b95d47 | 128 | |
25b7f84c | 129 | positionPtr[1] = kCRYSTAL_SIZE*(locPositionPtr[0]-N_XCOLUMNS_MOD/2)*fRotParametersSin[module] - fPHOSRadius*fRotParametersCos[module]; |
2410262d | 130 | |
442af5b7 | 131 | positionPtr[2] = kCRYSTAL_SIZE*(locPositionPtr[1]-N_ZROWS_MOD); |
2410262d | 132 | |
133 | } | |
134 | ||
135 | void | |
5d4ed6f4 | 136 | AliHLTPHOSPhysicsAnalyzer::WriteHistogram(const Char_t* fileName) |
2410262d | 137 | { |
91b95d47 | 138 | //Write the histogram |
2374af72 | 139 | //See header file for documentation |
2410262d | 140 | TFile *outfile = new TFile(fileName,"recreate"); |
141 | ||
142 | fRootHistPtr->Write(); | |
143 | ||
144 | outfile->Close(); | |
91b95d47 | 145 | |
146 | delete outfile; | |
147 | outfile = 0; | |
2410262d | 148 | |
149 | } | |
150 | ||
151 |