]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSHistoProdMatchedTracks.cxx
- fixing compilation warnings
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSHistoProdMatchedTracks.cxx
1
2 /**************************************************************************
3  * This file is property of and copyright by the ALICE HLT Project        * 
4  * All rights reserved.                                                   *
5  *                                                                        *
6  * Primary Authors: Albin Gaignette
7  *                                                                        *
8  * Permission to use, copy, modify and distribute this software and its   *
9  * documentation strictly for non-commercial purposes is hereby granted   *
10  * without fee, provided that the above copyright notice appears in all   *
11  * copies and that both the copyright notice and this permission notice   *
12  * appear in the supporting documentation. The authors make no claims     *
13  * about the suitability of this software for any purpose. It is          * 
14  * provided "as is" without express or implied warranty.                  *
15  **************************************************************************/
16
17 /** 
18  * @file   AliHLTPHOSMatchedclustershistoProducer
19  * @author Albin Gaignette
20  * @date 
21  * @brief  Histogram producer for PHOS HLT 
22  */
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 "AliHLTPHOSHistoProdMatchedTracks.h"
31 //#include "AliESDCaloCluster.h"
32 #include "TMath.h"
33
34 #include "AliHLTCaloClusterDataStruct.h"
35 #include "AliHLTCaloClusterReader.h"
36 #include "TObjArray.h"
37 //#include "TClonesArray.h"
38 //#include <iostream>
39 #include "TH1F.h"
40 //#include "TH2F.h"
41
42 AliHLTPHOSHistoProdMatchedTracks::AliHLTPHOSHistoProdMatchedTracks() :
43   fClusterReader(NULL),
44   fHistArrayPtr(0),
45   fHistMatchQuality(0),
46   fHistMatchedEnergy(0),
47   fHistUnMatchedEnergy(0)
48 {
49   // See header file for documentation
50   fHistArrayPtr = new TObjArray;
51   fClusterReader = new AliHLTCaloClusterReader();
52
53   fHistMatchQuality = new TH1F("fHistMatchQuality", "Distance between cluster and track intersection with phos module", 50, 0, 50);
54   fHistMatchQuality->GetXaxis()->SetTitle("Distance (cm)");
55   fHistMatchQuality->GetYaxis()->SetTitle("Count");
56   fHistMatchQuality->SetMarkerStyle(21);
57   fHistArrayPtr->AddLast(fHistMatchQuality);
58
59   fHistMatchedEnergy = new  TH1F("fHistMatchedEnergy", "Energy distribution of clusters, negative x is unmatched, positive x is matched", 400, -200, 200);
60   fHistMatchedEnergy->GetXaxis()->SetTitle("Cluster Energy (GeV)");
61   fHistMatchedEnergy->GetYaxis()->SetTitle("Number of clusters. Negative x direction is unmatched track, positive matched");
62   fHistMatchedEnergy->SetMarkerStyle(21);
63   fHistArrayPtr->AddLast(fHistMatchedEnergy);
64
65   fHistUnMatchedEnergy = new  TH1F("fHistUnMatchedEnergy", "Energy distribution of clusters, negative x is unmatched, positive x is matched", 400, -200, 200);
66   fHistUnMatchedEnergy->GetXaxis()->SetTitle("Cluster Energy (GeV)");
67   fHistUnMatchedEnergy->GetYaxis()->SetTitle("Number of clusters. Negative x direction is unmatched track, positive matched");
68   fHistUnMatchedEnergy->SetMarkerStyle(21);
69   fHistArrayPtr->AddLast(fHistUnMatchedEnergy);
70 }
71
72
73 AliHLTPHOSHistoProdMatchedTracks::~AliHLTPHOSHistoProdMatchedTracks()
74 {
75
76   if(fHistMatchQuality){
77     delete fHistMatchQuality;
78     fHistMatchQuality = 0;
79   }
80
81   if(fHistMatchedEnergy) {
82     delete fHistMatchedEnergy;
83     fHistMatchedEnergy = 0;
84   }
85
86   if(fHistUnMatchedEnergy) {
87     delete fHistUnMatchedEnergy;
88     fHistUnMatchedEnergy = 0;
89   }
90
91 }
92
93
94 TObjArray* AliHLTPHOSHistoProdMatchedTracks::GetHistograms()
95 {  
96   // See header file for documentation
97
98   return fHistArrayPtr;
99 }
100
101
102 Int_t AliHLTPHOSHistoProdMatchedTracks::DoEvent(AliHLTCaloClusterHeaderStruct* cHeader) {   
103   
104   fClusterReader->SetMemory(cHeader);
105   
106   AliHLTCaloClusterDataStruct* cluster;
107   while ( ( cluster = fClusterReader->NextCluster() ) ) {
108     
109     if(cluster->fTracksMatched->GetSize()>0) {
110       fHistMatchedEnergy->Fill(cluster->fEnergy);
111     } else {
112       fHistUnMatchedEnergy->Fill(cluster->fEnergy);
113     }
114   }  
115   
116   
117   return 0;
118 }
119   
120  
121  
122