From e62fe47838b583f5ae705c5bb8dd26ae7d3a3f87 Mon Sep 17 00:00:00 2001 From: masera Date: Mon, 30 Nov 2009 01:59:14 +0000 Subject: [PATCH] Access to RecPoints done with AliITSRecPointContainer in QA classes. Update of ESD checking in AliITSQAChecker. Minor updates in AliITSRecPointContainer (M.Masera) --- ITS/AliITSQAChecker.cxx | 52 ++++++++++++++++----------------- ITS/AliITSQADataMakerRec.cxx | 23 ++++++++------- ITS/AliITSQASDDDataMakerRec.cxx | 20 ++++++------- ITS/AliITSQASPDDataMakerRec.cxx | 30 +++++++++---------- ITS/AliITSQASSDDataMakerRec.cxx | 18 ++++++------ ITS/AliITSRecPointContainer.cxx | 9 ++++-- ITS/AliITSRecPointContainer.h | 4 +++ 7 files changed, 81 insertions(+), 75 deletions(-) diff --git a/ITS/AliITSQAChecker.cxx b/ITS/AliITSQAChecker.cxx index f8cfad6d389..8ce82429b91 100644 --- a/ITS/AliITSQAChecker.cxx +++ b/ITS/AliITSQAChecker.cxx @@ -99,9 +99,8 @@ Double_t * AliITSQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, A { - // Super-basic check on the QA histograms on the input list: - // look whether they are empty! - //for the ITS subdetectorQA (Raws Digits Hits RecPoints SDigits) return the worst (= lowest) value of the three result + // basic checks on the QA histograms on the input list + //for the ITS subdetectorQA (Raws Digits Hits RecPoints SDigits) return the worst value of the three result if(index == AliQAv1::kESD){ Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; @@ -160,7 +159,7 @@ Double_t * AliITSQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, A if(skipped[k-1]) continue; if(hdata->GetBinContent(k)<0.5*(entries/6.)){ cluMapSA = kFALSE; - AliDebug(AliQAv1::GetQADebugLevel(), Form("SA tracks have few points on layer %d - look at histogram hESDClustersSA",k)); + AliDebug(AliQAv1::GetQADebugLevel(),Form("SA tracks have few points on layer %d - look at histogram hESDClustersSA",k)); } } } @@ -175,7 +174,7 @@ Double_t * AliITSQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, A if(skipped[k-1]) continue; if(hdata->GetBinContent(k)<0.5*(entries/6.)){ cluMapMI = kFALSE; - AliDebug(AliQAv1::GetQADebugLevel(), Form("MI tracks have few points on layer %d - look at histogram hESDClustersMI",k)); + AliDebug(AliQAv1::GetQADebugLevel(),Form("MI tracks have few points on layer %d - look at histogram hESDClustersMI",k)); } } } @@ -188,7 +187,7 @@ Double_t * AliITSQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, A for(Int_t k=2; k<7-nskipped; k++){ if(hdata->GetBinContent(k)>maxlaytracks){ cluMI = kFALSE; - AliDebug(AliQAv1::GetQADebugLevel(), Form("MI Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersMI",k-1,6-nskipped)); + AliDebug(AliQAv1::GetQADebugLevel(),Form("MI Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersMI",k-1,6-nskipped)); } } } @@ -212,33 +211,32 @@ Double_t * AliITSQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, A verSPDZ = kTRUE; if(hdata->GetMean()<-5. && hdata->GetMean()>5.){ verSPDZ = kFALSE; - AliDebug(AliQAv1::GetQADebugLevel(), Form("Average z vertex coordinate is at z= %10.4g cm",hdata->GetMean())); + AliDebug(AliQAv1::GetQADebugLevel(),Form("Average z vertex coordinate is at z= %10.4g cm",hdata->GetMean())); } } } - else{ AliError("ESD Checker - invalid data type"); } - - rv[specie] = 0.; - if(tested>0){ - if(tested == empty){ - rv[specie] = 0.1; - AliWarning("All ESD histograms are empty"); - } - else { - rv[specie] = 0.1+0.4*(static_cast(tested-empty)/static_cast(tested)); - if(cluMapSA)rv[specie]+=0.1; - if(cluMapMI)rv[specie]+=0.1; - if(cluMI)rv[specie]+=0.1; - if(cluSA)rv[specie]+=0.1; - if(verSPDZ)rv[specie]+=0.1; - } - } - } - } - AliDebug(AliQAv1::GetQADebugLevel(), Form("ESD - Tested %d histograms, Return value %f \n",tested,rv[specie])); + } + rv[specie] = 0.; + if(tested>0){ + if(tested == empty){ + rv[specie] = 2500.; // set to error + AliWarning(Form("All ESD histograms are empty - specie=%d",specie)); + } + else { + rv[specie] = 2500.-1500.*(static_cast(tested-empty)/static_cast(tested)); // INFO if all histos are filled + if(cluMapSA)rv[specie]-=200.; + if(cluMapMI)rv[specie]-=200.; + if(cluMI)rv[specie]-=200.; + if(cluSA)rv[specie]-=200.; + if(verSPDZ)rv[specie]-=199.; // down to 1 if everything is OK + } + } + } + // AliDebug(AliQAv1::GetQADebugLevel(), Form("ESD - Tested %d histograms, Return value %f \n",tested,rv[specie])); + AliInfo(Form("ESD - Tested %d histograms, Return value %f \n",tested,rv[specie])); } return rv ; } // end of ESD QA diff --git a/ITS/AliITSQADataMakerRec.cxx b/ITS/AliITSQADataMakerRec.cxx index ffe46214790..f1445f06444 100644 --- a/ITS/AliITSQADataMakerRec.cxx +++ b/ITS/AliITSQADataMakerRec.cxx @@ -40,6 +40,7 @@ #include "AliQAChecker.h" #include "AliITSQAChecker.h" #include "AliITSRecPoint.h" +#include "AliITSRecPointContainer.h" #include "AliRawReader.h" #include "AliESDEvent.h" #include "AliESDtrack.h" @@ -317,9 +318,9 @@ void AliITSQADataMakerRec::InitRecPoints() //____________________________________________________________________________ void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree) -{ - +{ // Fill QA for recpoints + if(fSubDetector == 0 || fSubDetector == 1) { fSPDDataMaker->MakeRecPoints(clustersTree) ; } @@ -334,22 +335,20 @@ void AliITSQADataMakerRec::MakeRecPoints(TTree * 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 = rpcont->FetchClusters(0,clustersTree); + if(!rpcont->GetStatusOK()){ + AliError("connot 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); @@ -573,7 +572,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; @@ -581,6 +580,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); @@ -620,6 +620,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); diff --git a/ITS/AliITSQASDDDataMakerRec.cxx b/ITS/AliITSQASDDDataMakerRec.cxx index be0b67ffc55..2ec02680415 100644 --- a/ITS/AliITSQASDDDataMakerRec.cxx +++ b/ITS/AliITSQASDDDataMakerRec.cxx @@ -50,6 +50,7 @@ #include "AliITSDetTypeRec.h" #include "AliITSdigit.h" #include "AliITSRecPoint.h" +#include "AliITSRecPointContainer.h" #include "AliITSgeomTGeo.h" #include "AliCDBManager.h" #include "AliCDBStorage.h" @@ -645,15 +646,13 @@ Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree) Int_t lay, lad, det; //AliInfo("get the branch with the ITS clusters !\n"); - TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints"); - if (!branchRecP) { - AliError("can't get the branch with the ITS clusters !"); - return rv ; + AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance(); + TClonesArray *recpoints = rpcont->FetchClusters(0,clustersTree); + if(!rpcont->GetStatusOK() || !rpcont->IsSDDActive()){ + AliError("can't get SDD clusters !"); + return rv; } - static TClonesArray statRecpoints("AliITSRecPoint") ; - TClonesArray *recpoints = &statRecpoints; - branchRecP->SetAddress(&recpoints); Int_t npoints = 0; Float_t cluglo[3]={0.,0.,0.}; if(fkOnline) @@ -663,9 +662,11 @@ Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree) fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset(); } } - for(Int_t module=0; moduleGetEntries();module++){ + Int_t firMod=AliITSgeomTGeo::GetModuleIndex(3,1,1); + Int_t lasMod=AliITSgeomTGeo::GetModuleIndex(5,1,1); + for(Int_t module=firMod; moduleGetEvent(module); + recpoints = rpcont->UncheckedGetClusters(module); npoints += recpoints->GetEntries(); //AliInfo(Form("modnumb %d, npoints %d, total points %d\n",module, recpoints->GetEntries(),npoints)); //AliITSgeomTGeo::GetModuleId(module, lay, lad, det); @@ -709,7 +710,6 @@ Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree) } } } - statRecpoints.Clear(); return rv ; } diff --git a/ITS/AliITSQASPDDataMakerRec.cxx b/ITS/AliITSQASPDDataMakerRec.cxx index 0c162e26517..716da1e6f83 100644 --- a/ITS/AliITSQASPDDataMakerRec.cxx +++ b/ITS/AliITSQASPDDataMakerRec.cxx @@ -41,6 +41,7 @@ #include "AliITSRawStreamSPDErrorLog.h" #include "AliITSdigitSPD.h" #include "AliITSRecPoint.h" +#include "AliITSRecPointContainer.h" ClassImp(AliITSQASPDDataMakerRec) @@ -554,31 +555,29 @@ Int_t AliITSQASPDDataMakerRec::MakeRecPoints(TTree * clusterTree) { // Fill QA for RecPoints - SPD - Int_t rv = 0 ; - static TClonesArray statITSCluster("AliITSRecPoint"); - TClonesArray *ITSCluster = &statITSCluster; - TBranch* itsClusterBranch=clusterTree->GetBranch("ITSRecPoints"); - if (!itsClusterBranch) { - AliError("can't get the branch with the ITS clusters !"); + AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance(); + TClonesArray *recpoints = rpcont->FetchClusters(0,clusterTree); + if(!rpcont->GetStatusOK() || !rpcont->IsSPDActive()){ + AliError("can't get SPD clusters !"); return rv; } - + //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie())); //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])); - itsClusterBranch->SetAddress(&ITSCluster); - Int_t nItsMods = (Int_t)clusterTree->GetEntries(); + Int_t nSPDmod = AliITSgeomTGeo::GetModuleIndex(3,1,1); Float_t cluGlo[3] = {0.,0.,0.}; Int_t nClusters[2] = {0,0}; - for (Int_t iIts=0; iIts < nItsMods; iIts++) { - - if (!clusterTree->GetEvent(iIts)) continue; - Int_t nCluster = ITSCluster->GetEntriesFast(); + for (Int_t iIts=0; iIts < nSPDmod; iIts++) { + recpoints = rpcont->UncheckedGetClusters(iIts); + Int_t nCluster = recpoints->GetEntriesFast(); + if(nCluster == 0)continue; // loop over clusters while(nCluster--) { - AliITSRecPoint* cluster = (AliITSRecPoint*)ITSCluster->UncheckedAt(nCluster); - - if (cluster->GetLayer()>1) continue; + AliITSRecPoint* cluster = + (AliITSRecPoint*)recpoints->UncheckedAt(nCluster); + if (cluster->GetLayer()>1)continue; Int_t lay=cluster->GetLayer(); fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(lay); cluster->GetGlobalXYZ(cluGlo); @@ -623,7 +622,6 @@ Int_t AliITSQASPDDataMakerRec::MakeRecPoints(TTree * clusterTree) fAliITSQADataMakerRec->GetRecPointsData(29 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nClusters[0],nClusters[1]); - statITSCluster.Clear(); return rv ; } diff --git a/ITS/AliITSQASSDDataMakerRec.cxx b/ITS/AliITSQASSDDataMakerRec.cxx index 742af295f3d..b9f20abc2ef 100644 --- a/ITS/AliITSQASSDDataMakerRec.cxx +++ b/ITS/AliITSQASSDDataMakerRec.cxx @@ -42,6 +42,7 @@ #include "AliITSgeomTGeo.h" #include "AliRawEventHeaderBase.h" #include "AliITSRecPoint.h" +#include "AliITSRecPointContainer.h" #include "AliITSdigitSSD.h" #include "AliITSBadChannelsSSDv2.h" @@ -1527,23 +1528,23 @@ Int_t AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree) Int_t rv = 0 ; Int_t gLayer = 0, gLadder = 0, gModule = 0; Int_t lLadderLocationY = 0; - TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints"); - if (!branchRecP) { - AliError("can't get the branch with the ITS clusters !"); + AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance(); + TClonesArray *recpoints = rpcont->FetchClusters(0,clustersTree); + if(!rpcont->GetStatusOK() || !rpcont->IsSSDActive()){ + AliError("can't get SSD clusters !"); return rv; } //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie())); //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])); - static TClonesArray statRecpoints("AliITSRecPoint"); - TClonesArray *recpoints = &statRecpoints; - branchRecP->SetAddress(&recpoints); Int_t nClustersLayer5 = 0, nClustersLayer6 = 0; Int_t npoints = 0; Float_t cluglo[3]={0.,0.,0.}; //printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints STEP1 \n"); - for(Int_t module = 0; module < clustersTree->GetEntries(); module++){ - branchRecP->GetEvent(module); + Int_t firMod = AliITSgeomTGeo::GetModuleIndex(5,1,1); + Int_t lasMod = AliITSgeomTGeo::GetNModules(); + for(Int_t module = firMod; module < lasMod; module++){ + recpoints = rpcont->UncheckedGetClusters(module); npoints += recpoints->GetEntries(); AliITSgeomTGeo::GetModuleId(module,gLayer,gLadder,gModule); //printf("SSDDataMAkerRec:::::::::::::::::::::::gLayer ========== %d \n\n",gLayer); @@ -1617,7 +1618,6 @@ Int_t AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree) fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 2)->Fill(nClustersLayer5); fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 3)->Fill(nClustersLayer6); - statRecpoints.Clear(); return rv ; } diff --git a/ITS/AliITSRecPointContainer.cxx b/ITS/AliITSRecPointContainer.cxx index e05832c473d..bc77c748dea 100644 --- a/ITS/AliITSRecPointContainer.cxx +++ b/ITS/AliITSRecPointContainer.cxx @@ -28,7 +28,8 @@ fSSDNModules(0), fArray(), fCurrentEve(-1000), fActualSize(0), -fDet(""){ +fDet(""), +fStatusOK(kTRUE){ // Default constructor if(fgkNModules != AliITSgeomTGeo::GetNModules())AliError(Form("The total number of modules is not %d, but %d",fgkNModules,AliITSgeomTGeo::GetNModules())); @@ -89,7 +90,10 @@ void AliITSRecPointContainer::CookEntries(){ if(fActualSize == (fSPDNModules+fSSDNModules))fDet = "SPD SSD "; if(fActualSize == (fSDDNModules+fSSDNModules))fDet = "SDD SSD "; if((!fDet.Contains("SPD")) && (!fDet.Contains("SDD")) && - (!fDet.Contains("SSD")))AliError(Form("The number of active modules %d does not correspond to any standard configuration of the detector",fActualSize)); + (!fDet.Contains("SSD"))){ + AliError(Form("The number of active modules %d does not correspond to any standard configuration of the detector",fActualSize)); + fStatusOK = kFALSE; + } } //______________________________________________________________________ TClonesArray* AliITSRecPointContainer::FetchClusters(Int_t mod, TTree* tR){ @@ -102,6 +106,7 @@ TClonesArray* AliITSRecPointContainer::FetchClusters(Int_t mod, TTree* tR){ branch = tR->GetBranch("ITSRecPoints"); if(!branch){ AliError("Branch ITSRecPoints not found on ITS recpoints TTree"); + fStatusOK = kFALSE; return NULL; } diff --git a/ITS/AliITSRecPointContainer.h b/ITS/AliITSRecPointContainer.h index 1face828ca0..5123905a4c7 100644 --- a/ITS/AliITSRecPointContainer.h +++ b/ITS/AliITSRecPointContainer.h @@ -24,6 +24,8 @@ class AliITSRecPointContainer : public TObject { Bool_t IsSDDActive() const {return fDet.Contains("SDD");} Bool_t IsSSDActive() const {return fDet.Contains("SSD");} Bool_t IsITSComplete() const {return fDet.Contains("ALL");} + Bool_t GetStatusOK() const {return fStatusOK;} + Int_t GetNumberOfModules() const {return fActualSize; } static AliITSRecPointContainer* Instance(const AliITSRecoParam *ptr=NULL); TClonesArray* FetchClusters(Int_t mod, TTree* tR); @@ -49,6 +51,8 @@ class AliITSRecPointContainer : public TObject { Int_t fCurrentEve; //!run number Int_t fActualSize; //! actual number of ITS modules in TTree R TString fDet; //! ITS subdetectors active for the current run + Bool_t fStatusOK; //! kFALSE is RP branch is absent or if there are anomalies + //! in the number of active modules ClassDef(AliITSRecPointContainer,0) }; -- 2.43.0