X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOFT0.cxx;h=b3e992be3460c13c88882139aca871548fdddf2e;hb=dd8324349e5d59e51f863e5025d99ebcba1faf78;hp=0bb5c5485463d3beb98abc488462ef027ed80558;hpb=d3b3a3b24cc880365e409a578a50f49d17de9ff4;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOFT0.cxx b/TOF/AliTOFT0.cxx index 0bb5c548546..b3e992be346 100644 --- a/TOF/AliTOFT0.cxx +++ b/TOF/AliTOFT0.cxx @@ -92,6 +92,7 @@ #include #include +#include "AliLoader.h" #include "AliMC.h" #include "AliRun.h" @@ -172,6 +173,21 @@ AliTOFT0::AliTOFT0(const AliTOFT0 & tzero): ( (AliTOFT0 &)tzero ).Copy(*this); } +//____________________________________________________________________________ +AliTOFT0& AliTOFT0::operator = (const AliTOFT0 & tzero) +{ + if (this==&tzero) return *this; + + fNevents=tzero.fNevents; + fTimeResolution=tzero.fTimeResolution; + fLowerMomBound=tzero.fLowerMomBound; + fUpperMomBound=tzero.fUpperMomBound; + fT0File=tzero.fT0File; + fHeadersFile=tzero.fHeadersFile; + return *this; + +} + //____________________________________________________________________________ AliTOFT0::~AliTOFT0() { @@ -268,15 +284,15 @@ void AliTOFT0::Exec(Option_t *option) } if(strstr(option,"all")){ - AliInfo(Form("Selecting primary tracks with momentum between %d GeV/c and %d GeV/c", fLowerMomBound, fUpperMomBound)); - AliInfo("Memorandum: 0 means PION | 1 means KAON | 2 means PROTON") + AliInfo(Form("Selecting primary tracks with momentum between %f GeV/c and %f GeV/c", fLowerMomBound, fUpperMomBound)); + AliInfo("Memorandum: 0 means PION | 1 means KAON | 2 means PROTON"); } - if (fNevents == 0) fNevents = (Int_t) AliRunLoader::GetRunLoader()->TreeE()->GetEntries(); + if (fNevents == 0) fNevents = (Int_t) AliRunLoader::Instance()->TreeE()->GetEntries(); for (Int_t ievent = 0; ievent < fNevents; ievent++) { gAlice->GetEvent(ievent); - TTree *hitTree = detTOF->TreeH (); + TTree *hitTree = detTOF->GetLoader()->TreeH (); if (!hitTree) return; TParticle* particle; @@ -296,12 +312,12 @@ void AliTOFT0::Exec(Option_t *option) { if(nset>=5) break; // check on the number of set analyzed - gAlice->ResetHits(); + gAlice->GetMCApp()->ResetHits(); hitTree->GetEvent(track); - AliMC *mcApplication = (AliMC*)gAlice->GetMCApp(); + //AliMC *mcApplication = (AliMC*)gAlice->GetMCApp(); - particle = mcApplication->Particle(track); + //particle = mcApplication->Particle(track); Int_t nhits = tofHits->GetEntriesFast(); for (Int_t hit = 0; hit < nhits; hit++) @@ -446,8 +462,8 @@ void AliTOFT0::Exec(Option_t *option) if(strstr(option,"all")){ AliInfo(Form("True Assignment %d %d %d %d %d %d %d %d %d %d", truparticle[0], truparticle[1], truparticle[2], truparticle[3], truparticle[4], truparticle[5], truparticle[6], truparticle[7], truparticle[8], truparticle[9])); AliInfo(Form("Best Assignment %d %d %d %d %d %d %d %d %d %d", assparticle[0], assparticle[1], assparticle[2], assparticle[3], assparticle[4], assparticle[5], assparticle[6], assparticle[7], assparticle[8], assparticle[9])); - AliInfo(Form("Minimum ChiSquare for current set %d ", chisquare)); - AliInfo(Form("Confidence Level (Minimum ChiSquare) %d", confLevel)); + AliInfo(Form("Minimum ChiSquare for current set %f ", chisquare)); + AliInfo(Form("Confidence Level (Minimum ChiSquare) %f", confLevel)); } if (strstr(option,"visual") && itimes && (itimes%kUPDATE) == 0) { if (itimes == kUPDATE){ @@ -481,10 +497,10 @@ void AliTOFT0::Exec(Option_t *option) nmisidentified=(nmisidentified0+nmisidentified1+nmisidentified2+nmisidentified3+nmisidentified4+nmisidentified5+nmisidentified6+nmisidentified7+nmisidentified8+nmisidentified9); AliInfo(Form("total number of tracks token into account %i", 10*5*fNevents)); Float_t badPercentage=100.*(Float_t)nmisidentified/(10*5*fNevents); - AliInfo(Form("total misidentified %i (%d %) ", nmisidentified, badPercentage)); + AliInfo(Form("total misidentified %i (%f %%) ", nmisidentified, badPercentage)); AliInfo(Form("Total Number of set token into account %i", 5*fNevents)); Float_t goodSetPercentage=100.*(Float_t)ngood/(5*fNevents); - AliInfo(Form("Number of set with no misidentified tracks %i (%d %)", ngood, goodSetPercentage)); + AliInfo(Form("Number of set with no misidentified tracks %i (%f %%)", ngood, goodSetPercentage)); } // free used memory for canvas @@ -493,10 +509,12 @@ void AliTOFT0::Exec(Option_t *option) delete c3; c3=0; // generating output filename only if not previously specified using SetTZeroFile - char outFileName[70]; - strcpy(outFileName,"ht010tr120ps"); // global time resolution has to be converted from Int_t to char + + /*const*/ Int_t kSize = 70+fHeadersFile.Length()+1; + char outFileName[kSize]; + strncpy(outFileName,"ht010tr120ps",kSize); // global time resolution has to be converted from Int_t to char // in order to have in the output filename this parameter - strcat(outFileName,fHeadersFile); + strncat(outFileName,fHeadersFile,kSize); if(fT0File.IsNull()) fT0File=outFileName; @@ -523,7 +541,7 @@ void AliTOFT0::Exec(Option_t *option) void AliTOFT0::SetTZeroFile(char * file ) { // - // + // Set T0 file name // printf("Destination file : %s \n", file) ; fT0File=file; @@ -534,7 +552,7 @@ void AliTOFT0::SetTZeroFile(char * file ) void AliTOFT0::Print(Option_t* /*option*/)const { // - // + // Print class content // printf("------------------- %s -------------\n", GetName()) ; if(!fT0File.IsNull()) @@ -549,7 +567,9 @@ Bool_t AliTOFT0::operator==( AliTOFT0 const &tzero )const // Equal operator // - if( (fTimeResolution==tzero.fTimeResolution)&&(fLowerMomBound==tzero.fLowerMomBound)&&(fUpperMomBound==tzero.fUpperMomBound)) + if( (fTimeResolution==tzero.fTimeResolution)&& + (fLowerMomBound==tzero.fLowerMomBound)&& + (fUpperMomBound==tzero.fUpperMomBound)) return kTRUE ; else return kFALSE ;