]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSHistoProdMatchedTracks.cxx
Renaming histo production classes to introduce order,
[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   fHistMatchedEnergy(0),
46   fHistUnMatchedEnergy(0)
47 {
48   // See header file for documentation
49   fHistArrayPtr = new TObjArray;
50   fClusterReader = new AliHLTCaloClusterReader();
51
52   fHistMatchQuality = new TH1F("fHistMatchQuality", "Distance between cluster and track intersection with phos module", 50, 0, 50);
53   fHistMatchQuality->GetXaxis()->SetTitle("Distance (cm)");
54   fHistMatchQuality->GetYaxis()->SetTitle("Count");
55   fHistMatchQuality->SetMarkerStyle(21);
56   fHistArrayPtr->AddLast(fHistMatchQuality);
57
58   fHistMatchedEnergy = new  TH1F("fHistMatchedEnergy", "Energy distribution of clusters, negative x is unmatched, positive x is matched", 400, -200, 200);
59   fHistMatchedEnergy->GetXaxis()->SetTitle("Cluster Energy (GeV)");
60   fHistMatchedEnergy->GetYaxis()->SetTitle("Number of clusters. Negative x direction is unmatched track, positive matched");
61   fHistMatchedEnergy->SetMarkerStyle(21);
62   fHistArrayPtr->AddLast(fHistMatchedEnergy);
63
64   fHistUnMatchedEnergy = new  TH1F("fHistUnMatchedEnergy", "Energy distribution of clusters, negative x is unmatched, positive x is matched", 400, -200, 200);
65   fHistUnMatchedEnergy->GetXaxis()->SetTitle("Cluster Energy (GeV)");
66   fHistUnMatchedEnergy->GetYaxis()->SetTitle("Number of clusters. Negative x direction is unmatched track, positive matched");
67   fHistUnMatchedEnergy->SetMarkerStyle(21);
68   fHistArrayPtr->AddLast(fHistUnMatchedEnergy);
69 }
70
71
72 AliHLTPHOSHistoProdMatchedTracks::~AliHLTPHOSHistoProdMatchedTracks()
73 {
74
75   if(fHistMatchQuality){
76     delete fHistMatchQuality;
77     fHistMatchQuality = 0;
78   }
79
80   if(fHistMatchedEnergy) {
81     delete fHistMatchedEnergy;
82     fHistMatchedEnergy = 0;
83   }
84
85   if(fHistUnMatchedEnergy) {
86     delete fHistUnMatchedEnergy;
87     fHistUnMatchedEnergy = 0;
88   }
89
90 }
91
92
93 TObjArray* AliHLTPHOSHistoProdMatchedTracks::GetHistograms()
94 {  
95   // See header file for documentation
96
97   return fHistArrayPtr;
98 }
99
100
101 Int_t AliHLTPHOSHistoProdMatchedTracks::DoEvent(AliHLTCaloClusterHeaderStruct* cHeader) {   
102   
103   fClusterReader->SetMemory(cHeader);
104   
105   AliHLTCaloClusterDataStruct* cluster;
106   while ( ( cluster = fClusterReader->NextCluster() ) ) {
107     
108     if(cluster->fTracksMatched->GetSize()>0) {
109       fHistMatchedEnergy->Fill(cluster->fEnergy);
110     } else {
111       fHistUnMatchedEnergy->Fill(cluster->fEnergy);
112     }
113   }  
114   
115   
116   return 0;
117 }
118   
119  
120  
121