X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliEMCALQADataMakerSim.cxx;h=318bd2b3469248c08113ff07957a683f6ee2d361;hb=0c1bd98e74bb0cdbfcec4dc01f7d8d2dc10fb7f0;hp=855d1a69330da859375f3817690983f6278d93f9;hpb=7d297381c12cca29a9615cd416f7b7291ab32450;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliEMCALQADataMakerSim.cxx b/EMCAL/AliEMCALQADataMakerSim.cxx index 855d1a69330..318bd2b3469 100644 --- a/EMCAL/AliEMCALQADataMakerSim.cxx +++ b/EMCAL/AliEMCALQADataMakerSim.cxx @@ -82,10 +82,10 @@ void AliEMCALQADataMakerSim::InitHits() const Bool_t expert = kTRUE ; const Bool_t image = kTRUE ; - TH1F * h0 = new TH1F("hEmcalHits", "Hits energy distribution in EMCAL", 200, 0., 2.) ; //GeV + TH1F * h0 = new TH1F("hEmcalHits", "Hits energy distribution in EMCAL;Energy [MeV];Counts", 200, 0., 2.) ; //GeV h0->Sumw2() ; Add2HitsList(h0, 0, !expert, image) ; - TH1I * h1 = new TH1I("hEmcalHitsMul", "Hits multiplicity distribution in EMCAL", 1000, 0, 10000) ; + TH1I * h1 = new TH1I("hEmcalHitsMul", "Hits multiplicity distribution in EMCAL;# of Hits;Entries", 1000, 0, 10000) ; h1->Sumw2() ; Add2HitsList(h1, 1, !expert, image) ; } @@ -97,10 +97,10 @@ void AliEMCALQADataMakerSim::InitDigits() const Bool_t expert = kTRUE ; const Bool_t image = kTRUE ; - TH1I * h0 = new TH1I("hEmcalDigits", "Digits amplitude distribution in EMCAL", 500, 0, 500) ; + TH1I * h0 = new TH1I("hEmcalDigits", "Digits amplitude distribution in EMCAL;Amplitude [ADC counts];Counts", 500, 0, 500) ; h0->Sumw2() ; Add2DigitsList(h0, 0, !expert, image) ; - TH1I * h1 = new TH1I("hEmcalDigitsMul", "Digits multiplicity distribution in EMCAL", 200, 0, 2000) ; + TH1I * h1 = new TH1I("hEmcalDigitsMul", "Digits multiplicity distribution in EMCAL;# of Digits;Entries", 200, 0, 2000) ; h1->Sumw2() ; Add2DigitsList(h1, 1, !expert, image) ; } @@ -112,21 +112,21 @@ void AliEMCALQADataMakerSim::InitSDigits() const Bool_t expert = kTRUE ; const Bool_t image = kTRUE ; - TH1F * h0 = new TH1F("hEmcalSDigits", "SDigits energy distribution in EMCAL", 200, 0., 20.) ; + TH1F * h0 = new TH1F("hEmcalSDigits", "SDigits energy distribution in EMCAL;Energy [MeV];Counts", 200, 0., 20.) ; h0->Sumw2() ; Add2SDigitsList(h0, 0, !expert, image) ; - TH1I * h1 = new TH1I("hEmcalSDigitsMul", "SDigits multiplicity distribution in EMCAL", 500, 0, 5000) ; + TH1I * h1 = new TH1I("hEmcalSDigitsMul", "SDigits multiplicity distribution in EMCAL;# of SDigits;Entries", 500, 0, 5000) ; h1->Sumw2() ; Add2SDigitsList(h1, 1, !expert, image) ; } //____________________________________________________________________________ -void AliEMCALQADataMakerSim::MakeHits(TClonesArray * hits) +void AliEMCALQADataMakerSim::MakeHits() { //make QA data from Hits - - GetHitsData(1)->Fill(hits->GetEntriesFast()) ; - TIter next(hits) ; + + GetHitsData(1)->Fill(fHitsArray->GetEntriesFast()) ; + TIter next(fHitsArray) ; AliEMCALHit * hit ; while ( (hit = dynamic_cast(next())) ) { GetHitsData(0)->Fill( hit->GetEnergy()) ; @@ -139,36 +139,31 @@ void AliEMCALQADataMakerSim::MakeHits(TTree * hitTree) { // make QA data from Hit Tree - TClonesArray * hits = new TClonesArray("AliEMCALHit", 1000); + if (fHitsArray) + fHitsArray->Clear() ; + else + fHitsArray = new TClonesArray("AliEMCALHit", 1000); TBranch * branch = hitTree->GetBranch("EMCAL") ; if ( ! branch ) { AliWarning("EMCAL branch in Hit Tree not found") ; } else { - TClonesArray * tmp = new TClonesArray("AliEMCALHit", 1000) ; - branch->SetAddress(&tmp) ; - Int_t index = 0 ; + branch->SetAddress(&fHitsArray) ; for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) { branch->GetEntry(ientry) ; - for (Int_t ihit = 0 ; ihit < tmp->GetEntries() ; ihit++) { - AliEMCALHit * hit = dynamic_cast (tmp->At(ihit)) ; - new((*hits)[index]) AliEMCALHit(*hit) ; - index++ ; - } - } - tmp->Delete() ; - delete tmp ; - MakeHits(hits) ; + MakeHits() ; + fHitsArray->Clear() ; + } } } //____________________________________________________________________________ -void AliEMCALQADataMakerSim::MakeDigits(TClonesArray * digits) +void AliEMCALQADataMakerSim::MakeDigits() { // makes data from Digits - - GetDigitsData(1)->Fill(digits->GetEntriesFast()) ; - TIter next(digits) ; + + GetDigitsData(1)->Fill(fDigitsArray->GetEntriesFast()) ; + TIter next(fDigitsArray) ; AliEMCALDigit * digit ; while ( (digit = dynamic_cast(next())) ) { GetDigitsData(0)->Fill( digit->GetAmp()) ; @@ -180,29 +175,33 @@ void AliEMCALQADataMakerSim::MakeDigits(TClonesArray * digits) void AliEMCALQADataMakerSim::MakeDigits(TTree * digitTree) { // makes data from Digit Tree - TClonesArray * digits = new TClonesArray("AliEMCALDigit", 1000) ; + if (fDigitsArray) + fDigitsArray->Clear() ; + else + fDigitsArray = new TClonesArray("AliEMCALDigit", 1000) ; TBranch * branch = digitTree->GetBranch("EMCAL") ; if ( ! branch ) { AliWarning("EMCAL branch in Digit Tree not found") ; } else { - branch->SetAddress(&digits) ; + branch->SetAddress(&fDigitsArray) ; branch->GetEntry(0) ; - MakeDigits(digits) ; + MakeDigits() ; } } //____________________________________________________________________________ -void AliEMCALQADataMakerSim::MakeSDigits(TClonesArray * sdigits) +void AliEMCALQADataMakerSim::MakeSDigits() { // makes data from SDigits //Need a copy of the SDigitizer to calibrate the sdigit amplitude to //energy in GeV + AliEMCALSDigitizer* sDigitizer = new AliEMCALSDigitizer(); - GetSDigitsData(1)->Fill(sdigits->GetEntriesFast()) ; - TIter next(sdigits) ; + GetSDigitsData(1)->Fill(fSDigitsArray->GetEntriesFast()) ; + TIter next(fSDigitsArray) ; AliEMCALDigit * sdigit ; while ( (sdigit = dynamic_cast(next())) ) { GetSDigitsData(0)->Fill( sDigitizer->Calibrate(sdigit->GetAmp())) ; @@ -215,15 +214,18 @@ void AliEMCALQADataMakerSim::MakeSDigits(TClonesArray * sdigits) void AliEMCALQADataMakerSim::MakeSDigits(TTree * sdigitTree) { // makes data from SDigit Tree - TClonesArray * sdigits = new TClonesArray("AliEMCALDigit", 1000) ; + if (fSDigitsArray) + fSDigitsArray->Clear() ; + else + fSDigitsArray = new TClonesArray("AliEMCALDigit", 1000) ; TBranch * branch = sdigitTree->GetBranch("EMCAL") ; if ( ! branch ) { AliWarning("EMCAL branch in SDigit Tree not found") ; } else { - branch->SetAddress(&sdigits) ; + branch->SetAddress(&fSDigitsArray) ; branch->GetEntry(0) ; - MakeSDigits(sdigits) ; + MakeSDigits() ; } }