]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Update of AliACORDEQAChecker and AliACORDEQADataMakerSim(Yves) implementing one secon...
authormrodrigu <mrodrigu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 15 Mar 2009 22:08:42 +0000 (22:08 +0000)
committermrodrigu <mrodrigu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 15 Mar 2009 22:08:42 +0000 (22:08 +0000)
ACORDE/ACORDErecLinkDef.h
ACORDE/AliACORDECalibData.cxx
ACORDE/AliACORDECalibData.h
ACORDE/AliACORDEQAChecker.cxx
ACORDE/AliACORDEQAChecker.h
ACORDE/AliACORDEQADataMakerSim.cxx
ACORDE/AliACORDEReconstructor.cxx
ACORDE/AliACORDEReconstructor.h
ACORDE/libACORDErec.pkg

index 1dbc1215d180b8b58f301cf324bff59840db5d32..91a1b18ffccfed2dd90cb37aeb6efe43e8765b4c 100644 (file)
@@ -10,6 +10,8 @@
  
 #pragma link C++ class  AliACORDEReconstructor+;
 #pragma link C++ class  AliACORDEQADataMakerRec+;
+#pragma link C++ class  AliACORDERecoParam+;
+
  
 #endif
 
index 03228c461551b3c7eaa6e7100748be3bedfde8cd..c3724c5a1825812571465eb9f8492d07e604b342 100644 (file)
@@ -70,8 +70,9 @@ AliACORDECalibData::AliACORDECalibData(const AliACORDECalibData& calibda) :
   // there are 60 modules. Note that number of first module is 1 (one)
   for(int t=0; t<60; t++) 
   {
-  fEfficiencies[t] =calibda.GetEfficiency(t+1);
-  fRates[t] = calibda.GetRate(t+1);
+       fEfficiencies[t] =calibda.GetEfficiency(t+1);
+       fRates[t] = calibda.GetRate(t+1);
+       fModulesActivity[t] = calibda.GetModuleActivity(t+1);
   }
 }
 //_______________________________________________________________
@@ -108,8 +109,9 @@ AliACORDECalibData &AliACORDECalibData::operator =(const AliACORDECalibData& cal
   // there are 60 modules. Note that number of first module is 1 (one)
   for(int t=0; t<60; t++) 
   {
-  fEfficiencies[t] =calibda.GetEfficiency(t+1);
-  fRates[t] = calibda.GetRate(t+1);
+       fEfficiencies[t] =calibda.GetEfficiency(t+1);
+       fRates[t] = calibda.GetRate(t+1);
+       fModulesActivity[t] = calibda.GetModuleActivity(t+1);
   }
   return *this;
 }
@@ -148,3 +150,10 @@ void AliACORDECalibData::SetRates(Float_t* Rt)
    if(Rt) for (int t=0;t<60; t++) fRates[t] = Rt[t];
 else for (int t=0;t<60; t++) fRates[t] = 0.0;
 }
