- TH2F * digitOccupancy = new TH2F("digitOccupancy","EMC digits", 64,-71.,71.,64,-71.,71.);
- TH2F * sdigitOccupancy = new TH2F("sdigitOccupancy","EMC sdigits", 64,-71.,71.,64,-71.,71.);
- TH2F * emcOccupancy = new TH2F("emcOccupancy","EMC RecPoints",64,-71.,71.,64,-71.,71.);
- TH2F * ppsdUp = new TH2F("ppsdUp","PPSD Up digits", 128,-71.,71.,128,-71.,71.) ;
- TH2F * ppsdUpCl = new TH2F("ppsdUpCl","PPSD Up RecPoints",128,-71.,71.,128,-71.,71.) ;
- TH2F * ppsdLow = new TH2F("ppsdLow","PPSD Low digits", 128,-71.,71.,128,-71.,71.) ;
- TH2F * ppsdLowCl = new TH2F("ppsdLowCl","PPSD Low RecPoints",128,-71.,71.,128,-71.,71.) ;
- TH2F * nbar = new TH2F("nbar","Primary nbar", 64,-71.,71.,64,-71.,71.);
- TH2F * phot = new TH2F("phot","Primary Photon", 64,-71.,71.,64,-71.,71.);
- TH2F * charg = new TH2F("charg","Primary charged",64,-71.,71.,64,-71.,71.);
- TH2F * recPhot = new TH2F("recPhot","RecParticles with primary Photon",64,-71.,71.,64,-71.,71.);
- TH2F * recNbar = new TH2F("recNbar","RecParticles with primary Nbar", 64,-71.,71.,64,-71.,71.);
+ AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(fRunLoader->GetLoader("PHOSLoader"));
+ if ( gime == 0 )
+ {
+ AliError(Form("Could not obtain the Loader object !"));
+ return ;
+ }
+
+
+ if(Nevent >= fRunLoader->GetNumberOfEvents() ) {
+ AliError(Form("There is no event %d only %d events available", Nevent, fRunLoader->GetNumberOfEvents() )) ;
+ return ;
+ }
+ const AliPHOSGeometry * phosgeom = gime->PHOSGeometry() ;
+ fRunLoader->GetEvent(Nevent);
+
+ Int_t nx = phosgeom->GetNPhi() ;
+ Int_t nz = phosgeom->GetNZ() ;
+ Float_t * cri= phosgeom->GetEMCAGeometry()->GetCrystalHalfSize() ;
+ Float_t x = nx*cri[0] ;
+ Float_t z = nz*cri[2] ;
+ Int_t nxCPV = (Int_t) (nx*phosgeom->GetPadSizePhi()/(2.*cri[0])) ;
+ Int_t nzCPV = (Int_t) (nz*phosgeom->GetPadSizeZ()/(2.*cri[2])) ;
+
+ TH2F * emcDigits = (TH2F*) gROOT->FindObject("emcDigits") ;
+ if(emcDigits)
+ emcDigits->Delete() ;
+ emcDigits = new TH2F("emcDigits","EMC digits", nx,-x,x,nz,-z,z);
+ TH2F * emcSdigits =(TH2F*) gROOT->FindObject("emcSdigits") ;
+ if(emcSdigits)
+ emcSdigits->Delete() ;
+ emcSdigits = new TH2F("emcSdigits","EMC sdigits", nx,-x,x,nz,-z,z);
+ TH2F * emcRecPoints = (TH2F*)gROOT->FindObject("emcRecPoints") ;
+ if(emcRecPoints)
+ emcRecPoints->Delete() ;
+ emcRecPoints = new TH2F("emcRecPoints","EMC RecPoints",nx,-x,x,nz,-z,z);
+ TH2F * cpvSdigits =(TH2F*) gROOT->FindObject("cpvSdigits") ;
+ if(cpvSdigits)
+ cpvSdigits->Delete() ;
+ cpvSdigits = new TH2F("cpvSdigits","CPV sdigits", nx,-x,x,nz,-z,z);
+ TH2F * cpvDigits = (TH2F*)gROOT->FindObject("cpvDigits") ;
+ if(cpvDigits)
+ cpvDigits->Delete() ;
+ cpvDigits = new TH2F("cpvDigits","CPV digits", nxCPV,-x,x,nzCPV,-z,z) ;
+ TH2F * cpvRecPoints= (TH2F*)gROOT->FindObject("cpvRecPoints") ;
+ if(cpvRecPoints)
+ cpvRecPoints->Delete() ;
+ cpvRecPoints = new TH2F("cpvRecPoints","CPV RecPoints", nxCPV,-x,x,nzCPV,-z,z) ;
+
+ TH2F * phot = (TH2F*)gROOT->FindObject("phot") ;
+ if(phot)
+ phot->Delete() ;
+ phot = new TH2F("phot","Primary Photon", nx,-x,x,nz,-z,z);
+ TH2F * recPhot = (TH2F*)gROOT->FindObject("recPhot") ;
+ if(recPhot)
+ recPhot->Delete() ;
+ recPhot = new TH2F("recPhot","RecParticles with primary Photon",nx,-x,x,nz,-z,z);