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 //_________________________________________________________________________
19 // Algorythm class to analyze PHOSv1 events:
20 // Construct histograms and displays them.
21 // Use the macro EditorBar.C for best access to the functionnalities
23 //*-- Author: Y. Schutz (SUBATECH) & Gines Martinez (SUBATECH)
24 //////////////////////////////////////////////////////////////////////////////
26 // --- ROOT system ---
32 #include "TParticle.h"
33 #include "TClonesArray.h"
39 // --- Standard library ---
44 // --- AliRoot header files ---
47 #include "AliPHOSAnalyze.h"
48 #include "AliPHOSClusterizerv1.h"
49 #include "AliPHOSTrackSegmentMakerv1.h"
50 #include "AliPHOSPIDv1.h"
51 #include "AliPHOSReconstructioner.h"
52 #include "AliPHOSDigit.h"
53 #include "AliPHOSTrackSegment.h"
54 #include "AliPHOSRecParticle.h"
55 #include "AliPHOSIndexToObject.h"
56 #include "AliPHOSCPVHit.h"
57 #include "AliPHOSCpvRecPoint.h"
59 ClassImp(AliPHOSAnalyze)
61 //____________________________________________________________________________
62 AliPHOSAnalyze::AliPHOSAnalyze()
64 // default ctor (useless)
69 //____________________________________________________________________________
70 AliPHOSAnalyze::AliPHOSAnalyze(Text_t * name)
72 // ctor: analyze events from root file "name"
74 Bool_t ok = OpenRootFile(name) ;
76 cout << " AliPHOSAnalyze > Error opening " << name << endl ;
79 //========== Get AliRun object from file
80 gAlice = (AliRun*) fRootFile->Get("gAlice") ;
82 //=========== Get the PHOS object and associated geometry from the file
83 fPHOS = (AliPHOSv1 *)gAlice->GetDetector("PHOS") ;
84 fGeom = AliPHOSGeometry::GetInstance( fPHOS->GetGeometry()->GetName(), fPHOS->GetGeometry()->GetTitle() );
86 //========== Initializes the Index to Object converter
87 fObjGetter = AliPHOSIndexToObject::GetInstance(fPHOS) ;
88 //========== Current event number
100 //____________________________________________________________________________
101 AliPHOSAnalyze::AliPHOSAnalyze(const AliPHOSAnalyze & ana)
104 ( (AliPHOSAnalyze &)ana ).Copy(*this) ;
107 //____________________________________________________________________________
108 void AliPHOSAnalyze::Copy(TObject & obj)
110 // copy an analysis into an other one
112 // I do nothing more because the copy is silly but the Code checkers requires one
115 //____________________________________________________________________________
116 AliPHOSAnalyze::~AliPHOSAnalyze()
120 if(fRootFile->IsOpen()) fRootFile->Close() ;
121 if(fRootFile) {delete fRootFile ; fRootFile=0 ;}
122 if(fPHOS) {delete fPHOS ; fPHOS =0 ;}
123 if(fClu) {delete fClu ; fClu =0 ;}
124 if(fPID) {delete fPID ; fPID =0 ;}
125 if(fRec) {delete fRec ; fRec =0 ;}
126 if(fTrs) {delete fTrs ; fTrs =0 ;}
130 //____________________________________________________________________________
131 void AliPHOSAnalyze::ActivePPSD(Int_t Nevents=1){
133 fhEnergyCorrelations = new TH2F("hEnergyCorrelations","hEnergyCorrelations",40, 0., 0.15, 30, 0., 3.e-5);
134 //========== Create the Clusterizer
135 fClu = new AliPHOSClusterizerv1() ;
136 fClu->SetEmcEnergyThreshold(0.01) ;
137 fClu->SetEmcClusteringThreshold(0.20) ;
138 fClu->SetPpsdEnergyThreshold (0.0000002) ;
139 fClu->SetPpsdClusteringThreshold(0.0000001) ;
140 fClu->SetLocalMaxCut(0.02) ;
141 fClu->SetCalibrationParameters(0., 0.00000001) ;
145 for ( ievent=0; ievent<Nevents; ievent++)
148 //========== Event Number>
149 if ( ( log10((Float_t)(ievent+1)) - (Int_t)(log10((Float_t)(ievent+1))) ) == 0. )
150 cout << "AnalyzeResolutions > " << "Event is " << ievent << endl ;
152 //=========== Connects the various Tree's for evt
153 gAlice->GetEvent(ievent);
155 //=========== Gets the Kine TTree
156 gAlice->TreeK()->GetEvent(0) ;
158 //=========== Get the Digit Tree
159 gAlice->TreeD()->GetEvent(0) ;
161 //========== Creating branches ===================================
162 AliPHOSRecPoint::RecPointsList ** EmcRecPoints = fPHOS->EmcRecPoints() ;
163 gAlice->TreeR()->SetBranchAddress( "PHOSEmcRP", EmcRecPoints ) ;
165 AliPHOSRecPoint::RecPointsList ** PpsdRecPoints = fPHOS->PpsdRecPoints() ;
166 gAlice->TreeR()->SetBranchAddress( "PHOSPpsdRP", PpsdRecPoints ) ;
168 AliPHOSTrackSegment::TrackSegmentsList ** TrackSegmentsList = fPHOS->TrackSegments() ;
169 if( (*TrackSegmentsList) )
170 (*TrackSegmentsList)->Clear() ;
171 gAlice->TreeR()->SetBranchAddress( "PHOSTS", TrackSegmentsList ) ;
173 AliPHOSRecParticle::RecParticlesList ** RecParticleList = fPHOS->RecParticles() ;
174 if( (*RecParticleList) )
175 (*RecParticleList)->Clear() ;
176 gAlice->TreeR()->SetBranchAddress( "PHOSRP", RecParticleList ) ;
179 //=========== Gets the Reconstraction TTree
180 gAlice->TreeR()->GetEvent(0) ;
182 AliPHOSPpsdRecPoint * RecPoint ;
184 TIter nextRP(*fPHOS->PpsdRecPoints() ) ;
185 while( ( RecPoint = (AliPHOSPpsdRecPoint *)nextRP() ) )
187 if(!(RecPoint->GetUp()) ) {
188 AliPHOSDigit *digit ;
190 for(iDigit = 0; iDigit < fPHOS->Digits()->GetEntries(); iDigit++)
192 digit = (AliPHOSDigit *) fPHOS->Digits()->At(iDigit) ;
193 fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
194 if((relid[2]==1)&&(relid[3]==1)&&(relid[0]==RecPoint->GetPHOSMod())){
195 Float_t ConvertorEnergy = fClu->Calibrate(digit->GetAmp()) ;
196 fhEnergyCorrelations->Fill(ConvertorEnergy,RecPoint->GetTotalEnergy() );
205 fhEnergyCorrelations->Draw("BOX") ;
209 //____________________________________________________________________________
210 void AliPHOSAnalyze::AnalyzeManyEvents(Int_t Nevents, Int_t module)
212 // analyzes Nevents events in a single PHOS module
213 // Events should be reconstructed by Reconstruct()
215 if ( fRootFile == 0 )
216 cout << "AnalyzeManyEvents > " << "Root File not openned" << endl ;
219 //========== Booking Histograms
220 cout << "AnalyzeManyEvents > " << "Booking Histograms" << endl ;
225 AliPHOSDigit * digit ;
226 AliPHOSEmcRecPoint * emc ;
227 AliPHOSPpsdRecPoint * ppsd ;
228 // AliPHOSTrackSegment * tracksegment ;
229 AliPHOSRecParticle * recparticle;
231 for ( ievent=0; ievent<Nevents; ievent++)
233 //========== Event Number>
234 if ( ( log10((Float_t)(ievent+1)) - (Int_t)(log10((Float_t)(ievent+1))) ) == 0. )
235 cout << "AnalyzeManyEvents > " << "Event is " << ievent << endl ;
237 //=========== Connects the various Tree's for evt
238 gAlice->GetEvent(ievent);
240 //=========== Gets the Digit TTree
241 gAlice->TreeD()->GetEvent(0) ;
243 //=========== Gets the number of entries in the Digits array
244 TIter nextdigit(fPHOS->Digits()) ;
245 while( ( digit = (AliPHOSDigit *)nextdigit() ) )
247 fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
248 if (fClu->IsInEmc(digit)) fhEmcDigit->Fill(fClu->Calibrate(digit->GetAmp())) ;
251 if (relid[1]<17) fhVetoDigit->Fill(fClu->Calibrate(digit->GetAmp()));
252 if (relid[1]>16) fhConvertorDigit->Fill(fClu->Calibrate(digit->GetAmp()));
257 //=========== Cluster in module
258 TIter nextEmc(*fPHOS->EmcRecPoints() ) ;
259 while((emc = (AliPHOSEmcRecPoint *)nextEmc()))
261 if ( emc->GetPHOSMod() == module )
263 fhEmcCluster->Fill( emc->GetTotalEnergy() );
264 TIter nextPpsd( *fPHOS->PpsdRecPoints()) ;
265 while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
267 if ( ppsd->GetPHOSMod() == module )
269 if (!ppsd->GetUp()) fhConvertorEmc->Fill(emc->GetTotalEnergy(),ppsd->GetTotalEnergy()) ;
275 //=========== Cluster in module PPSD Down
276 TIter nextPpsd(*fPHOS->PpsdRecPoints() ) ;
277 while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
279 if ( ppsd->GetPHOSMod() == module )
281 if (!ppsd->GetUp()) fhConvertorCluster->Fill(ppsd->GetTotalEnergy()) ;
282 if (ppsd->GetUp()) fhVetoCluster ->Fill(ppsd->GetTotalEnergy()) ;
286 //========== TRackSegments in the event
287 TIter nextRecParticle(*fPHOS->RecParticles() ) ;
288 while((recparticle = (AliPHOSRecParticle *)nextRecParticle()))
290 if ( recparticle->GetPHOSTrackSegment()->GetPHOSMod() == module )
292 cout << "Particle type is " << recparticle->GetType() << endl ;
293 Int_t numberofprimaries = 0 ;
294 Int_t * listofprimaries = recparticle->GetPrimaries(numberofprimaries) ;
295 cout << "Number of primaries = " << numberofprimaries << endl ;
297 for ( index = 0 ; index < numberofprimaries ; index++)
298 cout << " primary # " << index << " = " << listofprimaries[index] << endl ;
306 //____________________________________________________________________________
307 void AliPHOSAnalyze::Reconstruct(Int_t Nevents,Int_t FirstEvent )
310 // Performs reconstruction of EMC and CPV (GPS2 or IHEP)
311 // for events from FirstEvent to Nevents
314 for ( ievent=FirstEvent; ievent<Nevents; ievent++) {
315 if (ievent==FirstEvent) {
316 cout << "Analyze > Starting Reconstructing " << endl ;
317 //========== Create the Clusterizer
318 fClu = new AliPHOSClusterizerv1() ;
319 fClu->SetEmcEnergyThreshold(0.05) ;
320 fClu->SetEmcClusteringThreshold(0.20) ;
321 fClu->SetLocalMaxCut(0.03) ;
322 if (strcmp(fGeom->GetName(),"GPS2") == 0) {
323 fClu->SetPpsdEnergyThreshold (0.0000002) ;
324 fClu->SetPpsdClusteringThreshold(0.0000001) ;
326 else if (strcmp(fGeom->GetName(),"IHEP") == 0) {
327 fClu->SetLocalMaxCutCPV(0.03) ;
328 fClu->SetLogWeightCutCPV(4.0) ;
329 fClu->SetPpsdEnergyThreshold (0.09) ;
331 fClu->SetCalibrationParameters(0., 0.00000001) ;
333 //========== Creates the track segment maker
334 fTrs = new AliPHOSTrackSegmentMakerv1() ;
335 // fTrs->UnsetUnfoldFlag() ;
337 //========== Creates the particle identifier for GPS2 only
338 if (strcmp(fGeom->GetName(),"GPS2") == 0) {
339 fPID = new AliPHOSPIDv1() ;
340 fPID->SetShowerProfileCuts(0.3, 1.8, 0.3, 1.8 ) ;
343 //========== Creates the Reconstructioner
344 fRec = new AliPHOSReconstructioner(fClu, fTrs, fPID) ;
345 if (fDebugLevel != 0) fRec -> SetDebugReconstruction(kTRUE);
348 if (fDebugLevel != 0 ||
349 (ievent+1) % (Int_t)TMath::Power( 10, (Int_t)TMath::Log10(ievent+1) ) == 0)
350 cout << "======= Analyze ======> Event " << ievent+1 << endl ;
352 //=========== Connects the various Tree's for evt
353 gAlice->GetEvent(ievent);
355 //=========== Gets the Digit TTree
356 gAlice->TreeD()->GetEvent(0) ;
358 //=========== Do the reconstruction
359 fPHOS->Reconstruction(fRec);
362 if(fClu) {delete fClu ; fClu =0 ;}
363 if(fPID) {delete fPID ; fPID =0 ;}
364 if(fRec) {delete fRec ; fRec =0 ;}
365 if(fTrs) {delete fTrs ; fTrs =0 ;}
369 //-------------------------------------------------------------------------------------
370 void AliPHOSAnalyze::ReadAndPrintCPV(Int_t EvFirst, Int_t EvLast)
373 // Read and print generated and reconstructed hits in CPV
374 // for events from EvFirst to Nevent.
375 // If only EvFirst is defined, print only this one event.
376 // Author: Yuri Kharlov
380 if (EvFirst!=0 && EvLast==0) EvLast=EvFirst;
381 for ( Int_t ievent=EvFirst; ievent<=EvLast; ievent++) {
383 //========== Event Number>
384 cout << endl << "==== ReadAndPrintCPV ====> Event is " << ievent+1 << endl ;
386 //=========== Connects the various Tree's for evt
387 Int_t ntracks = gAlice->GetEvent(ievent);
389 //========== Creating branches ===================================
390 AliPHOSRecPoint::RecPointsList ** emcRecPoints = fPHOS->EmcRecPoints() ;
391 gAlice->TreeR()->SetBranchAddress( "PHOSEmcRP" , emcRecPoints ) ;
393 AliPHOSRecPoint::RecPointsList ** cpvRecPoints = fPHOS->PpsdRecPoints() ;
394 gAlice->TreeR()->SetBranchAddress( "PHOSPpsdRP", cpvRecPoints ) ;
396 // Read and print CPV hits
398 AliPHOSCPVModule cpvModule;
399 TClonesArray *cpvHits;
401 AliPHOSCPVHit *cpvHit;
406 for (Int_t itrack=0; itrack<ntracks; itrack++) {
407 //=========== Get the Hits Tree for the Primary track itrack
409 gAlice->TreeH()->GetEvent(itrack);
410 for (Int_t iModule=0; iModule < fGeom->GetNModules(); iModule++) {
411 cpvModule = fPHOS->GetCPVModule(iModule);
412 cpvHits = cpvModule.Hits();
413 nCPVhits = cpvHits->GetEntriesFast();
414 for (Int_t ihit=0; ihit<nCPVhits; ihit++) {
416 cpvHit = (AliPHOSCPVHit*)cpvHits->UncheckedAt(ihit);
417 p = cpvHit->GetMomentum();
418 xgen = cpvHit->GetX();
419 zgen = cpvHit->GetY();
420 ipart = cpvHit->GetIpart();
421 printf("CPV hit in module %d: ",iModule+1);
422 printf(" p = (%f, %f, %f, %f) GeV,\n",
423 p.Px(),p.Py(),p.Pz(),p.Energy());
424 printf(" (X,Z) = (%8.4f, %8.4f) cm, ipart = %d\n",
430 // Read and print CPV reconstructed points
432 //=========== Gets the Reconstruction TTree
433 gAlice->TreeR()->GetEvent(0) ;
434 TIter nextRP(*fPHOS->PpsdRecPoints() ) ;
435 AliPHOSPpsdRecPoint *cpvRecPoint ;
436 Int_t nRecPoints = 0;
437 while( ( cpvRecPoint = (AliPHOSPpsdRecPoint *)nextRP() ) ) {
440 cpvRecPoint->GetLocalPosition(locpos);
441 Int_t phosModule = cpvRecPoint->GetPHOSMod();
442 printf("CPV recpoint in module %d: (X,Z) = (%f,%f) cm\n",
443 phosModule,locpos.X(),locpos.Z());
445 printf("This event has %d generated hits and %d reconstructed points\n",
446 nGenHits,nRecPoints);
450 //____________________________________________________________________________
451 void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents)
454 // Analyzes CPV characteristics
455 // Author: Yuri Kharlov
461 TH1F *hDx = new TH1F("hDx" ,"CPV x-resolution@reconstruction",100,-5. , 5.);
462 TH1F *hDz = new TH1F("hDz" ,"CPV z-resolution@reconstruction",100,-5. , 5.);
463 TH1F *hDr = new TH1F("hDr" ,"CPV r-resolution@reconstruction",100, 0. , 5.);
464 TH1S *hNrp = new TH1S("hNrp" ,"CPV rec.point multiplicity", 21,-0.5,20.5);
465 TH1S *hNrpX = new TH1S("hNrpX","CPV rec.point Phi-length" , 21,-0.5,20.5);
466 TH1S *hNrpZ = new TH1S("hNrpZ","CPV rec.point Z-length" , 21,-0.5,20.5);
468 cout << "Start CPV Analysis"<< endl ;
469 for ( Int_t ievent=0; ievent<Nevents; ievent++) {
471 //========== Event Number>
472 // if ( (ievent+1) % (Int_t)TMath::Power( 10, (Int_t)TMath::Log10(ievent+1) ) == 0)
473 cout << endl << "==== AnalyzeCPV ====> Event is " << ievent+1 << endl ;
475 //=========== Connects the various Tree's for evt
476 Int_t ntracks = gAlice->GetEvent(ievent);
478 //========== Creating branches ===================================
479 AliPHOSRecPoint::RecPointsList ** emcRecPoints = fPHOS->EmcRecPoints() ;
480 gAlice->TreeR()->SetBranchAddress( "PHOSEmcRP" , emcRecPoints ) ;
482 AliPHOSRecPoint::RecPointsList ** cpvRecPoints = fPHOS->PpsdRecPoints() ;
483 gAlice->TreeR()->SetBranchAddress( "PHOSPpsdRP", cpvRecPoints ) ;
485 // Create and fill arrays of hits for each CPV module
487 Int_t nOfModules = fGeom->GetNModules();
488 TClonesArray **hitsPerModule = new TClonesArray *[nOfModules];
489 for (Int_t iModule=0; iModule < nOfModules; iModule++)
490 hitsPerModule[iModule] = new TClonesArray("AliPHOSCPVHit",100);
492 AliPHOSCPVModule cpvModule;
493 TClonesArray *cpvHits;
495 AliPHOSCPVHit *cpvHit;
500 // First go through all primary tracks and fill the arrays
501 // of hits per each CPV module
503 for (Int_t itrack=0; itrack<ntracks; itrack++) {
504 // Get the Hits Tree for the Primary track itrack
506 gAlice->TreeH()->GetEvent(itrack);
507 for (Int_t iModule=0; iModule < nOfModules; iModule++) {
508 cpvModule = fPHOS->GetCPVModule(iModule);
509 cpvHits = cpvModule.Hits();
510 nCPVhits = cpvHits->GetEntriesFast();
511 for (Int_t ihit=0; ihit<nCPVhits; ihit++) {
512 cpvHit = (AliPHOSCPVHit*)cpvHits->UncheckedAt(ihit);
513 p = cpvHit->GetMomentum();
514 xzgen[0] = cpvHit->GetX();
515 xzgen[1] = cpvHit->GetY();
516 ipart = cpvHit->GetIpart();
517 TClonesArray &lhits = *(TClonesArray *)hitsPerModule[iModule];
518 new(lhits[hitsPerModule[iModule]->GetEntriesFast()]) AliPHOSCPVHit(*cpvHit);
523 for (Int_t iModule=0; iModule < nOfModules; iModule++) {
524 Int_t nsum = hitsPerModule[iModule]->GetEntriesFast();
525 printf("Module %d has %d hits\n",iModule,nsum);
528 // Then go through reconstructed points and for each find
530 // The distance from the rec.point to the closest hit
531 // gives the coordinate resolution of the CPV
533 // Get the Reconstruction Tree
534 gAlice->TreeR()->GetEvent(0) ;
535 TIter nextRP(*fPHOS->PpsdRecPoints() ) ;
536 AliPHOSCpvRecPoint *cpvRecPoint ;
538 while( ( cpvRecPoint = (AliPHOSCpvRecPoint *)nextRP() ) ) {
540 cpvRecPoint->GetLocalPosition(locpos);
541 Int_t phosModule = cpvRecPoint->GetPHOSMod();
542 Int_t rpMult = cpvRecPoint->GetDigitsMultiplicity();
543 Int_t rpMultX, rpMultZ;
544 cpvRecPoint->GetClusterLengths(rpMultX,rpMultZ);
545 Float_t xrec = locpos.X();
546 Float_t zrec = locpos.Z();
547 Float_t dxmin = 1.e+10;
548 Float_t dzmin = 1.e+10;
549 Float_t r2min = 1.e+10;
552 cpvHits = hitsPerModule[phosModule-1];
553 Int_t nCPVhits = cpvHits->GetEntriesFast();
554 for (Int_t ihit=0; ihit<nCPVhits; ihit++) {
555 cpvHit = (AliPHOSCPVHit*)cpvHits->UncheckedAt(ihit);
556 xgen = cpvHit->GetX();
557 zgen = cpvHit->GetY();
558 r2 = TMath::Power((xgen-xrec),2) + TMath::Power((zgen-zrec),2);
567 hDr ->Fill(TMath::Sqrt(r2min));
569 hNrpX->Fill(rpMultX);
570 hNrpZ->Fill(rpMultZ);
572 delete [] hitsPerModule;
576 Text_t outputname[80] ;
577 sprintf(outputname,"%s.analyzed",fRootFile->GetName());
578 TFile output(outputname,"RECREATE");
590 TCanvas *cpvCanvas = new TCanvas("CPV","CPV analysis",20,20,800,400);
591 gStyle->SetOptStat(111111);
592 gStyle->SetOptFit(1);
593 gStyle->SetOptDate(1);
594 cpvCanvas->Divide(3,2);
597 gPad->SetFillColor(10);
598 hNrp->SetFillColor(16);
602 gPad->SetFillColor(10);
603 hNrpX->SetFillColor(16);
607 gPad->SetFillColor(10);
608 hNrpZ->SetFillColor(16);
612 gPad->SetFillColor(10);
613 hDx->SetFillColor(16);
618 gPad->SetFillColor(10);
619 hDz->SetFillColor(16);
624 gPad->SetFillColor(10);
625 hDr->SetFillColor(16);
628 cpvCanvas->Print("CPV.ps");
632 //____________________________________________________________________________
633 void AliPHOSAnalyze::InvariantMass(Int_t Nevents )
635 // Calculates Real and Mixed invariant mass distributions
636 const Int_t NMixedEvents = 4 ; //# of events used for calculation of 'mixed' distribution
637 Int_t MixedLoops = (Int_t )TMath::Ceil(Nevents/NMixedEvents) ;
639 //========== Booking Histograms
640 TH2D * hRealEM = new TH2D("hRealEM", "Real for EM particles", 250,0.,1.,40,0.,4.) ;
641 TH2D * hRealPhot = new TH2D("hRealPhot", "Real for kPhoton particles", 250,0.,1.,40,0.,4.) ;
642 TH2D * hMixedEM = new TH2D("hMixedEM", "Mixed for EM particles", 250,0.,1.,40,0.,4.) ;
643 TH2D * hMixedPhot= new TH2D("hMixedPhot","Mixed for kPhoton particles",250,0.,1.,40,0.,4.) ;
646 Int_t EventInMixedLoop ;
648 Int_t NRecParticles[NMixedEvents] ;
650 AliPHOSRecParticle::RecParticlesList * AllRecParticleList = new TClonesArray("AliPHOSRecParticle", NMixedEvents*1000) ;
652 for(EventInMixedLoop = 0; EventInMixedLoop < MixedLoops; EventInMixedLoop++ ){
655 for ( ievent=0; ievent < NMixedEvents; ievent++){
657 Int_t AbsEventNumber = EventInMixedLoop*NMixedEvents + ievent ;
659 //=========== Connects the various Tree's for evt
660 gAlice->GetEvent(AbsEventNumber);
662 //=========== Get the Digit Tree
663 gAlice->TreeD()->GetEvent(0) ;
665 //========== Creating branches ===================================
667 AliPHOSRecParticle::RecParticlesList ** RecParticleList = fPHOS->RecParticles() ;
668 if( (*RecParticleList) )
669 (*RecParticleList)->Clear() ;
670 gAlice->TreeR()->SetBranchAddress( "PHOSRP", RecParticleList ) ;
672 //=========== Gets the Reconstraction TTree
673 gAlice->TreeR()->GetEvent(0) ;
675 AliPHOSRecParticle * RecParticle ;
677 for(iRecParticle = 0; iRecParticle < (*RecParticleList)->GetEntries() ;iRecParticle++ )
679 RecParticle = (AliPHOSRecParticle *) (*RecParticleList)->At(iRecParticle) ;
680 if((RecParticle->GetType() == AliPHOSFastRecParticle::kGAMMA)||
681 (RecParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEM)){
682 new( (*AllRecParticleList)[iRecPhot] ) AliPHOSRecParticle(*RecParticle) ;
687 NRecParticles[ievent] = iRecPhot-1 ;
690 //Now calculate invariant mass:
692 Int_t NCurEvent = 0 ;
694 for(irp1 = 0; irp1 < AllRecParticleList->GetEntries()-1; irp1++){
695 AliPHOSRecParticle * rp1 = (AliPHOSRecParticle *)AllRecParticleList->At(irp1) ;
697 for(irp2 = irp1+1; irp2 < AllRecParticleList->GetEntries(); irp2++){
698 AliPHOSRecParticle * rp2 = (AliPHOSRecParticle *)AllRecParticleList->At(irp2) ;
701 InvMass = (rp1->Energy()+rp2->Energy())*(rp1->Energy()+rp2->Energy())-
702 (rp1->Px()+rp2->Px())*(rp1->Px()+rp2->Px())-
703 (rp1->Py()+rp2->Py())*(rp1->Py()+rp2->Py())-
704 (rp1->Pz()+rp2->Pz())*(rp1->Pz()+rp2->Pz()) ;
707 InvMass = TMath::Sqrt(InvMass);
710 Pt = TMath::Sqrt((rp1->Px()+rp2->Px() )*( rp1->Px()+rp2->Px() ) +(rp1->Py()+rp2->Py())*(rp1->Py()+rp2->Py()));
712 if(irp1 > NRecParticles[NCurEvent])
715 if(irp2 <= NRecParticles[NCurEvent]){ //'Real' event
716 hRealEM->Fill(InvMass,Pt);
717 if((rp1->GetType() == AliPHOSFastRecParticle::kGAMMA)&&(rp2->GetType() == AliPHOSFastRecParticle::kGAMMA))
718 hRealPhot->Fill(InvMass,Pt);
721 hMixedEM->Fill(InvMass,Pt);
722 if((rp1->GetType() == AliPHOSFastRecParticle::kGAMMA)&&(rp2->GetType() == AliPHOSFastRecParticle::kGAMMA))
723 hMixedPhot->Fill(InvMass,Pt);
726 } //loop over second rp
727 }//loop over first rp
728 AllRecParticleList->Delete() ;
731 delete AllRecParticleList ;
734 TFile output("invmass.root","RECREATE");
740 hMixedPhot->Write() ;
747 //____________________________________________________________________________
748 void AliPHOSAnalyze::AnalyzeResolutions(Int_t Nevents )
750 // analyzes Nevents events and calculate Energy and Position resolution as well as
751 // probaility of correct indentifiing of the incident particle
753 //========== Booking Histograms
754 cout << "AnalyzeResolutions > " << "Booking Histograms" << endl ;
755 BookResolutionHistograms();
757 Int_t Counter[9][5] ;
758 Int_t i1,i2,TotalInd = 0 ;
759 for(i1 = 0; i1<9; i1++)
760 for(i2 = 0; i2<5; i2++)
761 Counter[i1][i2] = 0 ;
763 Int_t TotalPrimary = 0 ;
764 Int_t TotalRecPart = 0 ;
765 Int_t TotalRPwithPrim = 0 ;
768 cout << "Start Analysing"<< endl ;
769 for ( ievent=0; ievent<Nevents; ievent++)
772 //========== Event Number>
773 // if ( ( log10((Float_t)(ievent+1)) - (Int_t)(log10((Float_t)(ievent+1))) ) == 0. )
774 cout << "AnalyzeResolutions > " << "Event is " << ievent << endl ;
776 //=========== Connects the various Tree's for evt
777 gAlice->GetEvent(ievent);
779 //=========== Gets the Kine TTree
780 gAlice->TreeK()->GetEvent(0) ;
782 //=========== Gets the list of Primari Particles
783 TClonesArray * PrimaryList = gAlice->Particles();
785 TParticle * Primary ;
787 for ( iPrimary = 0 ; iPrimary < PrimaryList->GetEntries() ; iPrimary++)
789 Primary = (TParticle*)PrimaryList->UncheckedAt(iPrimary) ;
790 Int_t PrimaryType = Primary->GetPdgCode() ;
791 if( PrimaryType == 22 ) {
793 Double_t PrimX, PrimZ ;
794 fGeom->ImpactOnEmc(Primary->Theta(), Primary->Phi(), ModuleNumber, PrimX, PrimZ) ;
796 fhPrimary->Fill(Primary->Energy()) ;
797 if(Primary->Energy() > 0.3)
803 //=========== Get the Digit Tree
804 gAlice->TreeD()->GetEvent(0) ;
806 //========== Creating branches ===================================
807 AliPHOSRecPoint::RecPointsList ** EmcRecPoints = fPHOS->EmcRecPoints() ;
808 gAlice->TreeR()->SetBranchAddress( "PHOSEmcRP", EmcRecPoints ) ;
810 AliPHOSRecPoint::RecPointsList ** PpsdRecPoints = fPHOS->PpsdRecPoints() ;
811 gAlice->TreeR()->SetBranchAddress( "PHOSPpsdRP", PpsdRecPoints ) ;
813 AliPHOSTrackSegment::TrackSegmentsList ** TrackSegmentsList = fPHOS->TrackSegments() ;
814 if( (*TrackSegmentsList) )
815 (*TrackSegmentsList)->Clear() ;
816 gAlice->TreeR()->SetBranchAddress( "PHOSTS", TrackSegmentsList ) ;
818 AliPHOSRecParticle::RecParticlesList ** RecParticleList = fPHOS->RecParticles() ;
819 if( (*RecParticleList) )
820 (*RecParticleList)->Clear() ;
821 gAlice->TreeR()->SetBranchAddress( "PHOSRP", RecParticleList ) ;
823 //=========== Gets the Reconstraction TTree
824 gAlice->TreeR()->GetEvent(0) ;
826 AliPHOSRecParticle * RecParticle ;
828 for(iRecParticle = 0; iRecParticle < (*RecParticleList)->GetEntries() ;iRecParticle++ )
830 RecParticle = (AliPHOSRecParticle *) (*RecParticleList)->At(iRecParticle) ;
831 fhAllRP->Fill(CorrectEnergy(RecParticle->Energy())) ;
833 Int_t ModuleNumberRec ;
834 Double_t RecX, RecZ ;
835 fGeom->ImpactOnEmc(RecParticle->Theta(), RecParticle->Phi(), ModuleNumberRec, RecX, RecZ) ;
837 Double_t MinDistance = 2. ;
838 Int_t ClosestPrimary = -1 ;
840 Int_t numberofprimaries ;
841 Int_t * listofprimaries = RecParticle->GetPrimaries(numberofprimaries) ;
843 TParticle * Primary ;
844 Double_t Distance = MinDistance ;
845 for ( index = 0 ; index < numberofprimaries ; index++){
846 Primary = (TParticle*)PrimaryList->UncheckedAt(listofprimaries[index]) ;
848 Double_t PrimX, PrimZ ;
849 fGeom->ImpactOnEmc(Primary->Theta(), Primary->Phi(), ModuleNumber, PrimX, PrimZ) ;
850 if(ModuleNumberRec == ModuleNumber)
851 Distance = TMath::Sqrt((RecX-PrimX)*(RecX-PrimX)+(RecZ-PrimZ)*(RecZ-PrimZ) ) ;
852 if(MinDistance > Distance)
854 MinDistance = Distance ;
855 ClosestPrimary = listofprimaries[index] ;
860 if(ClosestPrimary >=0 ){
863 Int_t PrimaryType = ((TParticle *)PrimaryList->At(ClosestPrimary))->GetPdgCode() ;
864 // TParticlePDG* PDGparticle = ((TParticle *)PrimaryList->At(ClosestPrimary))->GetPDG();
865 // Double_t charge = PDGparticle->Charge() ;
867 // cout <<"Primary " <<PrimaryType << " E " << ((TParticle *)PrimaryList->At(ClosestPrimary))->Energy() << endl ;
872 PrimaryCode = 0; //Photon
873 fhAllEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy()) ;
874 fhAllPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
877 PrimaryCode = 1; //Electron
880 PrimaryCode = 1; //positron
883 PrimaryCode = 4; //K+
886 PrimaryCode = 4; //K-
889 PrimaryCode = 4; //K0s
892 PrimaryCode = 4; //K0l
895 PrimaryCode = 2; //K0l
898 PrimaryCode = 2; //K0l
901 PrimaryCode = 2; //K0l
904 PrimaryCode = 2; //K0l
907 PrimaryCode = 3; //ELSE
911 switch(RecParticle->GetType())
913 case AliPHOSFastRecParticle::kGAMMA:
914 if(PrimaryType == 22){
915 fhPhotEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
916 fhEMEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
917 fhPPSDEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
919 fhPhotPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
920 fhEMPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
921 fhPPSDPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
923 fhPhotReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
924 fhPhotEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
925 fhPhotPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
927 fhPhotPhot->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
929 if(PrimaryType == 2112){ //neutron
930 fhNReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
931 fhNEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
932 fhNPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
935 if(PrimaryType == -2112){ //neutron ~
936 fhNBarReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
937 fhNBarEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
938 fhNBarPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
941 if(PrimaryCode == 2){
942 fhChargedReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
943 fhChargedEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
944 fhChargedPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
947 fhAllReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
948 fhAllEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
949 fhAllPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
950 fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
951 fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
952 fhPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
953 Counter[0][PrimaryCode]++;
955 case AliPHOSFastRecParticle::kELECTRON:
956 if(PrimaryType == 22){
957 fhPhotElec->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
958 fhEMEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
959 fhEMPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
960 fhPhotEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
961 fhPhotPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
963 if(PrimaryType == 2112){ //neutron
964 fhNEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
965 fhNPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
968 if(PrimaryType == -2112){ //neutron ~
969 fhNBarEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
970 fhNBarPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
973 if(PrimaryCode == 2){
974 fhChargedEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
975 fhChargedPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
978 fhAllEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
979 fhAllPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
980 fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
981 fhPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
982 Counter[1][PrimaryCode]++;
984 case AliPHOSFastRecParticle::kNEUTRALHA:
985 if(PrimaryType == 22)
986 fhPhotNeuH->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
988 fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
989 Counter[2][PrimaryCode]++;
991 case AliPHOSFastRecParticle::kNEUTRALEM:
992 if(PrimaryType == 22){
993 fhEMEnergy->Fill(((TParticle *)PrimaryList->At(ClosestPrimary))->Energy(),RecParticle->Energy() ) ;
994 fhEMPosition->Fill(((TParticle *)PrimaryList->At(ClosestPrimary))->Energy(),MinDistance ) ;
996 fhPhotNuEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
997 fhPhotEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
999 if(PrimaryType == 2112) //neutron
1000 fhNEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1002 if(PrimaryType == -2112) //neutron ~
1003 fhNBarEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1005 if(PrimaryCode == 2)
1006 fhChargedEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1008 fhAllEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1009 fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1010 fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1012 Counter[3][PrimaryCode]++;
1014 case AliPHOSFastRecParticle::kCHARGEDHA:
1015 if(PrimaryType == 22) //photon
1016 fhPhotChHa->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1018 Counter[4][PrimaryCode]++ ;
1020 case AliPHOSFastRecParticle::kGAMMAHA:
1021 if(PrimaryType == 22){ //photon
1022 fhPhotGaHa->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1023 fhPPSDEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
1024 fhPPSDPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
1025 fhPhotPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1027 if(PrimaryType == 2112){ //neutron
1028 fhNPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1031 if(PrimaryType == -2112){ //neutron ~
1032 fhNBarPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1034 if(PrimaryCode == 2){
1035 fhChargedPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1038 fhAllPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1039 fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1040 fhPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1041 Counter[5][PrimaryCode]++ ;
1043 case AliPHOSFastRecParticle::kABSURDEM:
1044 Counter[6][PrimaryCode]++ ;
1045 fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1047 case AliPHOSFastRecParticle::kABSURDHA:
1048 Counter[7][PrimaryCode]++ ;
1051 Counter[8][PrimaryCode]++ ;
1058 cout << "Resolutions: Analyzed " << Nevents << " event(s)" << endl ;
1059 cout << "Resolutions: Total primary " << TotalPrimary << endl ;
1060 cout << "Resoluitons: Total reconstracted " << TotalRecPart << endl ;
1061 cout << "TotalReconstructed with Primarie " << TotalRPwithPrim << endl ;
1062 cout << " Primary: Photon Electron Ch. Hadr. Neutr. Hadr Kaons" << endl ;
1063 cout << " Detected as photon " << Counter[0][0] << " " << Counter[0][1] << " " << Counter[0][2] << " " <<Counter[0][3] << " " << Counter[0][4] << endl ;
1064 cout << " Detected as electron " << Counter[1][0] << " " << Counter[1][1] << " " << Counter[1][2] << " " <<Counter[1][3] << " " << Counter[1][4] << endl ;
1065 cout << " Detected as neutral hadron " << Counter[2][0] << " " << Counter[2][1] << " " << Counter[2][2] << " " <<Counter[2][3] << " " << Counter[2][4] << endl ;
1066 cout << " Detected as neutral EM " << Counter[3][0] << " " << Counter[3][1] << " " << Counter[3][2] << " " <<Counter[3][3] << " " << Counter[3][4] << endl ;
1067 cout << " Detected as charged hadron " << Counter[4][0] << " " << Counter[4][1] << " " << Counter[4][2] << " " <<Counter[4][3] << " " << Counter[4][4] << endl ;
1068 cout << " Detected as gamma-hadron " << Counter[5][0] << " " << Counter[5][1] << " " << Counter[5][2] << " " <<Counter[5][3] << " " << Counter[5][4] << endl ;
1069 cout << " Detected as Absurd EM " << Counter[6][0] << " " << Counter[6][1] << " " << Counter[6][2] << " " <<Counter[6][3] << " " << Counter[6][4] << endl ;
1070 cout << " Detected as absurd hadron " << Counter[7][0] << " " << Counter[7][1] << " " << Counter[7][2] << " " <<Counter[7][3] << " " << Counter[7][4] << endl ;
1071 cout << " Detected as undefined " << Counter[8][0] << " " << Counter[8][1] << " " << Counter[8][2] << " " <<Counter[8][3] << " " << Counter[8][4] << endl ;
1073 for(i1 = 0; i1<9; i1++)
1074 for(i2 = 0; i2<5; i2++)
1075 TotalInd+=Counter[i1][i2] ;
1076 cout << "Indentified particles " << TotalInd << endl ;
1081 //____________________________________________________________________________
1082 void AliPHOSAnalyze::BookingHistograms()
1084 // Books the histograms where the results of the analysis are stored (to be changed)
1087 delete fhVetoDigit ;
1088 delete fhConvertorDigit ;
1089 delete fhEmcCluster ;
1090 delete fhVetoCluster ;
1091 delete fhConvertorCluster ;
1092 delete fhConvertorEmc ;
1094 fhEmcDigit = new TH1F("hEmcDigit", "hEmcDigit", 1000, 0. , 25.);
1095 fhVetoDigit = new TH1F("hVetoDigit", "hVetoDigit", 500, 0. , 3.e-5);
1096 fhConvertorDigit = new TH1F("hConvertorDigit","hConvertorDigit", 500, 0. , 3.e-5);
1097 fhEmcCluster = new TH1F("hEmcCluster", "hEmcCluster", 1000, 0. , 30.);
1098 fhVetoCluster = new TH1F("hVetoCluster", "hVetoCluster", 500, 0. , 3.e-5);
1099 fhConvertorCluster = new TH1F("hConvertorCluster","hConvertorCluster",500, 0. , 3.e-5);
1100 fhConvertorEmc = new TH2F("hConvertorEmc", "hConvertorEmc", 200, 1. , 3., 200, 0., 3.e-5);
1103 //____________________________________________________________________________
1104 void AliPHOSAnalyze::BookResolutionHistograms()
1106 // Books the histograms where the results of the Resolution analysis are stored
1109 // delete fhAllEnergy ;
1111 // delete fhPhotEnergy ;
1113 // delete fhEMEnergy ;
1115 // delete fhPPSDEnergy ;
1118 fhAllEnergy = new TH2F("hAllEnergy", "Energy of any RP with primary photon",100, 0., 5., 100, 0., 5.);
1119 fhPhotEnergy = new TH2F("hPhotEnergy", "Energy of kGAMMA with primary photon",100, 0., 5., 100, 0., 5.);
1120 fhEMEnergy = new TH2F("hEMEnergy", "Energy of EM with primary photon", 100, 0., 5., 100, 0., 5.);
1121 fhPPSDEnergy = new TH2F("hPPSDEnergy", "Energy of PPSD with primary photon", 100, 0., 5., 100, 0., 5.);
1123 // if(fhAllPosition)
1124 // delete fhAllPosition ;
1125 // if(fhPhotPosition)
1126 // delete fhPhotPosition ;
1128 // delete fhEMPosition ;
1129 // if(fhPPSDPosition)
1130 // delete fhPPSDPosition ;
1133 fhAllPosition = new TH2F("hAllPosition", "Position of any RP with primary photon",100, 0., 5., 100, 0., 5.);
1134 fhPhotPosition = new TH2F("hPhotPosition", "Position of kGAMMA with primary photon",100, 0., 5., 100, 0., 5.);
1135 fhEMPosition = new TH2F("hEMPosition", "Position of EM with primary photon", 100, 0., 5., 100, 0., 5.);
1136 fhPPSDPosition = new TH2F("hPPSDPosition", "Position of PPSD with primary photon", 100, 0., 5., 100, 0., 5.);
1139 // delete fhAllReg ;
1141 // delete fhPhotReg ;
1145 // delete fhNBarReg ;
1147 // delete fhChargedReg ;
1149 fhAllReg = new TH1F("hAllReg", "All primaries registered as photon", 100, 0., 5.);
1150 fhPhotReg = new TH1F("hPhotReg", "Photon registered as photon", 100, 0., 5.);
1151 fhNReg = new TH1F("hNReg", "N registered as photon", 100, 0., 5.);
1152 fhNBarReg = new TH1F("hNBarReg", "NBar registered as photon", 100, 0., 5.);
1153 fhChargedReg= new TH1F("hChargedReg", "Charged hadron registered as photon",100, 0., 5.);
1158 // delete fhPhotEM ;
1162 // delete fhNBarEM ;
1164 // delete fhChargedEM ;
1166 fhAllEM = new TH1F("hAllEM", "All primary registered as EM",100, 0., 5.);
1167 fhPhotEM = new TH1F("hPhotEM", "Photon registered as EM", 100, 0., 5.);
1168 fhNEM = new TH1F("hNEM", "N registered as EM", 100, 0., 5.);
1169 fhNBarEM = new TH1F("hNBarEM", "NBar registered as EM", 100, 0., 5.);
1170 fhChargedEM= new TH1F("hChargedEM","Charged registered as EM",100, 0., 5.);
1173 // delete fhAllPPSD ;
1175 // delete fhPhotPPSD ;
1179 // delete fhNBarPPSD ;
1180 // if(fhChargedPPSD)
1181 // delete fhChargedPPSD ;
1183 fhAllPPSD = new TH1F("hAllPPSD", "All primary registered as PPSD",100, 0., 5.);
1184 fhPhotPPSD = new TH1F("hPhotPPSD", "Photon registered as PPSD", 100, 0., 5.);
1185 fhNPPSD = new TH1F("hNPPSD", "N registered as PPSD", 100, 0., 5.);
1186 fhNBarPPSD = new TH1F("hNBarPPSD", "NBar registered as PPSD", 100, 0., 5.);
1187 fhChargedPPSD= new TH1F("hChargedPPSD","Charged registered as PPSD",100, 0., 5.);
1190 // delete fhPrimary ;
1191 fhPrimary= new TH1F("hPrimary", "hPrimary", 100, 0., 5.);
1202 fhAllRP = new TH1F("hAllRP","All Reconstructed particles", 100, 0., 5.);
1203 fhVeto = new TH1F("hVeto", "All uncharged particles", 100, 0., 5.);
1204 fhShape = new TH1F("hShape","All particles with EM shaower",100, 0., 5.);
1205 fhPPSD = new TH1F("hPPSD", "All PPSD photon particles", 100, 0., 5.);
1209 // delete fhPhotPhot ;
1211 // delete fhPhotElec ;
1213 // delete fhPhotNeuH ;
1215 // delete fhPhotNuEM ;
1217 // delete fhPhotChHa ;
1219 // delete fhPhotGaHa ;
1221 fhPhotPhot = new TH1F("hPhotPhot","hPhotPhot", 100, 0., 5.); //Photon registered as photon
1222 fhPhotElec = new TH1F("hPhotElec","hPhotElec", 100, 0., 5.); //Photon registered as Electron
1223 fhPhotNeuH = new TH1F("hPhotNeuH","hPhotNeuH", 100, 0., 5.); //Photon registered as Neutral Hadron
1224 fhPhotNuEM = new TH1F("hPhotNuEM","hPhotNuEM", 100, 0., 5.); //Photon registered as Neutral EM
1225 fhPhotChHa = new TH1F("hPhotChHa","hPhotChHa", 100, 0., 5.); //Photon registered as Charged Hadron
1226 fhPhotGaHa = new TH1F("hPhotGaHa","hPhotGaHa", 100, 0., 5.); //Photon registered as Gamma-Hadron
1230 //____________________________________________________________________________
1231 Bool_t AliPHOSAnalyze::Init(Int_t evt)
1233 // Do a few initializations: open the root file
1234 // get the AliRun object
1235 // defines the clusterizer, tracksegment maker and particle identifier
1236 // sets the associated parameters
1240 //========== Open galice root file
1242 if ( fRootFile == 0 ) {
1243 Text_t * name = new Text_t[80] ;
1244 cout << "AnalyzeOneEvent > Enter file root file name : " ;
1246 Bool_t ok = OpenRootFile(name) ;
1248 cout << " AliPHOSAnalyze > Error opening " << name << endl ;
1250 //========== Get AliRun object from file
1252 gAlice = (AliRun*) fRootFile->Get("gAlice") ;
1254 //=========== Get the PHOS object and associated geometry from the file
1256 fPHOS = (AliPHOSv1 *)gAlice->GetDetector("PHOS") ;
1257 fGeom = fPHOS->GetGeometry();
1258 // fGeom = AliPHOSGeometry::GetInstance( fPHOS->GetGeometry()->GetName(), fPHOS->GetGeometry()->GetTitle() );
1265 //========== Create the Clusterizer
1267 fClu = new AliPHOSClusterizerv1() ;
1268 fClu->SetEmcEnergyThreshold(0.030) ;
1269 fClu->SetEmcClusteringThreshold(0.20) ;
1270 fClu->SetPpsdEnergyThreshold (0.0000002) ;
1271 fClu->SetPpsdClusteringThreshold(0.0000001) ;
1272 fClu->SetLocalMaxCut(0.03) ;
1273 fClu->SetCalibrationParameters(0., 0.00000001) ;
1274 cout << "AnalyzeOneEvent > using clusterizer " << fClu->GetName() << endl ;
1275 fClu->PrintParameters() ;
1277 //========== Creates the track segment maker
1279 fTrs = new AliPHOSTrackSegmentMakerv1() ;
1280 cout << "AnalyzeOneEvent > using tack segment maker " << fTrs->GetName() << endl ;
1281 // fTrs->UnsetUnfoldFlag() ;
1283 //========== Creates the particle identifier
1285 fPID = new AliPHOSPIDv1() ;
1286 cout << "AnalyzeOneEvent > using particle identifier " << fPID->GetName() << endl ;
1287 //fPID->SetShowerProfileCuts(Float_t l1m, Float_t l1M, Float_t l2m, Float_t l2M) ;
1288 fPID->SetShowerProfileCuts(0.7, 2.0 , 0.6 , 1.5) ;
1290 //========== Creates the Reconstructioner
1292 fRec = new AliPHOSReconstructioner(fClu, fTrs, fPID) ;
1293 // fRec -> SetDebugReconstruction(kFALSE);
1294 fRec -> SetDebugReconstruction(kTRUE);
1296 //=========== Connect the various Tree's for evt
1298 if ( evt == -999 ) {
1299 cout << "AnalyzeOneEvent > Enter event number : " ;
1301 cout << evt << endl ;
1304 gAlice->GetEvent(evt);
1306 //=========== Get the Digit TTree
1308 gAlice->TreeD()->GetEvent(0) ;
1316 //____________________________________________________________________________
1317 void AliPHOSAnalyze::DisplayKineEvent(Int_t evt)
1319 // Display particles from the Kine Tree in global Alice (theta, phi) coordinates.
1320 // One PHOS module at the time.
1321 // The particle type can be selected.
1327 cout << "DisplayKineEvent > which module (1-5, -1: all) ? " ;
1328 cin >> module ; cout << module << endl ;
1330 Int_t testparticle ;
1331 cout << " 22 : PHOTON " << endl
1332 << " (-)11 : (POSITRON)ELECTRON " << endl
1333 << " (-)2112 : (ANTI)NEUTRON " << endl
1334 << " -999 : Everything else " << endl ;
1335 cout << "DisplayKineEvent > enter PDG particle code to display " ;
1336 cin >> testparticle ; cout << testparticle << endl ;
1338 Text_t histoname[80] ;
1339 sprintf(histoname,"Event %d: Incident particles in module %d", evt, module) ;
1341 Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by module
1342 fGeom->EmcModuleCoverage(module, tm, tM, pm, pM, AliPHOSGeometry::Degre() ) ;
1344 Double_t theta, phi ;
1345 fGeom->EmcXtalCoverage(theta, phi, AliPHOSGeometry::Degre() ) ;
1347 Int_t tdim = (Int_t)( (tM - tm) / theta ) ;
1348 Int_t pdim = (Int_t)( (pM - pm) / phi ) ;
1355 TH2F * histoparticle = new TH2F("histoparticle", histoname,
1356 pdim, pm, pM, tdim, tm, tM) ;
1357 histoparticle->SetStats(kFALSE) ;
1359 // Get pointers to Alice Particle TClonesArray
1361 TParticle * particle;
1362 TClonesArray * particlearray = gAlice->Particles();
1364 Text_t canvasname[80];
1365 sprintf(canvasname,"Particles incident in PHOS/EMC module # %d",module) ;
1366 TCanvas * kinecanvas = new TCanvas("kinecanvas", canvasname, 650, 500) ;
1368 // get the KINE Tree
1370 TTree * kine = gAlice->TreeK() ;
1371 Stat_t nParticles = kine->GetEntries() ;
1372 cout << "DisplayKineEvent > events in kine " << nParticles << endl ;
1374 // loop over particles
1376 Double_t kRADDEG = 180. / TMath::Pi() ;
1378 Int_t nparticlein = 0 ;
1379 for (index1 = 0 ; index1 < nParticles ; index1++){
1380 Int_t nparticle = particlearray->GetEntriesFast() ;
1382 for( index2 = 0 ; index2 < nparticle ; index2++) {
1383 particle = (TParticle*)particlearray->UncheckedAt(index2) ;
1384 Int_t particletype = particle->GetPdgCode() ;
1385 if (testparticle == -999 || testparticle == particletype) {
1386 Double_t phi = particle->Phi() ;
1387 Double_t theta = particle->Theta() ;
1390 fGeom->ImpactOnEmc(theta, phi, mod, z, x) ;
1391 if ( mod == module ) {
1393 if (particle->Energy() > fClu->GetEmcClusteringThreshold() )
1394 histoparticle->Fill(phi*kRADDEG, theta*kRADDEG, particle->Energy() ) ;
1399 kinecanvas->Draw() ;
1400 histoparticle->Draw("color") ;
1401 TPaveText * pavetext = new TPaveText(294, 100, 300, 101);
1403 sprintf(text, "Particles: %d ", nparticlein) ;
1404 pavetext->AddText(text) ;
1406 kinecanvas->Update();
1409 //____________________________________________________________________________
1410 void AliPHOSAnalyze::DisplayRecParticles()
1412 // Display reconstructed particles in global Alice(theta, phi) coordinates.
1413 // One PHOS module at the time.
1414 // Click on symbols indicate the reconstructed particle type.
1417 cout << "DisplayRecParticles > Analyze an event first ... (y/n) " ;
1419 cin >> answer ; cout << answer ;
1420 // if ( answer == "y" )
1421 // AnalyzeOneEvent() ;
1426 cout << "DisplayRecParticles > which module (1-5, -1: all) ? " ;
1427 cin >> module ; cout << module << endl ;
1428 Text_t histoname[80] ;
1429 sprintf(histoname,"Event %d: Reconstructed particles in module %d", fEvt, module) ;
1430 Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by module
1431 fGeom->EmcModuleCoverage(module, tm, tM, pm, pM, AliPHOSGeometry::Degre() ) ;
1432 Double_t theta, phi ;
1433 fGeom->EmcXtalCoverage(theta, phi, AliPHOSGeometry::Degre() ) ;
1434 Int_t tdim = (Int_t)( (tM - tm) / theta ) ;
1435 Int_t pdim = (Int_t)( (pM - pm) / phi ) ;
1439 TH2F * histoRparticle = new TH2F("histoRparticle", histoname,
1440 pdim, pm, pM, tdim, tm, tM) ;
1441 histoRparticle->SetStats(kFALSE) ;
1442 Text_t canvasname[80] ;
1443 sprintf(canvasname, "Reconstructed particles in PHOSmodule # %d", module) ;
1444 TCanvas * rparticlecanvas = new TCanvas("RparticleCanvas", canvasname, 650, 500) ;
1445 AliPHOSRecParticle::RecParticlesList * rpl = *fPHOS->RecParticles() ;
1446 Int_t nRecParticles = rpl->GetEntries() ;
1447 Int_t nRecParticlesInModule = 0 ;
1448 TIter nextRecPart(rpl) ;
1449 AliPHOSRecParticle * rp ;
1450 cout << "DisplayRecParticles > " << nRecParticles << " reconstructed particles " << endl ;
1451 Double_t kRADDEG = 180. / TMath::Pi() ;
1452 while ( (rp = (AliPHOSRecParticle *)nextRecPart() ) ) {
1453 AliPHOSTrackSegment * ts = rp->GetPHOSTrackSegment() ;
1454 if ( ts->GetPHOSMod() == module ) {
1455 Int_t numberofprimaries = 0 ;
1456 Int_t * listofprimaries = 0;
1457 rp->GetPrimaries(numberofprimaries) ;
1458 cout << "Number of primaries = " << numberofprimaries << endl ;
1460 for ( index = 0 ; index < numberofprimaries ; index++)
1461 cout << " primary # " << index << " = " << listofprimaries[index] << endl ;
1463 nRecParticlesInModule++ ;
1464 Double_t theta = rp->Theta() * kRADDEG ;
1465 Double_t phi = rp->Phi() * kRADDEG ;
1466 Double_t energy = rp->Energy() ;
1467 histoRparticle->Fill(phi, theta, energy) ;
1470 histoRparticle->Draw("color") ;
1472 nextRecPart.Reset() ;
1473 while ( (rp = (AliPHOSRecParticle *)nextRecPart() ) ) {
1474 AliPHOSTrackSegment * ts = rp->GetPHOSTrackSegment() ;
1475 if ( ts->GetPHOSMod() == module )
1480 sprintf(text, "reconstructed particles: %d", nRecParticlesInModule) ;
1481 TPaveText * pavetext = new TPaveText(292, 100, 300, 101);
1482 pavetext->AddText(text) ;
1484 rparticlecanvas->Update() ;
1488 //____________________________________________________________________________
1489 void AliPHOSAnalyze::DisplayRecPoints()
1491 // Display reconstructed points in local PHOS-module (x, z) coordinates.
1492 // One PHOS module at the time.
1493 // Click on symbols displays the EMC cluster, or PPSD information.
1496 cout << "DisplayRecPoints > Analyze an event first ... (y/n) " ;
1498 cin >> answer ; cout << answer ;
1499 // if ( answer == "y" )
1500 // AnalyzeOneEvent() ;
1505 cout << "DisplayRecPoints > which module (1-5, -1: all) ? " ;
1506 cin >> module ; cout << module << endl ;
1508 Text_t canvasname[80];
1509 sprintf(canvasname,"Digits in PHOS/EMC module # %d",module) ;
1510 TCanvas * modulecanvas = new TCanvas("module", canvasname, 650, 500) ;
1511 modulecanvas->Draw() ;
1513 //=========== Creating 2d-histogram of the PHOS module
1514 // a little bit junkie but is used to test Geom functinalities
1516 Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by module
1518 fGeom->EmcModuleCoverage(module, tm, tM, pm, pM);
1519 // convert angles into coordinates local to the EMC module of interest
1521 Int_t emcModuleNumber ;
1522 Double_t emcModulexm, emcModulezm ; // minimum local coordinate in a given EMCA module
1523 Double_t emcModulexM, emcModulezM ; // maximum local coordinate in a given EMCA module
1524 fGeom->ImpactOnEmc(tm, pm, emcModuleNumber, emcModulezm, emcModulexm) ;
1525 fGeom->ImpactOnEmc(tM, pM, emcModuleNumber, emcModulezM, emcModulexM) ;
1526 Int_t xdim = (Int_t)( ( emcModulexM - emcModulexm ) / fGeom->GetCrystalSize(0) ) ;
1527 Int_t zdim = (Int_t)( ( emcModulezM - emcModulezm ) / fGeom->GetCrystalSize(2) ) ;
1528 Float_t xmin = emcModulexm - fGeom->GetCrystalSize(0) ;
1529 Float_t xMax = emcModulexM + fGeom->GetCrystalSize(0) ;
1530 Float_t zmin = emcModulezm - fGeom->GetCrystalSize(2) ;
1531 Float_t zMax = emcModulezM + fGeom->GetCrystalSize(2) ;
1532 Text_t histoname[80];
1533 sprintf(histoname,"Event %d: Digits and RecPoints in module %d", fEvt, module) ;
1534 TH2F * hModule = new TH2F("HistoReconstructed", histoname,
1535 xdim, xmin, xMax, zdim, zmin, zMax) ;
1536 hModule->SetMaximum(2.0);
1537 hModule->SetMinimum(0.0);
1538 hModule->SetStats(kFALSE);
1540 TIter next(fPHOS->Digits()) ;
1541 Float_t energy, y, z;
1543 Int_t relid[4]; Int_t nDigits = 0 ;
1544 AliPHOSDigit * digit ;
1546 // Making 2D histogram of the EMC module
1547 while((digit = (AliPHOSDigit *)next()))
1549 fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
1550 if (relid[0] == module && relid[1] == 0)
1552 energy = fClu->Calibrate(digit->GetAmp()) ;
1553 cout << "Energy is " << energy << " and threshold is " << fClu->GetEmcEnergyThreshold() << endl;
1554 if (energy > fClu->GetEmcEnergyThreshold() ){
1557 fGeom->RelPosInModule(relid,y,z) ;
1558 hModule->Fill(y, z, energy) ;
1562 cout <<"DrawRecPoints > Found in module "
1563 << module << " " << nDigits << " digits with total energy " << etot << endl ;
1564 hModule->Draw("col2") ;
1566 //=========== Cluster in module
1568 // TClonesArray * emcRP = fPHOS->EmcClusters() ;
1569 TObjArray * emcRP = *(fPHOS->EmcRecPoints()) ;
1572 Int_t totalnClusters = 0 ;
1573 Int_t nClusters = 0 ;
1574 TIter nextemc(emcRP) ;
1575 AliPHOSEmcRecPoint * emc ;
1576 while((emc = (AliPHOSEmcRecPoint *)nextemc()))
1578 // Int_t numberofprimaries ;
1579 // Int_t * primariesarray = new Int_t[10] ;
1580 // emc->GetPrimaries(numberofprimaries, primariesarray) ;
1582 if ( emc->GetPHOSMod() == module )
1585 energy = emc->GetTotalEnergy() ;
1590 cout << "DrawRecPoints > Found " << totalnClusters << " EMC Clusters in PHOS" << endl ;
1591 cout << "DrawRecPoints > Found in module " << module << " " << nClusters << " EMC Clusters " << endl ;
1592 cout << "DrawRecPoints > total energy " << etot << endl ;
1594 TPaveText * pavetext = new TPaveText(22, 80, 83, 90);
1596 sprintf(text, "digits: %d; clusters: %d", nDigits, nClusters) ;
1597 pavetext->AddText(text) ;
1599 modulecanvas->Update();
1601 //=========== Cluster in module PPSD Down
1603 // TClonesArray * ppsdRP = fPHOS->PpsdClusters() ;
1604 TObjArray * ppsdRP = *(fPHOS->PpsdRecPoints() );
1607 TIter nextPpsd(ppsdRP) ;
1608 AliPHOSPpsdRecPoint * ppsd ;
1609 while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
1612 if ( ppsd->GetPHOSMod() == module )
1615 energy = ppsd->GetEnergy() ;
1617 if (!ppsd->GetUp()) ppsd->Draw("P") ;
1620 cout << "DrawRecPoints > Found " << totalnClusters << " Ppsd Down Clusters in PHOS" << endl ;
1621 cout << "DrawRecPoints > Found in module " << module << " " << nClusters << " Ppsd Down Clusters " << endl ;
1622 cout << "DrawRecPoints > total energy " << etot << endl ;
1624 //=========== Cluster in module PPSD Up
1626 ppsdRP = *(fPHOS->PpsdRecPoints()) ;
1629 TIter nextPpsdUp(ppsdRP) ;
1630 while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsdUp()))
1633 if ( ppsd->GetPHOSMod() == module )
1636 energy = ppsd->GetEnergy() ;
1638 if (ppsd->GetUp()) ppsd->Draw("P") ;
1641 cout << "DrawRecPoints > Found " << totalnClusters << " Ppsd Up Clusters in PHOS" << endl ;
1642 cout << "DrawRecPoints > Found in module " << module << " " << nClusters << " Ppsd Up Clusters " << endl ;
1643 cout << "DrawRecPoints > total energy " << etot << endl ;
1648 //____________________________________________________________________________
1649 void AliPHOSAnalyze::DisplayTrackSegments()
1651 // Display track segments in local PHOS-module (x, z) coordinates.
1652 // One PHOS module at the time.
1653 // One symbol per PHOS subsystem: EMC, upper PPSD, lower PPSD.
1656 cout << "DisplayTrackSegments > Analyze an event first ... (y/n) " ;
1658 cin >> answer ; cout << answer ;
1659 // if ( answer == "y" )
1660 // AnalyzeOneEvent() ;
1665 cout << "DisplayTrackSegments > which module (1-5, -1: all) ? " ;
1666 cin >> module ; cout << module << endl ;
1667 //=========== Creating 2d-histogram of the PHOS module
1668 // a little bit junkie but is used to test Geom functinalities
1670 Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by module
1672 fGeom->EmcModuleCoverage(module, tm, tM, pm, pM);
1673 // convert angles into coordinates local to the EMC module of interest
1675 Int_t emcModuleNumber ;
1676 Double_t emcModulexm, emcModulezm ; // minimum local coordinate in a given EMCA module
1677 Double_t emcModulexM, emcModulezM ; // maximum local coordinate in a given EMCA module
1678 fGeom->ImpactOnEmc(tm, pm, emcModuleNumber, emcModulezm, emcModulexm) ;
1679 fGeom->ImpactOnEmc(tM, pM, emcModuleNumber, emcModulezM, emcModulexM) ;
1680 Int_t xdim = (Int_t)( ( emcModulexM - emcModulexm ) / fGeom->GetCrystalSize(0) ) ;
1681 Int_t zdim = (Int_t)( ( emcModulezM - emcModulezm ) / fGeom->GetCrystalSize(2) ) ;
1682 Float_t xmin = emcModulexm - fGeom->GetCrystalSize(0) ;
1683 Float_t xMax = emcModulexM + fGeom->GetCrystalSize(0) ;
1684 Float_t zmin = emcModulezm - fGeom->GetCrystalSize(2) ;
1685 Float_t zMax = emcModulezM + fGeom->GetCrystalSize(2) ;
1686 Text_t histoname[80];
1687 sprintf(histoname,"Event %d: Track Segments in module %d", fEvt, module) ;
1688 TH2F * histotrack = new TH2F("histotrack", histoname,
1689 xdim, xmin, xMax, zdim, zmin, zMax) ;
1690 histotrack->SetStats(kFALSE);
1691 Text_t canvasname[80];
1692 sprintf(canvasname,"Track segments in PHOS/EMC-PPSD module # %d", module) ;
1693 TCanvas * trackcanvas = new TCanvas("TrackSegmentCanvas", canvasname, 650, 500) ;
1694 histotrack->Draw() ;
1696 AliPHOSTrackSegment::TrackSegmentsList * trsegl = *(fPHOS->TrackSegments()) ;
1697 AliPHOSTrackSegment * trseg ;
1699 Int_t nTrackSegments = trsegl->GetEntries() ;
1702 Int_t nTrackSegmentsInModule = 0 ;
1703 for(index = 0; index < nTrackSegments ; index++){
1704 trseg = (AliPHOSTrackSegment * )trsegl->At(index) ;
1705 etot+= trseg->GetEnergy() ;
1706 if ( trseg->GetPHOSMod() == module ) {
1707 nTrackSegmentsInModule++ ;
1712 sprintf(text, "track segments: %d", nTrackSegmentsInModule) ;
1713 TPaveText * pavetext = new TPaveText(22, 80, 83, 90);
1714 pavetext->AddText(text) ;
1716 trackcanvas->Update() ;
1717 cout << "DisplayTrackSegments > Found " << trsegl->GetEntries() << " Track segments with total energy "<< etot << endl ;
1721 //____________________________________________________________________________
1722 Bool_t AliPHOSAnalyze::OpenRootFile(Text_t * name)
1724 // Open the root file named "name"
1726 fRootFile = new TFile(name, "update") ;
1727 return fRootFile->IsOpen() ;
1729 //____________________________________________________________________________
1730 void AliPHOSAnalyze::SaveHistograms()
1732 // Saves the histograms in a root file named "name.analyzed"
1734 Text_t outputname[80] ;
1735 sprintf(outputname,"%s.analyzed",fRootFile->GetName());
1736 TFile output(outputname,"RECREATE");
1740 fhAllEnergy->Write() ;
1742 fhPhotEnergy->Write() ;
1744 fhEMEnergy->Write() ;
1746 fhPPSDEnergy->Write() ;
1748 fhAllPosition->Write() ;
1750 fhPhotPosition->Write() ;
1752 fhEMPosition->Write() ;
1754 fhPPSDPosition->Write() ;
1758 fhPhotReg->Write() ;
1762 fhNBarReg->Write() ;
1764 fhChargedReg->Write() ;
1774 fhChargedEM->Write() ;
1776 fhAllPPSD->Write() ;
1778 fhPhotPPSD->Write() ;
1782 fhNBarPPSD->Write() ;
1784 fhChargedPPSD->Write() ;
1786 fhPrimary->Write() ;
1796 fhPhotPhot->Write() ;
1798 fhPhotElec->Write() ;
1800 fhPhotNeuH->Write() ;
1802 fhPhotNuEM->Write() ;
1804 fhPhotNuEM->Write() ;
1806 fhPhotChHa->Write() ;
1808 fhPhotGaHa->Write() ;
1809 if(fhEnergyCorrelations)
1810 fhEnergyCorrelations->Write() ;
1815 //____________________________________________________________________________
1816 Float_t AliPHOSAnalyze::CorrectEnergy(Float_t ERecPart)
1818 return ERecPart/0.8783 ;
1821 //____________________________________________________________________________
1822 void AliPHOSAnalyze::ResetHistograms()
1824 fhEnergyCorrelations = 0 ; //Energy correlations between Eloss in Convertor and PPSD(2)
1826 fhEmcDigit = 0 ; // Histo of digit energies in the Emc
1827 fhVetoDigit = 0 ; // Histo of digit energies in the Veto
1828 fhConvertorDigit = 0 ; // Histo of digit energies in the Convertor
1829 fhEmcCluster = 0 ; // Histo of Cluster energies in Emc
1830 fhVetoCluster = 0 ; // Histo of Cluster energies in Veto
1831 fhConvertorCluster = 0 ; // Histo of Cluster energies in Convertor
1832 fhConvertorEmc = 0 ; // 2d Convertor versus Emc energies
1835 fhPhotEnergy = 0 ; // Total spectrum of detected photons
1836 fhEMEnergy = 0 ; // Spectrum of detected electrons with electron primary
1839 fhPhotPosition = 0 ;
1841 fhPPSDPosition = 0 ;