+
+void AliACORDECalibData::SetModulesActivity(Float_t* Mac)
+{
+       if(Mac) for (int t=0;t<60;t++) fModulesActivity[t] = Mac[t];
+       else for (int t=0;t<60;t++) fModulesActivity[t] = 0.0;
+}
+
index 8195c18a7f259fc390275a4daaf720afe02bdc17..21dd2064fb7a710daba776d644278609754fcc4a 100644 (file)
@@ -21,6 +21,8 @@ class AliACORDECalibData: public TNamed {
   Float_t  GetEfficiency(Int_t i) const { return fEfficiencies[i-1];}
   Float_t* GetRates() const {return (float*)fRates;}
   Float_t GetRate(Int_t i) const {return fRates[i-1];}
+  Float_t* GetModulesActivity() const {return (float*)fModulesActivity;}
+  Float_t GetModuleActivity(Int_t i) const {return fModulesActivity[i-1];}
  // TList*  GetHistos()const {return Hist;} 
   void SetRates(Float_t* Rt);
   void SetRate(Float_t rate, Int_t mod){fRates[mod-1]=rate;}
@@ -31,11 +33,14 @@ class AliACORDECalibData: public TNamed {
   void AddHMultiHits(TH1D  *Histo){fMultiHits=(TH1D*)Histo->Clone("MultiHits");}//
   void AddHTMultiHits(TH1D *Histo){fTMultiHits=(TH1D*)Histo->Clone("Total Multi Hits");}
   void Draw(Option_t *option="");
+  void SetModulesActivity(Float_t* Mac);
+  void SetModuleActivity(Float_t mac,Int_t mod){fModulesActivity[mod-1]=mac;}
 
 
  protected:
   Float_t fEfficiencies[60];
   Float_t fRates[60];
+  Float_t fModulesActivity[60];
   TH1D *fHits;
   TH1D *fTHits;
   TH1D *fMultiHits;
index 5c5aef7c82f578c589cef28876d907a8717d9227..bcf5f5d2783596273bde993aaae52a4ab90418e2 100755 (executable)
@@ -36,6 +36,8 @@
 #include "AliQA.h"
 #include "AliQAChecker.h"
 #include "AliACORDEQAChecker.h"
+#include "AliCDBEntry.h"
+#include "AliQAManager.h"
 
 ClassImp(AliACORDEQAChecker)
 
@@ -52,19 +54,33 @@ Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/)
 Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray ** list)
 {
 
-
-// Super-basic check on the QA histograms on the input list: 
-  // look whether they are empty!
+       // We added one check to the ACORDE's QA histograms:
+       // 1.- We check if they are empty
+       // we check for the reference histogram to start the QAChecker. If not QAref object
+       // is found, we check that the number of hits per channel is not so far from
+       // the maximum number of hits.
   Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; 
   Int_t * count   = new Int_t[AliRecoParam::kNSpecies] ; 
+  Double_t * acoTest = new Double_t[AliRecoParam::kNSpecies];
+  Double_t acoHitsNorm = 0;
+ Double_t * acoRefTest = new Double_t[AliRecoParam::kNSpecies];
+
+       // Look at the QAref data for ACORDE
+
+       char * acoOCDBDir = Form("ACORDE/%s/%s",AliQA::GetRefOCDBDirName(),AliQA::GetRefDataDirName());
+       AliCDBEntry *acoQARefDir = AliQAManager::QAManager()->Get(acoOCDBDir);
+
+
   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
     test[specie]    = 0.0 ; 
     count[specie] = 0 ; 
+       acoTest[specie] = 0.0;
   }
   
   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
     if (list[specie]->GetEntries() == 0){  
       test[specie] = 1. ; // nothing to check
+       acoTest[specie] = 1.;
     }
     else {
       TIter next(list[specie]) ; 
@@ -76,6 +92,30 @@ Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray ** li
           AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ; 
           count[specie]++ ; 
           test[specie] += rv ; 
+       
+
+       // here we implement the second version for ACORDEQAChecker
+       // by the moment we only compare that the hits in every ACORDE's channel
+       // are close and > 0 
+       for (Int_t i=0;i<60;i++)
+       {
+               acoHitsNorm =  hdata->GetBinContent(i)/hdata->GetMaximum();
+               if  (acoQARefDir)
+               {
+                       AliWarning("Using the QA Reference data for ACORDE !!!");
+                       test[specie] = CheckAcordeRefHits(list[specie],(TObjArray *)acoQARefDir->GetObject());
+                       if ((test[specie] = 0.86) || (acoHitsNorm>0.50)) 
+                       {
+                               acoRefTest[specie]=0.78;printf("testMario: %f\n",acoRefTest[specie]);
+                       }
+               }else{
+               AliWarning("Using the inner ACORDE QA Checker !!!");
+               if ( (acoHitsNorm>0.40) && (acoHitsNorm<=1) ) acoTest[specie] = 0.75;
+               if ( (acoHitsNorm>0.0020) && (acoHitsNorm<=0.40) ) acoTest[specie] = 0.251;
+               if ( (acoHitsNorm>0.0) && (acoHitsNorm<=0.0020) ) acoTest[specie] = 0.0010;
+               if ( (acoHitsNorm>-1.0) && (acoHitsNorm<=0.0) ) acoTest[specie] = -0.5;
+               }
+       }
         }
         else{
           AliError("Data type cannot be processed") ;
@@ -87,7 +127,9 @@ Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray ** li
           test[specie] = 0.5;  //upper limit value to set kWARNING flag for a task
         }
         else {
-          test[specie] /= count[specie] ;
+       if (acoQARefDir) test[specie] = acoRefTest[specie];
+       else{
+       test[specie] = acoTest[specie];printf("testDyMa: %f\n",test[specie]);}
         }
       }
     }
