X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSQADataMakerRec.cxx;h=c8b6fabe54cfbcb88af600877aa472a73d3f08f8;hb=c0fc8108e5ce86afca140bfe938325bd220705ed;hp=3db65f9f454228660daf0c60a0577794c4e8fcf6;hpb=cc36e145b4328c88d0b451acdac7e2949c968b03;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSQADataMakerRec.cxx b/ITS/AliITSQADataMakerRec.cxx index 3db65f9f454..c8b6fabe54c 100644 --- a/ITS/AliITSQADataMakerRec.cxx +++ b/ITS/AliITSQADataMakerRec.cxx @@ -27,7 +27,6 @@ // --- ROOT system --- #include -#include // --- Standard library --- // --- AliRoot header files --- @@ -35,18 +34,23 @@ #include "AliITSQASPDDataMakerRec.h" #include "AliITSQASDDDataMakerRec.h" #include "AliITSQASSDDataMakerRec.h" -#include "AliLog.h" #include "AliQAv1.h" #include "AliQAChecker.h" #include "AliITSQAChecker.h" #include "AliITSRecPoint.h" +#include "AliITSRecPointContainer.h" #include "AliRawReader.h" #include "AliESDEvent.h" #include "AliESDtrack.h" -#include "AliESDVertex.h" #include "AliMultiplicity.h" #include "AliITSgeomTGeo.h" +//class TH2; +//class TH2F; +class AliESDVertex; +class AliLog; +class TTree; + ClassImp(AliITSQADataMakerRec) //____________________________________________________________________________ @@ -56,6 +60,8 @@ fkOnline(kMode), fSubDetector(subDet), fLDC(ldc), fRunNumber(0), +fEventNumber(0), +fSelectedTaskIndex(AliQAv1::kNULLTASKINDEX), fSPDDataMaker(NULL), fSDDDataMaker(NULL), fSSDDataMaker(NULL) @@ -95,7 +101,9 @@ AliQADataMakerRec(), fkOnline(qadm.fkOnline), fSubDetector(qadm.fSubDetector), fLDC(qadm.fLDC), -fRunNumber(0), +fRunNumber(qadm.fRunNumber), +fEventNumber(qadm.fEventNumber), +fSelectedTaskIndex(qadm.fSelectedTaskIndex), fSPDDataMaker(NULL), fSDDDataMaker(NULL), fSSDDataMaker(NULL) @@ -125,55 +133,74 @@ void AliITSQADataMakerRec::StartOfDetectorCycle() if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->StartOfDetectorCycle(); } +//____________________________________________________________________________ +void AliITSQADataMakerRec::StartOfCycle(AliQAv1::TASKINDEX_t task, Int_t run, const Bool_t sameCycle) +{ + // Start a cycle of QA data acquistion + fSelectedTaskIndex=task; + AliQADataMakerRec::StartOfCycle(task,run,sameCycle); +} + //____________________________________________________________________________ void AliITSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list) { // launch the QA checking + AliInfo(Form("End of Dedetctor Cycle called for %s\n",AliQAv1::GetTaskName(task).Data() )); for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - //SetEventSpecie(specie) ; - //AliQAv1::Instance()->SetEventSpecie(specie); - if(AliQAv1::Instance()->IsEventSpecieSet(specie)){ - AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list[specie])\n"); - if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]); - if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]); - if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]); - - - AliQAChecker *qac = AliQAChecker::Instance(); - AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0); - Int_t subdet=GetSubDet(); - qacb->SetSubDet(subdet); - - if(subdet== 0 ){ - qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task), fSDDDataMaker->GetOffset(task), fSSDDataMaker->GetOffset(task)); //Setting the offset for the QAChecker list - } - else - if(subdet!=0){ - Int_t offset=GetDetTaskOffset(subdet, task); - qacb->SetDetTaskOffset(subdet,offset); - } - qac->Run( AliQAv1::kITS , task, list); - - } - - } + if(AliQAv1::Instance()->IsEventSpecieSet(specie)){ + Int_t idnumber=list[specie]->GetUniqueID(); + //printf("specie %s \t id number == %d\n",AliRecoParam::GetEventSpecieName(specie),idnumber); + if(idnumber==40||idnumber==0){ + //AliInfo(Form("No check for %s\n",AliQAv1::GetTaskName(task).Data() )) + continue; + } //skip kDigitsR and not filled TobjArray specie + else{ + AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list[specie])\n"); + if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]); + if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]); + if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list[/*GetEventSpecie()*/specie]); + + + AliQAChecker *qac = AliQAChecker::Instance(); + AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0); + Int_t subdet=GetSubDet(); + qacb->SetSubDet(subdet); + + if(subdet== 0 ){ + qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task,specie), fSDDDataMaker->GetOffset(task,specie), fSSDDataMaker->GetOffset(task,specie)); //Setting the offset for the QAChecker list + qacb->SetHisto(fSPDDataMaker->GetTaskHisto(task), fSDDDataMaker->GetTaskHisto(task), fSSDDataMaker->GetTaskHisto(task)); + } + else + if(subdet!=0){ + Int_t offset=GetDetTaskOffset(subdet, task,specie); + qacb->SetDetTaskOffset(subdet,offset); + Int_t histo=GetDetTaskHisto(subdet, task); + qacb->SetDetHisto(subdet,histo); + } + + qac->Run( AliQAv1::kITS , task, list); + + }//end else unique id + }//end else event specie + }//end for } //____________________________________________________________________________ -void AliITSQADataMakerRec::EndOfDetectorCycle(const char * /*fgDataName*/) -{ +//void AliITSQADataMakerRec::EndOfDetectorCycle(const char * /*fgDataName*/) +//{ //eventually used for different AliQAChecker::Instance()->Run -} +//} //____________________________________________________________________________ -void AliITSQADataMakerRec::InitRaws() -{ +void AliITSQADataMakerRec::InitRaws() { + // Initialization of RAW data histograms //if(fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()) return; + if(fSubDetector == 0 || fSubDetector == 1) { AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRaws\n"); fSPDDataMaker->InitRaws(); @@ -190,6 +217,8 @@ void AliITSQADataMakerRec::InitRaws() fSSDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); fSSDDataMaker->InitRaws(); } + fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(10); + } //____________________________________________________________________________ @@ -215,10 +244,10 @@ void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader) //____________________________________________________________________________ void AliITSQADataMakerRec::InitDigits() { - + // Initialization for DIGITS if(fSubDetector == 0 || fSubDetector == 1) { - AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigitss\n"); + AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigits\n"); fSPDDataMaker->InitDigits(); } @@ -234,6 +263,7 @@ void AliITSQADataMakerRec::InitDigits() fSSDDataMaker->InitDigits(); } + fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(40); } //____________________________________________________________________________ @@ -277,23 +307,19 @@ void AliITSQADataMakerRec::InitRecPoints() fSSDDataMaker->InitRecPoints(); } - + fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(20); if(fSubDetector == 0){ Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries(); const Bool_t expert = kTRUE ; const Bool_t image = kTRUE ; - Char_t name[50]; - Char_t title[50]; - TH2F**hPhiEta = new TH2F*[6]; + TH2F* hPhiEta[6]; for (Int_t iLay=0;iLay<6;iLay++) { - sprintf(name,"Phi_vs_Eta_ITS_Layer%d",iLay+1); - sprintf(title,"Phi vs Eta - ITS Layer %d",iLay+1); - hPhiEta[iLay]=new TH2F(name,title,30,-1.5,1.5,200,0.,2*TMath::Pi()); + hPhiEta[iLay]=new TH2F(Form("Phi_vs_Eta_ITS_Layer%d",iLay+1),Form("Phi_vs_Eta_ITS_Layer%d",iLay+1),30,-1.5,1.5,200,0.,2*TMath::Pi()); hPhiEta[iLay]->GetXaxis()->SetTitle("Pseudorapidity"); hPhiEta[iLay]->GetYaxis()->SetTitle("#varphi [rad]"); - Add2RecPointsList((new TH2F(*hPhiEta[iLay])), iLay + offset, !expert, image); + Add2RecPointsList(hPhiEta[iLay], iLay + offset, !expert, image); - delete hPhiEta[iLay]; + //delete hPhiEta[iLay]; } } @@ -302,9 +328,9 @@ void AliITSQADataMakerRec::InitRecPoints() //____________________________________________________________________________ void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree) -{ - +{ // Fill QA for recpoints + if(fSubDetector == 0 || fSubDetector == 1) { fSPDDataMaker->MakeRecPoints(clustersTree) ; } @@ -316,25 +342,30 @@ void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree) if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRecPoints(clustersTree); - + if(fSubDetector == 0){ + // Check id histograms already created for this Event Specie - TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints"); - if (!branchRecP) { - AliError("can't get the branch with the ITS clusters !"); + AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance(); + TClonesArray *recpoints =NULL; + if(fkOnline){ + rpcont->FetchClusters(0,clustersTree,GetEventNumber()); + } + else{ + rpcont->FetchClusters(0,clustersTree); + } + if(!rpcont->GetStatusOK()){ + AliError("cannot access to ITS recpoints"); return; } - + Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries(); Float_t cluGlo[3] = {0.,0.,0.}; Int_t lay, lad, det; - static TClonesArray statRecpoints("AliITSRecPoint") ; - TClonesArray *recpoints = &statRecpoints; - branchRecP->SetAddress(&recpoints); // Fill QA for recpoints - for(Int_t module=0; moduleGetEntries();module++){ + for(Int_t module=0; moduleGetNumberOfModules();module++){ // AliInfo(Form("Module %d\n",module)); - branchRecP->GetEvent(module); + recpoints = rpcont->UncheckedGetClusters(module); AliITSgeomTGeo::GetModuleId(module, lay, lad, det); for(Int_t j=0;jGetEntries();j++){ AliITSRecPoint *rcp = (AliITSRecPoint*)recpoints->At(j); @@ -546,7 +577,7 @@ void AliITSQADataMakerRec::InitESDs() hESDSkippedLayers->SetMinimum(0); Add2ESDsList(hESDSkippedLayers, 23, expertHistogram); - + fESDsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(30); return; } @@ -558,7 +589,7 @@ void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd) // Check id histograms already created for this Event Specie // if ( ! GetESDsData(0) ) // InitESDs() ; - + const Int_t nESDTracks = esd->GetNumberOfTracks(); Int_t nITSrefit5 = 0; @@ -566,6 +597,7 @@ void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd) Float_t xloc,zloc; // loop on tracks + AliInfo(Form("Filling histograms for ESD. Number of tracks %d",nESDTracks)); for(Int_t i = 0; i < nESDTracks; i++) { AliESDtrack *track = esd->GetTrack(i); @@ -605,6 +637,7 @@ void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd) const AliESDVertex *vtxTrk = esd->GetPrimaryVertexTracks(); Int_t mult = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfTracklets(); + AliInfo(Form("Multiplicity %d ; Number of SPD vert contributors %d",mult,vtxSPD->GetNContributors())); if(mult>0) GetESDsData(7)->Fill((Float_t)(vtxSPD->GetNContributors())/(Float_t)mult); @@ -655,31 +688,31 @@ void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd) } //_________________________________________________________________ -Int_t AliITSQADataMakerRec::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task) +Int_t AliITSQADataMakerRec::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task, Int_t specie) { + //number of booked histos for the QAchecking Raws offset + Int_t offset=0; switch(subdet) { - - Int_t offset; case 1: - offset=fSPDDataMaker->GetOffset(task); - return offset; + offset=fSPDDataMaker->GetOffset(task,specie); + //return offset; break; case 2: - offset=fSDDDataMaker->GetOffset(task); - return offset; + offset=fSDDDataMaker->GetOffset(task,specie); + //return offset; break; case 3: - offset=fSSDDataMaker->GetOffset(task); - return offset; + offset=fSSDDataMaker->GetOffset(task,specie); + //return offset; break; default: AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n"); offset=0; - return offset; + //return offset; break; } - //return offset; + return offset; } //____________________________________________________________________ @@ -690,3 +723,72 @@ Bool_t AliITSQADataMakerRec::AreEqual(Double_t a1,Double_t a2) return TMath::Abs(a1-a2)<=kEpsilon*TMath::Abs(a1); } +//_________________________________________________________________ +Int_t AliITSQADataMakerRec::GetDetTaskHisto(Int_t subdet,AliQAv1::TASKINDEX_t task) +{ + //return the number of histo booked for each the Raws Task + + Int_t histo=0; + switch(subdet) + { + case 1: + histo=fSPDDataMaker->GetTaskHisto(task); + //return histo; + break; + case 2: + histo=fSDDDataMaker->GetTaskHisto(task); + //return histo; + break; + case 3: + histo=fSSDDataMaker->GetTaskHisto(task); + //return histo; + break; + default: + AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n"); + histo=0; + //return histo; + break; + } + //return offset; + return histo; +} + + +//____________________________________________________________________ + +void AliITSQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task) +{ + //reset the detector histograms for a given task + AliQADataMakerRec::ResetDetector(task); + + if(fSubDetector==0||fSubDetector==1)fSPDDataMaker->ResetDetector(task); + + if(fSubDetector==0||fSubDetector==2)fSDDDataMaker->ResetDetector(task); + + if(fSubDetector==0||fSubDetector==3)fSSDDataMaker->ResetDetector(task); + +} + + +//____________________________________________________________________ + +AliITSDDLModuleMapSDD *AliITSQADataMakerRec::GetDDLSDDModuleMap() +{ + //return the SDD module map + if(fSubDetector==2){return fSDDDataMaker->GetDDLSDDModuleMap();} + else {return NULL;} +} + +//____________________________________________________________________ + +Bool_t AliITSQADataMakerRec::ListExists(AliQAv1::TASKINDEX_t task) const +{ + //Check the existence of a list for a given task + Bool_t havethelist=kFALSE; + if( ( task == AliQAv1::kRAWS && fRawsQAList ) || + ( task == AliQAv1::kRECPOINTS && fRecPointsQAList ) || + ( task == AliQAv1::kDIGITSR && fDigitsQAList ) || + ( task == AliQAv1::kESDS && fESDsQAList ) ) havethelist=kTRUE; + return havethelist; + +}