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;
Bool_t AliFMDDigitizer::Init()
{
// Initialization
- cout<<"AliFMDDigitizer::Init"<<endl;
+// cout<<"AliFMDDigitizer::Init"<<endl;
return kTRUE;
}
Error("Exec","Can not find Run Loader for input stream 0");
return;
}
- Info("Exec","inRL->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");
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;
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;
// 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("<AliPMDdigitizer::Open> ");
- printf("AliRun object found on file.\n");
- }
- else
- {
- printf("<AliPMDdigitizer::Open> ");
- printf("Could not find AliRun object.\n");
- }
-
+ if (fDebug) {
+ if (gAlice)
+ {
+ printf("<AliPMDdigitizer::Open> ");
+ printf("AliRun object found on file.\n");
+ }
+ else
+ {
+ printf("<AliPMDdigitizer::Open> ");
+ printf("Could not find AliRun object.\n");
+ }
+ }
+
fPMD = (AliPMD*)gAlice->GetDetector("PMD");
fPMDLoader = fRunLoader->GetLoader("PMDLoader");
if (fPMDLoader == 0x0)
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.
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)
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.
}
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)
// 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;iEventN<GetLoader()->GetRunLoader()->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;iPrimN<GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop
- GetLoader()->TreeH()->GetEntry(iPrimN);
+ richLoader->TreeH()->GetEntry(iPrimN);
for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){//hits loop
AliRICHhit *pHit=(AliRICHhit*)Hits()->At(iHitN);
TVector2 x2 = P()->ShiftToWirePos(C(pHit->C())->Glob2Loc(pHit->OutX3()));
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()
for(Int_t ipadX=0;ipadX<NpadsX();ipadX++)
for(Int_t ipadY=0;ipadY<NpadsY();ipadY++)
fSigmaThMap[iChamber][ipadX][ipadY] = SigmaThMean()+(1.-2*gRandom->Rndm())*SigmaThSpread();
- Info("GenSigmaThMap"," Threshold map generated for all RICH chambers");
+ // Info("GenSigmaThMap"," Threshold map generated for all RICH chambers");
}
//__________________________________________________________________________________________________
void AliRICHParam::Print()
// 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;k<nClusters[ich];k++) {
- AliRICHcluster *pCluster = (AliRICHcluster *)Rich()->Clusters(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;k<nClusters[ich];k++) {
+ AliRICHcluster *pCluster = (AliRICHcluster *)Rich()->Clusters(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;i<nPrimaries;i++){
-
- Rich()->GetLoader()->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;i<nPrimaries;i++){
+
+ richLoader->TreeH()->GetEntry(i);
+
+ // Rich()->Hits()->Print();
+ Int_t iPrim = 0;
+
+ AliRICHhit* pHit=0;
+
+ for(Int_t j=0;j<Rich()->Hits()->GetEntries();j++) {
- for(Int_t j=0;j<Rich()->Hits()->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;j<nClusters[pHit->Chamber()-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;j<nClusters[pHit->Chamber()-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()
//__________________________________________________________________________________________________
AliSTARTDigitizer::AliSTARTDigitizer(AliRunDigitizer* manager)
:AliDigitizer(manager)
{
- cout<<"AliSTARTDigitizer::AliSTARTDigitizer"<<endl;
+ // cout<<"AliSTARTDigitizer::AliSTARTDigitizer"<<endl;
// ctor which should be used
// fDebug =0;
// if (GetDebug()>2)
Bool_t AliSTARTDigitizer::Init()
{
// Initialization
- cout<<"AliSTARTDigitizer::Init"<<endl;
+// cout<<"AliSTARTDigitizer::Init"<<endl;
return kTRUE;
}
// Use the TOF SDigitizer to make TOF SDigits
//
- cout<<"AliTOF::Hits2SDigits> start...\n";
+// cout<<"AliTOF::Hits2SDigits> start...\n";
AliRunLoader * rl = fLoader->GetRunLoader();
AliTOFSDigitizer sd((rl->GetFileName()).Data());
- sd.Print("");
+ if (GetDebug()) sd.Print("");
sd.Exec("") ;
AliRunLoader * rl = fLoader->GetRunLoader();
AliTOFSDigitizer sd((rl->GetFileName()).Data(),evNumber1,evNumber2) ;
- sd.Print("");
+ if (GetDebug()) sd.Print("");
sd.Exec("") ;
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)
}
// 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;
Bool_t thereIsNotASelection=(fSelectedSector==-1) && (fSelectedPlate==-1);
- fRunLoader->LoadgAlice();
+ if (fRunLoader->GetAliRun() == 0x0) fRunLoader->LoadgAlice();
gAlice = fRunLoader->GetAliRun();
fRunLoader->LoadKinematics();
fTOFLoader->LoadSDigits("recreate");
for (Int_t iEvent=fEvent1; iEvent<fEvent2; iEvent++) {
- cout << "------------------- "<< GetName() << " ------------- \n";
- cout << "Sdigitizing event " << iEvent << endl;
+// cout << "------------------- "<< GetName() << " ------------- \n";
+// cout << "Sdigitizing event " << iEvent << endl;
fRunLoader->GetEvent(iEvent);
else branch = TreeH()->GetBranch("TPC");
Stat_t ntracks = TreeH()->GetEntries();
// loop over all hits
- cout<<"\nAliTPC::SetActiveSectors(): Got "<<ntracks<<" tracks\n";
+ if (GetDebug()) cout<<"\nAliTPC::SetActiveSectors(): Got "<<ntracks<<" tracks\n";
for(Int_t track=0;track<ntracks;track++)
{
} // end of loop over sectors
- cerr<<"Number of made clusters : "<<nclusters<<" \n";
+ // cerr<<"Number of made clusters : "<<nclusters<<" \n";
fLoader->WriteRecPoints("OVERWRITE");
// setting the defaults
//
- cerr<<"Setting default parameters...\n";
+ // cerr<<"Setting default parameters...\n";
// Set response functions
fDigitsSwitch=0; // standard digits
- cerr<<"Digitizing TPC -- normal digits...\n";
+ // cerr<<"Digitizing TPC -- normal digits...\n";
for(Int_t isec=0;isec<fTPCParam->GetNSector();isec++)
if (IsSectorActive(isec))
SetDigitsArray(arr);
- cerr<<"Digitizing TPC -- summable digits...\n";
+ // cerr<<"Digitizing TPC -- summable digits...\n";
fDigitsSwitch=1; // summable digits
// 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)
{
return kFALSE;
}
- fRunLoader->LoadgAlice();
+ if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice();
gAlice = fRunLoader->GetAliRun();
if (gAlice) {
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);
}
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); }
}
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);
}
//_____________________________________________________________________________
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);
}
//_____________________________________________________________________________
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");
//----------------------------------------------------------------
if(!fMerger){
- printf(" ZDC digitization (without merging)\n");
+ if (GetDebug()) printf(" ZDC digitization (without merging)\n");
AliZDCMergedHit *mHit;
Int_t j, sector[2];
}
//----------------------------------------------------------------
else if(fMerger){
- printf(" ZDC merging and digitization\n");
+ if (GetDebug()) printf(" ZDC merging and digitization\n");
// ### Initialise merging
fMerger -> InitMerging();
}
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
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
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];
//_____________________________________________________________________________
void AliZDC::Digits2Reco()
{
- printf(" Entering AliZDC::Digits2Reco\n");
+ if (GetDebug()) printf(" Entering AliZDC::Digits2Reco\n");
AliDetector *zdcd = gAlice->GetDetector("ZDC");
TClonesArray *zdcdigits = zdcd->Digits();
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;
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)
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
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
// --------------------------------------------------------------------------------------------------
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
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];