X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOFSDigitizer.cxx;h=dab096a05633d2e158b44bb5aae35c5ee153894f;hb=fea9b33464c97e5e4e064b4cea5e8995cb8cb7e6;hp=54f076e5ff81d043ceec7463c8fdb12882a60bf5;hpb=797e311fc1d10181adc38a6206a67a318da48884;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOFSDigitizer.cxx b/TOF/AliTOFSDigitizer.cxx index 54f076e5ff8..dab096a0563 100644 --- a/TOF/AliTOFSDigitizer.cxx +++ b/TOF/AliTOFSDigitizer.cxx @@ -15,72 +15,188 @@ /* $Id$ */ -//_________________________________________________________________________ -// This is a TTask that constructs SDigits out of Hits -// A Summable Digits is the "sum" of all hits in a pad -// Detector response has been simulated via the method -// SimulateDetectorResponse -// -//-- Authors: F. Pierella, A. De Caro -// Use case: see AliTOFhits2sdigits.C macro in the CVS -////////////////////////////////////////////////////////////////////////////// - -#include -#include +//__________________________________________________________// +// // +// This is a TTask that constructs SDigits out of Hits // +// A Summable Digits is the "sum" of all hits in a pad // +// Detector response has been simulated via the method // +// SimulateDetectorResponse // +// // +// -- Authors: F. Pierella, A. De Caro // +// Use case: see AliTOFhits2sdigits.C macro in the CVS // +//__________________________________________________________// #include +#include #include #include -#include -#include #include -#include -#include -#include #include +#include +#include -#include "AliDetector.h" #include "AliLoader.h" -#include "AliRun.h" +#include "AliLog.h" +#include "AliMC.h" #include "AliRunLoader.h" -#include "AliTOF.h" +#include "AliRun.h" + #include "AliTOFGeometry.h" #include "AliTOFHitMap.h" -#include "AliTOFSDigit.h" -#include "AliTOFSDigitizer.h" -#include "AliTOFhit.h" #include "AliTOFhitT0.h" -#include "AliTOFv1.h" -#include "AliTOFv2.h" -#include "AliTOFv3.h" -#include "AliTOFv4.h" -#include "AliMC.h" +#include "AliTOFhit.h" +#include "AliTOFSDigitizer.h" +#include "AliTOFSDigit.h" +#include "AliTOF.h" + +extern TROOT *gROOT; ClassImp(AliTOFSDigitizer) //____________________________________________________________________________ - AliTOFSDigitizer::AliTOFSDigitizer():TTask("TOFSDigitizer","") +AliTOFSDigitizer::AliTOFSDigitizer(): + TTask("TOFSDigitizer",""), + fEvent1(-1), + fEvent2(-1), + ftail(0x0), + fHeadersFile(""), + fRunLoader(0x0), + fTOFLoader(0x0), + fSelectedSector(-1), + fSelectedPlate(-1), + fTimeResolution(0), + fpadefficiency(0), + fEdgeEffect(-1), + fEdgeTails(-1), + fHparameter(0), + fH2parameter(0), + fKparameter(0), + fK2parameter(0), + fEffCenter(0), + fEffBoundary(0), + fEff2Boundary(0), + fEff3Boundary(0), + fAddTRes(0), + fResCenter(0), + fResBoundary(0), + fResSlope(0), + fTimeWalkCenter(0), + fTimeWalkBoundary(0), + fTimeWalkSlope(0), + fTimeDelayFlag(-1), + fPulseHeightSlope(0), + fTimeDelaySlope(0), + fMinimumCharge(0), + fChargeSmearing(0), + fLogChargeSmearing(0), + fTimeSmearing(0), + fAverageTimeFlag(-1), + fAdcBin(0), + fAdcMean(0), + fAdcRms(0) { // ctor +} + +//------------------------------------------------------------------------ +AliTOFSDigitizer::AliTOFSDigitizer(const AliTOFSDigitizer &source): + TTask(source), + fEvent1(-1), + fEvent2(-1), + ftail(0x0), + fHeadersFile(""), + fRunLoader(0x0), + fTOFLoader(0x0), + fSelectedSector(-1), + fSelectedPlate(-1), + fTimeResolution(0), + fpadefficiency(0), + fEdgeEffect(-1), + fEdgeTails(-1), + fHparameter(0), + fH2parameter(0), + fKparameter(0), + fK2parameter(0), + fEffCenter(0), + fEffBoundary(0), + fEff2Boundary(0), + fEff3Boundary(0), + fAddTRes(0), + fResCenter(0), + fResBoundary(0), + fResSlope(0), + fTimeWalkCenter(0), + fTimeWalkBoundary(0), + fTimeWalkSlope(0), + fTimeDelayFlag(-1), + fPulseHeightSlope(0), + fTimeDelaySlope(0), + fMinimumCharge(0), + fChargeSmearing(0), + fLogChargeSmearing(0), + fTimeSmearing(0), + fAverageTimeFlag(-1), + fAdcBin(0), + fAdcMean(0), + fAdcRms(0) +{ + // copy constructor + //this->fTOFGeometry=source.fTOFGeometry; + +} - fRunLoader = 0; - fTOFLoader = 0; +//____________________________________________________________________________ +AliTOFSDigitizer& AliTOFSDigitizer::operator=(const AliTOFSDigitizer &/*source*/) +{ + // ass. op. + return *this; - fEvent1 = 0; - fEvent2 = 0; - ftail = 0; - fSelectedSector = -1; - fSelectedPlate = -1; } //____________________________________________________________________________ -AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_t nEvents):TTask("TOFSDigitizer","") +AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_t nEvents): + TTask("TOFSDigitizer",""), + fEvent1(-1), + fEvent2(-1), + ftail(0x0), + fHeadersFile(HeaderFile), // input filename (with hits) + fRunLoader(0x0), + fTOFLoader(0x0), + fSelectedSector(-1), // by default we sdigitize all sectors + fSelectedPlate(-1), // by default we sdigitize all plates in all sectors + fTimeResolution(0), + fpadefficiency(0), + fEdgeEffect(-1), + fEdgeTails(-1), + fHparameter(0), + fH2parameter(0), + fKparameter(0), + fK2parameter(0), + fEffCenter(0), + fEffBoundary(0), + fEff2Boundary(0), + fEff3Boundary(0), + fAddTRes(0), + fResCenter(0), + fResBoundary(0), + fResSlope(0), + fTimeWalkCenter(0), + fTimeWalkBoundary(0), + fTimeWalkSlope(0), + fTimeDelayFlag(-1), + fPulseHeightSlope(0), + fTimeDelaySlope(0), + fMinimumCharge(0), + fChargeSmearing(0), + fLogChargeSmearing(0), + fTimeSmearing(0), + fAverageTimeFlag(-1), + fAdcBin(0), + fAdcMean(0), + fAdcRms(0) { - ftail = 0; - fSelectedSector=-1; // by default we sdigitize all sectors - fSelectedPlate =-1; // by default we sdigitize all plates in all sectors + //ctor, reading from input file - fHeadersFile = HeaderFile ; // input filename (with hits) TFile * file = (TFile*) gROOT->GetFile(fHeadersFile.Data()); //File was not opened yet open file and get alirun object @@ -90,14 +206,35 @@ AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_ } // add Task to //root/Tasks folder - fRunLoader = AliRunLoader::Open(HeaderFile);//open session and mount on default event folder + TString evfoldname = AliConfig::GetDefaultEventFolderName(); + 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"); + AliFatal("Event is not loaded. Exiting"); return; } - fRunLoader->LoadHeader(); + /* + fRunLoader->CdGAFile(); + TDirectory *savedir=gDirectory; + TFile *in=(TFile*)gFile; + + +// when fTOFGeometry was needed + if (!in->IsOpen()) { + AliWarning("Geometry file is not open default TOF geometry will be used"); + fTOFGeometry = new AliTOFGeometry(); + } + else { + in->cd(); + fTOFGeometry = (AliTOFGeometry*)in->Get("TOFgeometry"); + } + + savedir->cd(); + */ + if (fRunLoader->TreeE() == 0x0) fRunLoader->LoadHeader(); if (evNumber1>=0) fEvent1 = evNumber1; else fEvent1=0; @@ -107,10 +244,10 @@ AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_ else fEvent2 = 1; if (!(fEvent2>fEvent1)) { - cout << " ERROR: fEvent2 = " << fEvent2 << " <= fEvent1 = " << fEvent1 << endl; + AliError(Form("fEvent2 = %d <= fEvent1 = %d", fEvent2, fEvent1)); fEvent1 = 0; fEvent2 = 1; - cout << " Correction: fEvent2 = " << fEvent2 << " <= fEvent1 = " << fEvent1 << endl; + AliError(Form("Correction: fEvent2 = %d <= fEvent1 = %d", fEvent2, fEvent1)); } // init parameters for sdigitization @@ -119,7 +256,7 @@ AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_ fTOFLoader = fRunLoader->GetLoader("TOFLoader"); if (fTOFLoader == 0x0) { - Fatal("AliTOFSDigitizer","Can not find TOF loader in event. Exiting."); + AliFatal("Can not find TOF loader in event. Exiting."); return; } fTOFLoader->PostSDigitizer(this); @@ -130,6 +267,7 @@ AliTOFSDigitizer::~AliTOFSDigitizer() { // dtor fTOFLoader->CleanSDigitizer(); + } //____________________________________________________________________________ @@ -137,8 +275,8 @@ void AliTOFSDigitizer::InitParameters() { // set parameters for detector simulation - fTimeResolution =0.120; - fpadefficiency =0.99 ; + fTimeResolution = 0.080; //0.120; OLD + fpadefficiency = 0.99 ; fEdgeEffect = 2 ; fEdgeTails = 0 ; fHparameter = 0.4 ; @@ -149,9 +287,12 @@ void AliTOFSDigitizer::InitParameters() fEffBoundary = 0.65; fEff2Boundary = 0.90; fEff3Boundary = 0.08; - fResCenter = 50. ; + fAddTRes = 68. ; // \sqrt{2x20^2 + 15^2 + 2x10^2 + 30^2 + 50^2} (p-p) + //fAddTRes = 48. ; // \sqrt{2x20^2 + 15^2 + 2x10^2 + 30^2 + 15^2} (Pb-Pb) + // 30^2+20^2+40^2+50^2+50^2+50^2 = 10400 ps^2 (very old value) + fResCenter = 35. ; //50. ; // OLD fResBoundary = 70. ; - fResSlope = 40. ; + fResSlope = 37. ; //40. ; // OLD fTimeWalkCenter = 0. ; fTimeWalkBoundary=0. ; fTimeWalkSlope = 0. ; @@ -164,7 +305,7 @@ void AliTOFSDigitizer::InitParameters() fLogChargeSmearing=0.13; fTimeSmearing =0.022; fAverageTimeFlag=0 ; - fTdcBin = 50.; // 1 TDC bin = 50 ps + fAdcBin = 0.25; // 1 ADC bin = 0.25 pC (or 0.03 pC) fAdcMean = 50.; // ADC distribution mpv value for Landau (in bins) // it corresponds to a mean value of ~100 bins @@ -188,10 +329,9 @@ Double_t TimeWithTail(Double_t* x, Double_t* par) return f; } - //____________________________________________________________________________ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { - + //execute TOF sdigitization if (strstr(verboseOption,"tim") || strstr(verboseOption,"all")) gBenchmark->Start("TOFSDigitizer"); @@ -208,15 +348,15 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { Bool_t thereIsNotASelection=(fSelectedSector==-1) && (fSelectedPlate==-1); - fRunLoader->LoadgAlice(); + if (fRunLoader->GetAliRun() == 0x0) fRunLoader->LoadgAlice(); gAlice = fRunLoader->GetAliRun(); fRunLoader->LoadKinematics(); - AliTOF *TOF = (AliTOF *) gAlice->GetDetector("TOF"); + AliTOF *tof = (AliTOF *) gAlice->GetDetector("TOF"); - if (!TOF) { - Error("AliTOFSDigitizer","TOF not found"); + if (!tof) { + AliError("TOF not found"); return; } @@ -224,29 +364,29 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { fTOFLoader->LoadSDigits("recreate"); for (Int_t iEvent=fEvent1; iEventGetEvent(iEvent); - TTree *TH = fTOFLoader->TreeH (); - if (!TH) return; + TTree *hitTree = fTOFLoader->TreeH (); + if (!hitTree) return; if (fTOFLoader->TreeS () == 0) fTOFLoader->MakeTree ("S"); //Make branch for digits - TOF->MakeBranch("S"); + tof->MakeBranch("S"); // recreate TClonesArray fSDigits - for backward compatibility - if (TOF->SDigits() == 0) { - TOF->CreateSDigitsArray(); + if (tof->SDigits() == 0) { + tof->CreateSDigitsArray(); } else { - TOF->RecreateSDigitsArray(); + tof->RecreateSDigitsArray(); } - TOF->SetTreeAddress(); + tof->SetTreeAddress(); - Int_t version=TOF->IsVersion(); + Int_t version=tof->IsVersion(); Int_t nselectedHitsinEv=0; Int_t ntotalsdigitsinEv=0; @@ -256,20 +396,24 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { TParticle *particle; //AliTOFhit *tofHit; - TClonesArray *TOFhits = TOF->Hits(); + TClonesArray *tofHitArray = tof->Hits(); // create hit map - AliTOFHitMap *hitMap = new AliTOFHitMap(TOF->SDigits()); + // AliTOFHitMap *hitMap = new AliTOFHitMap(tof->SDigits(), fTOFGeometry); + AliTOFHitMap *hitMap = new AliTOFHitMap(tof->SDigits()); - TBranch * tofHitsBranch = TH->GetBranch("TOF"); + TBranch * tofHitsBranch = hitTree->GetBranch("TOF"); - Int_t ntracks = static_cast(TH->GetEntries()); + Int_t ntracks = static_cast(hitTree->GetEntries()); for (Int_t track = 0; track < ntracks; track++) { - gAlice->ResetHits(); + gAlice->GetMCApp()->ResetHits(); tofHitsBranch->GetEvent(track); - particle = gAlice->GetMCApp()->Particle(track); - Int_t nhits = TOFhits->GetEntriesFast(); + + AliMC *mcApplication = (AliMC*)gAlice->GetMCApp(); + + particle = mcApplication->Particle(track); + Int_t nhits = tofHitArray->GetEntriesFast(); // cleaning all hits of the same track in the same pad volume // it is a rare event, however it happens @@ -282,40 +426,46 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { for (Int_t hit = 0; hit < nhits; hit++) { Int_t vol[5]; // location for a digit - Float_t digit[2]; // TOF digit variables + Int_t digit[2]; // TOF digit variables Int_t tracknum; - Float_t Xpad; - Float_t Zpad; + Float_t dxPad; + Float_t dzPad; Float_t geantTime; // fp: really sorry for this, it is a temporary trick to have // track length too - if(version!=6){ - AliTOFhit *tofHit = (AliTOFhit *) TOFhits->UncheckedAt(hit); + if (version<6) { //(version!=6 && version!=7) + AliTOFhit *tofHit = (AliTOFhit *) tofHitArray->UncheckedAt(hit); tracknum = tofHit->GetTrack(); vol[0] = tofHit->GetSector(); vol[1] = tofHit->GetPlate(); vol[2] = tofHit->GetStrip(); vol[3] = tofHit->GetPadx(); vol[4] = tofHit->GetPadz(); - Xpad = tofHit->GetDx(); - Zpad = tofHit->GetDz(); + dxPad = tofHit->GetDx(); + dzPad = tofHit->GetDz(); geantTime = tofHit->GetTof(); // unit [s] } else { - AliTOFhitT0 *tofHit = (AliTOFhitT0 *) TOFhits->UncheckedAt(hit); + AliTOFhitT0 *tofHit = (AliTOFhitT0 *) tofHitArray->UncheckedAt(hit); tracknum = tofHit->GetTrack(); vol[0] = tofHit->GetSector(); vol[1] = tofHit->GetPlate(); vol[2] = tofHit->GetStrip(); vol[3] = tofHit->GetPadx(); vol[4] = tofHit->GetPadz(); - Xpad = tofHit->GetDx(); - Zpad = tofHit->GetDz(); + dxPad = tofHit->GetDx(); + dzPad = tofHit->GetDz(); geantTime = tofHit->GetTof(); // unit [s] } geantTime *= 1.e+09; // conversion from [s] to [ns] - + // TOF matching window (~200ns) control + if (geantTime>=AliTOFGeometry::MatchingWindow()*1E-3) { + AliDebug(2,Form("Time measurement (%f) greater than the matching window (%f)", + geantTime, AliTOFGeometry::MatchingWindow()*1E-3)); + continue; + } + // selection case for sdigitizing only hits in a given plate of a given sector if(thereIsNotASelection || (vol[0]==fSelectedSector && vol[1]==fSelectedPlate)){ @@ -339,8 +489,8 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { nselectedHitsinEv++; if (particle->GetFirstMother() < 0) nHitsFromPrim++; // counts hits due to primary particles - Float_t xStrip=AliTOFGeometry::XPad()*(vol[3]+0.5-0.5*AliTOFGeometry::NpadX())+Xpad; - Float_t zStrip=AliTOFGeometry::ZPad()*(vol[4]+0.5-0.5*AliTOFGeometry::NpadZ())+Zpad; + Float_t xStrip=AliTOFGeometry::XPad()*(vol[3]+0.5-0.5*AliTOFGeometry::NpadX())+dxPad; + Float_t zStrip=AliTOFGeometry::ZPad()*(vol[4]+0.5-0.5*AliTOFGeometry::NpadZ())+dzPad; Int_t nActivatedPads = 0, nFiredPads = 0; Bool_t isFired[4] = {kFALSE, kFALSE, kFALSE, kFALSE}; @@ -353,10 +503,17 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { for(Int_t indexOfPad=0; indexOfPad=AliTOFGeometry::MatchingWindow()*1E-3) { + AliDebug(2,Form("Time measurement (%f) greater than the matching window (%f)", + tofAfterSimul[indexOfPad], AliTOFGeometry::MatchingWindow()*1E-3)); + continue; + } + + if(timediff>=0.2) nlargeTofDiff++; // greater than 200ps - if(timediff>=0.2) nlargeTofDiff++; - - digit[0] = (Int_t) ((tofAfterSimul[indexOfPad]*1.e+03)/fTdcBin); // TDC bin number (each bin -> 50. ps) + digit[0] = (Int_t) ((tofAfterSimul[indexOfPad]*1.e+03)/AliTOFGeometry::TdcBinWidth()); // TDC bin number (each bin -> 24.4 ps) Float_t landauFactor = gRandom->Landau(fAdcMean, fAdcRms); digit[1] = (Int_t) (qInduced[indexOfPad] * landauFactor); // ADC bins (each bin -> 0.25 (or 0.03) pC) @@ -372,12 +529,12 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { AliTOFSDigit *sdig = static_cast(hitMap->GetHit(vol)); Int_t tdctime = (Int_t) digit[0]; Int_t adccharge = (Int_t) digit[1]; - sdig->Update(fTdcBin,tdctime,adccharge,tracknum); + sdig->Update(AliTOFGeometry::TdcBinWidth(),tdctime,adccharge,tracknum); ntotalupdatesinEv++; ntotalupdates++; } else { - TOF->AddSDigit(tracknum, vol, digit); + tof->AddSDigit(tracknum, vol, digit); if(indexOfPad){ nnoisesdigits++; @@ -404,17 +561,16 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { fTOFLoader->TreeS()->Fill(); fTOFLoader->WriteSDigits("OVERWRITE"); - if (TOF->SDigits()) TOF->ResetSDigits(); + if (tof->SDigits()) tof->ResetSDigits(); - if (strstr(verboseOption,"all")) { - cout << "---------------------------------------- \n"; - cout << " \n"; - cout << "After sdigitizing " << nselectedHitsinEv << " hits" << " in event " << iEvent << endl; + if (strstr(verboseOption,"all") || strstr(verboseOption,"partial")) { + AliDebug(2,"----------------------------------------"); + AliDebug(2,Form("After sdigitizing %d hits in event %d", nselectedHitsinEv, iEvent)); //" (" << nHitsFromPrim << " from primaries and " << nHitsFromSec << " from secondaries) TOF hits, " - cout << ntotalsdigitsinEv << " digits have been created \n"; - cout << "(" << nsignalsdigitsinEv << " due to signals and " << nnoisesdigitsinEv << " due to border effect) \n"; - cout << ntotalupdatesinEv << " total updates of the hit map have been performed in current event \n"; - cout << "---------------------------------------- \n"; + AliInfo(Form("%d sdigits have been created", ntotalsdigitsinEv)); + AliDebug(2,Form("(%d due to signals and %d due to border effect)", nsignalsdigitsinEv, nnoisesdigitsinEv)); + AliDebug(2,Form("%d total updates of the hit map have been performed in current event", ntotalupdatesinEv)); + AliDebug(2,"----------------------------------------"); } } //event loop on events @@ -431,28 +587,24 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { } nHitsFromSec=nselectedHits-nHitsFromPrim; - if(strstr(verboseOption,"all")){ - cout << "---------------------------------------- \n"; - cout << "---------------------------------------- \n"; - cout << "-----------SDigitization Summary-------- \n"; - cout << " \n"; - cout << "After sdigitizing " << nselectedHits << " hits \n"; - cout << "in " << (fEvent2-fEvent1) << " events \n"; -//" (" << nHitsFromPrim << " from primaries and " << nHitsFromSec << " from secondaries) TOF hits, " - cout << ntotalsdigits << " sdigits have been created \n"; - cout << "(" << nsignalsdigits << " due to signals and " - << nnoisesdigits << " due to border effect) \n"; - cout << ntotalupdates << " total updates of the hit map have been performed \n"; - cout << "in " << nlargeTofDiff << " cases the time of flight difference is greater than 200 ps \n"; + if (strstr(verboseOption,"all") || strstr(verboseOption,"partial")) { + AliDebug(2,"----------------------------------------"); + AliDebug(2,Form("After sdigitizing %d hits in %d events ", nselectedHits, fEvent2-fEvent1)); + //" (" << nHitsFromPrim << " from primaries and " << nHitsFromSec << " from secondaries) TOF hits, " + AliDebug(2,Form("%d sdigits have been created", ntotalsdigits)); + AliDebug(2,Form("(%d due to signals and %d due to border effect)", nsignalsdigits, nnoisesdigits)); + AliDebug(2,Form("%d total updates of the hit map have been performed", ntotalupdates)); + AliDebug(2,Form("in %d cases the time of flight difference is greater than 200 ps", nlargeTofDiff)); + AliDebug(2,"----------------------------------------"); } if(strstr(verboseOption,"tim") || strstr(verboseOption,"all")){ gBenchmark->Stop("TOFSDigitizer"); - cout << "AliTOFSDigitizer: \n"; - cout << " took " << gBenchmark->GetCpuTime("TOFSDigitizer") << " seconds in order to make sdigits " - << gBenchmark->GetCpuTime("TOFSDigitizer")/(fEvent2-fEvent1) << " seconds per event \n"; - cout << " +++++++++++++++++++++++++++++++++++++++++++++++++++ \n"; + AliInfo("AliTOFSDigitizer:"); + AliInfo(Form(" took %f seconds in order to make sdigits " + "%f seconds per event", gBenchmark->GetCpuTime("TOFSDigitizer"), gBenchmark->GetCpuTime("TOFSDigitizer")/(fEvent2-fEvent1))); + AliInfo(" +++++++++++++++++++++++++++++++++++++++++++++++++++ "); } } @@ -460,23 +612,23 @@ void AliTOFSDigitizer::Exec(Option_t *verboseOption) { //__________________________________________________________________ void AliTOFSDigitizer::Print(Option_t* /*opt*/)const { - cout << "------------------- "<< GetName() << " ------------- \n"; + AliInfo(Form(" ------------------- %s ------------- ", GetName())); } //__________________________________________________________________ void AliTOFSDigitizer::SelectSectorAndPlate(Int_t sector, Int_t plate) { + //Select sector and plate Bool_t isaWrongSelection=(sector < 0) || (sector >= AliTOFGeometry::NSectors()) || (plate < 0) || (plate >= AliTOFGeometry::NPlates()); if(isaWrongSelection){ - cout << "You have selected an invalid value for sector or plate " << endl; - cout << "The correct range for sector is [0,"<< AliTOFGeometry::NSectors()-1 <<"]\n"; - cout << "The correct range for plate is [0,"<< AliTOFGeometry::NPlates()-1 <<"]\n"; - cout << "By default we continue sdigitizing all hits in all plates of all sectors \n"; + AliError("You have selected an invalid value for sector or plate "); + AliError(Form("The correct range for sector is [0,%d]", AliTOFGeometry::NSectors()-1)); + AliError(Form("The correct range for plate is [0,%d]", AliTOFGeometry::NPlates()-1)); + AliError("By default we continue sdigitizing all hits in all plates of all sectors"); } else { fSelectedSector=sector; fSelectedPlate =plate; - cout << "SDigitizing only hits in plate " << fSelectedPlate << " of the sector " - << fSelectedSector << endl; + AliInfo(Form("SDigitizing only hits in plate %d of the sector %d", fSelectedPlate, fSelectedSector)); } } @@ -549,7 +701,7 @@ void AliTOFSDigitizer::SimulateDetectorResponse(Float_t z0, Float_t x0, Float_t eff[nActivatedPads-1] = fEffCenter; if (gRandom->Rndm() < eff[nActivatedPads-1]) { nFiredPads = 1; - res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + fResCenter * fResCenter); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns; + res[nActivatedPads-1] = 0.001 * TMath::Sqrt(fAddTRes*fAddTRes + fResCenter * fResCenter); // ns isFired[nActivatedPads-1] = kTRUE; tofTime[nActivatedPads-1] = gRandom->Gaus(geantTime + fTimeWalkCenter, res[0]); averageTime = tofTime[nActivatedPads-1]; @@ -587,7 +739,7 @@ void AliTOFSDigitizer::SimulateDetectorResponse(Float_t z0, Float_t x0, Float_t } (effZ