From f540341d134371fdde882958bede67bbfb7f0825 Mon Sep 17 00:00:00 2001 From: hristov Date: Mon, 16 Feb 2004 06:39:07 +0000 Subject: [PATCH] Reducing printout. Removing warnings from NewIO --- EMCAL/AliEMCALSDigitizer.cxx | 4 +- FMD/AliFMDDigitizer.cxx | 8 +- FMD/AliFMDReconstruction.cxx | 4 +- FMD/AliFMDSDigitizer.cxx | 6 +- PMD/AliPMDDigitizer.cxx | 50 +++-- RICH/AliRICH.cxx | 25 ++- RICH/AliRICHParam.cxx | 2 +- RICH/AliRICHRecon.cxx | 383 ++++++++++++++++++----------------- START/AliSTARTDigitizer.cxx | 4 +- TOF/AliTOF.cxx | 6 +- TOF/AliTOFMerger.cxx | 44 ++-- TOF/AliTOFSDigitizer.cxx | 13 +- TPC/AliTPC.cxx | 10 +- TRD/AliTRDdigitizer.cxx | 10 +- ZDC/AliZDC.cxx | 57 +++--- 15 files changed, 329 insertions(+), 297 deletions(-) diff --git a/EMCAL/AliEMCALSDigitizer.cxx b/EMCAL/AliEMCALSDigitizer.cxx index e95e46a18ef..674d654bd19 100644 --- a/EMCAL/AliEMCALSDigitizer.cxx +++ b/EMCAL/AliEMCALSDigitizer.cxx @@ -148,8 +148,8 @@ void AliEMCALSDigitizer::InitParameters() if (geom->GetSampling() == 0.) { Fatal("InitParameters", "Sampling factor not set !") ; } - else - Info("InitParameters", "Sampling factor set to %f", geom->GetSampling()) ; +// else +// Info("InitParameters", "Sampling factor set to %f", geom->GetSampling()) ; // this threshold corresponds approximately to 100 MeV fECPrimThreshold = 100E-3; diff --git a/FMD/AliFMDDigitizer.cxx b/FMD/AliFMDDigitizer.cxx index 6004805a9b7..43a229c941f 100644 --- a/FMD/AliFMDDigitizer.cxx +++ b/FMD/AliFMDDigitizer.cxx @@ -79,7 +79,7 @@ AliFMDDigitizer::~AliFMDDigitizer() Bool_t AliFMDDigitizer::Init() { // Initialization - cout<<"AliFMDDigitizer::Init"<GetAliRun() %#x",inRL->GetAliRun()); + // Info("Exec","inRL->GetAliRun() %#x",inRL->GetAliRun()); - inRL->LoadgAlice(); + if (!inRL->GetAliRun()) inRL->LoadgAlice(); AliFMD * fFMD = (AliFMD *) inRL->GetAliRun()->GetDetector("FMD"); - Info("Exec","inRL->GetAliRun(): %#x, FMD: %#x, InRL %#x.",inRL->GetAliRun(),fFMD,inRL); + // Info("Exec","inRL->GetAliRun(): %#x, FMD: %#x, InRL %#x.",inRL->GetAliRun(),fFMD,inRL); if (fFMD == 0x0) { Error("Exec","Can not get FMD from gAlice"); diff --git a/FMD/AliFMDReconstruction.cxx b/FMD/AliFMDReconstruction.cxx index 711b403f8ec..f98f6dc7f9d 100644 --- a/FMD/AliFMDReconstruction.cxx +++ b/FMD/AliFMDReconstruction.cxx @@ -135,8 +135,8 @@ void AliFMDReconstruction::Exec() return;//never reached } - fRunLoader->LoadgAlice(); - fRunLoader->LoadHeader(); + if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice(); + if (!fRunLoader->TreeE()) fRunLoader->LoadHeader(); Int_t retval; TDirectory* cwd = gDirectory; gDirectory = 0x0; diff --git a/FMD/AliFMDSDigitizer.cxx b/FMD/AliFMDSDigitizer.cxx index 74e056e120b..febce133bb1 100644 --- a/FMD/AliFMDSDigitizer.cxx +++ b/FMD/AliFMDSDigitizer.cxx @@ -128,9 +128,9 @@ void AliFMDSDigitizer::Exec(Option_t *option) return;//never reached } - fRunLoader->LoadgAlice(); - fRunLoader->LoadHeader(); - fRunLoader->LoadKinematics("READ"); + if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice(); + if (!fRunLoader->TreeE()) fRunLoader->LoadHeader(); + if (!fRunLoader->TreeK()) fRunLoader->LoadKinematics("READ"); Int_t retval; diff --git a/PMD/AliPMDDigitizer.cxx b/PMD/AliPMDDigitizer.cxx index b67c7baaabd..7e3cd77b5ad 100644 --- a/PMD/AliPMDDigitizer.cxx +++ b/PMD/AliPMDDigitizer.cxx @@ -130,31 +130,37 @@ void AliPMDDigitizer::OpengAliceFile(const char *file, Option_t *option) // Loads galice.root file and corresponding header, kinematics // hits and sdigits or digits depending on the option // - fRunLoader = AliRunLoader::Open(file,AliConfig::fgkDefaultEventFolderName, - "UPDATE"); + + TString evfoldname = AliConfig::fgkDefaultEventFolderName; + fRunLoader = AliRunLoader::GetRunLoader(evfoldname); + if (!fRunLoader) + fRunLoader = AliRunLoader::Open(file,AliConfig::fgkDefaultEventFolderName, + "UPDATE"); if (!fRunLoader) { Error("Open","Can not open session for file %s.",file); } - fRunLoader->LoadgAlice(); - fRunLoader->LoadHeader(); - fRunLoader->LoadKinematics(); + if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice(); + if (!fRunLoader->TreeE()) fRunLoader->LoadHeader(); + if (!fRunLoader->TreeK()) fRunLoader->LoadKinematics(); gAlice = fRunLoader->GetAliRun(); - if (gAlice) - { - printf(" "); - printf("AliRun object found on file.\n"); - } - else - { - printf(" "); - printf("Could not find AliRun object.\n"); - } - + if (fDebug) { + if (gAlice) + { + printf(" "); + printf("AliRun object found on file.\n"); + } + else + { + printf(" "); + printf("Could not find AliRun object.\n"); + } + } + fPMD = (AliPMD*)gAlice->GetDetector("PMD"); fPMDLoader = fRunLoader->GetLoader("PMDLoader"); if (fPMDLoader == 0x0) @@ -207,9 +213,9 @@ void AliPMDDigitizer::Hits2SDigits(Int_t ievt) ResetSDigit(); - printf("Event Number = %d \n",ievt); + if (fDebug) printf("Event Number = %d \n",ievt); Int_t nparticles = fRunLoader->GetHeader()->GetNtrack(); - printf("Number of Particles = %d \n", nparticles); + if (fDebug) printf("Number of Particles = %d \n", nparticles); fRunLoader->GetEvent(ievt); // ------------------------------------------------------- // // Pointer to specific detector hits. @@ -218,7 +224,7 @@ void AliPMDDigitizer::Hits2SDigits(Int_t ievt) fTreeH = fPMDLoader->TreeH(); Int_t ntracks = (Int_t) fTreeH->GetEntries(); - printf("Number of Tracks in the TreeH = %d \n", ntracks); + if (fDebug) printf("Number of Tracks in the TreeH = %d \n", ntracks); fTreeS = fPMDLoader->TreeS(); if (fTreeS == 0x0) @@ -439,10 +445,10 @@ void AliPMDDigitizer::Hits2Digits(Int_t ievt) ResetDigit(); - printf("Event Number = %d \n",ievt); + if (fDebug) printf("Event Number = %d \n",ievt); Int_t nparticles = fRunLoader->GetHeader()->GetNtrack(); - printf("Number of Particles = %d \n", nparticles); + if (fDebug) printf("Number of Particles = %d \n", nparticles); fRunLoader->GetEvent(ievt); // ------------------------------------------------------- // // Pointer to specific detector hits. @@ -457,7 +463,7 @@ void AliPMDDigitizer::Hits2Digits(Int_t ievt) } fTreeH = fPMDLoader->TreeH(); Int_t ntracks = (Int_t) fTreeH->GetEntries(); - printf("Number of Tracks in the TreeH = %d \n", ntracks); + if (fDebug) printf("Number of Tracks in the TreeH = %d \n", ntracks); fPMDLoader->LoadDigits("recreate"); fTreeD = fPMDLoader->TreeD(); if (fTreeD == 0x0) diff --git a/RICH/AliRICH.cxx b/RICH/AliRICH.cxx index 0c4a8883a62..309253292b1 100644 --- a/RICH/AliRICH.cxx +++ b/RICH/AliRICH.cxx @@ -123,15 +123,20 @@ void AliRICH::Hits2SDigits() // Create a list of sdigits corresponding to list of hits. Every hit generates one or more sdigits. // if(GetDebug()) Info("Hit2SDigits","Start."); + + AliLoader * richLoader = GetLoader(); + AliRunLoader * runLoader = GetLoader()->GetRunLoader(); + for(Int_t iEventN=0;iEventNGetRunLoader()->GetAliRun()->GetEventsPerRun();iEventN++){//events loop - GetLoader()->GetRunLoader()->GetEvent(iEventN); + runLoader->GetEvent(iEventN); - if(!GetLoader()->TreeH()) GetLoader()->LoadHits(); GetLoader()->GetRunLoader()->LoadHeader(); - GetLoader()->GetRunLoader()->LoadKinematics();//from - if(!GetLoader()->TreeS()) GetLoader()->MakeTree("S"); MakeBranch("S");//to + if (!richLoader->TreeH()) richLoader->LoadHits(); + if (!runLoader->TreeE()) runLoader->LoadHeader(); + if (!runLoader->TreeK()) runLoader->LoadKinematics();//from + if (!richLoader->TreeS()) richLoader->MakeTree("S"); MakeBranch("S");//to for(Int_t iPrimN=0;iPrimNTreeH()->GetEntries();iPrimN++){//prims loop - GetLoader()->TreeH()->GetEntry(iPrimN); + richLoader->TreeH()->GetEntry(iPrimN); for(Int_t iHitN=0;iHitNGetEntries();iHitN++){//hits loop AliRICHhit *pHit=(AliRICHhit*)Hits()->At(iHitN); TVector2 x2 = P()->ShiftToWirePos(C(pHit->C())->Glob2Loc(pHit->OutX3())); @@ -144,15 +149,17 @@ void AliRICH::Hits2SDigits() for(Int_t iPadX=iPadXmin;iPadX<=iPadXmax;iPadX++){ Double_t padQdc=iTotQdc*P()->FracQdc(x2,iPadX,iPadY); if(padQdc>0.1) AddSDigit(pHit->C(),iPadX,iPadY,padQdc, - GetLoader()->GetRunLoader()->Stack()->Particle(pHit->GetTrack())->GetPdgCode(),pHit->GetTrack()); + runLoader->Stack()->Particle(pHit->GetTrack())->GetPdgCode(),pHit->GetTrack()); }//affected pads loop }//hits loop }//prims loop - GetLoader()->TreeS()->Fill(); - GetLoader()->WriteSDigits("OVERWRITE"); + richLoader->TreeS()->Fill(); + richLoader->WriteSDigits("OVERWRITE"); ResetSDigits(); }//events loop - GetLoader()->UnloadHits(); GetLoader()->GetRunLoader()->UnloadHeader(); GetLoader()->GetRunLoader()->UnloadKinematics(); + richLoader->UnloadHits(); + runLoader->UnloadHeader(); + runLoader->UnloadKinematics(); GetLoader()->UnloadSDigits(); if(GetDebug()) Info("Hit2SDigits","Stop."); }//Hits2SDigits() diff --git a/RICH/AliRICHParam.cxx b/RICH/AliRICHParam.cxx index f1f7ca0e5be..f8d0a245cf6 100644 --- a/RICH/AliRICHParam.cxx +++ b/RICH/AliRICHParam.cxx @@ -32,7 +32,7 @@ void AliRICHParam::GenSigmaThMap() for(Int_t ipadX=0;ipadXRndm())*SigmaThSpread(); - Info("GenSigmaThMap"," Threshold map generated for all RICH chambers"); + // Info("GenSigmaThMap"," Threshold map generated for all RICH chambers"); } //__________________________________________________________________________________________________ void AliRICHParam::Print() diff --git a/RICH/AliRICHRecon.cxx b/RICH/AliRICHRecon.cxx index 76e13e90dcf..d0f74855c7e 100644 --- a/RICH/AliRICHRecon.cxx +++ b/RICH/AliRICHRecon.cxx @@ -88,203 +88,206 @@ void AliRICHRecon::StartProcessEvent() // Waiting(); } - Rich()->GetLoader()->LoadHits(); - Rich()->GetLoader()->LoadRecPoints(); - Rich()->GetLoader()->LoadDigits(); - gAlice->GetRunLoader()->LoadHeader(); - gAlice->GetRunLoader()->LoadKinematics(); - - Rich()->GetLoader()->TreeR()->GetEntry(0); + AliLoader * richLoader = Rich()->GetLoader(); + AliRunLoader * runLoader = richLoader->GetRunLoader(); + + if (richLoader->TreeH() == 0x0) richLoader->LoadHits(); + if (richLoader->TreeR() == 0x0) richLoader->LoadRecPoints(); + if (richLoader->TreeD() == 0x0) richLoader->LoadDigits(); + if (runLoader->TreeE() == 0x0) runLoader->LoadHeader(); + if (runLoader->TreeK() == 0x0) runLoader->LoadKinematics(); + + richLoader->TreeR()->GetEntry(0); - Float_t clusX[7][500],clusY[7][500]; - Int_t clusQ[7][500],clusMul[7][500]; - Int_t nClusters[7]; + Float_t clusX[7][500],clusY[7][500]; + Int_t clusQ[7][500],clusMul[7][500]; + Int_t nClusters[7]; - for (Int_t ich=0;ich<7;ich++) { - nClusters[ich] = Rich()->Clusters(ich+1)->GetEntries(); - for(Int_t k=0;kClusters(ich+1)->At(k); - clusX[ich][k] = pCluster->X(); - clusY[ich][k] = pCluster->Y(); - clusQ[ich][k] = pCluster->Q(); - clusMul[ich][k] = pCluster->Size(); -// pCluster->Print(); - } + for (Int_t ich=0;ich<7;ich++) { + nClusters[ich] = Rich()->Clusters(ich+1)->GetEntries(); + for(Int_t k=0;kClusters(ich+1)->At(k); + clusX[ich][k] = pCluster->X(); + clusY[ich][k] = pCluster->Y(); + clusQ[ich][k] = pCluster->Q(); + clusMul[ich][k] = pCluster->Size(); + // pCluster->Print(); } - - Int_t nPrimaries = (Int_t)Rich()->GetLoader()->TreeH()->GetEntries(); - - cout << " N. primaries " << nPrimaries << endl; - - for(Int_t i=0;iGetLoader()->TreeH()->GetEntry(i); - -// Rich()->Hits()->Print(); - Int_t iPrim = 0; - - AliRICHhit* pHit=0; + } + + Int_t nPrimaries = (Int_t)richLoader->TreeH()->GetEntries(); + + cout << " N. primaries " << nPrimaries << endl; + + for(Int_t i=0;iTreeH()->GetEntry(i); + + // Rich()->Hits()->Print(); + Int_t iPrim = 0; + + AliRICHhit* pHit=0; + + for(Int_t j=0;jHits()->GetEntries();j++) { - for(Int_t j=0;jHits()->GetEntries();j++) { - - pHit = (AliRICHhit*)Rich()->Hits()->At(j); - if(pHit->GetTrack() < nPrimaries) break; - iPrim++; + pHit = (AliRICHhit*)Rich()->Hits()->At(j); + if(pHit->GetTrack() < nPrimaries) break; + iPrim++; + } + + cout << " iPrim " << iPrim << " pHit " << pHit << endl; + + if (!pHit) return; + + // pHit->Print(); + + TParticle *pParticle = runLoader->Stack()->Particle(pHit->GetTrack()); + Float_t pmod = pParticle->P(); + Float_t pt = pParticle->Pt(); + Float_t trackEta = pParticle->Eta(); + Int_t q = (Int_t)TMath::Sign(1.,pParticle->GetPDG()->Charge()); + + // pParticle->Print(); + + cout << " pmod " << pmod << " pt " << pt << " Eta " << trackEta << " charge " << q << endl; + + SetTrackMomentum(pmod); + SetTrackPt(pt); + SetTrackEta(trackEta); + SetTrackCharge(q); + + TVector3 pLocal(0,0,0);//????? + + TVector2 primLocal =Rich()->C(pHit->C())->Glob2Loc(pHit->InX3()); + + // Float_t pmodFreo = pLocal.Mag(); + Float_t trackTheta = pLocal.Theta(); + Float_t trackPhi = pLocal.Phi(); + + // cout << " trackTheta " << trackTheta << " trackPhi " << trackPhi << endl; + + SetTrackTheta(trackTheta); + SetTrackPhi(trackPhi); + + Int_t maxInd = 0; + Float_t minDist = 999.; + + // cout << " n Clusters " << nClusters[pHit->Chamber()-1] << " for chamber n. " << pHit->Chamber() << endl; + + for(Int_t j=0;jChamber()-1];j++) + { + Float_t diffx = primLocal.X() - clusX[pHit->Chamber()-1][j]; + Float_t diffy = primLocal.Y() - clusY[pHit->Chamber()-1][j]; + + + Float_t diff = sqrt(diffx*diffx + diffy*diffy); + + if(diff < minDist) + { + minDist = diff; + maxInd = j; + } + } - - cout << " iPrim " << iPrim << " pHit " << pHit << endl; - - if (!pHit) return; - -// pHit->Print(); - - TParticle *pParticle = gAlice->GetRunLoader()->Stack()->Particle(pHit->GetTrack()); - Float_t pmod = pParticle->P(); - Float_t pt = pParticle->Pt(); - Float_t trackEta = pParticle->Eta(); - Int_t q = (Int_t)TMath::Sign(1.,pParticle->GetPDG()->Charge()); - -// pParticle->Print(); - - cout << " pmod " << pmod << " pt " << pt << " Eta " << trackEta << " charge " << q << endl; - - SetTrackMomentum(pmod); - SetTrackPt(pt); - SetTrackEta(trackEta); - SetTrackCharge(q); - - TVector3 pLocal(0,0,0);//????? - - TVector2 primLocal =Rich()->C(pHit->C())->Glob2Loc(pHit->InX3()); - -// Float_t pmodFreo = pLocal.Mag(); - Float_t trackTheta = pLocal.Theta(); - Float_t trackPhi = pLocal.Phi(); - -// cout << " trackTheta " << trackTheta << " trackPhi " << trackPhi << endl; - - SetTrackTheta(trackTheta); - SetTrackPhi(trackPhi); - - Int_t maxInd = 0; - Float_t minDist = 999.; - -// cout << " n Clusters " << nClusters[pHit->Chamber()-1] << " for chamber n. " << pHit->Chamber() << endl; - - for(Int_t j=0;jChamber()-1];j++) - { - Float_t diffx = primLocal.X() - clusX[pHit->Chamber()-1][j]; - Float_t diffy = primLocal.Y() - clusY[pHit->Chamber()-1][j]; - - - Float_t diff = sqrt(diffx*diffx + diffy*diffy); - - if(diff < minDist) - { - minDist = diff; - maxInd = j; - } - - } - - Float_t diffx = primLocal.X() - clusX[pHit->Chamber()-1][maxInd]; - Float_t diffy = primLocal.Y() - clusY[pHit->Chamber()-1][maxInd]; - - cout << " diffx " << diffx << " diffy " << diffy << endl; - - - SetMipIndex(maxInd); - SetTrackIndex(i); - - Float_t shiftX = 0;//primLocal.X()/primLocal.Z()*(fRadiatorWidth+fQuartzWidth+fGapWidth) + primLocal.X(); ????? - Float_t shiftY = 0;//primLocal.Y()/primLocal.Z()*(fRadiatorWidth+fQuartzWidth+fGapWidth) + primLocal.Y(); ????? - - SetShiftX(shiftX); - SetShiftY(shiftY); - - Float_t *pclusX = &clusX[pHit->Chamber()-1][0]; - Float_t *pclusY = &clusY[pHit->Chamber()-1][0]; - - SetCandidatePhotonX(pclusX); - SetCandidatePhotonY(pclusY); - SetCandidatePhotonsNumber(nClusters[pHit->Chamber()-1]); - - Int_t qch = clusQ[pHit->Chamber()-1][maxInd]; - - - if(minDist < 3.0 && qch > 120 && maxInd !=0) - { - - if(fIsBACKGROUND) - { - - Float_t xrndm = fXmin + (fXmax-fXmin)*gRandom->Rndm(280964); - Float_t yrndm = fYmin + (fYmax-fYmin)*gRandom->Rndm(280964); - SetShiftX(xrndm); - SetShiftY(yrndm); - - } - - PatRec(); - - trackThetaStored = GetTrackTheta(); - trackPhiStored = GetTrackPhi(); - thetaCerenkovStored = GetThetaCerenkov(); - houghPhotonsStored = GetHoughPhotons(); - - Int_t diffNPhotons = 999; - Int_t nsteps = 0; - Float_t diffTrackTheta = 999.; - Float_t diffTrackPhi = 999.; - - while(fIsMINIMIZER && GetHoughPhotons() > 2 - && diffNPhotons !=0 - && diffTrackTheta > 0.0001 - && nsteps < 10) - { - - Int_t houghPhotonsBefore = GetHoughPhotons(); - - Float_t trackThetaBefore = GetTrackTheta(); - Float_t trackPhiBefore = GetTrackPhi(); - - Minimization(); - - PatRec(); - - diffNPhotons = TMath::Abs(houghPhotonsBefore - GetHoughPhotons()); - - Float_t trackThetaAfter = GetTrackTheta(); - Float_t trackPhiAfter = GetTrackPhi(); - - diffTrackTheta = TMath::Abs(trackThetaAfter - trackThetaBefore); - diffTrackPhi = TMath::Abs(trackPhiAfter - trackPhiBefore); - - if(fDebug) + + Float_t diffx = primLocal.X() - clusX[pHit->Chamber()-1][maxInd]; + Float_t diffy = primLocal.Y() - clusY[pHit->Chamber()-1][maxInd]; + + cout << " diffx " << diffx << " diffy " << diffy << endl; + + + SetMipIndex(maxInd); + SetTrackIndex(i); + + Float_t shiftX = 0;//primLocal.X()/primLocal.Z()*(fRadiatorWidth+fQuartzWidth+fGapWidth) + primLocal.X(); ????? + Float_t shiftY = 0;//primLocal.Y()/primLocal.Z()*(fRadiatorWidth+fQuartzWidth+fGapWidth) + primLocal.Y(); ????? + + SetShiftX(shiftX); + SetShiftY(shiftY); + + Float_t *pclusX = &clusX[pHit->Chamber()-1][0]; + Float_t *pclusY = &clusY[pHit->Chamber()-1][0]; + + SetCandidatePhotonX(pclusX); + SetCandidatePhotonY(pclusY); + SetCandidatePhotonsNumber(nClusters[pHit->Chamber()-1]); + + Int_t qch = clusQ[pHit->Chamber()-1][maxInd]; + + + if(minDist < 3.0 && qch > 120 && maxInd !=0) + { + + if(fIsBACKGROUND) + { + + Float_t xrndm = fXmin + (fXmax-fXmin)*gRandom->Rndm(280964); + Float_t yrndm = fYmin + (fYmax-fYmin)*gRandom->Rndm(280964); + SetShiftX(xrndm); + SetShiftY(yrndm); + + } + + PatRec(); + + trackThetaStored = GetTrackTheta(); + trackPhiStored = GetTrackPhi(); + thetaCerenkovStored = GetThetaCerenkov(); + houghPhotonsStored = GetHoughPhotons(); + + Int_t diffNPhotons = 999; + Int_t nsteps = 0; + Float_t diffTrackTheta = 999.; + Float_t diffTrackPhi = 999.; + + while(fIsMINIMIZER && GetHoughPhotons() > 2 + && diffNPhotons !=0 + && diffTrackTheta > 0.0001 + && nsteps < 10) + { + + Int_t houghPhotonsBefore = GetHoughPhotons(); + + Float_t trackThetaBefore = GetTrackTheta(); + Float_t trackPhiBefore = GetTrackPhi(); + + Minimization(); + + PatRec(); + + diffNPhotons = TMath::Abs(houghPhotonsBefore - GetHoughPhotons()); + + Float_t trackThetaAfter = GetTrackTheta(); + Float_t trackPhiAfter = GetTrackPhi(); + + diffTrackTheta = TMath::Abs(trackThetaAfter - trackThetaBefore); + diffTrackPhi = TMath::Abs(trackPhiAfter - trackPhiBefore); + + if(fDebug) cout << " houghPhotonsBefore " << houghPhotonsBefore << " GetHoughPhotons() " << GetHoughPhotons(); - - nsteps++; - } - - SetFittedThetaCerenkov(GetThetaCerenkov()); - SetFittedHoughPhotons(GetHoughPhotons()); - - SetTrackTheta(trackThetaStored); - SetTrackPhi(trackPhiStored); - SetThetaCerenkov(thetaCerenkovStored); - SetHoughPhotons(houghPhotonsStored); - - SetMinDist(minDist); - - FillHistograms(); - - if(fIsDISPLAY) DrawEvent(1); - - Waiting(); - - } - } + + nsteps++; + } + + SetFittedThetaCerenkov(GetThetaCerenkov()); + SetFittedHoughPhotons(GetHoughPhotons()); + + SetTrackTheta(trackThetaStored); + SetTrackPhi(trackPhiStored); + SetThetaCerenkov(thetaCerenkovStored); + SetHoughPhotons(houghPhotonsStored); + + SetMinDist(minDist); + + FillHistograms(); + + if(fIsDISPLAY) DrawEvent(1); + + Waiting(); + + } + } if(fIsDISPLAY) fDisplay->Print("display.ps"); }//StartProcessEvent() //__________________________________________________________________________________________________ diff --git a/START/AliSTARTDigitizer.cxx b/START/AliSTARTDigitizer.cxx index 18dbd7836de..0b3497a3cff 100644 --- a/START/AliSTARTDigitizer.cxx +++ b/START/AliSTARTDigitizer.cxx @@ -57,7 +57,7 @@ ClassImp(AliSTARTDigitizer) AliSTARTDigitizer::AliSTARTDigitizer(AliRunDigitizer* manager) :AliDigitizer(manager) { - cout<<"AliSTARTDigitizer::AliSTARTDigitizer"<2) @@ -78,7 +78,7 @@ AliSTARTDigitizer::~AliSTARTDigitizer() Bool_t AliSTARTDigitizer::Init() { // Initialization - cout<<"AliSTARTDigitizer::Init"< start...\n"; +// cout<<"AliTOF::Hits2SDigits> start...\n"; AliRunLoader * rl = fLoader->GetRunLoader(); AliTOFSDigitizer sd((rl->GetFileName()).Data()); - sd.Print(""); + if (GetDebug()) sd.Print(""); sd.Exec("") ; @@ -754,7 +754,7 @@ void AliTOF::Hits2SDigits(Int_t evNumber1, Int_t evNumber2) AliRunLoader * rl = fLoader->GetRunLoader(); AliTOFSDigitizer sd((rl->GetFileName()).Data(),evNumber1,evNumber2) ; - sd.Print(""); + if (GetDebug()) sd.Print(""); sd.Exec("") ; diff --git a/TOF/AliTOFMerger.cxx b/TOF/AliTOFMerger.cxx index b92f7bf7e80..c86deeb53e8 100644 --- a/TOF/AliTOFMerger.cxx +++ b/TOF/AliTOFMerger.cxx @@ -119,25 +119,33 @@ void AliTOFMerger::Digitise() Error("Exec","Event is not loaded. Exiting"); return; } - retval = fRunLoader->LoadgAlice(); - if (retval) - { - Error("Exec","Error occured while loading gAlice. Exiting"); - return; - } - retval = fRunLoader->LoadHeader(); - if (retval) - { - Error("Exec","Error occured while loading header. Exiting"); - return; - } - retval = fRunLoader->LoadKinematics("READ"); - if (retval) - { - Error("Exec","Error occured while loading kinematics. Exiting"); - return; - } + if (fRunLoader->GetAliRun() == 0x0) { + retval = fRunLoader->LoadgAlice(); + if (retval) + { + Error("Exec","Error occured while loading gAlice. Exiting"); + return; + } + } + + if (fRunLoader->TreeE() == 0x0) { + retval = fRunLoader->LoadHeader(); + if (retval) + { + Error("Exec","Error occured while loading header. Exiting"); + return; + } + } + + if (fRunLoader->TreeK() == 0x0) { + retval = fRunLoader->LoadKinematics("READ"); + if (retval) + { + Error("Exec","Error occured while loading kinematics. Exiting"); + return; + } + } AliLoader* gime = fRunLoader->GetLoader("TOFLoader"); if (gime == 0x0) diff --git a/TOF/AliTOFSDigitizer.cxx b/TOF/AliTOFSDigitizer.cxx index 54f076e5ff8..3f585e363b0 100644 --- a/TOF/AliTOFSDigitizer.cxx +++ b/TOF/AliTOFSDigitizer.cxx @@ -90,14 +90,17 @@ AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_ } // add Task to //root/Tasks folder - fRunLoader = AliRunLoader::Open(HeaderFile);//open session and mount on default event folder + TString evfoldname = AliConfig::fgkDefaultEventFolderName; + fRunLoader = AliRunLoader::GetRunLoader(evfoldname); + if (!fRunLoader) + fRunLoader = AliRunLoader::Open(HeaderFile);//open session and mount on default event folder if (fRunLoader == 0x0) { Fatal("AliTOFSDigitizer","Event is not loaded. Exiting"); return; } - fRunLoader->LoadHeader(); + if (fRunLoader->TreeE() == 0x0) fRunLoader->LoadHeader(); if (evNumber1>=0) fEvent1 = evNumber1; else fEvent1=0; @@ -208,7 +211,7 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { Bool_t thereIsNotASelection=(fSelectedSector==-1) && (fSelectedPlate==-1); - fRunLoader->LoadgAlice(); + if (fRunLoader->GetAliRun() == 0x0) fRunLoader->LoadgAlice(); gAlice = fRunLoader->GetAliRun(); fRunLoader->LoadKinematics(); @@ -224,8 +227,8 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { fTOFLoader->LoadSDigits("recreate"); for (Int_t iEvent=fEvent1; iEventGetEvent(iEvent); diff --git a/TPC/AliTPC.cxx b/TPC/AliTPC.cxx index a26ea93d8fc..e57a7f2f9d4 100644 --- a/TPC/AliTPC.cxx +++ b/TPC/AliTPC.cxx @@ -876,7 +876,7 @@ void AliTPC::SetActiveSectors(Int_t flag) else branch = TreeH()->GetBranch("TPC"); Stat_t ntracks = TreeH()->GetEntries(); // loop over all hits - cout<<"\nAliTPC::SetActiveSectors(): Got "<WriteRecPoints("OVERWRITE"); @@ -1434,7 +1434,7 @@ void AliTPC::SetDefaults(){ // setting the defaults // - cerr<<"Setting default parameters...\n"; + // cerr<<"Setting default parameters...\n"; // Set response functions @@ -1567,7 +1567,7 @@ void AliTPC::Hits2Digits(Int_t eventnumber) fDigitsSwitch=0; // standard digits - cerr<<"Digitizing TPC -- normal digits...\n"; + // cerr<<"Digitizing TPC -- normal digits...\n"; for(Int_t isec=0;isecGetNSector();isec++) if (IsSectorActive(isec)) @@ -1638,7 +1638,7 @@ void AliTPC::Hits2SDigits2(Int_t eventnumber) SetDigitsArray(arr); - cerr<<"Digitizing TPC -- summable digits...\n"; + // cerr<<"Digitizing TPC -- summable digits...\n"; fDigitsSwitch=1; // summable digits diff --git a/TRD/AliTRDdigitizer.cxx b/TRD/AliTRDdigitizer.cxx index cebd2dbbfa4..2dd51c048fb 100644 --- a/TRD/AliTRDdigitizer.cxx +++ b/TRD/AliTRDdigitizer.cxx @@ -424,8 +424,12 @@ Bool_t AliTRDdigitizer::Open(const Char_t *file, Int_t nEvent) // Connect the AliRoot file containing Geometry, Kine, and Hits - fRunLoader = AliRunLoader::Open(file,AliConfig::fgkDefaultEventFolderName, - "UPDATE"); + + TString evfoldname = AliConfig::fgkDefaultEventFolderName; + fRunLoader = AliRunLoader::GetRunLoader(evfoldname); + if (!fRunLoader) + fRunLoader = AliRunLoader::Open(file,AliConfig::fgkDefaultEventFolderName, + "UPDATE"); if (!fRunLoader) { @@ -433,7 +437,7 @@ Bool_t AliTRDdigitizer::Open(const Char_t *file, Int_t nEvent) return kFALSE; } - fRunLoader->LoadgAlice(); + if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice(); gAlice = fRunLoader->GetAliRun(); if (gAlice) { diff --git a/ZDC/AliZDC.cxx b/ZDC/AliZDC.cxx index d73b7738e81..25e0e055c71 100644 --- a/ZDC/AliZDC.cxx +++ b/ZDC/AliZDC.cxx @@ -260,7 +260,7 @@ Float_t AliZDC::ZMax(void) const else fMergedHits = new TClonesArray ("AliZDCMergedHit",1000); MakeBranchInTree(fLoader->TreeS(), branchname, &fMergedHits, fBufferSize, file) ; - printf("* AliZDC::MakeBranch * Making Branch %s for SDigits\n\n",branchname); + if (GetDebug()) printf("* AliZDC::MakeBranch * Making Branch %s for SDigits\n\n",branchname); } @@ -271,17 +271,17 @@ Float_t AliZDC::ZMax(void) const else fDigits = new TClonesArray ("AliZDCDigit",1000); MakeBranchInTree(fLoader->TreeD(), branchname, &fDigits, fBufferSize, file) ; - printf("* AliZDC::MakeBranch * Making Branch %s for Digits\n\n",branchname); + if (GetDebug()) printf("* AliZDC::MakeBranch * Making Branch %s for Digits\n\n",branchname); } const char *cR = strstr(opt,"R"); - if (gAlice->TreeR() && cR) { + if (fLoader->TreeR() && cR) { if(fRecPoints==0) fRecPoints = new TClonesArray("AliZDCReco",1000); - MakeBranchInTree(gAlice->TreeR(), + MakeBranchInTree(fLoader->TreeR(), branchname, &fRecPoints, fBufferSize, file) ; - printf("* AliZDC::MakeBranch * Making Branch %s for RecPoints\n\n",branchname); } + if (GetDebug()) printf("* AliZDC::MakeBranch * Making Branch %s for RecPoints\n\n",branchname); } } @@ -294,7 +294,7 @@ Float_t AliZDC::ZMax(void) const sprintf(branchname,"%s",GetName()); if (fMergedHits==0x0) fMergedHits = new TClonesArray("AliZDCMergedHit",1000); MakeBranchInTree(treeS, branchname, &fMergedHits, kBufferSize, file) ; - printf("* AliZDC::MakeBranch * Making Branch %s for SDigits\n\n",branchname); + if (GetDebug()) printf("* AliZDC::MakeBranch * Making Branch %s for SDigits\n\n",branchname); } //_____________________________________________________________________________ @@ -306,7 +306,7 @@ Float_t AliZDC::ZMax(void) const sprintf(branchname,"%s",GetName()); if (fDigits == 0x0) fDigits = new TClonesArray("AliZDCDigit",1000); MakeBranchInTree(treeD, branchname, &fDigits, kBufferSize, file) ; - printf("* AliZDC::MakeBranch * Making Branch %s for Digits\n\n",branchname); + if (GetDebug()) printf("* AliZDC::MakeBranch * Making Branch %s for Digits\n\n",branchname); } //_____________________________________________________________________________ @@ -317,13 +317,13 @@ Float_t AliZDC::ZMax(void) const char branchname[20]; sprintf(branchname,"%s",GetName()); MakeBranchInTree(treeR, branchname, &fRecPoints, kBufferSize, file) ; - printf("* AliZDC::MakeBranch * Making Branch %s for RecPoints\n\n",branchname); + if (GetDebug()) printf("* AliZDC::MakeBranch * Making Branch %s for RecPoints\n\n",branchname); } //_____________________________________________________________________________ void AliZDC::Hits2SDigits() { - printf("\n Entering AliZDC::SDigits2Digits() "); + if (GetDebug()) printf("\n Entering AliZDC::SDigits2Digits() "); fLoader->LoadHits("read"); fLoader->LoadSDigits("recreate"); @@ -336,7 +336,7 @@ void AliZDC::Hits2SDigits() //---------------------------------------------------------------- if(!fMerger){ - printf(" ZDC digitization (without merging)\n"); + if (GetDebug()) printf(" ZDC digitization (without merging)\n"); AliZDCMergedHit *mHit; Int_t j, sector[2]; @@ -376,7 +376,7 @@ void AliZDC::Hits2SDigits() } //---------------------------------------------------------------- else if(fMerger){ - printf(" ZDC merging and digitization\n"); + if (GetDebug()) printf(" ZDC merging and digitization\n"); // ### Initialise merging fMerger -> InitMerging(); @@ -397,7 +397,7 @@ void AliZDC::Hits2SDigits() } if(!treeS){ - printf("\n ERROR -> Can't find TreeS%d in background file\n",fMerger->EvNum()); + if (GetDebug()) printf("\n ERROR -> Can't find TreeS%d in background file\n",fMerger->EvNum()); } // ### Get TCA of MergedHits from AliZDCMerger @@ -434,18 +434,19 @@ void AliZDC::Hits2SDigits() void AliZDC::SDigits2Digits() { if(!fMerger){ // Only digitization - printf(" ZDC digitization (no merging) \n"); + if (GetDebug()) printf(" ZDC digitization (no merging) \n"); fMerger = new AliZDCMerger(); fMerger->Digitize(fNMergedhits, fMergedHits); char hname[30]; - sprintf(hname,"TreeD%d",gAlice->GetHeader()->GetEvent()); - gAlice->TreeD()->Fill(); - gAlice->TreeD()->AutoSave(); - gAlice->TreeD()->Reset(); + AliRunLoader * rl = fLoader->GetRunLoader(); + sprintf(hname,"TreeD%d",rl->GetHeader()->GetEvent()); + fLoader->TreeD()->Fill(); + fLoader->TreeD()->AutoSave(); + fLoader->TreeD()->Reset(); } else if(fMerger){ // Merging and digitization - printf(" ZDC merging and digitization\n"); + if (GetDebug()) printf(" ZDC merging and digitization\n"); fMerger->Digitize(fNMergedhits, fMergedHits); // Digits tree @@ -465,7 +466,7 @@ void AliZDC::SDigits2Digits() if(!treeD){ - printf("\n ERROR -> Can't find TreeD%d in background file\n",fMerger->EvNum()); + if (GetDebug()) printf("\n ERROR -> Can't find TreeD%d in background file\n",fMerger->EvNum()); } // Branch address char branchDname[20]; @@ -491,7 +492,7 @@ void AliZDC::Hits2Digits() //_____________________________________________________________________________ void AliZDC::Digits2Reco() { - printf(" Entering AliZDC::Digits2Reco\n"); + if (GetDebug()) printf(" Entering AliZDC::Digits2Reco\n"); AliDetector *zdcd = gAlice->GetDetector("ZDC"); TClonesArray *zdcdigits = zdcd->Digits(); @@ -536,7 +537,7 @@ void AliZDC::Digits2Reco() else if(dig->GetSector(0) == 3) zemraw += dig->GetADCValue(); } // Digits loop } // TreeD entries loop - printf("\n --- znraw = %d, zpraw = %d, zemraw = %d\n",znraw, zpraw, zemraw); + if (GetDebug()) printf("\n --- znraw = %d, zpraw = %d, zemraw = %d\n",znraw, zpraw, zemraw); // --- Pedestal subtraction Int_t zncorr, zpcorr, zemcorr, meanPed=50; @@ -546,7 +547,7 @@ void AliZDC::Digits2Reco() if(zncorr<0) zncorr=0; if(zpcorr<0) zpcorr=0; if(zemcorr<0) zemcorr=0; - printf("\n zncorr = %d, zpcorr = %d, zemcorr = %d\n",zncorr,zpcorr,zemcorr); + if (GetDebug()) printf("\n zncorr = %d, zpcorr = %d, zemcorr = %d\n",zncorr,zpcorr,zemcorr); // --- ADCchannel -> photoelectrons // NB-> PM gain = 10^(5), ADC resolution = 6.4*10^(-7) @@ -554,7 +555,7 @@ void AliZDC::Digits2Reco() znphe = zncorr/convFactor; zpphe = zpcorr/convFactor; zemphe = zemcorr/convFactor; - printf("\n znphe = %f, zpphe = %f, zemphe = %f\n",znphe, zpphe, zemphe); + if (GetDebug()) printf("\n znphe = %f, zpphe = %f, zemphe = %f\n",znphe, zpphe, zemphe); // --- Energy calibration // Conversion factors for hadronic ZDCs goes from phe yield to TRUE incident @@ -570,19 +571,19 @@ void AliZDC::Digits2Reco() zdcenergy = znenergy+zpenergy; zemenergy = -4.81+0.3238*zemphe; if(zemenergy<0) zemenergy=0; - printf(" znenergy = %f TeV, zpenergy = %f TeV, zdcenergy = %f GeV, " + if (GetDebug()) printf(" znenergy = %f TeV, zpenergy = %f TeV, zdcenergy = %f GeV, " "\n zemenergy = %f TeV\n", znenergy, zpenergy, zdcenergy, zemenergy); if(zdcenergy==0) - printf("\n\n ### ATTENZIONE!!! -> ev# %d: znenergy = %f TeV, zpenergy = %f TeV, zdcenergy = %f GeV, " + if (GetDebug()) printf("\n\n ### ATTENZIONE!!! -> ev# %d: znenergy = %f TeV, zpenergy = %f TeV, zdcenergy = %f GeV, " " zemenergy = %f TeV\n\n", fMerger->EvNum(), znenergy, zpenergy, zdcenergy, zemenergy); // --- Number of incident spectator nucleons Int_t nDetSpecN, nDetSpecP; nDetSpecN = (Int_t) (znenergy/2.760); nDetSpecP = (Int_t) (zpenergy/2.760); - printf("\n nDetSpecN = %d, nDetSpecP = %d\n",nDetSpecN, nDetSpecP); + if (GetDebug()) printf("\n nDetSpecN = %d, nDetSpecP = %d\n",nDetSpecN, nDetSpecP); // --- Number of generated spectator nucleons and impact parameter // -------------------------------------------------------------------------------------------------- @@ -700,7 +701,7 @@ void AliZDC::Digits2Reco() nPart = 207-nGenSpecN-nGenSpecP; nPartTot = 207-nGenSpec; //printf(" ### nPart(ZP+ZN) = %d, nPart(ZDC) = %d, b = %f fm\n",nPart,nPartTot,impPar); - printf(" ### nPart = %d, b = %f fm\n",nPartTot,impPar); + if (GetDebug()) printf(" ### nPart = %d, b = %f fm\n",nPartTot,impPar); // --- Writing RecPoints TCA // Allocate the RecPoints TCA @@ -713,7 +714,7 @@ void AliZDC::Digits2Reco() delete reco; // TreeR - TTree *treeR = gAlice->TreeR(); + TTree *treeR = fLoader->TreeR(); if(!treeR) printf("\n ERROR -> Can't find TreeR%d in background file\n",fMerger->EvNum()); // Branch address char branchRname[20]; -- 2.43.0