- if ( fRootFile == 0 )
- cout << "AnalyzeManyEvents > " << "Root File not openned" << endl ;
- else
- {
- //========== Get AliRun object from file
- gAlice = (AliRun*) fRootFile->Get("gAlice") ;
- //=========== Get the PHOS object and associated geometry from the file
- fPHOS = (AliPHOSv0 *)gAlice->GetDetector("PHOS") ;
- fGeom = AliPHOSGeometry::GetInstance( fPHOS->GetGeometry()->GetName(), fPHOS->GetGeometry()->GetTitle() );
- //========== Booking Histograms
- cout << "AnalyzeManyEvents > " << "Booking Histograms" << endl ;
- BookingHistograms();
- Int_t ievent;
- Int_t relid[4] ;
- AliPHOSDigit * digit ;
- AliPHOSEmcRecPoint * emc ;
- AliPHOSPpsdRecPoint * ppsd ;
- // AliPHOSTrackSegment * tracksegment ;
- AliPHOSRecParticle * recparticle;
- for ( ievent=0; ievent<Nevents; ievent++)
- {
- if (ievent==0) cout << "AnalyzeManyEvents > " << "Starting Analyzing " << endl ;
- //========== Create the Clusterizer
- fClu = new AliPHOSClusterizerv1() ;
- fClu->SetEmcEnergyThreshold(0.05) ;
- fClu->SetEmcClusteringThreshold(0.50) ;
- fClu->SetPpsdEnergyThreshold (0.0000002) ;
- fClu->SetPpsdClusteringThreshold(0.0000001) ;
- fClu->SetLocalMaxCut(0.03) ;
- fClu->SetCalibrationParameters(0., 0.00000001) ;
- //========== Creates the track segment maker
- fTrs = new AliPHOSTrackSegmentMakerv1() ;
- fTrs->UnsetUnfoldFlag() ;
- //========== Creates the particle identifier
- fPID = new AliPHOSPIDv1() ;
- fPID->SetShowerProfileCuts(0.3, 1.8, 0.3, 1.8 ) ;
- fPID->Print() ;
- //========== Creates the Reconstructioner
- fRec = new AliPHOSReconstructioner(fClu, fTrs, fPID) ;
- //========== Event Number>
- if ( ( log10((Float_t)(ievent+1)) - (Int_t)(log10((Float_t)(ievent+1))) ) == 0. )
- cout << "AnalyzeManyEvents > " << "Event is " << ievent << endl ;
- //=========== Connects the various Tree's for evt
- gAlice->GetEvent(ievent);
- //=========== Gets the Digit TTree
- gAlice->TreeD()->GetEvent(0) ;
- //=========== Gets the number of entries in the Digits array
- TIter nextdigit(fPHOS->Digits()) ;
- while( ( digit = (AliPHOSDigit *)nextdigit() ) )
- {
- fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
- if (fClu->IsInEmc(digit)) fhEmcDigit->Fill(fClu->Calibrate(digit->GetAmp())) ;
- else
- {
- if (relid[1]<17) fhVetoDigit->Fill(fClu->Calibrate(digit->GetAmp()));
- if (relid[1]>16) fhConvertorDigit->Fill(fClu->Calibrate(digit->GetAmp()));
- }
- }
- //=========== Do the reconstruction
- fPHOS->Reconstruction(fRec);
- //=========== Cluster in module
- TIter nextEmc(fPHOS->EmcRecPoints() ) ;
- while((emc = (AliPHOSEmcRecPoint *)nextEmc()))
- {
- if ( emc->GetPHOSMod() == module )
- {
- fhEmcCluster->Fill( emc->GetTotalEnergy() );
- TIter nextPpsd( fPHOS->PpsdRecPoints()) ;
- while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
- {
- if ( ppsd->GetPHOSMod() == module )
- {
- if (!ppsd->GetUp()) fhConvertorEmc->Fill(emc->GetTotalEnergy(),ppsd->GetTotalEnergy()) ;
- }
- }
- }
- }
- //=========== Cluster in module PPSD Down
- TIter nextPpsd(fPHOS->PpsdRecPoints() ) ;
- while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
- {
- if ( ppsd->GetPHOSMod() == module )
- {
- if (!ppsd->GetUp()) fhConvertorCluster->Fill(ppsd->GetTotalEnergy()) ;
- if (ppsd->GetUp()) fhVetoCluster ->Fill(ppsd->GetTotalEnergy()) ;
- }
- }
- //========== TRackSegments in the event
- TIter nextRecParticle(fPHOS->RecParticles() ) ;
- while((recparticle = (AliPHOSRecParticle *)nextRecParticle()))
- {
- if ( recparticle->GetPHOSTrackSegment()->GetPHOSMod() == module )
- {
- cout << "Particle type is " << recparticle->GetType() << endl ;
- Int_t numberofprimaries = 0 ;
- Int_t * listofprimaries = recparticle->GetPrimaries(numberofprimaries) ;
- cout << "Number of primaries = " << numberofprimaries << endl ;
- Int_t index ;
- for ( index = 0 ; index < numberofprimaries ; index++)
- cout << " primary # " << index << " = " << listofprimaries[index] << endl ;
- switch(recparticle->GetType())
- {
- case AliPHOSFastRecParticle::kGAMMA:
- fhPhotonEnergy->Fill(recparticle->Energy() ) ;
- //fhPhotonPositionX->Fill(recpart. ) ;
- //fhPhotonPositionY->Fill(recpart. ) ;
- cout << "PHOTON" << endl;
- break;
- case AliPHOSFastRecParticle::kELECTRON:
- fhElectronEnergy->Fill(recparticle->Energy() ) ;
- //fhElectronPositionX->Fill(recpart. ) ;
- //fhElectronPositionY->Fill(recpart. ) ;
- cout << "ELECTRON" << endl;
- break;
- case AliPHOSFastRecParticle::kNEUTRALHA:
- fhNeutralHadronEnergy->Fill(recparticle->Energy() ) ;
- //fhNeutralHadronPositionX->Fill(recpart. ) ;
- //fhNeutralHadronPositionY->Fill(recpart. ) ;
- cout << "NEUTRAl HADRON" << endl;
- break ;
- case AliPHOSFastRecParticle::kNEUTRALEM:
- fhNeutralEMEnergy->Fill(recparticle->Energy() ) ;
- //fhNeutralEMPositionX->Fill(recpart. ) ;
- //fhNeutralEMPositionY->Fill(recpart. ) ;
- //cout << "NEUTRAL EM" << endl;
- break ;
- case AliPHOSFastRecParticle::kCHARGEDHA:
- fhChargedHadronEnergy->Fill(recparticle->Energy() ) ;
- //fhChargedHadronPositionX->Fill(recpart. ) ;
- //fhChargedHadronPositionY->Fill(recpart. ) ;
- cout << "CHARGED HADRON" << endl;
- break ;
- case AliPHOSFastRecParticle::kGAMMAHA:
- fhPhotonHadronEnergy->Fill(recparticle->Energy() ) ;
- //fhPhotonHadronPositionX->Fill(recpart. ) ;
- //fhPhotonHadronPositionY->Fill(recpart. ) ;
- cout << "PHOTON HADRON" << endl;
- break ;
- }
- }
- }
- // Deleting fClu, fTrs, fPID et fRec
- fClu->Delete();
- fTrs->Delete();
- fPID->Delete();
- fRec->Delete();
-
- } // endfor
- SavingHistograms();
- } // endif
-} // endfunction