]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Access to RecPoints done with AliITSRecPointContainer in QA classes. Update of ESD...
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 01:59:14 +0000 (01:59 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 01:59:14 +0000 (01:59 +0000)
ITS/AliITSQAChecker.cxx
ITS/AliITSQADataMakerRec.cxx
ITS/AliITSQASDDDataMakerRec.cxx
ITS/AliITSQASPDDataMakerRec.cxx
ITS/AliITSQASSDDataMakerRec.cxx
ITS/AliITSRecPointContainer.cxx
ITS/AliITSRecPointContainer.h

index f8cfad6d3894164e6d18e0ca206edb6c7a55d894..8ce82429b91aca33d3fb7fd1ecdda552f456c990 100644 (file)
@@ -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<Double_t>(tested-empty)/static_cast<Double_t>(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<Double_t>(tested-empty)/static_cast<Double_t>(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
index ffe46214790fc71b951434536742fe4e5d340d53..f1445f064444442909aea5ee5626d0a2bd9d2a59 100644 (file)
@@ -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; module<clustersTree->GetEntries();module++){
+    for(Int_t module=0; module<rpcont->GetNumberOfModules();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;j<recpoints->GetEntries();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);
 
index be0b67ffc5520fbda233cc5b5e768a77a735845e..2ec02680415bf911db00ea062f2f551a049debfb 100644 (file)
@@ -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; module<clustersTree->GetEntries();module++){
+  Int_t firMod=AliITSgeomTGeo::GetModuleIndex(3,1,1);
+  Int_t lasMod=AliITSgeomTGeo::GetModuleIndex(5,1,1);
+  for(Int_t module=firMod; module<lasMod;module++){
     //AliInfo(Form("Module %d\n",module));
-    branchRecP->GetEvent(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 ; 
 }
 
index 0c162e26517b747a0f0166bf4cdee01bbb4b8bd3..716da1e6f83f8d5eac37a2515c919f5f3763591e 100644 (file)
@@ -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 ;
 }
 
index 742af295f3d10b2dfe71ec7352bb857333211a86..b9f20abc2ef0761c51f135ed3b52465919deaf10 100644 (file)
@@ -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 ; 
 }
 
index e05832c473dd78d7c01d8a9f7331bae324e82b08..bc77c748dea6a9901726e8c83fb74c421c6a2429 100644 (file)
@@ -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;
     }
 
index 1face828ca0999e61bf2c3664ffd5f887dde4d12..5123905a4c7821d58e27923115dc4a65d5d5aded 100644 (file)
@@ -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)
 };