]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ACORDE/AliACORDEQADataMakerSim.cxx
Now the non standard branch is correctly set when using single jet finder from AOD
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEQADataMakerSim.cxx
index 38776b358e20aa44dded8e9323e2dd0f8ad6bb43..244d54e3e35bc3b2afb8c77daaaab4b73197f693 100755 (executable)
@@ -27,6 +27,8 @@
 //
 //  Created: June 13th 2008
 //---
+// Last Update: Aug. 27th 2008 ---> Implementation to declare QA expert histogram 
+
 
 // --- ROOT system ---
 #include <TClonesArray.h>
@@ -47,7 +49,7 @@
 ClassImp(AliACORDEQADataMakerSim)
            
 //____________________________________________________________________________ 
-AliACORDEQADataMakerSim::AliACORDEQADataMakerSim():AliQADataMakerSim(AliQA::GetDetName(AliQA::kACORDE), "ACORDE Quality Assurance Data Maker")
+AliACORDEQADataMakerSim::AliACORDEQADataMakerSim():AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kACORDE), "ACORDE Quality Assurance Data Maker")
 {
 }
 //____________________________________________________________________________ 
@@ -66,47 +68,47 @@ AliACORDEQADataMakerSim& AliACORDEQADataMakerSim::operator = (const AliACORDEQAD
   return *this;
 }
 //____________________________________________________________________________
