1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // This class creates and fills the monitor histograms for the HLT //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliMonitorHLT.h"
28 #include "AliL3MemHandler.h"
29 #include "AliL3SpacePointData.h"
30 #include "AliL3TrackArray.h"
31 #include "AliL3Track.h"
34 //_____________________________________________________________________________
35 AliMonitorHLT::AliMonitorHLT(AliTPCParam* param)
37 // create a HLT monitor object with the given parameters
42 //_____________________________________________________________________________
43 AliMonitorHLT::~AliMonitorHLT()
48 //_____________________________________________________________________________
49 void AliMonitorHLT::CreateHistos(TFolder* folder)
51 // create the HLT monitor histograms
53 fFolder = folder->AddFolder("HLT", "HLT");
55 fClustersCharge = CreateHisto1("ClustersCharge",
56 "charge distribution of clusters",
57 100, 0, 1000, "charge", "#Delta N/N",
58 AliMonitorHisto::kNormEvents);
60 Int_t nRows = fParam->GetNRowLow() + fParam->GetNRowUp();
61 fNClustersVsRow = CreateHisto1("NClustersVsRow",
62 "mean number of clusters per pad row",
63 nRows, -0.5, nRows-0.5,
64 "pad row", "<N_{clusters}>",
65 AliMonitorHisto::kNormEvents);
67 Int_t nSector = fParam->GetNInnerSector();
68 fNClustersVsSector = CreateHisto1("NClustersVsSector",
69 "mean number of clusters per sector",
70 nSector, -0.5, nSector-0.5,
71 "sector", "<N_{clusters}>",
72 AliMonitorHisto::kNormEvents);
74 fNTracks = CreateTrend("NTracks", "number of tracks per event",
77 fTrackPt = CreateHisto1("TrackPt", "pt distribution of tracks",
78 90, 0, 3, "p_{t} [GeV/c]", "#Delta N/N",
79 AliMonitorHisto::kNormEntries);
81 fTrackEta = CreateHisto1("TrackEta", "eta distribution of tracks",
82 100, -2, 2, "#eta", "#Delta N/N",
83 AliMonitorHisto::kNormEntries);
85 fTrackPhi = CreateHisto1("TrackPhi", "phi distribution of tracks",
86 120, 0, 360, "#phi [#circ]", "#Delta N/N",
87 AliMonitorHisto::kNormEntries);
92 //_____________________________________________________________________________
93 void AliMonitorHLT::FillHistos(AliRunLoader* /*runLoader*/,
94 AliRawReader* /*rawReader*/)
96 // fill the HLT monitor histogrms
99 Warning("FillHistos", "the code was compiled without HLT support");
102 AliL3MemHandler memHandler;
103 for (Int_t iSector = 0; iSector < fParam->GetNInnerSector(); iSector++) {
105 sprintf(fileName, "hlt/points_%d_-1.raw", iSector);
106 if (!memHandler.SetBinaryInput(fileName)) {
107 Warning("FillHistos", "could not open file %s", fileName);
110 AliL3SpacePointData* clusters =
111 (AliL3SpacePointData*) memHandler.Allocate();
112 UInt_t nClusters = 0;
113 memHandler.Binary2Memory(nClusters, clusters);
115 for (UInt_t iCluster = 0; iCluster < nClusters; iCluster++) {
116 AliL3SpacePointData& cluster = clusters[iCluster];
117 fClustersCharge->Fill(cluster.fCharge);
118 fNClustersVsRow->Fill(cluster.fPadRow);
119 fNClustersVsSector->Fill(iSector);
123 memHandler.CloseBinaryInput();
126 fNClustersVsSector->ScaleErrorBy(10.);
128 if (!memHandler.SetBinaryInput("hlt/tracks.raw")) {
129 Warning("FillHistos", "could not open file hlt/tracks.raw");
132 AliL3TrackArray* tracks = new AliL3TrackArray;
133 memHandler.Binary2TrackArray(tracks);
135 fNTracks->Fill(tracks->GetNTracks());
136 for (Int_t iTrack = 0; iTrack < tracks->GetNTracks(); iTrack++) {
137 AliL3Track* track = tracks->GetTrack(iTrack);
138 fTrackPt->Fill(track->GetPt());
139 fTrackEta->Fill(track->GetPseudoRapidity());
140 fTrackPhi->Fill(track->GetPsi() * TMath::RadToDeg());
144 memHandler.CloseBinaryInput();