]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSQADataMakerRec.cxx
Bug fix. Savannah bug number 59616
[u/mrichter/AliRoot.git] / ITS / AliITSQADataMakerRec.cxx
index ff08f7f85a1514998e7d557fbdfc7ef12b414bc4..3db65f9f454228660daf0c60a0577794c4e8fcf6 100644 (file)
@@ -22,6 +22,8 @@
 //  -------------------------------------------------------------
 //  W. Ferrarese + P. Cerello Feb 2008
 //  INFN Torino
+//  Melinda Siciliano Aug 2008
+
 
 // --- ROOT system ---
 #include <TH2.h>
@@ -53,9 +55,11 @@ AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kITS), "ITS Quality Assurance Dat
 fkOnline(kMode),
 fSubDetector(subDet),
 fLDC(ldc),
+fRunNumber(0),
 fSPDDataMaker(NULL),
 fSDDDataMaker(NULL),
 fSSDDataMaker(NULL)
+
 {
   //ctor used to discriminate OnLine-Offline analysis
   if(fSubDetector < 0 || fSubDetector > 3) {
@@ -91,9 +95,11 @@ AliQADataMakerRec(),
 fkOnline(qadm.fkOnline),
 fSubDetector(qadm.fSubDetector),
 fLDC(qadm.fLDC),
+fRunNumber(0),
 fSPDDataMaker(NULL),
 fSDDDataMaker(NULL),
 fSSDDataMaker(NULL)
+
 {
   //copy ctor 
   SetName((const char*)qadm.GetName()) ; 
@@ -125,11 +131,13 @@ void AliITSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr
   // launch the QA checking
 
   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
-    SetEventSpecie(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[specie]);
-    if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list[specie]);
-    if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list[specie]);
+    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();
@@ -146,8 +154,10 @@ void AliITSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr
        qacb->SetDetTaskOffset(subdet,offset);
       }
 
-    qac->Run( AliQAv1::kITS , task, list); 
-
+    qac->Run( AliQAv1::kITS , task, list);
+    }
+    
   }
 }
 
@@ -188,6 +198,7 @@ void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   // Fill QA for RAW   
   //return ; 
 
+  SetRunNumber(rawReader->GetRunNumber());
 
   if(fSubDetector == 0 || fSubDetector == 1)  {
     fSPDDataMaker->MakeRaws(rawReader) ; 
@@ -266,23 +277,27 @@ void AliITSQADataMakerRec::InitRecPoints()
                fSSDDataMaker->InitRecPoints();
        }
 
-       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];
-       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]->GetXaxis()->SetTitle("Pseudorapidity");
-               hPhiEta[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
-               Add2RecPointsList((new TH2F(*hPhiEta[iLay])), iLay + offset, !expert, image);
-
-               delete hPhiEta[iLay];
-       }
 
+       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];
+         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]->GetXaxis()->SetTitle("Pseudorapidity");
+           hPhiEta[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
+           Add2RecPointsList((new TH2F(*hPhiEta[iLay])), iLay + offset, !expert, image);
+           
+           delete hPhiEta[iLay];
+         }
+         
+       }
+       
 }
 
 //____________________________________________________________________________ 
@@ -302,41 +317,43 @@ void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
 
 
 
-
-       // 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 !");
-               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++){
-               branchRecP->GetEvent(module);
-               AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
-               for(Int_t j=0;j<recpoints->GetEntries();j++){
-                       AliITSRecPoint *rcp = (AliITSRecPoint*)recpoints->At(j);    
-                       //Check id histograms already created for this Event Specie
-                       rcp->GetGlobalXYZ(cluGlo);
-                       Double_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]+cluGlo[2]*cluGlo[2]);
-                       Double_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
-                       Double_t theta = TMath::ACos(cluGlo[2]/rad);
-                       Double_t eta = 100.;
-                       if(AreEqual(rad,0.) == kFALSE) {
-                         if(theta<=1.e-14){ eta=30.; }
-                         else { eta = -TMath::Log(TMath::Tan(theta/2.));}
-                       }
-                       (GetRecPointsData( rcp->GetLayer() + offset - 6))->Fill(eta,phi);
-               }
+  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 !");
+      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++){
+      //  AliInfo(Form("Module %d\n",module));
+      branchRecP->GetEvent(module);
+      AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
+      for(Int_t j=0;j<recpoints->GetEntries();j++){
+       AliITSRecPoint *rcp = (AliITSRecPoint*)recpoints->At(j);    
+       //Check id histograms already created for this Event Specie
+       rcp->GetGlobalXYZ(cluGlo);
+       Double_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]+cluGlo[2]*cluGlo[2]);
+       Double_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
+       Double_t theta = TMath::ACos(cluGlo[2]/rad);
+       Double_t eta = 100.;
+       if(AreEqual(rad,0.) == kFALSE) {
+         if(theta<=1.e-14){ eta=30.; }
+         else { eta = -TMath::Log(TMath::Tan(theta/2.));}
        }
-
-
+       //      printf("=========================>hlt   rcp->GetLayer() = %d \n",rcp->GetLayer());
+       (GetRecPointsData( rcp->GetLayer() + offset - 6))->Fill(eta,phi);
+      }
+    }
+  }
+  
 }
 
 //____________________________________________________________________________