X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=inline;f=FMD%2FAliFMDQADataMakerSim.cxx;h=4e422b4713ffbc90c210cfc613880347137506dd;hb=a99f398f8ebe09570e051713eb16e48245bff106;hp=d34156aa88e98db4e38c483055416e9def6993fb;hpb=c9dd1c4db59e91d9d26466958c3aec725805de6b;p=u%2Fmrichter%2FAliRoot.git diff --git a/FMD/AliFMDQADataMakerSim.cxx b/FMD/AliFMDQADataMakerSim.cxx index d34156aa88e..4e422b4713f 100644 --- a/FMD/AliFMDQADataMakerSim.cxx +++ b/FMD/AliFMDQADataMakerSim.cxx @@ -1,5 +1,5 @@ /************************************************************************** - * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. * + * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * @@ -27,6 +27,7 @@ #include "AliFMDHit.h" #include "AliQAChecker.h" #include "AliFMDParameters.h" +#include "AliFMDSDigit.h" //_____________________________________________________________________ // This is the class that collects the QA data for the FMD during simulation. @@ -40,65 +41,98 @@ //_____________________________________________________________________ ClassImp(AliFMDQADataMakerSim) - +#if 0 +; // This line is for Emacs - do not delete! +#endif //_____________________________________________________________________ -AliFMDQADataMakerSim::AliFMDQADataMakerSim() : -AliQADataMakerSim(AliQA::GetDetName(AliQA::kFMD), - "FMD Quality Assurance Data Maker") +AliFMDQADataMakerSim::AliFMDQADataMakerSim() + : AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kFMD), + "FMD Quality Assurance Data Maker") { // ctor - + } //_____________________________________________________________________ -AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& qadm) : - AliQADataMakerSim() +AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& /*qadm*/) + : AliQADataMakerSim() { //copy ctor + // Parameters: // qadm Object to copy from +} +//_____________________________________________________________________ +AliFMDQADataMakerSim& AliFMDQADataMakerSim::operator = (const AliFMDQADataMakerSim& ) +{ + + return *this; +} +//_____________________________________________________________________ +AliFMDQADataMakerSim::~AliFMDQADataMakerSim() +{ + } //_____________________________________________________________________ -void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list) +void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, + TObjArray ** list) { //Detector specific actions at end of cycle // do the QA checking - AliLog::Message(5,"FMD: end of detector cycle","AliFMDQADataMakerSim","AliFMDQADataMakerSim","AliFMDQADataMakerSim::EndOfDetectorCycle","AliFMDQADataMakerSim.cxx",83); - AliQAChecker::Instance()->Run(AliQA::kFMD, task, list) ; + AliLog::Message(5,"FMD: end of detector cycle", + "AliFMDQADataMakerSim","AliFMDQADataMakerSim", + "AliFMDQADataMakerSim::EndOfDetectorCycle", + "AliFMDQADataMakerSim.cxx",83); + AliQAChecker::Instance()->Run(AliQAv1::kFMD, task, list) ; } +//_____________________________________________________________________ +void AliFMDQADataMakerSim::InitSDigits() +{ + // create SDigits histograms in SDigits subdir + const Bool_t expert = kTRUE ; + const Bool_t image = kTRUE ; + + TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts;ADC counts;Entries",1024,0,1024); + hADCCounts->SetXTitle("ADC counts"); + Add2SDigitsList(hADCCounts, 0, !expert, image); +} //____________________________________________________________________ void AliFMDQADataMakerSim::InitHits() { // create Digits histograms in Digits subdir - TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits","Energy distribution",100,0,3); + const Bool_t expert = kTRUE ; + const Bool_t image = kTRUE ; + + TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits","Energy distribution;Energy [MeV];Counts",100,0,3); hEnergyOfHits->SetXTitle("Edep"); hEnergyOfHits->SetYTitle("Counts"); - Add2HitsList(hEnergyOfHits, 0); + Add2HitsList(hEnergyOfHits, 0, !expert, image); } //_____________________________________________________________________ void AliFMDQADataMakerSim::InitDigits() { // create Digits histograms in Digits subdir - TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",1024,0,1024); - //TH1F* hEnergyOfDigits = new TH1F("hEnergyOfDigits","Energy distribution",100,0,3); - hADCCounts->SetXTitle("ADC counts"); - //hADCCounts->SetYTitle("Counts"); - //hEnergyOfDigits->SetXTitle("Edep/Emip"); - //hEnergyOfDigits->SetYTitle("Counts"); - Add2DigitsList(hADCCounts, 0); - //Add2DigitsList(hEnergyOfDigits, 1); + const Bool_t expert = kTRUE ; + const Bool_t image = kTRUE ; + TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts; ADC counts;Entries",1024,0,1024); + hADCCounts->SetXTitle("ADC counts"); + Add2DigitsList(hADCCounts, 0, !expert, image); } //_____________________________________________________________________ -void AliFMDQADataMakerSim::MakeHits(TClonesArray * hits) +void AliFMDQADataMakerSim::MakeHits() { - TIter next(hits); + // Check id histograms already created for this Event Specie + if ( ! GetHitsData(0) ) + InitHits() ; + + TIter next(fHitsArray); AliFMDHit * hit; while ((hit = static_cast(next()))) GetHitsData(0)->Fill(hit->Edep()/hit->Length()*0.032); @@ -109,32 +143,35 @@ void AliFMDQADataMakerSim::MakeHits(TTree * hitTree) { // make QA data from Hit Tree + if (fHitsArray) + fHitsArray->Clear() ; + else + fHitsArray = new TClonesArray("AliFMDHit", 1000) ; + TBranch * branch = hitTree->GetBranch("FMD") ; if (!branch) { AliWarning("FMD branch in Hit Tree not found") ; return; } - - TClonesArray * tmp = new TClonesArray("AliFMDHit", 10) ; - branch->SetAddress(&tmp) ; + + branch->SetAddress(&fHitsArray) ; for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) { branch->GetEntry(ientry); - MakeHits(tmp); + MakeHits(); //tmp); + fHitsArray->Clear() ; } - tmp->Delete() ; - delete tmp ; } //_____________________________________________________________________ -void AliFMDQADataMakerSim::MakeDigits(TClonesArray * digits) +void AliFMDQADataMakerSim::MakeDigits() { // makes data from Digits - if(!digits) return; - - for(Int_t i = 0 ; i < digits->GetEntries() ; i++) { + if(!fDigitsArray) return; + + for(Int_t i = 0 ; i < fDigitsArray->GetEntriesFast() ; i++) { //Raw ADC counts - AliFMDDigit* digit = static_cast(digits->At(i)); + AliFMDDigit* digit = static_cast(fDigitsArray->At(i)); GetDigitsData(0)->Fill(digit->Counts()); } } @@ -143,16 +180,50 @@ void AliFMDQADataMakerSim::MakeDigits(TClonesArray * digits) void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree) { - TClonesArray * digits = new TClonesArray("AliFMDDigit", 1000) ; + if (fDigitsArray) + fDigitsArray->Clear(); + else + fDigitsArray = new TClonesArray("AliFMDDigit", 1000) ; TBranch * branch = digitTree->GetBranch("FMD") ; if (!branch) { AliWarning("FMD branch in Digit Tree not found") ; return; } - branch->SetAddress(&digits) ; + branch->SetAddress(&fDigitsArray) ; + branch->GetEntry(0) ; + MakeDigits() ; +} + +//_____________________________________________________________________ +void AliFMDQADataMakerSim::MakeSDigits() +{ + // makes data from Digits + if(!fSDigitsArray) return; + + for(Int_t i = 0 ; i < fSDigitsArray->GetEntriesFast() ; i++) { + //Raw ADC counts + AliFMDSDigit* sdigit = static_cast(fSDigitsArray->At(i)); + GetSDigitsData(0)->Fill(sdigit->Counts()); + } +} + +//_____________________________________________________________________ +void AliFMDQADataMakerSim::MakeSDigits(TTree * sdigitTree) +{ + + if (fSDigitsArray) + fSDigitsArray->Clear() ; + else + fSDigitsArray = new TClonesArray("AliFMDSDigit", 1000) ; + TBranch * branch = sdigitTree->GetBranch("FMD") ; + if (!branch) { + AliWarning("FMD branch in SDigit Tree not found") ; + return; + } + branch->SetAddress(&fSDigitsArray) ; branch->GetEntry(0) ; - MakeDigits(digits) ; + MakeSDigits() ; } //_____________________________________________________________________