@@ -95,4 +137,15 @@ Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray ** li
   }
   return test ; 
 }
-
+Double_t AliACORDEQAChecker::CheckAcordeRefHits(TObjArray *AcordeList, TObjArray *AcordeRef) const
+{
+       Double_t acoTest = 0;
+       TIter next(AcordeList);
+       TH1 * histo;
+       
+       while ( (histo = dynamic_cast<TH1 *>(next())) )
+       {
+               if( histo->KolmogorovTest((TH1F *)AcordeRef->At(0))<0.8)  acoTest = 0.86;
+       }       
+       return acoTest;
+}
index 5127820510decf754f5f549f51a6b65c29a7b8ca..5452595c96e1982c9eb73658e72982194f5008a0 100755 (executable)
@@ -32,8 +32,8 @@ public:
 
   virtual Double_t * Check(AliQA::ALITASK_t index) ;
   virtual Double_t * Check(AliQA::ALITASK_t index, TObjArray ** list) ;
-//  Double_t CheckEntries(TObjArray * list) const ;/*--> to be implemented*/
 
+  Double_t CheckAcordeRefHits(TObjArray *AcordeList, TObjArray *AcordeRef) const;
 
 private:
 
index 9c156523275f005be4d8e91b9a79d7cb9c25c5ae..b4afb680fa988c334308265b7a1ef08b368cfffe 100755 (executable)
@@ -111,80 +111,43 @@ void AliACORDEQADataMakerSim::MakeHits(TTree *hitTree)
 
        TClonesArray * hits = new TClonesArray("AliACORDEhit",1000);
        TBranch * branch = hitTree->GetBranch("ACORDE");
