]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSPhysicsAnalyzer.cxx
removing obsolete files + fixing some doxygen warnings + added some documentation
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSPhysicsAnalyzer.cxx
1 // $Id$
2
3 /**************************************************************************
4  * This file is property of and copyright by the ALICE HLT Project        * 
5  * All rights reserved.                                                   *
6  *                                                                        *
7  * Primary Authors: Oystein Djuvsland                                     *
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     *
14  * about the suitability of this software for any purpose. It is          * 
15  * provided "as is" without express or implied warranty.                  *
16  **************************************************************************/
17
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
29
30 #include "AliHLTPHOSPhysicsAnalyzer.h"
31 #include "TVector3.h"
32 #include "TFile.h"
33 #include "TMath.h"
34 #include "TH1F.h"
35 #include "AliPHOSGeometry.h"
36 #include "Rtypes.h"
37 #include "AliHLTPHOSCommonDefs.h"
38 #include "AliHLTPHOSRecPointDataStruct.h"
39  
40
41 ClassImp(AliHLTPHOSPhysicsAnalyzer);
42
43 AliHLTPHOSPhysicsAnalyzer::AliHLTPHOSPhysicsAnalyzer():
44   fRecPointsPtr(0), 
45   fRootHistPtr(0), 
46   fPHOSRadius(0)
47 {
48   //Constructor
49   //See header file for documentation
50   AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV");
51
52   //  fPHOSRadius = geom->GetIPtoCrystalSurface();
53   fPHOSRadius = geom->GetIPtoCrystalSurface();
54
55   for(int i = 0; i < N_MODULES; i++)
56     {
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
62     }
63 }
64 /*
65 AliHLTPHOSPhysicsAnalyzer::AliHLTPHOSPhysicsAnalyzer(const AliHLTPHOSPhysicsAnalyzer &):fClustersPtr(0), fRootHistPtr(0), fPHOSRadius(0)
66
67 {
68   //Cooy constructor
69   //See header file for documentation
70   AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV");
71
72   fPHOSRadius = geom->GetIPtoCrystalSurface();
73   
74   for(UInt_t i = 0; i < N_MODULES; i++)
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     }
80
81 }
82 */
83
84 AliHLTPHOSPhysicsAnalyzer::~AliHLTPHOSPhysicsAnalyzer()
85 {
86   //Destructor
87   //See header file for documentation
88   fRecPointsPtr = 0;
89   fRootHistPtr = 0;
90 }
91
92 void
93 AliHLTPHOSPhysicsAnalyzer::LocalPosition(AliHLTPHOSRecPointDataStruct* /*recPointPtr*/, Float_t* /*locPositionPtr*/)
94 {
95   //Get local position for a recPoint
96
97   //  locPositionPtr[0] = recPointPtr->fLocalPositionPtr[0];
98   //locPositionPtr[1] = recPointPtr->fLocalPositionPtr[1];
99
100 }
101
102 void
103 AliHLTPHOSPhysicsAnalyzer::GlobalPosition(AliHLTPHOSRecPointDataStruct* recPointPtr, Float_t* positionPtr)
104 {
105   //Get global position for a recPoint
106   //See header file for documentation
107   Float_t tempPosX = 0;
108  
109   
110   Int_t module = recPointPtr->fModule;
111
112   tempPosX = kCRYSTAL_SIZE*(recPointPtr->fX-N_XCOLUMNS_MOD/2) + kCRYSTAL_SIZE/2;
113
114   positionPtr[0] = tempPosX*fRotParametersSin[module] + fPHOSRadius*fRotParametersCos[module];
115
116   positionPtr[1] = tempPosX*fRotParametersCos[module] - fPHOSRadius*fRotParametersSin[module];
117  
118   positionPtr[2] = kCRYSTAL_SIZE*(recPointPtr->fZ-N_ZROWS_MOD/2) + kCRYSTAL_SIZE/2;
119
120 }
121
122 void
123 AliHLTPHOSPhysicsAnalyzer::GlobalPosition(Float_t* locPositionPtr, Float_t* positionPtr, Int_t module)
124
125   //Get global position from local postion and module number
126   //See header file for documentation
127   positionPtr[0] = kCRYSTAL_SIZE*(locPositionPtr[0]-N_XCOLUMNS_MOD/2)*fRotParametersCos[module] + fPHOSRadius*fRotParametersSin[module];
128
129   positionPtr[1] = kCRYSTAL_SIZE*(locPositionPtr[0]-N_XCOLUMNS_MOD/2)*fRotParametersSin[module] - fPHOSRadius*fRotParametersCos[module];
130   
131   positionPtr[2] = kCRYSTAL_SIZE*(locPositionPtr[1]-N_ZROWS_MOD);
132
133 }
134
135 void
136 AliHLTPHOSPhysicsAnalyzer::WriteHistogram(const Char_t* fileName)
137 {
138   //Write the histogram
139   //See header file for documentation
140   TFile *outfile = new TFile(fileName,"recreate");  
141   
142   fRootHistPtr->Write();
143   
144   outfile->Close();
145   
146   delete outfile;
147   outfile = 0;
148
149 }
150
151 void
152 AliHLTPHOSPhysicsAnalyzer::Analyze(AliHLTPHOSRecPointContainerStruct* /*recPointsArrayPtr*/, Int_t /*nRecPoints*/)
153 {
154   //comment
155   return;
156 }
157