-void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
+void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
 {
   //Detector specific actions at end of cycle
   // do the QA checking
-   printf("ACORDE---->Detector specific actions at END of cycle\n................\n");
+  AliDebug(AliQAv1::GetQADebugLevel(), "ACORDE---->Detector specific actions at END of cycle\n................\n");
 
-  AliQAChecker::Instance()->Run(AliQA::kACORDE, task, list) ;
+  AliQAChecker::Instance()->Run(AliQAv1::kACORDE, task, list) ;
 }
 //____________________________________________________________________________
 void AliACORDEQADataMakerSim::StartOfDetectorCycle()
 {
   //Detector specific actions at start of cycle
-  printf("ACORDE---->Detector specific actions at START of cycle\n................\n");
+  AliDebug(AliQAv1::GetQADebugLevel(), "ACORDE---->Detector specific actions at START of cycle\n................\n");
 }
 //____________________________________________________________________________ 
 void AliACORDEQADataMakerSim::InitHits()
 {
   // create Hits histograms in Hits subdir
-        TH1F *fAHitsACORDE[8];
-
-        fAHitsACORDE[0] = new TH1F("hACORDEloss" ,"Energy Loss ",1000,0.,1500.);
-        fAHitsACORDE[1] = new TH1F("hACORDEPolar" ," Polar Angle ",90,0.,90.);
-        fAHitsACORDE[2] = new TH1F("hACORDEAzimuth" ,"Azimuth Angle  ",360,-180.,180.);
-        fAHitsACORDE[3] = new TH1F("hACORDEPx" ,"Px Distribution ",60,-30.,30.);
-        fAHitsACORDE[4] = new TH1F("hACORDEPy" ,"Py Distribution ",60,-30.,30.);
-        fAHitsACORDE[5] = new TH1F("hACORDEPz" ,"Pz Distribution ",60,-30.,30.);
-        fAHitsACORDE[6] = new TH1F("hACORDEPt" ,"Pt Distribution ",60,0.,50.);
-        fAHitsACORDE[7] = new TH1F("hACORDEpxpz" ,"Pt Distribution ",100,-50.,50.);
-
-        TH2F *hACORDExy = new TH2F("hACORDExy" ,"Dist. xy",2800,-2400.,1400.,200,-4805.,4825.);
-        TH2F *hACORDExz = new TH2F("hACORDExz" ,"Dist.xz ",900,-1500.,2850.,1200,-1000.,4000.);
-        TH2F *hACORDEyz = new TH2F("hACORDEyz" ,"Dist.yz ",5,817.,819.,1200,-600.,600.);
-        TH2F *hACORDEAzimPol =  new TH2F("hACORDEAzimPol" ,"Azimuth vs Polar ",360,-180.,180.,180,0.,180.);
-
-        for(Int_t i=0; i<8; i++)
-          Add2HitsList(fAHitsACORDE[i],i);
-         Add2HitsList(hACORDExy,8);
-        Add2HitsList(hACORDExz,9);
-        Add2HitsList(hACORDEyz,10);
-        Add2HitsList(hACORDEAzimPol,11);
+       
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1F * fHitsACORDE;  
+
+       fHitsACORDE = new TH1F("ACORDEBitPatternfromHits","Distribution of ACORDE fired modules from HITS",60,1,60);
+       Add2HitsList(fHitsACORDE,0,!expert,image);
+
+       char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",
+                        "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",
+                        "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",
+                        "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",
+                        "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",
+                        "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};
+
+
+       fHitsACORDE->SetXTitle("Modules");
+        fHitsACORDE->SetYTitle("Counts");
+        for (Int_t i=0;i<60;i++)
+        {
+                fHitsACORDE->GetXaxis()->SetBinLabel(i+1,acoModule[i]);
+        }
 
 
 
@@ -116,11 +118,27 @@ void AliACORDEQADataMakerSim::InitDigits()
 {
   // create Digits histograms in Digits subdir
 
-   TH1F *    fhDigitsModule;
-   TString   modulename;
-   modulename = "hDigitsModule";
-   fhDigitsModule = new TH1F(modulename.Data(),"hDigitsModuleSingle",60,0,60);
-   Add2DigitsList( fhDigitsModule,0);
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1F *    fhDigitsModule;
+  fhDigitsModule = new TH1F("ACORDEBitPatternfromDigits","Distribution of ACORDE fired modules from DIGITS",60,1,60);
+  Add2DigitsList(fhDigitsModule,0,!expert,image);
+  char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",
+                        "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",
+                        "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",
+                        "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",
+                        "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",
+                        "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};
+
+
+       fhDigitsModule->SetXTitle("Modules");
+        fhDigitsModule->SetYTitle("Counts");
+        for (Int_t i=0;i<60;i++)
+        {
+                fhDigitsModule->GetXaxis()->SetBinLabel(i+1,acoModule[i]);
+        }
+
 
 }
 //____________________________________________________________________________
@@ -129,96 +147,58 @@ void AliACORDEQADataMakerSim::MakeHits(TTree *hitTree)
 {
   // Here we fill the QA histos for Hits declared above
 
-        printf("Estamos en make Hits");
-        TClonesArray * hits = new TClonesArray("AliACORDEhit",1000);
-        TBranch * branch = hitTree->GetBranch("ACORDE");
-        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++)
-                {
-                        branch->GetEntry(track);
-                        Int_t nhits = hits->GetEntriesFast();
-                        for(Int_t ihit=0;ihit<nhits;ihit++)
-                        {
-                                AliACORDEhit *AcoHit = (AliACORDEhit*) hits->UncheckedAt(ihit);
-                                if (!AcoHit)
-                                {
-                                        AliError("The unchecked hit doesn't exist");
-                                        break;
-                                }
-                                GetHitsData(0)->Fill(AcoHit->Eloss());
-                                GetHitsData(1)->Fill(AcoHit->PolarAngle());
-                                GetHitsData(2)->Fill(AcoHit->AzimuthAngle());
-                                GetHitsData(3)->Fill(AcoHit->Px());
-                                GetHitsData(4)->Fill(AcoHit->Py());
-                                GetHitsData(5)->Fill(AcoHit->Pz());
-                                GetHitsData(6)->Fill(TMath::Sqrt( (AcoHit->Px())*(AcoHit->Px())+
-                                             (AcoHit->Py())*(AcoHit->Py())));
-                               if((AcoHit->Py()) != 0.0 ) GetHitsData(7)->Fill(TMath::ATan(AcoHit->Px()/AcoHit->Py()));
-                               GetHitsData(8)->Fill( (Float_t)(AcoHit->X()),(Float_t)(AcoHit->Y()) );
-                               GetHitsData(9)->Fill( (Float_t)(AcoHit->X()),(Float_t)(AcoHit->Z()) );
-                               GetHitsData(10)->Fill( (Float_t)(AcoHit->Y()),(Float_t)(AcoHit->Z()) );
-                               GetHitsData(11)->Fill( (Float_t)(AcoHit->AzimuthAngle()),
-                                (Float_t)(AcoHit->PolarAngle()));
-                        }
-                }
-        }
+       if (fHitsArray) 
+       fHitsArray->Clear() ; 
+       else
+       fHitsArray = new TClonesArray("AliACORDEhit",1000);
+       TBranch * branch = hitTree->GetBranch("ACORDE");
+       if (!branch) 
+       {
+               AliWarning("ACORDE branch in Hit Tree not found");
+       } else 
+       {
+               branch->SetAddress(&fHitsArray);
+               for(Int_t track = 0 ; track < branch->GetEntries() ; track++) 
+               {
+                       branch->GetEntry(track);
+                       for(Int_t ihit=0 ; ihit < fHitsArray->GetEntriesFast() ; ihit++) 
+                       {
+                               AliACORDEhit *AcoHit = (AliACORDEhit*) fHitsArray->UncheckedAt(ihit);
+                               if(!AcoHit) 
+                               {
+                                       AliError("The unchecked hit doesn't exist");
+                                       continue ;
+                               }
+                               GetHitsData(0)->Fill(AcoHit->GetModule());
+                       }                       
+               }
+       }
 
 }
 //____________________________________________________________________________
 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);
-                        }
-                }
-
-
+  if (fDigitsArray) 
+    fDigitsArray->Clear() ; 
+  else
+    fDigitsArray = new TClonesArray("AliACORDEdigit",1000);
+  
+  TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
+  if (!branch) {
+    AliWarning("ACORDE branch in Digits Tree not found");
+  } else {
+   branch->SetAddress(&fDigitsArray);
+    for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {
+      branch->GetEntry(track);
+      for(Int_t idigit = 0 ; idigit < fDigitsArray->GetEntriesFast() ; idigit++) {
+        AliACORDEdigit *AcoDigit = (AliACORDEdigit*) fDigitsArray->UncheckedAt(idigit);
+        if (!AcoDigit) {
+          AliError("The unchecked digit doesn't exist");
+          continue ;
         }
-
+        GetDigitsData(0)->Fill(AcoDigit->GetModule());
+      }
+    }
+  }
 }