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 **************************************************************************/
15 //_________________________________________________________________________
16 // Cheking PHOSHistos procedure of PHOS
17 //*-- Author : Gines MARTINEZ SUBATECH january 2000
18 //////////////////////////////////////////////////////////////////////////////
20 // --- ROOT system ---
27 // --- Standard library ---
33 // --- AliRoot header files ---
36 #include "AliPHOSGeometry.h"
37 #include "AliPHOSv0.h"
38 #include "AliPHOSDigit.h"
39 #include "AliPHOSRecPoint.h"
40 #include "AliPHOSEmcRecPoint.h"
41 #include "AliPHOSPpsdRecPoint.h"
42 #include "AliPHOSClusterizerv1.h"
43 #include "AliPHOSReconstructioner.h"
44 #include "AliPHOSTrackSegment.h"
45 #include "AliPHOSTrackSegmentMakerv1.h"
46 #include "AliPHOSPIDv1.h"
47 #include "PHOSHistos.h"
50 void PHOSHistos (Text_t* infile, Int_t nevent, Int_t Module)
52 //========== Opening galice.root file
53 TFile * file = new TFile(infile);
54 //========== Get AliRun object from file
55 gAlice = (AliRun*) file->Get("gAlice");//=========== Gets the PHOS object and associated geometry from the file
57 AliPHOSv0 * PHOS = (AliPHOSv0 *)gAlice->GetDetector("PHOS");
58 AliPHOSGeometry * Geom = AliPHOSGeometry::GetInstance(PHOS->GetGeometry()->GetName(),PHOS->GetGeometry()->GetTitle());
59 //========== Creates the track segment maker
60 AliPHOSTrackSegmentMakerv1 * tracksegmentmaker = new AliPHOSTrackSegmentMakerv1() ;
61 //========== Creates the particle identifier
62 AliPHOSPIDv1 * particleidentifier = new AliPHOSPIDv1 ;
63 cout << "AnalyzeOneEvent > using particle identifier " << particleidentifier->GetName() << endl ;
65 TH1F * hEmcDigit = new TH1F("hEmcDigit","hEmcDigit",1000,0.,5.);
66 TH1F * hVetoDigit = new TH1F("hVetoDigit","hVetoDigit",1000,0.,3.e-5);
67 TH1F * hConvertorDigit = new TH1F("hConvertorDigit","hConvertorDigit",1000,0.,3.e-5);
68 TH1F * hEmcCluster = new TH1F("hEmcCluster","hEmcCluster",1000,-5.,5.);
69 TH1F * hVetoCluster = new TH1F("hVetoCluster","hVetoCluster",1000,0.,3.e-5);
70 TH1F * hConvertorCluster = new TH1F("hConvertorCluster","hConvertorCluster",1000,0.,3.e-5);
71 TH2F * hConvertorEmc = new TH2F("hConvertorEmc","hConvertorEmc",100,2.,3., 100, 0., 1.e-5);
73 AliPHOSDigit * digit ;
75 //========== Loop on events
77 for(ievent=0;ievent<nevent; ievent++)
79 //========== Creates the Clusterizer
80 AliPHOSClusterizerv1 * clusterizer = new AliPHOSClusterizerv1() ;
81 clusterizer->SetEmcEnergyThreshold(0.01) ;
82 clusterizer->SetEmcClusteringThreshold(0.1) ;
83 clusterizer->SetPpsdEnergyThreshold(0.00000005) ;
84 clusterizer->SetPpsdClusteringThreshold(0.00000005) ;
85 clusterizer->SetLocalMaxCut(0.03) ;
86 clusterizer->SetCalibrationParameters(0., 0.00000001) ;
88 //========== Creates the Reconstructioner
89 AliPHOSReconstructioner * Reconstructioner = new AliPHOSReconstructioner(clusterizer, tracksegmentmaker, particleidentifier) ;
91 cout << "Event " << ievent <<endl;
94 //=========== Connects the various Tree's for evt
95 gAlice->GetEvent(ievent);
96 //=========== Gets the Digit TTree
97 gAlice->TreeD()->GetEvent(0) ;
98 //=========== Gets the number of entries in the Digits array
99 // Int_t nId = PHOS->Digits()->GetEntries();
100 TIter next(PHOS->Digits()) ;
105 while( ( digit = (AliPHOSDigit *)next() ) )
107 Etot+=clusterizer->Calibrate(digit->GetAmp()) ;
108 Geom->AbsToRelNumbering(digit->GetId(), RelId) ;
110 if (clusterizer->IsInEmc(digit))
111 { hEmcDigit->Fill(clusterizer->Calibrate(digit->GetAmp())) ; }
114 if (RelId[1]==9) {nVeto++; hVetoDigit->Fill(clusterizer->Calibrate(digit->GetAmp()));}
115 if (RelId[1]==25) {nConvertor++; hConvertorDigit->Fill(clusterizer->Calibrate(digit->GetAmp()));}
119 PHOS->Reconstruction(Reconstructioner);
121 //=========== Cluster in Module
122 TClonesArray * EmcRP = PHOS->EmcClusters() ;
123 TIter nextemc(EmcRP) ;
124 AliPHOSEmcRecPoint * emc ;
126 while((emc = (AliPHOSEmcRecPoint *)nextemc()))
128 if ( emc->GetPHOSMod() == Module )
130 Energy = emc->GetEnergy() ;
131 hEmcCluster->Fill(Energy);
132 printf("Energy of the EMC cluster is %f \n",Energy);
133 TClonesArray * PpsdRP = PHOS->PpsdClusters() ;
134 TIter nextPpsd(PpsdRP) ;
135 AliPHOSPpsdRecPoint * Ppsd ;
137 while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
139 if ( Ppsd->GetPHOSMod() == Module )
141 Energy2 = Ppsd->GetEnergy() ;
143 if (!Ppsd->GetUp()) hConvertorEmc->Fill(Energy,Energy2) ;
150 //=========== Cluster in Module PPSD Down
151 TClonesArray * PpsdRP = PHOS->PpsdClusters() ;
152 TIter nextPpsd(PpsdRP) ;
153 AliPHOSPpsdRecPoint * Ppsd ;
154 while((Ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
156 if ( Ppsd->GetPHOSMod() == Module )
158 Energy = Ppsd->GetEnergy() ;
160 if (!Ppsd->GetUp()) hConvertorCluster->Fill(Energy) ;
161 if (Ppsd->GetUp()) hVetoCluster->Fill(Energy) ;
167 TCanvas * cVetoDigit = new TCanvas("VetoDigit","VetoDigit");
169 TCanvas * cConvertorDigit = new TCanvas("ConvertorDigit","ConvertorDigit");
170 hConvertorDigit->Draw();
171 TCanvas * cEmcDigit = new TCanvas("EmcDigit","EmcDigit");
173 TCanvas * cVetoCluster = new TCanvas("VetoCluster","VetoCluster");
174 hVetoCluster->Draw();
175 TCanvas * cConvertorCluster = new TCanvas("ConvertorCluster","ConvertorCluster");
176 hConvertorCluster->Draw();
177 TCanvas * cEmcCluster = new TCanvas("EmcCluster","EmcCluster");
179 TCanvas * cConvertorEmc = new TCanvas("ConvertorEmc","ConvertorEmc");
180 hConvertorEmc->Draw("col1");