Fixes for coverity
[u/mrichter/AliRoot.git] / PMD / AliPMDEmpDiscriminator.cxx
CommitLineData
077a4c66 1/***************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16//-----------------------------------------------------//
17// //
18// Date : August 05 2003 //
19// This does photon hadron discrimination on the //
20// of matching a PMD cluster with a CPV cluster //
21// //
22//-----------------------------------------------------//
23
24#include <Riostream.h>
25#include <TMath.h>
077a4c66 26#include <TTree.h>
077a4c66 27#include <TObjArray.h>
28#include <TClonesArray.h>
29#include <TFile.h>
30#include <TNtuple.h>
31#include <TParticle.h>
32
33#include "AliLog.h"
b0e4d1e1 34#include "AliPMDrecdata.h"
077a4c66 35#include "AliPMDclupid.h"
36#include "AliPMDDiscriminator.h"
37#include "AliPMDEmpDiscriminator.h"
38
39ClassImp(AliPMDEmpDiscriminator)
40
41AliPMDEmpDiscriminator::AliPMDEmpDiscriminator()
42{
43//
44// Default Constructor
45//
46}
47// -----------------------------------------------------------------------
48AliPMDEmpDiscriminator::~AliPMDEmpDiscriminator()
49{
50 // Destructor
51}
52
53// -----------------------------------------------------------------------
54
55void AliPMDEmpDiscriminator::Discrimination(TObjArray *pmdcontin, TObjArray *pmdcontout)
56{
57 // Does Photon/Hadron discrimination
58 // matching the clusters of CPV and PREshower plane
59 //
b0e4d1e1 60
be8b7039 61 Int_t det = 0,smn = 0, trno = 0, trpid = 0, mstatus = 0;
62 Float_t clusdata[7] = {0.,0.,0.,0.,0.,0.,0.};
b0e4d1e1 63
64 AliPMDrecdata *pmdcl = 0;
077a4c66 65 AliPMDclupid *pmdclout = 0;
66
67 Int_t nentries1 = pmdcontin->GetEntries();
68
69 AliDebug(1,Form("Number of total clusters from CPV PRE = %d",nentries1));
077a4c66 70
077a4c66 71
b0e4d1e1 72 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
077a4c66 73 {
b0e4d1e1 74 pmdcl = (AliPMDrecdata*)pmdcontin->UncheckedAt(ient1);
077a4c66 75
b0e4d1e1 76 det = pmdcl->GetDetector();
77 smn = pmdcl->GetSMNumber();
78 trno = pmdcl->GetClusTrackNo();
79 trpid = pmdcl->GetClusTrackPid();
80 clusdata[0] = pmdcl->GetClusX();
81 clusdata[1] = pmdcl->GetClusY();
82 clusdata[2] = pmdcl->GetClusADC();
83 clusdata[3] = pmdcl->GetClusCells();
84 clusdata[4] = pmdcl->GetClusSigmaX();
85 clusdata[5] = pmdcl->GetClusSigmaY();
86
87 if (det == 0 && clusdata[2] > 300.)
077a4c66 88 {
b0e4d1e1 89 clusdata[6] = 1; // photon
90 }
91 else
077a4c66 92 {
b0e4d1e1 93 clusdata[6] = 8; // hadron
077a4c66 94 }
95
b0e4d1e1 96 mstatus = 0; // at this moment matching is not done
97
98 pmdclout = new AliPMDclupid(det,smn,trno,trpid,mstatus,clusdata);
99 pmdcontout->Add(pmdclout);
100
101 } // Entries of TObjArray loop
077a4c66 102
103}
104// -----------------------------------------------------------------------