-       if (!branch)
-       {
+       if (!branch) {
                AliWarning("ACORDE branch in Hit Tree not found");
-       }else
-       {
-               if (branch)
-               {
-                       branch->SetAddress(&hits);
-               }else
-               {
-                       AliError("Branch ACORDE hit not found");
-                       exit(111);
-               }
-               Int_t ntracks = (Int_t)hitTree->GetEntries();
-               if (ntracks<=0) return;
-               for(Int_t track=0;track<ntracks;track++)
-               {
+       } else {
+    branch->SetAddress(&hits);
+               for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {
                        branch->GetEntry(track);
-                       Int_t nhits = hits->GetEntriesFast();
-                       for(Int_t ihit=1;ihit<=nhits;ihit++)
-                       {
+                       for(Int_t ihit=0 ; ihit < hits->GetEntriesFast() ; ihit++) {
                                AliACORDEhit *AcoHit = (AliACORDEhit*) hits->UncheckedAt(ihit);
-                               if(!AcoHit)
-                               {
+                               if(!AcoHit) {
                                        AliError("The unchecked hit doesn't exist");
-                                       break;
+                                       continue ;
                                }
                                GetHitsData(0)->Fill(AcoHit->GetModule()-1);
-                       }
-               }
-       }
-
+      }
+    }
+  }
 }
 //____________________________________________________________________________
 void AliACORDEQADataMakerSim::MakeDigits( TTree *digitsTree)
 {
   //fills QA histos for Digits
-
-
-        TClonesArray * digits = new TClonesArray("AliACORDEdigit",1000);
-        TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
-        if (!branch)
-        {
-                AliWarning("ACORDE branch in Digits Tree not found");
-        }else
-        {
-                if (branch)
-                {
-                        branch->SetAddress(&digits);
-                }else
-                {
-                        AliError("Branch ACORDE digit not found");
-                        exit(111);
-                }
-                Int_t ntracks = (Int_t)digitsTree->GetEntries();
-                if (ntracks<=0) return;
-                printf("Entries in DigitsTree:%d\n",ntracks);
-                for(Int_t track=0;track<ntracks;track++)
-                {
-                        branch->GetEntry(track);
-                        Int_t ndigits = digits->GetEntriesFast();
-                        for(Int_t idigit=0;idigit<ndigits;idigit++)
-                        {
-                                AliACORDEdigit *AcoDigit = (AliACORDEdigit*) digits->UncheckedAt(idigit);
-                                if (!AcoDigit)
-                                {
-                                        AliError("The unchecked digit doesn't exist");
-                                        break;
-                                }
-                                GetDigitsData(0)->Fill(AcoDigit->GetModule()-1);
-                        }
-                }
-
-
+  TClonesArray * digits = new TClonesArray("AliACORDEdigit",1000);
+  TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
+  if (!branch) {
+    AliWarning("ACORDE branch in Digits Tree not found");
+  } else {
+    branch->SetAddress(&digits);
+    for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {
+      branch->GetEntry(track);
+      for(Int_t idigit = 0 ; idigit < digits->GetEntriesFast() ; idigit++) {
+        AliACORDEdigit *AcoDigit = (AliACORDEdigit*) digits->UncheckedAt(idigit);
+        if (!AcoDigit) {
+          AliError("The unchecked digit doesn't exist");
+          continue ;
         }
-
+        GetDigitsData(0)->Fill(AcoDigit->GetModule()-1);
+      }
+    }
+  }
 }
index 692da258492269959a719c95e80302a8182969f9..fad163368d44de0857e3273dcc4953126ccd7677 100644 (file)
 #include "AliACORDERawStream.h"
 #include "AliESDEvent.h"
 #include "AliACORDEdigit.h"
+#include "AliACORDERecoParam.h"
 
 ClassImp(AliACORDEReconstructor)
 
 AliACORDEReconstructor:: AliACORDEReconstructor():
   AliReconstructor(),
   fESDACORDE(0x0),
+  fAcordeRecoParam(0x0),
   fCalibData(0x0)
 {
   // Default constructor  
   // Get calibration data
 
-  fCalibData = GetCalibData(); 
+  fCalibData = GetCalibData();
+  fAcordeRecoParam = GetRecoParam();
 }
 
-//FALTA IMPLEMENTAR_______________________________________________________________________
+//_______________________________________________________________________
 AliACORDECalibData *AliACORDEReconstructor::GetCalibData() const
 {
-  // TO BE IMPLEMENTED !!
+  return 0x0;
+}
+//____________________________________________________________________________
+AliACORDERecoParam *AliACORDEReconstructor::GetRecoParam() const
+{
   return 0x0;
 }
 //_____________________________________________________________________________
@@ -59,7 +66,6 @@ AliACORDEReconstructor& AliACORDEReconstructor::operator =
 AliACORDEReconstructor::~AliACORDEReconstructor()
 {
 // destructor
-//NECESITAS esta clase
   delete fESDACORDE; 
 }
 
@@ -67,7 +73,6 @@ AliACORDEReconstructor::~AliACORDEReconstructor()
 void AliACORDEReconstructor::Init()
 {
 // initializer
-//NECESITAS esta clase
     fESDACORDE  = new AliESDACORDE;
 }
 
index d2577bb3e44d733fa4b5eb714fdaf32ab259aaa1..154987361573c7cddb20c69146d358f89a674120 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "AliReconstructor.h"
 #include "AliLog.h"
+#include "AliACORDERecoParam.h"
 
 class AliACORDECalibData;
 class AliESDACORDE;
@@ -40,17 +41,21 @@ public:
 
   AliACORDECalibData *GetCalibData() const; 
 
+  AliACORDERecoParam *GetRecoParam() const;
+
+
 protected:
-//NO PODEMOS USARLOS X Q NO EXISTEN
+
   AliESDACORDE*        fESDACORDE;      // ACORDE ESD object  
-  
+  AliACORDERecoParam* fAcordeRecoParam; // Pointer to the ACORDE's RecoParam
+
 private:
   AliACORDEReconstructor(const AliACORDEReconstructor& reconstructor);
   AliACORDEReconstructor& operator = (const AliACORDEReconstructor& reconstructor);
   
   AliACORDECalibData* fCalibData;      //! calibration data
  
-  ClassDef(AliACORDEReconstructor, 0)  // class for the ACORDE reconstruction
+  ClassDef(AliACORDEReconstructor, 1)  // class for the ACORDE reconstruction
 };
 
 #endif
index 3ee2a26a971021ad8f539d5a72a3bcf29b993741..426e7852d598b7a11dece90b9dc730ddfc87fddf 100644 (file)
@@ -1,7 +1,9 @@
 #-*-Mode: Makefile-*-
 
 SRCS = AliACORDEReconstructor.cxx \
-       AliACORDEQADataMakerRec.cxx
+       AliACORDEQADataMakerRec.cxx \
+       AliACORDERecoParam.cxx
+
 HDRS:= $(SRCS:.cxx=.h)
 
 DHDR:=ACORDErecLinkDef.h