X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOFQADataMakerRec.cxx;h=ff28dc1d452b227fc6c912e7d43835106c973992;hb=d64b6c791709ae1de828a61628449cb16353cd92;hp=0b2b0c955e71c7177966cfe892785460e9b358b1;hpb=5b4ed716c7369afb50fc61c9cfd50a0ead48fc3a;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOFQADataMakerRec.cxx b/TOF/AliTOFQADataMakerRec.cxx index 0b2b0c955e7..ff28dc1d452 100644 --- a/TOF/AliTOFQADataMakerRec.cxx +++ b/TOF/AliTOFQADataMakerRec.cxx @@ -22,6 +22,17 @@ /////////////////////////////////////////////////////////////////////// /* + Modified by bvonhall on 03/11/2010 + - modified declaration of hTrmChannels035 and hTrmChannels3671 in EndOfDetectorCycle() + to prevent memory corruption + + Modified by adecaro on 18/10/2010 + - fTOFRawStream object set as private member + + Modified by fbellini on 13/09/2010 + - Set TLines as private members + - Set image flag for expert histos + Modified by fbellini on 14/06/2010 - Updated plots - use LoadRawDataBuffersV2() @@ -70,6 +81,7 @@ #include "AliTOFChannelOnlineStatusArray.h" + ClassImp(AliTOFQADataMakerRec) //____________________________________________________________________________ @@ -77,13 +89,25 @@ ClassImp(AliTOFQADataMakerRec) AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kTOF), "TOF Quality Assurance Data Maker"), fCalibData(0x0), fEnableNoiseFiltering(kFALSE), - fEnableDqmShifterOpt(kFALSE), - fProcessedRawEventN(0) + fEnableDqmShifterOpt(kFALSE), + fProcessedRawEventN(0), + fLineExpTimeMin(new TLine(200., 0., 200., 0.)), + fLineExpTimeMax(new TLine(250., 0., 250., 0.)), + fLineExpTotMin(new TLine(5., 0., 5., 0.)), + fLineExpTotMax(new TLine(20., 0., 20., 0.)), + fTOFRawStream(AliTOFRawStream()) { // // ctor // + for (Int_t sm=0;sm<10;sm++){ + fLineSMid035[sm] = new TLine( 40*sm, 0., 40*sm, 0.); + fLineSMid3671[sm] = new TLine( 40*sm+360, 0., 40*sm+360, 0.); + //fLineSMid035[sm]=0x0; + //fLineSMid3671[sm]=0x0; + } + } //____________________________________________________________________________ @@ -92,15 +116,23 @@ AliTOFQADataMakerRec::AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) : fCalibData(qadm.fCalibData), fEnableNoiseFiltering(qadm.fEnableNoiseFiltering), fEnableDqmShifterOpt(qadm.fEnableDqmShifterOpt), - fProcessedRawEventN(qadm.fProcessedRawEventN) + fProcessedRawEventN(qadm.fProcessedRawEventN), + fLineExpTimeMin(qadm.fLineExpTimeMin), + fLineExpTimeMax(qadm.fLineExpTimeMax), + fLineExpTotMin(qadm.fLineExpTotMin), + fLineExpTotMax(qadm.fLineExpTotMax), + fTOFRawStream(qadm.fTOFRawStream) { // //copy ctor // SetName((const char*)qadm.GetName()) ; SetTitle((const char*)qadm.GetTitle()); - - + + for (Int_t sm=0;sm<10;sm++){ + fLineSMid035[sm]=qadm.fLineSMid035[sm]; + fLineSMid3671[sm]=qadm.fLineSMid3671[sm]; + } } //__________________________________________________________________ @@ -114,6 +146,22 @@ AliTOFQADataMakerRec& AliTOFQADataMakerRec::operator = (const AliTOFQADataMakerR return *this; } +//---------------------------------------------------------------------------- +AliTOFQADataMakerRec::~AliTOFQADataMakerRec() +{ + + fTOFRawStream.Clear(); + + delete fLineExpTimeMin; + delete fLineExpTimeMax; + delete fLineExpTotMin; + delete fLineExpTotMax; + for (Int_t sm=0;sm<10;sm++){ + delete fLineSMid035[sm]; + delete fLineSMid3671[sm]; + } + +} //---------------------------------------------------------------------------- AliTOFChannelOnlineStatusArray* AliTOFQADataMakerRec::GetCalibData() const { @@ -215,16 +263,51 @@ void AliTOFQADataMakerRec::InitRaws() h23->Sumw2() ; h24->Sumw2() ; + //add lines for DQM shifter + //fLineExpTimeMin = new TLine(200., 0., 200., 0.); + fLineExpTimeMin->SetLineColor(kGreen); + fLineExpTimeMin->SetLineWidth(2); + + //fLineExpTimeMax = new TLine(250., 0., 250., 0.); + fLineExpTimeMax->SetLineColor(kGreen); + fLineExpTimeMax->SetLineWidth(2); + + //fLineExpTotMin = new TLine( 5., 0., 5., 0.); + fLineExpTotMin->SetLineColor(kGreen); + fLineExpTotMin->SetLineWidth(2); + + //fLineExpTotMax = new TLine(20., 0., 20., 0.); + fLineExpTotMax->SetLineColor(kGreen); + fLineExpTotMax->SetLineWidth(2); + + h5->GetListOfFunctions()->Add(fLineExpTimeMin); + h5->GetListOfFunctions()->Add(fLineExpTimeMax); + h10->GetListOfFunctions()->Add(fLineExpTotMin); + h10->GetListOfFunctions()->Add(fLineExpTotMax); + + for (Int_t sm=0;sm<10;sm++){ + //fLineSMid035[sm] = new TLine( 40*sm, 0., 40*sm, 0.); + fLineSMid035[sm]->SetLineColor(kMagenta); + fLineSMid035[sm]->SetLineWidth(2); + h16->GetListOfFunctions()->Add(fLineSMid035[sm]); + //GetRawsData(16)->GetListOfFunctions()->Add(fLineSMid035[sm]); + //fLineSMid3671[sm] = new TLine( 40*sm+360, 0., 40*sm+360, 0.); + fLineSMid3671[sm]->SetLineColor(kMagenta); + fLineSMid3671[sm]->SetLineWidth(2); + //GetRawsData(17)->GetListOfFunctions()->Add(fLineSMid3671[sm]); + h17->GetListOfFunctions()->Add(fLineSMid3671[sm]); + } + Add2RawsList(h0, 0, !expert, image, !saveCorr) ; - Add2RawsList(h1, 1, expert, !image, !saveCorr) ; - Add2RawsList(h2, 2, expert, !image, !saveCorr) ; - Add2RawsList(h3, 3, expert, !image, !saveCorr) ; - Add2RawsList(h4, 4, expert, !image, !saveCorr) ; + Add2RawsList(h1, 1, expert, !image, !saveCorr) ; + Add2RawsList(h2, 2, expert, !image, !saveCorr) ; + Add2RawsList(h3, 3, expert, !image, !saveCorr) ; + Add2RawsList(h4, 4, expert, !image, !saveCorr) ; Add2RawsList(h5, 5, !expert, image, !saveCorr) ; - Add2RawsList(h6, 6, expert, !image, !saveCorr) ; - Add2RawsList(h7, 7, expert, !image, !saveCorr) ; - Add2RawsList(h8, 8, expert, !image, !saveCorr) ; - Add2RawsList(h9, 9, expert, !image, !saveCorr) ; + Add2RawsList(h6, 6, expert, !image, !saveCorr) ; + Add2RawsList(h7, 7, expert, !image, !saveCorr) ; + Add2RawsList(h8, 8, expert, !image, !saveCorr) ; + Add2RawsList(h9, 9, expert, !image, !saveCorr) ; Add2RawsList(h10, 10, !expert, image, !saveCorr) ; Add2RawsList(h11, 11, expert, !image, !saveCorr) ; Add2RawsList(h12, 12, expert, !image, !saveCorr) ; @@ -320,6 +403,7 @@ void AliTOFQADataMakerRec::InitRecPoints() Add2RecPointsList(h17, 17, expert, !image) ; Add2RecPointsList(h18, 18, expert, !image) ; Add2RecPointsList(h19, 19, expert, !image) ; + } //____________________________________________________________________________ @@ -366,6 +450,7 @@ void AliTOFQADataMakerRec::InitESDs() Add2ESDsList(h8, 8, expert, image) ; Add2ESDsList(h9, 9, !expert, image) ; Add2ESDsList(h10, 10, !expert, image) ; + } @@ -390,16 +475,17 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader) Int_t chIndex=-1; TClonesArray * clonesRawData; - AliTOFRawStream tofInput(rawReader); - + //AliTOFRawStream tofInput(rawReader); + fTOFRawStream.SetRawReader(rawReader); + //uncomment if needed to apply DeltaBC correction - //tofInput.ApplyBCCorrections(kTRUE); + //fTOFRawStream.ApplyBCCorrections(kTRUE); for (Int_t iDDL = 0; iDDL < AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); iDDL++){ rawReader->Reset(); - tofInput.LoadRawDataBuffersV2(iDDL); - clonesRawData = (TClonesArray*)tofInput.GetRawData(); + fTOFRawStream.LoadRawDataBuffersV2(iDDL); + clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData(); for (Int_t iRawData = 0; iRawDataGetEntriesFast(); iRawData++) { AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData); @@ -412,12 +498,12 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader) equipmentID[4]=tofRawDatum->GetTDCchannel(); if (CheckEquipID(equipmentID)){ - tofInput.EquipmentId2VolumeId(iDDL, - tofRawDatum->GetTRM(), - tofRawDatum->GetTRMchain(), - tofRawDatum->GetTDC(), - tofRawDatum->GetTDCchannel(), - volumeID); + fTOFRawStream.EquipmentId2VolumeId(iDDL, + tofRawDatum->GetTRM(), + tofRawDatum->GetTRMchain(), + tofRawDatum->GetTDC(), + tofRawDatum->GetTDCchannel(), + volumeID); if (FilterSpare(equipmentID)) continue; if (FilterLTMData(equipmentID)){ //counts LTM hits if (tofRawDatum->GetTOT()) GetRawsData(15)->Fill(equipmentID[0]); @@ -500,10 +586,12 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader) } // DDL Loop for (Int_t j=0;j<5;j++){ - GetRawsData(j)->Fill(ntof[j]); + GetRawsData(j)->Fill(ntof[j]); } fProcessedRawEventN++; - + + fTOFRawStream.Clear(); + } else { AliDebug(1,Form("Event of type %d found. Skipping non-physics event for QA.\n", rawReader->GetType())); } @@ -699,107 +787,100 @@ void AliTOFQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr { //Detector specific actions at end of cycle // do the QA checking - for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { + + TH1F hTrmChannels035("hTrmchannels035", "Active channels per TRM - crates 0 to 35;TRM index = SMid(crate*10)+TRM(0-9);Active channels", 361, 0., 361.) ; + TH1F hTrmChannels3671("hTrmChannels3671","Active channels per TRM - crates 36 to 71 ;TRM index = SMid(crate*10)+TRM(0-9);Active channels", 361, 360., 721.) ; + + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ; - AliInfo(Form("Processed %i physics raw events",fProcessedRawEventN)); - - if (fCalibData){ - //normalize TRM hits plots to the number of enabled channels from OCDB object - TH1F * hTrmChannels035 = new TH1F("hTrmchannels035", "Active channels per TRM - crates 0 to 35;TRM index = SMid(crate*10)+TRM(0-9);Active channels", 361, 0., 361.) ; - TH1F * hTrmChannels3671 = new TH1F("hTrmChannels3671","Active channels per TRM - crates 36 to 71 ;TRM index = SMid(crate*10)+TRM(0-9);Active channels", 361, 360., 721.) ; - - for (Int_t ch = 0; ch < fCalibData->GetSize(); ch++) { - if (!(fCalibData->GetNoiseStatus(ch)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad) - && (fCalibData->GetHWStatus(ch) == AliTOFChannelOnlineStatusArray::kTOFHWOk)){ - Int_t geoId[5]; - Int_t detId[5]; - AliTOFGeometry::GetVolumeIndices(ch,geoId); - AliTOFRawStream::Geant2EquipmentId(geoId,detId); //detID=(ddl,trm,tdc, chain,channel) - if (detId[0]<36) hTrmChannels035->Fill((detId[1]-3)+detId[0]*10); - else hTrmChannels3671->Fill((detId[1]-3)+detId[0]*10); - } - } - GetRawsData(16)->Divide(hTrmChannels035); - GetRawsData(16)->SetTitle("TRMs average hit number per active channel - crates 0-35"); - GetRawsData(16)->GetYaxis()->SetTitle("hits/active channels"); - GetRawsData(17)->Divide(hTrmChannels3671); - GetRawsData(17)->SetTitle("TRMs average hit number per active channel - crates 36-71"); - GetRawsData(17)->GetYaxis()->SetTitle("hits/active channels"); - } - if (fEnableDqmShifterOpt){ // Help make the raw qa histogram easier to interpret for the DQM shifter - // This is still to be optimized... - if (!GetRawsData(0) || !GetRawsData(5) || !GetRawsData(10) || !GetRawsData(15) || !GetRawsData(16) || !GetRawsData(17)) { printf("No histogram for DQM found - Possible memory corruption ???. Please check\n") ; continue; } + AliInfo(Form("Processed %i physics raw events",fProcessedRawEventN)); - Double_t yTimeMin = GetRawsData(5)->GetMinimum(); - Double_t yTimeMax = GetRawsData(5)->GetMaximum(); - Double_t yTotMin = GetRawsData(10)->GetMinimum(); - Double_t yTotMax = GetRawsData(10)->GetMaximum(); - - TLine* lineExpTimeMin = new TLine(200., yTimeMin, 200., yTimeMax); - lineExpTimeMin->SetLineColor(kGreen); - lineExpTimeMin->SetLineWidth(2); - - TLine* lineExpTimeMax = new TLine(250., yTimeMin, 250., yTimeMax); - lineExpTimeMax->SetLineColor(kGreen); - lineExpTimeMax->SetLineWidth(2); - - TLine* lineExpTotMin = new TLine( 5., yTotMin, 5., yTotMax); - lineExpTotMin->SetLineColor(kGreen); - lineExpTotMin->SetLineWidth(2); - TLine* lineExpTotMax = new TLine(20., yTotMin, 20., yTotMax); - lineExpTotMax->SetLineColor(kGreen); - lineExpTotMax->SetLineWidth(2); - - ((TH1F*)GetRawsData(5))->GetListOfFunctions()->Add(lineExpTimeMin); - ((TH1F*)GetRawsData(5))->GetListOfFunctions()->Add(lineExpTimeMax); - ((TH1F*)GetRawsData(10))->GetListOfFunctions()->Add(lineExpTotMin); - ((TH1F*)GetRawsData(10))->GetListOfFunctions()->Add(lineExpTotMax); - - //make up for all bistos - for(Int_t j=0;j<20;j++){ - if (j<5) { - GetRawsData(j)->SetMarkerColor(kRed); - GetRawsData(j)->SetMarkerStyle(7); - } else { - GetRawsData(j)->SetLineColor(kBlue+1); - GetRawsData(j)->SetLineWidth(1); - GetRawsData(j)->SetMarkerColor(kBlue+1); - } + if (fCalibData){ + //normalize TRM hits plots to the number of enabled channels from OCDB object + //TH1F * hTrmChannels035 = new TH1F("hTrmchannels035", "Active channels per TRM - crates 0 to 35;TRM index = SMid(crate*10)+TRM(0-9);Active channels", 361, 0., 361.) ; + //TH1F * hTrmChannels3671 = new TH1F("hTrmChannels3671","Active channels per TRM - crates 36 to 71 ;TRM index = SMid(crate*10)+TRM(0-9);Active channels", 361, 360., 721.) ; + hTrmChannels035.Clear(); + hTrmChannels3671.Clear(); + for (Int_t ch = 0; ch < fCalibData->GetSize(); ch++) { + if (!(fCalibData->GetNoiseStatus(ch)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad) + && (fCalibData->GetHWStatus(ch) == AliTOFChannelOnlineStatusArray::kTOFHWOk)){ + Int_t geoId[5]; + Int_t detId[5]; + AliTOFGeometry::GetVolumeIndices(ch,geoId); + AliTOFRawStream::Geant2EquipmentId(geoId,detId); //detID=(ddl,trm,tdc, chain,channel) + if (detId[0]<36) hTrmChannels035.Fill((detId[1]-3)+detId[0]*10); + else hTrmChannels3671.Fill((detId[1]-3)+detId[0]*10); + } + } + GetRawsData(16)->Divide(&hTrmChannels035); + GetRawsData(16)->SetTitle("TRMs average hit number per active channel - crates 0-35"); + GetRawsData(16)->GetYaxis()->SetTitle("hits/active channels"); + GetRawsData(17)->Divide(&hTrmChannels3671); + GetRawsData(17)->SetTitle("TRMs average hit number per active channel - crates 36-71"); + GetRawsData(17)->GetYaxis()->SetTitle("hits/active channels"); } - Float_t ySMmax035=GetRawsData(16)->GetMaximum(); - TLine* lineSMid035[10]; - Float_t ySMmax3671=GetRawsData(17)->GetMaximum(); - TLine* lineSMid3671[10]; + //set minima and maxima to allow log scale + Double_t yTimeMax = GetRawsData(5)->GetMaximum(); + Double_t yTotMax = GetRawsData(10)->GetMaximum(); + Double_t yTrmMax = TMath::Max(GetRawsData(16)->GetMaximum(),GetRawsData(17)->GetMaximum()); + // Double_t yLtmMax = GetRawsData(15)->GetMaximum(); + // Double_t yHitMax = GetRawsData(0)->GetMaximum(); + + // GetRawsData(0)->SetMinimum(0.1); + // GetRawsData(5)->SetMinimum(0.1); + // GetRawsData(10)->SetMinimum(0.1); + // GetRawsData(15)->SetMinimum(0.1); + GetRawsData(16)->SetMinimum(0.0001); + GetRawsData(17)->SetMinimum(0.0001); + + // GetRawsData(0)->SetMaximum(yHitMax); + // GetRawsData(5)->SetMaximum(yTimeMax); + // GetRawsData(10)->SetMaximum(yTotMax); + // GetRawsData(15)->SetMaximum(yLtmMax); + GetRawsData(16)->SetMaximum(yTrmMax); + GetRawsData(17)->SetMaximum(yTrmMax); + + fLineExpTimeMin->SetY2(yTimeMax); + fLineExpTimeMax->SetY2(yTimeMax); + fLineExpTotMin->SetY2(yTotMax); + fLineExpTotMax->SetY2(yTotMax); for (Int_t sm=0;sm<10;sm++){ - lineSMid035[sm] = new TLine( 40*sm, 0, 40*sm, ySMmax035); - lineSMid035[sm]->SetLineColor(kMagenta); - lineSMid035[sm]->SetLineWidth(2); - GetRawsData(16)->GetListOfFunctions()->Add(lineSMid035[sm]); - - lineSMid3671[sm] = new TLine( 40*sm+360, 0, 40*sm+360, ySMmax3671); - lineSMid3671[sm]->SetLineColor(kMagenta); - lineSMid3671[sm]->SetLineWidth(2); - GetRawsData(17)->GetListOfFunctions()->Add(lineSMid3671[sm]); + fLineSMid035[sm]->SetY2(yTrmMax); + fLineSMid3671[sm]->SetY2(yTrmMax); + } + + + //make up for all histos + for(Int_t j=0;j<20;j++){ + if (j<5) { + GetRawsData(j)->SetMarkerColor(kRed); + GetRawsData(j)->SetMarkerStyle(7); + } else { + GetRawsData(j)->SetLineColor(kBlue+1); + GetRawsData(j)->SetLineWidth(1); + GetRawsData(j)->SetMarkerColor(kBlue+1); + } } for (Int_t j=15;j<19;j++){ - GetRawsData(j)->SetFillColor(kGray+1); - GetRawsData(j)->SetOption("bar"); + GetRawsData(j)->SetFillColor(kGray+1); + GetRawsData(j)->SetOption("bar"); } } } + AliQAChecker::Instance()->Run(AliQAv1::kTOF, task, list) ; } //____________________________________________________________________________