X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOF.cxx;h=96053d25ce70cd32a58602de0e5d0f854daff3d0;hb=b0d8f3fc8c91f8b286cab87e2d926b8b3e905968;hp=164de8abc127d5755a13826052c1319f3d688c5d;hpb=e939a978a98d29901b86bdb02cdcaf5157e717de;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOF.cxx b/TOF/AliTOF.cxx index 164de8abc12..96053d25ce7 100644 --- a/TOF/AliTOF.cxx +++ b/TOF/AliTOF.cxx @@ -39,12 +39,14 @@ */ //End_Html -#include "TFile.h" -#include "TFolder.h" -#include "TROOT.h" -#include "TTask.h" -#include "TTree.h" -#include "TVirtualMC.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "AliConst.h" #include "AliLoader.h" @@ -88,6 +90,10 @@ AliTOF::AliTOF(): // // Default constructor // + + //by default all sectors switched on + for (Int_t ii=0; ii<18; ii++) fTOFSectors[ii]=0; + fDigits = 0; fIshunt = 0; fName = "TOF"; @@ -118,6 +124,9 @@ AliTOF::AliTOF(const char *name, const char *title, Option_t *option) //skowron fTOFGeometry = new AliTOFGeometry(); + //by default all sectors switched on + for (Int_t ii=0; ii<18; ii++) fTOFSectors[ii]=0; + if (strstr(option,"tzero")){ fHits = new TClonesArray("AliTOFhitT0", 1000); fTZero = kTRUE; @@ -317,7 +326,7 @@ void AliTOF::AddT0Hit(Int_t track, Int_t *vol, Float_t *hits) } //_____________________________________________________________________________ -void AliTOF::AddDigit(Int_t *tracks, Int_t *vol, Float_t *digits) +void AliTOF::AddDigit(Int_t *tracks, Int_t *vol, Int_t *digits) { // // Add a TOF digit @@ -328,7 +337,7 @@ void AliTOF::AddDigit(Int_t *tracks, Int_t *vol, Float_t *digits) } //_____________________________________________________________________________ -void AliTOF::AddSDigit(Int_t tracknum, Int_t *vol, Float_t *digits) +void AliTOF::AddSDigit(Int_t tracknum, Int_t *vol, Int_t *digits) { // @@ -402,7 +411,16 @@ void AliTOF::CreateGeometry() Float_t xTof, yTof; - if (IsVersion()==7) { + if (IsVersion()==8) { + + xTof = 124.5;//fTOFGeometry->StripLength()+2.*(0.3+0.03); // cm, x-dimension of FTOA volume + yTof = fTOFGeometry->Rmax()-fTOFGeometry->Rmin(); // cm, y-dimension of FTOA volume + Float_t zTof = fTOFGeometry->ZlenA(); // cm, z-dimension of FTOA volume + + // TOF module internal definitions + TOFpc(xTof, yTof, zTof); + + } else if (IsVersion()==7) { xTof = 124.5;//fTOFGeometry->StripLength()+2.*(0.3+0.03); // cm, x-dimension of FTOA volume yTof = fTOFGeometry->Rmax()-fTOFGeometry->Rmin(); // cm, y-dimension of FTOA volume @@ -609,10 +627,9 @@ void AliTOF::Hits2SDigits(Int_t evNumber1, Int_t evNumber2) // if ((evNumber2-evNumber1)==1) - AliDebug(1, Form("I am making sdigits for the %dth event", evNumber1)) - else if ((evNumber2-evNumber1)>1) - AliDebug(1, Form("I am making sdigits for the events from the " - "%dth to the %dth", evNumber1, evNumber2-1)); + AliDebug(1, Form("I am making sdigits for the %dth event", evNumber1)); + if ((evNumber2-evNumber1)>1) + AliDebug(1, Form("I am making sdigits for the events from the %dth to the %dth", evNumber1, evNumber2-1)); AliRunLoader * rl = fLoader->GetRunLoader(); AliTOFSDigitizer sd((rl->GetFileName()).Data(),evNumber1,evNumber2) ; @@ -629,7 +646,7 @@ AliDigitizer* AliTOF::CreateDigitizer(AliRunDigitizer* manager) const } //___________________________________________________________________________ -Bool_t AliTOF::CheckOverlap(Int_t* vol, Float_t* digit,Int_t Track) +Bool_t AliTOF::CheckOverlap(Int_t* vol, Int_t* digit,Int_t Track) { // // Checks if 2 or more hits belong to the same pad. @@ -653,8 +670,8 @@ Bool_t AliTOF::CheckOverlap(Int_t* vol, Float_t* digit,Int_t Track) if (vol[i]!=vol2[i]) idem=kFALSE;} if (idem){ // same pad fired - Float_t tdc2 = digit[0]; - Float_t tdc1 = currentDigit->GetTdc(); + Int_t tdc2 = digit[0]; + Int_t tdc1 = currentDigit->GetTdc(); // we separate two digits on the same pad if // they are separated in time by at least 25 ns @@ -674,7 +691,7 @@ Bool_t AliTOF::CheckOverlap(Int_t* vol, Float_t* digit,Int_t Track) overlap = kTRUE; return overlap; } else - overlap= kFALSE; + overlap= kFALSE; } // close if (idem) -> two digits on the same TOF pad @@ -689,6 +706,9 @@ void AliTOF::Digits2Raw() // Starting from the TOF digits, writes the Raw Data objects // + TStopwatch stopwatch; + stopwatch.Start(); + fLoader->LoadDigits(); TTree* digits = fLoader->TreeD(); @@ -697,15 +717,22 @@ void AliTOF::Digits2Raw() return; } - //AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),"read"); + /* fRunLoader->CdGAFile(); TFile *in=(TFile*)gFile; in->cd(); AliTOFGeometry *geometry = (AliTOFGeometry*)in->Get("TOFgeometry"); - - AliTOFDDLRawData rawWriter(geometry); + */ + AliTOFDDLRawData rawWriter; //AliTOFDDLRawData rawWriter; rawWriter.SetVerbose(0); + //rawWriter.SetFakeOrphaneProduction(kTRUE); + //rawWriter.SetPackedAcquisitionMode(kFALSE); + if (rawWriter.GetPackedAcquisitionMode()) { + if(rawWriter.GetMatchingWindow()>8192) + AliWarning(Form("You are running in packing mode and the matching window is %.2f ns, i.e. greater than 199.8848 ns", + rawWriter.GetMatchingWindow()*AliTOFGeometry::TdcBinWidth()*1.e-03)); + } AliDebug(1,"Formatting raw data for TOF"); digits->GetEvent(0); @@ -713,6 +740,9 @@ void AliTOF::Digits2Raw() fLoader->UnloadDigits(); + AliDebug(1, Form("Execution time to write TOF raw data : R:%.2fs C:%.2fs", + stopwatch.RealTime(),stopwatch.CpuTime())); + } //____________________________________________________________________________