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);
411 for (iModule=0; iModule < fGeom->GetNModules(); iModule++) {
412 cpvModule = fPHOS->GetCPVModule(iModule);
413 cpvHits = cpvModule.Hits();
414 nCPVhits = cpvHits->GetEntriesFast();
415 for (Int_t ihit=0; ihit<nCPVhits; ihit++) {
417 cpvHit = (AliPHOSCPVHit*)cpvHits->UncheckedAt(ihit);
418 p = cpvHit->GetMomentum();
421 ipart = cpvHit->GetIpart();
422 printf("CPV hit in module %d: ",iModule+1);
423 printf(" p = (%f, %f, %f, %f) GeV,\n",
424 p.Px(),p.Py(),p.Pz(),p.Energy());
425 printf(" (X,Z) = (%8.4f, %8.4f) cm, ipart = %d\n",
431 // Read and print CPV reconstructed points
433 //=========== Gets the Reconstruction TTree
434 gAlice->TreeR()->GetEvent(0) ;
435 TIter nextRP(*fPHOS->PpsdRecPoints() ) ;
436 AliPHOSPpsdRecPoint *cpvRecPoint ;
437 Int_t nRecPoints = 0;
438 while( ( cpvRecPoint = (AliPHOSPpsdRecPoint *)nextRP() ) ) {
441 cpvRecPoint->GetLocalPosition(locpos);
442 Int_t phosModule = cpvRecPoint->GetPHOSMod();
443 printf("CPV recpoint in module %d: (X,Z) = (%f,%f) cm\n",
444 phosModule,locpos.X(),locpos.Z());
446 printf("This event has %d generated hits and %d reconstructed points\n",
447 nGenHits,nRecPoints);
451 //____________________________________________________________________________
452 void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents)
455 // Analyzes CPV characteristics
456 // Author: Yuri Kharlov
462 TH1F *hDx = new TH1F("hDx" ,"CPV x-resolution@reconstruction",100,-5. , 5.);
463 TH1F *hDz = new TH1F("hDz" ,"CPV z-resolution@reconstruction",100,-5. , 5.);
464 TH1F *hDr = new TH1F("hDr" ,"CPV r-resolution@reconstruction",100, 0. , 5.);
465 TH1S *hNrp = new TH1S("hNrp" ,"CPV rec.point multiplicity", 21,-0.5,20.5);
466 TH1S *hNrpX = new TH1S("hNrpX","CPV rec.point Phi-length" , 21,-0.5,20.5);
467 TH1S *hNrpZ = new TH1S("hNrpZ","CPV rec.point Z-length" , 21,-0.5,20.5);
469 cout << "Start CPV Analysis"<< endl ;
470 for ( Int_t ievent=0; ievent<Nevents; ievent++) {
472 //========== Event Number>
473 // if ( (ievent+1) % (Int_t)TMath::Power( 10, (Int_t)TMath::Log10(ievent+1) ) == 0)
474 cout << endl << "==== AnalyzeCPV ====> Event is " << ievent+1 << endl ;
476 //=========== Connects the various Tree's for evt
477 Int_t ntracks = gAlice->GetEvent(ievent);
479 //========== Creating branches ===================================
480 AliPHOSRecPoint::RecPointsList ** emcRecPoints = fPHOS->EmcRecPoints() ;
481 gAlice->TreeR()->SetBranchAddress( "PHOSEmcRP" , emcRecPoints ) ;
483 AliPHOSRecPoint::RecPointsList ** cpvRecPoints = fPHOS->PpsdRecPoints() ;
484 gAlice->TreeR()->SetBranchAddress( "PHOSPpsdRP", cpvRecPoints ) ;
486 // Create and fill arrays of hits for each CPV module
488 Int_t nOfModules = fGeom->GetNModules();
489 TClonesArray **hitsPerModule = new TClonesArray *[nOfModules];
490 for (Int_t iModule=0; iModule < nOfModules; iModule++)
491 hitsPerModule[iModule] = new TClonesArray("AliPHOSCPVHit",100);
493 AliPHOSCPVModule cpvModule;
494 TClonesArray *cpvHits;
496 AliPHOSCPVHit *cpvHit;
501 // First go through all primary tracks and fill the arrays
502 // of hits per each CPV module
504 for (Int_t itrack=0; itrack<ntracks; itrack++) {
505 // Get the Hits Tree for the Primary track itrack
507 gAlice->TreeH()->GetEvent(itrack);
508 for (Int_t iModule=0; iModule < nOfModules; iModule++) {
509 cpvModule = fPHOS->GetCPVModule(iModule);
510 cpvHits = cpvModule.Hits();
511 nCPVhits = cpvHits->GetEntriesFast();
512 for (Int_t ihit=0; ihit<nCPVhits; ihit++) {
513 cpvHit = (AliPHOSCPVHit*)cpvHits->UncheckedAt(ihit);
514 p = cpvHit->GetMomentum();
515 xzgen[0] = cpvHit->X();
516 xzgen[1] = cpvHit->Y();
517 ipart = cpvHit->GetIpart();
518 TClonesArray &lhits = *(TClonesArray *)hitsPerModule[iModule];
519 new(lhits[hitsPerModule[iModule]->GetEntriesFast()]) AliPHOSCPVHit(*cpvHit);
525 for (iModule=0; iModule < nOfModules; iModule++) {
526 Int_t nsum = hitsPerModule[iModule]->GetEntriesFast();
527 printf("Module %d has %d hits\n",iModule,nsum);
530 // Then go through reconstructed points and for each find
532 // The distance from the rec.point to the closest hit
533 // gives the coordinate resolution of the CPV
535 // Get the Reconstruction Tree
536 gAlice->TreeR()->GetEvent(0) ;
537 TIter nextRP(*fPHOS->PpsdRecPoints() ) ;
538 AliPHOSCpvRecPoint *cpvRecPoint ;
540 while( ( cpvRecPoint = (AliPHOSCpvRecPoint *)nextRP() ) ) {
542 cpvRecPoint->GetLocalPosition(locpos);
543 Int_t phosModule = cpvRecPoint->GetPHOSMod();
544 Int_t rpMult = cpvRecPoint->GetDigitsMultiplicity();
545 Int_t rpMultX, rpMultZ;
546 cpvRecPoint->GetClusterLengths(rpMultX,rpMultZ);
547 Float_t xrec = locpos.X();
548 Float_t zrec = locpos.Z();
549 Float_t dxmin = 1.e+10;
550 Float_t dzmin = 1.e+10;
551 Float_t r2min = 1.e+10;
554 cpvHits = hitsPerModule[phosModule-1];
555 Int_t nCPVhits = cpvHits->GetEntriesFast();
556 for (Int_t ihit=0; ihit<nCPVhits; ihit++) {
557 cpvHit = (AliPHOSCPVHit*)cpvHits->UncheckedAt(ihit);
560 r2 = TMath::Power((xgen-xrec),2) + TMath::Power((zgen-zrec),2);
569 hDr ->Fill(TMath::Sqrt(r2min));
571 hNrpX->Fill(rpMultX);
572 hNrpZ->Fill(rpMultZ);
574 delete [] hitsPerModule;
578 Text_t outputname[80] ;
579 sprintf(outputname,"%s.analyzed",fRootFile->GetName());
580 TFile output(outputname,"RECREATE");
592 TCanvas *cpvCanvas = new TCanvas("CPV","CPV analysis",20,20,800,400);
593 gStyle->SetOptStat(111111);
594 gStyle->SetOptFit(1);
595 gStyle->SetOptDate(1);
596 cpvCanvas->Divide(3,2);
599 gPad->SetFillColor(10);
600 hNrp->SetFillColor(16);
604 gPad->SetFillColor(10);
605 hNrpX->SetFillColor(16);
609 gPad->SetFillColor(10);
610 hNrpZ->SetFillColor(16);
614 gPad->SetFillColor(10);
615 hDx->SetFillColor(16);
620 gPad->SetFillColor(10);
621 hDz->SetFillColor(16);
626 gPad->SetFillColor(10);
627 hDr->SetFillColor(16);
630 cpvCanvas->Print("CPV.ps");
634 //____________________________________________________________________________
635 void AliPHOSAnalyze::InvariantMass(Int_t Nevents )
637 // Calculates Real and Mixed invariant mass distributions
638 const Int_t NMixedEvents = 4 ; //# of events used for calculation of 'mixed' distribution
639 Int_t MixedLoops = (Int_t )TMath::Ceil(Nevents/NMixedEvents) ;
641 //========== Booking Histograms
642 TH2D * hRealEM = new TH2D("hRealEM", "Real for EM particles", 250,0.,1.,40,0.,4.) ;
643 TH2D * hRealPhot = new TH2D("hRealPhot", "Real for kPhoton particles", 250,0.,1.,40,0.,4.) ;
644 TH2D * hMixedEM = new TH2D("hMixedEM", "Mixed for EM particles", 250,0.,1.,40,0.,4.) ;
645 TH2D * hMixedPhot= new TH2D("hMixedPhot","Mixed for kPhoton particles",250,0.,1.,40,0.,4.) ;
648 Int_t EventInMixedLoop ;
650 Int_t NRecParticles[NMixedEvents] ;
652 AliPHOSRecParticle::RecParticlesList * AllRecParticleList = new TClonesArray("AliPHOSRecParticle", NMixedEvents*1000) ;
654 for(EventInMixedLoop = 0; EventInMixedLoop < MixedLoops; EventInMixedLoop++ ){
657 for ( ievent=0; ievent < NMixedEvents; ievent++){
659 Int_t AbsEventNumber = EventInMixedLoop*NMixedEvents + ievent ;
661 //=========== Connects the various Tree's for evt
662 gAlice->GetEvent(AbsEventNumber);
664 //=========== Get the Digit Tree
665 gAlice->TreeD()->GetEvent(0) ;
667 //========== Creating branches ===================================
669 AliPHOSRecParticle::RecParticlesList ** RecParticleList = fPHOS->RecParticles() ;
670 if( (*RecParticleList) )
671 (*RecParticleList)->Clear() ;
672 gAlice->TreeR()->SetBranchAddress( "PHOSRP", RecParticleList ) ;
674 //=========== Gets the Reconstraction TTree
675 gAlice->TreeR()->GetEvent(0) ;
677 AliPHOSRecParticle * RecParticle ;
679 for(iRecParticle = 0; iRecParticle < (*RecParticleList)->GetEntries() ;iRecParticle++ )
681 RecParticle = (AliPHOSRecParticle *) (*RecParticleList)->At(iRecParticle) ;
682 if((RecParticle->GetType() == AliPHOSFastRecParticle::kGAMMA)||
683 (RecParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEM)){
684 new( (*AllRecParticleList)[iRecPhot] ) AliPHOSRecParticle(*RecParticle) ;
689 NRecParticles[ievent] = iRecPhot-1 ;
692 //Now calculate invariant mass:
694 Int_t NCurEvent = 0 ;
696 for(irp1 = 0; irp1 < AllRecParticleList->GetEntries()-1; irp1++){
697 AliPHOSRecParticle * rp1 = (AliPHOSRecParticle *)AllRecParticleList->At(irp1) ;
699 for(irp2 = irp1+1; irp2 < AllRecParticleList->GetEntries(); irp2++){
700 AliPHOSRecParticle * rp2 = (AliPHOSRecParticle *)AllRecParticleList->At(irp2) ;
703 InvMass = (rp1->Energy()+rp2->Energy())*(rp1->Energy()+rp2->Energy())-
704 (rp1->Px()+rp2->Px())*(rp1->Px()+rp2->Px())-
705 (rp1->Py()+rp2->Py())*(rp1->Py()+rp2->Py())-
706 (rp1->Pz()+rp2->Pz())*(rp1->Pz()+rp2->Pz()) ;
709 InvMass = TMath::Sqrt(InvMass);
712 Pt = TMath::Sqrt((rp1->Px()+rp2->Px() )*( rp1->Px()+rp2->Px() ) +(rp1->Py()+rp2->Py())*(rp1->Py()+rp2->Py()));
714 if(irp1 > NRecParticles[NCurEvent])
717 if(irp2 <= NRecParticles[NCurEvent]){ //'Real' event
718 hRealEM->Fill(InvMass,Pt);
719 if((rp1->GetType() == AliPHOSFastRecParticle::kGAMMA)&&(rp2->GetType() == AliPHOSFastRecParticle::kGAMMA))
720 hRealPhot->Fill(InvMass,Pt);
723 hMixedEM->Fill(InvMass,Pt);
724 if((rp1->GetType() == AliPHOSFastRecParticle::kGAMMA)&&(rp2->GetType() == AliPHOSFastRecParticle::kGAMMA))
725 hMixedPhot->Fill(InvMass,Pt);
728 } //loop over second rp
729 }//loop over first rp
730 AllRecParticleList->Delete() ;
733 delete AllRecParticleList ;
736 TFile output("invmass.root","RECREATE");
742 hMixedPhot->Write() ;
749 //____________________________________________________________________________
750 void AliPHOSAnalyze::AnalyzeResolutions(Int_t Nevents )
752 // analyzes Nevents events and calculate Energy and Position resolution as well as
753 // probaility of correct indentifiing of the incident particle
755 //========== Booking Histograms
756 cout << "AnalyzeResolutions > " << "Booking Histograms" << endl ;
757 BookResolutionHistograms();
759 Int_t Counter[9][5] ;
760 Int_t i1,i2,TotalInd = 0 ;
761 for(i1 = 0; i1<9; i1++)
762 for(i2 = 0; i2<5; i2++)
763 Counter[i1][i2] = 0 ;
765 Int_t TotalPrimary = 0 ;
766 Int_t TotalRecPart = 0 ;
767 Int_t TotalRPwithPrim = 0 ;
770 cout << "Start Analysing"<< endl ;
771 for ( ievent=0; ievent<Nevents; ievent++)
774 //========== Event Number>
775 // if ( ( log10((Float_t)(ievent+1)) - (Int_t)(log10((Float_t)(ievent+1))) ) == 0. )
776 cout << "AnalyzeResolutions > " << "Event is " << ievent << endl ;
778 //=========== Connects the various Tree's for evt
779 gAlice->GetEvent(ievent);
781 //=========== Gets the Kine TTree
782 gAlice->TreeK()->GetEvent(0) ;
784 //=========== Gets the list of Primari Particles
785 TClonesArray * PrimaryList = gAlice->Particles();
787 TParticle * Primary ;
789 for ( iPrimary = 0 ; iPrimary < PrimaryList->GetEntries() ; iPrimary++)
791 Primary = (TParticle*)PrimaryList->UncheckedAt(iPrimary) ;
792 Int_t PrimaryType = Primary->GetPdgCode() ;
793 if( PrimaryType == 22 ) {
795 Double_t PrimX, PrimZ ;
796 fGeom->ImpactOnEmc(Primary->Theta(), Primary->Phi(), ModuleNumber, PrimX, PrimZ) ;
798 fhPrimary->Fill(Primary->Energy()) ;
799 if(Primary->Energy() > 0.3)
805 //=========== Get the Digit Tree
806 gAlice->TreeD()->GetEvent(0) ;
808 //========== Creating branches ===================================
809 AliPHOSRecPoint::RecPointsList ** EmcRecPoints = fPHOS->EmcRecPoints() ;
810 gAlice->TreeR()->SetBranchAddress( "PHOSEmcRP", EmcRecPoints ) ;
812 AliPHOSRecPoint::RecPointsList ** PpsdRecPoints = fPHOS->PpsdRecPoints() ;
813 gAlice->TreeR()->SetBranchAddress( "PHOSPpsdRP", PpsdRecPoints ) ;
815 AliPHOSTrackSegment::TrackSegmentsList ** TrackSegmentsList = fPHOS->TrackSegments() ;
816 if( (*TrackSegmentsList) )
817 (*TrackSegmentsList)->Clear() ;
818 gAlice->TreeR()->SetBranchAddress( "PHOSTS", TrackSegmentsList ) ;
820 AliPHOSRecParticle::RecParticlesList ** RecParticleList = fPHOS->RecParticles() ;
821 if( (*RecParticleList) )
822 (*RecParticleList)->Clear() ;
823 gAlice->TreeR()->SetBranchAddress( "PHOSRP", RecParticleList ) ;
825 //=========== Gets the Reconstraction TTree
826 gAlice->TreeR()->GetEvent(0) ;
828 AliPHOSRecParticle * RecParticle ;
830 for(iRecParticle = 0; iRecParticle < (*RecParticleList)->GetEntries() ;iRecParticle++ )
832 RecParticle = (AliPHOSRecParticle *) (*RecParticleList)->At(iRecParticle) ;
833 fhAllRP->Fill(CorrectEnergy(RecParticle->Energy())) ;
835 Int_t ModuleNumberRec ;
836 Double_t RecX, RecZ ;
837 fGeom->ImpactOnEmc(RecParticle->Theta(), RecParticle->Phi(), ModuleNumberRec, RecX, RecZ) ;
839 Double_t MinDistance = 2. ;
840 Int_t ClosestPrimary = -1 ;
842 Int_t numberofprimaries ;
843 Int_t * listofprimaries = RecParticle->GetPrimaries(numberofprimaries) ;
845 TParticle * Primary ;
846 Double_t Distance = MinDistance ;
847 for ( index = 0 ; index < numberofprimaries ; index++){
848 Primary = (TParticle*)PrimaryList->UncheckedAt(listofprimaries[index]) ;
850 Double_t PrimX, PrimZ ;
851 fGeom->ImpactOnEmc(Primary->Theta(), Primary->Phi(), ModuleNumber, PrimX, PrimZ) ;
852 if(ModuleNumberRec == ModuleNumber)
853 Distance = TMath::Sqrt((RecX-PrimX)*(RecX-PrimX)+(RecZ-PrimZ)*(RecZ-PrimZ) ) ;
854 if(MinDistance > Distance)
856 MinDistance = Distance ;
857 ClosestPrimary = listofprimaries[index] ;
862 if(ClosestPrimary >=0 ){
865 Int_t PrimaryType = ((TParticle *)PrimaryList->At(ClosestPrimary))->GetPdgCode() ;
866 // TParticlePDG* PDGparticle = ((TParticle *)PrimaryList->At(ClosestPrimary))->GetPDG();
867 // Double_t charge = PDGparticle->Charge() ;
869 // cout <<"Primary " <<PrimaryType << " E " << ((TParticle *)PrimaryList->At(ClosestPrimary))->Energy() << endl ;
874 PrimaryCode = 0; //Photon
875 fhAllEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy()) ;
876 fhAllPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
879 PrimaryCode = 1; //Electron
882 PrimaryCode = 1; //positron
885 PrimaryCode = 4; //K+
888 PrimaryCode = 4; //K-
891 PrimaryCode = 4; //K0s
894 PrimaryCode = 4; //K0l
897 PrimaryCode = 2; //K0l
900 PrimaryCode = 2; //K0l
903 PrimaryCode = 2; //K0l
906 PrimaryCode = 2; //K0l
909 PrimaryCode = 3; //ELSE
913 switch(RecParticle->GetType())
915 case AliPHOSFastRecParticle::kGAMMA:
916 if(PrimaryType == 22){
917 fhPhotEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
918 fhEMEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
919 fhPPSDEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
921 fhPhotPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
922 fhEMPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
923 fhPPSDPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
925 fhPhotReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
926 fhPhotEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
927 fhPhotPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
929 fhPhotPhot->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
931 if(PrimaryType == 2112){ //neutron
932 fhNReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
933 fhNEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
934 fhNPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
937 if(PrimaryType == -2112){ //neutron ~
938 fhNBarReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
939 fhNBarEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
940 fhNBarPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
943 if(PrimaryCode == 2){
944 fhChargedReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
945 fhChargedEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
946 fhChargedPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
949 fhAllReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
950 fhAllEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
951 fhAllPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
952 fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
953 fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
954 fhPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
955 Counter[0][PrimaryCode]++;
957 case AliPHOSFastRecParticle::kELECTRON:
958 if(PrimaryType == 22){
959 fhPhotElec->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
960 fhEMEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
961 fhEMPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
962 fhPhotEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
963 fhPhotPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
965 if(PrimaryType == 2112){ //neutron
966 fhNEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
967 fhNPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
970 if(PrimaryType == -2112){ //neutron ~
971 fhNBarEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
972 fhNBarPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
975 if(PrimaryCode == 2){
976 fhChargedEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
977 fhChargedPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
980 fhAllEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
981 fhAllPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
982 fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
983 fhPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
984 Counter[1][PrimaryCode]++;
986 case AliPHOSFastRecParticle::kNEUTRALHA:
987 if(PrimaryType == 22)
988 fhPhotNeuH->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
990 fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
991 Counter[2][PrimaryCode]++;
993 case AliPHOSFastRecParticle::kNEUTRALEM:
994 if(PrimaryType == 22){
995 fhEMEnergy->Fill(((TParticle *)PrimaryList->At(ClosestPrimary))->Energy(),RecParticle->Energy() ) ;
996 fhEMPosition->Fill(((TParticle *)PrimaryList->At(ClosestPrimary))->Energy(),MinDistance ) ;
998 fhPhotNuEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
999 fhPhotEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1001 if(PrimaryType == 2112) //neutron
1002 fhNEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1004 if(PrimaryType == -2112) //neutron ~
1005 fhNBarEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1007 if(PrimaryCode == 2)
1008 fhChargedEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1010 fhAllEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1011 fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1012 fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1014 Counter[3][PrimaryCode]++;
1016 case AliPHOSFastRecParticle::kCHARGEDHA:
1017 if(PrimaryType == 22) //photon
1018 fhPhotChHa->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1020 Counter[4][PrimaryCode]++ ;
1022 case AliPHOSFastRecParticle::kGAMMAHA:
1023 if(PrimaryType == 22){ //photon
1024 fhPhotGaHa->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1025 fhPPSDEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
1026 fhPPSDPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
1027 fhPhotPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1029 if(PrimaryType == 2112){ //neutron
1030 fhNPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1033 if(PrimaryType == -2112){ //neutron ~
1034 fhNBarPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1036 if(PrimaryCode == 2){
1037 fhChargedPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1040 fhAllPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1041 fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1042 fhPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1043 Counter[5][PrimaryCode]++ ;
1045 case AliPHOSFastRecParticle::kABSURDEM:
1046 Counter[6][PrimaryCode]++ ;
1047 fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
1049 case AliPHOSFastRecParticle::kABSURDHA:
1050 Counter[7][PrimaryCode]++ ;
1053 Counter[8][PrimaryCode]++ ;
1060 cout << "Resolutions: Analyzed " << Nevents << " event(s)" << endl ;
1061 cout << "Resolutions: Total primary " << TotalPrimary << endl ;
1062 cout << "Resoluitons: Total reconstracted " << TotalRecPart << endl ;
1063 cout << "TotalReconstructed with Primarie " << TotalRPwithPrim << endl ;
1064 cout << " Primary: Photon Electron Ch. Hadr. Neutr. Hadr Kaons" << endl ;
1065 cout << " Detected as photon " << Counter[0][0] << " " << Counter[0][1] << " " << Counter[0][2] << " " <<Counter[0][3] << " " << Counter[0][4] << endl ;
1066 cout << " Detected as electron " << Counter[1][0] << " " << Counter[1][1] << " " << Counter[1][2] << " " <<Counter[1][3] << " " << Counter[1][4] << endl ;
1067 cout << " Detected as neutral hadron " << Counter[2][0] << " " << Counter[2][1] << " " << Counter[2][2] << " " <<Counter[2][3] << " " << Counter[2][4] << endl ;
1068 cout << " Detected as neutral EM " << Counter[3][0] << " " << Counter[3][1] << " " << Counter[3][2] << " " <<Counter[3][3] << " " << Counter[3][4] << endl ;
1069 cout << " Detected as charged hadron " << Counter[4][0] << " " << Counter[4][1] << " " << Counter[4][2] << " " <<Counter[4][3] << " " << Counter[4][4] << endl ;
1070 cout << " Detected as gamma-hadron " << Counter[5][0] << " " << Counter[5][1] << " " << Counter[5][2] << " " <<Counter[5][3] << " " << Counter[5][4] << endl ;
1071 cout << " Detected as Absurd EM " << Counter[6][0] << " " << Counter[6][1] << " " << Counter[6][2] << " " <<Counter[6][3] << " " << Counter[6][4] << endl ;
1072 cout << " Detected as absurd hadron " << Counter[7][0] << " " << Counter[7][1] << " " << Counter[7][2] << " " <<Counter[7][3] << " " << Counter[7][4] << endl ;
1073 cout << " Detected as undefined " << Counter[8][0] << " " << Counter[8][1] << " " << Counter[8][2] << " " <<Counter[8][3] << " " << Counter[8][4] << endl ;
1075 for(i1 = 0; i1<9; i1++)
1076 for(i2 = 0; i2<5; i2++)
1077 TotalInd+=Counter[i1][i2] ;
1078 cout << "Indentified particles " << TotalInd << endl ;
1083 //____________________________________________________________________________
1084 void AliPHOSAnalyze::BookingHistograms()
1086 // Books the histograms where the results of the analysis are stored (to be changed)
1089 delete fhVetoDigit ;
1090 delete fhConvertorDigit ;
1091 delete fhEmcCluster ;
1092 delete fhVetoCluster ;
1093 delete fhConvertorCluster ;
1094 delete fhConvertorEmc ;
1096 fhEmcDigit = new TH1F("hEmcDigit", "hEmcDigit", 1000, 0. , 25.);
1097 fhVetoDigit = new TH1F("hVetoDigit", "hVetoDigit", 500, 0. , 3.e-5);
1098 fhConvertorDigit = new TH1F("hConvertorDigit","hConvertorDigit", 500, 0. , 3.e-5);
1099 fhEmcCluster = new TH1F("hEmcCluster", "hEmcCluster", 1000, 0. , 30.);
1100 fhVetoCluster = new TH1F("hVetoCluster", "hVetoCluster", 500, 0. , 3.e-5);
1101 fhConvertorCluster = new TH1F("hConvertorCluster","hConvertorCluster",500, 0. , 3.e-5);
1102 fhConvertorEmc = new TH2F("hConvertorEmc", "hConvertorEmc", 200, 1. , 3., 200, 0., 3.e-5);
1105 //____________________________________________________________________________
1106 void AliPHOSAnalyze::BookResolutionHistograms()
1108 // Books the histograms where the results of the Resolution analysis are stored
1111 // delete fhAllEnergy ;
1113 // delete fhPhotEnergy ;
1115 // delete fhEMEnergy ;
1117 // delete fhPPSDEnergy ;
1120 fhAllEnergy = new TH2F("hAllEnergy", "Energy of any RP with primary photon",100, 0., 5., 100, 0., 5.);
1121 fhPhotEnergy = new TH2F("hPhotEnergy", "Energy of kGAMMA with primary photon",100, 0., 5., 100, 0., 5.);
1122 fhEMEnergy = new TH2F("hEMEnergy", "Energy of EM with primary photon", 100, 0., 5., 100, 0., 5.);
1123 fhPPSDEnergy = new TH2F("hPPSDEnergy", "Energy of PPSD with primary photon", 100, 0., 5., 100, 0., 5.);
1125 // if(fhAllPosition)
1126 // delete fhAllPosition ;
1127 // if(fhPhotPosition)
1128 // delete fhPhotPosition ;
1130 // delete fhEMPosition ;
1131 // if(fhPPSDPosition)
1132 // delete fhPPSDPosition ;
1135 fhAllPosition = new TH2F("hAllPosition", "Position of any RP with primary photon",100, 0., 5., 100, 0., 5.);
1136 fhPhotPosition = new TH2F("hPhotPosition", "Position of kGAMMA with primary photon",100, 0., 5., 100, 0., 5.);
1137 fhEMPosition = new TH2F("hEMPosition", "Position of EM with primary photon", 100, 0., 5., 100, 0., 5.);
1138 fhPPSDPosition = new TH2F("hPPSDPosition", "Position of PPSD with primary photon", 100, 0., 5., 100, 0., 5.);
1141 // delete fhAllReg ;
1143 // delete fhPhotReg ;
1147 // delete fhNBarReg ;
1149 // delete fhChargedReg ;
1151 fhAllReg = new TH1F("hAllReg", "All primaries registered as photon", 100, 0., 5.);
1152 fhPhotReg = new TH1F("hPhotReg", "Photon registered as photon", 100, 0., 5.);
1153 fhNReg = new TH1F("hNReg", "N registered as photon", 100, 0., 5.);
1154 fhNBarReg = new TH1F("hNBarReg", "NBar registered as photon", 100, 0., 5.);
1155 fhChargedReg= new TH1F("hChargedReg", "Charged hadron registered as photon",100, 0., 5.);
1160 // delete fhPhotEM ;
1164 // delete fhNBarEM ;
1166 // delete fhChargedEM ;
1168 fhAllEM = new TH1F("hAllEM", "All primary registered as EM",100, 0., 5.);
1169 fhPhotEM = new TH1F("hPhotEM", "Photon registered as EM", 100, 0., 5.);
1170 fhNEM = new TH1F("hNEM", "N registered as EM", 100, 0., 5.);
1171 fhNBarEM = new TH1F("hNBarEM", "NBar registered as EM", 100, 0., 5.);
1172 fhChargedEM= new TH1F("hChargedEM","Charged registered as EM",100, 0., 5.);
1175 // delete fhAllPPSD ;
1177 // delete fhPhotPPSD ;
1181 // delete fhNBarPPSD ;
1182 // if(fhChargedPPSD)
1183 // delete fhChargedPPSD ;
1185 fhAllPPSD = new TH1F("hAllPPSD", "All primary registered as PPSD",100, 0., 5.);
1186 fhPhotPPSD = new TH1F("hPhotPPSD", "Photon registered as PPSD", 100, 0., 5.);
1187 fhNPPSD = new TH1F("hNPPSD", "N registered as PPSD", 100, 0., 5.);
1188 fhNBarPPSD = new TH1F("hNBarPPSD", "NBar registered as PPSD", 100, 0., 5.);
1189 fhChargedPPSD= new TH1F("hChargedPPSD","Charged registered as PPSD",100, 0., 5.);
1192 // delete fhPrimary ;
1193 fhPrimary= new TH1F("hPrimary", "hPrimary", 100, 0., 5.);
1204 fhAllRP = new TH1F("hAllRP","All Reconstructed particles", 100, 0., 5.);
1205 fhVeto = new TH1F("hVeto", "All uncharged particles", 100, 0., 5.);
1206 fhShape = new TH1F("hShape","All particles with EM shaower",100, 0., 5.);
1207 fhPPSD = new TH1F("hPPSD", "All PPSD photon particles", 100, 0., 5.);
1211 // delete fhPhotPhot ;
1213 // delete fhPhotElec ;
1215 // delete fhPhotNeuH ;
1217 // delete fhPhotNuEM ;
1219 // delete fhPhotChHa ;
1221 // delete fhPhotGaHa ;
1223 fhPhotPhot = new TH1F("hPhotPhot","hPhotPhot", 100, 0., 5.); //Photon registered as photon
1224 fhPhotElec = new TH1F("hPhotElec","hPhotElec", 100, 0., 5.); //Photon registered as Electron
1225 fhPhotNeuH = new TH1F("hPhotNeuH","hPhotNeuH", 100, 0., 5.); //Photon registered as Neutral Hadron
1226 fhPhotNuEM = new TH1F("hPhotNuEM","hPhotNuEM", 100, 0., 5.); //Photon registered as Neutral EM
1227 fhPhotChHa = new TH1F("hPhotChHa","hPhotChHa", 100, 0., 5.); //Photon registered as Charged Hadron
1228 fhPhotGaHa = new TH1F("hPhotGaHa","hPhotGaHa", 100, 0., 5.); //Photon registered as Gamma-Hadron
1232 //____________________________________________________________________________
1233 Bool_t AliPHOSAnalyze::Init(Int_t evt)
1235 // Do a few initializations: open the root file
1236 // get the AliRun object
1237 // defines the clusterizer, tracksegment maker and particle identifier
1238 // sets the associated parameters
1242 //========== Open galice root file
1244 if ( fRootFile == 0 ) {
1245 Text_t * name = new Text_t[80] ;
1246 cout << "AnalyzeOneEvent > Enter file root file name : " ;
1248 Bool_t ok = OpenRootFile(name) ;
1250 cout << " AliPHOSAnalyze > Error opening " << name << endl ;
1252 //========== Get AliRun object from file
1254 gAlice = (AliRun*) fRootFile->Get("gAlice") ;
1256 //=========== Get the PHOS object and associated geometry from the file
1258 fPHOS = (AliPHOSv1 *)gAlice->GetDetector("PHOS") ;
1259 fGeom = fPHOS->GetGeometry();
1260 // fGeom = AliPHOSGeometry::GetInstance( fPHOS->GetGeometry()->GetName(), fPHOS->GetGeometry()->GetTitle() );
1267 //========== Create the Clusterizer
1269 fClu = new AliPHOSClusterizerv1() ;
1270 fClu->SetEmcEnergyThreshold(0.030) ;
1271 fClu->SetEmcClusteringThreshold(0.20) ;
1272 fClu->SetPpsdEnergyThreshold (0.0000002) ;
1273 fClu->SetPpsdClusteringThreshold(0.0000001) ;
1274 fClu->SetLocalMaxCut(0.03) ;
1275 fClu->SetCalibrationParameters(0., 0.00000001) ;
1276 cout << "AnalyzeOneEvent > using clusterizer " << fClu->GetName() << endl ;
1277 fClu->PrintParameters() ;
1279 //========== Creates the track segment maker
1281 fTrs = new AliPHOSTrackSegmentMakerv1() ;
1282 cout << "AnalyzeOneEvent > using tack segment maker " << fTrs->GetName() << endl ;
1283 // fTrs->UnsetUnfoldFlag() ;
1285 //========== Creates the particle identifier
1287 fPID = new AliPHOSPIDv1() ;
1288 cout << "AnalyzeOneEvent > using particle identifier " << fPID->GetName() << endl ;
1289 //fPID->SetShowerProfileCuts(Float_t l1m, Float_t l1M, Float_t l2m, Float_t l2M) ;
1290 fPID->SetShowerProfileCuts(0.7, 2.0 , 0.6 , 1.5) ;
1292 //========== Creates the Reconstructioner
1294 fRec = new AliPHOSReconstructioner(fClu, fTrs, fPID) ;
1295 // fRec -> SetDebugReconstruction(kFALSE);
1296 fRec -> SetDebugReconstruction(kTRUE);
1298 //=========== Connect the various Tree's for evt
1300 if ( evt == -999 ) {
1301 cout << "AnalyzeOneEvent > Enter event number : " ;
1303 cout << evt << endl ;
1306 gAlice->GetEvent(evt);
1308 //=========== Get the Digit TTree
1310 gAlice->TreeD()->GetEvent(0) ;
1318 //____________________________________________________________________________
1319 void AliPHOSAnalyze::DisplayKineEvent(Int_t evt)
1321 // Display particles from the Kine Tree in global Alice (theta, phi) coordinates.
1322 // One PHOS module at the time.
1323 // The particle type can be selected.
1329 cout << "DisplayKineEvent > which module (1-5, -1: all) ? " ;
1330 cin >> module ; cout << module << endl ;
1332 Int_t testparticle ;
1333 cout << " 22 : PHOTON " << endl
1334 << " (-)11 : (POSITRON)ELECTRON " << endl
1335 << " (-)2112 : (ANTI)NEUTRON " << endl
1336 << " -999 : Everything else " << endl ;
1337 cout << "DisplayKineEvent > enter PDG particle code to display " ;
1338 cin >> testparticle ; cout << testparticle << endl ;
1340 Text_t histoname[80] ;
1341 sprintf(histoname,"Event %d: Incident particles in module %d", evt, module) ;
1343 Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by module
1344 fGeom->EmcModuleCoverage(module, tm, tM, pm, pM, AliPHOSGeometry::Degre() ) ;
1346 Double_t theta, phi ;
1347 fGeom->EmcXtalCoverage(theta, phi, AliPHOSGeometry::Degre() ) ;
1349 Int_t tdim = (Int_t)( (tM - tm) / theta ) ;
1350 Int_t pdim = (Int_t)( (pM - pm) / phi ) ;
1357 TH2F * histoparticle = new TH2F("histoparticle", histoname,
1358 pdim, pm, pM, tdim, tm, tM) ;
1359 histoparticle->SetStats(kFALSE) ;
1361 // Get pointers to Alice Particle TClonesArray
1363 TParticle * particle;
1364 TClonesArray * particlearray = gAlice->Particles();
1366 Text_t canvasname[80];
1367 sprintf(canvasname,"Particles incident in PHOS/EMC module # %d",module) ;
1368 TCanvas * kinecanvas = new TCanvas("kinecanvas", canvasname, 650, 500) ;
1370 // get the KINE Tree
1372 TTree * kine = gAlice->TreeK() ;
1373 Stat_t nParticles = kine->GetEntries() ;
1374 cout << "DisplayKineEvent > events in kine " << nParticles << endl ;
1376 // loop over particles
1378 Double_t kRADDEG = 180. / TMath::Pi() ;
1380 Int_t nparticlein = 0 ;
1381 for (index1 = 0 ; index1 < nParticles ; index1++){
1382 Int_t nparticle = particlearray->GetEntriesFast() ;
1384 for( index2 = 0 ; index2 < nparticle ; index2++) {
1385 particle = (TParticle*)particlearray->UncheckedAt(index2) ;
1386 Int_t particletype = particle->GetPdgCode() ;
1387 if (testparticle == -999 || testparticle == particletype) {
1388 Double_t phi = particle->Phi() ;
1389 Double_t theta = particle->Theta() ;
1392 fGeom->ImpactOnEmc(theta, phi, mod, z, x) ;
1393 if ( mod == module ) {
1395 if (particle->Energy() > fClu->GetEmcClusteringThreshold() )
1396 histoparticle->Fill(phi*kRADDEG, theta*kRADDEG, particle->Energy() ) ;
1401 kinecanvas->Draw() ;
1402 histoparticle->Draw("color") ;
1403 TPaveText * pavetext = new TPaveText(294, 100, 300, 101);
1405 sprintf(text, "Particles: %d ", nparticlein) ;
1406 pavetext->AddText(text) ;
1408 kinecanvas->Update();
1411 //____________________________________________________________________________
1412 void AliPHOSAnalyze::DisplayRecParticles()
1414 // Display reconstructed particles in global Alice(theta, phi) coordinates.
1415 // One PHOS module at the time.
1416 // Click on symbols indicate the reconstructed particle type.
1419 cout << "DisplayRecParticles > Analyze an event first ... (y/n) " ;
1421 cin >> answer ; cout << answer ;
1422 // if ( answer == "y" )
1423 // AnalyzeOneEvent() ;
1428 cout << "DisplayRecParticles > which module (1-5, -1: all) ? " ;
1429 cin >> module ; cout << module << endl ;
1430 Text_t histoname[80] ;
1431 sprintf(histoname,"Event %d: Reconstructed particles in module %d", fEvt, module) ;
1432 Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by module
1433 fGeom->EmcModuleCoverage(module, tm, tM, pm, pM, AliPHOSGeometry::Degre() ) ;
1434 Double_t theta, phi ;
1435 fGeom->EmcXtalCoverage(theta, phi, AliPHOSGeometry::Degre() ) ;
1436 Int_t tdim = (Int_t)( (tM - tm) / theta ) ;
1437 Int_t pdim = (Int_t)( (pM - pm) / phi ) ;
1441 TH2F * histoRparticle = new TH2F("histoRparticle", histoname,
1442 pdim, pm, pM, tdim, tm, tM) ;
1443 histoRparticle->SetStats(kFALSE) ;
1444 Text_t canvasname[80] ;
1445 sprintf(canvasname, "Reconstructed particles in PHOSmodule # %d", module) ;
1446 TCanvas * rparticlecanvas = new TCanvas("RparticleCanvas", canvasname, 650, 500) ;
1447 AliPHOSRecParticle::RecParticlesList * rpl = *fPHOS->RecParticles() ;
1448 Int_t nRecParticles = rpl->GetEntries() ;
1449 Int_t nRecParticlesInModule = 0 ;
1450 TIter nextRecPart(rpl) ;
1451 AliPHOSRecParticle * rp ;
1452 cout << "DisplayRecParticles > " << nRecParticles << " reconstructed particles " << endl ;
1453 Double_t kRADDEG = 180. / TMath::Pi() ;
1454 while ( (rp = (AliPHOSRecParticle *)nextRecPart() ) ) {
1455 AliPHOSTrackSegment * ts = rp->GetPHOSTrackSegment() ;
1456 if ( ts->GetPHOSMod() == module ) {
1457 Int_t numberofprimaries = 0 ;
1458 Int_t * listofprimaries = 0;
1459 rp->GetPrimaries(numberofprimaries) ;
1460 cout << "Number of primaries = " << numberofprimaries << endl ;
1462 for ( index = 0 ; index < numberofprimaries ; index++)
1463 cout << " primary # " << index << " = " << listofprimaries[index] << endl ;
1465 nRecParticlesInModule++ ;
1466 Double_t theta = rp->Theta() * kRADDEG ;
1467 Double_t phi = rp->Phi() * kRADDEG ;
1468 Double_t energy = rp->Energy() ;
1469 histoRparticle->Fill(phi, theta, energy) ;
1472 histoRparticle->Draw("color") ;
1474 nextRecPart.Reset() ;
1475 while ( (rp = (AliPHOSRecParticle *)nextRecPart() ) ) {
1476 AliPHOSTrackSegment * ts = rp->GetPHOSTrackSegment() ;
1477 if ( ts->GetPHOSMod() == module )
1482 sprintf(text, "reconstructed particles: %d", nRecParticlesInModule) ;
1483 TPaveText * pavetext = new TPaveText(292, 100, 300, 101);
1484 pavetext->AddText(text) ;
1486 rparticlecanvas->Update() ;
1490 //____________________________________________________________________________
1491 void AliPHOSAnalyze::DisplayRecPoints()
1493 // Display reconstructed points in local PHOS-module (x, z) coordinates.
1494 // One PHOS module at the time.
1495 // Click on symbols displays the EMC cluster, or PPSD information.
1498 cout << "DisplayRecPoints > Analyze an event first ... (y/n) " ;
1500 cin >> answer ; cout << answer ;
1501 // if ( answer == "y" )
1502 // AnalyzeOneEvent() ;
1507 cout << "DisplayRecPoints > which module (1-5, -1: all) ? " ;
1508 cin >> module ; cout << module << endl ;
1510 Text_t canvasname[80];
1511 sprintf(canvasname,"Digits in PHOS/EMC module # %d",module) ;
1512 TCanvas * modulecanvas = new TCanvas("module", canvasname, 650, 500) ;
1513 modulecanvas->Draw() ;
1515 //=========== Creating 2d-histogram of the PHOS module
1516 // a little bit junkie but is used to test Geom functinalities
1518 Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by module
1520 fGeom->EmcModuleCoverage(module, tm, tM, pm, pM);
1521 // convert angles into coordinates local to the EMC module of interest
1523 Int_t emcModuleNumber ;
1524 Double_t emcModulexm, emcModulezm ; // minimum local coordinate in a given EMCA module
1525 Double_t emcModulexM, emcModulezM ; // maximum local coordinate in a given EMCA module
1526 fGeom->ImpactOnEmc(tm, pm, emcModuleNumber, emcModulezm, emcModulexm) ;
1527 fGeom->ImpactOnEmc(tM, pM, emcModuleNumber, emcModulezM, emcModulexM) ;
1528 Int_t xdim = (Int_t)( ( emcModulexM - emcModulexm ) / fGeom->GetCrystalSize(0) ) ;
1529 Int_t zdim = (Int_t)( ( emcModulezM - emcModulezm ) / fGeom->GetCrystalSize(2) ) ;
1530 Float_t xmin = emcModulexm - fGeom->GetCrystalSize(0) ;
1531 Float_t xMax = emcModulexM + fGeom->GetCrystalSize(0) ;
1532 Float_t zmin = emcModulezm - fGeom->GetCrystalSize(2) ;
1533 Float_t zMax = emcModulezM + fGeom->GetCrystalSize(2) ;
1534 Text_t histoname[80];
1535 sprintf(histoname,"Event %d: Digits and RecPoints in module %d", fEvt, module) ;
1536 TH2F * hModule = new TH2F("HistoReconstructed", histoname,
1537 xdim, xmin, xMax, zdim, zmin, zMax) ;
1538 hModule->SetMaximum(2.0);
1539 hModule->SetMinimum(0.0);
1540 hModule->SetStats(kFALSE);
1542 TIter next(fPHOS->Digits()) ;
1543 Float_t energy, y, z;
1545 Int_t relid[4]; Int_t nDigits = 0 ;
1546 AliPHOSDigit * digit ;
1548 // Making 2D histogram of the EMC module
1549 while((digit = (AliPHOSDigit *)next()))
1551 fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
1552 if (relid[0] == module && relid[1] == 0)
1554 energy = fClu->Calibrate(digit->GetAmp()) ;
1555 cout << "Energy is " << energy << " and threshold is " << fClu->GetEmcEnergyThreshold() << endl;
1556 if (energy > fClu->GetEmcEnergyThreshold() ){
1559 fGeom->RelPosInModule(relid,y,z) ;
1560 hModule->Fill(y, z, energy) ;
1564 cout <<"DrawRecPoints > Found in module "
1565 << module << " " << nDigits << " digits with total energy " << etot << endl ;
1566 hModule->Draw("col2") ;
1568 //=========== Cluster in module
1570 // TClonesArray * emcRP = fPHOS->EmcClusters() ;
1571 TObjArray * emcRP = *(fPHOS->EmcRecPoints()) ;
1574 Int_t totalnClusters = 0 ;
1575 Int_t nClusters = 0 ;
1576 TIter nextemc(emcRP) ;
1577 AliPHOSEmcRecPoint * emc ;
1578 while((emc = (AliPHOSEmcRecPoint *)nextemc()))
1580 // Int_t numberofprimaries ;
1581 // Int_t * primariesarray = new Int_t[10] ;
1582 // emc->GetPrimaries(numberofprimaries, primariesarray) ;
1584 if ( emc->GetPHOSMod() == module )
1587 energy = emc->GetTotalEnergy() ;
1592 cout << "DrawRecPoints > Found " << totalnClusters << " EMC Clusters in PHOS" << endl ;
1593 cout << "DrawRecPoints > Found in module " << module << " " << nClusters << " EMC Clusters " << endl ;
1594 cout << "DrawRecPoints > total energy " << etot << endl ;
1596 TPaveText * pavetext = new TPaveText(22, 80, 83, 90);
1598 sprintf(text, "digits: %d; clusters: %d", nDigits, nClusters) ;
1599 pavetext->AddText(text) ;
1601 modulecanvas->Update();
1603 //=========== Cluster in module PPSD Down
1605 // TClonesArray * ppsdRP = fPHOS->PpsdClusters() ;
1606 TObjArray * ppsdRP = *(fPHOS->PpsdRecPoints() );
1609 TIter nextPpsd(ppsdRP) ;
1610 AliPHOSPpsdRecPoint * ppsd ;
1611 while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
1614 if ( ppsd->GetPHOSMod() == module )
1617 energy = ppsd->GetEnergy() ;
1619 if (!ppsd->GetUp()) ppsd->Draw("P") ;
1622 cout << "DrawRecPoints > Found " << totalnClusters << " Ppsd Down Clusters in PHOS" << endl ;
1623 cout << "DrawRecPoints > Found in module " << module << " " << nClusters << " Ppsd Down Clusters " << endl ;
1624 cout << "DrawRecPoints > total energy " << etot << endl ;
1626 //=========== Cluster in module PPSD Up
1628 ppsdRP = *(fPHOS->PpsdRecPoints()) ;
1631 TIter nextPpsdUp(ppsdRP) ;
1632 while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsdUp()))
1635 if ( ppsd->GetPHOSMod() == module )
1638 energy = ppsd->GetEnergy() ;
1640 if (ppsd->GetUp()) ppsd->Draw("P") ;
1643 cout << "DrawRecPoints > Found " << totalnClusters << " Ppsd Up Clusters in PHOS" << endl ;
1644 cout << "DrawRecPoints > Found in module " << module << " " << nClusters << " Ppsd Up Clusters " << endl ;
1645 cout << "DrawRecPoints > total energy " << etot << endl ;
1650 //____________________________________________________________________________
1651 void AliPHOSAnalyze::DisplayTrackSegments()
1653 // Display track segments in local PHOS-module (x, z) coordinates.
1654 // One PHOS module at the time.
1655 // One symbol per PHOS subsystem: EMC, upper PPSD, lower PPSD.
1658 cout << "DisplayTrackSegments > Analyze an event first ... (y/n) " ;
1660 cin >> answer ; cout << answer ;
1661 // if ( answer == "y" )
1662 // AnalyzeOneEvent() ;
1667 cout << "DisplayTrackSegments > which module (1-5, -1: all) ? " ;
1668 cin >> module ; cout << module << endl ;
1669 //=========== Creating 2d-histogram of the PHOS module
1670 // a little bit junkie but is used to test Geom functinalities
1672 Double_t tm, tM, pm, pM ; // min and Max theta and phi covered by module
1674 fGeom->EmcModuleCoverage(module, tm, tM, pm, pM);
1675 // convert angles into coordinates local to the EMC module of interest
1677 Int_t emcModuleNumber ;
1678 Double_t emcModulexm, emcModulezm ; // minimum local coordinate in a given EMCA module
1679 Double_t emcModulexM, emcModulezM ; // maximum local coordinate in a given EMCA module
1680 fGeom->ImpactOnEmc(tm, pm, emcModuleNumber, emcModulezm, emcModulexm) ;
1681 fGeom->ImpactOnEmc(tM, pM, emcModuleNumber, emcModulezM, emcModulexM) ;
1682 Int_t xdim = (Int_t)( ( emcModulexM - emcModulexm ) / fGeom->GetCrystalSize(0) ) ;
1683 Int_t zdim = (Int_t)( ( emcModulezM - emcModulezm ) / fGeom->GetCrystalSize(2) ) ;
1684 Float_t xmin = emcModulexm - fGeom->GetCrystalSize(0) ;
1685 Float_t xMax = emcModulexM + fGeom->GetCrystalSize(0) ;
1686 Float_t zmin = emcModulezm - fGeom->GetCrystalSize(2) ;
1687 Float_t zMax = emcModulezM + fGeom->GetCrystalSize(2) ;
1688 Text_t histoname[80];
1689 sprintf(histoname,"Event %d: Track Segments in module %d", fEvt, module) ;
1690 TH2F * histotrack = new TH2F("histotrack", histoname,
1691 xdim, xmin, xMax, zdim, zmin, zMax) ;
1692 histotrack->SetStats(kFALSE);
1693 Text_t canvasname[80];
1694 sprintf(canvasname,"Track segments in PHOS/EMC-PPSD module # %d", module) ;
1695 TCanvas * trackcanvas = new TCanvas("TrackSegmentCanvas", canvasname, 650, 500) ;
1696 histotrack->Draw() ;
1698 AliPHOSTrackSegment::TrackSegmentsList * trsegl = *(fPHOS->TrackSegments()) ;
1699 AliPHOSTrackSegment * trseg ;
1701 Int_t nTrackSegments = trsegl->GetEntries() ;
1704 Int_t nTrackSegmentsInModule = 0 ;
1705 for(index = 0; index < nTrackSegments ; index++){
1706 trseg = (AliPHOSTrackSegment * )trsegl->At(index) ;
1707 etot+= trseg->GetEnergy() ;
1708 if ( trseg->GetPHOSMod() == module ) {
1709 nTrackSegmentsInModule++ ;
1714 sprintf(text, "track segments: %d", nTrackSegmentsInModule) ;
1715 TPaveText * pavetext = new TPaveText(22, 80, 83, 90);
1716 pavetext->AddText(text) ;
1718 trackcanvas->Update() ;
1719 cout << "DisplayTrackSegments > Found " << trsegl->GetEntries() << " Track segments with total energy "<< etot << endl ;
1723 //____________________________________________________________________________
1724 Bool_t AliPHOSAnalyze::OpenRootFile(Text_t * name)
1726 // Open the root file named "name"
1728 fRootFile = new TFile(name, "update") ;
1729 return fRootFile->IsOpen() ;
1731 //____________________________________________________________________________
1732 void AliPHOSAnalyze::SaveHistograms()
1734 // Saves the histograms in a root file named "name.analyzed"
1736 Text_t outputname[80] ;
1737 sprintf(outputname,"%s.analyzed",fRootFile->GetName());
1738 TFile output(outputname,"RECREATE");
1742 fhAllEnergy->Write() ;
1744 fhPhotEnergy->Write() ;
1746 fhEMEnergy->Write() ;
1748 fhPPSDEnergy->Write() ;
1750 fhAllPosition->Write() ;
1752 fhPhotPosition->Write() ;
1754 fhEMPosition->Write() ;
1756 fhPPSDPosition->Write() ;
1760 fhPhotReg->Write() ;
1764 fhNBarReg->Write() ;
1766 fhChargedReg->Write() ;
1776 fhChargedEM->Write() ;
1778 fhAllPPSD->Write() ;
1780 fhPhotPPSD->Write() ;
1784 fhNBarPPSD->Write() ;
1786 fhChargedPPSD->Write() ;
1788 fhPrimary->Write() ;
1798 fhPhotPhot->Write() ;
1800 fhPhotElec->Write() ;
1802 fhPhotNeuH->Write() ;
1804 fhPhotNuEM->Write() ;
1806 fhPhotNuEM->Write() ;
1808 fhPhotChHa->Write() ;
1810 fhPhotGaHa->Write() ;
1811 if(fhEnergyCorrelations)
1812 fhEnergyCorrelations->Write() ;
1817 //____________________________________________________________________________
1818 Float_t AliPHOSAnalyze::CorrectEnergy(Float_t ERecPart)
1820 return ERecPart/0.8783 ;
1823 //____________________________________________________________________________
1824 void AliPHOSAnalyze::ResetHistograms()
1826 fhEnergyCorrelations = 0 ; //Energy correlations between Eloss in Convertor and PPSD(2)
1828 fhEmcDigit = 0 ; // Histo of digit energies in the Emc
1829 fhVetoDigit = 0 ; // Histo of digit energies in the Veto
1830 fhConvertorDigit = 0 ; // Histo of digit energies in the Convertor
1831 fhEmcCluster = 0 ; // Histo of Cluster energies in Emc
1832 fhVetoCluster = 0 ; // Histo of Cluster energies in Veto
1833 fhConvertorCluster = 0 ; // Histo of Cluster energies in Convertor
1834 fhConvertorEmc = 0 ; // 2d Convertor versus Emc energies
1837 fhPhotEnergy = 0 ; // Total spectrum of detected photons
1838 fhEMEnergy = 0 ; // Spectrum of detected electrons with electron primary
1841 fhPhotPosition = 0 ;
1843 fhPPSDPosition = 0 ;