-Int_t AliTOFSDigits2Digits(Int_t nev=5) {
+Int_t AliTOFSDigits2Digits(Int_t nev = 1) {
// Adapted to the NewIO by I.Belikov (Jouri.Belikov@cern.ch)
-
// number 3 is a legacy from AliDigit object
- if (gAlice) {
+ Int_t rc = 0;
+
+ if (gAlice)
+ {
delete gAlice->GetRunLoader();
- delete gAlice;//if everything was OK here it is already NULL
+ delete gAlice;
gAlice = 0x0;
- }
-
- AliRunLoader* rl = AliRunLoader::Open("galice.root");
- if (rl == 0x0) {
+ }
+
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ if (rl == 0x0)
+ {
cerr<<"Can not open session"<<endl;
- return 1;
- }
-
- if (rl->LoadgAlice()) {
+ rc = 1;
+ return rc;
+ }
+
+ if (rl->LoadgAlice())
+ {
cerr<<"Error occured while loading gAlice"<<endl;
- return 1;
- }
-
- AliLoader *tofl = rl->GetLoader("TOFLoader");
- if (tofl == 0x0) {
- cerr<<"Can not get the TOF Loader"<<endl;
- return 1;
- }
-
+ rc = 2;
+ return rc;
+ }
+
+ AliLoader *tofl = rl->GetLoader("TOFLoader");
+ if (tofl == 0x0)
+ {
+ cerr<<"Can not get the TOF Loader"<<endl;
+ rc = 3;
+ return rc;
+ }
+
gAlice=rl->GetAliRun();
- if (!gAlice) {
- cerr<<"Can't get gAlice !\n";
- return 1;
- }
-
+ if (!gAlice)
+ {
+ cerr<<"Can't get gAlice !\n";
+ rc = 4;
+ return rc;
+ }
+
tofl->LoadSDigits("read");
tofl->LoadDigits("recreate");
-
+
Int_t totndig=0; // total number of digits
Int_t tottracks=0; // total number of tracks contributing to totndig
-
+
if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
TClonesArray *fSDigits=new TClonesArray("AliTOFSDigit", 1000);
for (Int_t ievent = 0; ievent < nev; ievent++) {
rl->GetEvent(ievent);
-
+
TTree *sTree=tofl->TreeS();
- if (sTree == 0) {
- cerr<<"Can't get the sdigit tree !\n";
- return 1;
- }
+ if (sTree == 0)
+ {
+ cerr<<"Can't get the sdigit tree !\n";
+ rc = 5;
+ return rc;
+ }
TBranch *branch=sTree->GetBranch("TOF");
- if (!branch) {
- cerr<<"Cant' get the branch !\n";
- return 1;
- }
+ if (!branch)
+ {
+ cerr<<"Cant' get the branch !\n";
+ rc = 6;
+ return rc;
+ }
branch->SetAddress(&fSDigits);
TTree *dTree=tofl->TreeD();
padz<1 || padz>2 ||
padx<1 || padx>48);
- if (isSDigitBad) {
- cout << "<AliTOFSDigits2Digits> strange sdigit found" << endl;
- return 3;
- }
+ if (isSDigitBad)
+ {
+ cout << "<AliTOFSDigits2Digits> strange sdigit found" << endl;
+ rc = 7;
+ return rc;
+ }
//-------------------------------------------------------
// start loop on number of slots for current sdigit
// adding a TOF digit for each slot
{
Int_t ndigits=da.GetEntriesFast();
- //cerr<<ndigits<<" ndig \n";
new (da[ndigits]) AliTOFdigit(tracknum, vol, digit);
}
totndig++;
delete fSDigits;
delete fDigits;
-
+
+ tofl->UnloadDigits();
+ tofl->UnloadSDigits();
+ rl->UnloadHeader();
+ rl->UnloadgAlice();
+
cout << "----------------------------------------------------------" << endl;
cout << "<AliTOFSDigits2Digits> Summary" << endl;
cout << "contributing tracks to " << totndig << " digits: " << tottracks << endl;
cout << "----------------------------------------------------------" << endl;
- return 0;
-
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
+
+ return rc;
}
-Int_t AliTOFanalyzeDigits(TString headersFile, Int_t ndump=15, Int_t iEvNum=0)
+Int_t AliTOFanalyzeDigits(Int_t ndump=15, Int_t iEvNum=0)
{
//
// Analyzes the TOF digits and fills QA-histograms
// report problems to pierella@bo.infn.it
// iEvNum=0 means all events in the file
// Author: F. Pierella (Bologna University)
+ // Updated to the new I/O by: A. De Caro, C. Zampolli
- // Dynamically link some shared libs
- if (gClassTable->GetID("AliRun") < 0) {
- gROOT->LoadMacro("loadlibs.C");
- loadlibs();
- } else {
- delete gAlice;
- gAlice = 0;
- }
-
- Int_t rc=0;
-
+ Int_t rc = 0;
- TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(headersFile.Data());
- if(file){
- cout<<"headerFile already open \n";
- }
- else {
- if(!file)file=TFile::Open(headersFile.Data());
- }
-
- // Get AliRun object from file
- if (!gAlice) {
- gAlice = (AliRun*)file->Get("gAlice");
- if (gAlice) printf("AliRun object found on file\n");
- }
-
-
- if (iEvNum == 0) iEvNum = (Int_t) gAlice->TreeE()->GetEntries();
-
-
- AliTOFdigit *tofdigit;
-
- AliTOF * tof = (AliTOF *) gAlice->GetDetector("TOF") ;
-
- if (!tof) {
- cout << "<AliTOFanalyzeDigits> No TOF detector found" << endl;
- rc = 2;
- return rc;
- }
-
// adc and tdc
TH1F *htdc = new TH1F("htdc","TDC [bin]",500,0.,15000.);
TH1F *hadc = new TH1F("hadc","ADC [bin]",100,0., 3000.);
-
// TOF digit volumes
TH1F *hsector = new TH1F("hsector","Sector",20,0.,20.);
TH1F *hplate = new TH1F("hplate","Plate ", 6,0., 6.);
// ADC-TDC correlation
TH2F *h2tdcVSadc = new TH2F("h2tdcVSadc","TDC [bin] VS ADC [bin]",100,0.,3000.,500,0.,15000.);
- cout << "First " << ndump << " Digits found in TOF TreeD branch have:" << endl;
+ // Dynamically link some shared libs
+ if (gClassTable->GetID("AliRun") < 0) {
+ gROOT->LoadMacro("loadlibs.C");
+ loadlibs();
+ }
- for (Int_t ievent = 0; ievent < iEvNum; ievent++) {
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
+
+ AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::fgkDefaultEventFolderName,"read");
+ if (!rl)
+ {
+ cerr<<"Can't load RunLoader from file"<<"!\n";
+ rc = 1;
+ return rc;
+ }
+
+ rl->LoadgAlice();
+ gAlice = rl->GetAliRun();
+
+ if (!gAlice)
+ {
+ cerr << "<AliTOFanalyzeDigits> AliRun object not found on file\n ";
+ rc = 2;
+ return rc;
+ }
- gAlice->GetEvent(ievent) ;
- if(gAlice->TreeD()==0) {
- cout << "<AliTOFanalyzeDigits> No TreeD found" << endl;
- rc = 4;
+ AliLoader* tofl = rl->GetLoader("TOFLoader");
+ AliTOF* tof = (AliTOF*) rl->GetAliRun()->GetDetector("TOF");
+
+ if (tof==0x0 || tofl==0x0)
+ {
+ cerr << "<AliTOFanalyzeDigits> No TOF detector found" << endl;
+ rc = 3;
return rc;
}
+
+ cout << "First " << ndump << " Digits found in TOF TreeD branch have:" << endl;
+
+ if (iEvNum == 0)
+ {
+ rl->LoadHeader();
+ TTree *TE = rl->TreeE();
+ iEvNum = (Int_t)TE->GetEntries();
+ }
+
+ AliTOFdigit *tofdigit;
+
+ for (Int_t ievent = 0; ievent < iEvNum; ievent++) {
+ printf ("Processing event %d \n", ievent);
+ rl->GetEvent(ievent);
-
-
- Int_t ndig, k;
- gAlice->ResetDigits();
- gAlice->TreeD()->GetEvent(ievent);
- TClonesArray * TOFdigits = tof->Digits();
-
- ndig=TOFdigits->GetEntries();
-
- cout << "<AliTOFanalyzeDigits> found " << ndig
- << " TOF digits for event " << ievent << endl;
-
- for (k=0; k<ndig; k++) {
- tofdigit= (AliTOFdigit*) TOFdigits->UncheckedAt(k);
- Float_t tdc=tofdigit->GetTdc();
- Float_t adc=tofdigit->GetAdc();
- htdc->Fill(tdc);
- hadc->Fill(adc);
- // TOF digit volumes
- Int_t sector = tofdigit->GetSector(); // range [1-18]
- Int_t plate = tofdigit->GetPlate(); // range [1- 5]
- Int_t strip = tofdigit->GetStrip(); // range [1-20]
- Int_t padz = tofdigit->GetPadz(); // range [1- 2]
- Int_t padx = tofdigit->GetPadx(); // range [1-48]
- // it is QA, then I perform QA!
- Bool_t isDigitBad = (sector<1 || sector>18 || plate<1 || plate >5 || padz<1 || padz>2 || padx<1 || padx>48);
-
- if (isDigitBad) {
- cout << "<AliTOFanalyzeDigits> strange digit found" << endl;
+ // Get the pointer Digit tree
+ tofl->LoadDigits();
+ TTree *TD=tofl->TreeD();
+ tof->SetTreeAddress();
+
+ if(!TD)
+ {
+ cout << "<AliTOFanalyzeDigits> No TreeD found" << endl;
rc = 3;
return rc;
}
-
- if(k<ndump){
- cout << k << "-th | " << "Sector " << sector << " | Plate " << plate << " | Strip " << strip << " | PadZ " << padz << " | PadX " << padx << endl;
- cout << k << "-th | ADC " << adc << " [bin] | TDC " << tdc << " [bin]" << endl;
- cout << "----------------------------------------------------"<< endl;
- }
-
- // filling digit volume histos
- hsector->Fill(sector);
- hplate->Fill(plate);
- hstrip->Fill(strip);
- hpadx->Fill(padx);
- hpadz->Fill(padz);
- h2tdcVSadc->Fill(adc,tdc);
- }
+ TClonesArray * TOFdigits = new TClonesArray("AliTOFdigit",1000);
+ TOFdigits = tof->Digits();
+ TOFdigits = TD->GetBranch("TOF")->SetAddress(&TOFdigits);
+
+ Int_t nEntries = TD->GetEntries();
+
+ for (Int_t iEntry = 0; iEntry < nEntries; iEntry ++)
+ {
+ tof->ResetDigits();
+ TD->GetEvent(iEntry);
+ Int_t ndig = TOFdigits->GetEntriesFast();
+ cout << "<AliTOFanalyzeDigits> found " << ndig
+ << " TOF digits for event " << ievent << endl;
+
+ for (Int_t k=0; k<ndig; k++) {
+ tofdigit = (AliTOFdigit*) TOFdigits->UncheckedAt(k);
+ Float_t tdc = tofdigit->GetTdc();
+ Float_t adc = tofdigit->GetAdc();
+ htdc->Fill(tdc);
+ hadc->Fill(adc);
+ // TOF digit volumes
+ Int_t sector = tofdigit->GetSector(); // range [1-18]
+ Int_t plate = tofdigit->GetPlate(); // range [1- 5]
+ Int_t strip = tofdigit->GetStrip(); // range [1-20]
+ Int_t padz = tofdigit->GetPadz(); // range [1- 2]
+ Int_t padx = tofdigit->GetPadx(); // range [1-48]
+ // it is QA, then I perform QA!
+ Bool_t isDigitBad = (sector<1 || sector>18 || plate<1 || plate >5 || padz<1 || padz>2 || padx<1 || padx>48);
+
+ if (isDigitBad)
+ {
+ cout << "<AliTOFanalyzeDigits> strange digit found" << endl;
+ rc = 4;
+ return rc;
+ }
+
+ if(k<ndump){
+ cout << k << "-th | " << "Sector " << sector << " | Plate " << plate << " | Strip " << strip << " | PadZ " << padz << " | PadX " << padx << endl;
+ cout << k << "-th | ADC " << adc << " [bin] | TDC " << tdc << " [bin]" << endl;
+ cout << "----------------------------------------------------"<< endl;
+ }
+
+ // filling digit volume histos
+ hsector->Fill(sector);
+ hplate->Fill(plate);
+ hstrip->Fill(strip);
+ hpadx->Fill(padx);
+ hpadz->Fill(padz);
+ h2tdcVSadc->Fill(adc,tdc);
+
+ }
+ }
+
+ tofl->UnloadDigits();
+ rl->UnloadHeader();
+ rl->UnloadgAlice();
} // end loop on events
-
+
TFile *fout = new TFile("TOF_digitsQA.root","RECREATE");
htdc->Write();
hadc->Write();
hpadx->Write();
fout->Close();
+ delete htdc;
+ delete hadc;
+ delete h2tdcVSadc;
+ delete hsector;
+ delete hplate;
+ delete hstrip;
+ delete hpadz;
+ delete hpadx;
+
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
return rc;
-Int_t AliTOFanalyzeHits()
+Int_t AliTOFanalyzeHits(Int_t nevents = 1, Bool_t drawing = kFALSE)
{
//
// Analyzes the hits and fills QA-histograms
+ // Use case:
+ // start aliroot
+ // root [0] .L AliTOFanalyzeHits.C
+ // root [1] AliTOFanalyzeHits()
//
+ // Updated to the new I/O by: A. De Caro, C. Zampolli
Int_t rc = 0;
-
- if (!gAlice) {
- cout << "<AliTOFanalyzeHits> No AliRun object found" << endl;
- rc = 1;
- return rc;
- }
- gAlice->GetEvent(0);
-
- // Get the pointer to the TOF detector
- AliTOF *tof = (AliTOF *) gAlice->GetDetector("TOF");
- if (!tof) {
- cout << "<AliTOFanalyzeHits> No TOF detector found" << endl;
- rc = 2;
- return rc;
- }
-
+
// Define the histograms
// x,y,z, rho, tof, padx, padz, sector, plate, strip, (x vs y)
// track length when striking the TOF (used by AliTOFT0)
TH1F *htrackLenp= new TH1F("htrackLenp","Track Length on TOF for Primaries",800,0.,800.);
- // Get the pointer hit tree
- TTree *hitTree = gAlice->TreeH();
- if (!hitTree) {
- cout << "<AliTOFanalyzeHits> No hit tree found" << endl;
- rc = 4;
+ // Histograms added to control the right TOF element numbering:
+ // it should be increasing with the azimuthal and polar angles
+
+ TH2F *hmoduleVStheta = new TH2F("hmoduleVStheta", "hmoduleVStheta", 180,0.,180.,6,0,6);
+ TH2F *hsectorVSphi = new TH2F("hsectorVSphi", "hsectorVSphi", 360,0.,360.,19,0,19);
+ TH2F *hstripVStheta = new TH2F("hstripVStheta", "hstripVStheta", 180,0.,180.,25,0,25);
+ TH2F *hpadzVStheta = new TH2F("hpadzVStheta", "hpadzVStheta", 180,0.,180.,3,0,3);
+ TH2F *hpadxVSphi = new TH2F("hpadxVSphi", "hpadxVSphi", 360,0.,360.,49,0,49);
+
+ // Dynamically link some shared libs
+ if (gClassTable->GetID("AliRun") < 0) {
+ gROOT->LoadMacro("loadlibs.C");
+ loadlibs();
+ }
+
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
+
+ AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::fgkDefaultEventFolderName,"read");
+ if (!rl)
+ {
+ cerr<<"Can't load RunLoader from file"<<"!\n";
+ rc = 1;
+ return rc;
+ }
+
+ rl->LoadgAlice();
+ gAlice = rl->GetAliRun();
+
+ if (!gAlice)
+ {
+ cerr << "<AliTOFanalyzeHits> AliRun object not found on file\n ";
+ rc = 2;
+ return rc;
+ }
+
+ // Get the pointer to the TOF detector
+ AliTOF *tof = (AliTOF *) gAlice->GetDetector("TOF");
+ AliLoader *tofl = rl->GetLoader("TOFLoader");
+ if (tof == 0x0 || tofl == 0x0) {
+ cerr << "<AliTOFanalyzeHits> Can not find TOF or TOFLoader\n";
+ rc = 3;
return rc;
}
Int_t countHits = 0;
- Int_t nBytes = 0;
-
- // Get the number of entries in the hit tree
- // (Number of primary particles creating a hit somewhere)
- Int_t nTrack = (Int_t) hitTree->GetEntries();
- cout << "<AliTOFanalyzeHits> Found " << nTrack
- << " primary particles with hits" << endl;
-
- Int_t nPrimaryOnTof = 0;
- Int_t nSecondaryOnTof = 0;
- Int_t nelectron = 0;
- Int_t npion = 0;
- Int_t nkaon = 0;
- Int_t nproton = 0;
- Int_t nmuon = 0;
+
+ rl->LoadHeader();
+
+ for (Int_t ievent=0; ievent<nevents; ievent++) {
+ printf ("Processing event %d \n", ievent);
+ rl->GetEvent(ievent);
+
+ // Get the pointer Hit tree
+ tofl->LoadHits();
+ TTree *hitTree = tofl->TreeH();
+ tof->SetTreeAddress();
+ if (!hitTree) {
+ cout << "<AliTOFanalyzeHits> No TreeH found" << endl;
+ rc = 4;
+ return rc;
+ }
+
+ rl->LoadKinematics();
+ //AliStack* stack = rl->Stack(); // it is not necessary to use the stack!
+
+ // Get the number of entries in the hit tree
+ // (Number of primary particles creating a hit somewhere)
+ Int_t nTrack = (Int_t) hitTree->GetEntries();
+ cout << "<AliTOFanalyzeHits> Found " << nTrack
+ << " primary particles with hits" << endl;
+
+ Int_t nPrimaryOnTof = 0;
+ Int_t nSecondaryOnTof = 0;
+ Int_t nelectron = 0;
+ Int_t npion = 0;
+ Int_t nkaon = 0;
+ Int_t nproton = 0;
+ Int_t nmuon = 0;
- // Loop through all entries in the tree
- for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
-
- gAlice->ResetHits();
- nBytes += hitTree->GetEvent(iTrack);
-
-
- // Loop through the TOF hits
- Int_t iHit = 0;
- AliTOFhitT0 *hit = (AliTOFhitT0 *) tof->FirstHit(-1);
- while (hit) {
-
- countHits++;
- iHit++;
-
- Float_t x = hit->X();
- Float_t y = hit->Y();
- Float_t z = hit->Z();
- Float_t circleLen=TMath::Sqrt(x*x+y*y)*TMath::ATan2(y,x);
- h2hitMap->Fill(circleLen,z);
-
- Float_t flightTime = hit->GetTof(); // [s]
- flightTime*=1.e+09; // convert in [ns]
- Float_t angle = hit->GetIncA();
- Float_t tofmom= hit->GetMom(); // [GeV/c]
- Float_t trackLen= hit->GetLen(); // [cm]
-
- // TOF hit volumes
- Int_t sector = hit->GetSector(); // range [1-18]
- Int_t plate = hit->GetPlate(); // range [1- 5]
- Int_t strip = hit->GetStrip(); // range [1-20]
- Int_t padz = hit->GetPadz(); // range [1- 2]
- Int_t padx = hit->GetPadx(); // range [1-48]
- // it is QA, then I perform QA!
- Bool_t isHitBad = (sector<1 || sector>18 || plate<1 || plate >5 || padz<1 || padz>2 || padx<1 || padx>48);
-
- if (isHitBad) {
- cout << "<AliTOFanalyzeHits> strange hit found" << endl;
- rc = 3;
- return rc;
- }
- // filling hit volume histos
- hsector->Fill(sector);
- hplate->Fill(plate);
- hstrip->Fill(strip);
- hpadx->Fill(padx);
- hpadz->Fill(padz);
-
-
- Int_t track = hit->Track();
- TParticle *part = gAlice->Particle(track);
-
- // getting MC info for the current track
- if (part->GetFirstMother()<0){
- Int_t icod = TMath::Abs(part->GetPdgCode());
- switch (icod) {
- case 211:
- npion++;
- break ;
- case 321:
- nkaon++;
- break ;
- case 2212:
- nproton++;
- break ;
- case 11:
- nelectron++;
- break ;
- case 13:
- nmuon++;
- break ;
- }
- htofp->Fill(flightTime);
- htofmomp->Fill(tofmom);
- htrackLenp->Fill(trackLen);
- } else {
- htofs->Fill(flightTime);
- htofmoms->Fill(tofmom);
- }
+ // Loop through all entries in the tree
+ for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
+
+ tof->ResetHits();
+ hitTree->GetEvent(iTrack);
+
+ // Loop through the TOF hits
+ AliTOFhitT0 *hit = (AliTOFhitT0 *) tof->FirstHit(-1);
+ while (hit) {
+
+ countHits++;
+
+ Float_t x = hit->X();
+ Float_t y = hit->Y();
+ Float_t z = hit->Z();
+ Float_t phiAngle=TMath::Pi() + TMath::ATan2(-y,-x);
+ Float_t rhoRadius=TMath::Sqrt(x*x+y*y);
+ Float_t thetaAngle=TMath::Pi() + TMath::ATan2(-rhoRadius,-z);
+ Float_t dummy=rhoRadius*phiAngle;
+ h2hitMap->Fill(dummy,z);
+
+ phiAngle*=180./TMath::Pi();
+ thetaAngle*=180./TMath::Pi();
+
+ Float_t flightTime = hit->GetTof(); // [s]
+ flightTime *= 1.e+09; // convert in [ns]
+ Float_t angle = hit->GetIncA();
+ Float_t tofmom = hit->GetMom(); // [GeV/c]
+ Float_t trackLen = hit->GetLen(); // [cm]
+
+ // TOF hit volumes
+ Int_t sector = hit->GetSector(); // range [1-18]
+ Int_t plate = hit->GetPlate(); // range [1- 5]
+ Int_t strip = hit->GetStrip(); // range [1-20]
+ Int_t padz = hit->GetPadz(); // range [1- 2]
+ Int_t padx = hit->GetPadx(); // range [1-48]
+ // it is QA, then I perform QA!
+ Bool_t isHitBad = (sector<1 || sector>18 || plate<1 || plate >5 || padz<1 || padz>2 || padx<1 || padx>48);
+
+ if (isHitBad) {
+ cout << "<AliTOFanalyzeHits> strange hit found" << endl;
+ rc = 5;
+ return rc;
+ }
+
+ hmoduleVStheta->Fill(thetaAngle,plate);
+ hstripVStheta->Fill(thetaAngle,strip);
+ hsectorVSphi->Fill(phiAngle,sector);
+ hpadxVSphi->Fill(phiAngle,padx);
+ hpadzVStheta->Fill(thetaAngle,padz);
+
+ // filling hit volume histos
+ hsector->Fill(sector);
+ hplate->Fill(plate);
+ hstrip->Fill(strip);
+ hpadx->Fill(padx);
+ hpadz->Fill(padz);
+
+ Int_t track = hit->Track();
+ TParticle *part = gAlice->Particle(track);
+
+ // getting MC info for the current track
+ if (part->GetFirstMother()<0){
+ Int_t icod = TMath::Abs(part->GetPdgCode());
+ switch (icod) {
+ case 211:
+ npion++;
+ break ;
+ case 321:
+ nkaon++;
+ break ;
+ case 2212:
+ nproton++;
+ break ;
+ case 11:
+ nelectron++;
+ break ;
+ case 13:
+ nmuon++;
+ break ;
+ }
+ htofp->Fill(flightTime);
+ htofmomp->Fill(tofmom);
+ htrackLenp->Fill(trackLen);
+ } else {
+ htofs->Fill(flightTime);
+ htofmoms->Fill(tofmom);
+ }
+
+ // go to next hit
+ hit = (AliTOFhitT0 *) tof->NextHit();
- // go to next hit
- hit = (AliTOFhitT0 *) tof->NextHit();
+ }
}
- }
+ tofl->UnloadHits();
+ rl->UnloadKinematics();
- cout << "<AliTOFanalyzeHits> Found " << countHits << " hits in total" << endl;
- cout << npion << " primary pions reached the TOF detector" << endl;
- cout << nkaon << " primary kaons reached the TOF detector" << endl;
- cout << nproton << " primary protons reached the TOF detector" << endl;
- cout << nelectron << " primary electrons reached the TOF detector" << endl;
- cout << nmuon << " primary muons reached the TOF detector" << endl;
+ cout << "<AliTOFanalyzeHits> Found " << countHits << " hits in total" << endl;
+ cout << npion << " primary pions reached the TOF detector" << endl;
+ cout << nkaon << " primary kaons reached the TOF detector" << endl;
+ cout << nproton << " primary protons reached the TOF detector" << endl;
+ cout << nelectron << " primary electrons reached the TOF detector" << endl;
+ cout << nmuon << " primary muons reached the TOF detector" << endl;
-
- TCanvas *cHits = new TCanvas("cHits","AliTOFanalyzeHits hit volumes",50,50,900,900);
- cHits->Divide(3,2);
- cHits->cd(1);
- hsector->Draw();
- cHits->cd(2);
- hplate->Draw();
- cHits->cd(3);
- hstrip->Draw();
- cHits->cd(4);
- hpadz->Draw();
- cHits->cd(5);
- hpadx->Draw();
-
- TCanvas *chitmap = new TCanvas("chitmap","AliTOFanalyzeHits Hit Map",50,50,400,400);
- chitmap->cd();
- h2hitMap->Draw();
-
- TCanvas *ctrackLen = new TCanvas("ctrackLen","AliTOFanalyzeHits Track Length for primaries on TOF",50,50,400,400);
- ctrackLen->cd();
- htrackLenp->Draw();
-
- TCanvas *ctofmom = new TCanvas("ctofmom","AliTOFanalyzeHits flight times",50,50,700,700);
- ctofmom->Divide(2,2);
- ctofmom->cd(1);
- gPad->SetLogy();
- htofp->Draw();
- ctofmom->cd(2);
- gPad->SetLogy();
- htofs->Draw();
- ctofmom->cd(3);
- gPad->SetLogy();
- htofmomp->Draw();
- ctofmom->cd(4);
- gPad->SetLogy();
- htofmoms->Draw();
-
+ }
+ rl->UnloadHeader();
+ rl->UnloadgAlice();
+
+ if (drawing) {
+ TCanvas *cHits = new TCanvas("cHits","AliTOFanalyzeHits hit volumes",50,50,900,900);
+ cHits->Divide(3,2);
+ cHits->cd(1);
+ hsector->Draw();
+ cHits->cd(2);
+ hplate->Draw();
+ cHits->cd(3);
+ hstrip->Draw();
+ cHits->cd(4);
+ hpadz->Draw();
+ cHits->cd(5);
+ hpadx->Draw();
+
+ TCanvas *chitmap = new TCanvas("chitmap","AliTOFanalyzeHits Hit Map",50,50,600,600);
+ chitmap->cd();
+ h2hitMap->Draw();
+
+ TCanvas *ctrackLen = new TCanvas("ctrackLen","AliTOFanalyzeHits Track Length for primaries on TOF",50,50,400,400);
+ ctrackLen->cd();
+ htrackLenp->Draw();
+
+ TCanvas *ctofmom = new TCanvas("ctofmom","AliTOFanalyzeHits flight times",50,50,700,700);
+ ctofmom->Divide(2,2);
+ ctofmom->cd(1);
+ gPad->SetLogy();
+ htofp->Draw();
+ ctofmom->cd(2);
+ gPad->SetLogy();
+ htofs->Draw();
+ ctofmom->cd(3);
+ gPad->SetLogy();
+ htofmomp->Draw();
+ ctofmom->cd(4);
+ gPad->SetLogy();
+ htofmoms->Draw();
+ }
+
// save histos into file TOF_hitsQA.root
TFile *fout = new TFile("TOF_hitsQA.root","RECREATE");
h2hitMap->Write();
hpadz->Write();
hpadx->Write();
htrackLenp->Write();
+
+ hmoduleVStheta->Write();
+ hsectorVSphi->Write();
+ hstripVStheta->Write();
+ hpadzVStheta->Write();
+ hpadxVSphi->Write();
+
fout->Close();
+ cout << " Finished AliTOFanalizeHits \n";
+
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
+
return rc;
}
-
-Int_t AliTOFanalyzeSDigitsV2(TString headersFile, Int_t ndump=15, Int_t iEvNum=0)
+Int_t AliTOFanalyzeSDigitsV2(Int_t ndump=15, Int_t iEvNum=0)
{
- // V2: to be used with transient fSDigits data member
//
// Analyzes the TOF sdigits and fills QA-histograms
// report problems to pierella@bo.infn.it
// iEvNum=0 means all events in the file
+ //
+ // Updated to the new I/O by: A. De Caro, C. Zampolli
- // Dynamically link some shared libs
- if (gClassTable->GetID("AliRun") < 0) {
- gROOT->LoadMacro("loadlibs.C");
- loadlibs();
- } else {
- delete gAlice;
- gAlice = 0;
- }
-
- Int_t rc=0;
-
-
- TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(headersFile.Data());
- if(file){
- cout<<"headerFile already open \n";
- }
- else {
- if(!file)file=TFile::Open(headersFile.Data());
- }
-
- // Get AliRun object from file
- if (!gAlice) {
- gAlice = (AliRun*)file->Get("gAlice");
- if (gAlice) printf("AliRun object found on file\n");
- }
-
-
- if (iEvNum == 0) iEvNum = (Int_t) gAlice->TreeE()->GetEntries();
-
- AliTOF * tof = (AliTOF *) gAlice->GetDetector("TOF") ;
-
- if (!tof) {
- cout << "<AliTOFanalyzeSDigitsV2> No TOF detector found" << endl;
- rc = 2;
- return rc;
- }
+ Int_t rc = 0;
// adc and tdc
- TH1F *htdc = new TH1F("htdc","TDC [bin]",500,0.,15000.);
+ TH1F *htdc = new TH1F("htdc","TDC [bin]",5000,0.,150000.);
TH1F *hadc = new TH1F("hadc","ADC [bin]",100,0., 3000.);
-
- // number of slot for each sdigits
- TH1F *hndigits = new TH1F("hndigits","fNDigits",5,0.,5.);
-
// TOF sdigit volumes
TH1F *hsector = new TH1F("hsector","Sector",20,0.,20.);
TH1F *hplate = new TH1F("hplate","Plate ", 6,0., 6.);
TH1F *hpadz = new TH1F("hpadz","Pad along z ",3,0.,3.);
TH1F *hpadx = new TH1F("hpadx","Pad along x",50,0.,50.);
// ADC-TDC correlation
- TH2F *h2tdcVSadc = new TH2F("h2tdcVSadc","TDC [bin] VS ADC [bin]",100,0.,3000.,500,0.,15000.);
+ TH2F *h2tdcVSadc = new TH2F("h2tdcVSadc","TDC [bin] VS ADC [bin]",500,0.,150000.,100,0.,3000.);
+
+ // Dynamically link some shared libs
+ if (gClassTable->GetID("AliRun") < 0) {
+ gROOT->LoadMacro("loadlibs.C");
+ loadlibs();
+ }
+
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
+
+ AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::fgkDefaultEventFolderName,"read");
+ if (!rl)
+ {
+ cerr<<"Can't load RunLoader from file"<<"!\n";
+ rc = 1;
+ return rc;
+ }
+
+ rl->LoadgAlice();
+ gAlice = rl->GetAliRun();
+
+ if (!gAlice)
+ {
+ cerr << "<AliTOFanalyzeSDigits> AliRun object not found on file\n ";
+ rc = 2;
+ return rc;
+ }
+ AliLoader *tofl = rl->GetLoader("TOFLoader");
+ AliTOF *tof = (AliTOF *) rl->GetAliRun()->GetDetector("TOF");
+
+ if (tof==0x0 || tofl==0x0)
+ {
+ cerr << "<AliTOFanalyzeSDigits> no TOF detector found" << endl;
+ rc = 3;
+ return rc;
+ }
+
cout << "First " << ndump << " SDigits found in TOF TreeS branch have:" << endl;
+ if (iEvNum == 0)
+ {
+ rl->LoadHeader();
+ TTree *TE = rl->TreeE();
+ iEvNum = (Int_t)TE->GetEntries();
+ }
+ AliTOFSDigit *tofsdigit;
+
for (Int_t ievent = 0; ievent < iEvNum; ievent++) {
+ printf ("Processing event %d \n", ievent);
+ rl->GetEvent(ievent);
- char tname[100]; sprintf(tname,"TreeS%d",ievent);
+ // Get the pointer SDigit tree
+ tofl->LoadSDigits();
+ TTree *TS=tofl->TreeS();
+ tof->SetTreeAddress();
- TTree *sdigitstree=(TTree*)file->Get(tname);
+ if(!TS)
+ {
+ cout << "<AliTOFanalyzeSDigits> No TreeS found" << endl;
+ rc = 4;
+ return rc;
+ }
- TClonesArray * fSDigits= new TClonesArray("AliTOFSDigit", 1000);
- sdigitstree->GetBranch("TOF")->SetAddress(&fSDigits);
-
- Int_t nEntries = sdigitstree->GetEntries();
- //cout << nEntries << endl;
-
- // Loop through all entries in the tree
- Int_t nbytes;
- for (Int_t iEntry = 0; iEntry < nEntries; iEntry++) {
-
- // Import the tree
- nbytes += sdigitstree->GetEvent(iEntry);
-
- // Get the number of sdigits
- Int_t ndig = fSDigits->GetEntriesFast();
- cout << "------------------<AliTOFanalyzeSDigitsV2>------------------" << endl;
- cout << "Found " << ndig << " TOF SDigits for event " << ievent << endl;
- cout << "------------------------------------------------------------" << endl;
-
- // start loop on sdigits
- for (Int_t k = 0; k < ndig; k++) {
-
- // Get the information for this digit
- AliTOFSDigit *tofsdigit = (AliTOFSDigit *) fSDigits->UncheckedAt(k);
- Float_t firstTDC=tofsdigit->GetTdc(0);
- Float_t firstADC=tofsdigit->GetAdc(0);
- Int_t nslot=tofsdigit->GetNDigits();
- hndigits->Fill(nslot);
- htdc->Fill(firstTDC);
- hadc->Fill(firstADC);
- // TOF sdigit volumes
- Int_t sector = tofsdigit->GetSector(); // range [1-18]
- Int_t plate = tofsdigit->GetPlate(); // range [1- 5]
- Int_t strip = tofsdigit->GetStrip(); // range [1-20]
- Int_t padz = tofsdigit->GetPadz(); // range [1- 2]
- Int_t padx = tofsdigit->GetPadx(); // range [1-48]
- // it is QA, then I perform QA!
- Bool_t isSDigitBad = (sector<1 || sector>18 || plate<1 || plate >5 || padz<1 || padz>2 || padx<1 || padx>48);
-
- if (isSDigitBad) {
- cout << "<AliTOFanalyzeSDigitsV2> strange sdigit found" << endl;
- rc = 3;
- return rc;
- }
+ TClonesArray * TOFsdigits = new TClonesArray("AliTOFSDigit",1000);
+ TOFsdigits = tof->SDigits();
+ TOFsdigits = TS->GetBranch("TOF")->SetAddress(&TOFsdigits);
+
+ Int_t nEntries = TS->GetEntries();
+
+ for (Int_t iEntry = 0; iEntry < nEntries; iEntry ++)
+ {
+ tof->ResetDigits();
+ TS->GetEvent(iEntry);
+ Int_t ndig = TOFsdigits->GetEntriesFast();
+ cout << "<AliTOFanalyzeSDigits> found " << ndig
+ << " TOF sdigits for event " << ievent << endl;
- if(k<ndump){
- cout << k << "-th | " << "Sector " << sector << " | Plate " << plate << " | Strip " << strip << " | PadZ " << padz << " | PadX " << padx << endl;
- cout << k << "-th | ADC " << firstADC << " [bin] | TDC " << firstTDC << " [bin]" << endl;
- cout << "----------------------------------------------------"<< endl;
+ for (Int_t k=0; k<ndig; k++) {
+ tofsdigit = (AliTOFSDigit*) TOFsdigits->UncheckedAt(k);
+ Float_t firstTDC = tofsdigit->GetTdc(0);
+ Float_t firstADC = tofsdigit->GetAdc(0);
+ htdc->Fill(firstTDC);
+ hadc->Fill(firstADC);
+ // TOF sdigit volumes
+ Int_t sector = tofsdigit->GetSector(); // range [1-18]
+ Int_t plate = tofsdigit->GetPlate(); // range [1- 5]
+ Int_t strip = tofsdigit->GetStrip(); // range [1-20]
+ Int_t padz = tofsdigit->GetPadz(); // range [1- 2]
+ Int_t padx = tofsdigit->GetPadx(); // range [1-48]
+ // it is QA, then I perform QA!
+ Bool_t isSDigitBad = (sector<1 || sector>18 || plate<1 || plate >5 || padz<1 || padz>2 || padx<1 || padx>48);
+
+ if (isSDigitBad) {
+ cout << "<AliTOFanalyzeSDigits> strange sdigit found" << endl;
+ rc = 4;
+ return rc;
+ }
+
+ if(k<ndump){
+ cout << k << "-th | " << "Sector " << sector << " | Plate " << plate << " | Strip " << strip << " | PadZ " << padz << " | PadX " << padx << endl;
+ cout << k << "-th | ADC " << firstADC << " [bin] | TDC " << firstTDC << " [bin]" << endl;
+ cout << "----------------------------------------------------"<< endl;
+ }
+
+ // filling sdigit volume histos
+ hsector->Fill(sector);
+ hplate->Fill(plate);
+ hstrip->Fill(strip);
+ hpadx->Fill(padx);
+ hpadz->Fill(padz);
+ h2tdcVSadc->Fill(firstTDC,firstADC);
+
}
-
- // filling sdigit volume histos
- hsector->Fill(sector);
- hplate->Fill(plate);
- hstrip->Fill(strip);
- hpadx->Fill(padx);
- hpadz->Fill(padz);
- h2tdcVSadc->Fill(firstADC,firstTDC);
-
- //cout << "firstTDC " << firstTDC << " firstADC " << firstADC << endl;
- } // end loop on sdigits
-
- } // end loop on entries
+ }
- } // end loop on events
+ tofl->UnloadSDigits();
+ } // end loop on events
+
+ rl->UnloadHeader();
+ rl->UnloadgAlice();
+
TFile *fout = new TFile("TOF_sdigitsQA.root","RECREATE");
htdc->Write();
hadc->Write();
- hndigits->Write();
h2tdcVSadc->Write();
hsector->Write();
hplate->Write();
hstrip->Write();
hpadz->Write();
hpadx->Write();
- fout->Close();
+ fout->Close();
+
+ delete htdc;
+ delete hadc;
+ delete h2tdcVSadc;
+ delete hsector;
+ delete hplate;
+ delete hstrip;
+ delete hpadz;
+ delete hpadx;
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
return rc;
-
}
+
-static Int_t eventsPerRun = 100;
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <Riostream.h>
+#include <TRandom.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+#include <TGeant3.h>
+#include "STEER/AliRunLoader.h"
+#include "STEER/AliRun.h"
+#include "STEER/AliConfig.h"
+#include "STEER/AliGenerator.h"
+#include "PYTHIA6/AliDecayerPythia.h"
+#include "EVGEN/AliGenHIJINGpara.h"
+#include "THijing/AliGenHijing.h"
+#include "EVGEN/AliGenCocktail.h"
+#include "EVGEN/AliGenSlowNucleons.h"
+#include "EVGEN/AliSlowNucleonModelExp.h"
+#include "PYTHIA6/AliGenPythia.h"
+#include "STEER/AliMagFMaps.h"
+#include "STRUCT/AliBODY.h"
+#include "STRUCT/AliMAG.h"
+#include "STRUCT/AliABSOv0.h"
+#include "STRUCT/AliDIPOv2.h"
+#include "STRUCT/AliHALL.h"
+#include "STRUCT/AliFRAMEv2.h"
+#include "STRUCT/AliSHILv2.h"
+#include "STRUCT/AliPIPEv0.h"
+#include "ITS/AliITSvPPRasymm.h"
+#include "TPC/AliTPCv2.h"
+#include "TOF/AliTOFv2FHoles.h"
+#include "TOF/AliTOFv4T0.h"
+#include "RICH/AliRICHv3.h"
+#include "ZDC/AliZDCv2.h"
+#include "TRD/AliTRDv1.h"
+#include "FMD/AliFMDv1.h"
+#include "MUON/AliMUONv1.h"
+#include "PHOS/AliPHOSv1.h"
+#include "PMD/AliPMDv1.h"
+#include "START/AliSTARTv1.h"
+#include "EMCAL/AliEMCALv1.h"
+#include "CRT/AliCRTv0.h"
+#include "VZERO/AliVZEROv2.h"
+#endif
+
+enum PprRun_t
+{
+ test50,
+ kParam_8000, kParam_4000, kParam_2000,
+ kHijing_cent1, kHijing_cent2,
+ kHijing_per1, kHijing_per2, kHijing_per3, kHijing_per4, kHijing_per5,
+ kHijing_jj25, kHijing_jj50, kHijing_jj75, kHijing_jj100, kHijing_jj200,
+ kHijing_gj25, kHijing_gj50, kHijing_gj75, kHijing_gj100, kHijing_gj200,
+ kHijing_pA //, kPythia
+};
+
+enum PprGeo_t
+{
+ kHoles, kNoHoles
+};
+
+enum PprRad_t
+{
+ kGluonRadiation, kNoGluonRadiation
+};
+
+enum PprMag_t
+{
+ k2kG, k4kG, k5kG
+};
+
+
+// This part for configuration
+//static PprRun_t srun = test50;
+//static PprRun_t srun = kPythia;
+static PprRun_t srun = kHijing_cent2;
+static PprGeo_t sgeo = kNoHoles;
+static PprRad_t srad = kGluonRadiation;
+static PprMag_t smag = k4kG;
+
+// Comment line
+static TString comment;
+
+// Functions
+Float_t EtaToTheta(Float_t arg);
+AliGenerator* GeneratorFactory(PprRun_t srun);
+AliGenHijing* HijingStandard();
+
void Config()
{
- // 7-DEC-2000 09:00
- // Switch on Transition Radiation simulation. 6/12/00 18:00
- // iZDC=1 7/12/00 09:00
// ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
// Theta range given through pseudorapidity limits 22/6/2001
// Set Random Number seed
- // gRandom->SetSeed(12345);
+ gRandom->SetSeed(12345); //Set 0 to use the current time
+ cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;
+
// libraries required by geant321
+#if defined(__CINT__)
gSystem->Load("libgeant321");
+#endif
new TGeant3("C++ Interface to Geant3");
- if (!gSystem->Getenv("CONFIG_FILE"))
- {
- TFile *rootfile = new TFile("TOF_test.root", "recreate");
-
- rootfile->SetCompressionLevel(2);
- }
-
- TGeant3 *geant3 = (TGeant3 *) gMC;
+ AliRunLoader* rl=0x0;
+
+ cout<<"Config.C: Creating Run Loader ..."<<endl;
+ rl = AliRunLoader::Open("galice.root",
+ AliConfig::fgkDefaultEventFolderName,
+ "recreate");
+ if (rl == 0x0)
+ {
+ gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
+ return;
+ }
+ rl->SetCompressionLevel(2);
+ rl->SetNumberOfEventsPerFile(3);
+ gAlice->SetRunLoader(rl);
//
// Set External decayer
//
//
//=======================================================================
- // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
- geant3->SetTRIG(1); //Number of events to be processed
- geant3->SetSWIT(4, 10);
- geant3->SetDEBU(0, 0, 1);
- //geant3->SetSWIT(2,2);
- geant3->SetDCAY(1);
- geant3->SetPAIR(1);
- geant3->SetCOMP(1);
- geant3->SetPHOT(1);
- geant3->SetPFIS(0);
- geant3->SetDRAY(0);
- geant3->SetANNI(1);
- geant3->SetBREM(1);
- geant3->SetMUNU(1);
- geant3->SetCKOV(1);
- geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
- geant3->SetLOSS(2);
- geant3->SetMULS(1);
- geant3->SetRAYL(1);
- geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
- geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
- geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
- geant3->SetERAN(5.e-7);
+ //
+ //=======================================================================
+ // ************* STEERING parameters FOR ALICE SIMULATION **************
+ // --- Specify event type to be tracked through the ALICE setup
+ // --- All positions are in cm, angles in degrees, and P and E in GeV
+
+ gMC->SetProcess("DCAY",1);
+ gMC->SetProcess("PAIR",1);
+ gMC->SetProcess("COMP",1);
+ gMC->SetProcess("PHOT",1);
+ gMC->SetProcess("PFIS",0);
+ gMC->SetProcess("DRAY",0);
+ gMC->SetProcess("ANNI",1);
+ gMC->SetProcess("BREM",1);
+ gMC->SetProcess("MUNU",1);
+ gMC->SetProcess("CKOV",1);
+ gMC->SetProcess("HADR",1);
+ gMC->SetProcess("LOSS",2);
+ gMC->SetProcess("MULS",1);
+ gMC->SetProcess("RAYL",1);
Float_t cut = 1.e-3; // 1MeV cut by default
Float_t tofmax = 1.e10;
- // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
- geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
- tofmax);
-
- // #### AliGenHIJING generation######################################
- //
- AliGenHijing *gener = new AliGenHijing(1);
- gener->SetEnergyCMS(5500);
- gener->SetReferenceFrame("CMS");
- gener->SetProjectile("A", 208,82);
- gener->SetTarget("A", 208,82);
- gener->SetImpactParameterRange(0.,3.);
- gener->SetJetQuenching(1);
- gener->SetShadowing(1);
- gener->SetDecaysOff(0);
- gener->SetSelectAll(0);
- gener->SetOrigin(0.,0.,0.);
- gener->SetSpectators(0);
- gener->SetThetaRange(85.,95.);
+ gMC->SetCut("CUTGAM", cut);
+ gMC->SetCut("CUTELE", cut);
+ gMC->SetCut("CUTNEU", cut);
+ gMC->SetCut("CUTHAD", cut);
+ gMC->SetCut("CUTMUO", cut);
+ gMC->SetCut("BCUTE", cut);
+ gMC->SetCut("BCUTM", cut);
+ gMC->SetCut("DCUTE", cut);
+ gMC->SetCut("DCUTM", cut);
+ gMC->SetCut("PPCUTM", cut);
+ gMC->SetCut("TOFMAX", tofmax);
+
+
+// Generator Configuration
+ gAlice->SetDebug(1);
+ AliGenerator* gener = GeneratorFactory(srun);
+ gener->SetOrigin(0, 0, 0); // vertex position
+ gener->SetSigma(0, 0, 0); // Sigma in (X,Y,Z) (cm) on IP position
+ //gener->SetCutVertexZ(1.); // Truncate at 1 sigma
+ //gener->SetVertexSmear(kPerEvent);
+ gener->SetThetaRange(45.,135.);
gener->SetTrackingFlag(1);
gener->Init();
+
+ if (smag == k2kG) {
+ comment = comment.Append(" | L3 field 0.2 T");
+ } else if (smag == k4kG) {
+ comment = comment.Append(" | L3 field 0.4 T");
+ } else if (smag == k5kG) {
+ comment = comment.Append(" | L3 field 0.5 T");
+ }
+
+
+ if (srad == kGluonRadiation)
+ {
+ comment = comment.Append(" | Gluon Radiation On");
+
+ } else {
+ comment = comment.Append(" | Gluon Radiation Off");
+ }
- //
- // Activate this line if you want the vertex smearing to happen
- // track by track
- //
- //gener->SetVertexSmear(perTrack);
-
- gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
- //gAlice->SetField(-999,2,2.);//Scale factor=2 ==> field=0.4T
-
- Int_t iABSO = 1;
- Int_t iCRT = 0;
- Int_t iDIPO = 1;
- Int_t iFMD = 1;
- Int_t iFRAME = 1;
- Int_t iHALL = 1;
- Int_t iITS = 1;
- Int_t iMAG = 1;
- Int_t iMUON = 1;
- Int_t iPHOS = 1;
- Int_t iPIPE = 1;
- Int_t iPMD = 1;
- Int_t iRICH = 1;
- Int_t iSHIL = 1;
- Int_t iSTART = 1;
- Int_t iTOF = 1;
- Int_t iTPC = 1;
- Int_t iTRD = 1;
- Int_t iZDC = 1;
- Int_t iEMCAL = 0;
+ if (sgeo == kHoles)
+ {
+ comment = comment.Append(" | Holes for PHOS/RICH");
+
+ } else {
+ comment = comment.Append(" | No holes for PHOS/RICH");
+ }
+
+ printf("\n \n Comment: %s \n \n", comment.Data());
+
+
+// Field (L3 0.4 T)
+ AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., smag);
+ rl->CdGAFile();
+
+//
+ Int_t iABSO = 1;
+ Int_t iDIPO = 0; //1;
+ Int_t iFMD = 0; //1;
+ Int_t iFRAME = 1;
+ Int_t iHALL = 0; //1;
+ Int_t iITS = 1;
+ Int_t iMAG = 1;
+ Int_t iMUON = 0; //1;
+ Int_t iPHOS = 0; //1;
+ Int_t iPIPE = 1;
+ Int_t iPMD = 0; //1;
+ Int_t iRICH = 0; //1;
+ Int_t iSHIL = 0; //1;
+ Int_t iSTART = 0; //1;
+ Int_t iTOF = 1;
+ Int_t iTPC = 1;
+ Int_t iTRD = 1;
+ Int_t iZDC = 0; //1;
+ Int_t iEMCAL = 0; //1;
+ Int_t iVZERO = 0; //1;
+ Int_t iCRT = 0;
//=================== Alice BODY parameters =============================
AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
{
//=================== FRAME parameters ============================
- AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
-
+ AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
+ if (sgeo == kHoles) {
+ FRAME->SetHoles(1);
+ } else {
+ FRAME->SetHoles(0);
+ }
}
if (iSHIL)
{
//=================== SHIL parameters ============================
- AliSHIL *SHIL = new AliSHILvF("SHIL", "Shielding");
+ AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
}
AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
}
- if(iITS) {
+ if(iITS) {
-//=================== ITS parameters ============================
+ //=================== ITS parameters ============================
//
// As the innermost detector in ALICE, the Inner Tracking System "impacts" on
// almost all other detectors. This involves the fact that the ITS geometry
//
//AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
//
- AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
- ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
- ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
+ AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
+ ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
+ ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
// ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
- ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
- ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
- ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
- ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
- ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
- ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
- //
+ ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
+ ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
+ ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
+ ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
+ ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
+ ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
+ //
//AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
//ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
//ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
//ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
//ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
//ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
- //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
+ //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
//ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
//
//
//
//
//AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
- //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
+ //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
//ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
//
//AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
- //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
+ //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
//ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
//
//
// ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
// The default (=0) means that you dont want to use this facility.
//
- ITS->SetEUCLID(0);
- }
-
+ ITS->SetEUCLID(0);
+ }
if (iTPC)
{
// gROOT->LoadMacro("SetTPCParam.C");
// AliTPCParam *param = SetTPCParam();
- //AliTPC *TPC = new AliTPCv2("TPC", "Default");
- AliTPC *TPC = new AliTPCv1("TPC","Default"); //fast simulation (Pierella)
+ AliTPC *TPC = new AliTPCv2("TPC", "Default");
// All sectors included
TPC->SetSecAL(-1);
}
- if (iTOF)
- {
+
+ if (iTOF) {
+ if (sgeo == kHoles) {
//=================== TOF parameters ============================
- //AliTOF *TOF = new AliTOFv2("TOF", "normal TOF");
- AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF"); // default for time zero determination
+ AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes");
+ } else {
+ AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
+ }
}
+
if (iRICH)
{
//=================== RICH parameters ===========================
- AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
+ AliRICH *RICH = new AliRICHv3("RICH", "normal RICH");
}
AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
}
- if (iCRT)
- {
- //=================== CRT parameters ============================
-
- AliCRT *CRT = new AliCRTv1("CRT", "normal CRT");
- }
-
if (iTRD)
{
//=================== TRD parameters ============================
- //AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
- AliTRD *TRD = new AliTRDv0("TRD","TRD fast simulator");// Pierella
+ AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
// Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
TRD->SetGasMix(1);
-
- // With hole in front of PHOS
- TRD->SetPHOShole();
- // With hole in front of RICH
- TRD->SetRICHhole();
- // Switch on TR
- AliTRDsim *TRDsim = TRD->CreateTR();
+ if (sgeo == kHoles) {
+ // With hole in front of PHOS
+ TRD->SetPHOShole();
+ // With hole in front of RICH
+ TRD->SetRICHhole();
+ }
+ // Switch on TR
+ AliTRDsim *TRDsim = TRD->CreateTR();
}
if (iFMD)
{
//=================== FMD parameters ============================
-
- AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
- FMD->SetRingsSi1(256);
- FMD->SetRingsSi2(64);
- FMD->SetSectorsSi1(20);
- FMD->SetSectorsSi2(24);
+ AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
}
if (iMUON)
if (iPHOS)
{
- AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
+ AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
}
if (iPMD)
{
//=================== PMD parameters ============================
-
AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
+ }
- PMD->SetPAR(1., 1., 0.8, 0.02);
- PMD->SetIN(6., 18., -580., 27., 27.);
- PMD->SetGEO(0.0, 0.2, 4.);
- PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
-
+ if (iSTART)
+ {
+ //=================== START parameters ============================
+ AliSTART *START = new AliSTARTv1("START", "START Detector");
}
- if (iEMCAL && !iRICH)
+ if (iEMCAL)
{
//=================== EMCAL parameters ============================
- AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a");
+ AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "G56_2_55_19");
}
- if (iSTART)
+ if (iCRT)
{
- //=================== START parameters ============================
- AliSTART *START = new AliSTARTv1("START", "START Detector");
+ //=================== CRT parameters ============================
+ AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
}
-
+ if (iVZERO)
+ {
+ //=================== CRT parameters ============================
+ AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
+ }
+
+
}
Float_t EtaToTheta(Float_t arg){
return (180./TMath::Pi())*2.*atan(exp(-arg));
}
+
+
+
+AliGenerator* GeneratorFactory(PprRun_t srun) {
+ Int_t isw = 3;
+ if (srad == kNoGluonRadiation) isw = 0;
+
+
+ AliGenerator * gGener = 0x0;
+ switch (srun) {
+ case test50:
+ {
+ comment = comment.Append(":HIJINGparam test 50 particles");
+ AliGenHIJINGpara *gener = new AliGenHIJINGpara(100);
+ gener->SetMomentumRange(0, 999999.);
+ gener->SetPhiRange(0., 360.);
+ // Set pseudorapidity range from -8 to 8.
+ Float_t thmin = EtaToTheta(1); // theta min. <---> eta max
+ Float_t thmax = EtaToTheta(-1); // theta max. <---> eta min
+ gener->SetThetaRange(thmin,thmax);
+ gGener=gener;
+ }
+ break;
+ case kParam_8000:
+ {
+ comment = comment.Append(":HIJINGparam N=8000");
+ AliGenHIJINGpara *gener = new AliGenHIJINGpara(86030);
+ gener->SetMomentumRange(0, 999999.);
+ gener->SetPhiRange(0., 360.);
+ // Set pseudorapidity range from -8 to 8.
+ Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
+ Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
+ gener->SetThetaRange(thmin,thmax);
+ gGener=gener;
+ }
+ break;
+ case kParam_4000:
+ {
+ comment = comment.Append("HIJINGparam N=4000");
+ AliGenHIJINGpara *gener = new AliGenHIJINGpara(43015);
+ gener->SetMomentumRange(0, 999999.);
+ gener->SetPhiRange(0., 360.);
+ // Set pseudorapidity range from -8 to 8.
+ Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
+ Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
+ gener->SetThetaRange(thmin,thmax);
+ gGener=gener;
+ }
+ break;
+ case kParam_2000:
+ {
+ comment = comment.Append("HIJINGparam N=2000");
+ AliGenHIJINGpara *gener = new AliGenHIJINGpara(21507);
+ gener->SetMomentumRange(0, 999999.);
+ gener->SetPhiRange(0., 360.);
+ // Set pseudorapidity range from -8 to 8.
+ Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
+ Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
+ gener->SetThetaRange(thmin,thmax);
+ gGener=gener;
+ }
+ break;
+//
+// Hijing Central
+//
+ case kHijing_cent1:
+ {
+ comment = comment.Append("HIJING cent1");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ gGener=gener;
+ }
+ break;
+ case kHijing_cent2:
+ {
+ comment = comment.Append("HIJING cent2");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 2.);
+ gGener=gener;
+ break;
+ }
+//
+// Hijing Peripheral
+//
+ case kHijing_per1:
+ {
+ comment = comment.Append("HIJING per1");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(5., 8.6);
+ gGener=gener;
+ }
+ break;
+ case kHijing_per2:
+ {
+ comment = comment.Append("HIJING per2");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(8.6, 11.2);
+ gGener=gener;
+ }
+ break;
+ case kHijing_per3:
+ {
+ comment = comment.Append("HIJING per3");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(11.2, 13.2);
+ gGener=gener;
+ }
+ break;
+ case kHijing_per4:
+ {
+ comment = comment.Append("HIJING per4");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(13.2, 15.);
+ gGener=gener;
+ }
+ break;
+ case kHijing_per5:
+ {
+ comment = comment.Append("HIJING per5");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(15., 100.);
+ gGener=gener;
+ }
+ break;
+//
+// Jet-Jet
+//
+ case kHijing_jj25:
+ {
+ comment = comment.Append("HIJING Jet 25 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(1);
+ gener->SetPtJet(25.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.3,0.3);
+ gener->SetJetPhiRange(75., 165.);
+ gGener=gener;
+ }
+ break;
+
+ case kHijing_jj50:
+ {
+ comment = comment.Append("HIJING Jet 50 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(1);
+ gener->SetPtJet(50.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.3,0.3);
+ gener->SetJetPhiRange(75., 165.);
+ gGener=gener;
+ }
+ break;
+
+ case kHijing_jj75:
+ {
+ comment = comment.Append("HIJING Jet 75 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(1);
+ gener->SetPtJet(75.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.3,0.3);
+ gener->SetJetPhiRange(75., 165.);
+ gGener=gener;
+ }
+ break;
+
+ case kHijing_jj100:
+ {
+ comment = comment.Append("HIJING Jet 100 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(1);
+ gener->SetPtJet(100.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.3,0.3);
+ gener->SetJetPhiRange(75., 165.);
+ gGener=gener;
+ }
+ break;
+
+ case kHijing_jj200:
+ {
+ comment = comment.Append("HIJING Jet 200 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(1);
+ gener->SetPtJet(200.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.3,0.3);
+ gener->SetJetPhiRange(75., 165.);
+ gGener=gener;
+ }
+ break;
+//
+// Gamma-Jet
+//
+ case kHijing_gj25:
+ {
+ comment = comment.Append("HIJING Gamma 25 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(2);
+ gener->SetPtJet(25.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.12, 0.12);
+ gener->SetJetPhiRange(220., 320.);
+ gGener=gener;
+ }
+ break;
+
+ case kHijing_gj50:
+ {
+ comment = comment.Append("HIJING Gamma 50 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(2);
+ gener->SetPtJet(50.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.12, 0.12);
+ gener->SetJetPhiRange(220., 320.);
+ gGener=gener;
+ }
+ break;
+
+ case kHijing_gj75:
+ {
+ comment = comment.Append("HIJING Gamma 75 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(2);
+ gener->SetPtJet(75.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.12, 0.12);
+ gener->SetJetPhiRange(220., 320.);
+ gGener=gener;
+ }
+ break;
+
+ case kHijing_gj100:
+ {
+ comment = comment.Append("HIJING Gamma 100 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(2);
+ gener->SetPtJet(100.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.12, 0.12);
+ gener->SetJetPhiRange(220., 320.);
+ gGener=gener;
+ }
+ break;
+
+ case kHijing_gj200:
+ {
+ comment = comment.Append("HIJING Gamma 200 GeV");
+ AliGenHijing *gener = HijingStandard();
+// impact parameter range
+ gener->SetImpactParameterRange(0., 5.);
+ // trigger
+ gener->SetTrigger(2);
+ gener->SetPtJet(200.);
+ gener->SetRadiation(isw);
+ gener->SetSimpleJets(!isw);
+ gener->SetJetEtaRange(-0.12, 0.12);
+ gener->SetJetPhiRange(220., 320.);
+ gGener=gener;
+ }
+ break;
+ case kHijing_pA:
+ {
+ comment = comment.Append("HIJING pA");
+
+ AliGenCocktail *gener = new AliGenCocktail();
+// gener->SetTrackingFlag(0);
+ gener->SetOrigin(0, 0, 0); // vertex position
+ gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
+ gener->SetCutVertexZ(1.); // Truncate at 1 sigma
+ gener->SetVertexSmear(kPerEvent);
+ AliGenHijing *hijing = new AliGenHijing(-1);
+// centre of mass energy
+ hijing->SetEnergyCMS(TMath::Sqrt(82./208.) * 14000.);
+// impact parameter range
+ hijing->SetImpactParameterRange(0., 15.);
+// reference frame
+ hijing->SetReferenceFrame("CMS");
+ hijing->SetBoostLHC(1);
+// projectile
+ hijing->SetProjectile("P", 1, 1);
+ hijing->SetTarget ("A", 208, 82);
+// tell hijing to keep the full parent child chain
+ hijing->KeepFullEvent();
+// enable jet quenching
+ hijing->SetJetQuenching(0);
+// enable shadowing
+ hijing->SetShadowing(1);
+// Don't track spectators
+ hijing->SetSpectators(0);
+// kinematic selection
+ hijing->SetSelectAll(0);
+//
+ AliGenSlowNucleons* gray = new AliGenSlowNucleons(1);
+ AliSlowNucleonModel* model = new AliSlowNucleonModelExp();
+ gray->SetSlowNucleonModel(model);
+ gray->SetDebug(1);
+ gener->AddGenerator(hijing,"Hijing pPb", 1);
+ gener->AddGenerator(gray, "Gray Particles",1);
+ gGener=gener;
+ }
+ break;
+ case kPythia:
+ {
+ comment = comment.Append(":Pythia p-p @ 14 TeV");
+ AliGenPythia *gener = new AliGenPythia(-1);
+ gener->SetMomentumRange(0,999999);
+ gener->SetPhiRange(-180,180);
+ gener->SetThetaRange(0., 180.);
+ gener->SetYRange(-12,12);
+ gener->SetPtRange(0,1000);
+ gener->SetStrucFunc(kCTEQ4L);
+ gener->SetProcess(kPyMb);
+ gener->SetEnergyCMS(14000.);
+ gGener=gener;
+ }
+ break;
+ }
+ return gGener;
+}
+
+AliGenHijing* HijingStandard()
+{
+ AliGenHijing *gener = new AliGenHijing(-1);
+// centre of mass energy
+ gener->SetEnergyCMS(5500.);
+// reference frame
+ gener->SetReferenceFrame("CMS");
+// projectile
+ gener->SetProjectile("A", 208, 82);
+ gener->SetTarget ("A", 208, 82);
+// tell hijing to keep the full parent child chain
+ gener->KeepFullEvent();
+// enable jet quenching
+ gener->SetJetQuenching(4);
+// enable shadowing
+ gener->SetShadowing(1);
+// neutral pion and heavy particle decays switched off
+ gener->SetDecaysOff(1);
+// Don't track spectators
+ gener->SetSpectators(0);
+// kinematic selection
+ gener->SetSelectAll(0);
+ return gener;
+}
+
+
+
-void AliTOFhits2sdigits(TString fileNameHits, Int_t firstEvent=0,Int_t nEvents=1)
+void AliTOFhits2sdigits(Int_t firstEvent=0,Int_t nEvents=1)
{
/////////////////////////////////////////////////////////////////////////
// start root
// // load the macro
// root[0] .L AliTOFhits2sdigits.C
- // root[1] AliTOFhits2sdigits("galice.root",0,1)
+ // root[1] AliTOFhits2sdigits()
+ //
+ // Updated to the new I/O: C. Zampolli
+ //
/////////////////////////////////////////////////////////////////////////
// Dynamically link some shared libs
+
if (gClassTable->GetID("AliRun") < 0) {
gROOT->LoadMacro("loadlibs.C");
loadlibs();
cout << "Loaded shared libraries" << endl;
- }
-
-
+ }
+
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
+
// Create the TOF sdigitzer and sdigitize by default the first event
// (in fact by default Int_t firstEvent=0,Int_t nEvents=1)
- AliTOFSDigitizer *sdigitizer = new AliTOFSDigitizer(fileNameHits.Data(),firstEvent,nEvents); // it is the same nevents numbering
- // scheme used by STEER/AliHits2SDigits.C
+ AliTOFSDigitizer *sdigitizer = new AliTOFSDigitizer("galice.root",firstEvent,nEvents); // it is the same nevents numbering
// Activate this line if you want to print the parameters
// used in sdigitization
// performs sdigitization of the above events with "all" verbose option
// "tim" option is also available for benchmarking only
- sdigitizer->Exec("all");
+ //sdigitizer->Exec("all");
// N.B.: in order to maintain the functionality to sdigitize
// all events in current file add a second option
- // sdigitizer->Exec("all","all");
+ sdigitizer->Exec("all","all");
// the second "all" option overrides the previous settings for
// lower and upper bounds for event to sdigitize and allow
// the sdigitization for ALL events in fileNameHits
+
+ sdigitizer = 0x0;
+ delete sdigitizer;
+
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
+
}
-Int_t AliTOFtest()
+Int_t AliTOFtest(Int_t nevents=1)
{
//
// Test macro for the TOF code
// start aliroot
// root [0] .L AliTOFtest.C
// root [1] AliTOFtest()
+ //
+ // Updated to the new I/O: A. De Caro, C. Zampolli
+ //
Int_t rc = 0;
// Initialize the test setup
- //gAlice->Init("$(ALICE_ROOT)/TOF/AliTOFconfig.C");
gAlice->Init("$ALICE_ROOT/TOF/AliTOFconfig.C");
- // Run one central Hijing event and create the hits (time required:
- // some minuts)
+ // Run one central Hijing event and create the hits
+ // (time required: some minuts)
gAlice->SetDebug(2);
- gAlice->Run(1);
-
- if (gAlice) delete gAlice;
- TFile *file = (TFile *) gROOT->GetListOfFiles()->FindObject("TOF_test.root");
- gAlice = (AliRun *) file->Get("gAlice");
-
- // Analyze the TOF hits
- if (rc = AliTOFanalyzeHits()) return rc;
-
- return rc;
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTOFanalyzeHits()
-{
- //
- // Analyzes the hits and fills QA-histograms
- //
-
- Int_t rc = 0;
-
- if (!gAlice) {
- cout << "<AliTOFanalyzeHits> No AliRun object found" << endl;
- rc = 1;
- return rc;
- }
- gAlice->GetEvent(0);
-
- // Get the pointer to the TOF detector
- AliTOF *tof = (AliTOF *) gAlice->GetDetector("TOF");
- if (!tof) {
- cout << "<AliTOFanalyzeHits> No TOF detector found" << endl;
- rc = 2;
- return rc;
- }
-
- // Define the histograms
- // x,y,z, rho, tof, padx, padz, sector, plate, strip, (x vs y)
-
- // hit-map in a plane
- TH2F *h2hitMap = new TH2F("h2hitMap","Hit Map (projection on the plane)",2500,-12500.,12500.,800,-400.,400.);
- // time of flight distribution for primaries and secondaries
- TH1F *htofp = new TH1F("htofp","Time of Flight (primaries)",800,0.,80.);
- TH1F *htofs = new TH1F("htofs","Time of Flight (secondaries)",800,0.,80.);
- // momentum when striking the TOF for primaries and secondaries
- TH1F *htofmomp = new TH1F("htofmomp","Momentum at TOF (primaries)",100,0.,10.);
- TH1F *htofmoms = new TH1F("htofmoms","Momentum at TOF (secondaries)",100,0.,10.);
- // TOF hit volumes
- TH1F *hsector = new TH1F("hsector","Sector",20,0.,20.);
- TH1F *hplate = new TH1F("hplate","Plate ", 6,0., 6.);
- TH1F *hstrip = new TH1F("hstrip","Strip ",25,0.,25.);
- TH1F *hpadz = new TH1F("hpadz","Pad along z ",3,0.,3.);
- TH1F *hpadx = new TH1F("hpadx","Pad along x",50,0.,50.);
- // track length when striking the TOF (used by AliTOFT0)
- TH1F *htrackLenp= new TH1F("htrackLenp","Track Length on TOF for Primaries",800,0.,800.);
-
- // Get the pointer hit tree
- TTree *hitTree = gAlice->TreeH();
- if (!hitTree) {
- cout << "<AliTOFanalyzeHits> No hit tree found" << endl;
- rc = 4;
- return rc;
- }
-
- Int_t countHits = 0;
- Int_t nBytes = 0;
-
- // Get the number of entries in the hit tree
- // (Number of primary particles creating a hit somewhere)
- Int_t nTrack = (Int_t) hitTree->GetEntries();
- cout << "<AliTOFanalyzeHits> Found " << nTrack
- << " primary particles with hits" << endl;
-
- Int_t nPrimaryOnTof = 0;
- Int_t nSecondaryOnTof = 0;
- Int_t nelectron = 0;
- Int_t npion = 0;
- Int_t nkaon = 0;
- Int_t nproton = 0;
- Int_t nmuon = 0;
+ gAlice->Run(nevents);
- // Loop through all entries in the tree
- for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
-
- gAlice->ResetHits();
- nBytes += hitTree->GetEvent(iTrack);
-
-
- // Loop through the TOF hits
- Int_t iHit = 0;
- AliTOFhitT0 *hit = (AliTOFhitT0 *) tof->FirstHit(-1);
- while (hit) {
-
- countHits++;
- iHit++;
-
- Float_t x = hit->X();
- Float_t y = hit->Y();
- Float_t z = hit->Z();
- Float_t circleLen=TMath::Sqrt(x*x+y*y)*TMath::ATan2(y,x);
- h2hitMap->Fill(circleLen,z);
-
- Float_t flightTime = hit->GetTof(); // [s]
- flightTime*=1.e+09; // convert in [ns]
- Float_t angle = hit->GetIncA();
- Float_t tofmom= hit->GetMom(); // [GeV/c]
- Float_t trackLen= hit->GetLen(); // [cm]
-
- // TOF hit volumes
- Int_t sector = hit->GetSector(); // range [1-18]
- Int_t plate = hit->GetPlate(); // range [1- 5]
- Int_t strip = hit->GetStrip(); // range [1-20]
- Int_t padz = hit->GetPadz(); // range [1- 2]
- Int_t padx = hit->GetPadx(); // range [1-48]
- // it is QA, then I perform QA!
- Bool_t isHitBad = (sector<1 || sector>18 || plate<1 || plate >5 || padz<1 || padz>2 || padx<1 || padx>48);
-
- if (isHitBad) {
- cout << "<AliTOFanalyzeHits> strange hit found" << endl;
- rc = 3;
- return rc;
- }
- // filling hit volume histos
- hsector->Fill(sector);
- hplate->Fill(plate);
- hstrip->Fill(strip);
- hpadx->Fill(padx);
- hpadz->Fill(padz);
-
-
- Int_t track = hit->Track();
- TParticle *part = gAlice->Particle(track);
-
- // getting MC info for the current track
- if (part->GetFirstMother()<0){
- Int_t icod = TMath::Abs(part->GetPdgCode());
- switch (icod) {
- case 211:
- npion++;
- break ;
- case 321:
- nkaon++;
- break ;
- case 2212:
- nproton++;
- break ;
- case 11:
- nelectron++;
- break ;
- case 13:
- nmuon++;
- break ;
- }
- htofp->Fill(flightTime);
- htofmomp->Fill(tofmom);
- htrackLenp->Fill(trackLen);
- } else {
- htofs->Fill(flightTime);
- htofmoms->Fill(tofmom);
- }
-
- // go to next hit
- hit = (AliTOFhitT0 *) tof->NextHit();
-
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
}
- }
-
- cout << "<AliTOFanalyzeHits> Found " << countHits << " hits in total" << endl;
- cout << npion << " primary pions reached the TOF detector" << endl;
- cout << nkaon << " primary kaons reached the TOF detector" << endl;
- cout << nproton << " primary protons reached the TOF detector" << endl;
- cout << nelectron << " primary electrons reached the TOF detector" << endl;
- cout << nmuon << " primary muons reached the TOF detector" << endl;
-
+ gROOT->LoadMacro("$(ALICE_ROOT)/TOF/AliTOFanalyzeHits.C");
+ if (rc=AliTOFanalyzeHits()) return rc;
- TCanvas *cHits = new TCanvas("cHits","AliTOFanalyzeHits hit volumes",50,50,900,900);
- cHits->Divide(3,2);
- cHits->cd(1);
- hsector->Draw();
- cHits->cd(2);
- hplate->Draw();
- cHits->cd(3);
- hstrip->Draw();
- cHits->cd(4);
- hpadz->Draw();
- cHits->cd(5);
- hpadx->Draw();
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
- TCanvas *chitmap = new TCanvas("chitmap","AliTOFanalyzeHits Hit Map",50,50,600,600);
- chitmap->cd();
- h2hitMap->Draw();
+ gROOT->LoadMacro("$(ALICE_ROOT)/TOF/AliTOFhits2sdigits.C");
+ if (rc=AliTOFhits2sdigits()) return rc;
- TCanvas *ctrackLen = new TCanvas("ctrackLen","AliTOFanalyzeHits Track Length for primaries on TOF",50,50,400,400);
- ctrackLen->cd();
- htrackLenp->Draw();
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
- TCanvas *ctofmom = new TCanvas("ctofmom","AliTOFanalyzeHits flight times",50,50,700,700);
- ctofmom->Divide(2,2);
- ctofmom->cd(1);
- gPad->SetLogy();
- htofp->Draw();
- ctofmom->cd(2);
- gPad->SetLogy();
- htofs->Draw();
- ctofmom->cd(3);
- gPad->SetLogy();
- htofmomp->Draw();
- ctofmom->cd(4);
- gPad->SetLogy();
- htofmoms->Draw();
+ gROOT->LoadMacro("$(ALICE_ROOT)/TOF/AliTOFanalyzeSDigitsV2.C");
+ if (rc=AliTOFanalyzeSDigitsV2()) return rc;
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
+
+ gROOT->LoadMacro("$(ALICE_ROOT)/TOF/AliTOFSDigits2Digits.C");
+ if (rc=AliTOFSDigits2Digits()) return rc;
+ //gROOT->LoadMacro("$(ALICE_ROOT)/TOF/AliTOFtestDigitizer.C");
+ //if (rc=AliTOFtestDigitizer()) return rc;
+
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
- // save histos into file TOF_hitsQA.root
- TFile *fout = new TFile("TOF_hitsQA.root","RECREATE");
- h2hitMap->Write();
- htofp->Write();
- htofs->Write();
- htofmomp->Write();
- htofmoms->Write();
- hsector->Write();
- hplate->Write();
- hstrip->Write();
- hpadz->Write();
- hpadx->Write();
- htrackLenp->Write();
- fout->Close();
-
- return rc;
+ gROOT->LoadMacro("$(ALICE_ROOT)/TOF/AliTOFanalyzeDigits.C");
+ if (rc=AliTOFanalyzeDigits()) return rc;
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
}
// file with digits
//
// input:
-// TString fileNameSDigits ... input file with sdigits
+// char* fileNameSignal ... input file with sdigits
// TString fileNameDigits ... output file with digits
// Int_t nEvents ... how many events to process
//
+// Updated to the new I/O: C. Zampolli
+//
+/////////////////////////////////////////////////////////////////////
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "iostream.h"
#include "TStopwatch.h"
#endif
-//#include "AliHits2SDigits.C"
-
-TFile* OpenFile(TString fileName);
-Bool_t ImportgAlice(TFile *file);
-void AliCopyN(TString inputFile, TString outputFile);
-void AliCopy(TFile *inputFile, TFile *outputFile);
-Int_t gDEBUG = 1;
+Int_t AliTOFtestDigitizer(const char* fileNameSignal = "galice.root",
+ /*const char* fileNameSignal = "signal/galice.root",
+ const char* fileNameBkgrd = "bkgrd/galice.root",*/
+ Int_t nEvents = -1, Int_t signalPerBkgrd = 1,
+ Int_t iTOF = 1)
+{
+
+// delete the current gAlice object, the one from input file will be used
+ if(gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice=0x0;
+ }
+ AliRunDigitizer * manager = new AliRunDigitizer(1/*2*/,signalPerBkgrd);
+ manager->SetInputStream(0, fileNameSignal);
+ //manager->SetInputStream(1, fileNameBkgrd);
+ //manager->SetOutputFile(fileNameSignal);
+ if (nEvents >= 0) manager->SetNrOfEventsToWrite(nEvents);
-Int_t AliTOFtestDigitizer(TString fileNameDigits="digits.root",
- TString fileNameSDigits="rfio:sdigits.root",
- Int_t nEvents = 1, Int_t iTOF = 1, Int_t iCopy = 1)
-{
-// delete the current gAlice object, the one from input file
-// will be used
+ if (iTOF) AliTOFDigitizer *dTOF = new AliTOFDigitizer(manager);
- if(gAlice){
- delete gAlice;
- gAlice = 0;
- } // end if gAlice
- AliRunDigitizer * manager = new AliRunDigitizer(1,1);
- manager->SetInputStream(0,fileNameSDigits.Data());
- if (fileNameDigits != "") {
- if (iCopy) {
- AliCopyN(fileNameSDigits,fileNameDigits);
- }
- manager->SetOutputFile(fileNameDigits);
- }
- manager->SetNrOfEventsToWrite(nEvents);
- if (iTOF) AliTOFDigitizer *dTOF = new AliTOFDigitizer(manager);
TStopwatch timer;
timer.Start();
manager->Exec("deb all");
timer.Stop();
timer.Print();
- delete manager;
-}
-
-
-////////////////////////////////////////////////////////////////////////
-void AliCopyN(TString inputFileName, TString outputFileName) {
-// copy some objects
-
- TFile *inputFile = OpenFile(inputFileName);
- if (!inputFile) return;
- TFile *outputFile = TFile::Open(outputFileName.Data(),"update");
- if (!outputFile->IsOpen()) {
- cerr<<"Can't open "<<outputFileName.Data()<<" !\n";
- return;
- }
- if (!ImportgAlice(inputFile)) return;
- AliCopy(inputFile, outputFile);
- inputFile->Close();
- delete inputFile;
- outputFile->Close();
- delete outputFile;
-}
-
-////////////////////////////////////////////////////////////////////////
-TFile* OpenFile(TString fileName) {
- // open file fileName
- TFile *file = TFile::Open(fileName.Data());
- if (!file->IsOpen()) {
- cerr<<"Can't open "<<fileName.Data()<<" !\n";
- return 0;
- }
- return file;
-}
+// delete manager;
+// manager = 0x0;
+
+ if(gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice=0x0;
+ }
-////////////////////////////////////////////////////////////////////////
-Bool_t ImportgAlice(TFile *file) {
- // read in gAlice object from the file
- gAlice = (AliRun*)file->Get("gAlice");
- if (!gAlice) return kFALSE;
- return kTRUE;
-}
+ return 0;
-////////////////////////////////////////////////////////////////////////
-void AliCopy(TFile *inputFile, TFile *outputFile) {
-// copy some objects
-
-// copy gAlice
- if (gDEBUG) cout<<"Copy gAlice: ";
- outputFile->cd();
- gAlice->Write();
- if (gDEBUG) cout<<"done"<<endl;
-
- TTree *treeE = gAlice->TreeE();
- if (!treeE) {
- cerr<<"No TreeE found "<<endl;
- return;
- }
-
-// copy TreeE
- if (gDEBUG) cout<<"Copy TreeE: ";
- AliHeader *header = new AliHeader();
- treeE->SetBranchAddress("Header", &header);
- treeE->SetBranchStatus("*",1);
- TTree *treeENew = treeE->CloneTree();
- treeENew->Write();
- if (gDEBUG) cout<<"done"<<endl;
-
-// copy AliceGeom
- if (gDEBUG) cout<<"Copy AliceGeom: ";
- TGeometry *AliceGeom = static_cast<TGeometry*>(inputFile->Get("AliceGeom"));
- if (!AliceGeom) {
- cerr<<"AliceGeom was not found in the input file "<<endl;
- return;
- }
- AliceGeom->Write();
- if (gDEBUG) cout<<"done"<<endl;
-
}
-
-void TOFquickanal(Int_t evNumber=0)
+Int_t TOFquickanal(Int_t eventNumber = 0)
{
-/////////////////////////////////////////////////////////////////////////
-// This macro is a small example of a ROOT macro
-// illustrating how to read the output of GALICE
-// and fill some histograms concerning the TOF Hit Tree.
-//
-// Root > .L TOFquickanal.C //this loads the macro in memory
-// Root > TOFquickanal(); //by default process first event
-// Root > TOFquickanal(2); //process third event
-//Begin_Html
-/*
-<img src="picts/TOFquickanal.gif">
-*/
-//End_Html
-//
-// Author: F. Pierella , Bologna University 12-04-2001
-/////////////////////////////////////////////////////////////////////////
-
-// Dynamically link some shared libs
+ /////////////////////////////////////////////////////////////////////////
+ // This macro is a small example of a ROOT macro
+ // illustrating how to read the output of GALICE
+ // and fill some histograms concerning the TOF Hit Tree.
+ //
+ // Root > .L TOFquickanal.C //this loads the macro in memory
+ // Root > TOFquickanal(); //by default process first event
+ // Root > TOFquickanal(2); //process third event
+ //Begin_Html
+ /*
+ <img src="picts/TOFquickanal.gif">
+ */
+ //End_Html
+ //
+ // Author: F. Pierella , Bologna University 12-04-2001
+ // Updated to the new I/O by: A. De Caro, C. Zampolli
+ /////////////////////////////////////////////////////////////////////////
+
+ // Dynamically link some shared libs
if (gClassTable->GetID("AliRun") < 0) {
gROOT->LoadMacro("loadlibs.C");
loadlibs();
}
-
- // Connect the Root Galice file containing Geometry, Kine and Hits
- TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
- if (!file) file = new TFile("galice.root");
-
- // Get AliRun object from file or create it if not on file
- if (!gAlice) {
- gAlice = (AliRun*)file->Get("gAlice");
- if (gAlice) printf("AliRun object found on file\n");
- if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+
+ Int_t rc = 0;
+
+ AliRunLoader *rl =AliRunLoader::Open("galice.root",AliConfig::fgkDefaultEventFolderName,"update");
+ if (!rl)
+ {
+ cerr << "Can't load RunLoader from file!\n";
+ rc = 1;
+ return rc;
+ }
+
+ rl->LoadgAlice();
+ gAlice=rl->GetAliRun();
+
+ if (!gAlice)
+ {
+ cerr << "<TOFquickanal> AliRun object not found on file \n";
+ rc = 2;
+ return rc;
+ }
+
+ // Get the pointer to the TOF detector
+ AliLoader *tofl = rl->GetLoader("TOFLoader");
+ AliTOF * tof = (AliTOF*) gAlice->GetDetector("TOF");
+ if (tof == 0x0 || tofl == 0x0) {
+ cerr << "<TOFquickanal> Can not find TOF or TOFLoader\n";
+ rc = 3;
+ return rc;
}
-
- // Import the Kine and Hits Trees for the event evNumber in the file
- Int_t nparticles = gAlice->GetEvent(evNumber);
- if (nparticles <= 0) return;
-
- Float_t tof,tofmom,incangle;
- Double_t xcoor,ycoor,zcoor,radius,prodmom,prodthe,prodphi;
- Int_t nbytes = 0;
- Int_t j,hit,ipart;
- Int_t nhits;
- TParticle *particle;
-
-
- // Get pointers to Alice detectors and Hits containers
- AliDetector *TOF = gAlice->GetDetector("TOF");
-
- Int_t ntracks = gAlice->TreeH()->GetEntries();
-
+
//=======> Create histograms
//---> Time of Flight for Primary Particles (ns)
TH1F *htofprim = new TH1F("htofprim","Time of Flight for Primary Particles",100,0.,100.);
//---> Incidence Angle of the particle on the pad (or strip) (deg) - primary plus secondary -
TH1F *hincangle = new TH1F("hincangle","Incidence Angle of the particle on the strip",90,0.,180.);
- AliTOFhit *tofHit;
+ printf ("Processing event %d \n", eventNumber);
+ rl->GetEvent(eventNumber);
+
+ // Get pointers to Alice detectors and Hits containers
+ tofl->LoadHits();
+ TTree *TH = tofl->TreeH();
+ tof->SetTreeAddress();
+ if (!TH) {
+ cout << "<TOFquickanal> No hit tree found" << endl;
+ rc = 4;
+ return rc;
+ }
+
+ // Import the Kine Tree for the event eventNumber in the file
+ rl->LoadHeader();
+ rl->LoadKinematics();
+ //AliStack * stack = rl->Stack();
+
+ Int_t ntracks = TH->GetEntries();
+ cout<<" ntracks = "<<ntracks<<endl;
+
+ AliTOFhitT0 *tofHit;
// Start loop on tracks in the hits containers
for (Int_t track=0; track<ntracks;track++) {
-// printf("Track #%d\n",track);
- if(TOF) {
- // ======>Histogram TOF
- for(tofHit=(AliTOFhit*)TOF->FirstHit(track); tofHit; tofHit=(AliTOFhit*)TOF->NextHit()) {
-
- tof = tofHit->GetTof();
- tof *= 1.E+09; // conversion from s to ns
- tofmom = tofHit->GetMom();
-
- ipart = tofHit->GetTrack();
- particle = gAlice->Particle(ipart);
-
- if (particle->GetFirstMother() < 0) {
- htofprim->Fill(tof);
- htofmom->Fill(tofmom);
- } else {
- htofsec->Fill(tof);
- };
-
- zcoor = tofHit->Z();
- hzcoor->Fill(zcoor);
-
- incangle= tofHit->GetIncA();
- hincangle->Fill(incangle);
-
- xcoor =particle->Vx();
- ycoor =particle->Vy();
- radius = TMath::Sqrt(xcoor*xcoor+ycoor*ycoor);
- if (particle->GetFirstMother() >= 0) hradius->Fill(radius);
-
- prodmom=particle->P();
- if (prodmom!=0.) {
- Double_t dummy = (particle->Pz())/prodmom;
- prodthe = TMath::ACos(dummy);
- prodthe *=57.29578; // conversion from rad to deg
- if (particle->GetFirstMother() < 0) hprodthe->Fill(prodthe);
- } // theta at production vertex
-
- if (particle->GetFirstMother() < 0) {
- hprodmom->Fill(prodmom);
- Double_t dummypx=particle->Px();
- Double_t dummypy=particle->Py();
- prodphi = TMath::ATan2(dummypy,dummypx);
- prodphi *=57.29578; // conversion from rad to deg
- hprodphi->Fill(prodphi);
- } // phi at production vertex
-
- } // close if(TOF)
+ tof->ResetHits();
+ TH->GetEvent(track);
+
+ for(tofHit=(AliTOFhitT0*)tof->FirstHit(track); tofHit; tofHit=(AliTOFhitT0*)tof->NextHit()) {
+
+ Float_t toflight = tofHit->GetTof();
+ toflight *= 1.E+09; // conversion from s to ns
+ Double_t tofmom = tofHit->GetMom();
+
+ Int_t ipart = tofHit->Track();
+ TParticle *particle = gAlice->Particle(ipart);
+ if (particle->GetFirstMother() < 0) {
+ htofprim->Fill(toflight);
+ htofmom->Fill(tofmom);
+ } else {
+ htofsec->Fill(toflight);
+ }
+
+ Double_t zcoor = tofHit->Z();
+ hzcoor->Fill(zcoor);
+
+ Double_t incangle = tofHit->GetIncA();
+ hincangle->Fill(incangle);
+
+ Double_t xcoor = particle->Vx();
+ Double_t ycoor = particle->Vy();
+ Double_t radius = TMath::Sqrt(xcoor*xcoor+ycoor*ycoor);
+ if (particle->GetFirstMother() >= 0) hradius->Fill(radius);
+
+ Double_t prodmom = particle->P();
+ if (prodmom!=0.) {
+ Double_t dummy = (particle->Pz())/prodmom;
+ Double_t prodthe = TMath::ACos(dummy);
+ prodthe *= 57.29578; // conversion from rad to deg
+ if (particle->GetFirstMother() < 0) hprodthe->Fill(prodthe);
+ } // theta at production vertex
+
+ if (particle->GetFirstMother() < 0) {
+ hprodmom->Fill(prodmom);
+ Double_t dummypx = particle->Px();
+ Double_t dummypy = particle->Py();
+ Double_t prodphi = TMath::ATan2(dummypy,dummypx);
+ prodphi *= 57.29578; // conversion from rad to deg
+ hprodphi->Fill(prodphi);
+ } // phi at production vertex
} // close loop on TOF-hits
- } // close loop on tracks in the hits containers
+ } // close loop on tracks in the hits containers
+ //Create canvas, set the view range, show histograms
+ TCanvas *c1 = new TCanvas("c1","Alice TOF hits quick analysis",400,10,600,700);
+ c1->cd();
+ hprodmom->Draw();
+ TCanvas *c2 = new TCanvas("c2","Alice TOF hits quick analysis",400,10,600,700);
+ c2->cd();
+ hprodthe->Draw();
+
+ TCanvas *c3 = new TCanvas("c3","Alice TOF hits quick analysis",400,10,600,700);
+ c3->cd();
+ hprodphi->Draw();
+
+ TCanvas *c4 = new TCanvas("c4","Alice TOF hits quick analysis",400,10,600,700);
+ c4->cd();
+ hzcoor->Draw();
+
+ TCanvas *c5 = new TCanvas("c5","Alice TOF hits quick analysis",400,10,600,700);
+ c5->cd();
+ hradius->Draw();
+
+ TCanvas *c6 = new TCanvas("c6","Alice TOF hits quick analysis",400,10,600,700);
+ c6->cd();
+ htofprim->Draw();
+
+ TCanvas *c7 = new TCanvas("c7","Alice TOF hits quick analysis",400,10,600,700);
+ c7->cd();
+ htofsec->Draw();
+
+
+ TCanvas *c8 = new TCanvas("c8","Alice TOF hits quick analysis",400,10,600,700);
+ c8->cd();
+ htofmom->Draw();
+
+ TCanvas *c9 = new TCanvas("c9","Alice TOF hits quick analysis",400,10,600,700);
+ c9->cd();
+ hincangle->Draw();
+
+ //tofl->UnloadHits();
+ //rl->UnloadHeader();
+ //rl->UnloadgAlice();
+ //rl->UnloadKinematics();
-//Create canvas, set the view range, show histograms
- TCanvas *c1 = new TCanvas("c1","Alice TOF hits quick analysis",400,10,600,700);
- c1->cd();
- hprodmom->Draw();
-
- TCanvas *c2 = new TCanvas("c2","Alice TOF hits quick analysis",400,10,600,700);
- c2->cd();
- hprodthe->Draw();
-
- TCanvas *c3 = new TCanvas("c3","Alice TOF hits quick analysis",400,10,600,700);
- c3->cd();
- hprodphi->Draw();
-
- TCanvas *c4 = new TCanvas("c4","Alice TOF hits quick analysis",400,10,600,700);
- c4->cd();
- hzcoor->Draw();
-
- TCanvas *c5 = new TCanvas("c5","Alice TOF hits quick analysis",400,10,600,700);
- c5->cd();
- hradius->Draw();
-
- TCanvas *c6 = new TCanvas("c6","Alice TOF hits quick analysis",400,10,600,700);
- c6->cd();
- htofprim->Draw();
-
- TCanvas *c7 = new TCanvas("c7","Alice TOF hits quick analysis",400,10,600,700);
- c7->cd();
- htofsec->Draw();
-
-
- TCanvas *c8 = new TCanvas("c8","Alice TOF hits quick analysis",400,10,600,700);
- c8->cd();
- htofmom->Draw();
-
- TCanvas *c9 = new TCanvas("c9","Alice TOF hits quick analysis",400,10,600,700);
- c9->cd();
- hincangle->Draw();
+ return rc;
}